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
8aa6e417c64cd353ac1b1f64daec7ddc86150ff3
2,019
h
C
ea_data_structures/Utilities/TupleUtilities.h
SuganthanBC/cpp_data_structures
d764a42de43c44d9ce4832ed4dce3743bf24f9e2
[ "MIT" ]
4
2021-06-25T15:56:58.000Z
2021-11-28T20:58:54.000Z
ea_data_structures/Utilities/TupleUtilities.h
SuganthanBC/cpp_data_structures
d764a42de43c44d9ce4832ed4dce3743bf24f9e2
[ "MIT" ]
null
null
null
ea_data_structures/Utilities/TupleUtilities.h
SuganthanBC/cpp_data_structures
d764a42de43c44d9ce4832ed4dce3743bf24f9e2
[ "MIT" ]
1
2021-11-13T16:29:27.000Z
2021-11-13T16:29:27.000Z
#include <tuple> namespace EA::Tuples { template <typename Tuple, typename FuncType, std::size_t... I> constexpr FuncType forEachImpl(Tuple&& t, FuncType&& f, std::index_sequence<I...>) { return (void) std::initializer_list<int> { (std::forward<FuncType>(f)(std::get<I>(std::forward<Tuple>(t))), 0)...}, f; } template <typename Tuple, typename FuncType> constexpr FuncType for_each(Tuple&& t, FuncType&& f) { return forEachImpl( std::forward<Tuple>(t), std::forward<FuncType>(f), std::make_index_sequence< std::tuple_size<std::remove_reference_t<Tuple>>::value> {}); } template <typename Container, typename FuncType> constexpr void forEach(Container& container, FuncType&& f) { for_each(container.getMembers(), std::forward<FuncType>(f)); } template <typename... Ts> auto make_pointer_tuple() { return std::tuple {static_cast<Ts*>(nullptr)...}; } template <typename... Args, typename FuncType> void callForAllTypes(FuncType&& func) { (func(static_cast<Args*>(nullptr)), ...); } template <typename... Args, typename T, typename FuncType> void callIfTypeMatching(T& obj, FuncType&& callback) { auto func = [&](auto element) { if (auto* cast = dynamic_cast<decltype(element)>(&obj)) callback(*cast); }; callForAllTypes<Args...>(func); } template <typename... Args> struct Container { template <typename FuncType> constexpr FuncType forEach(FuncType&& f) { return for_each(elements, std::forward<FuncType>(f)); } template <typename T> constexpr auto& get() { return std::get<T>(elements); } template <int index> constexpr auto& get() { return std::get<index>(elements); } std::tuple<Args...> elements; }; } // namespace EA::Tuples namespace MixedTypes { template <class F, class... Args> void forEach(F&& f, Args&&... args) { ((void) f(std::forward<Args>(args)),...); } } // namespace MixedTypes
23.206897
82
0.631996
cec3c7f27627684f916c71f811bc4272a51608ad
12,512
c
C
tencent-cloud-iotsuite-embedded-c/examples/advanced_edition/http/http_rpc_main.c
tencentyun/tencent-cloud-iotsdk-package-for-rtt
61814f2c423d16db5d1bb6899237f51a1ca8bccc
[ "MIT" ]
8
2018-11-02T08:06:55.000Z
2019-06-02T17:19:49.000Z
tencent-cloud-iotsuite-embedded-c/examples/advanced_edition/http/http_rpc_main.c
tencentyun/tencent-cloud-iotsdk-package-for-rtt
61814f2c423d16db5d1bb6899237f51a1ca8bccc
[ "MIT" ]
2
2019-05-03T09:21:25.000Z
2019-05-05T02:22:31.000Z
tencent-cloud-iotsuite-embedded-c/examples/advanced_edition/http/http_rpc_main.c
tencentyun/tencent-cloud-iotsdk-package-for-rtt
61814f2c423d16db5d1bb6899237f51a1ca8bccc
[ "MIT" ]
5
2018-11-13T06:11:19.000Z
2019-09-17T09:06:18.000Z
#include "tc_iot_export.h" #include "tc_iot_device_config.h" #define TC_IOT_PROP_param_bool 0 #define TC_IOT_PROP_param_enum 1 #define TC_IOT_PROP_param_number 2 #define TC_IOT_PROP_param_string 3 typedef struct _tc_iot_shadow_local_data { tc_iot_shadow_bool param_bool; tc_iot_shadow_enum param_enum; tc_iot_shadow_number param_number; char param_string[50+1]; }tc_iot_shadow_local_data; // 数据模板字段,变量名最大长度 #define MAX_TEMPLATE_KEY_LEN 20 // 数据模板字段取值最大长度 #define MAX_VAL_BUFFER_LEN 50 extern void parse_command(tc_iot_device_info * p_device, int argc, char ** argv); tc_iot_shadow_local_data g_local_data = { false, 0, 0, "" }; tc_iot_device_info g_device_info = { /* device info*/ TC_IOT_CONFIG_DEVICE_SECRET, TC_IOT_CONFIG_DEVICE_PRODUCT_ID, TC_IOT_CONFIG_DEVICE_NAME, TC_IOT_CONFIG_DEVICE_CLIENT_ID, TC_IOT_CONFIG_DEVICE_USER_NAME, TC_IOT_CONFIG_DEVICE_PASSWORD, 0, TC_IOT_CONFIG_AUTH_MODE, TC_IOT_CONFIG_REGION, TC_IOT_CONFIG_AUTH_API_URL, }; int _process_desired( const char * doc_start, jsmntok_t * json_token, int tok_count, unsigned char * p_desired_bits, tc_iot_shadow_local_data * p_local_data) { int i; jsmntok_t * key_tok = NULL; jsmntok_t * val_tok = NULL; char val_buf[MAX_VAL_BUFFER_LEN+1]; char key_buf[MAX_TEMPLATE_KEY_LEN+1]; int key_len = 0, val_len = 0; const char * key_start; const char * val_start; if (!doc_start) { TC_IOT_LOG_ERROR("doc_start is null"); return TC_IOT_NULL_POINTER; } if (!json_token) { TC_IOT_LOG_ERROR("json_token is null"); return TC_IOT_NULL_POINTER; } if (!tok_count) { TC_IOT_LOG_ERROR("tok_count is invalid"); return TC_IOT_INVALID_PARAMETER; } memset(val_buf, 0, sizeof(val_buf)); memset(key_buf, 0, sizeof(key_buf)); for (i = 0; i < tok_count/2; i++) { /* 位置 0 是object对象,所以要从位置 1 开始取数据*/ /* 2*i+1 为 key 字段,2*i + 2 为 value 字段*/ key_tok = &(json_token[2*i + 1]); key_start = doc_start + key_tok->start; key_len = key_tok->end - key_tok->start; if (key_len > MAX_TEMPLATE_KEY_LEN) { memcpy(key_buf, key_start, MAX_TEMPLATE_KEY_LEN); key_buf[MAX_TEMPLATE_KEY_LEN] = '\0'; TC_IOT_LOG_ERROR("key=%s... length oversize.", key_buf); continue; } memcpy(key_buf, key_start, key_len); key_buf[key_len] = '\0'; val_tok = &(json_token[2*i + 2]); val_start = doc_start + val_tok->start; val_len = val_tok->end - val_tok->start; if (val_len > TC_IOT_MAX_FIELD_LEN) { memcpy(val_buf, val_start, MAX_VAL_BUFFER_LEN); val_buf[MAX_VAL_BUFFER_LEN] = '\0'; TC_IOT_LOG_ERROR("val=%s... length oversize.", val_buf); continue; } memcpy(val_buf, val_start, val_len); val_buf[val_len] = '\0'; if (strcmp("param_bool", key_buf) == 0 ) { TC_IOT_BIT_SET(p_desired_bits, TC_IOT_PROP_param_bool); TC_IOT_LOG_TRACE("desired field: %s=%s->%s", key_buf, p_local_data->param_bool?"true":"false", val_buf); p_local_data->param_bool = (val_buf[0] != 'f') && (val_buf[0] != '0'); } else if (strcmp("param_enum", key_buf) == 0 ) { TC_IOT_BIT_SET(p_desired_bits, TC_IOT_PROP_param_enum); TC_IOT_LOG_TRACE("desired field: %s=%d->%s", key_buf, p_local_data->param_enum, val_buf); p_local_data->param_enum = atoi(val_buf); } else if (strcmp("param_number", key_buf) == 0 ) { TC_IOT_BIT_SET(p_desired_bits, TC_IOT_PROP_param_number); TC_IOT_LOG_TRACE("desired field: %s=%f->%s", key_buf, p_local_data->param_number, val_buf); p_local_data->param_number = atof(val_buf); } else if (strcmp("param_string", key_buf) == 0 ) { TC_IOT_BIT_SET(p_desired_bits, TC_IOT_PROP_param_string); TC_IOT_LOG_TRACE("desired field: %s=%s->%s", key_buf, p_local_data->param_string, val_buf); strcpy(p_local_data->param_string, val_buf); } else { TC_IOT_LOG_ERROR("unknown desired field: %s=%s", key_buf, val_buf); continue; } } return TC_IOT_SUCCESS; } int check_and_process_desired(unsigned char * p_desired_bits, tc_iot_shadow_local_data * p_local_data, const char * message) { const char * desired_start = NULL; int desired_len = 0; jsmntok_t json_token[TC_IOT_MAX_JSON_TOKEN_COUNT]; int field_index = 0; int ret = 0; int token_count = 0; /* 有效性检查 */ ret = tc_iot_json_parse(message, strlen(message), json_token, TC_IOT_ARRAY_LENGTH(json_token)); if (ret <= 0) { TC_IOT_LOG_ERROR("tc_iot_json_parse ret=%d", ret); return ret; } token_count = ret; tc_iot_mem_usage_log("json_token[TC_IOT_MAX_JSON_TOKEN_COUNT]", sizeof(json_token), sizeof(json_token[0])*token_count); /* 检查 desired 字段是否存在 */ field_index = tc_iot_json_find_token(message, json_token, token_count, "payload.state.desired", NULL, 0); if (field_index <= 0 ) { TC_IOT_LOG_TRACE("payload.state.desired not found, ret=%d", field_index); } else { desired_start = message + json_token[field_index].start; desired_len = json_token[field_index].end - json_token[field_index].start; TC_IOT_LOG_TRACE("payload.state.desired found:%s", tc_iot_log_summary_string(desired_start, desired_len)); /* 根据控制台或者 APP 端的指令,设定设备状态 */ if (desired_start) { ret = tc_iot_json_parse(desired_start, desired_len, json_token, token_count); if (ret <= 0) { return TC_IOT_FAILURE; } _process_desired( desired_start, json_token, ret, p_desired_bits, p_local_data); } } return TC_IOT_SUCCESS; } int do_rpc_get(char * result, int result_len, tc_iot_device_info * p_device_info, bool metadata, bool reported) { int ret = 0; char request[1024]; tc_iot_json_writer writer; tc_iot_json_writer * w = &writer; int timestamp = 0; int nonce = 0; timestamp = tc_iot_hal_timestamp(NULL); tc_iot_hal_srandom(timestamp); tc_iot_json_writer_open(w, request, sizeof(request)); tc_iot_json_writer_string(w ,"method", "get"); tc_iot_json_writer_bool(w ,"metadata", metadata); tc_iot_json_writer_bool(w ,"reported", reported); ret = tc_iot_json_writer_close(w); if (ret <= 0) { TC_IOT_LOG_INFO("encode json failed ,ret=%d", ret); } else { tc_iot_hal_printf("[client->server]:%s\n", request); } nonce = tc_iot_hal_random(); ret = tc_iot_http_mqapi_rpc( result, result_len, TC_IOT_CONFIG_RPC_API_URL, NULL, timestamp, nonce, p_device_info, request); if (ret > 0) { tc_iot_hal_printf("[server->client]:%s\n", result); } else { TC_IOT_LOG_INFO("request failed ,ret=%d", ret); } return ret; } int do_rpc_update(char * result, int result_len, tc_iot_device_info * p_device_info, unsigned char * report_bits, tc_iot_shadow_local_data * p_local_data) { int ret = 0; char request[1024]; tc_iot_json_writer writer; tc_iot_json_writer * w = &writer; int timestamp = 0; int nonce = 0; timestamp = tc_iot_hal_timestamp(NULL); tc_iot_hal_srandom(timestamp); tc_iot_json_writer_open(w, request, sizeof(request)); tc_iot_json_writer_string(w ,"method", "update"); tc_iot_json_writer_object_begin(w ,"state"); tc_iot_json_writer_object_begin(w ,"reported"); if (TC_IOT_BIT_GET(report_bits, TC_IOT_PROP_param_bool)) { tc_iot_json_writer_raw_data(w ,"param_bool", p_local_data->param_bool ? TC_IOT_SHADOW_JSON_TRUE:TC_IOT_SHADOW_JSON_FALSE); } if (TC_IOT_BIT_GET(report_bits, TC_IOT_PROP_param_number)) { tc_iot_json_writer_int(w ,"param_number", p_local_data->param_number); } if (TC_IOT_BIT_GET(report_bits, TC_IOT_PROP_param_enum)) { tc_iot_json_writer_int(w ,"param_enum", p_local_data->param_enum); } if (TC_IOT_BIT_GET(report_bits, TC_IOT_PROP_param_string)) { tc_iot_json_writer_string(w ,"param_string", p_local_data->param_string); } tc_iot_json_writer_object_end(w); tc_iot_json_writer_object_end(w); ret = tc_iot_json_writer_close(w); if (ret <= 0) { TC_IOT_LOG_INFO("encode json failed ,ret=%d", ret); } else { tc_iot_hal_printf("[c->s]:%s\n", request); } nonce = tc_iot_hal_random(); ret = tc_iot_http_mqapi_rpc( result, result_len, TC_IOT_CONFIG_RPC_API_URL, NULL, timestamp, nonce, p_device_info, request); if (ret > 0) { tc_iot_hal_printf("[s->c]:%s\n", result); } else { TC_IOT_LOG_INFO("request failed ,ret=%d", ret); } return ret; } int do_rpc_delete(char * result, int result_len, tc_iot_device_info * p_device_info, unsigned char * desired_bits) { int ret = 0; char request[1024]; tc_iot_json_writer writer; tc_iot_json_writer * w = &writer; int timestamp = 0; int nonce = 0; timestamp = tc_iot_hal_timestamp(NULL); tc_iot_hal_srandom(timestamp); tc_iot_json_writer_open(w, request, sizeof(request)); tc_iot_json_writer_string(w ,"method", "delete"); tc_iot_json_writer_object_begin(w ,"state"); tc_iot_json_writer_object_begin(w ,"desired"); if (TC_IOT_BIT_GET(desired_bits, TC_IOT_PROP_param_bool)) { tc_iot_json_writer_null(w ,"param_bool"); } if (TC_IOT_BIT_GET(desired_bits, TC_IOT_PROP_param_number)) { tc_iot_json_writer_null(w ,"param_number"); } if (TC_IOT_BIT_GET(desired_bits, TC_IOT_PROP_param_enum)) { tc_iot_json_writer_null(w ,"param_enum"); } if (TC_IOT_BIT_GET(desired_bits, TC_IOT_PROP_param_string)) { tc_iot_json_writer_null(w ,"param_string"); } tc_iot_json_writer_object_end(w); tc_iot_json_writer_object_end(w); ret = tc_iot_json_writer_close(w); if (ret <= 0) { TC_IOT_LOG_INFO("encode json failed ,ret=%d", ret); } else { tc_iot_hal_printf("[client->server]:%s\n", request); } nonce = tc_iot_hal_random(); ret = tc_iot_http_mqapi_rpc( result, result_len, TC_IOT_CONFIG_RPC_API_URL, NULL, timestamp, nonce, p_device_info, request); if (ret > 0) { tc_iot_hal_printf("[server->client]:%s\n", result); } else { TC_IOT_LOG_ERROR("request failed ,ret=%d", ret); } return ret; } static void step_log(const char * step_desc, bool begin) { if (begin) { tc_iot_hal_printf("\n-----%s--------%s---------------\n","begin", step_desc); } else { tc_iot_hal_printf("-----%s--------%s---------------\n"," end ", step_desc); } } int main(int argc, char** argv) { char result[1024]; int ret = 0; unsigned char desired_bits[1]; parse_command(&g_device_info, argc, argv); step_log("rpc get: server desired data", true); ret = do_rpc_get(result, sizeof(result), &g_device_info, false, false); if (ret < 0) { return 0; } step_log("rpc get: server desired data", false); memset(desired_bits, 0, sizeof(desired_bits)); check_and_process_desired(desired_bits, &g_local_data, result); if (desired_bits[0]) { step_log("rpc update: report latest device state", true); ret = do_rpc_update(result, sizeof(result), &g_device_info, desired_bits, &g_local_data); if (ret < 0) { return 0; } step_log("rpc update: report latest device state", false); step_log("rpc delete: clear desired data after successfully processed.", true); ret = do_rpc_delete(result, sizeof(result), &g_device_info, desired_bits); if (ret < 0) { return 0; } step_log("rpc delete: clear desired data after successfully processed.", false); step_log("rpc get: fetch latest state", true); ret = do_rpc_get(result, sizeof(result), &g_device_info, false, true); if (ret < 0) { return 0; } step_log("rpc get: fetch latest state", false); tc_iot_hal_printf("\n> control command process finished, check latest report data over console:\n> https://console.cloud.tencent.com/iotsuite/product\n"); } else { tc_iot_hal_printf("\n> no control command, try send control data over console:\n> https://console.cloud.tencent.com/iotsuite/product\n"); } return 0; }
35.646724
162
0.659447
0e03a90b26a0bd0b6c323f9f954bbd0cc9622c75
845
h
C
src/Base/InfoBar.h
roto5296/choreonoid
ffe12df8db71e32aea18833afb80dffc42c373d0
[ "MIT" ]
66
2020-03-11T14:06:01.000Z
2022-03-23T23:18:27.000Z
src/Base/InfoBar.h
roto5296/choreonoid
ffe12df8db71e32aea18833afb80dffc42c373d0
[ "MIT" ]
12
2020-07-23T06:13:11.000Z
2022-01-13T14:25:01.000Z
src/Base/InfoBar.h
roto5296/choreonoid
ffe12df8db71e32aea18833afb80dffc42c373d0
[ "MIT" ]
18
2020-07-17T15:57:54.000Z
2022-03-29T13:18:59.000Z
/** @author Shin'ichiro Nakaoka */ #ifndef CNOID_BASE_INFO_BAR_H #define CNOID_BASE_INFO_BAR_H #include <QStatusBar> #include <QHBoxLayout> #include <string> #include "exportdecl.h" namespace cnoid { class CNOID_EXPORT InfoBar : public QStatusBar { public: static InfoBar* instance(); void notify(const std::string& message); void notify(const char* message); void notify(const QString& message); private: QWidget* indicatorBase; QHBoxLayout* indicatorLayout; QWidget* currentIndicator; QMetaObject::Connection indicatorConnection; std::string plainTextMessage; InfoBar(); ~InfoBar(); void setIndicator(QWidget* indicator); void removeCurrentIndicator(); void onFocusChanged(QWidget* old, QWidget* now); void onIndicatorDestroyed(QObject* obj); }; } #endif
20.119048
52
0.710059
6d7b7dee8e268db0dd93337fbd0a8efcf4a31625
2,553
h
C
src/operators/ai.onnx/BitShift/11/operator__ai_onnx__bitshift__11.h
ChenHuaYou/cONNXr
aa80322ec1f53d87644ba15d5c5663e726824c95
[ "MIT" ]
null
null
null
src/operators/ai.onnx/BitShift/11/operator__ai_onnx__bitshift__11.h
ChenHuaYou/cONNXr
aa80322ec1f53d87644ba15d5c5663e726824c95
[ "MIT" ]
null
null
null
src/operators/ai.onnx/BitShift/11/operator__ai_onnx__bitshift__11.h
ChenHuaYou/cONNXr
aa80322ec1f53d87644ba15d5c5663e726824c95
[ "MIT" ]
null
null
null
//this file was generated by ../../../../../../scripts/onnx_generator/OperatorHeader.py # ifndef OPERATOR_OPERATOR__AI_ONNX__BITSHIFT__11_H # define OPERATOR_OPERATOR__AI_ONNX__BITSHIFT__11_H # include "operators/operator.h" # include "operators/operator_stub.h" # include "operators/operator_info.h" /** * ai.onnx operator 'BitShift' version 11 * * @param[in] ctx Operator context * @return Status code * * Bitwise shift operator performs element-wise operation. For each input element, if the * attribute "direction" is "RIGHT", this operator moves its binary representation toward * the right side so that the input value is effectively decreased. If the attribute "direction" * is "LEFT", bits of binary representation moves toward the left side, which results the * increase of its actual value. The input X is the tensor to be shifted and another input * Y specifies the amounts of shifting. For example, if "direction" is "Right", X is [1, 4], * and S is [1, 1], the corresponding output Z would be [0, 2]. If "direction" is "LEFT" with * X=[1, 2] and S=[1, 2], the corresponding output Y would be [2, 8]. * * Because this operator supports Numpy-style broadcasting, X's and Y's shapes are * not necessarily identical. * This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md). * * Constraint T: * Constrain input and output types to integer tensors. * Allowed Types: tensor_uint16, tensor_uint32, tensor_uint64, tensor_uint8 * Input T X: * First operand, input to be shifted. * Allowed Types: tensor_uint16, tensor_uint32, tensor_uint64, tensor_uint8 * * Input T Y: * Second operand, amounts of shift. * Allowed Types: tensor_uint16, tensor_uint32, tensor_uint64, tensor_uint8 * Output T Z: * Output tensor * Allowed Types: tensor_uint16, tensor_uint32, tensor_uint64, tensor_uint8 * Attribute STRING direction : * Direction of moving bits. It can be either "RIGHT" (for right shift) or * "LEFT" (for left shift). * * @since version 11 * * @see io/onnx/onnx/defs/logical/defs.cc:204 * @see https://github.com/onnx/onnx/blob/master/docs/Operators.md#BitShift */ operator_status prepare_operator__ai_onnx__bitshift__11( Onnx__NodeProto *ctx ); extern operator_info info_operator__ai_onnx__bitshift__11; typedef struct { char* direction; } context_operator__ai_onnx__bitshift__11; operator_status execute_operator__ai_onnx__bitshift__11( Onnx__NodeProto *ctx ); # endif
37.544118
138
0.741089
ed3a8497825b68c97e906a4f23244237c4a23ba1
189
h
C
code.h
rsc-at-umich/radmind
74cd07176c42867ad6e22da3be3ccc9a30d80b53
[ "BSD-4-Clause-UC" ]
null
null
null
code.h
rsc-at-umich/radmind
74cd07176c42867ad6e22da3be3ccc9a30d80b53
[ "BSD-4-Clause-UC" ]
null
null
null
code.h
rsc-at-umich/radmind
74cd07176c42867ad6e22da3be3ccc9a30d80b53
[ "BSD-4-Clause-UC" ]
null
null
null
/* * Copyright (c) 2003 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ const char *encode( const char *line ); const char *decode( const char *line );
23.625
60
0.693122
ef215c2771501f6863ee03ed6e1c3b55286f0e80
5,757
h
C
ibtk/include/ibtk/LIndexSetDataFactory.h
MSV-Project/IBAMR
3cf614c31bb3c94e2620f165ba967cba719c45ea
[ "BSD-3-Clause" ]
2
2017-12-06T06:16:36.000Z
2021-03-13T12:28:08.000Z
ibtk/include/ibtk/LIndexSetDataFactory.h
MSV-Project/IBAMR
3cf614c31bb3c94e2620f165ba967cba719c45ea
[ "BSD-3-Clause" ]
null
null
null
ibtk/include/ibtk/LIndexSetDataFactory.h
MSV-Project/IBAMR
3cf614c31bb3c94e2620f165ba967cba719c45ea
[ "BSD-3-Clause" ]
null
null
null
// Filename: LIndexSetDataFactory.h // Created on 04 Jun 2007 by Boyce Griffith // // Copyright (c) 2002-2013, Boyce Griffith // 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 New York University nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. #ifndef included_LIndexSetDataFactory #define included_LIndexSetDataFactory /////////////////////////////// INCLUDES ///////////////////////////////////// #include <stddef.h> #include "Box.h" #include "IntVector.h" #include "ibtk/LSetDataFactory.h" #include "tbox/Arena.h" #include "tbox/Pointer.h" namespace SAMRAI { namespace hier { template <int DIM> class Patch; template <int DIM> class PatchData; template <int DIM> class PatchDataFactory; } // namespace hier } // namespace SAMRAI /////////////////////////////// CLASS DEFINITION ///////////////////////////// namespace IBTK { /*! * \brief Class LIndexSetPatchDataFactory provides a * SAMRAI::hier::PatchDataFactory class corresponding to patch data of type * LIndexSetData. */ template<class T> class LIndexSetDataFactory : public LSetDataFactory<T> { public: /*! * The default constructor for the LIndexSetDataFactory class. The ghost * cell width argument gives the default width for all data objects created * with this factory. */ LIndexSetDataFactory( const SAMRAI::hier::IntVector<NDIM>& ghosts); /*! * Virtual destructor for the data factory class. */ virtual ~LIndexSetDataFactory(); /*! * Virtual factory function to allocate a concrete data object. The default * information about the object (e.g., ghost cell width) is taken from the * factory. If no memory pool is provided, the allocation routine assumes * some default memory pool. */ SAMRAI::tbox::Pointer<SAMRAI::hier::PatchData<NDIM> > allocate( const SAMRAI::hier::Box<NDIM>& box, SAMRAI::tbox::Pointer<SAMRAI::tbox::Arena> pool=NULL) const; /*! * Virtual factory function to allocate a concrete data object. The default * information about the object (e.g., ghost cell width) is taken from the * factory. If no memory pool is provided, the allocation routine assumes * some default memory pool. */ SAMRAI::tbox::Pointer<SAMRAI::hier::PatchData<NDIM> > allocate( const SAMRAI::hier::Patch<NDIM>& patch, SAMRAI::tbox::Pointer<SAMRAI::tbox::Arena> pool=NULL) const; /*! * Calculate the amount of memory needed to store the data object, including * object data but not dynamically allocated data. */ size_t getSizeOfMemory( const SAMRAI::hier::Box<NDIM>& box) const; /*! * Virtual function to clone the data factory. This will return a new * instantiation of the factory with the same properties (e.g., same type). * The properties of the cloned factory can then be changed without * modifying the original. */ SAMRAI::tbox::Pointer<SAMRAI::hier::PatchDataFactory<NDIM> > cloneFactory( const SAMRAI::hier::IntVector<NDIM>& ghosts); /*! * Return whether it is valid to copy this LIndexSetDataFactory to the * supplied destination patch data factory. It will return true if dst_pdf * is a LIndexSetDataFactory, false otherwise. */ bool validCopyTo( const SAMRAI::tbox::Pointer<SAMRAI::hier::PatchDataFactory<NDIM> >& dst_pdf) const; private: /*! * \brief Default constructor. * * \note This constructor is not implemented and should not be used. */ LIndexSetDataFactory(); /*! * \brief Copy constructor. * * \note This constructor is not implemented and should not be used. * * \param from The value to copy to this object. */ LIndexSetDataFactory( const LIndexSetDataFactory<T>& from); /*! * \brief Assignment operator. * * \note This operator is not implemented and should not be used. * * \param that The value to assign to this object. * * \return A reference to this object. */ LIndexSetDataFactory& operator=( const LIndexSetDataFactory<T>& that); }; }// namespace IBTK ////////////////////////////////////////////////////////////////////////////// #endif //#ifndef included_LIndexSetDataFactory
34.473054
91
0.672746
3528fd471a4a141a0f2b6196f83a8b24634cce83
425
h
C
C++/settings.h
Galaco/BTLRN_XTRM
c55405d5a36a44a8b1e3def555de9ec10027625b
[ "Unlicense" ]
null
null
null
C++/settings.h
Galaco/BTLRN_XTRM
c55405d5a36a44a8b1e3def555de9ec10027625b
[ "Unlicense" ]
null
null
null
C++/settings.h
Galaco/BTLRN_XTRM
c55405d5a36a44a8b1e3def555de9ec10027625b
[ "Unlicense" ]
null
null
null
#ifndef SETTINGS_H #define SETTINGS_H #include <SFML/Graphics.hpp> #include <iostream> #include <string> #include <fstream> class Settings { public: Settings(); bool read(); bool write(); int getWidth(); int getHeight(); int getVolume(); int getAA(); bool getVsync(); ~Settings(); protected: private: int width , height; int volume , antialiasing; bool verticalsync; }; #endif
13.709677
29
0.647059
dc8dd944a8fd4c88c06ff5b97b0a4ef00a9cdd51
819
h
C
aws-cpp-sdk-mediaconvert/include/aws/mediaconvert/model/NoiseFilterPostTemporalSharpening.h
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-mediaconvert/include/aws/mediaconvert/model/NoiseFilterPostTemporalSharpening.h
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-mediaconvert/include/aws/mediaconvert/model/NoiseFilterPostTemporalSharpening.h
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T11:58:03.000Z
2021-11-09T11:58:03.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/mediaconvert/MediaConvert_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace MediaConvert { namespace Model { enum class NoiseFilterPostTemporalSharpening { NOT_SET, DISABLED, ENABLED, AUTO }; namespace NoiseFilterPostTemporalSharpeningMapper { AWS_MEDIACONVERT_API NoiseFilterPostTemporalSharpening GetNoiseFilterPostTemporalSharpeningForName(const Aws::String& name); AWS_MEDIACONVERT_API Aws::String GetNameForNoiseFilterPostTemporalSharpening(NoiseFilterPostTemporalSharpening value); } // namespace NoiseFilterPostTemporalSharpeningMapper } // namespace Model } // namespace MediaConvert } // namespace Aws
24.818182
124
0.799756
983e91a0fdc182fa561763a21185cbf9ecd1741e
985
h
C
System/Library/PrivateFrameworks/iCloudQuotaUI.framework/ICQUpgradeOfferViewController.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
12
2019-06-02T02:42:41.000Z
2021-04-13T07:22:20.000Z
System/Library/PrivateFrameworks/iCloudQuotaUI.framework/ICQUpgradeOfferViewController.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/iCloudQuotaUI.framework/ICQUpgradeOfferViewController.h
lechium/iPhoneOS_12.1.1_Headers
aac688b174273dfcbade13bab104461f463db772
[ "MIT" ]
3
2019-06-11T02:46:10.000Z
2019-12-21T14:58:16.000Z
/* * This header is generated by classdump-dyld 1.0 * on Saturday, June 1, 2019 at 6:52:09 PM Mountain Standard Time * Operating System: Version 12.1.1 (Build 16C5050a) * Image Source: /System/Library/PrivateFrameworks/iCloudQuotaUI.framework/iCloudQuotaUI * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <iCloudQuotaUI/ICQViewController.h> @class _ICQUpgradeOfferPageSpecification; @interface ICQUpgradeOfferViewController : ICQViewController @property (nonatomic,readonly) _ICQUpgradeOfferPageSpecification * upgradeOfferPageSpecification; @property (assign,getter=isCancelEnabled,nonatomic) BOOL cancelEnabled; +(BOOL)supportsPageClassIdentifier:(id)arg1 ; -(void)cancel:(id)arg1 ; -(id)initWithPageSpecification:(id)arg1 ; -(void)setCancelEnabled:(BOOL)arg1 ; -(_ICQUpgradeOfferPageSpecification *)upgradeOfferPageSpecification; -(id)initWithUpgradeOfferPageSpecification:(id)arg1 ; -(BOOL)isCancelEnabled; -(void)loadView; @end
36.481481
98
0.810152
c2c8a5495bc751a495831884a8bb6f74313a918d
4,526
c
C
test/Dss-C/source/testTimeSeriesStruct13.c
HydrologicEngineeringCenter/heclib
dd3111ee2a8d0c80b88d21bd529991f154fec40a
[ "MIT" ]
19
2021-03-09T17:42:30.000Z
2022-03-21T21:46:47.000Z
test/Dss-C/source/testTimeSeriesStruct13.c
HydrologicEngineeringCenter/heclib
dd3111ee2a8d0c80b88d21bd529991f154fec40a
[ "MIT" ]
22
2021-06-17T20:01:28.000Z
2022-03-21T21:33:29.000Z
test/Dss-C/source/testTimeSeriesStruct13.c
HydrologicEngineeringCenter/heclib
dd3111ee2a8d0c80b88d21bd529991f154fec40a
[ "MIT" ]
3
2021-06-16T17:48:30.000Z
2022-01-13T16:44:47.000Z
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "heclib.h" #include "hecdss7.h" #include "zStructTimeSeries.h" #include "hecdssInternal.h" #include "TestDssC.h" // Irregular interval doubles, full int testztsStruct13(long long *ifltab) { zStructTimeSeries *tss1, *tss2; int status; int numb; int zero = 0; double data1[1100], data3[1100]; int times[1100]; int quality1[1100][2], notes1[1100][4]; int quality3[1100][2], notes3[1100][4]; char cnotes1[1100][50]; char cnotes3[1100][50]; char cnotesa[55000], cnotesb[55000]; char cdate[13]; char *cnull=0; int i, j, n, ich, one; int lenQuality, lenNotes ; int maxVals; int jul; int lowerCase; int cnotesLengthTotal; // This function tests features not supported in DSS-6 if (zgetVersion(ifltab) == 6) { return 0; } maxVals = 1010; lowerCase = 1; one = 1; lenQuality = 2; lenNotes = 4; numb = 1100; for (i=0;i<55000; i++) { cnotesa[i] = '@'; cnotesb[i] = '@'; } jul = dateToJulian("21Jan1991"); ich = 66; //ichar('A') cnotesLengthTotal = 0; for (i=0; i<numb; i++) { // Noon times times[i] = (jul + i) * 1440 + 720; data1[i] = (double)i; data3[i] = data1[i]; n = i/25; n = i - (n*25) + 1; if (n == 1) { if (lowerCase == 1) lowerCase = 0; else lowerCase = 1; } for (j=0; j<49; j++) { cnotes1[i][j] = ' '; cnotes3[i][j] = ' '; } if (lowerCase) { for (j=0; j<n; j++) { cnotes1[i][j] = ich+j-1+32; cnotes3[i][j] = ich+j-1+32; cnotesa[cnotesLengthTotal] = ich+j-1+32; cnotesb[cnotesLengthTotal] = ich+j-1+32; cnotesLengthTotal++; } } else { for (j=0; j<n; j++) { cnotes1[i][j] = ich+j-1; cnotes3[i][j] = ich+j-1; cnotesa[cnotesLengthTotal] = ich+j-1; cnotesb[cnotesLengthTotal] = ich+j-1; cnotesLengthTotal++; } } cnotes1[i][n] = '\0'; cnotes3[i][n] = '\0'; cnotesa[cnotesLengthTotal] = '\0'; cnotesb[cnotesLengthTotal] = '\0'; cnotesLengthTotal++; for (j=0;j<2;j++) { quality1[i][j] = (i*100) + j; quality3[i][j] = quality1[i][j]; } for (j=0;j<4;j++) { notes1[i][j] = (i*100) + j; notes3[i][j] = notes1[i][j]; } } tss1 = zstructTsNewIrregDoubles("/Basin/Location/Flow//~1Day/TSS-Doubles-Full/", data1, numb, times, MINUTE_GRANULARITY, cnull, "cfs", "Inst-Val"); tss1->quality = &quality1[0][0]; tss1->qualityElementSize = 2; // Each line of cnotes must be null terminated; you cannot add extra nulls or blanks after each line, as they // would be seen as a new line. tss1->cnotes = cnotesa; tss1->cnotesLengthTotal = cnotesLengthTotal; tss1->precision = 2; //////////////// // Location Data //tss1->locationStruct = zstructLocationNew(0); stringCopy (tss1->locationStruct->timeZoneName, sizeof(tss1->locationStruct->timeZoneName), "PST", 3); tss1->locationStruct->xOrdinate = -100; tss1->locationStruct->yOrdinate = 101; tss1->locationStruct->zOrdinate = 102; tss1->locationStruct->coordinateSystem = 2; tss1->locationStruct->coordinateID = 3; tss1->locationStruct->horizontalUnits = 4; tss1->locationStruct->horizontalDatum=5; tss1->locationStruct->verticalUnits=1; tss1->locationStruct->verticalDatum = 2; tss1->userHeader = (int *)calloc(6,4); tss1->userHeader[0] = 1; tss1->userHeader[1] = 2; tss1->userHeader[2] = 3; tss1->userHeader[3] = 4; tss1->userHeader[4] = 5; tss1->userHeaderNumber = 5; if (getEndian() && (zgetVersion(ifltab) == 7)) { zswitchInts(tss1->userHeader, 6); } //zset7("MLVL", "", 13); status = ztsStore(ifltab, tss1, 0); if (zcheckStatus(ifltab, status, 1, "Fail in testztsStruct13 Loc 1, store status ")) return status; if (getEndian() && (zgetVersion(ifltab) == 7)) { zswitchInts(tss1->userHeader, 6); } jul = dateToJulian("21Jan1991"); jul += numb -1; julianToDate(jul, 4, cdate, 13); tss2 = zstructTsNewTimes("/Basin/Location/Flow//~1Day/TSS-Doubles-Full/", "21Jan1991", "1200", cdate, "1200"); status = ztsRetrieve(ifltab, tss2, -1, 2, 1); if (zcheckStatus(ifltab, status, 1, "Fail in testztsStruct13 Loc 3, retrieve status ")) return status; if (getEndian() && (zgetVersion(ifltab) == 7)) { zswitchInts(tss2->userHeader, 6); } status = zcompareDataSets(ifltab, tss1, tss2, 1, 0, tss1->pathname, "Fail in testztsStruct13, Location 4"); if (status) return status; free(tss1->userHeader); zstructFree(tss1); zstructFree(tss2); return 0; }
24.868132
149
0.617543
72371133273f2621361125e58250bace5cc61583
13,016
h
C
src/display_rawfb/display_rfb_mod.h
LuaDist-testing/tekui
22e3047372496941a2c59d0be9fc4a24a9c2bec0
[ "MIT" ]
null
null
null
src/display_rawfb/display_rfb_mod.h
LuaDist-testing/tekui
22e3047372496941a2c59d0be9fc4a24a9c2bec0
[ "MIT" ]
null
null
null
src/display_rawfb/display_rfb_mod.h
LuaDist-testing/tekui
22e3047372496941a2c59d0be9fc4a24a9c2bec0
[ "MIT" ]
null
null
null
#ifndef _TEK_DISPLAY_RFB_MOD_H #define _TEK_DISPLAY_RFB_MOD_H /* ** display_rfb_mod.h - Raw framebuffer display driver ** Written by Franciska Schulze <fschulze at schulze-mueller.de> ** and Timm S. Mueller <tmueller at schulze-mueller.de> ** See copyright notice in teklib/COPYRIGHT */ #define NDEBUG #include <assert.h> #include <ft2build.h> #include FT_FREETYPE_H #include <freetype/ftglyph.h> #include <freetype/ftcache.h> #include <tek/debug.h> #include <tek/exec.h> #include <tek/teklib.h> #include <tek/proto/exec.h> #include <tek/mod/visual.h> #if defined(ENABLE_VNCSERVER) #include <rfb/rfb.h> #include <rfb/rfbregion.h> #endif /*****************************************************************************/ typedef TUINT32 RFBPixelARGB32; typedef TUINT16 RFBPixelRGB16; #define RGB16GetRFBPixelBlue(p) ((((p) & 0x7c00) >> 7) | (((p) & 0x7000) >> 12)) #define RGB16GetRFBPixelGreen(p) ((((p) & 0x03e0) >> 2) | (((p) & 0x0380) >> 7)) #define RGB16GetRFBPixelRed(p) ((((p) & 0x001f) << 3) | (((p) & 0x001c) >> 2)) #define ARGB32GetRFBPixelAlpha(p) ((p) >> 24) #define ARGB32GetRFBPixelRed(p) (((p) >> 16) & 0xff) #define ARGB32GetRFBPixelGreen(p) (((p) >> 8) & 0xff) #define ARGB32GetRFBPixelBlue(p) ((p) & 0xff) #define ARGB32FromRGB(r,g,b) (((r)<<16) | ((g)<<8) | (b)) #define RGB16FromRGB(r,g,b) ((((b) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((r) & 0xf8) >> 3)) #define RGB16FromARGB32(p) RGB16FromRGB(ARGB32GetRFBPixelRed(p),ARGB32GetRFBPixelGreen(p),ARGB32GetRFBPixelBlue(p)) #define ARGB32FromRGB16(p) ARGB32FromRGB(RGB16GetRFBPixelRed(p),RGB16GetRFBPixelGreen(p),RGB16GetRFBPixelBlue(p)) #if defined(RFB_DEPTH_24BIT) typedef RFBPixelARGB32 RFBPixel; #define RFBPIXFMT TVPIXFMT_ARGB32 #define RFB_BITS_PER_GUN 8 #define GetRFBPixelRed(p) ARGB32GetRFBPixelRed(p) #define GetRFBPixelGreen(p) ARGB32GetRFBPixelGreen(p) #define GetRFBPixelBlue(p) ARGB32GetRFBPixelBlue(p) #define RFBPixel2RGB32(p) (p) #define RGB2RFBPixel(p) (p) #define RFBPixelFromRGB(r,g,b) ARGB32FromRGB(r,g,b) #else typedef RFBPixelRGB16 RFBPixel; #define RFBPIXFMT TVPIXFMT_RGB16 #define RFB_BITS_PER_GUN 5 #define GetRFBPixelRed(p) RGB16GetRFBPixelRed(p) #define GetRFBPixelGreen(p) RGB16GetRFBPixelGreen(p) #define GetRFBPixelBlue(p) RGB16GetRFBPixelBlue(p) #define RFBPixel2RGB32(p) ((GetRFBPixelRed(p) << 16) | (GetRFBPixelGreen(p) << 8) | GetRFBPixelBlue(p)) #define RGB2RFBPixel(p) ( (((p) & 0xf80000) >> 19) | (((p) & 0xf800) >> 6) | (((p) & 0xf8) << 7) ) #define RFBPixelFromRGB(r,g,b) RGB16FromRGB(r,g,b) #endif #define WritePixel(v, x, y, p) do { \ assert((x) >= (v)->rfbw_WinRect[0]); \ assert((x) <= (v)->rfbw_WinRect[2]); \ assert((y) >= (v)->rfbw_WinRect[1]); \ assert((y) <= (v)->rfbw_WinRect[3]); \ ((RFBPixel *)(v)->rfbw_BufPtr)[(y) * (v)->rfbw_PixelPerLine + (x)] = (p); \ } while(0) /*****************************************************************************/ #define RFB_DISPLAY_VERSION 2 #define RFB_DISPLAY_REVISION 0 #define RFB_DISPLAY_NUMVECTORS 10 #ifndef LOCAL #define LOCAL #endif #ifndef EXPORT #define EXPORT TMODAPI #endif /*****************************************************************************/ #define RFB_DEF_WIDTH 600 #define RFB_DEF_HEIGHT 400 #define RFB_UTF8_BUFSIZE 4096 /*****************************************************************************/ /* ** Region management */ typedef TINT RECTINT; struct RectList { struct TList rl_List; TINT rl_NumNodes; }; struct Pool { struct RectList p_Rects; struct TExecBase *p_ExecBase; }; struct Region { struct RectList rg_Rects; struct Pool *rg_Pool; }; struct RectNode { struct TNode rn_Node; TINT rn_Rect[4]; }; LOCAL struct Region *rfb_region_new(struct Pool *, TINT *s); LOCAL void rfb_region_destroy(struct Pool *, struct Region *region); LOCAL TBOOL rfb_region_overlap(struct Pool *, struct Region *region, TINT s[]); LOCAL TBOOL rfb_region_subrect(struct Pool *, struct Region *region, TINT s[]); LOCAL TBOOL rfb_region_subregion(struct Pool *, struct Region *dregion, struct Region *sregion); LOCAL TBOOL rfb_region_andrect(struct Pool *, struct Region *region, TINT s[], TINT dx, TINT dy); LOCAL TBOOL rfb_region_andregion(struct Pool *, struct Region *dregion, struct Region *sregion); LOCAL TBOOL rfb_region_isempty(struct Pool *, struct Region *region); LOCAL TBOOL rfb_region_orrect(struct Pool *, struct Region *region, TINT r[], TBOOL opportunistic); LOCAL void rfb_region_initpool(struct Pool *pool, TAPTR TExecBase); LOCAL void rfb_region_destroypool(struct Pool *pool); LOCAL TBOOL rfb_region_intersect(TINT *d0, TINT *d1, TINT *d2, TINT *d3, TINT s0, TINT s1, TINT s2, TINT s3); /*****************************************************************************/ /* ** Fonts */ #ifndef FNT_DEFDIR #define FNT_DEFDIR "tek/ui/font" #endif #define FNT_DEFNAME "VeraMono" #define FNT_DEFPXSIZE 14 #define FNT_WILDCARD "*" #define FNTQUERY_NUMATTR (5+1) #define FNTQUERY_UNDEFINED -1 #define FNT_ITALIC 0x1 #define FNT_BOLD 0x2 #define FNT_UNDERLINE 0x4 #define FNT_MATCH_NAME 0x01 #define FNT_MATCH_SIZE 0x02 #define FNT_MATCH_SLANT 0x04 #define FNT_MATCH_WEIGHT 0x08 #define FNT_MATCH_SCALE 0x10 /* all mandatory properties: */ #define FNT_MATCH_ALL 0x0f #define MAX_GLYPHS 256 struct FontManager { /* list of opened fonts */ struct TList openfonts; }; struct FontNode { struct THandle handle; FT_Face face; TUINT pxsize; TINT ascent; TINT descent; TINT height; TSTRPTR name; }; struct FontQueryNode { struct TNode node; TTAGITEM tags[FNTQUERY_NUMATTR]; }; struct FontQueryHandle { struct THandle handle; struct TList reslist; struct TNode **nptr; }; LOCAL FT_Error rfb_fontrequester(FTC_FaceID faceID, FT_Library lib, FT_Pointer reqData, FT_Face *face); /*****************************************************************************/ typedef struct { /* Module header: */ struct TModule rfb_Module; /* Exec module base ptr: */ struct TExecBase *rfb_ExecBase; /* Locking for module base: */ struct TLock *rfb_Lock; /* Number of module opens: */ TUINT rfb_RefCount; /* Task: */ struct TTask *rfb_Task; /* Command message port: */ struct TMsgPort *rfb_CmdPort; /* Sub rendering device (optional): */ TAPTR rfb_RndDevice; /* Replyport for render requests: */ struct TMsgPort *rfb_RndRPort; /* Render device instance: */ TAPTR rfb_RndInstance; /* Render request: */ struct TVRequest *rfb_RndRequest; /* Own input message port receiving input from sub device: */ TAPTR rfb_RndIMsgPort; /* Device open tags: */ TTAGITEM *rfb_OpenTags; /* Module global memory manager (thread safe): */ struct TMemManager *rfb_MemMgr; /* Locking for instance data: */ struct TLock *rfb_InstanceLock; /* pooled input messages: */ struct TList rfb_IMsgPool; /* list of all visuals: */ struct TList rfb_VisualList; struct Pool rfb_RectPool; RFBPixel *rfb_BufPtr; TBOOL rfb_BufferOwner; TUINT rfb_InputMask; TINT rfb_Width; TINT rfb_Height; TINT rfb_Modulo; TINT rfb_BytesPerPixel; TINT rfb_BytesPerLine; FT_Library rfb_FTLibrary; FTC_Manager rfb_FTCManager; FTC_CMapCache rfb_FTCCMapCache; FTC_SBitCache rfb_FTCSBitCache; struct FontManager rfb_FontManager; TINT rfb_MouseX; TINT rfb_MouseY; TINT rfb_KeyQual; TUINT32 rfb_unicodebuffer[RFB_UTF8_BUFSIZE]; struct Region *rfb_DirtyRegion; struct rfb_window *rfb_FocusWindow; #if defined(ENABLE_VNCSERVER) rfbScreenInfoPtr rfb_RFBScreen; TAPTR rfb_VNCTask; int rfb_RFBPipeFD[2]; TUINT rfb_RFBReadySignal; TAPTR rfb_RFBMainTask; TBOOL rfb_WaitSignal; #endif } RFBDISPLAY; typedef struct rfb_window { struct TNode rfbw_Node; /* Window extents: */ TINT rfbw_WinRect[4]; /* Clipping boundaries: */ TINT rfbw_ClipRect[4]; /* Buffer pointer to upper left edge of visual: */ RFBPixel *rfbw_BufPtr; /* Current pens: */ TVPEN bgpen, fgpen; /* list of allocated pens: */ struct TList penlist; /* current active font */ TAPTR curfont; /* Destination message port for input messages: */ TAPTR rfbw_IMsgPort; /* mask of active events */ TUINT rfbw_InputMask; /* userdata attached to this window, also propagated in messages: */ TTAG userdata; /* Modulo, pixel per line */ TINT rfbw_Modulo; TINT rfbw_PixelPerLine; /* window is "borderless", i.e. a popup window: */ TBOOL borderless; } RFBWINDOW; struct RFBPen { struct TNode node; TUINT32 rgb; }; struct rfb_attrdata { RFBDISPLAY *mod; RFBWINDOW *v; TAPTR font; TINT num; }; /*****************************************************************************/ /* ** Framebuffer drawing primitives */ LOCAL void fbp_drawpoint(RFBDISPLAY *mod, RFBWINDOW *v, TINT x, TINT y, struct RFBPen *pen); LOCAL void fbp_drawfrect(RFBDISPLAY *mod, RFBWINDOW *v, TINT rect[4], struct RFBPen *pen); LOCAL void fbp_drawrect(RFBDISPLAY *mod, RFBWINDOW *v, TINT rect[4], struct RFBPen *pen); LOCAL void fbp_drawline(RFBDISPLAY *mod, RFBWINDOW *v, TINT rect[4], struct RFBPen *pen); LOCAL void fbp_drawtriangle(RFBDISPLAY *mod, RFBWINDOW *v, TINT x0, TINT y0, TINT x1, TINT y1, TINT x2, TINT y2, struct RFBPen *pen); LOCAL void fbp_drawbuffer(RFBDISPLAY *mod, RFBWINDOW *v, TUINT8 *buf, TINT rect[4], TINT totw, TUINT pixfmt, TBOOL alpha); LOCAL void fbp_copyarea(RFBDISPLAY *mod, RFBWINDOW *v, TINT rect[4], TINT dx0, TINT dy0, struct THook *exposehook); /*****************************************************************************/ LOCAL TUINT32 *rfb_utf8tounicode(RFBDISPLAY *mod, TSTRPTR utf8string, TINT len, TINT *bytelen); LOCAL TBOOL rfb_getimsg(RFBDISPLAY *mod, RFBWINDOW *v, TIMSG **msgptr, TUINT type); LOCAL void rfb_exit(RFBDISPLAY *mod); LOCAL void rfb_openvisual(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_closevisual(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_setinput(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_allocpen(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_freepen(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_frect(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_rect(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_line(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_plot(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_drawstrip(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_clear(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_getattrs(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_setattrs(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_drawtext(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_openfont(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_getfontattrs(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_textsize(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_setfont(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_closefont(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_queryfonts(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_getnextfont(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_drawtags(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_drawfan(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_copyarea(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_setcliprect(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_unsetcliprect(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_drawbuffer(RFBDISPLAY *mod, struct TVRequest *req); LOCAL void rfb_flush(RFBDISPLAY *mod, struct TVRequest *req); LOCAL TBOOL rfb_damage(RFBDISPLAY *mod, TINT drect[], RFBWINDOW *v); LOCAL struct Region *rfb_getlayers(RFBDISPLAY *mod, RFBWINDOW *v, TINT dx, TINT dy); LOCAL struct Region *rfb_getlayermask(RFBDISPLAY *mod, TINT *crect, RFBWINDOW *v, TINT dx, TINT dy); LOCAL void rfb_markdirty(RFBDISPLAY *mod, TINT *r); LOCAL void rfb_schedulecopy(RFBDISPLAY *mod, TINT *r, TINT dx, TINT dy); LOCAL TAPTR rfb_hostopenfont(RFBDISPLAY *mod, TTAGITEM *tags); LOCAL void rfb_hostclosefont(RFBDISPLAY *mod, TAPTR font); LOCAL void rfb_hostsetfont(RFBDISPLAY *mod, RFBWINDOW *v, TAPTR font); LOCAL TTAGITEM *rfb_hostgetnextfont(RFBDISPLAY *mod, TAPTR fqhandle); LOCAL TINT rfb_hosttextsize(RFBDISPLAY *mod, TAPTR font, TSTRPTR text, TINT len); LOCAL TVOID rfb_hostdrawtext(RFBDISPLAY *mod, RFBWINDOW *v, TSTRPTR text, TINT len, TINT posx, TINT posy, TVPEN fgpen); LOCAL THOOKENTRY TTAG rfb_hostgetfattrfunc(struct THook *hook, TAPTR obj, TTAG msg); LOCAL TAPTR rfb_hostqueryfonts(RFBDISPLAY *mod, TTAGITEM *tags); LOCAL void rfb_flush_clients(RFBDISPLAY *mod, TBOOL also_external); LOCAL RFBWINDOW *rfb_findcoord(RFBDISPLAY *mod, TINT x, TINT y); LOCAL void rfb_focuswindow(RFBDISPLAY *mod, RFBWINDOW *v); #if defined(ENABLE_VNCSERVER) int rfb_vnc_init(RFBDISPLAY *mod); void rfb_vnc_exit(RFBDISPLAY *mod); void rfb_vnc_flush(RFBDISPLAY *mod, struct Region *D); void rfb_vnc_copyrect(RFBDISPLAY *mod, RFBWINDOW *v, int dx, int dy, int x0, int y0, int x1, int y1, int yinc); #endif #endif /* _TEK_DISPLAY_RFB_MOD_H */
29.921839
117
0.708589
374753af56c2adf6265061ebbb59d26f9a0f47d1
17,674
c
C
src/urnlearning_simulation.c
gsmcwhirter/self-deception
b92932e91b1c5ac4b00210f2a891ac1347a3fe01
[ "MIT" ]
1
2015-01-25T01:32:53.000Z
2015-01-25T01:32:53.000Z
src/urnlearning_simulation.c
gsmcwhirter/self-deception
b92932e91b1c5ac4b00210f2a891ac1347a3fe01
[ "MIT" ]
null
null
null
src/urnlearning_simulation.c
gsmcwhirter/self-deception
b92932e91b1c5ac4b00210f2a891ac1347a3fe01
[ "MIT" ]
1
2019-04-09T17:32:24.000Z
2019-04-09T17:32:24.000Z
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <errno.h> #include <inttypes.h> #include "urnlearning_urns.h" #include "urnlearning_game.h" #include "urnlearning_simulation.h" #include "randomkit.h" #include "commander.h" #include "timestamp.h" #ifdef _OPENMP #include <omp.h> #endif #define VERSION "0.0.1" #define UNUSED(x) (void)(x) #define SITUATIONS 2 #define STATES 3 #define MESSAGES 3 double max_payoff = 1.0; double inspect_prob = 0.85; double inspect_cost = 0.25; double prop_fitness_other = 1.0; double common_interest_prob = 0.5; rk_state rand_state; int rk_state_set = 0; int be_verbose = 0; int dump_to_files = 0; unsigned long duplications = 1; long threads = 1; unsigned long generations = 1000000; double ** payoffs(unsigned int players, unsigned int **types, unsigned int * state_action_profile) { assert(types != NULL); if (types == NULL){ exit(EXIT_FAILURE); } double **payoffs = malloc(players * sizeof(double *)); assert(payoffs != NULL); if (payoffs == NULL){ exit(EXIT_FAILURE); } unsigned int i, j, tmp; //set payoffs to zero for (i = 0; i < players; i++){ if (i == 0){ tmp = players; } else { tmp = i-1; } *(payoffs + i) = malloc(*(*(types + i) + *(state_action_profile + tmp)) * sizeof(double)); assert(*(payoffs + i) != NULL); if(*(payoffs + i) == NULL){ exit(EXIT_FAILURE); } for (j = 0; j < *(*(types + i) + *(state_action_profile + tmp)); j++){ *(*(payoffs + i) + j) = 0.0; } } //calculate actual payoffs unsigned int situation, state, representation, message, action, inspect, real_action, sender_desired_act; double sample; situation = *(state_action_profile + players + 1); state = *(state_action_profile + players); representation = *(state_action_profile + 0) - (situation * STATES); message = *(state_action_profile + 1) - (situation * MESSAGES); action = *(state_action_profile + 2); if (action == STATES){ inspect = 1; if (!rk_state_set){ rk_randomseed(&rand_state); rk_state_set = 1; } sample = rk_double(&rand_state); if (sample < inspect_prob){ //switch (situation){ // case 0: //pure common interest // real_action = representation; // break; // case 1: //partial common interest // if (representation > 1){ real_action = representation; //This is correct. Even in partial common interest cases, //the receiver wants to know the real state. // } // else { // real_action = 1 - representation; // } // break; // default: // exit(EXIT_FAILURE); // break; //} } else { real_action = (unsigned int)rk_interval(STATES - 1, &rand_state); // -1 b/c inclusive } } else { inspect = 0; real_action = action; } switch (situation){ case 0: //pure common interest *(*(payoffs + 0) + representation) = ((state == real_action) ? max_payoff : 0.0) * prop_fitness_other + ((state == representation) ? max_payoff : 0.0) * (1.0 - prop_fitness_other); *(*(payoffs + 1) + message) = ((state == real_action) ? max_payoff : 0.0) * prop_fitness_other + ((state == representation) ? max_payoff : 0.0) * (1.0 - prop_fitness_other); *(*(payoffs + 2) + action) = ((state == real_action) ? max_payoff - inspect * inspect_cost : 0.0); break; case 1: //partial common interest if (state > 1){ *(*(payoffs + 0) + representation) = ((state == real_action) ? max_payoff : 0.0) * prop_fitness_other + ((state == representation) ? max_payoff : 0.0) * (1.0 - prop_fitness_other); *(*(payoffs + 1) + message) = ((state == real_action) ? max_payoff : 0.0) * prop_fitness_other + ((state == representation) ? max_payoff : 0.0) * (1.0 - prop_fitness_other); *(*(payoffs + 2) + action) = ((state == real_action) ? max_payoff - inspect * inspect_cost : 0.0); } else { sender_desired_act = 1 - state; *(*(payoffs + 0) + representation) = ((sender_desired_act == real_action) ? max_payoff : 0.0) * prop_fitness_other + ((state == representation) ? max_payoff : 0.0) * (1.0 - prop_fitness_other); *(*(payoffs + 1) + message) = ((sender_desired_act == real_action) ? max_payoff : 0.0) * prop_fitness_other + ((state == representation) ? max_payoff : 0.0) * (1.0 - prop_fitness_other); *(*(payoffs + 2) + action) = ((state == real_action) ? max_payoff - inspect * inspect_cost : 0.0); } break; default: exit(EXIT_FAILURE); break; } #ifndef NDEBUG printf("Payoffs:\n"); for (i = 0; i < players; i++){ if (i == 0){ tmp = players; } else { tmp = i-1; } for (j = 0; j < *(*(types + i) + *(state_action_profile + tmp)); j++){ printf(" %g", *(*(payoffs + i) + j)); } printf("\n"); } #endif return payoffs; } unsigned int * urnlearning_interaction(unsigned int players, urncollection_t **player_urns, rk_state *rand_state_ptr) { assert(player_urns != NULL); if (player_urns == NULL){ exit(EXIT_FAILURE); } assert(rand_state_ptr != NULL); if (rand_state_ptr == NULL){ exit(EXIT_FAILURE); } unsigned int situation; double situation_draw; situation_draw = rk_double(rand_state_ptr); if (situation_draw < common_interest_prob){ //common interest situation = 0; } else { //partial common interest situation = 1; } //situation = (unsigned int)rk_interval(SITUATIONS - 1, rand_state_ptr); // - 1 b/c inclusive unsigned int state; state = (unsigned int)rk_interval((*(player_urns + 0))->num_urns - 1, rand_state_ptr); // -1 b/c inclusive unsigned int * state_action_profile = malloc((players + 2) * sizeof(unsigned int)); unsigned int i; unsigned int last_action = state; for (i = 0; i < players; i++){ switch (i){ case 0: last_action = Urn_randomSelect(*((*(player_urns + i))->urns + last_action), rand_state_ptr); *(state_action_profile + i) = situation * STATES + last_action; break; case 1: last_action = Urn_randomSelect(*((*(player_urns + i))->urns + (situation * STATES + last_action)), rand_state_ptr); *(state_action_profile + i) = situation * MESSAGES + last_action; break; case 2: last_action = Urn_randomSelect(*((*(player_urns + i))->urns + (situation * MESSAGES + last_action)), rand_state_ptr); *(state_action_profile + i) = last_action; break; default: exit(EXIT_FAILURE); break; } } #ifndef NDEBUG printf("Interaction:\n"); printf(" Situation: %i\n", situation); printf(" State: %i\n", state); printf(" Actions:"); printf(" %i %i %i\n", *(state_action_profile + 0) - situation * STATES, *(state_action_profile + 1) - situation * MESSAGES, *(state_action_profile + 2)); #endif *(state_action_profile + players) = state; *(state_action_profile + players + 1) = situation; return state_action_profile; } void display_game(urngame_t * game, FILE *outfile){ unsigned int i, j; if (outfile == NULL){ outfile = stdout; } char *prefix = " "; for (i = 0; i < game->num_players; i++){ fprintf(outfile, "Player %i\n", i); urncollection_t * urncoll = *(game->player_urns + i); for (j = 0; j < urncoll->num_urns; j++){ Urn_display(*(urncoll->urns + j), prefix, outfile); fprintf(outfile, "\n"); } } } static void handle_verbose(command_t *self) { UNUSED(self); be_verbose = 1; printf("verbose output enabled.\n"); } static void handle_files(command_t *self) { UNUSED(self); dump_to_files = 1; if (be_verbose){ printf("dumping output to files.\n"); } } static void handle_duplications(command_t *self) { if (self->arg != NULL){ errno = 0; duplications = strtoul(self->arg, NULL, 0); if (errno || duplications == 0){ printf("Number of duplications is invalid.\n"); exit(EXIT_FAILURE); } } } static void handle_interactions(command_t *self){ if (self->arg != NULL){ errno = 0; generations = strtoul(self->arg, NULL, 0); if (errno || generations == 0){ printf("Number of interactions is invalid.\n"); exit(EXIT_FAILURE); } } } static void handle_threads(command_t *self) { if (self->arg != NULL){ errno = 0; threads = strtol(self->arg, NULL, 0); if (errno || threads == 0){ printf("Number of threads is invalid.\n"); exit(EXIT_FAILURE); } } } static void handle_inspect_prob(command_t *self) { if (self->arg != NULL){ errno = 0; inspect_prob = strtod(self->arg, NULL); if (errno || inspect_prob < 0.0 || inspect_prob > 1.0){ printf("Inspection probability is invalid.\n"); exit(EXIT_FAILURE); } } } static void handle_inspect_cost(command_t *self) { if (self->arg != NULL){ errno = 0; inspect_cost = strtod(self->arg, NULL); if (errno || inspect_cost < 0.0){ printf("Inspection cost is invalid."); exit(EXIT_FAILURE); } } } static void handle_prop_fitness_other(command_t *self) { if (self->arg != NULL){ errno = 0; prop_fitness_other = strtod(self->arg, NULL); if (errno || prop_fitness_other < 0.0 || prop_fitness_other > 1.0){ printf("Other-related fitness proportion is invalid."); exit(EXIT_FAILURE); } } } static void handle_common_interest_prob(command_t *self) { if (self->arg != NULL){ errno = 0; common_interest_prob = strtod(self->arg, NULL); if (errno || common_interest_prob < 0.0 || common_interest_prob > 1.0){ printf("Common interest probability is invalid.\n"); exit(EXIT_FAILURE); } } } unsigned numDigits(const unsigned n) { if (n < 10) return 1; return 1 + numDigits(n / 10); } int main(int argc, char *argv[]) { int64_t start_time = timestamp(); command_t options; command_init(&options, argv[0], VERSION); command_option(&options, "-v", "--verbose", "enable verbose stuff", handle_verbose); command_option(&options, "-f", "--files", "dump output to files", handle_files); command_option(&options, "-i", "--interactions <arg>", "number of interactions to run (default 1000000)", handle_interactions); command_option(&options, "-N", "--duplications <arg>", "number of duplications to run (default 1)", handle_duplications); command_option(&options, "-M", "--threads <arg>", "number of threads to use (openmp, default 1)", handle_threads); command_option(&options, "-p", "--inspect_prob <arg>", "probability of successful inspection (default 0.85)", handle_inspect_prob); command_option(&options, "-c", "--inspect_cost <arg>", "cost of inspection (default 0.25)", handle_inspect_cost); command_option(&options, "-o", "--other_fitness <arg>", "proportion of fitness generated from other-related interactions (default 1.0)", handle_prop_fitness_other); command_option(&options, "-s", "--ci_prob <arg>", "probability of common interest situations (default 0.5)", handle_common_interest_prob); command_parse(&options, argc, argv); printf("Inspect probability: %g\n", inspect_prob); printf("Inspect cost: %g\n", inspect_cost); printf("Other-related fitness: %g\n", prop_fitness_other); printf("Common-Interest Probability: %g\n", common_interest_prob); unsigned int num_players = 3; unsigned int *urn_counts = malloc(num_players * sizeof(unsigned int)); assert(urn_counts != NULL); if (urn_counts == NULL){ exit(EXIT_FAILURE); } *(urn_counts + 0) = STATES; *(urn_counts + 1) = SITUATIONS * STATES; *(urn_counts + 2) = SITUATIONS * MESSAGES; unsigned int **types = malloc(num_players * sizeof(unsigned int *)); assert(types != NULL); if (types == NULL){ exit(EXIT_FAILURE); } double ***initial_counts = malloc(num_players * sizeof(double **)); assert(initial_counts != NULL); if (initial_counts == NULL){ exit(EXIT_FAILURE); } unsigned int i, j, k; unsigned long dup; for (i = 0; i < num_players; i++){ *(types + i) = malloc(*(urn_counts + i) * sizeof(unsigned int)); assert(*(types + i) != NULL); if (*(types + i) == NULL){ exit(EXIT_FAILURE); } *(initial_counts + i) = malloc(*(urn_counts + i) * sizeof(double *)); assert(*(initial_counts + i) != NULL); if (*(initial_counts + i) == NULL){ exit(EXIT_FAILURE); } for (j = 0; j < *(urn_counts + i); j++){ switch (i){ case 0: *(*(types + i) + j) = STATES; break; case 1: *(*(types + i) + j) = MESSAGES; break; case 2: *(*(types + i) + j) = STATES + 1; break; } *(*(initial_counts + i) + j) = malloc(*(*(types + i) + j) * sizeof(double)); assert(*(*(initial_counts + i) + j) != NULL); if (*(*(initial_counts + i) + j) == NULL){ exit(EXIT_FAILURE); } for (k = 0; k < *(*(types + i) + j); k++){ *(*(*(initial_counts + i) + j) + k) = 1.0; } } } //actual simulation urngame_t * game = UrnGame_create(num_players, urn_counts, types, initial_counts, urnlearning_interaction); assert(game != NULL); if (game == NULL){ exit(EXIT_FAILURE); } printf("Running %lu duplications for %lu interactions...\n", duplications, generations); #ifdef _OPENMP omp_set_dynamic(0); omp_set_nested(1); if (threads < 0){ int num_procs = omp_get_num_procs(); if (num_procs < 2){ threads = 1; } else { threads = num_procs - 1; } } omp_set_num_threads(threads); #ifdef NDEBUG if (be_verbose){ #endif printf("Number of threads: %li\n", threads); #ifdef NDEBUG } #endif #pragma omp parallel for #endif for (dup = 0; dup < duplications; dup++){ #ifdef NDEBUG if (be_verbose){ #endif printf("Starting duplication %lu...\n", dup + 1); #ifdef NDEBUG } #endif int64_t dup_start_time = timestamp(); urngame_t *gamedup = UrnGame_clone(game); #ifdef NDEBUG if (be_verbose){ #endif printf("Done cloning the game for duplication %lu.\n", dup + 1); #ifdef NDEBUG } #endif FILE *outfile = NULL; char *filename; int filename_size = numDigits(dup + 1) + 17; //17 is the length of "duplication_.out" plus the terminating null if (dump_to_files){ filename = malloc(filename_size * sizeof(char)); snprintf(filename, filename_size, "duplication_%lu.out", dup + 1); outfile = fopen(filename, "w"); free(filename); } else { outfile = stdout; } fprintf(outfile, "Running for %lu interactions.\n\n", generations); fprintf(outfile, "Initial State:\n"); display_game(gamedup, outfile); fprintf(outfile, "\n"); urnlearning_dynamics(gamedup, generations, payoffs); fprintf(outfile, "done.\n\n"); //reports display_game(gamedup, outfile); UrnGame_destroy(gamedup); fprintf(outfile, "\nTime taken: %" PRId64 " ms\n", timestamp() - dup_start_time); if (dump_to_files){ fclose(outfile); } #ifdef NDEBUG if (be_verbose){ #endif printf("Done duplication %lu.\n", dup + 1); #ifdef NDEBUG } #endif } for (i = 0; i < num_players; i++){ free(*(types + i)); for (j = 0; j < *(urn_counts + i); j++){ free(*(*(initial_counts + i) + j)); } free(*(initial_counts + i)); } free(types); free(initial_counts); free(urn_counts); UrnGame_destroy(game); command_free(&options); #ifdef NDEBUG if (be_verbose){ #endif printf("Total time: %" PRId64 " ms\n", timestamp() - start_time); #ifdef NDEBUG } #endif return 0; }
31.336879
209
0.546452
98fed67cfd390daef04cd427fa599d69a8085545
164
c
C
ICC/RevisaoP1/Uso_do_While/EX3.c
javayuga/introUNESP
7f0bc41aeef208bd343092e996b6adf205a307ab
[ "Apache-2.0" ]
1
2020-10-07T21:09:36.000Z
2020-10-07T21:09:36.000Z
ICC/RevisaoP1/Uso_do_While/EX3.c
javayuga/introUNESP
7f0bc41aeef208bd343092e996b6adf205a307ab
[ "Apache-2.0" ]
null
null
null
ICC/RevisaoP1/Uso_do_While/EX3.c
javayuga/introUNESP
7f0bc41aeef208bd343092e996b6adf205a307ab
[ "Apache-2.0" ]
1
2020-10-30T20:01:02.000Z
2020-10-30T20:01:02.000Z
#include<stdlib.h> #include<stdio.h> int main() { //entrada: massa inicial // enquanto massa maior que 0.5 system("PAUSE"); return 0; }
10.933333
39
0.573171
a6bd7360e9bf28257442f3f99972243e365fe5be
1,259
h
C
MYPickerView/Classes/MYPickerColumnView.h
WenMingYan/MYPickerView
a956434de63db868ccfdf2ca7733a1230d78e357
[ "MIT" ]
1
2019-09-04T08:41:27.000Z
2019-09-04T08:41:27.000Z
MYPickerView/Classes/MYPickerColumnView.h
WenMingYan/MYPickerView
a956434de63db868ccfdf2ca7733a1230d78e357
[ "MIT" ]
null
null
null
MYPickerView/Classes/MYPickerColumnView.h
WenMingYan/MYPickerView
a956434de63db868ccfdf2ca7733a1230d78e357
[ "MIT" ]
null
null
null
// // TYTimerPickerColumnView.h // lottie-ios // // Created by 温明妍 on 2019/8/29. // #import <UIKit/UIKit.h> @class MYPickerColumnView; @protocol TYDFTimerPickerColumnViewDelegate <NSObject> @optional - (void)pickerColumnView:(MYPickerColumnView *)pickerColumnView didSelectRow:(NSInteger)row; @end @interface MYPickerColumnView : UIView @property(nonatomic, weak) id<TYDFTimerPickerColumnViewDelegate> delegate; @property (nonatomic, strong) UIFont *normalFont; @property (nonatomic, strong) UIFont *selectFont; @property (nonatomic, strong) UIColor *normalTextColor; @property (nonatomic, strong) UIColor *selectTextColor; @property (nonatomic, strong) UIFont *middleTextFont; @property (nonatomic, strong) UIColor *middleTextColor; @property (nonatomic, strong) NSString *middleText; @property (nonatomic, assign) CGFloat horizontalOffset; @property (nonatomic, assign) CGFloat verticalOffset; @property (nonatomic, assign) BOOL isScrollCycle;/** < 是否是循环*/ @property (nonatomic, strong) NSArray<NSAttributedString *> *datas; /**< 数据 */ - (void)selectRow:(NSInteger)row animated:(BOOL)animated; - (void)selectRow:(NSInteger)row animated:(BOOL)animated callDelegate:(BOOL)callDelegate; - (NSInteger)selectedRow; - (void)reloadDatas; @end
26.229167
92
0.772041
4731f5987ce8f9075296e3544dc8c34d95cdf87d
27,349
c
C
bignumber/bn-gfp.c
alu112/OpenCrypto
80cb8d69fd82112c79b8bfd59a22faf9481cfbc9
[ "Apache-2.0" ]
1
2021-02-18T08:54:36.000Z
2021-02-18T08:54:36.000Z
bignumber/bn-gfp.c
alu112/OpenCrypto
80cb8d69fd82112c79b8bfd59a22faf9481cfbc9
[ "Apache-2.0" ]
null
null
null
bignumber/bn-gfp.c
alu112/OpenCrypto
80cb8d69fd82112c79b8bfd59a22faf9481cfbc9
[ "Apache-2.0" ]
1
2020-07-24T07:02:58.000Z
2020-07-24T07:02:58.000Z
/* Copyright 2020 Andrew Li, Gavin Li li.andrew.mail@gmail.com gavinux@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <string.h> #include <stdlib.h> #include <stdio.h> #include <assert.h> #include "bn-gfp.h" #if 1 void (*bn_expmod)(bn_t, bn_t, bn_t, bn_t) = bn_kary_expmod; /* bn_bitwise_expmod; bn_kary_expmod; */ //void (*bn_expmod)(bn_t, bn_t, bn_t, bn_t) = bn_bitwise_expmod; /* bn_bitwise_expmod; bn_kary_expmod; */ void (*bn_mulmod)(bn_t, bn_t, bn_t, bn_t) = bn_classic_mulmod; /* bn_mont_mulmod; bn_classic_mulmod */ #else void (*bn_expmod)(bn_t, bn_t, bn_t, bn_t) = bn_mont_expmod; void (*bn_mulmod)(bn_t, bn_t, bn_t, bn_t) = bn_mont_mulmod; #endif void (*bn_div)(bn_t, bn_t, bn_t, bn_t) = bn_hac_div; /* bn_hac_div; bn_classic_div */ void (*bn_mont_pro)(bn_t , bn_t , bn_t , bn_t , bn_t ) = bn_mont_pro_2; static void r_mod_n(bn_t r, bn_t n, bn_t r_n); void bn_print(char * msg, bn_t bn) { int i; uint8_t *p8 = (uint8_t *)bn; if (msg) printf("%s", msg); for (i=BN_LEN*4-1; i>=0; i--) if (p8[i]) break; i = i < 0 ? 0 : i; for ( ; i>=0; i--) printf("%02x", p8[i]); printf("\n"); } /* print n bytes */ void bn_print_len(char *msg, bn_t bn, int n) { int i; uint8_t *p8 = (uint8_t *)bn; if (msg) printf("%s", msg); /* if n is longer than BN_LEN*4 */ for (i=n-1; i>=BN_LEN*4-1; i--) printf("00"); if (n >= BN_LEN*4) i = BN_LEN*4 - 1; else i = n - 1; for ( ; i>=0; i--) printf("%02x", p8[i]); printf("\n"); } void bn_swap(bn_t a, bn_t b) { bn_t t; bn_cpy(a, t); bn_cpy(b, a); bn_cpy(t, b); } int bn_getbit(bn_t a, int i) { int dword, bits; assert(i<BN_LEN*32); dword = i / 32; bits = i % 32; return a[dword] & (1<<bits) ? 1 : 0; } void bn_setbit(bn_t a, int i) { int dword, bits; assert(i<BN_LEN*32); dword = i / 32; bits = i % 32; a[dword] |= (1<<bits); } void bn_clrbit(bn_t a, int i) { int dword, bits; assert(i<BN_LEN*32); dword = i / 32; bits = i % 32; a[dword] &= ~(1<<bits); } /* get left most uint32 which is not zero */ int bn_getlen(bn_t bn) { int i; for (i=BN_LEN-1; i>=0; i--) { if (bn[i]) break; } return i + 1; } /* get msbit position */ int bn_getmsbposn(bn_t bn) { int i, j; i = bn_getlen(bn) - 1; if (i >= 0) { for (j=31; j>=0; j--) if (bn[i] & (1<<j)) break; return i * 32 + j + 1; } else return 0; } /* bn = 0 */ void bn_clear(bn_t bn) { memset(bn, 0, sizeof(bn_t)); } /* bn = 1 */ void bn_setone(bn_t bn) { bn_clear(bn); *(uint32_t *)bn = 1; } /* set bn = uint64 */ void bn_qw2bn(uint64_t u64, bn_t bn) { bn_clear(bn); memmove(bn, &u64, sizeof(uint64_t)); } /* set bn to the hexstring */ void bn_hex2bn(uint8_t *hexstr, bn_t bn) { int i, k, len, offset; uint8_t hex[16]; bn_clear(bn); if (!strncmp(hexstr, "0x", 2) || !strncmp(hexstr, "0X", 2)) hexstr += 2; len = strlen(hexstr); for (k=0, i=0; i<len; k++, i+=8) { memset(hex, 0, sizeof(hex)); offset = len - i - 8; if (offset > 0) memmove(hex, &hexstr[offset], 8); else memmove(hex, hexstr, len - i); bn[k] = strtoul(hex, 0, 16); } } void bn_bn2hex(bn_t a, uint8_t *hex) { int i, len; len = bn_getlen(a); strcpy(hex, "0x"); for (i=0; i<len; i++) sprintf(hex+i*8+2, "%08x", a[len-i-1]); } /* copy bytes array to bn */ void bn_ba2bn(uint8_t *bytes, int len, bn_t r) { uint8_t *dst = (uint8_t *)r; bn_clear(r); bytes += len-1; while(len--) *dst++ = *bytes--; } void bn_bn2ba(bn_t r, int len, uint8_t *bytes) { uint8_t *src = (uint8_t *)r; bytes += len-1; while(len--) *bytes-- = *src++; } bool bn_iszero(bn_t bn) { int i; uint32_t u32 = 0; for (i=0; i<BN_LEN; i++) u32 |= bn[i]; return u32 ? 0 : 1; } bool bn_isone(bn_t bn) { int i; uint32_t u32; if (*bn == 1) { u32 = 0; for (i=1; i<BN_LEN; i++) u32 |= bn[i]; return !u32; } return false; } bool bn_isodd(bn_t bn) { return bn[0] & 1 ? 1 : 0; } bool bn_iseven(bn_t bn) { return bn[0] & 1 ? 0 : 1; } /* no negative number */ bool bn_ispositive(bn_t bn) { return !bn_iszero(bn); } /* to = from */ void bn_cpy(bn_t from, bn_t to) { memmove(to, from, sizeof(bn_t)); } /* copy [from] n uint32 start from offset to [to] */ void bn_cpylen(int offset, int n, bn_t from, bn_t to) { memset(to, 0, sizeof(bn_t)); memmove(to, from + offset - n + 1, 4*n); } /* b = a << nbits */ void bn_lshift(bn_t a, int nbits, bn_t b) { int i; int nwords = (nbits / 32); memmove(b+nwords, a, (BN_LEN-nwords)*sizeof(uint32_t)); memset(b, 0, nwords*sizeof(uint32_t)); nbits &= 31; if (nbits) { for (i = BN_LEN - 1; i > 0; i--) b[i] = (b[i] << nbits) | (b[i - 1] >> (32 - nbits)); b[0] <<= nbits; } } /* b = a >> nbits */ void bn_rshift(bn_t a, int nbits, bn_t b) { int i; int nwords = (nbits / 32); memmove(b, a+nwords, (BN_LEN-nwords)*sizeof(uint32_t)); memset(b+BN_LEN - nwords, 0, nwords*sizeof(uint32_t)); nbits &= 31; if (nbits) { for (i = 0; i < BN_LEN - 2; i++) b[i] = (b[i] >> nbits) | (b[i + 1] << (32 - nbits)); b[BN_LEN - 1] >>= nbits; } } /* bn <<= 32 */ void bn_lshift32(bn_t bn) { int i; for (i=BN_LEN-1; i>0; i--) bn[i] = bn[i-1]; bn[0] = 0; } /* bn = bn<<32 | u32 */ void bn_lshift32_append(bn_t bn, uint32_t u32) { bn_lshift32(bn); bn[0] = u32; } /* bn <<= 1 , which is bn*2 */ void bn_lshift1(bn_t bn) { int i; uint32_t bl, br; bl = 0; for (i=0; i<BN_LEN; i++) { br = bn[i] >> 31 & 1; bn[i] = bn[i] << 1 | bl; bl = br; } } /* bn >>= 1 , which is bn/2 */ void bn_rshift1(bn_t bn) { int i; uint32_t bl, br; bl = 0; for (i=BN_LEN-1; i>=0; i--) { br = (bn[i] & 1) << 31; bn[i] = bn[i] >> 1 | bl; bl = br; } } /* a = a + uint32 */ uint32_t bn_addx(uint32_t x, bn_t a) { int i; if (a[0] + x < x) { for (i=1; i<BN_LEN; i++) if (++a[i]) break; } a[0] += x; if (i == BN_LEN) return 1; /* carry */ else return 0; } /* a = a - uint32 */ uint32_t bn_subx(uint32_t x, bn_t a) { int i; if (a[0] < x) { for (i=1; i<BN_LEN; i++) if (a[i]--) break; } a[0] -= x; if (i == BN_LEN) return 1; /* borrow */ else return 0; } /* * return 1: a > b * 0: a == b * -1: a < b */ int bn_cmp(bn_t a, bn_t b) { int i; for (i=BN_LEN-1; i>=0; i--) { if (a[i] > b[i]) return 1; else if (a[i] < b[i]) return -1; } return 0; } /* r = a + b */ uint32_t bn_add(bn_t a, bn_t b, bn_t r) { #if 0 /* avoid use uint64_t, this is slower */ int i, m, n; uint32_t carry; bn_t sum; m = bn_getlen(a); n = bn_getlen(b); n = m<n ? n : m; n = n<BN_LEN ? n : BN_LEN; carry = 0; bn_clear(sum); for (i=0; i<n; i++) { sum[i] = a[i] + b[i] + carry; carry = a[i] > ~b[i] ? 1 : 0; } if (i<BN_LEN) { sum[i] = carry; carry = 0; } bn_cpy(sum, r); return carry; #else int i, m, n; uint64_t u64; bn_t sum; m = bn_getlen(a); n = bn_getlen(b); n = m<n ? n : m; n = n<BN_LEN ? n+1 : BN_LEN; u64 = 0UL; bn_clear(sum); for (i=0; i<n; i++) { u64 = (u64 >> 32) + (uint64_t)a[i] + (uint64_t)b[i]; sum[i] = u64; } u64 >>= 32; if (i<BN_LEN) { sum[i] = u64; u64 = 0; } bn_cpy(sum, r); return u64; #endif } /* r = a - b */ uint32_t bn_sub(bn_t a, bn_t b, bn_t r) { int i; bn_t t; for (i=0; i<BN_LEN; i++) t[i] = ~b[i]; bn_addx(1, t); return bn_add(a, t, r); } /* r = a * u32 */ uint32_t bn_mul32(bn_t a, uint32_t u32, bn_t r) { int i, n; uint64_t u64 = 0; bn_t result; n = bn_getlen(a); bn_clear(result); for (i=0; i</*BN_LEN*/ n; i++) { u64 = (u64 >> 32) + a[i] * (uint64_t)u32; result[i] = u64; } u64 >>= 32; if (i<BN_LEN) { result[i] = u64; u64 = 0; } bn_cpy(result, r); /* if u64 is none-zero, then it is the carry value */ return u64; } /* r = a * u64 */ uint64_t bn_mul64(bn_t a, uint64_t u64, bn_t r) { uint64_t carry; bn_t u, v; carry = bn_mul32(a, u64, u); bn_cpy(a, v); carry |= (uint64_t)bn_mul32(v, u64>>32, v) << 32; carry += v[BN_LEN-1]; bn_lshift32(v); carry += bn_add(u, v, r); return carry; } /* r = a * b */ uint32_t bn_mul(bn_t a, bn_t b, bn_t r) { int i, j, m, n; uint32_t carry; uint64_t u64; bn_t tmp, res, a1, b1; m = bn_getlen(a); n = bn_getlen(b); m = m<BN_LEN ? m+1 : BN_LEN; n = n<BN_LEN ? n+1 : BN_LEN; if (m >= n) { bn_cpy(a, a1); bn_cpy(b, b1); } else { bn_cpy(a, b1); bn_cpy(b, a1); i = m; m = n; n = i; } carry = 0; bn_clear(res); for (i=0; i<m; i++) { u64 = 0UL; bn_clear(tmp); for (j=0; j<n && i+j<BN_LEN; j++) { u64 = (u64>>32) + (uint64_t)a1[i] * b1[j]; tmp[i+j] = u64; } carry += u64>>32; bn_add(res, tmp, res); } bn_cpy(res, r); return carry; } /* HAC 14.16 Algorithm Multiple-precision squaring */ uint32_t bn_sqr(bn_t x, bn_t y) { int i, j, t; bn_t w; uint64_t uv, c, p, p2, c1; t = bn_getlen(x); if (t>BN_LEN/2) return -1; bn_clear(w); for (i=0; i<t; i++) { p = (uint64_t)x[i] * x[i]; w[2*i] = uv = w[2*i] + p; c = uv>>32; if (uv < p) c |= 1UL<<32; for (j=i+1; j<t; j++) { p = (uint64_t)x[i] * x[j]; p2 = p<<1; if (p2 < p) c1 = 1UL<<32; else c1 = 0; uv = w[i+j] + c; if (uv < c) c1 += 1UL<<32; w[i+j] = uv += p2; if (uv < p2) c1 += 1UL<<32; c = c1 | uv>>32; } if (i+j<BN_LEN-1) *(uint64_t *)&w[i+j] += c; else w[i+j] += c; } bn_cpy(w, y); return 0; } /* q = a / s; r = a % s */ void bn_divu32(bn_t a, uint32_t s, bn_t q, uint32_t *r) { int i; uint64_t u64 = 0UL; bn_t y; bn_clear(y); for (i=BN_LEN-1; i>=0; i--) { u64 = u64 << 32 | a[i]; y[i] = u64 / s; u64 %= s; } bn_cpy(y, q); *r = u64; } /* * q = a / b; m = a % b * if q and m point to same location * then m contain correct value, q is overwritten by m */ void bn_classic_div(bn_t a, bn_t b, bn_t q, bn_t m) { int i, alen, blen, nshift = 0; uint32_t r32; uint64_t rh, rl; bn_t rt, mt, r, mm; bn_t at, bt; bn_t av, bv; bn_cpy(a, at); bn_cpy(b, bt); bn_cpy(a, av); bn_cpy(b, bv); switch (bn_cmp(at, bt)) { case -1: bn_clear(q); bn_cpy(at, m); break; case 0: bn_setone(q); bn_clear(m); break; case +1: /* * normalize * if normalized, then the rh-rl <= 2 */ alen = bn_getlen(at) - 1; nshift = bn_getmsbposn(bt) % 32; if ((alen < BN_LEN - 1) && (nshift != 0)) { nshift = 32 - nshift; bn_lshift(at, nshift, at); bn_lshift(bt, nshift, bt); } else nshift = 0; /* end of normalize */ alen = bn_getlen(at) - 1; blen = bn_getlen(bt) - 1; r32 = 0; bn_clear(r); /* get blen-1 uint32 from at to mm as numerator */ bn_cpylen(alen, blen, at, mm); /* bt is denominator */ for (i=alen-blen; i>=0; i--) { /* * get in another uint32 to numerator mm * so mm is at least blen length */ bn_lshift32_append(mm, at[i]); /* * if numerator is less than denominator, then the quotient is 0 * and have to get another uint32 in to numerator */ if (bn_cmp(mm, bt) < 0) { r32 = 0; bn_lshift32_append(r, r32); continue; } /* try to find the scope of quotient */ /* mm might be 64-bit, and mm+1 also might be 64-bit */ rh = (*(uint64_t *)&mm[blen]+1UL) / (bt[blen]); /* * because at > bt, so bt < 0xFFFFFFFF * so bt + 1 <= 0xFFFFFFFF, it is 32-bit number */ rl = (*(uint64_t *)&mm[blen]) / (bt[blen] + 1UL); /* * although the calculated rh value bigger then uint32 * but in reality, the quotient won't be that big. * If this happened, just set the quotient to maximum uint32 number. * Reason: * the *(uint64_t *)&mm[blen] can only contain more than * 32-bit number if and only if the mm[blen] < bt[blen] * * for an 8-bit example: * the quotient of 0xBECD / 0xBF is an 8-bit digit + remainder * it won't be more than 8-bit digits */ assert((rh&0xFFFFFFFe00000000UL)==0); assert((rl&0xFFFFFFFf00000000UL)==0); if (rh>0xFFFFFFFFUL) rh=0xFFFFFFFFUL; /* search r32 = roundup(mm / bt) bewteen rl..rh */ while (1) { if (rh - rl <= 1) { r32 = rh; break; } r32 = (rh + rl) / 2; bn_mul32(bt, r32, rt); if (bn_cmp(rt, mm) >= 0) rh = r32; else rl = r32; } /* find which one is the quotient of mm/bt, r32 or r32-1 ? */ bn_mul32(bt, r32, rt); if (bn_cmp(mm, rt) < 0) { r32--; bn_mul32(bt, r32, rt); } bn_sub(mm, rt, mt); /* mt is mm % bt */ bn_cpy(mt, mm); assert(mm[blen] <= bt[blen]); /* save the quotient to r */ bn_lshift32_append(r, r32); } bn_cpy(r, q); /* undo-normalize for the remainder */ if (nshift) { bn_rshift(mm, nshift, mm); } /* end of undo-normalize */ bn_cpy(mm, m); break; } } /* HAC 14.20 Algorithm Multiple-precision division */ /* a = q*b + r, 0 <= r < y, an...a1a0, bt...b1b0 */ void bn_hac_div(bn_t a, bn_t b, bn_t q, bn_t r) { int i, n, t, f, nshift = 0; bn_t w, x, y, ys, wz; bn_cpy(a, x); bn_cpy(b, y); switch (bn_cmp(x, y)) { case -1: bn_clear(q); bn_cpy(x, r); break; case 0: bn_setone(q); bn_clear(r); break; case +1: /* start of normalization */ n = bn_getlen(x) - 1; nshift = bn_getmsbposn(y) % 32; if ((n < BN_LEN - 1) && (nshift != 0)) { nshift = 32 - nshift; bn_lshift(x, nshift, x); bn_lshift(y, nshift, y); } else nshift = 0; /* end of normalization */ bn_clear(w); n = bn_getlen(x) - 1; t = bn_getlen(y) - 1; bn_lshift(y, (n-t)*32, ys); while (bn_cmp(x, ys) >= 0) { w[n-t]++; bn_sub(x, ys, x); } for (i=n; i>=t+1; i--) { if (x[i] == y[t]) w[i-t-1] = ~0; else w[i-t-1] = *(uint64_t *)&x[i-1] / y[t]; while (1) { #ifdef USE_UINT128 typedef __uint128_t uint128_t; uint128_t p128; /* product */ union { uint128_t w128; uint64_t w64[2]; } x128; p128 = (uint128_t)w[i-t-1] * *(uint64_t *)&y[t-1]; x128.w64[0] = *(uint64_t *)&x[i-2]; x128.w64[1] = x[i]; if (p128 > x128.w128) w[i-t-1]--; else break; #else uint32_t p96[3] = {0,0,0};; uint64_t wy; *(uint64_t *)p96 = (uint64_t)w[i-t-1] * y[t-1]; wy = (uint64_t)w[i-t-1] * y[t]; *(uint64_t *)(p96+1) += wy; if (p96[2] > x[i]) w[i-t-1]--; else if ((p96[2] == x[i]) && (*(uint64_t *)&p96[0] > *(uint64_t *)&x[i-2])) w[i-t-1]--; else break; #endif } bn_lshift(y, (i-t-1)*32, ys); bn_mul32(ys, w[i-t-1], wz); f = bn_cmp(x, wz); bn_sub(x, wz, x); if (f < 0) { bn_add(x, ys, x); w[i-t-1]--; } } /* undo-normalize for the remainder */ if (nshift) { bn_rshift(x, nshift, x); } /* end of undo-normalize */ bn_cpy(w, q); bn_cpy(x, r); break; } } /**************** mod api ******************/ void bn_addmod(bn_t a, bn_t b, bn_t n, bn_t r) { bn_t t; bn_add(a, b, t); if (bn_cmp(n, t) <= 0) bn_sub(t, n, t); bn_cpy(t, r); } void bn_submod(bn_t a, bn_t b, bn_t n, bn_t r) { bn_t t; bn_sub(a, b, t); if (bn_cmp(a, b) < 0) bn_add(t, n, r); else bn_cpy(t, r); } /* m = a mod n */ void bn_mod(bn_t a, bn_t n, bn_t m) { bn_t q; bn_div(a, n, q, m); } /* m = a * b mod n */ void bn_classic_mulmod(bn_t a, bn_t b, bn_t n, bn_t m) { bn_t r, q; bn_mul(a, b, r); bn_div(r, n, q, m); } /* r = 1/a mod n */ void bn_invmod(bn_t a, bn_t n, bn_t r) { bn_eea(n, a, NULL, r, NULL); } /* HAC 14.79 Algorithm Left-to-right binary exponentiation */ /* y = x^e mod n */ void bn_bitwise_expmod(bn_t x, bn_t e, bn_t n, bn_t y) { int i, j; bn_t r; i = bn_getmsbposn(e) - 1; j = i % 32; i /= 32; bn_cpy(x, r); for (j--; i>=0; i--) { for (; j>=0; j--) { bn_mulmod(r, r, n, r); if (e[i] & (1<<j)) { bn_mulmod(x, r, n, r); } } j = 31; } bn_cpy(r, y); } /* HAC 14.83 Algorithm Modified left-to-right k-ary exponentiation */ /* y= x^e mod n k-ary algorithm */ void bn_kary_expmod(bn_t x, bn_t e, bn_t n, bn_t y) { const int k = 4; int i, j, l; uint32_t u32, u4; bn_t r, table[16]; /* 1<<k */ /* precompute the table of exponents */ bn_setone(table[0]); for (i=1; i<(1<<k); i++) bn_mulmod(table[i-1], x, n, table[i]); /* find MSnibble not zero */ i = bn_getlen(e) - 1; for (j=7; j>=0; j--) { if (e[i] & (0xF<<4*j)) break; } bn_setone(r); for (; i>=0; i--) { u32 = e[i]; for (; j>=0; j--) { for (l=0; l<k; l++) bn_mulmod(r, r, n, r); u4 = u32 >> (4*j) & 0x0F; if (u4) bn_mulmod(r, table[u4], n, r); } j = 7; } bn_cpy(r, y); } //============================================================= /* * HAC 14.54 Algorithm Binary gcd algorithm * INPUT: two positive integers x and y with x>= y * OUTPUT: gcd(x, y) */ uint32_t bn_bin_gcd(bn_t x, bn_t y, bn_t gcd) { uint32_t shift; bn_t u, v, t; bn_cpy(x, u); bn_cpy(y, v); shift = 0; while (bn_iseven(u) && bn_iseven(v)) { bn_rshift1(u); bn_rshift1(v); shift++; } while (!bn_iszero(u)) { while (bn_iseven(u)) bn_rshift1(u); while (bn_iseven(v)) bn_rshift1(v); if (bn_cmp(u, v) >= 0) { bn_sub(u, v, t); bn_rshift1(t); bn_cpy(t, u); } else { bn_sub(v, u, t); bn_rshift1(t); bn_cpy(t, v); } } bn_lshift(v, shift, gcd); return 0; } /* BUGS!!! * HAC 14.61 Algorithm Binary extended gcd algorithm * INPUT: two positive integers x and y * OUTPUT: integers a, b, and g such that ax + by = g, where g = gcd(x, y). */ uint32_t bn_bin_extended_gcd(bn_t x, bn_t y, bn_t a, bn_t b, bn_t g) { uint32_t shift = 0; bn_t u, v; bn_t A, B, C, D, X, Y; bn_cpy(x, X); bn_cpy(y, Y); while (bn_iseven(X) && bn_iseven(Y)) { bn_rshift1(X); bn_rshift1(Y); shift++; } bn_cpy(X, u); bn_cpy(Y, v); bn_setone(A); bn_clear(B); bn_clear(C); bn_setone(D); do { while (bn_iseven(u)) { bn_rshift1(u); if (bn_iseven(A) && !bn_cmp(A, B)) { bn_rshift1(A); bn_rshift1(B); } else { bn_add(A, Y, A); bn_rshift1(A); bn_sub(B, X, B); bn_rshift1(B); } } while (bn_iseven(v)) { bn_rshift1(v); if (bn_iseven(C) && !bn_cmp(C, D)) { bn_rshift1(C); bn_rshift1(D); } else { bn_add(C, Y, C); bn_rshift1(C); bn_sub(D, X, D); bn_rshift1(D); } } if (bn_cmp(u, v) >= 0) { bn_sub(u, v, u); bn_sub(A, C, A); bn_sub(B, D, B); if ((B[BN_LEN-1]&(1<<31)) == 0) { bn_add(A, Y, A); bn_sub(B, X, B); } } else { bn_sub(v, u, v); bn_sub(C, A, C); bn_sub(D, B, D); if ((D[BN_LEN-1]&(1<<31)) == 0) { bn_add(C, Y, C); bn_sub(D, X, D); } } } while (!bn_iszero(u)); if (a) bn_cpy(C, a); if (b) { if (D[BN_LEN-1]&(1<<31)) bn_add(D, x, b); else bn_cpy(D, b); } if (g) bn_lshift(v, shift, g); return 0; } /* * Extended Euclidean Algorithm * INPUT: two positive integers a and b * OUTPUT: integers a, b, and g. such that ax + by = g, where g = gcd(a, b). * such that: x = -a', y = 1/b mod a, g = 1 * which is used in montgomery calculation: -n*n' + r*r^(-1) = 1 */ uint32_t bn_eea(bn_t a, bn_t b, bn_t x, bn_t y, bn_t g) { #if 1 bn_t A, B, X, Y, x1, x2, y1, y2, q, r; if (bn_iszero(b)) { bn_cpy(a, g); bn_setone(x); bn_clear(y); return 0; } bn_cpy(a, A); bn_cpy(b, B); bn_setone(x2); bn_clear(x1); bn_clear(y2); bn_setone(y1); while(!bn_iszero(B)) { bn_div(A, B, q, r); bn_mul(q, x1, X); bn_sub(x2, X, X); bn_mul(q, y1, Y); bn_sub(y2, Y, Y); bn_cpy(B, A); bn_cpy(r, B); bn_cpy(x1, x2); bn_cpy(X, x1); bn_cpy(y1, y2); bn_cpy(Y, y1); } if (g) bn_cpy(A, g); if (x) bn_cpy(x2, x); /* y can't bigger than a after mod a. if it is, then y is negative */ if (y) { if (bn_cmp(y2, a) > 0) bn_add(y2, a, y); else bn_cpy(y2, y); } return 0; #else bn_t q, s0, s1, s, t0, t1, t, r0, r1, r; bn_cpy(a, r0); bn_cpy(b, r1); bn_setone(s0); bn_clear(s1); bn_clear(t0); bn_setone(t1); while ( bn_div(r0, r1, q, r), !bn_iszero(r) ) { bn_mul(q, s1, s); bn_sub(s0, s, s); bn_mul(q, t1, t); bn_sub(t0, t, t); bn_cpy(r1, r0); bn_cpy(r, r1); bn_cpy(s1, s0); bn_cpy(s, s1); bn_cpy(t1, t0); bn_cpy(t, t1); }; if (g) bn_cpy(r1, g); /* y can't bigger than a after mod a. if it is, then y is negative */ if (bn_cmp(t1, a) > 0) bn_add(t1, a, t1); if (y) bn_cpy(t1, y); if (x) { bn_cpy(s1, a); } return 0; #endif } //============================================================= /* * HAC 14.32 Algorithm Montgomery reduction * INPUT: integers * T = (t[2n−1] ... t[1]t[0])b < mR * m = (m[n−1] ... m[1]m[0])b with gcd(m, b) = 1, * m is odd for RSA, so gcd(m,b)=1 will hold * m' = −m^(−1) mod b * radix b = 2^32 * R = b^n is sufficient (but not necessary) for efficient implementation * OUTPUT:TR^(−1) mod m */ uint32_t bn_mont_redc(bn_t T, bn_t m, /*bn_t R,*/ bn_t mp, bn_t TRm) { uint32_t i, n, ui, ov; bn_t A, s; bn_cpy(T, A); n = bn_getlen(m); for (i=0; i<n; i++) { ui = mp[0] * A[0]; ov = bn_mul32(m, ui, s); ov += bn_add(A, s, A); bn_rshift(A, 32, A); //A[BN_LEN-1] += ov; A[n-1] = ov; } if (bn_cmp(A, m) >= 0) bn_sub(A, m, TRm); else bn_cpy(A, TRm); return 0; } /* * HAC 14.36 Algorithm Montgomery multiplication * INPUT: integers * m = (m[n−1] ... m[1]m[0]) radix b * x = (x[n−1] ... x[1]x[0]) radix b * y = (y[n−1] ... y[1]y[0]) radix b * with 0 <= x, y < m, R = b^n with gcd(m, b) = 1, and m' = −m^(−1) mod b. * OUTPUT: xyR^(−1) mod m * * Here: b = 2^32 */ void bn_mont_pro_1(bn_t x, bn_t y, bn_t m, bn_t mp, bn_t product) { uint32_t i, l, ui, u32, carry0; uint64_t carry1; bn_t A, s, t; /* 1 */ bn_clear(A); /* 2 */ l = bn_getlen(m); carry0 = 0; for (i=0; i<l; i++) { /* 2.1 u=(a0 + xi*y0)m' mod b, mod b mean drop carry */ //u64 = A[0] + (uint64_t)x[i] * y[0]; /* drop the carry */ //u64 = bn_mul64(mp, u64, u); //ui = u[0]; u32 = A[0] + x[i] * y[0]; /* drop the carry */ ui = mp[0] * u32; /* 2.2 A=(A + xiy + um)/b, /b means shift right */ carry1 = bn_mul32(y, x[i], t); carry1 += bn_mul32(m, ui, s); carry1 += bn_add(A, s, A); carry1 += bn_add(A, t, A); /* carry1 might over 32-bit after the above statments */ bn_rshift(A, 32, A); carry1 += carry0; //A[BN_LEN-1] += carry1; A[l-1] += carry1; carry0 = carry1 >> 32; /* save high 32 bit to carry0 */ } if (l<=BN_LEN-1) A[l] = carry0; /* 3 */ if (bn_cmp(A, m) >= 0) bn_sub(A, m, product); else bn_cpy(A, product); } /* * Montgomery multiplication * * https://colinandmargaret.co.uk/Research/Mont_Mult_2ndEd_v4.pdf * * m is n bits, temperary variable u is n+2 bits * bitwise calculation, no need for gcd * INPUT: same as HAC 14.36 * OUTPUT: xyR^(−1) mod m, where R=2^k * * function MonPro(a, b) { n is odd and a, b, n < 2^k } * ——————————————————— * Step 1. u := 0 * Step 2. for i = 0 to k − 1 * Step 3. u := u + aib * Step 4. u := u + u0n * Step 5. u := u/2 * Step 6. if u ≥ n then return u − n * else return u * ——————————————————— */ void bn_mont_pro_2(bn_t x, bn_t y, bn_t m, bn_t mp, bn_t product) { int i, k; uint32_t carry; bn_t u; (void) mp; k = bn_getmsbposn(m); bn_clear(u); for (i=0; i<k; i++) { if (bn_getbit(x, i)) carry = bn_add(u, y, u); if (bn_getbit(u, 0)) carry += bn_add(u, m, u); /* carry might be 2 bits */ bn_rshift1(u); //u[BN_LEN - 1] |= ((carry&1) << 31); /* safe to drop b1 ? */ if (carry&1) bn_setbit(x, k-1); } if (carry&2 && k<BN_LEN*32) bn_setbit(x, k); if (bn_cmp(u, m) >= 0) bn_sub(u, m, product); else bn_cpy(u, product); } /* * same as bn_mont_mul_1, this is word-wise. * the word size choosen is 4-bit * gcd for 32-bit value is easy and fast * or the gcd(n, R) can be precomputed and do look-up later * * https://colinandmargaret.co.uk/Research/Mont_Mult_2ndEd_v4.pdf * * function MonPro(a, b) { n is odd and a, b, n < 2^(sw) } * ——————————————————— * Step 1. u := 0 * Step 2. for i = 0 to s − 1 * Step 3. u := u + aib * Step 4. u := u + (−n0^(-1))) · u0 · n * Step 5. u := u/2^w * Step 6. if u ≥ n then return u − n * else return u * ——————————————————— */ void bn_mont_pro_3(bn_t x, bn_t y, bn_t m, bn_t mp, bn_t product) { int i, s; uint64_t nu; bn_t R, u; s = bn_getlen(m); bn_clear(u); for (i=0; i<s; i++) { bn_mul32(y, x[i], R); bn_add(u, R, u); nu = mp[0] * u[0]; bn_qw2bn(nu, R); bn_mul(m, R, R); bn_add(u, R, u); bn_rshift(u, 32, u); } if (bn_cmp(u, m) >= 0) bn_sub(u, m, product); else bn_cpy(u, product); } /* a = a * r mod n; which r is one more bit than m */ static void bn_axr_mod_n(bn_t a, bn_t n, bn_t b) { int i, bits; bn_t xa; bn_cpy(a, xa); while (bn_cmp(xa, n) >= 0) bn_sub(xa, n, xa); bits = bn_getlen(n) * 32; for (i=0; i<bits; i++) { bn_lshift1(xa); if (bn_cmp(xa, n)>=0) bn_sub(xa, n, xa); } bn_cpy(xa, b); } void bn_mont_mulmod(bn_t a, bn_t b, bn_t n, bn_t product) { bn_t np; bn_get_n_prime(n, np); bn_mont_mulmod_with_np(a, b, n, np, product); } /* * product = a * b mod n * * n is odd number * r*r^(-1) - n*n' = 1 * np is n' in the function * * The integers r^(−1) and n' can both be computed by the * Extended Euclidean Algorithm */ #if 1 /* better implementation */ void bn_mont_mulmod_with_np(bn_t a, bn_t b, bn_t n, bn_t np, bn_t product) { bn_t xa; /* _ * compute a = a * r mod n */ bn_axr_mod_n(a, n, xa); bn_mont_pro(xa, b, n, np, product); } #else void bn_mont_mulmod_with_np(bn_t a, bn_t b, bn_t n, bn_t np, bn_t product) { bn_t one, xa, xb; bn_setone(one); bn_axr_mod_m(a, n, xa); bn_axr_mod_m(b, n, xb); bn_mont_pro(xa, xb, n, np, product); bn_mont_pro(product, one, n, np, product); } #endif /* R mod n */ static void r_mod_n(bn_t r, bn_t n, bn_t r_n) { bn_sub(r, n, r_n); while (bn_cmp(r_n, n) >= 0) bn_sub(r_n, n, r_n); } void bn_get_n_prime(bn_t n, bn_t np) { bn_t R, m; bn_clear(R); if (bn_mont_pro == bn_mont_pro_1) { R[bn_getlen(n)] = 1; bn_cpy(n, m); /* R has half of BN_LEN for RSA signature creation and decryption */ } else if (bn_mont_pro == bn_mont_pro_3) { bn_qw2bn(1UL<<32, R); bn_clear(m); m[0] = n[0]; } if (bn_mont_pro != bn_mont_pro_2) { bn_eea(m, R, np, NULL, NULL); if (np[BN_LEN-1] & 1<<31) bn_clear(R); bn_sub(R, np, np); } } /* * HAC 14.94 Algorithm Montgomery exponentiation * y = x^e mod n */ void bn_mont_expmod(bn_t x, bn_t e, bn_t n, bn_t y) { int i, t; bn_t one, R, A, np, xt, r_n, r2_n; bn_get_n_prime(n, np); bn_clear(R); R[bn_getlen(n)] = 1; /* calculate r_n = R mod n */ r_mod_n(R, n, r_n); /* * calculate r2_n = R^2 mod n * A*B mod N = ((A mod N) * (B mod N)) mod N */ bn_mont_mulmod_with_np(r_n, r_n, n, np, r2_n); /* 1 */ bn_mont_pro(x, r2_n, n, np, xt); bn_cpy(r_n, A); t = bn_getmsbposn(e) - 1; /* 2 */ for (i=t; i>=0; i--) { /* 2.1 */ bn_mont_pro(A, A, n, np, A); /* 2.2 */ if (bn_getbit(e, i)) { bn_mont_pro(A, xt, n, np, A); } } /* 3 */ bn_setone(one); bn_mont_pro(A, one, n, np, y); } //=============================================================
19.64727
106
0.540459
073ec70ba3191ade503b6f3b9baf91a281aff9e6
11,883
c
C
crypto_aead/aes128cpfbv1/evp/encrypt.c
iadgov/simon-speck-supercop
5bba85c3094029eb73b7077441e5c6ea2f2cb1c6
[ "CC0-1.0" ]
21
2016-12-03T14:19:01.000Z
2018-03-09T14:52:25.000Z
crypto_aead/aes128cpfbv1/evp/encrypt.c
iadgov/simon-speck-supercop
5bba85c3094029eb73b7077441e5c6ea2f2cb1c6
[ "CC0-1.0" ]
null
null
null
crypto_aead/aes128cpfbv1/evp/encrypt.c
iadgov/simon-speck-supercop
5bba85c3094029eb73b7077441e5c6ea2f2cb1c6
[ "CC0-1.0" ]
11
2017-03-06T17:21:42.000Z
2018-03-18T03:52:58.000Z
/* * CPFB version 1.0 * @author Miguel Montes * @author Daniel Penazzi * * To the extent possible under law, the authors have waived all copyright * and related or neighboring rights to the source code in this file. * http://creativecommons.org/publicdomain/zero/1.0/ */ /* Notes about this version * This version of CPFB has been implemented using the EVP interface of OpenSSL. * It uses AES-NI when available. * It assumes that EVP_EncryptUpdate, in ECB mode, returns as many blocks as it * has been given as input, at least when the number of blocks is 1, 4 or 8. * For simplicity, it does not implement re-keying for long messages so the maximum * message length of this implementation is (2**32 - 1) 96-bit blocks * (12 bytes short of 48 GB). */ #include "crypto_aead.h" #include "api.h" #include <openssl/evp.h> #include <string.h> #define USE_CRYPTO_INT #ifdef USE_CRYPTO_INT #include "crypto_uint64.h" #include "crypto_uint32.h" #else #include <stdint.h> typedef uint64_t crypto_uint64; typedef uint32_t crypto_uint32; #endif /* Set to zero if data is not 32 bit aligned */ #ifndef CPFB_IS_ALIGNED #define CPFB_IS_ALIGNED 1 #endif #if CRYPTO_KEYBYTES == 16 #define AES_ROUNDS 10 #define KEYBITS 128 #define KEY_LENGTH 16 #define AES_set_key(userkey,key) EVP_CIPHER_CTX_init(key); EVP_EncryptInit_ex(key, EVP_aes_128_ecb( ), NULL, userkey, NULL) #elif CRYPTO_KEYBYTES == 32 #define AES_ROUNDS 14 #define KEYBITS 256 #define KEY_LENGTH 32 #define AES_set_key(userkey,key) EVP_CIPHER_CTX_init(key); EVP_EncryptInit_ex(key, EVP_aes_256_ecb( ), NULL, userkey, NULL) #else #error "Unknown Key Length" #endif #define AES_encrypt(in,out,ctx) {int outl; EVP_EncryptUpdate(ctx, out, &outl , in, 16);} #define TAG_LENGTH CRYPTO_ABYTES #define NONCE_LENGTH CRYPTO_NPUBBYTES #define BLOCK_LENGTH 16 #define NONCE_TYPE (CRYPTO_NPUBBYTES-8) #define NONCE_INCREMENT 8 #define PAYLOAD_SIZE 12 #define BPI 8 #if __GNUC__ #define bswap32(x) __builtin_bswap32(x) #define inline __inline #elif _MSC_VER #define bswap32(x) _byteswap_ulong(x) #define inline __forceinline #endif #if (defined(__i386__) || defined(__x86_64__)) && defined(bswap32) #define store32(x,u) { *((crypto_uint32*)(x)) = bswap32((crypto_uint32)(u)); } #else static void store32(unsigned char *x, unsigned long long u) { int i; for (i = 3; i >= 0; --i) { x[i] = (unsigned char)u; u >>= 8; } } #endif static void store64(unsigned char *x, unsigned long long u) { int i; for (i = 7; i >= 0; --i) { x[i] = (unsigned char)u; u >>= 8; } } typedef union { unsigned char u8[16]; crypto_uint32 u32[4]; crypto_uint64 u64[2]; } u128; #if CPFB_IS_ALIGNED == 1 static inline void xor128(const unsigned char* a, const unsigned char* b, unsigned char* x){ u128* aa = (u128*) a; u128* bb = (u128*) b; u128* xx = (u128*) x; xx->u64[0] = aa->u64[0] ^ bb->u64[0]; xx->u64[1] = aa->u64[1] ^ bb->u64[1]; } static inline void xor96(const unsigned char* a, const unsigned char* b, unsigned char* x){ u128* aa = (u128*) a; u128* bb = (u128*) b; u128* xx = (u128*) x; xx->u32[0] = aa->u32[0] ^ bb->u32[0]; xx->u32[1] = aa->u32[1] ^ bb->u32[1]; xx->u32[2] = aa->u32[2] ^ bb->u32[2]; } #else static inline void xor128(const unsigned char* a, const unsigned char* b, unsigned char* x){ int i; for(i=0; i < 16; i++) x[i] = a[i]^b[i]; } static inline void xor96(const unsigned char* a, const unsigned char* b, unsigned char* x){ int i; for(i=0; i < 12; i++) x[i] = a[i]^b[i]; } #endif static inline int verify_tag(const unsigned char* a, const unsigned char* b){ int i; unsigned char res = 0; for (i=0; i < TAG_LENGTH; i++) res |= a[i] ^ b[i]; return res == 0 ? 0 : -1; } static void set_nonce(unsigned char* nonce, const unsigned char* npub){ int i; for (i = 0; i < NONCE_LENGTH; ++i) nonce[i] = npub[i]; for (i = NONCE_LENGTH; i < BLOCK_LENGTH -1; i++) nonce[i] = 0; nonce[BLOCK_LENGTH -1] = (unsigned char) NONCE_TYPE; } static void inc_nonce(unsigned char* nonce){ int i; nonce[BLOCK_LENGTH -1] = (unsigned char)(nonce[BLOCK_LENGTH -1] + NONCE_INCREMENT); if (nonce[BLOCK_LENGTH-1] != NONCE_TYPE) return; for (i = BLOCK_LENGTH-2; i > NONCE_LENGTH; i++) if (++nonce[i]) return; } static void gen_kappa(unsigned char* nonce, unsigned char* kappa, EVP_CIPHER_CTX ctx_key[1]){ AES_encrypt(nonce,kappa,ctx_key); #if KEYBITS == 256 AES_encrypt(kappa,kappa+16,ctx_key); #endif } int crypto_aead_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k) { unsigned char kappa_0[KEY_LENGTH]; unsigned char kappa_m[KEY_LENGTH]; EVP_CIPHER_CTX ctx_k[1]; EVP_CIPHER_CTX ctx_kappa_0[1]; EVP_CIPHER_CTX ctx_kappa_m[1]; unsigned char nonce[BLOCK_LENGTH]; unsigned char X[BLOCK_LENGTH]; unsigned char P[BLOCK_LENGTH*BPI]; unsigned char stream[BLOCK_LENGTH*(BPI+1)]; unsigned long long i; unsigned long long counter; (void)nsec; /* avoid warning */ *clen = mlen + TAG_LENGTH; AES_set_key(k, ctx_k); /* Generation of the first kappa */ set_nonce(nonce,npub); gen_kappa(nonce, kappa_0, ctx_k); AES_set_key(kappa_0, ctx_kappa_0); /* Block encoding alen and mlen * In an online implementation, it would be done at the end, and X would be 0 */ store64(X , mlen); store32(X + 8, adlen); store32(X + 12, 0); AES_encrypt(X, X, ctx_kappa_0); /* AD processing */ counter = 0; while (adlen >= PAYLOAD_SIZE*BPI){ unsigned char* p = P; int outl; for(i = 0; i < BPI; i++){ memcpy(p,ad,PAYLOAD_SIZE); store32(p+PAYLOAD_SIZE,++counter); p+=BLOCK_LENGTH; ad+=PAYLOAD_SIZE; } EVP_EncryptUpdate(ctx_kappa_0,stream,&outl,P,BPI*BLOCK_LENGTH); for(i = 0; i < BPI; i++) xor128(X,stream+(i*BLOCK_LENGTH),X); adlen -= BPI*PAYLOAD_SIZE; } while (adlen >= PAYLOAD_SIZE*4){ unsigned char* p = P; int outl; for(i = 0; i < 4; i++){ memcpy(p,ad,PAYLOAD_SIZE); store32(p+PAYLOAD_SIZE,++counter); p+=BLOCK_LENGTH; ad+=PAYLOAD_SIZE; } EVP_EncryptUpdate(ctx_kappa_0,stream,&outl,P,4*BLOCK_LENGTH); for(i = 0; i < 4; i++) xor128(X,stream+(i*BLOCK_LENGTH),X); adlen -= 4*PAYLOAD_SIZE; } while (adlen > 0) { unsigned long long blocklen = PAYLOAD_SIZE; if (adlen < blocklen) blocklen = adlen; for (i = 0; i < blocklen; i++) P[i] = ad[i]; for (i = blocklen; i < PAYLOAD_SIZE; i++) P[i] = 0; ++counter; store32(P + PAYLOAD_SIZE, counter); AES_encrypt(P, stream, ctx_kappa_0); xor128(X, stream, X); ad += blocklen; adlen -= blocklen; } /* Plaintext processing */ if (mlen > 0) { /* New kappa */ inc_nonce(nonce); gen_kappa(nonce, kappa_m, ctx_k); AES_set_key(kappa_m, ctx_kappa_m); counter = 0; /* P_0 processing */ for (i = 0; i < BLOCK_LENGTH; i++) P[i] = kappa_0[i]; AES_encrypt(P, stream, ctx_kappa_m); while (mlen >= PAYLOAD_SIZE*BPI){ unsigned char* p = P; unsigned char* s = stream; int outl; for(i = 0; i < BPI; i++){ memcpy(p,m+(i*PAYLOAD_SIZE),PAYLOAD_SIZE); store32(p+PAYLOAD_SIZE,++counter); xor128(p,kappa_0,p); p+=BLOCK_LENGTH; } EVP_EncryptUpdate(ctx_kappa_m,stream+BLOCK_LENGTH,&outl,P,BLOCK_LENGTH*BPI); for(i =0; i < BPI; i++){ xor96(m,s,c); s+=BLOCK_LENGTH; xor128(X,s,X); m+=PAYLOAD_SIZE; c+=PAYLOAD_SIZE; } memcpy(stream,s,BLOCK_LENGTH); mlen -= PAYLOAD_SIZE*BPI; } while (mlen > 0) { unsigned long long blocklen = PAYLOAD_SIZE; if (mlen < blocklen) blocklen = mlen; for (i = 0; i < blocklen; ++i) { P[i] = m[i]; c[i] = m[i] ^ stream[i]; } for (i = blocklen; i < PAYLOAD_SIZE; i++) P[i] = 0; ++counter; store32(P + PAYLOAD_SIZE, counter); xor128(P, kappa_0, P); AES_encrypt(P, stream, ctx_kappa_m); xor128(X, stream, X); c += blocklen; m += blocklen; mlen -= blocklen; } } AES_encrypt(X, X, ctx_kappa_0); for (i = 0; i < TAG_LENGTH; i++) c[i] = X[i]; return 0; } int crypto_aead_decrypt(unsigned char *m, unsigned long long *outputmlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) { unsigned char kappa_0[KEY_LENGTH]; unsigned char kappa_m[KEY_LENGTH]; EVP_CIPHER_CTX ctx_k[1]; EVP_CIPHER_CTX ctx_kappa_0[1]; EVP_CIPHER_CTX ctx_kappa_m[1]; unsigned char nonce[BLOCK_LENGTH]; unsigned char X[BLOCK_LENGTH]; unsigned char P[BLOCK_LENGTH*BPI]; unsigned char stream[BLOCK_LENGTH*BPI]; unsigned long long i; unsigned long long counter; unsigned long long mlen; (void)nsec; /* avoid warning */ if (clen < TAG_LENGTH) return -1; *outputmlen = mlen = clen - TAG_LENGTH; AES_set_key(k, ctx_k); /* Generation of the first kappa */ set_nonce(nonce,npub); gen_kappa(nonce, kappa_0, ctx_k); AES_set_key(kappa_0, ctx_kappa_0); /* Block encoding alen and mlen * In an online implementation, it would be done at the end, and X would be 0 */ store64(X, mlen); store32(X + 8, adlen); store32(X + 12, 0); AES_encrypt(X, X, ctx_kappa_0); /* AD processing */ counter = 0; while (adlen >= PAYLOAD_SIZE*BPI){ unsigned char* p = P; int outl; for(i = 0; i < BPI; i++){ memcpy(p,ad,PAYLOAD_SIZE); store32(p+PAYLOAD_SIZE,++counter); p+=BLOCK_LENGTH; ad+=PAYLOAD_SIZE; } EVP_EncryptUpdate(ctx_kappa_0,stream,&outl,P,BPI*BLOCK_LENGTH); for(i = 0; i < BPI; i++) xor128(X,stream+(i*BLOCK_LENGTH),X); adlen -= BPI*PAYLOAD_SIZE; } while (adlen >= PAYLOAD_SIZE*4){ unsigned char* p = P; int outl; for(i = 0; i < 4; i++){ memcpy(p,ad,PAYLOAD_SIZE); store32(p+PAYLOAD_SIZE,++counter); p+=BLOCK_LENGTH; ad+=PAYLOAD_SIZE; } EVP_EncryptUpdate(ctx_kappa_0,stream,&outl,P,4*BLOCK_LENGTH); for(i = 0; i < 4; i++) xor128(X,stream+(i*BLOCK_LENGTH),X); adlen -= 4*PAYLOAD_SIZE; } while (adlen > 0) { unsigned long long blocklen = PAYLOAD_SIZE; if (adlen < blocklen) blocklen = adlen; for (i = 0; i < blocklen; i++) P[i] = ad[i]; for (i = blocklen; i < PAYLOAD_SIZE; i++) P[i] = 0; ++counter; store32(P + PAYLOAD_SIZE, counter); AES_encrypt(P, stream, ctx_kappa_0); xor128(X, stream, X); ad += blocklen; adlen -= blocklen; } /* Plaintext processing */ if (mlen > 0) { /* New kappa */ inc_nonce(nonce); gen_kappa(nonce, kappa_m, ctx_k); AES_set_key(kappa_m, ctx_kappa_m); counter = 0; /* P_0 processing */ for (i = 0; i < BLOCK_LENGTH; i++) P[i] = kappa_0[i]; AES_encrypt(P, stream, ctx_kappa_m); while (mlen > PAYLOAD_SIZE) { for (i = 0; i < PAYLOAD_SIZE; ++i) { m[i] = c[i] ^ stream[i]; P[i] = m[i]; } ++counter; store32(P + PAYLOAD_SIZE, counter); xor128(P, kappa_0, P); AES_encrypt(P, stream, ctx_kappa_m); xor128(X, stream, X); c += PAYLOAD_SIZE; m += PAYLOAD_SIZE; mlen -= PAYLOAD_SIZE; } if (mlen > 0) { for (i = 0; i < mlen; ++i) { m[i] = c[i] ^ stream[i]; P[i] = m[i]; } for (i = mlen; i < PAYLOAD_SIZE; i++) P[i] = 0; ++counter; store32(P + PAYLOAD_SIZE, counter); xor128(P, kappa_0, P); AES_encrypt(P, stream, ctx_kappa_m); xor128(X, stream, X); c += mlen; } } AES_encrypt(X, X, ctx_kappa_0); return verify_tag(c,X); }
26.174009
123
0.629555
60b1bca5dc6b68f43e9e3f07c44965f0babb0cd1
7,655
h
C
DataCollector/mozilla/xulrunner-sdk/include/nsIStartupCache.h
andrasigneczi/TravelOptimiser
b08805f97f0823fd28975a36db67193386aceb22
[ "Apache-2.0" ]
1
2016-04-20T08:35:44.000Z
2016-04-20T08:35:44.000Z
DataCollector/mozilla/xulrunner-sdk/include/nsIStartupCache.h
andrasigneczi/TravelOptimiser
b08805f97f0823fd28975a36db67193386aceb22
[ "Apache-2.0" ]
null
null
null
DataCollector/mozilla/xulrunner-sdk/include/nsIStartupCache.h
andrasigneczi/TravelOptimiser
b08805f97f0823fd28975a36db67193386aceb22
[ "Apache-2.0" ]
null
null
null
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsIStartupCache.idl */ #ifndef __gen_nsIStartupCache_h__ #define __gen_nsIStartupCache_h__ #ifndef __gen_nsIInputStream_h__ #include "nsIInputStream.h" #endif #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif #ifndef __gen_nsIObserver_h__ #include "nsIObserver.h" #endif #ifndef __gen_nsIObjectOutputStream_h__ #include "nsIObjectOutputStream.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsIStartupCache */ #define NS_ISTARTUPCACHE_IID_STR "25957820-90a1-428c-8739-b0845d3cc534" #define NS_ISTARTUPCACHE_IID \ {0x25957820, 0x90a1, 0x428c, \ { 0x87, 0x39, 0xb0, 0x84, 0x5d, 0x3c, 0xc5, 0x34 }} class NS_NO_VTABLE nsIStartupCache : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTARTUPCACHE_IID) /* uint32_t getBuffer (in string aID, out charPtr aBuffer); */ NS_IMETHOD GetBuffer(const char * aID, char **aBuffer, uint32_t *_retval) = 0; /* void putBuffer (in string aID, in string aBuffer, in uint32_t aLength); */ NS_IMETHOD PutBuffer(const char * aID, const char * aBuffer, uint32_t aLength) = 0; /* void invalidateCache (); */ NS_IMETHOD InvalidateCache(void) = 0; /* void ignoreDiskCache (); */ NS_IMETHOD IgnoreDiskCache(void) = 0; /* nsIObjectOutputStream getDebugObjectOutputStream (in nsIObjectOutputStream aStream); */ NS_IMETHOD GetDebugObjectOutputStream(nsIObjectOutputStream *aStream, nsIObjectOutputStream * *_retval) = 0; /* boolean startupWriteComplete (); */ NS_IMETHOD StartupWriteComplete(bool *_retval) = 0; /* void resetStartupWriteTimer (); */ NS_IMETHOD ResetStartupWriteTimer(void) = 0; /* void recordAgesAlways (); */ NS_IMETHOD RecordAgesAlways(void) = 0; /* readonly attribute nsIObserver observer; */ NS_IMETHOD GetObserver(nsIObserver * *aObserver) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIStartupCache, NS_ISTARTUPCACHE_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSISTARTUPCACHE \ NS_IMETHOD GetBuffer(const char * aID, char **aBuffer, uint32_t *_retval) override; \ NS_IMETHOD PutBuffer(const char * aID, const char * aBuffer, uint32_t aLength) override; \ NS_IMETHOD InvalidateCache(void) override; \ NS_IMETHOD IgnoreDiskCache(void) override; \ NS_IMETHOD GetDebugObjectOutputStream(nsIObjectOutputStream *aStream, nsIObjectOutputStream * *_retval) override; \ NS_IMETHOD StartupWriteComplete(bool *_retval) override; \ NS_IMETHOD ResetStartupWriteTimer(void) override; \ NS_IMETHOD RecordAgesAlways(void) override; \ NS_IMETHOD GetObserver(nsIObserver * *aObserver) override; /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSISTARTUPCACHE(_to) \ NS_IMETHOD GetBuffer(const char * aID, char **aBuffer, uint32_t *_retval) override { return _to GetBuffer(aID, aBuffer, _retval); } \ NS_IMETHOD PutBuffer(const char * aID, const char * aBuffer, uint32_t aLength) override { return _to PutBuffer(aID, aBuffer, aLength); } \ NS_IMETHOD InvalidateCache(void) override { return _to InvalidateCache(); } \ NS_IMETHOD IgnoreDiskCache(void) override { return _to IgnoreDiskCache(); } \ NS_IMETHOD GetDebugObjectOutputStream(nsIObjectOutputStream *aStream, nsIObjectOutputStream * *_retval) override { return _to GetDebugObjectOutputStream(aStream, _retval); } \ NS_IMETHOD StartupWriteComplete(bool *_retval) override { return _to StartupWriteComplete(_retval); } \ NS_IMETHOD ResetStartupWriteTimer(void) override { return _to ResetStartupWriteTimer(); } \ NS_IMETHOD RecordAgesAlways(void) override { return _to RecordAgesAlways(); } \ NS_IMETHOD GetObserver(nsIObserver * *aObserver) override { return _to GetObserver(aObserver); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSISTARTUPCACHE(_to) \ NS_IMETHOD GetBuffer(const char * aID, char **aBuffer, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBuffer(aID, aBuffer, _retval); } \ NS_IMETHOD PutBuffer(const char * aID, const char * aBuffer, uint32_t aLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->PutBuffer(aID, aBuffer, aLength); } \ NS_IMETHOD InvalidateCache(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InvalidateCache(); } \ NS_IMETHOD IgnoreDiskCache(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IgnoreDiskCache(); } \ NS_IMETHOD GetDebugObjectOutputStream(nsIObjectOutputStream *aStream, nsIObjectOutputStream * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDebugObjectOutputStream(aStream, _retval); } \ NS_IMETHOD StartupWriteComplete(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->StartupWriteComplete(_retval); } \ NS_IMETHOD ResetStartupWriteTimer(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetStartupWriteTimer(); } \ NS_IMETHOD RecordAgesAlways(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RecordAgesAlways(); } \ NS_IMETHOD GetObserver(nsIObserver * *aObserver) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetObserver(aObserver); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsStartupCache : public nsIStartupCache { public: NS_DECL_ISUPPORTS NS_DECL_NSISTARTUPCACHE nsStartupCache(); private: ~nsStartupCache(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS(nsStartupCache, nsIStartupCache) nsStartupCache::nsStartupCache() { /* member initializers and constructor code */ } nsStartupCache::~nsStartupCache() { /* destructor code */ } /* uint32_t getBuffer (in string aID, out charPtr aBuffer); */ NS_IMETHODIMP nsStartupCache::GetBuffer(const char * aID, char **aBuffer, uint32_t *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } /* void putBuffer (in string aID, in string aBuffer, in uint32_t aLength); */ NS_IMETHODIMP nsStartupCache::PutBuffer(const char * aID, const char * aBuffer, uint32_t aLength) { return NS_ERROR_NOT_IMPLEMENTED; } /* void invalidateCache (); */ NS_IMETHODIMP nsStartupCache::InvalidateCache() { return NS_ERROR_NOT_IMPLEMENTED; } /* void ignoreDiskCache (); */ NS_IMETHODIMP nsStartupCache::IgnoreDiskCache() { return NS_ERROR_NOT_IMPLEMENTED; } /* nsIObjectOutputStream getDebugObjectOutputStream (in nsIObjectOutputStream aStream); */ NS_IMETHODIMP nsStartupCache::GetDebugObjectOutputStream(nsIObjectOutputStream *aStream, nsIObjectOutputStream * *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } /* boolean startupWriteComplete (); */ NS_IMETHODIMP nsStartupCache::StartupWriteComplete(bool *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } /* void resetStartupWriteTimer (); */ NS_IMETHODIMP nsStartupCache::ResetStartupWriteTimer() { return NS_ERROR_NOT_IMPLEMENTED; } /* void recordAgesAlways (); */ NS_IMETHODIMP nsStartupCache::RecordAgesAlways() { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute nsIObserver observer; */ NS_IMETHODIMP nsStartupCache::GetObserver(nsIObserver * *aObserver) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIStartupCache_h__ */
38.275
210
0.749314
e4beff973c27083c7c3d8e365727fe74a2d73088
5,015
h
C
chrome/browser/android/bookmarks/partner_bookmarks_reader.h
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2022-02-10T00:36:35.000Z
2022-02-10T00:36:35.000Z
chrome/browser/android/bookmarks/partner_bookmarks_reader.h
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/android/bookmarks/partner_bookmarks_reader.h
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_READER_H_ #define CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_READER_H_ #include <stdint.h> #include <memory> #include "base/android/jni_weak_ref.h" #include "components/bookmarks/browser/bookmark_node.h" #include "components/favicon_base/favicon_types.h" namespace favicon { class LargeIconService; } class PartnerBookmarksShim; class Profile; // Generates a partner bookmark hierarchy and handles submitting the results to // the global PartnerBookmarksShim. class PartnerBookmarksReader { public: PartnerBookmarksReader(PartnerBookmarksShim* partner_bookmarks_shim, Profile* profile); PartnerBookmarksReader(const PartnerBookmarksReader&) = delete; PartnerBookmarksReader& operator=(const PartnerBookmarksReader&) = delete; ~PartnerBookmarksReader(); // JNI methods void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); void Reset(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); jlong AddPartnerBookmark( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jstring>& jurl, const base::android::JavaParamRef<jstring>& jtitle, jboolean is_folder, jlong parent_id, const base::android::JavaParamRef<jbyteArray>& favicon, const base::android::JavaParamRef<jbyteArray>& touchicon, jboolean fetch_uncached_favicons_from_server, jint desired_favicon_size_px, // Callback<FaviconFetchResult> const base::android::JavaParamRef<jobject>& j_callback); void PartnerBookmarksCreationComplete( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); static std::unique_ptr<bookmarks::BookmarkNode> CreatePartnerBookmarksRootForTesting(); private: // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.partnerbookmarks enum class FaviconFetchResult { // Successfully fetched a favicon from cache or server. // Deprecated, SUCCESS_FROM_CACHE and SUCCESS_FROM_SERVER should be used. DEPRECATED_SUCCESS = 0, // Received a server error fetching the favicon. FAILURE_SERVER_ERROR, // The icon service was unavailable. FAILURE_ICON_SERVICE_UNAVAILABLE, // There was nothing in the cache, but we opted out of retrieving from // server. FAILURE_NOT_IN_CACHE, // Request sent out and a connection error occurred (no valid HTTP response // received). FAILURE_CONNECTION_ERROR, // Success fetching the favicon from the cache without reaching out to the // server. SUCCESS_FROM_CACHE, // Success fetching the favicon from server. SUCCESS_FROM_SERVER, // Failed to write the favicon to cache, likely from attempting to add a // duplicate. FAILURE_WRITING_FAVICON_CACHE, // Boundary value for UMA. UMA_BOUNDARY, }; using FaviconFetchedCallback = base::OnceCallback<void(FaviconFetchResult)>; favicon::LargeIconService* GetLargeIconService(); void GetFavicon(const GURL& page_url, Profile* profile, bool fallback_to_server, int desired_favicon_size_px, FaviconFetchedCallback callback); void GetFaviconImpl(const GURL& page_url, Profile* profile, bool fallback_to_server, int desired_favicon_size_px, FaviconFetchedCallback callback); void GetFaviconFromCacheOrServer(const GURL& page_url, bool fallback_to_server, bool from_server, int desired_favicon_size_px, FaviconFetchedCallback callback); void OnGetFaviconFromCacheFinished( const GURL& page_url, FaviconFetchedCallback callback, bool fallback_to_server, bool from_server, int desired_favicon_size_px, const favicon_base::LargeIconResult& result); void OnGetFaviconFromServerFinished( const GURL& page_url, int desired_favicon_size_px, FaviconFetchedCallback callback, favicon_base::GoogleFaviconServerRequestStatus status); void OnFaviconFetched(const base::android::JavaRef<jobject>& j_callback, FaviconFetchResult result); PartnerBookmarksShim* partner_bookmarks_shim_; Profile* profile_; favicon::LargeIconService* large_icon_service_; base::CancelableTaskTracker favicon_task_tracker_; // JNI std::unique_ptr<bookmarks::BookmarkNode> wip_partner_bookmarks_root_; int64_t wip_next_available_id_; }; #endif // CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_READER_H_
37.706767
79
0.721236
e4fbc7a645ea20abfde170c81f2761154e9a701d
1,844
h
C
AXTransparentNavigationBar/Classes/UINavigationBar+Transparent.h
devedbox/AXTransparentNavigationBar
efadd0ca6cee7a076b60533940b2b7286611bfc8
[ "MIT" ]
null
null
null
AXTransparentNavigationBar/Classes/UINavigationBar+Transparent.h
devedbox/AXTransparentNavigationBar
efadd0ca6cee7a076b60533940b2b7286611bfc8
[ "MIT" ]
null
null
null
AXTransparentNavigationBar/Classes/UINavigationBar+Transparent.h
devedbox/AXTransparentNavigationBar
efadd0ca6cee7a076b60533940b2b7286611bfc8
[ "MIT" ]
null
null
null
// // UINavigationBar+Transparent.h // AXTransparentNavigationBar // // Created by devedbox on 16/9/2. // Copyright © 2016年 devedbox. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #import <UIKit/UIKit.h> @interface UINavigationBar (Transparent) /// Set transparent of navigation bar. /// @property(assign, nonatomic, getter=isTransparent) BOOL transparent; // Animation method. - (void)setTransparent:(BOOL)transparent animated:(BOOL)animated; @end @interface UIViewController (NavigationBarTransparent) /// Is navigation bar transparent. @property(assign, nonatomic, getter=isNavigationBarTransparent) BOOL navigationBarTransparent; /// Set navigation tarnsparent animated. - (void)setNavigationBarTransparent:(BOOL)navigationBarTransparent animated:(BOOL)animated; @end
43.904762
94
0.77115
8e45c516ebf728b95f4f23315fd4ffdb2f83c771
1,557
c
C
static_queue/main.c
roberwill/data_structures
5804097418dc90719fe37f89fbd05f1daf9a1585
[ "MIT" ]
1
2020-05-27T20:33:28.000Z
2020-05-27T20:33:28.000Z
static_queue/main.c
roberwill/data_structures
5804097418dc90719fe37f89fbd05f1daf9a1585
[ "MIT" ]
null
null
null
static_queue/main.c
roberwill/data_structures
5804097418dc90719fe37f89fbd05f1daf9a1585
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #include "queue.h" void print_if(int condition, char* title, char* yes, char* no) { #ifndef nil #define nil NULL #endif if (title != nil) printf("%s = ", title); if (condition) { if (yes == nil) printf("Yes!\n"); else printf("%s", yes); } else { if (no == nil) printf("No!\n"); else printf("%s", no); } } int main() { Queue q; QueueItem item, removed_item; init(&q); print_if(is_empty(&q), "Empty", nil, nil); print_if(is_full(&q), "Full", nil, nil); printf("Length: %d\n", size(&q)); print(&q); item.number = 12; enqueue(&q, &item); item.number = 22; enqueue(&q, &item); item.number = 33; enqueue(&q, &item); item.number = 44; enqueue(&q, &item); item.number = 55; enqueue(&q, &item); item.number = 666; print_if(enqueue(&q, &item), "Inserted", nil, nil); print_if(is_empty(&q), "Empty", nil, nil); print_if(is_full(&q), "Full", nil, nil); printf("Length: %d\n", size(&q)); print(&q); dequeue(&q, &removed_item); printf("Removed %d\n", removed_item.number); dequeue(&q, &removed_item); printf("Removed %d\n", removed_item.number); dequeue(&q, &removed_item); printf("Removed %d\n", removed_item.number); print_if(is_empty(&q), "Empty", nil, nil); print_if(is_full(&q), "Full", nil, nil); printf("Length: %d\n", size(&q)); print(&q); return 0; }
20.486842
64
0.529223
69af1b1c4788fcedbe7de49f8785077d5e8370a3
5,411
c
C
DIR819_v1.06/src/opensource/dlna/dlna_intel/ushare/ushare-1.1a/src/cms.c
Sirherobrine23/Dir819gpl_code
8af92d65416198755974e3247b7bbe7f1151d525
[ "BSD-2-Clause" ]
1
2022-03-19T06:38:01.000Z
2022-03-19T06:38:01.000Z
DIR819_v1.06/src/opensource/dlna/dlna_intel/ushare/ushare-1.1a/src/cms.c
Sirherobrine23/Dir819gpl_code
8af92d65416198755974e3247b7bbe7f1151d525
[ "BSD-2-Clause" ]
null
null
null
DIR819_v1.06/src/opensource/dlna/dlna_intel/ushare/ushare-1.1a/src/cms.c
Sirherobrine23/Dir819gpl_code
8af92d65416198755974e3247b7bbe7f1151d525
[ "BSD-2-Clause" ]
1
2022-03-19T06:38:03.000Z
2022-03-19T06:38:03.000Z
/* * cms.c : GeeXboX uShare Connection Management Service. * Originally developped for the GeeXboX project. * Parts of the code are originated from GMediaServer from Oskar Liljeblad. * Copyright (C) 2005-2007 Benjamin Zores <ben@geexbox.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdlib.h> #include <upnp/upnp.h> #include <upnp/upnptools.h> #include "ushare.h" #include "services.h" #include "mime.h" /* Represent the CMS GetProtocolInfo action. */ #define SERVICE_CMS_ACTION_PROT_INFO "GetProtocolInfo" /* Represent the CMS GetCurrentConnectionIDs action. */ #define SERVICE_CMS_ACTION_CON_ID "GetCurrentConnectionIDs" /* Represent the CMS GetCurrentConnectionInfo action. */ #define SERVICE_CMS_ACTION_CON_INFO "GetCurrentConnectionInfo" /* Represent the CMS SOURCE argument. */ #define SERVICE_CMS_ARG_SOURCE "Source" /* Represent the CMS SINK argument. */ #define SERVICE_CMS_ARG_SINK "Sink" /* Represent the CMS ConnectionIDs argument. */ #define SERVICE_CMS_ARG_CONNECTION_IDS "ConnectionIDs" /* Represent the CMS ConnectionID argument. */ #define SERVICE_CMS_ARG_CONNECTION_ID "ConnectionID" /* Represent the CMS RcsID argument. */ #define SERVICE_CMS_ARG_RCS_ID "RcsID" /* Represent the CMS AVTransportID argument. */ #define SERVICE_CMS_ARG_TRANSPORT_ID "AVTransportID" /* Represent the CMS ProtocolInfo argument. */ #define SERVICE_CMS_ARG_PROT_INFO "ProtocolInfo" /* Represent the CMS PeerConnectionManager argument. */ #define SERVICE_CMS_ARG_PEER_CON_MANAGER "PeerConnectionManager" /* Represent the CMS PeerConnectionID argument. */ #define SERVICE_CMS_ARG_PEER_CON_ID "PeerConnectionID" /* Represent the CMS Direction argument. */ #define SERVICE_CMS_ARG_DIRECTION "Direction" /* Represent the CMS Status argument. */ #define SERVICE_CMS_ARG_STATUS "Status" /* Represent the CMS default connection ID value. */ #define SERVICE_CMS_DEFAULT_CON_ID "0" /* Represent the CMS unknown connection ID value. */ #define SERVICE_CMS_UNKNOW_ID "-1" /* Represent the CMS Output value. */ #define SERVICE_CMS_OUTPUT "Output" /* Represent the CMS Success Status. */ #define SERVICE_CMS_STATUS_OK "OK" static bool cms_get_protocol_info (struct action_event_t *event) { extern struct mime_type_t MIME_Type_List[]; struct mime_type_t *list; char *respText = NULL, *respPtr; size_t respLen = 0, len; if (!event) return false; // calculating length of response list = MIME_Type_List; while (list->extension) { char *protocol = mime_get_protocol (list); respLen += strlen (protocol) + 1; free (protocol); list++; } respText = (char*) malloc (respLen * sizeof (char)); if (!respText) return event->status; list = MIME_Type_List; respPtr = respText; while (list->extension) { char *protocol = mime_get_protocol (list); len = strlen (protocol); strncpy (respPtr, protocol, len); free (protocol); respPtr += len; list++; if (list->extension) strcpy (respPtr++, ","); } *respPtr = '\0'; upnp_add_response (event, SERVICE_CMS_ARG_SOURCE, respText); upnp_add_response (event, SERVICE_CMS_ARG_SINK, ""); free (respText); return event->status; } static bool cms_get_current_connection_ids (struct action_event_t *event) { if (!event) return false; upnp_add_response (event, SERVICE_CMS_ARG_CONNECTION_IDS, ""); return event->status; } static bool cms_get_current_connection_info (struct action_event_t *event) { extern struct mime_type_t MIME_Type_List[]; struct mime_type_t *list = MIME_Type_List; if (!event) return false; upnp_add_response (event, SERVICE_CMS_ARG_CONNECTION_ID, SERVICE_CMS_DEFAULT_CON_ID); upnp_add_response (event, SERVICE_CMS_ARG_RCS_ID, SERVICE_CMS_UNKNOW_ID); upnp_add_response (event, SERVICE_CMS_ARG_TRANSPORT_ID, SERVICE_CMS_UNKNOW_ID); while (list->extension) { char *protocol = mime_get_protocol (list); upnp_add_response (event, SERVICE_CMS_ARG_PROT_INFO, protocol); free (protocol); list++; } upnp_add_response (event, SERVICE_CMS_ARG_PEER_CON_MANAGER, ""); upnp_add_response (event, SERVICE_CMS_ARG_PEER_CON_ID, SERVICE_CMS_UNKNOW_ID); upnp_add_response (event, SERVICE_CMS_ARG_DIRECTION, SERVICE_CMS_OUTPUT); upnp_add_response (event, SERVICE_CMS_ARG_STATUS, SERVICE_CMS_STATUS_OK); return event->status; } /* List of UPnP ConnectionManager Service actions */ struct service_action_t cms_service_actions[] = { { SERVICE_CMS_ACTION_PROT_INFO, cms_get_protocol_info }, { SERVICE_CMS_ACTION_CON_ID, cms_get_current_connection_ids }, { SERVICE_CMS_ACTION_CON_INFO, cms_get_current_connection_info }, { NULL, NULL } };
29.895028
75
0.748291
11337cf42cf8a5fef85146e922327d29f2dd3665
3,874
c
C
devkitPro/examples/switch/applet/vrmode/source/main.c
TheMindVirus/codemii
33822905b99aa816eb346f8572a9f4906094352c
[ "MIT" ]
null
null
null
devkitPro/examples/switch/applet/vrmode/source/main.c
TheMindVirus/codemii
33822905b99aa816eb346f8572a9f4906094352c
[ "MIT" ]
null
null
null
devkitPro/examples/switch/applet/vrmode/source/main.c
TheMindVirus/codemii
33822905b99aa816eb346f8572a9f4906094352c
[ "MIT" ]
null
null
null
// Include the most common headers from the C standard library #include <stdio.h> #include <stdlib.h> #include <string.h> // Include the main libnx system header, for Switch development #include <switch.h> // This example shows how to use VrMode, see also libnx applet.h and pctl.h. // TODO: This needs replaced with GL rendering, to handle the special VrMode rendering. // When running on pre-7.0.0, hbl has to run under the labo-vr application for the host application. // Main program entrypoint int main(int argc, char* argv[]) { Result rc = 0; bool pctlinit=0; // This example uses a text console, as a simple way to output text to the screen. // If you want to write a software-rendered graphics application, // take a look at the graphics/simplegfx example, which uses the libnx Framebuffer API instead. // If on the other hand you want to write an OpenGL based application, // take a look at the graphics/opengl set of examples, which uses EGL instead. consoleInit(NULL); // Configure our supported input layout: a single player with standard controller styles padConfigureInput(1, HidNpadStyleSet_NpadStandard); // Initialize the default gamepad (which reads handheld mode inputs as well as the first connected controller) PadState pad; padInitializeDefault(&pad); printf("VrMode example\n"); // Using pctl is optional. rc = pctlInitialize(); if (R_FAILED(rc)) printf("pctlInitialize(): 0x%x\n", rc); if (R_SUCCEEDED(rc)) pctlinit = 1; if (pctlinit) { printf("Press A to enable VrMode, B to disable, and X to check VrMode.\n"); } else { printf("VrMode functionality disabled since pctlInitialize failed.\n"); } printf("Press + to exit.\n"); // Main loop while (appletMainLoop()) { // Scan the gamepad. This should be done once for each frame padUpdate(&pad); // padGetButtonsDown returns the set of buttons that have been // newly pressed in this frame compared to the previous one u64 kDown = padGetButtonsDown(&pad); if (kDown & HidNpadButton_Plus) break; // break in order to return to hbmenu if (pctlinit) { if (kDown & HidNpadButton_A) { // Not sure what this is. /*rc = pctlConfirmStereoVisionPermission(); if (R_FAILED(rc)) printf("pctlConfirmStereoVisionPermission(): 0x%x\n", rc);*/ bool tmpflag=0; rc = pctlIsStereoVisionPermitted(&tmpflag); if (R_FAILED(rc)) printf("pctlIsStereoVisionPermitted(): 0x%x\n", rc); if (!tmpflag) printf("Parental Controls doesn't allow using VrMode.\n"); if (R_SUCCEEDED(rc) && tmpflag) { rc = appletSetVrModeEnabled(true); printf("appletSetVrModeEnabled(true): 0x%x\n", rc); } } else if (kDown & HidNpadButton_B) { rc = appletSetVrModeEnabled(false); printf("appletSetVrModeEnabled(false): 0x%x\n", rc); // See above comment. /*rc = pctlResetConfirmedStereoVisionPermission(); printf("pctlResetConfirmedStereoVisionPermission(): 0x%x\n", rc);*/ } else if (kDown & HidNpadButton_X) { bool flag=0; rc = appletIsVrModeEnabled(&flag); printf("appletIsVrModeEnabled(): 0x%x", rc); if (R_SUCCEEDED(rc)) printf(", %d\n", flag); printf("\n"); } } // Update the console, sending a new frame to the display consoleUpdate(NULL); } if (pctlinit) pctlExit(); // Deinitialize and clean up resources used by the console (important!) consoleExit(NULL); return 0; }
36.205607
114
0.615901
da441d74717c1b1ae96c46f85de1bd5ee1aaa6e1
1,562
h
C
imove_peopleextractor/src/ImageProcessing/PeopleExtractor.h
fbredius/IMOVE
912b4d0696e88acfc0ce7bc556eecf8fc423c4d3
[ "MIT" ]
3
2018-04-24T10:04:37.000Z
2018-05-11T08:27:03.000Z
imove_peopleextractor/src/ImageProcessing/PeopleExtractor.h
fbredius/IMOVE
912b4d0696e88acfc0ce7bc556eecf8fc423c4d3
[ "MIT" ]
null
null
null
imove_peopleextractor/src/ImageProcessing/PeopleExtractor.h
fbredius/IMOVE
912b4d0696e88acfc0ce7bc556eecf8fc423c4d3
[ "MIT" ]
3
2018-05-16T08:44:19.000Z
2020-12-04T16:04:32.000Z
#ifndef IMOVE_SRC_IMAGE_PROCESSING_PEOPLEEXTRACTOR_H_ #define IMOVE_SRC_IMAGE_PROCESSING_PEOPLEEXTRACTOR_H_ #include <opencv2/highgui.hpp> #include <opencv2/video.hpp> #include <cv.hpp> #include <opencv2/core.hpp> #include <opencv2/opencv.hpp> #include <vector> #include "opencv2/imgcodecs.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/videoio.hpp" #include "Detector/PeopleDetector.h" #include "Identifier/PeopleIdentifier.h" #include "../Person.h" #include "../../../scene_interface/src/People.h" #include "../../../util/src/Vector2.h" #include "../../../util/src/Boundary.h" #include "../../../util/src/configuration/CameraConfiguration.hpp" class PeopleExtractor { private: // Detector to detect locations of people in a frame PeopleDetector detector; // Identifier to identify people with locations PeopleIdentifier identifier; // Current frame cv::Mat frame; // Debug frame cv::Mat debug_frame; // Size of the frame after resizing cv::Size frame_size; // Convert objects from the People class to the scene interface People class const scene_interface::People convert(std::vector<Person>& people); // Ratio with which the frame is resized float resize_ratio; public: PeopleExtractor(CameraConfiguration* camConfig); ~PeopleExtractor(); // Main extraction function to extract people from a frame const scene_interface::People extractPeople(cv::Mat& new_frame); // Display image processing results const cv::Mat getDebugFrame() const; }; #endif // IMOVE_SRC_IMAGE_PROCESSING_PEOPLEEXTRACTOR_H_
26.931034
78
0.752881
fd8e4be9a93e6b42925e4259baca425f579a949f
6,298
h
C
third_party/spdlog/bm/spdlog/details/registry.h
edgarcosta92/behavioral-model
de9ec3ddc45c2b210681a7675c0bded6e56ec9d3
[ "Apache-2.0" ]
390
2015-10-13T05:22:51.000Z
2022-03-30T19:18:14.000Z
third_party/spdlog/bm/spdlog/details/registry.h
edgarcosta92/behavioral-model
de9ec3ddc45c2b210681a7675c0bded6e56ec9d3
[ "Apache-2.0" ]
919
2015-08-10T17:50:50.000Z
2022-03-31T17:46:07.000Z
third_party/spdlog/bm/spdlog/details/registry.h
edgarcosta92/behavioral-model
de9ec3ddc45c2b210681a7675c0bded6e56ec9d3
[ "Apache-2.0" ]
351
2015-09-18T03:32:32.000Z
2022-03-31T03:56:38.000Z
/*************************************************************************/ /* spdlog - an extremely fast and easy to use c++11 logging library. */ /* Copyright (c) 2014 Gabi Melman. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #pragma once // Loggers registy of unique name->logger pointer // An attempt to create a logger with an alreasy existing name will be ignored // If user requests a non existing logger, nullptr will be returned // This class is thread safe #include <string> #include <mutex> #include <unordered_map> #include <functional> #include "./null_mutex.h" #include "../logger.h" #include "../async_logger.h" #include "../common.h" namespace spdlog { namespace details { template <class Mutex> class registry_t { public: void register_logger(std::shared_ptr<logger> logger) { std::lock_guard<Mutex> lock(_mutex); register_logger_impl(logger); } std::shared_ptr<logger> get(const std::string& logger_name) { std::lock_guard<Mutex> lock(_mutex); auto found = _loggers.find(logger_name); return found == _loggers.end() ? nullptr : found->second; } template<class It> std::shared_ptr<logger> create(const std::string& logger_name, const It& sinks_begin, const It& sinks_end) { std::shared_ptr<logger> new_logger; std::lock_guard<Mutex> lock(_mutex); if (_async_mode) new_logger = std::make_shared<async_logger>(logger_name, sinks_begin, sinks_end, _async_q_size, _overflow_policy, _worker_warmup_cb, _flush_interval_ms); else new_logger = std::make_shared<logger>(logger_name, sinks_begin, sinks_end); if (_formatter) new_logger->set_formatter(_formatter); new_logger->set_level(_level); register_logger_impl(new_logger); return new_logger; } void drop(const std::string& logger_name) { std::lock_guard<Mutex> lock(_mutex); _loggers.erase(logger_name); } void drop_all() { std::lock_guard<Mutex> lock(_mutex); _loggers.clear(); } std::shared_ptr<logger> create(const std::string& logger_name, sinks_init_list sinks) { return create(logger_name, sinks.begin(), sinks.end()); } std::shared_ptr<logger> create(const std::string& logger_name, sink_ptr sink) { return create(logger_name, { sink }); } void formatter(formatter_ptr f) { std::lock_guard<Mutex> lock(_mutex); _formatter = f; for (auto& l : _loggers) l.second->set_formatter(_formatter); } void set_pattern(const std::string& pattern) { std::lock_guard<Mutex> lock(_mutex); _formatter = std::make_shared<pattern_formatter>(pattern); for (auto& l : _loggers) l.second->set_formatter(_formatter); } void set_level(level::level_enum log_level) { std::lock_guard<Mutex> lock(_mutex); for (auto& l : _loggers) l.second->set_level(log_level); _level = log_level; } void set_async_mode(size_t q_size, const async_overflow_policy overflow_policy, const std::function<void()>& worker_warmup_cb, const std::chrono::milliseconds& flush_interval_ms) { std::lock_guard<Mutex> lock(_mutex); _async_mode = true; _async_q_size = q_size; _overflow_policy = overflow_policy; _worker_warmup_cb = worker_warmup_cb; _flush_interval_ms = flush_interval_ms; } void set_sync_mode() { std::lock_guard<Mutex> lock(_mutex); _async_mode = false; } static registry_t<Mutex>& instance() { static registry_t<Mutex> s_instance; return s_instance; } private: void register_logger_impl(std::shared_ptr<logger> logger) { auto logger_name = logger->name(); if (_loggers.find(logger_name) != std::end(_loggers)) throw spdlog_ex("logger with name " + logger_name + " already exists"); _loggers[logger->name()] = logger; } registry_t<Mutex>(){} registry_t<Mutex>(const registry_t<Mutex>&) = delete; registry_t<Mutex>& operator=(const registry_t<Mutex>&) = delete; Mutex _mutex; std::unordered_map <std::string, std::shared_ptr<logger>> _loggers; formatter_ptr _formatter; level::level_enum _level = level::info; bool _async_mode = false; size_t _async_q_size = 0; async_overflow_policy _overflow_policy = async_overflow_policy::block_retry; std::function<void()> _worker_warmup_cb = nullptr; std::chrono::milliseconds _flush_interval_ms; }; #ifdef SPDLOG_NO_REGISTRY_MUTEX typedef registry_t<spdlog::details::null_mutex> registry; #else typedef registry_t<std::mutex> registry; #endif } }
34.79558
182
0.620673
74b305480f478e5f5ba334d4a9fd6a3aeafea616
5,036
c
C
OperatingSystems/lab4/user/fork.c
LittleNyima/BUAA-cs-core
468e8e0bcbb65171df7299455352bf119b05c627
[ "MIT" ]
5
2021-03-04T07:24:46.000Z
2021-11-03T10:24:38.000Z
OperatingSystems/lab4/user/fork.c
LittleNyima/BUAA-cs-core
468e8e0bcbb65171df7299455352bf119b05c627
[ "MIT" ]
null
null
null
OperatingSystems/lab4/user/fork.c
LittleNyima/BUAA-cs-core
468e8e0bcbb65171df7299455352bf119b05c627
[ "MIT" ]
1
2021-09-26T03:58:07.000Z
2021-09-26T03:58:07.000Z
// implement fork from user space #include "lib.h" #include <mmu.h> #include <env.h> /* ----------------- help functions ---------------- */ /* Overview: * Copy `len` bytes from `src` to `dst`. * * Pre-Condition: * `src` and `dst` can't be NULL. Also, the `src` area * shouldn't overlap the `dest`, otherwise the behavior of this * function is undefined. */ void user_bcopy(const void *src, void *dst, size_t len) { void *max; // writef("~~~~~~~~~~~~~~~~ src:%x dst:%x len:%x\n",(int)src,(int)dst,len); max = dst + len; // copy machine words while possible if (((int)src % 4 == 0) && ((int)dst % 4 == 0)) { while (dst + 3 < max) { *(int *)dst = *(int *)src; dst += 4; src += 4; } } // finish remaining 0-3 bytes while (dst < max) { *(char *)dst = *(char *)src; dst += 1; src += 1; } //for(;;); } /* Overview: * Sets the first n bytes of the block of memory * pointed by `v` to zero. * * Pre-Condition: * `v` must be valid. * * Post-Condition: * the content of the space(from `v` to `v`+ n) * will be set to zero. */ void user_bzero(void *v, u_int n) { char *p; int m; p = v; m = n; while (--m >= 0) { *p++ = 0; } } /*--------------------------------------------------------------*/ /* Overview: * Custom page fault handler - if faulting page is copy-on-write, * map in our own private writable copy. * * Pre-Condition: * `va` is the address which leads to a TLBS exception. * * Post-Condition: * Launch a user_panic if `va` is not a copy-on-write page. * Otherwise, this handler should map a private writable copy of * the faulting page at correct address. */ /*** exercise 4.13 ***/ static void pgfault(u_int va) { u_int *tmp; int ret; u_int pte = (*vpt)[VPN(va)]; u_int perm = pte & 0xfff; // writef("fork.c:pgfault():\t va:%x\n",va); if ((pte & PTE_COW) == 0) { user_panic("pgfault COW check fail"); } //map the new page at a temporary place va = ROUNDDOWN(va, BY2PG); tmp = USTACKTOP; ret = syscall_mem_alloc(0, tmp, perm & ~PTE_COW); if (ret != 0) { user_panic("pgfault tmp alloc fail"); } //copy the content user_bcopy(va, tmp, BY2PG); //map the page on the appropriate place ret = syscall_mem_map(0, tmp, 0, va, perm & ~PTE_COW); if (ret < 0) { user_panic("pgfault map fail"); } //unmap the temporary place ret = syscall_mem_unmap(0, tmp); if (ret != 0) { user_panic("pgfault unmap fail"); } } /* Overview: * Map our virtual page `pn` (address pn*BY2PG) into the target `envid` * at the same virtual address. * * Post-Condition: * if the page is writable or copy-on-write, the new mapping must be * created copy on write and then our mapping must be marked * copy on write as well. In another word, both of the new mapping and * our mapping should be copy-on-write if the page is writable or * copy-on-write. * * Hint: * PTE_LIBRARY indicates that the page is shared between processes. * A page with PTE_LIBRARY may have PTE_R at the same time. You * should process it correctly. */ /*** exercise 4.10 ***/ static void duppage(u_int envid, u_int pn) { u_int addr; u_int perm; addr = pn << PGSHIFT; perm = ((Pte *)(*vpt))[pn] & 0xfff; if ((perm & PTE_V) && (perm & PTE_LIBRARY) && (perm & PTE_R)) { syscall_mem_map(0, addr, envid, addr, perm); } else if ((perm & PTE_V) && ((perm & PTE_COW) || (perm & PTE_R))) { syscall_mem_map(0, addr, envid, addr, perm | PTE_COW); syscall_mem_map(0, addr, 0, addr, perm | PTE_COW); } else { syscall_mem_map(0, addr, envid, addr, perm); } // user_panic("duppage not implemented"); } /* Overview: * User-level fork. Create a child and then copy our address space * and page fault handler setup to the child. * * Hint: use vpd, vpt, and duppage. * Hint: remember to fix "env" in the child process! * Note: `set_pgfault_handler`(user/pgfault.c) is different from * `syscall_set_pgfault_handler`. */ /*** exercise 4.9 4.15***/ extern void __asm_pgfault_handler(void); int fork(void) { // Your code here. u_int newenvid; extern struct Env *envs; extern struct Env *env; u_int i; int ret; //The parent installs pgfault using set_pgfault_handler set_pgfault_handler(pgfault); //alloc a new alloc newenvid = syscall_env_alloc(); if (newenvid == 0) { env = envs + ENVX(syscall_getenvid()); return 0; } for (i = 0; i < UTOP - 2 * BY2PG; i += BY2PG) { if ((((Pde *)(*vpd))[i >> PDSHIFT] & PTE_V) && (((Pte *)(*vpt))[i >> PGSHIFT] & PTE_V)) { duppage(newenvid, VPN(i)); } } ret = syscall_mem_alloc(newenvid, UXSTACKTOP - BY2PG, PTE_V | PTE_R); if (ret < 0) { user_panic("fork mem_alloc fail"); } ret = syscall_set_pgfault_handler(newenvid, __asm_pgfault_handler, UXSTACKTOP); if (ret < 0) { user_panic("fork set_pgfault faild"); } ret = syscall_set_env_status(newenvid, ENV_RUNNABLE); if (ret < 0) { user_panic("fork set_status faild"); } return newenvid; } // Challenge! int sfork(void) { user_panic("sfork not implemented"); return -E_INVAL; }
22.995434
91
0.620334
50f11134b43b7a862659e8f1eb14104e1be77a93
6,987
h
C
kernel/drivers/gpu/pvr/sgxinfo.h
LoongPenguin/Linux_210
d941ed620798fb9c96b5d06764fb1dcb68057513
[ "Apache-2.0" ]
null
null
null
kernel/drivers/gpu/pvr/sgxinfo.h
LoongPenguin/Linux_210
d941ed620798fb9c96b5d06764fb1dcb68057513
[ "Apache-2.0" ]
null
null
null
kernel/drivers/gpu/pvr/sgxinfo.h
LoongPenguin/Linux_210
d941ed620798fb9c96b5d06764fb1dcb68057513
[ "Apache-2.0" ]
null
null
null
/********************************************************************** * * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. * * 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, except * as otherwise stated in writing, without any warranty; without even the * implied warranty of merchantability or fitness for a particular purpose. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * The full GNU General Public License is included in this distribution in * the file called "COPYING". * * Contact Information: * Imagination Technologies Ltd. <gpl-support@imgtec.com> * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK * ******************************************************************************/ #if !defined (__SGXINFO_H__) #define __SGXINFO_H__ #include "sgxscript.h" #include "servicesint.h" #include "services.h" #include "sgxapi_km.h" #include "sgx_mkif_km.h" #define SGX_MAX_DEV_DATA 24 #define SGX_MAX_INIT_MEM_HANDLES 16 typedef struct _SGX_BRIDGE_INFO_FOR_SRVINIT { IMG_DEV_PHYADDR sPDDevPAddr; PVRSRV_HEAP_INFO asHeapInfo[PVRSRV_MAX_CLIENT_HEAPS]; } SGX_BRIDGE_INFO_FOR_SRVINIT; typedef enum _SGXMKIF_CMD_TYPE_ { SGXMKIF_CMD_TA = 0, SGXMKIF_CMD_TRANSFER = 1, SGXMKIF_CMD_2D = 2, SGXMKIF_CMD_POWER = 3, SGXMKIF_CMD_CLEANUP = 4, SGXMKIF_CMD_GETMISCINFO = 5, SGXMKIF_CMD_PROCESS_QUEUES = 6, SGXMKIF_CMD_DATABREAKPOINT = 7, SGXMKIF_CMD_SETHWPERFSTATUS = 8, SGXMKIF_CMD_MAX = 9, SGXMKIF_CMD_FORCE_I32 = -1, } SGXMKIF_CMD_TYPE; typedef struct _SGX_BRIDGE_INIT_INFO_ { IMG_HANDLE hKernelCCBMemInfo; IMG_HANDLE hKernelCCBCtlMemInfo; IMG_HANDLE hKernelCCBEventKickerMemInfo; IMG_HANDLE hKernelSGXHostCtlMemInfo; IMG_HANDLE hKernelSGXTA3DCtlMemInfo; IMG_HANDLE hKernelSGXMiscMemInfo; IMG_UINT32 aui32HostKickAddr[SGXMKIF_CMD_MAX]; SGX_INIT_SCRIPTS sScripts; IMG_UINT32 ui32ClientBuildOptions; SGX_MISCINFO_STRUCT_SIZES sSGXStructSizes; #if defined(SGX_SUPPORT_HWPROFILING) IMG_HANDLE hKernelHWProfilingMemInfo; #endif #if defined(SUPPORT_SGX_HWPERF) IMG_HANDLE hKernelHWPerfCBMemInfo; #endif IMG_HANDLE hKernelTASigBufferMemInfo; IMG_HANDLE hKernel3DSigBufferMemInfo; #if defined(FIX_HW_BRN_29702) IMG_HANDLE hKernelCFIMemInfo; #endif #if defined(FIX_HW_BRN_29823) IMG_HANDLE hKernelDummyTermStreamMemInfo; #endif #if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) IMG_HANDLE hKernelEDMStatusBufferMemInfo; #endif #if defined(SGX_FEATURE_OVERLAPPED_SPM) IMG_HANDLE hKernelTmpRgnHeaderMemInfo; #endif #if defined(SGX_FEATURE_SPM_MODE_0) IMG_HANDLE hKernelTmpDPMStateMemInfo; #endif IMG_UINT32 ui32EDMTaskReg0; IMG_UINT32 ui32EDMTaskReg1; IMG_UINT32 ui32ClkGateStatusReg; IMG_UINT32 ui32ClkGateStatusMask; #if defined(SGX_FEATURE_MP) IMG_UINT32 ui32MasterClkGateStatusReg; IMG_UINT32 ui32MasterClkGateStatusMask; IMG_UINT32 ui32MasterClkGateStatus2Reg; IMG_UINT32 ui32MasterClkGateStatus2Mask; #endif IMG_UINT32 ui32CacheControl; IMG_UINT32 asInitDevData[SGX_MAX_DEV_DATA]; IMG_HANDLE asInitMemHandles[SGX_MAX_INIT_MEM_HANDLES]; } SGX_BRIDGE_INIT_INFO; typedef struct _SGX_DEVICE_SYNC_LIST_ { PSGXMKIF_HWDEVICE_SYNC_LIST psHWDeviceSyncList; IMG_HANDLE hKernelHWSyncListMemInfo; PVRSRV_CLIENT_MEM_INFO *psHWDeviceSyncListClientMemInfo; PVRSRV_CLIENT_MEM_INFO *psAccessResourceClientMemInfo; volatile IMG_UINT32 *pui32Lock; struct _SGX_DEVICE_SYNC_LIST_ *psNext; IMG_UINT32 ui32NumSyncObjects; IMG_HANDLE ahSyncHandles[1]; } SGX_DEVICE_SYNC_LIST, *PSGX_DEVICE_SYNC_LIST; typedef struct _SGX_INTERNEL_STATUS_UPDATE_ { CTL_STATUS sCtlStatus; IMG_HANDLE hKernelMemInfo; } SGX_INTERNEL_STATUS_UPDATE; typedef struct _SGX_CCB_KICK_ { SGXMKIF_COMMAND sCommand; IMG_HANDLE hCCBKernelMemInfo; IMG_UINT32 ui32NumDstSyncObjects; IMG_HANDLE hKernelHWSyncListMemInfo; IMG_HANDLE *pahDstSyncHandles; IMG_UINT32 ui32NumTAStatusVals; IMG_UINT32 ui32Num3DStatusVals; #if defined(SUPPORT_SGX_NEW_STATUS_VALS) SGX_INTERNEL_STATUS_UPDATE asTAStatusUpdate[SGX_MAX_TA_STATUS_VALS]; SGX_INTERNEL_STATUS_UPDATE as3DStatusUpdate[SGX_MAX_3D_STATUS_VALS]; #else IMG_HANDLE ahTAStatusSyncInfo[SGX_MAX_TA_STATUS_VALS]; IMG_HANDLE ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS]; #endif IMG_BOOL bFirstKickOrResume; #if (defined(NO_HARDWARE) || defined(PDUMP)) IMG_BOOL bTerminateOrAbort; #endif IMG_BOOL bLastInScene; IMG_UINT32 ui32CCBOffset; #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS) IMG_UINT32 ui32NumTASrcSyncs; IMG_HANDLE ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS]; IMG_UINT32 ui32NumTADstSyncs; IMG_HANDLE ahTADstKernelSyncInfo[SGX_MAX_TA_DST_SYNCS]; IMG_UINT32 ui32Num3DSrcSyncs; IMG_HANDLE ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS]; #else IMG_UINT32 ui32NumSrcSyncs; IMG_HANDLE ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS]; #endif IMG_BOOL bTADependency; IMG_HANDLE hTA3DSyncInfo; IMG_HANDLE hTASyncInfo; IMG_HANDLE h3DSyncInfo; #if defined(PDUMP) IMG_UINT32 ui32CCBDumpWOff; #endif #if defined(NO_HARDWARE) IMG_UINT32 ui32WriteOpsPendingVal; #endif } SGX_CCB_KICK; #define SGX_KERNEL_USE_CODE_BASE_INDEX 15 typedef struct _SGX_CLIENT_INFO_ { IMG_UINT32 ui32ProcessID; IMG_VOID *pvProcess; PVRSRV_MISC_INFO sMiscInfo; IMG_UINT32 asDevData[SGX_MAX_DEV_DATA]; } SGX_CLIENT_INFO; typedef struct _SGX_INTERNAL_DEVINFO_ { IMG_UINT32 ui32Flags; IMG_HANDLE hHostCtlKernelMemInfoHandle; IMG_BOOL bForcePTOff; } SGX_INTERNAL_DEVINFO; #if defined(TRANSFER_QUEUE) typedef struct _PVRSRV_TRANSFER_SGX_KICK_ { IMG_HANDLE hCCBMemInfo; IMG_UINT32 ui32SharedCmdCCBOffset; IMG_DEV_VIRTADDR sHWTransferContextDevVAddr; IMG_HANDLE hTASyncInfo; IMG_HANDLE h3DSyncInfo; IMG_UINT32 ui32NumSrcSync; IMG_HANDLE ahSrcSyncInfo[SGX_MAX_TRANSFER_SYNC_OPS]; IMG_UINT32 ui32NumDstSync; IMG_HANDLE ahDstSyncInfo[SGX_MAX_TRANSFER_SYNC_OPS]; IMG_UINT32 ui32Flags; IMG_UINT32 ui32PDumpFlags; #if defined(PDUMP) IMG_UINT32 ui32CCBDumpWOff; #endif } PVRSRV_TRANSFER_SGX_KICK, *PPVRSRV_TRANSFER_SGX_KICK; #if defined(SGX_FEATURE_2D_HARDWARE) typedef struct _PVRSRV_2D_SGX_KICK_ { IMG_HANDLE hCCBMemInfo; IMG_UINT32 ui32SharedCmdCCBOffset; IMG_DEV_VIRTADDR sHW2DContextDevVAddr; IMG_UINT32 ui32NumSrcSync; IMG_HANDLE ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS]; IMG_HANDLE hDstSyncInfo; IMG_HANDLE hTASyncInfo; IMG_HANDLE h3DSyncInfo; IMG_UINT32 ui32PDumpFlags; #if defined(PDUMP) IMG_UINT32 ui32CCBDumpWOff; #endif } PVRSRV_2D_SGX_KICK, *PPVRSRV_2D_SGX_KICK; #endif #endif #endif
24.260417
80
0.801202
975d20b255957dfbe00059334937b596dbaddc8a
2,171
c
C
src/lib/parm_file_test.c
m1dev/vfd
d0de296585f434f780b5fc99dabe8c52d7db90fc
[ "Apache-2.0" ]
null
null
null
src/lib/parm_file_test.c
m1dev/vfd
d0de296585f434f780b5fc99dabe8c52d7db90fc
[ "Apache-2.0" ]
null
null
null
src/lib/parm_file_test.c
m1dev/vfd
d0de296585f434f780b5fc99dabe8c52d7db90fc
[ "Apache-2.0" ]
null
null
null
/* Mneminic: parm_file_test.c Abstract: Unit test for parm file parsing (part of config.c). Tests obvious things, may miss edge cases. usage: parm_file_test cfg-file-name Date: 03 February 2016 Author: E. Scott Daniels */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <errno.h> #include <string.h> #include "vfdlib.h" void pprint( parms_t* parms ) { int i; fprintf( stderr, " parms read:\n" ); fprintf( stderr, "\tlog dir: %s\n", parms->log_dir ); fprintf( stderr, "\tconfig_dir: %s\n", parms->config_dir ); fprintf( stderr, "\tlog_level: %d\n", parms->log_level ); fprintf( stderr, "\tlog_keep: %d\n", parms->log_keep ); fprintf( stderr, "\tdelete_keep: %d\n", parms->delete_keep ); fprintf( stderr, "\tfifo: %s\n", parms->fifo_path ); fprintf( stderr, "\tcpu_mask: %s\n", parms->cpu_mask ); fprintf( stderr, "\tdpdk_log_level: %d\n", parms->dpdk_log_level ); fprintf( stderr, "\tdpdk_init_log_level: %d\n", parms->dpdk_init_log_level ); fprintf( stderr, "\tnpciids: %d\n", parms->npciids ); for( i = 0; i < parms->npciids; i++ ) { fprintf( stderr, "\tpciid[%d]: %s %d flags=%02x\n", i, parms->pciids[i].id, parms->pciids[i].mtu, parms->pciids[i].flags ); } } int main( int argc, char** argv ) { char* fname = "vfd.cfg"; parms_t* parms; int rc = 0; if( argv[1] != NULL ) { fname = argv[1]; } parms = read_parms( fname ); if( parms == NULL ) { fprintf( stderr, "[FAIL] unable to read parm file %s: %s\n", fname, strerror( errno ) ); pprint( parms ); free_parms( parms ); rc = 1; } else { fprintf( stderr, "[OK] Able to open, read and parse json in parm file\n" ); pprint( parms ); } free_parms( parms ); parms = read_parms( "/hosuchdir/nosuchfile" ); // should return defaults all round rather than failing if( parms != NULL ) { fprintf( stderr, "[OK] opening nonexisting file resulted in default struct:\n" ); pprint( parms ); free_parms( parms ); } else { fprintf( stderr, "[FAIL] attempt to open a nonexistant file was rejected; should have returned a struct with defaults\n" ); rc = 1; } exit( rc ); // bad exit if we failed a test }
29.739726
125
0.647167
976f11ea05283c5354291d7a6cd3e25713789e6a
225
h
C
WFBaseClasses/ViewController.h
ForAllKid/FKBaseClasses
9aede936779eb4996258dce8e0c9c27038aac722
[ "MIT" ]
1
2018-05-22T03:18:48.000Z
2018-05-22T03:18:48.000Z
WFBaseClasses/ViewController.h
ForAllKid/FKBaseClasses
9aede936779eb4996258dce8e0c9c27038aac722
[ "MIT" ]
null
null
null
WFBaseClasses/ViewController.h
ForAllKid/FKBaseClasses
9aede936779eb4996258dce8e0c9c27038aac722
[ "MIT" ]
null
null
null
// // ViewController.h // WFBaseClasses // // Created by 周宏辉 on 2018/5/2. // Copyright © 2018年 Wefint. All rights reserved. // #import "WFTableViewController.h" @interface ViewController : WFTableViewController @end
14.0625
50
0.711111
6eeb190234cb27c79120ee8fef26258a5e44df59
827
h
C
include/il2cpp/System/Collections/Generic/ObjectComparer_StatueItemData_.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
1
2022-01-15T20:20:27.000Z
2022-01-15T20:20:27.000Z
include/il2cpp/System/Collections/Generic/ObjectComparer_StatueItemData_.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
include/il2cpp/System/Collections/Generic/ObjectComparer_StatueItemData_.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
#pragma once #include "il2cpp.h" int32_t System_Collections_Generic_ObjectComparer_StatueItemData___Compare (System_Collections_Generic_ObjectComparer_StatueItemData__o* __this, Dpr_SecretBase_StatueItemData_o x, Dpr_SecretBase_StatueItemData_o y, const MethodInfo* method_info); bool System_Collections_Generic_ObjectComparer_StatueItemData___Equals (System_Collections_Generic_ObjectComparer_StatueItemData__o* __this, Il2CppObject* obj, const MethodInfo* method_info); int32_t System_Collections_Generic_ObjectComparer_StatueItemData___GetHashCode (System_Collections_Generic_ObjectComparer_StatueItemData__o* __this, const MethodInfo* method_info); void System_Collections_Generic_ObjectComparer_StatueItemData____ctor (System_Collections_Generic_ObjectComparer_StatueItemData__o* __this, const MethodInfo* method_info);
91.888889
246
0.911729
1bdbb7403b6bd6d4e6f523f5ef58e7ab22f3bf87
1,890
c
C
jpeg-6b/jdpostct.c
Leonan8995/ZDW
3f3743dd5aff047608ec31fb71186d177812c7df
[ "Unlicense" ]
2
2016-10-12T12:45:49.000Z
2016-10-12T13:29:49.000Z
jpeg-6b/jdpostct.c
Leonan8995/Xenomia
3f3743dd5aff047608ec31fb71186d177812c7df
[ "Unlicense" ]
null
null
null
jpeg-6b/jdpostct.c
Leonan8995/Xenomia
3f3743dd5aff047608ec31fb71186d177812c7df
[ "Unlicense" ]
null
null
null
/* * jdpostct.c * * Copyright (C) 1994-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains the decompression postprocessing controller. * This controller manages the upsampling, color conversion, and color * quantization/reduction steps; specifically, it controls the buffering * between upsample/color conversion and color quantization/reduction. * * If no color quantization/reduction is required, then this module has no * work to do, and it just hands off to the upsample/color conversion code. * An integrated upsample/convert/quantize process would replace this module * entirely. */ #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" /* Private buffer controller object */ typedef struct { struct jpeg_d_post_controller pub; /* public fields */ } my_post_controller; typedef my_post_controller * my_post_ptr; /* * Initialize for a processing pass. */ METHODDEF(void) start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) { my_post_ptr post = (my_post_ptr) cinfo->post; switch (pass_mode) { case JBUF_PASS_THRU: /* For single-pass processing without color quantization, * I have no work to do; just call the upsampler directly. */ post->pub.post_process_data = cinfo->upsample->upsample; break; default: ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); break; } } /* * Initialize postprocessing controller. */ GLOBAL(void) jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) { my_post_ptr post; post = (my_post_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_post_controller)); cinfo->post = (struct jpeg_d_post_controller *) post; post->pub.start_pass = start_pass_dpost; }
26.619718
76
0.736508
f444202629b4a7ed026121dbf70b7134893e1c3b
9,553
h
C
impl/src/tooling/checker/evaluator/args.h
rustedwizard/BosqueLanguage
8cf877e9a273dccaca5f12dd9f8f9d03ea06d3ba
[ "MIT" ]
4,370
2019-04-16T07:05:37.000Z
2019-05-06T19:01:23.000Z
impl/src/tooling/checker/evaluator/args.h
rustedwizard/BosqueLanguage
8cf877e9a273dccaca5f12dd9f8f9d03ea06d3ba
[ "MIT" ]
139
2019-04-16T05:58:11.000Z
2019-05-06T19:46:00.000Z
impl/src/tooling/checker/evaluator/args.h
rustedwizard/BosqueLanguage
8cf877e9a273dccaca5f12dd9f8f9d03ea06d3ba
[ "MIT" ]
321
2019-04-16T04:52:04.000Z
2019-05-06T11:11:25.000Z
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- #pragma once #include "common.h" class SMTParseJSON : public ApiManagerJSON<z3::expr, z3::solver> { private: std::vector<std::vector<uint8_t>> hashhash; public: SMTParseJSON(): ApiManagerJSON(), hashhash() {;} static z3::expr generateInitialArgContext(z3::context& c, size_t i) { auto ii = c.int_val((uint64_t)0); auto ij = c.int_val((uint64_t)i); return z3::concat(ii.unit(), ij.unit()); } static z3::expr generateInitialResultContext(z3::context& c) { auto ii = c.int_val((uint64_t)1); return ii.unit(); } virtual ~SMTParseJSON() {;} virtual bool checkInvokeOk(const std::string& checkinvoke, z3::expr value, z3::solver& ctx) override final; virtual bool parseNoneImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual bool parseNothingImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual bool parseBoolImpl(const APIModule* apimodule, const IType* itype, bool b, z3::expr value, z3::solver& ctx) override final; virtual bool parseNatImpl(const APIModule* apimodule, const IType* itype, uint64_t n, z3::expr value, z3::solver& ctx) override final; virtual bool parseIntImpl(const APIModule* apimodule, const IType* itype, int64_t i, z3::expr value, z3::solver& ctx) override final; virtual bool parseBigNatImpl(const APIModule* apimodule, const IType* itype, std::string n, z3::expr value, z3::solver& ctx) override final; virtual bool parseBigIntImpl(const APIModule* apimodule, const IType* itype, std::string i, z3::expr value, z3::solver& ctx) override final; virtual bool parseFloatImpl(const APIModule* apimodule, const IType* itype, std::string f, z3::expr value, z3::solver& ctx) override final; virtual bool parseDecimalImpl(const APIModule* apimodule, const IType* itype, std::string d, z3::expr value, z3::solver& ctx) override final; virtual bool parseRationalImpl(const APIModule* apimodule, const IType* itype, std::string n, uint64_t d, z3::expr value, z3::solver& ctx) override final; virtual bool parseStringImpl(const APIModule* apimodule, const IType* itype, std::string s, z3::expr value, z3::solver& ctx) override final; virtual bool parseByteBufferImpl(const APIModule* apimodule, const IType* itype, uint8_t compress, uint8_t format, std::vector<uint8_t>& data, z3::expr value, z3::solver& ctx) override final; virtual bool parseDateTimeImpl(const APIModule* apimodule, const IType* itype, DateTime t, z3::expr value, z3::solver& ctx) override final; virtual bool parseTickTimeImpl(const APIModule* apimodule, const IType* itype, uint64_t t, z3::expr value, z3::solver& ctx) override final; virtual bool parseLogicalTimeImpl(const APIModule* apimodule, const IType* itype, uint64_t j, z3::expr value, z3::solver& ctx) override final; virtual bool parseUUIDImpl(const APIModule* apimodule, const IType* itype, std::vector<uint8_t> v, z3::expr value, z3::solver& ctx) override final; virtual bool parseContentHashImpl(const APIModule* apimodule, const IType* itype, std::vector<uint8_t> v, z3::expr value, z3::solver& ctx) override final; virtual void prepareParseTuple(const APIModule* apimodule, const IType* itype, z3::solver& ctx) override final; virtual z3::expr getValueForTupleIndex(const APIModule* apimodule, const IType* itype, z3::expr value, size_t i, z3::solver& ctx) override final; virtual void completeParseTuple(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual void prepareParseRecord(const APIModule* apimodule, const IType* itype, z3::solver& ctx) override final; virtual z3::expr getValueForRecordProperty(const APIModule* apimodule, const IType* itype, z3::expr value, std::string pname, z3::solver& ctx) override final; virtual void completeParseRecord(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual void prepareParseContainer(const APIModule* apimodule, const IType* itype, z3::expr value, size_t count, z3::solver& ctx) override final; virtual z3::expr getValueForContainerElementParse(const APIModule* apimodule, const IType* itype, z3::expr value, size_t i, z3::solver& ctx) override final; virtual void completeParseContainer(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual void prepareParseEntity(const APIModule* apimodule, const IType* itype, z3::solver& ctx) override final; virtual void prepareParseEntityMask(const APIModule* apimodule, const IType* itype, z3::solver& ctx) override final; virtual z3::expr getValueForEntityField(const APIModule* apimodule, const IType* itype, z3::expr value, std::pair<std::string, std::string> fnamefkey, z3::solver& ctx) override final; virtual void completeParseEntity(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual void setMaskFlag(const APIModule* apimodule, z3::expr flagloc, size_t i, bool flag, z3::solver& ctx) override final; virtual z3::expr parseUnionChoice(const APIModule* apimodule, const IType* itype, z3::expr value, size_t pick, const IType* picktype, z3::solver& ctx) override final; virtual std::optional<bool> extractBoolImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<uint64_t> extractNatImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<int64_t> extractIntImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::string> extractBigNatImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::string> extractBigIntImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::string> extractFloatImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::string> extractDecimalImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::pair<std::string, uint64_t>> extractRationalImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::string> extractStringImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::pair<std::vector<uint8_t>, std::pair<uint8_t, uint8_t>>> extractByteBufferImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<DateTime> extractDateTimeImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<uint64_t> extractTickTimeImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<uint64_t> extractLogicalTimeImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::vector<uint8_t>> extractUUIDImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<std::vector<uint8_t>> extractContentHashImpl(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual z3::expr extractValueForTupleIndex(const APIModule* apimodule, const IType* itype, z3::expr value, size_t i, z3::solver& ctx) override final; virtual z3::expr extractValueForRecordProperty(const APIModule* apimodule, const IType* itype, z3::expr value, std::string pname, z3::solver& ctx) override final; virtual z3::expr extractValueForEntityField(const APIModule* apimodule, const IType* itype, z3::expr value, std::pair<std::string, std::string> fnamefkey, z3::solver& ctx) override final; virtual void prepareExtractContainer(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual std::optional<size_t> extractLengthForContainer(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; virtual z3::expr extractValueForContainer(const APIModule* apimodule, const IType* itype, z3::expr value, size_t i, z3::solver& ctx) override final; virtual void completeExtractContainer(const APIModule* apimodule, const IType* itype, z3::solver& ctx) override final; virtual std::optional<size_t> extractUnionChoice(const APIModule* apimodule, const IType* itype, const std::vector<const IType*>& opttypes, z3::expr intoloc, z3::solver& ctx) override final; virtual z3::expr extractUnionValue(const APIModule* apimodule, const IType* itype, z3::expr value, z3::solver& ctx) override final; };
91.855769
206
0.734534
a72e7f15dc43a280d11bcef5783e904a5b35c469
7,845
c
C
src/resamplerate.c
AnSwErYWJ/AudioResamplerate
25f41ea0f20e837fced148d73845971247780286
[ "BSD-2-Clause" ]
17
2016-08-11T07:39:46.000Z
2021-12-12T12:18:20.000Z
src/resamplerate.c
AnSwErYWJ/AudioResamplerate
25f41ea0f20e837fced148d73845971247780286
[ "BSD-2-Clause" ]
5
2017-02-23T09:31:56.000Z
2021-08-16T03:02:20.000Z
src/resamplerate.c
AnSwErYWJ/AudioResamplerate
25f41ea0f20e837fced148d73845971247780286
[ "BSD-2-Clause" ]
13
2017-01-22T12:12:31.000Z
2021-02-27T08:19:20.000Z
/************************************************************************* > File Name: resamplerate.c > Author: weijie.yuan > Mail: > Created Time: Fri Aug 5 16:25:02 2016 ************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include "samplerate.h" #include "iniparser.h" #include "log.h" #include "resamplerate.h" #include "handle_wave.h" static AUDIO input,output; static dictionary *ini; static SRC_STATE *state; static int channels = 0; static double ratio = 0; static int tmp_frame_len = 0; static short *tmpbuf = NULL; static int error; static int file_size(const char *filepath) { struct stat statbuf; stat(filepath,&statbuf); int size = statbuf.st_size; return size; } /* new AUDIO obj */ static AUDIO audio_new() { AUDIO file; file.path = NULL; file.type = NULL; file.fp = NULL; file.buf = NULL; file.items = 0; file.sample_rate = 0; file.frame_len = 0; return file; } static void get_conf() { /* parser dictionary */ ini = iniparser_load("config.ini"); if(ini == NULL) { LOGE("can not open %s","../config.ini"); exit(EXIT_FAILURE); } /* get section numbers */ int n = iniparser_getnsec(ini); if (n != 3) { LOGE("config error!"); exit(EXIT_FAILURE); } /* get section names */ char *section_one = iniparser_getsecname(ini,0); if (strcmp(section_one,"audio") != 0) { LOGE("config error!"); exit(EXIT_FAILURE); } char *section_two = iniparser_getsecname(ini,1); if (strcmp(section_two,"path") != 0) { LOGE("config error!"); exit(EXIT_FAILURE); } char *section_three = iniparser_getsecname(ini,2); if (strcmp(section_three,"type") != 0) { LOGE("config error!"); exit(EXIT_FAILURE); } /* get channels */ channels = iniparser_getint(ini,"audio:channels",-1); if (channels <= 0 || channels > 2) { LOGE("audio:channels error,only support mono or stereo!"); exit(EXIT_FAILURE); } /* get ratio */ output.sample_rate = iniparser_getdouble(ini,"audio:output_sample_rate",-1); input.sample_rate = iniparser_getdouble(ini,"audio:input_sample_rate",-1); if (input.sample_rate <= 0 || output.sample_rate <= 0) { LOGE("audio:sample_rate error!"); exit(EXIT_FAILURE); } ratio = output.sample_rate/input.sample_rate; /* get file path */ input.path = iniparser_getstring(ini,"path:input","null"); if (strcmp(input.path,"null") == 0 ) { LOGE("path:input!"); exit(EXIT_FAILURE); } output.path = iniparser_getstring(ini,"path:output","null"); if (strcmp(output.path,"null") == 0 ) { LOGE("path:output!"); exit(EXIT_FAILURE); } /* get file type */ input.type = iniparser_getstring(ini,"type:input","null"); if (strcmp(input.type,"null") == 0 ) { LOGE("type:input!"); exit(EXIT_FAILURE); } output.type = iniparser_getstring(ini,"type:output","null"); if (strcmp(output.type,"null") == 0 ) { LOGE("type:output!"); exit(EXIT_FAILURE); } } static void audio_del(AUDIO *file) { file->path = NULL; file->type = NULL; fclose(file->fp); free(file->buf); file->buf = NULL; file->items = 0; file->sample_rate = 0; file->frame_len = 0; } static void initialize() { input = audio_new(); output = audio_new(); get_conf(); /* open in and out audio */ input.fp = fopen(input.path,"rb"); if (input.fp == NULL) { LOGE("open input file %s failed",input.path); exit(EXIT_FAILURE); } output.fp = fopen(output.path, "wb+"); if (output.fp == NULL) { LOGE("create output file %s failed",output.path); exit(EXIT_FAILURE); } /* data items*/ input.items = 1024; output.items = ((size_t)(ratio+1)) * input.items; int size; /* judge input file type */ if (strcmp(input.type,"pcm") == 0 || strcmp(input.type,"PCM") == 0 ) size = file_size(input.path) * ratio; else if (strcmp(input.type,"wav") == 0 || strcmp(input.type,"WAV") == 0 ) { size = (file_size(input.path)-44) * ratio; fseek(input.fp,44,SEEK_SET); } else { LOGE("input file type %s invalid",input.type); exit(EXIT_FAILURE); } /* judge output file type */ if (strcmp(output.type,"pcm") == 0 || strcmp(output.type,"PCM") == 0 ){} else if (strcmp(output.type,"wav") == 0 || strcmp(output.type,"WAV") == 0 ) { WaveHeader_t wavheader; init_wavheader(&wavheader); wavheader.riff_datasize = size + 44 - 8; wavheader.fmt_channels = channels; wavheader.fmt_sample_rate = output.sample_rate; wavheader.fmt_avg_bytes_per_sec = wavheader.fmt_sample_rate * wavheader.fmt_channels * wavheader.fmt_bit_per_sample / 8; wavheader.fmt_block_align = wavheader.fmt_bit_per_sample * wavheader.fmt_channels / 8; wavheader.data_datasize = size; write_wavheader(output.fp,wavheader); } else { LOGE("output file type %s invalid",input.type); exit(EXIT_FAILURE); } input.frame_len = sizeof(float)*channels; output.frame_len = sizeof(float)*channels; tmp_frame_len = sizeof(short)*channels; /* calloc memory */ input.buf = (float *)calloc(1,input.items*input.frame_len); if (input.buf == NULL) { LOGE("input buf calloc failed"); exit(EXIT_FAILURE); } output.buf = (float *)calloc(1,output.items*output.frame_len); if (output.buf == NULL) { LOGE("output buf calloc failed"); exit(EXIT_FAILURE); } tmpbuf = (short *)calloc(1,output.items*tmp_frame_len); if (tmpbuf == NULL) { LOGE("tmpbuf calloc failed"); exit(EXIT_FAILURE); } /* new samplerate obj*/ if ((state = src_new (SRC_SINC_BEST_QUALITY, channels, &error)) == NULL) { LOGE("resample new failed"); exit(EXIT_FAILURE); } } static void resamplerate() { SRC_DATA samplerate; /* samplerate params config */ samplerate.data_in = input.buf; samplerate.input_frames = (long)input.items; samplerate.data_out = output.buf; samplerate.end_of_input = 0; samplerate.src_ratio = ratio; samplerate.output_frames = (long)output.items; size_t nread = 0; /* resamplerate */ while ((nread = fread(tmpbuf,tmp_frame_len,input.items,input.fp)) > 0) { src_short_to_float_array (tmpbuf, input.buf, nread*channels) ; if ((error = src_process (state, &samplerate))) LOGE("src_process failed : %s",src_strerror (error)) ; memset(tmpbuf,'\0',output.items*tmp_frame_len); src_float_to_short_array (output.buf, tmpbuf, samplerate.output_frames_gen*channels); if (fwrite(tmpbuf,tmp_frame_len,samplerate.output_frames_gen,output.fp) != samplerate.output_frames_gen) { LOGE("fwrite failed"); exit(EXIT_FAILURE); } memset(input.buf,'\0',input.items*input.frame_len); memset(output.buf,'\0',output.items*output.frame_len); } } static void clean_up() { /* free AUDIO obj */ audio_del(&input); audio_del(&output); /* free tmp buf */ free(tmpbuf); tmpbuf = NULL; /* free samplerate obj*/ src_delete(state); /* free dirctionary */ iniparser_freedict(ini); } int main(int argc,const char *argv[]) { /* copyright */ printf("%s",NOTICE); initialize(); resamplerate(); printf("output path : %s\n",output.path); printf("successfully\n"); clean_up(); return 0; }
23.990826
128
0.591332
1eeba3bf06e3a192ab62f6846ae8f350e376971f
2,681
h
C
src/third_party/mozjs-45/include/js/TypeDecls.h
SunguckLee/real-mongodb
fef0e44fafc6d3709a84101327e7d2f54dd18d88
[ "Apache-2.0" ]
4
2018-02-06T01:53:12.000Z
2018-02-20T01:47:36.000Z
src/third_party/mozjs-45/include/js/TypeDecls.h
SunguckLee/real-mongodb
fef0e44fafc6d3709a84101327e7d2f54dd18d88
[ "Apache-2.0" ]
null
null
null
src/third_party/mozjs-45/include/js/TypeDecls.h
SunguckLee/real-mongodb
fef0e44fafc6d3709a84101327e7d2f54dd18d88
[ "Apache-2.0" ]
3
2018-02-06T01:53:18.000Z
2021-07-28T09:48:15.000Z
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * 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/. */ // This file contains public type declarations that are used *frequently*. If // it doesn't occur at least 10 times in Gecko, it probably shouldn't be in // here. // // It includes only: // - forward declarations of structs and classes; // - typedefs; // - enums (maybe). // It does *not* contain any struct or class definitions. #ifndef js_TypeDecls_h #define js_TypeDecls_h #include <stddef.h> #include <stdint.h> #include "js-config.h" struct JSContext; class JSFunction; class JSObject; class JSScript; class JSString; class JSAddonId; struct jsid; namespace JS { typedef unsigned char Latin1Char; class Symbol; class Value; template <typename T> class Handle; template <typename T> class MutableHandle; template <typename T> class Rooted; template <typename T> class PersistentRooted; typedef Handle<JSFunction*> HandleFunction; typedef Handle<jsid> HandleId; typedef Handle<JSObject*> HandleObject; typedef Handle<JSScript*> HandleScript; typedef Handle<JSString*> HandleString; typedef Handle<JS::Symbol*> HandleSymbol; typedef Handle<Value> HandleValue; typedef MutableHandle<JSFunction*> MutableHandleFunction; typedef MutableHandle<jsid> MutableHandleId; typedef MutableHandle<JSObject*> MutableHandleObject; typedef MutableHandle<JSScript*> MutableHandleScript; typedef MutableHandle<JSString*> MutableHandleString; typedef MutableHandle<JS::Symbol*> MutableHandleSymbol; typedef MutableHandle<Value> MutableHandleValue; typedef Rooted<JSObject*> RootedObject; typedef Rooted<JSFunction*> RootedFunction; typedef Rooted<JSScript*> RootedScript; typedef Rooted<JSString*> RootedString; typedef Rooted<JS::Symbol*> RootedSymbol; typedef Rooted<jsid> RootedId; typedef Rooted<JS::Value> RootedValue; typedef PersistentRooted<JSFunction*> PersistentRootedFunction; typedef PersistentRooted<jsid> PersistentRootedId; typedef PersistentRooted<JSObject*> PersistentRootedObject; typedef PersistentRooted<JSScript*> PersistentRootedScript; typedef PersistentRooted<JSString*> PersistentRootedString; typedef PersistentRooted<JS::Symbol*> PersistentRootedSymbol; typedef PersistentRooted<Value> PersistentRootedValue; } // namespace JS #endif /* js_TypeDecls_h */
33.5125
79
0.736292
715da4247ebc561a1c74db70fcb2689cf3b93e6c
55,214
c
C
nfp-sdk-6.0.1/p4/components/npe/me/src/npe_hash.c
earthcomputing/Netronome
9f5132ecea3c134322305c9524da7189374881ec
[ "MIT" ]
null
null
null
nfp-sdk-6.0.1/p4/components/npe/me/src/npe_hash.c
earthcomputing/Netronome
9f5132ecea3c134322305c9524da7189374881ec
[ "MIT" ]
null
null
null
nfp-sdk-6.0.1/p4/components/npe/me/src/npe_hash.c
earthcomputing/Netronome
9f5132ecea3c134322305c9524da7189374881ec
[ "MIT" ]
null
null
null
/* * Copyright (C) 2012-2015, Netronome Systems, 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. * * @file src/npe_hash.c * @brief Hash operations */ /* Compilation for Netronome NFP */ #if defined(__NFP_TOOL_NFCC) #ifndef NFP_LIB_ANY_NFCC_VERSION #if (__NFP_TOOL_NFCC < NFP_SW_VERSION(5, 0, 0, 0)) || \ (__NFP_TOOL_NFCC > NFP_SW_VERSION(6, 255, 255, 255)) #error "This software is not supported for the version of the SDK currently in use." #endif #endif #endif /* flowenv code */ #ifdef __NFP_TOOL_NFCC #include <assert.h> #include <nfp/mem_bulk.h> #include <nfp/me.h> #endif /* npe code */ #include <npe_types.h> #include <npe_hash.h> enum npe_hash_crc_op { CRC_32_BE, CRC_32_BE_SWAP, CRC_32_LE, CRC_32_LE_SWAP, CRC_CCITT_BE, CRC_CCITT_BE_SWAP, CRC_CCITT_LE, CRC_CCITT_LE_SWAP, CRC_ISCSI_BE, CRC_ISCSI_BE_SWAP, CRC_ISCSI_LE, CRC_ISCSI_LE_SWAP, CRC_10_BE, CRC_10_BE_SWAP, CRC_10_LE, CRC_10_LE_SWAP, CRC_5_BE, CRC_5_BE_SWAP, CRC_5_LE, CRC_5_LE_SWAP, CRC_NONE, CRC_NONE_SWAP }; enum npe_hash_crc_bytes { BYTES_0_3, BYTES_0_2, BYTES_0_1, BYTE_0, BYTES_1_3, BYTES_2_3, BYTE_3, }; #ifndef __NFP_TOOL_NFCC static const unsigned int crc32_table[256] = { 0x00000000U,0x04C11DB7U,0x09823B6EU,0x0D4326D9U, 0x130476DCU,0x17C56B6BU,0x1A864DB2U,0x1E475005U, 0x2608EDB8U,0x22C9F00FU,0x2F8AD6D6U,0x2B4BCB61U, 0x350C9B64U,0x31CD86D3U,0x3C8EA00AU,0x384FBDBDU, 0x4C11DB70U,0x48D0C6C7U,0x4593E01EU,0x4152FDA9U, 0x5F15ADACU,0x5BD4B01BU,0x569796C2U,0x52568B75U, 0x6A1936C8U,0x6ED82B7FU,0x639B0DA6U,0x675A1011U, 0x791D4014U,0x7DDC5DA3U,0x709F7B7AU,0x745E66CDU, 0x9823B6E0U,0x9CE2AB57U,0x91A18D8EU,0x95609039U, 0x8B27C03CU,0x8FE6DD8BU,0x82A5FB52U,0x8664E6E5U, 0xBE2B5B58U,0xBAEA46EFU,0xB7A96036U,0xB3687D81U, 0xAD2F2D84U,0xA9EE3033U,0xA4AD16EAU,0xA06C0B5DU, 0xD4326D90U,0xD0F37027U,0xDDB056FEU,0xD9714B49U, 0xC7361B4CU,0xC3F706FBU,0xCEB42022U,0xCA753D95U, 0xF23A8028U,0xF6FB9D9FU,0xFBB8BB46U,0xFF79A6F1U, 0xE13EF6F4U,0xE5FFEB43U,0xE8BCCD9AU,0xEC7DD02DU, 0x34867077U,0x30476DC0U,0x3D044B19U,0x39C556AEU, 0x278206ABU,0x23431B1CU,0x2E003DC5U,0x2AC12072U, 0x128E9DCFU,0x164F8078U,0x1B0CA6A1U,0x1FCDBB16U, 0x018AEB13U,0x054BF6A4U,0x0808D07DU,0x0CC9CDCAU, 0x7897AB07U,0x7C56B6B0U,0x71159069U,0x75D48DDEU, 0x6B93DDDBU,0x6F52C06CU,0x6211E6B5U,0x66D0FB02U, 0x5E9F46BFU,0x5A5E5B08U,0x571D7DD1U,0x53DC6066U, 0x4D9B3063U,0x495A2DD4U,0x44190B0DU,0x40D816BAU, 0xACA5C697U,0xA864DB20U,0xA527FDF9U,0xA1E6E04EU, 0xBFA1B04BU,0xBB60ADFCU,0xB6238B25U,0xB2E29692U, 0x8AAD2B2FU,0x8E6C3698U,0x832F1041U,0x87EE0DF6U, 0x99A95DF3U,0x9D684044U,0x902B669DU,0x94EA7B2AU, 0xE0B41DE7U,0xE4750050U,0xE9362689U,0xEDF73B3EU, 0xF3B06B3BU,0xF771768CU,0xFA325055U,0xFEF34DE2U, 0xC6BCF05FU,0xC27DEDE8U,0xCF3ECB31U,0xCBFFD686U, 0xD5B88683U,0xD1799B34U,0xDC3ABDEDU,0xD8FBA05AU, 0x690CE0EEU,0x6DCDFD59U,0x608EDB80U,0x644FC637U, 0x7A089632U,0x7EC98B85U,0x738AAD5CU,0x774BB0EBU, 0x4F040D56U,0x4BC510E1U,0x46863638U,0x42472B8FU, 0x5C007B8AU,0x58C1663DU,0x558240E4U,0x51435D53U, 0x251D3B9EU,0x21DC2629U,0x2C9F00F0U,0x285E1D47U, 0x36194D42U,0x32D850F5U,0x3F9B762CU,0x3B5A6B9BU, 0x0315D626U,0x07D4CB91U,0x0A97ED48U,0x0E56F0FFU, 0x1011A0FAU,0x14D0BD4DU,0x19939B94U,0x1D528623U, 0xF12F560EU,0xF5EE4BB9U,0xF8AD6D60U,0xFC6C70D7U, 0xE22B20D2U,0xE6EA3D65U,0xEBA91BBCU,0xEF68060BU, 0xD727BBB6U,0xD3E6A601U,0xDEA580D8U,0xDA649D6FU, 0xC423CD6AU,0xC0E2D0DDU,0xCDA1F604U,0xC960EBB3U, 0xBD3E8D7EU,0xB9FF90C9U,0xB4BCB610U,0xB07DABA7U, 0xAE3AFBA2U,0xAAFBE615U,0xA7B8C0CCU,0xA379DD7BU, 0x9B3660C6U,0x9FF77D71U,0x92B45BA8U,0x9675461FU, 0x8832161AU,0x8CF30BADU,0x81B02D74U,0x857130C3U, 0x5D8A9099U,0x594B8D2EU,0x5408ABF7U,0x50C9B640U, 0x4E8EE645U,0x4A4FFBF2U,0x470CDD2BU,0x43CDC09CU, 0x7B827D21U,0x7F436096U,0x7200464FU,0x76C15BF8U, 0x68860BFDU,0x6C47164AU,0x61043093U,0x65C52D24U, 0x119B4BE9U,0x155A565EU,0x18197087U,0x1CD86D30U, 0x029F3D35U,0x065E2082U,0x0B1D065BU,0x0FDC1BECU, 0x3793A651U,0x3352BBE6U,0x3E119D3FU,0x3AD08088U, 0x2497D08DU,0x2056CD3AU,0x2D15EBE3U,0x29D4F654U, 0xC5A92679U,0xC1683BCEU,0xCC2B1D17U,0xC8EA00A0U, 0xD6AD50A5U,0xD26C4D12U,0xDF2F6BCBU,0xDBEE767CU, 0xE3A1CBC1U,0xE760D676U,0xEA23F0AFU,0xEEE2ED18U, 0xF0A5BD1DU,0xF464A0AAU,0xF9278673U,0xFDE69BC4U, 0x89B8FD09U,0x8D79E0BEU,0x803AC667U,0x84FBDBD0U, 0x9ABC8BD5U,0x9E7D9662U,0x933EB0BBU,0x97FFAD0CU, 0xAFB010B1U,0xAB710D06U,0xA6322BDFU,0xA2F33668U, 0xBCB4666DU,0xB8757BDAU,0xB5365D03U,0xB1F740B4U }; static const uint16_t crc_ccitt_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 }; #endif #ifdef __NFP_TOOL_NFCC #define _MULTI_REG_OP( reg_op, reg_op_last, s ) \ { \ int last_reg; \ \ switch ( s & ~3) { \ \ case 64: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ reg_op(10); reg_op(11); reg_op(12); reg_op(13); reg_op(14); \ reg_op(15); \ last_reg = 16; \ break; \ \ case 60: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ reg_op(10); reg_op(11); reg_op(12); reg_op(13); reg_op(14); \ last_reg = 15; \ break; \ \ case 56: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ reg_op(10); reg_op(11); reg_op(12); reg_op(13); \ last_reg = 14; \ break; \ \ case 52: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ reg_op(10); reg_op(11); reg_op(12); \ last_reg = 13; \ break; \ \ case 48: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ reg_op(10); reg_op(11); \ last_reg = 12; \ break; \ \ case 44: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ reg_op(10); \ last_reg = 11; \ break; \ \ case 40: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); reg_op(9); \ last_reg = 10; \ break; \ \ case 36: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); reg_op(8); \ last_reg = 9; \ break; \ \ case 32: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); reg_op(7); \ last_reg = 8; \ break; \ \ case 28: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); reg_op(6); \ last_reg = 7; \ break; \ \ case 24: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ reg_op(5); \ last_reg = 6; \ break; \ \ case 20: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); reg_op(4); \ last_reg = 5; \ break; \ \ case 16: \ reg_op(0); reg_op(1); reg_op(2); reg_op(3); \ last_reg = 4; \ break; \ \ case 12: \ reg_op(0); reg_op(1); reg_op(2); \ last_reg = 3; \ break; \ \ case 8: \ reg_op(0); reg_op(1); \ last_reg = 2; \ break; \ \ case 4: \ reg_op(0); \ last_reg = 1; \ break; \ \ case 0: \ last_reg = 0; \ break; \ \ default: \ break; \ } \ \ switch ( size & 3 ) { \ \ case 1: \ reg_op_last(last_reg, BYTE_0); \ break; \ case 2: \ reg_op_last(last_reg, BYTES_0_1); \ break; \ case 3: \ reg_op_last(last_reg, BYTES_0_2); \ break; \ default: \ break; \ } \ } #endif #ifdef __NFP_TOOL_NFCC __NPE_INTRINSIC void _npe_hash_crc_op(enum npe_hash_crc_op op, enum npe_hash_crc_bytes b, uint32_t d) { uint32_t res; if ( op == CRC_32_BE ) { if (b == BYTES_0_3) __asm crc_be[crc_32, res, d], bytes_0_3; else if (b == BYTES_0_2) __asm crc_be[crc_32, res, d], bytes_0_2; else if (b == BYTES_0_1) __asm crc_be[crc_32, res, d], bytes_0_1; else if (b == BYTE_0) __asm crc_be[crc_32, res, d], byte_0; else if (b == BYTES_1_3) __asm crc_be[crc_32, res, d], bytes_1_3; else if (b == BYTES_2_3) __asm crc_be[crc_32, res, d], bytes_2_3; else if (b == BYTE_3) __asm crc_be[crc_32, res, d], byte_3; } else if ( op == CRC_32_BE_SWAP ) { if (b == BYTES_0_3) __asm crc_be[crc_32, res, d], bytes_0_3, bit_swap; else if (b == BYTES_0_2) __asm crc_be[crc_32, res, d], bytes_0_2, bit_swap; else if (b == BYTES_0_1) __asm crc_be[crc_32, res, d], bytes_0_1, bit_swap; else if (b == BYTE_0) __asm crc_be[crc_32, res, d], byte_0, bit_swap; else if (b == BYTES_1_3) __asm crc_be[crc_32, res, d], bytes_1_3, bit_swap; else if (b == BYTES_2_3) __asm crc_be[crc_32, res, d], bytes_2_3, bit_swap; else if (b == BYTE_3) __asm crc_be[crc_32, res, d], byte_3, bit_swap; } else if ( op == CRC_32_LE ) { if (b == BYTES_0_3) __asm crc_le[crc_32, res, d], bytes_0_3; else if (b == BYTES_0_2) __asm crc_le[crc_32, res, d], bytes_0_2; else if (b == BYTES_0_1) __asm crc_le[crc_32, res, d], bytes_0_1; else if (b == BYTE_0) __asm crc_le[crc_32, res, d], byte_0; else if (b == BYTES_1_3) __asm crc_le[crc_32, res, d], bytes_1_3; else if (b == BYTES_2_3) __asm crc_le[crc_32, res, d], bytes_2_3; else if (b == BYTE_3) __asm crc_le[crc_32, res, d], byte_3; } else if ( op == CRC_32_LE_SWAP ) { if (b == BYTES_0_3) __asm crc_le[crc_32, res, d], bytes_0_3, bit_swap; else if (b == BYTES_0_2) __asm crc_le[crc_32, res, d], bytes_0_2, bit_swap; else if (b == BYTES_0_1) __asm crc_le[crc_32, res, d], bytes_0_1, bit_swap; else if (b == BYTE_0) __asm crc_le[crc_32, res, d], byte_0, bit_swap; else if (b == BYTES_1_3) __asm crc_le[crc_32, res, d], bytes_1_3, bit_swap; else if (b == BYTES_2_3) __asm crc_le[crc_32, res, d], bytes_2_3, bit_swap; else if (b == BYTE_3) __asm crc_le[crc_32, res, d], byte_3, bit_swap; } else if ( op == CRC_CCITT_BE ) { if (b == BYTES_0_3) __asm crc_be[crc_ccitt, res, d], bytes_0_3; else if (b == BYTES_0_2) __asm crc_be[crc_ccitt, res, d], bytes_0_2; else if (b == BYTES_0_1) __asm crc_be[crc_ccitt, res, d], bytes_0_1; else if (b == BYTE_0) __asm crc_be[crc_ccitt, res, d], byte_0; else if (b == BYTES_1_3) __asm crc_be[crc_ccitt, res, d], bytes_1_3; else if (b == BYTES_2_3) __asm crc_be[crc_ccitt, res, d], bytes_2_3; else if (b == BYTE_3) __asm crc_be[crc_ccitt, res, d], byte_3; } else if ( op == CRC_CCITT_BE_SWAP ) { if (b == BYTES_0_3) __asm crc_be[crc_ccitt, res, d], bytes_0_3, bit_swap; else if (b == BYTES_0_2) __asm crc_be[crc_ccitt, res, d], bytes_0_2, bit_swap; else if (b == BYTES_0_1) __asm crc_be[crc_ccitt, res, d], bytes_0_1, bit_swap; else if (b == BYTE_0) __asm crc_be[crc_ccitt, res, d], byte_0, bit_swap; else if (b == BYTES_1_3) __asm crc_be[crc_ccitt, res, d], bytes_1_3, bit_swap; else if (b == BYTES_2_3) __asm crc_be[crc_ccitt, res, d], bytes_2_3, bit_swap; else if (b == BYTE_3) __asm crc_be[crc_ccitt, res, d], byte_3, bit_swap; } else if ( op == CRC_CCITT_LE ) { if (b == BYTES_0_3) __asm crc_le[crc_ccitt, res, d], bytes_0_3; else if (b == BYTES_0_2) __asm crc_le[crc_ccitt, res, d], bytes_0_2; else if (b == BYTES_0_1) __asm crc_le[crc_ccitt, res, d], bytes_0_1; else if (b == BYTE_0) __asm crc_le[crc_ccitt, res, d], byte_0; else if (b == BYTES_1_3) __asm crc_le[crc_ccitt, res, d], bytes_1_3; else if (b == BYTES_2_3) __asm crc_le[crc_ccitt, res, d], bytes_2_3; else if (b == BYTE_3) __asm crc_le[crc_ccitt, res, d], byte_3; } else if ( op == CRC_CCITT_LE_SWAP ) { if (b == BYTES_0_3) __asm crc_le[crc_ccitt, res, d], bytes_0_3, bit_swap; else if (b == BYTES_0_2) __asm crc_le[crc_ccitt, res, d], bytes_0_2, bit_swap; else if (b == BYTES_0_1) __asm crc_le[crc_ccitt, res, d], bytes_0_1, bit_swap; else if (b == BYTE_0) __asm crc_le[crc_ccitt, res, d], byte_0, bit_swap; else if (b == BYTES_1_3) __asm crc_le[crc_ccitt, res, d], bytes_1_3, bit_swap; else if (b == BYTES_2_3) __asm crc_le[crc_ccitt, res, d], bytes_2_3, bit_swap; else if (b == BYTE_3) __asm crc_le[crc_ccitt, res, d], byte_3, bit_swap; } } #endif #ifdef __NFP_TOOL_NFCC __NPE_INTRINSIC uint32_t _npe_hash_crc(enum npe_hash_crc_op op, void *p, size_t size, uint32_t init) { crc_write(init); if (__is_in_lmem(p)) { #undef _REG_OP #define _REG_OP(_x) _npe_hash_crc_op(op, BYTES_0_3, \ ((__lmem uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_crc_op(op, _b, \ ((__lmem uint32_t *)p)[_x]) } else { #undef _REG_OP #define _REG_OP(_x) _npe_hash_crc_op(op, BYTES_0_3, \ ((__gpr uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_crc_op(op, _b, \ ((__gpr uint32_t *)p)[_x]) } _MULTI_REG_OP( _REG_OP, _REG_OP_LAST, size); return crc_read(); } #endif #ifdef __NFP_TOOL_NFCC __NPE_INTRINSIC uint32_t _npe_hash_crc_rem(enum npe_hash_crc_op op, npe_mem_ptr_t p, size_t size, uint32_t init) { __xread uint32_t xfr[8]; int bytes_left = size; uint64_t curr_byte = (uint64_t)p; crc_write(init); while(1) { if ( bytes_left >= 32) { mem_read64( &xfr[0], (__mem void *)curr_byte, 32); _npe_hash_crc_op(op, BYTES_0_3, xfr[0]); _npe_hash_crc_op(op, BYTES_0_3, xfr[1]); _npe_hash_crc_op(op, BYTES_0_3, xfr[2]); _npe_hash_crc_op(op, BYTES_0_3, xfr[3]); _npe_hash_crc_op(op, BYTES_0_3, xfr[4]); _npe_hash_crc_op(op, BYTES_0_3, xfr[5]); _npe_hash_crc_op(op, BYTES_0_3, xfr[6]); _npe_hash_crc_op(op, BYTES_0_3, xfr[7]); bytes_left -= 32; curr_byte += 32; } else if ( bytes_left >= 24) { mem_read64( &xfr[0], (__mem void *)curr_byte, 24); _npe_hash_crc_op(op, BYTES_0_3, xfr[0]); _npe_hash_crc_op(op, BYTES_0_3, xfr[1]); _npe_hash_crc_op(op, BYTES_0_3, xfr[2]); _npe_hash_crc_op(op, BYTES_0_3, xfr[3]); _npe_hash_crc_op(op, BYTES_0_3, xfr[4]); _npe_hash_crc_op(op, BYTES_0_3, xfr[5]); bytes_left -= 24; curr_byte += 24; } else if ( bytes_left >= 16) { mem_read64( &xfr[0], (__mem void *)curr_byte, 16); _npe_hash_crc_op(op, BYTES_0_3, xfr[0]); _npe_hash_crc_op(op, BYTES_0_3, xfr[1]); _npe_hash_crc_op(op, BYTES_0_3, xfr[2]); _npe_hash_crc_op(op, BYTES_0_3, xfr[3]); bytes_left -= 16; curr_byte += 16; } else if ( bytes_left >= 8) { mem_read64( &xfr[0], (__mem void *)curr_byte, 8); _npe_hash_crc_op(op, BYTES_0_3, xfr[0]); _npe_hash_crc_op(op, BYTES_0_3, xfr[1]); bytes_left -= 8; curr_byte += 8; } else if ( bytes_left >= 4) { mem_read32( &xfr[0], (__mem void *)curr_byte, 4); _npe_hash_crc_op(op, BYTES_0_3, xfr[0]); bytes_left -= 4; curr_byte += 4; } else { mem_read8( &xfr[0], (__mem void *)curr_byte, bytes_left); switch ( bytes_left ) { case 1: _npe_hash_crc_op(op, BYTE_0, xfr[0]); bytes_left -= 1; break; case 2: _npe_hash_crc_op(op, BYTES_0_1, xfr[0]); bytes_left -= 2; break; case 3: _npe_hash_crc_op(op, BYTES_0_2, xfr[0]); bytes_left -= 3; break; default: break; } } if ( bytes_left == 0 ) break; } return crc_read(); } #endif __NPE_INTRINSIC uint32_t npe_hash_crc_32(void *p, size_t size, uint32_t init, enum npe_endian endian, enum npe_bit_swap swap) { #ifdef __NFP_TOOL_NFCC /* N.B. In order to support both lmem and reg data, need to have constant values for size, endian, swap due to various compiler nuances. Also limiting max data size for similar reason. */ ctassert(__is_ct_const(size)); ctassert(size <= 67); ctassert(__is_ct_const(endian)); ctassert(__is_ct_const(swap)); #if ( endian == NPE_BIG_ENDIAN ) #if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc(CRC_32_BE, p, size, init); #else return _npe_hash_crc(CRC_32_BE_SWAP, p, size, init); #endif #else #if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc(CRC_32_LE, p, size, init); #else return _npe_hash_crc(CRC_32_LE_SWAP, p, size, init); #endif #endif #else // crc-32 polynomial: 0x104C11DB7 uint32_t crc = init; int len = size; char *data = (char *)p; if ( endian == NPE_BIG_ENDIAN ) { for (;;) { char d; d = *(data+3); crc = crc32_table[(d & 0xff) ^ ((crc >> 24) & 0xff)] ^ (crc << 8); len--; if ( len <= 0 ) break; d = *(data+2); crc = crc32_table[(d & 0xff) ^ ((crc >> 24) & 0xff)] ^ (crc << 8); len--; if ( len <= 0 ) break; d = *(data+1); crc = crc32_table[(d & 0xff) ^ ((crc >> 24) & 0xff)] ^ (crc << 8); len--; if ( len <= 0 ) break; d = *(data+0); crc = crc32_table[(d & 0xff) ^ ((crc >> 24) & 0xff)] ^ (crc << 8); len--; if ( len <= 0 ) break; data+=4; } } else { for (;;) { crc = crc32_table[(*data & 0xff) ^ ((crc >> 24) & 0xff)] ^ (crc << 8); data++; len--; if ( len <= 0 ) break; } } return crc; #endif } uint32_t npe_hash_crc_32_rem(npe_mem_ptr_t p, size_t size, uint32_t init, enum npe_endian endian, enum npe_bit_swap swap) { #ifdef __NFP_TOOL_NFCC if ( endian == NPE_BIG_ENDIAN ) { if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc_rem(CRC_32_BE, p, size, init); else return _npe_hash_crc_rem(CRC_32_BE_SWAP, p, size, init); } else { if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc_rem(CRC_32_LE, p, size, init); else return _npe_hash_crc_rem(CRC_32_LE_SWAP, p, size, init); } #else return npe_hash_crc_32(p, size, init, endian, swap); #endif } __NPE_INTRINSIC uint32_t npe_hash_crc_ccitt(void *p, size_t size, uint32_t init, enum npe_endian endian, enum npe_bit_swap swap) { #ifdef __NFP_TOOL_NFCC /* N.B. In order to support both lmem and reg data, need to have constant values for size, endian, swap due to various compiler nuances. Also limiting max data size for similar reason. */ ctassert(__is_ct_const(size)); ctassert(size <= 67); ctassert(__is_ct_const(endian)); ctassert(__is_ct_const(swap)); #if ( endian == NPE_BIG_ENDIAN ) #if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc(CRC_CCITT_BE, p, size, init); #else return _npe_hash_crc(CRC_CCITT_BE_SWAP, p, size, init); #endif #else #if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc(CRC_CCITT_LE, p, size, init); #else return _npe_hash_crc(CRC_CCITT_LE_SWAP, p, size, init); #endif #endif #else // crc-ccitt polynomial: 0x11021 uint32_t crc = init & 0xffff; int len = size; char *data = (char *)p; if ( endian == NPE_BIG_ENDIAN ) { for (;;) { char d; d = *(data+3); crc = crc_ccitt_table[(crc >> 8 ^ d) & 0xffU] ^ (crc << 8); len--; if ( len <= 0 ) break; d = *(data+2); crc = crc_ccitt_table[(crc >> 8 ^ d) & 0xffU] ^ (crc << 8); len--; if ( len <= 0 ) break; d = *(data+1); crc = crc_ccitt_table[(crc >> 8 ^ d) & 0xffU] ^ (crc << 8); len--; if ( len <= 0 ) break; d = *(data+0); crc = crc_ccitt_table[(crc >> 8 ^ d) & 0xffU] ^ (crc << 8); len--; if ( len <= 0 ) break; data+=4; } } else { for (;;) { crc = crc_ccitt_table[(crc >> 8 ^ *data) & 0xffU] ^ (crc << 8); data++; len--; if ( len <= 0 ) break; } } return crc & 0xffffU; #endif } uint32_t npe_hash_crc_ccitt_rem(npe_mem_ptr_t p, size_t size, uint32_t init, enum npe_endian endian, enum npe_bit_swap swap) { #ifdef __NFP_TOOL_NFCC if ( endian == NPE_BIG_ENDIAN ) { if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc_rem(CRC_CCITT_BE, p, size, init); else return _npe_hash_crc_rem(CRC_CCITT_BE_SWAP, p, size, init); } else { if ( swap == NPE_BIT_SWAP_DISABLE ) return _npe_hash_crc_rem(CRC_CCITT_LE, p, size, init); else return _npe_hash_crc_rem(CRC_CCITT_LE_SWAP, p, size, init); } #else /* GCC */ return npe_hash_crc_ccitt(p, size, init, endian, swap); #endif } #define _npe_hash_fletcher_16_op(s1, s2, b, d) \ { \ if (b == BYTES_0_3) { \ s1 += ((d >> 24) & 0xff); \ s2 += s1; \ s1 += ((d >> 16) & 0xff); \ s2 += s1; \ s1 += ((d >> 8) & 0xff); \ s2 += s1; \ s1 += ((d >> 0) & 0xff); \ s2 += s1; \ } else if (b == BYTES_0_2) { \ s1 += ((d >> 24) & 0xff); \ s2 += s1; \ s1 += ((d >> 16) & 0xff); \ s2 += s1; \ s1 += ((d >> 8) & 0xff); \ s2 += s1; \ } else if (b == BYTES_0_1) { \ s1 += ((d >> 24) & 0xff); \ s2 += s1; \ s1 += ((d >> 16) & 0xff); \ s2 += s1; \ } else if (b == BYTE_0) { \ s1 += ((d >> 24) & 0xff); \ s2 += s1; \ } \ \ s1 = (s1 & 0xff) + (s1 >> 8); \ s2 = (s2 & 0xff) + (s2 >> 8); \ } __NPE_INTRINSIC uint16_t npe_hash_fletcher_16(void *p, size_t size) { #ifdef __NFP_TOOL_NFCC __gpr uint32_t sum1 = 0xff; __gpr uint32_t sum2 = 0xff; /* N.B. In order to support both lmem and reg data, need to have constant values for size due to various compiler nuances. Also limiting max data size for similar reason. */ ctassert(__is_ct_const(size)); ctassert(size <= 67); if (__is_in_lmem(p)) { #undef _REG_OP #define _REG_OP(_x) _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, \ ((__lmem uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_fletcher_16_op(sum1, sum2, _b, \ ((__lmem uint32_t *)p)[_x]) } else { #undef _REG_OP #define _REG_OP(_x) _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, \ ((__gpr uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_fletcher_16_op(sum1, sum2, _b, \ ((__gpr uint32_t *)p)[_x]) } _MULTI_REG_OP( _REG_OP, _REG_OP_LAST, size ); #else /* GCC */ uint32_t *curr_byte = (uint32_t *)p; uint32_t sum1 = 0xff; uint32_t sum2 = 0xff; int bytes_left = size; while(1) { uint32_t val = *curr_byte++; if ( bytes_left >= 4) { _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, val); bytes_left -= 4; } else { switch ( bytes_left ) { case 1: _npe_hash_fletcher_16_op(sum1, sum2, BYTE_0, val); bytes_left -= 1; break; case 2: _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_1, val); bytes_left -= 2; break; case 3: _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_2, val); bytes_left -= 3; break; default: break; } } if ( bytes_left == 0 ) break; } #endif done: return ( sum2 << 8 | sum1 ); } uint16_t npe_hash_fletcher_16_rem(npe_mem_ptr_t p, size_t size) { #ifdef __NFP_TOOL_NFCC __xread uint32_t xfr[8]; int bytes_left = size; uint64_t curr_byte = (uint64_t)p; __gpr uint32_t sum1 = 0xff; __gpr uint32_t sum2 = 0xff; while(1) { if ( bytes_left >= 32) { mem_read64( &xfr[0], (__mem void *)curr_byte, 32); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[1]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[2]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[3]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[4]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[5]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[6]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[7]); bytes_left -= 32; curr_byte += 32; } else if ( bytes_left >= 24) { mem_read64( &xfr[0], (__mem void *)curr_byte, 24); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[1]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[2]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[3]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[4]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[5]); bytes_left -= 24; curr_byte += 24; } else if ( bytes_left >= 16) { mem_read64( &xfr[0], (__mem void *)curr_byte, 16); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[1]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[2]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[3]); bytes_left -= 16; curr_byte += 16; } else if ( bytes_left >= 8) { mem_read64( &xfr[0], (__mem void *)curr_byte, 8); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[1]); bytes_left -= 8; curr_byte += 8; } else if ( bytes_left >= 4) { mem_read32( &xfr[0], (__mem void *)curr_byte, 4); _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_3, xfr[0]); bytes_left -= 4; curr_byte += 4; } else { mem_read8( &xfr[0], (__mem void *)curr_byte, bytes_left); switch ( bytes_left ) { case 1: _npe_hash_fletcher_16_op(sum1, sum2, BYTE_0, xfr[0]); bytes_left -= 1; break; case 2: _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_1, xfr[0]); bytes_left -= 2; break; case 3: _npe_hash_fletcher_16_op(sum1, sum2, BYTES_0_2, xfr[0]); bytes_left -= 3; break; default: break; } } if ( bytes_left == 0 ) break; } return ( sum2 << 8 | sum1 ); #else /* GCC */ return npe_hash_fletcher_16(p, size); #endif } #define _npe_hash_fletcher_32_op(s1, s2, b, d ) \ { \ if ( b == BYTES_0_3 ) { \ s1 += ((d >> 16) & 0xffff); \ s2 += s1; \ s1 += ((d >> 0) & 0xffff); \ s2 += s1; \ } else { \ s1 += ((d >> 16) & 0xffff); \ s2 += s1; \ } \ s1 = (s1 & 0xffff) + (s1 >> 16); \ s2 = (s2 & 0xffff) + (s2 >> 16); \ } __NPE_INTRINSIC uint32_t npe_hash_fletcher_32(void *p, size_t size) { #ifdef __NFP_TOOL_NFCC __gpr uint32_t sum1 = 0xffff; __gpr uint32_t sum2 = 0xffff; /* N.B. In order to support both lmem and reg data, need to have constant values for size due to various compiler nuances. Also limiting max data size for similar reason. */ ctassert(__is_ct_const(size)); ctassert(size <= 67); ctassert(!(size & 1)); if (__is_in_lmem(p)) { #undef _REG_OP #define _REG_OP(_x) _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, \ ((__lmem uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x, _b) _npe_hash_fletcher_32_op(sum1, sum2, \ BYTES_0_1, \ ((__lmem uint32_t *)p)[_x]) } else { #undef _REG_OP #define _REG_OP(_x) _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, \ ((__gpr uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x, _b) _npe_hash_fletcher_32_op(sum1, sum2, \ BYTES_0_1, \ ((__gpr uint32_t *)p)[_x]) } _MULTI_REG_OP(_REG_OP, _REG_OP_LAST, size); #else /* GCC */ uint32_t *curr_byte = (uint32_t *)p; uint32_t sum1 = 0xffff; uint32_t sum2 = 0xffff; int bytes_left = size & ~1; while(1) { uint32_t val = *curr_byte++; if ( bytes_left >= 4) { _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, val); bytes_left -= 4; } else if ( bytes_left >= 2 ) { _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_1, val); bytes_left -= 2; } if ( bytes_left == 0 ) break; } #endif return ( sum2 << 16 | sum1 ); } uint32_t npe_hash_fletcher_32_rem(npe_mem_ptr_t p, size_t size) { #ifdef __NFP_TOOL_NFCC __xread uint32_t xfr[8]; int bytes_left = size & ~1; uint64_t curr_byte = (uint64_t)p; __gpr uint32_t sum1 = 0xffff; __gpr uint32_t sum2 = 0xffff; while(1) { if ( bytes_left >= 32) { mem_read64( &xfr[0], (__mem void *)curr_byte, 32); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[1]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[2]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[3]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[4]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[5]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[6]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[7]); bytes_left -= 32; curr_byte += 32; } else if ( bytes_left >= 24) { mem_read64( &xfr[0], (__mem void *)curr_byte, 24); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[1]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[2]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[3]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[4]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[5]); bytes_left -= 24; curr_byte += 24; } else if ( bytes_left >= 16) { mem_read64( &xfr[0], (__mem void *)curr_byte, 16); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[1]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[2]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[3]); bytes_left -= 16; curr_byte += 16; } else if ( bytes_left >= 8) { mem_read64( &xfr[0], (__mem void *)curr_byte, 8); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[0]); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[1]); bytes_left -= 8; curr_byte += 8; } else if ( bytes_left >= 4) { mem_read32( &xfr[0], (__mem void *)curr_byte, 4); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_3, xfr[0]); bytes_left -= 4; curr_byte += 4; } else if (bytes_left >= 2) { mem_read8( &xfr[0], (__mem void *)curr_byte, 2); _npe_hash_fletcher_32_op(sum1, sum2, BYTES_0_1, xfr[0]); bytes_left -= 2; curr_byte += 2; } if ( bytes_left == 0 ) break; } return ( sum2 << 16 | sum1 ); #else return npe_hash_fletcher_32(p, size); #endif } #define _npe_hash_jenkins_8_op(hash, b, d) \ { \ if (b == BYTES_0_3) { \ hash += d >> 24 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ hash += d >> 16 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ hash += d >> 8 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ hash += d >> 0 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ } else if ( b == BYTES_0_2 ) { \ hash += d >> 24 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ hash += d >> 16 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ hash += d >> 8 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ } else if ( b == BYTES_0_1 ) { \ hash += d >> 24 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ hash += d >> 16 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ } else if ( b == BYTE_0 ) { \ hash += d >> 24 & 0xff; \ hash += hash << 10; \ hash ^= hash >> 6; \ } \ } __NPE_INTRINSIC uint32_t npe_hash_jenkins_8(void *p, size_t size) { #ifdef __NFP_TOOL_NFCC __gpr uint32_t hash = 0; /* N.B. In order to support both lmem and reg data, need to have constant values for size due to various compiler nuances. Also limiting max data size for similar reason. */ ctassert(__is_ct_const(size)); ctassert(size <= 67); if (__is_in_lmem(p)) { #undef _REG_OP #define _REG_OP(_x) _npe_hash_jenkins_8_op(hash, BYTES_0_3, \ ((__lmem uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_jenkins_8_op(hash, _b, \ ((__lmem uint32_t *)p)[_x]) } else { #undef _REG_OP #define _REG_OP(_x) _npe_hash_jenkins_8_op(hash, BYTES_0_3, \ ((__gpr uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_jenkins_8_op(hash, _b, \ ((__gpr uint32_t *)p)[_x]) } _MULTI_REG_OP( _REG_OP, _REG_OP_LAST, size ); #else /* GCC */ uint32_t *curr_byte = (uint32_t *)p; uint32_t hash = 0; int bytes_left = size; while(1) { uint32_t val = *curr_byte++; if ( bytes_left >= 4) { _npe_hash_jenkins_8_op(hash, BYTES_0_3, val); bytes_left -= 4; } else { switch ( bytes_left ) { case 1: _npe_hash_jenkins_8_op(hash, BYTE_0, val); bytes_left -= 1; break; case 2: _npe_hash_jenkins_8_op(hash, BYTES_0_1, val); bytes_left -= 2; break; case 3: _npe_hash_jenkins_8_op(hash, BYTES_0_2, val); bytes_left -= 3; break; default: break; } } if ( bytes_left == 0 ) break; } #endif hash += hash << 3; hash ^= hash >> 11; hash += hash << 15; return hash; } uint32_t npe_hash_jenkins_8_rem(npe_mem_ptr_t p, size_t size) { #ifdef __NFP_TOOL_NFCC __xread uint32_t xfr[8]; int bytes_left = size; uint64_t curr_byte = (uint64_t)p; __gpr uint32_t hash = 0; while(1) { if ( bytes_left >= 32) { mem_read64( &xfr[0], (__mem void *)curr_byte, 32); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[1]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[2]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[3]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[4]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[5]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[6]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[7]); bytes_left -= 32; curr_byte += 32; } else if ( bytes_left >= 24) { mem_read64( &xfr[0], (__mem void *)curr_byte, 24); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[1]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[2]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[3]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[4]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[5]); bytes_left -= 24; curr_byte += 24; } else if ( bytes_left >= 16) { mem_read64( &xfr[0], (__mem void *)curr_byte, 16); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[1]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[2]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[3]); bytes_left -= 16; curr_byte += 16; } else if ( bytes_left >= 8) { mem_read64( &xfr[0], (__mem void *)curr_byte, 8); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[1]); bytes_left -= 8; curr_byte += 8; } else if ( bytes_left >= 4) { mem_read32( &xfr[0], (__mem void *)curr_byte, 4); _npe_hash_jenkins_8_op(hash, BYTES_0_3, xfr[0]); bytes_left -= 4; curr_byte += 4; } else { mem_read8( &xfr[0], (__mem void *)curr_byte, bytes_left); switch ( bytes_left ) { case 1: _npe_hash_jenkins_8_op(hash, BYTE_0, xfr[0]); bytes_left -= 1; break; case 2: _npe_hash_jenkins_8_op(hash, BYTES_0_1, xfr[0]); bytes_left -= 2; break; case 3: _npe_hash_jenkins_8_op(hash, BYTES_0_2, xfr[0]); bytes_left -= 3; break; default: break; } } if ( bytes_left == 0 ) break; } hash += hash << 3; hash ^= hash >> 11; hash += hash << 15; return ( hash ); #else return npe_hash_jenkins_8(p, size); #endif } #define _npe_hash_jenkins_32_op(hash, b, d) \ { \ hash += d; \ hash += hash << 10; \ hash ^= hash >> 6; \ } __NPE_INTRINSIC uint32_t npe_hash_jenkins_32(void *p, size_t size) { #ifdef __NFP_TOOL_NFCC __gpr uint32_t hash = 0; /* N.B. In order to support both lmem and reg data, need to have constant values for size due to various compiler nuances. Also limiting max data size for similar reason. */ ctassert(__is_ct_const(size)); ctassert(size <= 67); ctassert(!(size & 3)); if (__is_in_lmem(p)) { #undef _REG_OP #define _REG_OP(_x) _npe_hash_jenkins_32_op(hash, BYTES_0_3, \ ((__lmem uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_jenkins_32_op(hash, _b, \ ((__lmem uint32_t *)p)[_x]) } else { #undef _REG_OP #define _REG_OP(_x) _npe_hash_jenkins_32_op(hash, BYTES_0_3, \ ((__gpr uint32_t *)p)[_x]) #undef _REG_OP_LAST #define _REG_OP_LAST(_x,_b) _npe_hash_jenkins_32_op(hash, _b, \ ((__gpr uint32_t *)p)[_x]) } _MULTI_REG_OP( _REG_OP, _REG_OP_LAST, size ); #else /* GCC */ uint32_t *curr_byte = (uint32_t *)p; uint32_t hash = 0; int bytes_left = size & ~3; while(1) { uint32_t val = *curr_byte++; _npe_hash_jenkins_32_op(hash, BYTES_0_3, val); bytes_left -= 4; if ( bytes_left == 0 ) break; } #endif hash += hash << 3; hash ^= hash >> 11; hash += hash << 15; return hash; } uint32_t npe_hash_jenkins_32_rem(npe_mem_ptr_t p, size_t size) { #ifdef __NFP_TOOL_NFCC __xread uint32_t xfr[8]; int bytes_left = size & ~3; uint64_t curr_byte = (uint64_t)p; __gpr uint32_t hash = 0; while(1) { if ( bytes_left >= 32) { mem_read64( &xfr[0], (__mem void *)curr_byte, 32); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[1]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[2]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[3]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[4]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[5]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[6]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[7]); bytes_left -= 32; curr_byte += 32; } else if ( bytes_left >= 24) { mem_read64( &xfr[0], (__mem void *)curr_byte, 24); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[1]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[2]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[3]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[4]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[5]); bytes_left -= 24; curr_byte += 24; } else if ( bytes_left >= 16) { mem_read64( &xfr[0], (__mem void *)curr_byte, 16); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[1]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[2]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[3]); bytes_left -= 16; curr_byte += 16; } else if ( bytes_left >= 8) { mem_read64( &xfr[0], (__mem void *)curr_byte, 8); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[0]); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[1]); bytes_left -= 8; curr_byte += 8; } else { mem_read32( &xfr[0], (__mem void *)curr_byte, 4); _npe_hash_jenkins_32_op(hash, BYTES_0_3, xfr[0]); bytes_left -= 4; curr_byte += 4; } if ( bytes_left == 0 ) break; } hash += hash << 3; hash ^= hash >> 11; hash += hash << 15; return ( hash ); #else return npe_hash_jenkins_32(p, size); #endif }
37.74026
96
0.483645
14c862c3af64726f8a9b6b4f3e1fcc8ffd2afa46
211
h
C
OLED_SH1106/ssd1306/ssd1306_tests.h
rainlotus/STM32F103_SH1106
30a92ef2e217408d3948960a51e05840d47d08e1
[ "Apache-2.0" ]
null
null
null
OLED_SH1106/ssd1306/ssd1306_tests.h
rainlotus/STM32F103_SH1106
30a92ef2e217408d3948960a51e05840d47d08e1
[ "Apache-2.0" ]
null
null
null
OLED_SH1106/ssd1306/ssd1306_tests.h
rainlotus/STM32F103_SH1106
30a92ef2e217408d3948960a51e05840d47d08e1
[ "Apache-2.0" ]
null
null
null
#ifndef __SSD1306_TEST_H__ #define __SSD1306_TEST_H__ void ssd1306_TestBorder(void); void ssd1306_TestFonts(void); void ssd1306_TestFPS(void); void ssd1306_TestAll(void); #endif // __SSD1306_TEST_H__
21.1
31
0.796209
adede851645b435363cad8d3391a0c670cd153b7
4,089
h
C
cc3200-sdk/ti_rtos/ti_rtos_config/ewarm/iar/tirtos/ti/sysbios/heaps/package/internal/HeapTrack.xdc.h
rchtsang/cc3200-sdk-linux-gcc
92d11e088a19cdea9374ef0ead2c3dd55995dcff
[ "MIT" ]
2
2017-04-27T09:24:42.000Z
2020-04-01T17:52:28.000Z
cc3200-sdk/ti_rtos/ti_rtos_config/ewarm/iar/tirtos/ti/sysbios/heaps/package/internal/HeapTrack.xdc.h
rchtsang/cc3200-sdk-linux-gcc
92d11e088a19cdea9374ef0ead2c3dd55995dcff
[ "MIT" ]
null
null
null
cc3200-sdk/ti_rtos/ti_rtos_config/ewarm/iar/tirtos/ti/sysbios/heaps/package/internal/HeapTrack.xdc.h
rchtsang/cc3200-sdk-linux-gcc
92d11e088a19cdea9374ef0ead2c3dd55995dcff
[ "MIT" ]
3
2018-01-30T16:38:52.000Z
2022-03-30T00:56:46.000Z
/* * Do not modify this file; it is automatically * generated and any modifications will be overwritten. * * @(#) xdc-B06 */ #ifndef ti_sysbios_heaps_HeapTrack__INTERNAL__ #define ti_sysbios_heaps_HeapTrack__INTERNAL__ #ifndef ti_sysbios_heaps_HeapTrack__internalaccess #define ti_sysbios_heaps_HeapTrack__internalaccess #endif #include <ti/sysbios/heaps/HeapTrack.h> #undef xdc_FILE__ #ifndef xdc_FILE #define xdc_FILE__ NULL #else #define xdc_FILE__ xdc_FILE #endif /* alloc */ #undef ti_sysbios_heaps_HeapTrack_alloc #define ti_sysbios_heaps_HeapTrack_alloc ti_sysbios_heaps_HeapTrack_alloc__E /* free */ #undef ti_sysbios_heaps_HeapTrack_free #define ti_sysbios_heaps_HeapTrack_free ti_sysbios_heaps_HeapTrack_free__E /* isBlocking */ #undef ti_sysbios_heaps_HeapTrack_isBlocking #define ti_sysbios_heaps_HeapTrack_isBlocking ti_sysbios_heaps_HeapTrack_isBlocking__E /* getStats */ #undef ti_sysbios_heaps_HeapTrack_getStats #define ti_sysbios_heaps_HeapTrack_getStats ti_sysbios_heaps_HeapTrack_getStats__E /* printTask */ #undef ti_sysbios_heaps_HeapTrack_printTask #define ti_sysbios_heaps_HeapTrack_printTask ti_sysbios_heaps_HeapTrack_printTask__E /* printHeap */ #undef ti_sysbios_heaps_HeapTrack_printHeap #define ti_sysbios_heaps_HeapTrack_printHeap ti_sysbios_heaps_HeapTrack_printHeap__E /* printTrack */ #define HeapTrack_printTrack ti_sysbios_heaps_HeapTrack_printTrack__I /* Module_startup */ #undef ti_sysbios_heaps_HeapTrack_Module_startup #define ti_sysbios_heaps_HeapTrack_Module_startup ti_sysbios_heaps_HeapTrack_Module_startup__E /* Instance_init */ #undef ti_sysbios_heaps_HeapTrack_Instance_init #define ti_sysbios_heaps_HeapTrack_Instance_init ti_sysbios_heaps_HeapTrack_Instance_init__E /* Instance_finalize */ #undef ti_sysbios_heaps_HeapTrack_Instance_finalize #define ti_sysbios_heaps_HeapTrack_Instance_finalize ti_sysbios_heaps_HeapTrack_Instance_finalize__E /* per-module runtime symbols */ #undef Module__MID #define Module__MID ti_sysbios_heaps_HeapTrack_Module__id__C #undef Module__DGSINCL #define Module__DGSINCL ti_sysbios_heaps_HeapTrack_Module__diagsIncluded__C #undef Module__DGSENAB #define Module__DGSENAB ti_sysbios_heaps_HeapTrack_Module__diagsEnabled__C #undef Module__DGSMASK #define Module__DGSMASK ti_sysbios_heaps_HeapTrack_Module__diagsMask__C #undef Module__LOGDEF #define Module__LOGDEF ti_sysbios_heaps_HeapTrack_Module__loggerDefined__C #undef Module__LOGOBJ #define Module__LOGOBJ ti_sysbios_heaps_HeapTrack_Module__loggerObj__C #undef Module__LOGFXN0 #define Module__LOGFXN0 ti_sysbios_heaps_HeapTrack_Module__loggerFxn0__C #undef Module__LOGFXN1 #define Module__LOGFXN1 ti_sysbios_heaps_HeapTrack_Module__loggerFxn1__C #undef Module__LOGFXN2 #define Module__LOGFXN2 ti_sysbios_heaps_HeapTrack_Module__loggerFxn2__C #undef Module__LOGFXN4 #define Module__LOGFXN4 ti_sysbios_heaps_HeapTrack_Module__loggerFxn4__C #undef Module__LOGFXN8 #define Module__LOGFXN8 ti_sysbios_heaps_HeapTrack_Module__loggerFxn8__C #undef Module__G_OBJ #define Module__G_OBJ ti_sysbios_heaps_HeapTrack_Module__gateObj__C #undef Module__G_PRMS #define Module__G_PRMS ti_sysbios_heaps_HeapTrack_Module__gatePrms__C #undef Module__GP_create #define Module__GP_create ti_sysbios_heaps_HeapTrack_Module_GateProxy_create #undef Module__GP_delete #define Module__GP_delete ti_sysbios_heaps_HeapTrack_Module_GateProxy_delete #undef Module__GP_enter #define Module__GP_enter ti_sysbios_heaps_HeapTrack_Module_GateProxy_enter #undef Module__GP_leave #define Module__GP_leave ti_sysbios_heaps_HeapTrack_Module_GateProxy_leave #undef Module__GP_query #define Module__GP_query ti_sysbios_heaps_HeapTrack_Module_GateProxy_query /* Object__sizingError */ #line 1 "Error_inconsistent_object_size_in_ti.sysbios.heaps.HeapTrack" typedef char ti_sysbios_heaps_HeapTrack_Object__sizingError[sizeof(ti_sysbios_heaps_HeapTrack_Object) > sizeof(ti_sysbios_heaps_HeapTrack_Struct) ? -1 : 1]; #endif /* ti_sysbios_heaps_HeapTrack__INTERNAL____ */
38.214953
157
0.870629
096dd3a077e5e719288d4351df480f24fbefd0f8
2,741
c
C
fast/vote_relation_luts_prepare.c
piercelab/tcr_docking_angle
bd35461bbc3ef58a4387a3e7f896867f5cd315cd
[ "CC-BY-4.0" ]
null
null
null
fast/vote_relation_luts_prepare.c
piercelab/tcr_docking_angle
bd35461bbc3ef58a4387a3e7f896867f5cd315cd
[ "CC-BY-4.0" ]
null
null
null
fast/vote_relation_luts_prepare.c
piercelab/tcr_docking_angle
bd35461bbc3ef58a4387a3e7f896867f5cd315cd
[ "CC-BY-4.0" ]
null
null
null
/****************************************************************************** This file is part of the FAST protein structure alignment package, developed by Jianhua Zhu at the Bioinformatics Program of Boston University. ******************************************************************************/ #include <stdio.h> #include "vote.h" /*----------------------------------------------------------------------------- LUT tables to calculate -----------------------------------------------------------------------------*/ void vote_relation_luts_prepare(FILE *fout) { int k,b; uint16_t bit; uint16_t bits[VC_RR_DISTANCE_MAX+128]; uint16_t masks[VC_RR_DISTANCE_MAX+128]; uint16_t angle_bits[1025]; uint16_t angle_masks[1025]; uint16_t angle_masks2[1025]; /* Distance LUT and MASK */ bit=1; b=128; for(k=0;k<VC_RR_DISTANCE_MAX+128;k++) { if(k>=b) { bit<<=1; if(bit==0)break; b=(int)(b*1.20)+256; } bits[k]=bit; masks[k]=bit|(bit<<1)|(bit>>1); } fprintf(fout,"#include \"vote.h\"\n\n"); fprintf(fout,"uint16_t\tvote_distance_bit_lut[]=\n{"); for(k=0;k<VC_RR_DISTANCE_MAX+128;k++) { if(k&3)continue; if((k&31)==0)fprintf(fout,"\n"); fprintf(fout,"\t%u,",(unsigned int)bits[k]); } fprintf(fout,"\n};\n\n"); fprintf(fout,"uint16_t\tvote_distance_mask_lut[]=\n{"); for(k=0;k<VC_RR_DISTANCE_MAX+128;k++) { if(k&3)continue; if((k&31)==0)fprintf(fout,"\n"); fprintf(fout,"\t%u,",(unsigned int)masks[k]); } fprintf(fout,"\n};\n\n"); /* Angle LUTS */ b=64; bit=1; for(k=0;k<1025;k++) { if(k>=b) { bit<<=1; if(bit==0)break; b+=64; } angle_bits[k]=bit; angle_masks[k]=bit|(bit<<1)|(bit<<2)|(bit<<3)|(bit<<4) |(bit>>1)|(bit>>2)|(bit>>3)|(bit>>4); angle_masks2[k]=bit|(bit<<1)|(bit<<2)|(bit<<3)|(bit<<4) |(bit<<5)|(bit<<6)|(bit>>1)|(bit>>2)|(bit>>3)|(bit>>4) |(bit>>5)|(bit>>6); } angle_bits[1024]=angle_bits[1023]; angle_masks[1024]=angle_masks[1023]; angle_masks2[1024]=angle_masks2[1023]; fprintf(fout,"uint16_t\tvote_angle_bit_lut[]=\n{"); for(k=0;k<1025;k++) { if((k&7)==0)fprintf(fout,"\n"); fprintf(fout,"\t%u,",(unsigned int)angle_bits[k]); } fprintf(fout,"\n};\n\n"); fprintf(fout,"uint16_t\tvote_angle_mask_lut[]=\n{"); for(k=0;k<1025;k++) { if((k&7)==0)fprintf(fout,"\n"); fprintf(fout,"\t%u,",(unsigned int)angle_masks[k]); } fprintf(fout,"\n};\n\n"); fprintf(fout,"uint16_t\tvote_angle_mask_lut2[]=\n{"); for(k=0;k<1025;k++) { if((k&7)==0)fprintf(fout,"\n"); fprintf(fout,"\t%u,",(unsigned int)angle_masks2[k]); } fprintf(fout,"\n};\n\n"); } int main(int argc,char **argv) { FILE *fout; fout=fopen(argv[1],"w"); if(!fout)exit(1); vote_relation_luts_prepare(fout); fclose(fout); return 0; }
22.467213
79
0.546516
8631a535d3a3f1d25f1841c97eb27cbb64be599a
2,220
c
C
graph_tad/main.c
felipecustodio/graph
56c99e02309b3f5142313b141d9d99cc0e3262bf
[ "MIT" ]
null
null
null
graph_tad/main.c
felipecustodio/graph
56c99e02309b3f5142313b141d9d99cc0e3262bf
[ "MIT" ]
null
null
null
graph_tad/main.c
felipecustodio/graph
56c99e02309b3f5142313b141d9d99cc0e3262bf
[ "MIT" ]
null
null
null
/***********************************************/ /* SCC0216 - Modelagem Computacional em Grafos */ /* Felipe Scrochio Custódio - 9442688 */ /***********************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "graph.h" int instruction(char* input, char* command) { if (strcmp(input, command) == 0) { return 1; } return 0; } int main(int argc, char const *argv[]) { char* command = (char*)malloc(sizeof(char) * 3); char directed, representation; int x, y, w; // vertices x,y, weight w int i, j; Graph* g = NULL; init_graph(&g); // create graph with given parameters scanf("%c %c %d %d", &directed, &representation, &x, &y); // initialize adjacency matrix g->representation = representation; if (g->representation == 'M') { initMatrix(&g, x); } // set graph type (directed or undirected) switch (directed) { case 'D': g->directed = 1; break; case 'G': break; } int start, end, weight; // read edges (start, end, weight) for (i = 0; i < y; i++) { scanf("%d %d %d", &start, &end, &weight); getchar(); addVERTEX(&g, start); addVERTEX(&g, end); add_edge(&g, start, end, weight); } sortEdges(&g); while (scanf("%s ", command) != EOF) { if (instruction(command, "IG")) { print_graph(g); } else if (instruction(command, "VA")) { // print adjacency list of x scanf("%d", &x); printAdjacents(g, x); } else if (instruction(command, "AA")) { // add edge between x y with weight w scanf("%d %d %d", &x, &y, &w); add_edge(&g, x, y, w); sortEdges(&g); } else if (instruction(command, "RA")) { scanf("%d %d", &x, &y); remove_edge(&g, x, y); } else if (instruction(command, "IT")) { if (g->directed) { transpose(&g); print_graph(g); } } else if (instruction(command, "MP")) { findSmallestEdge(g); } } return 0; }
26.746988
61
0.474324
79ba5db56c957e387a92ac0efdc43d028b879ea3
118
h
C
Content Sources/iTunes/Data Model/mogenerator/SMKiTunesArtist.h
indragiek/SNRMusicK
2eb02ff6281bc623f7147c14b69344135cbadeff
[ "MIT" ]
39
2015-01-30T01:05:58.000Z
2021-02-08T02:38:26.000Z
Content Sources/iTunes/Data Model/mogenerator/SMKiTunesArtist.h
krishaamer/SNRMusicKit
d1197aa3fa7b71d6edda27f9b80acbe7a1582114
[ "MIT" ]
null
null
null
Content Sources/iTunes/Data Model/mogenerator/SMKiTunesArtist.h
krishaamer/SNRMusicKit
d1197aa3fa7b71d6edda27f9b80acbe7a1582114
[ "MIT" ]
5
2015-01-16T02:38:20.000Z
2021-02-08T02:38:27.000Z
#import "_SMKiTunesArtist.h" #import "SMKArtist.h" @interface SMKiTunesArtist : _SMKiTunesArtist <SMKArtist> {} @end
19.666667
60
0.771186
06fff61d56e18d994004891f61110f7da14df415
4,656
h
C
include/scl/stream/operators/uniqueBy.h
Voltra/StandardClassLibrary
46f7164049f6d4ed8ba932fc8c1c463fa9dce31a
[ "MIT" ]
null
null
null
include/scl/stream/operators/uniqueBy.h
Voltra/StandardClassLibrary
46f7164049f6d4ed8ba932fc8c1c463fa9dce31a
[ "MIT" ]
9
2020-04-07T17:25:43.000Z
2022-01-16T18:19:06.000Z
include/scl/stream/operators/uniqueBy.h
Voltra/StandardClassLibrary
46f7164049f6d4ed8ba932fc8c1c463fa9dce31a
[ "MIT" ]
null
null
null
#pragma once #include <scl/stream/details/deprecation.h> #include <scl/stream/details/iterator/OpStreamIterator.h> #include <functional> #include <memory> #include <scl/tools/make/make.hpp> #include <scl/tools/meta/meta.hpp> #include <unordered_set> #include <scl/stream/Stream.h> namespace scl{ namespace stream{ namespace operators{ namespace details{ /** * Unique by operation * @tparam T being the value type * @tparam U being the type to use as key */ template <class T, class U> class UniqueByOperator : public scl::stream::details::iterator::OpStreamIterator<T>{ public: using iterator_type = scl::stream::details::iterator::OpStreamIterator<T>; using value_type = typename iterator_type::value_type; using payload_type = typename iterator_type::payload_type; using parent_iterator_type = typename iterator_type::parent_iterator_type; using parent_value_type = typename parent_iterator_type::value_type; using parent_payload_type = typename parent_iterator_type::payload_type; using parent_type = typename iterator_type::parent_type; /** * @typedef key_type * The type of keys (unique by key) */ using key_type = U; /** * @typedef mapper_type * The function type that computes a key from a value */ using mapper_type = std::function<key_type(const value_type&)>; /** * Construct an operator from its parent iterator and the mapper function * @param p being the parent iterator * @param key being the key computation function */ UniqueByOperator(parent_type p, mapper_type key) : iterator_type{std::move(p)}, key{key} { } payload_type next() override{ bool condition = true; while(condition && this->parent()->hasNext()){ const auto& alt = this->parent()->next().value(); if(!alt.hasValue()) continue; const auto& value = *alt; auto id = this->key(value); condition = !this->tagged.count(id); //count(id) == 0 => not found //!count(id) => true if doesn't has value if(condition){ this->tagged.insert(id); return payload_type::withValue(value); } } return payload_type::withoutValue(); } protected: /** * @var key * the function that computes a key from a value */ mapper_type key; /** * @var tagged * the state that keeps track of all encountered keys */ std::unordered_set<key_type> tagged; }; /** * Toolbox tag type for unique by operations * @tparam T being the value type * @tparam U being the key type */ template <class T, class U> struct uniqueBy_toolbox{ /** * @typedef map_t * The key computation function type */ using map_t = typename UniqueByOperator<T, U>::mapper_type; /** * @var mapper * the key computation function */ map_t mapper; }; } /** * Remove duplicates from a stream * @tparam F being the callable type (deduce) * @tparam Fn being the function wrapper type (computed) * @tparam T being the value type (computed) * @tparam U being the key type (computed) * @param mapper being the key computation function * @return a toolbox tag for pipe operator */ template < class F, class Fn = decltype(META::as_fn(std::declval<F>())), class T = META::decay_t<META::arg_t<Fn, 0>>, class U = META::decay_t<META::return_t<Fn>> > details::uniqueBy_toolbox<T, U> uniqueBy(F&& mapper){ return {META::as_fn(mapper)}; } /** * Remove duplicates from a stream by explicitly providing the type arguments * @tparam T being the value type * @tparam U being the key type * @param mapper being the key computation function * @return a toolbox tag for pipe operator */ template <class T, class U> details::uniqueBy_toolbox<T, U> uniqueBy_(typename details::uniqueBy_toolbox<T, U>::map_t mapper){ return {mapper}; } /** * Pipe operator overload for uniqueBy (and unique) operations * @tparam T being the value type * @tparam U being the key type * @param lhs being the stream to remove duplicates from * @param rhs being the unique toolbox tag */ template <class T, class U> Stream<T> operator|(const Stream<T>& lhs, details::uniqueBy_toolbox<T, U> rhs){ using namespace scl::tools; return Stream<T>{ make::ptr<details::UniqueByOperator<T, U>>(lhs.it(), rhs.mapper) }; } } } }
29.846154
101
0.632947
ede0d9c4997450adbf6e82d5945caee30faeffec
1,063
h
C
TAO/TAO_IDL/be_include/be_visitor_exception.h
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
[ "DOC" ]
36
2015-01-10T07:27:33.000Z
2022-03-07T03:32:08.000Z
TAO/TAO_IDL/be_include/be_visitor_exception.h
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
[ "DOC" ]
2
2018-08-13T07:30:51.000Z
2019-02-25T03:04:31.000Z
TAO/TAO_IDL/be_include/be_visitor_exception.h
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
[ "DOC" ]
38
2015-01-08T14:12:06.000Z
2022-01-19T08:33:00.000Z
/* -*- c++ -*- */ //============================================================================= /** * @file be_visitor_exception.h * * $Id: be_visitor_exception.h 88828 2010-02-04 09:09:22Z johnnyw $ * * Concrete visitor for the Exception class * * * @author Aniruddha Gokhale */ //============================================================================= #ifndef TAO_BE_VISITOR_EXCEPTION_H #define TAO_BE_VISITOR_EXCEPTION_H #include "be_visitor_scope.h" #include "be_visitor_enum.h" #include "be_visitor_structure.h" #include "be_visitor_union.h" #include "be_visitor_exception/exception.h" #include "be_visitor_exception/exception_ch.h" #include "be_visitor_exception/exception_ci.h" #include "be_visitor_exception/exception_cs.h" #include "be_visitor_exception/ctor.h" #include "be_visitor_exception/ctor_assign.h" #include "be_visitor_exception/any_op_ch.h" #include "be_visitor_exception/any_op_cs.h" #include "be_visitor_exception/cdr_op_ch.h" #include "be_visitor_exception/cdr_op_cs.h" #endif /* TAO_BE_VISITOR_EXCEPTION_H */
28.72973
79
0.661336
256d77d147e49416431f7bdffd5ba14a416913d2
1,001
h
C
elements/PlotTime/plot_time_editor.h
BrnSlr/CuteBoard
00beb783e234c9a08f9a53baa0fe10744452f755
[ "Apache-2.0" ]
47
2019-10-23T17:55:13.000Z
2022-03-22T07:49:04.000Z
elements/PlotTime/plot_time_editor.h
BrnSlr/CuteBoard
00beb783e234c9a08f9a53baa0fe10744452f755
[ "Apache-2.0" ]
1
2021-12-20T18:48:26.000Z
2021-12-20T18:48:26.000Z
elements/PlotTime/plot_time_editor.h
BrnSlr/CuteBoard
00beb783e234c9a08f9a53baa0fe10744452f755
[ "Apache-2.0" ]
18
2020-01-31T06:45:06.000Z
2022-03-29T16:56:31.000Z
#ifndef PLOTTIMEEDITOR_H #define PLOTTIMEEDITOR_H #include <QDialog> #include "plot_time.h" #include "ui/widgets/properties_widget.h" #include "plot_time_shared.h" namespace Ui { class PLOT_TIME_EXPORT PlotTimeEditor; } class PLOT_TIME_EXPORT PlotTimeEditor : public QDialog { Q_OBJECT LOG4QT_DECLARE_QCLASS_LOGGER public: explicit PlotTimeEditor(PlotTime *display, QWidget *parent = nullptr); ~PlotTimeEditor() Q_DECL_OVERRIDE; void accept() Q_DECL_OVERRIDE; private slots: void updateElement(); void updateTabs(); void newParameter(); void removeParameter(); void replaceParameter(); void on_listWidget_currentRowChanged(int currentRow); void on_rangeComboBox_currentIndexChanged(int index); private: Ui::PlotTimeEditor *ui; PlotTime *mDisplay; QList<PropertiesWidget *> mPropertiesWidgets; QToolButton *mNewParamButton; QToolButton *mRemoveParamButton; QToolButton *mReplaceParamButton; }; #endif // PLOTTIMEEDITOR_H
22.75
74
0.759241
b01ae1f0465aa502f8dcdc33f1fc308db0266f3f
1,411
c
C
REXCompiler/omptests/rex-simd/simd_dev/gather/rose_gather_avx2.c
passlab/rexomptest
558e084877c70b1d883dccecfd8058986350155c
[ "BSD-2-Clause" ]
null
null
null
REXCompiler/omptests/rex-simd/simd_dev/gather/rose_gather_avx2.c
passlab/rexomptest
558e084877c70b1d883dccecfd8058986350155c
[ "BSD-2-Clause" ]
null
null
null
REXCompiler/omptests/rex-simd/simd_dev/gather/rose_gather_avx2.c
passlab/rexomptest
558e084877c70b1d883dccecfd8058986350155c
[ "BSD-2-Clause" ]
null
null
null
#include "rex_kmp.h" // create a list of 64 numbers, and only sum the even ones #include <stdio.h> #include <stdlib.h> #include <immintrin.h> #define N 32000 int main(argc,argv) int argc; char **argv; { int i; int status = 0; srand((time((void *)0))); float *numbers = (malloc(sizeof(float ) * 32000)); int *mask = (malloc(sizeof(int ) * 32000)); // Init the numbers for (int i = 0; i < 32000; i++) numbers[i] = (rand() % 10); for (int i = 0; i < 32000; i++) mask[i] = rand() % 32000; /*for (int i = 0; i<8; i++) printf("%.1f ", numbers[i]); puts("\n---"); for (int i = 0; i<8; i++) printf("%d ", mask[i]); puts("\n---");*/ //Serial float result1 = 0; for (int i = 0; i < 32000; i++) { result1 += numbers[mask[i]]; } float result2 = 0; __m256 __vec0 = _mm256_set1_ps(result2); __m256 __part3 = _mm256_setzero_ps(); for (i = 0; i <= 31999; i += 8) { __m256i __mask0 = _mm256_loadu_si256((__m256i *)(&mask[i])); __m256 __vec1 = _mm256_i32gather_ps(numbers,__mask0,4); __m256 __vec2 = _mm256_add_ps(__vec1,__vec0); __part3 = _mm256_add_ps(__part3,__vec2); } __m256 __buf1 = __part3; __buf1 = _mm256_hadd_ps(__buf1,__buf1); __buf1 = _mm256_hadd_ps(__buf1,__buf1); float __buf2[8]; _mm256_storeu_ps(&__buf2,__buf1); result2 = __buf2[0] + __buf2[6]; // print printf("Result1: %f | Result2: %f\n",result1,result2); return 0; }
28.22
64
0.609497
e5d1ffdf3e8cd51e1f26f91afee32ac38f9a7cc9
683
h
C
VideoSDK/Framwork/MLMediaEditingModel/MLMediaEditingModel.framework/Headers/MLTransitionEffect.h
cosmos33/MMVideoSDK--iOS
8bf5d5aa0190cebf17e6da4fce8f90e26add2148
[ "MIT" ]
1
2019-03-26T12:02:45.000Z
2019-03-26T12:02:45.000Z
VideoSDK/Framwork/MLMediaEditingModel/MLMediaEditingModel.framework/Headers/MLTransitionEffect.h
cosmos33/MMVideoSDK--iOS
8bf5d5aa0190cebf17e6da4fce8f90e26add2148
[ "MIT" ]
null
null
null
VideoSDK/Framwork/MLMediaEditingModel/MLMediaEditingModel.framework/Headers/MLTransitionEffect.h
cosmos33/MMVideoSDK--iOS
8bf5d5aa0190cebf17e6da4fce8f90e26add2148
[ "MIT" ]
3
2019-03-25T10:12:31.000Z
2020-06-25T07:23:16.000Z
// // MLTransitionEffect.h // Pods // // Created by YuAo on 16/05/2017. // // @import Mantle; NS_ASSUME_NONNULL_BEGIN typedef NSString *MLTransitionEffectType NS_EXTENSIBLE_STRING_ENUM; FOUNDATION_EXPORT MLTransitionEffectType const MLTransitionEffectTypeNone; @interface MLTransitionEffect : MTLModel <MTLJSONSerializing> @property (nonatomic,readonly,copy) NSDictionary<NSString *, id> *parameters; @property (nonatomic,readonly,copy) MLTransitionEffectType type; - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithType:(MLTransitionEffectType)type parameters:(NSDictionary<NSString *, id> *)parameters NS_DESIGNATED_INITIALIZER; @end NS_ASSUME_NONNULL_END
22.766667
138
0.809663
b5d3ad84677fe6042c3c4f4c7935edf73be8d0e3
2,338
c
C
OpenLDAP/servers/slapd/back-ldap/modify.c
orynider/php-5.6.3x4VC9
47f9765b797279061c364e004153a0919895b23e
[ "BSD-2-Clause" ]
1
2021-02-24T13:01:00.000Z
2021-02-24T13:01:00.000Z
OpenLDAP/servers/slapd/back-ldap/modify.c
orynider/php-5.6.3x4VC9
47f9765b797279061c364e004153a0919895b23e
[ "BSD-2-Clause" ]
null
null
null
OpenLDAP/servers/slapd/back-ldap/modify.c
orynider/php-5.6.3x4VC9
47f9765b797279061c364e004153a0919895b23e
[ "BSD-2-Clause" ]
null
null
null
/* modify.c - ldap backend modify function */ /* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/modify.c,v 1.1.8.3 2001/01/17 06:04:25 kurt Exp $ */ /* * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* This is an altered version */ /* * Copyright 1999, Howard Chu, All rights reserved. <hyc@highlandsun.com> * * Permission is granted to anyone to use this software for any purpose * on any computer system, and to alter it and redistribute it, subject * to the following restrictions: * * 1. The author is not responsible for the consequences of use of this * software, no matter how awful, even if they arise from flaws in it. * * 2. The origin of this software must not be misrepresented, either by * explicit claim or by omission. Since few users ever read sources, * credits should appear in the documentation. * * 3. Altered versions must be plainly marked as such, and must not be * misrepresented as being the original software. Since few users * ever read sources, credits should appear in the documentation. * * 4. This notice may not be removed or altered. */ #include "portable.h" //#include <stdio.h> #include <ac/string.h> #include <ac/socket.h> #include "slap.h" #include "back-ldap.h" int ldap_back_modify( Backend *be, Connection *conn, Operation *op, const char *dn, const char *ndn, Modifications *modlist ) { struct ldapinfo *li = (struct ldapinfo *) be->be_private; struct ldapconn *lc; LDAPMod **modv; LDAPMod *mods; Modifications *ml; int i; lc = ldap_back_getconn(li, conn, op); if (!lc) return( -1 ); if (!lc->bound) { ldap_back_dobind(lc, op); if (!lc->bound) return( -1 ); } for (i=0, ml=modlist; ml; i++,ml=ml->sml_next) ; mods = (LDAPMod *)ch_malloc(i*sizeof(LDAPMod)); if (mods == NULL) return( -1 ); modv = (LDAPMod **)ch_malloc((i+1)*sizeof(LDAPMod *)); if (modv == NULL) { free(mods); return( -1 ); } modv[i] = 0; for (i=0, ml=modlist; ml; i++, ml=ml->sml_next) { modv[i] = &mods[i]; mods[i].mod_op = ml->sml_op; mods[i].mod_type = ml->sml_desc->ad_cname->bv_val; mods[i].mod_bvalues = ml->sml_bvalues; } ldap_modify_s( lc->ld, dn, modv ); free(mods); free(modv); return( ldap_back_op_result( lc, op )); }
25.413043
99
0.667665
d52669f1dfd98764a315dfa05de02ae02c7a1a49
1,665
h
C
src/external/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h
shreyasvj25/turicreate
32e84ca16aef8d04aff3d49ae9984bd49326bffd
[ "BSD-3-Clause" ]
2
2019-02-08T21:29:57.000Z
2021-07-27T06:59:19.000Z
src/external/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h
shreyasvj25/turicreate
32e84ca16aef8d04aff3d49ae9984bd49326bffd
[ "BSD-3-Clause" ]
3
2022-02-15T04:42:24.000Z
2022-03-12T01:05:15.000Z
src/external/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h
ZeroInfinite/turicreate
dd210c2563930881abd51fd69cb73007955b33fd
[ "BSD-3-Clause" ]
1
2019-01-12T01:07:34.000Z
2019-01-12T01:07:34.000Z
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/core/Core_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace FileSystem { #ifdef _WIN32 static const char PATH_DELIM = '\\'; #else static const char PATH_DELIM = '/'; #endif /** * Returns the directory path for the home dir env variable */ AWS_CORE_API Aws::String GetHomeDirectory(); /** * Creates directory if it doesn't exist. Returns true if the directory was created * or already exists. False for failure. */ AWS_CORE_API bool CreateDirectoryIfNotExists(const char* path); /** * Deletes file if it exists. Returns true if file doesn't exist or on success. */ AWS_CORE_API bool RemoveFileIfExists(const char* fileName); /** * Moves the file. Returns true on success */ AWS_CORE_API bool RelocateFileOrDirectory(const char* from, const char* to); /** * Computes a unique tmp file path */ AWS_CORE_API Aws::String CreateTempFilePath(); } // namespace FileSystem } // namespace Aws
28.220339
86
0.685886
cb3a893b4371cc7251911b333e76a75f53978648
3,411
c
C
language-world/data-structure/Basic_Point/String/Fixed_Length_Sequence_String.c
hylerrix/demos
169a3374d4bbb2e79eb9b9f5c839141388b46954
[ "MIT" ]
2
2020-07-24T05:00:39.000Z
2021-07-24T22:49:03.000Z
language-world/data-structure/Basic_Point/String/Fixed_Length_Sequence_String.c
hylerrix/demos
169a3374d4bbb2e79eb9b9f5c839141388b46954
[ "MIT" ]
14
2020-06-10T03:27:33.000Z
2020-11-23T03:55:57.000Z
language-world/data-structure/Basic_Point/String/Fixed_Length_Sequence_String.c
hylerrix/demos
169a3374d4bbb2e79eb9b9f5c839141388b46954
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #define MAXSIZE 50 typedef struct { char ch[MAXSIZE+1]; int len; }SString; // 串插入函数 int SStrInsert(SString *S, int pos, const SString T); // 串删除函数 int SStrDelete(SString *S, int pos, int len); // 串连接函数 int SStrCat(SString *S, const SString T); // 求子串函数 int SubSString(SString *T, SString S, int pos, int len); int main(void) { SString *S; SString *T; S = (SString *)malloc(sizeof(SString)); T = (SString *)malloc(sizeof(SString)); S->ch[1] = 'a'; S->ch[2] = 's'; S->ch[3] = 'd'; S->len = 3; T->ch[1] = 'q'; T->ch[2] = 'w'; T->ch[3] = 'e'; T->ch[4] = 'r'; T->len = 4; printf("T: "); for (int i = 1; i <= T->len; ++i) { printf("%c", T->ch[i]); } printf("\n"); printf("S: "); for (int i = 1; i <= S->len; ++i) { printf("%c", S->ch[i]); } printf("\n"); printf("SStrInsert(S, 1, T): %d\n", SStrInsert(S, 2, *T)); printf("S: "); for (int i = 1; i <= S->len; ++i) { printf("%c", S->ch[i]); } printf("\n"); printf("SStrDelete(S, 2, 1): %d\n", SStrDelete(S, 2, 1)); printf("S: "); for (int i = 1; i <= S->len; ++i) { printf("%c", S->ch[i]); } printf("\n"); printf("SStrCat(S, T): %d\n", SStrCat(S, *T)); printf("S: "); for (int i = 1; i <= S->len; ++i) { printf("%c", S->ch[i]); } printf("\n"); printf("SubSString(T, S, 2, 3): %d\n", SubSString(T, *S, 2, 3)); printf("S: "); for (int i = 1; i <= S->len; ++i) { printf("%c", S->ch[i]); } printf("\n"); printf("T: "); for (int i = 1; i <= T->len; ++i) { printf("%c", T->ch[i]); } printf("\n"); return 0; } int SStrInsert(SString *S, int pos, const SString T) { int i; if (NULL == S || NULL == S->ch || NULL == T.ch || pos < 1 || pos > S->len + 1) return 0; if (S->len+T.len <= MAXSIZE) { for (i = S->len+T.len; i >= pos+T.len; i--) S->ch[i] = S->ch[i-T.len]; for (i = pos; i < pos+T.len; i++) S->ch[i] = T.ch[i-pos+1]; S->len = S->len+T.len; } else if (pos+T.len <= MAXSIZE) { for (i = MAXSIZE; i > pos+T.len; i--) S->ch[i] = S->ch[i-T.len]; for (i = pos; i < pos+T.len; i++) S->ch[i] = T.ch[i-pos+1]; S->len = MAXSIZE; } else { for (i = pos; i <= MAXSIZE; i++) S->ch[i] = T.ch[i-pos+1]; S->len = MAXSIZE; } return 1; } int SStrDelete(SString *S, int pos, int len) { int i = 1; if (NULL == S || NULL == S->ch || len < 0 || pos < 1 || pos > S->len-len+1) return 0; for (i = pos; i <= S->len-len; i++) S->ch[i] = S->ch[i+len]; S->len = S->len-len; return 1; } int SStrCat(SString *S, const SString T) { int i = 1; if (NULL == S || NULL == S->ch || NULL == T.ch) return 0; if (S->len + T.len <= MAXSIZE) { for (i = S->len+1; i <= S->len+T.len; i++) S->ch[i] = T.ch[i-S->len]; S->len = S->len+T.len; return 1; } else if (S->len <= MAXSIZE) { for (i = S->len+1; i <= MAXSIZE; i++) S->ch[i] = T.ch[i-S->len]; S->len = MAXSIZE; return 0; } else { return 0; } } int SubSString(SString *T, SString S, int pos, int len) { int i; if (NULL == T || NULL == T->ch || NULL == S.ch || len < 0 || len > S.len -pos+1 || pos < 1 || pos > S.len) return 0; for (i = 1; i <= len; i++) T->ch[i] = S.ch[pos+i-1]; T->len = len; return 1; }
22.74
79
0.458223
27c392efd897876437404c4ef0a7fcacdd5c5d27
1,294
h
C
Src/SeminarDemo/Decorator/pattern-demo3.h
whuer-xiaojie/Design_Patterns_C-
467459e4f62ee5b0e4ce682c55a8f7f8ae986167
[ "MIT" ]
null
null
null
Src/SeminarDemo/Decorator/pattern-demo3.h
whuer-xiaojie/Design_Patterns_C-
467459e4f62ee5b0e4ce682c55a8f7f8ae986167
[ "MIT" ]
null
null
null
Src/SeminarDemo/Decorator/pattern-demo3.h
whuer-xiaojie/Design_Patterns_C-
467459e4f62ee5b0e4ce682c55a8f7f8ae986167
[ "MIT" ]
null
null
null
#pragma once #pragma once #pragma once #include <iostream> class CMobelPhone { public: virtual int getPrice(void) = 0; virtual ~CMobelPhone() {} protected: int m_price; }; class CHwPhone :public CMobelPhone { public: virtual int getPrice(void) = 0; virtual ~CHwPhone() {} }; class CMate20 :public CHwPhone { public: CMate20() { this->m_price = 5000; } virtual int getPrice(void) { return m_price; } virtual ~CMate20() {} }; class CMate20Pro :public CHwPhone { public: CMate20Pro() { this->m_price = 6000; } virtual int getPrice(void) { return m_price; } virtual ~CMate20Pro() {} }; class CDecorator :public CMobelPhone { protected: CMobelPhone *m_pPhone; public: virtual int getPrice(void) = 0; virtual ~CDecorator() {} }; class CWireless :public CDecorator { public: CWireless(CMobelPhone *pPhone) { this->m_pPhone = pPhone; this->m_price = m_pPhone->getPrice() + 500; } virtual int getPrice(void) { return m_price; } virtual ~CWireless() {} }; int main(int argc, char**argv) { CMobelPhone *pMate20 = new CMate20(); CDecorator *pPhone1 = new CWireless(pMate20); std::cout << pPhone1->getPrice() << std::endl; CMobelPhone *pMate20Pro = new CMate20Pro(); CDecorator *pPhone2 = new CWireless(pMate20Pro); std::cout << pPhone2->getPrice() << std::endl; }
19.907692
49
0.695518
27f32636de01be2c4748cc2fe4f1cb5be54d4c94
50
h
C
FreeBSD/contrib/blacklist/port/config.h
TigerBSD/FreeBSD-Custom-ThinkPad
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
4
2016-08-22T22:02:55.000Z
2017-03-04T22:56:44.000Z
FreeBSD/contrib/blacklist/port/config.h
TigerBSD/FreeBSD-Custom-ThinkPad
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
21
2016-08-11T09:43:43.000Z
2017-01-29T12:52:56.000Z
FreeBSD/contrib/blacklist/port/config.h
TigerBSD/TigerBSD
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
null
null
null
#if defined(__FreeBSD__) #include "port.h" #endif
12.5
24
0.74
fe734bb1bb417c51c70545ce4715acbf7a679627
6,352
c
C
pkgs/apps/vips/src/libsrc/freq_filt/im_freq_mask.c
relokin/parsec
75d63d9bd2368913343be9037e301947ecf78f7f
[ "BSD-3-Clause" ]
2
2017-04-24T22:37:28.000Z
2020-05-26T01:57:37.000Z
pkgs/apps/vips/src/libsrc/freq_filt/im_freq_mask.c
cota/parsec2-aarch64
cdf7da348afd231dbe067266f24dc14d22f5cebf
[ "BSD-3-Clause" ]
null
null
null
pkgs/apps/vips/src/libsrc/freq_filt/im_freq_mask.c
cota/parsec2-aarch64
cdf7da348afd231dbe067266f24dc14d22f5cebf
[ "BSD-3-Clause" ]
null
null
null
/* @(#) Filter functions * &(#) va_alist is a series of double variables * @(#) * @(#) Used to filter image in in the frequency domain, writes * @(#) the result in image out * @(#) * @(#) int im_flt_image_freq( in, out, flag, num_args, va_alist ) * @(#) IMAGE *in, *out; * @(#) enum mask_type flag; * @(#) int num_args; * @(#) * @(#) Returns 0 on success and -1 on error * @(#) * @(#) Creates a filter mask used for filtering in the frequency domain * @(#) The resultant mask is held by image * @(#) * @(#) int im_create_fmask(image, xsize, ysize, flag, num_args, va_alist) * @(#) IMAGE *image; * @(#) int xsize, ysize; * @(#) enum mask_type flag; * @(#) int num_args; * @(#) * @(#) Returns 0 on success and -1 on error * @(#) * @(#) Creates a filter mask used for filtering in the frequency domain * @(#) The resultant mask is held by image * @(#) Function im_freq_mask() differs from im_create_fmask() in the last * @(#) argument only: the latter accepts a va_dcl whereas the former * @(#) accepts a va_list pointer pointing to the read arguments of va_dcl * @(#) * @(#) int im_freq_mask(image, xs, ys, flag, num_args, ap) * @(#) IMAGE *image; * @(#) int xs, ys; * @(#) enum mask_type flag; * @(#) int num_args; * @(#) va_list ap; * @(#) * @(#) Returns 0 on success and -1 on error * @(#) * Copyright: N. Dessipris 1991, * Written on: Nov 1991 * Updated on: Dec 1991 * 20/9/95 JC * - modernised */ /* This file is part of VIPS. VIPS is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk */ #ifdef HAVE_CONFIG_H #include <config.h> #endif /*HAVE_CONFIG_H*/ #include <vips/intl.h> #include <stdio.h> #include <math.h> #include <stdarg.h> #include <vips/vips.h> #include <vips/fmask.h> #ifdef WITH_DMALLOC #include <dmalloc.h> #endif /*WITH_DMALLOC*/ /* Create the final mask by copying the 1/4 of the mask held by coeff * The final mask is written onto image on a line by line basis * The buffer coeff should hold (xsize/2+1)*(ysize/2+1) elms * The created mask is not rotated; so the center is at (0, 0) */ static int copy_quarter( IMAGE *out, float *coeff_s ) { float *line, *cpline; float *coeff, *cpcoeff; int x, y; int hxsplus1; if( !(line = IM_ARRAY( out, out->Xsize, float )) ) return( -1 ); hxsplus1 = out->Xsize/2 + 1; coeff = coeff_s; for( y = 0; y < out->Ysize/2; y++ ) { cpline = line; cpcoeff = coeff; coeff += hxsplus1; for( x = 0; x < out->Xsize/2; x++ ) *cpline++ = *cpcoeff++; for( x = out->Xsize/2; x < out->Xsize; x++ ) *cpline++ = *cpcoeff--; if( im_writeline( y, out, (PEL *) line ) ) return( -1 ); } for( y = out->Ysize/2; y < out->Ysize; y++ ) { cpline = line; cpcoeff = coeff; coeff -= hxsplus1; for( x = 0; x < out->Xsize/2; x++ ) *cpline++ = *cpcoeff++; for( x = out->Xsize/2; x < out->Xsize; x++ ) *cpline++ = *cpcoeff--; if( im_writeline( y, out, (PEL *) line ) ) return( -1 ); } return( 0 ); } /* Make a mask image. */ static int build_freq_mask( IMAGE *out, int xs, int ys, MaskType flag, va_list ap ) { float *coeff; extern float *im__create_quarter( IMAGE *, int, int, MaskType, va_list ); /* Check sizes and create one quarter of the final mask */ if( !im_ispoweroftwo( xs ) || !im_ispoweroftwo( ys ) ) { im_errormsg( "im_freq_mask: mask sizes power of 2 only" ); return( -1 ); } /* Create the output image. */ im_initdesc( out, xs, ys, 1, IM_BBITS_FLOAT, IM_BANDFMT_FLOAT, IM_CODING_NONE, IM_TYPE_B_W, 1.0, 1.0, 0, 0 ); if( im_setupout( out ) ) return( -1 ); switch( flag ) { case MASK_IDEAL_HIGHPASS: case MASK_IDEAL_LOWPASS: case MASK_BUTTERWORTH_HIGHPASS: case MASK_BUTTERWORTH_LOWPASS: case MASK_GAUSS_HIGHPASS: case MASK_GAUSS_LOWPASS: case MASK_IDEAL_RINGPASS: case MASK_IDEAL_RINGREJECT: case MASK_BUTTERWORTH_RINGPASS: case MASK_BUTTERWORTH_RINGREJECT: case MASK_GAUSS_RINGPASS: case MASK_GAUSS_RINGREJECT: case MASK_FRACTAL_FLT: /* All these are created as a quarter and duplicated. */ if( !(coeff = im__create_quarter( out, xs, ys, flag, ap )) || copy_quarter( out, coeff ) ) return( -1 ); break; case MASK_IDEAL_BANDPASS: case MASK_IDEAL_BANDREJECT: case MASK_BUTTERWORTH_BANDPASS: case MASK_BUTTERWORTH_BANDREJECT: case MASK_GAUSS_BANDPASS: case MASK_GAUSS_BANDREJECT: /* Created all in one go. */ if( im__fmaskcir( out, flag, ap ) ) return( -1 ); break; default: im_errormsg( "im_freq_mask: unimplemented mask type" ); return( -1 ); } return( 0 ); } /* Create a mask, and filter an image with it. */ int im_flt_image_freq( IMAGE *in, IMAGE *out, MaskType flag, ... ) { IMAGE *mask = im_open_local( out, "tempmask", "p" ); va_list ap; if( !mask ) return( -1 ); /* Generate mask. */ va_start( ap, flag ); if( build_freq_mask( mask, in->Xsize, in->Ysize, flag, ap ) ) return( -1 ); va_end( ap ); if( im_freqflt( in, mask, out ) ) return( -1 ); return( 0 ); } /* Create a filter mask. */ int im_create_fmask( IMAGE *out, int xsize, int ysize, MaskType flag, ... ) { va_list ap; va_start( ap, flag ); if( build_freq_mask( out, xsize, ysize, flag, ap ) ) return( -1 ); va_end( ap ); return( 0 ); }
26.689076
79
0.606895
4a776550422faed20158852779ee98875bb72ccf
680
h
C
firmware/MUSIA/EEPROM/spi_interface.h
zzattack/ninhid
49edbc37d7ba71d63141e0d6122499ddd1f494ba
[ "MIT" ]
17
2016-08-09T11:38:50.000Z
2022-03-01T09:45:01.000Z
firmware/MUSIA/EEPROM/spi_interface.h
zzattack/ninhid
49edbc37d7ba71d63141e0d6122499ddd1f494ba
[ "MIT" ]
11
2016-07-12T22:48:24.000Z
2021-06-22T16:55:56.000Z
firmware/MUSIA/EEPROM/spi_interface.h
zzattack/ninhid
49edbc37d7ba71d63141e0d6122499ddd1f494ba
[ "MIT" ]
6
2017-11-11T21:17:03.000Z
2021-12-20T20:33:30.000Z
#pragma once #include <cstdint> class spi_interface; typedef void(*select_handler)(spi_interface* spi); class spi_interface { private: select_handler _selectHandler = nullptr; public: virtual void setCS() = 0; virtual void clearCS() = 0; inline uint8_t next() { return writeSPI(0x00); } inline uint32_t next4() { uint32_t ret; writeSPI(nullptr, (uint8_t*)&ret, 4); return ret; } virtual uint8_t writeSPI(uint8_t c) = 0; virtual void writeSPI(const uint8_t* txBuff, uint8_t* rxBuff, uint16_t size) = 0; virtual void select() { if (_selectHandler != nullptr) _selectHandler(this); } virtual void setSelectHandler(select_handler handler) { _selectHandler = handler; } };
32.380952
92
0.744118
a437b8d471422146bd8634de0b7663d0c4b57c41
3,228
c
C
usr/src/tools/smatch/src/check_puts_argument.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/tools/smatch/src/check_puts_argument.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/tools/smatch/src/check_puts_argument.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
1
2020-12-30T00:04:16.000Z
2020-12-30T00:04:16.000Z
/* * Copyright (C) 2009 Dan Carpenter. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt */ /* * This script is for finding functions like hcd_buffer_free() which free * their arguments. After running it, add those functions to check_memory.c */ #include "smatch.h" #include "smatch_slist.h" static int my_id; STATE(putted); static struct symbol *this_func; static struct tracker_list *putted_args = NULL; static void match_function_def(struct symbol *sym) { this_func = sym; } static int parent_is_arg(struct symbol *sym) { struct symbol *arg; FOR_EACH_PTR(this_func->ctype.base_type->arguments, arg) { if (sym == arg) return 1; } END_FOR_EACH_PTR(arg); return 0; } static void match_put(const char *fn, struct expression *expr, void *info) { struct expression *tmp; struct symbol *sym; char *name; tmp = get_argument_from_call_expr(expr->args, 0); tmp = strip_expr(tmp); name = expr_to_var_sym(tmp, &sym); free_string(name); if (parent_is_arg(sym) && sym->ident) set_state(my_id, sym->ident->name, sym, &putted); } static int return_count = 0; static void match_return(struct expression *ret_value) { struct stree *stree; struct sm_state *tmp; struct tracker *tracker; if (__inline_fn) return; if (!return_count) { stree = __get_cur_stree(); FOR_EACH_MY_SM(my_id, stree, tmp) { if (tmp->state == &putted) add_tracker(&putted_args, my_id, tmp->name, tmp->sym); } END_FOR_EACH_SM(tmp); } else { FOR_EACH_PTR(putted_args, tracker) { tmp = get_sm_state(my_id, tracker->name, tracker->sym); if (tmp && tmp->state != &putted) del_tracker(&putted_args, my_id, tracker->name, tracker->sym); } END_FOR_EACH_PTR(tracker); } } static void print_arg(struct symbol *sym) { struct symbol *arg; int i = 0; FOR_EACH_PTR(this_func->ctype.base_type->arguments, arg) { if (sym == arg) { sm_info("puts_arg %s %d", get_function(), i); return; } i++; } END_FOR_EACH_PTR(arg); } static void match_end_func(struct symbol *sym) { struct tracker *tracker; if (__inline_fn) return; if (is_reachable()) match_return(NULL); FOR_EACH_PTR(putted_args, tracker) { print_arg(tracker->sym); } END_FOR_EACH_PTR(tracker); free_trackers_and_list(&putted_args); return_count = 0; } void check_puts_argument(int id) { if (!option_info || option_project != PROJ_KERNEL) return; my_id = id; add_hook(&match_function_def, FUNC_DEF_HOOK); add_function_hook("kobject_put", &match_put, NULL); add_function_hook("kref_put", &match_put, NULL); add_hook(&match_return, RETURN_HOOK); add_hook(&match_end_func, END_FUNC_HOOK); }
24.089552
76
0.714994
a89966adc4e60368b969ddbd49d5cbb96463ea7f
432
h
C
MASStorage/Classes/_private_/categories/MASObject+StoragePrivate.h
CAAPIM/iOS-MAS-Storage
9574790b5a6452d18979a9d9d6163884260c832c
[ "MIT" ]
null
null
null
MASStorage/Classes/_private_/categories/MASObject+StoragePrivate.h
CAAPIM/iOS-MAS-Storage
9574790b5a6452d18979a9d9d6163884260c832c
[ "MIT" ]
4
2017-05-30T20:58:01.000Z
2018-03-21T22:30:41.000Z
MASStorage/Classes/_private_/categories/MASObject+StoragePrivate.h
CAAPIM/iOS-MAS-Storage
9574790b5a6452d18979a9d9d6163884260c832c
[ "MIT" ]
2
2016-12-21T15:47:09.000Z
2017-09-14T22:35:44.000Z
// // MASObject+StoragePrivate.h // MASStorage // // Copyright (c) 2016 CA. All rights reserved. // // This software may be modified and distributed under the terms // of the MIT license. See the LICENSE file for details. // #import <MASFoundation/MASFoundation.h> @interface MASObject (StoragePrivate) // TO BE DELETED! // NOT USED ANYMORE // ALL IMPLEMENTATION IS DONE DIRECTLY IN THE MASConfiguration model object @end
20.571429
75
0.733796
a4bcdb7aa7bcedb331cad493a6805b792b1342d0
3,537
h
C
build/ubuntu-22.04/intel-mvp-tdx-guest-grub2/debian/grub-extras/disabled/gpxe/include_wrap/gpxe/list.h
ruomengh/tdx-tools
6c146f63d85f13681196e28bb463500279a5ada6
[ "Apache-2.0" ]
11
2021-12-21T01:32:59.000Z
2022-03-30T14:37:45.000Z
grub-extras/disabled/gpxe/include_wrap/gpxe/list.h
GalliumOS/grub2
a90b0bf25dd265d43b75d40030985594c578ea44
[ "MIT" ]
15
2022-01-12T00:40:59.000Z
2022-03-31T17:03:42.000Z
grub-extras/disabled/gpxe/include_wrap/gpxe/list.h
GalliumOS/grub2
a90b0bf25dd265d43b75d40030985594c578ea44
[ "MIT" ]
7
2021-12-20T11:45:46.000Z
2022-03-15T06:22:52.000Z
/* * Copyright © 2009 Vladimir 'phcoder' Serbinenko <phcoder@gmail.com> * 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. */ FILE_LICENCE ( BSD2 ); #ifndef _GPXE_LIST_H #define _GPXE_LIST_H 1 #include <grub/types.h> #include <gpxe/wrap.h> struct list_head { struct list_head *next; struct list_head *prev; }; #define LIST_HEAD struct list_head #define INIT_LIST_HEAD(x) ((x)->next = NULL) #define LIST_HEAD_INIT(x) { .next = NULL, .prev = NULL } #define list_empty(x) ((x)->next == NULL) #define offsetof(type, elem) ((grub_uint8_t *) (&((type *) NULL)->elem) - (grub_uint8_t *) NULL) #define container_of(var, type, elem) ((type *) ((grub_uint8_t *)(var) - offsetof (type, elem))) #define list_get_next(it, lst_el, hold) \ container_of ((it)->lst_el.next, typeof (*hold), lst_el) #define list_for_each_entry(it, lst, lst_el) \ for ((it) = container_of((lst)->next, typeof (*(it)), lst_el); \ &(it)->lst_el != NULL && &(it)->lst_el != (void *) lst; \ (it) = list_get_next(it, lst_el, it)) #define list_for_each_entry_safe(it, next_h, lst, lst_el) \ for ((it) = container_of((lst)->next, typeof (*(it)), lst_el); \ &(it)->lst_el != NULL && &(it)->lst_el != (void *) lst; \ ((it) = container_of ((next_h), typeof (*(next_h)), lst_el)), \ (next_h) = list_get_next(it, lst_el, next_h)) static inline void list_del (struct list_head *head) { if (head->next == head->prev) { head->next->prev = NULL; head->prev->next = NULL; } else { head->prev->next = head->next; head->next->prev = head->prev; } } static inline void list_add_tail (struct list_head *head, struct list_head *new) { if (list_empty (head)) { head->next = head->prev = new; new->next = new->prev = head; } else { head->prev->next = new; new->prev = head->prev; new->next = head; head->prev = new; } } static inline void list_add (struct list_head *head, struct list_head *new) { if (list_empty (head)) { head->next = head->prev = new; new->next = new->prev = head; } else { head->next->prev = new; new->next = head->next; new->prev = head; head->next = new; } } #endif
29.722689
96
0.660164
78cb9dc5a919f89c45aaf37e0f99faa1e2db7712
53,684
c
C
testsuite/EXP_4/test1696.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
34
2017-07-04T14:16:12.000Z
2021-04-22T21:04:43.000Z
testsuite/EXP_4/test1696.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
1
2017-07-06T03:43:44.000Z
2017-07-06T03:43:44.000Z
testsuite/EXP_4/test1696.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" static int32_t x1 = INT32_MAX; static uint64_t x3 = 3976LLU; static int16_t x4 = INT16_MAX; volatile int64_t x11 = INT64_MIN; uint32_t x21 = 4U; int64_t x22 = INT64_MIN; int64_t x23 = 99668258668223605LL; uint32_t t5 = 2304U; volatile int32_t t6 = 9541; volatile int32_t x29 = -10045230; int8_t x30 = -1; int64_t x43 = -1LL; volatile uint32_t x54 = UINT32_MAX; static int8_t x56 = -1; int32_t t13 = 101574; static uint32_t x60 = UINT32_MAX; int32_t t14 = -1023787053; static int8_t x62 = INT8_MIN; uint32_t x63 = 14105U; uint32_t x67 = UINT32_MAX; volatile int32_t t16 = -236; int64_t x69 = INT64_MIN; volatile uint64_t x74 = 7810496412864992350LLU; int32_t t18 = -7; uint8_t x83 = 111U; int8_t x84 = INT8_MIN; int32_t x91 = -18382325; static int64_t x93 = -1LL; volatile int64_t t23 = 59804456LL; int8_t x100 = 0; uint8_t x108 = 1U; int64_t x113 = INT64_MIN; int16_t x118 = INT16_MAX; uint64_t x122 = UINT64_MAX; static int64_t x135 = -1LL; volatile int8_t x147 = -1; uint8_t x169 = UINT8_MAX; static int32_t x173 = INT32_MAX; volatile uint8_t x176 = 2U; volatile int32_t t44 = -133517; uint8_t x190 = UINT8_MAX; volatile int32_t x191 = -1; int16_t x193 = 146; volatile uint8_t x200 = 6U; int32_t x201 = 1; int8_t x203 = INT8_MIN; volatile int32_t t49 = -161529; int16_t x210 = 6; uint16_t x213 = UINT16_MAX; static int64_t x214 = INT64_MIN; volatile uint64_t x217 = 209461838095358116LLU; int64_t x219 = INT64_MIN; volatile int64_t x220 = INT64_MAX; static int64_t x226 = 1803LL; volatile int8_t x228 = INT8_MIN; int8_t x236 = 0; volatile int32_t t57 = -253493; static uint8_t x266 = 14U; uint8_t x271 = 4U; uint16_t x272 = 614U; uint32_t x277 = UINT32_MAX; int16_t x278 = 3258; int32_t x283 = INT32_MIN; volatile int16_t x293 = INT16_MAX; int32_t x298 = -1; volatile int8_t x301 = 41; int64_t x303 = -5LL; int16_t x315 = INT16_MAX; static int8_t x323 = INT8_MIN; static uint16_t x325 = 113U; int32_t x335 = -25989; volatile int32_t t81 = -32187; int64_t x337 = INT64_MAX; volatile int32_t x338 = INT32_MIN; uint32_t x343 = 32783U; volatile int64_t t84 = -59951LL; uint32_t x350 = UINT32_MAX; volatile int32_t x355 = 214564; static volatile uint16_t x357 = 5694U; int8_t x359 = INT8_MIN; int32_t t90 = -1; volatile int32_t x382 = INT32_MAX; volatile uint8_t x387 = UINT8_MAX; int32_t x388 = INT32_MIN; int32_t t94 = 3421; volatile uint16_t x393 = 10977U; int64_t x396 = INT64_MIN; int8_t x407 = -1; uint64_t t98 = 36315LLU; int8_t x409 = -1; volatile int32_t t99 = 458172156; volatile int32_t t103 = -17858; int8_t x433 = 4; int16_t x436 = INT16_MIN; uint16_t x442 = 108U; int16_t x446 = -1; static int32_t t106 = 244; uint32_t x452 = UINT32_MAX; volatile uint64_t t109 = 3227459LLU; volatile uint32_t x463 = 231U; uint16_t x464 = 7749U; int32_t t110 = 1898334; uint64_t x466 = UINT64_MAX; int16_t x468 = INT16_MIN; int32_t t111 = INT32_MIN; int16_t x478 = 44; volatile int32_t t115 = -17197; static int8_t x501 = INT8_MIN; volatile int32_t t118 = -35858; volatile int64_t x507 = INT64_MAX; int32_t t119 = 41859729; uint8_t x510 = 15U; int32_t t121 = -4020002; static volatile int32_t x517 = -1; uint16_t x529 = 30U; uint32_t x539 = UINT32_MAX; uint8_t x540 = 19U; static int32_t x546 = -1; uint8_t x549 = 26U; int32_t x551 = INT32_MIN; int32_t t130 = -2073; uint32_t x554 = UINT32_MAX; static volatile int16_t x555 = INT16_MIN; uint32_t x562 = 5568178U; uint16_t x566 = UINT16_MAX; int32_t x573 = -1; uint16_t x577 = UINT16_MAX; volatile int32_t t139 = 12555466; volatile int64_t x594 = INT64_MAX; volatile int64_t x599 = INT64_MAX; static int64_t x601 = 62742175302065LL; volatile int64_t t143 = 152LL; int64_t x609 = 55684LL; volatile uint8_t x610 = 21U; static int64_t x619 = INT64_MIN; int64_t x620 = INT64_MIN; volatile uint32_t t148 = 2023289U; int8_t x629 = 8; volatile uint32_t x634 = 2361616U; int64_t x647 = INT64_MAX; uint64_t x653 = 9LLU; int64_t x656 = -627050911631LL; volatile int64_t x659 = -1LL; static uint32_t x666 = 55559211U; int32_t x667 = INT32_MIN; int16_t x683 = INT16_MAX; int64_t x684 = -409925017789913717LL; static volatile int64_t t163 = INT64_MAX; int32_t x689 = INT32_MIN; int8_t x699 = INT8_MIN; int64_t x703 = INT64_MIN; volatile int32_t x727 = -839; volatile int32_t x735 = INT32_MIN; volatile int16_t x736 = 10; uint64_t x739 = 1501018685985767009LLU; int64_t x751 = INT64_MIN; int8_t x757 = -1; int32_t x762 = -1; int32_t x763 = -1; volatile int32_t x775 = INT32_MAX; volatile int32_t x776 = 121395416; int32_t x791 = INT32_MAX; uint8_t x796 = 1U; int32_t t192 = -105394; static int32_t x802 = INT32_MIN; int32_t x803 = -1; static volatile int16_t x804 = 0; static int64_t x805 = -1759458858347LL; int64_t x807 = INT64_MIN; int64_t x809 = INT64_MAX; static uint64_t x818 = UINT64_MAX; volatile int64_t t197 = 83LL; uint16_t x821 = UINT16_MAX; void f0(void) { volatile int64_t x2 = INT64_MIN; volatile int32_t t0 = -14615607; t0 = (x1-(x2<=(x3>x4))); if (t0 != 2147483646) { NG(); } else { ; } } void f1(void) { uint8_t x5 = 4U; int64_t x6 = -1LL; static volatile uint16_t x7 = 4607U; static uint32_t x8 = 7528891U; volatile int32_t t1 = -307564; t1 = (x5-(x6<=(x7>x8))); if (t1 != 3) { NG(); } else { ; } } void f2(void) { uint8_t x9 = 12U; static int64_t x10 = -1LL; static int16_t x12 = 1328; volatile int32_t t2 = -134096753; t2 = (x9-(x10<=(x11>x12))); if (t2 != 11) { NG(); } else { ; } } void f3(void) { int32_t x13 = 22240; uint8_t x14 = 98U; volatile int64_t x15 = INT64_MAX; int32_t x16 = INT32_MAX; int32_t t3 = 766262; t3 = (x13-(x14<=(x15>x16))); if (t3 != 22240) { NG(); } else { ; } } void f4(void) { volatile int8_t x17 = INT8_MIN; uint64_t x18 = 5998889LLU; int8_t x19 = 9; uint8_t x20 = UINT8_MAX; volatile int32_t t4 = 106238; t4 = (x17-(x18<=(x19>x20))); if (t4 != -128) { NG(); } else { ; } } void f5(void) { int16_t x24 = INT16_MAX; t5 = (x21-(x22<=(x23>x24))); if (t5 != 3U) { NG(); } else { ; } } void f6(void) { int8_t x25 = -1; int16_t x26 = INT16_MIN; static uint16_t x27 = 3196U; int64_t x28 = -1851296LL; t6 = (x25-(x26<=(x27>x28))); if (t6 != -2) { NG(); } else { ; } } void f7(void) { volatile int32_t x31 = INT32_MIN; static int64_t x32 = INT64_MIN; volatile int32_t t7 = 493; t7 = (x29-(x30<=(x31>x32))); if (t7 != -10045231) { NG(); } else { ; } } void f8(void) { int64_t x33 = 2886LL; volatile int64_t x34 = INT64_MIN; static int64_t x35 = INT64_MIN; int16_t x36 = INT16_MAX; volatile int64_t t8 = -1390LL; t8 = (x33-(x34<=(x35>x36))); if (t8 != 2885LL) { NG(); } else { ; } } void f9(void) { uint32_t x37 = UINT32_MAX; volatile int16_t x38 = INT16_MIN; int32_t x39 = INT32_MAX; int16_t x40 = INT16_MIN; volatile uint32_t t9 = 609443U; t9 = (x37-(x38<=(x39>x40))); if (t9 != 4294967294U) { NG(); } else { ; } } void f10(void) { int64_t x41 = INT64_MAX; uint8_t x42 = 1U; int8_t x44 = INT8_MIN; volatile int64_t t10 = -23534211LL; t10 = (x41-(x42<=(x43>x44))); if (t10 != 9223372036854775806LL) { NG(); } else { ; } } void f11(void) { uint32_t x45 = UINT32_MAX; int8_t x46 = INT8_MAX; static int8_t x47 = INT8_MIN; static int64_t x48 = INT64_MAX; static volatile uint32_t t11 = UINT32_MAX; t11 = (x45-(x46<=(x47>x48))); if (t11 != UINT32_MAX) { NG(); } else { ; } } void f12(void) { volatile int16_t x49 = INT16_MAX; uint8_t x50 = 0U; int32_t x51 = -45240; int16_t x52 = INT16_MIN; int32_t t12 = -909070091; t12 = (x49-(x50<=(x51>x52))); if (t12 != 32766) { NG(); } else { ; } } void f13(void) { static volatile int8_t x53 = 38; int32_t x55 = -1; t13 = (x53-(x54<=(x55>x56))); if (t13 != 38) { NG(); } else { ; } } void f14(void) { static int8_t x57 = 0; static uint16_t x58 = UINT16_MAX; int64_t x59 = -1LL; t14 = (x57-(x58<=(x59>x60))); if (t14 != 0) { NG(); } else { ; } } void f15(void) { uint64_t x61 = UINT64_MAX; volatile int32_t x64 = -1; uint64_t t15 = 17377983111015LLU; t15 = (x61-(x62<=(x63>x64))); if (t15 != 18446744073709551614LLU) { NG(); } else { ; } } void f16(void) { int8_t x65 = 0; int16_t x66 = INT16_MIN; static int16_t x68 = 0; t16 = (x65-(x66<=(x67>x68))); if (t16 != -1) { NG(); } else { ; } } void f17(void) { uint64_t x70 = 24821754150092500LLU; volatile int16_t x71 = -16132; static int8_t x72 = INT8_MIN; volatile int64_t t17 = INT64_MIN; t17 = (x69-(x70<=(x71>x72))); if (t17 != INT64_MIN) { NG(); } else { ; } } void f18(void) { int16_t x73 = -1; int8_t x75 = INT8_MAX; uint32_t x76 = 5530U; t18 = (x73-(x74<=(x75>x76))); if (t18 != -1) { NG(); } else { ; } } void f19(void) { static volatile int16_t x77 = INT16_MAX; int32_t x78 = -6340272; int8_t x79 = -1; volatile int32_t x80 = 427; volatile int32_t t19 = 470364070; t19 = (x77-(x78<=(x79>x80))); if (t19 != 32766) { NG(); } else { ; } } void f20(void) { int32_t x81 = -5960; static int32_t x82 = -311; int32_t t20 = 2094019; t20 = (x81-(x82<=(x83>x84))); if (t20 != -5961) { NG(); } else { ; } } void f21(void) { int64_t x85 = -1LL; volatile int32_t x86 = -914536; int32_t x87 = INT32_MAX; int16_t x88 = INT16_MAX; static volatile int64_t t21 = -80720108401246LL; t21 = (x85-(x86<=(x87>x88))); if (t21 != -2LL) { NG(); } else { ; } } void f22(void) { int8_t x89 = INT8_MIN; static int16_t x90 = INT16_MAX; int32_t x92 = 2530; volatile int32_t t22 = -962197669; t22 = (x89-(x90<=(x91>x92))); if (t22 != -128) { NG(); } else { ; } } void f23(void) { uint8_t x94 = 38U; static uint16_t x95 = 102U; uint32_t x96 = UINT32_MAX; t23 = (x93-(x94<=(x95>x96))); if (t23 != -1LL) { NG(); } else { ; } } void f24(void) { int16_t x97 = 12745; static uint64_t x98 = UINT64_MAX; volatile int8_t x99 = 19; volatile int32_t t24 = -10137; t24 = (x97-(x98<=(x99>x100))); if (t24 != 12745) { NG(); } else { ; } } void f25(void) { static uint16_t x105 = UINT16_MAX; static volatile int32_t x106 = INT32_MIN; uint32_t x107 = UINT32_MAX; volatile int32_t t25 = -1; t25 = (x105-(x106<=(x107>x108))); if (t25 != 65534) { NG(); } else { ; } } void f26(void) { int32_t x109 = INT32_MAX; int8_t x110 = 1; int64_t x111 = INT64_MIN; int32_t x112 = 882938344; int32_t t26 = INT32_MAX; t26 = (x109-(x110<=(x111>x112))); if (t26 != INT32_MAX) { NG(); } else { ; } } void f27(void) { uint16_t x114 = UINT16_MAX; uint64_t x115 = UINT64_MAX; static int8_t x116 = -1; volatile int64_t t27 = INT64_MIN; t27 = (x113-(x114<=(x115>x116))); if (t27 != INT64_MIN) { NG(); } else { ; } } void f28(void) { int32_t x117 = -1; int32_t x119 = 130222294; uint64_t x120 = 365112111LLU; static int32_t t28 = -126070707; t28 = (x117-(x118<=(x119>x120))); if (t28 != -1) { NG(); } else { ; } } void f29(void) { uint32_t x121 = 84U; int16_t x123 = INT16_MIN; volatile int64_t x124 = 1925468640745LL; volatile uint32_t t29 = 4093U; t29 = (x121-(x122<=(x123>x124))); if (t29 != 84U) { NG(); } else { ; } } void f30(void) { uint8_t x125 = UINT8_MAX; volatile int16_t x126 = INT16_MAX; int32_t x127 = -716725673; int8_t x128 = INT8_MIN; int32_t t30 = 4226; t30 = (x125-(x126<=(x127>x128))); if (t30 != 255) { NG(); } else { ; } } void f31(void) { volatile uint32_t x129 = 58739930U; int64_t x130 = INT64_MAX; static uint32_t x131 = UINT32_MAX; uint32_t x132 = 1269056657U; static volatile uint32_t t31 = 43U; t31 = (x129-(x130<=(x131>x132))); if (t31 != 58739930U) { NG(); } else { ; } } void f32(void) { static uint32_t x133 = 284443U; volatile int8_t x134 = INT8_MIN; static volatile uint32_t x136 = 35898982U; static uint32_t t32 = 38190U; t32 = (x133-(x134<=(x135>x136))); if (t32 != 284442U) { NG(); } else { ; } } void f33(void) { static int8_t x137 = -1; int64_t x138 = INT64_MIN; uint32_t x139 = UINT32_MAX; int8_t x140 = -1; int32_t t33 = 140216; t33 = (x137-(x138<=(x139>x140))); if (t33 != -2) { NG(); } else { ; } } void f34(void) { static int32_t x141 = -1; uint64_t x142 = 36216486151182584LLU; volatile int32_t x143 = -253866308; int32_t x144 = INT32_MIN; static int32_t t34 = -9808; t34 = (x141-(x142<=(x143>x144))); if (t34 != -1) { NG(); } else { ; } } void f35(void) { volatile int64_t x145 = 3250543230659LL; volatile int16_t x146 = 6637; uint32_t x148 = UINT32_MAX; int64_t t35 = 8459597494LL; t35 = (x145-(x146<=(x147>x148))); if (t35 != 3250543230659LL) { NG(); } else { ; } } void f36(void) { uint16_t x149 = 0U; static uint16_t x150 = 7022U; static int64_t x151 = INT64_MIN; uint32_t x152 = 29552698U; volatile int32_t t36 = 590175; t36 = (x149-(x150<=(x151>x152))); if (t36 != 0) { NG(); } else { ; } } void f37(void) { int64_t x153 = INT64_MIN; volatile int32_t x154 = 182567; uint32_t x155 = 0U; static uint16_t x156 = 25U; int64_t t37 = INT64_MIN; t37 = (x153-(x154<=(x155>x156))); if (t37 != INT64_MIN) { NG(); } else { ; } } void f38(void) { static int16_t x157 = INT16_MIN; static volatile int8_t x158 = -1; volatile int64_t x159 = INT64_MAX; volatile uint32_t x160 = 3533U; int32_t t38 = -1; t38 = (x157-(x158<=(x159>x160))); if (t38 != -32769) { NG(); } else { ; } } void f39(void) { static int16_t x161 = 6; int32_t x162 = 38454073; int64_t x163 = INT64_MAX; static int64_t x164 = INT64_MIN; volatile int32_t t39 = -12; t39 = (x161-(x162<=(x163>x164))); if (t39 != 6) { NG(); } else { ; } } void f40(void) { uint16_t x165 = 3U; int32_t x166 = INT32_MIN; uint32_t x167 = 48843588U; volatile int64_t x168 = INT64_MIN; static int32_t t40 = 866585; t40 = (x165-(x166<=(x167>x168))); if (t40 != 2) { NG(); } else { ; } } void f41(void) { static int8_t x170 = 33; int8_t x171 = INT8_MIN; int32_t x172 = INT32_MIN; volatile int32_t t41 = 395; t41 = (x169-(x170<=(x171>x172))); if (t41 != 255) { NG(); } else { ; } } void f42(void) { uint8_t x174 = 2U; int64_t x175 = -3583745382438LL; int32_t t42 = INT32_MAX; t42 = (x173-(x174<=(x175>x176))); if (t42 != INT32_MAX) { NG(); } else { ; } } void f43(void) { int32_t x177 = -1; int32_t x178 = -74428; uint32_t x179 = 0U; uint64_t x180 = 18526LLU; volatile int32_t t43 = -207349037; t43 = (x177-(x178<=(x179>x180))); if (t43 != -2) { NG(); } else { ; } } void f44(void) { uint8_t x181 = UINT8_MAX; uint32_t x182 = UINT32_MAX; uint16_t x183 = 22800U; volatile int16_t x184 = -1; t44 = (x181-(x182<=(x183>x184))); if (t44 != 255) { NG(); } else { ; } } void f45(void) { int8_t x185 = 7; uint16_t x186 = UINT16_MAX; uint64_t x187 = 267194789142969LLU; static int64_t x188 = INT64_MAX; static volatile int32_t t45 = -167620; t45 = (x185-(x186<=(x187>x188))); if (t45 != 7) { NG(); } else { ; } } void f46(void) { volatile int64_t x189 = INT64_MIN; uint32_t x192 = 5882U; volatile int64_t t46 = INT64_MIN; t46 = (x189-(x190<=(x191>x192))); if (t46 != INT64_MIN) { NG(); } else { ; } } void f47(void) { static uint32_t x194 = UINT32_MAX; static uint16_t x195 = 2425U; volatile uint8_t x196 = 36U; int32_t t47 = -232; t47 = (x193-(x194<=(x195>x196))); if (t47 != 146) { NG(); } else { ; } } void f48(void) { int16_t x197 = INT16_MIN; volatile uint16_t x198 = 29U; volatile int8_t x199 = 23; int32_t t48 = -363328499; t48 = (x197-(x198<=(x199>x200))); if (t48 != -32768) { NG(); } else { ; } } void f49(void) { uint64_t x202 = UINT64_MAX; int32_t x204 = INT32_MAX; t49 = (x201-(x202<=(x203>x204))); if (t49 != 1) { NG(); } else { ; } } void f50(void) { uint64_t x205 = UINT64_MAX; uint16_t x206 = 19U; uint32_t x207 = 23884941U; static int8_t x208 = -1; static volatile uint64_t t50 = UINT64_MAX; t50 = (x205-(x206<=(x207>x208))); if (t50 != UINT64_MAX) { NG(); } else { ; } } void f51(void) { volatile uint32_t x209 = UINT32_MAX; uint8_t x211 = 119U; static int16_t x212 = INT16_MIN; uint32_t t51 = UINT32_MAX; t51 = (x209-(x210<=(x211>x212))); if (t51 != UINT32_MAX) { NG(); } else { ; } } void f52(void) { volatile int64_t x215 = INT64_MAX; int8_t x216 = 62; static volatile int32_t t52 = -1; t52 = (x213-(x214<=(x215>x216))); if (t52 != 65534) { NG(); } else { ; } } void f53(void) { uint8_t x218 = UINT8_MAX; static volatile uint64_t t53 = 31958850677011LLU; t53 = (x217-(x218<=(x219>x220))); if (t53 != 209461838095358116LLU) { NG(); } else { ; } } void f54(void) { uint64_t x225 = 674795717442LLU; uint32_t x227 = UINT32_MAX; uint64_t t54 = 141150051593953654LLU; t54 = (x225-(x226<=(x227>x228))); if (t54 != 674795717442LLU) { NG(); } else { ; } } void f55(void) { uint8_t x229 = 17U; static uint32_t x230 = 4431147U; int64_t x231 = 1059845384LL; uint16_t x232 = 754U; int32_t t55 = 83647990; t55 = (x229-(x230<=(x231>x232))); if (t55 != 17) { NG(); } else { ; } } void f56(void) { int16_t x233 = -1; int64_t x234 = INT64_MIN; int16_t x235 = 0; static volatile int32_t t56 = -270897345; t56 = (x233-(x234<=(x235>x236))); if (t56 != -2) { NG(); } else { ; } } void f57(void) { volatile uint16_t x237 = UINT16_MAX; int16_t x238 = 7805; int64_t x239 = -1LL; int8_t x240 = -3; t57 = (x237-(x238<=(x239>x240))); if (t57 != 65535) { NG(); } else { ; } } void f58(void) { volatile int32_t x241 = INT32_MAX; int32_t x242 = -56285422; int64_t x243 = INT64_MIN; volatile uint8_t x244 = 3U; int32_t t58 = 3; t58 = (x241-(x242<=(x243>x244))); if (t58 != 2147483646) { NG(); } else { ; } } void f59(void) { int32_t x245 = 174515; uint16_t x246 = 337U; int16_t x247 = INT16_MIN; static volatile uint16_t x248 = 16U; static volatile int32_t t59 = 68; t59 = (x245-(x246<=(x247>x248))); if (t59 != 174515) { NG(); } else { ; } } void f60(void) { uint8_t x249 = 5U; int16_t x250 = -1; int32_t x251 = -65058148; int32_t x252 = INT32_MIN; volatile int32_t t60 = -1063391257; t60 = (x249-(x250<=(x251>x252))); if (t60 != 4) { NG(); } else { ; } } void f61(void) { int16_t x253 = INT16_MIN; volatile int8_t x254 = 1; int64_t x255 = INT64_MIN; int8_t x256 = -15; volatile int32_t t61 = -102468; t61 = (x253-(x254<=(x255>x256))); if (t61 != -32768) { NG(); } else { ; } } void f62(void) { int32_t x257 = INT32_MIN; uint16_t x258 = UINT16_MAX; uint16_t x259 = 1840U; int64_t x260 = 257LL; int32_t t62 = INT32_MIN; t62 = (x257-(x258<=(x259>x260))); if (t62 != INT32_MIN) { NG(); } else { ; } } void f63(void) { uint64_t x261 = UINT64_MAX; uint32_t x262 = 7U; static int32_t x263 = 53595644; uint16_t x264 = 1981U; volatile uint64_t t63 = UINT64_MAX; t63 = (x261-(x262<=(x263>x264))); if (t63 != UINT64_MAX) { NG(); } else { ; } } void f64(void) { uint64_t x265 = 23550789LLU; int32_t x267 = -1; int32_t x268 = -1; volatile uint64_t t64 = 4129053479166924521LLU; t64 = (x265-(x266<=(x267>x268))); if (t64 != 23550789LLU) { NG(); } else { ; } } void f65(void) { int32_t x269 = -1; uint32_t x270 = UINT32_MAX; volatile int32_t t65 = -2639; t65 = (x269-(x270<=(x271>x272))); if (t65 != -1) { NG(); } else { ; } } void f66(void) { int16_t x273 = -28; int64_t x274 = -1LL; int8_t x275 = INT8_MIN; uint64_t x276 = UINT64_MAX; volatile int32_t t66 = 881542595; t66 = (x273-(x274<=(x275>x276))); if (t66 != -29) { NG(); } else { ; } } void f67(void) { int64_t x279 = INT64_MIN; uint32_t x280 = UINT32_MAX; static uint32_t t67 = UINT32_MAX; t67 = (x277-(x278<=(x279>x280))); if (t67 != UINT32_MAX) { NG(); } else { ; } } void f68(void) { int16_t x281 = -272; uint8_t x282 = 29U; static int32_t x284 = -1; volatile int32_t t68 = 695; t68 = (x281-(x282<=(x283>x284))); if (t68 != -272) { NG(); } else { ; } } void f69(void) { static int16_t x285 = INT16_MIN; uint32_t x286 = UINT32_MAX; int32_t x287 = INT32_MIN; volatile int32_t x288 = 1653283; static int32_t t69 = 12209; t69 = (x285-(x286<=(x287>x288))); if (t69 != -32768) { NG(); } else { ; } } void f70(void) { uint64_t x289 = UINT64_MAX; int16_t x290 = INT16_MAX; uint32_t x291 = 1660U; volatile uint64_t x292 = 221355484501LLU; uint64_t t70 = UINT64_MAX; t70 = (x289-(x290<=(x291>x292))); if (t70 != UINT64_MAX) { NG(); } else { ; } } void f71(void) { int64_t x294 = INT64_MIN; uint16_t x295 = UINT16_MAX; int8_t x296 = -5; volatile int32_t t71 = -241664; t71 = (x293-(x294<=(x295>x296))); if (t71 != 32766) { NG(); } else { ; } } void f72(void) { uint32_t x297 = 121U; int64_t x299 = -176643441006716136LL; int64_t x300 = -1LL; volatile uint32_t t72 = 801U; t72 = (x297-(x298<=(x299>x300))); if (t72 != 120U) { NG(); } else { ; } } void f73(void) { volatile int8_t x302 = -1; int64_t x304 = 60338435711779LL; volatile int32_t t73 = 5268024; t73 = (x301-(x302<=(x303>x304))); if (t73 != 40) { NG(); } else { ; } } void f74(void) { static int32_t x305 = -35399806; int32_t x306 = -1460; static int16_t x307 = 0; int32_t x308 = 1263; volatile int32_t t74 = -13; t74 = (x305-(x306<=(x307>x308))); if (t74 != -35399807) { NG(); } else { ; } } void f75(void) { volatile int64_t x309 = -15643901561LL; int16_t x310 = -1; uint32_t x311 = 3U; int32_t x312 = INT32_MAX; volatile int64_t t75 = 11423122389449LL; t75 = (x309-(x310<=(x311>x312))); if (t75 != -15643901562LL) { NG(); } else { ; } } void f76(void) { int32_t x313 = -1; int32_t x314 = 1; int16_t x316 = -10; volatile int32_t t76 = 88426; t76 = (x313-(x314<=(x315>x316))); if (t76 != -2) { NG(); } else { ; } } void f77(void) { volatile int16_t x317 = INT16_MAX; uint32_t x318 = UINT32_MAX; int64_t x319 = INT64_MIN; int16_t x320 = INT16_MAX; int32_t t77 = -21468; t77 = (x317-(x318<=(x319>x320))); if (t77 != 32767) { NG(); } else { ; } } void f78(void) { static int32_t x321 = 1; int8_t x322 = INT8_MIN; int8_t x324 = 2; int32_t t78 = -16002; t78 = (x321-(x322<=(x323>x324))); if (t78 != 0) { NG(); } else { ; } } void f79(void) { int64_t x326 = INT64_MAX; static uint8_t x327 = 3U; static volatile int32_t x328 = -6405846; volatile int32_t t79 = 2994048; t79 = (x325-(x326<=(x327>x328))); if (t79 != 113) { NG(); } else { ; } } void f80(void) { int8_t x329 = INT8_MIN; int64_t x330 = -3124969536987494013LL; volatile int8_t x331 = INT8_MAX; uint32_t x332 = UINT32_MAX; static int32_t t80 = 109; t80 = (x329-(x330<=(x331>x332))); if (t80 != -129) { NG(); } else { ; } } void f81(void) { int16_t x333 = -29; volatile uint8_t x334 = 1U; static int8_t x336 = -6; t81 = (x333-(x334<=(x335>x336))); if (t81 != -29) { NG(); } else { ; } } void f82(void) { uint64_t x339 = 9563760222LLU; int32_t x340 = INT32_MIN; int64_t t82 = -776LL; t82 = (x337-(x338<=(x339>x340))); if (t82 != 9223372036854775806LL) { NG(); } else { ; } } void f83(void) { static volatile int64_t x341 = 285192LL; uint32_t x342 = UINT32_MAX; int16_t x344 = INT16_MAX; int64_t t83 = -5476565LL; t83 = (x341-(x342<=(x343>x344))); if (t83 != 285192LL) { NG(); } else { ; } } void f84(void) { int64_t x345 = INT64_MAX; int16_t x346 = INT16_MIN; uint64_t x347 = 5796357LLU; int8_t x348 = INT8_MAX; t84 = (x345-(x346<=(x347>x348))); if (t84 != 9223372036854775806LL) { NG(); } else { ; } } void f85(void) { static int32_t x349 = INT32_MIN; volatile int8_t x351 = INT8_MAX; static volatile uint32_t x352 = 124492U; volatile int32_t t85 = INT32_MIN; t85 = (x349-(x350<=(x351>x352))); if (t85 != INT32_MIN) { NG(); } else { ; } } void f86(void) { static int64_t x353 = -691306168674LL; volatile int32_t x354 = INT32_MIN; int16_t x356 = -1; volatile int64_t t86 = -28649029LL; t86 = (x353-(x354<=(x355>x356))); if (t86 != -691306168675LL) { NG(); } else { ; } } void f87(void) { static uint8_t x358 = UINT8_MAX; int32_t x360 = INT32_MIN; volatile int32_t t87 = -2472608; t87 = (x357-(x358<=(x359>x360))); if (t87 != 5694) { NG(); } else { ; } } void f88(void) { volatile uint64_t x361 = UINT64_MAX; static uint32_t x362 = UINT32_MAX; int8_t x363 = 1; int8_t x364 = 6; static uint64_t t88 = UINT64_MAX; t88 = (x361-(x362<=(x363>x364))); if (t88 != UINT64_MAX) { NG(); } else { ; } } void f89(void) { volatile uint64_t x369 = 200163593697308LLU; volatile int32_t x370 = INT32_MIN; int64_t x371 = -55928970193089LL; volatile int64_t x372 = -1LL; volatile uint64_t t89 = 6LLU; t89 = (x369-(x370<=(x371>x372))); if (t89 != 200163593697307LLU) { NG(); } else { ; } } void f90(void) { uint16_t x373 = 30U; int64_t x374 = -43603901214084LL; volatile uint8_t x375 = 110U; int16_t x376 = 616; t90 = (x373-(x374<=(x375>x376))); if (t90 != 29) { NG(); } else { ; } } void f91(void) { int64_t x377 = 51017792333911LL; volatile int16_t x378 = -23; static uint8_t x379 = 2U; int64_t x380 = 500775LL; volatile int64_t t91 = -54518151102340LL; t91 = (x377-(x378<=(x379>x380))); if (t91 != 51017792333910LL) { NG(); } else { ; } } void f92(void) { uint64_t x381 = 30476521228829LLU; uint8_t x383 = 0U; int32_t x384 = -253703726; uint64_t t92 = 6967967062638111482LLU; t92 = (x381-(x382<=(x383>x384))); if (t92 != 30476521228829LLU) { NG(); } else { ; } } void f93(void) { int8_t x385 = INT8_MIN; static int16_t x386 = INT16_MIN; int32_t t93 = 1091190; t93 = (x385-(x386<=(x387>x388))); if (t93 != -129) { NG(); } else { ; } } void f94(void) { uint16_t x389 = 5500U; static int64_t x390 = INT64_MIN; int64_t x391 = INT64_MIN; uint8_t x392 = 2U; t94 = (x389-(x390<=(x391>x392))); if (t94 != 5499) { NG(); } else { ; } } void f95(void) { int64_t x394 = INT64_MIN; int64_t x395 = -1LL; int32_t t95 = 10315416; t95 = (x393-(x394<=(x395>x396))); if (t95 != 10976) { NG(); } else { ; } } void f96(void) { volatile int8_t x397 = INT8_MIN; int8_t x398 = -1; int16_t x399 = 1404; uint8_t x400 = 5U; int32_t t96 = -5; t96 = (x397-(x398<=(x399>x400))); if (t96 != -129) { NG(); } else { ; } } void f97(void) { volatile int8_t x401 = INT8_MIN; static int32_t x402 = 875; static volatile int8_t x403 = INT8_MIN; uint64_t x404 = 3LLU; int32_t t97 = -6660; t97 = (x401-(x402<=(x403>x404))); if (t97 != -128) { NG(); } else { ; } } void f98(void) { uint64_t x405 = 312700164253678LLU; volatile int16_t x406 = INT16_MIN; uint32_t x408 = 57961U; t98 = (x405-(x406<=(x407>x408))); if (t98 != 312700164253677LLU) { NG(); } else { ; } } void f99(void) { int16_t x410 = INT16_MIN; int16_t x411 = 1; int32_t x412 = INT32_MAX; t99 = (x409-(x410<=(x411>x412))); if (t99 != -2) { NG(); } else { ; } } void f100(void) { static int8_t x417 = -3; int16_t x418 = INT16_MAX; uint32_t x419 = 5391U; int8_t x420 = 0; int32_t t100 = -6759460; t100 = (x417-(x418<=(x419>x420))); if (t100 != -3) { NG(); } else { ; } } void f101(void) { int32_t x421 = -1; static uint64_t x422 = 307052490028890LLU; int8_t x423 = INT8_MIN; int16_t x424 = INT16_MIN; int32_t t101 = -1; t101 = (x421-(x422<=(x423>x424))); if (t101 != -1) { NG(); } else { ; } } void f102(void) { int8_t x425 = INT8_MAX; volatile int8_t x426 = INT8_MAX; int8_t x427 = INT8_MAX; uint64_t x428 = 425298920LLU; volatile int32_t t102 = -55845; t102 = (x425-(x426<=(x427>x428))); if (t102 != 127) { NG(); } else { ; } } void f103(void) { int16_t x429 = -1; uint32_t x430 = 15515347U; volatile uint8_t x431 = 3U; static int32_t x432 = -1; t103 = (x429-(x430<=(x431>x432))); if (t103 != -1) { NG(); } else { ; } } void f104(void) { static volatile uint32_t x434 = 83749U; int64_t x435 = INT64_MIN; volatile int32_t t104 = 0; t104 = (x433-(x434<=(x435>x436))); if (t104 != 4) { NG(); } else { ; } } void f105(void) { static uint8_t x441 = UINT8_MAX; volatile int64_t x443 = 1925387606LL; int64_t x444 = INT64_MIN; int32_t t105 = -9784; t105 = (x441-(x442<=(x443>x444))); if (t105 != 255) { NG(); } else { ; } } void f106(void) { static uint16_t x445 = UINT16_MAX; int32_t x447 = 38124512; uint64_t x448 = 2961832LLU; t106 = (x445-(x446<=(x447>x448))); if (t106 != 65534) { NG(); } else { ; } } void f107(void) { uint32_t x449 = 0U; int64_t x450 = -1LL; uint8_t x451 = 60U; static uint32_t t107 = UINT32_MAX; t107 = (x449-(x450<=(x451>x452))); if (t107 != UINT32_MAX) { NG(); } else { ; } } void f108(void) { int8_t x453 = -59; int64_t x454 = INT64_MAX; volatile int64_t x455 = -917844LL; static int16_t x456 = 7524; static int32_t t108 = -156747784; t108 = (x453-(x454<=(x455>x456))); if (t108 != -59) { NG(); } else { ; } } void f109(void) { uint64_t x457 = 586059668342LLU; uint64_t x458 = UINT64_MAX; int64_t x459 = -1LL; int32_t x460 = INT32_MIN; t109 = (x457-(x458<=(x459>x460))); if (t109 != 586059668342LLU) { NG(); } else { ; } } void f110(void) { int16_t x461 = INT16_MAX; uint64_t x462 = 8394919511417036LLU; t110 = (x461-(x462<=(x463>x464))); if (t110 != 32767) { NG(); } else { ; } } void f111(void) { volatile int32_t x465 = INT32_MIN; uint16_t x467 = 124U; t111 = (x465-(x466<=(x467>x468))); if (t111 != INT32_MIN) { NG(); } else { ; } } void f112(void) { static uint8_t x469 = 73U; static int8_t x470 = INT8_MIN; volatile int64_t x471 = INT64_MIN; volatile int64_t x472 = INT64_MAX; volatile int32_t t112 = -43832738; t112 = (x469-(x470<=(x471>x472))); if (t112 != 72) { NG(); } else { ; } } void f113(void) { static uint32_t x477 = 63U; int32_t x479 = INT32_MIN; uint32_t x480 = 13U; static volatile uint32_t t113 = 7796787U; t113 = (x477-(x478<=(x479>x480))); if (t113 != 63U) { NG(); } else { ; } } void f114(void) { uint8_t x485 = 0U; int16_t x486 = 10763; static uint16_t x487 = UINT16_MAX; int8_t x488 = INT8_MIN; int32_t t114 = -3211672; t114 = (x485-(x486<=(x487>x488))); if (t114 != 0) { NG(); } else { ; } } void f115(void) { uint8_t x489 = UINT8_MAX; int16_t x490 = INT16_MIN; static int8_t x491 = INT8_MIN; static volatile int64_t x492 = INT64_MAX; t115 = (x489-(x490<=(x491>x492))); if (t115 != 254) { NG(); } else { ; } } void f116(void) { uint16_t x493 = 10749U; uint8_t x494 = 0U; int8_t x495 = INT8_MAX; static int16_t x496 = INT16_MAX; int32_t t116 = 258931643; t116 = (x493-(x494<=(x495>x496))); if (t116 != 10748) { NG(); } else { ; } } void f117(void) { volatile uint32_t x497 = UINT32_MAX; static int8_t x498 = INT8_MIN; uint64_t x499 = UINT64_MAX; int32_t x500 = 110821; volatile uint32_t t117 = 29550U; t117 = (x497-(x498<=(x499>x500))); if (t117 != 4294967294U) { NG(); } else { ; } } void f118(void) { uint64_t x502 = 159430404833700919LLU; static uint32_t x503 = 1625191737U; volatile uint8_t x504 = 3U; t118 = (x501-(x502<=(x503>x504))); if (t118 != -128) { NG(); } else { ; } } void f119(void) { int8_t x505 = INT8_MIN; uint16_t x506 = 3528U; uint8_t x508 = 5U; t119 = (x505-(x506<=(x507>x508))); if (t119 != -128) { NG(); } else { ; } } void f120(void) { static uint64_t x509 = 144540940121LLU; int16_t x511 = INT16_MAX; int16_t x512 = -1; static volatile uint64_t t120 = 209385701728458LLU; t120 = (x509-(x510<=(x511>x512))); if (t120 != 144540940121LLU) { NG(); } else { ; } } void f121(void) { static volatile uint16_t x513 = UINT16_MAX; int16_t x514 = INT16_MAX; int8_t x515 = -1; static volatile int8_t x516 = 0; t121 = (x513-(x514<=(x515>x516))); if (t121 != 65535) { NG(); } else { ; } } void f122(void) { volatile uint8_t x518 = UINT8_MAX; int16_t x519 = 9436; volatile int16_t x520 = INT16_MIN; volatile int32_t t122 = 1594095; t122 = (x517-(x518<=(x519>x520))); if (t122 != -1) { NG(); } else { ; } } void f123(void) { uint64_t x521 = 974346181506627LLU; int64_t x522 = INT64_MIN; int64_t x523 = INT64_MAX; uint32_t x524 = 1281856U; uint64_t t123 = 334788499746LLU; t123 = (x521-(x522<=(x523>x524))); if (t123 != 974346181506626LLU) { NG(); } else { ; } } void f124(void) { uint64_t x525 = 3LLU; int32_t x526 = INT32_MIN; int32_t x527 = -3; uint64_t x528 = 4936286099865859095LLU; uint64_t t124 = 617LLU; t124 = (x525-(x526<=(x527>x528))); if (t124 != 2LLU) { NG(); } else { ; } } void f125(void) { int32_t x530 = -8; int8_t x531 = -1; volatile int64_t x532 = -12306375219150LL; int32_t t125 = 3957627; t125 = (x529-(x530<=(x531>x532))); if (t125 != 29) { NG(); } else { ; } } void f126(void) { volatile int16_t x533 = -2173; uint64_t x534 = 1581LLU; volatile int16_t x535 = INT16_MIN; volatile int8_t x536 = INT8_MIN; volatile int32_t t126 = 0; t126 = (x533-(x534<=(x535>x536))); if (t126 != -2173) { NG(); } else { ; } } void f127(void) { uint64_t x537 = UINT64_MAX; static uint8_t x538 = 101U; volatile uint64_t t127 = UINT64_MAX; t127 = (x537-(x538<=(x539>x540))); if (t127 != UINT64_MAX) { NG(); } else { ; } } void f128(void) { int16_t x541 = INT16_MIN; uint64_t x542 = UINT64_MAX; int16_t x543 = 7; int8_t x544 = INT8_MIN; volatile int32_t t128 = -8; t128 = (x541-(x542<=(x543>x544))); if (t128 != -32768) { NG(); } else { ; } } void f129(void) { int8_t x545 = INT8_MIN; static int32_t x547 = INT32_MAX; uint32_t x548 = 1U; volatile int32_t t129 = -12404136; t129 = (x545-(x546<=(x547>x548))); if (t129 != -129) { NG(); } else { ; } } void f130(void) { int64_t x550 = INT64_MIN; static volatile uint64_t x552 = 5011213LLU; t130 = (x549-(x550<=(x551>x552))); if (t130 != 25) { NG(); } else { ; } } void f131(void) { int8_t x553 = INT8_MIN; int16_t x556 = INT16_MIN; int32_t t131 = -17066094; t131 = (x553-(x554<=(x555>x556))); if (t131 != -128) { NG(); } else { ; } } void f132(void) { int64_t x557 = -1LL; volatile int32_t x558 = INT32_MIN; int32_t x559 = -1; static uint64_t x560 = 12401541LLU; int64_t t132 = 6608682618LL; t132 = (x557-(x558<=(x559>x560))); if (t132 != -2LL) { NG(); } else { ; } } void f133(void) { uint8_t x561 = UINT8_MAX; int16_t x563 = -165; static int64_t x564 = INT64_MIN; volatile int32_t t133 = 123465; t133 = (x561-(x562<=(x563>x564))); if (t133 != 255) { NG(); } else { ; } } void f134(void) { int64_t x565 = -814774332600LL; volatile int32_t x567 = INT32_MIN; static int8_t x568 = -35; int64_t t134 = 4842894LL; t134 = (x565-(x566<=(x567>x568))); if (t134 != -814774332600LL) { NG(); } else { ; } } void f135(void) { uint64_t x569 = 8897LLU; uint32_t x570 = UINT32_MAX; int8_t x571 = INT8_MIN; int8_t x572 = INT8_MAX; volatile uint64_t t135 = 4428230LLU; t135 = (x569-(x570<=(x571>x572))); if (t135 != 8897LLU) { NG(); } else { ; } } void f136(void) { int16_t x574 = INT16_MIN; int32_t x575 = INT32_MAX; static uint32_t x576 = 12U; volatile int32_t t136 = -402413623; t136 = (x573-(x574<=(x575>x576))); if (t136 != -2) { NG(); } else { ; } } void f137(void) { int64_t x578 = INT64_MAX; int64_t x579 = -1LL; static int32_t x580 = -3116989; static int32_t t137 = -70849; t137 = (x577-(x578<=(x579>x580))); if (t137 != 65535) { NG(); } else { ; } } void f138(void) { static uint32_t x581 = 1278311U; volatile int16_t x582 = INT16_MIN; volatile int32_t x583 = INT32_MIN; volatile int64_t x584 = -1LL; uint32_t t138 = 29708U; t138 = (x581-(x582<=(x583>x584))); if (t138 != 1278310U) { NG(); } else { ; } } void f139(void) { int32_t x585 = -641506; uint16_t x586 = 6U; int8_t x587 = 2; int16_t x588 = INT16_MIN; t139 = (x585-(x586<=(x587>x588))); if (t139 != -641506) { NG(); } else { ; } } void f140(void) { volatile int8_t x589 = INT8_MIN; volatile int16_t x590 = INT16_MIN; static int64_t x591 = INT64_MAX; volatile int16_t x592 = INT16_MAX; static volatile int32_t t140 = 5104; t140 = (x589-(x590<=(x591>x592))); if (t140 != -129) { NG(); } else { ; } } void f141(void) { int8_t x593 = -1; int64_t x595 = 2623968LL; int32_t x596 = INT32_MIN; int32_t t141 = -723471; t141 = (x593-(x594<=(x595>x596))); if (t141 != -1) { NG(); } else { ; } } void f142(void) { volatile uint64_t x597 = 2149400453467969808LLU; uint32_t x598 = 33731515U; int16_t x600 = INT16_MIN; volatile uint64_t t142 = 3251341810LLU; t142 = (x597-(x598<=(x599>x600))); if (t142 != 2149400453467969808LLU) { NG(); } else { ; } } void f143(void) { int16_t x602 = INT16_MIN; int8_t x603 = -1; uint32_t x604 = UINT32_MAX; t143 = (x601-(x602<=(x603>x604))); if (t143 != 62742175302064LL) { NG(); } else { ; } } void f144(void) { uint64_t x605 = UINT64_MAX; int8_t x606 = INT8_MIN; int64_t x607 = -1LL; int8_t x608 = 47; static uint64_t t144 = 26387820266704921LLU; t144 = (x605-(x606<=(x607>x608))); if (t144 != 18446744073709551614LLU) { NG(); } else { ; } } void f145(void) { int64_t x611 = INT64_MIN; int16_t x612 = INT16_MAX; volatile int64_t t145 = -691817LL; t145 = (x609-(x610<=(x611>x612))); if (t145 != 55684LL) { NG(); } else { ; } } void f146(void) { int16_t x613 = -1; volatile uint8_t x614 = UINT8_MAX; static volatile uint16_t x615 = UINT16_MAX; volatile uint32_t x616 = UINT32_MAX; int32_t t146 = -5; t146 = (x613-(x614<=(x615>x616))); if (t146 != -1) { NG(); } else { ; } } void f147(void) { int64_t x617 = -1LL; static int32_t x618 = INT32_MIN; int64_t t147 = -1LL; t147 = (x617-(x618<=(x619>x620))); if (t147 != -2LL) { NG(); } else { ; } } void f148(void) { uint32_t x621 = 11798U; volatile uint32_t x622 = 88249U; uint8_t x623 = 108U; static int32_t x624 = 59962; t148 = (x621-(x622<=(x623>x624))); if (t148 != 11798U) { NG(); } else { ; } } void f149(void) { int8_t x625 = 1; int8_t x626 = INT8_MAX; int16_t x627 = INT16_MIN; volatile uint8_t x628 = 0U; int32_t t149 = 5119; t149 = (x625-(x626<=(x627>x628))); if (t149 != 1) { NG(); } else { ; } } void f150(void) { static uint8_t x630 = 0U; static int64_t x631 = 606423218037206LL; int8_t x632 = 0; int32_t t150 = 428; t150 = (x629-(x630<=(x631>x632))); if (t150 != 7) { NG(); } else { ; } } void f151(void) { uint64_t x633 = 33777818102253060LLU; uint16_t x635 = 75U; static uint16_t x636 = 3U; volatile uint64_t t151 = 4446993184LLU; t151 = (x633-(x634<=(x635>x636))); if (t151 != 33777818102253060LLU) { NG(); } else { ; } } void f152(void) { uint8_t x637 = 23U; volatile int64_t x638 = INT64_MIN; int8_t x639 = INT8_MAX; int64_t x640 = -1LL; volatile int32_t t152 = -1; t152 = (x637-(x638<=(x639>x640))); if (t152 != 22) { NG(); } else { ; } } void f153(void) { uint64_t x641 = 2251819628263LLU; volatile int16_t x642 = INT16_MIN; volatile int16_t x643 = INT16_MIN; uint32_t x644 = 254U; uint64_t t153 = 3936512824LLU; t153 = (x641-(x642<=(x643>x644))); if (t153 != 2251819628262LLU) { NG(); } else { ; } } void f154(void) { static int32_t x645 = INT32_MIN; static int64_t x646 = INT64_MAX; int16_t x648 = 0; volatile int32_t t154 = INT32_MIN; t154 = (x645-(x646<=(x647>x648))); if (t154 != INT32_MIN) { NG(); } else { ; } } void f155(void) { int16_t x649 = INT16_MIN; static int64_t x650 = -1LL; int8_t x651 = -1; int64_t x652 = -1LL; volatile int32_t t155 = 7; t155 = (x649-(x650<=(x651>x652))); if (t155 != -32769) { NG(); } else { ; } } void f156(void) { static volatile int32_t x654 = INT32_MAX; int16_t x655 = INT16_MAX; volatile uint64_t t156 = 4715856251LLU; t156 = (x653-(x654<=(x655>x656))); if (t156 != 9LLU) { NG(); } else { ; } } void f157(void) { int32_t x657 = -31491184; uint8_t x658 = 2U; int8_t x660 = INT8_MIN; volatile int32_t t157 = 993883; t157 = (x657-(x658<=(x659>x660))); if (t157 != -31491184) { NG(); } else { ; } } void f158(void) { static uint16_t x661 = 142U; int8_t x662 = -1; uint32_t x663 = 53U; uint32_t x664 = UINT32_MAX; int32_t t158 = 5378368; t158 = (x661-(x662<=(x663>x664))); if (t158 != 141) { NG(); } else { ; } } void f159(void) { volatile uint32_t x665 = 7170492U; int64_t x668 = INT64_MIN; volatile uint32_t t159 = 760258U; t159 = (x665-(x666<=(x667>x668))); if (t159 != 7170492U) { NG(); } else { ; } } void f160(void) { static uint64_t x669 = 57800026336559LLU; volatile uint32_t x670 = 1709445692U; int8_t x671 = -1; int32_t x672 = -4383546; static volatile uint64_t t160 = 29432953135917LLU; t160 = (x669-(x670<=(x671>x672))); if (t160 != 57800026336559LLU) { NG(); } else { ; } } void f161(void) { int16_t x673 = INT16_MAX; int8_t x674 = INT8_MAX; volatile uint16_t x675 = 1845U; int16_t x676 = 313; int32_t t161 = 914662422; t161 = (x673-(x674<=(x675>x676))); if (t161 != 32767) { NG(); } else { ; } } void f162(void) { uint32_t x677 = 48753U; volatile int32_t x678 = 29739415; static int64_t x679 = -20793415LL; int8_t x680 = INT8_MIN; volatile uint32_t t162 = 3U; t162 = (x677-(x678<=(x679>x680))); if (t162 != 48753U) { NG(); } else { ; } } void f163(void) { int64_t x681 = INT64_MAX; uint8_t x682 = UINT8_MAX; t163 = (x681-(x682<=(x683>x684))); if (t163 != INT64_MAX) { NG(); } else { ; } } void f164(void) { uint16_t x685 = UINT16_MAX; uint64_t x686 = UINT64_MAX; static int8_t x687 = -1; int16_t x688 = INT16_MAX; int32_t t164 = 21948; t164 = (x685-(x686<=(x687>x688))); if (t164 != 65535) { NG(); } else { ; } } void f165(void) { volatile int64_t x690 = INT64_MAX; uint32_t x691 = UINT32_MAX; volatile uint32_t x692 = 1U; volatile int32_t t165 = INT32_MIN; t165 = (x689-(x690<=(x691>x692))); if (t165 != INT32_MIN) { NG(); } else { ; } } void f166(void) { volatile int64_t x693 = 59910LL; static uint32_t x694 = 86896U; static int64_t x695 = INT64_MAX; int32_t x696 = INT32_MIN; static int64_t t166 = 1LL; t166 = (x693-(x694<=(x695>x696))); if (t166 != 59910LL) { NG(); } else { ; } } void f167(void) { static uint8_t x697 = 0U; uint64_t x698 = UINT64_MAX; static int8_t x700 = INT8_MIN; volatile int32_t t167 = 129569827; t167 = (x697-(x698<=(x699>x700))); if (t167 != 0) { NG(); } else { ; } } void f168(void) { volatile uint16_t x701 = 2434U; int32_t x702 = INT32_MAX; volatile uint16_t x704 = 6824U; int32_t t168 = -8093702; t168 = (x701-(x702<=(x703>x704))); if (t168 != 2434) { NG(); } else { ; } } void f169(void) { int64_t x705 = INT64_MAX; int64_t x706 = 2642559LL; int64_t x707 = -1LL; volatile int32_t x708 = INT32_MIN; int64_t t169 = INT64_MAX; t169 = (x705-(x706<=(x707>x708))); if (t169 != INT64_MAX) { NG(); } else { ; } } void f170(void) { uint16_t x709 = 15335U; volatile int32_t x710 = -1; uint8_t x711 = UINT8_MAX; int8_t x712 = -2; static volatile int32_t t170 = 11593290; t170 = (x709-(x710<=(x711>x712))); if (t170 != 15334) { NG(); } else { ; } } void f171(void) { uint16_t x713 = UINT16_MAX; uint8_t x714 = 89U; uint8_t x715 = 0U; uint16_t x716 = 24U; int32_t t171 = 422414; t171 = (x713-(x714<=(x715>x716))); if (t171 != 65535) { NG(); } else { ; } } void f172(void) { int8_t x717 = 37; uint64_t x718 = 525498007103795074LLU; int8_t x719 = INT8_MIN; int16_t x720 = -1; volatile int32_t t172 = 64758; t172 = (x717-(x718<=(x719>x720))); if (t172 != 37) { NG(); } else { ; } } void f173(void) { int8_t x721 = INT8_MAX; int8_t x722 = INT8_MIN; uint32_t x723 = UINT32_MAX; volatile int8_t x724 = 3; static volatile int32_t t173 = 240099; t173 = (x721-(x722<=(x723>x724))); if (t173 != 126) { NG(); } else { ; } } void f174(void) { int64_t x725 = -1LL; uint16_t x726 = UINT16_MAX; int32_t x728 = INT32_MIN; int64_t t174 = -35467LL; t174 = (x725-(x726<=(x727>x728))); if (t174 != -1LL) { NG(); } else { ; } } void f175(void) { static volatile uint16_t x729 = 1U; static int8_t x730 = INT8_MIN; static int16_t x731 = INT16_MIN; int32_t x732 = 600549; static volatile int32_t t175 = 454; t175 = (x729-(x730<=(x731>x732))); if (t175 != 0) { NG(); } else { ; } } void f176(void) { int32_t x733 = INT32_MAX; int64_t x734 = -1LL; int32_t t176 = -234; t176 = (x733-(x734<=(x735>x736))); if (t176 != 2147483646) { NG(); } else { ; } } void f177(void) { volatile uint8_t x737 = 1U; static int16_t x738 = -5536; static int16_t x740 = -137; int32_t t177 = -946465771; t177 = (x737-(x738<=(x739>x740))); if (t177 != 0) { NG(); } else { ; } } void f178(void) { int16_t x741 = INT16_MAX; int64_t x742 = INT64_MIN; int8_t x743 = -1; int32_t x744 = INT32_MIN; static int32_t t178 = -46590; t178 = (x741-(x742<=(x743>x744))); if (t178 != 32766) { NG(); } else { ; } } void f179(void) { static volatile uint32_t x745 = 484159U; int32_t x746 = -5701; int8_t x747 = 42; uint8_t x748 = 26U; uint32_t t179 = 17011804U; t179 = (x745-(x746<=(x747>x748))); if (t179 != 484158U) { NG(); } else { ; } } void f180(void) { volatile uint64_t x749 = 538453034103LLU; static uint64_t x750 = 1121014094169865LLU; volatile uint32_t x752 = 1816122601U; volatile uint64_t t180 = 516052LLU; t180 = (x749-(x750<=(x751>x752))); if (t180 != 538453034103LLU) { NG(); } else { ; } } void f181(void) { static uint16_t x753 = 98U; int8_t x754 = 1; int8_t x755 = -1; uint8_t x756 = 4U; int32_t t181 = 6445553; t181 = (x753-(x754<=(x755>x756))); if (t181 != 98) { NG(); } else { ; } } void f182(void) { int64_t x758 = INT64_MAX; static uint8_t x759 = 3U; uint8_t x760 = 33U; volatile int32_t t182 = 474; t182 = (x757-(x758<=(x759>x760))); if (t182 != -1) { NG(); } else { ; } } void f183(void) { int16_t x761 = INT16_MIN; uint8_t x764 = UINT8_MAX; volatile int32_t t183 = -122; t183 = (x761-(x762<=(x763>x764))); if (t183 != -32769) { NG(); } else { ; } } void f184(void) { static int64_t x765 = 74711725111264LL; volatile int64_t x766 = INT64_MIN; int32_t x767 = -1; int32_t x768 = -1; volatile int64_t t184 = -1776691306346LL; t184 = (x765-(x766<=(x767>x768))); if (t184 != 74711725111263LL) { NG(); } else { ; } } void f185(void) { static volatile int32_t x769 = INT32_MAX; int8_t x770 = INT8_MIN; static int64_t x771 = -16297468548521046LL; volatile uint16_t x772 = UINT16_MAX; volatile int32_t t185 = 833503786; t185 = (x769-(x770<=(x771>x772))); if (t185 != 2147483646) { NG(); } else { ; } } void f186(void) { int64_t x773 = INT64_MIN; uint8_t x774 = 4U; volatile int64_t t186 = INT64_MIN; t186 = (x773-(x774<=(x775>x776))); if (t186 != INT64_MIN) { NG(); } else { ; } } void f187(void) { volatile int32_t x777 = INT32_MIN; int64_t x778 = 3289537146LL; int64_t x779 = -1LL; int64_t x780 = INT64_MAX; static volatile int32_t t187 = INT32_MIN; t187 = (x777-(x778<=(x779>x780))); if (t187 != INT32_MIN) { NG(); } else { ; } } void f188(void) { int64_t x781 = INT64_MAX; int16_t x782 = -57; int16_t x783 = -1; int8_t x784 = -14; static volatile int64_t t188 = 176258728312574702LL; t188 = (x781-(x782<=(x783>x784))); if (t188 != 9223372036854775806LL) { NG(); } else { ; } } void f189(void) { static uint32_t x785 = UINT32_MAX; volatile uint16_t x786 = UINT16_MAX; static int8_t x787 = -1; int16_t x788 = INT16_MIN; uint32_t t189 = UINT32_MAX; t189 = (x785-(x786<=(x787>x788))); if (t189 != UINT32_MAX) { NG(); } else { ; } } void f190(void) { volatile int32_t x789 = INT32_MAX; uint8_t x790 = 1U; int32_t x792 = INT32_MAX; static int32_t t190 = INT32_MAX; t190 = (x789-(x790<=(x791>x792))); if (t190 != INT32_MAX) { NG(); } else { ; } } void f191(void) { volatile uint64_t x793 = 152831911292181LLU; volatile int32_t x794 = INT32_MIN; static int64_t x795 = INT64_MIN; static uint64_t t191 = 3LLU; t191 = (x793-(x794<=(x795>x796))); if (t191 != 152831911292180LLU) { NG(); } else { ; } } void f192(void) { static volatile int16_t x797 = -1; int16_t x798 = -13; static int8_t x799 = -3; volatile int32_t x800 = INT32_MIN; t192 = (x797-(x798<=(x799>x800))); if (t192 != -2) { NG(); } else { ; } } void f193(void) { static int64_t x801 = -121058450901333295LL; volatile int64_t t193 = 194933744687010503LL; t193 = (x801-(x802<=(x803>x804))); if (t193 != -121058450901333296LL) { NG(); } else { ; } } void f194(void) { int16_t x806 = -1; int8_t x808 = -15; static int64_t t194 = 25LL; t194 = (x805-(x806<=(x807>x808))); if (t194 != -1759458858348LL) { NG(); } else { ; } } void f195(void) { int16_t x810 = INT16_MIN; int8_t x811 = INT8_MIN; volatile int32_t x812 = -250; int64_t t195 = -7462668LL; t195 = (x809-(x810<=(x811>x812))); if (t195 != 9223372036854775806LL) { NG(); } else { ; } } void f196(void) { int32_t x813 = -1; static volatile int64_t x814 = -61302392536659LL; static int32_t x815 = -1; int64_t x816 = INT64_MIN; int32_t t196 = 79; t196 = (x813-(x814<=(x815>x816))); if (t196 != -2) { NG(); } else { ; } } void f197(void) { int64_t x817 = -1LL; uint16_t x819 = 631U; volatile int8_t x820 = INT8_MIN; t197 = (x817-(x818<=(x819>x820))); if (t197 != -1LL) { NG(); } else { ; } } void f198(void) { static uint16_t x822 = 13402U; volatile uint32_t x823 = UINT32_MAX; static volatile int16_t x824 = INT16_MIN; int32_t t198 = -395065; t198 = (x821-(x822<=(x823>x824))); if (t198 != 65535) { NG(); } else { ; } } void f199(void) { int64_t x825 = -1LL; int16_t x826 = INT16_MIN; int32_t x827 = 93608719; int16_t x828 = INT16_MIN; volatile int64_t t199 = 3454312640925LL; t199 = (x825-(x826<=(x827>x828))); if (t199 != -2LL) { 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; }
19.009915
61
0.592467
60082431ad06e23f6eea290b69835dbab8d94fe4
445
h
C
SwipeCellKit/SwipeCellKit/ZASwipeCellKit.h
quehuy2012/SwipeableCollectionCell
48b25c6154d97e5dd80526807e26c25ea4aac68f
[ "MIT" ]
11
2018-03-12T09:50:57.000Z
2021-07-23T15:52:53.000Z
SwipeCellKit/SwipeCellKit/ZASwipeCellKit.h
quehuy2012/SwipeableCollectionCell
48b25c6154d97e5dd80526807e26c25ea4aac68f
[ "MIT" ]
null
null
null
SwipeCellKit/SwipeCellKit/ZASwipeCellKit.h
quehuy2012/SwipeableCollectionCell
48b25c6154d97e5dd80526807e26c25ea4aac68f
[ "MIT" ]
1
2018-05-07T06:44:47.000Z
2018-05-07T06:44:47.000Z
// // ZASwipeCellKit.h // SwipeCellKit // // Created by CPU11713 on 4/10/17. // Copyright © 2017 CPU11713. All rights reserved. // #ifndef ZASwipeCellKit_h #define ZASwipeCellKit_h #endif /* ZASwipeCellKit_h */ #import "ZASwipeCellOptions.h" #import "ZASwipeAction.h" #import "ZASwipeExpansionStyle.h" #import "ZASwipeTableCell.h" #import "ZASwipeCollectionCell.h" #import "ZAScaleTransition.h" #import "UICollectionView+SwipeCellKit.h"
20.227273
51
0.757303
13c86cc30e82c40552b8fc057c26483dcbe6d02f
14,370
h
C
sdk/sdk/include/fat/fat.h
doyaGu/C0501Q_HWJL01
07a71328bd9038453cbb1cf9c276a3dd1e416d63
[ "MIT" ]
1
2021-10-09T08:05:50.000Z
2021-10-09T08:05:50.000Z
sdk/sdk/include/fat/fat.h
doyaGu/C0501Q_HWJL01
07a71328bd9038453cbb1cf9c276a3dd1e416d63
[ "MIT" ]
null
null
null
sdk/sdk/include/fat/fat.h
doyaGu/C0501Q_HWJL01
07a71328bd9038453cbb1cf9c276a3dd1e416d63
[ "MIT" ]
null
null
null
#ifndef _FAT_H_ #define _FAT_H_ /**************************************************************************** * * Copyright (c) 2003-2008 by HCC Embedded * * This software is copyrighted by and is the sole property of * HCC. All rights, title, ownership, or other interests * in the software remain the property of HCC. This * software may only be used in accordance with the corresponding * license agreement. Any unauthorized use, duplication, transmission, * distribution, or disclosure of this software is expressly forbidden. * * This Copyright notice may not be removed or modified without prior * written consent of HCC. * * HCC reserves the right to modify this software without notice. * * HCC Embedded * Budapest 1133 * Vaci ut 110 * Hungary * * Tel: +36 (1) 450 1302 * Fax: +36 (1) 450 1303 * http: www.hcc-embedded.com * email: info@hcc-embedded.com * ***************************************************************************/ #ifdef __cplusplus extern "C" { #endif #include "udefs_f.h" #include "api_f.h" #include "chkdsk.h" /* F_DEF_SECTOR_SIZE is the default sector size which is always 512 */ #define F_DEF_SECTOR_SIZE 512 /* check whether FATCACHE_READAHEAD is set properly */ #if FATCACHE_READAHEAD*(F_MAX_SECTOR_SIZE/F_DEF_SECTOR_SIZE) > 256 #error The expression above cannot be more than 256 #endif typedef struct { unsigned char jump_code[3]; unsigned char OEM_name [8]; unsigned short bytes_per_sector; unsigned char sector_per_cluster; unsigned short reserved_sectors; unsigned char number_of_FATs; unsigned short max_root_entry; unsigned short number_of_sectors_less32; /* <32M */ unsigned char media_descriptor; unsigned short sector_per_FAT; unsigned short sector_per_Track; unsigned short number_of_heads; unsigned long number_of_hidden_sectors; unsigned long number_of_sectors; /* only on fat32 */ unsigned long sector_per_FAT32; unsigned short extflags; unsigned short fsversion; unsigned long rootcluster; unsigned short fsinfo; unsigned short bkbootsec; unsigned char reserved[12]; /* fat12-fat16-fat32 */ unsigned short logical_drive_num; unsigned char extended_signature; unsigned long serial_number; unsigned char volume_name[11]; unsigned char FAT_name[8]; unsigned char executable_marker[2]; } F_BOOTRECORD; /* number of sectors after mbr */ #define F_SPACE_AFTER_MBR 63 #if F_LONGFILENAME typedef struct { W_CHAR name[261]; /* with zero term */ unsigned char ord; unsigned char chksum; unsigned char state; unsigned long start; unsigned long end; } F_LFNINT; enum { /* 0 */ F_LFNSTATE_LFN, /* lfn is useable */ /* 1 */ F_LFNSTATE_SFN, /* lfn is useable, contains short filename */ /* 2 */ F_LFNSTATE_NEXT, /* lfn need more entry */ /* 3 */ F_LFNSTATE_INV /* invalid lfn */ }; #endif /* F_LONGFILENAME */ typedef struct { char name[F_MAXNAME]; /* 8+3 filename */ char ext[F_MAXEXT]; /* 8+3 extension */ unsigned char attr; /* 00ADVSHR */ unsigned char ntres; unsigned char crttimetenth; unsigned char crttime[2]; unsigned char crtdate[2]; unsigned char lastaccessdate[2]; unsigned char clusterhi[2]; /* FAT32 only */ unsigned char ctime[2]; unsigned char cdate[2]; unsigned char clusterlo[2]; /* fat12,fat16,fat32 */ unsigned char filesize[4]; } F_DIRENTRY; /* 1st char in 8+3 if entry is deleted*/ #define F_DELETED_CHAR ((char)0xe5) /* lower case name */ #define NTRES_SL_NAME 0x08 #define NTRES_SL_EXT 0x10 /* define for long filename entry in directory entry*/ #define F_ATTR_LFN (F_ATTR_VOLUME|F_ATTR_SYSTEM|F_ATTR_HIDDEN|F_ATTR_READONLY) #if F_LONGFILENAME typedef struct { unsigned char ord; unsigned char lfn_1; unsigned char lfnhi_1; unsigned char lfn_2; unsigned char lfnhi_2; unsigned char lfn_3; unsigned char lfnhi_3; unsigned char lfn_4; unsigned char lfnhi_4; unsigned char lfn_5; unsigned char lfnhi_5; unsigned char attr; /* 00ADVSHR */ unsigned char type; /* always 0 */ unsigned char chksum; unsigned char lfn_6; unsigned char lfnhi_6; unsigned char lfn_7; unsigned char lfnhi_7; unsigned char lfn_8; unsigned char lfnhi_8; unsigned char lfn_9; unsigned char lfnhi_9; unsigned char lfn_10; unsigned char lfnhi_10; unsigned char lfn_11; unsigned char lfnhi_11; unsigned char clusterlo[2]; /* fat12,fat16,fat32 */ unsigned char lfn_12; unsigned char lfnhi_12; unsigned char lfn_13; unsigned char lfnhi_13; } F_LFN; #endif /* F_LONGFILENAME */ /* definitions for FAT entry */ #define F_CLUSTER_FREE ((unsigned long)0x00000000) #define F_CLUSTER_RESERVED ((unsigned long)0x0ffffff0) #define F_CLUSTER_BAD ((unsigned long)0x0ffffff7) #define F_CLUSTER_LAST ((unsigned long)0x0ffffff8) #define F_CLUSTER_LASTF32R ((unsigned long)0x0fffffff) typedef struct { unsigned long sector; /* start sector */ unsigned long num; /* number of sectors */ } F_SECTOR; #if F_MAXFILES>0xffff /* maximum number of files */ #error F_MAXFILES should be less than 65535 #elif F_MAXFILES>0x7fff #define F_MAXFILES_SHIFT 16 #elif F_MAXFILES>0x3fff #define F_MAXFILES_SHIFT 15 #elif F_MAXFILES>0x1fff #define F_MAXFILES_SHIFT 14 #elif F_MAXFILES>0x0fff #define F_MAXFILES_SHIFT 13 #elif F_MAXFILES>0x07ff #define F_MAXFILES_SHIFT 12 #elif F_MAXFILES>0x03ff #define F_MAXFILES_SHIFT 11 #elif F_MAXFILES>0x01ff #define F_MAXFILES_SHIFT 10 #elif F_MAXFILES>0x00ff #define F_MAXFILES_SHIFT 9 #elif F_MAXFILES>0x007f #define F_MAXFILES_SHIFT 8 #elif F_MAXFILES>0x003f #define F_MAXFILES_SHIFT 7 #elif F_MAXFILES>0x001f #define F_MAXFILES_SHIFT 6 #elif F_MAXFILES>0x000f #define F_MAXFILES_SHIFT 5 #else #define F_MAXFILES_SHIFT 4 #endif /* definitions for FN_FILE internally used */ typedef struct { int N; char *ptr; #ifdef USE_MALLOC F_POS *pos; #else F_POS *pos; F_POS posbuf[WR_DATACACHE_SIZE]; #endif } t_WrDataCache; typedef struct FN_FILEINT FN_FILEINT; typedef struct FN_FILEINT { FN_FILE file; long modified; int drivenum; /* 0-A 1-B 2-C */ unsigned long abspos; unsigned long relpos; unsigned long filesize; unsigned char data[F_MAX_SECTOR_SIZE]; int datawritten; t_WrDataCache WrDataCache; unsigned long startcluster; F_POS pos; F_POS dirpos; long state; #if F_MAXSEEKPOS long seekpos[F_MAXSEEKPOS]; long seekprev[F_MAXSEEKPOS]; long seekshift; #endif FN_FILEINT *syncfile; char mode; char dummy[3]; #if F_FILE_CHANGED_EVENT char filename [FN_MAXPATH]; #endif } _FN_FILEINT; /* this bit signal if synchronization is required in append and read in state */ #define F_FILE_ST_SYNC 0x0001 #define F_FILE_ST_EOF 0x0002 typedef struct { unsigned long clfree; unsigned long clused; unsigned long clbad; } F_CLSPACE; #ifdef FATCACHE_ENABLE #define FATCACHE_SIZE (FATCACHE_BLOCKS*FATCACHE_READAHEAD) typedef struct { unsigned long sector; unsigned char modified; } t_CacheDsc; typedef struct { unsigned int N; /* number of sectors in the cache */ unsigned int Npos; /* position in the cache */ t_CacheDsc *dsc; #ifdef USE_MALLOC unsigned char *data; #else t_CacheDsc dsc_array[FATCACHE_SIZE*(F_MAX_SECTOR_SIZE/F_DEF_SECTOR_SIZE)]; unsigned char data[FATCACHE_SIZE*F_MAX_SECTOR_SIZE]; #endif } t_FatCache; #endif typedef struct { long state; F_BOOTRECORD bootrecord; F_SECTOR firstfat; F_SECTOR root; F_SECTOR data; #ifdef FATCACHE_ENABLE t_FatCache fatcache; unsigned char *fat; #else unsigned char fat[F_MAX_SECTOR_SIZE]; #endif unsigned long fatsector; long fatmodified; #if F_LONGFILENAME #ifdef DIRCACHE_ENABLE #ifdef USE_MALLOC unsigned char *dircache; #else unsigned char dircache[DIRCACHE_SIZE*F_MAX_SECTOR_SIZE]; #endif unsigned long dircache_start; unsigned long dircache_size; #endif #endif unsigned char direntry[F_MAX_SECTOR_SIZE]; unsigned long direntrysector; unsigned long lastalloccluster; #if USE_TASK_SEPARATED_CWD W_CHAR *cwd; /* current working folders in this volume points to task cwd */ #else W_CHAR cwd[FN_MAXPATH]; /* current working folders in this volume */ #endif long mediatype; F_CLSPACE clspace; /* calculated disk space */ char cspaceok; #if defined FATBITFIELD_ENABLE && defined USE_MALLOC unsigned char *fatbitfield; #endif int partition; unsigned long sectorstart; unsigned long sectornum; F_PHY phy; F_DRIVER *driver; unsigned char sectorbuffer[F_MAX_SECTOR_SIZE]; #if F_LONGFILENAME unsigned char pbitp[64]; #endif } F_VOLUME; #define F_FAT12_MAX_CLUSTER 0xFF0 #define F_FAT16_MAX_CLUSTER 0xFFF0 typedef struct { F_VOLUME volumes[FN_MAXVOLUME]; /* volumes */ FN_FILEINT files[F_MAXFILES]; unsigned long drvbldnum; /* drive build number for file.reference */ #if (!USE_TASK_SEPARATED_CWD) int f_curdrive; #endif } FN_FILESYSTEM; extern FN_FILESYSTEM f_filesystem; #if (!FN_CAPI_USED) typedef struct { long ID; /* task id */ #if USE_TASK_SEPARATED_CWD int f_curdrive; /* current drive */ struct { W_CHAR cwd[FN_MAXPATH]; /* current working folders in this volume */ } f_vols[FN_MAXVOLUME]; #endif FN_MUTEX_TYPE *pmutex; unsigned char current_bank; int lasterror; /* last error in this task */ } F_MULTI; #endif /* current file opening modes */ enum { /* 0 */ FN_FILE_CLOSE, /* 1 */ FN_FILE_RD, /* 2 */ FN_FILE_WR, /* 3 */ FN_FILE_A, /* 4 */ FN_FILE_RDP, /* 5 */ FN_FILE_WRP, /* 6 */ FN_FILE_AP, /* 7 */ FN_FILE_WRERR, /* 8 */ FN_FILE_LOCKED }; #define FN_FILE_ABORT_FLAG 0x40 /* signal for file is aborted */ /* current drive modes */ enum { /* 0 */ F_STATE_NONE, /* 1 */ F_STATE_NEEDMOUNT, /* 2 */ F_STATE_WORKING, /* 3 */ F_STATE_WORKING_WP //working but write protected }; /**************************************************************************** * * externed functions * ***************************************************************************/ extern int fn_delvolume (F_MULTI *fm,int drvnumber); extern int fn_get_volume_count (F_MULTI *fm); extern int fn_get_volume_list (F_MULTI *fm,int *buf); extern int fn_checkvolume(F_MULTI *fm,int drvnumber); extern int fn_format(F_MULTI *fm,int drivenum,long fattype); extern int fn_getcwd(F_MULTI *fm,char *buffer, int maxlen ); extern int fn_getdcwd(F_MULTI *fm,int drivenum, char *buffer, int maxlen ); extern int fn_chdrive(F_MULTI *fm,int drivenum); extern int fn_getdrive(F_MULTI *fm); extern int fn_getfreespace(F_MULTI *fm,int drivenum, FN_SPACE *pspace); extern int fn_chdir(F_MULTI *fm,const char *dirname); extern int fn_mkdir(F_MULTI *fm,const char *dirname); extern int fn_rmdir(F_MULTI *fm,const char *dirname); extern int fn_findfirst(F_MULTI *fm,const char *filename,FN_FIND *find); extern int fn_findnext(F_MULTI *fm,FN_FIND *find); extern int fn_rename(F_MULTI *fm,const char *filename, const char *newname); extern int fn_move(F_MULTI *fm,const char *filename, const char *newname); extern long fn_filelength(F_MULTI *fm,const char *filename); extern int fn_close(F_MULTI *fm,FN_FILE *filehandle); extern int fn_flush(F_MULTI *fm,FN_FILE *file); extern FN_FILE *fn_open(F_MULTI *fm,const char *filename,const char *mode); extern FN_FILE *fn_truncate(F_MULTI *fm,const char *filename,unsigned long length); extern long fn_read(F_MULTI *fm,void *buf,long size,long size_st,FN_FILE *filehandle); extern long fn_write(F_MULTI *fm,const void *buf,long size,long size_st,FN_FILE *filehandle); extern int fn_seek(F_MULTI *fm,FN_FILE *filehandle,long offset,long whence); extern int fn_seteof(F_MULTI *fm,FN_FILE *filehandle); extern long fn_tell(F_MULTI *fm,FN_FILE *filehandle); extern int fn_getc(F_MULTI *fm,FN_FILE *filehandle); extern int fn_putc(F_MULTI *fm,int ch,FN_FILE *filehandle); extern int fn_rewind(F_MULTI *fm,FN_FILE *filehandle); extern int fn_eof(F_MULTI*,FN_FILE *filehandle); extern int fn_gettimedate(F_MULTI *fm,const char *filename,unsigned short *pctime,unsigned short *pcdate); extern int fn_settimedate(F_MULTI *fm,const char *filename,unsigned short ctime,unsigned short cdate); extern int fn_delete(F_MULTI *fm,const char *filename, unsigned char delcontent); extern int fn_stat(F_MULTI *fm,const char *filename,F_STAT *stat); extern int fn_getattr(F_MULTI *fm,const char *filename,unsigned char *attr); extern int fn_setattr(F_MULTI *fm,const char *filename,unsigned char attr); extern int fn_getlabel(F_MULTI *fm,int drivenum, char *label, long len); extern int fn_setlabel(F_MULTI *fm,int drivenum, const char *label); extern int fn_get_oem(F_MULTI *fm, int drivenum, char *str, long maxlen); #ifdef HCC_UNICODE extern int fn_wgetcwd(F_MULTI *fm,wchar *buffer, int maxlen ); extern int fn_wgetdcwd(F_MULTI *fm,int drivenum, wchar *buffer, int maxlen ); extern int fn_wchdir(F_MULTI *fm,const wchar *dirname); extern int fn_wmkdir(F_MULTI *fm,const wchar *dirname); extern int fn_wrmdir(F_MULTI *fm,const wchar *dirname); extern int fn_wfindfirst(F_MULTI *fm,const wchar *filename,FN_WFIND *find); extern int fn_wfindnext(F_MULTI *fm,FN_WFIND *find); extern int fn_wrename(F_MULTI *fm,const wchar *filename, const wchar *newname); extern int fn_wmove(F_MULTI *fm,const wchar *filename, const wchar *newname); extern long fn_wfilelength(F_MULTI *fm,const wchar *filename); extern FN_FILE *fn_wopen(F_MULTI *fm,const wchar *filename,const wchar *mode); extern FN_FILE *fn_wtruncate(F_MULTI *fm,const wchar *filename,unsigned long length); extern int fn_wstat(F_MULTI *fm,const wchar *filename,F_STAT *stat); extern int fn_wgettimedate(F_MULTI *fm,const wchar *filename,unsigned short *pctime,unsigned short *pcdate); extern int fn_wsettimedate(F_MULTI *fm,const wchar *filename,unsigned short ctime,unsigned short cdate); extern int fn_wdelete(F_MULTI *fm,const wchar *filename,unsigned char delcontent); extern int fn_wgetattr(F_MULTI *fm,const wchar *filename,unsigned char *attr); extern int fn_wsetattr(F_MULTI *fm,const wchar *filename,unsigned char attr); #endif #include "fat_m.h" #define _f_toupper(ch) (((ch)>='a' && (ch)<='z') ? ((ch)-'a'+'A') : (ch)) #ifdef HCC_UNICODE extern wchar *_towchar(wchar *nconv, const char *s); #endif extern int _f_addentry(F_VOLUME *vi,F_NAME *fsname,F_POS *pos,F_DIRENTRY **pde); extern int _f_getdirsector(F_VOLUME *vi,unsigned long sector); #ifdef __cplusplus } #endif /**************************************************************************** * * end of fat.h * ***************************************************************************/ #endif /* _FAT_H_ */
26.759777
108
0.734238
ffe5a38d7ed32cc3244b669ad01b8519dcf7191e
11,758
h
C
OpenHome/Net/Bindings/C/Device/Providers/DvAvOpenhomeOrgExakt1.h
kmuellerjones/ohNetGenerated
2bb32625c9ab49e17ba84ec40cc4046ec09182f3
[ "MIT" ]
1
2017-01-06T15:34:03.000Z
2017-01-06T15:34:03.000Z
OpenHome/Net/Bindings/C/Device/Providers/DvAvOpenhomeOrgExakt1.h
kmuellerjones/ohNetGenerated
2bb32625c9ab49e17ba84ec40cc4046ec09182f3
[ "MIT" ]
5
2016-01-05T09:47:15.000Z
2018-12-16T14:07:35.000Z
OpenHome/Net/Bindings/C/Device/Providers/DvAvOpenhomeOrgExakt1.h
kmuellerjones/ohNetGenerated
2bb32625c9ab49e17ba84ec40cc4046ec09182f3
[ "MIT" ]
6
2015-04-08T18:50:36.000Z
2021-04-14T13:41:15.000Z
/** * Provider for the av.openhome.org:Exakt:1 UPnP service */ #ifndef HEADER_DVAVOPENHOMEORGEXAKT1_C #define HEADER_DVAVOPENHOMEORGEXAKT1_C #include <OpenHome/Defines.h> #include <OpenHome/OsTypes.h> #include <OpenHome/Net/C/DvDevice.h> #include <OpenHome/Net/C/DvInvocation.h> #ifdef __cplusplus extern "C" { #endif /** * @addtogroup DvProviderAvOpenhomeOrgExakt1 * @ingroup Providers * @{ */ /** * Callback which runs when the DeviceList action is invoked * * @param[in] aPtr Opaque data passed to DvProviderAvOpenhomeOrgExakt1EnableActionDeviceList * @param[in] aInvocation Table of function pointers allowing access to the version of the service being used * and other queries. * @param[in] aInvocationPtr aPtr argument to all functions contained in aInvocation. * @param[out] aList * * @return 0 if the action succeeded; non-zero if the action failed */ typedef int32_t (STDCALL *CallbackExakt1DeviceList)(void* aPtr, IDvInvocationC* aInvocation, void* aInvocationPtr, char** aList); /** * Callback which runs when the DeviceSettings action is invoked * * @param[in] aPtr Opaque data passed to DvProviderAvOpenhomeOrgExakt1EnableActionDeviceSettings * @param[in] aInvocation Table of function pointers allowing access to the version of the service being used * and other queries. * @param[in] aInvocationPtr aPtr argument to all functions contained in aInvocation. * @param[in] aDeviceId * @param[out] aSettings * * @return 0 if the action succeeded; non-zero if the action failed */ typedef int32_t (STDCALL *CallbackExakt1DeviceSettings)(void* aPtr, IDvInvocationC* aInvocation, void* aInvocationPtr, const char* aDeviceId, char** aSettings); /** * Callback which runs when the ConnectionStatus action is invoked * * @param[in] aPtr Opaque data passed to DvProviderAvOpenhomeOrgExakt1EnableActionConnectionStatus * @param[in] aInvocation Table of function pointers allowing access to the version of the service being used * and other queries. * @param[in] aInvocationPtr aPtr argument to all functions contained in aInvocation. * @param[out] aConnectionStatus * * @return 0 if the action succeeded; non-zero if the action failed */ typedef int32_t (STDCALL *CallbackExakt1ConnectionStatus)(void* aPtr, IDvInvocationC* aInvocation, void* aInvocationPtr, char** aConnectionStatus); /** * Callback which runs when the Set action is invoked * * @param[in] aPtr Opaque data passed to DvProviderAvOpenhomeOrgExakt1EnableActionSet * @param[in] aInvocation Table of function pointers allowing access to the version of the service being used * and other queries. * @param[in] aInvocationPtr aPtr argument to all functions contained in aInvocation. * @param[in] aDeviceId * @param[in] aBankId * @param[in] aFileUri * @param[in] aMute * @param[in] aPersist * * @return 0 if the action succeeded; non-zero if the action failed */ typedef int32_t (STDCALL *CallbackExakt1Set)(void* aPtr, IDvInvocationC* aInvocation, void* aInvocationPtr, const char* aDeviceId, uint32_t aBankId, const char* aFileUri, uint32_t aMute, uint32_t aPersist); /** * Callback which runs when the Reprogram action is invoked * * @param[in] aPtr Opaque data passed to DvProviderAvOpenhomeOrgExakt1EnableActionReprogram * @param[in] aInvocation Table of function pointers allowing access to the version of the service being used * and other queries. * @param[in] aInvocationPtr aPtr argument to all functions contained in aInvocation. * @param[in] aDeviceId * @param[in] aFileUri * * @return 0 if the action succeeded; non-zero if the action failed */ typedef int32_t (STDCALL *CallbackExakt1Reprogram)(void* aPtr, IDvInvocationC* aInvocation, void* aInvocationPtr, const char* aDeviceId, const char* aFileUri); /** * Callback which runs when the ReprogramFallback action is invoked * * @param[in] aPtr Opaque data passed to DvProviderAvOpenhomeOrgExakt1EnableActionReprogramFallback * @param[in] aInvocation Table of function pointers allowing access to the version of the service being used * and other queries. * @param[in] aInvocationPtr aPtr argument to all functions contained in aInvocation. * @param[in] aDeviceId * @param[in] aFileUri * * @return 0 if the action succeeded; non-zero if the action failed */ typedef int32_t (STDCALL *CallbackExakt1ReprogramFallback)(void* aPtr, IDvInvocationC* aInvocation, void* aInvocationPtr, const char* aDeviceId, const char* aFileUri); /** * Provider constructor * * @param[in] aDevice Handle returned by DvDeviceCreate[NoResources] * * @return Handle to this provider */ DllExport THandle STDCALL DvProviderAvOpenhomeOrgExakt1Create(DvDeviceC aDevice); /** * Provider destructor * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1Destroy(THandle aProvider); /** * Enable the DeviceList property. */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnablePropertyDeviceList(THandle aProvider); /** * Enable the ConnectionStatus property. */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnablePropertyConnectionStatus(THandle aProvider); /** * Register a callback for the action DeviceList * * If this is called, the action's availability will be published in the device's service.xml. * If this is not called, any attempt to invoke the action on a control point will fail. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aCallback Callback which will be run when the action is invoked * @param[in] aPtr Client-specified data which will be passed to the callback */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnableActionDeviceList(THandle aProvider, CallbackExakt1DeviceList aCallback, void* aPtr); /** * Register a callback for the action DeviceSettings * * If this is called, the action's availability will be published in the device's service.xml. * If this is not called, any attempt to invoke the action on a control point will fail. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aCallback Callback which will be run when the action is invoked * @param[in] aPtr Client-specified data which will be passed to the callback */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnableActionDeviceSettings(THandle aProvider, CallbackExakt1DeviceSettings aCallback, void* aPtr); /** * Register a callback for the action ConnectionStatus * * If this is called, the action's availability will be published in the device's service.xml. * If this is not called, any attempt to invoke the action on a control point will fail. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aCallback Callback which will be run when the action is invoked * @param[in] aPtr Client-specified data which will be passed to the callback */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnableActionConnectionStatus(THandle aProvider, CallbackExakt1ConnectionStatus aCallback, void* aPtr); /** * Register a callback for the action Set * * If this is called, the action's availability will be published in the device's service.xml. * If this is not called, any attempt to invoke the action on a control point will fail. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aCallback Callback which will be run when the action is invoked * @param[in] aPtr Client-specified data which will be passed to the callback */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnableActionSet(THandle aProvider, CallbackExakt1Set aCallback, void* aPtr); /** * Register a callback for the action Reprogram * * If this is called, the action's availability will be published in the device's service.xml. * If this is not called, any attempt to invoke the action on a control point will fail. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aCallback Callback which will be run when the action is invoked * @param[in] aPtr Client-specified data which will be passed to the callback */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnableActionReprogram(THandle aProvider, CallbackExakt1Reprogram aCallback, void* aPtr); /** * Register a callback for the action ReprogramFallback * * If this is called, the action's availability will be published in the device's service.xml. * If this is not called, any attempt to invoke the action on a control point will fail. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aCallback Callback which will be run when the action is invoked * @param[in] aPtr Client-specified data which will be passed to the callback */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1EnableActionReprogramFallback(THandle aProvider, CallbackExakt1ReprogramFallback aCallback, void* aPtr); /** * Set the value of the DeviceList property * * Can only be called if DvProviderAvOpenhomeOrgExakt1EnablePropertyDeviceList has previously been called. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aValue New value for the property (will be copied) * @param[out] aChanged 1 if the value has been updated; 0 if it was the same as the previous value * * @return 0 if the property was successfully set; non-zero if there was an error (including * an attempt to set a property to a value not in its allowed range/set) */ DllExport int32_t STDCALL DvProviderAvOpenhomeOrgExakt1SetPropertyDeviceList(THandle aProvider, const char* aValue, uint32_t* aChanged); /** * Get a copy of the value of the DeviceList property * * Can only be called if DvProviderAvOpenhomeOrgExakt1EnablePropertyDeviceList has previously been called. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[out] aValue Value for the property. Caller is responsible for freeing this. */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1GetPropertyDeviceList(THandle aProvider, char** aValue); /** * Set the value of the ConnectionStatus property * * Can only be called if DvProviderAvOpenhomeOrgExakt1EnablePropertyConnectionStatus has previously been called. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[in] aValue New value for the property (will be copied) * @param[out] aChanged 1 if the value has been updated; 0 if it was the same as the previous value * * @return 0 if the property was successfully set; non-zero if there was an error (including * an attempt to set a property to a value not in its allowed range/set) */ DllExport int32_t STDCALL DvProviderAvOpenhomeOrgExakt1SetPropertyConnectionStatus(THandle aProvider, const char* aValue, uint32_t* aChanged); /** * Get a copy of the value of the ConnectionStatus property * * Can only be called if DvProviderAvOpenhomeOrgExakt1EnablePropertyConnectionStatus has previously been called. * * @param[in] aProvider Handle returned by DvProviderAvOpenhomeOrgExakt1Create * @param[out] aValue Value for the property. Caller is responsible for freeing this. */ DllExport void STDCALL DvProviderAvOpenhomeOrgExakt1GetPropertyConnectionStatus(THandle aProvider, char** aValue); /* @} */ #ifdef __cplusplus } // extern "C" #endif #endif // HEADER_DVAVOPENHOMEORGEXAKT1_C
47.603239
206
0.760844
4df937a1139b4de443f20ff39e2bc4a986adb634
2,296
h
C
mulib.h
rdpoor/mulib
87d4bc5e54a0e147392fdd3c5ca250eec8ecb37f
[ "MIT" ]
5
2020-06-14T05:04:47.000Z
2020-12-02T22:11:30.000Z
mulib.h
rdpoor/mulib
87d4bc5e54a0e147392fdd3c5ca250eec8ecb37f
[ "MIT" ]
null
null
null
mulib.h
rdpoor/mulib
87d4bc5e54a0e147392fdd3c5ca250eec8ecb37f
[ "MIT" ]
1
2020-01-19T09:08:35.000Z
2020-01-19T09:08:35.000Z
/** * MIT License * * Copyright (c) 2020 R. Dunbar Poor <rdpoor@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _MULIB_H_ #define _MULIB_H_ #ifdef __cplusplus extern "C" { #endif // ============================================================================= // includes #include "mu_config.h" #include "core/mu_bvec.h" #include "core/mu_cirq.h" #include "core/mu_dlist.h" #include "core/mu_fsm.h" #include "core/mu_list.h" #include "core/mu_log.h" #include "core/mu_pstore.h" #include "core/mu_queue.h" #include "core/mu_sched.h" #include "core/mu_spsc.h" #include "core/mu_str.h" #include "core/mu_strbuf.h" #include "core/mu_task.h" #include "core/mu_thunk.h" #include "core/mu_timer.h" #include "core/mu_vect.h" #include "core/mu_version.h" #include "extras/mu_rfc_1123.h" #include "extras/mu_random.h" // ============================================================================= // types and definitions // ============================================================================= // declarations /** * @brief Initialize the mulib system. * * This function should be called once at startup before calling any mulib * functions. */ void mulib_init(void); #ifdef __cplusplus } #endif #endif /* #ifndef _MULIB_H_ */
29.818182
80
0.664634
7fa80c8f163bca4f09673f5373b1e81259102553
1,570
h
C
src/canvas.h
icekarma/fstl
3f8cf087d524d9397e7a761d71710ad2fd1425d9
[ "Unlicense" ]
2
2021-04-07T05:41:19.000Z
2022-03-27T02:16:59.000Z
src/canvas.h
nnadeau/fstl
633504e693606c0cc7d88e45ae90f11ef1c89b7f
[ "Unlicense" ]
null
null
null
src/canvas.h
nnadeau/fstl
633504e693606c0cc7d88e45ae90f11ef1c89b7f
[ "Unlicense" ]
2
2019-12-04T04:32:32.000Z
2020-08-12T06:45:48.000Z
#ifndef CANVAS_H #define CANVAS_H #include <QtOpenGL> #include <QSurfaceFormat> #include <QOpenGLShaderProgram> class GLMesh; class Mesh; class Backdrop; class Canvas : public QOpenGLWidget, protected QOpenGLFunctions { Q_OBJECT public: explicit Canvas(const QSurfaceFormat& format, QWidget* parent=0); ~Canvas(); void view_orthographic(); void view_perspective(); void draw_shaded(); void draw_wireframe(); public slots: void set_status(const QString& s); void clear_status(); void load_mesh(Mesh* m, bool is_reload); protected: void paintGL() override; void initializeGL() override; void resizeGL(int width, int height) override; void mousePressEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override; void mouseMoveEvent(QMouseEvent* event) override; void wheelEvent(QWheelEvent* event) override; void set_perspective(float p); void set_drawMode(int mode); void view_anim(float v); private: void draw_mesh(); QMatrix4x4 transform_matrix() const; QMatrix4x4 view_matrix() const; QOpenGLShaderProgram mesh_shader; QOpenGLShaderProgram mesh_wireframe_shader; QOpenGLShaderProgram quad_shader; GLMesh* mesh; Backdrop* backdrop; QVector3D center; float scale; float zoom; float tilt; float yaw; float perspective; int drawMode; Q_PROPERTY(float perspective MEMBER perspective WRITE set_perspective); QPropertyAnimation anim; QPoint mouse_pos; QString status; }; #endif // CANVAS_H
21.506849
75
0.729299
3d1cce241bbf9a0b86cbd4c5a2123ca3b1de227b
4,271
h
C
solver/Loandra/algorithms/Alg_OLL.h
ADDALemos/train-schedule-optimisation
333f52e7734dd4b53f1075422ef504076483d63c
[ "MIT" ]
null
null
null
solver/Loandra/algorithms/Alg_OLL.h
ADDALemos/train-schedule-optimisation
333f52e7734dd4b53f1075422ef504076483d63c
[ "MIT" ]
null
null
null
solver/Loandra/algorithms/Alg_OLL.h
ADDALemos/train-schedule-optimisation
333f52e7734dd4b53f1075422ef504076483d63c
[ "MIT" ]
null
null
null
/*! * \author Ruben Martins - ruben@sat.inesc-id.pt * * @section LICENSE * * Open-WBO, Copyright (c) 2013-2017, Ruben Martins, Vasco Manquinho, Ines Lynce * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #ifndef Alg_OLL_h #define Alg_OLL_h #ifdef SIMP #include "simp/SimpSolver.h" #else #include "core/Solver.h" #endif #include "../Encoder.h" #include "../MaxSAT.h" #include <map> #include <set> namespace openwbo { //================================================================================================= class OLL : public MaxSAT { public: OLL(int verb = _VERBOSITY_MINIMAL_, int enc = _CARD_TOTALIZER_) { solver = NULL; verbosity = verb; incremental_strategy = _INCREMENTAL_ITERATIVE_; encoding = enc; encoder.setCardEncoding(enc); min_weight = 1; } ~OLL() { if (solver != NULL) delete solver; } StatusCode search(); void getConflict(){ for (int i = 0; i <solver->errorP.size() ; ++i) { errorP.push(solver->errorP[i]); } } // Print solver configuration. void printConfiguration() { if(!print) return; printf("c ==========================================[ Solver Settings " "]============================================\n"); printf("c | " " |\n"); printf("c | Algorithm: %23s " " |\n", "OLL"); print_Card_configuration(encoding); printf("c | " " |\n"); } protected: // Rebuild MaxSAT solver // Solver *rebuildSolver(); // Rebuild MaxSAT solver. // Other void initRelaxation(); // Relaxes soft clauses. StatusCode unweighted(); StatusCode weighted(); Solver *solver; // SAT Solver used as a black box. Encoder encoder; // Interface for the encoder of constraints to CNF. // Controls the incremental strategy used by MSU3 algorithms. int incremental_strategy; // Controls the cardinality encoding used by MSU3 algorithms. int encoding; // Literals to be used in the constraint that excludes models. vec<Lit> objFunction; vec<uint64_t> coeffs; // Coefficients of the literals that are used in the // constraint that excludes models. std::map<Lit, int> coreMapping; // Mapping between the assumption literal and // the respective soft clause. std::map<Lit, int> coreCardinality; // Mapping between the assumption literal and // the respective soft clause. // lit -> <ID, bound, weight> std::map<Lit, std::pair<std::pair<int, uint64_t>, uint64_t>> boundMapping; // Soft clauses that are currently in the MaxSAT formula. vec<bool> activeSoft; uint64_t findNextWeightDiversity(uint64_t weight, std::set<Lit> &cardinality_assumptions); uint64_t findNextWeight(uint64_t weight, std::set<Lit> &cardinality_assumptions); uint64_t min_weight; }; } // namespace openwbo #endif
32.112782
99
0.595645
2cfa1730bdb1fc61729484b2fa7f747ef7dc2fa5
15,533
h
C
svn_sensor/sw_f373/trunk/lib/libopencm3/stm32/f3/dac.h
GliderWinchItems/embed
cc72aa7d8208db3871a15e38185e1e125fa7de47
[ "MIT" ]
1
2019-07-18T07:22:19.000Z
2019-07-18T07:22:19.000Z
svn_sensor/sw_f373/trunk/lib/libopencm3/stm32/f3/dac.h
GliderWinchItems/embed
cc72aa7d8208db3871a15e38185e1e125fa7de47
[ "MIT" ]
null
null
null
svn_sensor/sw_f373/trunk/lib/libopencm3/stm32/f3/dac.h
GliderWinchItems/embed
cc72aa7d8208db3871a15e38185e1e125fa7de47
[ "MIT" ]
2
2019-04-03T01:44:46.000Z
2020-04-01T07:41:41.000Z
/** @defgroup STM32F_dac_defines DAC Defines @brief <b>libopencm3 Defined Constants and Types for the STM32F Digital to Analog Converter </b> @ingroup STM32F_defines @version 1.0.0 @author @htmlonly &copy; @endhtmlonly 2012 Felix Held <felix-libopencm3@felixheld.de> @author @htmlonly &copy; @endhtmlonly 2012 Ken Sarkies @date 18 August 2012 LGPL License Terms @ref lgpl_license */ /* * This file is part of the libopencm3 project. * * Copyright (C) 2012 Felix Held <felix-libopencm3@felixheld.de> * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ /**@{*/ /* NOTE-- DAC2 Channel 2 is not implemented on the F373, only DAC1 CHannel 1 implemented on the F372 */ #ifndef LIBOPENCM3_DAC_H #define LIBOPENCM3_DAC_H #include <libopencm3/stm32/memorymap.h> #include <libopencm3/cm3/common.h> /* DAC registers base adresses (for convenience) */ #define DAC1 DAC1_BASE #define DAC2 DAC2_BASE /* --- DAC registers p 251 ------------------------------------------------------- */ /* DAC control register (DAC_CR) p 265 */ #define DAC1_CR MMIO32(DAC1_BASE + 0x00) #define DAC2_CR MMIO32(DAC2_BASE + 0x00) /* DAC software trigger register (DAC_SWTRIGR) p 268 */ #define DAC1_SWTRIGR MMIO32(DAC1_BASE + 0x04) #define DAC2_SWTRIGR MMIO32(DAC2_BASE + 0x04) /* DAC channel1 12-bit right-aligned data holding register (DAC_DHR12R1) p 268 */ #define DAC1_DHR12R1 MMIO32(DAC1_BASE + 0x08) #define DAC2_DHR12R1 MMIO32(DAC2_BASE + 0x08) /* DAC channel1 12-bit left aligned data holding register (DAC_DHR12L1) p 269 */ #define DAC1_DHR12L1 MMIO32(DAC1_BASE + 0x0C) #define DAC2_DHR12L1 MMIO32(DAC2_BASE + 0x0C) /* DAC channel1 8-bit right aligned data holding register (DAC_DHR8R1) p 269 */ #define DAC1_DHR8R1 MMIO32(DAC1_BASE + 0x10) #define DAC2_DHR8R1 MMIO32(DAC2_BASE + 0x10) /* DAC channel2 12-bit right aligned data holding register(DAC_DHR12R2) p 269, 270 */ #define DAC1_DHR12R2 MMIO32(DAC1_BASE + 0x14) /* DAC channel2 12-bit left aligned data holding register (DAC_DHR12L2) p 270 */ #define DAC1_DHR12L2 MMIO32(DAC1_BASE + 0x18) /* DAC channel2 8-bit right-aligned data holding register (DAC_DHR8R2) p 270 */ #define DAC1_DHR8R2 MMIO32(DAC1_BASE + 0x1C) /* Dual DAC 12-bit right-aligned data holding register (DAC_DHR12RD) p 271 */ #define DAC1_DHR12RD MMIO32(DAC_BASE + 0x20) /* DUAL DAC 12-bit left aligned data holding register (DAC_DHR12LD) p 271 */ #define DAC1_DHR12LD MMIO32(DAC_BASE + 0x24) /* DUAL DAC 8-bit right aligned data holding register (DAC_DHR8RD) p 272 */ #define DAC1_DHR8RD MMIO32(DAC1_BASE + 0x28) #define DAC2_DHR8RD MMIO32(DAC2_BASE + 0x28) /* DAC channel1 data output register (DAC_DOR1) p 271 */ #define DAC1_DOR1 MMIO32(DAC1_BASE + 0x2C) #define DAC2_DOR1 MMIO32(DAC2_BASE + 0x2C) /* DAC channel2 data output register (DAC_DOR2) p 272, 273 */ #define DAC1_DOR2 MMIO32(DAC1_BASE + 0x30) #define DAC2_DOR2 MMIO32(DAC2_BASE + 0x30) /* DAC status register (DAC_SR) p 273 */ #define DAC1_SR MMIO32(DAC1_BASE + 0x34) #define DAC2_SR MMIO32(DAC2_BASE + 0x34) /* --- DAC_CR values p 265 ------------------------------------------------------- */ /* DMAUDRIE2: DAC channel2 DMA underrun interrupt enable */ /* doesn't exist in most members of the STM32F1 family */ #define DAC_CR_DMAUDRIE2 (1 << 29) /* DMAEN2: DAC channel2 DMA enable */ #define DAC_CR_DMAEN2 (1 << 28) /* MAMP2[3:0]: DAC channel2 mask/amplitude selector */ /* DAC_CR_MAMP2_n: * Unmask bits [(n-1)..0] of LFSR/Triangle Amplitude equal to (2**n)-1 */ #define DAC_CR_MAMP2_SHIFT 24 /** @defgroup dac_mamp2 DAC Channel 2 LFSR Mask and Triangle Wave Amplitude values @ingroup STM32F_dac_defines Unmask bits [(n-1)..0] of LFSR/Triangle Amplitude equal to (2**(n)-1 @{*/ #define DAC_CR_MAMP2_1 (0x0 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_2 (0x1 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_3 (0x2 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_4 (0x3 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_5 (0x4 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_6 (0x5 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_7 (0x6 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_8 (0x7 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_9 (0x8 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_10 (0x9 << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_11 (0xA << DAC_CR_MAMP2_SHIFT) #define DAC_CR_MAMP2_12 (0xB << DAC_CR_MAMP2_SHIFT) /**@}*/ /* WAVE2[1:0]: DAC channel2 noise/triangle wave generation enable */ /* Legend: * DIS: wave generation disabled * NOISE: Noise wave generation enabled * TRI: Triangle wave generation enabled * * Note: only used if bit TEN2 = 1 (DAC channel2 trigger enabled) */ #define DAC_CR_WAVE2_SHIFT 22 #define DAC_CR_WAVE2_DIS (0x3 << DAC_CR_WAVE2_SHIFT) /** @defgroup dac_wave2_en DAC Channel 2 Waveform Generation Enable @ingroup STM32F_dac_defines @li NOISE: Noise wave generation enabled @li TRI: Triangle wave generation enabled @note: only used if bit TEN2 is set (DAC channel2 trigger enabled) @{*/ #define DAC_CR_WAVE2_NOISE (0x1 << DAC_CR_WAVE2_SHIFT) #define DAC_CR_WAVE2_TRI (0x2 << DAC_CR_WAVE2_SHIFT) /**@}*/ /* TSEL2[2:0]: DAC channel2 trigger selection */ /* Legend: * * T6: Timer 6 TRGO event * T3: Timer 3 TRGO event * T8: Timer 8 TRGO event * T7: Timer 7 TRGO event * T5: Timer 5 TRGO event * T15: Timer 15 TRGO event * T2: Timer 2 TRGO event * T4: Timer 4 TRGO event * E9: External line9 * SW: Software trigger * * Note: only used if bit TEN2 = 1 (DAC channel2 trigger enabled) * Note: T3 == T8; T5 == T15; not both present on one device * Note: this is *not* valid for the STM32L1 family */ #define DAC_CR_TSEL2_SHIFT 19 /** @defgroup dac_trig2_sel DAC Channel 2 Trigger Source Selection @ingroup STM32F_dac_defines @li T6: Timer 6 TRGO event @li T3: Timer 3 TRGO event @li T8: Timer 8 TRGO event @li T7: Timer 7 TRGO event @li T5: Timer 5 TRGO event @li T15: Timer 15 TRGO event @li T2: Timer 2 TRGO event @li T4: Timer 4 TRGO event @li E9: External line9 @li SW: Software trigger @note: Refer to the timer documentation for details of the TRGO event. @note: T3 replaced by T8 and T5 replaced by T15 in some devices. @note: this is <b>not</b> valid for the STM32L1 family. @note: only used if bit TEN2 is set (DAC channel 2 trigger enabled) @{*/ #define DAC_CR_TSEL2_T6 (0x0 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T3 (0x1 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T8 (0x1 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T7 (0x2 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T5 (0x3 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T15 (0x3 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T2 (0x4 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_T4 (0x5 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_E9 (0x6 << DAC_CR_TSEL2_SHIFT) #define DAC_CR_TSEL2_SW (0x7 << DAC_CR_TSEL2_SHIFT) /**@}*/ /* TEN2: DAC channel2 trigger enable */ #define DAC_CR_TEN2 (1 << 18) /* BOFF2: DAC channel2 output buffer disable */ #define DAC_CR_BOFF2 (1 << 17) /* EN2: DAC channel2 enable */ #define DAC_CR_EN2 (1 << 16) /* DMAUDRIE1: DAC channel1 DMA underrun interrupt enable */ /* doesn't exist in most members of the STM32F1 family */ #define DAC_CR_DMAUDRIE1 (1 << 13) /* DMAEN1: DAC channel1 DMA enable */ #define DAC_CR_DMAEN1 (1 << 12) /* MAMP1[3:0]: DAC channel1 mask/amplitude selector */ /* DAC_CR_MAMP1_n: * Unmask bits [(n-1)..0] of LFSR/Triangle Amplitude equal to (2**n)-1 */ #define DAC_CR_MAMP1_SHIFT 8 /** @defgroup dac_mamp1 DAC Channel 1 LFSR Mask and Triangle Wave Amplitude values @ingroup STM32F_dac_defines Unmask bits [(n-1)..0] of LFSR/Triangle Amplitude equal to (2**(n+1)-1 @{*/ #define DAC_CR_MAMP1_1 (0x0 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_2 (0x1 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_3 (0x2 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_4 (0x3 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_5 (0x4 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_6 (0x5 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_7 (0x6 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_8 (0x7 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_9 (0x8 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_10 (0x9 << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_11 (0xA << DAC_CR_MAMP1_SHIFT) #define DAC_CR_MAMP1_12 (0xB << DAC_CR_MAMP1_SHIFT) /**@}*/ /* WAVE1[1:0]: DAC channel1 noise/triangle wave generation enable */ /* Legend: * DIS: wave generation disabled * NOISE: Noise wave generation enabled * TRI: Triangle wave generation enabled * * Note: only used if bit TEN1 = 1 (DAC channel1 trigger enabled) */ #define DAC_CR_WAVE1_SHIFT 6 #define DAC_CR_WAVE1_DIS (0x3 << DAC_CR_WAVE1_SHIFT) /** @defgroup dac_wave1_en DAC Channel 1 Waveform Generation Enable @ingroup STM32F_dac_defines @li DIS: wave generation disabled @li NOISE: Noise wave generation enabled @li TRI: Triangle wave generation enabled @note: only used if bit TEN2 = 1 (DAC channel2 trigger enabled) @{*/ #define DAC_CR_WAVE1_NOISE (0x1 << DAC_CR_WAVE1_SHIFT) #define DAC_CR_WAVE1_TRI (0x2 << DAC_CR_WAVE1_SHIFT) /**@}*/ /* TSEL1[2:0]: DAC channel1 trigger selection */ /* Legend: * * T6: Timer 6 TRGO event * T3: Timer 3 TRGO event in connectivity line devices * T8: Timer 8 TRGO event in high-density and XL-density devices * T7: Timer 7 TRGO event * T5: Timer 5 TRGO event * T15: Timer 15 TRGO event * T2: Timer 2 TRGO event * T4: Timer 4 TRGO event * E9: External line9 * SW: Software trigger * * Note: only used if bit TEN1 = 1 (DAC channel1 trigger enabled) * Note: T3 == T8; T5 == T15; not both present on one device * Note: this is *not* valid for the STM32L1 family */ #define DAC_CR_TSEL1_SHIFT 3 /** @defgroup dac_trig1_sel DAC Channel 1 Trigger Source Selection @ingroup STM32F_dac_defines @li T6: Timer 6 TRGO event @li T3: Timer 3 TRGO event @li T8: Timer 8 TRGO event @li T7: Timer 7 TRGO event @li T5: Timer 5 TRGO event @li T15: Timer 15 TRGO event @li T2: Timer 2 TRGO event @li T4: Timer 4 TRGO event @li E9: External line 9 @li SW: Software trigger @note: Refer to the timer documentation for details of the TRGO event. @note: T3 replaced by T8 and T5 replaced by T15 in some devices. @note: this is <b>not</b> valid for the STM32L1 family. @note: only used if bit TEN2 is set (DAC channel 1 trigger enabled). @{*/ #define DAC_CR_TSEL1_T6 (0x0 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T3 (0x1 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T8 (0x1 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T7 (0x2 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T5 (0x3 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T15 (0x3 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T2 (0x4 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_T4 (0x5 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_E9 (0x6 << DAC_CR_TSEL1_SHIFT) #define DAC_CR_TSEL1_SW (0x7 << DAC_CR_TSEL1_SHIFT) /**@}*/ /* TEN1: DAC channel1 trigger enable */ #define DAC_CR_TEN1 (1 << 2) /* BOFF1: DAC channel1 output buffer disable */ #define DAC_CR_BOFF1 (1 << 1) /* EN1: DAC channel1 enable */ #define DAC_CR_EN1 (1 << 0) /* --- DAC_SWTRIGR values p 268 -------------------------------------------------- */ /* SWTRIG2: DAC channel2 software trigger */ #define DAC_SWTRIGR_SWTRIG2 (1 << 1) /* SWTRIG1: DAC channel1 software trigger */ #define DAC_SWTRIGR_SWTRIG1 (1 << 0) /* --- DAC_DHR12R1 values p 268 -------------------------------------------------- */ #define DAC_DHR12R1_DACC1DHR_LSB (1 << 0) #define DAC_DHR12R1_DACC1DHR_MSK (0x0FFF << 0) /* --- DAC_DHR12L1 values p 269 -------------------------------------------------- */ #define DAC_DHR12L1_DACC1DHR_LSB (1 << 4) #define DAC_DHR12L1_DACC1DHR_MSK (0x0FFF << 4) /* --- DAC_DHR8R1 values p 269 --------------------------------------------------- */ #define DAC_DHR8R1_DACC1DHR_LSB (1 << 0) #define DAC_DHR8R1_DACC1DHR_MSK (0x00FF << 0) /* --- DAC_DHR12R2 values p 269 -------------------------------------------------- */ #define DAC_DHR12R2_DACC2DHR_LSB (1 << 0) #define DAC_DHR12R2_DACC2DHR_MSK (0x00FFF << 0) /* --- DAC_DHR12L2 values p 270 -------------------------------------------------- */ #define DAC_DHR12L2_DACC2DHR_LSB (1 << 4) #define DAC_DHR12L2_DACC2DHR_MSK (0x0FFF << 4) /* --- DAC_DHR8R2 values p 270 --------------------------------------------------- */ #define DAC_DHR8R2_DACC2DHR_LSB (1 << 0) #define DAC_DHR8R2_DACC2DHR_MSK (0x00FF << 0) /* --- DAC_DHR12RD values p 271 -------------------------------------------------- */ #define DAC_DHR12RD_DACC2DHR_LSB (1 << 16) #define DAC_DHR12RD_DACC2DHR_MSK (0x0FFF << 16) #define DAC_DHR12RD_DACC1DHR_LSB (1 << 0) #define DAC_DHR12RD_DACC1DHR_MSK (0x0FFF << 0) /* --- DAC_DHR12LD values p 271 -------------------------------------------------- */ #define DAC_DHR12LD_DACC2DHR_LSB (1 << 16) #define DAC_DHR12LD_DACC2DHR_MSK (0x0FFF << 20) #define DAC_DHR12LD_DACC1DHR_LSB (1 << 0) #define DAC_DHR12LD_DACC1DHR_MSK (0x0FFF << 4) /* --- DAC_DHR8RD values p 272 --------------------------------------------------- */ #define DAC_DHR8RD_DACC2DHR_LSB (1 << 8) #define DAC_DHR8RD_DACC2DHR_MSK (0x00FF << 8) #define DAC_DHR8RD_DACC1DHR_LSB (1 << 0) #define DAC_DHR8RD_DACC1DHR_MSK (0x00FF << 0) /* --- DAC_DOR1 values p 272 ----------------------------------------------------- */ #define DAC_DOR1_DACC1DOR_LSB (1 << 0) #define DAC_DOR1_DACC1DOR_MSK (0x0FFF << 0) /* --- DAC_DOR2 values p 272, 273 ------------------------------------------------- */ #define DAC_DOR2_DACC2DOR_LSB (1 << 0) #define DAC_DOR2_DACC2DOR_MSK (0x0FFF << 0) /* --- DAC_SR values p 273 -------------------------------------------------------- */ #define DAC_SR_DMAUDR2 (1 << 29) // DAC channel2 DMA underrun flag #define DAC_SR_DMAUDR1 (1 << 13) // DAC channel1 DMA underrun flag /** DAC channel identifier */ typedef enum { CHANNEL_1, CHANNEL_2, CHANNEL_D } data_channel; /** DAC data size (8/12 bits), alignment (right/left) */ typedef enum { RIGHT8, RIGHT12, LEFT12 } data_align; /* --- Function prototypes ------------------------------------------------- */ BEGIN_DECLS void dac_enable(data_channel dac_channel); void dac_disable(data_channel dac_channel); void dac_buffer_enable(data_channel dac_channel); void dac_buffer_disable(data_channel dac_channel); void dac_dma_enable(data_channel dac_channel); void dac_dma_disable(data_channel dac_channel); void dac_trigger_enable(data_channel dac_channel); void dac_trigger_disable(data_channel dac_channel); void dac_set_trigger_source(u32 dac_trig_src); void dac_set_waveform_generation(u32 dac_wave_ens); void dac_disable_waveform_generation(data_channel dac_channel); void dac_set_waveform_characteristics(u32 dac_mamp); void dac_load_data_buffer_single(u32 dac_data, data_align dac_data_format, data_channel dac_channel); void dac_load_data_buffer_dual(u32 dac_data1, u32 dac_data2, data_align dac_data_format); void dac_software_trigger(data_channel dac_channel); END_DECLS #endif /**@}*/
35.302273
103
0.69877
d219e05642a8050daa06a577612d94b7362106b5
1,322
h
C
Assets/header/EmoticonMd5DownloadProxy.h
NuolanNuolan/IPAPatch-master
0f1821950c9b26d504c73681673901b8efa1e44c
[ "MIT" ]
5
2017-09-21T06:56:18.000Z
2021-01-02T22:15:23.000Z
Assets/header/EmoticonMd5DownloadProxy.h
NuolanNuolan/IPAPatch-master
0f1821950c9b26d504c73681673901b8efa1e44c
[ "MIT" ]
null
null
null
Assets/header/EmoticonMd5DownloadProxy.h
NuolanNuolan/IPAPatch-master
0f1821950c9b26d504c73681673901b8efa1e44c
[ "MIT" ]
5
2017-11-14T03:18:42.000Z
2019-12-30T03:09:35.000Z
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Mar 29 2017 23:22:24). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import "EmoticonDownloadProxy.h" #import "StoreEmotionBatchEmojiDownLoadCgiDelegate-Protocol.h" @class EmoticonCdnDownloadConnection, NSString, StoreEmotionBatchEmojiDownLoadCgi; @protocol EmoticonDownloadProxyDelegate; @interface EmoticonMd5DownloadProxy : EmoticonDownloadProxy <StoreEmotionBatchEmojiDownLoadCgiDelegate> { NSString *m_md5String; id <EmoticonDownloadProxyDelegate> m_delegate; _Bool m_isActive; StoreEmotionBatchEmojiDownLoadCgi *m_batchEmojiDownloadCgi; EmoticonCdnDownloadConnection *m_cdnDownloadProxy; NSString *_m_serverId; } @property(retain, nonatomic) NSString *m_serverId; // @synthesize m_serverId=_m_serverId; - (void).cxx_destruct; - (void)onBatchEmojiDownLoadEndWithEmojiList:(id)arg1; - (id)createCdnDownloadConnectionWithEmojiInfo:(id)arg1; - (void)callFailedDelegate; - (void)startRequest; - (_Bool)isActive; - (id)initWithMd5:(id)arg1 delegate:(id)arg2; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
32.243902
103
0.791225
d222bef8adfb59363768a3c20ce92075d024ca84
66,895
h
C
generated/nirfmxnr/nirfmxnr_library.h
tdunkle/grpc-device
2c784476327595fdeae06d6a3fc7aaf6daac597e
[ "MIT" ]
null
null
null
generated/nirfmxnr/nirfmxnr_library.h
tdunkle/grpc-device
2c784476327595fdeae06d6a3fc7aaf6daac597e
[ "MIT" ]
null
null
null
generated/nirfmxnr/nirfmxnr_library.h
tdunkle/grpc-device
2c784476327595fdeae06d6a3fc7aaf6daac597e
[ "MIT" ]
null
null
null
//--------------------------------------------------------------------- // This file is automatically generated. All manual edits will be lost. //--------------------------------------------------------------------- // Real implementation of LibraryInterface for NI-RFMXNR //--------------------------------------------------------------------- #ifndef NIRFMXNR_GRPC_LIBRARY_H #define NIRFMXNR_GRPC_LIBRARY_H #include "nirfmxnr_library_interface.h" #include <server/shared_library.h> namespace nirfmxnr_grpc { class NiRFmxNRLibrary : public nirfmxnr_grpc::NiRFmxNRLibraryInterface { public: NiRFmxNRLibrary(); virtual ~NiRFmxNRLibrary(); ::grpc::Status check_function_exists(std::string functionName); int32 ACPCfgAveraging(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 averagingEnabled, int32 averagingCount, int32 averagingType); int32 ACPCfgMeasurementMethod(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 measurementMethod); int32 ACPCfgNoiseCompensationEnabled(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 noiseCompensationEnabled); int32 ACPCfgNumberOfENDCOffsets(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 numberOfENDCOffsets); int32 ACPCfgNumberOfEUTRAOffsets(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 numberOfEUTRAOffsets); int32 ACPCfgNumberOfNROffsets(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 numberOfNROffsets); int32 ACPCfgNumberOfUTRAOffsets(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 numberOfUTRAOffsets); int32 ACPCfgPowerUnits(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 powerUnits); int32 ACPCfgRBWFilter(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 rbwAuto, float64 rbw, int32 rbwFilterType); int32 ACPCfgSweepTime(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 sweepTimeAuto, float64 sweepTimeInterval); int32 ACPFetchAbsolutePowersTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32 traceIndex, float64* x0, float64* dx, float32 absolutePowersTrace[], int32 arraySize, int32* actualArraySize); int32 ACPFetchComponentCarrierMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* absolutePower, float64* relativePower); int32 ACPFetchComponentCarrierMeasurementArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 absolutePower[], float64 relativePower[], int32 arraySize, int32* actualArraySize); int32 ACPFetchOffsetMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* lowerRelativePower, float64* upperRelativePower, float64* lowerAbsolutePower, float64* upperAbsolutePower); int32 ACPFetchOffsetMeasurementArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 lowerRelativePower[], float64 upperRelativePower[], float64 lowerAbsolutePower[], float64 upperAbsolutePower[], int32 arraySize, int32* actualArraySize); int32 ACPFetchRelativePowersTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32 traceIndex, float64* x0, float64* dx, float32 relativePowersTrace[], int32 arraySize, int32* actualArraySize); int32 ACPFetchSpectrum(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 spectrum[], int32 arraySize, int32* actualArraySize); int32 ACPFetchSubblockMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* subblockPower, float64* integrationBandwidth, float64* frequency); int32 ACPFetchTotalAggregatedPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* totalAggregatedPower); int32 ACPValidateNoiseCalibrationData(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* noiseCalibrationDataValid); int32 AbortMeasurements(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 AnalyzeIQ1Waveform(niRFmxInstrHandle instrumentHandle, char selectorString[], char resultName[], float64 x0, float64 dx, NIComplexSingle iq[], int32 arraySize, int32 reset, int64 reserved); int32 AnalyzeSpectrum1Waveform(niRFmxInstrHandle instrumentHandle, char selectorString[], char resultName[], float64 x0, float64 dx, float32 spectrum[], int32 arraySize, int32 reset, int64 reserved); int32 AutoLevel(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 measurementInterval, float64* referenceLevel); int32 BuildBandwidthPartString(char selectorString[], int32 bandwidthPartNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildCORESETClusterString(char selectorString[], int32 coresetClusterNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildCORESETString(char selectorString[], int32 coresetNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildCarrierString(char selectorString[], int32 carrierNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildListStepString(char listName[], char resultName[], int32 stepNumber, int32 selectorStringLength, char selectorString[]); int32 BuildListString(char listName[], char resultName[], int32 selectorStringLength, char selectorString[]); int32 BuildOffsetString(char selectorString[], int32 offsetNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildPDCCHString(char selectorString[], int32 pdcchNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildPDSCHClusterString(char selectorString[], int32 pdschClusterNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildPDSCHString(char selectorString[], int32 pdschNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildPUSCHClusterString(char selectorString[], int32 puschClusterNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildPUSCHString(char selectorString[], int32 puschNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildSignalString(char signalName[], char resultName[], int32 selectorStringLength, char selectorString[]); int32 BuildSubblockString(char selectorString[], int32 subblockNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 BuildUserString(char selectorString[], int32 userNumber, int32 selectorStringOutLength, char selectorStringOut[]); int32 CHPCfgAveraging(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 averagingEnabled, int32 averagingCount, int32 averagingType); int32 CHPCfgRBWFilter(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 rbwAuto, float64 rbw, int32 rbwFilterType); int32 CHPCfgSweepTime(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 sweepTimeAuto, float64 sweepTimeInterval); int32 CHPFetchComponentCarrierMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* absolutePower, float64* relativePower); int32 CHPFetchComponentCarrierMeasurementArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 absolutePower[], float64 relativePower[], int32 arraySize, int32* actualArraySize); int32 CHPFetchSpectrum(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 spectrum[], int32 arraySize, int32* actualArraySize); int32 CHPFetchSubblockPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* subblockPower); int32 CHPFetchTotalAggregatedPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* totalAggregatedPower); int32 CHPValidateNoiseCalibrationData(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* noiseCalibrationDataValid); int32 CfgDigitalEdgeTrigger(niRFmxInstrHandle instrumentHandle, char selectorString[], char digitalEdgeSource[], int32 digitalEdge, float64 triggerDelay, int32 enableTrigger); int32 CfgExternalAttenuation(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 externalAttenuation); int32 CfgFrequency(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 centerFrequency); int32 CfgFrequencyReference(niRFmxInstrHandle instrumentHandle, char channelName[], char frequencyReferenceSource[], float64 frequencyReferenceFrequency); int32 CfgIQPowerEdgeTrigger(niRFmxInstrHandle instrumentHandle, char selectorString[], char iqPowerEdgeSource[], int32 iqPowerEdgeSlope, float64 iqPowerEdgeLevel, float64 triggerDelay, int32 triggerMinQuietTimeMode, float64 triggerMinQuietTimeDuration, int32 iqPowerEdgeLevelType, int32 enableTrigger); int32 CfgMechanicalAttenuation(niRFmxInstrHandle instrumentHandle, char channelName[], int32 mechanicalAttenuationAuto, float64 mechanicalAttenuationValue); int32 CfgRF(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 centerFrequency, float64 referenceLevel, float64 externalAttenuation); int32 CfgRFAttenuation(niRFmxInstrHandle instrumentHandle, char channelName[], int32 rfAttenuationAuto, float64 rfAttenuationValue); int32 CfgReferenceLevel(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 referenceLevel); int32 CfgSoftwareEdgeTrigger(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 triggerDelay, int32 enableTrigger); int32 CfggNodeBCategory(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 gNodeBCategory); int32 CheckMeasurementStatus(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* isDone); int32 ClearAllNamedResults(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 ClearNamedResult(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 ClearNoiseCalibrationDatabase(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 CloneSignalConfiguration(niRFmxInstrHandle instrumentHandle, char oldSignalName[], char newSignalName[]); int32 Close(niRFmxInstrHandle instrumentHandle, int32 forceDestroy); int32 Commit(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 CreateList(niRFmxInstrHandle instrumentHandle, char listName[]); int32 CreateListStep(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* createdStepIndex); int32 CreateSignalConfiguration(niRFmxInstrHandle instrumentHandle, char signalName[]); int32 DeleteList(niRFmxInstrHandle instrumentHandle, char listName[]); int32 DeleteSignalConfiguration(niRFmxInstrHandle instrumentHandle, char signalName[]); int32 DisableTrigger(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 GetAllNamedResultNames(niRFmxInstrHandle instrumentHandle, char selectorString[], char resultNames[], int32 resultNamesBufferSize, int32* actualResultNamesSize, int32* defaultResultExists); int32 GetAttributeF32(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float32* attrVal); int32 GetAttributeF32Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float32 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeF64(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float64* attrVal); int32 GetAttributeF64Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float64 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeI16(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int16* attrVal); int32 GetAttributeI32(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int32* attrVal); int32 GetAttributeI32Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int32 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeI64(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int64* attrVal); int32 GetAttributeI64Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int64 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeI8(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int8* attrVal); int32 GetAttributeI8Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int8 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeNIComplexDoubleArray(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, NIComplexDouble attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeNIComplexSingleArray(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, NIComplexSingle attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeString(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int32 arraySize, char attrVal[]); int32 GetAttributeU16(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt16* attrVal); int32 GetAttributeU32(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt32* attrVal); int32 GetAttributeU32Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt32 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeU64Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt64 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetAttributeU8(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt8* attrVal); int32 GetAttributeU8Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt8 attrVal[], int32 arraySize, int32* actualArraySize); int32 GetError(niRFmxInstrHandle instrumentHandle, int32* errorCode, int32 errorDescriptionBufferSize, char errorDescription[]); int32 GetErrorString(niRFmxInstrHandle instrumentHandle, int32 errorCode, int32 errorDescriptionBufferSize, char errorDescription[]); int32 Initialize(char resourceName[], char optionString[], niRFmxInstrHandle* handleOut, int32* isNewSession); int32 InitializeFromNIRFSASession(uInt32 nirfsaSession, niRFmxInstrHandle* handleOut); int32 Initiate(niRFmxInstrHandle instrumentHandle, char selectorString[], char resultName[]); int32 ModAccAutoLevel(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout); int32 ModAccCfgMeasurementMode(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 measurementMode); int32 ModAccCfgNoiseCompensationEnabled(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 noiseCompensationEnabled); int32 ModAccCfgReferenceWaveform(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 x0, float64 dx, NIComplexSingle referenceWaveform[], int32 arraySize); int32 ModAccClearNoiseCalibrationDatabase(niRFmxInstrHandle instrumentHandle); int32 ModAccFetchCompositeEVM(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* compositeRMSEVMMean, float64* compositePeakEVMMaximum); int32 ModAccFetchFrequencyErrorMean(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* frequencyErrorMean); int32 ModAccFetchIQGainImbalancePerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 iqGainImbalancePerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 iqQuadratureErrorPerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchInBandEmissionTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 inBandEmission[], float32 inBandEmissionMask[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPBCHDMRSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle pbchdmrsConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 pbchdmrsrmsevmPerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 pbchdmrsrmsevmPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPBCHDataConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle pbchDataConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 pbchDataRMSEVMPerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPBCHDataRMSEVMPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 pbchDataRMSEVMPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCH1024QAMConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle qam1024Constellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCH16QAMConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle qam16Constellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCH256QAMConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle qam256Constellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCH64QAMConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle qam64Constellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCH8PSKConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle psk8Constellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCHDMRSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle pdschdmrsConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCHDataConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle pdschDataConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCHDemodulatedBits(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int8 bits[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCHPTRSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle pdschptrsConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPDSCHQPSKConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle qpskConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPSSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle pssConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPSSRMSEVMPerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 pssrmsevmPerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPSSRMSEVMPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 pssrmsevmPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPUSCHDMRSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle puschdmrsConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPUSCHDataConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle puschDataConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPUSCHDemodulatedBits(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int8 bits[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPUSCHPTRSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle puschptrsConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPeakEVMPerSlotMaximumTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 peakEVMPerSlotMaximum[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPeakEVMPerSubcarrierMaximumTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 peakEVMPerSubcarrierMaximum[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchPeakEVMPerSymbolMaximumTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 peakEVMPerSymbolMaximum[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchRMSEVMHighPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 rmsevmHighPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchRMSEVMLowPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 rmsevmLowPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchRMSEVMPerSlotMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 rmsevmPerSlotMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchRMSEVMPerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 rmsevmPerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchRMSEVMPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 rmsevmPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchSSSConstellationTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, NIComplexSingle sssConstellation[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchSSSRMSEVMPerSubcarrierMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 sssrmsevmPerSubcarrierMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchSSSRMSEVMPerSymbolMeanTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 sssrmsevmPerSymbolMean[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchSpectralFlatnessTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 spectralFlatness[], float32 spectralFlatnessLowerMask[], float32 spectralFlatnessUpperMask[], int32 arraySize, int32* actualArraySize); int32 ModAccFetchSubblockInBandEmissionTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 subblockInBandEmission[], float64 subblockInBandEmissionMask[], float64 subblockInBandEmissionRBIndices[], int32 arraySize, int32* actualArraySize); int32 ModAccValidateCalibrationData(niRFmxInstrHandle instrumentHandle, char selectorString[], int32* calibrationDataValid); int32 OBWCfgAveraging(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 averagingEnabled, int32 averagingCount, int32 averagingType); int32 OBWCfgRBWFilter(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 rbwAuto, float64 rbw, int32 rbwFilterType); int32 OBWCfgSweepTime(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 sweepTimeAuto, float64 sweepTimeInterval); int32 OBWFetchMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* occupiedBandwidth, float64* absolutePower, float64* startFrequency, float64* stopFrequency); int32 OBWFetchSpectrum(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 spectrum[], int32 arraySize, int32* actualArraySize); int32 PVTCfgAveraging(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 averagingEnabled, int32 averagingCount, int32 averagingType); int32 PVTCfgMeasurementMethod(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 measurementMethod); int32 PVTCfgOFFPowerExclusionPeriods(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 offPowerExclusionBefore, float64 offPowerExclusionAfter); int32 PVTFetchMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32* measurementStatus, float64* absoluteOFFPowerBefore, float64* absoluteOFFPowerAfter, float64* absoluteONPower, float64* burstWidth); int32 PVTFetchMeasurementArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32 measurementStatus[], float64 absoluteOFFPowerBefore[], float64 absoluteOFFPowerAfter[], float64 absoluteONPower[], float64 burstWidth[], int32 arraySize, int32* actualArraySize); int32 PVTFetchSignalPowerTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 signalPower[], float32 absoluteLimit[], int32 arraySize, int32* actualArraySize); int32 PVTFetchWindowedSignalPowerTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 windowedSignalPower[], int32 arraySize, int32* actualArraySize); int32 ResetAttribute(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID); int32 ResetToDefault(niRFmxInstrHandle instrumentHandle, char selectorString[]); int32 SEMCfgAveraging(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 averagingEnabled, int32 averagingCount, int32 averagingType); int32 SEMCfgComponentCarrierRatedOutputPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 componentCarrierRatedOutputPower); int32 SEMCfgComponentCarrierRatedOutputPowerArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 componentCarrierRatedOutputPower[], int32 numberOfElements); int32 SEMCfgNumberOfOffsets(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 numberOfOffsets); int32 SEMCfgOffsetAbsoluteLimit(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 absoluteLimitStart, float64 absoluteLimitStop); int32 SEMCfgOffsetAbsoluteLimitArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 absoluteLimitStart[], float64 absoluteLimitStop[], int32 numberOfElements); int32 SEMCfgOffsetBandwidthIntegral(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 bandwidthIntegral); int32 SEMCfgOffsetBandwidthIntegralArray(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 bandwidthIntegral[], int32 numberOfElements); int32 SEMCfgOffsetFrequency(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 offsetStartFrequency, float64 offsetStopFrequency, int32 offsetSideband); int32 SEMCfgOffsetFrequencyArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 offsetStartFrequency[], float64 offsetStopFrequency[], int32 offsetSideband[], int32 numberOfElements); int32 SEMCfgOffsetLimitFailMask(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 limitFailMask); int32 SEMCfgOffsetLimitFailMaskArray(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 limitFailMask[], int32 numberOfElements); int32 SEMCfgOffsetRBWFilter(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 offsetRBW, int32 offsetRBWFilterType); int32 SEMCfgOffsetRBWFilterArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 offsetRBW[], int32 offsetRBWFilterType[], int32 numberOfElements); int32 SEMCfgOffsetRelativeLimit(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 relativeLimitStart, float64 relativeLimitStop); int32 SEMCfgOffsetRelativeLimitArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 relativeLimitStart[], float64 relativeLimitStop[], int32 numberOfElements); int32 SEMCfgSweepTime(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 sweepTimeAuto, float64 sweepTimeInterval); int32 SEMCfgUplinkMaskType(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 uplinkMaskType); int32 SEMFetchComponentCarrierMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* absolutePower, float64* peakAbsolutePower, float64* peakFrequency, float64* relativePower); int32 SEMFetchComponentCarrierMeasurementArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 absolutePower[], float64 peakAbsolutePower[], float64 peakFrequency[], float64 relativePower[], int32 arraySize, int32* actualArraySize); int32 SEMFetchLowerOffsetMargin(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32* measurementStatus, float64* margin, float64* marginFrequency, float64* marginAbsolutePower, float64* marginRelativePower); int32 SEMFetchLowerOffsetMarginArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32 measurementStatus[], float64 margin[], float64 marginFrequency[], float64 marginAbsolutePower[], float64 marginRelativePower[], int32 arraySize, int32* actualArraySize); int32 SEMFetchLowerOffsetPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* totalAbsolutePower, float64* totalRelativePower, float64* peakAbsolutePower, float64* peakFrequency, float64* peakRelativePower); int32 SEMFetchLowerOffsetPowerArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 totalAbsolutePower[], float64 totalRelativePower[], float64 peakAbsolutePower[], float64 peakFrequency[], float64 peakRelativePower[], int32 arraySize, int32* actualArraySize); int32 SEMFetchMeasurementStatus(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32* measurementStatus); int32 SEMFetchSpectrum(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 spectrum[], float32 compositeMask[], int32 arraySize, int32* actualArraySize); int32 SEMFetchSubblockMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* subblockPower, float64* integrationBandwidth, float64* frequency); int32 SEMFetchTotalAggregatedPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* totalAggregatedPower); int32 SEMFetchUpperOffsetMargin(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32* measurementStatus, float64* margin, float64* marginFrequency, float64* marginAbsolutePower, float64* marginRelativePower); int32 SEMFetchUpperOffsetMarginArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, int32 measurementStatus[], float64 margin[], float64 marginFrequency[], float64 marginAbsolutePower[], float64 marginRelativePower[], int32 arraySize, int32* actualArraySize); int32 SEMFetchUpperOffsetPower(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* totalAbsolutePower, float64* totalRelativePower, float64* peakAbsolutePower, float64* peakFrequency, float64* peakRelativePower); int32 SEMFetchUpperOffsetPowerArray(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64 totalAbsolutePower[], float64 totalRelativePower[], float64 peakAbsolutePower[], float64 peakFrequency[], float64 peakRelativePower[], int32 arraySize, int32* actualArraySize); int32 SelectMeasurements(niRFmxInstrHandle instrumentHandle, char selectorString[], uInt32 measurements, int32 enableAllTraces); int32 SendSoftwareEdgeTrigger(niRFmxInstrHandle instrumentHandle); int32 SetAttributeF32(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float32 attrVal); int32 SetAttributeF32Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float32 attrVal[], int32 arraySize); int32 SetAttributeF64(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float64 attrVal); int32 SetAttributeF64Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, float64 attrVal[], int32 arraySize); int32 SetAttributeI16(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int16 attrVal); int32 SetAttributeI32(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int32 attrVal); int32 SetAttributeI32Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int32 attrVal[], int32 arraySize); int32 SetAttributeI64(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int64 attrVal); int32 SetAttributeI64Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int64 attrVal[], int32 arraySize); int32 SetAttributeI8(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int8 attrVal); int32 SetAttributeI8Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, int8 attrVal[], int32 arraySize); int32 SetAttributeNIComplexDoubleArray(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, NIComplexDouble attrVal[], int32 arraySize); int32 SetAttributeNIComplexSingleArray(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, NIComplexSingle attrVal[], int32 arraySize); int32 SetAttributeString(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, char attrVal[]); int32 SetAttributeU16(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt16 attrVal); int32 SetAttributeU32(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt32 attrVal); int32 SetAttributeU32Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt32 attrVal[], int32 arraySize); int32 SetAttributeU64Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt64 attrVal[], int32 arraySize); int32 SetAttributeU8(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt8 attrVal); int32 SetAttributeU8Array(niRFmxInstrHandle instrumentHandle, char selectorString[], int32 attributeID, uInt8 attrVal[], int32 arraySize); int32 TXPFetchMeasurement(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* averagePowerMean, float64* peakPowerMaximum); int32 TXPFetchPowerTrace(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout, float64* x0, float64* dx, float32 power[], int32 arraySize, int32* actualArraySize); int32 WaitForAcquisitionComplete(niRFmxInstrHandle instrumentHandle, float64 timeout); int32 WaitForMeasurementComplete(niRFmxInstrHandle instrumentHandle, char selectorString[], float64 timeout); private: using ACPCfgAveragingPtr = decltype(&RFmxNR_ACPCfgAveraging); using ACPCfgMeasurementMethodPtr = decltype(&RFmxNR_ACPCfgMeasurementMethod); using ACPCfgNoiseCompensationEnabledPtr = decltype(&RFmxNR_ACPCfgNoiseCompensationEnabled); using ACPCfgNumberOfENDCOffsetsPtr = decltype(&RFmxNR_ACPCfgNumberOfENDCOffsets); using ACPCfgNumberOfEUTRAOffsetsPtr = decltype(&RFmxNR_ACPCfgNumberOfEUTRAOffsets); using ACPCfgNumberOfNROffsetsPtr = decltype(&RFmxNR_ACPCfgNumberOfNROffsets); using ACPCfgNumberOfUTRAOffsetsPtr = decltype(&RFmxNR_ACPCfgNumberOfUTRAOffsets); using ACPCfgPowerUnitsPtr = decltype(&RFmxNR_ACPCfgPowerUnits); using ACPCfgRBWFilterPtr = decltype(&RFmxNR_ACPCfgRBWFilter); using ACPCfgSweepTimePtr = decltype(&RFmxNR_ACPCfgSweepTime); using ACPFetchAbsolutePowersTracePtr = decltype(&RFmxNR_ACPFetchAbsolutePowersTrace); using ACPFetchComponentCarrierMeasurementPtr = decltype(&RFmxNR_ACPFetchComponentCarrierMeasurement); using ACPFetchComponentCarrierMeasurementArrayPtr = decltype(&RFmxNR_ACPFetchComponentCarrierMeasurementArray); using ACPFetchOffsetMeasurementPtr = decltype(&RFmxNR_ACPFetchOffsetMeasurement); using ACPFetchOffsetMeasurementArrayPtr = decltype(&RFmxNR_ACPFetchOffsetMeasurementArray); using ACPFetchRelativePowersTracePtr = decltype(&RFmxNR_ACPFetchRelativePowersTrace); using ACPFetchSpectrumPtr = decltype(&RFmxNR_ACPFetchSpectrum); using ACPFetchSubblockMeasurementPtr = decltype(&RFmxNR_ACPFetchSubblockMeasurement); using ACPFetchTotalAggregatedPowerPtr = decltype(&RFmxNR_ACPFetchTotalAggregatedPower); using ACPValidateNoiseCalibrationDataPtr = decltype(&RFmxNR_ACPValidateNoiseCalibrationData); using AbortMeasurementsPtr = decltype(&RFmxNR_AbortMeasurements); using AnalyzeIQ1WaveformPtr = decltype(&RFmxNR_AnalyzeIQ1Waveform); using AnalyzeSpectrum1WaveformPtr = decltype(&RFmxNR_AnalyzeSpectrum1Waveform); using AutoLevelPtr = decltype(&RFmxNR_AutoLevel); using BuildBandwidthPartStringPtr = decltype(&RFmxNR_BuildBandwidthPartString); using BuildCORESETClusterStringPtr = decltype(&RFmxNR_BuildCORESETClusterString); using BuildCORESETStringPtr = decltype(&RFmxNR_BuildCORESETString); using BuildCarrierStringPtr = decltype(&RFmxNR_BuildCarrierString); using BuildListStepStringPtr = decltype(&RFmxNR_BuildListStepString); using BuildListStringPtr = decltype(&RFmxNR_BuildListString); using BuildOffsetStringPtr = decltype(&RFmxNR_BuildOffsetString); using BuildPDCCHStringPtr = decltype(&RFmxNR_BuildPDCCHString); using BuildPDSCHClusterStringPtr = decltype(&RFmxNR_BuildPDSCHClusterString); using BuildPDSCHStringPtr = decltype(&RFmxNR_BuildPDSCHString); using BuildPUSCHClusterStringPtr = decltype(&RFmxNR_BuildPUSCHClusterString); using BuildPUSCHStringPtr = decltype(&RFmxNR_BuildPUSCHString); using BuildSignalStringPtr = decltype(&RFmxNR_BuildSignalString); using BuildSubblockStringPtr = decltype(&RFmxNR_BuildSubblockString); using BuildUserStringPtr = decltype(&RFmxNR_BuildUserString); using CHPCfgAveragingPtr = decltype(&RFmxNR_CHPCfgAveraging); using CHPCfgRBWFilterPtr = decltype(&RFmxNR_CHPCfgRBWFilter); using CHPCfgSweepTimePtr = decltype(&RFmxNR_CHPCfgSweepTime); using CHPFetchComponentCarrierMeasurementPtr = decltype(&RFmxNR_CHPFetchComponentCarrierMeasurement); using CHPFetchComponentCarrierMeasurementArrayPtr = decltype(&RFmxNR_CHPFetchComponentCarrierMeasurementArray); using CHPFetchSpectrumPtr = decltype(&RFmxNR_CHPFetchSpectrum); using CHPFetchSubblockPowerPtr = decltype(&RFmxNR_CHPFetchSubblockPower); using CHPFetchTotalAggregatedPowerPtr = decltype(&RFmxNR_CHPFetchTotalAggregatedPower); using CHPValidateNoiseCalibrationDataPtr = decltype(&RFmxNR_CHPValidateNoiseCalibrationData); using CfgDigitalEdgeTriggerPtr = decltype(&RFmxNR_CfgDigitalEdgeTrigger); using CfgExternalAttenuationPtr = decltype(&RFmxNR_CfgExternalAttenuation); using CfgFrequencyPtr = decltype(&RFmxNR_CfgFrequency); using CfgFrequencyReferencePtr = decltype(&RFmxNR_CfgFrequencyReference); using CfgIQPowerEdgeTriggerPtr = decltype(&RFmxNR_CfgIQPowerEdgeTrigger); using CfgMechanicalAttenuationPtr = decltype(&RFmxNR_CfgMechanicalAttenuation); using CfgRFPtr = decltype(&RFmxNR_CfgRF); using CfgRFAttenuationPtr = decltype(&RFmxNR_CfgRFAttenuation); using CfgReferenceLevelPtr = decltype(&RFmxNR_CfgReferenceLevel); using CfgSoftwareEdgeTriggerPtr = decltype(&RFmxNR_CfgSoftwareEdgeTrigger); using CfggNodeBCategoryPtr = decltype(&RFmxNR_CfggNodeBCategory); using CheckMeasurementStatusPtr = decltype(&RFmxNR_CheckMeasurementStatus); using ClearAllNamedResultsPtr = decltype(&RFmxNR_ClearAllNamedResults); using ClearNamedResultPtr = decltype(&RFmxNR_ClearNamedResult); using ClearNoiseCalibrationDatabasePtr = decltype(&RFmxNR_ClearNoiseCalibrationDatabase); using CloneSignalConfigurationPtr = decltype(&RFmxNR_CloneSignalConfiguration); using ClosePtr = decltype(&RFmxNR_Close); using CommitPtr = decltype(&RFmxNR_Commit); using CreateListPtr = decltype(&RFmxNR_CreateList); using CreateListStepPtr = decltype(&RFmxNR_CreateListStep); using CreateSignalConfigurationPtr = decltype(&RFmxNR_CreateSignalConfiguration); using DeleteListPtr = decltype(&RFmxNR_DeleteList); using DeleteSignalConfigurationPtr = decltype(&RFmxNR_DeleteSignalConfiguration); using DisableTriggerPtr = decltype(&RFmxNR_DisableTrigger); using GetAllNamedResultNamesPtr = decltype(&RFmxNR_GetAllNamedResultNames); using GetAttributeF32Ptr = decltype(&RFmxNR_GetAttributeF32); using GetAttributeF32ArrayPtr = decltype(&RFmxNR_GetAttributeF32Array); using GetAttributeF64Ptr = decltype(&RFmxNR_GetAttributeF64); using GetAttributeF64ArrayPtr = decltype(&RFmxNR_GetAttributeF64Array); using GetAttributeI16Ptr = decltype(&RFmxNR_GetAttributeI16); using GetAttributeI32Ptr = decltype(&RFmxNR_GetAttributeI32); using GetAttributeI32ArrayPtr = decltype(&RFmxNR_GetAttributeI32Array); using GetAttributeI64Ptr = decltype(&RFmxNR_GetAttributeI64); using GetAttributeI64ArrayPtr = decltype(&RFmxNR_GetAttributeI64Array); using GetAttributeI8Ptr = decltype(&RFmxNR_GetAttributeI8); using GetAttributeI8ArrayPtr = decltype(&RFmxNR_GetAttributeI8Array); using GetAttributeNIComplexDoubleArrayPtr = decltype(&RFmxNR_GetAttributeNIComplexDoubleArray); using GetAttributeNIComplexSingleArrayPtr = decltype(&RFmxNR_GetAttributeNIComplexSingleArray); using GetAttributeStringPtr = decltype(&RFmxNR_GetAttributeString); using GetAttributeU16Ptr = decltype(&RFmxNR_GetAttributeU16); using GetAttributeU32Ptr = decltype(&RFmxNR_GetAttributeU32); using GetAttributeU32ArrayPtr = decltype(&RFmxNR_GetAttributeU32Array); using GetAttributeU64ArrayPtr = decltype(&RFmxNR_GetAttributeU64Array); using GetAttributeU8Ptr = decltype(&RFmxNR_GetAttributeU8); using GetAttributeU8ArrayPtr = decltype(&RFmxNR_GetAttributeU8Array); using GetErrorPtr = decltype(&RFmxNR_GetError); using GetErrorStringPtr = decltype(&RFmxNR_GetErrorString); using InitializePtr = decltype(&RFmxNR_Initialize); using InitializeFromNIRFSASessionPtr = decltype(&RFmxNR_InitializeFromNIRFSASession); using InitiatePtr = decltype(&RFmxNR_Initiate); using ModAccAutoLevelPtr = decltype(&RFmxNR_ModAccAutoLevel); using ModAccCfgMeasurementModePtr = decltype(&RFmxNR_ModAccCfgMeasurementMode); using ModAccCfgNoiseCompensationEnabledPtr = decltype(&RFmxNR_ModAccCfgNoiseCompensationEnabled); using ModAccCfgReferenceWaveformPtr = decltype(&RFmxNR_ModAccCfgReferenceWaveform); using ModAccClearNoiseCalibrationDatabasePtr = decltype(&RFmxNR_ModAccClearNoiseCalibrationDatabase); using ModAccFetchCompositeEVMPtr = decltype(&RFmxNR_ModAccFetchCompositeEVM); using ModAccFetchFrequencyErrorMeanPtr = decltype(&RFmxNR_ModAccFetchFrequencyErrorMean); using ModAccFetchIQGainImbalancePerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchIQGainImbalancePerSubcarrierMeanTrace); using ModAccFetchIQQuadratureErrorPerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace); using ModAccFetchInBandEmissionTracePtr = decltype(&RFmxNR_ModAccFetchInBandEmissionTrace); using ModAccFetchPBCHDMRSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPBCHDMRSConstellationTrace); using ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTrace); using ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTrace); using ModAccFetchPBCHDataConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPBCHDataConstellationTrace); using ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTrace); using ModAccFetchPBCHDataRMSEVMPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchPBCHDataRMSEVMPerSymbolMeanTrace); using ModAccFetchPDSCH1024QAMConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCH1024QAMConstellationTrace); using ModAccFetchPDSCH16QAMConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCH16QAMConstellationTrace); using ModAccFetchPDSCH256QAMConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCH256QAMConstellationTrace); using ModAccFetchPDSCH64QAMConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCH64QAMConstellationTrace); using ModAccFetchPDSCH8PSKConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCH8PSKConstellationTrace); using ModAccFetchPDSCHDMRSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCHDMRSConstellationTrace); using ModAccFetchPDSCHDataConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCHDataConstellationTrace); using ModAccFetchPDSCHDemodulatedBitsPtr = decltype(&RFmxNR_ModAccFetchPDSCHDemodulatedBits); using ModAccFetchPDSCHPTRSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCHPTRSConstellationTrace); using ModAccFetchPDSCHQPSKConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPDSCHQPSKConstellationTrace); using ModAccFetchPSSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPSSConstellationTrace); using ModAccFetchPSSRMSEVMPerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchPSSRMSEVMPerSubcarrierMeanTrace); using ModAccFetchPSSRMSEVMPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchPSSRMSEVMPerSymbolMeanTrace); using ModAccFetchPUSCHDMRSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPUSCHDMRSConstellationTrace); using ModAccFetchPUSCHDataConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPUSCHDataConstellationTrace); using ModAccFetchPUSCHDemodulatedBitsPtr = decltype(&RFmxNR_ModAccFetchPUSCHDemodulatedBits); using ModAccFetchPUSCHPTRSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchPUSCHPTRSConstellationTrace); using ModAccFetchPeakEVMPerSlotMaximumTracePtr = decltype(&RFmxNR_ModAccFetchPeakEVMPerSlotMaximumTrace); using ModAccFetchPeakEVMPerSubcarrierMaximumTracePtr = decltype(&RFmxNR_ModAccFetchPeakEVMPerSubcarrierMaximumTrace); using ModAccFetchPeakEVMPerSymbolMaximumTracePtr = decltype(&RFmxNR_ModAccFetchPeakEVMPerSymbolMaximumTrace); using ModAccFetchRMSEVMHighPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchRMSEVMHighPerSymbolMeanTrace); using ModAccFetchRMSEVMLowPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchRMSEVMLowPerSymbolMeanTrace); using ModAccFetchRMSEVMPerSlotMeanTracePtr = decltype(&RFmxNR_ModAccFetchRMSEVMPerSlotMeanTrace); using ModAccFetchRMSEVMPerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchRMSEVMPerSubcarrierMeanTrace); using ModAccFetchRMSEVMPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchRMSEVMPerSymbolMeanTrace); using ModAccFetchSSSConstellationTracePtr = decltype(&RFmxNR_ModAccFetchSSSConstellationTrace); using ModAccFetchSSSRMSEVMPerSubcarrierMeanTracePtr = decltype(&RFmxNR_ModAccFetchSSSRMSEVMPerSubcarrierMeanTrace); using ModAccFetchSSSRMSEVMPerSymbolMeanTracePtr = decltype(&RFmxNR_ModAccFetchSSSRMSEVMPerSymbolMeanTrace); using ModAccFetchSpectralFlatnessTracePtr = decltype(&RFmxNR_ModAccFetchSpectralFlatnessTrace); using ModAccFetchSubblockInBandEmissionTracePtr = decltype(&RFmxNR_ModAccFetchSubblockInBandEmissionTrace); using ModAccValidateCalibrationDataPtr = decltype(&RFmxNR_ModAccValidateCalibrationData); using OBWCfgAveragingPtr = decltype(&RFmxNR_OBWCfgAveraging); using OBWCfgRBWFilterPtr = decltype(&RFmxNR_OBWCfgRBWFilter); using OBWCfgSweepTimePtr = decltype(&RFmxNR_OBWCfgSweepTime); using OBWFetchMeasurementPtr = decltype(&RFmxNR_OBWFetchMeasurement); using OBWFetchSpectrumPtr = decltype(&RFmxNR_OBWFetchSpectrum); using PVTCfgAveragingPtr = decltype(&RFmxNR_PVTCfgAveraging); using PVTCfgMeasurementMethodPtr = decltype(&RFmxNR_PVTCfgMeasurementMethod); using PVTCfgOFFPowerExclusionPeriodsPtr = decltype(&RFmxNR_PVTCfgOFFPowerExclusionPeriods); using PVTFetchMeasurementPtr = decltype(&RFmxNR_PVTFetchMeasurement); using PVTFetchMeasurementArrayPtr = decltype(&RFmxNR_PVTFetchMeasurementArray); using PVTFetchSignalPowerTracePtr = decltype(&RFmxNR_PVTFetchSignalPowerTrace); using PVTFetchWindowedSignalPowerTracePtr = decltype(&RFmxNR_PVTFetchWindowedSignalPowerTrace); using ResetAttributePtr = decltype(&RFmxNR_ResetAttribute); using ResetToDefaultPtr = decltype(&RFmxNR_ResetToDefault); using SEMCfgAveragingPtr = decltype(&RFmxNR_SEMCfgAveraging); using SEMCfgComponentCarrierRatedOutputPowerPtr = decltype(&RFmxNR_SEMCfgComponentCarrierRatedOutputPower); using SEMCfgComponentCarrierRatedOutputPowerArrayPtr = decltype(&RFmxNR_SEMCfgComponentCarrierRatedOutputPowerArray); using SEMCfgNumberOfOffsetsPtr = decltype(&RFmxNR_SEMCfgNumberOfOffsets); using SEMCfgOffsetAbsoluteLimitPtr = decltype(&RFmxNR_SEMCfgOffsetAbsoluteLimit); using SEMCfgOffsetAbsoluteLimitArrayPtr = decltype(&RFmxNR_SEMCfgOffsetAbsoluteLimitArray); using SEMCfgOffsetBandwidthIntegralPtr = decltype(&RFmxNR_SEMCfgOffsetBandwidthIntegral); using SEMCfgOffsetBandwidthIntegralArrayPtr = decltype(&RFmxNR_SEMCfgOffsetBandwidthIntegralArray); using SEMCfgOffsetFrequencyPtr = decltype(&RFmxNR_SEMCfgOffsetFrequency); using SEMCfgOffsetFrequencyArrayPtr = decltype(&RFmxNR_SEMCfgOffsetFrequencyArray); using SEMCfgOffsetLimitFailMaskPtr = decltype(&RFmxNR_SEMCfgOffsetLimitFailMask); using SEMCfgOffsetLimitFailMaskArrayPtr = decltype(&RFmxNR_SEMCfgOffsetLimitFailMaskArray); using SEMCfgOffsetRBWFilterPtr = decltype(&RFmxNR_SEMCfgOffsetRBWFilter); using SEMCfgOffsetRBWFilterArrayPtr = decltype(&RFmxNR_SEMCfgOffsetRBWFilterArray); using SEMCfgOffsetRelativeLimitPtr = decltype(&RFmxNR_SEMCfgOffsetRelativeLimit); using SEMCfgOffsetRelativeLimitArrayPtr = decltype(&RFmxNR_SEMCfgOffsetRelativeLimitArray); using SEMCfgSweepTimePtr = decltype(&RFmxNR_SEMCfgSweepTime); using SEMCfgUplinkMaskTypePtr = decltype(&RFmxNR_SEMCfgUplinkMaskType); using SEMFetchComponentCarrierMeasurementPtr = decltype(&RFmxNR_SEMFetchComponentCarrierMeasurement); using SEMFetchComponentCarrierMeasurementArrayPtr = decltype(&RFmxNR_SEMFetchComponentCarrierMeasurementArray); using SEMFetchLowerOffsetMarginPtr = decltype(&RFmxNR_SEMFetchLowerOffsetMargin); using SEMFetchLowerOffsetMarginArrayPtr = decltype(&RFmxNR_SEMFetchLowerOffsetMarginArray); using SEMFetchLowerOffsetPowerPtr = decltype(&RFmxNR_SEMFetchLowerOffsetPower); using SEMFetchLowerOffsetPowerArrayPtr = decltype(&RFmxNR_SEMFetchLowerOffsetPowerArray); using SEMFetchMeasurementStatusPtr = decltype(&RFmxNR_SEMFetchMeasurementStatus); using SEMFetchSpectrumPtr = decltype(&RFmxNR_SEMFetchSpectrum); using SEMFetchSubblockMeasurementPtr = decltype(&RFmxNR_SEMFetchSubblockMeasurement); using SEMFetchTotalAggregatedPowerPtr = decltype(&RFmxNR_SEMFetchTotalAggregatedPower); using SEMFetchUpperOffsetMarginPtr = decltype(&RFmxNR_SEMFetchUpperOffsetMargin); using SEMFetchUpperOffsetMarginArrayPtr = decltype(&RFmxNR_SEMFetchUpperOffsetMarginArray); using SEMFetchUpperOffsetPowerPtr = decltype(&RFmxNR_SEMFetchUpperOffsetPower); using SEMFetchUpperOffsetPowerArrayPtr = decltype(&RFmxNR_SEMFetchUpperOffsetPowerArray); using SelectMeasurementsPtr = decltype(&RFmxNR_SelectMeasurements); using SendSoftwareEdgeTriggerPtr = decltype(&RFmxNR_SendSoftwareEdgeTrigger); using SetAttributeF32Ptr = decltype(&RFmxNR_SetAttributeF32); using SetAttributeF32ArrayPtr = decltype(&RFmxNR_SetAttributeF32Array); using SetAttributeF64Ptr = decltype(&RFmxNR_SetAttributeF64); using SetAttributeF64ArrayPtr = decltype(&RFmxNR_SetAttributeF64Array); using SetAttributeI16Ptr = decltype(&RFmxNR_SetAttributeI16); using SetAttributeI32Ptr = decltype(&RFmxNR_SetAttributeI32); using SetAttributeI32ArrayPtr = decltype(&RFmxNR_SetAttributeI32Array); using SetAttributeI64Ptr = decltype(&RFmxNR_SetAttributeI64); using SetAttributeI64ArrayPtr = decltype(&RFmxNR_SetAttributeI64Array); using SetAttributeI8Ptr = decltype(&RFmxNR_SetAttributeI8); using SetAttributeI8ArrayPtr = decltype(&RFmxNR_SetAttributeI8Array); using SetAttributeNIComplexDoubleArrayPtr = decltype(&RFmxNR_SetAttributeNIComplexDoubleArray); using SetAttributeNIComplexSingleArrayPtr = decltype(&RFmxNR_SetAttributeNIComplexSingleArray); using SetAttributeStringPtr = decltype(&RFmxNR_SetAttributeString); using SetAttributeU16Ptr = decltype(&RFmxNR_SetAttributeU16); using SetAttributeU32Ptr = decltype(&RFmxNR_SetAttributeU32); using SetAttributeU32ArrayPtr = decltype(&RFmxNR_SetAttributeU32Array); using SetAttributeU64ArrayPtr = decltype(&RFmxNR_SetAttributeU64Array); using SetAttributeU8Ptr = decltype(&RFmxNR_SetAttributeU8); using SetAttributeU8ArrayPtr = decltype(&RFmxNR_SetAttributeU8Array); using TXPFetchMeasurementPtr = decltype(&RFmxNR_TXPFetchMeasurement); using TXPFetchPowerTracePtr = decltype(&RFmxNR_TXPFetchPowerTrace); using WaitForAcquisitionCompletePtr = decltype(&RFmxNR_WaitForAcquisitionComplete); using WaitForMeasurementCompletePtr = decltype(&RFmxNR_WaitForMeasurementComplete); typedef struct FunctionPointers { ACPCfgAveragingPtr ACPCfgAveraging; ACPCfgMeasurementMethodPtr ACPCfgMeasurementMethod; ACPCfgNoiseCompensationEnabledPtr ACPCfgNoiseCompensationEnabled; ACPCfgNumberOfENDCOffsetsPtr ACPCfgNumberOfENDCOffsets; ACPCfgNumberOfEUTRAOffsetsPtr ACPCfgNumberOfEUTRAOffsets; ACPCfgNumberOfNROffsetsPtr ACPCfgNumberOfNROffsets; ACPCfgNumberOfUTRAOffsetsPtr ACPCfgNumberOfUTRAOffsets; ACPCfgPowerUnitsPtr ACPCfgPowerUnits; ACPCfgRBWFilterPtr ACPCfgRBWFilter; ACPCfgSweepTimePtr ACPCfgSweepTime; ACPFetchAbsolutePowersTracePtr ACPFetchAbsolutePowersTrace; ACPFetchComponentCarrierMeasurementPtr ACPFetchComponentCarrierMeasurement; ACPFetchComponentCarrierMeasurementArrayPtr ACPFetchComponentCarrierMeasurementArray; ACPFetchOffsetMeasurementPtr ACPFetchOffsetMeasurement; ACPFetchOffsetMeasurementArrayPtr ACPFetchOffsetMeasurementArray; ACPFetchRelativePowersTracePtr ACPFetchRelativePowersTrace; ACPFetchSpectrumPtr ACPFetchSpectrum; ACPFetchSubblockMeasurementPtr ACPFetchSubblockMeasurement; ACPFetchTotalAggregatedPowerPtr ACPFetchTotalAggregatedPower; ACPValidateNoiseCalibrationDataPtr ACPValidateNoiseCalibrationData; AbortMeasurementsPtr AbortMeasurements; AnalyzeIQ1WaveformPtr AnalyzeIQ1Waveform; AnalyzeSpectrum1WaveformPtr AnalyzeSpectrum1Waveform; AutoLevelPtr AutoLevel; BuildBandwidthPartStringPtr BuildBandwidthPartString; BuildCORESETClusterStringPtr BuildCORESETClusterString; BuildCORESETStringPtr BuildCORESETString; BuildCarrierStringPtr BuildCarrierString; BuildListStepStringPtr BuildListStepString; BuildListStringPtr BuildListString; BuildOffsetStringPtr BuildOffsetString; BuildPDCCHStringPtr BuildPDCCHString; BuildPDSCHClusterStringPtr BuildPDSCHClusterString; BuildPDSCHStringPtr BuildPDSCHString; BuildPUSCHClusterStringPtr BuildPUSCHClusterString; BuildPUSCHStringPtr BuildPUSCHString; BuildSignalStringPtr BuildSignalString; BuildSubblockStringPtr BuildSubblockString; BuildUserStringPtr BuildUserString; CHPCfgAveragingPtr CHPCfgAveraging; CHPCfgRBWFilterPtr CHPCfgRBWFilter; CHPCfgSweepTimePtr CHPCfgSweepTime; CHPFetchComponentCarrierMeasurementPtr CHPFetchComponentCarrierMeasurement; CHPFetchComponentCarrierMeasurementArrayPtr CHPFetchComponentCarrierMeasurementArray; CHPFetchSpectrumPtr CHPFetchSpectrum; CHPFetchSubblockPowerPtr CHPFetchSubblockPower; CHPFetchTotalAggregatedPowerPtr CHPFetchTotalAggregatedPower; CHPValidateNoiseCalibrationDataPtr CHPValidateNoiseCalibrationData; CfgDigitalEdgeTriggerPtr CfgDigitalEdgeTrigger; CfgExternalAttenuationPtr CfgExternalAttenuation; CfgFrequencyPtr CfgFrequency; CfgFrequencyReferencePtr CfgFrequencyReference; CfgIQPowerEdgeTriggerPtr CfgIQPowerEdgeTrigger; CfgMechanicalAttenuationPtr CfgMechanicalAttenuation; CfgRFPtr CfgRF; CfgRFAttenuationPtr CfgRFAttenuation; CfgReferenceLevelPtr CfgReferenceLevel; CfgSoftwareEdgeTriggerPtr CfgSoftwareEdgeTrigger; CfggNodeBCategoryPtr CfggNodeBCategory; CheckMeasurementStatusPtr CheckMeasurementStatus; ClearAllNamedResultsPtr ClearAllNamedResults; ClearNamedResultPtr ClearNamedResult; ClearNoiseCalibrationDatabasePtr ClearNoiseCalibrationDatabase; CloneSignalConfigurationPtr CloneSignalConfiguration; ClosePtr Close; CommitPtr Commit; CreateListPtr CreateList; CreateListStepPtr CreateListStep; CreateSignalConfigurationPtr CreateSignalConfiguration; DeleteListPtr DeleteList; DeleteSignalConfigurationPtr DeleteSignalConfiguration; DisableTriggerPtr DisableTrigger; GetAllNamedResultNamesPtr GetAllNamedResultNames; GetAttributeF32Ptr GetAttributeF32; GetAttributeF32ArrayPtr GetAttributeF32Array; GetAttributeF64Ptr GetAttributeF64; GetAttributeF64ArrayPtr GetAttributeF64Array; GetAttributeI16Ptr GetAttributeI16; GetAttributeI32Ptr GetAttributeI32; GetAttributeI32ArrayPtr GetAttributeI32Array; GetAttributeI64Ptr GetAttributeI64; GetAttributeI64ArrayPtr GetAttributeI64Array; GetAttributeI8Ptr GetAttributeI8; GetAttributeI8ArrayPtr GetAttributeI8Array; GetAttributeNIComplexDoubleArrayPtr GetAttributeNIComplexDoubleArray; GetAttributeNIComplexSingleArrayPtr GetAttributeNIComplexSingleArray; GetAttributeStringPtr GetAttributeString; GetAttributeU16Ptr GetAttributeU16; GetAttributeU32Ptr GetAttributeU32; GetAttributeU32ArrayPtr GetAttributeU32Array; GetAttributeU64ArrayPtr GetAttributeU64Array; GetAttributeU8Ptr GetAttributeU8; GetAttributeU8ArrayPtr GetAttributeU8Array; GetErrorPtr GetError; GetErrorStringPtr GetErrorString; InitializePtr Initialize; InitializeFromNIRFSASessionPtr InitializeFromNIRFSASession; InitiatePtr Initiate; ModAccAutoLevelPtr ModAccAutoLevel; ModAccCfgMeasurementModePtr ModAccCfgMeasurementMode; ModAccCfgNoiseCompensationEnabledPtr ModAccCfgNoiseCompensationEnabled; ModAccCfgReferenceWaveformPtr ModAccCfgReferenceWaveform; ModAccClearNoiseCalibrationDatabasePtr ModAccClearNoiseCalibrationDatabase; ModAccFetchCompositeEVMPtr ModAccFetchCompositeEVM; ModAccFetchFrequencyErrorMeanPtr ModAccFetchFrequencyErrorMean; ModAccFetchIQGainImbalancePerSubcarrierMeanTracePtr ModAccFetchIQGainImbalancePerSubcarrierMeanTrace; ModAccFetchIQQuadratureErrorPerSubcarrierMeanTracePtr ModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace; ModAccFetchInBandEmissionTracePtr ModAccFetchInBandEmissionTrace; ModAccFetchPBCHDMRSConstellationTracePtr ModAccFetchPBCHDMRSConstellationTrace; ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTracePtr ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTrace; ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTracePtr ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTrace; ModAccFetchPBCHDataConstellationTracePtr ModAccFetchPBCHDataConstellationTrace; ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTracePtr ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTrace; ModAccFetchPBCHDataRMSEVMPerSymbolMeanTracePtr ModAccFetchPBCHDataRMSEVMPerSymbolMeanTrace; ModAccFetchPDSCH1024QAMConstellationTracePtr ModAccFetchPDSCH1024QAMConstellationTrace; ModAccFetchPDSCH16QAMConstellationTracePtr ModAccFetchPDSCH16QAMConstellationTrace; ModAccFetchPDSCH256QAMConstellationTracePtr ModAccFetchPDSCH256QAMConstellationTrace; ModAccFetchPDSCH64QAMConstellationTracePtr ModAccFetchPDSCH64QAMConstellationTrace; ModAccFetchPDSCH8PSKConstellationTracePtr ModAccFetchPDSCH8PSKConstellationTrace; ModAccFetchPDSCHDMRSConstellationTracePtr ModAccFetchPDSCHDMRSConstellationTrace; ModAccFetchPDSCHDataConstellationTracePtr ModAccFetchPDSCHDataConstellationTrace; ModAccFetchPDSCHDemodulatedBitsPtr ModAccFetchPDSCHDemodulatedBits; ModAccFetchPDSCHPTRSConstellationTracePtr ModAccFetchPDSCHPTRSConstellationTrace; ModAccFetchPDSCHQPSKConstellationTracePtr ModAccFetchPDSCHQPSKConstellationTrace; ModAccFetchPSSConstellationTracePtr ModAccFetchPSSConstellationTrace; ModAccFetchPSSRMSEVMPerSubcarrierMeanTracePtr ModAccFetchPSSRMSEVMPerSubcarrierMeanTrace; ModAccFetchPSSRMSEVMPerSymbolMeanTracePtr ModAccFetchPSSRMSEVMPerSymbolMeanTrace; ModAccFetchPUSCHDMRSConstellationTracePtr ModAccFetchPUSCHDMRSConstellationTrace; ModAccFetchPUSCHDataConstellationTracePtr ModAccFetchPUSCHDataConstellationTrace; ModAccFetchPUSCHDemodulatedBitsPtr ModAccFetchPUSCHDemodulatedBits; ModAccFetchPUSCHPTRSConstellationTracePtr ModAccFetchPUSCHPTRSConstellationTrace; ModAccFetchPeakEVMPerSlotMaximumTracePtr ModAccFetchPeakEVMPerSlotMaximumTrace; ModAccFetchPeakEVMPerSubcarrierMaximumTracePtr ModAccFetchPeakEVMPerSubcarrierMaximumTrace; ModAccFetchPeakEVMPerSymbolMaximumTracePtr ModAccFetchPeakEVMPerSymbolMaximumTrace; ModAccFetchRMSEVMHighPerSymbolMeanTracePtr ModAccFetchRMSEVMHighPerSymbolMeanTrace; ModAccFetchRMSEVMLowPerSymbolMeanTracePtr ModAccFetchRMSEVMLowPerSymbolMeanTrace; ModAccFetchRMSEVMPerSlotMeanTracePtr ModAccFetchRMSEVMPerSlotMeanTrace; ModAccFetchRMSEVMPerSubcarrierMeanTracePtr ModAccFetchRMSEVMPerSubcarrierMeanTrace; ModAccFetchRMSEVMPerSymbolMeanTracePtr ModAccFetchRMSEVMPerSymbolMeanTrace; ModAccFetchSSSConstellationTracePtr ModAccFetchSSSConstellationTrace; ModAccFetchSSSRMSEVMPerSubcarrierMeanTracePtr ModAccFetchSSSRMSEVMPerSubcarrierMeanTrace; ModAccFetchSSSRMSEVMPerSymbolMeanTracePtr ModAccFetchSSSRMSEVMPerSymbolMeanTrace; ModAccFetchSpectralFlatnessTracePtr ModAccFetchSpectralFlatnessTrace; ModAccFetchSubblockInBandEmissionTracePtr ModAccFetchSubblockInBandEmissionTrace; ModAccValidateCalibrationDataPtr ModAccValidateCalibrationData; OBWCfgAveragingPtr OBWCfgAveraging; OBWCfgRBWFilterPtr OBWCfgRBWFilter; OBWCfgSweepTimePtr OBWCfgSweepTime; OBWFetchMeasurementPtr OBWFetchMeasurement; OBWFetchSpectrumPtr OBWFetchSpectrum; PVTCfgAveragingPtr PVTCfgAveraging; PVTCfgMeasurementMethodPtr PVTCfgMeasurementMethod; PVTCfgOFFPowerExclusionPeriodsPtr PVTCfgOFFPowerExclusionPeriods; PVTFetchMeasurementPtr PVTFetchMeasurement; PVTFetchMeasurementArrayPtr PVTFetchMeasurementArray; PVTFetchSignalPowerTracePtr PVTFetchSignalPowerTrace; PVTFetchWindowedSignalPowerTracePtr PVTFetchWindowedSignalPowerTrace; ResetAttributePtr ResetAttribute; ResetToDefaultPtr ResetToDefault; SEMCfgAveragingPtr SEMCfgAveraging; SEMCfgComponentCarrierRatedOutputPowerPtr SEMCfgComponentCarrierRatedOutputPower; SEMCfgComponentCarrierRatedOutputPowerArrayPtr SEMCfgComponentCarrierRatedOutputPowerArray; SEMCfgNumberOfOffsetsPtr SEMCfgNumberOfOffsets; SEMCfgOffsetAbsoluteLimitPtr SEMCfgOffsetAbsoluteLimit; SEMCfgOffsetAbsoluteLimitArrayPtr SEMCfgOffsetAbsoluteLimitArray; SEMCfgOffsetBandwidthIntegralPtr SEMCfgOffsetBandwidthIntegral; SEMCfgOffsetBandwidthIntegralArrayPtr SEMCfgOffsetBandwidthIntegralArray; SEMCfgOffsetFrequencyPtr SEMCfgOffsetFrequency; SEMCfgOffsetFrequencyArrayPtr SEMCfgOffsetFrequencyArray; SEMCfgOffsetLimitFailMaskPtr SEMCfgOffsetLimitFailMask; SEMCfgOffsetLimitFailMaskArrayPtr SEMCfgOffsetLimitFailMaskArray; SEMCfgOffsetRBWFilterPtr SEMCfgOffsetRBWFilter; SEMCfgOffsetRBWFilterArrayPtr SEMCfgOffsetRBWFilterArray; SEMCfgOffsetRelativeLimitPtr SEMCfgOffsetRelativeLimit; SEMCfgOffsetRelativeLimitArrayPtr SEMCfgOffsetRelativeLimitArray; SEMCfgSweepTimePtr SEMCfgSweepTime; SEMCfgUplinkMaskTypePtr SEMCfgUplinkMaskType; SEMFetchComponentCarrierMeasurementPtr SEMFetchComponentCarrierMeasurement; SEMFetchComponentCarrierMeasurementArrayPtr SEMFetchComponentCarrierMeasurementArray; SEMFetchLowerOffsetMarginPtr SEMFetchLowerOffsetMargin; SEMFetchLowerOffsetMarginArrayPtr SEMFetchLowerOffsetMarginArray; SEMFetchLowerOffsetPowerPtr SEMFetchLowerOffsetPower; SEMFetchLowerOffsetPowerArrayPtr SEMFetchLowerOffsetPowerArray; SEMFetchMeasurementStatusPtr SEMFetchMeasurementStatus; SEMFetchSpectrumPtr SEMFetchSpectrum; SEMFetchSubblockMeasurementPtr SEMFetchSubblockMeasurement; SEMFetchTotalAggregatedPowerPtr SEMFetchTotalAggregatedPower; SEMFetchUpperOffsetMarginPtr SEMFetchUpperOffsetMargin; SEMFetchUpperOffsetMarginArrayPtr SEMFetchUpperOffsetMarginArray; SEMFetchUpperOffsetPowerPtr SEMFetchUpperOffsetPower; SEMFetchUpperOffsetPowerArrayPtr SEMFetchUpperOffsetPowerArray; SelectMeasurementsPtr SelectMeasurements; SendSoftwareEdgeTriggerPtr SendSoftwareEdgeTrigger; SetAttributeF32Ptr SetAttributeF32; SetAttributeF32ArrayPtr SetAttributeF32Array; SetAttributeF64Ptr SetAttributeF64; SetAttributeF64ArrayPtr SetAttributeF64Array; SetAttributeI16Ptr SetAttributeI16; SetAttributeI32Ptr SetAttributeI32; SetAttributeI32ArrayPtr SetAttributeI32Array; SetAttributeI64Ptr SetAttributeI64; SetAttributeI64ArrayPtr SetAttributeI64Array; SetAttributeI8Ptr SetAttributeI8; SetAttributeI8ArrayPtr SetAttributeI8Array; SetAttributeNIComplexDoubleArrayPtr SetAttributeNIComplexDoubleArray; SetAttributeNIComplexSingleArrayPtr SetAttributeNIComplexSingleArray; SetAttributeStringPtr SetAttributeString; SetAttributeU16Ptr SetAttributeU16; SetAttributeU32Ptr SetAttributeU32; SetAttributeU32ArrayPtr SetAttributeU32Array; SetAttributeU64ArrayPtr SetAttributeU64Array; SetAttributeU8Ptr SetAttributeU8; SetAttributeU8ArrayPtr SetAttributeU8Array; TXPFetchMeasurementPtr TXPFetchMeasurement; TXPFetchPowerTracePtr TXPFetchPowerTrace; WaitForAcquisitionCompletePtr WaitForAcquisitionComplete; WaitForMeasurementCompletePtr WaitForMeasurementComplete; } FunctionLoadStatus; nidevice_grpc::SharedLibrary shared_library_; FunctionPointers function_pointers_; }; } // namespace nirfmxnr_grpc #endif // NIRFMXNR_GRPC_LIBRARY_H
97.656934
304
0.855714
2c985abf255b70811ff6dfe5ec72e4733e0da5ec
1,436
h
C
Dictionary/DictNode/DictNode.h
ma-anjum95/EvilHangman
5deaba215802d25b03f85d397358cf656eb33d64
[ "MIT" ]
1
2015-05-04T17:22:05.000Z
2015-05-04T17:22:05.000Z
Dictionary/DictNode/DictNode.h
ma-anjum95/EvilHangman
5deaba215802d25b03f85d397358cf656eb33d64
[ "MIT" ]
null
null
null
Dictionary/DictNode/DictNode.h
ma-anjum95/EvilHangman
5deaba215802d25b03f85d397358cf656eb33d64
[ "MIT" ]
null
null
null
#ifndef DICTNODE_H #define DICTNODE_H #include <iostream> using namespace std; #ifndef ALPHABETS #define ALPHABETS 27 #endif class DictNode { /* * The boolean which tells us if the node we are looking at * marks the ending of a word or not. * It is initially set to false by default constructor. */ bool is_word; public: /* * The main component of our data structure and forms a tree of * pointer of objects of same class. * Each of the pointer points to individual alphabets of the word. * The pointers from 0 - 25 point to alphabets a - z whereas, the last 26 index is for the " ' " character. */ DictNode *branch[ALPHABETS]; /* * The default constructor of the class Node. * Takes no Parameters. * It sets the "is_word" boolean to false indicating that the node * just created is not an ending of a word. * It also sets each of branch pointer to NULL. */ DictNode(void); /* * This is a method which returns the current boolean state of "is_word" * If we are traversing the data structure and the word we are checking * ends on this node, we can check if it is a word. */ bool isWord(void); /* * This method is called when we want to convert our node into an * ending for a word. * It only sets the "is_word" boolean to true indicating completion of a word. */ void makeWord(void); }; #endif
26.592593
110
0.666435
2ca7b3c884363fa4cd7c3a9ec075bacb385a3419
8,579
h
C
src/Layers/xrRenderPC_R1/FStaticRender.h
acidicMercury8/xray-1.6
52fba7348a93a52ff9694f2c9dd40c0d090e791e
[ "Linux-OpenIB" ]
10
2021-05-04T06:40:27.000Z
2022-01-20T20:24:28.000Z
src/Layers/xrRenderPC_R1/FStaticRender.h
acidicMercury8/xray-1.6
52fba7348a93a52ff9694f2c9dd40c0d090e791e
[ "Linux-OpenIB" ]
null
null
null
src/Layers/xrRenderPC_R1/FStaticRender.h
acidicMercury8/xray-1.6
52fba7348a93a52ff9694f2c9dd40c0d090e791e
[ "Linux-OpenIB" ]
2
2020-05-17T10:01:14.000Z
2020-09-11T20:17:27.000Z
#pragma once #include "../xrRender/r__dsgraph_structure.h" #include "../xrRender/PSLibrary.h" #include "../xrRender/hom.h" #include "../xrRender/detailmanager.h" #include "glowmanager.h" #include "../xrRender/wallmarksengine.h" #include "fstaticrender_rendertarget.h" #include "../xrRender/modelpool.h" #include "lightShadows.h" #include "lightProjector.h" #include "lightPPA.h" #include "../xrRender/light_DB.h" #include "../../xrEngine/fmesh.h" class dxRender_Visual; // definition class CRender : public R_dsgraph_structure { public: enum { PHASE_NORMAL, PHASE_POINT, PHASE_SPOT }; struct _options { u32 vis_intersect : 1; // config u32 distortion : 1; // run-time modified u32 color_mapping : 1; // true if SM 1.4 and higher u32 disasm : 1; // config u32 forceskinw : 1; // config u32 no_detail_textures : 1; // config } o; struct _stats { u32 o_queries, o_culled; } stats; public: // Sector detection and visibility CSector* pLastSector; Fvector vLastCameraPos; u32 uLastLTRACK; xr_vector<IRender_Portal*> Portals; xr_vector<IRender_Sector*> Sectors; xrXRC Sectors_xrc; CDB::MODEL* rmPortals; CHOM HOM; //. R_occlusion HWOCC; // Global containers xr_vector<FSlideWindowItem> SWIs; xr_vector<ref_shader> Shaders; typedef svector<D3DVERTEXELEMENT9,MAXD3DDECLLENGTH+1> VertexDeclarator; xr_vector<VertexDeclarator> DCL; xr_vector<IDirect3DVertexBuffer9*> VB; xr_vector<IDirect3DIndexBuffer9*> IB; xr_vector<dxRender_Visual*> Visuals; CPSLibrary PSLibrary; CLight_DB* L_DB; CLightR_Manager* L_Dynamic; CLightShadows* L_Shadows; CLightProjector* L_Projector; CGlowManager* L_Glows; CWallmarksEngine* Wallmarks; CDetailManager* Details; CModelPool* Models; CRenderTarget* Target; // Render-target // R1-specific global constants Fmatrix r1_dlight_tcgen ; light* r1_dlight_light ; float r1_dlight_scale ; cl_light_PR r1_dlight_binder_PR ; cl_light_C r1_dlight_binder_color ; cl_light_XFORM r1_dlight_binder_xform ; shared_str c_ldynamic_props ; bool m_bMakeAsyncSS; bool m_bFirstFrameAfterReset; // Determines weather the frame is the first after resetting device. private: // Loading / Unloading void LoadBuffers (CStreamReader *fs); void LoadVisuals (IReader *fs); void LoadLights (IReader *fs); void LoadSectors (IReader *fs); void LoadSWIs (CStreamReader *fs); BOOL add_Dynamic (dxRender_Visual *pVisual, u32 planes); // normal processing void add_Static (dxRender_Visual *pVisual, u32 planes); void add_leafs_Dynamic (dxRender_Visual *pVisual); // if detected node's full visibility void add_leafs_Static (dxRender_Visual *pVisual); // if detected node's full visibility public: ShaderElement* rimp_select_sh_static (dxRender_Visual *pVisual, float cdist_sq); ShaderElement* rimp_select_sh_dynamic (dxRender_Visual *pVisual, float cdist_sq); D3DVERTEXELEMENT9* getVB_Format (int id); IDirect3DVertexBuffer9* getVB (int id); IDirect3DIndexBuffer9* getIB (int id); FSlideWindowItem* getSWI (int id); IRender_Portal* getPortal (int id); IRender_Sector* getSectorActive (); IRenderVisual* model_CreatePE (LPCSTR name); void ApplyBlur4 (FVF::TL4uv* dest, u32 w, u32 h, float k); void apply_object (IRenderable* O); IC void apply_lmaterial () {}; public: // feature level virtual GenerationLevel get_generation () { return IRender_interface::GENERATION_R1; } virtual DWORD get_dx_level () { return 0x00090000; } virtual bool is_sun_static () {return true;} // Loading / Unloading virtual void create (); virtual void destroy (); virtual void reset_begin (); virtual void reset_end (); virtual void level_Load (IReader*); virtual void level_Unload (); virtual IDirect3DBaseTexture9* texture_load (LPCSTR fname, u32& msize); virtual HRESULT shader_compile ( LPCSTR name, DWORD const* pSrcData, UINT SrcDataLen, LPCSTR pFunctionName, LPCSTR pTarget, DWORD Flags, void*& result ); // Information virtual void Statistics (CGameFont* F); virtual LPCSTR getShaderPath () { return "r1\\"; } virtual ref_shader getShader (int id); virtual IRender_Sector* getSector (int id); virtual IRenderVisual* getVisual (int id); virtual IRender_Sector* detectSector (const Fvector& P); int translateSector (IRender_Sector* pSector); virtual IRender_Target* getTarget (); // Main virtual void flush (); virtual void set_Object (IRenderable* O ); virtual void add_Occluder (Fbox2& bb_screenspace ); // mask screen region as oclluded virtual void add_Visual (IRenderVisual* V ); // add visual leaf (no culling performed at all) virtual void add_Geometry (IRenderVisual* V ); // add visual(s) (all culling performed) // wallmarks virtual void add_StaticWallmark (ref_shader& S, const Fvector& P, float s, CDB::TRI* T, Fvector* V); virtual void add_StaticWallmark (IWallMarkArray *pArray, const Fvector& P, float s, CDB::TRI* T, Fvector* V); virtual void add_StaticWallmark (const wm_shader& S, const Fvector& P, float s, CDB::TRI* T, Fvector* V); virtual void clear_static_wallmarks (); virtual void add_SkeletonWallmark (intrusive_ptr<CSkeletonWallmark> wm); virtual void add_SkeletonWallmark (const Fmatrix* xf, CKinematics* obj, ref_shader& sh, const Fvector& start, const Fvector& dir, float size); virtual void add_SkeletonWallmark (const Fmatrix* xf, IKinematics* obj, IWallMarkArray *pArray, const Fvector& start, const Fvector& dir, float size); // virtual IBlender* blender_create (CLASS_ID cls); virtual void blender_destroy (IBlender* &); // virtual IRender_ObjectSpecific* ros_create (IRenderable* parent); virtual void ros_destroy (IRender_ObjectSpecific* &); // Particle library virtual CPSLibrary* ps_library (){return &PSLibrary;} // Lighting virtual IRender_Light* light_create (); virtual IRender_Glow* glow_create (); // Models virtual IRenderVisual* model_CreateParticles (LPCSTR name); virtual IRender_DetailModel* model_CreateDM (IReader*F); virtual IRenderVisual* model_Create (LPCSTR name, IReader*data=0); virtual IRenderVisual* model_CreateChild (LPCSTR name, IReader*data); virtual IRenderVisual* model_Duplicate (IRenderVisual* V); virtual void model_Delete (IRenderVisual* & V, BOOL bDiscard); virtual void model_Delete (IRender_DetailModel* & F); virtual void model_Logging (BOOL bEnable) { Models->Logging(bEnable); } virtual void models_Prefetch (); virtual void models_Clear (BOOL b_complete); // Occlusion culling virtual BOOL occ_visible (vis_data& V); virtual BOOL occ_visible (Fbox& B); virtual BOOL occ_visible (sPoly& P); // Main virtual void Calculate (); virtual void Render (); virtual void Screenshot (ScreenshotMode mode=SM_NORMAL, LPCSTR name = 0); virtual void Screenshot (ScreenshotMode mode, CMemoryWriter& memory_writer); virtual void ScreenshotAsyncBegin (); virtual void ScreenshotAsyncEnd (CMemoryWriter& memory_writer); virtual void _BCL OnFrame (); // Render mode virtual void rmNear (); virtual void rmFar (); virtual void rmNormal (); // Constructor/destructor/loader CRender (); virtual ~CRender (); protected: virtual void ScreenshotImpl (ScreenshotMode mode, LPCSTR name, CMemoryWriter* memory_writer); private: FS_FileSet m_file_set; }; extern CRender RImplementation;
38.644144
157
0.641333
d610ccf681c223a322ddbce7c9654a2d16ac944f
1,353
c
C
source/build.c
geniiii/NorthstarCLauncher
24746f276b46aa71e85e6fb755fdbc8f4da162c3
[ "MIT" ]
null
null
null
source/build.c
geniiii/NorthstarCLauncher
24746f276b46aa71e85e6fb755fdbc8f4da162c3
[ "MIT" ]
null
null
null
source/build.c
geniiii/NorthstarCLauncher
24746f276b46aa71e85e6fb755fdbc8f4da162c3
[ "MIT" ]
null
null
null
#define BUILD_WIN32 1 //~ Windows headers // NOTE(geni): 0x0601 = Windows 7 #define UNICODE #define WINVER 0x0601 #define _WIN32_WINNT 0x0601 #define PSAPI_VERSION 2 #define NOATOM #define NOHELP #define NOPROFILER #define NOGDICAPMASKS #define NOATOM #define NOSERVICE #define NOMETAFILE #define NOMINMAX #define NOKANJI #define NODRAWTEXT #define NOCOLOR #define NOSYSMETRICS #define NOMENUS #define NOKEYSTATES #define NOWH #define NOCOMM #define NOMCX #define NOIME #define NODEFERWINDOWPOS #define NOMEMMGR #define NOSOUND #define NOWH #define NOWINMESSAGES #define NOVIRTUALKEYCODES #define NOWINSTYLES #define NOICONS #define NOCLIPBOARD #define NOKERNEL #define NOSHOWWINDOW #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <Tlhelp32.h> #undef DeleteFile #undef CopyFile #define MemoryCopy CopyMemory #define MemoryMove MoveMemory #define MemorySet FillMemory #include <stdint.h> #include <stdio.h> #include <string.h> #include "language_layer.h" #include "memory.h" #include "string8.h" #include "string16.h" #define STB_SPRINTF_STATIC #define STB_SPRINTF_IMPLEMENTATION #include "ext/stb_sprintf.h" #include "win32/win32_memory.c" #include "memory.c" #include "cstrings.c" #include "string8.c" #include "string16.c" #include "log.c" #include "win32/win32_utilities.c" #include "win32/win32_file_io.c" #include "main.c"
18.791667
34
0.790096
326124405192d82b30690215aba994075394fc19
4,367
h
C
AppBarProductivity/src/MainFrm.h
v1nns/AppBarProductivity
deb6dafe8fc39ac56feb5fb01dffa5041e600a93
[ "MIT" ]
1
2019-11-26T01:33:03.000Z
2019-11-26T01:33:03.000Z
AppBarProductivity/src/MainFrm.h
v1nns/AppBarProductivity
deb6dafe8fc39ac56feb5fb01dffa5041e600a93
[ "MIT" ]
null
null
null
AppBarProductivity/src/MainFrm.h
v1nns/AppBarProductivity
deb6dafe8fc39ac56feb5fb01dffa5041e600a93
[ "MIT" ]
null
null
null
// MainFrm.h : interface of the CMainFrame class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MAINFRM_H__0BAAEE30_BBE0_4BED_AC03_EA45087CEC77__INCLUDED_) #define AFX_MAINFRM_H__0BAAEE30_BBE0_4BED_AC03_EA45087CEC77__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "resource.h" #include "TaskLoader.h" #include "CatListBox.h" #include "InsertTaskDialog.h" #include "PushPin.h" #include "BtnST.h" #include "FPSMiniCalendar\FPSMiniCalendarCtrl.h" #include "WMDateCtrl\WMDateCtrl.h" #include "ScintillaEditor\ScintillaWnd.h" #include "PropertySheet\EnTabCtrl.h" #include "PropertySheet\TabCtrl\TabCtrl.h" #include "ToolTip\XSuperTooltip.h" #define ID_RESOURCE_PINBUTTON 200 #define ID_RESOURCE_SEARCHEDIT 201 #define ID_RESOURCE_CALENDAR 202 #define ID_RESOURCE_CALENDARBUTTON 203 #define ID_RESOURCE_NOTEPAD 300 #define ID_RESOURCE_NOTEPAD_NEWPAGE 301 #define ID_RESOURCE_AGENDA 400 #define ID_RESOURCE_AGENDA_PAGE_1 401 #define ID_RESOURCE_AGENDA_PAGE_2 402 #define APPBAR_INSERTTASK WM_APP + 10000 #define APPBAR_LOADTASKTREE WM_APP + 10001 #define APPBAR_SAVETASKTREE WM_APP + 10002 #define SIZE_VALUE_SEARCHEDIT 30 #define SIZE_VALUE_CALENDAR 130 #define SIZE_VALUE_TABCONTROLTASKS 365 #define SIZE_VALUE_TABCONTROLNOTEPAD 130 class CMainFrame : public CFrameWnd, public TabCtrlNotify { public: CMainFrame(); virtual ~CMainFrame(); protected: DECLARE_DYNAMIC(CMainFrame) // Operations protected: void EraseBackground(CDC *pDC); void DrawNotepadBkgnd(CDC *pDC); void DrawAgendaBkgnd(CDC *pDC); // Agenda private: void InitializeAgenda(); void OnInsertTask(); void OnLoadAgenda(); void OnSaveAgenda(); void OnUpdateAgendaTabs(); // Notepad private: void InitializeNotepad(); // Pin Button private: void InitializePinButton(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMainFrame) virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL PreTranslateMessage(MSG* pMsg); //}}AFX_VIRTUAL // Generated message map functions protected: //{{AFX_MSG(CMainFrame) afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); //}}AFX_MSG afx_msg void OnDynamicButtonClicked(); afx_msg void OnCalendarDblClk(NMHDR* pNMHDR, LRESULT* pResult); afx_msg LRESULT OnCalendarHoveringToday(WPARAM wparam, LPARAM lparam); afx_msg void OnTabSaveDoc(); DECLARE_MESSAGE_MAP() private: // TabCtrlNotify. virtual void OnCloseButtonClicked(TabCtrl *pCtrl, CRect const *pRect, CPoint ptScr); virtual void OnMenuButtonClicked(TabCtrl *pCtrl, CRect const *pRect, CPoint ptScr); virtual void OnAddTabButtonClicked(TabCtrl * pCtrl, CRect const * pRect, CPoint ptScr); virtual void OnDrag(TabCtrl *pCtrl, HTAB hTab, CPoint ptScr, bool outside); // Attributes private: //Mutex CMutex* m_pToolTipMutex; //Calendar CFPSMiniCalendarCtrl m_Calendar; CRect m_RectToday; bool m_IsShowingTip; //Tasks std::vector<Task> m_ListTasks; CCatListBox m_TabTotal, m_TabMonthly; TabCtrl m_TabControlTasks; TabCtrlStyle_VS2010_bars style; //TabCtrlStyle_VS2008_bars_silver style; std::vector<Task> m_TodayTaskList; //Notepad HINSTANCE m_hDll; std::vector<CScintillaWnd*> m_ListNotepad; TabCtrl m_TabControlCustomPad; HACCEL m_hAccelNotepad; // handle to accelerator table // Pin Button CPushPinButton m_PinButton; // Calendar Button CButtonST m_CalendarButton; // Tooltip CXSuperTooltip m_Tip; // Variables bool m_isPinned; int m_Palette; CBrush m_ClearColor, m_WhiteColor; bool m_bPoint; CFont m_FontTitle, m_FontSubtitle, m_FontText, m_FontTasks; }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MAINFRM_H__0BAAEE30_BBE0_4BED_AC03_EA45087CEC77__INCLUDED_)
25.389535
97
0.758873
d2d87f96b5a3a71fa8368e6417261bdfceab2e10
864
h
C
common/cpp/crypto/crypto.h
AYCH-Inc/aych.hyperava
d469ec35214f9db3ce4b0294ede2dc56ef5ed380
[ "Apache-2.0" ]
2
2019-11-06T05:45:26.000Z
2020-12-16T06:02:30.000Z
common/cpp/crypto/crypto.h
AYCH-Inc/aych.hyperava
d469ec35214f9db3ce4b0294ede2dc56ef5ed380
[ "Apache-2.0" ]
null
null
null
common/cpp/crypto/crypto.h
AYCH-Inc/aych.hyperava
d469ec35214f9db3ce4b0294ede2dc56ef5ed380
[ "Apache-2.0" ]
2
2019-09-14T06:00:29.000Z
2020-04-02T10:21:42.000Z
/* Copyright 2018 Intel Corporation * * 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 <openssl/sha.h> #include "crypto_shared.h" #include "crypto_utils.h" #include "pkenc.h" #include "pkenc_private_key.h" #include "pkenc_public_key.h" #include "sig.h" #include "sig_private_key.h" #include "sig_public_key.h" #include "skenc.h"
30.857143
75
0.746528
300c84a3fe03a19ec54448af97a8dfa4695168f2
5,138
h
C
net/tools/flip_server/mem_cache.h
kurli/chromium-crosswalk
f4c5d15d49d02b74eb834325e4dff50b16b53243
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
net/tools/flip_server/mem_cache.h
kurli/chromium-crosswalk
f4c5d15d49d02b74eb834325e4dff50b16b53243
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
net/tools/flip_server/mem_cache.h
kurli/chromium-crosswalk
f4c5d15d49d02b74eb834325e4dff50b16b53243
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2011 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 NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ #define NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_ #include <map> #include <string> #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "net/tools/flip_server/balsa_headers.h" #include "net/tools/flip_server/balsa_visitor_interface.h" #include "net/tools/flip_server/constants.h" namespace net { class StoreBodyAndHeadersVisitor: public BalsaVisitorInterface { public: void HandleError() { error_ = true; } // BalsaVisitorInterface: virtual void ProcessBodyInput(const char *input, size_t size) OVERRIDE {} virtual void ProcessBodyData(const char *input, size_t size) OVERRIDE; virtual void ProcessHeaderInput(const char *input, size_t size) OVERRIDE {} virtual void ProcessTrailerInput(const char *input, size_t size) OVERRIDE {} virtual void ProcessHeaders(const BalsaHeaders& headers) OVERRIDE { // nothing to do here-- we're assuming that the BalsaFrame has // been handed our headers. } virtual void ProcessRequestFirstLine(const char* line_input, size_t line_length, const char* method_input, size_t method_length, const char* request_uri_input, size_t request_uri_length, const char* version_input, size_t version_length) OVERRIDE {} virtual void ProcessResponseFirstLine(const char *line_input, size_t line_length, const char *version_input, size_t version_length, const char *status_input, size_t status_length, const char *reason_input, size_t reason_length) OVERRIDE {} virtual void ProcessChunkLength(size_t chunk_length) OVERRIDE {} virtual void ProcessChunkExtensions(const char *input, size_t size) OVERRIDE {} virtual void HeaderDone() OVERRIDE {} virtual void MessageDone() OVERRIDE {} virtual void HandleHeaderError(BalsaFrame* framer) OVERRIDE; virtual void HandleHeaderWarning(BalsaFrame* framer) OVERRIDE; virtual void HandleChunkingError(BalsaFrame* framer) OVERRIDE; virtual void HandleBodyError(BalsaFrame* framer) OVERRIDE; BalsaHeaders headers; std::string body; bool error_; }; //////////////////////////////////////////////////////////////////////////////// class FileData { public: FileData(); FileData(const BalsaHeaders* headers, const std::string& filename, const std::string& body); ~FileData(); BalsaHeaders* headers() { return headers_.get(); } const BalsaHeaders* headers() const { return headers_.get(); } const std::string& filename() { return filename_; } const std::string& body() { return body_; } private: scoped_ptr<BalsaHeaders> headers_; std::string filename_; std::string body_; DISALLOW_COPY_AND_ASSIGN(FileData); }; //////////////////////////////////////////////////////////////////////////////// class MemCacheIter { public: MemCacheIter() : file_data(NULL), priority(0), transformed_header(false), body_bytes_consumed(0), stream_id(0), max_segment_size(kInitialDataSendersThreshold), bytes_sent(0) {} explicit MemCacheIter(FileData* fd) : file_data(fd), priority(0), transformed_header(false), body_bytes_consumed(0), stream_id(0), max_segment_size(kInitialDataSendersThreshold), bytes_sent(0) {} FileData* file_data; int priority; bool transformed_header; size_t body_bytes_consumed; uint32 stream_id; uint32 max_segment_size; size_t bytes_sent; }; //////////////////////////////////////////////////////////////////////////////// class MemoryCache { public: typedef std::map<std::string, FileData*> Files; public: MemoryCache(); virtual ~MemoryCache(); void CloneFrom(const MemoryCache& mc); void AddFiles(); // virtual for unittests virtual void ReadToString(const char* filename, std::string* output); void ReadAndStoreFileContents(const char* filename); FileData* GetFileData(const std::string& filename); bool AssignFileData(const std::string& filename, MemCacheIter* mci); // For unittests void InsertFile(const BalsaHeaders* headers, const std::string& filename, const std::string& body); private: void InsertFile(FileData* file_data); void ClearFiles(); Files files_; std::string cwd_; }; class NotifierInterface { public: virtual ~NotifierInterface() {} virtual void Notify() = 0; }; } // namespace net #endif // NET_TOOLS_FLIP_SERVER_MEM_CACHE_H_
32.1125
80
0.619696
5ccace2a4ec9f831569aed22495eb67606fc1af5
2,094
h
C
System/Library/Frameworks/MetalPerformanceShadersGraph.framework/MPSGraphTensor.h
lechium/tvOS142Headers
c7696f6d760e4822f61b9f2c2adcd18749700fda
[ "MIT" ]
1
2020-11-11T06:05:23.000Z
2020-11-11T06:05:23.000Z
System/Library/Frameworks/MetalPerformanceShadersGraph.framework/MPSGraphTensor.h
lechium/tvOS142Headers
c7696f6d760e4822f61b9f2c2adcd18749700fda
[ "MIT" ]
null
null
null
System/Library/Frameworks/MetalPerformanceShadersGraph.framework/MPSGraphTensor.h
lechium/tvOS142Headers
c7696f6d760e4822f61b9f2c2adcd18749700fda
[ "MIT" ]
null
null
null
/* * This header is generated by classdump-dyld 1.5 * on Tuesday, November 10, 2020 at 10:19:02 PM Mountain Standard Time * Operating System: Version 14.2 (Build 18K57) * Image Source: /System/Library/Frameworks/MetalPerformanceShadersGraph.framework/MetalPerformanceShadersGraph * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley. */ #import <MetalPerformanceShadersGraph/MetalPerformanceShadersGraph-Structs.h> #import <libobjc.A.dylib/NSCopying.h> @class MPSGraphOperation, NSArray, NSString; @interface MPSGraphTensor : NSObject <NSCopying> { Value _value; MPSGraphOperation* _operation; unsigned _dataType; unsigned long long _index; NSArray* _shape; NSString* _name; } @property (nonatomic,readonly) NSString * name; //@synthesize name=_name - In the implementation block @property (nonatomic,readonly) Value value; //@synthesize value=_value - In the implementation block @property (nonatomic,readonly) unsigned long long index; //@synthesize index=_index - In the implementation block @property (nonatomic,copy,readonly) NSArray * shape; //@synthesize shape=_shape - In the implementation block @property (nonatomic,readonly) unsigned dataType; //@synthesize dataType=_dataType - In the implementation block @property (nonatomic,__weak,readonly) MPSGraphOperation * operation; //@synthesize operation=_operation - In the implementation block -(NSString *)name; -(id)copyWithZone:(NSZone*)arg1 ; -(id)debugDescription; -(Value)value; -(unsigned long long)index; -(MPSGraphOperation *)operation; -(unsigned)dataType; -(NSArray *)shape; -(id)initTensorWithOperation:(id)arg1 value:(Value)arg2 name:(id)arg3 ; -(id)initTensorWithValue:(Value)arg1 ; -(id)initTensorWithOperation:(id)arg1 value:(Value)arg2 ; @end
47.590909
146
0.668577
65f3e4bf896fae43561c33b0921c27ed7d6e0d36
8,136
h
C
coffee_machine/mpu/HALCoGen_EMAC_Driver_with_lwIP_Demonstration/v00.03.00/TMS570LS31x/HALCoGen-TMS570LS31x/include/reg_mibspi.h
daeroro/IntegrationProject
3b37f31e172cf4411ad0c2481e154e5facfb4d1e
[ "MIT" ]
null
null
null
coffee_machine/mpu/HALCoGen_EMAC_Driver_with_lwIP_Demonstration/v00.03.00/TMS570LS31x/HALCoGen-TMS570LS31x/include/reg_mibspi.h
daeroro/IntegrationProject
3b37f31e172cf4411ad0c2481e154e5facfb4d1e
[ "MIT" ]
null
null
null
coffee_machine/mpu/HALCoGen_EMAC_Driver_with_lwIP_Demonstration/v00.03.00/TMS570LS31x/HALCoGen-TMS570LS31x/include/reg_mibspi.h
daeroro/IntegrationProject
3b37f31e172cf4411ad0c2481e154e5facfb4d1e
[ "MIT" ]
2
2019-04-29T01:05:25.000Z
2019-04-29T02:45:44.000Z
/** @file reg_mibspi.h * @brief MIBSPI Register Layer Header File * @date 20.May.2014 * @version 04.00.00 * * This file contains: * - Definitions * - Types * - Interface Prototypes * . * which are relevant for the MIBSPI driver. */ /* (c) Texas Instruments 2009-2014, All rights reserved. */ #ifndef __REG_MIBSPI_H__ #define __REG_MIBSPI_H__ #include "sys_common.h" #include "reg_gio.h" /* USER CODE BEGIN (0) */ /* USER CODE END */ /* Mibspi Register Frame Definition */ /** @struct mibspiBase * @brief MIBSPI Register Definition * * This structure is used to access the MIBSPI module registers. */ /** @typedef mibspiBASE_t * @brief MIBSPI Register Frame Type Definition * * This type is used to access the MIBSPI Registers. */ typedef volatile struct mibspiBase { uint32 GCR0; /**< 0x0000: Global Control 0 */ uint32 GCR1; /**< 0x0004: Global Control 1 */ uint32 INT0; /**< 0x0008: Interrupt Register */ uint32 LVL; /**< 0x000C: Interrupt Level */ uint32 FLG; /**< 0x0010: Interrupt flags */ uint32 PC0; /**< 0x0014: Function Pin Enable */ uint32 PC1; /**< 0x0018: Pin Direction */ uint32 PC2; /**< 0x001C: Pin Input Latch */ uint32 PC3; /**< 0x0020: Pin Output Latch */ uint32 PC4; /**< 0x0024: Output Pin Set */ uint32 PC5; /**< 0x0028: Output Pin Clr */ uint32 PC6; /**< 0x002C: Open Drain Output Enable */ uint32 PC7; /**< 0x0030: Pullup/Pulldown Disable */ uint32 PC8; /**< 0x0034: Pullup/Pulldown Selection */ uint32 DAT0; /**< 0x0038: Transmit Data */ uint32 DAT1; /**< 0x003C: Transmit Data with Format and Chip Select */ uint32 BUF; /**< 0x0040: Receive Buffer */ uint32 EMU; /**< 0x0044: Emulation Receive Buffer */ uint32 DELAY; /**< 0x0048: Delays */ uint32 DEF; /**< 0x004C: Default Chip Select */ uint32 FMT0; /**< 0x0050: Data Format 0 */ uint32 FMT1; /**< 0x0054: Data Format 1 */ uint32 FMT2; /**< 0x0058: Data Format 2 */ uint32 FMT3; /**< 0x005C: Data Format 3 */ uint32 INTVECT0; /**< 0x0060: Interrupt Vector 0 */ uint32 INTVECT1; /**< 0x0064: Interrupt Vector 1 */ uint32 SRSEL; /**< 0x0068: Slew Rate Select */ uint32 PMCTRL; /**< 0x006C: Parallel Mode Control */ uint32 MIBSPIE; /**< 0x0070: Multi-buffer Mode Enable */ uint32 TGITENST; /**< 0x0074: TG Interrupt Enable Set */ uint32 TGITENCR; /**< 0x0078: TG Interrupt Enable Clear */ uint32 TGITLVST; /**< 0x007C: Transfer Group Interrupt Level Set */ uint32 TGITLVCR; /**< 0x0080: Transfer Group Interrupt Level Clear */ uint32 TGINTFLG; /**< 0x0084: Transfer Group Interrupt Flag */ uint32 rsvd1[2U]; /**< 0x0088: Reserved */ uint32 TICKCNT; /**< 0x0090: Tick Counter */ uint32 LTGPEND; /**< 0x0090: Last TG End Pointer */ uint32 TGCTRL[16U]; /**< 0x0098 - 0x00D4: Transfer Group Control */ uint32 DMACTRL[8U]; /**< 0x00D8 - 0x00F4: DMA Control */ uint32 DMACOUNT[8U]; /**< 0x00F8 - 0x0114: DMA Count */ uint32 DMACNTLEN; /**< 0x0118 - 0x0114: DMA Control length */ uint32 rsvd2; /**< 0x011C: Reserved */ uint32 UERRCTRL; /**< 0x0120: Multi-buffer RAM Uncorrectable Parity Error Control */ uint32 UERRSTAT; /**< 0x0124: Multi-buffer RAM Uncorrectable Parity Error Status */ uint32 UERRADDRRX; /**< 0x0128: RXRAM Uncorrectable Parity Error Address */ uint32 UERRADDRTX; /**< 0x012C: TXRAM Uncorrectable Parity Error Address */ uint32 RXOVRN_BUF_ADDR; /**< 0x0130: RXRAM Overrun Buffer Address */ uint32 IOLPKTSTCR; /**< 0x0134: IO loopback */ uint32 EXT_PRESCALE1; /**< 0x0138: */ uint32 EXT_PRESCALE2; /**< 0x013C: */ } mibspiBASE_t; /** @def mibspiREG1 * @brief MIBSPI1 Register Frame Pointer * * This pointer is used by the MIBSPI driver to access the mibspi module registers. */ #define mibspiREG1 ((mibspiBASE_t *)0xFFF7F400U) /** @def mibspiPORT1 * @brief MIBSPI1 GIO Port Register Pointer * * Pointer used by the GIO driver to access I/O PORT of MIBSPI1 * (use the GIO drivers to access the port pins). */ #define mibspiPORT1 ((gioPORT_t *)0xFFF7F418U) /** @def mibspiREG3 * @brief MIBSPI3 Register Frame Pointer * * This pointer is used by the MIBSPI driver to access the mibspi module registers. */ #define mibspiREG3 ((mibspiBASE_t *)0xFFF7F800U) /** @def mibspiPORT3 * @brief MIBSPI3 GIO Port Register Pointer * * Pointer used by the GIO driver to access I/O PORT of MIBSPI3 * (use the GIO drivers to access the port pins). */ #define mibspiPORT3 ((gioPORT_t *)0xFFF7F818U) /** @def mibspiREG5 * @brief MIBSPI5 Register Frame Pointer * * This pointer is used by the MIBSPI driver to access the mibspi module registers. */ #define mibspiREG5 ((mibspiBASE_t *)0xFFF7FC00U) /** @def mibspiPORT5 * @brief MIBSPI5 GIO Port Register Pointer * * Pointer used by the GIO driver to access I/O PORT of MIBSPI5 * (use the GIO drivers to access the port pins). */ #define mibspiPORT5 ((gioPORT_t *)0xFFF7FC18U) /** @struct mibspiRamBase * @brief MIBSPI Buffer RAM Definition * * This structure is used to access the MIBSPI buffer memory. */ /** @typedef mibspiRAM_t * @brief MIBSPI RAM Type Definition * * This type is used to access the MIBSPI RAM. */ typedef volatile struct mibspiRamBase { struct { #if ((__little_endian__ == 1) || (__LITTLE_ENDIAN__ == 1)) uint16 data; /**< tx buffer data */ uint16 control; /**< tx buffer control */ #else uint16 control; /**< tx buffer control */ uint16 data; /**< tx buffer data */ #endif } tx[128]; struct { #if ((__little_endian__ == 1) || (__LITTLE_ENDIAN__ == 1)) uint16 data; /**< rx buffer data */ uint16 flags; /**< rx buffer flags */ #else uint16 flags; /**< rx buffer flags */ uint16 data; /**< rx buffer data */ #endif } rx[128]; } mibspiRAM_t; /** @def mibspiRAM1 * @brief MIBSPI1 Buffer RAM Pointer * * This pointer is used by the MIBSPI driver to access the mibspi buffer memory. */ #define mibspiRAM1 ((mibspiRAM_t *)0xFF0E0000U) /** @def mibspiRAM3 * @brief MIBSPI3 Buffer RAM Pointer * * This pointer is used by the MIBSPI driver to access the mibspi buffer memory. */ #define mibspiRAM3 ((mibspiRAM_t *)0xFF0C0000U) /** @def mibspiRAM5 * @brief MIBSPI5 Buffer RAM Pointer * * This pointer is used by the MIBSPI driver to access the mibspi buffer memory. */ #define mibspiRAM5 ((mibspiRAM_t *)0xFF0A0000U) /** @def mibspiPARRAM1 * @brief MIBSPI1 Buffer RAM PARITY Pointer * * This pointer is used by the MIBSPI driver to access the mibspi buffer memory. */ #define mibspiPARRAM1 (*(volatile uint32 *)(0xFF0E0000U + 0x00000400U)) /** @def mibspiPARRAM3 * @brief MIBSPI3 Buffer RAM PARITY Pointer * * This pointer is used by the MIBSPI driver to access the mibspi buffer memory. */ #define mibspiPARRAM3 (*(volatile uint32 *)(0xFF0C0000U + 0x00000400U)) /** @def mibspiPARRAM5 * @brief MIBSPI5 Buffer RAM PARITY Pointer * * This pointer is used by the MIBSPI driver to access the mibspi buffer memory. */ #define mibspiPARRAM5 (*(volatile uint32 *)(0xFF0A0000U + 0x00000400U)) /* USER CODE BEGIN (1) */ /* USER CODE END */ #endif
36.16
104
0.592429
a925b857050fadfdba01a326220f3f91992e4b1c
223
h
C
type.h
leesoft-mirage/LavaX_OS_GBA
012dd9fc4e7b7ebad15f7b39cf192ddcb158091c
[ "MIT" ]
16
2015-10-28T04:57:50.000Z
2021-01-30T10:51:16.000Z
type.h
leesoft-mirage/LavaX_OS_GBA
012dd9fc4e7b7ebad15f7b39cf192ddcb158091c
[ "MIT" ]
null
null
null
type.h
leesoft-mirage/LavaX_OS_GBA
012dd9fc4e7b7ebad15f7b39cf192ddcb158091c
[ "MIT" ]
7
2017-03-14T16:38:06.000Z
2021-02-04T12:19:55.000Z
#ifndef _TYPE_H #define _TYPE_H 1 typedef unsigned char u8; typedef unsigned short u16; typedef unsigned long u32; typedef unsigned char byte; typedef unsigned short word; typedef unsigned long a32; #endif /* type.h */
15.928571
28
0.7713
659b88b9745ed1d0d2e826ae22f43200526dfaa7
1,389
h
C
include/il2cpp/Dpr/Battle/View/Systems/BattleViewUISystem/_CloseStatusWindow_d__193.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
1
2022-01-15T20:20:27.000Z
2022-01-15T20:20:27.000Z
include/il2cpp/Dpr/Battle/View/Systems/BattleViewUISystem/_CloseStatusWindow_d__193.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
include/il2cpp/Dpr/Battle/View/Systems/BattleViewUISystem/_CloseStatusWindow_d__193.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
#pragma once #include "il2cpp.h" void Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193___ctor (Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193_o* __this, int32_t __1__state, const MethodInfo* method_info); void Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193__System_IDisposable_Dispose (Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193_o* __this, const MethodInfo* method_info); bool Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193__MoveNext (Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193_o* __this, const MethodInfo* method_info); Il2CppObject* Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193__System_Collections_Generic_IEnumerator_System_Object__get_Current (Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193_o* __this, const MethodInfo* method_info); void Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193__System_Collections_IEnumerator_Reset (Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193_o* __this, const MethodInfo* method_info); Il2CppObject* Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193__System_Collections_IEnumerator_get_Current (Dpr_Battle_View_Systems_BattleViewUISystem__CloseStatusWindow_d__193_o* __this, const MethodInfo* method_info);
126.272727
262
0.932325
aa96019284079f2f466b0403d50cc24c7677ad8e
18,610
h
C
doc/veb/FTL.h
covrom/cmemdb
7ce8ad2ae497c79916020c68bdf8a167374245b6
[ "MIT" ]
null
null
null
doc/veb/FTL.h
covrom/cmemdb
7ce8ad2ae497c79916020c68bdf8a167374245b6
[ "MIT" ]
null
null
null
doc/veb/FTL.h
covrom/cmemdb
7ce8ad2ae497c79916020c68bdf8a167374245b6
[ "MIT" ]
null
null
null
// ============================================================================ // (c) Copyright 2003 Roman Dementiev, Lutz Kettner, Jens Mehnert, and Peter // Sanders, MPI Informatik, Stuhlsatzenhausweg 85, 66123 Saarbrucken, Germany. // // This source code is described in the paper: // Engineering a Sorted List Data Structure for 32 Bit Keys. // By Roman Dementiev, Lutz Kettner, Jens Mehnert and Peter Sanders. // In: Algorithm Engineering and Experiments (ALENEX'04), New Orleans, Jan 2004 // ---------------------------------------------------------------------------- // // FTL.h // $Revision: $ // $Date: $ // // Test driver class: creates the test instances and measures runtime. // ============================================================================ #ifndef MAP32_FTL_H #define MAP32_FTL_H #include <iostream> #include <list> #include <set> #include <queue> #include "STree_orig.h" // Attn: order dependent, has to come before LEDA!! #include <LEDA/_sortseq.h> #include <LEDA/impl/ab_tree.h> #include <map> #include "Dlist.h" #include "LVL1Tree.h" #include "timer.h" //#include "eb_tree.h" //#define TEST_ORIG_STREE //#define TEST_STREE //#define TEST_STLMAP //#define TEST_SORTSEQ //#define TEST_LEDA_STREE //#define TEST_LEDA_AB_TREE // Use dynamic perfect hashing #ifdef TEST_LEDA_STREE_DP #define TEST_LEDA_STREE #endif namespace fake_leda { GenPtr nullGenPtr(0); } #define REPEAT_BEGIN for(unsigned int count__=0;count__ < TIMES; count__++) { #define REPEAT_END } typedef int Type; inline unsigned my_rand(void) { static unsigned rand; return (rand = rand * 3141592621UL + 663896637UL); } typedef std::map<int,int> stl_map; typedef _sortseq<int,int,ab_tree> leda_ab_tree_; #define DECLARE_DICT \ LVL1Tree test; \ std::map<int,int> paar; \ leda_sortseq<int,int> l_sortseq; \ STree_orig<> orig_stree(0); \ leda_ab_tree_ l_dict; // leda_stree l_stree(32); class FTL { typedef leda_sortseq<int,int>::item sortseq_item_t; typedef leda_ab_tree_::item dict_item_t; /// typedef fake_leda::eb_tree leda_stree; public: FTL() {} // perform multiple locates void locTest(unsigned int, unsigned int, unsigned int); // fill tree with random numbers void insTest(int,int); void delTest(int,int); void insDelTest(int,int); void memoryTest(); // insert element and its immediate neighbor void consecutiveElements(int,int); void print(double time, unsigned int elements); }; void FTL::print(double time, unsigned int elements) { std::cout << (time/elements) << " "; } // A hash table in level 3 is only needed if two elements fall in that // subtree. We insert a random element plus its immediate successor, so // only with probability 1/256 we won't have them in the same level 3 tree. void FTL::consecutiveElements(int elements, int shift) { std::cout << elements << " "; unsigned const int temp = elements/2; // two elements per step unsigned int * testArray = new unsigned int[temp]; for(unsigned int i=0;i<temp;i++) testArray[i]=(unsigned int) (my_rand()>>shift); timer Timer; #ifdef TEST_STLMAP /* Fuelle Map */ REPEAT_BEGIN map<int,int> s_map; Timer.start(); for(unsigned int i=0;i<temp;i++) s_map.insert(pair<int,int>(testArray[i],testArray[i])); for(unsigned int i=0;i<temp;i++) s_map.insert(pair<int,int>(testArray[i]+1,testArray[i]+1)); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif /* Map filled */ #ifdef TEST_STREE /* Fuelle STree */ REPEAT_BEGIN LVL1Tree stree; Timer.start(); for(unsigned int i=0;i<temp;i++) stree.insert(testArray[i],testArray[i]); for(unsigned int i=0;i<temp;i++) stree.insert(testArray[i]+1,testArray[i]+1); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif /* STree filled */ #ifdef TEST_SORTSEQ /* Fill leda_sortseq */ REPEAT_BEGIN leda_sortseq<int,int> l_sortseq; Timer.start(); for(unsigned int i=0;i<temp;i++) l_sortseq.insert(testArray[i],testArray[i]); for(unsigned int i=0;i<temp;i++) l_sortseq.insert(testArray[i]+1,testArray[i]+1); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_ORIG_STREE /* Fill orig_stree */ REPEAT_BEGIN STree_orig<> orig_stree(0); Timer.start(); for(unsigned int i=0;i<temp;i++) orig_stree.insert(testArray[i]); for(unsigned int i=0;i<temp;i++) orig_stree.insert(testArray[i]+1); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_AB_TREE /* Fill leda dict */ REPEAT_BEGIN leda_ab_tree_ l_dict; Timer.start(); for(unsigned int i=0;i<temp;i++) l_dict.insert(testArray[i],testArray[i]); for(unsigned int i=0;i<temp;i++) l_dict.insert(testArray[i]+1,testArray[i]+1); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); #endif #ifdef TEST_LEDA_STREE REPEAT_BEGIN leda_stree l_stree(32); Timer.start(); for(unsigned int i=0;i<temp;i++) l_stree.insert((testArray[i])); for(unsigned int i=0;i<temp;i++) l_stree.insert((testArray[i]+1)); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); #endif std::cout << std::endl; delete [] testArray; } // Compare between lookup und lower_bound. // Input: elements: number of elements in the test tree // iter: number of repetitions // shift: shifts the random keys to the right to reduce the key size // Output: comparison data void FTL::locTest(unsigned int elements,unsigned int iter, unsigned int shift){ std::cout << elements << " "; const int iterationen = iter; unsigned const int temp = elements; unsigned int * testArray = new unsigned int[temp]; DECLARE_DICT for(unsigned int i=0;i<temp;i++) { testArray[i]=(unsigned int) (my_rand())>>shift; } /* Fill trees */ for(unsigned int i=0;i<temp;i++) { #ifdef TEST_STREE test.insert(testArray[i],testArray[i]); #endif #ifdef TEST_STLMAP paar.insert(pair<int,int>(testArray[i],testArray[i])); #endif #ifdef TEST_SORTSEQ l_sortseq.insert(testArray[i],testArray[i]); #endif #ifdef TEST_ORIG_STREE orig_stree.insert(testArray[i]); #endif #ifdef TEST_LEDA_AB_TREE l_dict.insert(testArray[i],testArray[i]); #endif #ifdef TEST_LEDA_STREE l_stree.insert(testArray[i]); #endif } // locate results Dnode* map32_item; map<int,int>::iterator mapIter; sortseq_item_t leda_sortseq_item; dict_item_t leda_dict_item; int tmp = 0; tmp = tmp + 1; // to get rid of warning // Pre-run before measuring #ifdef TEST_STLMAP for(int e=0;e<iterationen;e++) { // pre-run unsigned int zu3 = (unsigned int) (my_rand())>>shift; mapIter = paar.lower_bound(zu3); } #endif #ifdef TEST_STREE for(int e=0;e<iterationen;e++) { // pre-run unsigned int zu2 = (unsigned int) (my_rand())>>shift; map32_item = test.locateNode(zu2); } #endif #ifdef TEST_SORTSEQ for(int e=0;e<iterationen;e++) { // pre-run unsigned int zu2 = (unsigned int) (my_rand())>>shift; leda_sortseq_item = l_sortseq.locate(zu2); } #endif #ifdef TEST_ORIG_STREE for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; tmp = orig_stree.locate(zu2); } #endif #ifdef TEST_LEDA_AB_TREE for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; leda_dict_item = l_dict.locate(zu2); } #endif #ifdef TEST_LEDA_STREE for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; tmp = l_stree.succ(zu2); } #endif // Run for the measurements timer Timer; #ifdef TEST_STLMAP Timer.start(); for(int e=0;e<iterationen;e++) { unsigned int zu3 = (unsigned int) (my_rand())>>shift; mapIter = paar.lower_bound(zu3); } Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif /******************** STree *************/ #ifdef TEST_STREE Timer.start(); for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; map32_item = test.locateNode(zu2); } Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif /******************************************/ /* LEDA sortseq */ #ifdef TEST_SORTSEQ Timer.start(); for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; leda_sortseq_item = l_sortseq.locate(zu2); } Timer.stop(); print(Timer.useconds(),elements); #endif /* original Stree */ #ifdef TEST_ORIG_STREE Timer.start(); for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; tmp = orig_stree.locate(zu2); } Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_AB_TREE Timer.start(); for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; leda_dict_item = l_dict.locate(zu2); } Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_STREE Timer.start(); for(int e=0;e<iterationen;e++) { unsigned int zu2 = (unsigned int) (my_rand())>>shift; tmp = l_stree.succ(zu2); } Timer.stop(); print(Timer.useconds(),elements); #endif std::cout << std::endl; delete [] testArray; } // Compare insertion speed void FTL::insTest(int elements, int shift) { std::cout << elements << " "; unsigned const int temp = elements; unsigned int *testArray = new unsigned int[temp]; for(unsigned int i=0;i<temp;i++) { testArray[i]=(unsigned int) (my_rand()>>shift); } // Fill map timer Timer; #ifdef TEST_STLMAP REPEAT_BEGIN map<int,int> s_map; Timer.start(); for(unsigned int i=0;i<temp;i++) s_map.insert(pair<int,int>(testArray[i],testArray[i])); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif // Fill LVL1Tree #ifdef TEST_STREE REPEAT_BEGIN LVL1Tree stree; Timer.start(); for(unsigned int i=0;i<temp;i++) stree.insert(testArray[i],testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif // LEDA sort seq #ifdef TEST_SORTSEQ REPEAT_BEGIN leda_sortseq<int,int> l_sortseq; Timer.start(); for(unsigned int i=0;i<temp;i++) l_sortseq.insert(testArray[i],testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif /* original stree */ #ifdef TEST_ORIG_STREE REPEAT_BEGIN STree_orig<> orig_stree(0); Timer.start(); for(unsigned int i=0;i<temp;i++) orig_stree.insert(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_AB_TREE REPEAT_BEGIN leda_ab_tree_ l_dict; Timer.start(); for(unsigned int i=0;i<temp;i++) l_dict.insert(testArray[i],testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_STREE REPEAT_BEGIN leda_stree l_stree(32); Timer.start(); for(unsigned int i=0;i<temp;i++) l_stree.insert(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif std::cout << std::endl; delete [] testArray; } // Compare removal speed void FTL::delTest(int elements,int shift) { std::cout << elements << " "; unsigned const int temp = elements; unsigned int *testArray = new unsigned int[temp]; for(unsigned int i=0;i<temp;i++) testArray[i]=(unsigned int) (my_rand() >> shift); timer Timer; #ifdef TEST_STLMAP // removal in map REPEAT_BEGIN map<int,int> s_map; for(unsigned int i=0;i<temp;i++) s_map.insert(pair<int,int>(testArray[i],testArray[i])); Timer.start(); for(unsigned int i=0;i<temp;i++) s_map.erase(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif /* STree loeschen */ #ifdef TEST_STREE REPEAT_BEGIN LVL1Tree stree; for(unsigned int i=0;i<temp;i++) stree.insert(testArray[i],testArray[i]); Timer.start(); for(unsigned int i=0;i<temp;i++) stree.del(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif /* LEDA sortseq */ #ifdef TEST_SORTSEQ REPEAT_BEGIN leda_sortseq<int,int> l_sortseq; for(unsigned int i=0;i<temp;i++) l_sortseq.insert(testArray[i],testArray[i]); Timer.start(); for(unsigned int i=0;i<temp;i++) l_sortseq.del(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif /* orig stree */ #ifdef TEST_ORIG_STREE REPEAT_BEGIN STree_orig<> orig_stree(0); for(unsigned int i=0;i<temp;i++) orig_stree.insert(testArray[i]); Timer.start(); for(unsigned int i=0;i<temp;i++) orig_stree.del(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_AB_TREE REPEAT_BEGIN leda_ab_tree_ l_dict; for(unsigned int i=0;i<temp;i++) l_dict.insert(testArray[i],testArray[i]); Timer.start(); for(unsigned int i=0;i<temp;i++) l_dict.del(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_STREE REPEAT_BEGIN leda_stree l_stree(32); for(unsigned int i=0;i<temp;i++) l_stree.insert(testArray[i]); Timer.start(); for(unsigned int i=0;i<temp;i++) l_stree.del(testArray[i]); Timer.stop(); REPEAT_END print(Timer.useconds(),elements); Timer.reset(); #endif std::cout << std::endl; delete [] testArray; } // Switch between removal and insertion of random keys void FTL::insDelTest(int elements, int shift) { std::cout << elements << " "; unsigned const int temp = elements; unsigned int * testArray = new unsigned int[temp]; DECLARE_DICT timer Timer; #ifdef TEST_STLMAP /* Test MAP */ for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; testArray[i]=tmp; paar.insert(pair<int,int>(tmp,tmp)); } Timer.start(); REPEAT_BEGIN for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; paar.erase(testArray[i]); paar.insert(pair<int,int>(tmp,tmp)); testArray[i] = tmp; } REPEAT_END Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif /* STree */ #ifdef TEST_STREE for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; testArray[i]=tmp; test.insert(tmp,tmp); } Timer.start(); REPEAT_BEGIN for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; test.del(testArray[i]); test.insert(tmp,tmp); testArray[i] = tmp; } REPEAT_END Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); /* STree filled */ #endif /* LEDA sortseq */ #ifdef TEST_SORTSEQ for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; testArray[i]=tmp; l_sortseq.insert(tmp,tmp); } Timer.start(); REPEAT_BEGIN for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; l_sortseq.del(testArray[i]); l_sortseq.insert(tmp,tmp); testArray[i] = tmp; } REPEAT_END Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif /* Orig stree */ #ifdef TEST_ORIG_STREE for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; testArray[i]=tmp; orig_stree.insert(tmp); } Timer.start(); REPEAT_BEGIN for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; orig_stree.del(testArray[i]); orig_stree.insert(tmp); testArray[i] = tmp; } REPEAT_END Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_AB_TREE for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; testArray[i]=tmp; l_dict.insert(tmp,tmp); } Timer.start(); REPEAT_BEGIN for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; l_dict.del(testArray[i]); l_dict.insert(tmp,tmp); testArray[i] = tmp; } REPEAT_END Timer.stop(); print(Timer.useconds(),elements); Timer.reset(); #endif #ifdef TEST_LEDA_STREE for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; testArray[i]=tmp; l_stree.insert(tmp); } Timer.start(); REPEAT_BEGIN for(unsigned int i=0;i<temp;i++) { const unsigned int tmp = my_rand()>>shift; l_stree.del(testArray[i]); l_stree.insert(tmp); testArray[i] = tmp; } REPEAT_END Timer.stop(); print(Timer.useconds(),elements); #endif std::cout << std::endl; delete [] testArray; } #endif // MAP32_FTL_H
26.509972
79
0.591617
e730b1dcd310a6592d88e7fa703f0896cee922b3
2,418
h
C
src/structures/vroom/input/input.h
senhalil/vroom
bbb3d53d312b1ad3586c200370fe9f73c733f5a8
[ "BSD-2-Clause" ]
null
null
null
src/structures/vroom/input/input.h
senhalil/vroom
bbb3d53d312b1ad3586c200370fe9f73c733f5a8
[ "BSD-2-Clause" ]
null
null
null
src/structures/vroom/input/input.h
senhalil/vroom
bbb3d53d312b1ad3586c200370fe9f73c733f5a8
[ "BSD-2-Clause" ]
null
null
null
#ifndef INPUT_H #define INPUT_H /* This file is part of VROOM. Copyright (c) 2015-2018, Julien Coupey. All rights reserved (see LICENSE). */ #include <chrono> #include <memory> #include <unordered_map> #include <unordered_set> #include <vector> #include "routing/wrapper.h" #include "structures/generic/matrix.h" #include "structures/typedefs.h" #include "structures/vroom/job.h" #include "structures/vroom/solution/solution.h" #include "structures/vroom/vehicle.h" namespace vroom { class VRP; class Input { private: std::chrono::high_resolution_clock::time_point _start_loading; std::chrono::high_resolution_clock::time_point _end_loading; std::chrono::high_resolution_clock::time_point _end_solving; std::chrono::high_resolution_clock::time_point _end_routing; std::unique_ptr<routing::Wrapper<Cost>> _routing_wrapper; bool _no_addition_yet; bool _has_skills; bool _has_TW; bool _homogeneous_locations; bool _geometry; Matrix<Cost> _matrix; std::vector<Location> _locations; std::unordered_map<Location, Index> _locations_to_index; unsigned _amount_size; Amount _amount_lower_bound; std::vector<std::vector<bool>> _vehicle_to_job_compatibility; std::vector<std::vector<bool>> _vehicle_to_vehicle_compatibility; std::unordered_set<Index> _matrix_used_index; bool _all_locations_have_coords; void check_amount_size(unsigned size); std::unique_ptr<VRP> get_problem() const; void check_cost_bound() const; void set_compatibility(); void store_amount_lower_bound(const Amount& amount); public: std::vector<Job> jobs; std::vector<Vehicle> vehicles; Input(); void set_geometry(bool geometry); void set_routing(std::unique_ptr<routing::Wrapper<Cost>> routing_wrapper); void add_job(const Job& job); void add_vehicle(const Vehicle& vehicle); void set_matrix(Matrix<Cost>&& m); unsigned amount_size() const; Amount get_amount_lower_bound() const; bool has_skills() const; bool has_homogeneous_locations() const; bool vehicle_ok_with_job(Index v_index, Index j_index) const; // Returns true iff both vehicles have common job candidates. bool vehicle_ok_with_vehicle(Index v1_index, Index v2_index) const; const Matrix<Cost>& get_matrix() const; Matrix<Cost> get_sub_matrix(const std::vector<Index>& indices) const; Solution solve(unsigned exploration_level, unsigned nb_thread); }; } // namespace vroom #endif
23.940594
76
0.767163
b7460e2fd7f4f6c3e89c11cea9ebb0e05f7f1c6a
4,987
h
C
test/ir/index_manager/t_IndexReader.h
izenecloud/izenelib
9d5958100e2ce763fc75f27217adf982d7c9d902
[ "Apache-2.0" ]
31
2015-03-03T19:13:42.000Z
2020-09-03T08:11:56.000Z
test/ir/index_manager/t_IndexReader.h
izenecloud/izenelib
9d5958100e2ce763fc75f27217adf982d7c9d902
[ "Apache-2.0" ]
1
2016-12-24T00:12:11.000Z
2016-12-24T00:12:11.000Z
test/ir/index_manager/t_IndexReader.h
izenecloud/izenelib
9d5958100e2ce763fc75f27217adf982d7c9d902
[ "Apache-2.0" ]
8
2015-09-06T01:55:21.000Z
2021-12-20T02:16:13.000Z
/** * @file t_IndexReader.h * @author Jun * @version SF1 v5.0 * @brief Test cases on @c IndexReader. * */ #ifndef T_INDEX_READER_H #define T_INDEX_READER_H #include <glog/logging.h> #include <boost/test/unit_test.hpp> #include <ir/index_manager/index/IndexReader.h> #include "IndexerTestFixture.h" //#define LOG_CHECK_OPERATION namespace t_IndexReader { /** * The fixture used in cases testing IndexReader module. */ class IndexReaderTestFixture: public IndexerTestFixture { public: /** Check document length. */ void checkDocLength() { VLOG(2) << "=> IndexReaderTestFixture::checkDocLength()"; IndexReader* pIndexReader = indexer_->getIndexReader(); if(!indexer_->isRealTime()) { BOOST_CHECK_EQUAL(pIndexReader->numDocs(), mapDocIdLen_.size()); BOOST_CHECK_EQUAL(pIndexReader->maxDoc(), maxDocID_); for(DocIdLenMapT::const_iterator lenMapIt = mapDocIdLen_.begin(); lenMapIt != mapDocIdLen_.end(); ++lenMapIt) { #ifdef LOG_CHECK_OPERATION BOOST_TEST_MESSAGE("check: " << lenMapIt->first); #endif BOOST_CHECK_EQUAL(pIndexReader->docLength(lenMapIt->first, indexer_->getPropertyIDByName(COLLECTION_ID, INVERTED_FIELD)), lenMapIt->second); } } VLOG(2) << "<= IndexReaderTestFixture::checkDocLength()"; } /** Check @c Bitset, it is used to record which doc is removed. */ void checkDocFilter() { VLOG(2) << "=> IndexReaderTestFixture::checkDocFilter()"; IndexReader* pIndexReader = indexer_->getIndexReader(); Bitset* pDocFilter = pIndexReader->getDocFilter(); Directory* pDirectory = indexer_->getDirectory(); // no doc is deleted if(getMaxDocID() == static_cast<unsigned int>(getDocCount())) { // file "docs.del" should not exist BOOST_CHECK(! pDirectory->fileExists(DELETED_DOCS)); // Bitset instance should not be created BOOST_CHECK(pDocFilter == NULL); } else { // file "docs.del" should exist BOOST_CHECK(pDirectory->fileExists(DELETED_DOCS)); // Bitset instance should be created BOOST_CHECK(pDocFilter != NULL); // Bitset size should be <= (maxDocID + 4), in case of Bitset::grow() BOOST_CHECK_GT(pDocFilter->size(), 0U); BOOST_CHECK_LE(pDocFilter->size(), getMaxDocID() + 4); } VLOG(2) << "<= IndexReaderTestFixture::checkDocFilter()"; } }; inline void index(const IndexerTestConfig& config) { VLOG(2) << "=> t_IndexReader::index"; { IndexReaderTestFixture fixture; fixture.configTest(config); // create barrels for(int i=0; i<config.iterNum_; ++i) { fixture.createDocument(); fixture.checkDocLength(); fixture.checkDocFilter(); } } { // new Indexer instance, // while keep original index files IndexReaderTestFixture fixture; fixture.setRealIndex(false); IndexerTestConfig newConfig = config; // change from offline mode to realtime mode, // only VInt type is supported for realtime mode if(config.indexMode_ == "default") newConfig.indexMode_ = "realtime"; fixture.configTest(newConfig); // re-generate random numbers to check for(int i=0; i<config.iterNum_; ++i) fixture.createDocument(); fixture.checkDocLength(); fixture.checkDocFilter(); // create new index files fixture.setRealIndex(true); for(int i=0; i<config.iterNum_; ++i) { fixture.createDocument(); fixture.checkDocLength(); fixture.checkDocFilter(); } } VLOG(2) << "<= t_IndexReader::index"; } inline void update(const IndexerTestConfig& config) { VLOG(2) << "=> t_IndexReader::update"; IndexReaderTestFixture fixture; fixture.configTest(config); fixture.createDocument(); for(int i=0; i<config.iterNum_; ++i) { fixture.updateDocument(); fixture.checkDocLength(); fixture.checkDocFilter(); } VLOG(2) << "<= t_IndexReader::update"; } inline void remove(const IndexerTestConfig& config) { VLOG(2) << "=> t_IndexReader::remove"; IndexReaderTestFixture fixture; fixture.configTest(config); fixture.createDocument(); while(! fixture.isDocEmpty()) { fixture.removeDocument(); fixture.checkDocLength(); fixture.checkDocFilter(); } VLOG(2) << "<= t_IndexReader::remove"; } inline void empty(const IndexerTestConfig& config) { VLOG(2) << "=> t_IndexReader::empty"; IndexReaderTestFixture fixture; fixture.configTest(config); fixture.checkDocLength(); fixture.checkDocFilter(); VLOG(2) << "<= t_IndexReader::empty"; } } #endif
27.103261
156
0.616002
64bc228c00f34c95de55213b9432a93d3687a75c
1,018
h
C
src/derivative.h
peanutfun/GiNaCDE
aeeb00a89add8d01979ee6ced16d2a6432b5097c
[ "MIT" ]
1
2021-11-22T01:09:10.000Z
2021-11-22T01:09:10.000Z
src/derivative.h
peanutfun/GiNaCDE
aeeb00a89add8d01979ee6ced16d2a6432b5097c
[ "MIT" ]
19
2021-11-08T10:02:51.000Z
2022-02-04T10:36:15.000Z
src/derivative.h
peanutfun/GiNaCDE
aeeb00a89add8d01979ee6ced16d2a6432b5097c
[ "MIT" ]
1
2021-11-10T09:53:18.000Z
2021-11-10T09:53:18.000Z
/** @file derivative.h * * Interface to the derivative.cpp file. */ #ifndef DERIVATIVE_H_INCLUDED #define DERIVATIVE_H_INCLUDED #include <ginac/ginac.h> using namespace std; using namespace GiNaC; extern lst twcPhase; /** substituting in Int and Diff arguments and mapping**/ class subs_IntDiffargu:public map_function { unsigned i,j; ex _expr, _var, _temexpr; exset symclt; string str; public: exmap IntDiffargu_map, Conjurgu_map; subs_IntDiffargu(unsigned i_, unsigned j_, ex _var_):i(i_), j(j_), _var(_var_){} ex operator()(const ex& _e); ~subs_IntDiffargu(){} }; /** Derivative for funtions with dependency **/ ex pdiff(const ex&, const ex&, const ex&); /** Evaluation of Diff, Integrate **/ class evaluatec:public map_function { ex _tem; public: ex operator()(const ex& _e); ~evaluatec(){} }; extern evaluatec evaluateg; ex evaluate(const ex&); ex zero_order_rem(const ex&); #endif // DERIVATIVE_H_INCLUDED
21.659574
85
0.670923
230c0b5d2b0717e38c508c6b373cdec5cf7b9521
7,832
c
C
examples/CoSP2/src-mpi/haloExchange.c
kyushick/cdruntime
de08c79aad373c9715922294c67a7482c62ba9f2
[ "Unlicense" ]
null
null
null
examples/CoSP2/src-mpi/haloExchange.c
kyushick/cdruntime
de08c79aad373c9715922294c67a7482c62ba9f2
[ "Unlicense" ]
null
null
null
examples/CoSP2/src-mpi/haloExchange.c
kyushick/cdruntime
de08c79aad373c9715922294c67a7482c62ba9f2
[ "Unlicense" ]
null
null
null
/// \file /// Communicate halo data such as "ghost" rows with neighboring tasks. #include "haloExchange.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include "sparseMatrix.h" #include "decomposition.h" #include "parallel.h" #include "performance.h" #include "constants.h" #include "mytype.h" /// A structure to package data for a single row to pack into a /// send/recv buffer. typedef struct NonZeroMsgSt { int irow; int icol; real_t val; } NonZeroMsg; /// \details HaloExchange* initHaloExchange(struct DomainSt* domain) { HaloExchange* hh = (HaloExchange*)malloc(sizeof(HaloExchange)); hh->maxHalo = domain->totalProcs; hh->haloCount = 0; hh->haloProc = (int*)malloc(hh->maxHalo*sizeof(int)); hh->bufferSize = domain->localRowExtent * domain->totalCols * ( 2 * sizeof(int) + sizeof(real_t)); // row, col, value if (printRank() && debug == 1) printf("bufferSize = %d\n", hh->bufferSize); hh->sendBuf = (char*)malloc(hh->bufferSize*sizeof(char)); hh->recvBuf = (char**)malloc(getNRanks()*sizeof(char*)); for (int i = 0; i < getNRanks(); i++) { hh->recvBuf[i] = (char*)malloc(hh->bufferSize*sizeof(char)); } return hh; } /// \details void destroyHaloExchange(struct HaloExchangeSt* haloExchange) { free(haloExchange->haloProc); free(haloExchange->sendBuf); for (int i = 0; i < getNRanks(); i++) { free(haloExchange->recvBuf[i]); } free(haloExchange->recvBuf); free(haloExchange); } /// Setup for data exchange - post non-blocking reads void exchangeSetup(struct HaloExchangeSt* haloExchange, struct SparseMatrixSt* spmatrix, struct DomainSt* domain) { // Update halo processors for matrix updateData(haloExchange, spmatrix, domain); // Post receives from halo processors and // Send local row to halo processors if (haloExchange->haloCount > 0) { // Post non-blocking receives haloExchange->rlist = (int*)malloc(haloExchange->haloCount*sizeof(int)); for (int i = 0; i < haloExchange->haloCount; i++) { haloExchange->rlist[i] = irecvAnyParallel(haloExchange->recvBuf[i], haloExchange->bufferSize); } } } /// This is the function that does the heavy lifting for the /// communication of halo data. void exchangeData(struct HaloExchangeSt* haloExchange, struct SparseMatrixSt* spmatrix, struct DomainSt* domain) { if (haloExchange->haloCount > 0) { // Send local rows to each halo processor int nSendLen = loadBuffer(haloExchange->sendBuf, spmatrix, domain); for (int i = 0; i < haloExchange->haloCount; i++) { int nSend = sendParallel(haloExchange->sendBuf, nSendLen, haloExchange->haloProc[i]); collectCounter(sendCounter, nSendLen); } // Receive remote rows from each halo processor for (int i = 0; i < haloExchange->haloCount; i++) { int nRecv = waitIrecv(haloExchange->rlist[i]); unloadBuffer(haloExchange->recvBuf[i], nRecv, spmatrix, domain); collectCounter(recvCounter, nRecv); } } } /// \details /// Determine processors in halo void updateData(struct HaloExchangeSt* haloExchange, struct SparseMatrixSt* spmatrix, struct DomainSt* domain) { haloExchange->haloCount = 0; for (int i = domain->localRowMin; i < domain->localRowMax; i++) { for (int j = 0; j < spmatrix->iia[i]; j++) { int rnum = spmatrix->jja[i][j]; if (rnum < domain->localRowMin || rnum >= domain->localRowMax) { int rowProc = processorNum(domain, rnum); addHaloProc(haloExchange, rowProc); } } } } /// \details /// Gather sparse matrix data to processor 0 void gatherData(struct HaloExchangeSt* haloExchange, struct SparseMatrixSt* spmatrix, struct DomainSt* domain) { int myRank = getMyRank(); // If rank 0, read all blocks that have not been received as halos if (myRank == 0) { free(haloExchange->rlist); haloExchange->rlist = (int*)malloc((getNRanks() - haloExchange->haloCount)*sizeof(int)); int ir = 0; for (int i = 1; i < getNRanks(); i++) { if (!isHaloProc(haloExchange, i)) { haloExchange->rlist[ir] = irecvAnyParallel(haloExchange->recvBuf[ir], haloExchange->bufferSize); ir++; } } for (int i = 0; i < ir; i++) { int nRecv = waitIrecv(haloExchange->rlist[i]); unloadBuffer(haloExchange->recvBuf[i], nRecv, spmatrix, domain); collectCounter(recvCounter, nRecv); } } // Else send block if wasn't sent as halo else { if (!isHaloProc(haloExchange, 0)) { int nSendLen = loadBuffer(haloExchange->sendBuf, spmatrix, domain); int nSend = sendParallel(haloExchange->sendBuf, nSendLen, 0); collectCounter(sendCounter, nSendLen); } } } /// \details /// Gather sparse matrix data to processor 0 void allGatherData(struct HaloExchangeSt* haloExchange, struct SparseMatrixSt* spmatrix, struct DomainSt* domain) { int myRank = getMyRank(); // Post reads for all blocks that have not been received as halos free(haloExchange->rlist); haloExchange->rlist = (int*)malloc((getNRanks() - haloExchange->haloCount)*sizeof(int)); int ir = 0; for (int i = 0; i < getNRanks(); i++) { if (i != myRank && !isHaloProc(haloExchange, i)) { haloExchange->rlist[ir] = irecvAnyParallel(haloExchange->recvBuf[ir], haloExchange->bufferSize); ir++; } } // Send to other ranks that aren't halos int nSendLen = loadBuffer(haloExchange->sendBuf, spmatrix, domain); for (int i = 0; i < getNRanks(); i++) { if ( i != myRank && !isHaloProc(haloExchange, i)) { int nSend = sendParallel(haloExchange->sendBuf, nSendLen, i); collectCounter(sendCounter, nSendLen); } } for (int i = 0; i < ir; i++) { int nRecv = waitIrecv(haloExchange->rlist[i]); unloadBuffer(haloExchange->recvBuf[i], nRecv, spmatrix, domain); collectCounter(recvCounter, nRecv); } } /// \details /// Check if proc is a halo proc int isHaloProc(struct HaloExchangeSt* haloExchange, int rproc) { for (int i = 0; i < haloExchange->haloCount; i++) { if (haloExchange->haloProc[i] == rproc) return 1; } return 0; } /// \details /// Add halo processor number to list if not currently present void addHaloProc(struct HaloExchangeSt* haloExchange, int rproc) { if (haloExchange->haloCount == 0) { haloExchange->haloProc[0] = rproc; haloExchange->haloCount = 1; } else { if (isHaloProc(haloExchange, rproc) == 1) return; haloExchange->haloProc[haloExchange->haloCount] = rproc; haloExchange->haloCount++; } } /// \details /// The loadBuffer function for a halo exchange of row data. int loadBuffer(char* buf, struct SparseMatrixSt* xmatrix, struct DomainSt* domain) { NonZeroMsg* rbuf = (NonZeroMsg*) buf; int nBuf = 0; for (int i = domain->localRowMin; i < domain->localRowMax; i++) { for (int j = 0; j < xmatrix->iia[i]; j++) { rbuf[nBuf].irow = i; rbuf[nBuf].icol = xmatrix->jja[i][j]; rbuf[nBuf].val = xmatrix->val[i][j]; nBuf++; } } return nBuf*sizeof(NonZeroMsg); } /// \details /// The unloadBuffer function for a halo exchange of row data. void unloadBuffer(char* buf, int bufSize, struct SparseMatrixSt* xmatrix, struct DomainSt* domain) { NonZeroMsg* rbuf = (NonZeroMsg*) buf; int nBuf = bufSize / sizeof(NonZeroMsg); assert(bufSize % sizeof(NonZeroMsg) == 0); // Assume all non-zeros for a row areastored contiguously int rcurrent = -1; int j = 0; for (int i = 0; i < nBuf; i++) { int irow = rbuf[i].irow; if (irow != rcurrent) { xmatrix->iia[irow] = 0; rcurrent = irow; j = 0; } xmatrix->iia[irow]++; xmatrix->jja[irow][j] = rbuf[i].icol; xmatrix->val[irow][j] = rbuf[i].val; j++; } }
26.459459
113
0.650153
3796d3dc84092835a10b5402cb0956e2a8fb5514
1,234
h
C
src/utils/MD5.h
zicohao/im
81416213809301ab604a3f9ee42817028db4e718
[ "MIT" ]
1
2021-11-22T12:49:44.000Z
2021-11-22T12:49:44.000Z
src/utils/MD5.h
zicohao/im
81416213809301ab604a3f9ee42817028db4e718
[ "MIT" ]
null
null
null
src/utils/MD5.h
zicohao/im
81416213809301ab604a3f9ee42817028db4e718
[ "MIT" ]
null
null
null
#ifndef MD5_H #define MD5_H #include <string> #include <fstream> // MD5 declaration. class MD5 { // Type define typedef unsigned char byte; typedef unsigned int uint32; public: MD5(); MD5(const void* input, size_t length); MD5(const std::string& str); MD5(std::ifstream& in); void update(const void* input, size_t length); void update(const std::string& str); void update(std::ifstream& in); const byte* digest(); std::string toString(); void reset(); private: void update(const byte* input, size_t length); void final(); void transform(const byte block[64]); void encode(const uint32* input, byte* output, size_t length); void decode(const byte* input, uint32* output, size_t length); std::string bytesToHexString(const byte* input, size_t length); // class uMD5ncopyable MD5(const MD5&); MD5& operator=(const MD5&); private: uint32 _state[4]; // state (ABCD) uint32 _count[2]; // number of bits, modulo 2^64 (low-order word first) byte _buffer[64]; // input buffer byte _digest[16]; // message digest bool _finished; // calculate finished ? static const byte PADDING[64]; // padding for calculate static const char HEX[16]; enum { BUFFER_SIZE = 1024 }; }; #endif // MD5_H
22.851852
72
0.694489
f0511ffd77c0319c2f0f9136c3cf91ceec591a8c
271
h
C
GfxFramework/src/Graffics/gfxCommon.h
Ohjurot/DirectX-12-Sandbox
99f9b033ae00907144b5cf8efb1c3ae46a22dc7a
[ "MIT" ]
null
null
null
GfxFramework/src/Graffics/gfxCommon.h
Ohjurot/DirectX-12-Sandbox
99f9b033ae00907144b5cf8efb1c3ae46a22dc7a
[ "MIT" ]
null
null
null
GfxFramework/src/Graffics/gfxCommon.h
Ohjurot/DirectX-12-Sandbox
99f9b033ae00907144b5cf8efb1c3ae46a22dc7a
[ "MIT" ]
null
null
null
#pragma once #define COM_RELEASE(ptrCom) if(ptrCom) {ptrCom->Release(); ptrCom = NULL;} #define COM_SAFE_CREATE_HR_RETURN(hrTemp, exp) if(FAILED(hrTemp = exp)){Shutdown(); return hrTemp;} #define COM_CREATE_HR_RETURN(hrTemp, exp) if(FAILED(hrTemp = exp)){return hrTemp;}
54.2
99
0.756458
153f8f0ba8f2ed9dfb115d3c560ce71b8ba38b00
1,238
c
C
src/m_buffer.c
emekoi/graphics
7f067b02c117db9425dddaf241873e98ec0c8898
[ "MIT" ]
null
null
null
src/m_buffer.c
emekoi/graphics
7f067b02c117db9425dddaf241873e98ec0c8898
[ "MIT" ]
null
null
null
src/m_buffer.c
emekoi/graphics
7f067b02c117db9425dddaf241873e98ec0c8898
[ "MIT" ]
1
2018-10-31T01:49:15.000Z
2018-10-31T01:49:15.000Z
#include <stdlib.h> #define STB_IMAGE_IMPLEMENTATION #include "lib/stb_image.h" #include "lib/sera/sera.h" #include "util.h" #include "lib/fs/fs.h" sr_Buffer *new_srBuffer(void) { sr_Buffer *b = zrealloc(NULL, sizeof(*b)); return b; } static sr_Buffer *sr_BufferMemory(const void *data, int len) { int w, h; void *pixels = stbi_load_from_memory(data, len, &w, &h, NULL, STBI_rgb_alpha); if (!pixels) return NULL; sr_Buffer *b = sr_newBuffer(w, h); if (!b) { zfree(pixels); return NULL; } sr_loadPixels(b, pixels, SR_FMT_RGBA); zfree(pixels); return b; } sr_Buffer *sr_newBufferFile(const char *filename) { size_t len; void *data = fs_read(filename, &len); if (!data) CERROR("could not open file '%s'", filename); sr_Buffer *b = sr_BufferMemory(data, len); free(data); if (!b) CERROR("could not load buffer"); return b; } sr_Buffer *sr_newBufferString(const char *str) { size_t len = strlen(str); sr_Buffer *b = sr_BufferMemory(str, len); if (!b) CERROR("could not load sr_Buffer"); return b; } sr_Buffer *sr_newBufferBlank(int w, int h) { sr_Buffer *b = sr_newBuffer(w, h); if (!b) CERROR("could not create sr_Buffer"); sr_clear(b, sr_pixel(0, 0, 0, 0)); return b; }
22.107143
80
0.669628
29d4a5fe3b298fa56b7640710a0bdc8b777dd800
3,517
h
C
src/iso_rect.h
dickoa/euclid
6588a6f56c73779152ff99eb06f41b3ec61170bc
[ "MIT" ]
68
2020-09-17T13:17:03.000Z
2022-02-20T09:14:54.000Z
src/iso_rect.h
dickoa/euclid
6588a6f56c73779152ff99eb06f41b3ec61170bc
[ "MIT" ]
27
2020-09-17T13:35:53.000Z
2022-01-20T09:12:48.000Z
src/iso_rect.h
dickoa/euclid
6588a6f56c73779152ff99eb06f41b3ec61170bc
[ "MIT" ]
11
2020-09-17T11:43:37.000Z
2022-01-10T13:08:27.000Z
#pragma once #include <cpp11/strings.hpp> #include <cpp11/doubles.hpp> #include "cgal_types.h" #include "geometry_vector.h" #include "exact_numeric.h" #include "intersection.h" #include "distance.h" class iso_rect : public geometry_vector<Iso_rectangle, 2> { public: using geometry_vector::geometry_vector; ~iso_rect() = default; Primitive geometry_type() const { return ISORECT; } size_t cardinality(size_t i) const { return 4; } size_t long_length() const { return size() * 4; } cpp11::writable::strings def_names() const { return {"x", "y"}; } Exact_number get_single_definition(size_t i, int which, int element) const { switch(which) { case 0: return _storage[i].vertex(element).x(); case 1: return _storage[i].vertex(element).y(); } return _storage[i].vertex(0).x(); } std::vector<double> get_row(size_t i, size_t j) const { return { CGAL::to_double(_storage[i].vertex(j).x().exact()), CGAL::to_double(_storage[i].vertex(j).y().exact()) }; } cpp11::writable::list intersection(const geometry_vector_base& other) const { if (other.dimensions() != dimensions()) { cpp11::stop("Only geometries of the same dimensionality can intersect"); } switch (other.geometry_type()) { case ISORECT: return intersection_impl(_storage, get_vector_of_geo<Iso_rectangle>(other)); case LINE: return intersection_impl(_storage, get_vector_of_geo<Line_2>(other)); case POINT: return intersection_impl(_storage, get_vector_of_geo<Point_2>(other)); case RAY: return intersection_impl(_storage, get_vector_of_geo<Ray_2>(other)); case SEGMENT: return intersection_impl(_storage, get_vector_of_geo<Segment_2>(other)); case TRIANGLE: return intersection_impl(_storage, get_vector_of_geo<Triangle_2>(other)); default: cpp11::stop("Don't know how to calculate the intersection of these geometries"); } } cpp11::writable::logicals do_intersect(const geometry_vector_base& other) const { if (other.dimensions() != dimensions()) { cpp11::stop("Only geometries of the same dimensionality can intersect"); } switch (other.geometry_type()) { case CIRCLE: return do_intersect_impl(get_vector_of_geo<Circle_2>(other), _storage); case ISORECT: return do_intersect_impl(_storage, get_vector_of_geo<Iso_rectangle>(other)); case LINE: return do_intersect_impl(_storage, get_vector_of_geo<Line_2>(other)); case POINT: return do_intersect_impl(_storage, get_vector_of_geo<Point_2>(other)); case RAY: return do_intersect_impl(_storage, get_vector_of_geo<Ray_2>(other)); case SEGMENT: return do_intersect_impl(_storage, get_vector_of_geo<Segment_2>(other)); case TRIANGLE: return do_intersect_impl(_storage, get_vector_of_geo<Triangle_2>(other)); default: return unknown_intersect_impl(std::max(size(), other.size())); } } std::vector<Exact_number> squared_distance(const geometry_vector_base& other) const { if (other.dimensions() != dimensions()) { cpp11::stop("Only geometries of the same dimensionality can intersect"); } return unknown_squared_distance_impl(std::max(size(), other.size())); } cpp11::writable::doubles_matrix distance_matrix(const geometry_vector_base& other) const { if (other.dimensions() != dimensions()) { cpp11::stop("Only geometries of the same dimensionality can intersect"); } return unknown_distance_matrix_impl(size(), other.size()); } }; typedef cpp11::external_pointer<iso_rect> iso_rect_p;
40.425287
94
0.725618
e48479cab4bb94db6858bd49eb37138d701642b2
969
h
C
components/qtmaterialautocomplete_p.h
umerov1999/material-my
3255c2709573bcfe907b579ccda7a1999b18901d
[ "BSD-3-Clause" ]
1
2021-07-21T02:13:28.000Z
2021-07-21T02:13:28.000Z
components/qtmaterialautocomplete_p.h
umerov1999/material-my
3255c2709573bcfe907b579ccda7a1999b18901d
[ "BSD-3-Clause" ]
null
null
null
components/qtmaterialautocomplete_p.h
umerov1999/material-my
3255c2709573bcfe907b579ccda7a1999b18901d
[ "BSD-3-Clause" ]
null
null
null
#ifndef QTMATERIALAUTOCOMPLETE_P_H #define QTMATERIALAUTOCOMPLETE_P_H #include "qtmaterialflatbutton_p.h" class QWidget; class QVBoxLayout; class QtMaterialAutoCompleteOverlay; class QtMaterialAutoCompleteStateMachine; class QtMaterialAutoCompletePrivate : public QtMaterialFlatButtonPrivate { Q_DISABLE_COPY(QtMaterialAutoCompletePrivate) Q_DECLARE_PUBLIC(QtMaterialAutoComplete) public: QtMaterialAutoCompletePrivate(QtMaterialAutoComplete *q); virtual ~QtMaterialAutoCompletePrivate(); void init(); QWidget *menu; QWidget *frame; QtMaterialAutoCompleteStateMachine *stateMachine; QVBoxLayout *menuLayout; QStringList dataSource; int maxWidth; int maxHeight; bool toggle; }; #endif // QTMATERIALAUTOCOMPLETE_P_H
29.363636
72
0.639835
a5ab97d4cc5aa2d70b981cdf924475cf7400530b
6,493
h
C
src/logging/Program.h
nrc-cnrc/Portage-SMT-TAS
73f5a65de4adfa13008ea9a01758385c97526059
[ "MIT" ]
null
null
null
src/logging/Program.h
nrc-cnrc/Portage-SMT-TAS
73f5a65de4adfa13008ea9a01758385c97526059
[ "MIT" ]
null
null
null
src/logging/Program.h
nrc-cnrc/Portage-SMT-TAS
73f5a65de4adfa13008ea9a01758385c97526059
[ "MIT" ]
null
null
null
/** * @author Samuel Larkin * @file Program.h This file serves as a guide on how to use the argProcessor class. * * * Technologies langagieres interactives / Interactive Language Technologies * Inst. de technologie de l'information / Institute for Information Technology * Conseil national de recherches Canada / National Research Council Canada * Copyright 2004, Sa Majeste la Reine du Chef du Canada / * Copyright 2004, Her Majesty in Right of Canada */ #ifndef YOUR_APPLICATION_GUARD_H #define YOUR_APPLICATION_GUARD_H #include <portage_defs.h> // Most likely you will need the portage definitions #include <argProcessor.h> // Must be included since we are going to derive argProcessor namespace Portage { /// Your application namespace prevents polluting to much the Portage namespace. namespace YourApplication { /// Example of how to create a logger for your application. Logging::logger SpecificLogger = Logging::createLogger("{output|debug|verbose}.Specific"); /// Your help message to guide user on how to use your application. static char help_message[] = "A message describing the arguments to your program"; /// The list of valid switches already includes -verbose: and -debug. const char* const switches[] = {"s1", "s2", "t1:", "t1:", "v"}; /** * A class that will hold and parse command line arguments. * Class that will handle the final parsing of command line switches, * checking their integrity ans so on and activating loggers for example. * Also, it's suggested that this class servers as a placeholder for all * switches' values. */ class ARG : public argProcessor { private: Logging::logger m_logger; ///< class' internal verbose logger Logging::logger m_debug; ///< class' internal debug logger public: bool bVerbose; ///< suggestion: describes if the verbose is on or off without specifing the level bool bS1; ///< value of s1 bool bS2; ///< value of s2 string sT1; ///< value of t1 Uint nT2; ///< value of t2 public: /** * The constructor and you initialize your members. * There is a call to the base class (argProcessor) and you MUST fill in the * proper information for your application needs. * <BR>argProcessor(number of switches, the switches, min arg, max arg, help msg, help switch, ); * @param argc number of arguments in vector * @param argv vector of arguments */ ARG(const int argc, const char* const argv[]) : argProcessor(ARRAY_SIZE(switches), switches, 0, 0, help_message, "-h", true) , m_logger(Logging::createLogger("verbose.main.arg")) , m_debug(Logging::createLogger("debug.main.arg")) , bVerbose(false) , bS1(false) , bS2(false) , sT1("Initialisation") , nT2(0) { // MANDATORY CALL TO THE BASE CLASS TO PROCESS THE ARGUMENTS argProcessor::processArgs(argc, argv); } /** * Logs the values of every switches. * In this function you log the values of the arguments from the command line * this function is called from the base class argument parsing and is guarded * by the if statement and the debuglogger */ virtual void printSwitchesValue() { // Here m_debug can be replaced by debugLogger from Logging LOG_INFO(m_logger, "Printing arguments"); if (m_debug->isDebugEnabled()) // short-circuiting for efficiency { LOG_DEBUG(m_debug, "Verbose: %s", (bVerbose ? "ON" : "OFF")); LOG_DEBUG(m_debug, "switch1: %s", (bS1 ? "ON" : "OFF")); LOG_DEBUG(m_debug, "switch2: %s", (bS2 ? "ON" : "OFF")); LOG_DEBUG(m_debug, "t1: %s", sT1.c_str()); LOG_DEBUG(m_debug, "t2: %d", nT2); // An example of a more elaborated scheme std::stringstream oss; LOG_DEBUG(m_debug, "Number of reference files: %d", sRefFiles.size()); for (Uint i(0); i<sRefFiles.size(); ++i) { oss << "- " << sRefFiles[i].c_str() << " "; } LOG_DEBUG(m_debug, oss.str().c_str()); } } /** * Here is the code to extract to variable the value of the switches * from the command line. This is where all the work is done. * Extract all switches' values and set them in class members. */ virtual void processArgs() { LOG_INFO(m_logger, "Processing arguments"); // mp_arg_reader is a member of the base class that contains the parse command line arguments // mp_arg_reader->testAndSet // mp_arg_reader->getSwitch // Taking care of general flags // mp_arg_reader->testAndSet("v", bVerbose); mp_arg_reader->testAndSet("s1", bS1); mp_arg_reader->testAndSet("s2", bS2); mp_arg_reader->testAndSet("t1", sT1); mp_arg_reader->testAndSet("t2", nT2); // Some logger activation or any kind of argument consistency checking can be done if (bS1) { // Example of activating a logger from the commande line //Specific->setLevel(Logging::LogLevel::ACTIVATED); } // Elaborated switch checking based on the presence of some switch // if (mp_arg_reader->getSwitch("some switch")) { // get some switches mp_arg_reader->testAndSet("S", S); mp_arg_reader->testAndSet("K", K); mp_arg_reader->testAndSet("best-trans-file", sBestTransFile); } else { // error if not set LOG_FATAL(m_logger, "You must provide a best translation file"); } } }; // ends ARG } // ends the YourApplication namespace /// Any declaration of functions related to your main goes here. Uint function1(bool verbose = false); } // ends the Portage namespace #endif // YOUR_APPLICATION_GUARD_H
41.356688
115
0.584938
ec9d5b56c2d03dbc9bfb56041ef3cb716a5a7ab4
827
h
C
src/luq_qvoid.h
LuaDist-testing/luq
cf0ceb1ca93f04135de8eca9ff9b5c907b07aa55
[ "MIT" ]
null
null
null
src/luq_qvoid.h
LuaDist-testing/luq
cf0ceb1ca93f04135de8eca9ff9b5c907b07aa55
[ "MIT" ]
null
null
null
src/luq_qvoid.h
LuaDist-testing/luq
cf0ceb1ca93f04135de8eca9ff9b5c907b07aa55
[ "MIT" ]
null
null
null
#include "luq_pthread.h" #ifndef QVOID_LENGTH # define QVOID_LENGTH 255 #endif typedef struct qvoid_tag{ pthread_cond_t cond; pthread_mutex_t mutex; int count; void *arr[QVOID_LENGTH]; } qvoid_t; int qvoid_init(qvoid_t *q); int qvoid_destroy(qvoid_t *q); int qvoid_capacity(qvoid_t *q); int qvoid_size(qvoid_t *q); int qvoid_empty(qvoid_t *q); int qvoid_full(qvoid_t *q); int qvoid_put(qvoid_t *q, void *data); int qvoid_put_nolock(qvoid_t *q, void *data); int qvoid_put_timeout(qvoid_t *q, void *data, int ms); int qvoid_lock(qvoid_t *q); int qvoid_unlock(qvoid_t *q); int qvoid_notify(qvoid_t *q); int qvoid_get(qvoid_t *q, void **data); int qvoid_get_nolock(qvoid_t *q, void **data); int qvoid_get_timeout(qvoid_t *q, void **data, int ms); int qvoid_clear(qvoid_t *q);
17.978261
55
0.711004
260d602fa5e593fc58ea4410050ce53c532f4254
2,839
h
C
projects/procjam-2020/bricks/shared.h
tmpvar/rawk
0dee2bdf9e11e9033988a0d9d1e52603263c6aca
[ "MIT" ]
9
2020-08-14T19:46:33.000Z
2021-10-13T09:33:20.000Z
projects/procjam-2020/bricks/shared.h
tmpvar/rawkit
0dee2bdf9e11e9033988a0d9d1e52603263c6aca
[ "MIT" ]
null
null
null
projects/procjam-2020/bricks/shared.h
tmpvar/rawkit
0dee2bdf9e11e9033988a0d9d1e52603263c6aca
[ "MIT" ]
null
null
null
#ifdef CPU_HOST #pragma once #define GLM_FORCE_RADIANS #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtx/compatibility.hpp> #include <glm/glm.hpp> using namespace glm; typedef uint uint32_t; #else #extension GL_ARB_gpu_shader_int64 : require #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require #endif struct Camera { vec4 pos; // TODO: orientation and vp matrix }; struct Scene { mat4 worldToScreen; vec4 screen_dims; vec4 eye; vec4 brick_dims; vec4 cascade_center; Camera camera; float time; }; struct Brick { vec4 pos; uvec4 params; // op count, op, nop, nop }; struct BrickOcclusion { uint64_t occlusion[64]; }; #define BRICK_COLOR_DIAMETER 8 #define BRICK_COLOR_LENGTH BRICK_COLOR_DIAMETER * BRICK_COLOR_DIAMETER * BRICK_COLOR_DIAMETER struct BrickColor { // 8^3 which means each voxel is colored by the interpolation // between neighboring color values.. It's either this, drop // down to 16bit color or figure out a brick level compression scheme. DXT1 should work fine here, but // we'll probably want to turn this into a texture! uint voxel[512]; }; struct ray_hit_t { vec4 color; vec3 pos; vec3 normal; float density; float iterations; }; struct scene_t { vec3 grid_dims; vec3 inv_grid_dims; Brick brick; }; struct bound3_t { vec3 mMin; vec3 mMax; }; #define OP_ID_BEZIER 1.0 #define OP_ID_SPHERE 2.0 struct op_t { vec4 control; // id, nop, nop, nop vec4 a; // x, y, z, radius vec4 b; // x, y, z, radius vec4 c; // x, y, z, radius vec4 d; // x, y, z, radius }; float dot2( vec3 v ) { return dot(v,v); } vec2 sdBezier(vec3 pos, vec3 A, vec3 B, vec3 C) { vec3 a = B - A; vec3 b = A - 2.0f*B + C; vec3 c = a * 2.0f; vec3 d = A - pos; float kk = 1.0f / dot(b,b); float kx = kk * dot(a,b); float ky = kk * (2.0f*dot(a,a)+dot(d,b)) / 3.0f; float kz = kk * dot(d,a); vec2 res; float p = ky - kx*kx; float p3 = p*p*p; float q = kx*(2.0f*kx*kx - 3.0f*ky) + kz; float h = q*q + 4.0f*p3; if(h >= 0.0) { h = sqrt(h); vec2 x = (vec2(h, -h) - q) / 2.0f; vec2 uv = sign(x)*pow(abs(x), vec2(1.0f/3.0f)); float t = clamp(uv.x+uv.y-kx, 0.0f, 1.0f); // 1 root res = vec2(dot2(d+(c+b*t)*t),t); } else { float z = sqrt(-p); float v = acos( q/(p*z*2.0f) ) / 3.0f; float m = cos(v); float n = sin(v)*1.732050808f; vec3 t = clamp( vec3(m+m,-n-m,n-m)*z-kx, 0.0f, 1.0f); // 3 roots, but only need two float dis = dot2(d+(c+b*t.x)*t.x); res = vec2(dis,t.x); dis = dot2(d+(c+b*t.y)*t.y); if( dis<res.x ) res = vec2(dis,t.y ); } res.x = sqrt(res.x); return res; }
21.186567
104
0.589644
4d3a992206c9e6e9b3e35e9321ff3376f2191395
56,574
h
C
src/frontend/SageIII/sageInterface/sageBuilder.h
haiwangcat/ROSE
75bf4106a5febe40269ea0361a024b7811668d45
[ "BSD-3-Clause" ]
4
2015-03-17T13:52:21.000Z
2022-01-12T05:32:47.000Z
src/frontend/SageIII/sageInterface/sageBuilder.h
haiwangcat/ROSE
75bf4106a5febe40269ea0361a024b7811668d45
[ "BSD-3-Clause" ]
null
null
null
src/frontend/SageIII/sageInterface/sageBuilder.h
haiwangcat/ROSE
75bf4106a5febe40269ea0361a024b7811668d45
[ "BSD-3-Clause" ]
1
2019-12-25T10:18:01.000Z
2019-12-25T10:18:01.000Z
#ifndef ROSE_SAGE_BUILDER_INTERFACE #define ROSE_SAGE_BUILDER_INTERFACE #include <string> /*! \defgroup frontendSageHighLevelInterface High level AST builders \ingroup ROSE_FrontEndGroup \brief This namespace contains high level SAGE III AST node and subtree builders Building AST trees using raw SgNode constructors is tedious and error-prone. It becomes even more difficult with the presence of symbol tables. This namespace contains major AST node builders on top of the constructors to take care of symbol tables, various edges to scope, parent and so on. \authors Chunhua Liao (last modified 2/12/2008) */ namespace SageBuilder{ #if 0 //---------------------AST creation/building/construction----------------- SgExpression* buildConst(SgType* t, const string & val); SgExpression* buildConstInt(int val); // build sth in languages, but not in SAGE AST // how to specify position info? then SgClassDeclaration* buildClassDeclaration(...,class_type); // or SgClassDeclaration* buildStruct(...); SgClassDeclaration* buildClass(...); SgClassDeclaration* buildUnion(...); // build B from dependent A SgTemplateInstantiationMemberFunctionDecl* buildForwardFunctionDeclaration (SgTemplateInstantiationMemberFunctionDecl * memberFunctionInstantiation); //previous attempt: src/midend/astUtil/astInterface // AstNodePtr AstInterface::CreateConst( const string& val, const string& valtype) const // AstNodePtr AstInterfaceBase::CreateConstInt( int val) #endif //---------------------------------------------------------- //@{ /*! @name Scope stack interfaces \brief a global data structure to store current scope and parent scopes. Scope stack is provided as an alternative to manually passing scope parameters to builder functions. It is not required to be used. Please use the recommendeded operation functions for maintaining the scope stack. Don't use raw container access functions to ScopeStack. e.g. avoid ScopeStack.push_back(), using pushScopeStack() instead. \todo consider complex cases: - how many scope stacks to keep? one. examine only one transparently - regular: push a child scope of current scope, add symbols etc. - irregular: push an arbitrary scope temporarily, add some symbol, then pop - even push a chain of scopes - restore scopes */ /*! \brief intended to be a private member, don't access it directly. could be changed any time */ extern std::list<SgScopeStatement*> ScopeStack; // DQ (11/30/2010): Added support for building Fortran case insensitive symbol table handling. //! Support for construction of case sensitive/insensitive symbol table handling in scopes. extern bool symbol_table_case_insensitive_semantics; //! Public interfaces of the scope stack, should be stable void pushScopeStack (SgScopeStatement* stmt); void pushScopeStack (SgNode* node); void popScopeStack(); SgScopeStatement* topScopeStack() ; bool emptyScopeStack(); void clearScopeStack(); //@} //-------------------------------------------------------------- //@{ /*! @name Builders for SgType \brief Builders for simple and complex SgType nodes, such as integer type, function type, array type, struct type, etc. \todo SgModifierType,SgNamedType(SgClassType,SgEnumType,SgTypedefType), SgQualifiedNameType, SgTemplateType,SgTypeComplex, SgTypeDefault,SgTypeEllipse,SgTypeGlobalVoid,SgTypeImaginary */ //! Built in simple types SgTypeBool * buildBoolType(); SgTypeChar * buildCharType(); SgTypeDouble* buildDoubleType(); SgTypeFloat* buildFloatType(); SgTypeInt * buildIntType(); SgTypeLong* buildLongType(); SgTypeLongDouble* buildLongDoubleType(); SgTypeLongLong * buildLongLongType(); SgTypeShort* buildShortType(); // DQ (8/21/2010): We want to move to the new buildStringType( SgExpression*,size_t) function over the older buildStringType() function. SgTypeString* buildStringType(); // SgTypeString* buildStringType( SgExpression* stringLengthExpression, size_t stringLengthLiteral ); SgTypeString* buildStringType( SgExpression* stringLengthExpression ); SgTypeVoid * buildVoidType(); SgTypeWchar* buildWcharType(); SgTypeSignedChar* buildSignedCharType(); SgTypeSignedInt* buildSignedIntType(); SgTypeSignedLong* buildSignedLongType(); SgTypeSignedLongLong* buildSignedLongLongType(); SgTypeSignedShort* buildSignedShortType(); SgTypeUnsignedChar* buildUnsignedCharType(); SgTypeUnsignedInt* buildUnsignedIntType(); SgTypeUnsignedLong* buildUnsignedLongType(); SgTypeUnsignedLongLong* buildUnsignedLongLongType(); SgTypeUnsignedShort* buildUnsignedShortType(); SgTypeUnknown * buildUnknownType(); //! Build a pointer type SgPointerType* buildPointerType(SgType *base_type = NULL); //! Build a reference type SgReferenceType* buildReferenceType(SgType *base_type = NULL); // Liao, entirely phase out this function ! Build a modifier type with no modifiers set //SgModifierType* buildModifierType(SgType *base_type = NULL); // DQ (7/29/2010): Changed return type from SgType to SgModifierType for a number of the functions below. //! Build a modifier type. SgModifierType* buildModifierType(SgType* base_type = NULL); //! Build a const type. SgModifierType* buildConstType(SgType* base_type = NULL); //! Build a volatile type. SgModifierType* buildVolatileType(SgType* base_type = NULL); //! Build a restrict type. SgModifierType* buildRestrictType(SgType* base_type); //! Build ArrayType SgArrayType* buildArrayType(SgType* base_type=NULL, SgExpression* index=NULL); // DQ (8/27/2010): Added Fortran specific support for types based on kind expressions. //! Build a type based on the Fortran kind mechanism SgModifierType* buildFortranKindType(SgType* base_type, SgExpression* kindExpression ); //! Build function type from return type and parameter type list SgFunctionType * buildFunctionType(SgType* return_type, SgFunctionParameterTypeList * typeList=NULL); //! Build function type from return type and parameter list SgFunctionType * buildFunctionType(SgType* return_type, SgFunctionParameterList * argList=NULL); // DQ (1/16/2009): Added to support member function in C++ (for new interface) SgMemberFunctionType * buildMemberFunctionType(SgType* return_type, SgFunctionParameterTypeList * typeList, SgClassDefinition *struct_name, unsigned int mfunc_specifier); //! Build an opaque type with a name, useful when a type's details are unknown during transformation, especially for a runtime library's internal type. Must provide scope here. /*! Some types are not known during translation but nevertheless are needed. For example, some * internal types from a runtime library. To work around this problem: this function prepends a hidden typedef declaration into scope * 'typedef int OpaqueTypeName;' * The translation-generated code is expected to include the runtime library's headers to * have the real type declarations. */ SgType* buildOpaqueType(std::string const type_name, SgScopeStatement * scope); // DQ (7/29/2010): Changed return type from SgType to SgModifierType for a number of the functions below. //! Build a UPC strict type SgModifierType* buildUpcStrictType(SgType *base_type = NULL); //! Build a UPC relaxed type SgModifierType* buildUpcRelaxedType(SgType *base_type = NULL); //! Build a UPC shared type // SgModifierType* buildUpcSharedType(SgType *base_type = NULL); SgModifierType* buildUpcSharedType(SgType *base_type = NULL, long layout = -1); //! Build a UPC shared[] type SgModifierType* buildUpcBlockIndefiniteType(SgType *base_type = NULL); //! Build a UPC shared[*] type SgModifierType* buildUpcBlockStarType(SgType *base_type = NULL); //! Build a UPC shared[n] type SgModifierType* buildUpcBlockNumberType(SgType *base_type, long block_factor); //! Build a complex type SgTypeComplex* buildComplexType(SgType *base_type = NULL); //! Build an imaginary type SgTypeImaginary* buildImaginaryType(SgType *base_type = NULL); //! Build a const/volatile type qualifier SgConstVolatileModifier * buildConstVolatileModifier (SgConstVolatileModifier::cv_modifier_enum mtype=SgConstVolatileModifier::e_unknown); //@} //-------------------------------------------------------------- //@{ /*! @name Builders for expressions \brief handle side effects of parent pointers, Sg_File_Info, lvalue etc. Expressions are usually built using bottomup approach, i.e. buiding operands first, then the expression operating on the operands. It is also possible to build expressions with NULL operands or empty values first, then set them afterwards. - Value string is not included in the argument list for simplicty. It can be set afterwards using set_valueString() - Expression builders are organized roughtly in the order of class hierarchy list of ROSE Web Reference - default values for arguments are provided to support top-down construction. Should use SageInterface::setOperand(),setLhsOperand(), setRhsOperand() etc to set operands and handle side effects. \todo SgAsmOp, SgAsteriskShapeExp, SgValueExp, SgEnumVal, SgThrowOp, */ // JJW (11/19/2008): _nfi versions of functions set file info objects to NULL (used in frontend) SgVariantExpression * buildVariantExpression(); //! Build a null expression, set file info as the default one SgNullExpression* buildNullExpression(); //! No file info version of buildNullExpression(). File info is to be set later on. SgNullExpression* buildNullExpression_nfi(); //! Build a bool value expression, the name convention of SgBoolValExp is little different from others for some unknown reason SgBoolValExp* buildBoolValExp(int value = 0); SgBoolValExp* buildBoolValExp(bool value = 0); SgBoolValExp* buildBoolValExp_nfi(int value); SgCharVal* buildCharVal(char value = 0); SgCharVal* buildCharVal_nfi(char value, const std::string& str); SgWcharVal* buildWcharVal(wchar_t value = 0); SgWcharVal* buildWcharVal_nfi(wchar_t value, const std::string& str); SgComplexVal* buildComplexVal(long double real_value = 0.0, long double imaginary_value = 0.0 ); SgComplexVal* buildComplexVal(SgValueExp* real_value, SgValueExp* imaginary_value); SgComplexVal* buildComplexVal_nfi(SgValueExp* real_value, SgValueExp* imaginary_value, const std::string& str); SgComplexVal* buildImaginaryVal(long double imaginary_value); SgComplexVal* buildImaginaryVal(SgValueExp* imaginary_value); SgComplexVal* buildImaginaryVal_nfi(SgValueExp* imaginary_value, const std::string& str); //! Build a double value expression SgDoubleVal* buildDoubleVal(double value = 0.0); SgDoubleVal* buildDoubleVal_nfi(double value, const std::string& str); SgFloatVal* buildFloatVal(float value = 0.0); SgFloatVal* buildFloatVal_nfi(float value, const std::string& str); //! Build an integer value expression SgIntVal* buildIntVal(int value = 0); SgIntVal* buildIntValHex(int value = 0); SgIntVal* buildIntVal_nfi(int value, const std::string& str); //! Build a long integer value expression SgLongIntVal* buildLongIntVal(long value = 0); SgLongIntVal* buildLongIntValHex(long value = 0); SgLongIntVal* buildLongIntVal_nfi(long value, const std::string& str); //! Build a long long integer value expression SgLongLongIntVal* buildLongLongIntVal(long long value = 0); SgLongLongIntVal* buildLongLongIntValHex(long long value = 0); SgLongLongIntVal* buildLongLongIntVal_nfi(long long value, const std::string& str); SgEnumVal* buildEnumVal_nfi(int value, SgEnumDeclaration* decl, SgName name); SgLongDoubleVal* buildLongDoubleVal(long double value = 0.0); SgLongDoubleVal* buildLongDoubleVal_nfi(long double value, const std::string& str); SgShortVal* buildShortVal(short value = 0); SgShortVal* buildShortValHex(short value = 0); SgShortVal* buildShortVal_nfi(short value, const std::string& str); SgStringVal* buildStringVal(std::string value=""); SgStringVal* buildStringVal_nfi(std::string value); //! Build an unsigned char SgUnsignedCharVal* buildUnsignedCharVal(unsigned char v = 0); SgUnsignedCharVal* buildUnsignedCharValHex(unsigned char v = 0); SgUnsignedCharVal* buildUnsignedCharVal_nfi(unsigned char v, const std::string& str); //! Build an unsigned short integer SgUnsignedShortVal* buildUnsignedShortVal(unsigned short v = 0); SgUnsignedShortVal* buildUnsignedShortValHex(unsigned short v = 0); SgUnsignedShortVal* buildUnsignedShortVal_nfi(unsigned short v, const std::string& str); //! Build an unsigned integer SgUnsignedIntVal* buildUnsignedIntVal(unsigned int v = 0); SgUnsignedIntVal* buildUnsignedIntValHex(unsigned int v = 0); SgUnsignedIntVal* buildUnsignedIntVal_nfi(unsigned int v, const std::string& str); //! Build a unsigned long integer SgUnsignedLongVal* buildUnsignedLongVal(unsigned long v = 0); SgUnsignedLongVal* buildUnsignedLongValHex(unsigned long v = 0); SgUnsignedLongVal* buildUnsignedLongVal_nfi(unsigned long v, const std::string& str); //! Build an unsigned long long integer SgUnsignedLongLongIntVal* buildUnsignedLongLongIntVal(unsigned long long v = 0); SgUnsignedLongLongIntVal* buildUnsignedLongLongIntValHex(unsigned long long v = 0); SgUnsignedLongLongIntVal* buildUnsignedLongLongIntVal_nfi(unsigned long long v, const std::string& str); //! Build UPC THREADS (integer expression) SgUpcThreads* buildUpcThreads(); SgUpcThreads* buildUpcThreads_nfi(); //! Build UPC MYTHREAD (integer expression) SgUpcMythread* buildUpcMythread(); SgUpcMythread* buildUpcMythread_nfi(); //! Build this pointer SgThisExp* buildThisExp(SgClassSymbol* sym); SgThisExp* buildThisExp_nfi(SgClassSymbol* sym); //! Build super pointer SgSuperExp* buildSuperExp(SgClassSymbol* sym); SgSuperExp* buildSuperExp_nfi(SgClassSymbol* sym); //! Build lambda expression SgLambdaRefExp* buildLambdaRefExp(SgType* return_type, SgFunctionParameterList* params, SgScopeStatement* scope); //! Template function to build a unary expression of type T. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators). /*! The instantiated functions' prototypes are not shown since they are expanded using macros. * Doxygen is not smart enough to handle macro expansion. */ template <class T> T* buildUnaryExpression(SgExpression* operand = NULL); template <class T> T* buildUnaryExpression_nfi(SgExpression* operand); //! Template function to build a unary expression of type T with advanced information specified such as parenthesis and file info. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). /*! The instantiated functions' prototypes are not shown since they are expanded using macros. * Doxygen is not smart enough to handle macro expansion. */ #define BUILD_UNARY_PROTO(suffix) \ Sg##suffix * build##suffix(SgExpression* op =NULL); \ Sg##suffix * build##suffix##_nfi(SgExpression* op); BUILD_UNARY_PROTO(AddressOfOp) BUILD_UNARY_PROTO(BitComplementOp) BUILD_UNARY_PROTO(MinusOp) BUILD_UNARY_PROTO(NotOp) BUILD_UNARY_PROTO(PointerDerefExp) BUILD_UNARY_PROTO(UnaryAddOp) BUILD_UNARY_PROTO(MinusMinusOp) BUILD_UNARY_PROTO(PlusPlusOp) BUILD_UNARY_PROTO(RealPartOp) BUILD_UNARY_PROTO(ImagPartOp) BUILD_UNARY_PROTO(ConjugateOp) BUILD_UNARY_PROTO(VarArgStartOneOperandOp) BUILD_UNARY_PROTO(VarArgEndOp) //! Build a type casting expression SgCastExp * buildCastExp(SgExpression * operand_i = NULL, SgType * expression_type = NULL, SgCastExp::cast_type_enum cast_type = SgCastExp::e_C_style_cast); SgCastExp * buildCastExp_nfi(SgExpression * operand_i, SgType * expression_type, SgCastExp::cast_type_enum cast_type); //! Build vararg op expression SgVarArgOp * buildVarArgOp_nfi(SgExpression * operand_i, SgType * expression_type); //! Build -- expression, Sgop_mode is a value of either SgUnaryOp::prefix or SgUnaryOp::postfix SgMinusOp *buildMinusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode); SgMinusMinusOp *buildMinusMinusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode); SgMinusMinusOp *buildMinusMinusOp_nfi(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode); //! Build ++x or x++ , specify prefix or postfix using either SgUnaryOp::prefix or SgUnaryOp::postfix SgPlusPlusOp* buildPlusPlusOp(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode); SgPlusPlusOp* buildPlusPlusOp_nfi(SgExpression* operand_i, SgUnaryOp::Sgop_mode a_mode); //! Build a ThrowOp expression SgThrowOp* buildThrowOp(SgExpression *, SgThrowOp::e_throw_kind); SgNewExp * buildNewExp(SgType* type, SgExprListExp* exprListExp, SgConstructorInitializer* constInit, SgExpression* expr, short int val, SgFunctionDeclaration* funcDecl); SgDeleteExp* buildDeleteExp(SgExpression* variable, short is_array, short need_global_specifier, SgFunctionDeclaration* deleteOperatorDeclaration); #undef BUILD_UNARY_PROTO //! Template function to build a binary expression of type T, taking care of parent pointers, file info, lvalue, etc. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp() /*! The instantiated functions' prototypes are not shown since they are expanded using macros. * Doxygen is not smart enough to handle macro expansion. */ template <class T> T* buildBinaryExpression(SgExpression* lhs =NULL, SgExpression* rhs =NULL); template <class T> T* buildBinaryExpression_nfi(SgExpression* lhs, SgExpression* rhs); //! Template function to build a binary expression of type T,with extra information for parenthesis and file info, Instantiated functions include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(), buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(), buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp() /*! The instantiated functions' prototypes are not shown since they are expanded using macros. * Doxygen is not smart enough to handle macro expansion. */ #define BUILD_BINARY_PROTO(suffix) \ Sg##suffix * build##suffix(SgExpression* lhs =NULL, SgExpression* rhs =NULL); \ Sg##suffix * build##suffix##_nfi(SgExpression* lhs, SgExpression* rhs); BUILD_BINARY_PROTO(AddOp) BUILD_BINARY_PROTO(AndAssignOp) BUILD_BINARY_PROTO(AndOp) BUILD_BINARY_PROTO(ArrowExp) BUILD_BINARY_PROTO(ArrowStarOp) BUILD_BINARY_PROTO(AssignOp) BUILD_BINARY_PROTO(BitAndOp) BUILD_BINARY_PROTO(BitOrOp) BUILD_BINARY_PROTO(BitXorOp) BUILD_BINARY_PROTO(CommaOpExp) BUILD_BINARY_PROTO(ConcatenationOp) BUILD_BINARY_PROTO(DivAssignOp) BUILD_BINARY_PROTO(DivideOp) BUILD_BINARY_PROTO(DotExp) BUILD_BINARY_PROTO(DotStarOp) BUILD_BINARY_PROTO(EqualityOp) BUILD_BINARY_PROTO(ExponentiationOp) BUILD_BINARY_PROTO(ExponentiationAssignOp) BUILD_BINARY_PROTO(GreaterOrEqualOp) BUILD_BINARY_PROTO(GreaterThanOp) BUILD_BINARY_PROTO(IntegerDivideOp) BUILD_BINARY_PROTO(IntegerDivideAssignOp) BUILD_BINARY_PROTO(IorAssignOp) BUILD_BINARY_PROTO(IsOp) BUILD_BINARY_PROTO(IsNotOp) BUILD_BINARY_PROTO(LessOrEqualOp) BUILD_BINARY_PROTO(LessThanOp) BUILD_BINARY_PROTO(LshiftAssignOp) BUILD_BINARY_PROTO(LshiftOp) BUILD_BINARY_PROTO(MembershipOp) BUILD_BINARY_PROTO(MinusAssignOp) BUILD_BINARY_PROTO(ModAssignOp) BUILD_BINARY_PROTO(ModOp) BUILD_BINARY_PROTO(MultAssignOp) BUILD_BINARY_PROTO(MultiplyOp) BUILD_BINARY_PROTO(NonMembershipOp) BUILD_BINARY_PROTO(NotEqualOp) BUILD_BINARY_PROTO(OrOp) BUILD_BINARY_PROTO(PlusAssignOp) BUILD_BINARY_PROTO(PntrArrRefExp) BUILD_BINARY_PROTO(RshiftAssignOp) BUILD_BINARY_PROTO(JavaUnsignedRshiftAssignOp) BUILD_BINARY_PROTO(RshiftOp) BUILD_BINARY_PROTO(JavaUnsignedRshiftOp) BUILD_BINARY_PROTO(ScopeOp) BUILD_BINARY_PROTO(SubtractOp) BUILD_BINARY_PROTO(XorAssignOp) BUILD_BINARY_PROTO(VarArgCopyOp) BUILD_BINARY_PROTO(VarArgStartOp) #undef BUILD_BINARY_PROTO //! Build a conditional expression ?: SgConditionalExp * buildConditionalExp(SgExpression* test =NULL, SgExpression* a =NULL, SgExpression* b =NULL); SgConditionalExp * buildConditionalExp_nfi(SgExpression* test, SgExpression* a, SgExpression* b, SgType* t); //! Build a SgExprListExp, used for function call parameter list etc. SgExprListExp * buildExprListExp(SgExpression * expr1 = NULL, SgExpression* expr2 = NULL, SgExpression* expr3 = NULL, SgExpression* expr4 = NULL, SgExpression* expr5 = NULL, SgExpression* expr6 = NULL, SgExpression* expr7 = NULL, SgExpression* expr8 = NULL, SgExpression* expr9 = NULL, SgExpression* expr10 = NULL); SgExprListExp * buildExprListExp(const std::vector<SgExpression*>& exprs); SgExprListExp * buildExprListExp_nfi(); SgExprListExp * buildExprListExp_nfi(const std::vector<SgExpression*>& exprs); //! Build a SgTupleExp SgTupleExp * buildTupleExp(SgExpression * expr1 = NULL, SgExpression* expr2 = NULL, SgExpression* expr3 = NULL, SgExpression* expr4 = NULL, SgExpression* expr5 = NULL, SgExpression* expr6 = NULL, SgExpression* expr7 = NULL, SgExpression* expr8 = NULL, SgExpression* expr9 = NULL, SgExpression* expr10 = NULL); SgTupleExp * buildTupleExp(const std::vector<SgExpression*>& exprs); SgTupleExp * buildTupleExp_nfi(); SgTupleExp * buildTupleExp_nfi(const std::vector<SgExpression*>& exprs); //! Build a SgListExp SgListExp * buildListExp(SgExpression * expr1 = NULL, SgExpression* expr2 = NULL, SgExpression* expr3 = NULL, SgExpression* expr4 = NULL, SgExpression* expr5 = NULL, SgExpression* expr6 = NULL, SgExpression* expr7 = NULL, SgExpression* expr8 = NULL, SgExpression* expr9 = NULL, SgExpression* expr10 = NULL); SgListExp * buildListExp(const std::vector<SgExpression*>& exprs); SgListExp * buildListExp_nfi(); SgListExp * buildListExp_nfi(const std::vector<SgExpression*>& exprs); SgComprehension * buildComprehension(SgExpression *target, SgExpression *iter, SgExprListExp *ifs); SgComprehension * buildComprehension_nfi(SgExpression *target, SgExpression *iter, SgExprListExp *ifs); SgListComprehension * buildListComprehension(SgExpression *elt, SgExprListExp *generators); SgListComprehension * buildListComprehension_nfi(SgExpression *elt, SgExprListExp *generators); SgSetComprehension * buildSetComprehension(SgExpression *elt, SgExprListExp *generators); SgSetComprehension * buildSetComprehension_nfi(SgExpression *elt, SgExprListExp *generators); SgDictionaryComprehension * buildDictionaryComprehension(SgKeyDatumPair *kd_pair, SgExprListExp *generators); SgDictionaryComprehension * buildDictionaryComprehension_nfi(SgKeyDatumPair *kd_pair, SgExprListExp *generators); //! Build SgVarRefExp based on a variable's Sage name. It will lookup symbol table internally starting from scope. A variable name is unique so type can be inferred (double check this). /*! It is possible to build a reference to a variable with known name before the variable is declaration, especially during bottomup construction of AST. In this case, SgTypeUnknown is used to indicate the variable reference needing postprocessing fix using fixVariableReferences() once the AST is complete and all variable declarations exist. But the side effect is some get_type() operation may not recognize the unknown type before the fix. So far, I extended SgPointerDerefExp::get_type() and SgPntrArrRefExp::get_type() for SgTypeUnknown. There may be others needing the same extension. */ SgVarRefExp * buildVarRefExp(const SgName& name, SgScopeStatement* scope=NULL); //! Build SgVarRefExp based on a variable's name. It will lookup symbol table internally starting from scope. A variable is unique so type can be inferred. SgVarRefExp * buildVarRefExp(const std::string& varName, SgScopeStatement* scope=NULL); //! Build a variable reference using a C style char array SgVarRefExp * buildVarRefExp(const char* varName, SgScopeStatement* scope=NULL); //! Build a variable reference from an existing symbol SgVarRefExp * buildVarRefExp(SgVariableSymbol* varSymbol); SgVarRefExp * buildVarRefExp_nfi(SgVariableSymbol* varSymbol); //! Build a variable reference from an existing variable declaration. The assumption is a SgVariableDeclartion only declares one variable in the ROSE AST. SgVarRefExp * buildVarRefExp(SgVariableDeclaration* vardecl); //!build a variable reference from an initialized name //! It first tries to grab the associated symbol, then call buildVarRefExp(const SgName& name, SgScopeStatement*) if symbol does not exist. SgVarRefExp * buildVarRefExp(SgInitializedName* initname, SgScopeStatement* scope=NULL); //!Build a variable reference expression at scope to an opaque variable which has unknown information except for its name. Used when referring to an internal variable defined in some headers of runtime libraries.(The headers are not yet inserted into the file during translation). Similar to buildOpaqueType(); /*! It will declare a hidden int varName at the specified scope to cheat the AST consistence tests. */ SgVarRefExp* buildOpaqueVarRefExp(const std::string& varName,SgScopeStatement* scope=NULL); //! Build a Fortran numeric label ref exp SgLabelRefExp * buildLabelRefExp(SgLabelSymbol * s); //! Build SgFunctionRefExp based on a C++ function's name and function type. It will lookup symbol table internally starting from scope. A hidden prototype will be created internally to introduce a new function symbol if the function symbol cannot be found. SgFunctionRefExp * buildFunctionRefExp(const SgName& name, const SgType* func_type, SgScopeStatement* scope=NULL); SgFunctionRefExp * buildFunctionRefExp(const char* name, const SgType* func_type, SgScopeStatement* scope=NULL); //! Build SgFunctionRefExp based on a C function's name. It will lookup symbol table internally starting from scope and return the first matching function. SgFunctionRefExp * buildFunctionRefExp(const SgName& name,SgScopeStatement* scope=NULL); SgFunctionRefExp * buildFunctionRefExp(const char* name,SgScopeStatement* scope=NULL); //! Build SgFunctionRefExp based on a function's declaration. SgFunctionRefExp * buildFunctionRefExp(const SgFunctionDeclaration* func_decl); //! Build SgFunctionRefExp based on a function's symbol. SgFunctionRefExp * buildFunctionRefExp(SgFunctionSymbol* sym); SgFunctionRefExp * buildFunctionRefExp_nfi(SgFunctionSymbol* sym); SgMemberFunctionRefExp * buildMemberFunctionRefExp_nfi(SgMemberFunctionSymbol* sym, bool virtual_call, bool need_qualifier); SgMemberFunctionRefExp * buildMemberFunctionRefExp(SgMemberFunctionSymbol* sym, bool virtual_call, bool need_qualifier); SgClassNameRefExp * buildClassNameRefExp_nfi(SgClassSymbol* sym); SgClassNameRefExp * buildClassNameRefExp(SgClassSymbol* sym); //! Build a function call expression SgFunctionCallExp* buildFunctionCallExp(SgFunctionSymbol* sym, SgExprListExp* parameters=NULL); SgFunctionCallExp* buildFunctionCallExp_nfi(SgExpression* f, SgExprListExp* parameters=NULL); SgFunctionCallExp* buildFunctionCallExp(SgExpression* f, SgExprListExp* parameters=NULL); //! Build a function call expression,it will automatically search for function symbols internally to build a right function reference etc. It tolerates the lack of the function symbol to support generating calls to library functions whose headers have not yet been inserted. SgFunctionCallExp* buildFunctionCallExp(const SgName& name, SgType* return_type, \ SgExprListExp* parameters=NULL, SgScopeStatement* scope=NULL); //! Build a CUDA kernel call expression (kernel<<<config>>>(parameters)) SgCudaKernelCallExp * buildCudaKernelCallExp_nfi( SgExpression * kernel, SgExprListExp* parameters = NULL, SgCudaKernelExecConfig * config = NULL ); //! Build a CUDA kernel execution configuration (<<<grid, blocks, shared, stream>>>) SgCudaKernelExecConfig * buildCudaKernelExecConfig_nfi( SgExpression *grid = NULL, SgExpression *blocks = NULL, SgExpression *shared = NULL, SgExpression *stream = NULL ); //! Build the rhs of a variable declaration which includes an assignment SgAssignInitializer * buildAssignInitializer(SgExpression * operand_i = NULL, SgType * expression_type = NULL); SgAssignInitializer * buildAssignInitializer_nfi(SgExpression * operand_i = NULL, SgType * expression_type = NULL); //! Build an aggregate initializer SgAggregateInitializer * buildAggregateInitializer(SgExprListExp * initializers = NULL, SgType * type = NULL); SgAggregateInitializer * buildAggregateInitializer_nfi(SgExprListExp * initializers, SgType * type = NULL); //! Build a compound initializer, for vector type initialization SgCompoundInitializer * buildCompoundInitializer(SgExprListExp * initializers = NULL, SgType * type = NULL); SgCompoundInitializer * buildCompoundInitializer_nfi(SgExprListExp * initializers, SgType * type = NULL); // DQ (!/4/2009): Added support for building SgConstructorInitializer SgConstructorInitializer * buildConstructorInitializer( SgMemberFunctionDeclaration *declaration,SgExprListExp *args,SgType *expression_type,bool need_name,bool need_qualifier,bool need_parenthesis_after_name,bool associated_class_unknown); SgConstructorInitializer * buildConstructorInitializer_nfi( SgMemberFunctionDeclaration *declaration,SgExprListExp *args,SgType *expression_type,bool need_name,bool need_qualifier,bool need_parenthesis_after_name,bool associated_class_unknown); //! Build sizeof() expression with an expression parameter SgSizeOfOp* buildSizeOfOp(SgExpression* exp= NULL); SgSizeOfOp* buildSizeOfOp_nfi(SgExpression* exp); //! Build sizeof() expression with a type parameter SgSizeOfOp* buildSizeOfOp(SgType* type = NULL); SgSizeOfOp* buildSizeOfOp_nfi(SgType* type); // DQ (7/18/2011): Added support for SgJavaInstanceOfOp //! This is part of Java specific operator support. SgJavaInstanceOfOp* buildJavaInstanceOfOp(SgExpression* exp = NULL, SgType* type = NULL); //@} //-------------------------------------------------------------- //@{ /*! @name Builders for support nodes \brief AST high level builders for SgSupport nodes */ //! Initialized names are tricky, their scope vary depending on context, so scope and symbol information are not needed until the initialized name is being actually used somewhere. /*!e.g the scope of arguments of functions are different for defining and nondefining functions. */ SgInitializedName* buildInitializedName(const SgName & name, SgType* type, SgInitializer* init = NULL); SgInitializedName* buildInitializedName(const std::string &name, SgType* type); SgInitializedName* buildInitializedName(const char* name, SgType* type); SgInitializedName* buildInitializedName_nfi(const SgName & name, SgType* type, SgInitializer* init); //! Build SgFunctionParameterTypeList from SgFunctionParameterList SgFunctionParameterTypeList * buildFunctionParameterTypeList(SgFunctionParameterList * paralist); //! Build SgFunctionParameterTypeList from an expression list, useful when building a function call SgFunctionParameterTypeList * buildFunctionParameterTypeList(SgExprListExp * expList); //! Build an SgFunctionParameterTypeList from SgTypes. To build an SgFunctionParameterTypeList * buildFunctionParameterTypeList(SgType* type0 = NULL, SgType* type1 = NULL, SgType* type2 = NULL, SgType* type3 = NULL, SgType* type4 = NULL, SgType* type5 = NULL, SgType* type6 = NULL, SgType* type7 = NULL); //-------------------------------------------------------------- //@{ /*! @name Builders for statements \brief AST high level builders for SgStatement, explicit scope parameters are allowed for flexibility. Please use SageInterface::appendStatement(), prependStatement(), and insertStatement() to attach the newly built statements into an AST tree. Calling member functions like SgScopeStatement::prepend_statement() or using container functions such as pushback() is discouraged since they don't handle many side effects for symbol tables, source file information, scope and parent pointers etc. */ //! Build a variable declaration, handle symbol table transparently SgVariableDeclaration* buildVariableDeclaration(const SgName & name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL); SgVariableDeclaration* buildVariableDeclaration(const std::string & name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL); SgVariableDeclaration* buildVariableDeclaration(const char* name, SgType *type, SgInitializer *varInit=NULL, SgScopeStatement* scope=NULL); SgVariableDeclaration* buildVariableDeclaration_nfi(const SgName & name, SgType *type, SgInitializer *varInit, SgScopeStatement* scope); //!Build a typedef declaration, such as: typedef int myint; SgTypedefDeclaration* buildTypedefDeclaration(const std::string& name, SgType* base_type, SgScopeStatement* scope = NULL); SgTypedefDeclaration* buildTypedefDeclaration_nfi(const std::string& name, SgType* base_type, SgScopeStatement* scope = NULL); //! Build an empty SgFunctionParameterList, possibly with some initialized names filled in SgFunctionParameterList * buildFunctionParameterList(SgInitializedName* in1 = NULL, SgInitializedName* in2 = NULL, SgInitializedName* in3 = NULL, SgInitializedName* in4 = NULL, SgInitializedName* in5 = NULL, SgInitializedName* in6 = NULL, SgInitializedName* in7 = NULL, SgInitializedName* in8 = NULL, SgInitializedName* in9 = NULL, SgInitializedName* in10 = NULL); SgFunctionParameterList * buildFunctionParameterList_nfi(); //! Build an SgFunctionParameterList from SgFunctionParameterTypeList, like (int, float,...), used for parameter list of prototype functions when function type( including parameter type list) is known. SgFunctionParameterList* buildFunctionParameterList(SgFunctionParameterTypeList * paraTypeList); SgFunctionParameterList* buildFunctionParameterList_nfi(SgFunctionParameterTypeList * paraTypeList); // DQ (1/21/2009): This is a support function called by the buildNondefiningFunctionDeclaration() and // buildNondefiningMemberFunctionDeclaration() functions. Since we constructe the function type in // the support function and require either a SgFunctionType or SgMemberFunctionType, we need to to pass in // a flag to specify which function type to build (bool isMemberFunction). //! A template function for function prototype declaration builders // template <class actualFunction> // actualFunction* // buildNondefiningFunctionDeclaration_T (const SgName & name, SgType* return_type, SgFunctionParameterList * paralist, bool isMemberFunction, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); template <class actualFunction> actualFunction* buildNondefiningFunctionDeclaration_T (const SgName & name, SgType* return_type, SgFunctionParameterList * paralist, bool isMemberFunction, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0); //! Build a prototype for a function, handle function type, symbol etc transparently SgFunctionDeclaration * buildNondefiningFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); //! Build a prototype for an existing function declaration (defining or nondefining is fine) SgFunctionDeclaration * buildNondefiningFunctionDeclaration (const SgFunctionDeclaration* funcdecl, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); //! Build a prototype member function declaration // SgMemberFunctionDeclaration * // buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); SgMemberFunctionDeclaration * buildNondefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0); ////! Build a prototype member function declaration //SgMemberFunctionDeclaration * //buildNondefiningMemberFunctionDeclaration (const SgName & name, SgMemberFunctionType* func_type, SgFunctionParameterList* paralist, SgScopeStatement* scope=NULL); //! Build a defining ( non-prototype) member function declaration SgMemberFunctionDeclaration * buildDefiningMemberFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList *parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); //! Build a defining ( non-prototype) member function declaration from a SgMemberFunctionType SgMemberFunctionDeclaration * buildDefiningMemberFunctionDeclaration (const SgName & name, SgMemberFunctionType* func_type, SgFunctionParameterList* paralist, SgScopeStatement* scope, SgExprListExp* decoratorList = NULL); //! Build a defining ( non-prototype) member function declaration from a SgMemberFunctionType SgMemberFunctionDeclaration * buildDefiningMemberFunctionDeclaration (const SgName & name, SgMemberFunctionType* func_type, SgScopeStatement* scope, SgExprListExp* decoratorList = NULL); //! Build a prototype for an existing member function declaration (defining or nondefining is fine) // SgMemberFunctionDeclaration * // buildNondefiningMemberFunctionDeclaration (const SgMemberFunctionDeclaration* funcdecl, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); SgMemberFunctionDeclaration * buildNondefiningMemberFunctionDeclaration (const SgMemberFunctionDeclaration* funcdecl, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL, unsigned int functionConstVolatileFlags = 0); //! A template function for function declaration builders template <class actualFunction> actualFunction * buildDefiningFunctionDeclaration_T (const SgName & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); //! Build a function declaration with a function body SgFunctionDeclaration * buildDefiningFunctionDeclaration (const SgName & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); SgFunctionDeclaration * buildDefiningFunctionDeclaration (const std::string & name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); SgFunctionDeclaration * buildDefiningFunctionDeclaration (const char* name, SgType* return_type, SgFunctionParameterList * parlist, SgScopeStatement* scope=NULL, SgExprListExp* decoratorList = NULL); //! Build a Fortran subroutine or procedure SgProcedureHeaderStatement* buildProcedureHeaderStatement(const char* name, SgType* return_type, SgFunctionParameterList * parlist, SgProcedureHeaderStatement::subprogram_kind_enum, SgScopeStatement* scope=NULL); //! Build a regular function call statement SgExprStatement* buildFunctionCallStmt(const SgName& name, SgType* return_type, SgExprListExp* parameters=NULL, SgScopeStatement* scope=NULL); //! Build a function call statement using function expression and argument list only, like (*funcPtr)(args); SgExprStatement* buildFunctionCallStmt(SgExpression* function, SgExprListExp* parameters=NULL); //! Build a label statement, name is the label's name. Handling label symbol and scope internally. //! Note that the scope of a label statement is special. It is SgFunctionDefinition, //! not the closest scope statement such as SgBasicBlock. SgLabelStatement * buildLabelStatement(const SgName& name, SgStatement * stmt = NULL, SgScopeStatement* scope=NULL); SgLabelStatement * buildLabelStatement_nfi(const SgName& name, SgStatement * stmt, SgScopeStatement* scope); //! Build a goto statement SgGotoStatement * buildGotoStatement(SgLabelStatement * label=NULL); SgGotoStatement * buildGotoStatement_nfi(SgLabelStatement * label); //! Build a goto statement from a label symbol, supporting both C/C++ and Fortran cases SgGotoStatement * buildGotoStatement(SgLabelSymbol* symbol); //! Build a case option statement SgCaseOptionStmt * buildCaseOptionStmt( SgExpression * key = NULL,SgStatement *body = NULL); SgCaseOptionStmt * buildCaseOptionStmt_nfi( SgExpression * key,SgStatement *body); //! Build a default option statement SgDefaultOptionStmt * buildDefaultOptionStmt( SgStatement *body = NULL); SgDefaultOptionStmt * buildDefaultOptionStmt_nfi( SgStatement *body); //! Build a SgExprStatement, set File_Info automatically SgExprStatement* buildExprStatement(SgExpression* exp = NULL); SgExprStatement* buildExprStatement_nfi(SgExpression* exp); //! Build a switch statement SgSwitchStatement* buildSwitchStatement(SgStatement *item_selector = NULL,SgStatement *body = NULL); inline SgSwitchStatement* buildSwitchStatement(SgExpression *item_selector, SgStatement *body = NULL) { return buildSwitchStatement(buildExprStatement(item_selector), body); } SgSwitchStatement* buildSwitchStatement_nfi(SgStatement *item_selector,SgStatement *body); //! Build if statement SgIfStmt * buildIfStmt(SgStatement* conditional, SgStatement * true_body, SgStatement * false_body); inline SgIfStmt * buildIfStmt(SgExpression* conditional, SgStatement * true_body, SgStatement * false_body) { return buildIfStmt(buildExprStatement(conditional), true_body, false_body); } SgIfStmt * buildIfStmt_nfi(SgStatement* conditional, SgStatement * true_body, SgStatement * false_body); //! Build a for init statement SgForInitStatement * buildForInitStatement(); SgForInitStatement * buildForInitStatement(const SgStatementPtrList & statements); SgForInitStatement * buildForInitStatement_nfi(SgStatementPtrList & statements); //!Build a for statement, assume none of the arguments is NULL SgForStatement * buildForStatement(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL); SgForStatement * buildForStatement_nfi(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL); SgForStatement * buildForStatement_nfi(SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgStatement * loop_body, SgStatement * else_body = NULL); //! Build a UPC forall statement SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgStatement* initialize_stmt, SgStatement * test, SgExpression * increment, SgExpression* affinity, SgStatement * loop_body); SgUpcForAllStatement * buildUpcForAllStatement_nfi(SgForInitStatement * init_stmt, SgStatement * test, SgExpression * increment, SgExpression* affinity, SgStatement * loop_body); //! Build while statement SgWhileStmt * buildWhileStmt(SgStatement * condition, SgStatement *body, SgStatement *else_body = NULL); inline SgWhileStmt * buildWhileStmt(SgExpression * condition, SgStatement *body, SgStatement* else_body = NULL) { return buildWhileStmt(buildExprStatement(condition), body, else_body); } SgWhileStmt * buildWhileStmt_nfi(SgStatement * condition, SgStatement *body, SgStatement *else_body = NULL); //! Build a with statement SgWithStatement* buildWithStatement(SgExpression* expr, SgStatement* body); SgWithStatement* buildWithStatement_nfi(SgExpression* expr, SgStatement* body); //! Build do-while statement SgDoWhileStmt * buildDoWhileStmt(SgStatement * body, SgStatement *condition); inline SgDoWhileStmt * buildDoWhileStmt(SgStatement* body, SgExpression * condition) { return buildDoWhileStmt(body, buildExprStatement(condition)); } SgDoWhileStmt * buildDoWhileStmt_nfi(SgStatement * body, SgStatement *condition); //! Build pragma declaration, handle SgPragma and defining/nondefining pointers internally SgPragmaDeclaration * buildPragmaDeclaration(const std::string & name, SgScopeStatement* scope=NULL); SgPragmaDeclaration * buildPragmaDeclaration_nfi(const std::string & name, SgScopeStatement* scope); //!Build SgPragma SgPragma* buildPragma(const std::string & name); //! Build a SgBasicBlock, setting file info internally SgBasicBlock * buildBasicBlock(SgStatement * stmt1 = NULL, SgStatement* stmt2 = NULL, SgStatement* stmt3 = NULL, SgStatement* stmt4 = NULL, SgStatement* stmt5 = NULL, SgStatement* stmt6 = NULL, SgStatement* stmt7 = NULL, SgStatement* stmt8 = NULL, SgStatement* stmt9 = NULL, SgStatement* stmt10 = NULL); SgBasicBlock * buildBasicBlock_nfi(); SgBasicBlock * buildBasicBlock_nfi(const std::vector<SgStatement*>&); //! Build an assignment statement from lefthand operand and right hand operand SgExprStatement* buildAssignStatement(SgExpression* lhs,SgExpression* rhs); // DQ (8/16/2011): Generated a new version of this function to define consistant semantics. //! This version does not recursively reset the file info as a transformation. SgExprStatement* buildAssignStatement_ast_translate(SgExpression* lhs,SgExpression* rhs); //! Build a break statement SgBreakStmt* buildBreakStmt(); SgBreakStmt* buildBreakStmt_nfi(); //! Build a continue statement SgContinueStmt* buildContinueStmt(); SgContinueStmt* buildContinueStmt_nfi(); //! Build a pass statement SgPassStatement* buildPassStatement(); SgPassStatement* buildPassStatement_nfi(); //! Build a Assert statement SgAssertStmt* buildAssertStmt(SgExpression* test); SgAssertStmt* buildAssertStmt(SgExpression *test, SgExpression *exceptionArgument); SgAssertStmt* buildAssertStmt_nfi(SgExpression* test); //! Build a yield statement SgYieldExpression* buildYieldExpression(SgExpression* value); SgYieldExpression* buildYieldExpression_nfi(SgExpression* value); //! Build a key-datum pair SgKeyDatumPair* buildKeyDatumPair (SgExpression* key, SgExpression* datum); SgKeyDatumPair* buildKeyDatumPair_nfi(SgExpression* key, SgExpression* datum); //! Build a list of key-datum pairs SgDictionaryExp* buildDictionaryExp (std::vector<SgKeyDatumPair*> pairs); SgDictionaryExp* buildDictionaryExp_nfi(std::vector<SgKeyDatumPair*> pairs); //! Build an Actual Argument Expression SgActualArgumentExpression* buildActualArgumentExpression(SgName arg_name, SgExpression* arg); SgActualArgumentExpression* buildActualArgumentExpression_nfi(SgName arg_name, SgExpression* arg); //! Build a delete statement SgDeleteExp* buildDeleteExp(SgExpression *target, bool is_array = false, bool need_global_specifier = false, SgFunctionDeclaration *deleteOperatorDeclaration = NULL); SgDeleteExp* buildDeleteExp_nfi(SgExpression *target, bool is_array = false, bool need_global_specifier = false, SgFunctionDeclaration *deleteOperatorDeclaration = NULL); //! Build a class definition scope statement SgClassDefinition* buildClassDefinition(SgClassDeclaration *d = NULL); //! Build a class definition scope statement SgClassDefinition* buildClassDefinition_nfi(SgClassDeclaration *d = NULL); //! Build a structure first nondefining declaration, without file info SgClassDeclaration* buildNondefiningClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope); // DQ (11/7/2009): Added functions to build C++ class. SgClassDeclaration* buildNondefiningClassDeclaration ( SgName name, SgScopeStatement* scope ); SgClassDeclaration* buildDefiningClassDeclaration ( SgName name, SgScopeStatement* scope ); // DQ (11/7/2009): Added function to build C++ class (builts both the definig and non-defining declarations). SgClassDeclaration* buildClassDeclaration ( SgName name, SgScopeStatement* scope ); //! Build an enum first nondefining declaration, without file info SgEnumDeclaration* buildNondefiningEnumDeclaration_nfi(const SgName& name, SgScopeStatement* scope); //! Build a structure, It is also a declaration statement in SAGE III SgClassDeclaration * buildStructDeclaration(const SgName& name, SgScopeStatement* scope=NULL); SgClassDeclaration * buildStructDeclaration(const std::string& name, SgScopeStatement* scope=NULL); SgClassDeclaration * buildStructDeclaration(const char* name, SgScopeStatement* scope=NULL); //! Build a StmtDeclarationStmt SgStmtDeclarationStatement* buildStmtDeclarationStatement(SgStatement* stmt); SgStmtDeclarationStatement* buildStmtDeclarationStatement_nfi(SgStatement* stmt); // tps (09/02/2009) : Added support for building namespaces SgNamespaceDeclarationStatement * buildNamespaceDeclaration(const SgName& name, SgScopeStatement* scope=NULL); SgNamespaceDeclarationStatement * buildNamespaceDeclaration_nfi(const SgName& name, bool unnamednamespace, SgScopeStatement* scope ); SgNamespaceDefinitionStatement * buildNamespaceDefinition(SgNamespaceDeclarationStatement* d=NULL); // driscoll6 (7/20/11) : Support n-ary operators for python SgNaryComparisonOp* buildNaryComparisonOp(SgExpression* lhs); SgNaryComparisonOp* buildNaryComparisonOp_nfi(SgExpression* lhs); SgNaryBooleanOp* buildNaryBooleanOp(SgExpression* lhs); SgNaryBooleanOp* buildNaryBooleanOp_nfi(SgExpression* lhs); SgStringConversion* buildStringConversion(SgExpression* exp); SgStringConversion* buildStringConversion_nfi(SgExpression* exp); // DQ (1/24/2009): Added this "_nfi" function but refactored buildStructDeclaration to also use it (thsi needs to be done uniformally). SgClassDeclaration * buildClassDeclaration_nfi(const SgName& name, SgClassDeclaration::class_types kind, SgScopeStatement* scope, SgClassDeclaration* nonDefiningDecl); //! Build an enum, It is also a declaration statement in SAGE III SgEnumDeclaration * buildEnumDeclaration(const SgName& name, SgScopeStatement* scope=NULL); //! Build an enum, It is also a declaration statement in SAGE III SgEnumDeclaration * buildEnumDeclaration_nfi(const SgName& name, SgScopeStatement* scope=NULL); //! Build a return statement SgReturnStmt* buildReturnStmt(SgExpression* expression = NULL); SgReturnStmt* buildReturnStmt_nfi(SgExpression* expression); //! Build a NULL statement SgNullStatement* buildNullStatement(); SgNullStatement* buildNullStatement_nfi(); //! Build Fortran attribute specification statement SgAttributeSpecificationStatement * buildAttributeSpecificationStatement(SgAttributeSpecificationStatement::attribute_spec_enum kind); //! Build Fortran include line SgFortranIncludeLine* buildFortranIncludeLine(std::string filename); //! Build a Fortran common block, possibly with a name SgCommonBlockObject* buildCommonBlockObject(std::string name="", SgExprListExp* exp_list=NULL); //! Build a Fortran Common statement SgCommonBlock* buildCommonBlock(SgCommonBlockObject* first_block=NULL); // driscoll6 (6/9/2011): Adding support for try stmts. // ! Build a catch statement. SgCatchOptionStmt* buildCatchOptionStmt(SgVariableDeclaration* condition=NULL, SgStatement* body=NULL); // driscoll6 (6/9/2011): Adding support for try stmts. // ! Build a try statement. SgTryStmt* buildTryStmt(SgStatement* body, SgCatchOptionStmt* catch0=NULL, SgCatchOptionStmt* catch1=NULL, SgCatchOptionStmt* catch2=NULL, SgCatchOptionStmt* catch3=NULL, SgCatchOptionStmt* catch4=NULL); // charles4 (9/16/2011): Adding support for try stmts. // ! Build a try statement. //SgTryStmt* buildTryStmt(SgStatement *try_body, SgCatchStatementSeq *catches, SgStatement *finally_body = NULL); // charles4 (9/16/2011): Adding support for try stmts. // ! Build a try statement. SgTryStmt* buildTryStmt(SgBasicBlock *try_body, SgBasicBlock *finally_body = NULL); // charles4 (9/16/2011): Adding support for Catch Blocks. // ! Build an initial sequence of Catch blocks containing 0 or 1 element. SgCatchStatementSeq *buildCatchStatementSeq(SgCatchOptionStmt * = NULL); // charles4 (8/25/2011): Adding support for Java Synchronized stmts. // ! Build a Java Synchronized statement. SgJavaSynchronizedStatement *buildJavaSynchronizedStatement(SgExpression *, SgBasicBlock *); // charles4 (8/25/2011): Adding support for Java Throw stmts. // ! Build a Java Throw statement. SgJavaThrowStatement *buildJavaThrowStatement(SgThrowOp *); // charles4 (8/25/2011): Adding support for Java Foreach stmts. // ! Build a Java Foreach statement. // SgJavaForEachStatement *buildJavaForEachStatement(SgInitializedName * = NULL, SgExpression * = NULL, SgStatement * = NULL); SgJavaForEachStatement *buildJavaForEachStatement(SgVariableDeclaration * = NULL, SgExpression * = NULL, SgStatement * = NULL); // charles4 (8/25/2011): Adding support for Java Label stmts. // ! Build a Java Label statement. SgJavaLabelStatement *buildJavaLabelStatement(const SgName &, SgStatement * = NULL); // ! Build an exec statement SgExecStatement* buildExecStatement(SgExpression* executable, SgExpression* globals = NULL, SgExpression* locals = NULL); SgExecStatement* buildExecStatement_nfi(SgExpression* executable, SgExpression* globals = NULL, SgExpression* locals = NULL); // ! Build a python print statement SgPythonPrintStmt* buildPythonPrintStmt(SgExpression* dest = NULL, SgExprListExp* values = NULL); SgPythonPrintStmt* buildPythonPrintStmt_nfi(SgExpression* dest = NULL, SgExprListExp* values = NULL); // ! Build a python global statement SgPythonGlobalStmt* buildPythonGlobalStmt(SgInitializedNamePtrList& names); SgPythonGlobalStmt* buildPythonGlobalStmt_nfi(SgInitializedNamePtrList& names); // DQ (4/30/2010): Added support for building asm statements. //! Build a NULL statement SgAsmStmt* buildAsmStatement(std::string s); SgAsmStmt* buildAsmStatement_nfi(std::string s); // DQ (4/30/2010): Added support for building nop statement using asm statement // ! Building nop statement using asm statement SgAsmStmt* buildMultibyteNopStatement( int n ); //@} //-------------------------------------------------------------- //@{ /*! @name Builders for others \brief AST high level builders for others */ //! Build a SgFile node and attach it to SgProject /*! The input file will be loaded if exists, or an empty one will be generated from scratch transparently. Output file name is used to specify the output file name of unparsing. The final SgFile will be inserted to project automatically. If not provided, a new SgProject will be generated internally. Using SgFile->get_project() to retrieve it in this case. */ SgFile* buildFile(const std::string& inputFileName,const std::string& outputFileName, SgProject* project=NULL); //! Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment(). PreprocessingInfo* buildComment(SgLocatedNode* target, const std::string & content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before, PreprocessingInfo::DirectiveType dtype= PreprocessingInfo::CpreprocessorUnknownDeclaration); //! Build and attach #define XX directives, pass "#define xxx xxx" as content. PreprocessingInfo* buildCpreprocessorDefineDeclaration(SgLocatedNode* target, const std::string & content, PreprocessingInfo::RelativePositionType position=PreprocessingInfo::before); #ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT //! Build an abstract handle from a SgNode AbstractHandle::abstract_handle * buildAbstractHandle(SgNode* n); #endif //@} } // end of namespace #endif //ROSE_SAGE_BUILDER_INTERFACE
54.189655
843
0.794269
9cac9cfb6178ce05253257adca88fa9dcbf608e9
1,375
c
C
d/dagger/Elvanta/forest/roomdruid1.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
d/dagger/Elvanta/forest/roomdruid1.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
4
2021-03-15T18:56:39.000Z
2021-08-17T17:08:22.000Z
d/dagger/Elvanta/forest/roomdruid1.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> inherit ROOM; void create() { :: create(); set_property("light", 2); set_property("indoors", 1); set_short("The Druids' Room"); set_long("%^GREEN%^This is the resting place for the druids of Elvanta. Herein lies a simple couch for rest, a desk for writing, and a chair for thought. All of these are crafted by the love the druid holds for this forest realm, of the realm, and by the realm. So you have the answer as to how the trees formed the city, by the love of the tree druid."); set_smell ("default", "%^MAGENTA%^\nThe faint odour of jasmine and sandlewood mixes in the air, refreshing your weary senses.%^RESET%^"); set_listen ("default", "%^ORANGE%^Only the whispers of time are heard in this room"); set_exits( ([ "west" : "/d/dagger/Elvanta/forest/roomdruid2", "north" : "/d/dagger/Elvanta/forest/roomcastle4b" ]) ); set_items(([ "couch" : "%^BOLD%^BLUE%^A worn, faded, well used couch takes up the north east corner of the room, it has been used for ages and shows the wear, tear and worry.", "desk" : "Another work of art, molded from the great trees themselves, by the love the trees hold for the druid", "chair" : "Worn in spots, but lovingly cared for, the seat of the chair is shiny and smooth, polished by eons of thought" ]) ); } void reset() { ::reset(); if(!present("wirinth")) new("/d/dagger/Elvanta/forest/mon/wirinth")->move(TO); }
49.107143
358
0.714909
1b083b23bcb87103dd72ef8eef335e74e4c80c49
379
h
C
software/freqRelay/helpers.h
MingChen91/cs723_group1
b4d7983e07263bb94df7043237411ad0fb7e2840
[ "MIT" ]
null
null
null
software/freqRelay/helpers.h
MingChen91/cs723_group1
b4d7983e07263bb94df7043237411ad0fb7e2840
[ "MIT" ]
null
null
null
software/freqRelay/helpers.h
MingChen91/cs723_group1
b4d7983e07263bb94df7043237411ad0fb7e2840
[ "MIT" ]
null
null
null
#ifndef HELPERS_H_ #define HELPERS_H_ #include <stdint.h> #define SHIFT_REG_LEN 5 #define CHAR_BUFFER_SIZE 10 #define CONSTRUCT_FLOAT_DONE 0 #define CONSTRUCT_FLOAT_NOT_DONE 1 void shiftReg(int newNumber, int array[]); int setLeftMostUnsetBit(int n); int8_t constructFloat(float *resultFloat, char inputChar, char *charBuffer); #endif /* HELPERS_H_ */
23.6875
76
0.74934
6cee006b092f0f118aa516368e4cdb4e46ccb82f
23,826
h
C
project/c++/mri/src/PI-slim-napa/libipfix/ipfix_def.h
jia57196/code41
df611f84592afd453ccb2d22a7ad999ddb68d028
[ "Apache-2.0" ]
null
null
null
project/c++/mri/src/PI-slim-napa/libipfix/ipfix_def.h
jia57196/code41
df611f84592afd453ccb2d22a7ad999ddb68d028
[ "Apache-2.0" ]
null
null
null
project/c++/mri/src/PI-slim-napa/libipfix/ipfix_def.h
jia57196/code41
df611f84592afd453ccb2d22a7ad999ddb68d028
[ "Apache-2.0" ]
null
null
null
/* * IPFIX structs, types and definitions * * This is a generated file. Do not edit! * */ #ifndef IPFIX_DEF_H #define IPFIX_DEF_H #define IPFIX_CODING_INT 1 #define IPFIX_CODING_UINT 2 #define IPFIX_CODING_BYTES 3 #define IPFIX_CODING_STRING 4 #define IPFIX_CODING_FLOAT 5 #define IPFIX_CODING_NTP 6 #define IPFIX_CODING_IPADDR 7 #define REV_PEN 29305 /* reverse elements private enterprise number, see RFC5103 */ typedef int (*ipfix_encode_func) (void *, void*, size_t); typedef int (*ipfix_decode_func) (void *, void*, size_t); typedef int (*ipfix_snprint_func) (char *, size_t, void*, size_t); typedef struct { int eno; /* enterprise number or 0 */ int ftype; /* field type */ ssize_t length; /* field length */ int coding; char *name; char *documentation; } ipfix_field_type_t; typedef struct ipfix_field { struct ipfix_field *next; ipfix_field_type_t *ft; ipfix_encode_func encode; ipfix_decode_func decode; ipfix_snprint_func snprint; } ipfix_field_t; #define IPFIX_FT_OCTETDELTACOUNT 1 #define IPFIX_FT_PACKETDELTACOUNT 2 #define IPFIX_FT_FLOWS 3 #define IPFIX_FT_PROTOCOLIDENTIFIER 4 #define IPFIX_FT_IPCLASSOFSERVICE 5 #define IPFIX_FT_TCPCONTROLBITS 6 #define IPFIX_FT_SOURCETRANSPORTPORT 7 #define IPFIX_FT_SOURCEIPV4ADDRESS 8 #define IPFIX_FT_SOURCEIPV4PREFIXLENGTH 9 #define IPFIX_FT_INGRESSINTERFACE 10 #define IPFIX_FT_DESTINATIONTRANSPORTPORT 11 #define IPFIX_FT_DESTINATIONIPV4ADDRESS 12 #define IPFIX_FT_DESTINATIONIPV4PREFIXLENGTH 13 #define IPFIX_FT_EGRESSINTERFACE 14 #define IPFIX_FT_IPNEXTHOPIPV4ADDRESS 15 #define IPFIX_FT_BGPSOURCEASNUMBER 16 #define IPFIX_FT_BGPDESTINATIONASNUMBER 17 #define IPFIX_FT_BGPNEXTHOPIPV4ADDRESS 18 #define IPFIX_FT_POSTMCASTPACKETDELTACOUNT 19 #define IPFIX_FT_POSTMCASTOCTETDELTACOUNT 20 #define IPFIX_FT_FLOWENDSYSUPTIME 21 #define IPFIX_FT_FLOWSTARTSYSUPTIME 22 #define IPFIX_FT_POSTOCTETDELTACOUNT 23 #define IPFIX_FT_POSTPACKETDELTACOUNT 24 #define IPFIX_FT_MINIMUMIPTOTALLENGTH 25 #define IPFIX_FT_MAXIMUMIPTOTALLENGTH 26 #define IPFIX_FT_SOURCEIPV6ADDRESS 27 #define IPFIX_FT_DESTINATIONIPV6ADDRESS 28 #define IPFIX_FT_SOURCEIPV6PREFIXLENGTH 29 #define IPFIX_FT_DESTINATIONIPV6PREFIXLENGTH 30 #define IPFIX_FT_FLOWLABELIPV6 31 #define IPFIX_FT_ICMPTYPECODEIPV4 32 #define IPFIX_FT_IGMPTYPE 33 #define IPFIX_FT_SAMPLING_INTERVAL 34 #define IPFIX_FT_SAMPLING_ALGORITHM 35 #define IPFIX_FT_FLOWACTIVETIMEOUT 36 #define IPFIX_FT_FLOWIDLETIMEOUT 37 #define IPFIX_FT_ENGINE_TYPE 38 #define IPFIX_FT_ENGINE_ID 39 #define IPFIX_FT_EXPORTEDOCTETTOTALCOUNT 40 #define IPFIX_FT_EXPORTEDMESSAGETOTALCOUNT 41 #define IPFIX_FT_EXPORTEDFLOWRECORDTOTALCOUNT 42 #define IPFIX_FT_SOURCEIPV4PREFIX 44 #define IPFIX_FT_DESTINATIONIPV4PREFIX 45 #define IPFIX_FT_MPLSTOPLABELTYPE 46 #define IPFIX_FT_MPLSTOPLABELIPV4ADDRESS 47 #define IPFIX_FT_FLOW_SAMPLER_ID 48 #define IPFIX_FT_FLOW_SAMPLER_MODE 49 #define IPFIX_FT_FLOW_SAMPLER_RANDOM_INTERVAL 50 #define IPFIX_FT_MINIMUMTTL 52 #define IPFIX_FT_MAXIMUMTTL 53 #define IPFIX_FT_FRAGMENTIDENTIFICATION 54 #define IPFIX_FT_POSTIPCLASSOFSERVICE 55 #define IPFIX_FT_SOURCEMACADDRESS 56 #define IPFIX_FT_POSTDESTINATIONMACADDRESS 57 #define IPFIX_FT_VLANID 58 #define IPFIX_FT_POSTVLANID 59 #define IPFIX_FT_IPVERSION 60 #define IPFIX_FT_FLOWDIRECTION 61 #define IPFIX_FT_IPNEXTHOPIPV6ADDRESS 62 #define IPFIX_FT_BGPNEXTHOPIPV6ADDRESS 63 #define IPFIX_FT_IPV6EXTENSIONHEADERS 64 #define IPFIX_FT_MPLSTOPLABELSTACKSECTION 70 #define IPFIX_FT_MPLSLABELSTACKSECTION2 71 #define IPFIX_FT_MPLSLABELSTACKSECTION3 72 #define IPFIX_FT_MPLSLABELSTACKSECTION4 73 #define IPFIX_FT_MPLSLABELSTACKSECTION5 74 #define IPFIX_FT_MPLSLABELSTACKSECTION6 75 #define IPFIX_FT_MPLSLABELSTACKSECTION7 76 #define IPFIX_FT_MPLSLABELSTACKSECTION8 77 #define IPFIX_FT_MPLSLABELSTACKSECTION9 78 #define IPFIX_FT_MPLSLABELSTACKSECTION10 79 #define IPFIX_FT_DESTINATIONMACADDRESS 80 #define IPFIX_FT_POSTSOURCEMACADDRESS 81 #define IPFIX_FT_OCTETTOTALCOUNT 85 #define IPFIX_FT_PACKETTOTALCOUNT 86 #define IPFIX_FT_FRAGMENTOFFSET 88 #define IPFIX_FT_MPLSVPNROUTEDISTINGUISHER 90 #define IPFIX_FT_BGPNEXTADJACENTASNUMBER 128 #define IPFIX_FT_BGPPREVADJACENTASNUMBER 129 #define IPFIX_FT_EXPORTERIPV4ADDRESS 130 #define IPFIX_FT_EXPORTERIPV6ADDRESS 131 #define IPFIX_FT_DROPPEDOCTETDELTACOUNT 132 #define IPFIX_FT_DROPPEDPACKETDELTACOUNT 133 #define IPFIX_FT_DROPPEDOCTETTOTALCOUNT 134 #define IPFIX_FT_DROPPEDPACKETTOTALCOUNT 135 #define IPFIX_FT_FLOWENDREASON 136 #define IPFIX_FT_COMMONPROPERTIESID 137 #define IPFIX_FT_OBSERVATIONPOINTID 138 #define IPFIX_FT_ICMPTYPECODEIPV6 139 #define IPFIX_FT_MPLSTOPLABELIPV6ADDRESS 140 #define IPFIX_FT_LINECARDID 141 #define IPFIX_FT_PORTID 142 #define IPFIX_FT_METERINGPROCESSID 143 #define IPFIX_FT_EXPORTINGPROCESSID 144 #define IPFIX_FT_TEMPLATEID 145 #define IPFIX_FT_WLANCHANNELID 146 #define IPFIX_FT_WLANSSID 147 #define IPFIX_FT_FLOWID 148 #define IPFIX_FT_OBSERVATIONDOMAINID 149 #define IPFIX_FT_FLOWSTARTSECONDS 150 #define IPFIX_FT_FLOWENDSECONDS 151 #define IPFIX_FT_FLOWSTARTMILLISECONDS 152 #define IPFIX_FT_FLOWENDMILLISECONDS 153 #define IPFIX_FT_FLOWSTARTMICROSECONDS 154 #define IPFIX_FT_FLOWENDMICROSECONDS 155 #define IPFIX_FT_FLOWSTARTNANOSECONDS 156 #define IPFIX_FT_FLOWENDNANOSECONDS 157 #define IPFIX_FT_FLOWSTARTDELTAMICROSECONDS 158 #define IPFIX_FT_FLOWENDDELTAMICROSECONDS 159 #define IPFIX_FT_SYSTEMINITTIMEMILLISECONDS 160 #define IPFIX_FT_FLOWDURATIONMILLISECONDS 161 #define IPFIX_FT_FLOWDURATIONMICROSECONDS 162 #define IPFIX_FT_OBSERVEDFLOWTOTALCOUNT 163 #define IPFIX_FT_IGNOREDPACKETTOTALCOUNT 164 #define IPFIX_FT_IGNOREDOCTETTOTALCOUNT 165 #define IPFIX_FT_NOTSENTFLOWTOTALCOUNT 166 #define IPFIX_FT_NOTSENTPACKETTOTALCOUNT 167 #define IPFIX_FT_NOTSENTOCTETTOTALCOUNT 168 #define IPFIX_FT_DESTINATIONIPV6PREFIX 169 #define IPFIX_FT_SOURCEIPV6PREFIX 170 #define IPFIX_FT_POSTOCTETTOTALCOUNT 171 #define IPFIX_FT_POSTPACKETTOTALCOUNT 172 #define IPFIX_FT_FLOWKEYINDICATOR 173 #define IPFIX_FT_POSTMCASTPACKETTOTALCOUNT 174 #define IPFIX_FT_POSTMCASTOCTETTOTALCOUNT 175 #define IPFIX_FT_ICMPTYPEIPV4 176 #define IPFIX_FT_ICMPCODEIPV4 177 #define IPFIX_FT_ICMPTYPEIPV6 178 #define IPFIX_FT_ICMPCODEIPV6 179 #define IPFIX_FT_UDPSOURCEPORT 180 #define IPFIX_FT_UDPDESTINATIONPORT 181 #define IPFIX_FT_TCPSOURCEPORT 182 #define IPFIX_FT_TCPDESTINATIONPORT 183 #define IPFIX_FT_TCPSEQUENCENUMBER 184 #define IPFIX_FT_TCPACKNOWLEDGEMENTNUMBER 185 #define IPFIX_FT_TCPWINDOWSIZE 186 #define IPFIX_FT_TCPURGENTPOINTER 187 #define IPFIX_FT_TCPHEADERLENGTH 188 #define IPFIX_FT_IPHEADERLENGTH 189 #define IPFIX_FT_TOTALLENGTHIPV4 190 #define IPFIX_FT_PAYLOADLENGTHIPV6 191 #define IPFIX_FT_IPTTL 192 #define IPFIX_FT_NEXTHEADERIPV6 193 #define IPFIX_FT_MPLSPAYLOADLENGTH 194 #define IPFIX_FT_IPDIFFSERVCODEPOINT 195 #define IPFIX_FT_IPPRECEDENCE 196 #define IPFIX_FT_FRAGMENTFLAGS 197 #define IPFIX_FT_OCTETDELTASUMOFSQUARES 198 #define IPFIX_FT_OCTETTOTALSUMOFSQUARES 199 #define IPFIX_FT_MPLSTOPLABELTTL 200 #define IPFIX_FT_MPLSLABELSTACKLENGTH 201 #define IPFIX_FT_MPLSLABELSTACKDEPTH 202 #define IPFIX_FT_MPLSTOPLABELEXP 203 #define IPFIX_FT_IPPAYLOADLENGTH 204 #define IPFIX_FT_UDPMESSAGELENGTH 205 #define IPFIX_FT_ISMULTICAST 206 #define IPFIX_FT_IPV4IHL 207 #define IPFIX_FT_IPV4OPTIONS 208 #define IPFIX_FT_TCPOPTIONS 209 #define IPFIX_FT_PADDINGOCTETS 210 #define IPFIX_FT_COLLECTORIPV4ADDRESS 211 #define IPFIX_FT_COLLECTORIPV6ADDRESS 212 #define IPFIX_FT_COLLECTORINTERFACE 213 #define IPFIX_FT_COLLECTORPROTOCOLVERSION 214 #define IPFIX_FT_COLLECTORTRANSPORTPROTOCOL 215 #define IPFIX_FT_COLLECTORTRANSPORTPORT 216 #define IPFIX_FT_EXPORTERTRANSPORTPORT 217 #define IPFIX_FT_TCPSYNTOTALCOUNT 218 #define IPFIX_FT_TCPFINTOTALCOUNT 219 #define IPFIX_FT_TCPRSTTOTALCOUNT 220 #define IPFIX_FT_TCPPSHTOTALCOUNT 221 #define IPFIX_FT_TCPACKTOTALCOUNT 222 #define IPFIX_FT_TCPURGTOTALCOUNT 223 #define IPFIX_FT_IPTOTALLENGTH 224 #define IPFIX_FT_POSTMPLSTOPLABELEXP 237 #define IPFIX_FT_TCPWINDOWSCALE 238 #define IPFIX_FT_OBSERVATIONPOINTID_PSAMP 300 #define IPFIX_FT_SELECTIONSEQUENCEID 301 #define IPFIX_FT_SELECTORID 302 #define IPFIX_FT_INFORMATIONELEMENTID 303 #define IPFIX_FT_SELECTORALGORITHM 304 #define IPFIX_FT_SAMPLINGPACKETINTERVAL 305 #define IPFIX_FT_SAMPLINGPACKETSPACE 306 #define IPFIX_FT_SAMPLINGTIMEINTERVAL 307 #define IPFIX_FT_SAMPLINGTIMESPACE 308 #define IPFIX_FT_SAMPLINGSIZE 309 #define IPFIX_FT_SAMPLINGPOPULATION 310 #define IPFIX_FT_SAMPLINGPROBABILITY 311 #define IPFIX_FT_DATALINKFRAMESIZE 312 #define IPFIX_FT_IPHEADERPACKETSECTION 313 #define IPFIX_FT_IPPAYLOADPACKETSECTION 314 #define IPFIX_FT_DATALINKFRAMESECTION 315 #define IPFIX_FT_MPLSLABELSTACKSECTION 316 #define IPFIX_FT_MPLSPAYLOADPACKETSECTION 317 #define IPFIX_FT_PACKETSOBSERVED 318 #define IPFIX_FT_PACKETSSELECTED 319 #define IPFIX_FT_FIXEDERROR 320 #define IPFIX_FT_RELATIVEERROR 321 #define IPFIX_FT_OBSERVATIONTIMESECONDS 322 #define IPFIX_FT_OBSERVATIONTIMEMILLISECONDS 323 #define IPFIX_FT_OBSERVATIONTIMEMICROSECONDS 324 #define IPFIX_FT_OBSERVATIONTIMENANOSECONDS 325 #define IPFIX_FT_DIGESTHASHVALUE 326 #define IPFIX_FT_HASHIPPAYLOADOFFSET 327 #define IPFIX_FT_HASHIPPAYLOADSIZE 328 #define IPFIX_FT_HASHOUTPUTRANGEMIN 329 #define IPFIX_FT_HASHOUTPUTRANGEMAX 330 #define IPFIX_FT_HASHSELECTEDRANGEMIN 331 #define IPFIX_FT_HASHSELECTEDRANGEMAX 332 #define IPFIX_FT_HASHDIGESTOUTPUT 333 #define IPFIX_FT_HASHINITIALISERVALUE 334 /* column name definitions */ #define IPFIX_CN_OCTETDELTACOUNT "ie0_1" #define IPFIX_CN_PACKETDELTACOUNT "ie0_2" #define IPFIX_CN_FLOWS "ie0_3" #define IPFIX_CN_PROTOCOLIDENTIFIER "ie0_4" #define IPFIX_CN_IPCLASSOFSERVICE "ie0_5" #define IPFIX_CN_TCPCONTROLBITS "ie0_6" #define IPFIX_CN_SOURCETRANSPORTPORT "ie0_7" #define IPFIX_CN_SOURCEIPV4ADDRESS "ie0_8" #define IPFIX_CN_SOURCEIPV4PREFIXLENGTH "ie0_9" #define IPFIX_CN_INGRESSINTERFACE "ie0_a" #define IPFIX_CN_DESTINATIONTRANSPORTPORT "ie0_b" #define IPFIX_CN_DESTINATIONIPV4ADDRESS "ie0_c" #define IPFIX_CN_DESTINATIONIPV4PREFIXLENGTH "ie0_d" #define IPFIX_CN_EGRESSINTERFACE "ie0_e" #define IPFIX_CN_IPNEXTHOPIPV4ADDRESS "ie0_f" #define IPFIX_CN_BGPSOURCEASNUMBER "ie0_10" #define IPFIX_CN_BGPDESTINATIONASNUMBER "ie0_11" #define IPFIX_CN_BGPNEXTHOPIPV4ADDRESS "ie0_12" #define IPFIX_CN_POSTMCASTPACKETDELTACOUNT "ie0_13" #define IPFIX_CN_POSTMCASTOCTETDELTACOUNT "ie0_14" #define IPFIX_CN_FLOWENDSYSUPTIME "ie0_15" #define IPFIX_CN_FLOWSTARTSYSUPTIME "ie0_16" #define IPFIX_CN_POSTOCTETDELTACOUNT "ie0_17" #define IPFIX_CN_POSTPACKETDELTACOUNT "ie0_18" #define IPFIX_CN_MINIMUMIPTOTALLENGTH "ie0_19" #define IPFIX_CN_MAXIMUMIPTOTALLENGTH "ie0_1a" #define IPFIX_CN_SOURCEIPV6ADDRESS "ie0_1b" #define IPFIX_CN_DESTINATIONIPV6ADDRESS "ie0_1c" #define IPFIX_CN_SOURCEIPV6PREFIXLENGTH "ie0_1d" #define IPFIX_CN_DESTINATIONIPV6PREFIXLENGTH "ie0_1e" #define IPFIX_CN_FLOWLABELIPV6 "ie0_1f" #define IPFIX_CN_ICMPTYPECODEIPV4 "ie0_20" #define IPFIX_CN_IGMPTYPE "ie0_21" #define IPFIX_CN_SAMPLING_INTERVAL "ie0_22" #define IPFIX_CN_SAMPLING_ALGORITHM "ie0_23" #define IPFIX_CN_FLOWACTIVETIMEOUT "ie0_24" #define IPFIX_CN_FLOWIDLETIMEOUT "ie0_25" #define IPFIX_CN_ENGINE_TYPE "ie0_26" #define IPFIX_CN_ENGINE_ID "ie0_27" #define IPFIX_CN_EXPORTEDOCTETTOTALCOUNT "ie0_28" #define IPFIX_CN_EXPORTEDMESSAGETOTALCOUNT "ie0_29" #define IPFIX_CN_EXPORTEDFLOWRECORDTOTALCOUNT "ie0_2a" #define IPFIX_CN_SOURCEIPV4PREFIX "ie0_2c" #define IPFIX_CN_DESTINATIONIPV4PREFIX "ie0_2d" #define IPFIX_CN_MPLSTOPLABELTYPE "ie0_2e" #define IPFIX_CN_MPLSTOPLABELIPV4ADDRESS "ie0_2f" #define IPFIX_CN_FLOW_SAMPLER_ID "ie0_30" #define IPFIX_CN_FLOW_SAMPLER_MODE "ie0_31" #define IPFIX_CN_FLOW_SAMPLER_RANDOM_INTERVAL "ie0_32" #define IPFIX_CN_MINIMUMTTL "ie0_34" #define IPFIX_CN_MAXIMUMTTL "ie0_35" #define IPFIX_CN_FRAGMENTIDENTIFICATION "ie0_36" #define IPFIX_CN_POSTIPCLASSOFSERVICE "ie0_37" #define IPFIX_CN_SOURCEMACADDRESS "ie0_38" #define IPFIX_CN_POSTDESTINATIONMACADDRESS "ie0_39" #define IPFIX_CN_VLANID "ie0_3a" #define IPFIX_CN_POSTVLANID "ie0_3b" #define IPFIX_CN_IPVERSION "ie0_3c" #define IPFIX_CN_FLOWDIRECTION "ie0_3d" #define IPFIX_CN_IPNEXTHOPIPV6ADDRESS "ie0_3e" #define IPFIX_CN_BGPNEXTHOPIPV6ADDRESS "ie0_3f" #define IPFIX_CN_IPV6EXTENSIONHEADERS "ie0_40" #define IPFIX_CN_MPLSTOPLABELSTACKSECTION "ie0_46" #define IPFIX_CN_MPLSLABELSTACKSECTION2 "ie0_47" #define IPFIX_CN_MPLSLABELSTACKSECTION3 "ie0_48" #define IPFIX_CN_MPLSLABELSTACKSECTION4 "ie0_49" #define IPFIX_CN_MPLSLABELSTACKSECTION5 "ie0_4a" #define IPFIX_CN_MPLSLABELSTACKSECTION6 "ie0_4b" #define IPFIX_CN_MPLSLABELSTACKSECTION7 "ie0_4c" #define IPFIX_CN_MPLSLABELSTACKSECTION8 "ie0_4d" #define IPFIX_CN_MPLSLABELSTACKSECTION9 "ie0_4e" #define IPFIX_CN_MPLSLABELSTACKSECTION10 "ie0_4f" #define IPFIX_CN_DESTINATIONMACADDRESS "ie0_50" #define IPFIX_CN_POSTSOURCEMACADDRESS "ie0_51" #define IPFIX_CN_OCTETTOTALCOUNT "ie0_55" #define IPFIX_CN_PACKETTOTALCOUNT "ie0_56" #define IPFIX_CN_FRAGMENTOFFSET "ie0_58" #define IPFIX_CN_MPLSVPNROUTEDISTINGUISHER "ie0_5a" #define IPFIX_CN_BGPNEXTADJACENTASNUMBER "ie0_80" #define IPFIX_CN_BGPPREVADJACENTASNUMBER "ie0_81" #define IPFIX_CN_EXPORTERIPV4ADDRESS "ie0_82" #define IPFIX_CN_EXPORTERIPV6ADDRESS "ie0_83" #define IPFIX_CN_DROPPEDOCTETDELTACOUNT "ie0_84" #define IPFIX_CN_DROPPEDPACKETDELTACOUNT "ie0_85" #define IPFIX_CN_DROPPEDOCTETTOTALCOUNT "ie0_86" #define IPFIX_CN_DROPPEDPACKETTOTALCOUNT "ie0_87" #define IPFIX_CN_FLOWENDREASON "ie0_88" #define IPFIX_CN_COMMONPROPERTIESID "ie0_89" #define IPFIX_CN_OBSERVATIONPOINTID "ie0_8a" #define IPFIX_CN_ICMPTYPECODEIPV6 "ie0_8b" #define IPFIX_CN_MPLSTOPLABELIPV6ADDRESS "ie0_8c" #define IPFIX_CN_LINECARDID "ie0_8d" #define IPFIX_CN_PORTID "ie0_8e" #define IPFIX_CN_METERINGPROCESSID "ie0_8f" #define IPFIX_CN_EXPORTINGPROCESSID "ie0_90" #define IPFIX_CN_TEMPLATEID "ie0_91" #define IPFIX_CN_WLANCHANNELID "ie0_92" #define IPFIX_CN_WLANSSID "ie0_93" #define IPFIX_CN_FLOWID "ie0_94" #define IPFIX_CN_OBSERVATIONDOMAINID "ie0_95" #define IPFIX_CN_FLOWSTARTSECONDS "ie0_96" #define IPFIX_CN_FLOWENDSECONDS "ie0_97" #define IPFIX_CN_FLOWSTARTMILLISECONDS "ie0_98" #define IPFIX_CN_FLOWENDMILLISECONDS "ie0_99" #define IPFIX_CN_FLOWSTARTMICROSECONDS "ie0_9a" #define IPFIX_CN_FLOWENDMICROSECONDS "ie0_9b" #define IPFIX_CN_FLOWSTARTNANOSECONDS "ie0_9c" #define IPFIX_CN_FLOWENDNANOSECONDS "ie0_9d" #define IPFIX_CN_FLOWSTARTDELTAMICROSECONDS "ie0_9e" #define IPFIX_CN_FLOWENDDELTAMICROSECONDS "ie0_9f" #define IPFIX_CN_SYSTEMINITTIMEMILLISECONDS "ie0_a0" #define IPFIX_CN_FLOWDURATIONMILLISECONDS "ie0_a1" #define IPFIX_CN_FLOWDURATIONMICROSECONDS "ie0_a2" #define IPFIX_CN_OBSERVEDFLOWTOTALCOUNT "ie0_a3" #define IPFIX_CN_IGNOREDPACKETTOTALCOUNT "ie0_a4" #define IPFIX_CN_IGNOREDOCTETTOTALCOUNT "ie0_a5" #define IPFIX_CN_NOTSENTFLOWTOTALCOUNT "ie0_a6" #define IPFIX_CN_NOTSENTPACKETTOTALCOUNT "ie0_a7" #define IPFIX_CN_NOTSENTOCTETTOTALCOUNT "ie0_a8" #define IPFIX_CN_DESTINATIONIPV6PREFIX "ie0_a9" #define IPFIX_CN_SOURCEIPV6PREFIX "ie0_aa" #define IPFIX_CN_POSTOCTETTOTALCOUNT "ie0_ab" #define IPFIX_CN_POSTPACKETTOTALCOUNT "ie0_ac" #define IPFIX_CN_FLOWKEYINDICATOR "ie0_ad" #define IPFIX_CN_POSTMCASTPACKETTOTALCOUNT "ie0_ae" #define IPFIX_CN_POSTMCASTOCTETTOTALCOUNT "ie0_af" #define IPFIX_CN_ICMPTYPEIPV4 "ie0_b0" #define IPFIX_CN_ICMPCODEIPV4 "ie0_b1" #define IPFIX_CN_ICMPTYPEIPV6 "ie0_b2" #define IPFIX_CN_ICMPCODEIPV6 "ie0_b3" #define IPFIX_CN_UDPSOURCEPORT "ie0_b4" #define IPFIX_CN_UDPDESTINATIONPORT "ie0_b5" #define IPFIX_CN_TCPSOURCEPORT "ie0_b6" #define IPFIX_CN_TCPDESTINATIONPORT "ie0_b7" #define IPFIX_CN_TCPSEQUENCENUMBER "ie0_b8" #define IPFIX_CN_TCPACKNOWLEDGEMENTNUMBER "ie0_b9" #define IPFIX_CN_TCPWINDOWSIZE "ie0_ba" #define IPFIX_CN_TCPURGENTPOINTER "ie0_bb" #define IPFIX_CN_TCPHEADERLENGTH "ie0_bc" #define IPFIX_CN_IPHEADERLENGTH "ie0_bd" #define IPFIX_CN_TOTALLENGTHIPV4 "ie0_be" #define IPFIX_CN_PAYLOADLENGTHIPV6 "ie0_bf" #define IPFIX_CN_IPTTL "ie0_c0" #define IPFIX_CN_NEXTHEADERIPV6 "ie0_c1" #define IPFIX_CN_MPLSPAYLOADLENGTH "ie0_c2" #define IPFIX_CN_IPDIFFSERVCODEPOINT "ie0_c3" #define IPFIX_CN_IPPRECEDENCE "ie0_c4" #define IPFIX_CN_FRAGMENTFLAGS "ie0_c5" #define IPFIX_CN_OCTETDELTASUMOFSQUARES "ie0_c6" #define IPFIX_CN_OCTETTOTALSUMOFSQUARES "ie0_c7" #define IPFIX_CN_MPLSTOPLABELTTL "ie0_c8" #define IPFIX_CN_MPLSLABELSTACKLENGTH "ie0_c9" #define IPFIX_CN_MPLSLABELSTACKDEPTH "ie0_ca" #define IPFIX_CN_MPLSTOPLABELEXP "ie0_cb" #define IPFIX_CN_IPPAYLOADLENGTH "ie0_cc" #define IPFIX_CN_UDPMESSAGELENGTH "ie0_cd" #define IPFIX_CN_ISMULTICAST "ie0_ce" #define IPFIX_CN_IPV4IHL "ie0_cf" #define IPFIX_CN_IPV4OPTIONS "ie0_d0" #define IPFIX_CN_TCPOPTIONS "ie0_d1" #define IPFIX_CN_PADDINGOCTETS "ie0_d2" #define IPFIX_CN_COLLECTORIPV4ADDRESS "ie0_d3" #define IPFIX_CN_COLLECTORIPV6ADDRESS "ie0_d4" #define IPFIX_CN_COLLECTORINTERFACE "ie0_d5" #define IPFIX_CN_COLLECTORPROTOCOLVERSION "ie0_d6" #define IPFIX_CN_COLLECTORTRANSPORTPROTOCOL "ie0_d7" #define IPFIX_CN_COLLECTORTRANSPORTPORT "ie0_d8" #define IPFIX_CN_EXPORTERTRANSPORTPORT "ie0_d9" #define IPFIX_CN_TCPSYNTOTALCOUNT "ie0_da" #define IPFIX_CN_TCPFINTOTALCOUNT "ie0_db" #define IPFIX_CN_TCPRSTTOTALCOUNT "ie0_dc" #define IPFIX_CN_TCPPSHTOTALCOUNT "ie0_dd" #define IPFIX_CN_TCPACKTOTALCOUNT "ie0_de" #define IPFIX_CN_TCPURGTOTALCOUNT "ie0_df" #define IPFIX_CN_IPTOTALLENGTH "ie0_e0" #define IPFIX_CN_POSTMPLSTOPLABELEXP "ie0_ed" #define IPFIX_CN_TCPWINDOWSCALE "ie0_ee" #define IPFIX_CN_OBSERVATIONPOINTID_PSAMP "ie0_12c" #define IPFIX_CN_SELECTIONSEQUENCEID "ie0_12d" #define IPFIX_CN_SELECTORID "ie0_12e" #define IPFIX_CN_INFORMATIONELEMENTID "ie0_12f" #define IPFIX_CN_SELECTORALGORITHM "ie0_130" #define IPFIX_CN_SAMPLINGPACKETINTERVAL "ie0_131" #define IPFIX_CN_SAMPLINGPACKETSPACE "ie0_132" #define IPFIX_CN_SAMPLINGTIMEINTERVAL "ie0_133" #define IPFIX_CN_SAMPLINGTIMESPACE "ie0_134" #define IPFIX_CN_SAMPLINGSIZE "ie0_135" #define IPFIX_CN_SAMPLINGPOPULATION "ie0_136" #define IPFIX_CN_SAMPLINGPROBABILITY "ie0_137" #define IPFIX_CN_DATALINKFRAMESIZE "ie0_138" #define IPFIX_CN_IPHEADERPACKETSECTION "ie0_139" #define IPFIX_CN_IPPAYLOADPACKETSECTION "ie0_13a" #define IPFIX_CN_DATALINKFRAMESECTION "ie0_13b" #define IPFIX_CN_MPLSLABELSTACKSECTION "ie0_13c" #define IPFIX_CN_MPLSPAYLOADPACKETSECTION "ie0_13d" #define IPFIX_CN_PACKETSOBSERVED "ie0_13e" #define IPFIX_CN_PACKETSSELECTED "ie0_13f" #define IPFIX_CN_FIXEDERROR "ie0_140" #define IPFIX_CN_RELATIVEERROR "ie0_141" #define IPFIX_CN_OBSERVATIONTIMESECONDS "ie0_142" #define IPFIX_CN_OBSERVATIONTIMEMILLISECONDS "ie0_143" #define IPFIX_CN_OBSERVATIONTIMEMICROSECONDS "ie0_144" #define IPFIX_CN_OBSERVATIONTIMENANOSECONDS "ie0_145" #define IPFIX_CN_DIGESTHASHVALUE "ie0_146" #define IPFIX_CN_HASHIPPAYLOADOFFSET "ie0_147" #define IPFIX_CN_HASHIPPAYLOADSIZE "ie0_148" #define IPFIX_CN_HASHOUTPUTRANGEMIN "ie0_149" #define IPFIX_CN_HASHOUTPUTRANGEMAX "ie0_14a" #define IPFIX_CN_HASHSELECTEDRANGEMIN "ie0_14b" #define IPFIX_CN_HASHSELECTEDRANGEMAX "ie0_14c" #define IPFIX_CN_HASHDIGESTOUTPUT "ie0_14d" #define IPFIX_CN_HASHINITIALISERVALUE "ie0_14e" #endif
50.265823
84
0.698187
1b465f21eb190ac94450d1edc4725b20fb8e6cd8
2,499
h
C
src/sconelib/scone/model/StateComponent.h
alexxlzhou/scone-core
4a071626e5ee7ba253e72a973d4d214fa6e30cf5
[ "Apache-2.0" ]
null
null
null
src/sconelib/scone/model/StateComponent.h
alexxlzhou/scone-core
4a071626e5ee7ba253e72a973d4d214fa6e30cf5
[ "Apache-2.0" ]
null
null
null
src/sconelib/scone/model/StateComponent.h
alexxlzhou/scone-core
4a071626e5ee7ba253e72a973d4d214fa6e30cf5
[ "Apache-2.0" ]
null
null
null
/* ** StateComponent.h ** ** Copyright (C) 2013-2019 Thomas Geijtenbeek and contributors. All rights reserved. ** ** This file is part of SCONE. For more information, see http://scone.software. */ #pragma once #include "scone/core/Exception.h" #include "scone/core/platform.h" #include "scone/core/types.h" #include "scone/core/HasName.h" #include "scone/optimization/Params.h" #include "scone/core/PropNode.h" #include <vector> namespace scone { /// The StateComponent is used to define components that contain /// differential equations. The user must define a function that /// returns the initial condition (GetInitialConditions) and the /// calculation of the state derivative (CalcStateDerivatives). In /// case of hybrid systems (discrete), then one must define the /// event polling (CheckForEvent and TriggeredOnSign) and event /// handle functions (EventHandler), while also notify that the /// component contains discrete events (HasDescreteEvent). class SCONE_API StateComponent : public HasName { public: StateComponent( const PropNode& props, Params& par, Model& model ) : INIT_MEMBER_REQUIRED( props, name ), m_model( model ) {}; /// Name of the state component (required). String name; virtual const String& GetName() const override { return name; } /// Interface /// Return the initial conditions of the differential equations. virtual std::vector< Real > GetInitialConditions() const { SCONE_THROW_NOT_IMPLEMENTED } /// Calculates the state derivative xdot = f(t, x). virtual std::vector< Real > CalcStateDerivatives( Real t, std::vector< Real > x0 ) const { SCONE_THROW_NOT_IMPLEMENTED } /// If this component models a hybrid system (discrete events) then one /// should make this function true. virtual bool HasDiscreteEvent() const { return false; } /// If +1, then triggered on rising sign transition. /// If -1, then triggered on falling sign transition. /// If 0, then triggered on both transitions. virtual int TriggeredOnSign() const { return 0; } /// Implements a zero crossing function that signifies an event. virtual Real CheckForEvent( Real t, std::vector< Real > x ) const { SCONE_THROW_NOT_IMPLEMENTED } /// A function that is called when an event is detected and returns a /// the new state. It is assumed that any event modifies only the state. virtual std::vector< Real > EventHandler( Real t, std::vector< Real > x ) const { SCONE_THROW_NOT_IMPLEMENTED } protected: Model& m_model; }; }
37.298507
90
0.731893
88f2e9bbd23a7c61bb741fa1234cbe630a434660
332
h
C
src/h/Toolkit/Geometry/Cube.h
MeepSplize/Uniquis-Framework
1ab8049fdbe1c9dfa2676ce6380940bfb0e1dff6
[ "BSD-3-Clause" ]
null
null
null
src/h/Toolkit/Geometry/Cube.h
MeepSplize/Uniquis-Framework
1ab8049fdbe1c9dfa2676ce6380940bfb0e1dff6
[ "BSD-3-Clause" ]
null
null
null
src/h/Toolkit/Geometry/Cube.h
MeepSplize/Uniquis-Framework
1ab8049fdbe1c9dfa2676ce6380940bfb0e1dff6
[ "BSD-3-Clause" ]
null
null
null
#pragma once #include "Toolkit\\Geometry\\IGeometry.h" #include "Toolkit\\Geometry\\Point.h" namespace Uniquis { class Cube : public IGeometry { // VARIABLES public: // CONSTRUCTORS public: Cube(); Cube(float size); // DECONSTRUCTORS public: ~Cube(); // FUNCTIONS public: // OPERATORS public: }; }
8.736842
41
0.644578
0014874d0b715b6c3cd5cbe5aa930a01c3e40d7f
1,660
h
C
src/ansi-c/ansi_c_language.h
alecs184/esbmc
ec70901e554b8fdcfaa82b85a7050fa042168ca7
[ "BSD-3-Clause" ]
1
2021-02-26T22:03:18.000Z
2021-02-26T22:03:18.000Z
src/ansi-c/ansi_c_language.h
alecs184/esbmc
ec70901e554b8fdcfaa82b85a7050fa042168ca7
[ "BSD-3-Clause" ]
null
null
null
src/ansi-c/ansi_c_language.h
alecs184/esbmc
ec70901e554b8fdcfaa82b85a7050fa042168ca7
[ "BSD-3-Clause" ]
1
2021-04-15T14:14:27.000Z
2021-04-15T14:14:27.000Z
/*******************************************************************\ Module: Author: Daniel Kroening, kroening@kroening.com \*******************************************************************/ #ifndef CPROVER_ANSI_C_LANGUAGE_H #define CPROVER_ANSI_C_LANGUAGE_H #include <ansi-c/ansi_c_parse_tree.h> #include <util/language.h> class ansi_c_languaget : public languaget { public: virtual bool preprocess( const std::string &path, std::ostream &outstream, message_handlert &message_handler); bool parse(const std::string &path, message_handlert &message_handler) override; bool typecheck( contextt &context, const std::string &module, message_handlert &message_handler) override; bool final(contextt &context, message_handlert &message_handler) override; virtual bool merge_context( contextt &dest, contextt &src, message_handlert &message_handler, const std::string &module) const; void show_parse(std::ostream &out) override; ~ansi_c_languaget() override = default; ansi_c_languaget() = default; // conversion from expression into string bool from_expr( const exprt &expr, std::string &code, const namespacet &ns, bool fullname = false) override; // conversion from type into string bool from_type( const typet &type, std::string &code, const namespacet &ns, bool fullname = false) override; languaget *new_language() override { return new ansi_c_languaget; } std::string id() const override { return "C"; } protected: ansi_c_parse_treet parse_tree; std::string parse_path; }; languaget *new_ansi_c_language(); #endif
21.842105
77
0.660241
185f6ace47878c8e804eaaf0c131771878839d57
1,500
h
C
FindSecret/Classes/Native/UnityEngine_UnityEngine_InternalStaticBatchingUtil3638029110.h
GodIsWord/NewFindSecret
4f98f316d29936380f9665d6a6d89962d9ee5478
[ "MIT" ]
null
null
null
FindSecret/Classes/Native/UnityEngine_UnityEngine_InternalStaticBatchingUtil3638029110.h
GodIsWord/NewFindSecret
4f98f316d29936380f9665d6a6d89962d9ee5478
[ "MIT" ]
null
null
null
FindSecret/Classes/Native/UnityEngine_UnityEngine_InternalStaticBatchingUtil3638029110.h
GodIsWord/NewFindSecret
4f98f316d29936380f9665d6a6d89962d9ee5478
[ "MIT" ]
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_Object3080106164.h" // System.String struct String_t; // System.Func`2<UnityEngine.Material,System.Boolean> struct Func_2_t1477212788; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.InternalStaticBatchingUtility struct InternalStaticBatchingUtility_t3638029110 : public Il2CppObject { public: public: }; struct InternalStaticBatchingUtility_t3638029110_StaticFields { public: // System.Func`2<UnityEngine.Material,System.Boolean> UnityEngine.InternalStaticBatchingUtility::<>f__am$cache0 Func_2_t1477212788 * ___U3CU3Ef__amU24cache0_2; public: inline static int32_t get_offset_of_U3CU3Ef__amU24cache0_2() { return static_cast<int32_t>(offsetof(InternalStaticBatchingUtility_t3638029110_StaticFields, ___U3CU3Ef__amU24cache0_2)); } inline Func_2_t1477212788 * get_U3CU3Ef__amU24cache0_2() const { return ___U3CU3Ef__amU24cache0_2; } inline Func_2_t1477212788 ** get_address_of_U3CU3Ef__amU24cache0_2() { return &___U3CU3Ef__amU24cache0_2; } inline void set_U3CU3Ef__amU24cache0_2(Func_2_t1477212788 * value) { ___U3CU3Ef__amU24cache0_2 = value; Il2CppCodeGenWriteBarrier(&___U3CU3Ef__amU24cache0_2, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
26.315789
187
0.810667
8d5b09ef8696e10a6dae4882512e21c0b6731ff4
5,160
h
C
include/Fission/Platform/EntryPoint.h
lazergenixdev/Fission
da4151c37d81c19a77fe3d78d181da6c16ba4ddd
[ "MIT" ]
1
2021-02-28T10:58:11.000Z
2021-02-28T10:58:11.000Z
include/Fission/Platform/EntryPoint.h
lazergenixdev/Fission
da4151c37d81c19a77fe3d78d181da6c16ba4ddd
[ "MIT" ]
1
2021-07-06T17:34:48.000Z
2021-09-16T20:41:57.000Z
include/Fission/Platform/EntryPoint.h
lazergenixdev/Fission
da4151c37d81c19a77fe3d78d181da6c16ba4ddd
[ "MIT" ]
null
null
null
/** * * USAGE: * include header where you create your application, * this file contains the main function. * * * @file: EntryPoint.h * @author: lazergenixdev@gmail.com * * * This file is provided under the MIT License: * * Copyright (c) 2021 Lazergenix Software * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ #pragma once #include <Fission/Base/Exception.h> #include <Fission/Base/Utility/SmartPointer.h> #include <Fission/Core/Engine.hh> #include <Fission/Core/Application.hh> #include <Fission/Platform/System.h> #define FISSION_EXIT_SUCCESS 0 /* Success */ #define FISSION_EXIT_FAILURE 1 /* Failure */ #define FISSION_EXIT_UNKNOWN 2 /* Failure */ /* ================================================================================================== */ /* -------------------------------------- Function Definitions -------------------------------------- */ /* ================================================================================================== */ //! @brief Creates User Application. //! @return Pointer to a Fission::FApplication. extern Fission::FApplication * CreateApplication( void ); //! @brief Runs main application loop. //! @return ExitCode from the status of how the application exited. FISSION_MAIN_EXPORT(Fission::Platform::ExitCode) _fission_main( void * ); /* =================================================================================================== */ /* -------------------------------------- Platform Entry Points -------------------------------------- */ /* =================================================================================================== */ #if defined(FISSION_PLATFORM_WINDOWS) int WINAPI wWinMain( _In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int ) { // Instance data is not needed on Windows, as there are // WinAPI functions to get all the information needed; so // there is no reason to pass anything to our main function. return _fission_main(nullptr); } #elif defined(FISSION_PLATFORM_LINUX) #elif defined(FISSION_PLATFORM_ANDROID) /** * I've been looking into Android development, and the only way to * get a C++ program up and running is to compile into a shared library (.so) * and call our C++ functions from a Java Android Activity. * * So there is no need for a platform main function, our `_fission_main` * will work just fine. */ #endif /* =================================================================================================== */ /* ------------------------------------ fission main definition -------------------------------------- */ /* =================================================================================================== */ FISSION_MAIN_EXPORT(Fission::Platform::ExitCode) _fission_main( void * instance ) { using namespace Fission; using namespace string_literals; Platform::ExitCode nExitCode = FISSION_EXIT_UNKNOWN; FPointer<IFEngine> fsnEngine; FPointer<FApplication> app; try { Fission::CreateEngine( instance, &fsnEngine ); app = CreateApplication(); fsnEngine->LoadApplication( app.get() ); try { fsnEngine->Run( &nExitCode ); } catch( base::runtime_error & e ) { System::ShowSimpleMessageBox( string( e.name() ) + " caught"_utf8, e.what(), System::Error, app->pMainWindow ); nExitCode = FISSION_EXIT_FAILURE; } catch( std::exception & e ) { System::ShowSimpleMessageBox( "C++ exception caught"_utf8, e.what(), System::Error, app->pMainWindow ); nExitCode = FISSION_EXIT_FAILURE; } catch( ... ) { System::ShowSimpleMessageBox( "Unknown Error"_utf8, "No information provided, lol"_utf8, System::Error, app->pMainWindow ); } } catch( base::runtime_error & e ) { System::ShowSimpleMessageBox( string( e.name() ) + " caught"_utf8, e.what(), System::Error ); nExitCode = FISSION_EXIT_FAILURE; } catch( std::exception & e ) { System::ShowSimpleMessageBox( "C++ exception caught"_utf8, e.what(), System::Error ); nExitCode = FISSION_EXIT_FAILURE; } catch( ... ) { System::ShowSimpleMessageBox( "Unknown Error"_utf8, "No information provided, lol"_utf8, System::Error ); } return nExitCode; }
34.172185
126
0.608915
ae5bf2be6f52b158597aadd6b57245b746824f43
57,964
c
C
dir600b_v2.03/kernels/rt305x/drivers/ide/ide.c
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
1
2019-07-21T01:58:19.000Z
2019-07-21T01:58:19.000Z
dir600b_v2.03/kernels/rt305x/drivers/ide/ide.c
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
null
null
null
dir600b_v2.03/kernels/rt305x/drivers/ide/ide.c
ghsecuritylab/DIR600B2
78510ce13e037c430c84b4cdc7f49939481fe894
[ "BSD-2-Clause" ]
2
2020-03-06T22:45:39.000Z
2021-12-23T13:58:14.000Z
/* * linux/drivers/ide/ide.c Version 7.00beta2 Mar 05 2003 * * Copyright (C) 1994-1998 Linus Torvalds & authors (see below) */ /* * Mostly written by Mark Lord <mlord@pobox.com> * and Gadi Oxman <gadio@netvision.net.il> * and Andre Hedrick <andre@linux-ide.org> * * See linux/MAINTAINERS for address of current maintainer. * * This is the multiple IDE interface driver, as evolved from hd.c. * It supports up to MAX_HWIFS IDE interfaces, on one or more IRQs * (usually 14 & 15). * There can be up to two drives per interface, as per the ATA-2 spec. * * Primary: ide0, port 0x1f0; major=3; hda is minor=0; hdb is minor=64 * Secondary: ide1, port 0x170; major=22; hdc is minor=0; hdd is minor=64 * Tertiary: ide2, port 0x???; major=33; hde is minor=0; hdf is minor=64 * Quaternary: ide3, port 0x???; major=34; hdg is minor=0; hdh is minor=64 * ... * * From hd.c: * | * | It traverses the request-list, using interrupts to jump between functions. * | As nearly all functions can be called within interrupts, we may not sleep. * | Special care is recommended. Have Fun! * | * | modified by Drew Eckhardt to check nr of hd's from the CMOS. * | * | Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug * | in the early extended-partition checks and added DM partitions. * | * | Early work on error handling by Mika Liljeberg (liljeber@cs.Helsinki.FI). * | * | IRQ-unmask, drive-id, multiple-mode, support for ">16 heads", * | and general streamlining by Mark Lord (mlord@pobox.com). * * October, 1994 -- Complete line-by-line overhaul for linux 1.1.x, by: * * Mark Lord (mlord@pobox.com) (IDE Perf.Pkg) * Delman Lee (delman@ieee.org) ("Mr. atdisk2") * Scott Snyder (snyder@fnald0.fnal.gov) (ATAPI IDE cd-rom) * * This was a rewrite of just about everything from hd.c, though some original * code is still sprinkled about. Think of it as a major evolution, with * inspiration from lots of linux users, esp. hamish@zot.apana.org.au * * Version 1.0 ALPHA initial code, primary i/f working okay * Version 1.3 BETA dual i/f on shared irq tested & working! * Version 1.4 BETA added auto probing for irq(s) * Version 1.5 BETA added ALPHA (untested) support for IDE cd-roms, * ... * Version 5.50 allow values as small as 20 for idebus= * Version 5.51 force non io_32bit in drive_cmd_intr() * change delay_10ms() to delay_50ms() to fix problems * Version 5.52 fix incorrect invalidation of removable devices * add "hdx=slow" command line option * Version 5.60 start to modularize the driver; the disk and ATAPI * drivers can be compiled as loadable modules. * move IDE probe code to ide-probe.c * move IDE disk code to ide-disk.c * add support for generic IDE device subdrivers * add m68k code from Geert Uytterhoeven * probe all interfaces by default * add ioctl to (re)probe an interface * Version 6.00 use per device request queues * attempt to optimize shared hwgroup performance * add ioctl to manually adjust bandwidth algorithms * add kerneld support for the probe module * fix bug in ide_error() * fix bug in the first ide_get_lock() call for Atari * don't flush leftover data for ATAPI devices * Version 6.01 clear hwgroup->active while the hwgroup sleeps * support HDIO_GETGEO for floppies * Version 6.02 fix ide_ack_intr() call * check partition table on floppies * Version 6.03 handle bad status bit sequencing in ide_wait_stat() * Version 6.10 deleted old entries from this list of updates * replaced triton.c with ide-dma.c generic PCI DMA * added support for BIOS-enabled UltraDMA * rename all "promise" things to "pdc4030" * fix EZ-DRIVE handling on small disks * Version 6.11 fix probe error in ide_scan_devices() * fix ancient "jiffies" polling bugs * mask all hwgroup interrupts on each irq entry * Version 6.12 integrate ioctl and proc interfaces * fix parsing of "idex=" command line parameter * Version 6.13 add support for ide4/ide5 courtesy rjones@orchestream.com * Version 6.14 fixed IRQ sharing among PCI devices * Version 6.15 added SMP awareness to IDE drivers * Version 6.16 fixed various bugs; even more SMP friendly * Version 6.17 fix for newest EZ-Drive problem * Version 6.18 default unpartitioned-disk translation now "BIOS LBA" * Version 6.19 Re-design for a UNIFORM driver for all platforms, * model based on suggestions from Russell King and * Geert Uytterhoeven * Promise DC4030VL now supported. * add support for ide6/ide7 * delay_50ms() changed to ide_delay_50ms() and exported. * Version 6.20 Added/Fixed Generic ATA-66 support and hwif detection. * Added hdx=flash to allow for second flash disk * detection w/o the hang loop. * Added support for ide8/ide9 * Added idex=ata66 for the quirky chipsets that are * ATA-66 compliant, but have yet to determine a method * of verification of the 80c cable presence. * Specifically Promise's PDC20262 chipset. * Version 6.21 Fixing/Fixed SMP spinlock issue with insight from an old * hat that clarified original low level driver design. * Version 6.30 Added SMP support; fixed multmode issues. -ml * Version 6.31 Debug Share INTR's and request queue streaming * Native ATA-100 support * Prep for Cascades Project * Version 7.00alpha First named revision of ide rearrange * * Some additional driver compile-time options are in ./include/linux/ide.h * * To do, in likely order of completion: * - modify kernel to obtain BIOS geometry for drives on 2nd/3rd/4th i/f * */ #define REVISION "Revision: 7.00alpha2" #define VERSION "Id: ide.c 7.00a2 20020906" #define _IDE_C /* Tell ide.h it's really us */ #include <linux/module.h> #include <linux/types.h> #include <linux/string.h> #include <linux/kernel.h> #include <linux/timer.h> #include <linux/mm.h> #include <linux/interrupt.h> #include <linux/major.h> #include <linux/errno.h> #include <linux/genhd.h> #include <linux/blkpg.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/delay.h> #include <linux/ide.h> #include <linux/completion.h> #include <linux/reboot.h> #include <linux/cdrom.h> #include <linux/seq_file.h> #include <linux/device.h> #include <linux/bitops.h> #include <asm/byteorder.h> #include <asm/irq.h> #include <asm/uaccess.h> #include <asm/io.h> /* default maximum number of failures */ #define IDE_DEFAULT_MAX_FAILURES 1 static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR, IDE2_MAJOR, IDE3_MAJOR, IDE4_MAJOR, IDE5_MAJOR, IDE6_MAJOR, IDE7_MAJOR, IDE8_MAJOR, IDE9_MAJOR }; static int idebus_parameter; /* holds the "idebus=" parameter */ static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ static int initializing; /* set while initializing built-in drivers */ DECLARE_MUTEX(ide_cfg_sem); __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock); #ifdef CONFIG_BLK_DEV_IDEPCI static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ #endif int noautodma = 0; EXPORT_SYMBOL(noautodma); #ifdef CONFIG_BLK_DEV_IDEACPI int ide_noacpi = 0; int ide_noacpitfs = 1; int ide_noacpionboot = 1; #endif /* * This is declared extern in ide.h, for access by other IDE modules: */ ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */ EXPORT_SYMBOL(ide_hwifs); /* * Do not even *think* about calling this! */ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index) { unsigned int unit; /* bulk initialize hwif & drive info with zeros */ memset(hwif, 0, sizeof(ide_hwif_t)); /* fill in any non-zero initial values */ hwif->index = index; hwif->major = ide_hwif_to_major[index]; hwif->name[0] = 'i'; hwif->name[1] = 'd'; hwif->name[2] = 'e'; hwif->name[3] = '0' + index; hwif->bus_state = BUSSTATE_ON; hwif->atapi_dma = 0; /* disable all atapi dma */ hwif->ultra_mask = 0x80; /* disable all ultra */ hwif->mwdma_mask = 0x80; /* disable all mwdma */ hwif->swdma_mask = 0x80; /* disable all swdma */ init_completion(&hwif->gendev_rel_comp); default_hwif_iops(hwif); default_hwif_transport(hwif); for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; drive->media = ide_disk; drive->select.all = (unit<<4)|0xa0; drive->hwif = hwif; drive->ctl = 0x08; drive->ready_stat = READY_STAT; drive->bad_wstat = BAD_W_STAT; drive->special.b.recalibrate = 1; drive->special.b.set_geometry = 1; drive->name[0] = 'h'; drive->name[1] = 'd'; drive->name[2] = 'a' + (index * MAX_DRIVES) + unit; drive->max_failures = IDE_DEFAULT_MAX_FAILURES; drive->using_dma = 0; drive->vdma = 0; INIT_LIST_HEAD(&drive->list); init_completion(&drive->gendev_rel_comp); } } static void init_hwif_default(ide_hwif_t *hwif, unsigned int index) { hw_regs_t hw; memset(&hw, 0, sizeof(hw_regs_t)); ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq); memcpy(&hwif->hw, &hw, sizeof(hw)); memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; #ifdef CONFIG_BLK_DEV_HD if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) hwif->noprobe = 1; /* may be overridden by ide_setup() */ #endif } extern void ide_arm_init(void); /* * init_ide_data() sets reasonable default values into all fields * of all instances of the hwifs and drives, but only on the first call. * Subsequent calls have no effect (they don't wipe out anything). * * This routine is normally called at driver initialization time, * but may also be called MUCH earlier during kernel "command-line" * parameter processing. As such, we cannot depend on any other parts * of the kernel (such as memory allocation) to be functioning yet. * * This is too bad, as otherwise we could dynamically allocate the * ide_drive_t structs as needed, rather than always consuming memory * for the max possible number (MAX_HWIFS * MAX_DRIVES) of them. * * FIXME: We should stuff the setup data into __init and copy the * relevant hwifs/allocate them properly during boot. */ #define MAGIC_COOKIE 0x12345678 static void __init init_ide_data (void) { ide_hwif_t *hwif; unsigned int index; static unsigned long magic_cookie = MAGIC_COOKIE; if (magic_cookie != MAGIC_COOKIE) return; /* already initialized */ magic_cookie = 0; /* Initialise all interface structures */ for (index = 0; index < MAX_HWIFS; ++index) { hwif = &ide_hwifs[index]; init_hwif_data(hwif, index); init_hwif_default(hwif, index); #if !defined(CONFIG_PPC32) || !defined(CONFIG_PCI) hwif->irq = hwif->hw.irq = ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]); #endif } #ifdef CONFIG_IDE_ARM initializing = 1; ide_arm_init(); initializing = 0; #endif } /** * ide_system_bus_speed - guess bus speed * * ide_system_bus_speed() returns what we think is the system VESA/PCI * bus speed (in MHz). This is used for calculating interface PIO timings. * The default is 40 for known PCI systems, 50 otherwise. * The "idebus=xx" parameter can be used to override this value. * The actual value to be used is computed/displayed the first time * through. Drivers should only use this as a last resort. * * Returns a guessed speed in MHz. */ static int ide_system_bus_speed(void) { #ifdef CONFIG_PCI static struct pci_device_id pci_default[] = { { PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) }, { } }; #else #define pci_default 0 #endif /* CONFIG_PCI */ if (!system_bus_speed) { if (idebus_parameter) { /* user supplied value */ system_bus_speed = idebus_parameter; } else if (pci_dev_present(pci_default)) { /* safe default value for PCI */ system_bus_speed = 33; } else { /* safe default value for VESA and PCI */ system_bus_speed = 50; } printk(KERN_INFO "ide: Assuming %dMHz system bus speed " "for PIO modes%s\n", system_bus_speed, idebus_parameter ? "" : "; override with idebus=xx"); } return system_bus_speed; } #ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_ide_root; #endif static struct resource* hwif_request_region(ide_hwif_t *hwif, unsigned long addr, int num) { struct resource *res = request_region(addr, num, hwif->name); if (!res) printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", hwif->name, addr, addr+num-1); return res; } /** * ide_hwif_request_regions - request resources for IDE * @hwif: interface to use * * Requests all the needed resources for an interface. * Right now core IDE code does this work which is deeply wrong. * MMIO leaves it to the controller driver, * PIO will migrate this way over time. */ int ide_hwif_request_regions(ide_hwif_t *hwif) { unsigned long addr; unsigned int i; if (hwif->mmio) return 0; addr = hwif->io_ports[IDE_CONTROL_OFFSET]; if (addr && !hwif_request_region(hwif, addr, 1)) goto control_region_busy; hwif->straight8 = 0; addr = hwif->io_ports[IDE_DATA_OFFSET]; if ((addr | 7) == hwif->io_ports[IDE_STATUS_OFFSET]) { if (!hwif_request_region(hwif, addr, 8)) goto data_region_busy; hwif->straight8 = 1; return 0; } for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { addr = hwif->io_ports[i]; if (!hwif_request_region(hwif, addr, 1)) { while (--i) release_region(addr, 1); goto data_region_busy; } } return 0; data_region_busy: addr = hwif->io_ports[IDE_CONTROL_OFFSET]; if (addr) release_region(addr, 1); control_region_busy: /* If any errors are return, we drop the hwif interface. */ return -EBUSY; } /** * ide_hwif_release_regions - free IDE resources * * Note that we only release the standard ports, * and do not even try to handle any extra ports * allocated for weird IDE interface chipsets. * * Note also that we don't yet handle mmio resources here. More * importantly our caller should be doing this so we need to * restructure this as a helper function for drivers. */ void ide_hwif_release_regions(ide_hwif_t *hwif) { u32 i = 0; if (hwif->mmio) return; if (hwif->io_ports[IDE_CONTROL_OFFSET]) release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); if (hwif->straight8) { release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); return; } for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) if (hwif->io_ports[i]) release_region(hwif->io_ports[i], 1); } /** * ide_hwif_restore - restore hwif to template * @hwif: hwif to update * @tmp_hwif: template * * Restore hwif to a previous state by copying most settings * from the template. */ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) { hwif->hwgroup = tmp_hwif->hwgroup; hwif->gendev.parent = tmp_hwif->gendev.parent; hwif->proc = tmp_hwif->proc; hwif->major = tmp_hwif->major; hwif->straight8 = tmp_hwif->straight8; hwif->bus_state = tmp_hwif->bus_state; hwif->atapi_dma = tmp_hwif->atapi_dma; hwif->ultra_mask = tmp_hwif->ultra_mask; hwif->mwdma_mask = tmp_hwif->mwdma_mask; hwif->swdma_mask = tmp_hwif->swdma_mask; hwif->chipset = tmp_hwif->chipset; hwif->hold = tmp_hwif->hold; #ifdef CONFIG_BLK_DEV_IDEPCI hwif->pci_dev = tmp_hwif->pci_dev; hwif->cds = tmp_hwif->cds; #endif hwif->tuneproc = tmp_hwif->tuneproc; hwif->speedproc = tmp_hwif->speedproc; hwif->selectproc = tmp_hwif->selectproc; hwif->reset_poll = tmp_hwif->reset_poll; hwif->pre_reset = tmp_hwif->pre_reset; hwif->resetproc = tmp_hwif->resetproc; hwif->intrproc = tmp_hwif->intrproc; hwif->maskproc = tmp_hwif->maskproc; hwif->quirkproc = tmp_hwif->quirkproc; hwif->busproc = tmp_hwif->busproc; hwif->ata_input_data = tmp_hwif->ata_input_data; hwif->ata_output_data = tmp_hwif->ata_output_data; hwif->atapi_input_bytes = tmp_hwif->atapi_input_bytes; hwif->atapi_output_bytes = tmp_hwif->atapi_output_bytes; hwif->dma_setup = tmp_hwif->dma_setup; hwif->dma_exec_cmd = tmp_hwif->dma_exec_cmd; hwif->dma_start = tmp_hwif->dma_start; hwif->ide_dma_end = tmp_hwif->ide_dma_end; hwif->ide_dma_check = tmp_hwif->ide_dma_check; hwif->ide_dma_on = tmp_hwif->ide_dma_on; hwif->dma_off_quietly = tmp_hwif->dma_off_quietly; hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq; hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq; hwif->dma_host_on = tmp_hwif->dma_host_on; hwif->dma_host_off = tmp_hwif->dma_host_off; hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq; hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout; hwif->OUTB = tmp_hwif->OUTB; hwif->OUTBSYNC = tmp_hwif->OUTBSYNC; hwif->OUTW = tmp_hwif->OUTW; hwif->OUTSW = tmp_hwif->OUTSW; hwif->OUTSL = tmp_hwif->OUTSL; hwif->INB = tmp_hwif->INB; hwif->INW = tmp_hwif->INW; hwif->INSW = tmp_hwif->INSW; hwif->INSL = tmp_hwif->INSL; hwif->sg_max_nents = tmp_hwif->sg_max_nents; hwif->mmio = tmp_hwif->mmio; hwif->rqsize = tmp_hwif->rqsize; hwif->no_lba48 = tmp_hwif->no_lba48; #ifndef CONFIG_BLK_DEV_IDECS hwif->irq = tmp_hwif->irq; #endif hwif->dma_base = tmp_hwif->dma_base; hwif->dma_master = tmp_hwif->dma_master; hwif->dma_command = tmp_hwif->dma_command; hwif->dma_vendor1 = tmp_hwif->dma_vendor1; hwif->dma_status = tmp_hwif->dma_status; hwif->dma_vendor3 = tmp_hwif->dma_vendor3; hwif->dma_prdtable = tmp_hwif->dma_prdtable; hwif->config_data = tmp_hwif->config_data; hwif->select_data = tmp_hwif->select_data; hwif->extra_base = tmp_hwif->extra_base; hwif->extra_ports = tmp_hwif->extra_ports; hwif->autodma = tmp_hwif->autodma; hwif->udma_four = tmp_hwif->udma_four; hwif->hwif_data = tmp_hwif->hwif_data; } /** * ide_unregister - free an IDE interface * @index: index of interface (will change soon to a pointer) * * Perform the final unregister of an IDE interface. At the moment * we don't refcount interfaces so this will also get split up. * * Locking: * The caller must not hold the IDE locks * The drive present/vanishing is not yet properly locked * Take care with the callbacks. These have been split to avoid * deadlocking the IDE layer. The shutdown callback is called * before we take the lock and free resources. It is up to the * caller to be sure there is no pending I/O here, and that * the interface will not be reopened (present/vanishing locking * isn't yet done BTW). After we commit to the final kill we * call the cleanup callback with the ide locks held. * * Unregister restores the hwif structures to the default state. * This is raving bonkers. */ void ide_unregister(unsigned int index) { ide_drive_t *drive; ide_hwif_t *hwif, *g; static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */ ide_hwgroup_t *hwgroup; int irq_count = 0, unit; BUG_ON(index >= MAX_HWIFS); BUG_ON(in_interrupt()); BUG_ON(irqs_disabled()); down(&ide_cfg_sem); spin_lock_irq(&ide_lock); hwif = &ide_hwifs[index]; if (!hwif->present) goto abort; for (unit = 0; unit < MAX_DRIVES; ++unit) { drive = &hwif->drives[unit]; if (!drive->present) continue; spin_unlock_irq(&ide_lock); device_unregister(&drive->gendev); wait_for_completion(&drive->gendev_rel_comp); spin_lock_irq(&ide_lock); } hwif->present = 0; spin_unlock_irq(&ide_lock); destroy_proc_ide_interface(hwif); hwgroup = hwif->hwgroup; /* * free the irq if we were the only hwif using it */ g = hwgroup->hwif; do { if (g->irq == hwif->irq) ++irq_count; g = g->next; } while (g != hwgroup->hwif); if (irq_count == 1) free_irq(hwif->irq, hwgroup); spin_lock_irq(&ide_lock); /* * Note that we only release the standard ports, * and do not even try to handle any extra ports * allocated for weird IDE interface chipsets. */ ide_hwif_release_regions(hwif); /* * Remove us from the hwgroup, and free * the hwgroup if we were the only member */ if (hwif->next == hwif) { BUG_ON(hwgroup->hwif != hwif); kfree(hwgroup); } else { /* There is another interface in hwgroup. * Unlink us, and set hwgroup->drive and ->hwif to * something sane. */ g = hwgroup->hwif; while (g->next != hwif) g = g->next; g->next = hwif->next; if (hwgroup->hwif == hwif) { /* Chose a random hwif for hwgroup->hwif. * It's guaranteed that there are no drives * left in the hwgroup. */ BUG_ON(hwgroup->drive != NULL); hwgroup->hwif = g; } BUG_ON(hwgroup->hwif == hwif); } /* More messed up locking ... */ spin_unlock_irq(&ide_lock); device_unregister(&hwif->gendev); wait_for_completion(&hwif->gendev_rel_comp); /* * Remove us from the kernel's knowledge */ blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS); kfree(hwif->sg_table); unregister_blkdev(hwif->major, hwif->name); spin_lock_irq(&ide_lock); if (hwif->dma_base) { (void) ide_release_dma(hwif); hwif->dma_base = 0; hwif->dma_master = 0; hwif->dma_command = 0; hwif->dma_vendor1 = 0; hwif->dma_status = 0; hwif->dma_vendor3 = 0; hwif->dma_prdtable = 0; hwif->extra_base = 0; hwif->extra_ports = 0; } /* copy original settings */ tmp_hwif = *hwif; /* restore hwif data to pristine status */ init_hwif_data(hwif, index); init_hwif_default(hwif, index); ide_hwif_restore(hwif, &tmp_hwif); abort: spin_unlock_irq(&ide_lock); up(&ide_cfg_sem); } EXPORT_SYMBOL(ide_unregister); /** * ide_setup_ports - set up IDE interface ports * @hw: register descriptions * @base: base register * @offsets: table of register offsets * @ctrl: control register * @ack_irq: IRQ ack * @irq: interrupt lie * * Setup hw_regs_t structure described by parameters. You * may set up the hw structure yourself OR use this routine to * do it for you. This is basically a helper * */ void ide_setup_ports ( hw_regs_t *hw, unsigned long base, int *offsets, unsigned long ctrl, unsigned long intr, ide_ack_intr_t *ack_intr, /* * ide_io_ops_t *iops, */ int irq) { int i; memset(hw, 0, sizeof(hw_regs_t)); for (i = 0; i < IDE_NR_PORTS; i++) { if (offsets[i] == -1) { switch(i) { case IDE_CONTROL_OFFSET: hw->io_ports[i] = ctrl; break; #if defined(CONFIG_AMIGA) || defined(CONFIG_MAC) case IDE_IRQ_OFFSET: hw->io_ports[i] = intr; break; #endif /* (CONFIG_AMIGA) || (CONFIG_MAC) */ default: hw->io_ports[i] = 0; break; } } else { hw->io_ports[i] = base + offsets[i]; } } hw->irq = irq; hw->dma = NO_DMA; hw->ack_intr = ack_intr; /* * hw->iops = iops; */ } /** * ide_register_hw_with_fixup - register IDE interface * @hw: hardware registers * @hwifp: pointer to returned hwif * @fixup: fixup function * * Register an IDE interface, specifying exactly the registers etc. * Set init=1 iff calling before probes have taken place. * * Returns -1 on error. */ int ide_register_hw_with_fixup(hw_regs_t *hw, ide_hwif_t **hwifp, void(*fixup)(ide_hwif_t *hwif)) { int index, retry = 1; ide_hwif_t *hwif; do { for (index = 0; index < MAX_HWIFS; ++index) { hwif = &ide_hwifs[index]; if (hwif->hw.io_ports[IDE_DATA_OFFSET] == hw->io_ports[IDE_DATA_OFFSET]) goto found; } for (index = 0; index < MAX_HWIFS; ++index) { hwif = &ide_hwifs[index]; if (hwif->hold) continue; if ((!hwif->present && !hwif->mate && !initializing) || (!hwif->hw.io_ports[IDE_DATA_OFFSET] && initializing)) goto found; } for (index = 0; index < MAX_HWIFS; index++) ide_unregister(index); } while (retry--); return -1; found: if (hwif->present) ide_unregister(index); else if (!hwif->hold) { init_hwif_data(hwif, index); init_hwif_default(hwif, index); } if (hwif->present) return -1; memcpy(&hwif->hw, hw, sizeof(*hw)); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); hwif->irq = hw->irq; hwif->noprobe = 0; hwif->chipset = hw->chipset; hwif->gendev.parent = hw->dev; if (!initializing) { probe_hwif_init_with_fixup(hwif, fixup); create_proc_ide_interfaces(); } if (hwifp) *hwifp = hwif; return (initializing || hwif->present) ? index : -1; } EXPORT_SYMBOL(ide_register_hw_with_fixup); int ide_register_hw(hw_regs_t *hw, ide_hwif_t **hwifp) { return ide_register_hw_with_fixup(hw, hwifp, NULL); } EXPORT_SYMBOL(ide_register_hw); /* * Locks for IDE setting functionality */ DECLARE_MUTEX(ide_setting_sem); /** * __ide_add_setting - add an ide setting option * @drive: drive to use * @name: setting name * @rw: true if the function is read write * @read_ioctl: function to call on read * @write_ioctl: function to call on write * @data_type: type of data * @min: range minimum * @max: range maximum * @mul_factor: multiplication scale * @div_factor: divison scale * @data: private data field * @set: setting * @auto_remove: setting auto removal flag * * Removes the setting named from the device if it is present. * The function takes the settings_lock to protect against * parallel changes. This function must not be called from IRQ * context. Returns 0 on success or -1 on failure. * * BUGS: This code is seriously over-engineered. There is also * magic about how the driver specific features are setup. If * a driver is attached we assume the driver settings are auto * remove. */ static int __ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set, int auto_remove) { ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting = NULL; down(&ide_setting_sem); while ((*p) && strcmp((*p)->name, name) < 0) p = &((*p)->next); if ((setting = kzalloc(sizeof(*setting), GFP_KERNEL)) == NULL) goto abort; if ((setting->name = kmalloc(strlen(name) + 1, GFP_KERNEL)) == NULL) goto abort; strcpy(setting->name, name); setting->rw = rw; setting->read_ioctl = read_ioctl; setting->write_ioctl = write_ioctl; setting->data_type = data_type; setting->min = min; setting->max = max; setting->mul_factor = mul_factor; setting->div_factor = div_factor; setting->data = data; setting->set = set; setting->next = *p; if (auto_remove) setting->auto_remove = 1; *p = setting; up(&ide_setting_sem); return 0; abort: up(&ide_setting_sem); kfree(setting); return -1; } int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set) { return __ide_add_setting(drive, name, rw, read_ioctl, write_ioctl, data_type, min, max, mul_factor, div_factor, data, set, 1); } EXPORT_SYMBOL(ide_add_setting); /** * __ide_remove_setting - remove an ide setting option * @drive: drive to use * @name: setting name * * Removes the setting named from the device if it is present. * The caller must hold the setting semaphore. */ static void __ide_remove_setting (ide_drive_t *drive, char *name) { ide_settings_t **p, *setting; p = (ide_settings_t **) &drive->settings; while ((*p) && strcmp((*p)->name, name)) p = &((*p)->next); if ((setting = (*p)) == NULL) return; (*p) = setting->next; kfree(setting->name); kfree(setting); } /** * ide_find_setting_by_ioctl - find a drive specific ioctl * @drive: drive to scan * @cmd: ioctl command to handle * * Scan's the device setting table for a matching entry and returns * this or NULL if no entry is found. The caller must hold the * setting semaphore */ static ide_settings_t *ide_find_setting_by_ioctl (ide_drive_t *drive, int cmd) { ide_settings_t *setting = drive->settings; while (setting) { if (setting->read_ioctl == cmd || setting->write_ioctl == cmd) break; setting = setting->next; } return setting; } /** * ide_find_setting_by_name - find a drive specific setting * @drive: drive to scan * @name: setting name * * Scan's the device setting table for a matching entry and returns * this or NULL if no entry is found. The caller must hold the * setting semaphore */ ide_settings_t *ide_find_setting_by_name (ide_drive_t *drive, char *name) { ide_settings_t *setting = drive->settings; while (setting) { if (strcmp(setting->name, name) == 0) break; setting = setting->next; } return setting; } /** * auto_remove_settings - remove driver specific settings * @drive: drive * * Automatically remove all the driver specific settings for this * drive. This function may not be called from IRQ context. The * caller must hold ide_setting_sem. */ static void auto_remove_settings (ide_drive_t *drive) { ide_settings_t *setting; repeat: setting = drive->settings; while (setting) { if (setting->auto_remove) { __ide_remove_setting(drive, setting->name); goto repeat; } setting = setting->next; } } /** * ide_read_setting - read an IDE setting * @drive: drive to read from * @setting: drive setting * * Read a drive setting and return the value. The caller * must hold the ide_setting_sem when making this call. * * BUGS: the data return and error are the same return value * so an error -EINVAL and true return of the same value cannot * be told apart */ int ide_read_setting (ide_drive_t *drive, ide_settings_t *setting) { int val = -EINVAL; unsigned long flags; if ((setting->rw & SETTING_READ)) { spin_lock_irqsave(&ide_lock, flags); switch(setting->data_type) { case TYPE_BYTE: val = *((u8 *) setting->data); break; case TYPE_SHORT: val = *((u16 *) setting->data); break; case TYPE_INT: case TYPE_INTA: val = *((u32 *) setting->data); break; } spin_unlock_irqrestore(&ide_lock, flags); } return val; } /** * ide_spin_wait_hwgroup - wait for group * @drive: drive in the group * * Wait for an IDE device group to go non busy and then return * holding the ide_lock which guards the hwgroup->busy status * and right to use it. */ int ide_spin_wait_hwgroup (ide_drive_t *drive) { ide_hwgroup_t *hwgroup = HWGROUP(drive); unsigned long timeout = jiffies + (3 * HZ); spin_lock_irq(&ide_lock); while (hwgroup->busy) { unsigned long lflags; spin_unlock_irq(&ide_lock); local_irq_set(lflags); if (time_after(jiffies, timeout)) { local_irq_restore(lflags); printk(KERN_ERR "%s: channel busy\n", drive->name); return -EBUSY; } local_irq_restore(lflags); spin_lock_irq(&ide_lock); } return 0; } EXPORT_SYMBOL(ide_spin_wait_hwgroup); /** * ide_write_setting - read an IDE setting * @drive: drive to read from * @setting: drive setting * @val: value * * Write a drive setting if it is possible. The caller * must hold the ide_setting_sem when making this call. * * BUGS: the data return and error are the same return value * so an error -EINVAL and true return of the same value cannot * be told apart * * FIXME: This should be changed to enqueue a special request * to the driver to change settings, and then wait on a sema for completion. * The current scheme of polling is kludgy, though safe enough. */ int ide_write_setting (ide_drive_t *drive, ide_settings_t *setting, int val) { int i; u32 *p; if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (!(setting->rw & SETTING_WRITE)) return -EPERM; if (val < setting->min || val > setting->max) return -EINVAL; if (setting->set) return setting->set(drive, val); if (ide_spin_wait_hwgroup(drive)) return -EBUSY; switch (setting->data_type) { case TYPE_BYTE: *((u8 *) setting->data) = val; break; case TYPE_SHORT: *((u16 *) setting->data) = val; break; case TYPE_INT: *((u32 *) setting->data) = val; break; case TYPE_INTA: p = (u32 *) setting->data; for (i = 0; i < 1 << PARTN_BITS; i++, p++) *p = val; break; } spin_unlock_irq(&ide_lock); return 0; } static int set_io_32bit(ide_drive_t *drive, int arg) { drive->io_32bit = arg; #ifdef CONFIG_BLK_DEV_DTC2278 if (HWIF(drive)->chipset == ide_dtc2278) HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg; #endif /* CONFIG_BLK_DEV_DTC2278 */ return 0; } static int set_using_dma (ide_drive_t *drive, int arg) { #ifdef CONFIG_BLK_DEV_IDEDMA ide_hwif_t *hwif = drive->hwif; int err = -EPERM; if (!drive->id || !(drive->id->capability & 1)) goto out; if (hwif->ide_dma_check == NULL) goto out; err = -EBUSY; if (ide_spin_wait_hwgroup(drive)) goto out; /* * set ->busy flag, unlock and let it ride */ hwif->hwgroup->busy = 1; spin_unlock_irq(&ide_lock); err = 0; if (arg) { if (ide_set_dma(drive) || hwif->ide_dma_on(drive)) err = -EIO; } else ide_dma_off(drive); /* * lock, clear ->busy flag and unlock before leaving */ spin_lock_irq(&ide_lock); hwif->hwgroup->busy = 0; spin_unlock_irq(&ide_lock); out: return err; #else return -EPERM; #endif } static int set_pio_mode (ide_drive_t *drive, int arg) { struct request rq; if (!HWIF(drive)->tuneproc) return -ENOSYS; if (drive->special.b.set_tune) return -EBUSY; ide_init_drive_cmd(&rq); drive->tune_req = (u8) arg; drive->special.b.set_tune = 1; (void) ide_do_drive_cmd(drive, &rq, ide_wait); return 0; } static int set_xfer_rate (ide_drive_t *drive, int arg) { int err = ide_wait_cmd(drive, WIN_SETFEATURES, (u8) arg, SETFEATURES_XFER, 0, NULL); if (!err && arg) { ide_set_xfer_rate(drive, (u8) arg); ide_driveid_update(drive); } return err; } /** * ide_add_generic_settings - generic ide settings * @drive: drive being configured * * Add the generic parts of the system settings to the /proc files and * ioctls for this IDE device. The caller must not be holding the * ide_setting_sem. */ void ide_add_generic_settings (ide_drive_t *drive) { /* * drive setting name read/write access read ioctl write ioctl data type min max mul_factor div_factor data pointer set function */ __ide_add_setting(drive, "io_32bit", drive->no_io_32bit ? SETTING_READ : SETTING_RW, HDIO_GET_32BIT, HDIO_SET_32BIT, TYPE_BYTE, 0, 1 + (SUPPORT_VLB_SYNC << 1), 1, 1, &drive->io_32bit, set_io_32bit, 0); __ide_add_setting(drive, "keepsettings", SETTING_RW, HDIO_GET_KEEPSETTINGS, HDIO_SET_KEEPSETTINGS, TYPE_BYTE, 0, 1, 1, 1, &drive->keep_settings, NULL, 0); __ide_add_setting(drive, "nice1", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->nice1, NULL, 0); __ide_add_setting(drive, "pio_mode", SETTING_WRITE, -1, HDIO_SET_PIO_MODE, TYPE_BYTE, 0, 255, 1, 1, NULL, set_pio_mode, 0); __ide_add_setting(drive, "unmaskirq", drive->no_unmask ? SETTING_READ : SETTING_RW, HDIO_GET_UNMASKINTR, HDIO_SET_UNMASKINTR, TYPE_BYTE, 0, 1, 1, 1, &drive->unmask, NULL, 0); __ide_add_setting(drive, "using_dma", SETTING_RW, HDIO_GET_DMA, HDIO_SET_DMA, TYPE_BYTE, 0, 1, 1, 1, &drive->using_dma, set_using_dma, 0); __ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL, 0); __ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate, 0); __ide_add_setting(drive, "number", SETTING_RW, -1, -1, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL, 0); } /** * system_bus_clock - clock guess * * External version of the bus clock guess used by very old IDE drivers * for things like VLB timings. Should not be used. */ int system_bus_clock (void) { return((int) ((!system_bus_speed) ? ide_system_bus_speed() : system_bus_speed )); } EXPORT_SYMBOL(system_bus_clock); static int generic_ide_suspend(struct device *dev, pm_message_t mesg) { ide_drive_t *drive = dev->driver_data; ide_hwif_t *hwif = HWIF(drive); struct request rq; struct request_pm_state rqpm; ide_task_t args; /* Call ACPI _GTM only once */ if (!(drive->dn % 2)) ide_acpi_get_timing(hwif); memset(&rq, 0, sizeof(rq)); memset(&rqpm, 0, sizeof(rqpm)); memset(&args, 0, sizeof(args)); rq.cmd_type = REQ_TYPE_PM_SUSPEND; rq.special = &args; rq.data = &rqpm; rqpm.pm_step = ide_pm_state_start_suspend; if (mesg.event == PM_EVENT_PRETHAW) mesg.event = PM_EVENT_FREEZE; rqpm.pm_state = mesg.event; return ide_do_drive_cmd(drive, &rq, ide_wait); } static int generic_ide_resume(struct device *dev) { ide_drive_t *drive = dev->driver_data; ide_hwif_t *hwif = HWIF(drive); struct request rq; struct request_pm_state rqpm; ide_task_t args; /* Call ACPI _STM only once */ if (!(drive->dn % 2)) ide_acpi_push_timing(hwif); ide_acpi_exec_tfs(drive); memset(&rq, 0, sizeof(rq)); memset(&rqpm, 0, sizeof(rqpm)); memset(&args, 0, sizeof(args)); rq.cmd_type = REQ_TYPE_PM_RESUME; rq.special = &args; rq.data = &rqpm; rqpm.pm_step = ide_pm_state_start_resume; rqpm.pm_state = PM_EVENT_ON; return ide_do_drive_cmd(drive, &rq, ide_head_wait); } int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev, unsigned int cmd, unsigned long arg) { ide_settings_t *setting; ide_driver_t *drv; int err = 0; void __user *p = (void __user *)arg; down(&ide_setting_sem); if ((setting = ide_find_setting_by_ioctl(drive, cmd)) != NULL) { if (cmd == setting->read_ioctl) { err = ide_read_setting(drive, setting); up(&ide_setting_sem); return err >= 0 ? put_user(err, (long __user *)arg) : err; } else { if (bdev != bdev->bd_contains) err = -EINVAL; else err = ide_write_setting(drive, setting, arg); up(&ide_setting_sem); return err; } } up(&ide_setting_sem); switch (cmd) { case HDIO_OBSOLETE_IDENTITY: case HDIO_GET_IDENTITY: if (bdev != bdev->bd_contains) return -EINVAL; if (drive->id_read == 0) return -ENOMSG; if (copy_to_user(p, drive->id, (cmd == HDIO_GET_IDENTITY) ? sizeof(*drive->id) : 142)) return -EFAULT; return 0; case HDIO_GET_NICE: return put_user(drive->dsc_overlap << IDE_NICE_DSC_OVERLAP | drive->atapi_overlap << IDE_NICE_ATAPI_OVERLAP | drive->nice0 << IDE_NICE_0 | drive->nice1 << IDE_NICE_1 | drive->nice2 << IDE_NICE_2, (long __user *) arg); #ifdef CONFIG_IDE_TASK_IOCTL case HDIO_DRIVE_TASKFILE: if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) return -EACCES; switch(drive->media) { case ide_disk: return ide_taskfile_ioctl(drive, cmd, arg); default: return -ENOMSG; } #endif /* CONFIG_IDE_TASK_IOCTL */ case HDIO_DRIVE_CMD: if (!capable(CAP_SYS_RAWIO)) return -EACCES; return ide_cmd_ioctl(drive, cmd, arg); case HDIO_DRIVE_TASK: if (!capable(CAP_SYS_RAWIO)) return -EACCES; return ide_task_ioctl(drive, cmd, arg); case HDIO_SCAN_HWIF: { hw_regs_t hw; int args[3]; if (!capable(CAP_SYS_RAWIO)) return -EACCES; if (copy_from_user(args, p, 3 * sizeof(int))) return -EFAULT; memset(&hw, 0, sizeof(hw)); ide_init_hwif_ports(&hw, (unsigned long) args[0], (unsigned long) args[1], NULL); hw.irq = args[2]; if (ide_register_hw(&hw, NULL) == -1) return -EIO; return 0; } case HDIO_UNREGISTER_HWIF: if (!capable(CAP_SYS_RAWIO)) return -EACCES; /* (arg > MAX_HWIFS) checked in function */ ide_unregister(arg); return 0; case HDIO_SET_NICE: if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (arg != (arg & ((1 << IDE_NICE_DSC_OVERLAP) | (1 << IDE_NICE_1)))) return -EPERM; drive->dsc_overlap = (arg >> IDE_NICE_DSC_OVERLAP) & 1; drv = *(ide_driver_t **)bdev->bd_disk->private_data; if (drive->dsc_overlap && !drv->supports_dsc_overlap) { drive->dsc_overlap = 0; return -EPERM; } drive->nice1 = (arg >> IDE_NICE_1) & 1; return 0; case HDIO_DRIVE_RESET: { unsigned long flags; if (!capable(CAP_SYS_ADMIN)) return -EACCES; /* * Abort the current command on the * group if there is one, taking * care not to allow anything else * to be queued and to die on the * spot if we miss one somehow */ spin_lock_irqsave(&ide_lock, flags); if (HWGROUP(drive)->resetting) { spin_unlock_irqrestore(&ide_lock, flags); return -EBUSY; } ide_abort(drive, "drive reset"); BUG_ON(HWGROUP(drive)->handler); /* Ensure nothing gets queued after we drop the lock. Reset will clear the busy */ HWGROUP(drive)->busy = 1; spin_unlock_irqrestore(&ide_lock, flags); (void) ide_do_reset(drive); return 0; } case CDROMEJECT: case CDROMCLOSETRAY: return scsi_cmd_ioctl(file, bdev->bd_disk, cmd, p); case HDIO_GET_BUSSTATE: if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (put_user(HWIF(drive)->bus_state, (long __user *)arg)) return -EFAULT; return 0; case HDIO_SET_BUSSTATE: if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (HWIF(drive)->busproc) return HWIF(drive)->busproc(drive, (int)arg); return -EOPNOTSUPP; default: return -EINVAL; } } EXPORT_SYMBOL(generic_ide_ioctl); /* * stridx() returns the offset of c within s, * or -1 if c is '\0' or not found within s. */ static int __init stridx (const char *s, char c) { char *i = strchr(s, c); return (i && c) ? i - s : -1; } /* * match_parm() does parsing for ide_setup(): * * 1. the first char of s must be '='. * 2. if the remainder matches one of the supplied keywords, * the index (1 based) of the keyword is negated and returned. * 3. if the remainder is a series of no more than max_vals numbers * separated by commas, the numbers are saved in vals[] and a * count of how many were saved is returned. Base10 is assumed, * and base16 is allowed when prefixed with "0x". * 4. otherwise, zero is returned. */ static int __init match_parm (char *s, const char *keywords[], int vals[], int max_vals) { static const char *decimal = "0123456789"; static const char *hex = "0123456789abcdef"; int i, n; if (*s++ == '=') { /* * Try matching against the supplied keywords, * and return -(index+1) if we match one */ if (keywords != NULL) { for (i = 0; *keywords != NULL; ++i) { if (!strcmp(s, *keywords++)) return -(i+1); } } /* * Look for a series of no more than "max_vals" * numeric values separated by commas, in base10, * or base16 when prefixed with "0x". * Return a count of how many were found. */ for (n = 0; (i = stridx(decimal, *s)) >= 0;) { vals[n] = i; while ((i = stridx(decimal, *++s)) >= 0) vals[n] = (vals[n] * 10) + i; if (*s == 'x' && !vals[n]) { while ((i = stridx(hex, *++s)) >= 0) vals[n] = (vals[n] * 0x10) + i; } if (++n == max_vals) break; if (*s == ',' || *s == ';') ++s; } if (!*s) return n; } return 0; /* zero = nothing matched */ } #ifdef CONFIG_BLK_DEV_ALI14XX extern int probe_ali14xx; extern int ali14xx_init(void); #endif #ifdef CONFIG_BLK_DEV_UMC8672 extern int probe_umc8672; extern int umc8672_init(void); #endif #ifdef CONFIG_BLK_DEV_DTC2278 extern int probe_dtc2278; extern int dtc2278_init(void); #endif #ifdef CONFIG_BLK_DEV_HT6560B extern int probe_ht6560b; extern int ht6560b_init(void); #endif #ifdef CONFIG_BLK_DEV_QD65XX extern int probe_qd65xx; extern int qd65xx_init(void); #endif static int __initdata is_chipset_set[MAX_HWIFS]; /* * ide_setup() gets called VERY EARLY during initialization, * to handle kernel "command line" strings beginning with "hdx=" or "ide". * * Remember to update Documentation/ide.txt if you change something here. */ static int __init ide_setup(char *s) { int i, vals[3]; ide_hwif_t *hwif; ide_drive_t *drive; unsigned int hw, unit; const char max_drive = 'a' + ((MAX_HWIFS * MAX_DRIVES) - 1); const char max_hwif = '0' + (MAX_HWIFS - 1); if (strncmp(s,"hd",2) == 0 && s[2] == '=') /* hd= is for hd.c */ return 0; /* driver and not us */ if (strncmp(s,"ide",3) && strncmp(s,"idebus",6) && strncmp(s,"hd",2)) return 0; printk(KERN_INFO "ide_setup: %s", s); init_ide_data (); #ifdef CONFIG_BLK_DEV_IDEDOUBLER if (!strcmp(s, "ide=doubler")) { extern int ide_doubler; printk(" : Enabled support for IDE doublers\n"); ide_doubler = 1; return 1; } #endif /* CONFIG_BLK_DEV_IDEDOUBLER */ if (!strcmp(s, "ide=nodma")) { printk(" : Prevented DMA\n"); noautodma = 1; return 1; } #ifdef CONFIG_BLK_DEV_IDEPCI if (!strcmp(s, "ide=reverse")) { ide_scan_direction = 1; printk(" : Enabled support for IDE inverse scan order.\n"); return 1; } #endif /* CONFIG_BLK_DEV_IDEPCI */ #ifdef CONFIG_BLK_DEV_IDEACPI if (!strcmp(s, "ide=noacpi")) { //printk(" : Disable IDE ACPI support.\n"); ide_noacpi = 1; return 1; } if (!strcmp(s, "ide=acpigtf")) { //printk(" : Enable IDE ACPI _GTF support.\n"); ide_noacpitfs = 0; return 1; } if (!strcmp(s, "ide=acpionboot")) { //printk(" : Call IDE ACPI methods on boot.\n"); ide_noacpionboot = 0; return 1; } #endif /* CONFIG_BLK_DEV_IDEACPI */ /* * Look for drive options: "hdx=" */ if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { const char *hd_words[] = { "none", "noprobe", "nowerr", "cdrom", "minus5", "autotune", "noautotune", "minus8", "swapdata", "bswap", "noflush", "remap", "remap63", "scsi", NULL }; unit = s[2] - 'a'; hw = unit / MAX_DRIVES; unit = unit % MAX_DRIVES; hwif = &ide_hwifs[hw]; drive = &hwif->drives[unit]; if (strncmp(s + 4, "ide-", 4) == 0) { strlcpy(drive->driver_req, s + 4, sizeof(drive->driver_req)); goto done; } switch (match_parm(&s[3], hd_words, vals, 3)) { case -1: /* "none" */ case -2: /* "noprobe" */ drive->noprobe = 1; goto done; case -3: /* "nowerr" */ drive->bad_wstat = BAD_R_STAT; hwif->noprobe = 0; goto done; case -4: /* "cdrom" */ drive->present = 1; drive->media = ide_cdrom; /* an ATAPI device ignores DRDY */ drive->ready_stat = 0; hwif->noprobe = 0; goto done; case -6: /* "autotune" */ drive->autotune = IDE_TUNE_AUTO; goto obsolete_option; case -7: /* "noautotune" */ drive->autotune = IDE_TUNE_NOAUTO; goto obsolete_option; case -9: /* "swapdata" */ case -10: /* "bswap" */ drive->bswap = 1; goto done; case -11: /* noflush */ drive->noflush = 1; goto done; case -12: /* "remap" */ drive->remap_0_to_1 = 1; goto done; case -13: /* "remap63" */ drive->sect0 = 63; goto done; case -14: /* "scsi" */ drive->scsi = 1; goto done; case 3: /* cyl,head,sect */ drive->media = ide_disk; drive->ready_stat = READY_STAT; drive->cyl = drive->bios_cyl = vals[0]; drive->head = drive->bios_head = vals[1]; drive->sect = drive->bios_sect = vals[2]; drive->present = 1; drive->forced_geom = 1; hwif->noprobe = 0; goto done; default: goto bad_option; } } if (s[0] != 'i' || s[1] != 'd' || s[2] != 'e') goto bad_option; /* * Look for bus speed option: "idebus=" */ if (s[3] == 'b' && s[4] == 'u' && s[5] == 's') { if (match_parm(&s[6], NULL, vals, 1) != 1) goto bad_option; if (vals[0] >= 20 && vals[0] <= 66) { idebus_parameter = vals[0]; } else printk(" -- BAD BUS SPEED! Expected value from 20 to 66"); goto done; } /* * Look for interface options: "idex=" */ if (s[3] >= '0' && s[3] <= max_hwif) { /* * Be VERY CAREFUL changing this: note hardcoded indexes below * (-8, -9, -10) are reserved to ease the hardcoding. */ static const char *ide_words[] = { "noprobe", "serialize", "minus3", "minus4", "reset", "dma", "ata66", "minus8", "minus9", "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", NULL }; hw = s[3] - '0'; hwif = &ide_hwifs[hw]; i = match_parm(&s[4], ide_words, vals, 3); /* * Cryptic check to ensure chipset not already set for hwif. * Note: we can't depend on hwif->chipset here. */ if ((i >= -18 && i <= -11) || (i > 0 && i <= 3)) { /* chipset already specified */ if (is_chipset_set[hw]) goto bad_option; if (i > -18 && i <= -11) { /* these drivers are for "ide0=" only */ if (hw != 0) goto bad_hwif; /* chipset already specified for 2nd port */ if (is_chipset_set[hw+1]) goto bad_option; } is_chipset_set[hw] = 1; printk("\n"); } switch (i) { #ifdef CONFIG_BLK_DEV_ALI14XX case -17: /* "ali14xx" */ probe_ali14xx = 1; goto done; #endif #ifdef CONFIG_BLK_DEV_UMC8672 case -16: /* "umc8672" */ probe_umc8672 = 1; goto done; #endif #ifdef CONFIG_BLK_DEV_DTC2278 case -15: /* "dtc2278" */ probe_dtc2278 = 1; goto done; #endif #ifdef CONFIG_BLK_DEV_CMD640 case -14: /* "cmd640_vlb" */ { extern int cmd640_vlb; /* flag for cmd640.c */ cmd640_vlb = 1; goto done; } #endif #ifdef CONFIG_BLK_DEV_HT6560B case -13: /* "ht6560b" */ probe_ht6560b = 1; goto done; #endif #ifdef CONFIG_BLK_DEV_QD65XX case -12: /* "qd65xx" */ probe_qd65xx = 1; goto done; #endif #ifdef CONFIG_BLK_DEV_4DRIVES case -11: /* "four" drives on one set of ports */ { ide_hwif_t *mate = &ide_hwifs[hw^1]; mate->drives[0].select.all ^= 0x20; mate->drives[1].select.all ^= 0x20; hwif->chipset = mate->chipset = ide_4drives; mate->irq = hwif->irq; memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); hwif->mate = mate; mate->mate = hwif; hwif->serialized = mate->serialized = 1; goto obsolete_option; } #endif /* CONFIG_BLK_DEV_4DRIVES */ case -10: /* minus10 */ case -9: /* minus9 */ case -8: /* minus8 */ case -4: case -3: goto bad_option; case -7: /* ata66 */ #ifdef CONFIG_BLK_DEV_IDEPCI hwif->udma_four = 1; goto obsolete_option; #else goto bad_hwif; #endif case -6: /* dma */ hwif->autodma = 1; goto obsolete_option; case -5: /* "reset" */ hwif->reset = 1; goto obsolete_option; case -2: /* "serialize" */ hwif->mate = &ide_hwifs[hw^1]; hwif->mate->mate = hwif; hwif->serialized = hwif->mate->serialized = 1; goto obsolete_option; case -1: /* "noprobe" */ hwif->noprobe = 1; goto done; case 1: /* base */ vals[1] = vals[0] + 0x206; /* default ctl */ case 2: /* base,ctl */ vals[2] = 0; /* default irq = probe for it */ case 3: /* base,ctl,irq */ hwif->hw.irq = vals[2]; ide_init_hwif_ports(&hwif->hw, (unsigned long) vals[0], (unsigned long) vals[1], &hwif->irq); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); hwif->irq = vals[2]; hwif->noprobe = 0; hwif->chipset = ide_forced; goto obsolete_option; case 0: goto bad_option; default: printk(" -- SUPPORT NOT CONFIGURED IN THIS KERNEL\n"); return 1; } } bad_option: printk(" -- BAD OPTION\n"); return 1; obsolete_option: printk(" -- OBSOLETE OPTION, WILL BE REMOVED SOON!\n"); return 1; bad_hwif: printk("-- NOT SUPPORTED ON ide%d", hw); done: printk("\n"); return 1; } extern void __init pnpide_init(void); extern void __exit pnpide_exit(void); extern void __init h8300_ide_init(void); /* * probe_for_hwifs() finds/initializes "known" IDE interfaces */ static void __init probe_for_hwifs (void) { #ifdef CONFIG_BLK_DEV_IDEPCI ide_scan_pcibus(ide_scan_direction); #endif /* CONFIG_BLK_DEV_IDEPCI */ #ifdef CONFIG_ETRAX_IDE { extern void init_e100_ide(void); init_e100_ide(); } #endif /* CONFIG_ETRAX_IDE */ #ifdef CONFIG_BLK_DEV_CMD640 { extern void ide_probe_for_cmd640x(void); ide_probe_for_cmd640x(); } #endif /* CONFIG_BLK_DEV_CMD640 */ #ifdef CONFIG_BLK_DEV_IDE_PMAC { extern int pmac_ide_probe(void); (void)pmac_ide_probe(); } #endif /* CONFIG_BLK_DEV_IDE_PMAC */ #ifdef CONFIG_BLK_DEV_GAYLE { extern void gayle_init(void); gayle_init(); } #endif /* CONFIG_BLK_DEV_GAYLE */ #ifdef CONFIG_BLK_DEV_FALCON_IDE { extern void falconide_init(void); falconide_init(); } #endif /* CONFIG_BLK_DEV_FALCON_IDE */ #ifdef CONFIG_BLK_DEV_MAC_IDE { extern void macide_init(void); macide_init(); } #endif /* CONFIG_BLK_DEV_MAC_IDE */ #ifdef CONFIG_BLK_DEV_Q40IDE { extern void q40ide_init(void); q40ide_init(); } #endif /* CONFIG_BLK_DEV_Q40IDE */ #ifdef CONFIG_BLK_DEV_BUDDHA { extern void buddha_init(void); buddha_init(); } #endif /* CONFIG_BLK_DEV_BUDDHA */ #ifdef CONFIG_BLK_DEV_IDEPNP pnpide_init(); #endif #ifdef CONFIG_H8300 h8300_ide_init(); #endif } void ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver) { #ifdef CONFIG_PROC_FS ide_add_proc_entries(drive->proc, driver->proc, drive); #endif } EXPORT_SYMBOL(ide_register_subdriver); /** * ide_unregister_subdriver - disconnect drive from driver * @drive: drive to unplug * @driver: driver * * Disconnect a drive from the driver it was attached to and then * clean up the various proc files and other objects attached to it. * * Takes ide_setting_sem and ide_lock. * Caller must hold none of the locks. */ void ide_unregister_subdriver(ide_drive_t *drive, ide_driver_t *driver) { unsigned long flags; #ifdef CONFIG_PROC_FS ide_remove_proc_entries(drive->proc, driver->proc); #endif down(&ide_setting_sem); spin_lock_irqsave(&ide_lock, flags); /* * ide_setting_sem protects the settings list * ide_lock protects the use of settings * * so we need to hold both, ide_settings_sem because we want to * modify the settings list, and ide_lock because we cannot take * a setting out that is being used. * * OTOH both ide_{read,write}_setting are only ever used under * ide_setting_sem. */ auto_remove_settings(drive); spin_unlock_irqrestore(&ide_lock, flags); up(&ide_setting_sem); } EXPORT_SYMBOL(ide_unregister_subdriver); /* * Probe module */ EXPORT_SYMBOL(ide_lock); static int ide_bus_match(struct device *dev, struct device_driver *drv) { return 1; } static char *media_string(ide_drive_t *drive) { switch (drive->media) { case ide_disk: return "disk"; case ide_cdrom: return "cdrom"; case ide_tape: return "tape"; case ide_floppy: return "floppy"; case ide_optical: return "optical"; default: return "UNKNOWN"; } } static ssize_t media_show(struct device *dev, struct device_attribute *attr, char *buf) { ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", media_string(drive)); } static ssize_t drivename_show(struct device *dev, struct device_attribute *attr, char *buf) { ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", drive->name); } static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "ide:m-%s\n", media_string(drive)); } static struct device_attribute ide_dev_attrs[] = { __ATTR_RO(media), __ATTR_RO(drivename), __ATTR_RO(modalias), __ATTR_NULL }; static int ide_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size) { ide_drive_t *drive = to_ide_device(dev); int i = 0; int length = 0; add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, "MEDIA=%s", media_string(drive)); add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, "DRIVENAME=%s", drive->name); add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, "MODALIAS=ide:m-%s", media_string(drive)); envp[i] = NULL; return 0; } static int generic_ide_probe(struct device *dev) { ide_drive_t *drive = to_ide_device(dev); ide_driver_t *drv = to_ide_driver(dev->driver); return drv->probe ? drv->probe(drive) : -ENODEV; } static int generic_ide_remove(struct device *dev) { ide_drive_t *drive = to_ide_device(dev); ide_driver_t *drv = to_ide_driver(dev->driver); if (drv->remove) drv->remove(drive); return 0; } static void generic_ide_shutdown(struct device *dev) { ide_drive_t *drive = to_ide_device(dev); ide_driver_t *drv = to_ide_driver(dev->driver); if (dev->driver && drv->shutdown) drv->shutdown(drive); } struct bus_type ide_bus_type = { .name = "ide", .match = ide_bus_match, .uevent = ide_uevent, .probe = generic_ide_probe, .remove = generic_ide_remove, .shutdown = generic_ide_shutdown, .dev_attrs = ide_dev_attrs, .suspend = generic_ide_suspend, .resume = generic_ide_resume, }; EXPORT_SYMBOL_GPL(ide_bus_type); /* * This is gets invoked once during initialization, to set *everything* up */ static int __init ide_init(void) { int ret; printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); system_bus_speed = ide_system_bus_speed(); ret = bus_register(&ide_bus_type); if (ret < 0) { printk(KERN_WARNING "IDE: bus_register error: %d\n", ret); return ret; } init_ide_data(); #ifdef CONFIG_PROC_FS proc_ide_root = proc_mkdir("ide", NULL); #endif #ifdef CONFIG_BLK_DEV_ALI14XX if (probe_ali14xx) (void)ali14xx_init(); #endif #ifdef CONFIG_BLK_DEV_UMC8672 if (probe_umc8672) (void)umc8672_init(); #endif #ifdef CONFIG_BLK_DEV_DTC2278 if (probe_dtc2278) (void)dtc2278_init(); #endif #ifdef CONFIG_BLK_DEV_HT6560B if (probe_ht6560b) (void)ht6560b_init(); #endif #ifdef CONFIG_BLK_DEV_QD65XX if (probe_qd65xx) (void)qd65xx_init(); #endif initializing = 1; /* Probe for special PCI and other "known" interface chipsets. */ probe_for_hwifs(); initializing = 0; #ifdef CONFIG_PROC_FS proc_ide_create(); #endif return 0; } #ifdef MODULE static char *options = NULL; module_param(options, charp, 0); MODULE_LICENSE("GPL"); static void __init parse_options (char *line) { char *next = line; if (line == NULL || !*line) return; while ((line = next) != NULL) { if ((next = strchr(line,' ')) != NULL) *next++ = 0; if (!ide_setup(line)) printk (KERN_INFO "Unknown option '%s'\n", line); } } int __init init_module (void) { parse_options(options); return ide_init(); } void __exit cleanup_module (void) { int index; for (index = 0; index < MAX_HWIFS; ++index) ide_unregister(index); #ifdef CONFIG_BLK_DEV_IDEPNP pnpide_exit(); #endif #ifdef CONFIG_PROC_FS proc_ide_destroy(); #endif bus_unregister(&ide_bus_type); } #else /* !MODULE */ __setup("", ide_setup); module_init(ide_init); #endif /* MODULE */
26.835185
221
0.682424
53e69eb5106ad0b92a063cf3696801e42ba2ad4c
1,162
h
C
src/test_util.h
tesa4436/c-kzg
20dd98ae88263b289c4eb7c5bd88b079c691fe8a
[ "Apache-2.0" ]
14
2021-02-01T21:21:34.000Z
2022-03-18T02:06:36.000Z
src/test_util.h
tesa4436/c-kzg
20dd98ae88263b289c4eb7c5bd88b079c691fe8a
[ "Apache-2.0" ]
9
2021-02-06T19:00:22.000Z
2021-08-20T15:04:48.000Z
src/test_util.h
tesa4436/c-kzg
20dd98ae88263b289c4eb7c5bd88b079c691fe8a
[ "Apache-2.0" ]
3
2021-06-10T15:44:42.000Z
2021-10-31T07:25:14.000Z
/* * Copyright 2021 Benjamin Edgington * * 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 "bls12_381.h" // The generator for our "trusted" setup static const scalar_t secret = {0xa4, 0x73, 0x31, 0x95, 0x28, 0xc8, 0xb6, 0xea, 0x4d, 0x08, 0xcc, 0x53, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; void generate_trusted_setup(g1_t *s1, g2_t *s2, const scalar_t *secret, const uint64_t n); uint64_t rand_uint64(); fr_t rand_fr(); g1_t rand_g1(); void shuffle(uint64_t *a, uint64_t n); void title(void);
38.733333
97
0.688468
48ce13dad6eff709c8eb8a7da2ce626b8b91df20
998
c
C
hw/log.c
ROBOTIS-GIT/XelNetwork_FwSDK
dafed7a4917f97a273115f668627f9c4ae51f87d
[ "Apache-2.0" ]
1
2018-10-25T02:00:42.000Z
2018-10-25T02:00:42.000Z
hw/log.c
ROBOTIS-GIT/XelNetwork_FwSDK
dafed7a4917f97a273115f668627f9c4ae51f87d
[ "Apache-2.0" ]
null
null
null
hw/log.c
ROBOTIS-GIT/XelNetwork_FwSDK
dafed7a4917f97a273115f668627f9c4ae51f87d
[ "Apache-2.0" ]
null
null
null
/* * log.c * * Created on: 2017. 8. 25. * Author: baram */ #include "led.h" #ifdef _USE_HW_LOG #include <stdarg.h> #include <stdbool.h> #include "hw.h" //-- Internal Variables // static bool log_enable = false; static uint8_t log_ch = _DEF_UART1; //-- External Variables // //-- Internal Functions // //-- External Functions // bool logInit(void) { return true; } void logOn(void) { log_enable = true; } void logOff() { log_enable = false; } void logChangeChannel(uint8_t ch) { log_ch = ch; } void logPrintf( const char *fmt, ...) { va_list arg; va_start (arg, fmt); int32_t len; char print_buffer[255]; if (log_enable == false) { return; } len = vsnprintf(print_buffer, 255, fmt, arg); va_end (arg); switch(log_ch) { case _DEF_UART1: case _DEF_UART2: case _DEF_UART3: case _DEF_UART4: uartWrite(log_ch, (uint8_t *)print_buffer, len); break; } return; } #endif /* _USE_HW_LOG */
10.28866
54
0.609218
12585984096af6286e26d663c1dfc68b1850c1cc
181
h
C
nesulator/graphics.h
NailLegProcessorDivide/nesulator
b5f5ebc7435600d7ceea8a36e9ca1699e2d7becc
[ "MIT" ]
null
null
null
nesulator/graphics.h
NailLegProcessorDivide/nesulator
b5f5ebc7435600d7ceea8a36e9ca1699e2d7becc
[ "MIT" ]
null
null
null
nesulator/graphics.h
NailLegProcessorDivide/nesulator
b5f5ebc7435600d7ceea8a36e9ca1699e2d7becc
[ "MIT" ]
null
null
null
#pragma once #include <stdint.h> void setclose(); void start();//starts the graphics engine drawing void setpointer(uint8_t*); void setpixel(int, int, uint8_t); //void draw();
13.923077
49
0.712707