content
stringlengths
6
1.05M
obf_code
stringlengths
6
1.05M
probability
float64
0
1
obf_dict
stringlengths
0
25.3k
/*****************************************************************************/ /** fmActivateMcastGroup * \ingroup multicast * * \chips FM3000, FM4000, FM6000, FM10000 * * \desc Activates a multicast group. * * \param[in] sw is the switch on which to operate. * * \param[in] mcastGroup is the multicast group number (returned by * ''fmCreateMcastGroup''). * * \return FM_OK if successful. * \return FM_ERR_INVALID_SWITCH if sw is invalid. * \return FM_ERR_INVALID_MULTICAST_GROUP if mcastGroup is out of * range or is not the handle of an existing multicast group. * \return FM_ERR_MCAST_GROUP_ACTIVE if the group is already active. * \return FM_ERR_MCAST_ADDR_NOT_ASSIGNED if a multicast * address has not been assigned to the group. This error is * returned only when legacy multicast group restrictions are * enabled. Otherwise it is not required for a multicast group * to have an address attached prior to activation. * \return FM_ERR_ADDR_BANK_FULL if there is no room in the MA table * for the multicast address. * \return FM_FAIL if multicast group could not share a replication * group with other multicast groups due to a common listener * port, or an internal logic error occurs. * \return FM_ERR_LPORT_DESTS_UNAVAILABLE if a block of logical port * destination table entries cannot be allocated. * *****************************************************************************/ fm_status fmActivateMcastGroup(fm_int sw, fm_int mcastGroup) { fm_status err; FM_LOG_ENTRY_API(FM_LOG_CAT_MULTICAST, "sw = %d, mcastGroup = %d\n", sw, mcastGroup); VALIDATE_AND_PROTECT_SWITCH(sw); err = fmActivateMcastGroupInt(sw, mcastGroup); UNPROTECT_SWITCH(sw); FM_LOG_EXIT_API(FM_LOG_CAT_MULTICAST, err); }
/*****************************************************************************/ /** fmActivateMcastGroup * \ingroup multicast * * \chips FM3000, FM4000, FM6000, FM10000 * * \desc Activates a multicast group. * * \param[in] sw is the switch on which to operate. * * \param[in] mcastGroup is the multicast group number (returned by * ''fmCreateMcastGroup''). * * \return FM_OK if successful. * \return FM_ERR_INVALID_SWITCH if sw is invalid. * \return FM_ERR_INVALID_MULTICAST_GROUP if mcastGroup is out of * range or is not the handle of an existing multicast group. * \return FM_ERR_MCAST_GROUP_ACTIVE if the group is already active. * \return FM_ERR_MCAST_ADDR_NOT_ASSIGNED if a multicast * address has not been assigned to the group. This error is * returned only when legacy multicast group restrictions are * enabled. Otherwise it is not required for a multicast group * to have an address attached prior to activation. * \return FM_ERR_ADDR_BANK_FULL if there is no room in the MA table * for the multicast address. * \return FM_FAIL if multicast group could not share a replication * group with other multicast groups due to a common listener * port, or an internal logic error occurs. * \return FM_ERR_LPORT_DESTS_UNAVAILABLE if a block of logical port * destination table entries cannot be allocated. * *****************************************************************************/ fm_status FUNC_0(CLASS_0 VAR_0, CLASS_0 VAR_1) { fm_status VAR_2; FUNC_1(VAR_3, "sw = %d, mcastGroup = %d\n", VAR_0, VAR_1); FUNC_2(VAR_0); VAR_2 = FUNC_3(VAR_0, VAR_1); FUNC_4(VAR_0); FUNC_5(VAR_3, VAR_2); }
0.921913
{'FUNC_0': 'fmActivateMcastGroup', 'CLASS_0': 'fm_int', 'VAR_0': 'sw', 'VAR_1': 'mcastGroup', 'VAR_2': 'err', 'FUNC_1': 'FM_LOG_ENTRY_API', 'VAR_3': 'FM_LOG_CAT_MULTICAST', 'FUNC_2': 'VALIDATE_AND_PROTECT_SWITCH', 'FUNC_3': 'fmActivateMcastGroupInt', 'FUNC_4': 'UNPROTECT_SWITCH', 'FUNC_5': 'FM_LOG_EXIT_API'}
/** * @brief Get the current JR input queue index of the next job to read. * The HW increments register by 4. Convert it to a software * index number * * @param[in] baseaddr CAAM JR Base Address * * @retval index of the next entry in the queue */ uint8_t hal_jr_input_index(vaddr_t baseaddr) { uint32_t index; index = get32(baseaddr + JRx_IRRIR); return index >> 2; }
/** * @brief Get the current JR input queue index of the next job to read. * The HW increments register by 4. Convert it to a software * index number * * @param[in] baseaddr CAAM JR Base Address * * @retval index of the next entry in the queue */ uint8_t hal_jr_input_index(vaddr_t baseaddr) { uint32_t index; index = get32(baseaddr + JRx_IRRIR); return index >> 2; }
0.053508
{}
#pragma once #include <iostream> class Greet { public: static int hello(std::string name) { std::cout << "Hello " << name << "!" << std::endl; return 0; } };
#pragma once #include <iostream> CLASS_0 Greet { public: VAR_0 int hello(CLASS_1::VAR_2 name) { std::VAR_3 << "Hello " << name << "!" << VAR_1::endl; return 0; } };
0.473493
{'CLASS_0': 'class', 'VAR_0': 'static', 'CLASS_1': 'std', 'VAR_1': 'std', 'VAR_2': 'string', 'VAR_3': 'cout'}
/** ****************************************************************************** * File Name : LTDC.c * Description : This file provides code for the configuration * of the LTDC instances. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "ltdc.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ LTDC_HandleTypeDef hltdc; /* LTDC init function */ void MX_LTDC_Init(void) { LTDC_LayerCfgTypeDef pLayerCfg = {0}; hltdc.Instance = LTDC; hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL; hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL; hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL; hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC; hltdc.Init.HorizontalSync = 0; hltdc.Init.VerticalSync = 0; hltdc.Init.AccumulatedHBP = 1; hltdc.Init.AccumulatedVBP = 1; hltdc.Init.AccumulatedActiveW = 201; hltdc.Init.AccumulatedActiveH = 481; hltdc.Init.TotalWidth = 202; hltdc.Init.TotalHeigh = 482; hltdc.Init.Backcolor.Blue = 0; hltdc.Init.Backcolor.Green = 0; hltdc.Init.Backcolor.Red = 0; if (HAL_LTDC_Init(&hltdc) != HAL_OK) { Error_Handler(); } pLayerCfg.WindowX0 = 0; pLayerCfg.WindowX1 = 200; pLayerCfg.WindowY0 = 0; pLayerCfg.WindowY1 = 480; pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565; pLayerCfg.Alpha = 255; pLayerCfg.Alpha0 = 0; pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA; pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA; pLayerCfg.FBStartAdress = 0xC0000000; pLayerCfg.ImageWidth = 200; pLayerCfg.ImageHeight = 480; pLayerCfg.Backcolor.Blue = 0; pLayerCfg.Backcolor.Green = 0; pLayerCfg.Backcolor.Red = 0; if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK) { Error_Handler(); } } void HAL_LTDC_MspInit(LTDC_HandleTypeDef* ltdcHandle) { if(ltdcHandle->Instance==LTDC) { /* USER CODE BEGIN LTDC_MspInit 0 */ /* USER CODE END LTDC_MspInit 0 */ /* LTDC clock enable */ __HAL_RCC_LTDC_CLK_ENABLE(); /* LTDC interrupt Init */ HAL_NVIC_SetPriority(LTDC_IRQn, 7, 0); HAL_NVIC_EnableIRQ(LTDC_IRQn); /* USER CODE BEGIN LTDC_MspInit 1 */ /* USER CODE END LTDC_MspInit 1 */ } } void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* ltdcHandle) { if(ltdcHandle->Instance==LTDC) { /* USER CODE BEGIN LTDC_MspDeInit 0 */ /* USER CODE END LTDC_MspDeInit 0 */ /* Peripheral clock disable */ __HAL_RCC_LTDC_CLK_DISABLE(); /* LTDC interrupt Deinit */ HAL_NVIC_DisableIRQ(LTDC_IRQn); /* USER CODE BEGIN LTDC_MspDeInit 1 */ /* USER CODE END LTDC_MspDeInit 1 */ } } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/** ****************************************************************************** * File Name : LTDC.c * Description : This file provides code for the configuration * of the LTDC instances. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license * SLA0044, the "License"; You may not use this file except in compliance with * the License. You may obtain a copy of the License at: * www.st.com/SLA0044 * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "IMPORT_0" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ LTDC_HandleTypeDef hltdc; /* LTDC init function */ void MX_LTDC_Init(void) { CLASS_0 pLayerCfg = {0}; hltdc.VAR_0 = LTDC; hltdc.VAR_1.VAR_2 = VAR_3; hltdc.VAR_1.VSPolarity = VAR_4; hltdc.VAR_1.VAR_5 = LTDC_DEPOLARITY_AL; hltdc.VAR_1.PCPolarity = VAR_6; hltdc.VAR_1.VAR_7 = 0; hltdc.VAR_1.VerticalSync = 0; hltdc.VAR_1.VAR_8 = 1; hltdc.VAR_1.VAR_9 = 1; hltdc.VAR_1.VAR_10 = 201; hltdc.VAR_1.AccumulatedActiveH = 481; hltdc.VAR_1.TotalWidth = 202; hltdc.VAR_1.TotalHeigh = 482; hltdc.VAR_1.VAR_11.Blue = 0; hltdc.VAR_1.VAR_11.VAR_12 = 0; hltdc.VAR_1.VAR_11.VAR_13 = 0; if (HAL_LTDC_Init(&hltdc) != HAL_OK) { Error_Handler(); } pLayerCfg.WindowX0 = 0; pLayerCfg.VAR_14 = 200; pLayerCfg.WindowY0 = 0; pLayerCfg.VAR_15 = 480; pLayerCfg.VAR_16 = LTDC_PIXEL_FORMAT_RGB565; pLayerCfg.VAR_17 = 255; pLayerCfg.VAR_18 = 0; pLayerCfg.BlendingFactor1 = VAR_19; pLayerCfg.VAR_20 = VAR_21; pLayerCfg.FBStartAdress = 0xC0000000; pLayerCfg.ImageWidth = 200; pLayerCfg.ImageHeight = 480; pLayerCfg.VAR_11.Blue = 0; pLayerCfg.VAR_11.VAR_12 = 0; pLayerCfg.VAR_11.VAR_13 = 0; if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK) { Error_Handler(); } } void HAL_LTDC_MspInit(LTDC_HandleTypeDef* ltdcHandle) { if(ltdcHandle->VAR_0==LTDC) { /* USER CODE BEGIN LTDC_MspInit 0 */ /* USER CODE END LTDC_MspInit 0 */ /* LTDC clock enable */ __HAL_RCC_LTDC_CLK_ENABLE(); /* LTDC interrupt Init */ HAL_NVIC_SetPriority(VAR_22, 7, 0); HAL_NVIC_EnableIRQ(VAR_22); /* USER CODE BEGIN LTDC_MspInit 1 */ /* USER CODE END LTDC_MspInit 1 */ } } void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* ltdcHandle) { if(ltdcHandle->VAR_0==LTDC) { /* USER CODE BEGIN LTDC_MspDeInit 0 */ /* USER CODE END LTDC_MspDeInit 0 */ /* Peripheral clock disable */ FUNC_0(); /* LTDC interrupt Deinit */ FUNC_1(VAR_22); /* USER CODE BEGIN LTDC_MspDeInit 1 */ /* USER CODE END LTDC_MspDeInit 1 */ } } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0.48185
{'IMPORT_0': 'ltdc.h', 'CLASS_0': 'LTDC_LayerCfgTypeDef', 'VAR_0': 'Instance', 'VAR_1': 'Init', 'VAR_2': 'HSPolarity', 'VAR_3': 'LTDC_HSPOLARITY_AL', 'VAR_4': 'LTDC_VSPOLARITY_AL', 'VAR_5': 'DEPolarity', 'VAR_6': 'LTDC_PCPOLARITY_IPC', 'VAR_7': 'HorizontalSync', 'VAR_8': 'AccumulatedHBP', 'VAR_9': 'AccumulatedVBP', 'VAR_10': 'AccumulatedActiveW', 'VAR_11': 'Backcolor', 'VAR_12': 'Green', 'VAR_13': 'Red', 'VAR_14': 'WindowX1', 'VAR_15': 'WindowY1', 'VAR_16': 'PixelFormat', 'VAR_17': 'Alpha', 'VAR_18': 'Alpha0', 'VAR_19': 'LTDC_BLENDING_FACTOR1_PAxCA', 'VAR_20': 'BlendingFactor2', 'VAR_21': 'LTDC_BLENDING_FACTOR2_PAxCA', 'VAR_22': 'LTDC_IRQn', 'FUNC_0': '__HAL_RCC_LTDC_CLK_DISABLE', 'FUNC_1': 'HAL_NVIC_DisableIRQ'}
/* * call-seq: * res.autoclear? -> boolean * * Returns +true+ if the underlying C struct will be cleared automatically by libpq. * Elsewise the result is cleared by PG::Result#clear or by the GC when it's no longer in use. * */ VALUE pgresult_autoclear_p( VALUE self ) { t_pg_result *this = pgresult_get_this(self); return this->autoclear ? Qtrue : Qfalse; }
/* * call-seq: * res.autoclear? -> boolean * * Returns +true+ if the underlying C struct will be cleared automatically by libpq. * Elsewise the result is cleared by PG::Result#clear or by the GC when it's no longer in use. * */ CLASS_0 FUNC_0( CLASS_0 VAR_0 ) { t_pg_result *VAR_1 = FUNC_1(VAR_0); return VAR_1->VAR_2 ? VAR_3 : VAR_4; }
0.557178
{'CLASS_0': 'VALUE', 'FUNC_0': 'pgresult_autoclear_p', 'VAR_0': 'self', 'VAR_1': 'this', 'FUNC_1': 'pgresult_get_this', 'VAR_2': 'autoclear', 'VAR_3': 'Qtrue', 'VAR_4': 'Qfalse'}
#include "libavutil/log2_tab.c"
#include "IMPORT_0"
0.550872
{'IMPORT_0': 'libavutil/log2_tab.c'}
// // NSString+money.h // qtyd // // Created by stephendsw on 15/7/27. // Copyright (c) 2015年 qtyd. All rights reserved. // #import <Foundation/Foundation.h> #import "NSString+quick.h" @interface NSString (model) #pragma mark - 金额 /** * 格式化金额(xxx,xxx,xx),用于显示数据 */ - (NSString *)moneyFormatShow; - (NSString *)moneyFormatShowWithInt; /** * 格式化金额,保留2位小数,用于计算数据 */ - (NSString *)moneyFormatData; // 金额取整 - (NSString*)moneyFormatDataWithIntegerValue; /** * 格式化金额(xxx,xxx,xx),用于显示数据 小数点后字体小 * */ -(NSAttributedString *)moneyFormatZeroShow; #pragma mark - 时间 /** * 秒戳转时间 * */ - (NSString *)secondToTimeFormat; /** * 秒戳转时间 * */ -(NSString *)secondToTimeFormatChinese; #pragma mark - 加密 /** * 加密 * */ - (NSString *)enValue; /** * 解密 * */ - (NSString *)dnValue; #pragma mark - 标 /** * 标期名 无【】 * */ - (NSString *)firstBorrowNameNoFormat; /** * 标期名 有【】 * */ - (NSString *)firstBorrowName; /** * 标名 * */ - (NSString *)lastBorrowName; /** * 标类别 * */ + (NSString *)tenderType:(NSDictionary *)dic; #pragma mark - 其他 - (NSString *)realNameFormat; - (NSString *)phoneFormat; + (NSString *)safeRank; /** * 隐藏字符串,替换为* * * @param start 开始位置 * @param end 结束位置 */ - (NSString *)hideValue:(NSInteger)start end:(NSInteger)end; @end
// // NSString+money.h // qtyd // // Created by stephendsw on 15/7/27. // Copyright (c) 2015年 qtyd. All rights reserved. // #import <Foundation/Foundation.h> #import "NSString+quick.h" @interface NSString (VAR_0) #pragma mark - 金额 /** * 格式化金额(xxx,xxx,xx),用于显示数据 */ - (NSString *)VAR_1; - (NSString *)moneyFormatShowWithInt; /** * 格式化金额,保留2位小数,用于计算数据 */ - (NSString *)VAR_2; // 金额取整 - (NSString*)VAR_3; /** * 格式化金额(xxx,xxx,xx),用于显示数据 小数点后字体小 * */ -(CLASS_0 *)moneyFormatZeroShow; #pragma mark - 时间 /** * 秒戳转时间 * */ - (NSString *)secondToTimeFormat; /** * 秒戳转时间 * */ -(NSString *)secondToTimeFormatChinese; #pragma mark - 加密 /** * 加密 * */ - (NSString *)enValue; /** * 解密 * */ - (NSString *)VAR_4; #pragma mark - 标 /** * 标期名 无【】 * */ - (NSString *)firstBorrowNameNoFormat; /** * 标期名 有【】 * */ - (NSString *)VAR_5; /** * 标名 * */ - (NSString *)VAR_6; /** * 标类别 * */ + (NSString *)VAR_7:(VAR_8 *)dic; #pragma mark - 其他 - (NSString *)realNameFormat; - (NSString *)VAR_9; + (NSString *)VAR_10; /** * 隐藏字符串,替换为* * * @param start 开始位置 * @param end 结束位置 */ - (NSString *)VAR_11:(NSInteger)start end:(NSInteger)end; @end
0.545629
{'VAR_0': 'model', 'VAR_1': 'moneyFormatShow', 'VAR_2': 'moneyFormatData', 'VAR_3': 'moneyFormatDataWithIntegerValue', 'CLASS_0': 'NSAttributedString', 'VAR_4': 'dnValue', 'VAR_5': 'firstBorrowName', 'VAR_6': 'lastBorrowName', 'VAR_7': 'tenderType', 'VAR_8': 'NSDictionary', 'VAR_9': 'phoneFormat', 'VAR_10': 'safeRank', 'VAR_11': 'hideValue'}
/* * Object-specific functions (allocations, etc) */ static int compare_str(struct silc_ctx_t* c, silc_obj str, const char* buf, int size) { int len = 0; char* char_content = NULL; int subtype = silc_int_mem_parse_ref(c->mem, str, &len, &char_content, NULL); SILC_ASSERT(SILC_BREF_STR_SUBTYPE == subtype); int size_diff = len - size; if (size_diff != 0) { return size_diff; } return memcmp(buf, char_content, size); }
/* * Object-specific functions (allocations, etc) */ static int compare_str(struct silc_ctx_t* c, silc_obj str, const char* buf, int size) { int len = 0; char* char_content = NULL; int subtype = silc_int_mem_parse_ref(c->mem, str, &len, &char_content, NULL); SILC_ASSERT(SILC_BREF_STR_SUBTYPE == subtype); int size_diff = len - size; if (size_diff != 0) { return size_diff; } return FUNC_0(buf, char_content, size); }
0.119992
{'FUNC_0': 'memcmp'}
// Copyright 2021 // Author: <NAME> #pragma once #include <nlohmann/json.hpp> #include <restinio/all.hpp> using nlohmann::json; namespace Notes { namespace Utils { class HttpException : public std::exception { public: HttpException(restinio::http_status_line_t const& httpStatusLine, std::string const& reason); restinio::http_status_line_t getHttpStatusLine() const; char const* what() const override; friend void to_json(nlohmann::json& j, HttpException const& exc); friend void from_json(nlohmann::json const& j, HttpException& exc); private: restinio::http_status_line_t _httpStatus; std::ostringstream _reason; }; } // namespace Utils } // namespace Notes
// Copyright 2021 // Author: <NAME> #pragma once #include <IMPORT_0> #include <IMPORT_1> CLASS_0 VAR_0::VAR_1; CLASS_2 VAR_2 { CLASS_2 VAR_3 { CLASS_3 VAR_4 : VAR_5 VAR_6::exception { public: FUNC_0(VAR_7::VAR_8 VAR_9& VAR_10, VAR_6::VAR_11 VAR_9& VAR_12); restinio::VAR_8 FUNC_1() VAR_9; char const* FUNC_2() const VAR_13; CLASS_5 VAR_14 FUNC_3(CLASS_1::VAR_1& VAR_15, CLASS_4 const& VAR_16); CLASS_5 VAR_14 from_json(CLASS_1::VAR_1 VAR_9& VAR_15, CLASS_4& VAR_16); private: restinio::VAR_8 VAR_17; std::VAR_18 VAR_19; }; } // namespace Utils } // namespace Notes
0.961615
{'IMPORT_0': 'nlohmann/json.hpp', 'IMPORT_1': 'restinio/all.hpp', 'CLASS_0': 'using', 'VAR_0': 'nlohmann', 'CLASS_1': 'nlohmann', 'VAR_1': 'json', 'CLASS_2': 'namespace', 'VAR_2': 'Notes', 'VAR_3': 'Utils', 'CLASS_3': 'class', 'VAR_4': 'HttpException', 'FUNC_0': 'HttpException', 'CLASS_4': 'HttpException', 'VAR_5': 'public', 'VAR_6': 'std', 'VAR_7': 'restinio', 'VAR_8': 'http_status_line_t', 'VAR_9': 'const', 'VAR_10': 'httpStatusLine', 'VAR_11': 'string', 'VAR_12': 'reason', 'FUNC_1': 'getHttpStatusLine', 'FUNC_2': 'what', 'VAR_13': 'override', 'CLASS_5': 'friend', 'VAR_14': 'void', 'FUNC_3': 'to_json', 'VAR_15': 'j', 'VAR_16': 'exc', 'VAR_17': '_httpStatus', 'VAR_18': 'ostringstream', 'VAR_19': '_reason'}
/* Add your own BFS code into this file (or a copy of it). */ void run_mpi_bfs(const csr_graph* const g, int64_t root, int64_t* pred, int64_t* nvisited) { }
/* Add your own BFS code into this file (or a copy of it). */ void run_mpi_bfs(const csr_graph* const g, int64_t root, int64_t* pred, int64_t* nvisited) { }
0.320283
{}
/* * Compute the ffLDL tree of an auto-adjoint matrix G. The matrix * is provided as three polynomials (FFT representation). * * The "tree" array is filled with the computed tree, of size * (logn+1)*(2^logn) elements (see ffLDL_treesize()). * * Input arrays MUST NOT overlap, except possibly the three unmodified * arrays g00, g01 and g11. tmp[] should have room for at least three * polynomials of 2^logn elements each. */ static void ffLDL_fft(fpr *tree, const fpr *g00, const fpr *g01, const fpr *g11, unsigned logn, fpr *tmp) { size_t n, hn; fpr *d00, *d11; n = MKN(logn); if (n == 1) { tree[0] = g00[0]; return; } hn = n >> 1; d00 = tmp; d11 = tmp + n; tmp += n << 1; memcpy(d00, g00, n * sizeof * g00); PQCLEAN_FALCON512_CLEAN_poly_LDLmv_fft(d11, tree, g00, g01, g11, logn); PQCLEAN_FALCON512_CLEAN_poly_split_fft(tmp, tmp + hn, d00, logn); PQCLEAN_FALCON512_CLEAN_poly_split_fft(d00, d00 + hn, d11, logn); memcpy(d11, tmp, n * sizeof * tmp); ffLDL_fft_inner(tree + n, d11, d11 + hn, logn - 1, tmp); ffLDL_fft_inner(tree + n + ffLDL_treesize(logn - 1), d00, d00 + hn, logn - 1, tmp); }
/* * Compute the ffLDL tree of an auto-adjoint matrix G. The matrix * is provided as three polynomials (FFT representation). * * The "tree" array is filled with the computed tree, of size * (logn+1)*(2^logn) elements (see ffLDL_treesize()). * * Input arrays MUST NOT overlap, except possibly the three unmodified * arrays g00, g01 and g11. tmp[] should have room for at least three * polynomials of 2^logn elements each. */ static void FUNC_0(CLASS_0 *VAR_0, const CLASS_0 *VAR_1, const CLASS_0 *VAR_2, const CLASS_0 *VAR_3, unsigned VAR_4, CLASS_0 *VAR_5) { size_t VAR_6, VAR_7; CLASS_0 *VAR_8, *VAR_9; VAR_6 = FUNC_1(VAR_4); if (VAR_6 == 1) { VAR_0[0] = VAR_1[0]; return; } VAR_7 = VAR_6 >> 1; VAR_8 = VAR_5; VAR_9 = VAR_5 + VAR_6; VAR_5 += VAR_6 << 1; FUNC_2(VAR_8, VAR_1, VAR_6 * sizeof * VAR_1); FUNC_3(VAR_9, VAR_0, VAR_1, VAR_2, VAR_3, VAR_4); FUNC_4(VAR_5, VAR_5 + VAR_7, VAR_8, VAR_4); FUNC_4(VAR_8, VAR_8 + VAR_7, VAR_9, VAR_4); FUNC_2(VAR_9, VAR_5, VAR_6 * sizeof * VAR_5); FUNC_5(VAR_0 + VAR_6, VAR_9, VAR_9 + VAR_7, VAR_4 - 1, VAR_5); FUNC_5(VAR_0 + VAR_6 + FUNC_6(VAR_4 - 1), VAR_8, VAR_8 + VAR_7, VAR_4 - 1, VAR_5); }
0.998022
{'FUNC_0': 'ffLDL_fft', 'CLASS_0': 'fpr', 'VAR_0': 'tree', 'VAR_1': 'g00', 'VAR_2': 'g01', 'VAR_3': 'g11', 'VAR_4': 'logn', 'VAR_5': 'tmp', 'VAR_6': 'n', 'VAR_7': 'hn', 'VAR_8': 'd00', 'VAR_9': 'd11', 'FUNC_1': 'MKN', 'FUNC_2': 'memcpy', 'FUNC_3': 'PQCLEAN_FALCON512_CLEAN_poly_LDLmv_fft', 'FUNC_4': 'PQCLEAN_FALCON512_CLEAN_poly_split_fft', 'FUNC_5': 'ffLDL_fft_inner', 'FUNC_6': 'ffLDL_treesize'}
/* ################################################################### ** This component module is generated by Processor Expert. Do not modify it. ** Filename : McuHardFault.h ** Project : FRDM-K64F_Generator ** Processor : MK64FN1M0VLL12 ** Component : HardFault ** Version : Component 01.020, Driver 01.00, CPU db: 3.00.000 ** Compiler : GNU C Compiler ** Date/Time : 2018-07-03, 08:21, # CodeGen: 331 ** Abstract : ** Component to simplify hard faults for ARM/Kinetis. ** Settings : ** Component name : McuHardFault ** Contents : ** HardFaultHandler - void McuHardFault_HardFaultHandler(void); ** Deinit - void McuHardFault_Deinit(void); ** Init - void McuHardFault_Init(void); ** ** * Copyright (c) 2014-2017, <NAME> ** * Web: https://mcuoneclipse.com ** * SourceForge: https://sourceforge.net/projects/mcuoneclipse ** * Git: https://github.com/ErichStyger/McuOnEclipse_PEx ** * 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 McuHardFault.h ** @version 01.00 ** @brief ** Component to simplify hard faults for ARM/Kinetis. */ /*! ** @addtogroup McuHardFault_module McuHardFault module documentation ** @{ */ /* MODULE McuHardFault. */ #include "McuHardFault.h" /* ** =================================================================== ** Method : McuHardFault_HandlerC (component HardFault) ** ** Description : ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ /** * This is called from the HardFaultHandler with a pointer the Fault stack * as the parameter. We can then read the values from the stack and place them * into local variables for ease of reading. * We then read the various Fault Status and Address Registers to help decode * cause of the fault. * The function ends with a BKPT instruction to force control back into the debugger */ #pragma GCC diagnostic ignored "-Wunused-but-set-variable" void McuHardFault_HandlerC(uint32_t *hardfault_args) { /*lint -save -e550 Symbol not accessed. */ static volatile unsigned long stacked_r0; static volatile unsigned long stacked_r1; static volatile unsigned long stacked_r2; static volatile unsigned long stacked_r3; static volatile unsigned long stacked_r12; static volatile unsigned long stacked_lr; static volatile unsigned long stacked_pc; static volatile unsigned long stacked_psr; static volatile unsigned long _CFSR; static volatile unsigned long _HFSR; static volatile unsigned long _DFSR; static volatile unsigned long _AFSR; static volatile unsigned long _BFAR; static volatile unsigned long _MMAR; stacked_r0 = ((unsigned long)hardfault_args[0]); // http://www.asciiworld.com/-Smiley,20-.html stacked_r1 = ((unsigned long)hardfault_args[1]); // oooo$$$$$$$$$$$$oooo stacked_r2 = ((unsigned long)hardfault_args[2]); // oo$$$$$$$$$$$$$$$$$$$$$$$$o stacked_r3 = ((unsigned long)hardfault_args[3]); // oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$ stacked_r12 = ((unsigned long)hardfault_args[4]); // o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$ stacked_lr = ((unsigned long)hardfault_args[5]); // oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$ stacked_pc = ((unsigned long)hardfault_args[6]); // "$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$ stacked_psr = ((unsigned long)hardfault_args[7]); // $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$ // $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$ /* Configurable Fault Status Register */ // "$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$ /* Consists of MMSR, BFSR and UFSR */ // $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o _CFSR = (*((volatile unsigned long *)(0xE000ED28))); // o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o // $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o /* Hard Fault Status Register */ // o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$ _HFSR = (*((volatile unsigned long *)(0xE000ED2C))); // $$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$"""""""" // """" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$ /* Debug Fault Status Register */ // "$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$ _DFSR = (*((volatile unsigned long *)(0xE000ED30))); // $$$o "$$""$$$$$$"""" o$$$ // $$$$o o$$$" /* Auxiliary Fault Status Register */ // "$$$$o o$$$$$$o"$$$$o o$$$$ _AFSR = (*((volatile unsigned long *)(0xE000ED3C))); // "$$$$$oo ""$$$$o$$$$$o o$$$$"" // ""$$$$$oooo "$$$o$$$$$$$$$""" // ""$$$$$$$oo $$$$$$$$$$ /* Read the Fault Address Registers. */ // """"$$$$$$$$$$$ /* These may not contain valid values. */ // $$$$$$$$$$$$ /* Check BFARVALID/MMARVALID to see */ // $$$$$$$$$$" /* if they are valid values */ // "$$$"" /* MemManage Fault Address Register */ _MMAR = (*((volatile unsigned long *)(0xE000ED34))); /* Bus Fault Address Register */ _BFAR = (*((volatile unsigned long *)(0xE000ED38))); #if 0 /* experimental, seems not to work properly with GDB in KDS V3.2.0 */ #ifdef __GNUC__ /* might improve stack, see https://www.element14.com/community/message/199113/l/gdb-assisted-debugging-of-hard-faults#199113 */ __asm volatile ( "tst lr,#4 \n" /* check which stack pointer we are using */ "ite eq \n" "mrseq r0, msp \n" /* use MSP */ "mrsne r0, psp \n" /* use PSP */ "mov sp, r0 \n" /* set stack pointer so GDB shows proper stack frame */ ); #endif #endif __asm("BKPT #0\n") ; /* cause the debugger to stop */ /*lint -restore */ } /* ** =================================================================== ** Method : HardFaultHandler (component HardFault) ** ** Description : ** Hard Fault Handler ** Parameters : None ** Returns : Nothing ** =================================================================== */ #pragma GCC diagnostic ignored "-Wunused-but-set-variable" __attribute__((naked)) #if McuLib_CONFIG_SDK_VERSION_USED != McuLib_CONFIG_SDK_PROCESSOR_EXPERT void HardFault_Handler(void) #else void McuHardFault_HardFaultHandler(void) #endif { __asm volatile ( " movs r0,#4 \n" /* load bit mask into R0 */ " mov r1, lr \n" /* load link register into R1 */ " tst r0, r1 \n" /* compare with bitmask */ " beq _MSP \n" /* if bitmask is set: stack pointer is in PSP. Otherwise in MSP */ " mrs r0, psp \n" /* otherwise: stack pointer is in PSP */ " b _GetPC \n" /* go to part which loads the PC */ "_MSP: \n" /* stack pointer is in MSP register */ " mrs r0, msp \n" /* load stack pointer into R0 */ "_GetPC: \n" /* find out where the hard fault happened */ " ldr r1,[r0,#20] \n" /* load program counter into R1. R1 contains address of the next instruction where the hard fault happened */ " b McuHardFault_HandlerC \n" /* decode more information. R0 contains pointer to stack frame */ ); } /* ** =================================================================== ** Method : Deinit (component HardFault) ** ** Description : ** Deinitializes the driver ** Parameters : None ** Returns : Nothing ** =================================================================== */ void McuHardFault_Deinit(void) { #if McuHardFault_CONFIG_SETTING_DISABLE_WRITE_BUFFER #if McuLib_CONFIG_SDK_VERSION_USED == McuLib_CONFIG_SDK_PROCESSOR_EXPERT SCB_ACTLR &= ~(SCB_ACTLR_DISDEFWBUF_MASK); /* write buffer bit, see https://community.nxp.com/docs/DOC-103810 */ #elif McuLib_CONFIG_NXP_SDK_USED SCnSCB->ACTLR &= ~SCnSCB_ACTLR_DISDEFWBUF_Msk; #endif #endif } /* ** =================================================================== ** Method : Init (component HardFault) ** ** Description : ** Initializes the driver ** Parameters : None ** Returns : Nothing ** =================================================================== */ void McuHardFault_Init(void) { #if McuHardFault_CONFIG_SETTING_DISABLE_WRITE_BUFFER #if McuLib_CONFIG_SDK_VERSION_USED == McuLib_CONFIG_SDK_PROCESSOR_EXPERT SCB_ACTLR |= SCB_ACTLR_DISDEFWBUF_MASK; /* write buffer bit, see https://community.nxp.com/docs/DOC-103810 */ #elif McuLib_CONFIG_NXP_SDK_USED SCnSCB->ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk; #endif #endif } /* END McuHardFault. */ /*! ** @} */
/* ################################################################### ** This component module is generated by Processor Expert. Do not modify it. ** Filename : McuHardFault.h ** Project : FRDM-K64F_Generator ** Processor : MK64FN1M0VLL12 ** Component : HardFault ** Version : Component 01.020, Driver 01.00, CPU db: 3.00.000 ** Compiler : GNU C Compiler ** Date/Time : 2018-07-03, 08:21, # CodeGen: 331 ** Abstract : ** Component to simplify hard faults for ARM/Kinetis. ** Settings : ** Component name : McuHardFault ** Contents : ** HardFaultHandler - void McuHardFault_HardFaultHandler(void); ** Deinit - void McuHardFault_Deinit(void); ** Init - void McuHardFault_Init(void); ** ** * Copyright (c) 2014-2017, <NAME> ** * Web: https://mcuoneclipse.com ** * SourceForge: https://sourceforge.net/projects/mcuoneclipse ** * Git: https://github.com/ErichStyger/McuOnEclipse_PEx ** * 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 McuHardFault.h ** @version 01.00 ** @brief ** Component to simplify hard faults for ARM/Kinetis. */ /*! ** @addtogroup McuHardFault_module McuHardFault module documentation ** @{ */ /* MODULE McuHardFault. */ #include "McuHardFault.h" /* ** =================================================================== ** Method : McuHardFault_HandlerC (component HardFault) ** ** Description : ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ /** * This is called from the HardFaultHandler with a pointer the Fault stack * as the parameter. We can then read the values from the stack and place them * into local variables for ease of reading. * We then read the various Fault Status and Address Registers to help decode * cause of the fault. * The function ends with a BKPT instruction to force control back into the debugger */ #pragma GCC diagnostic ignored "-Wunused-but-set-variable" void McuHardFault_HandlerC(uint32_t *hardfault_args) { /*lint -save -e550 Symbol not accessed. */ static volatile unsigned long VAR_0; static volatile unsigned long stacked_r1; static volatile unsigned long stacked_r2; static volatile unsigned long stacked_r3; static volatile unsigned long stacked_r12; static volatile unsigned long stacked_lr; static volatile unsigned long stacked_pc; static volatile unsigned long VAR_1; static volatile unsigned long _CFSR; static volatile unsigned long _HFSR; static volatile unsigned long VAR_2; static volatile unsigned long _AFSR; static volatile unsigned long _BFAR; static volatile unsigned long _MMAR; VAR_0 = ((unsigned long)hardfault_args[0]); // http://www.asciiworld.com/-Smiley,20-.html stacked_r1 = ((unsigned long)hardfault_args[1]); // oooo$$$$$$$$$$$$oooo stacked_r2 = ((unsigned long)hardfault_args[2]); // oo$$$$$$$$$$$$$$$$$$$$$$$$o stacked_r3 = ((unsigned long)hardfault_args[3]); // oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$ stacked_r12 = ((unsigned long)hardfault_args[4]); // o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$ stacked_lr = ((unsigned long)hardfault_args[5]); // oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$ stacked_pc = ((unsigned long)hardfault_args[6]); // "$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$ VAR_1 = ((unsigned long)hardfault_args[7]); // $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$ // $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$ /* Configurable Fault Status Register */ // "$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$ /* Consists of MMSR, BFSR and UFSR */ // $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o _CFSR = (*((volatile unsigned long *)(0xE000ED28))); // o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o // $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o /* Hard Fault Status Register */ // o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$ _HFSR = (*((volatile unsigned long *)(0xE000ED2C))); // $$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$"""""""" // """" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$ /* Debug Fault Status Register */ // "$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$ VAR_2 = (*((volatile unsigned long *)(0xE000ED30))); // $$$o "$$""$$$$$$"""" o$$$ // $$$$o o$$$" /* Auxiliary Fault Status Register */ // "$$$$o o$$$$$$o"$$$$o o$$$$ _AFSR = (*((volatile unsigned long *)(0xE000ED3C))); // "$$$$$oo ""$$$$o$$$$$o o$$$$"" // ""$$$$$oooo "$$$o$$$$$$$$$""" // ""$$$$$$$oo $$$$$$$$$$ /* Read the Fault Address Registers. */ // """"$$$$$$$$$$$ /* These may not contain valid values. */ // $$$$$$$$$$$$ /* Check BFARVALID/MMARVALID to see */ // $$$$$$$$$$" /* if they are valid values */ // "$$$"" /* MemManage Fault Address Register */ _MMAR = (*((volatile unsigned long *)(0xE000ED34))); /* Bus Fault Address Register */ _BFAR = (*((volatile unsigned long *)(0xE000ED38))); #if 0 /* experimental, seems not to work properly with GDB in KDS V3.2.0 */ #ifdef __GNUC__ /* might improve stack, see https://www.element14.com/community/message/199113/l/gdb-assisted-debugging-of-hard-faults#199113 */ CLASS_0 volatile ( "tst lr,#4 \n" /* check which stack pointer we are using */ "ite eq \n" "mrseq r0, msp \n" /* use MSP */ "mrsne r0, psp \n" /* use PSP */ "mov sp, r0 \n" /* set stack pointer so GDB shows proper stack frame */ ); #endif #endif FUNC_0("BKPT #0\n") ; /* cause the debugger to stop */ /*lint -restore */ } /* ** =================================================================== ** Method : HardFaultHandler (component HardFault) ** ** Description : ** Hard Fault Handler ** Parameters : None ** Returns : Nothing ** =================================================================== */ #pragma GCC diagnostic ignored "-Wunused-but-set-variable" __attribute__((naked)) #if McuLib_CONFIG_SDK_VERSION_USED != McuLib_CONFIG_SDK_PROCESSOR_EXPERT void HardFault_Handler(void) #else void McuHardFault_HardFaultHandler(void) #endif { CLASS_0 volatile ( " movs r0,#4 \n" /* load bit mask into R0 */ " mov r1, lr \n" /* load link register into R1 */ " tst r0, r1 \n" /* compare with bitmask */ " beq _MSP \n" /* if bitmask is set: stack pointer is in PSP. Otherwise in MSP */ " mrs r0, psp \n" /* otherwise: stack pointer is in PSP */ " b _GetPC \n" /* go to part which loads the PC */ "_MSP: \n" /* stack pointer is in MSP register */ " mrs r0, msp \n" /* load stack pointer into R0 */ "_GetPC: \n" /* find out where the hard fault happened */ " ldr r1,[r0,#20] \n" /* load program counter into R1. R1 contains address of the next instruction where the hard fault happened */ " b McuHardFault_HandlerC \n" /* decode more information. R0 contains pointer to stack frame */ ); } /* ** =================================================================== ** Method : Deinit (component HardFault) ** ** Description : ** Deinitializes the driver ** Parameters : None ** Returns : Nothing ** =================================================================== */ void McuHardFault_Deinit(void) { #if McuHardFault_CONFIG_SETTING_DISABLE_WRITE_BUFFER #if McuLib_CONFIG_SDK_VERSION_USED == McuLib_CONFIG_SDK_PROCESSOR_EXPERT VAR_3 &= ~(SCB_ACTLR_DISDEFWBUF_MASK); /* write buffer bit, see https://community.nxp.com/docs/DOC-103810 */ #elif VAR_4 SCnSCB->ACTLR &= ~SCnSCB_ACTLR_DISDEFWBUF_Msk; #endif #endif } /* ** =================================================================== ** Method : Init (component HardFault) ** ** Description : ** Initializes the driver ** Parameters : None ** Returns : Nothing ** =================================================================== */ void McuHardFault_Init(void) { #if McuHardFault_CONFIG_SETTING_DISABLE_WRITE_BUFFER #if McuLib_CONFIG_SDK_VERSION_USED == McuLib_CONFIG_SDK_PROCESSOR_EXPERT VAR_3 |= SCB_ACTLR_DISDEFWBUF_MASK; /* write buffer bit, see https://community.nxp.com/docs/DOC-103810 */ #elif VAR_4 SCnSCB->ACTLR |= SCnSCB_ACTLR_DISDEFWBUF_Msk; #endif #endif } /* END McuHardFault. */ /*! ** @} */
0.235789
{'VAR_0': 'stacked_r0', 'VAR_1': 'stacked_psr', 'VAR_2': '_DFSR', 'CLASS_0': '__asm', 'FUNC_0': '__asm', 'VAR_3': 'SCB_ACTLR', 'VAR_4': 'McuLib_CONFIG_NXP_SDK_USED'}
// // Created by Develop on 11/5/15. // #ifndef LEETCODE_TREE_NODE_H #define LEETCODE_TREE_NODE_H #include <stddef.h> class TreeNode { public: int val; TreeNode *left, *right; TreeNode(int val){ this->val = val; this->left = this->right = NULL; } }; #endif //LEETCODE_TREE_NODE_H
// // Created by Develop on 11/5/15. // #ifndef LEETCODE_TREE_NODE_H #define LEETCODE_TREE_NODE_H #include <stddef.h> class TreeNode { public: int val; TreeNode *left, *right; TreeNode(int val){ this->val = val; this->left = this->right = NULL; } }; #endif //LEETCODE_TREE_NODE_H
0.009834
{}
// // NSString+Extension.h // NSString+Extension // // Created by peng on 2017/6/6. // Copyright © 2017年 peng. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface NSString (Extension) @end
// // NSString+Extension.h // NSString+Extension // // Created by peng on 2017/6/6. // Copyright © 2017年 peng. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface FUNC_0 (VAR_0) @VAR_1
0.889752
{'FUNC_0': 'NSString', 'VAR_0': 'Extension', 'VAR_1': 'end'}
/* This will set the direction in which the face is used by the * region. It will also attach the region on the appropriate side of * the face to be consistent - if there is already a region on that * side, it will overwrite it */ int MR_Set_FaceDir_i_FNR3R4(MRegion_ptr r, int i, int dir) { int j, k; MRegion_Adj_FN *adj; adj = (MRegion_Adj_FN *) r->adj; if (i >= MAXPF3) { MSTK_Report("MR_FaceDir_i","Not that many faces in region",MSTK_ERROR); return 0; } j = (int) i/(8*sizeof(unsigned int)); k = i%(8*sizeof(unsigned int)); adj->fdirs[j] = adj->fdirs[j] & ~(1<<k); adj->fdirs[j] = adj->fdirs[j] | (dir<<k); MFace_ptr f = List_Entry(adj->rfaces, i); List_ptr fregs = MF_Regions(f); if (fregs) { if (List_Contains(fregs, r)) MF_Rem_Region(f, r); List_Delete(fregs); } MF_Add_Region(f, r, !dir); return 1; }
/* This will set the direction in which the face is used by the * region. It will also attach the region on the appropriate side of * the face to be consistent - if there is already a region on that * side, it will overwrite it */ int MR_Set_FaceDir_i_FNR3R4(MRegion_ptr r, int VAR_0, int dir) { int j, VAR_1; MRegion_Adj_FN *adj; adj = (MRegion_Adj_FN *) r->adj; if (VAR_0 >= VAR_2) { MSTK_Report("MR_FaceDir_i","Not that many faces in region",VAR_3); return 0; } j = (int) VAR_0/(8*sizeof(unsigned int)); VAR_1 = VAR_0%(8*sizeof(unsigned int)); adj->VAR_4[j] = adj->VAR_4[j] & ~(1<<VAR_1); adj->VAR_4[j] = adj->VAR_4[j] | (dir<<VAR_1); MFace_ptr f = List_Entry(adj->rfaces, VAR_0); List_ptr fregs = MF_Regions(f); if (fregs) { if (FUNC_0(fregs, r)) MF_Rem_Region(f, r); List_Delete(fregs); } MF_Add_Region(f, r, !dir); return 1; }
0.316122
{'VAR_0': 'i', 'VAR_1': 'k', 'VAR_2': 'MAXPF3', 'VAR_3': 'MSTK_ERROR', 'VAR_4': 'fdirs', 'FUNC_0': 'List_Contains'}
#pragma once #include "ReferentNode.h" namespace FastRDF { class Dataset; class Uri; class UriNode : public ReferentNode { friend class Dataset; public: UriNode(); const Uri& getUri() const; UriNode(const UriNode& other); UriNode& operator=(const UriNode& other); private: UriNode(Dataset* dataset, NodeId nodeId); }; }
#pragma once #include "IMPORT_0" namespace VAR_0 { CLASS_0 VAR_2; CLASS_0 VAR_3; CLASS_0 UriNode : VAR_4 VAR_5 { CLASS_3 VAR_1 VAR_2; public: UriNode(); const CLASS_2& FUNC_0() const; UriNode(const UriNode& VAR_6); UriNode& VAR_7=(const UriNode& VAR_6); CLASS_4: UriNode(CLASS_1* VAR_8, CLASS_5 VAR_9); }; }
0.899787
{'IMPORT_0': 'ReferentNode.h', 'VAR_0': 'FastRDF', 'CLASS_0': 'class', 'VAR_1': 'class', 'VAR_2': 'Dataset', 'CLASS_1': 'Dataset', 'VAR_3': 'Uri', 'CLASS_2': 'Uri', 'VAR_4': 'public', 'VAR_5': 'ReferentNode', 'CLASS_3': 'friend', 'FUNC_0': 'getUri', 'VAR_6': 'other', 'VAR_7': 'operator', 'CLASS_4': 'private', 'VAR_8': 'dataset', 'CLASS_5': 'NodeId', 'VAR_9': 'nodeId'}
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI */ @interface CUIPSDLayerGroupEnd : CUIPSDLayer @end
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI */ @CLASS_0 CUIPSDLayerGroupEnd : CUIPSDLayer @end
0.150122
{'CLASS_0': 'interface'}
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * https://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 <avro/platform.h> #include <stdlib.h> #include "avro/basics.h" #include "avro/io.h" #include "avro/value.h" #include "avro_private.h" #include "encoding.h" static int write_array_value(avro_writer_t writer, avro_value_t *src) { int rval; size_t element_count; check(rval, avro_value_get_size(src, &element_count)); if (element_count > 0) { check_prefix(rval, avro_binary_encoding.write_long (writer, element_count), "Cannot write array block count: "); size_t i; for (i = 0; i < element_count; i++) { avro_value_t child; check(rval, avro_value_get_by_index(src, i, &child, NULL)); check(rval, avro_value_write(writer, &child)); } } check_prefix(rval, avro_binary_encoding.write_long(writer, 0), "Cannot write array block count: "); return 0; } static int write_map_value(avro_writer_t writer, avro_value_t *src) { int rval; size_t element_count; check(rval, avro_value_get_size(src, &element_count)); if (element_count > 0) { check_prefix(rval, avro_binary_encoding.write_long (writer, element_count), "Cannot write map block count: "); size_t i; for (i = 0; i < element_count; i++) { avro_value_t child; const char *key; check(rval, avro_value_get_by_index(src, i, &child, &key)); check(rval, avro_binary_encoding.write_string(writer, key)); check(rval, avro_value_write(writer, &child)); } } check_prefix(rval, avro_binary_encoding.write_long(writer, 0), "Cannot write map block count: "); return 0; } static int write_record_value(avro_writer_t writer, avro_value_t *src) { int rval; size_t field_count; check(rval, avro_value_get_size(src, &field_count)); size_t i; for (i = 0; i < field_count; i++) { avro_value_t field; check(rval, avro_value_get_by_index(src, i, &field, NULL)); check(rval, avro_value_write(writer, &field)); } return 0; } static int write_union_value(avro_writer_t writer, avro_value_t *src) { int rval; int discriminant; avro_value_t branch; check(rval, avro_value_get_discriminant(src, &discriminant)); check(rval, avro_value_get_current_branch(src, &branch)); check(rval, avro_binary_encoding.write_long(writer, discriminant)); return avro_value_write(writer, &branch); } int avro_value_write(avro_writer_t writer, avro_value_t *src) { int rval; switch (avro_value_get_type(src)) { case AVRO_BOOLEAN: { int val; check(rval, avro_value_get_boolean(src, &val)); return avro_binary_encoding.write_boolean(writer, val); } case AVRO_BYTES: { const void *buf; size_t size; check(rval, avro_value_get_bytes(src, &buf, &size)); return avro_binary_encoding.write_bytes(writer, (const char *) buf, size); } case AVRO_DOUBLE: { double val; check(rval, avro_value_get_double(src, &val)); return avro_binary_encoding.write_double(writer, val); } case AVRO_FLOAT: { float val; check(rval, avro_value_get_float(src, &val)); return avro_binary_encoding.write_float(writer, val); } case AVRO_INT32: { int32_t val; check(rval, avro_value_get_int(src, &val)); return avro_binary_encoding.write_long(writer, val); } case AVRO_INT64: { int64_t val; check(rval, avro_value_get_long(src, &val)); return avro_binary_encoding.write_long(writer, val); } case AVRO_NULL: { check(rval, avro_value_get_null(src)); return avro_binary_encoding.write_null(writer); } case AVRO_STRING: { const char *str; size_t size; check(rval, avro_value_get_string(src, &str, &size)); return avro_binary_encoding.write_bytes(writer, str, size-1); } case AVRO_ARRAY: return write_array_value(writer, src); case AVRO_ENUM: { int val; check(rval, avro_value_get_enum(src, &val)); return avro_binary_encoding.write_long(writer, val); } case AVRO_FIXED: { const void *buf; size_t size; check(rval, avro_value_get_fixed(src, &buf, &size)); return avro_write(writer, (void *) buf, size); } case AVRO_MAP: return write_map_value(writer, src); case AVRO_RECORD: return write_record_value(writer, src); case AVRO_UNION: return write_union_value(writer, src); default: { avro_set_error("Unknown schema type"); return EINVAL; } } return 0; }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * https://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 <IMPORT_0> #include <stdlib.h> #include "avro/basics.h" #include "avro/io.h" #include "avro/value.h" #include "avro_private.h" #include "encoding.h" static int write_array_value(avro_writer_t writer, avro_value_t *VAR_0) { int VAR_1; size_t element_count; FUNC_0(VAR_1, FUNC_1(VAR_0, &element_count)); if (element_count > 0) { check_prefix(VAR_1, VAR_2.write_long (writer, element_count), "Cannot write array block count: "); size_t i; for (i = 0; i < element_count; i++) { avro_value_t child; FUNC_0(VAR_1, avro_value_get_by_index(VAR_0, i, &child, NULL)); FUNC_0(VAR_1, avro_value_write(writer, &child)); } } check_prefix(VAR_1, VAR_2.write_long(writer, 0), "Cannot write array block count: "); return 0; } static int FUNC_2(avro_writer_t writer, avro_value_t *VAR_0) { int VAR_1; size_t element_count; FUNC_0(VAR_1, FUNC_1(VAR_0, &element_count)); if (element_count > 0) { check_prefix(VAR_1, VAR_2.write_long (writer, element_count), "Cannot write map block count: "); size_t i; for (i = 0; i < element_count; i++) { avro_value_t child; const char *key; FUNC_0(VAR_1, avro_value_get_by_index(VAR_0, i, &child, &key)); FUNC_0(VAR_1, VAR_2.write_string(writer, key)); FUNC_0(VAR_1, avro_value_write(writer, &child)); } } check_prefix(VAR_1, VAR_2.write_long(writer, 0), "Cannot write map block count: "); return 0; } static int write_record_value(avro_writer_t writer, avro_value_t *VAR_0) { int VAR_1; size_t field_count; FUNC_0(VAR_1, FUNC_1(VAR_0, &field_count)); size_t i; for (i = 0; i < field_count; i++) { avro_value_t VAR_3; FUNC_0(VAR_1, avro_value_get_by_index(VAR_0, i, &VAR_3, NULL)); FUNC_0(VAR_1, avro_value_write(writer, &VAR_3)); } return 0; } static int FUNC_3(avro_writer_t writer, avro_value_t *VAR_0) { int VAR_1; int discriminant; avro_value_t VAR_4; FUNC_0(VAR_1, FUNC_4(VAR_0, &discriminant)); FUNC_0(VAR_1, avro_value_get_current_branch(VAR_0, &VAR_4)); FUNC_0(VAR_1, VAR_2.write_long(writer, discriminant)); return avro_value_write(writer, &VAR_4); } int avro_value_write(avro_writer_t writer, avro_value_t *VAR_0) { int VAR_1; switch (avro_value_get_type(VAR_0)) { case VAR_5: { int val; FUNC_0(VAR_1, FUNC_5(VAR_0, &val)); return VAR_2.write_boolean(writer, val); } case AVRO_BYTES: { const void *buf; size_t size; FUNC_0(VAR_1, avro_value_get_bytes(VAR_0, &buf, &size)); return VAR_2.FUNC_6(writer, (const char *) buf, size); } case AVRO_DOUBLE: { double val; FUNC_0(VAR_1, avro_value_get_double(VAR_0, &val)); return VAR_2.FUNC_7(writer, val); } case AVRO_FLOAT: { float val; FUNC_0(VAR_1, FUNC_8(VAR_0, &val)); return VAR_2.write_float(writer, val); } case VAR_6: { int32_t val; FUNC_0(VAR_1, FUNC_9(VAR_0, &val)); return VAR_2.write_long(writer, val); } case VAR_7: { int64_t val; FUNC_0(VAR_1, FUNC_10(VAR_0, &val)); return VAR_2.write_long(writer, val); } case AVRO_NULL: { FUNC_0(VAR_1, FUNC_11(VAR_0)); return VAR_2.FUNC_12(writer); } case AVRO_STRING: { const char *str; size_t size; FUNC_0(VAR_1, avro_value_get_string(VAR_0, &str, &size)); return VAR_2.FUNC_6(writer, str, size-1); } case VAR_8: return write_array_value(writer, VAR_0); case VAR_9: { int val; FUNC_0(VAR_1, avro_value_get_enum(VAR_0, &val)); return VAR_2.write_long(writer, val); } case VAR_10: { const void *buf; size_t size; FUNC_0(VAR_1, avro_value_get_fixed(VAR_0, &buf, &size)); return FUNC_13(writer, (void *) buf, size); } case VAR_11: return FUNC_2(writer, VAR_0); case AVRO_RECORD: return write_record_value(writer, VAR_0); case AVRO_UNION: return FUNC_3(writer, VAR_0); default: { FUNC_14("Unknown schema type"); return VAR_12; } } return 0; }
0.249655
{'IMPORT_0': 'avro/platform.h', 'VAR_0': 'src', 'VAR_1': 'rval', 'FUNC_0': 'check', 'FUNC_1': 'avro_value_get_size', 'VAR_2': 'avro_binary_encoding', 'FUNC_2': 'write_map_value', 'VAR_3': 'field', 'FUNC_3': 'write_union_value', 'VAR_4': 'branch', 'FUNC_4': 'avro_value_get_discriminant', 'VAR_5': 'AVRO_BOOLEAN', 'FUNC_5': 'avro_value_get_boolean', 'FUNC_6': 'write_bytes', 'FUNC_7': 'write_double', 'FUNC_8': 'avro_value_get_float', 'VAR_6': 'AVRO_INT32', 'FUNC_9': 'avro_value_get_int', 'VAR_7': 'AVRO_INT64', 'FUNC_10': 'avro_value_get_long', 'FUNC_11': 'avro_value_get_null', 'FUNC_12': 'write_null', 'VAR_8': 'AVRO_ARRAY', 'VAR_9': 'AVRO_ENUM', 'VAR_10': 'AVRO_FIXED', 'FUNC_13': 'avro_write', 'VAR_11': 'AVRO_MAP', 'FUNC_14': 'avro_set_error', 'VAR_12': 'EINVAL'}
#ifndef _ALMC_BACK_END_STACK_FRAME_H #define _ALMC_BACK_END_STACK_FRAME_H #include "regtable.h" #include "..\..\front-end\ast\ast.h" typedef struct x86_AsmCodeProc AsmCodeProc; typedef struct x86_AsmCodeProtoProc AsmCodeProtoProc; typedef enum x86_StackFrameEntityKind { STACK_FRAME_ENTITY_LOCAL, STACK_FRAME_ENTITY_ARGUMENT, } StackFrameEntityKind; typedef struct x86_StackFrameEntity { Type* type; int32_t offset; char* definition; StackFrameEntityKind kind; } StackFrameEntity; typedef struct x86_StackFrame { struct _stack_frame_data { StackFrameEntity** entities; int32_t required_space_for_locals; int32_t required_space_for_arguments; }; struct _stack_frame_references { // the reference to procedure which body // is described by this instance of StackFrame AsmCodeProc* of_proc; struct _stack_frame_label_references { // describes the label on which program // should jmp if break, continue or return statement met char* loop_break_label; char* loop_continue_label; char* proc_return_label; }; // needed to determine the need of jump to // origin ret by proc_return_label bool jump_to_ret; }; } StackFrame; StackFrame* stack_frame_new(FuncDecl* func); StackFrameEntity* stack_frame_entity_new(Type* type, uint32_t offset, char* definition, StackFrameEntityKind kind); StackFrameEntity* get_entity_by_name(const char* name, StackFrame* frame); StackFrameEntity* add_local(VarDecl* local, StackFrame* frame); StackFrameEntity* add_argument(TypeVar* argument, StackFrame* frame); #endif // _ALMC_BACK_END_STACK_FRAME_H
#ifndef VAR_0 #define VAR_0 #include "IMPORT_0" #include "..\..\front-end\ast\ast.h" typedef struct CLASS_0 ID_0; typedef struct CLASS_2 AsmCodeProtoProc; typedef enum CLASS_3 { STACK_FRAME_ENTITY_LOCAL, VAR_1, } ID_1; typedef struct x86_StackFrameEntity { Type* type; int32_t VAR_2; char* VAR_3; CLASS_4 VAR_4; } StackFrameEntity; typedef struct x86_StackFrame { struct _stack_frame_data { StackFrameEntity** VAR_5; int32_t VAR_6; int32_t VAR_7; }; struct _stack_frame_references { // the reference to procedure which body // is described by this instance of StackFrame CLASS_1* VAR_8; struct _stack_frame_label_references { // describes the label on which program // should jmp if break, continue or return statement met char* VAR_9; char* loop_continue_label; char* VAR_10; }; // needed to determine the need of jump to // origin ret by proc_return_label bool jump_to_ret; }; } StackFrame; StackFrame* stack_frame_new(CLASS_5* VAR_11); StackFrameEntity* stack_frame_entity_new(Type* type, uint32_t VAR_2, char* VAR_3, CLASS_4 VAR_4); StackFrameEntity* FUNC_0(const char* VAR_12, StackFrame* VAR_13); StackFrameEntity* add_local(VarDecl* VAR_14, StackFrame* VAR_13); StackFrameEntity* add_argument(CLASS_6* argument, StackFrame* VAR_13); #endif // _ALMC_BACK_END_STACK_FRAME_H
0.602212
{'VAR_0': '_ALMC_BACK_END_STACK_FRAME_H', 'IMPORT_0': 'regtable.h', 'CLASS_0': 'x86_AsmCodeProc', 'ID_0': 'AsmCodeProc', 'CLASS_1': 'AsmCodeProc', 'CLASS_2': 'x86_AsmCodeProtoProc', 'CLASS_3': 'x86_StackFrameEntityKind', 'VAR_1': 'STACK_FRAME_ENTITY_ARGUMENT', 'ID_1': 'StackFrameEntityKind', 'CLASS_4': 'StackFrameEntityKind', 'VAR_2': 'offset', 'VAR_3': 'definition', 'VAR_4': 'kind', 'VAR_5': 'entities', 'VAR_6': 'required_space_for_locals', 'VAR_7': 'required_space_for_arguments', 'VAR_8': 'of_proc', 'VAR_9': 'loop_break_label', 'VAR_10': 'proc_return_label', 'CLASS_5': 'FuncDecl', 'VAR_11': 'func', 'FUNC_0': 'get_entity_by_name', 'VAR_12': 'name', 'VAR_13': 'frame', 'VAR_14': 'local', 'CLASS_6': 'TypeVar'}
// // TSWindowMonitorController.h // ncMeta // // Created by <NAME> on 14.08.12. // Copyright (c) 2012 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> @interface TSWindowMonitorController : NSObject + (TSWindowMonitorController *)sharedController; - (void) startMonitoring; - (void) stopMonitoring; @property (assign) id delegate; @property (strong) NSTimer *timer; @property (assign) BOOL lastVisibleState; @end
// // TSWindowMonitorController.h // ncMeta // // Created by <NAME> on 14.08.12. // Copyright (c) 2012 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> @interface VAR_0 : VAR_1 + (CLASS_0 *)VAR_2; - (void) startMonitoring; - (void) stopMonitoring; @property (assign) VAR_3 VAR_4; @property (ID_0) VAR_5 *VAR_6; @property (assign) BOOL VAR_7; @CLASS_1
0.677325
{'VAR_0': 'TSWindowMonitorController', 'CLASS_0': 'TSWindowMonitorController', 'VAR_1': 'NSObject', 'VAR_2': 'sharedController', 'VAR_3': 'id', 'VAR_4': 'delegate', 'ID_0': 'strong', 'VAR_5': 'NSTimer', 'VAR_6': 'timer', 'VAR_7': 'lastVisibleState', 'CLASS_1': 'end'}
/* * This header is generated by classdump-dyld 1.0 * on Saturday, June 1, 2019 at 6:50:57 PM Mountain Standard Time * Operating System: Version 12.1.1 (Build 16C5050a) * Image Source: /System/Library/PrivateFrameworks/Email.framework/Email * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. */ @protocol OS_dispatch_queue; @class NSMutableDictionary, EAEmailAddressSet, CNContactStore, NSUbiquitousKeyValueStore, NSObject; @interface EMVIPManager : NSObject { NSMutableDictionary* _vipsByIdentifier; EAEmailAddressSet* _cachedEmailAddresses; CNContactStore* _contactStore; NSUbiquitousKeyValueStore* _keyValueStore; NSObject*<OS_dispatch_queue> _operationQueue; } @property (nonatomic,readonly) CNContactStore * contactStore; //@synthesize contactStore=_contactStore - In the implementation block @property (nonatomic,readonly) NSUbiquitousKeyValueStore * keyValueStore; //@synthesize keyValueStore=_keyValueStore - In the implementation block @property (nonatomic,readonly) NSObject*<OS_dispatch_queue> operationQueue; //@synthesize operationQueue=_operationQueue - In the implementation block +(id)_log; +(id)_contactDescriptors; +(id)plistURL; +(void)initialize; -(CNContactStore *)contactStore; -(NSUbiquitousKeyValueStore *)keyValueStore; -(void)_vipManagerCommonInitWithKeyValueStore:(id)arg1 contactStore:(id)arg2 ; -(void)_loadVIPs; -(void)_updateLocalWithCloud:(id)arg1 refresh:(BOOL)arg2 ; -(void)_keyValueStoreChanged:(id)arg1 ; -(id)_allVIPEmailAddresses; -(id)_contactForName:(id)arg1 emailAddresses:(id)arg2 ; -(BOOL)_isVIPForContact:(id)arg1 orAddresses:(id)arg2 ; -(void)_saveVIPs; -(void)_removeVIPsWithIdentifiers:(id)arg1 ; -(id)_vipsDictionary; -(void)_saveVIPsLocally; -(void)_updateCloudWithLocal; -(id)_cloudKeyForIdentifier:(id)arg1 ; -(id)_validatedCloudVIPFromStore:(id)arg1 withCloudKey:(id)arg2 ; -(void)_mergeVIPs; -(id)_contactFromContacts:(id)arg1 matchingMostAddresses:(id)arg2 ; -(id)vipWithIdentifier:(id)arg1 ; -(void)saveVIPs:(id)arg1 ; -(void)removeVIPsWithIdentifiers:(id)arg1 ; -(void)removeVIPsWithEmailAddresses:(id)arg1 ; -(id)allVIPs; -(id)initWithSyncEnabled:(BOOL)arg1 ; -(id)allVIPEmailAddresses; -(id)init; -(void)dealloc; -(NSObject*<OS_dispatch_queue>)operationQueue; @end
/* * This header is generated by classdump-dyld 1.0 * on Saturday, June 1, 2019 at 6:50:57 PM Mountain Standard Time * Operating System: Version 12.1.1 (Build 16C5050a) * Image Source: /System/Library/PrivateFrameworks/Email.framework/Email * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. */ @protocol OS_dispatch_queue; @class NSMutableDictionary, EAEmailAddressSet, CNContactStore, NSUbiquitousKeyValueStore, NSObject; @interface VAR_0 : NSObject { NSMutableDictionary* _vipsByIdentifier; EAEmailAddressSet* _cachedEmailAddresses; CNContactStore* _contactStore; NSUbiquitousKeyValueStore* VAR_1; NSObject*<OS_dispatch_queue> VAR_2; } @property (nonatomic,VAR_3) CNContactStore * contactStore; //@synthesize contactStore=_contactStore - In the implementation block @property (nonatomic,VAR_3) NSUbiquitousKeyValueStore * VAR_4; //@synthesize keyValueStore=_keyValueStore - In the implementation block @property (nonatomic,VAR_3) NSObject*<OS_dispatch_queue> operationQueue; //@synthesize operationQueue=_operationQueue - In the implementation block +(id)VAR_5; +(id)_contactDescriptors; +(id)plistURL; +(void)initialize; -(CNContactStore *)contactStore; -(NSUbiquitousKeyValueStore *)VAR_4; -(void)_vipManagerCommonInitWithKeyValueStore:(id)CLASS_0 contactStore:(id)arg2 ; -(void)VAR_7; -(void)_updateLocalWithCloud:(id)CLASS_0 refresh:(VAR_8)arg2 ; -(void)_keyValueStoreChanged:(id)VAR_6 ; -(id)VAR_9; -(id)_contactForName:(id)CLASS_0 emailAddresses:(id)arg2 ; -(ID_0)_isVIPForContact:(id)CLASS_0 VAR_10:(id)arg2 ; -(void)_saveVIPs; -(void)_removeVIPsWithIdentifiers:(id)VAR_6 ; -(id)_vipsDictionary; -(void)_saveVIPsLocally; -(void)VAR_11; -(id)_cloudKeyForIdentifier:(id)VAR_6 ; -(id)_validatedCloudVIPFromStore:(id)CLASS_0 withCloudKey:(id)arg2 ; -(void)_mergeVIPs; -(id)_contactFromContacts:(id)CLASS_0 matchingMostAddresses:(id)arg2 ; -(id)vipWithIdentifier:(id)VAR_6 ; -(void)saveVIPs:(id)VAR_6 ; -(void)removeVIPsWithIdentifiers:(id)VAR_6 ; -(void)VAR_12:(id)VAR_6 ; -(id)allVIPs; -(id)initWithSyncEnabled:(VAR_8)VAR_6 ; -(id)allVIPEmailAddresses; -(id)init; -(void)VAR_13; -(NSObject*<OS_dispatch_queue>)operationQueue; @end
0.28447
{'VAR_0': 'EMVIPManager', 'VAR_1': '_keyValueStore', 'VAR_2': '_operationQueue', 'VAR_3': 'readonly', 'VAR_4': 'keyValueStore', 'VAR_5': '_log', 'CLASS_0': 'arg1', 'VAR_6': 'arg1', 'VAR_7': '_loadVIPs', 'VAR_8': 'BOOL', 'ID_0': 'BOOL', 'VAR_9': '_allVIPEmailAddresses', 'VAR_10': 'orAddresses', 'VAR_11': '_updateCloudWithLocal', 'VAR_12': 'removeVIPsWithEmailAddresses', 'VAR_13': 'dealloc'}
// SPDX-License-Identifier: MPL-2.0 // Copyright (c) <NAME> <<EMAIL>> #pragma once #include <xcb/render.h> #include <xcb/xcb_image.h> #include <stdbool.h> #include "backend.h" #include "config.h" #include "region.h" typedef struct session session_t; typedef struct win win; typedef struct conv conv; typedef struct backend_base backend_t; struct backend_operations; struct dual_kawase_params { /// Number of downsample passes int iterations; /// Pixel offset for down- and upsample float offset; /// Save area around blur target (@ref resize_width, @ref resize_height) int expand; }; struct backend_image_inner_base { int refcount; bool has_alpha; }; struct backend_image { // Backend dependent inner image data struct backend_image_inner_base *inner; double opacity; double dim; double max_brightness; double corner_radius; // Effective size of the image int ewidth, eheight; bool color_inverted; int border_width; }; bool build_shadow(xcb_connection_t *, xcb_drawable_t, double opacity, int width, int height, const conv *kernel, xcb_render_picture_t shadow_pixel, xcb_pixmap_t *pixmap, xcb_render_picture_t *pict); xcb_render_picture_t solid_picture(xcb_connection_t *, xcb_drawable_t, bool argb, double a, double r, double g, double b); xcb_image_t * make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height); /// The default implementation of `is_win_transparent`, it simply looks at win::mode. So /// this is not suitable for backends that alter the content of windows bool default_is_win_transparent(void *, win *, void *); /// The default implementation of `is_frame_transparent`, it uses win::frame_opacity. Same /// caveat as `default_is_win_transparent` applies. bool default_is_frame_transparent(void *, win *, void *); void * default_backend_render_shadow(backend_t *backend_data, int width, int height, const conv *kernel, double r, double g, double b, double a); void init_backend_base(struct backend_base *base, session_t *ps); struct conv **generate_blur_kernel(enum blur_method method, void *args, int *kernel_count); struct dual_kawase_params *generate_dual_kawase_params(void *args); void *default_clone_image(backend_t *base, const void *image_data, const region_t *reg); bool default_is_image_transparent(backend_t *base attr_unused, void *image_data); bool default_set_image_property(backend_t *base attr_unused, enum image_properties op, void *image_data, void *arg); struct backend_image *default_new_backend_image(int w, int h);
// SPDX-License-Identifier: MPL-2.0 // Copyright (c) <NAME> <<EMAIL>> #pragma once #include <xcb/render.h> #include <xcb/xcb_image.h> #include <stdbool.h> #include "backend.h" #include "config.h" #include "region.h" typedef struct session session_t; typedef struct win win; typedef struct conv conv; typedef struct CLASS_0 backend_t; struct backend_operations; struct dual_kawase_params { /// Number of downsample passes int iterations; /// Pixel offset for down- and upsample float offset; /// Save area around blur target (@ref resize_width, @ref resize_height) int expand; }; struct backend_image_inner_base { int refcount; bool has_alpha; }; struct backend_image { // Backend dependent inner image data struct backend_image_inner_base *inner; double opacity; double dim; double max_brightness; double corner_radius; // Effective size of the image int ewidth, eheight; bool color_inverted; int border_width; }; bool build_shadow(xcb_connection_t *, xcb_drawable_t, double opacity, int width, int height, const conv *kernel, xcb_render_picture_t shadow_pixel, xcb_pixmap_t *pixmap, xcb_render_picture_t *pict); xcb_render_picture_t solid_picture(xcb_connection_t *, xcb_drawable_t, bool VAR_0, double a, double r, double g, double b); xcb_image_t * make_shadow(xcb_connection_t *c, const conv *kernel, double opacity, int width, int height); /// The default implementation of `is_win_transparent`, it simply looks at win::mode. So /// this is not suitable for backends that alter the content of windows bool default_is_win_transparent(void *, win *, void *); /// The default implementation of `is_frame_transparent`, it uses win::frame_opacity. Same /// caveat as `default_is_win_transparent` applies. bool default_is_frame_transparent(void *, win *, void *); void * default_backend_render_shadow(backend_t *backend_data, int width, int height, const conv *kernel, double r, double g, double b, double a); void init_backend_base(struct CLASS_0 *base, session_t *ps); struct conv **generate_blur_kernel(enum blur_method method, void *args, int *kernel_count); struct dual_kawase_params *generate_dual_kawase_params(void *args); void *default_clone_image(backend_t *base, const void *image_data, const region_t *reg); bool default_is_image_transparent(backend_t *base attr_unused, void *image_data); bool default_set_image_property(backend_t *base attr_unused, enum image_properties op, void *image_data, void *arg); struct backend_image *default_new_backend_image(int w, int h);
0.02667
{'CLASS_0': 'backend_base', 'VAR_0': 'argb'}
/* ** EPITECH PROJECT, 2018 ** LIBMY - UNIT TEST ** File description: ** Unit Tests for my_putstr function */ #include "my.h" #include "unittest.h" Test(my_putstr, test_00, .init = redirect_all_std) { my_putstr("Hello World\n"); cr_assert_stdout_eq_str("Hello World\n"); } Test(my_putstr, test_01, .init = redirect_all_std) { my_putstr("H"); cr_assert_stdout_eq_str("H"); } Test(my_putstr, test_02, .init = redirect_all_std) { my_putstr("0123456789"); cr_assert_stdout_eq_str("0123456789"); } Test(my_putstr, test_03, .init = redirect_all_std) { my_putstr("0\n"); cr_assert_stdout_eq_str("0\n"); } Test(my_putstr, test_04, .init = redirect_all_std) { my_putstr("Hel0\n"); cr_assert_stdout_eq_str("Hel0\n"); }
/* ** EPITECH PROJECT, 2018 ** LIBMY - UNIT TEST ** File description: ** Unit Tests for my_putstr function */ #include "my.h" #include "IMPORT_0" Test(VAR_0, test_00, .init = VAR_1) { FUNC_0("Hello World\n"); FUNC_1("Hello World\n"); } Test(VAR_0, VAR_2, .init = VAR_1) { FUNC_0("H"); FUNC_1("H"); } Test(VAR_0, VAR_3, .init = VAR_1) { FUNC_0("0123456789"); FUNC_1("0123456789"); } Test(VAR_0, test_03, .init = VAR_1) { FUNC_0("0\n"); FUNC_1("0\n"); } Test(VAR_0, test_04, .init = VAR_1) { FUNC_0("Hel0\n"); FUNC_1("Hel0\n"); }
0.572278
{'IMPORT_0': 'unittest.h', 'VAR_0': 'my_putstr', 'FUNC_0': 'my_putstr', 'VAR_1': 'redirect_all_std', 'FUNC_1': 'cr_assert_stdout_eq_str', 'VAR_2': 'test_01', 'VAR_3': 'test_02'}
#include <stdio.h> #include <conio.h> int main() { /* Preço do produto a ser digitado */ float productPrice; /* Define o totalPrice igual a 0 para poder adicionar o productPrice */ float totalPrice = 0; /* Chamada para digitar os produtos, no qual 0 encerra o programa */ printf("Type all the products prices: (0 exits)\n"); /* O loop irá parar quando a variável loop for diferente de 1 */ int loop = 1; /* Loop para pegar os preços digitados pelo usuário */ while( loop == 1 ) { /* Recebe o preço que o usuário digitou */ scanf("\n%f", &productPrice); /** * Filtro para o preço digitado, no qual: * * 1 - Menor que 0: Exibe um erro ao usuário * 2 - Igual a 0: Exibe uma mensagem que está finalizando a compra, * define a variável loop igual a 0 para interrompor o while * 3 - Em outros casos: Adiciona o preço digitado ao preço total */ if ( productPrice < 0 ) { /* 1 */ printf("\"%.2f\" Isn't a valid price! (Wasn't added)!\n", productPrice); } else if ( productPrice == 0 ) { /* 2 */ printf("Finishing the order..."); loop = 0; } else { /* 3 */ totalPrice += productPrice; } } /** * Define os descontos em um array para que possa exibir o total de desconto * no final. Os descontos são definidos como: * * 1 - Desconto de 5% em compras abaixo de R$50,00 * 2 - Desconto de 10% em compras de até R$100,00 * 3 - Desconto de 15% em compras abaixo de R$200,00 * 4 - Desconto de 20% em compras acima de R$200,00 * * Estrutura: { limite, desconto } * Exemplo: * discount[0] => { 50, 5 } * discount[0][0] => 50 (Valor) * discount[0][1] => 5 (Desconto) * * Em cada caso, é mostrado na tela do usuário o valor total da compra e o * desconto adquirido. */ float discounts[4][2] = { { 50, 5 }, { 100, 10 }, { 200, 15 }, { 200, 20 } }; if ( totalPrice < discounts[0][0] ) { totalPrice *= 1 - (discounts[0][1] / 100); /* 1 */ printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[0][1]); } else if ( totalPrice >= discounts[0][0] && totalPrice < discounts[1][0] ) { /* 2 */ totalPrice *= 1 - (discounts[1][1] / 100); printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[1][1]); } else if ( totalPrice >= discounts[1][0] && totalPrice < discounts[2][0] ) { /* 3 */ totalPrice *= 1 - (discounts[2][1] / 100); printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[2][1]); } else { /* 4 */ totalPrice *= 1 - (discounts[3][1] / 100); printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[3][1]); } getch(); return 0; }
#include <stdio.h> #include <conio.h> int main() { /* Preço do produto a ser digitado */ float VAR_0; /* Define o totalPrice igual a 0 para poder adicionar o productPrice */ float totalPrice = 0; /* Chamada para digitar os produtos, no qual 0 encerra o programa */ printf("Type all the products prices: (0 exits)\n"); /* O loop irá parar quando a variável loop for diferente de 1 */ int loop = 1; /* Loop para pegar os preços digitados pelo usuário */ while( loop == 1 ) { /* Recebe o preço que o usuário digitou */ scanf("\n%f", &VAR_0); /** * Filtro para o preço digitado, no qual: * * 1 - Menor que 0: Exibe um erro ao usuário * 2 - Igual a 0: Exibe uma mensagem que está finalizando a compra, * define a variável loop igual a 0 para interrompor o while * 3 - Em outros casos: Adiciona o preço digitado ao preço total */ if ( VAR_0 < 0 ) { /* 1 */ printf("\"%.2f\" Isn't a valid price! (Wasn't added)!\n", VAR_0); } else if ( VAR_0 == 0 ) { /* 2 */ printf("Finishing the order..."); loop = 0; } else { /* 3 */ totalPrice += VAR_0; } } /** * Define os descontos em um array para que possa exibir o total de desconto * no final. Os descontos são definidos como: * * 1 - Desconto de 5% em compras abaixo de R$50,00 * 2 - Desconto de 10% em compras de até R$100,00 * 3 - Desconto de 15% em compras abaixo de R$200,00 * 4 - Desconto de 20% em compras acima de R$200,00 * * Estrutura: { limite, desconto } * Exemplo: * discount[0] => { 50, 5 } * discount[0][0] => 50 (Valor) * discount[0][1] => 5 (Desconto) * * Em cada caso, é mostrado na tela do usuário o valor total da compra e o * desconto adquirido. */ float discounts[4][2] = { { 50, 5 }, { 100, 10 }, { 200, 15 }, { 200, 20 } }; if ( totalPrice < discounts[0][0] ) { totalPrice *= 1 - (discounts[0][1] / 100); /* 1 */ printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[0][1]); } else if ( totalPrice >= discounts[0][0] && totalPrice < discounts[1][0] ) { /* 2 */ totalPrice *= 1 - (discounts[1][1] / 100); printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[1][1]); } else if ( totalPrice >= discounts[1][0] && totalPrice < discounts[2][0] ) { /* 3 */ totalPrice *= 1 - (discounts[2][1] / 100); printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[2][1]); } else { /* 4 */ totalPrice *= 1 - (discounts[3][1] / 100); printf("\n\nTotal price:\nR$%.2f (Discount of %.0f%%)", totalPrice, discounts[3][1]); } getch(); return 0; }
0.074096
{'VAR_0': 'productPrice'}
/* * The MIT License (MIT) * * Copyright © 2015-2016 Franklin "Snaipe" Mathieu <http://snai.pe/> * * 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 INTERNAL_H_ #define INTERNAL_H_ #if defined (_WIN32) && !defined (__CYGWIN__) # include <windows.h> # if defined (MINGW_DEFINE_OFF_T) && (defined (__MINGW32__) || defined (__MINGW64__)) # include "off_t.h" # if !defined (__MINGW64__) # define off_t cr_off32 # else # define off_t cr_off64 # endif # define off64_t cr_off64 # endif # include <io.h> # if defined (MINGW_DEFINE_OFF_T) && (defined (__MINGW32__) || defined (__MINGW64__)) # undef off_t # undef off64_t # endif # include <fcntl.h> # include <winnt.h> # include <stdint.h> # include <signal.h> #else # include <fcntl.h> # include <signal.h> # include <sys/param.h> # include <sys/wait.h> # include <unistd.h> # ifdef BSD # include <sys/types.h> typedef unsigned long u_long; typedef unsigned int u_int; typedef unsigned short u_short; typedef unsigned char u_char; # include <sys/sysctl.h> # endif #endif #include "posix.h" #endif /* !INTERNAL_H_ */
/* * The MIT License (MIT) * * Copyright © 2015-2016 Franklin "Snaipe" Mathieu <http://snai.pe/> * * 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 INTERNAL_H_ #define INTERNAL_H_ #if defined (VAR_0) && !defined (__CYGWIN__) # include <IMPORT_0> # if defined (VAR_1) && (defined (VAR_2) || defined (VAR_3)) # include "IMPORT_1" # if !defined (VAR_3) # define VAR_4 cr_off32 # else # define VAR_4 cr_off64 # endif # define VAR_5 cr_off64 # endif # include <io.h> # if defined (VAR_1) && (defined (VAR_2) || defined (VAR_3)) # undef off_t # undef off64_t # endif # include <IMPORT_2> # include <IMPORT_3> # include <stdint.h> # include <IMPORT_4> #else # include <IMPORT_2> # include <IMPORT_4> # include <IMPORT_5> # include <sys/wait.h> # include <IMPORT_6> # ifdef VAR_6 # include <sys/types.h> typedef unsigned long ID_0; typedef unsigned int ID_1; typedef unsigned short ID_2; typedef unsigned char u_char; # include <IMPORT_7> # endif #endif #include "IMPORT_8" #endif /* !INTERNAL_H_ */
0.82965
{'VAR_0': '_WIN32', 'IMPORT_0': 'windows.h', 'VAR_1': 'MINGW_DEFINE_OFF_T', 'VAR_2': '__MINGW32__', 'VAR_3': '__MINGW64__', 'IMPORT_1': 'off_t.h', 'VAR_4': 'off_t', 'VAR_5': 'off64_t', 'IMPORT_2': 'fcntl.h', 'IMPORT_3': 'winnt.h', 'IMPORT_4': 'signal.h', 'IMPORT_5': 'sys/param.h', 'IMPORT_6': 'unistd.h', 'VAR_6': 'BSD', 'ID_0': 'u_long', 'ID_1': 'u_int', 'ID_2': 'u_short', 'IMPORT_7': 'sys/sysctl.h', 'IMPORT_8': 'posix.h'}
/* Check if coalescing SKBs is legal. */ static int tcp_can_collapse(struct sock *sk, struct sk_buff *skb) { if (tcp_skb_pcount(skb) > 1) return 0; if (skb_shinfo(skb)->nr_frags != 0) return 0; if (skb_cloned(skb)) return 0; if (skb == tcp_send_head(sk)) return 0; if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) return 0; return 1; }
/* Check if coalescing SKBs is legal. */ static int FUNC_0(struct CLASS_0 *VAR_0, struct sk_buff *VAR_1) { if (tcp_skb_pcount(VAR_1) > 1) return 0; if (FUNC_1(VAR_1)->VAR_2 != 0) return 0; if (FUNC_2(VAR_1)) return 0; if (VAR_1 == FUNC_3(VAR_0)) return 0; if (FUNC_4(VAR_1)->VAR_3 & VAR_4) return 0; return 1; }
0.769653
{'FUNC_0': 'tcp_can_collapse', 'CLASS_0': 'sock', 'VAR_0': 'sk', 'VAR_1': 'skb', 'FUNC_1': 'skb_shinfo', 'VAR_2': 'nr_frags', 'FUNC_2': 'skb_cloned', 'FUNC_3': 'tcp_send_head', 'FUNC_4': 'TCP_SKB_CB', 'VAR_3': 'sacked', 'VAR_4': 'TCPCB_SACKED_ACKED'}
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. #pragma once #include <fstream> #include <cstring> #include <iostream> #include <algorithm> #include <numeric> #include <vector> #include "Eigen/Core" #include "logger.h" #include "types.h" #include "hyperparams.h" namespace ISLE { class LogUtils { public: LogUtils(const std::string& log_dir) { global_open_diagnostic_log_file(log_dir); } ~LogUtils() { } void print_string( const std::string& str, const bool print_to_terminal = true) { ISLE_LOG_DIAGNOSTIC(str); ISLE_LOG_INFO(str); } void print_stringstream( const std::ostringstream& stream, const bool print_to_terminal = true) { ISLE_LOG_DIAGNOSTIC(stream.str()); ISLE_LOG_INFO(stream.str()); } template <class catchT> void print_catch_words(const doc_id_t topic, const catchT* catch_threshold, const std::vector<word_id_t>& catchwords, const std::vector<std::string>& vocab_words, bool print_to_terminal = true) { std::ostringstream ostr; ostr << "Catchwords:" << "\n"; for (auto iter = catchwords.begin(); iter != catchwords.end(); ++iter) ostr << vocab_words[*iter] << ":" << *iter << "(" << catch_threshold[*iter] << ") "; ostr << "\n"; print_stringstream(ostr, print_to_terminal); } void print_cluster_details(const doc_id_t num_topics, const std::vector<FPTYPE>& distsq, const std::vector<word_id_t> *const catchwords, const std::vector<doc_id_t> *const closest_docs, const std::vector<FPTYPE>& coherences, const std::vector<FPTYPE>& nl_coherences, bool print_to_terminal = true) { std::ostringstream ostr; std::vector<std::pair<int, doc_id_t> > cluster_sizes; for (auto t = 0; t < num_topics; ++t) cluster_sizes.push_back(std::make_pair(closest_docs[t].size(), t)); std::sort(cluster_sizes.begin(), cluster_sizes.end(), [](const auto& left, const auto&right) {return left.first < right.first; }); int catchless = 0; for (auto i = 0; i < num_topics; ++i) { auto t = cluster_sizes[i].second; ostr << std::setw(12) << std::left << "Cluster" << t << std::setw(12) << std::left << " size:" << cluster_sizes[i].first << std::setw(15) << std::left << " distsq_sum:" << distsq[i] << std::setw(15) << std::left << " raw_coh:" << nl_coherences[i] << std::setw(15) << std::left << " flt_coh:" << coherences[i] << " #catchwords: " << catchwords[t].size() << std::endl; if (catchwords[t].size() == 0) catchless++; } ostr << "\n#Topics with no catchwords: " << catchless << "(" << num_topics << ")" << std::endl; print_stringstream(ostr, print_to_terminal); } template<class FPTYPE> void print_eigen_data( std::vector<FPTYPE>& evalues, doc_id_t num_topics, bool print_to_terminal = true) { std::ostringstream ostr; ostr << "Eigvals: "; for (doc_id_t t = 0; t < num_topics; ++t) ostr << "(" << t << "): " << std::sqrt(evalues[t]) << "\t"; ostr << std::endl; std::vector<FPTYPE> eig_sum_slabs(num_topics / 100 + 1, 0.0); for (doc_id_t t = 0; t < num_topics; ++t) eig_sum_slabs[t / 100] += evalues[t]; for (auto slab = 0; slab < num_topics / 100; ++slab) ostr << "Sum of Top-" << (slab + 1) * 100 << " eig vals: " << std::accumulate(eig_sum_slabs.begin(), eig_sum_slabs.begin() + 1 + slab, (FPTYPE)0.0) << "\n"; print_stringstream(ostr, print_to_terminal); } }; }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. #pragma once #include <IMPORT_0> #include <IMPORT_1> #include <IMPORT_2> #include <IMPORT_3> #include <IMPORT_4> #include <IMPORT_5> #include "IMPORT_6" #include "IMPORT_7" #include "IMPORT_8" #include "IMPORT_9" CLASS_0 VAR_0 { CLASS_1 VAR_2 { public: FUNC_0(VAR_3 std::VAR_4& VAR_5) { FUNC_1(VAR_5); } ~FUNC_0() { } void print_string( const std::VAR_4& VAR_6, const bool print_to_terminal = true) { FUNC_3(VAR_6); FUNC_4(VAR_6); } void FUNC_5( const std::VAR_7& VAR_8, const bool print_to_terminal = true) { FUNC_3(VAR_8.FUNC_2()); FUNC_4(VAR_8.FUNC_2()); } template <VAR_1 VAR_9> VAR_10 FUNC_6(VAR_3 VAR_11 VAR_12, VAR_3 VAR_9* VAR_13, VAR_3 std::IMPORT_5<VAR_14>& VAR_15, VAR_3 std::IMPORT_5<std::VAR_4>& vocab_words, VAR_16 print_to_terminal = true) { std::VAR_7 VAR_17; VAR_17 << "Catchwords:" << "\n"; for (auto CLASS_3VAR_19 = VAR_15.FUNC_7(); VAR_18 != VAR_15.FUNC_8(); ++VAR_18) VAR_17 << vocab_words[*VAR_18] << ":" << *VAR_18 << "(" << VAR_13[*VAR_18] << ") "; VAR_17 << "\n"; FUNC_5(VAR_17, print_to_terminal); } void FUNC_9(const CLASS_2 VAR_20, const std::IMPORT_5<VAR_21>& VAR_22, const std::IMPORT_5<VAR_14> *const VAR_15, const std::IMPORT_5<VAR_11> *const VAR_23, const std::IMPORT_5<VAR_21>& coherences, const std::IMPORT_5<VAR_21>& VAR_24, bool print_to_terminal = true) { std::VAR_7 VAR_17; std::IMPORT_5<std::pair<int, VAR_11> > VAR_25; for (auto CLASS_4VAR_19 = 0; VAR_26 < VAR_20; ++VAR_26) VAR_25.FUNC_10(std::FUNC_11(VAR_23[VAR_26].FUNC_12(), VAR_26)); std::FUNC_13(VAR_25.FUNC_7(), VAR_25.FUNC_8(), [](const auto& VAR_27, VAR_3 VAR_28&VAR_29) {return VAR_27.first < VAR_29.first; }); int catchless = 0; for (auto CLASS_5VAR_19 = 0; VAR_30 < VAR_20; ++VAR_30) { auto CLASS_4VAR_19 = VAR_25[VAR_30].VAR_31; VAR_17 << std::FUNC_14(12) << std::VAR_27 << "Cluster" << VAR_26 << std::FUNC_14(12) << std::VAR_27 << " size:" << VAR_25[VAR_30].first << std::FUNC_14(15) << std::VAR_27 << " distsq_sum:" << VAR_22[VAR_30] << std::FUNC_14(15) << std::VAR_27 << " raw_coh:" << VAR_24[VAR_30] << std::FUNC_14(15) << std::VAR_27 << " flt_coh:" << coherences[VAR_30] << " #catchwords: " << VAR_15[VAR_26].FUNC_12() << std::VAR_32; if (VAR_15[VAR_26].FUNC_12() == 0) catchless++; } VAR_17 << "\n#Topics with no catchwords: " << catchless << "(" << VAR_20 << ")" << std::VAR_32; FUNC_5(VAR_17, print_to_terminal); } template<VAR_1 VAR_21> VAR_10 FUNC_15( std::IMPORT_5<VAR_21>& VAR_33, VAR_11 VAR_20, VAR_16 print_to_terminal = true) { std::VAR_7 VAR_17; VAR_17 << "Eigvals: "; for (CLASS_2 VAR_26 = 0; VAR_26 < VAR_20; ++VAR_26) VAR_17 << "(" << VAR_26 << "): " << std::FUNC_16(VAR_33[VAR_26]) << "\t"; VAR_17 << std::VAR_32; std::IMPORT_5<VAR_21> FUNC_17(VAR_20 / 100 + 1, 0.0); for (CLASS_2 VAR_26 = 0; VAR_26 < VAR_20; ++VAR_26) VAR_34[VAR_26 / 100] += VAR_33[VAR_26]; for (auto CLASS_6VAR_19 = 0; VAR_35 < VAR_20 / 100; ++VAR_35) VAR_17 << "Sum of Top-" << (VAR_35 + 1) * 100 << " eig vals: " << std::accumulate(VAR_34.FUNC_7(), VAR_34.FUNC_7() + 1 + VAR_35, (ID_0)0.0) << "\n"; FUNC_5(VAR_17, print_to_terminal); } }; }
0.856012
{'IMPORT_0': 'fstream', 'IMPORT_1': 'cstring', 'IMPORT_2': 'iostream', 'IMPORT_3': 'algorithm', 'IMPORT_4': 'numeric', 'IMPORT_5': 'vector', 'IMPORT_6': 'Eigen/Core', 'IMPORT_7': 'logger.h', 'IMPORT_8': 'types.h', 'IMPORT_9': 'hyperparams.h', 'CLASS_0': 'namespace', 'VAR_0': 'ISLE', 'CLASS_1': 'class', 'VAR_1': 'class', 'VAR_2': 'LogUtils', 'FUNC_0': 'LogUtils', 'VAR_3': 'const', 'VAR_4': 'string', 'VAR_5': 'log_dir', 'FUNC_1': 'global_open_diagnostic_log_file', 'VAR_6': 'str', 'FUNC_2': 'str', 'FUNC_3': 'ISLE_LOG_DIAGNOSTIC', 'FUNC_4': 'ISLE_LOG_INFO', 'FUNC_5': 'print_stringstream', 'VAR_7': 'ostringstream', 'VAR_8': 'stream', 'VAR_9': 'catchT', 'VAR_10': 'void', 'FUNC_6': 'print_catch_words', 'VAR_11': 'doc_id_t', 'CLASS_2': 'doc_id_t', 'VAR_12': 'topic', 'VAR_13': 'catch_threshold', 'VAR_14': 'word_id_t', 'VAR_15': 'catchwords', 'VAR_16': 'bool', 'VAR_17': 'ostr', 'CLASS_3': 'iter', 'VAR_18': 'iter', 'VAR_19': '', 'FUNC_7': 'begin', 'FUNC_8': 'end', 'FUNC_9': 'print_cluster_details', 'VAR_20': 'num_topics', 'VAR_21': 'FPTYPE', 'ID_0': 'FPTYPE', 'VAR_22': 'distsq', 'VAR_23': 'closest_docs', 'VAR_24': 'nl_coherences', 'VAR_25': 'cluster_sizes', 'CLASS_4': 't', 'VAR_26': 't', 'FUNC_10': 'push_back', 'FUNC_11': 'make_pair', 'FUNC_12': 'size', 'FUNC_13': 'sort', 'VAR_27': 'left', 'VAR_28': 'auto', 'VAR_29': 'right', 'CLASS_5': 'i', 'VAR_30': 'i', 'VAR_31': 'second', 'FUNC_14': 'setw', 'VAR_32': 'endl', 'FUNC_15': 'print_eigen_data', 'VAR_33': 'evalues', 'FUNC_16': 'sqrt', 'FUNC_17': 'eig_sum_slabs', 'VAR_34': 'eig_sum_slabs', 'CLASS_6': 'slab', 'VAR_35': 'slab'}
// Initialize AES-CTR algorithm in CCM mode as used by GBL void btl_initAesCcm(void *ctx, uint8_t flags, uint8_t *nonce, uint32_t counter, const uint8_t *key, unsigned int keySize) { #if defined(_CMU_CLKEN1_MASK) && defined(CRYPTOACC_PRESENT) CMU->CLKEN1_SET = CMU_CLKEN1_CRYPTOACC; CMU->CRYPTOACCCLKCTRL_SET = CMU_CRYPTOACCCLKCTRL_AESEN; #elif defined(_CMU_CLKEN1_SEMAILBOXHOST_MASK) CMU->CLKEN1_SET = CMU_CLKEN1_SEMAILBOXHOST; #endif AesCtrContext_t *context = (AesCtrContext_t *)ctx; #if defined(SEMAILBOX_PRESENT) && defined(BOOTLOADER_USE_SYMMETRIC_KEY_FROM_SE_STORAGE) \ && (BOOTLOADER_USE_SYMMETRIC_KEY_FROM_SE_STORAGE == 1) (void)key; context->aesKeyDesc.type = SL_SE_KEY_TYPE_SYMMETRIC; context->aesKeyDesc.size = keySize / 8UL; context->aesKeyDesc.flags = SL_SE_KEY_FLAG_NON_EXPORTABLE; context->aesKeyDesc.storage.method = SL_SE_KEY_STORAGE_INTERNAL_IMMUTABLE; context->aesKeyDesc.storage.location.slot = SL_SE_KEY_SLOT_APPLICATION_AES_128_KEY; #else mbedtls_aes_init(&(context->aesContext)); mbedtls_aes_setkey_enc(&(context->aesContext), key, keySize); #endif context->offsetInBlock = 0; context->counter[0] = flags; memcpy(&(context->counter[1]), nonce, 12); context->counter[13] = (counter & 0x00FF0000) >> 16; context->counter[14] = (counter & 0x0000FF00) >> 8; context->counter[15] = (counter & 0x000000FF); }
// Initialize AES-CTR algorithm in CCM mode as used by GBL void btl_initAesCcm(void *VAR_0, uint8_t flags, uint8_t *nonce, uint32_t counter, const uint8_t *key, unsigned int keySize) { #if defined(_CMU_CLKEN1_MASK) && defined(VAR_1) CMU->CLKEN1_SET = CMU_CLKEN1_CRYPTOACC; CMU->VAR_2 = CMU_CRYPTOACCCLKCTRL_AESEN; #elif defined(_CMU_CLKEN1_SEMAILBOXHOST_MASK) CMU->CLKEN1_SET = CMU_CLKEN1_SEMAILBOXHOST; #endif AesCtrContext_t *context = (AesCtrContext_t *)VAR_0; #if defined(SEMAILBOX_PRESENT) && defined(VAR_3) \ && (VAR_3 == 1) (void)key; context->aesKeyDesc.VAR_4 = VAR_5; context->aesKeyDesc.size = keySize / 8UL; context->aesKeyDesc.flags = VAR_6; context->aesKeyDesc.VAR_7.VAR_8 = VAR_9; context->aesKeyDesc.VAR_7.location.VAR_10 = SL_SE_KEY_SLOT_APPLICATION_AES_128_KEY; #else FUNC_0(&(context->aesContext)); mbedtls_aes_setkey_enc(&(context->aesContext), key, keySize); #endif context->offsetInBlock = 0; context->counter[0] = flags; memcpy(&(context->counter[1]), nonce, 12); context->counter[13] = (counter & 0x00FF0000) >> 16; context->counter[14] = (counter & 0x0000FF00) >> 8; context->counter[15] = (counter & 0x000000FF); }
0.289134
{'VAR_0': 'ctx', 'VAR_1': 'CRYPTOACC_PRESENT', 'VAR_2': 'CRYPTOACCCLKCTRL_SET', 'VAR_3': 'BOOTLOADER_USE_SYMMETRIC_KEY_FROM_SE_STORAGE', 'VAR_4': 'type', 'VAR_5': 'SL_SE_KEY_TYPE_SYMMETRIC', 'VAR_6': 'SL_SE_KEY_FLAG_NON_EXPORTABLE', 'VAR_7': 'storage', 'VAR_8': 'method', 'VAR_9': 'SL_SE_KEY_STORAGE_INTERNAL_IMMUTABLE', 'VAR_10': 'slot', 'FUNC_0': 'mbedtls_aes_init'}
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once namespace DWriteTextLayoutImplementation { // Wrapper for DWRITE_LINE_SPACING_METHOD enumeration. // The DWRITE_LINE_SPACING_METHOD enumeration is defined in dwrite.h. public enum class LineSpacingMethod { // Default line spacing depends solely on the content, growing // to accommodate the size of fonts and inline objects. Default = DWRITE_LINE_SPACING_METHOD_DEFAULT, // Uniform line spacing: the spacing of all lines is determined by // values provided by the app in a DWRITE_LINE_SPACING structure. // One use of uniform spacing is to avoid the uneven appearance // that can occur from font fallback. Uniform = DWRITE_LINE_SPACING_METHOD_UNIFORM, // Proportional line spacing: the spacing and baseline distances // are based on the computed values based on the content, as with // default spacing, but adjusted proportionally by scaling factors // you provide in a DWRITE_LINE_SPACING structure. Proportional = DWRITE_LINE_SPACING_METHOD_PROPORTIONAL }; // Wrapper for DWRITE_FONT_LINE_GAP_USAGE enumeration. The // DWRITE_FONT_LINE_GAP_USAGE enumeration is defined in dwrite_3.h. public enum class FontLineGapUsage { // Use default behavior for line gap usage. (This is different // for GDI-compatible text layout than for normal text layout.) Default = DWRITE_FONT_LINE_GAP_USAGE_DEFAULT, // The font line gap is excluded from line spacing. Disabled = DWRITE_FONT_LINE_GAP_USAGE_DISABLED, // The font line gap is included in line spacing. Enabled = DWRITE_FONT_LINE_GAP_USAGE_ENABLED }; // Wrapper for DWRITE_LINE_METRICS1 structure. public ref class LineMetrics sealed { public: property uint32 length { uint32 get() { return m_lineMetrics.length; } } property uint32 trailingWhitespaceLength { uint32 get() { return m_lineMetrics.trailingWhitespaceLength; } } property uint32 newlineLength { uint32 get() { return m_lineMetrics.newlineLength; } } property bool isTrimmed { bool get() { return !!m_lineMetrics.isTrimmed; } } property float height { float get() { return m_lineMetrics.height; } } property float baseline { float get() { return m_lineMetrics.baseline; } } property float leadingBefore { float get() { return m_lineMetrics.leadingBefore; } } property float leadingAfter { float get() { return m_lineMetrics.leadingAfter; } } internal: void SetLineMetrics(DWRITE_LINE_METRICS1 lineMetrics) { m_lineMetrics = lineMetrics; } private: DWRITE_LINE_METRICS1 m_lineMetrics; }; public ref class TextLayout sealed { public: TextLayout( Platform::String^ text, Platform::String^ languageTag, Platform::String^ fontFamily, float fontSize, uint32 pixelWidth, DWriteTextLayoutImplementation::LineSpacingMethod lineSpacingMethod ); Platform::Array<LineMetrics^>^ GetTextLayoutLineMetrics(); property uint32 Width { uint32 get() { return m_pixelWidth; } } property uint32 Height { uint32 get() { return m_pixelHeight; } } property DWriteTextLayoutImplementation::LineSpacingMethod LineSpacingMethod { DWriteTextLayoutImplementation::LineSpacingMethod get() { return static_cast<DWriteTextLayoutImplementation::LineSpacingMethod>(m_lineSpacing.method); } void set(DWriteTextLayoutImplementation::LineSpacingMethod value); } property float LineSpacingHeight { float get() { return m_lineSpacing.height; } void set(float value); } property float LineSpacingBaseline { float get() { return m_lineSpacing.baseline; } void set(float value); } property float LineSpacingLeadingBefore { float get() { return m_lineSpacing.leadingBefore; } void set(float value); } property FontLineGapUsage FontLineGapUsage { DWriteTextLayoutImplementation::FontLineGapUsage get() { return static_cast<DWriteTextLayoutImplementation::FontLineGapUsage>(m_lineSpacing.fontLineGapUsage); } void set(DWriteTextLayoutImplementation::FontLineGapUsage value); } internal: Microsoft::WRL::ComPtr<IDWriteTextLayout> GetDWriteTextLayout() { return m_textLayout.Get(); } DWRITE_TEXT_METRICS GetTextMetrics(); std::vector<DWRITE_LINE_METRICS1> GetLineMetrics(); private: void SetLineSpacingDefaults(); void SetLineSpacing(); void InvalidateLayout(); void UpdateCachedMetrics(); void EnsureCachedLineMetrics(); std::wstring m_text; std::wstring m_languageTag; std::wstring m_fontFamily; float m_fontSize; uint32 m_pixelWidth; // set in constructor uint32 m_pixelHeight; // derived from layout // DirectWrite objects Microsoft::WRL::ComPtr<IDWriteFactory3> m_dwriteFactory; Microsoft::WRL::ComPtr<IDWriteTextLayout3> m_textLayout; // The DWRITE_LINE_SPACING structure is defined in dwrite_3.h and has // these members which are used to control the line spacing behavior: // DWRITE_LINE_SPACING_METHOD method // float height // float baseline // float leadingBefore // DWRITE_FONT_LINE_GAP_USAGE fontLineGapUsage // The method selected will determine different interpretation and // effect for the other members. See dwrite_3.h for details. DWRITE_LINE_SPACING m_lineSpacing; // The DWRITE_LINE_METRICS1 structure is defined in dwrite_3.h and // is used to report computed metrics for a given line of a text // layout after the layout has been performed. It includes these // members: // float height // float baseline // float leadingBefore // float leadingAfter std::vector<DWRITE_LINE_METRICS1> m_lineMetrics; }; }
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once CLASS_0 DWriteTextLayoutImplementation { // Wrapper for DWRITE_LINE_SPACING_METHOD enumeration. // The DWRITE_LINE_SPACING_METHOD enumeration is defined in dwrite.h. CLASS_1 enum class LineSpacingMethod { // Default line spacing depends solely on the content, growing // to accommodate the size of fonts and inline objects. Default = VAR_0, // Uniform line spacing: the spacing of all lines is determined by // values provided by the app in a DWRITE_LINE_SPACING structure. // One use of uniform spacing is to avoid the uneven appearance // that can occur from font fallback. Uniform = VAR_1, // Proportional line spacing: the spacing and baseline distances // are based on the computed values based on the content, as with // default spacing, but adjusted proportionally by scaling factors // you provide in a DWRITE_LINE_SPACING structure. Proportional = VAR_2 }; // Wrapper for DWRITE_FONT_LINE_GAP_USAGE enumeration. The // DWRITE_FONT_LINE_GAP_USAGE enumeration is defined in dwrite_3.h. CLASS_1 enum class VAR_3 { // Use default behavior for line gap usage. (This is different // for GDI-compatible text layout than for normal text layout.) Default = VAR_4, // The font line gap is excluded from line spacing. VAR_5 = DWRITE_FONT_LINE_GAP_USAGE_DISABLED, // The font line gap is included in line spacing. Enabled = DWRITE_FONT_LINE_GAP_USAGE_ENABLED }; // Wrapper for DWRITE_LINE_METRICS1 structure. CLASS_1 VAR_6 class VAR_7 sealed { public: VAR_8 CLASS_3 VAR_10 { CLASS_3 FUNC_0() { return m_lineMetrics.VAR_10; } } CLASS_2 VAR_9 trailingWhitespaceLength { CLASS_3 FUNC_0() { return m_lineMetrics.trailingWhitespaceLength; } } CLASS_2 VAR_9 newlineLength { CLASS_3 FUNC_0() { return m_lineMetrics.newlineLength; } } CLASS_2 bool isTrimmed { bool FUNC_0() { return !!m_lineMetrics.isTrimmed; } } CLASS_2 VAR_11 height { float FUNC_0() { return m_lineMetrics.height; } } CLASS_2 VAR_11 baseline { float FUNC_0() { return m_lineMetrics.baseline; } } CLASS_2 VAR_11 leadingBefore { float FUNC_0() { return m_lineMetrics.leadingBefore; } } CLASS_2 VAR_11 leadingAfter { float FUNC_0() { return m_lineMetrics.leadingAfter; } } internal: VAR_12 SetLineMetrics(DWRITE_LINE_METRICS1 lineMetrics) { m_lineMetrics = lineMetrics; } private: DWRITE_LINE_METRICS1 m_lineMetrics; }; CLASS_1 VAR_6 class TextLayout sealed { public: TextLayout( VAR_13::VAR_14^ text, VAR_13::VAR_14^ languageTag, VAR_13::VAR_14^ fontFamily, VAR_11 fontSize, VAR_9 pixelWidth, DWriteTextLayoutImplementation::LineSpacingMethod lineSpacingMethod ); Platform::Array<VAR_7^>^ GetTextLayoutLineMetrics(); CLASS_2 VAR_9 VAR_15 { CLASS_3 FUNC_0() { return m_pixelWidth; } } CLASS_2 VAR_9 VAR_16 { CLASS_3 FUNC_0() { return m_pixelHeight; } } CLASS_2 DWriteTextLayoutImplementation::LineSpacingMethod LineSpacingMethod { DWriteTextLayoutImplementation::LineSpacingMethod FUNC_0() { return VAR_17<DWriteTextLayoutImplementation::LineSpacingMethod>(m_lineSpacing.VAR_18); } void set(DWriteTextLayoutImplementation::LineSpacingMethod value); } CLASS_2 VAR_11 VAR_19 { float FUNC_0() { return m_lineSpacing.height; } void set(float value); } CLASS_2 VAR_11 LineSpacingBaseline { float FUNC_0() { return m_lineSpacing.baseline; } void set(float value); } CLASS_2 VAR_11 LineSpacingLeadingBefore { float FUNC_0() { return m_lineSpacing.leadingBefore; } void set(float value); } CLASS_2 VAR_3 VAR_3 { DWriteTextLayoutImplementation::VAR_3 FUNC_0() { return VAR_17<DWriteTextLayoutImplementation::VAR_3>(m_lineSpacing.VAR_20); } void set(DWriteTextLayoutImplementation::VAR_3 value); } internal: Microsoft::WRL::ComPtr<VAR_21> GetDWriteTextLayout() { return VAR_22.Get(); } DWRITE_TEXT_METRICS GetTextMetrics(); std::VAR_23<DWRITE_LINE_METRICS1> FUNC_1(); private: VAR_12 SetLineSpacingDefaults(); void FUNC_2(); void FUNC_3(); void FUNC_4(); void FUNC_5(); std::wstring m_text; std::wstring m_languageTag; std::wstring VAR_24; float VAR_25; CLASS_3 m_pixelWidth; // set in constructor CLASS_3 m_pixelHeight; // derived from layout // DirectWrite objects Microsoft::WRL::ComPtr<IDWriteFactory3> VAR_26; Microsoft::WRL::ComPtr<VAR_27> VAR_22; // The DWRITE_LINE_SPACING structure is defined in dwrite_3.h and has // these members which are used to control the line spacing behavior: // DWRITE_LINE_SPACING_METHOD method // float height // float baseline // float leadingBefore // DWRITE_FONT_LINE_GAP_USAGE fontLineGapUsage // The method selected will determine different interpretation and // effect for the other members. See dwrite_3.h for details. DWRITE_LINE_SPACING m_lineSpacing; // The DWRITE_LINE_METRICS1 structure is defined in dwrite_3.h and // is used to report computed metrics for a given line of a text // layout after the layout has been performed. It includes these // members: // float height // float baseline // float leadingBefore // float leadingAfter std::VAR_23<DWRITE_LINE_METRICS1> m_lineMetrics; }; }
0.558043
{'CLASS_0': 'namespace', 'CLASS_1': 'public', 'VAR_0': 'DWRITE_LINE_SPACING_METHOD_DEFAULT', 'VAR_1': 'DWRITE_LINE_SPACING_METHOD_UNIFORM', 'VAR_2': 'DWRITE_LINE_SPACING_METHOD_PROPORTIONAL', 'VAR_3': 'FontLineGapUsage', 'VAR_4': 'DWRITE_FONT_LINE_GAP_USAGE_DEFAULT', 'VAR_5': 'Disabled', 'VAR_6': 'ref', 'VAR_7': 'LineMetrics', 'VAR_8': 'property', 'CLASS_2': 'property', 'CLASS_3': 'uint32', 'VAR_9': 'uint32', 'VAR_10': 'length', 'FUNC_0': 'get', 'VAR_11': 'float', 'VAR_12': 'void', 'VAR_13': 'Platform', 'VAR_14': 'String', 'VAR_15': 'Width', 'VAR_16': 'Height', 'VAR_17': 'static_cast', 'VAR_18': 'method', 'VAR_19': 'LineSpacingHeight', 'VAR_20': 'fontLineGapUsage', 'VAR_21': 'IDWriteTextLayout', 'VAR_22': 'm_textLayout', 'VAR_23': 'vector', 'FUNC_1': 'GetLineMetrics', 'FUNC_2': 'SetLineSpacing', 'FUNC_3': 'InvalidateLayout', 'FUNC_4': 'UpdateCachedMetrics', 'FUNC_5': 'EnsureCachedLineMetrics', 'VAR_24': 'm_fontFamily', 'VAR_25': 'm_fontSize', 'VAR_26': 'm_dwriteFactory', 'VAR_27': 'IDWriteTextLayout3'}
/* SPDX-License-Identifier: MIT */ /** @file windows/eventimpl.h @brief Declares the AJAEventImpl class. @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. **/ #ifndef AJA_EVENT_IMPL_H #define AJA_EVENT_IMPL_H #include "ajabase/system/system.h" #include "ajabase/common/common.h" #include "ajabase/system/event.h" class AJAEventImpl { public: AJAEventImpl(bool manualReset, const std::string& name); virtual ~AJAEventImpl(); AJAStatus Signal(); AJAStatus Clear(); AJAStatus SetState(bool signaled = true); AJAStatus GetState(bool* pSignaled); AJAStatus SetManualReset(bool manualReset); AJAStatus GetManualReset(bool* pManualReset); AJAStatus WaitForSignal(uint32_t timeout = 0xffffffff); virtual AJAStatus GetEventObject(uint64_t* pEventObject); HANDLE mEvent; private: bool mManualReset; }; #endif // AJA_EVENT_IMPL_H
/* SPDX-License-Identifier: MIT */ /** @file windows/eventimpl.h @brief Declares the AJAEventImpl class. @copyright (C) 2009-2021 AJA Video Systems, Inc. All rights reserved. **/ #ifndef VAR_0 #define VAR_0 #include "IMPORT_0" #include "ajabase/common/common.h" #include "ajabase/system/event.h" CLASS_0 VAR_1 { public: FUNC_0(VAR_2 VAR_3, VAR_4 VAR_5::string& name); CLASS_1 ~FUNC_0(); CLASS_2 FUNC_1(); CLASS_2 FUNC_2(); CLASS_2 FUNC_3(bool VAR_7 = true); CLASS_2 FUNC_4(bool* VAR_8); CLASS_2 SetManualReset(bool VAR_3); CLASS_2 FUNC_5(bool* VAR_9); CLASS_2 FUNC_6(uint32_t VAR_10 = 0xffffffff); CLASS_1 VAR_6 FUNC_7(uint64_t* VAR_11); CLASS_3 mEvent; private: VAR_2 VAR_12; }; #endif // AJA_EVENT_IMPL_H
0.823264
{'VAR_0': 'AJA_EVENT_IMPL_H', 'IMPORT_0': 'ajabase/system/system.h', 'CLASS_0': 'class', 'VAR_1': 'AJAEventImpl', 'FUNC_0': 'AJAEventImpl', 'VAR_2': 'bool', 'VAR_3': 'manualReset', 'VAR_4': 'const', 'VAR_5': 'std', 'CLASS_1': 'virtual', 'CLASS_2': 'AJAStatus', 'VAR_6': 'AJAStatus', 'FUNC_1': 'Signal', 'FUNC_2': 'Clear', 'FUNC_3': 'SetState', 'VAR_7': 'signaled', 'FUNC_4': 'GetState', 'VAR_8': 'pSignaled', 'FUNC_5': 'GetManualReset', 'VAR_9': 'pManualReset', 'FUNC_6': 'WaitForSignal', 'VAR_10': 'timeout', 'FUNC_7': 'GetEventObject', 'VAR_11': 'pEventObject', 'CLASS_3': 'HANDLE', 'VAR_12': 'mManualReset'}
// -*- C++ -*- /*! \file * \brief Even-odd preconditioned log(det(A_ee)) */ #ifndef __central_tprec_logdet_tt_monomial_h__ #define __central_tprec_logdet_tt_monomial_h__ #include "qdp_config.h" #if QDP_NS == 4 #if QDP_NC == 3 #if QDP_ND == 4 #include "central_tprec_fermact_w.h" #include "update/molecdyn/field_state.h" #include "update/molecdyn/monomial/abs_monomial.h" #include "update/molecdyn/monomial/force_monitors.h" #include "io/xmllog_io.h" namespace Chroma { //! A Monomial For Just the EvenEven part of EvenOddPrecLogDetWilsonTypeFermActs /*! @ingroup monomial * * Monomial is expected to be the same for these fermacts */ template<typename P, typename Q, typename Phi> class CentralTimePrecLogDetTTMonomial : public ExactMonomial<P,Q> { public: virtual ~CentralTimePrecLogDetTTMonomial() {} void dsdq(P& F, const AbsFieldState<P,Q>& s) { START_CODE(); XMLWriter& xml_out = TheXMLLogWriter::Instance(); push(xml_out, "CentralTimePrecLogDetTTMonomial"); // Create FermAct const CentralTimePrecFermAct<Phi,P,Q>& FA = getFermAct(); // Create a state for linop Handle< FermState<Phi,P,Q> > state(FA.createState(s.getQ())); //Create LinOp Handle< CentralTimePrecLinearOperator<Phi,P,Q> > lin(FA.linOp(state)); lin->derivLogDetTDagT(F, PLUS); F[lin->tDir()] *= Real(getNumFlavors()); state->deriv(F); monitorForces(xml_out, "Forces", F); pop(xml_out); END_CODE(); } //! Gauge action value Double S(const AbsFieldState<P,Q>& s) { START_CODE(); XMLWriter& xml_out = TheXMLLogWriter::Instance(); push(xml_out, "CentralTimePrecLogDetTTMonomial"); const CentralTimePrecFermAct<Phi,P,Q>& FA = getFermAct(); Handle< FermState<Phi,P,Q> > bc_g_state = FA.createState(s.getQ()); // Need way to get gauge state from AbsFieldState<P,Q> Handle< CentralTimePrecLinearOperator<Phi,P,Q> > lin(FA.linOp(bc_g_state)); Double S_ee =(Double(-2*getNumFlavors())*lin->logDetTDagT()); write(xml_out, "S", S_ee); pop(xml_out); END_CODE(); return S_ee; } void refreshInternalFields(const AbsFieldState<multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >& s) { //No internal fields to refresh => Nop } void setInternalFields(const Monomial<multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >& m) { // No internal fields to refresh => Nop } protected: virtual const CentralTimePrecFermAct<Phi,P,Q>& getFermAct() const = 0; virtual int getNumFlavors() const = 0; }; /*! @ingroup monomial */ namespace CentralTimePrecLogDetTTMonomial4DEnv { bool registerAll(); } // Parameter structure /*! @ingroup monomial */ struct CentralTimePrecLogDetTTMonomialParams { // Base Constructor CentralTimePrecLogDetTTMonomialParams(); // Read monomial from some root path CentralTimePrecLogDetTTMonomialParams(XMLReader& in, const std::string& path); GroupXML_t fermact; int num_flavors; }; /*! @ingroup monomial */ void read(XMLReader& r, const std::string& path, CentralTimePrecLogDetTTMonomialParams& p); /*! @ingroup monomial */ void write(XMLWriter& xml, const std::string& path, const CentralTimePrecLogDetTTMonomialParams& p); //! A Monomial For Just the EvenEven part of EvenOddPrecLogDetWilsonTypeFermActs -- concretely a 4D one /*! @ingroup monomial * * Monomial is expected to be the same for these fermacts */ class CentralTimePrecLogDetTTMonomial4D : public CentralTimePrecLogDetTTMonomial<multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix>, LatticeFermion> { public: // Typedefs to save typing typedef LatticeFermion T; typedef multi1d<LatticeColorMatrix> P; typedef multi1d<LatticeColorMatrix> Q; //! Construct from param struct CentralTimePrecLogDetTTMonomial4D(const CentralTimePrecLogDetTTMonomialParams& p); //! Copy Constructor CentralTimePrecLogDetTTMonomial4D(const CentralTimePrecLogDetTTMonomial4D& m) : num_flavors(m.num_flavors), fermact(m.fermact) {} //! Destructor is automagic ~CentralTimePrecLogDetTTMonomial4D() {} protected: const CentralTimePrecFermAct<T,P,Q> & getFermAct(void) const { return *fermact; } int getNumFlavors() const { return num_flavors; } private: int num_flavors; Handle< CentralTimePrecFermAct<T,P,Q> > fermact; }; } //end namespace chroma #endif #endif #endif #endif
// -*- C++ -*- /*! \file * \brief Even-odd preconditioned log(det(A_ee)) */ #ifndef VAR_0 #define VAR_0 #include "qdp_config.h" #if QDP_NS == 4 #if VAR_1 == 3 #if VAR_2 == 4 #include "IMPORT_0" #include "update/molecdyn/field_state.h" #include "IMPORT_1" #include "IMPORT_2" #include "IMPORT_3" namespace VAR_3 { //! A Monomial For Just the EvenEven part of EvenOddPrecLogDetWilsonTypeFermActs /*! @ingroup monomial * * Monomial is expected to be the same for these fermacts */ template<typename P, typename VAR_4, typename VAR_5> class CentralTimePrecLogDetTTMonomial : public VAR_6<P,VAR_4> { public: VAR_7 ~CentralTimePrecLogDetTTMonomial() {} void dsdq(P& F, const AbsFieldState<P,CLASS_0>& VAR_8) { START_CODE(); XMLWriter& VAR_9 = TheXMLLogWriter::Instance(); FUNC_0(VAR_9, "CentralTimePrecLogDetTTMonomial"); // Create FermAct const CentralTimePrecFermAct<VAR_5,P,VAR_4>& VAR_10 = FUNC_1(); // Create a state for linop VAR_11< FermState<VAR_5,P,VAR_4> > state(VAR_10.FUNC_2(VAR_8.getQ())); //Create LinOp VAR_11< CentralTimePrecLinearOperator<VAR_5,P,VAR_4> > lin(VAR_10.linOp(state)); lin->FUNC_3(F, VAR_12); F[lin->FUNC_4()] *= Real(getNumFlavors()); state->FUNC_5(F); FUNC_6(VAR_9, "Forces", F); FUNC_7(VAR_9); END_CODE(); } //! Gauge action value CLASS_2 FUNC_9(const AbsFieldState<P,CLASS_0>& VAR_8) { START_CODE(); XMLWriter& VAR_9 = TheXMLLogWriter::Instance(); FUNC_0(VAR_9, "CentralTimePrecLogDetTTMonomial"); const CentralTimePrecFermAct<VAR_5,P,VAR_4>& VAR_10 = FUNC_1(); VAR_11< FermState<VAR_5,P,VAR_4> > bc_g_state = VAR_10.FUNC_2(VAR_8.getQ()); // Need way to get gauge state from AbsFieldState<P,Q> VAR_11< CentralTimePrecLinearOperator<VAR_5,P,VAR_4> > lin(VAR_10.linOp(bc_g_state)); CLASS_2 S_ee =(FUNC_8(-2*getNumFlavors())*lin->logDetTDagT()); FUNC_10(VAR_9, "S", S_ee); FUNC_7(VAR_9); END_CODE(); return S_ee; } void FUNC_11(const AbsFieldState<VAR_13<VAR_14>, CLASS_3<VAR_14> >& VAR_8) { //No internal fields to refresh => Nop } void FUNC_12(const Monomial<VAR_13<VAR_14>, CLASS_3<VAR_14> >& m) { // No internal fields to refresh => Nop } protected: VAR_7 VAR_15 CentralTimePrecFermAct<VAR_5,P,VAR_4>& FUNC_1() VAR_15 = 0; CLASS_1 VAR_16 getNumFlavors() const = 0; }; /*! @ingroup monomial */ namespace VAR_17 { bool FUNC_13(); } // Parameter structure /*! @ingroup monomial */ struct CLASS_5 { // Base Constructor VAR_18(ID_1); // Read monomial from some root path VAR_18(XMLReader& VAR_19, const VAR_20::VAR_21& VAR_22); CLASS_7 fermact; int num_flavors; }; /*! @ingroup monomial */ void FUNC_14(XMLReader& r, const CLASS_6::VAR_21& VAR_22, CLASS_5& VAR_23); /*! @ingroup monomial */ void FUNC_10(XMLWriter& VAR_24, const CLASS_6::VAR_21& VAR_22, const CLASS_5& VAR_23); //! A Monomial For Just the EvenEven part of EvenOddPrecLogDetWilsonTypeFermActs -- concretely a 4D one /*! @ingroup monomial * * Monomial is expected to be the same for these fermacts */ class VAR_25 : public CentralTimePrecLogDetTTMonomial<VAR_13<VAR_14>, VAR_13<VAR_14>, VAR_26> { public: // Typedefs to save typing typedef CLASS_9 T; typedef CLASS_3<CLASS_4> P; typedef CLASS_3<CLASS_4> ID_0; //! Construct from param struct VAR_25(const CLASS_5& VAR_23); //! Copy Constructor VAR_25(const CLASS_8& m) : num_flavors(m.num_flavors), fermact(m.fermact) {} //! Destructor is automagic ~FUNC_15() {} protected: VAR_15 CentralTimePrecFermAct<T,P,VAR_4> & FUNC_1(VAR_27) VAR_15 { return *fermact; } int getNumFlavors() const { return num_flavors; } private: VAR_16 num_flavors; VAR_11< CentralTimePrecFermAct<T,P,VAR_4> > fermact; }; } //end namespace chroma #endif #endif #endif #endif
0.643084
{'VAR_0': '__central_tprec_logdet_tt_monomial_h__', 'VAR_1': 'QDP_NC', 'VAR_2': 'QDP_ND', 'IMPORT_0': 'central_tprec_fermact_w.h', 'IMPORT_1': 'update/molecdyn/monomial/abs_monomial.h', 'IMPORT_2': 'update/molecdyn/monomial/force_monitors.h', 'IMPORT_3': 'io/xmllog_io.h', 'VAR_3': 'Chroma', 'VAR_4': 'Q', 'CLASS_0': 'Q', 'ID_0': 'Q', 'VAR_5': 'Phi', 'VAR_6': 'ExactMonomial', 'VAR_7': 'virtual', 'CLASS_1': 'virtual', 'VAR_8': 's', 'VAR_9': 'xml_out', 'FUNC_0': 'push', 'VAR_10': 'FA', 'FUNC_1': 'getFermAct', 'VAR_11': 'Handle', 'FUNC_2': 'createState', 'FUNC_3': 'derivLogDetTDagT', 'VAR_12': 'PLUS', 'FUNC_4': 'tDir', 'FUNC_5': 'deriv', 'FUNC_6': 'monitorForces', 'FUNC_7': 'pop', 'CLASS_2': 'Double', 'FUNC_8': 'Double', 'FUNC_9': 'S', 'FUNC_10': 'write', 'FUNC_11': 'refreshInternalFields', 'VAR_13': 'multi1d', 'CLASS_3': 'multi1d', 'VAR_14': 'LatticeColorMatrix', 'CLASS_4': 'LatticeColorMatrix', 'FUNC_12': 'setInternalFields', 'VAR_15': 'const', 'VAR_16': 'int', 'VAR_17': 'CentralTimePrecLogDetTTMonomial4DEnv', 'FUNC_13': 'registerAll', 'CLASS_5': 'CentralTimePrecLogDetTTMonomialParams', 'VAR_18': 'CentralTimePrecLogDetTTMonomialParams', 'ID_1': '', 'VAR_19': 'in', 'VAR_20': 'std', 'CLASS_6': 'std', 'VAR_21': 'string', 'VAR_22': 'path', 'CLASS_7': 'GroupXML_t', 'FUNC_14': 'read', 'VAR_23': 'p', 'VAR_24': 'xml', 'VAR_25': 'CentralTimePrecLogDetTTMonomial4D', 'CLASS_8': 'CentralTimePrecLogDetTTMonomial4D', 'FUNC_15': 'CentralTimePrecLogDetTTMonomial4D', 'VAR_26': 'LatticeFermion', 'CLASS_9': 'LatticeFermion', 'VAR_27': 'void'}
//========================================================================================= /** * @brief Continue registration in the enclosing namespace. * * @returns A parent registration object. */ Namespace endClass() { assert(m_stackSize > 3); m_stackSize -= 3; lua_pop(L, 3); return Namespace(*this); }
//========================================================================================= /** * @brief Continue registration in the enclosing namespace. * * @returns A parent registration object. */ Namespace endClass() { assert(m_stackSize > 3); m_stackSize -= 3; lua_pop(L, 3); return Namespace(*this); }
0.097482
{}
#include <stdio.h> int main(){ int *m; int count = 100; m = &count; printf(" Endereco de 'count': %p\n", &count); printf(" Endereco de 'm': %p\n", &m); printf("Endereco de apontado por 'm': %d\n", m); return 0; }
#include <stdio.h> int FUNC_0(){ int *m; int count = 100; m = &count; printf(" Endereco de 'count': %p\n", &count); printf(" Endereco de 'm': %p\n", &m); printf("Endereco de apontado por 'm': %d\n", m); return 0; }
0.123635
{'FUNC_0': 'main'}
// // ViewController.h // Tip Calculator // // Created by <NAME> on 27/04/2016. // Copyright © 2016 Training. All rights reserved. // #import <UIKit/UIKit.h> @interface MainViewController : UIViewController @end
// // ViewController.h // Tip Calculator // // Created by <NAME> on 27/04/2016. // Copyright © 2016 Training. All rights reserved. // #import <UIKit/UIKit.h> @interface MainViewController : UIViewController @VAR_0
0.482991
{'VAR_0': 'end'}
/* * Copyright (c) 2015-2019 Intel Corporation. * All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * */ #ifndef _DEADLOOP_H #define _DEADLOOP_H #ifndef MODULE_DEADLOOP #error "MODULE_DEADLOOP is not defined" #endif #include "gcpu.h" boolean_t deadloop_setup(guest_cpu_handle_t gcpu, uint64_t dump_gva); #endif
/* * Copyright (c) 2015-2019 Intel Corporation. * All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * */ #ifndef _DEADLOOP_H #define _DEADLOOP_H #ifndef MODULE_DEADLOOP #error "MODULE_DEADLOOP is not defined" #endif #include "gcpu.h" boolean_t deadloop_setup(guest_cpu_handle_t gcpu, uint64_t dump_gva); #endif
0.10878
{}
#pragma once #include "Oniguruma/oniguruma.h" namespace mx { class COnigurumaRegion { public : COnigurumaRegion() : m_porRegion( ::onig_region_new() ) { } ~COnigurumaRegion() { ::onig_region_free( m_porRegion, 1 ); } // == Functions. // Gets the refion pointer. OnigRegion * Get() { return m_porRegion; } protected : // == Members. // The region. OnigRegion * m_porRegion; }; } // namespace mx
#pragma once #include "Oniguruma/oniguruma.h" namespace mx { class COnigurumaRegion { public : COnigurumaRegion() : m_porRegion( ::onig_region_new() ) { } ~COnigurumaRegion() { ::onig_region_free( m_porRegion, 1 ); } // == Functions. // Gets the refion pointer. OnigRegion * Get() { return m_porRegion; } protected : // == Members. // The region. OnigRegion * m_porRegion; }; } // namespace mx
0.032066
{}
/* * Check to see if obj is going to break, but don't actually break it. * Return 0 if the object isn't going to break, 1 if it is. */ boolean breaktest(struct obj *obj) { if (obj_resists(obj, 1, 99)) return 0; if (objects[obj->otyp].oc_material == GLASS && !obj->oartifact && obj->oclass != GEM_CLASS) return 1; switch (obj->oclass == POTION_CLASS ? POT_WATER : obj->otyp) { case EXPENSIVE_CAMERA: case POT_WATER: case EGG: case CREAM_PIE: case MELON: case ACID_VENOM: case BLINDING_VENOM: return 1; default: return 0; } }
/* * Check to see if obj is going to break, but don't actually break it. * Return 0 if the object isn't going to break, 1 if it is. */ boolean breaktest(struct CLASS_0 *VAR_0) { if (obj_resists(VAR_0, 1, 99)) return 0; if (objects[VAR_0->VAR_1].VAR_2 == VAR_3 && !VAR_0->VAR_4 && VAR_0->oclass != VAR_5) return 1; switch (VAR_0->oclass == POTION_CLASS ? VAR_6 : VAR_0->VAR_1) { case EXPENSIVE_CAMERA: case VAR_6: case VAR_7: case VAR_8: case VAR_9: case VAR_10: case BLINDING_VENOM: return 1; default: return 0; } }
0.501366
{'CLASS_0': 'obj', 'VAR_0': 'obj', 'VAR_1': 'otyp', 'VAR_2': 'oc_material', 'VAR_3': 'GLASS', 'VAR_4': 'oartifact', 'VAR_5': 'GEM_CLASS', 'VAR_6': 'POT_WATER', 'VAR_7': 'EGG', 'VAR_8': 'CREAM_PIE', 'VAR_9': 'MELON', 'VAR_10': 'ACID_VENOM'}
#include <FreeRTOS.h> #include <semphr.h> #include <log.h> #include <timer.h> #include "imu_types.h" #include "imu_internal.h" #define CONVERT_MS_TO_TICKS(x) (x/portTICK_RATE_MS) #define IMU_INITIAL_SAMPLE_RATE (1000) #define IMU_MIN_SAMPLE_RATE (10) #define IMU_MAX_SAMPLE_RATE (10000) /* Struct Foward declaration */ typedef struct state_struct state_t; /* Function pointer type */ typedef void (*imuFuncPtr)(state_t *); struct state_struct { imuTaskConfig_t *config; imuFuncPtr next; }; /* State Machine Functions */ static void MPU6050_Initialization(state_t *state); static void MPU6050_Wait(state_t *state); static void MPU6050_Run(state_t *state); static int MPU6050_SampleImuData(eMPU6050_BASE mpu, dataIMU_t *data); static void MPU6050_DataReady_Cb(eMPU6050_BASE mpu); /* Mutex to control concurrent access to the I2C peripheral */ static SemaphoreHandle_t mtxI2C = NULL; /* Mutex notification when IMU Data is ready */ static SemaphoreHandle_t xIMUDataReadySem[2] = { NULL }; /* IMU sample rate in milliseconds */ static uint32_t u32SampleRate = CONVERT_MS_TO_TICKS(IMU_INITIAL_SAMPLE_RATE); void vMPU6050Task(void *pvParameters) { state_t stMPU6050Task = { 0 }; imuTaskConfig_t *taskParam = (( imuTaskConfig_t * ) pvParameters); /* Initialize I2C Mutex for this task only once */ if (mtxI2C == NULL) { mtxI2C = xSemaphoreCreateMutex(); } /* Run State Machine */ stMPU6050Task.config = taskParam; stMPU6050Task.next = MPU6050_Initialization; /* Initial State */ while (stMPU6050Task.next != NULL) { stMPU6050Task.next(&stMPU6050Task); } /* Delete task when State Machine finishes */ taskParam->taskHandler = NULL; ERROR("Delete [%s] Task!", taskParam->name); vTaskDelete(NULL); } int MPU6050Task_SetSampleRate(uint32_t sample_rate) { int ret = -1; if ((sample_rate >= IMU_MIN_SAMPLE_RATE) && (sample_rate <= IMU_MAX_SAMPLE_RATE)) { u32SampleRate = CONVERT_MS_TO_TICKS(sample_rate); ret = 0; } return ret; } static void MPU6050_Initialization(state_t *state) { /* Lock I2C mutex */ xSemaphoreTake(mtxI2C, portMAX_DELAY); if (MPU6050_Enable(state->config->mpu, state->config->i2c, GetMillis) != 0) { ERROR("[%s] Enable Error!", state->config->name); state->next = NULL; goto end_mpu6050_initialization; } /* Initialize the Interrupt GPIO */ int retGpioInt = MPU6050_ConfigInterrupt(state->config->mpu, state->config->gpio_int, MPU6050_DataReady_Cb); if (retGpioInt != 0) { ERROR("[%s] Interrupt Configuration Error!", state->config->name); state->next = NULL; goto end_mpu6050_initialization; } /* Attempt to create a semaphore. */ if (xIMUDataReadySem[state->config->mpu] == NULL) { xIMUDataReadySem[state->config->mpu] = xSemaphoreCreateBinary(); } end_mpu6050_initialization: /* Release I2C mutex */ xSemaphoreGive(mtxI2C); if (state->next != NULL) { /* Start IMU Sample */ state->next = MPU6050_Wait; } } static void MPU6050_Wait(state_t *state) { state->config->xLastWakeTime = 0U; vTaskDelay((TickType_t)u32SampleRate); if (state->config->bRunSample == true) { state->next = MPU6050_Run; } } static void MPU6050_Run(state_t *state) { /* Wait IMU Data to be ready */ if (xSemaphoreTake(xIMUDataReadySem[state->config->mpu], (u32SampleRate/10)) != pdTRUE) { WARN("[%s] IMU Data not Ready!", state->config->name); } /* Lock I2C mutex */ xSemaphoreTake(mtxI2C, portMAX_DELAY); dataIMU_t dataimu = { 0 }; dataimu.imu = state->config->name; int ret = MPU6050_SampleImuData(state->config->mpu, &dataimu); /* Release I2C mutex */ xSemaphoreGive(mtxI2C); /* Check if the data was successful sample */ if (ret == 0) { /* Send IMU data via queue */ if (xQueueSend(state->config->queue, (void *)&dataimu, portMAX_DELAY) != pdTRUE) { ERROR("Full queue!"); } } else { ERROR("Error IMU Read!"); } /* Timer initialization */ if (state->config->xLastWakeTime == 0U) { state->config->xLastWakeTime = xTaskGetTickCount(); } vTaskDelayUntil(&state->config->xLastWakeTime, (TickType_t)u32SampleRate); /* Stop sampling if the flag was reset */ if (state->config->bRunSample == false) { state->next = MPU6050_Wait; } } static int MPU6050_SampleImuData(eMPU6050_BASE mpu, dataIMU_t *data) { int ret = 0; /* Check invalid pointer */ if (data == NULL) { return -1; } /* Store sample time in ms */ data->ms = GetMillis(); /* Sample Accelerometer */ ret += MPU6050_ReadAllAccel(mpu, &data->accel); /* Sample Gyroscope */ ret += MPU6050_ReadAllGyro(mpu, &data->gyro); /* Sample Temperature */ ret += MPU6050_ReadTemperature(mpu, &data->temperature); return ret; } static void MPU6050_DataReady_Cb(eMPU6050_BASE mpu) { /* Check if the semaphore is initialized */ if (xIMUDataReadySem[mpu] != NULL) { xSemaphoreGiveFromISR(xIMUDataReadySem[mpu], NULL); } }
#include <IMPORT_0> #include <IMPORT_1> #include <log.h> #include <IMPORT_2> #include "imu_types.h" #include "imu_internal.h" #define CONVERT_MS_TO_TICKS(x) (x/portTICK_RATE_MS) #define VAR_0 (1000) #define IMU_MIN_SAMPLE_RATE (10) #define IMU_MAX_SAMPLE_RATE (10000) /* Struct Foward declaration */ typedef struct state_struct state_t; /* Function pointer type */ typedef void (*CLASS_0)(state_t *); struct state_struct { imuTaskConfig_t *VAR_1; CLASS_0 VAR_2; }; /* State Machine Functions */ static void FUNC_1(state_t *VAR_4); static void MPU6050_Wait(state_t *VAR_4); static void FUNC_2(state_t *VAR_4); static int MPU6050_SampleImuData(CLASS_1 VAR_6, dataIMU_t *VAR_7); static void FUNC_3(CLASS_1 VAR_6); /* Mutex to control concurrent access to the I2C peripheral */ static SemaphoreHandle_t VAR_9 = NULL; /* Mutex notification when IMU Data is ready */ static SemaphoreHandle_t VAR_10[2] = { NULL }; /* IMU sample rate in milliseconds */ static uint32_t VAR_11 = CONVERT_MS_TO_TICKS(VAR_0); void vMPU6050Task(void *pvParameters) { state_t stMPU6050Task = { 0 }; imuTaskConfig_t *taskParam = (( imuTaskConfig_t * ) pvParameters); /* Initialize I2C Mutex for this task only once */ if (VAR_9 == NULL) { VAR_9 = xSemaphoreCreateMutex(); } /* Run State Machine */ stMPU6050Task.VAR_1 = taskParam; stMPU6050Task.VAR_2 = VAR_3; /* Initial State */ while (stMPU6050Task.VAR_2 != NULL) { stMPU6050Task.FUNC_0(&stMPU6050Task); } /* Delete task when State Machine finishes */ taskParam->taskHandler = NULL; FUNC_4("Delete [%s] Task!", taskParam->name); FUNC_5(NULL); } int FUNC_6(uint32_t VAR_12) { int VAR_13 = -1; if ((VAR_12 >= IMU_MIN_SAMPLE_RATE) && (VAR_12 <= IMU_MAX_SAMPLE_RATE)) { VAR_11 = CONVERT_MS_TO_TICKS(VAR_12); VAR_13 = 0; } return VAR_13; } static void FUNC_1(state_t *VAR_4) { /* Lock I2C mutex */ FUNC_7(VAR_9, portMAX_DELAY); if (FUNC_8(VAR_4->VAR_1->VAR_6, VAR_4->VAR_1->i2c, VAR_14) != 0) { FUNC_4("[%s] Enable Error!", VAR_4->VAR_1->name); VAR_4->VAR_2 = NULL; goto end_mpu6050_initialization; } /* Initialize the Interrupt GPIO */ int retGpioInt = MPU6050_ConfigInterrupt(VAR_4->VAR_1->VAR_6, VAR_4->VAR_1->VAR_15, VAR_8); if (retGpioInt != 0) { FUNC_4("[%s] Interrupt Configuration Error!", VAR_4->VAR_1->name); VAR_4->VAR_2 = NULL; goto end_mpu6050_initialization; } /* Attempt to create a semaphore. */ if (VAR_10[VAR_4->VAR_1->VAR_6] == NULL) { VAR_10[VAR_4->VAR_1->VAR_6] = xSemaphoreCreateBinary(); } end_mpu6050_initialization: /* Release I2C mutex */ xSemaphoreGive(VAR_9); if (VAR_4->VAR_2 != NULL) { /* Start IMU Sample */ VAR_4->VAR_2 = MPU6050_Wait; } } static void MPU6050_Wait(state_t *VAR_4) { VAR_4->VAR_1->VAR_16 = 0U; FUNC_10((TickType_t)VAR_11); if (VAR_4->VAR_1->VAR_17 == true) { VAR_4->VAR_2 = VAR_5; } } static void FUNC_2(state_t *VAR_4) { /* Wait IMU Data to be ready */ if (FUNC_7(VAR_10[VAR_4->VAR_1->VAR_6], (VAR_11/10)) != pdTRUE) { WARN("[%s] IMU Data not Ready!", VAR_4->VAR_1->name); } /* Lock I2C mutex */ FUNC_7(VAR_9, portMAX_DELAY); dataIMU_t dataimu = { 0 }; dataimu.imu = VAR_4->VAR_1->name; int VAR_13 = MPU6050_SampleImuData(VAR_4->VAR_1->VAR_6, &dataimu); /* Release I2C mutex */ xSemaphoreGive(VAR_9); /* Check if the data was successful sample */ if (VAR_13 == 0) { /* Send IMU data via queue */ if (xQueueSend(VAR_4->VAR_1->VAR_18, (void *)&dataimu, portMAX_DELAY) != pdTRUE) { FUNC_4("Full queue!"); } } else { FUNC_4("Error IMU Read!"); } /* Timer initialization */ if (VAR_4->VAR_1->VAR_16 == 0U) { VAR_4->VAR_1->VAR_16 = xTaskGetTickCount(); } vTaskDelayUntil(&VAR_4->VAR_1->VAR_16, (TickType_t)VAR_11); /* Stop sampling if the flag was reset */ if (VAR_4->VAR_1->VAR_17 == false) { VAR_4->VAR_2 = MPU6050_Wait; } } static int MPU6050_SampleImuData(CLASS_1 VAR_6, dataIMU_t *VAR_7) { int VAR_13 = 0; /* Check invalid pointer */ if (VAR_7 == NULL) { return -1; } /* Store sample time in ms */ VAR_7->VAR_19 = FUNC_9(); /* Sample Accelerometer */ VAR_13 += FUNC_11(VAR_6, &VAR_7->accel); /* Sample Gyroscope */ VAR_13 += FUNC_12(VAR_6, &VAR_7->gyro); /* Sample Temperature */ VAR_13 += FUNC_13(VAR_6, &VAR_7->VAR_20); return VAR_13; } static void FUNC_3(CLASS_1 VAR_6) { /* Check if the semaphore is initialized */ if (VAR_10[VAR_6] != NULL) { xSemaphoreGiveFromISR(VAR_10[VAR_6], NULL); } }
0.558925
{'IMPORT_0': 'FreeRTOS.h', 'IMPORT_1': 'semphr.h', 'IMPORT_2': 'timer.h', 'VAR_0': 'IMU_INITIAL_SAMPLE_RATE', 'CLASS_0': 'imuFuncPtr', 'VAR_1': 'config', 'VAR_2': 'next', 'FUNC_0': 'next', 'FUNC_1': 'MPU6050_Initialization', 'VAR_3': 'MPU6050_Initialization', 'VAR_4': 'state', 'FUNC_2': 'MPU6050_Run', 'VAR_5': 'MPU6050_Run', 'CLASS_1': 'eMPU6050_BASE', 'VAR_6': 'mpu', 'VAR_7': 'data', 'FUNC_3': 'MPU6050_DataReady_Cb', 'VAR_8': 'MPU6050_DataReady_Cb', 'VAR_9': 'mtxI2C', 'VAR_10': 'xIMUDataReadySem', 'VAR_11': 'u32SampleRate', 'FUNC_4': 'ERROR', 'FUNC_5': 'vTaskDelete', 'FUNC_6': 'MPU6050Task_SetSampleRate', 'VAR_12': 'sample_rate', 'VAR_13': 'ret', 'FUNC_7': 'xSemaphoreTake', 'FUNC_8': 'MPU6050_Enable', 'VAR_14': 'GetMillis', 'FUNC_9': 'GetMillis', 'VAR_15': 'gpio_int', 'VAR_16': 'xLastWakeTime', 'FUNC_10': 'vTaskDelay', 'VAR_17': 'bRunSample', 'VAR_18': 'queue', 'VAR_19': 'ms', 'FUNC_11': 'MPU6050_ReadAllAccel', 'FUNC_12': 'MPU6050_ReadAllGyro', 'FUNC_13': 'MPU6050_ReadTemperature', 'VAR_20': 'temperature'}
/* mpn_sqr_basecase -- Internal routine to square a natural number of length n. THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES. Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * 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. or * 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. or both in parallel, as here. The GNU MP 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 General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not, see https://www.gnu.org/licenses/. */ #include "gmp.h" #include "gmp-impl.h" #include "longlong.h" #if HAVE_NATIVE_mpn_sqr_diagonal #define MPN_SQR_DIAGONAL(rp, up, n) \ mpn_sqr_diagonal (rp, up, n) #else #define MPN_SQR_DIAGONAL(rp, up, n) \ do { \ mp_size_t _i; \ for (_i = 0; _i < (n); _i++) \ { \ mp_limb_t ul, lpl; \ ul = (up)[_i]; \ umul_ppmm ((rp)[2 * _i + 1], lpl, ul, ul << GMP_NAIL_BITS); \ (rp)[2 * _i] = lpl >> GMP_NAIL_BITS; \ } \ } while (0) #endif #if HAVE_NATIVE_mpn_sqr_diag_addlsh1 #define MPN_SQR_DIAG_ADDLSH1(rp, tp, up, n) \ mpn_sqr_diag_addlsh1 (rp, tp, up, n) #else #if HAVE_NATIVE_mpn_addlsh1_n #define MPN_SQR_DIAG_ADDLSH1(rp, tp, up, n) \ do { \ mp_limb_t cy; \ MPN_SQR_DIAGONAL (rp, up, n); \ cy = mpn_addlsh1_n (rp + 1, rp + 1, tp, 2 * n - 2); \ rp[2 * n - 1] += cy; \ } while (0) #else #define MPN_SQR_DIAG_ADDLSH1(rp, tp, up, n) \ do { \ mp_limb_t cy; \ MPN_SQR_DIAGONAL (rp, up, n); \ cy = mpn_lshift (tp, tp, 2 * n - 2, 1); \ cy += mpn_add_n (rp + 1, rp + 1, tp, 2 * n - 2); \ rp[2 * n - 1] += cy; \ } while (0) #endif #endif #undef READY_WITH_mpn_sqr_basecase #if ! defined (READY_WITH_mpn_sqr_basecase) && HAVE_NATIVE_mpn_addmul_2s void mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n) { mp_size_t i; mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD]; mp_ptr tp = tarr; mp_limb_t cy; /* must fit 2*n limbs in tarr */ ASSERT (n <= SQR_TOOM2_THRESHOLD); if ((n & 1) != 0) { if (n == 1) { mp_limb_t ul, lpl; ul = up[0]; umul_ppmm (rp[1], lpl, ul, ul << GMP_NAIL_BITS); rp[0] = lpl >> GMP_NAIL_BITS; return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 2; i += 2) { cy = mpn_addmul_2s (tp + 2 * i, up + i + 1, n - (i + 1), up + i); tp[n + i] = cy; } } else { if (n == 2) { #if HAVE_NATIVE_mpn_mul_2 rp[3] = mpn_mul_2 (rp, up, 2, up); #else rp[0] = 0; rp[1] = 0; rp[3] = mpn_addmul_2 (rp, up, 2, up); #endif return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 4; i += 2) { cy = mpn_addmul_2s (tp + 2 * i, up + i + 1, n - (i + 1), up + i); tp[n + i] = cy; } cy = mpn_addmul_1 (tp + 2 * n - 4, up + n - 1, 1, up[n - 2]); tp[2 * n - 3] = cy; } MPN_SQR_DIAG_ADDLSH1 (rp, tp, up, n); } #define READY_WITH_mpn_sqr_basecase #endif #if ! defined (READY_WITH_mpn_sqr_basecase) && HAVE_NATIVE_mpn_addmul_2 /* mpn_sqr_basecase using plain mpn_addmul_2. This is tricky, since we have to let mpn_addmul_2 make some undesirable multiplies, u[k]*u[k], that we would like to let mpn_sqr_diagonal handle. This forces us to conditionally add or subtract the mpn_sqr_diagonal results. Examples of the product we form: n = 4 n = 5 n = 6 u1u0 * u3u2u1 u1u0 * u4u3u2u1 u1u0 * u5u4u3u2u1 u2 * u3 u3u2 * u4u3 u3u2 * u5u4u3 u4 * u5 add: u0 u2 u3 add: u0 u2 u4 add: u0 u2 u4 u5 sub: u1 sub: u1 u3 sub: u1 u3 */ void mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n) { mp_size_t i; mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD]; mp_ptr tp = tarr; mp_limb_t cy; /* must fit 2*n limbs in tarr */ ASSERT (n <= SQR_TOOM2_THRESHOLD); if ((n & 1) != 0) { mp_limb_t x0, x1; if (n == 1) { mp_limb_t ul, lpl; ul = up[0]; umul_ppmm (rp[1], lpl, ul, ul << GMP_NAIL_BITS); rp[0] = lpl >> GMP_NAIL_BITS; return; } /* The code below doesn't like unnormalized operands. Since such operands are unusual, handle them with a dumb recursion. */ if (up[n - 1] == 0) { rp[2 * n - 2] = 0; rp[2 * n - 1] = 0; mpn_sqr_basecase (rp, up, n - 1); return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 2; i += 2) { cy = mpn_addmul_2 (tp + 2 * i, up + i + 1, n - (i + 1), up + i); tp[n + i] = cy; } MPN_SQR_DIAGONAL (rp, up, n); for (i = 2;; i += 4) { x0 = rp[i + 0]; rp[i + 0] = (-x0) & GMP_NUMB_MASK; x1 = rp[i + 1]; rp[i + 1] = (-x1 - (x0 != 0)) & GMP_NUMB_MASK; __GMPN_SUB_1 (cy, rp + i + 2, rp + i + 2, 2, (x1 | x0) != 0); if (i + 4 >= 2 * n) break; mpn_incr_u (rp + i + 4, cy); } } else { mp_limb_t x0, x1; if (n == 2) { #if HAVE_NATIVE_mpn_mul_2 rp[3] = mpn_mul_2 (rp, up, 2, up); #else rp[0] = 0; rp[1] = 0; rp[3] = mpn_addmul_2 (rp, up, 2, up); #endif return; } /* The code below doesn't like unnormalized operands. Since such operands are unusual, handle them with a dumb recursion. */ if (up[n - 1] == 0) { rp[2 * n - 2] = 0; rp[2 * n - 1] = 0; mpn_sqr_basecase (rp, up, n - 1); return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 4; i += 2) { cy = mpn_addmul_2 (tp + 2 * i, up + i + 1, n - (i + 1), up + i); tp[n + i] = cy; } cy = mpn_addmul_1 (tp + 2 * n - 4, up + n - 1, 1, up[n - 2]); tp[2 * n - 3] = cy; MPN_SQR_DIAGONAL (rp, up, n); for (i = 2;; i += 4) { x0 = rp[i + 0]; rp[i + 0] = (-x0) & GMP_NUMB_MASK; x1 = rp[i + 1]; rp[i + 1] = (-x1 - (x0 != 0)) & GMP_NUMB_MASK; if (i + 6 >= 2 * n) break; __GMPN_SUB_1 (cy, rp + i + 2, rp + i + 2, 2, (x1 | x0) != 0); mpn_incr_u (rp + i + 4, cy); } mpn_decr_u (rp + i + 2, (x1 | x0) != 0); } #if HAVE_NATIVE_mpn_addlsh1_n cy = mpn_addlsh1_n (rp + 1, rp + 1, tp, 2 * n - 2); #else cy = mpn_lshift (tp, tp, 2 * n - 2, 1); cy += mpn_add_n (rp + 1, rp + 1, tp, 2 * n - 2); #endif rp[2 * n - 1] += cy; } #define READY_WITH_mpn_sqr_basecase #endif #if ! defined (READY_WITH_mpn_sqr_basecase) /* Default mpn_sqr_basecase using mpn_addmul_1. */ void mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n) { mp_size_t i; ASSERT (n >= 1); ASSERT (! MPN_OVERLAP_P (rp, 2*n, up, n)); { mp_limb_t ul, lpl; ul = up[0]; umul_ppmm (rp[1], lpl, ul, ul << GMP_NAIL_BITS); rp[0] = lpl >> GMP_NAIL_BITS; } if (n > 1) { mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD]; mp_ptr tp = tarr; mp_limb_t cy; /* must fit 2*n limbs in tarr */ ASSERT (n <= SQR_TOOM2_THRESHOLD); cy = mpn_mul_1 (tp, up + 1, n - 1, up[0]); tp[n - 1] = cy; for (i = 2; i < n; i++) { mp_limb_t cy; cy = mpn_addmul_1 (tp + 2 * i - 2, up + i, n - i, up[i - 1]); tp[n + i - 2] = cy; } MPN_SQR_DIAG_ADDLSH1 (rp, tp, up, n); } } #endif
/* mpn_sqr_basecase -- Internal routine to square a natural number of length n. THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES. Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * 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. or * 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. or both in parallel, as here. The GNU MP 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 General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not, see https://www.gnu.org/licenses/. */ #include "gmp.h" #include "gmp-impl.h" #include "longlong.h" #if HAVE_NATIVE_mpn_sqr_diagonal #define MPN_SQR_DIAGONAL(VAR_0, VAR_1, n) \ mpn_sqr_diagonal (rp, up, n) #else #define MPN_SQR_DIAGONAL(VAR_0, VAR_1, n) \ do { \ mp_size_t _i; \ for (_i = 0; _i < (n); _i++) \ { \ mp_limb_t ul, lpl; \ ul = (up)[_i]; \ umul_ppmm ((rp)[2 * _i + 1], lpl, ul, ul << GMP_NAIL_BITS); \ (rp)[2 * _i] = lpl >> GMP_NAIL_BITS; \ } \ } while (0) #endif #if VAR_2 #define MPN_SQR_DIAG_ADDLSH1(VAR_0, tp, VAR_1, n) \ mpn_sqr_diag_addlsh1 (rp, tp, up, n) #else #if HAVE_NATIVE_mpn_addlsh1_n #define MPN_SQR_DIAG_ADDLSH1(VAR_0, tp, VAR_1, n) \ do { \ mp_limb_t cy; \ MPN_SQR_DIAGONAL (rp, up, n); \ cy = mpn_addlsh1_n (rp + 1, rp + 1, tp, 2 * n - 2); \ rp[2 * n - 1] += cy; \ } while (0) #else #define MPN_SQR_DIAG_ADDLSH1(VAR_0, tp, VAR_1, n) \ do { \ mp_limb_t cy; \ MPN_SQR_DIAGONAL (rp, up, n); \ cy = mpn_lshift (tp, tp, 2 * n - 2, 1); \ cy += mpn_add_n (rp + 1, rp + 1, tp, 2 * n - 2); \ rp[2 * n - 1] += cy; \ } while (0) #endif #endif #undef READY_WITH_mpn_sqr_basecase #if ! defined (READY_WITH_mpn_sqr_basecase) && VAR_3 void FUNC_0 (CLASS_0 VAR_0, mp_srcptr VAR_1, mp_size_t n) { mp_size_t i; CLASS_1 VAR_4[2 * VAR_5]; CLASS_0 tp = VAR_4; CLASS_1 cy; /* must fit 2*n limbs in tarr */ ASSERT (n <= VAR_5); if ((n & 1) != 0) { if (n == 1) { CLASS_1 VAR_6, lpl; VAR_6 = VAR_1[0]; FUNC_1 (VAR_0[1], lpl, VAR_6, VAR_6 << VAR_7); VAR_0[0] = lpl >> VAR_7; return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 2; i += 2) { cy = FUNC_2 (tp + 2 * i, VAR_1 + i + 1, n - (i + 1), VAR_1 + i); tp[n + i] = cy; } } else { if (n == 2) { #if HAVE_NATIVE_mpn_mul_2 VAR_0[3] = FUNC_3 (VAR_0, VAR_1, 2, VAR_1); #else VAR_0[0] = 0; VAR_0[1] = 0; VAR_0[3] = FUNC_4 (VAR_0, VAR_1, 2, VAR_1); #endif return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 4; i += 2) { cy = FUNC_2 (tp + 2 * i, VAR_1 + i + 1, n - (i + 1), VAR_1 + i); tp[n + i] = cy; } cy = mpn_addmul_1 (tp + 2 * n - 4, VAR_1 + n - 1, 1, VAR_1[n - 2]); tp[2 * n - 3] = cy; } MPN_SQR_DIAG_ADDLSH1 (VAR_0, tp, VAR_1, n); } #define READY_WITH_mpn_sqr_basecase #endif #if ! defined (READY_WITH_mpn_sqr_basecase) && VAR_8 /* mpn_sqr_basecase using plain mpn_addmul_2. This is tricky, since we have to let mpn_addmul_2 make some undesirable multiplies, u[k]*u[k], that we would like to let mpn_sqr_diagonal handle. This forces us to conditionally add or subtract the mpn_sqr_diagonal results. Examples of the product we form: n = 4 n = 5 n = 6 u1u0 * u3u2u1 u1u0 * u4u3u2u1 u1u0 * u5u4u3u2u1 u2 * u3 u3u2 * u4u3 u3u2 * u5u4u3 u4 * u5 add: u0 u2 u3 add: u0 u2 u4 add: u0 u2 u4 u5 sub: u1 sub: u1 u3 sub: u1 u3 */ void FUNC_0 (CLASS_0 VAR_0, mp_srcptr VAR_1, mp_size_t n) { mp_size_t i; CLASS_1 VAR_4[2 * VAR_5]; CLASS_0 tp = VAR_4; CLASS_1 cy; /* must fit 2*n limbs in tarr */ ASSERT (n <= VAR_5); if ((n & 1) != 0) { CLASS_1 x0, x1; if (n == 1) { CLASS_1 VAR_6, lpl; VAR_6 = VAR_1[0]; FUNC_1 (VAR_0[1], lpl, VAR_6, VAR_6 << VAR_7); VAR_0[0] = lpl >> VAR_7; return; } /* The code below doesn't like unnormalized operands. Since such operands are unusual, handle them with a dumb recursion. */ if (VAR_1[n - 1] == 0) { VAR_0[2 * n - 2] = 0; VAR_0[2 * n - 1] = 0; FUNC_0 (VAR_0, VAR_1, n - 1); return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 2; i += 2) { cy = FUNC_4 (tp + 2 * i, VAR_1 + i + 1, n - (i + 1), VAR_1 + i); tp[n + i] = cy; } MPN_SQR_DIAGONAL (VAR_0, VAR_1, n); for (i = 2;; i += 4) { x0 = VAR_0[i + 0]; VAR_0[i + 0] = (-x0) & GMP_NUMB_MASK; x1 = VAR_0[i + 1]; VAR_0[i + 1] = (-x1 - (x0 != 0)) & GMP_NUMB_MASK; FUNC_5 (cy, VAR_0 + i + 2, VAR_0 + i + 2, 2, (x1 | x0) != 0); if (i + 4 >= 2 * n) break; mpn_incr_u (VAR_0 + i + 4, cy); } } else { CLASS_1 x0, x1; if (n == 2) { #if HAVE_NATIVE_mpn_mul_2 VAR_0[3] = FUNC_3 (VAR_0, VAR_1, 2, VAR_1); #else VAR_0[0] = 0; VAR_0[1] = 0; VAR_0[3] = FUNC_4 (VAR_0, VAR_1, 2, VAR_1); #endif return; } /* The code below doesn't like unnormalized operands. Since such operands are unusual, handle them with a dumb recursion. */ if (VAR_1[n - 1] == 0) { VAR_0[2 * n - 2] = 0; VAR_0[2 * n - 1] = 0; FUNC_0 (VAR_0, VAR_1, n - 1); return; } MPN_ZERO (tp, n); for (i = 0; i <= n - 4; i += 2) { cy = FUNC_4 (tp + 2 * i, VAR_1 + i + 1, n - (i + 1), VAR_1 + i); tp[n + i] = cy; } cy = mpn_addmul_1 (tp + 2 * n - 4, VAR_1 + n - 1, 1, VAR_1[n - 2]); tp[2 * n - 3] = cy; MPN_SQR_DIAGONAL (VAR_0, VAR_1, n); for (i = 2;; i += 4) { x0 = VAR_0[i + 0]; VAR_0[i + 0] = (-x0) & GMP_NUMB_MASK; x1 = VAR_0[i + 1]; VAR_0[i + 1] = (-x1 - (x0 != 0)) & GMP_NUMB_MASK; if (i + 6 >= 2 * n) break; FUNC_5 (cy, VAR_0 + i + 2, VAR_0 + i + 2, 2, (x1 | x0) != 0); mpn_incr_u (VAR_0 + i + 4, cy); } mpn_decr_u (VAR_0 + i + 2, (x1 | x0) != 0); } #if HAVE_NATIVE_mpn_addlsh1_n cy = FUNC_6 (VAR_0 + 1, VAR_0 + 1, tp, 2 * n - 2); #else cy = FUNC_7 (tp, tp, 2 * n - 2, 1); cy += FUNC_8 (VAR_0 + 1, VAR_0 + 1, tp, 2 * n - 2); #endif VAR_0[2 * n - 1] += cy; } #define READY_WITH_mpn_sqr_basecase #endif #if ! defined (READY_WITH_mpn_sqr_basecase) /* Default mpn_sqr_basecase using mpn_addmul_1. */ void FUNC_0 (CLASS_0 VAR_0, mp_srcptr VAR_1, mp_size_t n) { mp_size_t i; ASSERT (n >= 1); ASSERT (! FUNC_9 (VAR_0, 2*n, VAR_1, n)); { CLASS_1 VAR_6, lpl; VAR_6 = VAR_1[0]; FUNC_1 (VAR_0[1], lpl, VAR_6, VAR_6 << VAR_7); VAR_0[0] = lpl >> VAR_7; } if (n > 1) { CLASS_1 VAR_4[2 * VAR_5]; CLASS_0 tp = VAR_4; CLASS_1 cy; /* must fit 2*n limbs in tarr */ ASSERT (n <= VAR_5); cy = mpn_mul_1 (tp, VAR_1 + 1, n - 1, VAR_1[0]); tp[n - 1] = cy; for (i = 2; i < n; i++) { CLASS_1 cy; cy = mpn_addmul_1 (tp + 2 * i - 2, VAR_1 + i, n - i, VAR_1[i - 1]); tp[n + i - 2] = cy; } MPN_SQR_DIAG_ADDLSH1 (VAR_0, tp, VAR_1, n); } } #endif
0.626365
{'VAR_0': 'rp', 'VAR_1': 'up', 'VAR_2': 'HAVE_NATIVE_mpn_sqr_diag_addlsh1', 'VAR_3': 'HAVE_NATIVE_mpn_addmul_2s', 'FUNC_0': 'mpn_sqr_basecase', 'CLASS_0': 'mp_ptr', 'CLASS_1': 'mp_limb_t', 'VAR_4': 'tarr', 'VAR_5': 'SQR_TOOM2_THRESHOLD', 'VAR_6': 'ul', 'FUNC_1': 'umul_ppmm', 'VAR_7': 'GMP_NAIL_BITS', 'FUNC_2': 'mpn_addmul_2s', 'FUNC_3': 'mpn_mul_2', 'FUNC_4': 'mpn_addmul_2', 'VAR_8': 'HAVE_NATIVE_mpn_addmul_2', 'FUNC_5': '__GMPN_SUB_1', 'FUNC_6': 'mpn_addlsh1_n', 'FUNC_7': 'mpn_lshift', 'FUNC_8': 'mpn_add_n', 'FUNC_9': 'MPN_OVERLAP_P'}
// Copyright 2014 The Crashpad Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef CRASHPAD_UTIL_STDLIB_CXX_H_ #define CRASHPAD_UTIL_STDLIB_CXX_H_ #include "build/build_config.h" #if defined(COMPILER_MSVC) #define CXX_LIBRARY_VERSION 2011 #define CXX_LIBRARY_HAS_CONSTEXPR 0 #else // !COMPILER_MSVC // <ciso646> doesn’t do very much, and under libc++, it will cause the // _LIBCPP_VERSION macro to be defined properly. Under libstdc++, it doesn’t // cause __GLIBCXX__ to be defined, but if _LIBCPP_VERSION isn’t defined after // #including <ciso646>, assume libstdc++ and #include libstdc++’s internal // header that defines __GLIBCXX__. #include <ciso646> #if !defined(_LIBCPP_VERSION) #if defined(__has_include) #if __has_include(<bits/c++config.h>) #include <bits/c++config.h> #endif #else #include <bits/c++config.h> #endif #endif // libstdc++ does not identify its version directly, but identifies the GCC // package it is a part of via the __GLIBCXX__ macro, which is based on the date // of the GCC release. libstdc++ had sufficient C++11 support as of GCC 4.6.0, // __GLIBCXX__ 20110325, but maintenance releases in the 4.4 an 4.5 series // followed this date, so check for those versions by their date stamps. // http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning // // libc++, identified by _LIBCPP_VERSION, always supports C++11. #if __cplusplus >= 201103l && \ ((defined(__GLIBCXX__) && \ __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \ __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \ __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \ __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \ __GLIBCXX__ != 20120702ul) || /* GCC 4.5.4 */ \ (defined(_LIBCPP_VERSION))) #define CXX_LIBRARY_VERSION 2011 #define CXX_LIBRARY_HAS_CONSTEXPR 1 #else #define CXX_LIBRARY_VERSION 2003 #define CXX_LIBRARY_HAS_CONSTEXPR 0 #endif #endif // COMPILER_MSVC #endif // CRASHPAD_UTIL_STDLIB_CXX_H_
// Copyright 2014 The Crashpad Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef CRASHPAD_UTIL_STDLIB_CXX_H_ #define CRASHPAD_UTIL_STDLIB_CXX_H_ #include "IMPORT_0" #if defined(COMPILER_MSVC) #define VAR_0 2011 #define CXX_LIBRARY_HAS_CONSTEXPR 0 #else // !COMPILER_MSVC // <ciso646> doesn’t do very much, and under libc++, it will cause the // _LIBCPP_VERSION macro to be defined properly. Under libstdc++, it doesn’t // cause __GLIBCXX__ to be defined, but if _LIBCPP_VERSION isn’t defined after // #including <ciso646>, assume libstdc++ and #include libstdc++’s internal // header that defines __GLIBCXX__. #include <IMPORT_1> #if !defined(VAR_1) #if defined(__has_include) #if __has_include(<bits/VAR_2++config.VAR_3>) #include <IMPORT_2> #endif #else #include <IMPORT_2> #endif #endif // libstdc++ does not identify its version directly, but identifies the GCC // package it is a part of via the __GLIBCXX__ macro, which is based on the date // of the GCC release. libstdc++ had sufficient C++11 support as of GCC 4.6.0, // __GLIBCXX__ 20110325, but maintenance releases in the 4.4 an 4.5 series // followed this date, so check for those versions by their date stamps. // http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning // // libc++, identified by _LIBCPP_VERSION, always supports C++11. #if __cplusplus >= 201103l && \ ((defined(__GLIBCXX__) && \ __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \ __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \ __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \ __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \ __GLIBCXX__ != 20120702ul) || /* GCC 4.5.4 */ \ (defined(VAR_1))) #define VAR_0 2011 #define CXX_LIBRARY_HAS_CONSTEXPR 1 #else #define VAR_0 2003 #define CXX_LIBRARY_HAS_CONSTEXPR 0 #endif #endif // COMPILER_MSVC #endif // CRASHPAD_UTIL_STDLIB_CXX_H_
0.358734
{'IMPORT_0': 'build/build_config.h', 'VAR_0': 'CXX_LIBRARY_VERSION', 'IMPORT_1': 'ciso646', 'VAR_1': '_LIBCPP_VERSION', 'VAR_2': 'c', 'VAR_3': 'h', 'IMPORT_2': 'bits/c++config.h'}
// // 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 NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2018 NVIDIA Corporation. All rights reserved. #ifndef APEX_NAME_SPACE_H #define APEX_NAME_SPACE_H #include "ApexUsingNamespace.h" /*! \file \brief Defines APEX namespace strings These are predefined framework namespaces in the named resource provider */ /*! \brief A namespace for names of collision groups (CollisionGroup). Each name in this namespace must map to a 5-bit integer in the range [0..31] (stored in a void*). The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_COLLISION_GROUP_NAME_SPACE "NSCollisionGroup" /*! \brief A namespace for names of GroupsMasks Each name in this namespace must map to a pointer to a persistent 128-bit GroupsMask type. The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_COLLISION_GROUP_128_NAME_SPACE "NSCollisionGroup128" /*! \brief A namespace for names of GroupsMasks64 Each name in this namespace must map to a pointer to a persistent 64-bit GroupsMask64 type. The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_COLLISION_GROUP_64_NAME_SPACE "NSCollisionGroup64" /*! \brief A namespace for names of collision group masks Each name in this namespace must map to a 32-bit integer (stored in a void*), wherein each bit represents a collision group (CollisionGroup). The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_COLLISION_GROUP_MASK_NAME_SPACE "NSCollisionGroupMask" /*! \brief Internal namespace for authorable asset types For examples, there are entries in this namespace for "ApexRenderMesh", "NxClothingAsset", "DestructibleAsset", etc... The values stored in this namespace are the namespace IDs of the authorable asset types. So if your module needs to get a pointer to a FooAsset created by module Foo, you can ask the ApexSDK for that asset's namespace ID. */ #define APEX_AUTHORABLE_ASSETS_TYPES_NAME_SPACE "AuthorableAssetTypes" /*! \brief Internal namespace for parameterized authorable assets */ #define APEX_NV_PARAM_AUTH_ASSETS_TYPES_NAME_SPACE "NvParamAuthorableAssetTypes" /*! \brief A namespace for graphical material names Each name in this namespace maps to a pointer to a game-engine defined graphical material data structure. APEX does not interpret or dereference this pointer in any way. APEX provides this pointer to the UserRenderResource::setMaterial(void *material) callback to the rendering engine. This mapping allows APEX assets to refer to game engine materials (e.g.: texture maps and shader programs) without imposing any limitations on what a game engine graphical material can contain. The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_MATERIALS_NAME_SPACE "ApexMaterials" /*! \brief A namespace for volumetric rendering material names */ #define APEX_VOLUME_RENDER_MATERIALS_NAME_SPACE "ApexVolumeRenderMaterials" /*! \brief A namespace for physical material names Each name in this namespace maps to MaterialID, which is a data type defined by the PhysX SDK. The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_PHYSICS_MATERIAL_NAME_SPACE "NSPhysicalMaterial" /*! \brief A namespace for custom vertex buffer semantics names Each name in this namespace maps to a pointer to a game-engine defined data structure identifying a custom vertex buffer semantic. APEX does not interpret or dereference this pointer in any way. APEX provides an array of these pointers in UserRenderVertexBufferDesc::customBuffersIdents, which is passed the rendering engine when requesting allocation of vertex buffers. */ #define APEX_CUSTOM_VB_NAME_SPACE "NSCustomVBNames" #endif // APEX_NAME_SPACE_H
// // 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 NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Copyright (c) 2018 NVIDIA Corporation. All rights reserved. #ifndef APEX_NAME_SPACE_H #define APEX_NAME_SPACE_H #include "IMPORT_0" /*! \file \brief Defines APEX namespace strings These are predefined framework namespaces in the named resource provider */ /*! \brief A namespace for names of collision groups (CollisionGroup). Each name in this namespace must map to a 5-bit integer in the range [0..31] (stored in a void*). The NRP will not automatically generate release requests for names in this namespace. */ #define VAR_0 "NSCollisionGroup" /*! \brief A namespace for names of GroupsMasks Each name in this namespace must map to a pointer to a persistent 128-bit GroupsMask type. The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_COLLISION_GROUP_128_NAME_SPACE "NSCollisionGroup128" /*! \brief A namespace for names of GroupsMasks64 Each name in this namespace must map to a pointer to a persistent 64-bit GroupsMask64 type. The NRP will not automatically generate release requests for names in this namespace. */ #define VAR_1 "NSCollisionGroup64" /*! \brief A namespace for names of collision group masks Each name in this namespace must map to a 32-bit integer (stored in a void*), wherein each bit represents a collision group (CollisionGroup). The NRP will not automatically generate release requests for names in this namespace. */ #define VAR_2 "NSCollisionGroupMask" /*! \brief Internal namespace for authorable asset types For examples, there are entries in this namespace for "ApexRenderMesh", "NxClothingAsset", "DestructibleAsset", etc... The values stored in this namespace are the namespace IDs of the authorable asset types. So if your module needs to get a pointer to a FooAsset created by module Foo, you can ask the ApexSDK for that asset's namespace ID. */ #define APEX_AUTHORABLE_ASSETS_TYPES_NAME_SPACE "AuthorableAssetTypes" /*! \brief Internal namespace for parameterized authorable assets */ #define VAR_3 "NvParamAuthorableAssetTypes" /*! \brief A namespace for graphical material names Each name in this namespace maps to a pointer to a game-engine defined graphical material data structure. APEX does not interpret or dereference this pointer in any way. APEX provides this pointer to the UserRenderResource::setMaterial(void *material) callback to the rendering engine. This mapping allows APEX assets to refer to game engine materials (e.g.: texture maps and shader programs) without imposing any limitations on what a game engine graphical material can contain. The NRP will not automatically generate release requests for names in this namespace. */ #define APEX_MATERIALS_NAME_SPACE "ApexMaterials" /*! \brief A namespace for volumetric rendering material names */ #define VAR_4 "ApexVolumeRenderMaterials" /*! \brief A namespace for physical material names Each name in this namespace maps to MaterialID, which is a data type defined by the PhysX SDK. The NRP will not automatically generate release requests for names in this namespace. */ #define VAR_5 "NSPhysicalMaterial" /*! \brief A namespace for custom vertex buffer semantics names Each name in this namespace maps to a pointer to a game-engine defined data structure identifying a custom vertex buffer semantic. APEX does not interpret or dereference this pointer in any way. APEX provides an array of these pointers in UserRenderVertexBufferDesc::customBuffersIdents, which is passed the rendering engine when requesting allocation of vertex buffers. */ #define APEX_CUSTOM_VB_NAME_SPACE "NSCustomVBNames" #endif // APEX_NAME_SPACE_H
0.609235
{'IMPORT_0': 'ApexUsingNamespace.h', 'VAR_0': 'APEX_COLLISION_GROUP_NAME_SPACE', 'VAR_1': 'APEX_COLLISION_GROUP_64_NAME_SPACE', 'VAR_2': 'APEX_COLLISION_GROUP_MASK_NAME_SPACE', 'VAR_3': 'APEX_NV_PARAM_AUTH_ASSETS_TYPES_NAME_SPACE', 'VAR_4': 'APEX_VOLUME_RENDER_MATERIALS_NAME_SPACE', 'VAR_5': 'APEX_PHYSICS_MATERIAL_NAME_SPACE'}
/** * Finalizes a digest out of `sink`'s current state. * * The `sink` must be `digest_flush`ed if it is a `large_umash`. * * @param index 0 to return the first (only, if hashing) value, 1 for the * second independent value for fingerprinting. */ static uint64_t digest(const struct umash_sink *sink, int index) { const size_t buf_begin = sizeof(sink->buf) - INCREMENTAL_GRANULARITY; const size_t shift = index * UMASH_PH_TOEPLITZ_SHIFT; if (sink->large_umash) return finalize(sink->poly_state[index].acc); if (sink->bufsz <= sizeof(uint64_t)) return umash_short( &sink->ph[shift], sink->seed, &sink->buf[buf_begin], sink->bufsz); return umash_medium(sink->poly_state[index].mul, &sink->ph[shift], sink->seed, &sink->buf[buf_begin], sink->bufsz); }
/** * Finalizes a digest out of `sink`'s current state. * * The `sink` must be `digest_flush`ed if it is a `large_umash`. * * @param index 0 to return the first (only, if hashing) value, 1 for the * second independent value for fingerprinting. */ static uint64_t FUNC_0(const struct CLASS_0 *VAR_0, int VAR_1) { const size_t VAR_2 = sizeof(VAR_0->VAR_3) - INCREMENTAL_GRANULARITY; const size_t shift = VAR_1 * VAR_4; if (VAR_0->VAR_5) return finalize(VAR_0->poly_state[VAR_1].VAR_6); if (VAR_0->VAR_7 <= sizeof(uint64_t)) return FUNC_1( &VAR_0->ph[shift], VAR_0->seed, &VAR_0->VAR_3[VAR_2], VAR_0->VAR_7); return umash_medium(VAR_0->poly_state[VAR_1].mul, &VAR_0->ph[shift], VAR_0->seed, &VAR_0->VAR_3[VAR_2], VAR_0->VAR_7); }
0.513893
{'FUNC_0': 'digest', 'CLASS_0': 'umash_sink', 'VAR_0': 'sink', 'VAR_1': 'index', 'VAR_2': 'buf_begin', 'VAR_3': 'buf', 'VAR_4': 'UMASH_PH_TOEPLITZ_SHIFT', 'VAR_5': 'large_umash', 'VAR_6': 'acc', 'VAR_7': 'bufsz', 'FUNC_1': 'umash_short'}
/** Returns the type of assignment the variable has */ static inline assignment_type_t trail_get_assignment_type(const mcsat_trail_t* trail, variable_t x) { assert(x < trail->type.size); return trail->type.data[x]; }
/** Returns the type of assignment the variable has */ static inline CLASS_0 FUNC_0(const mcsat_trail_t* VAR_0, CLASS_1 VAR_1) { FUNC_1(VAR_1 < VAR_0->VAR_2.VAR_3); return VAR_0->VAR_2.VAR_4[VAR_1]; }
0.81802
{'CLASS_0': 'assignment_type_t', 'FUNC_0': 'trail_get_assignment_type', 'VAR_0': 'trail', 'CLASS_1': 'variable_t', 'VAR_1': 'x', 'FUNC_1': 'assert', 'VAR_2': 'type', 'VAR_3': 'size', 'VAR_4': 'data'}
/* * Clean up UNVMe upon exit. */ static void do_unvme_cleanup(void) { unvme_close(unvme.ns); unvme.ns = NULL; }
/* * Clean up UNVMe upon exit. */ static void FUNC_0(void) { FUNC_1(unvme.VAR_0); unvme.VAR_0 = NULL; }
0.776258
{'FUNC_0': 'do_unvme_cleanup', 'FUNC_1': 'unvme_close', 'VAR_0': 'ns'}
#ifndef Geometry_TrackerNumberingBuilder_DDDCmsTrackerContruction_H #define Geometry_TrackerNumberingBuilder_DDDCmsTrackerContruction_H #include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" #include "FWCore/ParameterSet/interface/types.h" #include <string> #include <vector> #include <memory> class GeometricDet; class DDCompactView; /** * High level class to build a tracker. It will only build subdets, * then call subdet builders */ class DDDCmsTrackerContruction { public: DDDCmsTrackerContruction() = delete; ///takes ownership of detidShifts static std::unique_ptr<GeometricDet> construct(DDCompactView const& cpv, std::vector<int> const& detidShifts); }; #endif
#ifndef Geometry_TrackerNumberingBuilder_DDDCmsTrackerContruction_H #define Geometry_TrackerNumberingBuilder_DDDCmsTrackerContruction_H #include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" #include "FWCore/ParameterSet/interface/types.h" #include <string> #include <vector> #include <memory> class GeometricDet; class DDCompactView; /** * High level class to build a tracker. It will only build subdets, * then call subdet builders */ class DDDCmsTrackerContruction { public: DDDCmsTrackerContruction() = delete; ///takes ownership of detidShifts static std::unique_ptr<GeometricDet> construct(DDCompactView const& cpv, std::vector<int> const& detidShifts); }; #endif
0.045062
{}
/** * @brief Wrapper for cortexm_sleep calling power management callbacks * * @param[in] deep */ static inline void sam0_cortexm_sleep(int deep) { #ifdef MODULE_PERIPH_GPIO gpio_pm_cb_enter(deep); #endif cpu_pm_cb_enter(deep); cortexm_sleep(deep); cpu_pm_cb_leave(deep); #ifdef MODULE_PERIPH_GPIO gpio_pm_cb_leave(deep); #endif }
/** * @brief Wrapper for cortexm_sleep calling power management callbacks * * @param[in] deep */ static inline void sam0_cortexm_sleep(int deep) { #ifdef MODULE_PERIPH_GPIO FUNC_0(deep); #endif cpu_pm_cb_enter(deep); cortexm_sleep(deep); FUNC_1(deep); #ifdef MODULE_PERIPH_GPIO FUNC_2(deep); #endif }
0.203975
{'FUNC_0': 'gpio_pm_cb_enter', 'FUNC_1': 'cpu_pm_cb_leave', 'FUNC_2': 'gpio_pm_cb_leave'}
#import <Foundation/Foundation.h> @interface CDEEntityAutosaveInformation : NSObject #pragma mark - Creating - (instancetype)initWithEntityName:(NSString *)entityName items:(NSArray *)items; + (instancetype)newWithEntityName:(NSString *)entityName items:(NSArray *)items; #pragma mark - Properties @property (nonatomic, copy, readonly) NSString *entityName; @property (nonatomic, copy, readonly) NSArray *items; // contains CDEEntityAutosaveInformationItems @property (nonatomic, readonly) NSDictionary *dictionaryRepresentation; #pragma mark - Equality - (BOOL)isEqualToEntityAutosaveInformation:(CDEEntityAutosaveInformation *)entityAutosaveInformation; @end
#import <Foundation/Foundation.h> @interface CDEEntityAutosaveInformation : VAR_0 #pragma mark - Creating - (instancetype)initWithEntityName:(NSString *)entityName items:(NSArray *)items; + (instancetype)VAR_1:(NSString *)entityName items:(NSArray *)items; #pragma mark - Properties @FUNC_0 (nonatomic, copy, readonly) NSString *entityName; @FUNC_0 (nonatomic, copy, readonly) NSArray *items; // contains CDEEntityAutosaveInformationItems @FUNC_0 (nonatomic, readonly) NSDictionary *dictionaryRepresentation; #pragma mark - Equality - (BOOL)isEqualToEntityAutosaveInformation:(CDEEntityAutosaveInformation *)entityAutosaveInformation; @VAR_2
0.099997
{'VAR_0': 'NSObject', 'VAR_1': 'newWithEntityName', 'FUNC_0': 'property', 'VAR_2': 'end'}
// // NSDictionary+LYLog.h // LYProject // // Created by mac on 2019/9/16. // Copyright © 2019 mac. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface NSDictionary (LYLog) @end NS_ASSUME_NONNULL_END
// // NSDictionary+LYLog.h // LYProject // // Created by mac on 2019/9/16. // Copyright © 2019 mac. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface NSDictionary (LYLog) @end NS_ASSUME_NONNULL_END
0.012886
{}
#include "linea.h" #include <stddef.h> #include <stdio.h> linea_t *p_linea_parameter_block = NULL; font_hdr_t *p_linea_font_hdr = NULL; // See m68k arch: https://en.wikipedia.org/wiki/Motorola_68000#Architecture // data register #define D0_D2 "d0", "d1", "d2" // address register #define A0_A2 "a0", "a1", "a2" // condition code register #define AND_ASM_CC , "cc" // do we need hint for this ;) #define AND_ASM_MEMORY , "memory" #define _line_a_call(op_code) \ __asm__ volatile( \ "move.l %0,A0\n" \ "dc.w " op_code "\n" \ : /* outputs */ \ : "r"(p_linea_parameter_block) /* inputs */ \ : D0_D2, A0_A2 AND_ASM_CC AND_ASM_MEMORY /* side effect on */ \ ) void linea_init() { __asm__ volatile( "dc.w 0xA000\n" // Line-A opcode "move.l A0,%0\n" // Pointer parameter block LINEA "move.l A1,%1\n" // Pointer system fonts /* outputs */ : "=r"(p_linea_parameter_block), "=r"(p_linea_font_hdr) /* inputs */ : /* side effect on */ : D0_D2, A0_A2 AND_ASM_CC AND_ASM_MEMORY); } void linea_set_bit_plane(int8_t p1, int8_t p2, int8_t p3, int8_t p4) { p_linea_parameter_block->fg_bp_1 = p1; p_linea_parameter_block->fg_bp_2 = p2; p_linea_parameter_block->fg_bp_3 = p3; p_linea_parameter_block->fg_bp_4 = p4; } void linea_set_clip_region(int16_t enabled, int16_t x_min, int16_t y_min, int16_t x_max, int16_t y_max) { p_linea_parameter_block->clip = enabled; p_linea_parameter_block->xmn_clip = x_min; p_linea_parameter_block->ymn_clip = y_min; p_linea_parameter_block->xmx_clip = x_max; p_linea_parameter_block->ymx_clip = y_max; } void linea_put_pixel(int16_t x, int16_t y, int16_t color) { int16_t intin[] = {color}; p_linea_parameter_block->intin = intin; int16_t ptsin[] = {x, y}; p_linea_parameter_block->ptsin = ptsin; _line_a_call("0xA001"); } void linea_draw_line(int16_t x1, int16_t y1, int16_t x2, int16_t y2) { // Coordinate p_linea_parameter_block->x1 = x1; p_linea_parameter_block->y1 = y1; p_linea_parameter_block->x2 = x2; p_linea_parameter_block->y2 = y2; // Bit pattern for the line type; the bit pattern is to be interpreted as a dot pattern p_linea_parameter_block->ln_mask = 0xFFFF; // Writing mode; the following modes are possible: // - REPLACE 0 : Replace // - TRANS 1 : Transparent (OR) // - XOR 2 : Inverse (XOR) // - INVERS 3 : Inverse Transparent (XOR with not(LN_MASK)) p_linea_parameter_block->wrt_mode = 0; // Is the last pixel of the line to be drawn (1) or not (0) p_linea_parameter_block->lstlin = 1; _line_a_call("0xA003"); } void linea_draw_rect_filled(int16_t x1, int16_t y1, int16_t x2, int16_t y2) { // Coordinate p_linea_parameter_block->x1 = x1; p_linea_parameter_block->y1 = y1; p_linea_parameter_block->x2 = x2; p_linea_parameter_block->y2 = y2; // Writing mode; the following modes are possible: // - REPLACE 0 : Replace // - TRANS 1 : Transparent (OR) // - XOR 2 : Inverse (XOR) // - INVERS 3 : Inverse Transparent (XOR with not(LN_MASK)) p_linea_parameter_block->wrt_mode = 0; // Fill pattern uint16_t pattern[] = { 0x1000, }; p_linea_parameter_block->patptr = pattern; p_linea_parameter_block->patmsk = 0; _line_a_call("0xA005"); } void linea_set_mouse_visible(int8_t visible) { if (visible) { int16_t intin[] = {0}; p_linea_parameter_block->intin = intin; _line_a_call("0xA009"); } else { _line_a_call("0xA00A"); } } void linea_printf() { #ifdef ENABLE_STDLIB printf("===== LINE A CONTENT ====\n"); printf("p_linea_parameter_block: %p\n", p_linea_parameter_block); printf("p_linea_font_hdr: %p\n", p_linea_font_hdr); if (p_linea_parameter_block) { printf("\n\r"); printf(">> parameter_block (sizeof: %ld)\n", sizeof(linea_t)); printf("v_planes : %d\n\r", p_linea_parameter_block->v_planes); printf("v_lin_wr : %d\n\r", p_linea_parameter_block->v_lin_wr); printf("contrl : %p\n\r", p_linea_parameter_block->contrl); printf("intin : %p\n\r", p_linea_parameter_block->intin); printf("ptsin : %p\n\r", p_linea_parameter_block->ptsin); printf("intout : %p\n\r", p_linea_parameter_block->intout); printf("ptsout : %p\n\r", p_linea_parameter_block->ptsout); printf("fg_bp : [%d %d %d %d]\n\r", p_linea_parameter_block->fg_bp_1, p_linea_parameter_block->fg_bp_2, p_linea_parameter_block->fg_bp_3, p_linea_parameter_block->fg_bp_4); printf("lstlin : %d\n\r", p_linea_parameter_block->lstlin); printf("ln_mask : %d\n\r", p_linea_parameter_block->ln_mask); printf("wrt_mode : %d\n\r", p_linea_parameter_block->wrt_mode); printf("xy : (%d %d) (%d %d)\n\r", p_linea_parameter_block->x1, p_linea_parameter_block->y1, p_linea_parameter_block->x2, p_linea_parameter_block->y2); printf("patptr : %p\n\r", p_linea_parameter_block->patptr); printf("patmsk : %d\n\r", p_linea_parameter_block->patmsk); printf("multifill : %d\n\r", p_linea_parameter_block->multifill); printf("clip flag : %d\n\r", p_linea_parameter_block->clip); printf("clip rect : (%d %d) (%d %d)\n\r", p_linea_parameter_block->xmn_clip, p_linea_parameter_block->ymn_clip, p_linea_parameter_block->xmx_clip, p_linea_parameter_block->ymx_clip); printf("xacc_dda : %d\n\r", p_linea_parameter_block->xacc_dda); printf("dda_inc : %d\n\r", p_linea_parameter_block->dda_inc); printf("t_sclsts : %d\n\r", p_linea_parameter_block->t_sclsts); printf("mono_status: %d\n\r", p_linea_parameter_block->mono_status); printf("source : (%d %d)\n\r", p_linea_parameter_block->sourcex, p_linea_parameter_block->sourcey); printf("dest : (%d %d)\n\r", p_linea_parameter_block->destx, p_linea_parameter_block->desty); printf("del : (%d %d)\n\r", p_linea_parameter_block->delx, p_linea_parameter_block->dely); printf("fwidth : %d\n\r", p_linea_parameter_block->fwidth); printf("style : %d\n\r", p_linea_parameter_block->style); printf("litemask : %d\n\r", p_linea_parameter_block->litemask); printf("skewmask : %d\n\r", p_linea_parameter_block->skewmask); printf("weight : %d\n\r", p_linea_parameter_block->weight); printf("r_off : %d\n\r", p_linea_parameter_block->r_off); printf("l_off : %d\n\r", p_linea_parameter_block->l_off); printf("scale : %d\n\r", p_linea_parameter_block->scale); printf("chup : %d\n\r", p_linea_parameter_block->chup); printf("text_fg : %d\n\r", p_linea_parameter_block->text_fg); printf("text_bg : %d\n\r", p_linea_parameter_block->text_bg); printf("scrtchp : %p\n\r", p_linea_parameter_block->scrtchp); printf("scrpt2 : %d\n\r", p_linea_parameter_block->scrpt2); printf("copy_tran : %d\n\r", p_linea_parameter_block->copy_tran); } if (p_linea_font_hdr) { printf("\n\r"); printf(">> font hdr (sizeof: %ld)\n\r", sizeof(font_hdr_t)); printf("font_id : %d\n\r", p_linea_font_hdr->font_id); printf("point : %d\n\r", p_linea_font_hdr->point); printf("first_ade : %c\n\r", p_linea_font_hdr->first_ade); printf("last_ade : %c\n\r", p_linea_font_hdr->last_ade); } printf("=========================\n"); #endif // ENABLE_STDLIB }
#include "IMPORT_0" #include <IMPORT_1> #include <IMPORT_2> linea_t *p_linea_parameter_block = NULL; font_hdr_t *p_linea_font_hdr = NULL; // See m68k arch: https://en.wikipedia.org/wiki/Motorola_68000#Architecture // data register #define D0_D2 "d0", "d1", "d2" // address register #define VAR_0 "a0", "a1", "a2" // condition code register #define AND_ASM_CC , "cc" // do we need hint for this ;) #define VAR_1 , "memory" #define _line_a_call(op_code) \ __asm__ volatile( \ "move.l %0,A0\n" \ "dc.w " op_code "\n" \ : /* outputs */ \ : "r"(p_linea_parameter_block) /* inputs */ \ : D0_D2, VAR_0 AND_ASM_CC VAR_1 /* side effect on */ \ ) void FUNC_0() { __asm__ volatile( "dc.w 0xA000\n" // Line-A opcode "move.l A0,%0\n" // Pointer parameter block LINEA "move.l A1,%1\n" // Pointer system fonts /* outputs */ : "=r"(p_linea_parameter_block), "=r"(p_linea_font_hdr) /* inputs */ : /* side effect on */ : D0_D2, VAR_0 AND_ASM_CC VAR_1); } void linea_set_bit_plane(int8_t p1, int8_t VAR_2, int8_t p3, int8_t p4) { p_linea_parameter_block->fg_bp_1 = p1; p_linea_parameter_block->fg_bp_2 = VAR_2; p_linea_parameter_block->VAR_3 = p3; p_linea_parameter_block->VAR_4 = p4; } void FUNC_1(int16_t enabled, int16_t VAR_5, int16_t VAR_6, int16_t VAR_7, int16_t y_max) { p_linea_parameter_block->VAR_8 = enabled; p_linea_parameter_block->xmn_clip = VAR_5; p_linea_parameter_block->VAR_9 = VAR_6; p_linea_parameter_block->xmx_clip = VAR_7; p_linea_parameter_block->ymx_clip = y_max; } void linea_put_pixel(int16_t VAR_10, int16_t VAR_11, int16_t VAR_12) { int16_t intin[] = {VAR_12}; p_linea_parameter_block->intin = intin; int16_t ptsin[] = {VAR_10, VAR_11}; p_linea_parameter_block->ptsin = ptsin; _line_a_call("0xA001"); } void FUNC_2(int16_t x1, int16_t y1, int16_t VAR_13, int16_t VAR_14) { // Coordinate p_linea_parameter_block->x1 = x1; p_linea_parameter_block->y1 = y1; p_linea_parameter_block->VAR_13 = VAR_13; p_linea_parameter_block->VAR_14 = VAR_14; // Bit pattern for the line type; the bit pattern is to be interpreted as a dot pattern p_linea_parameter_block->ln_mask = 0xFFFF; // Writing mode; the following modes are possible: // - REPLACE 0 : Replace // - TRANS 1 : Transparent (OR) // - XOR 2 : Inverse (XOR) // - INVERS 3 : Inverse Transparent (XOR with not(LN_MASK)) p_linea_parameter_block->wrt_mode = 0; // Is the last pixel of the line to be drawn (1) or not (0) p_linea_parameter_block->lstlin = 1; _line_a_call("0xA003"); } void linea_draw_rect_filled(int16_t x1, int16_t y1, int16_t VAR_13, int16_t VAR_14) { // Coordinate p_linea_parameter_block->x1 = x1; p_linea_parameter_block->y1 = y1; p_linea_parameter_block->VAR_13 = VAR_13; p_linea_parameter_block->VAR_14 = VAR_14; // Writing mode; the following modes are possible: // - REPLACE 0 : Replace // - TRANS 1 : Transparent (OR) // - XOR 2 : Inverse (XOR) // - INVERS 3 : Inverse Transparent (XOR with not(LN_MASK)) p_linea_parameter_block->wrt_mode = 0; // Fill pattern uint16_t VAR_15[] = { 0x1000, }; p_linea_parameter_block->VAR_16 = VAR_15; p_linea_parameter_block->VAR_17 = 0; _line_a_call("0xA005"); } void FUNC_3(int8_t VAR_18) { if (VAR_18) { int16_t intin[] = {0}; p_linea_parameter_block->intin = intin; _line_a_call("0xA009"); } else { _line_a_call("0xA00A"); } } void linea_printf() { #ifdef ENABLE_STDLIB FUNC_4("===== LINE A CONTENT ====\n"); FUNC_4("p_linea_parameter_block: %p\n", p_linea_parameter_block); FUNC_4("p_linea_font_hdr: %p\n", p_linea_font_hdr); if (p_linea_parameter_block) { FUNC_4("\n\r"); FUNC_4(">> parameter_block (sizeof: %ld)\n", sizeof(linea_t)); FUNC_4("v_planes : %d\n\r", p_linea_parameter_block->VAR_19); FUNC_4("v_lin_wr : %d\n\r", p_linea_parameter_block->VAR_20); FUNC_4("contrl : %p\n\r", p_linea_parameter_block->contrl); FUNC_4("intin : %p\n\r", p_linea_parameter_block->intin); FUNC_4("ptsin : %p\n\r", p_linea_parameter_block->ptsin); FUNC_4("intout : %p\n\r", p_linea_parameter_block->VAR_21); FUNC_4("ptsout : %p\n\r", p_linea_parameter_block->ptsout); FUNC_4("fg_bp : [%d %d %d %d]\n\r", p_linea_parameter_block->fg_bp_1, p_linea_parameter_block->fg_bp_2, p_linea_parameter_block->VAR_3, p_linea_parameter_block->VAR_4); FUNC_4("lstlin : %d\n\r", p_linea_parameter_block->lstlin); FUNC_4("ln_mask : %d\n\r", p_linea_parameter_block->ln_mask); FUNC_4("wrt_mode : %d\n\r", p_linea_parameter_block->wrt_mode); FUNC_4("xy : (%d %d) (%d %d)\n\r", p_linea_parameter_block->x1, p_linea_parameter_block->y1, p_linea_parameter_block->VAR_13, p_linea_parameter_block->VAR_14); FUNC_4("patptr : %p\n\r", p_linea_parameter_block->VAR_16); FUNC_4("patmsk : %d\n\r", p_linea_parameter_block->VAR_17); FUNC_4("multifill : %d\n\r", p_linea_parameter_block->VAR_22); FUNC_4("clip flag : %d\n\r", p_linea_parameter_block->VAR_8); FUNC_4("clip rect : (%d %d) (%d %d)\n\r", p_linea_parameter_block->xmn_clip, p_linea_parameter_block->VAR_9, p_linea_parameter_block->xmx_clip, p_linea_parameter_block->ymx_clip); FUNC_4("xacc_dda : %d\n\r", p_linea_parameter_block->xacc_dda); FUNC_4("dda_inc : %d\n\r", p_linea_parameter_block->dda_inc); FUNC_4("t_sclsts : %d\n\r", p_linea_parameter_block->VAR_23); FUNC_4("mono_status: %d\n\r", p_linea_parameter_block->mono_status); FUNC_4("source : (%d %d)\n\r", p_linea_parameter_block->sourcex, p_linea_parameter_block->VAR_24); FUNC_4("dest : (%d %d)\n\r", p_linea_parameter_block->destx, p_linea_parameter_block->desty); FUNC_4("del : (%d %d)\n\r", p_linea_parameter_block->VAR_25, p_linea_parameter_block->dely); FUNC_4("fwidth : %d\n\r", p_linea_parameter_block->fwidth); FUNC_4("style : %d\n\r", p_linea_parameter_block->VAR_26); FUNC_4("litemask : %d\n\r", p_linea_parameter_block->VAR_27); FUNC_4("skewmask : %d\n\r", p_linea_parameter_block->VAR_28); FUNC_4("weight : %d\n\r", p_linea_parameter_block->weight); FUNC_4("r_off : %d\n\r", p_linea_parameter_block->r_off); FUNC_4("l_off : %d\n\r", p_linea_parameter_block->l_off); FUNC_4("scale : %d\n\r", p_linea_parameter_block->VAR_29); FUNC_4("chup : %d\n\r", p_linea_parameter_block->chup); FUNC_4("text_fg : %d\n\r", p_linea_parameter_block->VAR_30); FUNC_4("text_bg : %d\n\r", p_linea_parameter_block->text_bg); FUNC_4("scrtchp : %p\n\r", p_linea_parameter_block->VAR_31); FUNC_4("scrpt2 : %d\n\r", p_linea_parameter_block->VAR_32); FUNC_4("copy_tran : %d\n\r", p_linea_parameter_block->copy_tran); } if (p_linea_font_hdr) { FUNC_4("\n\r"); FUNC_4(">> font hdr (sizeof: %ld)\n\r", sizeof(font_hdr_t)); FUNC_4("font_id : %d\n\r", p_linea_font_hdr->font_id); FUNC_4("point : %d\n\r", p_linea_font_hdr->point); FUNC_4("first_ade : %c\n\r", p_linea_font_hdr->first_ade); FUNC_4("last_ade : %c\n\r", p_linea_font_hdr->last_ade); } FUNC_4("=========================\n"); #endif // ENABLE_STDLIB }
0.431251
{'IMPORT_0': 'linea.h', 'IMPORT_1': 'stddef.h', 'IMPORT_2': 'stdio.h', 'VAR_0': 'A0_A2', 'VAR_1': 'AND_ASM_MEMORY', 'FUNC_0': 'linea_init', 'VAR_2': 'p2', 'VAR_3': 'fg_bp_3', 'VAR_4': 'fg_bp_4', 'FUNC_1': 'linea_set_clip_region', 'VAR_5': 'x_min', 'VAR_6': 'y_min', 'VAR_7': 'x_max', 'VAR_8': 'clip', 'VAR_9': 'ymn_clip', 'VAR_10': 'x', 'VAR_11': 'y', 'VAR_12': 'color', 'FUNC_2': 'linea_draw_line', 'VAR_13': 'x2', 'VAR_14': 'y2', 'VAR_15': 'pattern', 'VAR_16': 'patptr', 'VAR_17': 'patmsk', 'FUNC_3': 'linea_set_mouse_visible', 'VAR_18': 'visible', 'FUNC_4': 'printf', 'VAR_19': 'v_planes', 'VAR_20': 'v_lin_wr', 'VAR_21': 'intout', 'VAR_22': 'multifill', 'VAR_23': 't_sclsts', 'VAR_24': 'sourcey', 'VAR_25': 'delx', 'VAR_26': 'style', 'VAR_27': 'litemask', 'VAR_28': 'skewmask', 'VAR_29': 'scale', 'VAR_30': 'text_fg', 'VAR_31': 'scrtchp', 'VAR_32': 'scrpt2'}
#ifndef MODRUBY_RUBY_APR_ARRAY_DECL #define MODRUBY_RUBY_APR_ARRAY_DECL #include "apr.h" extern "C" { void init_apr_array(VALUE module); VALUE apr_array_class(); VALUE make_apr_array(const apr_array_header_t* h); } // extern "C" #endif
#ifndef MODRUBY_RUBY_APR_ARRAY_DECL #define MODRUBY_RUBY_APR_ARRAY_DECL #include "apr.h" extern "C" { void init_apr_array(VALUE module); VALUE apr_array_class(); VALUE make_apr_array(const apr_array_header_t* h); } // extern "C" #endif
0.104756
{}
/* Copyright (C) 1992, 1993, 1994 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or distributor accepts any responsibility for the consequences of using it, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Refer to the Aladdin Ghostscript Free Public License (the "License") for full details. Every copy of Aladdin Ghostscript must include a copy of the License, normally in a plain ASCII text file named PUBLIC. The License grants you the right to copy, modify and redistribute Aladdin Ghostscript, but only under certain conditions described in the License. Among other things, the License requires that the copyright notice and this notice be preserved on all copies. */ /* zchar2.c */ /* Level 2 character operators */ #include "ghost.h" #include "errors.h" #include "oper.h" #include "gschar.h" #include "gsmatrix.h" /* for gxfont.h */ #include "gsstruct.h" /* for st_stream */ #include "gxfixed.h" /* for gxfont.h */ #include "gxfont.h" #include "estack.h" #include "ialloc.h" #include "ichar.h" #include "ifont.h" #include "igstate.h" #include "iname.h" #include "store.h" #include "stream.h" #include "ibnum.h" #include "gspath.h" /* gs_rmoveto prototype */ /* Table of continuation procedures. */ private int xshow_continue(P1(os_ptr)); private int yshow_continue(P1(os_ptr)); private int xyshow_continue(P1(os_ptr)); static const op_proc_p xyshow_continues[4] = { 0, xshow_continue, yshow_continue, xyshow_continue }; /* Forward references */ private int cshow_continue(P1(os_ptr)); private int moveshow(P2(os_ptr, int)); private int moveshow_continue(P2(os_ptr, int)); /* <proc> <string> cshow - */ private int zcshow(os_ptr op) { gs_show_enum *penum; int code; check_proc(op[-1]); if ( (code = op_show_setup(op, &penum)) < 0 ) return code; if ( (code = gs_cshow_n_init(penum, igs, (char *)op->value.bytes, r_size(op))) < 0 ) { ifree_object(penum, "op_show_enum_setup"); return code; } op_show_finish_setup(penum, 2, NULL); sslot = op[-1]; /* save kerning proc */ return cshow_continue(op - 2); } private int cshow_continue(os_ptr op) { gs_show_enum *penum = senum; int code = gs_show_next(penum); if ( code != gs_show_move ) { code = op_show_continue_dispatch(op, code); if ( code == o_push_estack ) /* must be gs_show_render */ { make_op_estack(esp - 1, cshow_continue); } else if ( code < 0 ) goto errx; return code; } /* Push the character code and width, and call the procedure. */ { gs_show_enum *penum = senum; ref *pslot = &sslot; gs_point wpt; gs_show_current_width(penum, &wpt); push(3); make_int(op - 2, gs_show_current_char(penum)); make_real(op - 1, wpt.x); make_real(op, wpt.y); push_op_estack(cshow_continue); *++esp = *pslot; /* user procedure */ } return o_push_estack; errx: op_show_free(); return code; } /* <charname> glyphshow - */ private int zglyphshow(os_ptr op) { gs_show_enum *penum; int code; check_type(*op, t_name); if ( (code = op_show_enum_setup(&penum)) < 0 ) return code; if ( (code = gs_glyphshow_init(penum, igs, (gs_glyph)name_index(op))) < 0 ) { ifree_object(penum, "op_show_enum_setup"); return code; } op_show_finish_setup(penum, 1, NULL); return op_show_continue(op - 1); } /* - rootfont <font> */ private int zrootfont(os_ptr op) { push(1); *op = *pfont_dict(gs_rootfont(igs)); return 0; } /* <string> <numarray|numstring> xshow - */ private int zxshow(os_ptr op) { return moveshow(op, 1); } /* <string> <numarray|numstring> yshow - */ private int zyshow(os_ptr op) { return moveshow(op, 2); } /* <string> <numarray|numstring> xyshow - */ private int zxyshow(os_ptr op) { return moveshow(op, 3); } /* Common code for {x,y,xy}show */ private int moveshow(os_ptr op, int xymask) { gs_show_enum *penum; int code = op_show_setup(op - 1, &penum); stream *s; if ( code < 0 ) return code; if ( (code = gs_xyshow_n_init(penum, igs, (char *)op[-1].value.bytes, r_size(op - 1)) < 0) ) { ifree_object(penum, "op_show_enum_setup"); return code; } s = s_alloc(imemory, "moveshow(stream)"); if ( s == 0 ) return_error(e_VMerror); code = sread_num_array(s, op); if ( code < 0 ) { ifree_object(penum, "op_show_enum_setup"); return code; } /* Save the number format in the position member of the stream. */ /* This is a real hack, but it's by far the simplest approach. */ s->position = code; #define s_num_format(s) (int)(s->position) op_show_finish_setup(penum, 2, NULL); make_istruct(&sslot, 0, s); return moveshow_continue(op - 2, xymask); } /* Continuation procedures */ private int xshow_continue(os_ptr op) { return moveshow_continue(op, 1); } private int yshow_continue(os_ptr op) { return moveshow_continue(op, 2); } private int xyshow_continue(os_ptr op) { return moveshow_continue(op, 3); } /* Get one value from the encoded number string or array. */ /* Sets pvalue->value.realval. */ private int sget_real(stream *s, int format, ref *pvalue, int read) { if ( read ) { int code; switch ( code = sget_encoded_number(s, format, pvalue) ) { case t_integer: pvalue->value.realval = pvalue->value.intval; case t_real: break; case t_null: code = e_rangecheck; default: return code; } } else pvalue->value.realval = 0; return 0; } private int moveshow_continue(os_ptr op, int xymask) { stream *s = r_ptr(&sslot, stream); int format = s_num_format(s); int code; gs_show_enum *penum = senum; next: code = gs_show_next(penum); if ( code != gs_show_move ) { code = op_show_continue_dispatch(op, code); if ( code == o_push_estack ) /* must be gs_show_render */ { make_op_estack(esp - 1, xyshow_continues[xymask]); } else if ( code < 0 ) goto errx; return code; } { /* Move according to the next value(s) from the stream. */ ref rwx, rwy; code = sget_real(s, format, &rwx, xymask & 1); if ( code < 0 ) goto errx; code = sget_real(s, format, &rwy, xymask & 2); if ( code < 0 ) goto errx; code = gs_rmoveto(igs, rwx.value.realval, rwy.value.realval); if ( code < 0 ) goto errx; } goto next; errx: op_show_free(); return code; } /* ------ Initialization procedure ------ */ BEGIN_OP_DEFS(zchar2_op_defs) { {"2cshow", zcshow}, {"0rootfont", zrootfont}, /* Internal operators */ {"0%cshow_continue", cshow_continue}, END_OP_DEFS(0) } BEGIN_OP_DEFS(zchar2_l2_op_defs) { op_def_begin_level2(), {"1glyphshow", zglyphshow}, {"2xshow", zxshow}, {"2xyshow", zxyshow}, {"2yshow", zyshow}, /* Internal operators */ {"0%xshow_continue", xshow_continue}, {"0%yshow_continue", yshow_continue}, {"0%xyshow_continue", xyshow_continue}, END_OP_DEFS(0) }
/* Copyright (C) 1992, 1993, 1994 Aladdin Enterprises. All rights reserved. This file is part of Aladdin Ghostscript. Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or distributor accepts any responsibility for the consequences of using it, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Refer to the Aladdin Ghostscript Free Public License (the "License") for full details. Every copy of Aladdin Ghostscript must include a copy of the License, normally in a plain ASCII text file named PUBLIC. The License grants you the right to copy, modify and redistribute Aladdin Ghostscript, but only under certain conditions described in the License. Among other things, the License requires that the copyright notice and this notice be preserved on all copies. */ /* zchar2.c */ /* Level 2 character operators */ #include "ghost.h" #include "IMPORT_0" #include "IMPORT_1" #include "gschar.h" #include "IMPORT_2" /* for gxfont.h */ #include "gsstruct.h" /* for st_stream */ #include "gxfixed.h" /* for gxfont.h */ #include "gxfont.h" #include "estack.h" #include "IMPORT_3" #include "ichar.h" #include "IMPORT_4" #include "IMPORT_5" #include "IMPORT_6" #include "IMPORT_7" #include "stream.h" #include "ibnum.h" #include "gspath.h" /* gs_rmoveto prototype */ /* Table of continuation procedures. */ CLASS_0 int FUNC_0(CLASS_1(os_ptr)); CLASS_0 int yshow_continue(CLASS_1(os_ptr)); CLASS_0 int xyshow_continue(CLASS_1(os_ptr)); static const CLASS_2 xyshow_continues[4] = { 0, VAR_0, yshow_continue, xyshow_continue }; /* Forward references */ CLASS_0 int cshow_continue(CLASS_1(os_ptr)); CLASS_0 int moveshow(P2(os_ptr, int)); CLASS_0 int moveshow_continue(P2(os_ptr, int)); /* <proc> <string> cshow - */ CLASS_0 int FUNC_1(os_ptr op) { gs_show_enum *penum; int code; check_proc(op[-1]); if ( (code = op_show_setup(op, &penum)) < 0 ) return code; if ( (code = FUNC_2(penum, igs, (char *)op->VAR_2.VAR_3, FUNC_3(op))) < 0 ) { ifree_object(penum, "op_show_enum_setup"); return code; } op_show_finish_setup(penum, 2, NULL); VAR_4 = op[-1]; /* save kerning proc */ return cshow_continue(op - 2); } CLASS_0 int cshow_continue(os_ptr op) { gs_show_enum *penum = VAR_5; int code = FUNC_4(penum); if ( code != gs_show_move ) { code = op_show_continue_dispatch(op, code); if ( code == VAR_6 ) /* must be gs_show_render */ { make_op_estack(VAR_7 - 1, cshow_continue); } else if ( code < 0 ) goto errx; return code; } /* Push the character code and width, and call the procedure. */ { gs_show_enum *penum = VAR_5; CLASS_3 *pslot = &VAR_4; gs_point wpt; FUNC_5(penum, &wpt); FUNC_6(3); FUNC_7(op - 2, FUNC_8(penum)); make_real(op - 1, wpt.VAR_8); make_real(op, wpt.y); FUNC_9(cshow_continue); *++VAR_7 = *pslot; /* user procedure */ } return VAR_6; errx: op_show_free(); return code; } /* <charname> glyphshow - */ CLASS_0 int FUNC_10(os_ptr op) { gs_show_enum *penum; int code; FUNC_11(*op, t_name); if ( (code = op_show_enum_setup(&penum)) < 0 ) return code; if ( (code = gs_glyphshow_init(penum, igs, (gs_glyph)FUNC_12(op))) < 0 ) { ifree_object(penum, "op_show_enum_setup"); return code; } op_show_finish_setup(penum, 1, NULL); return op_show_continue(op - 1); } /* - rootfont <font> */ CLASS_0 int zrootfont(os_ptr op) { FUNC_6(1); *op = *FUNC_13(FUNC_14(igs)); return 0; } /* <string> <numarray|numstring> xshow - */ CLASS_0 int zxshow(os_ptr op) { return moveshow(op, 1); } /* <string> <numarray|numstring> yshow - */ CLASS_0 int zyshow(os_ptr op) { return moveshow(op, 2); } /* <string> <numarray|numstring> xyshow - */ CLASS_0 int FUNC_15(os_ptr op) { return moveshow(op, 3); } /* Common code for {x,y,xy}show */ CLASS_0 int moveshow(os_ptr op, int xymask) { gs_show_enum *penum; int code = op_show_setup(op - 1, &penum); stream *VAR_11; if ( code < 0 ) return code; if ( (code = gs_xyshow_n_init(penum, igs, (char *)op[-1].VAR_2.VAR_3, FUNC_3(op - 1)) < 0) ) { ifree_object(penum, "op_show_enum_setup"); return code; } VAR_11 = s_alloc(imemory, "moveshow(stream)"); if ( VAR_11 == 0 ) FUNC_16(VAR_12); code = sread_num_array(VAR_11, op); if ( code < 0 ) { ifree_object(penum, "op_show_enum_setup"); return code; } /* Save the number format in the position member of the stream. */ /* This is a real hack, but it's by far the simplest approach. */ VAR_11->position = code; #define s_num_format(VAR_11) (int)(s->position) op_show_finish_setup(penum, 2, NULL); make_istruct(&VAR_4, 0, VAR_11); return moveshow_continue(op - 2, xymask); } /* Continuation procedures */ CLASS_0 int FUNC_0(os_ptr op) { return moveshow_continue(op, 1); } CLASS_0 int yshow_continue(os_ptr op) { return moveshow_continue(op, 2); } CLASS_0 int xyshow_continue(os_ptr op) { return moveshow_continue(op, 3); } /* Get one value from the encoded number string or array. */ /* Sets pvalue->value.realval. */ CLASS_0 int FUNC_17(stream *VAR_11, int VAR_13, CLASS_3 *pvalue, int VAR_14) { if ( VAR_14 ) { int code; switch ( code = FUNC_18(VAR_11, VAR_13, pvalue) ) { case t_integer: pvalue->VAR_2.VAR_15 = pvalue->VAR_2.VAR_16; case VAR_17: break; case t_null: code = VAR_18; default: return code; } } else pvalue->VAR_2.VAR_15 = 0; return 0; } CLASS_0 int moveshow_continue(os_ptr op, int xymask) { stream *VAR_11 = r_ptr(&VAR_4, stream); int VAR_13 = s_num_format(VAR_11); int code; gs_show_enum *penum = VAR_5; next: code = FUNC_4(penum); if ( code != gs_show_move ) { code = op_show_continue_dispatch(op, code); if ( code == VAR_6 ) /* must be gs_show_render */ { make_op_estack(VAR_7 - 1, xyshow_continues[xymask]); } else if ( code < 0 ) goto errx; return code; } { /* Move according to the next value(s) from the stream. */ CLASS_3 rwx, rwy; code = FUNC_17(VAR_11, VAR_13, &rwx, xymask & 1); if ( code < 0 ) goto errx; code = FUNC_17(VAR_11, VAR_13, &rwy, xymask & 2); if ( code < 0 ) goto errx; code = FUNC_19(igs, rwx.VAR_2.VAR_15, rwy.VAR_2.VAR_15); if ( code < 0 ) goto errx; } goto next; errx: op_show_free(); return code; } /* ------ Initialization procedure ------ */ BEGIN_OP_DEFS(zchar2_op_defs) { {"2cshow", VAR_1}, {"0rootfont", zrootfont}, /* Internal operators */ {"0%cshow_continue", cshow_continue}, FUNC_20(0) } BEGIN_OP_DEFS(zchar2_l2_op_defs) { FUNC_21(), {"1glyphshow", VAR_9}, {"2xshow", zxshow}, {"2xyshow", VAR_10}, {"2yshow", zyshow}, /* Internal operators */ {"0%xshow_continue", VAR_0}, {"0%yshow_continue", yshow_continue}, {"0%xyshow_continue", xyshow_continue}, FUNC_20(0) }
0.425473
{'IMPORT_0': 'errors.h', 'IMPORT_1': 'oper.h', 'IMPORT_2': 'gsmatrix.h', 'IMPORT_3': 'ialloc.h', 'IMPORT_4': 'ifont.h', 'IMPORT_5': 'igstate.h', 'IMPORT_6': 'iname.h', 'IMPORT_7': 'store.h', 'CLASS_0': 'private', 'FUNC_0': 'xshow_continue', 'VAR_0': 'xshow_continue', 'CLASS_1': 'P1', 'CLASS_2': 'op_proc_p', 'FUNC_1': 'zcshow', 'VAR_1': 'zcshow', 'FUNC_2': 'gs_cshow_n_init', 'VAR_2': 'value', 'VAR_3': 'bytes', 'FUNC_3': 'r_size', 'VAR_4': 'sslot', 'VAR_5': 'senum', 'FUNC_4': 'gs_show_next', 'VAR_6': 'o_push_estack', 'VAR_7': 'esp', 'CLASS_3': 'ref', 'FUNC_5': 'gs_show_current_width', 'FUNC_6': 'push', 'FUNC_7': 'make_int', 'FUNC_8': 'gs_show_current_char', 'VAR_8': 'x', 'FUNC_9': 'push_op_estack', 'FUNC_10': 'zglyphshow', 'VAR_9': 'zglyphshow', 'FUNC_11': 'check_type', 'FUNC_12': 'name_index', 'FUNC_13': 'pfont_dict', 'FUNC_14': 'gs_rootfont', 'FUNC_15': 'zxyshow', 'VAR_10': 'zxyshow', 'VAR_11': 's', 'FUNC_16': 'return_error', 'VAR_12': 'e_VMerror', 'FUNC_17': 'sget_real', 'VAR_13': 'format', 'VAR_14': 'read', 'FUNC_18': 'sget_encoded_number', 'VAR_15': 'realval', 'VAR_16': 'intval', 'VAR_17': 't_real', 'VAR_18': 'e_rangecheck', 'FUNC_19': 'gs_rmoveto', 'FUNC_20': 'END_OP_DEFS', 'FUNC_21': 'op_def_begin_level2'}
// Claim the next batch of sequence numbers for publishing. // // @param batch_descriptor to be updated for the batch range. // @return the updated batch_descriptor. BatchDescriptor* Next(BatchDescriptor* batch_descriptor) { int64_t sequence = claim_strategy_->IncrementAndGet(batch_descriptor->size(), gating_sequences_); batch_descriptor->set_end(sequence); return batch_descriptor; }
// Claim the next batch of sequence numbers for publishing. // // @param batch_descriptor to be updated for the batch range. // @return the updated batch_descriptor. CLASS_0* FUNC_0(CLASS_0* VAR_0) { int64_t VAR_1 = claim_strategy_->FUNC_1(VAR_0->FUNC_2(), VAR_2); VAR_0->FUNC_3(VAR_1); return VAR_0; }
0.936575
{'CLASS_0': 'BatchDescriptor', 'FUNC_0': 'Next', 'VAR_0': 'batch_descriptor', 'VAR_1': 'sequence', 'FUNC_1': 'IncrementAndGet', 'FUNC_2': 'size', 'VAR_2': 'gating_sequences_', 'FUNC_3': 'set_end'}
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include "core/framework/tensor.h" #include <functional> #include <stdint.h> #include <vector> // TODO(kreeger): Move this folder to a quantization utils/toolkit folder. namespace onnxruntime { namespace contrib { // function that transform array of input value to array of output value of length typedef std::function<void(const float* input, float* output, size_t length)> LookupTableArrayTransformer; // function that transform single value typedef std::function<float(float)> LookupTableScalarTransformer; template <typename T> void QlinearBuildLookupTable(uint8_t* table, const Tensor* tensor_x_scale, const Tensor* tensor_x_zero_point, const Tensor* tensor_y_scale, const Tensor* tensor_y_zero_point, const LookupTableArrayTransformer& array_values_transformer); template <typename T> void QlinearBuildLookupTable(uint8_t* table, const Tensor* tensor_x_scale, const Tensor* tensor_x_zero_point, const Tensor* tensor_y_scale, const Tensor* tensor_y_zero_point, const LookupTableScalarTransformer& value_transformer); void QLinearLookupTableTransform(const uint8_t* x, const uint8_t* table, uint8_t* y, size_t n); } // namespace contrib } // namespace onnxruntime
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include "IMPORT_0" #include <functional> #include <IMPORT_1> #include <IMPORT_2> // TODO(kreeger): Move this folder to a quantization utils/toolkit folder. CLASS_0 VAR_0 { CLASS_0 VAR_1 { // function that transform array of input value to array of output value of length typedef CLASS_1::CLASS_2<void(const float* VAR_2, float* VAR_3, size_t VAR_4)> ID_0; // function that transform single value typedef CLASS_1::CLASS_2<float(float)> ID_1; template <VAR_7 VAR_8> VAR_9 FUNC_0(VAR_10* VAR_11, VAR_12 Tensor* VAR_13, VAR_12 Tensor* tensor_x_zero_point, VAR_12 Tensor* VAR_14, VAR_12 Tensor* VAR_15, VAR_12 VAR_5& VAR_16); template <VAR_7 VAR_8> VAR_9 FUNC_0(VAR_10* VAR_11, VAR_12 Tensor* VAR_13, VAR_12 Tensor* tensor_x_zero_point, VAR_12 Tensor* VAR_14, VAR_12 Tensor* VAR_15, VAR_12 VAR_6& VAR_17); void FUNC_1(const uint8_t* x, const uint8_t* VAR_11, uint8_t* VAR_18, size_t VAR_19); } // namespace contrib } // namespace onnxruntime
0.914513
{'IMPORT_0': 'core/framework/tensor.h', 'IMPORT_1': 'stdint.h', 'IMPORT_2': 'vector', 'CLASS_0': 'namespace', 'VAR_0': 'onnxruntime', 'VAR_1': 'contrib', 'CLASS_1': 'std', 'CLASS_2': 'function', 'VAR_2': 'input', 'VAR_3': 'output', 'VAR_4': 'length', 'ID_0': 'LookupTableArrayTransformer', 'VAR_5': 'LookupTableArrayTransformer', 'ID_1': 'LookupTableScalarTransformer', 'VAR_6': 'LookupTableScalarTransformer', 'VAR_7': 'typename', 'VAR_8': 'T', 'VAR_9': 'void', 'FUNC_0': 'QlinearBuildLookupTable', 'VAR_10': 'uint8_t', 'VAR_11': 'table', 'VAR_12': 'const', 'VAR_13': 'tensor_x_scale', 'VAR_14': 'tensor_y_scale', 'VAR_15': 'tensor_y_zero_point', 'VAR_16': 'array_values_transformer', 'VAR_17': 'value_transformer', 'FUNC_1': 'QLinearLookupTableTransform', 'VAR_18': 'y', 'VAR_19': 'n'}
#import <BaseBoard/BSBaseXPCClient.h> @interface BKSProcessAssertionClient : BSBaseXPCClient + (instancetype)sharedInstance; @end
#import <BaseBoard/BSBaseXPCClient.h> @CLASS_0 VAR_0 : VAR_1 + (ID_0)VAR_2; @CLASS_1
0.656279
{'CLASS_0': 'interface', 'VAR_0': 'BKSProcessAssertionClient', 'VAR_1': 'BSBaseXPCClient', 'ID_0': 'instancetype', 'VAR_2': 'sharedInstance', 'CLASS_1': 'end'}
/****************************************************************************** * * * License Agreement * * * * Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * * 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. * * * * This agreement shall be governed in all respects by the laws of the State * * of California and by the laws of the United States of America. * * * * Altera does not recommend, suggest or require that this reference design * * file be used in conjunction or combination with any other product. * ******************************************************************************/ #include <signal.h> #include <unistd.h> #include "sys/alt_errno.h" #include "os/alt_syscall.h" /* * kill() is used by newlib in order to send signals to processes. Since there * is only a single process in the HAL, the only valid values for pid are * either the current process id, or the broadcast values, i.e. pid must be * less than or equal to zero. * * ALT_KILL is mapped onto the kill() system call in alt_syscall.h */ int ALT_KILL (int pid, int sig) { int status = 0; if (pid <= 0) { switch (sig) { case 0: /* The null signal is used to check that a pid is valid. */ break; case SIGABRT: case SIGALRM: case SIGFPE: case SIGILL: case SIGKILL: case SIGPIPE: case SIGQUIT: case SIGSEGV: case SIGTERM: case SIGUSR1: case SIGUSR2: case SIGBUS: case SIGPOLL: case SIGPROF: case SIGSYS: case SIGTRAP: case SIGVTALRM: case SIGXCPU: case SIGXFSZ: /* * The Posix standard defines the default behaviour for all these signals * as being eqivalent to a call to _exit(). No mechanism is provided to * change this behaviour. */ _exit(0); case SIGCHLD: case SIGURG: /* * The Posix standard defines these signals to be ignored by default. No * mechanism is provided to change this behaviour. */ break; default: /* Tried to send an unsupported signal */ status = EINVAL; } } else if (pid > 0) { /* Attempted to signal a non-existant process */ status = ESRCH; } if (status) { ALT_ERRNO = status; return -1; } return 0; }
/****************************************************************************** * * * License Agreement * * * * Copyright (c) 2004 Altera Corporation, San Jose, California, USA. * * 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. * * * * This agreement shall be governed in all respects by the laws of the State * * of California and by the laws of the United States of America. * * * * Altera does not recommend, suggest or require that this reference design * * file be used in conjunction or combination with any other product. * ******************************************************************************/ #include <IMPORT_0> #include <IMPORT_1> #include "IMPORT_2" #include "IMPORT_3" /* * kill() is used by newlib in order to send signals to processes. Since there * is only a single process in the HAL, the only valid values for pid are * either the current process id, or the broadcast values, i.e. pid must be * less than or equal to zero. * * ALT_KILL is mapped onto the kill() system call in alt_syscall.h */ int FUNC_0 (int pid, int VAR_0) { int VAR_1 = 0; if (pid <= 0) { switch (VAR_0) { case 0: /* The null signal is used to check that a pid is valid. */ break; case VAR_2: case VAR_3: case VAR_4: case VAR_5: case VAR_6: case VAR_7: case VAR_8: case SIGSEGV: case VAR_9: case VAR_10: case VAR_11: case SIGBUS: case VAR_12: case VAR_13: case VAR_14: case VAR_15: case VAR_16: case VAR_17: case VAR_18: /* * The Posix standard defines the default behaviour for all these signals * as being eqivalent to a call to _exit(). No mechanism is provided to * change this behaviour. */ FUNC_1(0); case VAR_19: case VAR_20: /* * The Posix standard defines these signals to be ignored by default. No * mechanism is provided to change this behaviour. */ break; default: /* Tried to send an unsupported signal */ VAR_1 = VAR_21; } } else if (pid > 0) { /* Attempted to signal a non-existant process */ VAR_1 = VAR_22; } if (VAR_1) { VAR_23 = VAR_1; return -1; } return 0; }
0.897309
{'IMPORT_0': 'signal.h', 'IMPORT_1': 'unistd.h', 'IMPORT_2': 'sys/alt_errno.h', 'IMPORT_3': 'os/alt_syscall.h', 'FUNC_0': 'ALT_KILL', 'VAR_0': 'sig', 'VAR_1': 'status', 'VAR_2': 'SIGABRT', 'VAR_3': 'SIGALRM', 'VAR_4': 'SIGFPE', 'VAR_5': 'SIGILL', 'VAR_6': 'SIGKILL', 'VAR_7': 'SIGPIPE', 'VAR_8': 'SIGQUIT', 'VAR_9': 'SIGTERM', 'VAR_10': 'SIGUSR1', 'VAR_11': 'SIGUSR2', 'VAR_12': 'SIGPOLL', 'VAR_13': 'SIGPROF', 'VAR_14': 'SIGSYS', 'VAR_15': 'SIGTRAP', 'VAR_16': 'SIGVTALRM', 'VAR_17': 'SIGXCPU', 'VAR_18': 'SIGXFSZ', 'FUNC_1': '_exit', 'VAR_19': 'SIGCHLD', 'VAR_20': 'SIGURG', 'VAR_21': 'EINVAL', 'VAR_22': 'ESRCH', 'VAR_23': 'ALT_ERRNO'}
// libera el semaforo. // como parametro toma un descriptor. int semfree(int sem_id){ struct sem *s; struct sem **r; s = stable.sem + sem_id; if (s->refcount == 0) return -1; for (r = proc->procsem; r < proc->procsem + MAXSEMPROC; r++) { if (*r == s) { *r = 0; acquire(&stable.lock); s->refcount--; proc->semquantity--; release(&stable.lock); return 0; } } return -1; }
// libera el semaforo. // como parametro toma un descriptor. int FUNC_0(int VAR_0){ struct CLASS_0 *VAR_2; struct CLASS_0 **VAR_3; VAR_2 = VAR_4.VAR_1 + VAR_0; if (VAR_2->VAR_5 == 0) return -1; for (VAR_3 = VAR_6->VAR_7; VAR_3 < VAR_6->VAR_7 + VAR_8; VAR_3++) { if (*VAR_3 == VAR_2) { *VAR_3 = 0; FUNC_1(&VAR_4.VAR_9); VAR_2->VAR_5--; VAR_6->VAR_10--; FUNC_2(&VAR_4.VAR_9); return 0; } } return -1; }
0.964784
{'FUNC_0': 'semfree', 'VAR_0': 'sem_id', 'CLASS_0': 'sem', 'VAR_1': 'sem', 'VAR_2': 's', 'VAR_3': 'r', 'VAR_4': 'stable', 'VAR_5': 'refcount', 'VAR_6': 'proc', 'VAR_7': 'procsem', 'VAR_8': 'MAXSEMPROC', 'FUNC_1': 'acquire', 'VAR_9': 'lock', 'VAR_10': 'semquantity', 'FUNC_2': 'release'}
/* Check an array or array section. */ static inline void gc_thread_check_array(gc_closure_t* const restrict closure, volatile void* const restrict dst, volatile void* const restrict src, const unsigned int num, const unsigned int nonptr_size, const unsigned int normptrs, const unsigned int weakptrs, const unsigned char max_gen, const bool copied, const bool do_weak) { const unsigned int size = gc_thread_obj_size(nonptr_size, normptrs, weakptrs); if(0 != normptrs || 0 != weakptrs) for(unsigned int i = 0; i < num; i++) gc_thread_check(closure, (char*)dst + (size * i), (char*)src + (size * i), nonptr_size, normptrs, weakptrs, max_gen, copied, do_weak); else gc_thread_check_scalar_array(dst, src, num, nonptr_size); }
/* Check an array or array section. */ static inline void FUNC_0(gc_closure_t* const restrict VAR_0, volatile void* const restrict VAR_1, volatile void* const restrict src, const unsigned int num, const unsigned int VAR_2, const unsigned int VAR_3, const unsigned int VAR_4, const unsigned char max_gen, const bool VAR_5, const bool VAR_6) { const unsigned int VAR_7 = FUNC_1(VAR_2, VAR_3, VAR_4); if(0 != VAR_3 || 0 != VAR_4) for(unsigned int i = 0; i < num; i++) FUNC_2(VAR_0, (char*)VAR_1 + (VAR_7 * i), (char*)src + (VAR_7 * i), VAR_2, VAR_3, VAR_4, max_gen, VAR_5, VAR_6); else FUNC_3(VAR_1, src, num, VAR_2); }
0.444948
{'FUNC_0': 'gc_thread_check_array', 'VAR_0': 'closure', 'VAR_1': 'dst', 'VAR_2': 'nonptr_size', 'VAR_3': 'normptrs', 'VAR_4': 'weakptrs', 'VAR_5': 'copied', 'VAR_6': 'do_weak', 'VAR_7': 'size', 'FUNC_1': 'gc_thread_obj_size', 'FUNC_2': 'gc_thread_check', 'FUNC_3': 'gc_thread_check_scalar_array'}
/** @file ISA I/O Protocol is used by ISA device drivers to perform I/O, MMIO and DMA operations on the ISA controllers they manage. Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _EFI_ISA_IO_H_ #define _EFI_ISA_IO_H_ #include <Protocol/IsaAcpi.h> /// /// Global ID for the EFI_ISA_IO_PROTOCOL /// #define EFI_ISA_IO_PROTOCOL_GUID \ { \ 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } /// /// Forward declaration for the EFI_ISA_IO_PROTOCOL. /// typedef struct _EFI_ISA_IO_PROTOCOL EFI_ISA_IO_PROTOCOL; /// /// Width of EFI_ISA_IO_PROTOCOL I/O Port and MMIO operations. /// typedef enum { EfiIsaIoWidthUint8 = 0, ///< 8-bit operation. EfiIsaIoWidthUint16, ///< 16-bit operation. EfiIsaIoWidthUint32, ///< 32-bit operation EfiIsaIoWidthReserved, EfiIsaIoWidthFifoUint8, ///< 8-bit FIFO operation. EfiIsaIoWidthFifoUint16, ///< 16-bit FIFO operation. EfiIsaIoWidthFifoUint32, ///< 32-bit FIFO operation. EfiIsaIoWidthFifoReserved, EfiIsaIoWidthFillUint8, ///< 8-bit Fill operation. EfiIsaIoWidthFillUint16, ///< 16-bit Fill operation. EfiIsaIoWidthFillUint32, ///< 32-bit Fill operation. EfiIsaIoWidthFillReserved, EfiIsaIoWidthMaximum } EFI_ISA_IO_PROTOCOL_WIDTH; /// /// Attributes for the EFI_ISA_IO_PROTOCOL common DMA buffer allocations. /// #define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x080 ///< Map a memory range so write are combined. #define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED 0x800 ///< Map a memory range so all read and write accesses are cached. #define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ///< Disable a memory range. /// /// Channel attribute for EFI_ISA_IO_PROTOCOL slave DMA requests /// #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE 0x001 ///< Set the speed of the DMA transfer in compatible mode. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A 0x002 ///< Not supported. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B 0x004 ///< Not supported. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C 0x008 ///< Not supported. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8 0x010 ///< Request 8-bit DMA transfers. Only available on channels 0..3. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16 0x020 ///< Request 16-bit DMA transfers. Only available on channels 4..7. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE 0x040 ///< Request a single DMA transfer. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE 0x080 ///< Request multiple DMA transfers until TC (Terminal Count) or EOP (End of Process). #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE 0x100 ///< Automatically reload base and count at the end of the DMA transfer. /// /// The DMA opreration type for EFI_ISA_IO_PROTOCOL DMA requests. /// typedef enum { /// /// A read operation from system memory by a bus master. /// EfiIsaIoOperationBusMasterRead, /// /// A write operation to system memory by a bus master. /// EfiIsaIoOperationBusMasterWrite, /// /// Provides both read and write access to system memory by both the processor /// and a bus master. The buffer is coherent from both the processor's and the /// bus master's point of view. /// EfiIsaIoOperationBusMasterCommonBuffer, /// /// A read operation from system memory by a slave device. /// EfiIsaIoOperationSlaveRead, /// /// A write operation to system memory by a slave master. /// EfiIsaIoOperationSlaveWrite, EfiIsaIoOperationMaximum } EFI_ISA_IO_PROTOCOL_OPERATION; /** Performs ISA I/O and MMIO Read/Write Cycles @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the I/O or MMIO operation. @param[in] Offset The offset into the ISA I/O or MMIO space to start the operation. @param[in] Count The number of I/O or MMIO operations to perform. @param[in, out] Buffer For read operations, the destination buffer to store the results. For write operations, the source buffer to write data from. @retval EFI_SUCCESS The data was successfully read from or written to the device. @retval EFI_UNSUPPORTED The Offset is not valid for this device. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_IO_MEM)( IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer ); /// /// Structure of functions for accessing ISA I/O and MMIO space. /// typedef struct { /// /// Read from ISA I/O or MMIO space. /// EFI_ISA_IO_PROTOCOL_IO_MEM Read; /// /// Write to ISA I/O or MMIO space. /// EFI_ISA_IO_PROTOCOL_IO_MEM Write; } EFI_ISA_IO_PROTOCOL_ACCESS; /** Copies data from one region of ISA MMIO space to another region of ISA MMIO space. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the MMIO copy operation. @param[in] DestOffset The offset of the destination in ISA MMIO space. @param[in] SrcOffset The offset of the source in ISA MMIO space. @param[in] Count The number tranfers to perform for this copy operation. @retval EFI_SUCCESS The data was copied sucessfully. @retval EFI_UNSUPPORTED The DestOffset or SrcOffset is not valid for this device. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_COPY_MEM)( IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_WIDTH Width, IN UINT32 DestOffset, IN UINT32 SrcOffset, IN UINTN Count ); /** Maps a memory region for DMA. This function returns the device-specific addresses required to access system memory. This function is used to map system memory for ISA DMA operations. All ISA DMA operations must be performed through their mapped addresses, and such mappings must be freed with EFI_ISA_IO_PROTOCOL.Unmap() after the DMA operation is completed. If the DMA operation is a single read or write data transfer through an ISA bus master, then EfiIsaIoOperationBusMasterRead or EfiIsaIoOperationBusMasterWrite is used and the range is unmapped to complete the operation. If the DMA operation is a single read or write data transfer through an ISA slave controller, then EfiIsaIoOperationSlaveRead or EfiIsaIoOperationSlaveWrite is used and the range is unmapped to complete the operation. If performing a DMA read operation, all the data must be present in system memory before the Map() is performed. Similarly, if performing a DMA write operation, the data must not be accessed in system memory until EFI_ISA_IO_PROTOCOL.Unmap() is performed. Bus master operations that require both read and write access or require multiple host device interactions within the same mapped region must use EfiIsaIoOperationBusMasterCommonBuffer. However, only memory allocated via the EFI_ISA_IO_PROTOCOL.AllocateBuffer() interface is guaranteed to be able to be mapped for this operation type. In all mapping requests the NumberOfBytes returned may be less than originally requested. It is the caller's responsibility to make additional requests to complete the entire transfer. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Operation Indicates the type of DMA (slave or bus master), and if the DMA operation is going to read or write to system memory. @param[in] ChannelNumber The slave channel number to use for this DMA operation. If Operation and ChannelAttributes shows that this device performs bus mastering DMA, then this field is ignored. The legal range for this field is 0..7. @param[in] ChannelAttributes A bitmask of the attributes used to configure the slave DMA channel for this DMA operation. See EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_* for the legal bit combinations. @param[in] HostAddress The system memory address to map to the device. @param[in, out] NumberOfBytes On input the number of bytes to map. On output the number of bytes that were mapped. @param[out] DeviceAddress The resulting map address for the bus master device to use to access the hosts HostAddress. @param[out] Mapping A returned value that must be passed to into EFI_ISA_IO_PROTOCOL.Unmap() to free all the the resources associated with this map request. @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. @retval EFI_INVALID_PARAMETER The Operation is undefined. @retval EFI_INVALID_PARAMETER The HostAddress is undefined. @retval EFI_UNSUPPORTED The HostAddress can not be mapped as a common buffer. @retval EFI_DEVICE_ERROR The system hardware could not map the requested address. @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_MAP)( IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_OPERATION Operation, IN UINT8 ChannelNumber OPTIONAL, IN UINT32 ChannelAttributes, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping ); /** Unmaps a memory region that was previously mapped with EFI_ISA_IO_PROTOCOL.Map(). The EFI_ISA_IO_PROTOCOL.Map() operation is completed and any corresponding resources are released. If the operation was EfiIsaIoOperationSlaveWrite or EfiIsaIoOperationBusMasterWrite, the data is committed to system memory. Any resources used for the mapping are freed. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Mapping The mapping value returned from EFI_ISA_IO_PROTOCOL.Map(). @retval EFI_SUCCESS The memory region was unmapped. @retval EFI_DEVICE_ERROR The data was not committed to the target system memory. **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_UNMAP)( IN EFI_ISA_IO_PROTOCOL *This, IN VOID *Mapping ); /** Allocates pages that are suitable for an EfiIsaIoOperationBusMasterCommonBuffer mapping. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Type The type allocation to perform. @param[in] MemoryType The type of memory to allocate. @param[in] Pages The number of pages to allocate. @param[out] HostAddress A pointer to store the base address of the allocated range. @param[in] Attributes The requested bit mask of attributes for the allocated range. @retval EFI_SUCCESS The requested memory pages were allocated. @retval EFI_INVALID_PARAMETER Type is invalid. @retval EFI_INVALID_PARAMETER MemoryType is invalid. @retval EFI_INVALID_PARAMETER HostAddress is NULL. @retval EFI_UNSUPPORTED Attributes is unsupported. @retval EFI_UNSUPPORTED The memory range specified by HostAddress, Pages, and Type is not available for common buffer use. @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER)( IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes ); /** Frees a common buffer that was allocated with EFI_ISA_IO_PROTOCOL.AllocateBuffer(). @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Pages The number of pages to free from the previously allocated common buffer. @param[in] HostAddress The base address of the previously allocated common buffer. @retval EFI_SUCCESS The requested memory pages were freed. @retval EFI_INVALID_PARAMETER The memory was not allocated with EFI_ISA_IO.AllocateBufer(). **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_FREE_BUFFER)( IN EFI_ISA_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress ); /** Flushes a DMA buffer, which forces all DMA posted write transactions to complete. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @retval EFI_SUCCESS The DMA buffers were flushed. @retval EFI_DEVICE_ERROR The buffers were not flushed due to a hardware error. **/ typedef EFI_STATUS (EFIAPI *EFI_ISA_IO_PROTOCOL_FLUSH)( IN EFI_ISA_IO_PROTOCOL *This ); /// /// The EFI_ISA_IO_PROTOCOL provides the basic Memory, I/O, and DMA interfaces /// used to abstract accesses to ISA controllers. There is one EFI_ISA_IO_PROTOCOL /// instance for each ISA controller on a ISA bus. A device driver that wishes /// to manage an ISA controller in a system will have to retrieve the /// ISA_PCI_IO_PROTOCOL instance associated with the ISA controller. /// struct _EFI_ISA_IO_PROTOCOL { EFI_ISA_IO_PROTOCOL_ACCESS Mem; EFI_ISA_IO_PROTOCOL_ACCESS Io; EFI_ISA_IO_PROTOCOL_COPY_MEM CopyMem; EFI_ISA_IO_PROTOCOL_MAP Map; EFI_ISA_IO_PROTOCOL_UNMAP Unmap; EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; EFI_ISA_IO_PROTOCOL_FREE_BUFFER FreeBuffer; EFI_ISA_IO_PROTOCOL_FLUSH Flush; /// /// The list of I/O , MMIO, DMA, and Interrupt resources associated with the /// ISA controller abstracted by this instance of the EFI_ISA_IO_PROTOCOL. /// EFI_ISA_ACPI_RESOURCE_LIST *ResourceList; /// /// The size, in bytes, of the ROM image. /// UINT32 RomSize; /// /// A pointer to the in memory copy of the ROM image. The ISA Bus Driver is responsible /// for allocating memory for the ROM image, and copying the contents of the ROM to memory /// during ISA Bus initialization. /// VOID *RomImage; }; extern EFI_GUID gEfiIsaIoProtocolGuid; #endif
/** @file ISA I/O Protocol is used by ISA device drivers to perform I/O, MMIO and DMA operations on the ISA controllers they manage. Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef VAR_0 #define VAR_0 #include <IMPORT_0> /// /// Global ID for the EFI_ISA_IO_PROTOCOL /// #define VAR_1 \ { \ 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } /// /// Forward declaration for the EFI_ISA_IO_PROTOCOL. /// typedef struct _EFI_ISA_IO_PROTOCOL ID_0; /// /// Width of EFI_ISA_IO_PROTOCOL I/O Port and MMIO operations. /// typedef enum { EfiIsaIoWidthUint8 = 0, ///< 8-bit operation. VAR_3, ///< 16-bit operation. VAR_4, ///< 32-bit operation EfiIsaIoWidthReserved, VAR_5, ///< 8-bit FIFO operation. EfiIsaIoWidthFifoUint16, ///< 16-bit FIFO operation. EfiIsaIoWidthFifoUint32, ///< 32-bit FIFO operation. EfiIsaIoWidthFifoReserved, VAR_6, ///< 8-bit Fill operation. EfiIsaIoWidthFillUint16, ///< 16-bit Fill operation. VAR_7, ///< 32-bit Fill operation. VAR_8, VAR_9 } ID_1; /// /// Attributes for the EFI_ISA_IO_PROTOCOL common DMA buffer allocations. /// #define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x080 ///< Map a memory range so write are combined. #define VAR_11 0x800 ///< Map a memory range so all read and write accesses are cached. #define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ///< Disable a memory range. /// /// Channel attribute for EFI_ISA_IO_PROTOCOL slave DMA requests /// #define VAR_12 0x001 ///< Set the speed of the DMA transfer in compatible mode. #define VAR_13 0x002 ///< Not supported. #define VAR_14 0x004 ///< Not supported. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C 0x008 ///< Not supported. #define VAR_15 0x010 ///< Request 8-bit DMA transfers. Only available on channels 0..3. #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16 0x020 ///< Request 16-bit DMA transfers. Only available on channels 4..7. #define VAR_16 0x040 ///< Request a single DMA transfer. #define VAR_17 0x080 ///< Request multiple DMA transfers until TC (Terminal Count) or EOP (End of Process). #define VAR_18 0x100 ///< Automatically reload base and count at the end of the DMA transfer. /// /// The DMA opreration type for EFI_ISA_IO_PROTOCOL DMA requests. /// typedef enum { /// /// A read operation from system memory by a bus master. /// EfiIsaIoOperationBusMasterRead, /// /// A write operation to system memory by a bus master. /// EfiIsaIoOperationBusMasterWrite, /// /// Provides both read and write access to system memory by both the processor /// and a bus master. The buffer is coherent from both the processor's and the /// bus master's point of view. /// VAR_19, /// /// A read operation from system memory by a slave device. /// VAR_20, /// /// A write operation to system memory by a slave master. /// VAR_21, EfiIsaIoOperationMaximum } EFI_ISA_IO_PROTOCOL_OPERATION; /** Performs ISA I/O and MMIO Read/Write Cycles @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the I/O or MMIO operation. @param[in] Offset The offset into the ISA I/O or MMIO space to start the operation. @param[in] Count The number of I/O or MMIO operations to perform. @param[in, out] Buffer For read operations, the destination buffer to store the results. For write operations, the source buffer to write data from. @retval EFI_SUCCESS The data was successfully read from or written to the device. @retval EFI_UNSUPPORTED The Offset is not valid for this device. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. **/ typedef VAR_22 (CLASS_0 *ID_2)( CLASS_2 VAR_2 *CLASS_3, CLASS_2 VAR_10 Width, CLASS_2 VAR_23 CLASS_5, CLASS_2 VAR_24 CLASS_7, CLASS_2 VAR_25 CLASS_9 *CLASS_10 ); /// /// Structure of functions for accessing ISA I/O and MMIO space. /// typedef struct { /// /// Read from ISA I/O or MMIO space. /// CLASS_1 Read; /// /// Write to ISA I/O or MMIO space. /// CLASS_1 VAR_27; } EFI_ISA_IO_PROTOCOL_ACCESS; /** Copies data from one region of ISA MMIO space to another region of ISA MMIO space. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Width Specifies the width of the MMIO copy operation. @param[in] DestOffset The offset of the destination in ISA MMIO space. @param[in] SrcOffset The offset of the source in ISA MMIO space. @param[in] Count The number tranfers to perform for this copy operation. @retval EFI_SUCCESS The data was copied sucessfully. @retval EFI_UNSUPPORTED The DestOffset or SrcOffset is not valid for this device. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. **/ typedef VAR_22 (CLASS_0 *EFI_ISA_IO_PROTOCOL_COPY_MEM)( CLASS_2 VAR_2 *CLASS_3, CLASS_2 VAR_10 Width, CLASS_2 VAR_23 CLASS_11, CLASS_2 VAR_23 SrcOffset, CLASS_2 VAR_24 CLASS_7 ); /** Maps a memory region for DMA. This function returns the device-specific addresses required to access system memory. This function is used to map system memory for ISA DMA operations. All ISA DMA operations must be performed through their mapped addresses, and such mappings must be freed with EFI_ISA_IO_PROTOCOL.Unmap() after the DMA operation is completed. If the DMA operation is a single read or write data transfer through an ISA bus master, then EfiIsaIoOperationBusMasterRead or EfiIsaIoOperationBusMasterWrite is used and the range is unmapped to complete the operation. If the DMA operation is a single read or write data transfer through an ISA slave controller, then EfiIsaIoOperationSlaveRead or EfiIsaIoOperationSlaveWrite is used and the range is unmapped to complete the operation. If performing a DMA read operation, all the data must be present in system memory before the Map() is performed. Similarly, if performing a DMA write operation, the data must not be accessed in system memory until EFI_ISA_IO_PROTOCOL.Unmap() is performed. Bus master operations that require both read and write access or require multiple host device interactions within the same mapped region must use EfiIsaIoOperationBusMasterCommonBuffer. However, only memory allocated via the EFI_ISA_IO_PROTOCOL.AllocateBuffer() interface is guaranteed to be able to be mapped for this operation type. In all mapping requests the NumberOfBytes returned may be less than originally requested. It is the caller's responsibility to make additional requests to complete the entire transfer. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Operation Indicates the type of DMA (slave or bus master), and if the DMA operation is going to read or write to system memory. @param[in] ChannelNumber The slave channel number to use for this DMA operation. If Operation and ChannelAttributes shows that this device performs bus mastering DMA, then this field is ignored. The legal range for this field is 0..7. @param[in] ChannelAttributes A bitmask of the attributes used to configure the slave DMA channel for this DMA operation. See EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_* for the legal bit combinations. @param[in] HostAddress The system memory address to map to the device. @param[in, out] NumberOfBytes On input the number of bytes to map. On output the number of bytes that were mapped. @param[out] DeviceAddress The resulting map address for the bus master device to use to access the hosts HostAddress. @param[out] Mapping A returned value that must be passed to into EFI_ISA_IO_PROTOCOL.Unmap() to free all the the resources associated with this map request. @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. @retval EFI_INVALID_PARAMETER The Operation is undefined. @retval EFI_INVALID_PARAMETER The HostAddress is undefined. @retval EFI_UNSUPPORTED The HostAddress can not be mapped as a common buffer. @retval EFI_DEVICE_ERROR The system hardware could not map the requested address. @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. **/ typedef VAR_22 (CLASS_0 *ID_3)( CLASS_2 VAR_2 *CLASS_3, CLASS_2 EFI_ISA_IO_PROTOCOL_OPERATION Operation, CLASS_2 UINT8 CLASS_13 VAR_28, CLASS_2 VAR_23 ChannelAttributes, CLASS_2 VAR_26 *CLASS_14, CLASS_2 VAR_25 CLASS_6 *CLASS_15, CLASS_8 VAR_29 *CLASS_16, CLASS_8 VAR_26 **Mapping ); /** Unmaps a memory region that was previously mapped with EFI_ISA_IO_PROTOCOL.Map(). The EFI_ISA_IO_PROTOCOL.Map() operation is completed and any corresponding resources are released. If the operation was EfiIsaIoOperationSlaveWrite or EfiIsaIoOperationBusMasterWrite, the data is committed to system memory. Any resources used for the mapping are freed. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Mapping The mapping value returned from EFI_ISA_IO_PROTOCOL.Map(). @retval EFI_SUCCESS The memory region was unmapped. @retval EFI_DEVICE_ERROR The data was not committed to the target system memory. **/ typedef VAR_22 (CLASS_0 *ID_4)( CLASS_2 VAR_2 *CLASS_3, CLASS_2 VAR_26 *Mapping ); /** Allocates pages that are suitable for an EfiIsaIoOperationBusMasterCommonBuffer mapping. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Type The type allocation to perform. @param[in] MemoryType The type of memory to allocate. @param[in] Pages The number of pages to allocate. @param[out] HostAddress A pointer to store the base address of the allocated range. @param[in] Attributes The requested bit mask of attributes for the allocated range. @retval EFI_SUCCESS The requested memory pages were allocated. @retval EFI_INVALID_PARAMETER Type is invalid. @retval EFI_INVALID_PARAMETER MemoryType is invalid. @retval EFI_INVALID_PARAMETER HostAddress is NULL. @retval EFI_UNSUPPORTED Attributes is unsupported. @retval EFI_UNSUPPORTED The memory range specified by HostAddress, Pages, and Type is not available for common buffer use. @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. **/ typedef VAR_22 (CLASS_0 *EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER)( CLASS_2 VAR_2 *CLASS_3, CLASS_2 VAR_30 CLASS_18, CLASS_2 VAR_31 CLASS_19, CLASS_2 VAR_24 CLASS_20, CLASS_8 VAR_26 **CLASS_14, CLASS_2 VAR_32 CLASS_21 ); /** Frees a common buffer that was allocated with EFI_ISA_IO_PROTOCOL.AllocateBuffer(). @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @param[in] Pages The number of pages to free from the previously allocated common buffer. @param[in] HostAddress The base address of the previously allocated common buffer. @retval EFI_SUCCESS The requested memory pages were freed. @retval EFI_INVALID_PARAMETER The memory was not allocated with EFI_ISA_IO.AllocateBufer(). **/ typedef VAR_22 (CLASS_0 *EFI_ISA_IO_PROTOCOL_FREE_BUFFER)( CLASS_2 VAR_2 *CLASS_3, CLASS_2 VAR_24 CLASS_20, CLASS_2 VAR_26 *CLASS_14 ); /** Flushes a DMA buffer, which forces all DMA posted write transactions to complete. @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance. @retval EFI_SUCCESS The DMA buffers were flushed. @retval EFI_DEVICE_ERROR The buffers were not flushed due to a hardware error. **/ typedef VAR_22 (CLASS_0 *ID_5)( CLASS_2 VAR_2 *CLASS_3 ); /// /// The EFI_ISA_IO_PROTOCOL provides the basic Memory, I/O, and DMA interfaces /// used to abstract accesses to ISA controllers. There is one EFI_ISA_IO_PROTOCOL /// instance for each ISA controller on a ISA bus. A device driver that wishes /// to manage an ISA controller in a system will have to retrieve the /// ISA_PCI_IO_PROTOCOL instance associated with the ISA controller. /// struct _EFI_ISA_IO_PROTOCOL { EFI_ISA_IO_PROTOCOL_ACCESS VAR_33; EFI_ISA_IO_PROTOCOL_ACCESS Io; EFI_ISA_IO_PROTOCOL_COPY_MEM VAR_34; CLASS_12 Map; CLASS_17 VAR_35; EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; EFI_ISA_IO_PROTOCOL_FREE_BUFFER VAR_36; CLASS_22 VAR_37; /// /// The list of I/O , MMIO, DMA, and Interrupt resources associated with the /// ISA controller abstracted by this instance of the EFI_ISA_IO_PROTOCOL. /// EFI_ISA_ACPI_RESOURCE_LIST *ResourceList; /// /// The size, in bytes, of the ROM image. /// CLASS_4 VAR_38; /// /// A pointer to the in memory copy of the ROM image. The ISA Bus Driver is responsible /// for allocating memory for the ROM image, and copying the contents of the ROM to memory /// during ISA Bus initialization. /// CLASS_9 *RomImage; }; extern CLASS_23 VAR_39; #endif
0.622842
{'VAR_0': '_EFI_ISA_IO_H_', 'IMPORT_0': 'Protocol/IsaAcpi.h', 'VAR_1': 'EFI_ISA_IO_PROTOCOL_GUID', 'ID_0': 'EFI_ISA_IO_PROTOCOL', 'VAR_2': 'EFI_ISA_IO_PROTOCOL', 'VAR_3': 'EfiIsaIoWidthUint16', 'VAR_4': 'EfiIsaIoWidthUint32', 'VAR_5': 'EfiIsaIoWidthFifoUint8', 'VAR_6': 'EfiIsaIoWidthFillUint8', 'VAR_7': 'EfiIsaIoWidthFillUint32', 'VAR_8': 'EfiIsaIoWidthFillReserved', 'VAR_9': 'EfiIsaIoWidthMaximum', 'ID_1': 'EFI_ISA_IO_PROTOCOL_WIDTH', 'VAR_10': 'EFI_ISA_IO_PROTOCOL_WIDTH', 'VAR_11': 'EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED', 'VAR_12': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE', 'VAR_13': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A', 'VAR_14': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B', 'VAR_15': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8', 'VAR_16': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE', 'VAR_17': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE', 'VAR_18': 'EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE', 'VAR_19': 'EfiIsaIoOperationBusMasterCommonBuffer', 'VAR_20': 'EfiIsaIoOperationSlaveRead', 'VAR_21': 'EfiIsaIoOperationSlaveWrite', 'VAR_22': 'EFI_STATUS', 'CLASS_0': 'EFIAPI', 'ID_2': 'EFI_ISA_IO_PROTOCOL_IO_MEM', 'CLASS_1': 'EFI_ISA_IO_PROTOCOL_IO_MEM', 'CLASS_2': 'IN', 'CLASS_3': 'This', 'VAR_23': 'UINT32', 'CLASS_4': 'UINT32', 'CLASS_5': 'Offset', 'VAR_24': 'UINTN', 'CLASS_6': 'UINTN', 'CLASS_7': 'Count', 'VAR_25': 'OUT', 'CLASS_8': 'OUT', 'CLASS_9': 'VOID', 'VAR_26': 'VOID', 'CLASS_10': 'Buffer', 'VAR_27': 'Write', 'CLASS_11': 'DestOffset', 'ID_3': 'EFI_ISA_IO_PROTOCOL_MAP', 'CLASS_12': 'EFI_ISA_IO_PROTOCOL_MAP', 'CLASS_13': 'ChannelNumber', 'VAR_28': 'OPTIONAL', 'CLASS_14': 'HostAddress', 'CLASS_15': 'NumberOfBytes', 'VAR_29': 'EFI_PHYSICAL_ADDRESS', 'CLASS_16': 'DeviceAddress', 'ID_4': 'EFI_ISA_IO_PROTOCOL_UNMAP', 'CLASS_17': 'EFI_ISA_IO_PROTOCOL_UNMAP', 'VAR_30': 'EFI_ALLOCATE_TYPE', 'CLASS_18': 'Type', 'VAR_31': 'EFI_MEMORY_TYPE', 'CLASS_19': 'MemoryType', 'CLASS_20': 'Pages', 'VAR_32': 'UINT64', 'CLASS_21': 'Attributes', 'ID_5': 'EFI_ISA_IO_PROTOCOL_FLUSH', 'CLASS_22': 'EFI_ISA_IO_PROTOCOL_FLUSH', 'VAR_33': 'Mem', 'VAR_34': 'CopyMem', 'VAR_35': 'Unmap', 'VAR_36': 'FreeBuffer', 'VAR_37': 'Flush', 'VAR_38': 'RomSize', 'CLASS_23': 'EFI_GUID', 'VAR_39': 'gEfiIsaIoProtocolGuid'}
#pragma once //------------------------------------------------------------------------------ /** @class Characters::CharacterSkeletonInstance Contains the per-instance skeleton data of a character. (C) 2008 Radon Labs GmbH (C) 2013-2016 Individual contributors, see AUTHORS file */ #include "core/types.h" #include "characters/characterskeleton.h" #include "characters/charjointcomponents.h" #include "jobs/job.h" #include "jobs/jobport.h" //------------------------------------------------------------------------------ namespace Characters { class CharacterSkeletonInstance { public: /// constructor CharacterSkeletonInstance(); /// destructor ~CharacterSkeletonInstance(); enum SkeletonEvalMode { BindPose, // use bind pose from resource Mix // mix bind pose and direct matrices }; /// setup from CharacterSkeleton void Setup(const CharacterSkeleton& skeleton); /// discard the object void Discard(); /// return true if the object has been setup bool IsValid() const; /// render a debug visualization of the character void RenderDebug(const Math::matrix44& modelTransform); /// get number of joint instances in the skeleton SizeT GetNumJoints() const; /// get the skin matrix array // FIXME: synchronization problems -> updated in asynchronous job! const Util::FixedArray<Math::matrix44>& GetSkinMatrixArray() const; /// get a joint matrix by joint index // FIXME: synchronization problems -> updated in asynchronous job! const Math::matrix44& GetJointMatrix(IndexT i) const; /// get base matrix, which is modifiable Math::matrix44& GetMixMatrix(IndexT i) const; /// apply joint components void ApplyJointComponents(const Util::FixedArray<CharJointComponents>& set); private: friend class CharacterInstance; /// setup skeleton evaluation job void SetupEvalJob(); /// setup a single joint void SetupJoint(const CharacterSkeleton& skeleton, IndexT jointIndex); /// evaluate the joints (computes new skin matrices) void EvaluateAsync(const Ptr<Jobs::JobPort>& jobPort, const Math::float4* sampleBuffer, SizeT numSamples, void* jointTextureRowPtr, SizeT jointTextureRowSize, bool waitAnimJobsDone, SkeletonEvalMode mode = BindPose); Util::FixedArray<CharJointComponents> startJointComponentsArray; Util::FixedArray<Math::matrix44> scaledMatrixArray; Util::FixedArray<Math::matrix44> skinMatrixArray; Util::FixedArray<Math::matrix44> mixMatrixArray; Util::FixedArray<CharJointComponents>* jointComponentsArrayPtr; Util::FixedArray<Math::matrix44> bindPoseMatrixArray; const CharacterSkeleton* skeletonPtr; Ptr<Jobs::Job> evalJob; bool isValid; bool jointComponentsDirty; }; //------------------------------------------------------------------------------ /** */ inline const Math::matrix44& CharacterSkeletonInstance::GetJointMatrix(IndexT i) const { return this->scaledMatrixArray[i]; } //------------------------------------------------------------------------------ /** */ inline Math::matrix44& CharacterSkeletonInstance::GetMixMatrix(IndexT i) const { return this->mixMatrixArray[i]; } //------------------------------------------------------------------------------ /** */ inline bool CharacterSkeletonInstance::IsValid() const { return this->isValid; } //------------------------------------------------------------------------------ /** */ inline SizeT CharacterSkeletonInstance::GetNumJoints() const { return this->startJointComponentsArray.Size(); } //------------------------------------------------------------------------------ /** */ inline const Util::FixedArray<Math::matrix44>& CharacterSkeletonInstance::GetSkinMatrixArray() const { return this->skinMatrixArray; } } // namespace Characters //------------------------------------------------------------------------------
#pragma once //------------------------------------------------------------------------------ /** @class Characters::CharacterSkeletonInstance Contains the per-instance skeleton data of a character. (C) 2008 Radon Labs GmbH (C) 2013-2016 Individual contributors, see AUTHORS file */ #include "core/types.h" #include "characters/characterskeleton.h" #include "characters/charjointcomponents.h" #include "jobs/job.h" #include "jobs/jobport.h" //------------------------------------------------------------------------------ namespace VAR_0 { class CharacterSkeletonInstance { public: /// constructor CharacterSkeletonInstance(); /// destructor ~CharacterSkeletonInstance(); enum SkeletonEvalMode { BindPose, // use bind pose from resource VAR_1 // mix bind pose and direct matrices }; /// setup from CharacterSkeleton void FUNC_0(const CLASS_0& skeleton); /// discard the object void FUNC_1(); /// return true if the object has been setup bool IsValid() const; /// render a debug visualization of the character void RenderDebug(const Math::matrix44& VAR_2); /// get number of joint instances in the skeleton CLASS_1 FUNC_2() const; /// get the skin matrix array // FIXME: synchronization problems -> updated in asynchronous job! const Util::VAR_3<Math::matrix44>& GetSkinMatrixArray() const; /// get a joint matrix by joint index // FIXME: synchronization problems -> updated in asynchronous job! const Math::matrix44& FUNC_3(IndexT i) const; /// get base matrix, which is modifiable Math::matrix44& FUNC_4(IndexT i) const; /// apply joint components void ApplyJointComponents(const Util::VAR_3<CharJointComponents>& VAR_4); private: VAR_5 class CharacterInstance; /// setup skeleton evaluation job void SetupEvalJob(); /// setup a single joint void FUNC_5(const CLASS_0& skeleton, IndexT jointIndex); /// evaluate the joints (computes new skin matrices) void EvaluateAsync(const Ptr<Jobs::JobPort>& jobPort, const Math::VAR_6* sampleBuffer, CLASS_1 numSamples, void* VAR_7, CLASS_1 jointTextureRowSize, bool waitAnimJobsDone, SkeletonEvalMode mode = BindPose); Util::VAR_3<CharJointComponents> startJointComponentsArray; Util::VAR_3<Math::matrix44> VAR_8; Util::VAR_3<Math::matrix44> skinMatrixArray; Util::VAR_3<Math::matrix44> VAR_9; Util::VAR_3<CharJointComponents>* jointComponentsArrayPtr; Util::VAR_3<Math::matrix44> VAR_10; const CLASS_0* VAR_11; Ptr<Jobs::Job> VAR_12; bool isValid; bool jointComponentsDirty; }; //------------------------------------------------------------------------------ /** */ inline const Math::matrix44& CharacterSkeletonInstance::FUNC_3(IndexT i) const { return this->VAR_8[i]; } //------------------------------------------------------------------------------ /** */ inline Math::matrix44& CharacterSkeletonInstance::FUNC_4(IndexT i) const { return this->VAR_9[i]; } //------------------------------------------------------------------------------ /** */ inline bool CharacterSkeletonInstance::IsValid() const { return this->isValid; } //------------------------------------------------------------------------------ /** */ inline CLASS_1 CharacterSkeletonInstance::FUNC_2() const { return this->startJointComponentsArray.FUNC_6(); } //------------------------------------------------------------------------------ /** */ inline const Util::VAR_3<Math::matrix44>& CharacterSkeletonInstance::GetSkinMatrixArray() const { return this->skinMatrixArray; } } // namespace Characters //------------------------------------------------------------------------------
0.329133
{'VAR_0': 'Characters', 'VAR_1': 'Mix', 'FUNC_0': 'Setup', 'CLASS_0': 'CharacterSkeleton', 'FUNC_1': 'Discard', 'VAR_2': 'modelTransform', 'CLASS_1': 'SizeT', 'FUNC_2': 'GetNumJoints', 'VAR_3': 'FixedArray', 'FUNC_3': 'GetJointMatrix', 'FUNC_4': 'GetMixMatrix', 'VAR_4': 'set', 'VAR_5': 'friend', 'FUNC_5': 'SetupJoint', 'VAR_6': 'float4', 'VAR_7': 'jointTextureRowPtr', 'VAR_8': 'scaledMatrixArray', 'VAR_9': 'mixMatrixArray', 'VAR_10': 'bindPoseMatrixArray', 'VAR_11': 'skeletonPtr', 'VAR_12': 'evalJob', 'FUNC_6': 'Size'}
/* * aQuantia Corporation Network Driver * Copyright (C) 2019 aQuantia Corporation. 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. */ #ifndef _ATL_STATS_H_ #define _ATL_STATS_H_ #include <linux/types.h> struct atl_rx_ring_stats { uint64_t packets; uint64_t bytes; uint64_t linear_dropped; uint64_t alloc_skb_failed; uint64_t reused_head_page; uint64_t reused_data_page; uint64_t alloc_head_page; uint64_t alloc_data_page; uint64_t alloc_head_page_failed; uint64_t alloc_data_page_failed; uint64_t non_eop_descs; uint64_t mac_err; uint64_t csum_err; uint64_t multicast; }; struct atl_tx_ring_stats { uint64_t packets; uint64_t bytes; uint64_t tx_busy; uint64_t tx_restart; uint64_t dma_map_failed; }; struct atl_ring_stats { union { struct atl_rx_ring_stats rx; struct atl_tx_ring_stats tx; }; }; struct atl_ether_stats { uint64_t rx_pause; uint64_t tx_pause; uint64_t rx_ether_drops; uint64_t rx_ether_octets; uint64_t rx_ether_pkts; uint64_t rx_ether_broacasts; uint64_t rx_ether_multicasts; uint64_t rx_ether_crc_align_errs; uint64_t rx_filter_host; uint64_t rx_filter_lost; }; struct atl_global_stats { struct atl_rx_ring_stats rx; struct atl_tx_ring_stats tx; /* MSM counters can't be reset without full HW reset, so * store them in relative form: * eth[i] == HW_counter - eth_base[i] */ struct atl_ether_stats eth; struct atl_ether_stats eth_base; }; struct atl_fwd_ring; #ifdef CONFIG_ATLFWD_FWD_NETLINK void atl_fwd_get_ring_stats(struct atl_fwd_ring *ring, struct atl_ring_stats *stats); #endif #endif /* _ATL_STATS_H_ */
/* * aQuantia Corporation Network Driver * Copyright (C) 2019 aQuantia Corporation. 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. */ #ifndef VAR_0 #define VAR_0 #include <linux/types.h> struct CLASS_0 { uint64_t VAR_1; uint64_t VAR_2; uint64_t VAR_3; uint64_t alloc_skb_failed; uint64_t reused_head_page; uint64_t VAR_4; uint64_t VAR_5; uint64_t VAR_6; uint64_t VAR_7; uint64_t VAR_8; uint64_t non_eop_descs; uint64_t VAR_9; uint64_t VAR_10; uint64_t multicast; }; struct atl_tx_ring_stats { uint64_t VAR_1; uint64_t VAR_2; uint64_t VAR_11; uint64_t VAR_12; uint64_t dma_map_failed; }; struct CLASS_1 { union { struct CLASS_0 VAR_13; struct atl_tx_ring_stats VAR_14; }; }; struct CLASS_2 { uint64_t VAR_15; uint64_t VAR_16; uint64_t VAR_17; uint64_t VAR_18; uint64_t VAR_19; uint64_t VAR_20; uint64_t rx_ether_multicasts; uint64_t VAR_21; uint64_t VAR_22; uint64_t VAR_23; }; struct CLASS_3 { struct CLASS_0 VAR_13; struct atl_tx_ring_stats VAR_14; /* MSM counters can't be reset without full HW reset, so * store them in relative form: * eth[i] == HW_counter - eth_base[i] */ struct CLASS_2 VAR_24; struct CLASS_2 VAR_25; }; struct CLASS_4; #ifdef VAR_26 void atl_fwd_get_ring_stats(struct CLASS_4 *ring, struct CLASS_1 *VAR_27); #endif #endif /* _ATL_STATS_H_ */
0.73277
{'VAR_0': '_ATL_STATS_H_', 'CLASS_0': 'atl_rx_ring_stats', 'VAR_1': 'packets', 'VAR_2': 'bytes', 'VAR_3': 'linear_dropped', 'VAR_4': 'reused_data_page', 'VAR_5': 'alloc_head_page', 'VAR_6': 'alloc_data_page', 'VAR_7': 'alloc_head_page_failed', 'VAR_8': 'alloc_data_page_failed', 'VAR_9': 'mac_err', 'VAR_10': 'csum_err', 'VAR_11': 'tx_busy', 'VAR_12': 'tx_restart', 'CLASS_1': 'atl_ring_stats', 'VAR_13': 'rx', 'VAR_14': 'tx', 'CLASS_2': 'atl_ether_stats', 'VAR_15': 'rx_pause', 'VAR_16': 'tx_pause', 'VAR_17': 'rx_ether_drops', 'VAR_18': 'rx_ether_octets', 'VAR_19': 'rx_ether_pkts', 'VAR_20': 'rx_ether_broacasts', 'VAR_21': 'rx_ether_crc_align_errs', 'VAR_22': 'rx_filter_host', 'VAR_23': 'rx_filter_lost', 'CLASS_3': 'atl_global_stats', 'VAR_24': 'eth', 'VAR_25': 'eth_base', 'CLASS_4': 'atl_fwd_ring', 'VAR_26': 'CONFIG_ATLFWD_FWD_NETLINK', 'VAR_27': 'stats'}
#ifndef STINGRAYKIT_COLLECTION_LISTCASTER_H #define STINGRAYKIT_COLLECTION_LISTCASTER_H // Copyright (c) 2011 - 2019, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <stingraykit/collection/EnumerableHelpers.h> #include <stingraykit/collection/ForEach.h> #include <stingraykit/collection/IObservableList.h> #include <stingraykit/signal/signals.h> namespace stingray { /** * @addtogroup toolkit_collections * @{ */ template < typename SrcType, typename DestType, typename SrcListType = IReadonlyList<SrcType> > class ListCaster : public virtual IReadonlyList<DestType> { typedef ListCaster<SrcType, DestType, SrcListType> Self; STINGRAYKIT_DECLARE_PTR(SrcListType); public: typedef function<DestType (const SrcType&)> Caster; typedef function<bool (const DestType&, SrcType&)> BackCaster; protected: const SrcListTypePtr _wrapped; const Caster _caster; const BackCaster _backCaster; public: ListCaster(const SrcListTypePtr& wrapped, const Caster& caster, const BackCaster& backCaster) : _wrapped(STINGRAYKIT_REQUIRE_NOT_NULL(wrapped)), _caster(caster), _backCaster(backCaster) { } virtual shared_ptr<IEnumerator<DestType> > GetEnumerator() const { return WrapEnumerator(_wrapped->GetEnumerator(), _caster); } virtual shared_ptr<IEnumerable<DestType> > Reverse() const { return WrapEnumerable(_wrapped->Reverse(), _caster); } virtual size_t GetCount() const { return _wrapped->GetCount(); } virtual bool IsEmpty() const { return _wrapped->IsEmpty(); } virtual bool Contains(const DestType& value) const { SrcType value_; return _backCaster(value, value_) ? _wrapped->Contains(value_) : false; } virtual optional<size_t> IndexOf(const DestType& value) const { SrcType value_; return _backCaster(value, value_) ? _wrapped->IndexOf(value_) : null; } virtual DestType Get(size_t index) const { return _caster(_wrapped->Get(index)); } virtual bool TryGet(size_t index, DestType& value) const { SrcType value_; if (_wrapped->TryGet(index, value_)) { value = _caster(value_); return true; } return false; } }; template < typename SrcType, typename DestType > class ObservableListCaster : public ListCaster<SrcType, DestType, IReadonlyObservableList<SrcType> >, public virtual IReadonlyObservableList<DestType> { typedef ListCaster<SrcType, DestType, IReadonlyObservableList<SrcType> > base; typedef ObservableListCaster<SrcType, DestType> Self; typedef IReadonlyObservableList<SrcType> SrcListType; STINGRAYKIT_DECLARE_PTR(SrcListType); typedef signal_policies::threading::ExternalMutexPointer ExternalMutexPointer; public: typedef typename IReadonlyObservableList<DestType>::OnChangedSignature OnChangedSignature; typedef typename base::Caster Caster; typedef typename base::BackCaster BackCaster; private: signal<OnChangedSignature, ExternalMutexPointer> _onChanged; const Token _connection; public: explicit ObservableListCaster(const SrcListTypePtr& wrapped, const Caster& caster, const BackCaster& backCaster) : base(wrapped, caster, backCaster), _onChanged(ExternalMutexPointer(shared_ptr<const Mutex>(base::_wrapped, &base::_wrapped->GetSyncRoot())), Bind(&Self::OnChangedPopulator, this, _1)), _connection(base::_wrapped->OnChanged().connect(Bind(&Self::ChangedHandler, this, _1, _2, _3))) { } virtual signal_connector<OnChangedSignature> OnChanged() const { return _onChanged.connector(); } virtual const Mutex& GetSyncRoot() const { return base::_wrapped->GetSyncRoot(); } private: void OnChangedPopulator(const function<OnChangedSignature>& slot) const { size_t index = 0; FOR_EACH(const DestType value IN base::GetEnumerator()) slot(CollectionOp::Added, index++, value); } void ChangedHandler(CollectionOp op, size_t index, const SrcType& value) { _onChanged(op, index, base::_caster(value)); } }; namespace Detail { template < typename SrcListType > class ListCasterProxy { typedef typename SrcListType::ItemType SrcType; private: shared_ptr<SrcListType> _srcList; public: ListCasterProxy(const shared_ptr<SrcListType>& srcList) : _srcList(srcList) { } template < typename DestType > operator shared_ptr<IReadonlyList<DestType> > () const { return make_shared_ptr<ListCaster<SrcType, DestType> >(_srcList, &DefaultCast<DestType>, &DefaultBackCast<DestType>); } template < typename DestType > operator shared_ptr<IReadonlyObservableList<DestType> > () const { return make_shared_ptr<ObservableListCaster<SrcType, DestType> >(_srcList, &DefaultCast<DestType>, &DefaultBackCast<DestType>); } private: template < typename DestType > static typename EnableIf<IsConvertible<SrcType, DestType>::Value, DestType>::ValueT DefaultCast(const SrcType& value) { return DestType(value); } template < typename DestType > static typename EnableIf<IsSharedPtr<SrcType>::Value && IsSharedPtr<DestType>::Value, bool>::ValueT DefaultBackCast(const DestType& value, SrcType& result) { result = dynamic_caster(value); return result.is_initialized(); } }; } template < typename T > typename Detail::ListCasterProxy<T> GetListCaster(const shared_ptr<T>& list) { return Detail::ListCasterProxy<T>(list); } /** @} */ } #endif
#ifndef VAR_0 #define VAR_0 // Copyright (c) 2011 - 2019, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <IMPORT_0> #include <IMPORT_1> #include <IMPORT_2> #include <IMPORT_3> CLASS_0 VAR_1 { /** * @addtogroup toolkit_collections * @{ */ VAR_2 < VAR_3 VAR_4, VAR_3 VAR_5, VAR_3 VAR_6 = VAR_7<VAR_4> > class ListCaster : VAR_9 VAR_10 VAR_7<VAR_5> { typedef CLASS_4<ID_0, ID_1, ID_2> VAR_11; FUNC_2(VAR_6); public: VAR_12 VAR_13<FUNC_0 (VAR_14 VAR_4&)> VAR_15; typedef CLASS_6<bool (const CLASS_3&, CLASS_2&)> ID_4; protected: VAR_14 CLASS_9 _wrapped; const CLASS_7 VAR_18; const CLASS_8 VAR_19; public: FUNC_1(VAR_14 VAR_17& VAR_20, VAR_14 VAR_15& VAR_21, VAR_14 VAR_16& VAR_22) : _wrapped(FUNC_5(VAR_20)), FUNC_3(VAR_21), FUNC_4(VAR_22) { } CLASS_5 VAR_23<VAR_24<VAR_5> > FUNC_6() const { return FUNC_7(_wrapped->FUNC_6(), VAR_18); } CLASS_5 VAR_23<VAR_25<VAR_5> > FUNC_8() const { return FUNC_9(_wrapped->FUNC_8(), VAR_18); } CLASS_5 VAR_26 FUNC_10() const { return _wrapped->FUNC_10(); } CLASS_5 VAR_27 FUNC_11() const { return _wrapped->FUNC_11(); } CLASS_5 VAR_27 FUNC_12(const CLASS_3& VAR_28) VAR_14 { CLASS_2 value_; return FUNC_4(VAR_28, value_) ? _wrapped->FUNC_12(value_) : false; } CLASS_5 VAR_29<size_t> FUNC_13(const CLASS_3& VAR_28) VAR_14 { CLASS_2 value_; return FUNC_4(VAR_28, value_) ? _wrapped->FUNC_13(value_) : VAR_30; } CLASS_5 VAR_5 FUNC_14(size_t VAR_31) VAR_14 { return FUNC_3(_wrapped->FUNC_14(VAR_31)); } CLASS_5 VAR_27 FUNC_15(size_t VAR_31, CLASS_3& VAR_28) VAR_14 { CLASS_2 value_; if (_wrapped->FUNC_15(VAR_31, value_)) { VAR_28 = FUNC_3(value_); return true; } return false; } }; VAR_2 < VAR_3 VAR_4, VAR_3 VAR_5 > class ObservableListCaster : VAR_9 VAR_8<VAR_4, VAR_5, VAR_33<VAR_4> >, VAR_9 VAR_10 VAR_33<VAR_5> { typedef CLASS_4<ID_0, ID_1, ID_5<VAR_4> > VAR_34; typedef CLASS_13<ID_0, ID_1> VAR_11; typedef CLASS_14<CLASS_2> ID_2; FUNC_2(VAR_6); typedef CLASS_16::CLASS_17::CLASS_18 ID_6; public: VAR_12 VAR_3 VAR_33<VAR_5>::VAR_36 VAR_36; typedef CLASS_1 CLASS_15::CLASS_7 ID_3; typedef CLASS_1 CLASS_15::CLASS_8 ID_4; private: VAR_37<VAR_36, VAR_35> VAR_38; const Token VAR_39; public: VAR_40 VAR_32(const CLASS_9& VAR_20, VAR_14 VAR_15& VAR_21, VAR_14 VAR_16& VAR_22) : FUNC_16(VAR_20, VAR_21, VAR_22), FUNC_18(FUNC_17(VAR_23<VAR_14 VAR_41>(VAR_34::_wrapped, &VAR_34::_wrapped->FUNC_20())), FUNC_21(&VAR_11::VAR_42, VAR_43, VAR_44)), FUNC_19(VAR_34::_wrapped->FUNC_22().FUNC_23(FUNC_21(&VAR_11::VAR_45, VAR_43, VAR_44, VAR_46, VAR_47))) { } CLASS_5 VAR_48<VAR_36> FUNC_22() const { return VAR_38.FUNC_25(); } CLASS_5 const VAR_41& FUNC_20() const { return VAR_34::_wrapped->FUNC_20(); } private: VAR_49 VAR_42(const CLASS_6<VAR_36>& VAR_50) const { size_t VAR_31 = 0; VAR_51(const CLASS_3 VAR_28 VAR_52 VAR_34::CLASS_10()) FUNC_26(CLASS_19::VAR_53, CLASS_12++, CLASS_11); } void FUNC_24(CLASS_19 VAR_54, size_t VAR_31, const CLASS_2& VAR_28) { FUNC_18(VAR_54, VAR_31, VAR_34::FUNC_3(VAR_28)); } }; CLASS_0 VAR_55 { VAR_2 < VAR_3 VAR_6 > class VAR_56 { typedef CLASS_1 ID_2::VAR_57 VAR_4; private: VAR_23<VAR_6> VAR_58; public: FUNC_27(VAR_14 VAR_23<VAR_6>& VAR_59) : FUNC_28(VAR_59) { } VAR_2 < VAR_3 VAR_5 > VAR_60 VAR_23<VAR_7<VAR_5> > () const { return VAR_61<VAR_8<VAR_4, VAR_5>VAR_62 >(VAR_58, &VAR_63<VAR_5>, &VAR_64<VAR_5>); } VAR_2 < VAR_3 VAR_5 > VAR_60 VAR_23<VAR_33<VAR_5> > () const { return VAR_61<VAR_32<VAR_4, VAR_5>VAR_62 >(VAR_58, &VAR_63<VAR_5>, &VAR_64<VAR_5>); } private: VAR_2 < VAR_3 VAR_5 > VAR_65 VAR_3 VAR_66<VAR_67<VAR_4, VAR_5>::VAR_68, VAR_5>::ValueT FUNC_29(VAR_14 VAR_4& VAR_28) { return FUNC_0(VAR_28); } VAR_2 < VAR_3 VAR_5 > VAR_65 VAR_3 VAR_66<VAR_69<VAR_4>::VAR_68 && VAR_69<VAR_5>::VAR_68, VAR_27>::ValueT FUNC_30(VAR_14 VAR_5& VAR_28, VAR_4& VAR_70) { VAR_70 = FUNC_31(VAR_28); return VAR_70.FUNC_32(); } }; } VAR_2 < VAR_3 VAR_71 > VAR_3 Detail::VAR_56<VAR_71> FUNC_33(VAR_14 VAR_23<VAR_71>& VAR_72) { return VAR_55::VAR_56<VAR_71>(VAR_72); } /** @} */ } #endif
0.967424
{'VAR_0': 'STINGRAYKIT_COLLECTION_LISTCASTER_H', 'IMPORT_0': 'stingraykit/collection/EnumerableHelpers.h', 'IMPORT_1': 'stingraykit/collection/ForEach.h', 'IMPORT_2': 'stingraykit/collection/IObservableList.h', 'IMPORT_3': 'stingraykit/signal/signals.h', 'CLASS_0': 'namespace', 'VAR_1': 'stingray', 'VAR_2': 'template', 'VAR_3': 'typename', 'CLASS_1': 'typename', 'VAR_4': 'SrcType', 'ID_0': 'SrcType', 'CLASS_2': 'SrcType', 'VAR_5': 'DestType', 'ID_1': 'DestType', 'FUNC_0': 'DestType', 'CLASS_3': 'DestType', 'VAR_6': 'SrcListType', 'ID_2': 'SrcListType', 'VAR_7': 'IReadonlyList', 'CLASS_4': 'ListCaster', 'FUNC_1': 'ListCaster', 'VAR_8': 'ListCaster', 'VAR_9': 'public', 'VAR_10': 'virtual', 'CLASS_5': 'virtual', 'VAR_11': 'Self', 'FUNC_2': 'STINGRAYKIT_DECLARE_PTR', 'VAR_12': 'typedef', 'VAR_13': 'function', 'CLASS_6': 'function', 'VAR_14': 'const', 'VAR_15': 'Caster', 'CLASS_7': 'Caster', 'ID_3': 'Caster', 'ID_4': 'BackCaster', 'CLASS_8': 'BackCaster', 'VAR_16': 'BackCaster', 'CLASS_9': 'SrcListTypePtr', 'VAR_17': 'SrcListTypePtr', 'VAR_18': '_caster', 'FUNC_3': '_caster', 'VAR_19': '_backCaster', 'FUNC_4': '_backCaster', 'VAR_20': 'wrapped', 'VAR_21': 'caster', 'VAR_22': 'backCaster', 'FUNC_5': 'STINGRAYKIT_REQUIRE_NOT_NULL', 'VAR_23': 'shared_ptr', 'VAR_24': 'IEnumerator', 'FUNC_6': 'GetEnumerator', 'CLASS_10': 'GetEnumerator', 'FUNC_7': 'WrapEnumerator', 'VAR_25': 'IEnumerable', 'FUNC_8': 'Reverse', 'FUNC_9': 'WrapEnumerable', 'VAR_26': 'size_t', 'FUNC_10': 'GetCount', 'VAR_27': 'bool', 'FUNC_11': 'IsEmpty', 'FUNC_12': 'Contains', 'VAR_28': 'value', 'CLASS_11': 'value', 'VAR_29': 'optional', 'FUNC_13': 'IndexOf', 'VAR_30': 'null', 'FUNC_14': 'Get', 'VAR_31': 'index', 'CLASS_12': 'index', 'FUNC_15': 'TryGet', 'CLASS_13': 'ObservableListCaster', 'VAR_32': 'ObservableListCaster', 'VAR_33': 'IReadonlyObservableList', 'ID_5': 'IReadonlyObservableList', 'CLASS_14': 'IReadonlyObservableList', 'VAR_34': 'base', 'CLASS_15': 'base', 'FUNC_16': 'base', 'CLASS_16': 'signal_policies', 'CLASS_17': 'threading', 'CLASS_18': 'ExternalMutexPointer', 'ID_6': 'ExternalMutexPointer', 'VAR_35': 'ExternalMutexPointer', 'FUNC_17': 'ExternalMutexPointer', 'VAR_36': 'OnChangedSignature', 'VAR_37': 'signal', 'VAR_38': '_onChanged', 'FUNC_18': '_onChanged', 'VAR_39': '_connection', 'FUNC_19': '_connection', 'VAR_40': 'explicit', 'VAR_41': 'Mutex', 'FUNC_20': 'GetSyncRoot', 'FUNC_21': 'Bind', 'VAR_42': 'OnChangedPopulator', 'VAR_43': 'this', 'VAR_44': '_1', 'FUNC_22': 'OnChanged', 'FUNC_23': 'connect', 'VAR_45': 'ChangedHandler', 'FUNC_24': 'ChangedHandler', 'VAR_46': '_2', 'VAR_47': '_3', 'VAR_48': 'signal_connector', 'FUNC_25': 'connector', 'VAR_49': 'void', 'VAR_50': 'slot', 'FUNC_26': 'slot', 'VAR_51': 'FOR_EACH', 'VAR_52': 'IN', 'CLASS_19': 'CollectionOp', 'VAR_53': 'Added', 'VAR_54': 'op', 'VAR_55': 'Detail', 'VAR_56': 'ListCasterProxy', 'FUNC_27': 'ListCasterProxy', 'VAR_57': 'ItemType', 'VAR_58': '_srcList', 'FUNC_28': '_srcList', 'VAR_59': 'srcList', 'VAR_60': 'operator', 'VAR_61': 'make_shared_ptr', 'VAR_62': '', 'VAR_63': 'DefaultCast', 'FUNC_29': 'DefaultCast', 'VAR_64': 'DefaultBackCast', 'FUNC_30': 'DefaultBackCast', 'VAR_65': 'static', 'VAR_66': 'EnableIf', 'VAR_67': 'IsConvertible', 'VAR_68': 'Value', 'VAR_69': 'IsSharedPtr', 'VAR_70': 'result', 'FUNC_31': 'dynamic_caster', 'FUNC_32': 'is_initialized', 'VAR_71': 'T', 'FUNC_33': 'GetListCaster', 'VAR_72': 'list'}
#ifndef _LIBC_BITS_THREAD_H #define _LIBC_BITS_THREAD_H #include <sys/types.h> struct thread_create_params { uint32_t entry_point; uint32_t stack_start; uint32_t stack_size; }; typedef struct thread_create_params thread_create_params_t; #endif // _LIBC_BITS_THREAD_H
#ifndef VAR_0 #define VAR_0 #include <IMPORT_0> struct CLASS_0 { uint32_t VAR_1; uint32_t VAR_2; uint32_t VAR_3; }; typedef struct CLASS_0 ID_0; #endif // _LIBC_BITS_THREAD_H
0.681676
{'VAR_0': '_LIBC_BITS_THREAD_H', 'IMPORT_0': 'sys/types.h', 'CLASS_0': 'thread_create_params', 'VAR_1': 'entry_point', 'VAR_2': 'stack_start', 'VAR_3': 'stack_size', 'ID_0': 'thread_create_params_t'}
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>. // #import "APDPBGeneratedMessage.h" @class NSString; @interface finscbffEventQuotationQueryModelPB : APDPBGeneratedMessage { } + (CDStruct_af61540b *)_fieldInfos; // Remaining properties @property(readonly) _Bool hasPb_hasEvent; // @dynamic hasPb_hasEvent; @property(readonly) _Bool hasQuotationEvent; // @dynamic hasQuotationEvent; @property(readonly) _Bool hasQuotationEventID; // @dynamic hasQuotationEventID; @property(readonly) _Bool hasSymbol; // @dynamic hasSymbol; @property(nonatomic) _Bool pb_hasEvent; // @dynamic pb_hasEvent; @property(retain, nonatomic) NSString *quotationEvent; // @dynamic quotationEvent; @property(retain, nonatomic) NSString *quotationEventID; // @dynamic quotationEventID; @property(retain, nonatomic) NSString *symbol; // @dynamic symbol; @end
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>. // #import "APDPBGeneratedMessage.h" @CLASS_0 VAR_0; @CLASS_2 VAR_1 : VAR_2 { } + (CLASS_3 *)VAR_3; // Remaining properties @VAR_4(ID_0) _Bool VAR_5; // @dynamic hasPb_hasEvent; @VAR_4(ID_0) _Bool VAR_6; // @dynamic hasQuotationEvent; @VAR_4(ID_0) _Bool VAR_7; // @dynamic hasQuotationEventID; @VAR_4(ID_0) _Bool VAR_8; // @dynamic hasSymbol; @VAR_4(nonatomic) _Bool VAR_9; // @dynamic pb_hasEvent; @FUNC_0(VAR_10, nonatomic) CLASS_1 *VAR_11; // @dynamic quotationEvent; @FUNC_0(VAR_10, nonatomic) CLASS_1 *quotationEventID; // @dynamic quotationEventID; @FUNC_0(VAR_10, nonatomic) CLASS_1 *VAR_12; // @dynamic symbol; @CLASS_4
0.606935
{'CLASS_0': 'class', 'VAR_0': 'NSString', 'CLASS_1': 'NSString', 'CLASS_2': 'interface', 'VAR_1': 'finscbffEventQuotationQueryModelPB', 'VAR_2': 'APDPBGeneratedMessage', 'CLASS_3': 'CDStruct_af61540b', 'VAR_3': '_fieldInfos', 'VAR_4': 'property', 'FUNC_0': 'property', 'ID_0': 'readonly', 'VAR_5': 'hasPb_hasEvent', 'VAR_6': 'hasQuotationEvent', 'VAR_7': 'hasQuotationEventID', 'VAR_8': 'hasSymbol', 'VAR_9': 'pb_hasEvent', 'VAR_10': 'retain', 'VAR_11': 'quotationEvent', 'VAR_12': 'symbol', 'CLASS_4': 'end'}
/* * System Interface Library for games * Copyright (c) 2007-2020 <NAME> <<EMAIL>> * Released under the GNU GPL version 3 or later; NO WARRANTY is provided. * See the file COPYING.txt for details. * * src/sysdep/android/thread.c: POSIX thread helpers for Android. */ #define IN_SYSDEP #include "src/base.h" #include "src/sysdep.h" #include "src/sysdep/android/internal.h" #include "src/sysdep/posix/thread.h" #include "src/thread.h" #include <jni.h> /*************************************************************************/ /*************************************************************************/ void posix_thread_runner_init(SysThread *thread) { JavaVM *vm = android_activity->vm; JNIEnv *env; (*vm)->AttachCurrentThread(vm, &env, NULL); jclass android_os_Process = get_class("android.os.Process"); ASSERT(android_os_Process, return); jmethodID setThreadPriority = (*env)->GetStaticMethodID( env, android_os_Process, "setThreadPriority", "(I)V"); ASSERT(setThreadPriority != 0, return); (*env)->CallStaticVoidMethod(env, android_os_Process, setThreadPriority, thread->initial_priority); if (UNLIKELY(clear_exceptions(env))) { DLOG("Failed to set thread priority to %d", thread->initial_priority); } if (thread->initial_affinity) { if (UNLIKELY(!thread_set_affinity(thread->initial_affinity))) { DLOG("Failed to set thread affinity mask to 0x%llX", (long long)thread->initial_affinity); } } } /*-----------------------------------------------------------------------*/ void posix_thread_runner_cleanup(UNUSED SysThread *thread) { JavaVM *vm = android_activity->vm; (*vm)->DetachCurrentThread(vm); } /*************************************************************************/ /*************************************************************************/
/* * System Interface Library for games * Copyright (c) 2007-2020 <NAME> <<EMAIL>> * Released under the GNU GPL version 3 or later; NO WARRANTY is provided. * See the file COPYING.txt for details. * * src/sysdep/android/thread.c: POSIX thread helpers for Android. */ #define VAR_0 #include "IMPORT_0" #include "src/sysdep.h" #include "IMPORT_1" #include "IMPORT_2" #include "IMPORT_3" #include <IMPORT_4> /*************************************************************************/ /*************************************************************************/ void FUNC_0(CLASS_0 *VAR_2) { CLASS_1 *VAR_3 = VAR_4->VAR_3; CLASS_2 *VAR_5; (*VAR_3)->FUNC_1(VAR_3, &VAR_5, NULL); CLASS_3 VAR_6 = FUNC_2("android.os.Process"); FUNC_3(VAR_6, VAR_7); CLASS_4 VAR_8 = (*VAR_5)->FUNC_4( VAR_5, VAR_6, "setThreadPriority", "(I)V"); FUNC_3(VAR_8 != 0, VAR_7); (*VAR_5)->CallStaticVoidMethod(VAR_5, VAR_6, VAR_8, VAR_2->VAR_9); if (UNLIKELY(FUNC_5(VAR_5))) { FUNC_6("Failed to set thread priority to %d", VAR_2->VAR_9); } if (VAR_2->VAR_10) { if (UNLIKELY(!FUNC_7(VAR_2->VAR_10))) { FUNC_6("Failed to set thread affinity mask to 0x%llX", (long long)VAR_2->VAR_10); } } } /*-----------------------------------------------------------------------*/ void FUNC_8(CLASS_5 VAR_1 *VAR_2) { CLASS_1 *VAR_3 = VAR_4->VAR_3; (*VAR_3)->FUNC_9(VAR_3); } /*************************************************************************/ /*************************************************************************/
0.939921
{'VAR_0': 'IN_SYSDEP', 'IMPORT_0': 'src/base.h', 'IMPORT_1': 'src/sysdep/android/internal.h', 'IMPORT_2': 'src/sysdep/posix/thread.h', 'IMPORT_3': 'src/thread.h', 'IMPORT_4': 'jni.h', 'FUNC_0': 'posix_thread_runner_init', 'CLASS_0': 'SysThread', 'VAR_1': 'SysThread', 'VAR_2': 'thread', 'CLASS_1': 'JavaVM', 'VAR_3': 'vm', 'VAR_4': 'android_activity', 'CLASS_2': 'JNIEnv', 'VAR_5': 'env', 'FUNC_1': 'AttachCurrentThread', 'CLASS_3': 'jclass', 'VAR_6': 'android_os_Process', 'FUNC_2': 'get_class', 'FUNC_3': 'ASSERT', 'VAR_7': 'return', 'CLASS_4': 'jmethodID', 'VAR_8': 'setThreadPriority', 'FUNC_4': 'GetStaticMethodID', 'VAR_9': 'initial_priority', 'FUNC_5': 'clear_exceptions', 'FUNC_6': 'DLOG', 'VAR_10': 'initial_affinity', 'FUNC_7': 'thread_set_affinity', 'FUNC_8': 'posix_thread_runner_cleanup', 'CLASS_5': 'UNUSED', 'FUNC_9': 'DetachCurrentThread'}
#ifndef BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H #define BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H #include "biorbdConfig.h" #include "Muscles/StaticOptimizationIpopt.h" namespace BIORBD_NAMESPACE { namespace utils { class Matrix; class Vector; } namespace muscles { /// /// \brief The actual implementation of the Static Optimization problem using a linearized approach /// /// This algo should be much faster than tradition but less precise (Michaud, 2020) /// /// class BIORBD_API StaticOptimizationIpoptLinearized : public StaticOptimizationIpopt { public: /// /// \brief Construct an Ipopt static optimization problem /// \param model The musculoskeletal Model /// \param Q The generalized coordinates /// \param Qdot The generalized velocities /// \param torqueTarget The generalized torque target /// \param activationInit The initial activation /// \param useResidual If use residual torque, if set to false, the optimization will fail if the model is not strong enough /// \param pNormFactor The p-norm to perform /// \param verbose Level of IPOPT verbose you want /// \param eps The precision to perform the finite diffentiation /// StaticOptimizationIpoptLinearized( Model& model, const rigidbody::GeneralizedCoordinates& Q, const rigidbody::GeneralizedVelocity& Qdot, const rigidbody::GeneralizedTorque& torqueTarget, const utils::Vector& activationInit, bool useResidual = true, unsigned int pNormFactor = 2, int verbose = 0, double eps = 1e-10); /// /// \brief Destroy class properly /// virtual ~StaticOptimizationIpoptLinearized(); /// /// \brief Method to return the constraint residuals /// \param n The number of variables /// \param x The values of the variables /// \param new_x If the variables were modified by IPOPT /// \param m The number of constraints /// \param g The actual contraints residual /// \return Return the presence of that function /// virtual bool eval_g( Ipopt::Index n, const Ipopt::Number* x, bool new_x, Ipopt::Index m, Ipopt::Number* g); /// /// \brief Return the jacobian of contraints /// \param n The number of variables /// \param x The values of the variables /// \param new_x If the variables were modified by IPOPT /// \param m The number of constraints /// \param nele_jac Number of elements in the jacobian matrix /// \param iRow iterator on the rows of the jacobian /// \param jCol iterator on the columns of the jacobian /// \param values The actual constraint jacobian /// \return Return the presence of that function /// virtual bool eval_jac_g( Ipopt::Index n, const Ipopt::Number* x, bool new_x, Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index* iRow, Ipopt::Index* jCol, Ipopt::Number* values); protected: std::shared_ptr<utils::Matrix> m_jacobian; ///< The constraints jacobian void prepareJacobian(); ///< Setup the constant constraints jacobian }; } } #endif // BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H
#ifndef VAR_0 #define VAR_0 #include "IMPORT_0" #include "Muscles/StaticOptimizationIpopt.h" CLASS_0 VAR_1 { CLASS_0 utils { CLASS_1 Matrix; CLASS_1 Vector; } CLASS_0 VAR_2 { /// /// \brief The actual implementation of the Static Optimization problem using a linearized approach /// /// This algo should be much faster than tradition but less precise (Michaud, 2020) /// /// CLASS_1 VAR_3 StaticOptimizationIpoptLinearized : public VAR_4 { public: /// /// \brief Construct an Ipopt static optimization problem /// \param model The musculoskeletal Model /// \param Q The generalized coordinates /// \param Qdot The generalized velocities /// \param torqueTarget The generalized torque target /// \param activationInit The initial activation /// \param useResidual If use residual torque, if set to false, the optimization will fail if the model is not strong enough /// \param pNormFactor The p-norm to perform /// \param verbose Level of IPOPT verbose you want /// \param eps The precision to perform the finite diffentiation /// StaticOptimizationIpoptLinearized( VAR_5& model, const VAR_6::GeneralizedCoordinates& Q, const VAR_6::GeneralizedVelocity& Qdot, const VAR_6::VAR_7& VAR_8, const utils::Vector& VAR_9, VAR_10 useResidual = true, VAR_11 VAR_12 pNormFactor = 2, VAR_12 VAR_13 = 0, double VAR_14 = 1e-10); /// /// \brief Destroy class properly /// virtual ~StaticOptimizationIpoptLinearized(); /// /// \brief Method to return the constraint residuals /// \param n The number of variables /// \param x The values of the variables /// \param new_x If the variables were modified by IPOPT /// \param m The number of constraints /// \param g The actual contraints residual /// \return Return the presence of that function /// virtual VAR_10 eval_g( CLASS_2::Index VAR_15, const CLASS_2::Number* x, bool VAR_16, CLASS_2::Index m, CLASS_2::Number* VAR_17); /// /// \brief Return the jacobian of contraints /// \param n The number of variables /// \param x The values of the variables /// \param new_x If the variables were modified by IPOPT /// \param m The number of constraints /// \param nele_jac Number of elements in the jacobian matrix /// \param iRow iterator on the rows of the jacobian /// \param jCol iterator on the columns of the jacobian /// \param values The actual constraint jacobian /// \return Return the presence of that function /// virtual VAR_10 FUNC_0( CLASS_2::Index VAR_15, const CLASS_2::Number* x, bool VAR_16, CLASS_2::Index m, CLASS_2::Index VAR_18, CLASS_2::Index* VAR_19, CLASS_2::Index* VAR_20, CLASS_2::Number* values); protected: std::shared_ptr<utils::Matrix> m_jacobian; ///< The constraints jacobian void prepareJacobian(); ///< Setup the constant constraints jacobian }; } } #endif // BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H
0.507381
{'VAR_0': 'BIORBD_MUSCLES_STATIC_OPTIMIZATION_IPOPT_LINEARIZED_H', 'IMPORT_0': 'biorbdConfig.h', 'CLASS_0': 'namespace', 'VAR_1': 'BIORBD_NAMESPACE', 'CLASS_1': 'class', 'VAR_2': 'muscles', 'VAR_3': 'BIORBD_API', 'VAR_4': 'StaticOptimizationIpopt', 'VAR_5': 'Model', 'VAR_6': 'rigidbody', 'VAR_7': 'GeneralizedTorque', 'VAR_8': 'torqueTarget', 'VAR_9': 'activationInit', 'VAR_10': 'bool', 'VAR_11': 'unsigned', 'VAR_12': 'int', 'VAR_13': 'verbose', 'VAR_14': 'eps', 'CLASS_2': 'Ipopt', 'VAR_15': 'n', 'VAR_16': 'new_x', 'VAR_17': 'g', 'FUNC_0': 'eval_jac_g', 'VAR_18': 'nele_jac', 'VAR_19': 'iRow', 'VAR_20': 'jCol'}
/* * Copyright (c) 2016 PrivatBank IT <<EMAIL>>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include <memory.h> #include "word_internal.h" #include "byte_utils_internal.h" #include "macros_internal.h" #undef FILE_MARKER #define FILE_MARKER "cryptonite/word_internal.c" WordArray *wa_alloc(size_t len) { WordArray *wa = NULL; int ret = RET_OK; CHECK_PARAM(len != 0); CALLOC_CHECKED(wa, sizeof(WordArray)); MALLOC_CHECKED(wa->buf, len * WORD_BYTE_LENGTH); wa->len = len; cleanup: if (ret != RET_OK) { wa_free(wa); wa = NULL; } return wa; } void wa_zero(WordArray *wa) { if (wa) { memset(wa->buf, 0, wa->len * WORD_BYTE_LENGTH); } } WordArray *wa_alloc_with_zero(size_t len) { WordArray *wa = NULL; int ret = RET_OK; CHECK_PARAM(len != 0); CHECK_NOT_NULL(wa = wa_alloc(len)); memset(wa->buf, 0, len * WORD_BYTE_LENGTH); cleanup: if (ret != RET_OK) { wa_free(wa); wa = NULL; } return wa; } void wa_one(WordArray *wa) { if (wa) { memset(wa->buf, 0, wa->len * WORD_BYTE_LENGTH); wa->buf[0] = 1; } } WordArray *wa_alloc_with_one(size_t len) { WordArray *wa = NULL; int ret = RET_OK; CHECK_PARAM(len != 0); CHECK_NOT_NULL(wa = wa_alloc(len)); memset(wa->buf, 0, len * WORD_BYTE_LENGTH); wa->buf[0] = 1; cleanup: if (ret != RET_OK) { wa_free(wa); wa = NULL; } return wa; } WordArray *wa_alloc_from_ba(const ByteArray *ba) { WordArray *ans = NULL; int ret; CHECK_PARAM(ba != NULL); CHECK_NOT_NULL(ans = wa_alloc_from_le(ba->buf, ba->len)); cleanup: return ans; } WordArray *wa_alloc_from_le(const uint8_t *in, size_t in_len) { WordArray *wa = NULL; int ret = RET_OK; CHECK_PARAM(in != NULL); CHECK_PARAM(in_len != 0); MALLOC_CHECKED(wa, sizeof(WordArray)); wa->len = (in_len + WORD_BYTE_LENGTH - 1) / WORD_BYTE_LENGTH; MALLOC_CHECKED(wa->buf, wa->len * WORD_BYTE_LENGTH); #ifdef ARCH64 DO(uint8_to_uint64(in, in_len, wa->buf, wa->len)); #else DO(uint8_to_uint32(in, in_len, wa->buf, wa->len)); #endif cleanup: if (ret != RET_OK) { wa_free(wa); wa = NULL; } return wa; } WordArray *wa_alloc_from_be(const uint8_t *in, size_t in_len) { WordArray *wa = NULL; uint8_t *in_le = NULL; int ret = RET_OK; CHECK_PARAM(in != NULL); CHECK_PARAM(in_len != 0); MALLOC_CHECKED(wa, sizeof(WordArray)); wa->len = (in_len + WORD_BYTE_LENGTH - 1) / WORD_BYTE_LENGTH; MALLOC_CHECKED(wa->buf, wa->len * WORD_BYTE_LENGTH); CHECK_NOT_NULL(in_le = uint8_swap_with_alloc(in, in_len)); #ifdef ARCH64 DO(uint8_to_uint64(in_le, in_len, wa->buf, wa->len)); #else DO(uint8_to_uint32(in_le, in_len, wa->buf, wa->len)); #endif cleanup: if (ret != RET_OK) { wa_free(wa); wa = NULL; } free(in_le); return wa; } int wa_from_ba(const ByteArray *ba, WordArray *wa) { int ret = RET_OK; CHECK_PARAM(ba != NULL); wa->len = (ba->len + WORD_BYTE_LENGTH - 1) / WORD_BYTE_LENGTH; REALLOC_CHECKED(wa->buf, wa->len * WORD_BYTE_LENGTH, wa->buf); #ifdef ARCH64 DO(uint8_to_uint64(ba->buf, ba->len, wa->buf, wa->len)); #else DO(uint8_to_uint32(ba->buf, ba->len, wa->buf, wa->len)); #endif cleanup: return ret; } WordArray *wa_copy_with_alloc(const WordArray *in) { WordArray *wa = NULL; int ret = RET_OK; CHECK_PARAM(in != NULL); CHECK_NOT_NULL(wa = wa_alloc(in->len)); DO(wa_copy(in, wa)); cleanup: if (ret != RET_OK) { wa_free(wa); wa = NULL; } return wa; } int wa_to_uint8(WordArray *wa, uint8_t *in, size_t in_len) { int ret = RET_OK; CHECK_PARAM(wa != NULL); CHECK_PARAM(in != NULL); #ifdef ARCH64 DO(uint64_to_uint8(wa->buf, wa->len, in, in_len)); #else DO(uint32_to_uint8(wa->buf, wa->len, in, in_len)); #endif cleanup: return ret; } WordArray *wa_alloc_from_uint8(const uint8_t *in, size_t in_len) { WordArray *wa = NULL; int ret = RET_OK; CHECK_PARAM(in != NULL); CHECK_PARAM(in_len != 0); MALLOC_CHECKED(wa, sizeof (WordArray)); wa->len = (in_len + WORD_BYTE_LENGTH - 1) / WORD_BYTE_LENGTH; MALLOC_CHECKED(wa->buf, wa->len * WORD_BYTE_LENGTH); #ifdef ARCH64 DO(uint8_to_uint64(in, in_len, wa->buf, wa->len)); #else DO(uint8_to_uint32(in, in_len, wa->buf, wa->len)); #endif return wa; cleanup: free(wa); return NULL; } int wa_copy(const WordArray *in, WordArray *out) { if (in == NULL || out == NULL || in->len > out->len) { ERROR_CREATE(RET_INVALID_PARAM); return RET_INVALID_PARAM; } if (in != out) { memcpy(out->buf, in->buf, in->len * WORD_BYTE_LENGTH); if (in->len < out->len) { memset(&out->buf[in->len], 0, (out->len - in->len) * WORD_BYTE_LENGTH); } } return RET_OK; } int wa_copy_part(const WordArray *in, size_t off, size_t len, WordArray *out) { if (in == NULL || out == NULL || in->len < off + len || out->len != len || in == out) { ERROR_CREATE(RET_INVALID_PARAM); return RET_INVALID_PARAM; } memcpy(out->buf, in->buf + off, len * WORD_BYTE_LENGTH); return RET_OK; } ByteArray *wa_to_ba(const WordArray *wa) { ByteArray *ans = NULL; int ret; if (wa != NULL) { #ifdef ARCH64 CHECK_NOT_NULL(ans = ba_alloc_from_uint64(wa->buf, wa->len)); #else CHECK_NOT_NULL(ans = ba_alloc_from_uint32(wa->buf, wa->len)); #endif } cleanup: return ans; } void wa_change_len(WordArray *wa, size_t len) { int ret = RET_OK; REALLOC_CHECKED(wa->buf, len * sizeof (word_t), wa->buf); if (wa->len < len) { memset(&wa->buf[wa->len], 0, (len - wa->len) * sizeof (word_t)); } wa->len = len; cleanup: return; } void wa_free(WordArray *in) { if (in) { free(in->buf); free(in); } } void wa_free_private(WordArray *in) { if (in) { if (in->buf && in->len > 0) { secure_zero(in->buf, in->len * WORD_BYTE_LENGTH); } free(in->buf); free(in); } } #define U64(a) ((uint64_t)(a)) int word_bit_len(word_t a) { #ifdef ARCH64 return (a < U64(0x100000000) ? (a < 0x10000 ? (a < 0x100 ? (a < 0x10 ? (a < 0x4 ? (a < 0x2 ? (a < 0x1 ? 0 : 1) : 2) : (a < 0x8 ? 3 : 4)) : (a < 0x40 ? (a < 0x20 ? 5 : 6) : (a < 0x80 ? 7 : 8))) : (a < 0x1000 ? (a < 0x400 ? (a < 0x200 ? 9 : 10) : (a < 0x800 ? 11 : 12)) : (a < 0x4000 ? (a < 0x2000 ? 13 : 14) : (a < 0x8000 ? 15 : 16)))) : (a < 0x1000000 ? (a < 0x100000 ? (a < 0x40000 ? (a < 0x20000 ? 17 : 18) : (a < 0x80000 ? 19 : 20)) : (a < 0x400000 ? (a < 0x200000 ? 21 : 22) : (a < 0x800000 ? 23 : 24))) : (a < 0x10000000 ? (a < 0x4000000 ? (a < 0x2000000 ? 25 : 26) : (a < 0x8000000 ? 27 : 28)) : (a < 0x40000000 ? (a < 0x20000000 ? 29 : 30) : (a < 0x80000000 ? 31 : 32))))) : (a < U64(0x1000000000000) ? (a < U64(0x10000000000) ? (a < U64(0x1000000000) ? (a < U64(0x400000000) ? (a < U64(0x200000000) ? 33 : 34) : (a < U64(0x800000000) ? 35 : 36)) : (a < U64(0x4000000000) ? (a < U64(0x2000000000) ? 37 : 38) : (a < U64(0x8000000000) ? 39 : 40))) : (a < U64(0x100000000000) ? (a < U64(0x40000000000) ? (a < U64(0x20000000000) ? 41 : 42) : (a < U64(0x80000000000) ? 43 : 44)) : (a < U64(0x400000000000) ? (a < U64(0x200000000000) ? 45 : 46) : (a < U64(0x800000000000) ? 47 : 48)))) : (a < U64(0x100000000000000) ? (a < U64(0x10000000000000) ? (a < U64(0x4000000000000) ? (a < U64(0x2000000000000) ? 49 : 50) : (a < U64(0x8000000000000) ? 51 : 52)) : (a < U64(0x40000000000000) ? (a < U64(0x20000000000000) ? 53 : 54) : (a < U64(0x80000000000000) ? 55 : 56))) : (a < U64(0x1000000000000000) ? (a < U64(0x400000000000000) ? (a < U64(0x200000000000000) ? 57 : 58) : (a < U64(0x800000000000000) ? 59 : 60)) : (a < U64(0x4000000000000000) ? (a < U64(0x2000000000000000) ? 61 : 62) : (a < U64(0x8000000000000000) ? 63 : 64)))))); #else return (a < 0x10000 ? (a < 0x100 ? (a < 0x10 ? (a < 0x4 ? (a < 0x2 ? (a < 0x1 ? 0 : 1) : 2) : (a < 0x8 ? 3 : 4)) : (a < 0x40 ? (a < 0x20 ? 5 : 6) : (a < 0x80 ? 7 : 8))) : (a < 0x1000 ? (a < 0x400 ? (a < 0x200 ? 9 : 10) : (a < 0x800 ? 11 : 12)) : (a < 0x4000 ? (a < 0x2000 ? 13 : 14) : (a < 0x8000 ? 15 : 16)))) : (a < 0x1000000 ? (a < 0x100000 ? (a < 0x40000 ? (a < 0x20000 ? 17 : 18) : (a < 0x80000 ? 19 : 20)) : (a < 0x400000 ? (a < 0x200000 ? 21 : 22) : (a < 0x800000 ? 23 : 24))) : (a < 0x10000000 ? (a < 0x4000000 ? (a < 0x2000000 ? 25 : 26) : (a < 0x8000000 ? 27 : 28)) : (a < 0x40000000 ? (a < 0x20000000 ? 29 : 30) : (a < 0x80000000 ? 31 : 32))))); #endif } int wa_cmp(const WordArray *a, const WordArray *b) { if (a->len != b->len) { return (int)(a->len - b->len); } return memcmp(a->buf, b->buf, a->len * sizeof(word_t)); }
/* * Copyright (c) 2016 PrivatBank IT <<EMAIL>>. All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include <memory.h> #include "word_internal.h" #include "byte_utils_internal.h" #include "macros_internal.h" #undef FILE_MARKER #define FILE_MARKER "cryptonite/word_internal.c" WordArray *wa_alloc(size_t VAR_0) { WordArray *VAR_1 = NULL; int ret = RET_OK; FUNC_0(VAR_0 != 0); FUNC_1(VAR_1, sizeof(WordArray)); MALLOC_CHECKED(VAR_1->buf, VAR_0 * VAR_2); VAR_1->VAR_0 = VAR_0; cleanup: if (ret != RET_OK) { wa_free(VAR_1); VAR_1 = NULL; } return VAR_1; } void wa_zero(WordArray *VAR_1) { if (VAR_1) { FUNC_2(VAR_1->buf, 0, VAR_1->VAR_0 * VAR_2); } } WordArray *wa_alloc_with_zero(size_t VAR_0) { WordArray *VAR_1 = NULL; int ret = RET_OK; FUNC_0(VAR_0 != 0); FUNC_3(VAR_1 = wa_alloc(VAR_0)); FUNC_2(VAR_1->buf, 0, VAR_0 * VAR_2); cleanup: if (ret != RET_OK) { wa_free(VAR_1); VAR_1 = NULL; } return VAR_1; } void FUNC_4(WordArray *VAR_1) { if (VAR_1) { FUNC_2(VAR_1->buf, 0, VAR_1->VAR_0 * VAR_2); VAR_1->buf[0] = 1; } } WordArray *wa_alloc_with_one(size_t VAR_0) { WordArray *VAR_1 = NULL; int ret = RET_OK; FUNC_0(VAR_0 != 0); FUNC_3(VAR_1 = wa_alloc(VAR_0)); FUNC_2(VAR_1->buf, 0, VAR_0 * VAR_2); VAR_1->buf[0] = 1; cleanup: if (ret != RET_OK) { wa_free(VAR_1); VAR_1 = NULL; } return VAR_1; } WordArray *wa_alloc_from_ba(const ByteArray *ba) { WordArray *VAR_3 = NULL; int ret; FUNC_0(ba != NULL); FUNC_3(VAR_3 = wa_alloc_from_le(ba->buf, ba->VAR_0)); cleanup: return VAR_3; } WordArray *wa_alloc_from_le(const uint8_t *VAR_4, size_t in_len) { WordArray *VAR_1 = NULL; int ret = RET_OK; FUNC_0(VAR_4 != NULL); FUNC_0(in_len != 0); MALLOC_CHECKED(VAR_1, sizeof(WordArray)); VAR_1->VAR_0 = (in_len + VAR_2 - 1) / VAR_2; MALLOC_CHECKED(VAR_1->buf, VAR_1->VAR_0 * VAR_2); #ifdef VAR_5 FUNC_5(uint8_to_uint64(VAR_4, in_len, VAR_1->buf, VAR_1->VAR_0)); #else FUNC_5(uint8_to_uint32(VAR_4, in_len, VAR_1->buf, VAR_1->VAR_0)); #endif cleanup: if (ret != RET_OK) { wa_free(VAR_1); VAR_1 = NULL; } return VAR_1; } WordArray *FUNC_6(const uint8_t *VAR_4, size_t in_len) { WordArray *VAR_1 = NULL; uint8_t *in_le = NULL; int ret = RET_OK; FUNC_0(VAR_4 != NULL); FUNC_0(in_len != 0); MALLOC_CHECKED(VAR_1, sizeof(WordArray)); VAR_1->VAR_0 = (in_len + VAR_2 - 1) / VAR_2; MALLOC_CHECKED(VAR_1->buf, VAR_1->VAR_0 * VAR_2); FUNC_3(in_le = uint8_swap_with_alloc(VAR_4, in_len)); #ifdef VAR_5 FUNC_5(uint8_to_uint64(in_le, in_len, VAR_1->buf, VAR_1->VAR_0)); #else FUNC_5(uint8_to_uint32(in_le, in_len, VAR_1->buf, VAR_1->VAR_0)); #endif cleanup: if (ret != RET_OK) { wa_free(VAR_1); VAR_1 = NULL; } FUNC_7(in_le); return VAR_1; } int FUNC_8(const ByteArray *ba, WordArray *VAR_1) { int ret = RET_OK; FUNC_0(ba != NULL); VAR_1->VAR_0 = (ba->VAR_0 + VAR_2 - 1) / VAR_2; REALLOC_CHECKED(VAR_1->buf, VAR_1->VAR_0 * VAR_2, VAR_1->buf); #ifdef VAR_5 FUNC_5(uint8_to_uint64(ba->buf, ba->VAR_0, VAR_1->buf, VAR_1->VAR_0)); #else FUNC_5(uint8_to_uint32(ba->buf, ba->VAR_0, VAR_1->buf, VAR_1->VAR_0)); #endif cleanup: return ret; } WordArray *wa_copy_with_alloc(const WordArray *VAR_4) { WordArray *VAR_1 = NULL; int ret = RET_OK; FUNC_0(VAR_4 != NULL); FUNC_3(VAR_1 = wa_alloc(VAR_4->VAR_0)); FUNC_5(wa_copy(VAR_4, VAR_1)); cleanup: if (ret != RET_OK) { wa_free(VAR_1); VAR_1 = NULL; } return VAR_1; } int FUNC_9(WordArray *VAR_1, uint8_t *VAR_4, size_t in_len) { int ret = RET_OK; FUNC_0(VAR_1 != NULL); FUNC_0(VAR_4 != NULL); #ifdef VAR_5 FUNC_5(uint64_to_uint8(VAR_1->buf, VAR_1->VAR_0, VAR_4, in_len)); #else FUNC_5(uint32_to_uint8(VAR_1->buf, VAR_1->VAR_0, VAR_4, in_len)); #endif cleanup: return ret; } WordArray *FUNC_10(const uint8_t *VAR_4, size_t in_len) { WordArray *VAR_1 = NULL; int ret = RET_OK; FUNC_0(VAR_4 != NULL); FUNC_0(in_len != 0); MALLOC_CHECKED(VAR_1, sizeof (WordArray)); VAR_1->VAR_0 = (in_len + VAR_2 - 1) / VAR_2; MALLOC_CHECKED(VAR_1->buf, VAR_1->VAR_0 * VAR_2); #ifdef VAR_5 FUNC_5(uint8_to_uint64(VAR_4, in_len, VAR_1->buf, VAR_1->VAR_0)); #else FUNC_5(uint8_to_uint32(VAR_4, in_len, VAR_1->buf, VAR_1->VAR_0)); #endif return VAR_1; cleanup: FUNC_7(VAR_1); return NULL; } int wa_copy(const WordArray *VAR_4, WordArray *out) { if (VAR_4 == NULL || out == NULL || VAR_4->VAR_0 > out->VAR_0) { ERROR_CREATE(RET_INVALID_PARAM); return RET_INVALID_PARAM; } if (VAR_4 != out) { memcpy(out->buf, VAR_4->buf, VAR_4->VAR_0 * VAR_2); if (VAR_4->VAR_0 < out->VAR_0) { FUNC_2(&out->buf[VAR_4->VAR_0], 0, (out->VAR_0 - VAR_4->VAR_0) * VAR_2); } } return RET_OK; } int FUNC_11(const WordArray *VAR_4, size_t off, size_t VAR_0, WordArray *out) { if (VAR_4 == NULL || out == NULL || VAR_4->VAR_0 < off + VAR_0 || out->VAR_0 != VAR_0 || VAR_4 == out) { ERROR_CREATE(RET_INVALID_PARAM); return RET_INVALID_PARAM; } memcpy(out->buf, VAR_4->buf + off, VAR_0 * VAR_2); return RET_OK; } ByteArray *FUNC_12(const WordArray *VAR_1) { ByteArray *VAR_3 = NULL; int ret; if (VAR_1 != NULL) { #ifdef VAR_5 FUNC_3(VAR_3 = ba_alloc_from_uint64(VAR_1->buf, VAR_1->VAR_0)); #else FUNC_3(VAR_3 = FUNC_13(VAR_1->buf, VAR_1->VAR_0)); #endif } cleanup: return VAR_3; } void wa_change_len(WordArray *VAR_1, size_t VAR_0) { int ret = RET_OK; REALLOC_CHECKED(VAR_1->buf, VAR_0 * sizeof (VAR_6), VAR_1->buf); if (VAR_1->VAR_0 < VAR_0) { FUNC_2(&VAR_1->buf[VAR_1->VAR_0], 0, (VAR_0 - VAR_1->VAR_0) * sizeof (VAR_6)); } VAR_1->VAR_0 = VAR_0; cleanup: return; } void wa_free(WordArray *VAR_4) { if (VAR_4) { FUNC_7(VAR_4->buf); FUNC_7(VAR_4); } } void FUNC_14(WordArray *VAR_4) { if (VAR_4) { if (VAR_4->buf && VAR_4->VAR_0 > 0) { FUNC_15(VAR_4->buf, VAR_4->VAR_0 * VAR_2); } FUNC_7(VAR_4->buf); FUNC_7(VAR_4); } } #define U64(a) ((uint64_t)(a)) int word_bit_len(CLASS_0 a) { #ifdef VAR_5 return (a < U64(0x100000000) ? (a < 0x10000 ? (a < 0x100 ? (a < 0x10 ? (a < 0x4 ? (a < 0x2 ? (a < 0x1 ? 0 : 1) : 2) : (a < 0x8 ? 3 : 4)) : (a < 0x40 ? (a < 0x20 ? 5 : 6) : (a < 0x80 ? 7 : 8))) : (a < 0x1000 ? (a < 0x400 ? (a < 0x200 ? 9 : 10) : (a < 0x800 ? 11 : 12)) : (a < 0x4000 ? (a < 0x2000 ? 13 : 14) : (a < 0x8000 ? 15 : 16)))) : (a < 0x1000000 ? (a < 0x100000 ? (a < 0x40000 ? (a < 0x20000 ? 17 : 18) : (a < 0x80000 ? 19 : 20)) : (a < 0x400000 ? (a < 0x200000 ? 21 : 22) : (a < 0x800000 ? 23 : 24))) : (a < 0x10000000 ? (a < 0x4000000 ? (a < 0x2000000 ? 25 : 26) : (a < 0x8000000 ? 27 : 28)) : (a < 0x40000000 ? (a < 0x20000000 ? 29 : 30) : (a < 0x80000000 ? 31 : 32))))) : (a < U64(0x1000000000000) ? (a < U64(0x10000000000) ? (a < U64(0x1000000000) ? (a < U64(0x400000000) ? (a < U64(0x200000000) ? 33 : 34) : (a < U64(0x800000000) ? 35 : 36)) : (a < U64(0x4000000000) ? (a < U64(0x2000000000) ? 37 : 38) : (a < U64(0x8000000000) ? 39 : 40))) : (a < U64(0x100000000000) ? (a < U64(0x40000000000) ? (a < U64(0x20000000000) ? 41 : 42) : (a < U64(0x80000000000) ? 43 : 44)) : (a < U64(0x400000000000) ? (a < U64(0x200000000000) ? 45 : 46) : (a < U64(0x800000000000) ? 47 : 48)))) : (a < U64(0x100000000000000) ? (a < U64(0x10000000000000) ? (a < U64(0x4000000000000) ? (a < U64(0x2000000000000) ? 49 : 50) : (a < U64(0x8000000000000) ? 51 : 52)) : (a < U64(0x40000000000000) ? (a < U64(0x20000000000000) ? 53 : 54) : (a < U64(0x80000000000000) ? 55 : 56))) : (a < U64(0x1000000000000000) ? (a < U64(0x400000000000000) ? (a < U64(0x200000000000000) ? 57 : 58) : (a < U64(0x800000000000000) ? 59 : 60)) : (a < U64(0x4000000000000000) ? (a < U64(0x2000000000000000) ? 61 : 62) : (a < U64(0x8000000000000000) ? 63 : 64)))))); #else return (a < 0x10000 ? (a < 0x100 ? (a < 0x10 ? (a < 0x4 ? (a < 0x2 ? (a < 0x1 ? 0 : 1) : 2) : (a < 0x8 ? 3 : 4)) : (a < 0x40 ? (a < 0x20 ? 5 : 6) : (a < 0x80 ? 7 : 8))) : (a < 0x1000 ? (a < 0x400 ? (a < 0x200 ? 9 : 10) : (a < 0x800 ? 11 : 12)) : (a < 0x4000 ? (a < 0x2000 ? 13 : 14) : (a < 0x8000 ? 15 : 16)))) : (a < 0x1000000 ? (a < 0x100000 ? (a < 0x40000 ? (a < 0x20000 ? 17 : 18) : (a < 0x80000 ? 19 : 20)) : (a < 0x400000 ? (a < 0x200000 ? 21 : 22) : (a < 0x800000 ? 23 : 24))) : (a < 0x10000000 ? (a < 0x4000000 ? (a < 0x2000000 ? 25 : 26) : (a < 0x8000000 ? 27 : 28)) : (a < 0x40000000 ? (a < 0x20000000 ? 29 : 30) : (a < 0x80000000 ? 31 : 32))))); #endif } int wa_cmp(const WordArray *a, const WordArray *b) { if (a->VAR_0 != b->VAR_0) { return (int)(a->VAR_0 - b->VAR_0); } return memcmp(a->buf, b->buf, a->VAR_0 * sizeof(VAR_6)); }
0.329229
{'VAR_0': 'len', 'VAR_1': 'wa', 'FUNC_0': 'CHECK_PARAM', 'FUNC_1': 'CALLOC_CHECKED', 'VAR_2': 'WORD_BYTE_LENGTH', 'FUNC_2': 'memset', 'FUNC_3': 'CHECK_NOT_NULL', 'FUNC_4': 'wa_one', 'VAR_3': 'ans', 'VAR_4': 'in', 'VAR_5': 'ARCH64', 'FUNC_5': 'DO', 'FUNC_6': 'wa_alloc_from_be', 'FUNC_7': 'free', 'FUNC_8': 'wa_from_ba', 'FUNC_9': 'wa_to_uint8', 'FUNC_10': 'wa_alloc_from_uint8', 'FUNC_11': 'wa_copy_part', 'FUNC_12': 'wa_to_ba', 'FUNC_13': 'ba_alloc_from_uint32', 'VAR_6': 'word_t', 'CLASS_0': 'word_t', 'FUNC_14': 'wa_free_private', 'FUNC_15': 'secure_zero'}
#ifndef SDConfig_h #define SDConfig_h /* _____STANDARD INCLUDES____________________________________________________ */ // include types & constants of Wiring core API #include "Arduino.h" #include "SD.h" #include "FS.h" #include "ArduinoJson.h" #define MAXSSID 5 class SDConfig { public: SDConfig(); bool begin(uint8_t cs, Stream& debug); bool isConfigFileValid(const char * path); String readConfig(const char * path); bool readConfig(String config); //String readConfigString(const char * path); typedef struct __configGlobal { uint8_t type; uint16_t interval; uint8_t numMeter; uint8_t adcExt; uint8_t mbc; String wifiSsid[MAXSSID]; String wifiPass[MAXSSID]; String url; String token; uint8_t batch; String path; String batch_path; String path_sensor; String batch_path_sensor; uint8_t log_use; String log_server; } configGlobal; configGlobal cfgG; typedef struct __configMeter { uint8_t id; uint32_t xid; uint8_t type; uint8_t index; float adjust[10]; uint16_t table[11]; } configMeter; configMeter cfgM[21]; typedef struct __configSensor { uint8_t used[2]; uint32_t xid[2]; uint8_t pin[8]; uint8_t type[8]; float range[8][2]; float adjust[8][2]; } configSensor; configSensor cfgS; typedef struct __configFlow { uint8_t id; uint32_t xid; float adjust[9]; } configFlow; configFlow cfgF; private: bool phaseConfig(String config); Stream* _debug; uint8_t _cs; }; #endif
#ifndef VAR_0 #define VAR_0 /* _____STANDARD INCLUDES____________________________________________________ */ // include types & constants of Wiring core API #include "Arduino.h" #include "IMPORT_0" #include "IMPORT_1" #include "IMPORT_2" #define VAR_1 5 CLASS_0 VAR_2 { public: FUNC_0(); bool FUNC_1(uint8_t VAR_3, CLASS_1& VAR_4); bool FUNC_2(const char * VAR_5); CLASS_2 FUNC_3(const char * VAR_5); bool FUNC_3(CLASS_2 VAR_7); //String readConfigString(const char * path); typedef struct CLASS_3 { uint8_t VAR_8; uint16_t VAR_9; uint8_t VAR_10; uint8_t VAR_11; uint8_t VAR_12; CLASS_2 VAR_13[VAR_1]; CLASS_2 VAR_14[VAR_1]; CLASS_2 VAR_15; CLASS_2 VAR_16; uint8_t VAR_17; CLASS_2 VAR_5; CLASS_2 VAR_18; CLASS_2 VAR_19; CLASS_2 VAR_20; uint8_t VAR_21; CLASS_2 VAR_22; } ID_0; CLASS_4 VAR_23; typedef struct CLASS_5 { uint8_t VAR_24; uint32_t VAR_25; uint8_t VAR_8; uint8_t VAR_26; float VAR_27[10]; uint16_t VAR_28[11]; } ID_1; CLASS_6 VAR_29[21]; typedef struct CLASS_7 { uint8_t VAR_30[2]; uint32_t VAR_25[2]; uint8_t VAR_31[8]; uint8_t VAR_8[8]; float VAR_32[8][2]; float VAR_27[8][2]; } ID_2; CLASS_8 VAR_33; typedef struct CLASS_9 { uint8_t VAR_24; uint32_t VAR_25; float VAR_27[9]; } ID_3; CLASS_10 VAR_34; private: bool FUNC_4(VAR_6 VAR_7); CLASS_1* VAR_35; uint8_t VAR_36; }; #endif
0.949407
{'VAR_0': 'SDConfig_h', 'IMPORT_0': 'SD.h', 'IMPORT_1': 'FS.h', 'IMPORT_2': 'ArduinoJson.h', 'VAR_1': 'MAXSSID', 'CLASS_0': 'class', 'VAR_2': 'SDConfig', 'FUNC_0': 'SDConfig', 'FUNC_1': 'begin', 'VAR_3': 'cs', 'CLASS_1': 'Stream', 'VAR_4': 'debug', 'FUNC_2': 'isConfigFileValid', 'VAR_5': 'path', 'CLASS_2': 'String', 'VAR_6': 'String', 'FUNC_3': 'readConfig', 'VAR_7': 'config', 'CLASS_3': '__configGlobal', 'VAR_8': 'type', 'VAR_9': 'interval', 'VAR_10': 'numMeter', 'VAR_11': 'adcExt', 'VAR_12': 'mbc', 'VAR_13': 'wifiSsid', 'VAR_14': 'wifiPass', 'VAR_15': 'url', 'VAR_16': 'token', 'VAR_17': 'batch', 'VAR_18': 'batch_path', 'VAR_19': 'path_sensor', 'VAR_20': 'batch_path_sensor', 'VAR_21': 'log_use', 'VAR_22': 'log_server', 'ID_0': 'configGlobal', 'CLASS_4': 'configGlobal', 'VAR_23': 'cfgG', 'CLASS_5': '__configMeter', 'VAR_24': 'id', 'VAR_25': 'xid', 'VAR_26': 'index', 'VAR_27': 'adjust', 'VAR_28': 'table', 'ID_1': 'configMeter', 'CLASS_6': 'configMeter', 'VAR_29': 'cfgM', 'CLASS_7': '__configSensor', 'VAR_30': 'used', 'VAR_31': 'pin', 'VAR_32': 'range', 'ID_2': 'configSensor', 'CLASS_8': 'configSensor', 'VAR_33': 'cfgS', 'CLASS_9': '__configFlow', 'ID_3': 'configFlow', 'CLASS_10': 'configFlow', 'VAR_34': 'cfgF', 'FUNC_4': 'phaseConfig', 'VAR_35': '_debug', 'VAR_36': '_cs'}
#include <math.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef double real; typedef struct Tok { enum { TokOp, TokNum, TokFunc, } kind; union { real Num; char Char; char *Str; }; } Tok; #define TOKS_CAP 65536 static Tok toks[TOKS_CAP]; static size_t toks_size = 0; static uint8_t op_prec[256] = { ['('] = 0, /* A precedence of 0 is reserved for delimiters. */ [')'] = 0, [','] = 0, ['+'] = 1, ['-'] = 1, ['*'] = 2, ['/'] = 2, ['^'] = 3, }; #define OP_PREC(tok_char) (op_prec[(size_t)tok_char]) static enum { OrderLtr, OrderRtl, } op_order[256] = { ['('] = OrderLtr, [')'] = OrderLtr, ['+'] = OrderLtr, ['-'] = OrderLtr, ['*'] = OrderLtr, ['/'] = OrderLtr, ['^'] = OrderRtl, }; #define OP_ORDER(tok_char) (op_order[(size_t)tok_char]) #define IS_FLOAT(c) ((c >= '0' && c <= '9') || c == '.') #define IS_ALPHA(c) ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) typedef struct Function { const char *name; real (*func)(real *args); size_t n_args; } Function; #define FUNCTIONS_CAP 256 static Function functions[FUNCTIONS_CAP]; static size_t functions_size = 0; static void push_tok(Tok t) { if (toks_size < TOKS_CAP) toks[toks_size++] = t; } static void add_func(const char *name, real (*func)(real *args), size_t n_args) { if (functions_size < FUNCTIONS_CAP) functions[functions_size++] = (Function){.name = name, .func = func, .n_args = n_args}; } static void tokenize(char *expr) { push_tok((Tok){.kind = TokOp, .Char = '('}); size_t paren_depth = 0; char *curr = expr; for (char c = *curr; c != 0; c = *(++curr)) { if (c == ' ') continue; if (IS_FLOAT(c)) { char buf[16]; buf[0] = c; size_t i = 1; while (i < 15 && IS_FLOAT(curr[i])) { buf[i] = curr[i]; i++; } curr += i - 1; buf[i++] = 0; real num = strtod(buf, NULL); push_tok((Tok){.kind = TokNum, .Num = num}); continue; } if (IS_ALPHA(c)) { char *buf = malloc(32); buf[0] = c; size_t i = 1; while (i < 31 && IS_ALPHA(curr[i])) { buf[i] = curr[i]; i++; } curr += i - 1; buf[i++] = 0; push_tok((Tok){.kind = TokFunc, .Str = buf}); continue; } if (c == '(') paren_depth++; else if (c == ')') { if (paren_depth == 0) { fprintf(stderr, "Error: unmatched ')'\n"); exit(1); } paren_depth--; } switch (c) { case '(': case ')': case ',': case '+': case '-': case '*': case '/': case '^': { push_tok((Tok){.kind = TokOp, .Char = c}); break; } default: fprintf(stderr, "Error: unrecognized token at %zd: '%c'\n", curr - expr, c); exit(1); } } if (paren_depth > 0) { fprintf(stderr, "Error: unmatched '('\n"); exit(1); } push_tok((Tok){.kind = TokOp, .Char = ')'}); } static void print_toks() { for (size_t i = 0; i < toks_size; i++) { switch (toks[i].kind) { case TokOp: if (toks[i].Char == 0) { fprintf(stderr, "Error: unexpected end of token stream\n"); exit(1); } printf("%c ", toks[i].Char); break; case TokNum: printf("%.2f ", toks[i].Num); break; case TokFunc: printf("%s ", toks[i].Str); break; default: fprintf(stderr, "Error: unhandled token\n"); exit(1); } } printf("\n"); } /* Delete tokens from begin to end (excluding end itself). */ static void del_toks(Tok *begin, Tok *end) { memmove(begin, end, (toks_size - (end - toks)) * sizeof(Tok)); toks_size -= end - begin; } static real eval(Tok *t) { if (!(t[0].kind == TokOp && OP_PREC(t[0].Char) == 0)) { fprintf(stderr, "Error: expected delimiter at beginning of expression\n"); exit(1); } while (1) { /* Collapse factor. */ if (t[1].kind == TokOp && t[1].Char == '-') { if (t[2].kind != TokNum) { fprintf(stderr, "Error: expected number token after minus factor\n"); exit(1); } t[2].Num *= -1.0; del_toks(t + 1, t + 2); } /* Collapse parentheses. */ if (t[1].kind == TokOp && t[1].Char == '(') { real res = eval(t + 1); size_t i; for (i = 2; !(t[i].kind == TokOp && OP_PREC(t[i].Char) == 0); i++); del_toks(t + 2, t + i + 1); /* Put the newly evaluated value into place. */ t[1].kind = TokNum; t[1].Num = res; } /* Collapse function. */ if (t[1].kind == TokFunc) { if (t + 2 >= toks + toks_size || !(t[2].kind == TokOp && t[2].Char == '(')) { fprintf(stderr, "Error: expected '(' token after function\n"); exit(1); } real arg_results[16]; size_t arg_results_size = 0; t += 2; while (1) { if (arg_results_size < 16) arg_results[arg_results_size++] = eval(t); size_t i = 1; for (; !(t[i].kind == TokOp && OP_PREC(t[i].Char) == 0); i++); bool end = t[i].Char == ')'; if (t[i].Char == ',') del_toks(t, t + i); else if (t[i].Char == ')') del_toks(t, t + i + 1); if (end) break; } t -= 2; real outer_res; bool func_found = false; for (size_t i = 0; i < functions_size; i++) { if (strcmp(t[1].Str, functions[i].name) == 0) { func_found = true; if (arg_results_size != functions[i].n_args) { const char *plural = functions[i].n_args == 1 ? "" : "s"; fprintf(stderr, "Error: function %s() requires exactly 1 argument%s\n", functions[i].name, plural); exit(1); } outer_res = functions[i].func(arg_results); } } if (!func_found) { fprintf(stderr, "Error: unknown function: %s()\n", t[1].Str); exit(1); } t[1].kind = TokNum; t[1].Num = outer_res; } if (!(t[0].kind == TokOp && t[1].kind == TokNum && t[2].kind == TokOp)) { fprintf(stderr, "Error: invalid token order\n"); exit(1); } const char curr_op = t[0].Char; const uint8_t curr_prec = OP_PREC(curr_op); const char next_op = t[2].Char; const uint8_t next_prec = OP_PREC(next_op); /* Delimiters have a precedence of 0; if we have a number between two delimiters, we're done. */ if (curr_prec == 0 && next_prec == 0) return t[1].Num; if (next_prec > curr_prec || (next_prec == curr_prec && OP_ORDER(curr_op) == OrderRtl)) { t += 2; } else if (next_prec < curr_prec || (next_prec == curr_prec && OP_ORDER(curr_op) == OrderLtr)) { real res; real lhs = t[-1].Num, rhs = t[1].Num; switch (curr_op) { case '+': res = lhs + rhs; break; case '-': res = lhs - rhs; break; case '*': res = lhs * rhs; break; case '/': res = lhs / rhs; break; case '^': res = pow(lhs, rhs); break; default: fprintf(stderr, "Error: unhandled operator '%c'\n", t[1].Char); exit(1); } t[1].Num = res; del_toks(t - 1, t + 1); t -= 2; } } } static void cleanup() { for (size_t i = 0; i < toks_size; i++) { if (toks[i].kind == TokFunc) free(toks[i].Str); } } static real fn_sqrt(real *args) { return sqrt(args[0]); } static real fn_pow(real *args) { return pow(args[0], args[1]); } static real fn_mod(real *args) { return fmod(args[0], args[1]); } static real fn_round(real *args) { return round(args[0]); } static real fn_floor(real *args) { return floor(args[0]); } static real fn_ceil(real *args) { return ceil(args[0]); } int main(int argc, char **argv) { if (argc != 2 || strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { fprintf(stderr, "Usage: ./exp \"<expression>\"\n"); exit(1); } add_func("sqrt", fn_sqrt, 1); add_func("pow", fn_pow, 2); add_func("mod", fn_mod, 2); add_func("round", fn_round, 1); add_func("floor", fn_floor, 1); add_func("ceil", fn_ceil, 1); tokenize(argv[1]); print_toks(); real res = eval(toks); printf("Result: %f\n", res); cleanup(); }
#include <math.h> #include <IMPORT_0> #include <IMPORT_1> #include <stdio.h> #include <IMPORT_2> #include <IMPORT_3> typedef double ID_0; typedef struct Tok { enum { TokOp, VAR_0, TokFunc, } VAR_1; union { CLASS_0 VAR_2; char Char; char *VAR_3; }; } Tok; #define VAR_4 65536 static Tok VAR_5[VAR_4]; static size_t toks_size = 0; static uint8_t op_prec[256] = { ['('] = 0, /* A precedence of 0 is reserved for delimiters. */ [')'] = 0, [','] = 0, ['+'] = 1, ['-'] = 1, ['*'] = 2, ['/'] = 2, ['^'] = 3, }; #define OP_PREC(tok_char) (op_prec[(size_t)tok_char]) static enum { OrderLtr, OrderRtl, } op_order[256] = { ['('] = OrderLtr, [')'] = OrderLtr, ['+'] = OrderLtr, ['-'] = OrderLtr, ['*'] = OrderLtr, ['/'] = OrderLtr, ['^'] = OrderRtl, }; #define OP_ORDER(tok_char) (op_order[(size_t)tok_char]) #define IS_FLOAT(VAR_6) ((c >= '0' && c <= '9') || c == '.') #define FUNC_0(VAR_6) ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) typedef struct Function { const char *VAR_7; CLASS_0 (*FUNC_1)(CLASS_0 *VAR_9); size_t n_args; } Function; #define FUNCTIONS_CAP 256 static Function functions[FUNCTIONS_CAP]; static size_t VAR_10 = 0; static void FUNC_2(Tok t) { if (toks_size < VAR_4) VAR_5[toks_size++] = t; } static void add_func(const char *VAR_7, CLASS_0 (*VAR_8)(CLASS_0 *VAR_9), size_t n_args) { if (VAR_10 < FUNCTIONS_CAP) functions[VAR_10++] = (Function){.VAR_7 = VAR_7, .VAR_8 = VAR_8, .n_args = n_args}; } static void tokenize(char *VAR_11) { FUNC_2((Tok){.VAR_1 = TokOp, .Char = '('}); size_t VAR_12 = 0; char *curr = VAR_11; for (char VAR_6 = *curr; VAR_6 != 0; VAR_6 = *(++curr)) { if (VAR_6 == ' ') continue; if (IS_FLOAT(VAR_6)) { char VAR_13[16]; VAR_13[0] = VAR_6; size_t VAR_14 = 1; while (VAR_14 < 15 && IS_FLOAT(curr[VAR_14])) { VAR_13[VAR_14] = curr[VAR_14]; VAR_14++; } curr += VAR_14 - 1; VAR_13[VAR_14++] = 0; CLASS_0 num = FUNC_3(VAR_13, NULL); FUNC_2((Tok){.VAR_1 = VAR_0, .VAR_2 = num}); continue; } if (FUNC_0(VAR_6)) { char *VAR_13 = FUNC_4(32); VAR_13[0] = VAR_6; size_t VAR_14 = 1; while (VAR_14 < 31 && FUNC_0(curr[VAR_14])) { VAR_13[VAR_14] = curr[VAR_14]; VAR_14++; } curr += VAR_14 - 1; VAR_13[VAR_14++] = 0; FUNC_2((Tok){.VAR_1 = TokFunc, .VAR_3 = VAR_13}); continue; } if (VAR_6 == '(') VAR_12++; else if (VAR_6 == ')') { if (VAR_12 == 0) { FUNC_5(VAR_15, "Error: unmatched ')'\n"); exit(1); } VAR_12--; } switch (VAR_6) { case '(': case ')': case ',': case '+': case '-': case '*': case '/': case '^': { FUNC_2((Tok){.VAR_1 = TokOp, .Char = VAR_6}); break; } default: FUNC_5(VAR_15, "Error: unrecognized token at %zd: '%c'\n", curr - VAR_11, VAR_6); exit(1); } } if (VAR_12 > 0) { FUNC_5(VAR_15, "Error: unmatched '('\n"); exit(1); } FUNC_2((Tok){.VAR_1 = TokOp, .Char = ')'}); } static void FUNC_6() { for (size_t VAR_14 = 0; VAR_14 < toks_size; VAR_14++) { switch (VAR_5[VAR_14].VAR_1) { case TokOp: if (VAR_5[VAR_14].Char == 0) { FUNC_5(VAR_15, "Error: unexpected end of token stream\n"); exit(1); } FUNC_7("%c ", VAR_5[VAR_14].Char); break; case VAR_0: FUNC_7("%.2f ", VAR_5[VAR_14].VAR_2); break; case TokFunc: FUNC_7("%s ", VAR_5[VAR_14].VAR_3); break; default: FUNC_5(VAR_15, "Error: unhandled token\n"); exit(1); } } FUNC_7("\n"); } /* Delete tokens from begin to end (excluding end itself). */ static void del_toks(Tok *begin, Tok *VAR_16) { memmove(begin, VAR_16, (toks_size - (VAR_16 - VAR_5)) * sizeof(Tok)); toks_size -= VAR_16 - begin; } static CLASS_0 FUNC_8(Tok *t) { if (!(t[0].VAR_1 == TokOp && OP_PREC(t[0].Char) == 0)) { FUNC_5(VAR_15, "Error: expected delimiter at beginning of expression\n"); exit(1); } while (1) { /* Collapse factor. */ if (t[1].VAR_1 == TokOp && t[1].Char == '-') { if (t[2].VAR_1 != VAR_0) { FUNC_5(VAR_15, "Error: expected number token after minus factor\n"); exit(1); } t[2].VAR_2 *= -1.0; del_toks(t + 1, t + 2); } /* Collapse parentheses. */ if (t[1].VAR_1 == TokOp && t[1].Char == '(') { CLASS_0 res = FUNC_8(t + 1); size_t VAR_14; for (VAR_14 = 2; !(t[VAR_14].VAR_1 == TokOp && OP_PREC(t[VAR_14].Char) == 0); VAR_14++); del_toks(t + 2, t + VAR_14 + 1); /* Put the newly evaluated value into place. */ t[1].VAR_1 = VAR_0; t[1].VAR_2 = res; } /* Collapse function. */ if (t[1].VAR_1 == TokFunc) { if (t + 2 >= VAR_5 + toks_size || !(t[2].VAR_1 == TokOp && t[2].Char == '(')) { FUNC_5(VAR_15, "Error: expected '(' token after function\n"); exit(1); } CLASS_0 VAR_17[16]; size_t VAR_18 = 0; t += 2; while (1) { if (VAR_18 < 16) VAR_17[VAR_18++] = FUNC_8(t); size_t VAR_14 = 1; for (; !(t[VAR_14].VAR_1 == TokOp && OP_PREC(t[VAR_14].Char) == 0); VAR_14++); bool VAR_16 = t[VAR_14].Char == ')'; if (t[VAR_14].Char == ',') del_toks(t, t + VAR_14); else if (t[VAR_14].Char == ')') del_toks(t, t + VAR_14 + 1); if (VAR_16) break; } t -= 2; CLASS_0 outer_res; bool VAR_19 = false; for (size_t VAR_14 = 0; VAR_14 < VAR_10; VAR_14++) { if (strcmp(t[1].VAR_3, functions[VAR_14].VAR_7) == 0) { VAR_19 = true; if (VAR_18 != functions[VAR_14].n_args) { const char *VAR_20 = functions[VAR_14].n_args == 1 ? "" : "s"; FUNC_5(VAR_15, "Error: function %s() requires exactly 1 argument%s\n", functions[VAR_14].VAR_7, VAR_20); exit(1); } outer_res = functions[VAR_14].FUNC_1(VAR_17); } } if (!VAR_19) { FUNC_5(VAR_15, "Error: unknown function: %s()\n", t[1].VAR_3); exit(1); } t[1].VAR_1 = VAR_0; t[1].VAR_2 = outer_res; } if (!(t[0].VAR_1 == TokOp && t[1].VAR_1 == VAR_0 && t[2].VAR_1 == TokOp)) { FUNC_5(VAR_15, "Error: invalid token order\n"); exit(1); } const char VAR_21 = t[0].Char; const uint8_t VAR_22 = OP_PREC(VAR_21); const char next_op = t[2].Char; const uint8_t next_prec = OP_PREC(next_op); /* Delimiters have a precedence of 0; if we have a number between two delimiters, we're done. */ if (VAR_22 == 0 && next_prec == 0) return t[1].VAR_2; if (next_prec > VAR_22 || (next_prec == VAR_22 && OP_ORDER(VAR_21) == OrderRtl)) { t += 2; } else if (next_prec < VAR_22 || (next_prec == VAR_22 && OP_ORDER(VAR_21) == OrderLtr)) { CLASS_0 res; CLASS_0 lhs = t[-1].VAR_2, VAR_23 = t[1].VAR_2; switch (VAR_21) { case '+': res = lhs + VAR_23; break; case '-': res = lhs - VAR_23; break; case '*': res = lhs * VAR_23; break; case '/': res = lhs / VAR_23; break; case '^': res = pow(lhs, VAR_23); break; default: FUNC_5(VAR_15, "Error: unhandled operator '%c'\n", t[1].Char); exit(1); } t[1].VAR_2 = res; del_toks(t - 1, t + 1); t -= 2; } } } static void FUNC_9() { for (size_t VAR_14 = 0; VAR_14 < toks_size; VAR_14++) { if (VAR_5[VAR_14].VAR_1 == TokFunc) FUNC_10(VAR_5[VAR_14].VAR_3); } } static CLASS_0 fn_sqrt(CLASS_0 *VAR_9) { return sqrt(VAR_9[0]); } static CLASS_0 FUNC_11(CLASS_0 *VAR_9) { return pow(VAR_9[0], VAR_9[1]); } static CLASS_0 FUNC_12(CLASS_0 *VAR_9) { return FUNC_13(VAR_9[0], VAR_9[1]); } static CLASS_0 FUNC_14(CLASS_0 *VAR_9) { return FUNC_15(VAR_9[0]); } static CLASS_0 fn_floor(CLASS_0 *VAR_9) { return floor(VAR_9[0]); } static CLASS_0 FUNC_16(CLASS_0 *VAR_9) { return FUNC_17(VAR_9[0]); } int main(int argc, char **argv) { if (argc != 2 || strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { FUNC_5(VAR_15, "Usage: ./exp \"<expression>\"\n"); exit(1); } add_func("sqrt", fn_sqrt, 1); add_func("pow", VAR_24, 2); add_func("mod", VAR_25, 2); add_func("round", VAR_26, 1); add_func("floor", fn_floor, 1); add_func("ceil", VAR_27, 1); tokenize(argv[1]); FUNC_6(); CLASS_0 res = FUNC_8(VAR_5); FUNC_7("Result: %f\n", res); FUNC_9(); }
0.512833
{'IMPORT_0': 'stdbool.h', 'IMPORT_1': 'stdint.h', 'IMPORT_2': 'stdlib.h', 'IMPORT_3': 'string.h', 'ID_0': 'real', 'CLASS_0': 'real', 'VAR_0': 'TokNum', 'VAR_1': 'kind', 'VAR_2': 'Num', 'VAR_3': 'Str', 'VAR_4': 'TOKS_CAP', 'VAR_5': 'toks', 'VAR_6': 'c', 'FUNC_0': 'IS_ALPHA', 'VAR_7': 'name', 'FUNC_1': 'func', 'VAR_8': 'func', 'VAR_9': 'args', 'VAR_10': 'functions_size', 'FUNC_2': 'push_tok', 'VAR_11': 'expr', 'VAR_12': 'paren_depth', 'VAR_13': 'buf', 'VAR_14': 'i', 'FUNC_3': 'strtod', 'FUNC_4': 'malloc', 'FUNC_5': 'fprintf', 'VAR_15': 'stderr', 'FUNC_6': 'print_toks', 'FUNC_7': 'printf', 'VAR_16': 'end', 'FUNC_8': 'eval', 'VAR_17': 'arg_results', 'VAR_18': 'arg_results_size', 'VAR_19': 'func_found', 'VAR_20': 'plural', 'VAR_21': 'curr_op', 'VAR_22': 'curr_prec', 'VAR_23': 'rhs', 'FUNC_9': 'cleanup', 'FUNC_10': 'free', 'FUNC_11': 'fn_pow', 'VAR_24': 'fn_pow', 'FUNC_12': 'fn_mod', 'VAR_25': 'fn_mod', 'FUNC_13': 'fmod', 'FUNC_14': 'fn_round', 'VAR_26': 'fn_round', 'FUNC_15': 'round', 'FUNC_16': 'fn_ceil', 'VAR_27': 'fn_ceil', 'FUNC_17': 'ceil'}
/* Declared in wfa_tg.h for following three basic API */ int wfaACClassToQos(int tgClass, int *pQos, int *pTosVal, int *pThreadPriority) { int Qos = 0, tosVal=0, threadPriority=0; if ( pQos == NULL || pTosVal==NULL || pThreadPriority==NULL) { DPRINT_ERR(WFA_ERR, "wfaACClassToQos pass in err param or NULL pt tgClass=%d pQos=0x%x pTosVal=0x%x pThreadPriority=0x%x\n",tgClass, pQos, pTosVal, pThreadPriority); return WFA_FAILURE; } switch(tgClass) { case TG_WMM_AC_BK: Qos = 0x08; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BK/UP1 tag: 0x%x\n", TOS_BK); tosVal = TOS_BK; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break; case TG_WMM_AC_BK2: case TG_WMM_AC_UP2: Qos = 0x10; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BK/UP2 tag: 0x%x\n", TOS_LE); tosVal = TOS_LE; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break; case TG_WMM_AC_VI: case TG_WMM_AC_UP5: Qos = 0x28; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VI/UP5 tag: 0x%x\n",TOS_VI); tosVal = TOS_VI; threadPriority = THREAD_PRIORITY_ABOVE_NORMAL; break; case TG_WMM_AC_UAPSD: tosVal = 0x88; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break; case TG_WMM_AC_VO: Qos = 0x30; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VO/UP6 Tag: 0x%x\n",TOS_VO); tosVal = TOS_VO; threadPriority = THREAD_PRIORITY_HIGHEST; break; case TG_WMM_AC_BE: Qos = 0x00; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BE/UP0 tag: 0x%x\n", TOS_BE); tosVal = TOS_BE; threadPriority = THREAD_PRIORITY_NORMAL; break; /*case TG_WMM_AC_BK2: Qos = 0x10; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BE2 tag: 0x%x\n", TOS_LE); tosVal = TOS_LE; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break;*/ case TG_WMM_AC_VI2: Qos = 0x20; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VI/UP4 tag: 0x%x\n", TOS_VI4); tosVal = TOS_VI4; threadPriority = THREAD_PRIORITY_NORMAL; break; case TG_WMM_AC_VO2: case TG_WMM_AC_UP7: Qos = 0x38; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VO/UP7 tag: 0x%x\n", TOS_VO7); tosVal = TOS_VO7; threadPriority = THREAD_PRIORITY_ABOVE_NORMAL; break; case TG_WMM_AC_BE2: case TG_WMM_AC_UP3: Qos = 0x18; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BE/UP3 tag: 0x%x\n", TOS_EE); tosVal = TOS_EE; threadPriority = THREAD_PRIORITY_NORMAL; break; default: DPRINT_WARNING(WFA_WNG, "wfaACClassToQos: ERR Unknown AC class value 0x%x\n", tgClass); tosVal = TOS_BE; Qos = 0x00; threadPriority = threadPriority = THREAD_PRIORITY_BELOW_NORMAL; } *pQos = Qos; *pTosVal = tosVal; *pThreadPriority = threadPriority; return WFA_SUCCESS; }
/* Declared in wfa_tg.h for following three basic API */ int wfaACClassToQos(int VAR_0, int *pQos, int *pTosVal, int *pThreadPriority) { int Qos = 0, tosVal=0, threadPriority=0; if ( pQos == NULL || pTosVal==NULL || pThreadPriority==NULL) { DPRINT_ERR(WFA_ERR, "wfaACClassToQos pass in err param or NULL pt tgClass=%d pQos=0x%x pTosVal=0x%x pThreadPriority=0x%x\n",VAR_0, pQos, pTosVal, pThreadPriority); return VAR_1; } switch(VAR_0) { case VAR_2: Qos = 0x08; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BK/UP1 tag: 0x%x\n", TOS_BK); tosVal = TOS_BK; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break; case TG_WMM_AC_BK2: case TG_WMM_AC_UP2: Qos = 0x10; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BK/UP2 tag: 0x%x\n", TOS_LE); tosVal = TOS_LE; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break; case TG_WMM_AC_VI: case TG_WMM_AC_UP5: Qos = 0x28; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VI/UP5 tag: 0x%x\n",TOS_VI); tosVal = TOS_VI; threadPriority = THREAD_PRIORITY_ABOVE_NORMAL; break; case TG_WMM_AC_UAPSD: tosVal = 0x88; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break; case TG_WMM_AC_VO: Qos = 0x30; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VO/UP6 Tag: 0x%x\n",VAR_3); tosVal = VAR_3; threadPriority = THREAD_PRIORITY_HIGHEST; break; case TG_WMM_AC_BE: Qos = 0x00; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BE/UP0 tag: 0x%x\n", TOS_BE); tosVal = TOS_BE; threadPriority = THREAD_PRIORITY_NORMAL; break; /*case TG_WMM_AC_BK2: Qos = 0x10; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BE2 tag: 0x%x\n", TOS_LE); tosVal = TOS_LE; threadPriority = THREAD_PRIORITY_BELOW_NORMAL; break;*/ case VAR_4: Qos = 0x20; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VI/UP4 tag: 0x%x\n", TOS_VI4); tosVal = TOS_VI4; threadPriority = THREAD_PRIORITY_NORMAL; break; case TG_WMM_AC_VO2: case TG_WMM_AC_UP7: Qos = 0x38; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS VO/UP7 tag: 0x%x\n", TOS_VO7); tosVal = TOS_VO7; threadPriority = THREAD_PRIORITY_ABOVE_NORMAL; break; case VAR_5: case TG_WMM_AC_UP3: Qos = 0x18; DPRINT_INFOL(WFA_OUT, "wfaACClassToQos: Setting QoS BE/UP3 tag: 0x%x\n", TOS_EE); tosVal = TOS_EE; threadPriority = THREAD_PRIORITY_NORMAL; break; default: DPRINT_WARNING(WFA_WNG, "wfaACClassToQos: ERR Unknown AC class value 0x%x\n", VAR_0); tosVal = TOS_BE; Qos = 0x00; threadPriority = threadPriority = THREAD_PRIORITY_BELOW_NORMAL; } *pQos = Qos; *pTosVal = tosVal; *pThreadPriority = threadPriority; return WFA_SUCCESS; }
0.076096
{'VAR_0': 'tgClass', 'VAR_1': 'WFA_FAILURE', 'VAR_2': 'TG_WMM_AC_BK', 'VAR_3': 'TOS_VO', 'VAR_4': 'TG_WMM_AC_VI2', 'VAR_5': 'TG_WMM_AC_BE2'}
/*===-- skein256.c ------------------------------------*- generic -*- C -*-===*/ /** @cond **/ #include "ordo/internal/implementation.h" /** @endcond **/ #include "ordo/primitives/hash_functions/skein256.h" #include "ordo/primitives/block_ciphers/threefish256.h" /*===----------------------------------------------------------------------===*/ #define SKEIN256_INTERNAL (bits(256)) #define SKEIN256_BLOCK (bits(256)) /* Some UBI block type constants. */ #define SKEIN_UBI_CFG 4 #define SKEIN_UBI_MSG 48 #define SKEIN_UBI_OUT 63 /* This also represents the default configuration block, to avoid recreating * it in case the parameters do not specify a different configuration block. */ static const uint64_t skein256_iv[4] = { UINT64_C(0xFC9DA860D048B449), UINT64_C(0x2FCA66479FA7D833), UINT64_C(0xB33BC3896656840F), UINT64_C(0x6A54E920FDE8DA69) }; /* Note this assumes "first" and "final" are boolean (0 or 1). The result is a * UBI-compliant tweak, however with a message length only up to 2^64 bits. */ static void make_tweak(uint64_t tweak[2], uint64_t type, uint64_t position, uint64_t first, uint64_t final) HOT_CODE; static void skein256_compress(const uint64_t * RESTRICT block, uint64_t * RESTRICT state, uint64_t * RESTRICT tweak) HOT_CODE; #ifdef OPAQUE struct SKEIN256_STATE { uint64_t state[4]; uint64_t block[4]; uint64_t block_len; uint64_t msg_len; }; #endif /*===----------------------------------------------------------------------===*/ int skein256_init(struct SKEIN256_STATE *state, const struct SKEIN256_PARAMS *params) { state->block_len = 0; state->msg_len = 0; if (params) { uint64_t tweak[2]; uint64_t len_tmp; if (bits(params->out_len) != SKEIN256_INTERNAL) return ORDO_ARG; /* Generate the initial state from the configuration block. */ memset(state->state, 0, SKEIN256_BLOCK); memcpy((unsigned char *)state->block + 0, &params->schema, sizeof(params->schema)); memcpy((unsigned char *)state->block + 4, &params->version, sizeof(params->version)); memcpy((unsigned char *)state->block + 6, &params->reserved, sizeof(params->reserved)); len_tmp = tole64(params->out_len); memcpy((unsigned char *)state->block + 8, &len_tmp, sizeof(len_tmp)); memcpy((unsigned char *)state->block + 16, &params->unused, sizeof(params->unused)); make_tweak(tweak, SKEIN_UBI_CFG, SKEIN256_BLOCK, 1, 1); skein256_compress(state->block, state->state, tweak); } else { /* No parameters, use default configuration block. */ memcpy(state->state, skein256_iv, SKEIN256_INTERNAL); /* Configuration block is actually little-endian. */ state->state[0] = fmle64(state->state[0]); state->state[1] = fmle64(state->state[1]); state->state[2] = fmle64(state->state[2]); state->state[3] = fmle64(state->state[3]); } return ORDO_SUCCESS; } void skein256_update(struct SKEIN256_STATE *state, const void *buffer, size_t len) { if (!len) return; if (state->block_len + len > SKEIN256_BLOCK) { size_t pad = (size_t)(SKEIN256_BLOCK - state->block_len); uint64_t tweak[2]; memcpy(offset(state->block, state->block_len), buffer, pad); state->msg_len += pad; make_tweak(tweak, SKEIN_UBI_MSG, state->msg_len, state->msg_len <= SKEIN256_BLOCK, 0); /* can't be the last block */ skein256_compress(state->block, state->state, tweak); state->block_len = 0; buffer = offset(buffer, pad); len -= pad; /* Do NOT process the final block. */ while (len > SKEIN256_BLOCK) { memcpy(state->block, buffer, SKEIN256_BLOCK); state->msg_len += SKEIN256_BLOCK; make_tweak(tweak, SKEIN_UBI_MSG, state->msg_len, state->msg_len <= SKEIN256_BLOCK, 0); skein256_compress(state->block, state->state, tweak); buffer = offset(buffer, SKEIN256_BLOCK); len -= SKEIN256_BLOCK; } } memcpy(offset(state->block, state->block_len), buffer, len); state->block_len += len; } void skein256_final(struct SKEIN256_STATE *state, void *digest) { uint64_t tweak[2]; /* Here, we need to process one complete block - the Skein specification * mandates zero-fill, so erase any residual input data in the state. */ memset(offset(state->block, state->block_len), 0x00, (size_t)(SKEIN256_BLOCK - state->block_len)); /* However, only the actual input data counts towards the length. */ state->msg_len += state->block_len; make_tweak(tweak, SKEIN_UBI_MSG, state->msg_len, state->msg_len <= SKEIN256_BLOCK, 1); /* this'll be the last block */ skein256_compress(state->block, state->state, tweak); { uint64_t out[4]; state->block[0] = 0; state->block[1] = 0; state->block[2] = 0; state->block[3] = 0; out[0] = state->state[0]; out[1] = state->state[1]; out[2] = state->state[2]; out[3] = state->state[3]; make_tweak(tweak, SKEIN_UBI_OUT, sizeof(uint64_t), 1, 1); skein256_compress(state->block, out, tweak); memcpy(digest, out, SKEIN256_BLOCK); } } /*===----------------------------------------------------------------------===*/ void make_tweak(uint64_t tweak[2], uint64_t type, uint64_t position, uint64_t first, uint64_t final) { tweak[0] = tole64(position); tweak[1] = tole64((final << 63) | (first << 62) | (type << 56)); } void skein256_compress(const uint64_t * RESTRICT block, uint64_t * RESTRICT state, uint64_t * RESTRICT tweak) { struct THREEFISH256_PARAMS params; struct THREEFISH256_STATE cipher; params.tweak[0] = tweak[0]; params.tweak[1] = tweak[1]; threefish256_init(&cipher, state, SKEIN256_INTERNAL, &params); memcpy(state, block, SKEIN256_INTERNAL); threefish256_forward(&cipher, state); threefish256_final(&cipher); xor_buffer(state, block, SKEIN256_INTERNAL); }
/*===-- skein256.c ------------------------------------*- generic -*- C -*-===*/ /** @cond **/ #include "ordo/internal/implementation.h" /** @endcond **/ #include "ordo/primitives/hash_functions/skein256.h" #include "ordo/primitives/block_ciphers/threefish256.h" /*===----------------------------------------------------------------------===*/ #define VAR_0 (bits(256)) #define SKEIN256_BLOCK (bits(256)) /* Some UBI block type constants. */ #define SKEIN_UBI_CFG 4 #define SKEIN_UBI_MSG 48 #define SKEIN_UBI_OUT 63 /* This also represents the default configuration block, to avoid recreating * it in case the parameters do not specify a different configuration block. */ static const uint64_t skein256_iv[4] = { UINT64_C(0xFC9DA860D048B449), UINT64_C(0x2FCA66479FA7D833), UINT64_C(0xB33BC3896656840F), UINT64_C(0x6A54E920FDE8DA69) }; /* Note this assumes "first" and "final" are boolean (0 or 1). The result is a * UBI-compliant tweak, however with a message length only up to 2^64 bits. */ static void make_tweak(uint64_t tweak[2], uint64_t type, uint64_t position, uint64_t first, uint64_t final) VAR_1; static void skein256_compress(const uint64_t * RESTRICT VAR_2, uint64_t * RESTRICT state, uint64_t * RESTRICT tweak) VAR_1; #ifdef VAR_3 struct SKEIN256_STATE { uint64_t state[4]; uint64_t VAR_2[4]; uint64_t block_len; uint64_t VAR_4; }; #endif /*===----------------------------------------------------------------------===*/ int skein256_init(struct SKEIN256_STATE *state, const struct CLASS_0 *VAR_5) { state->block_len = 0; state->VAR_4 = 0; if (VAR_5) { uint64_t tweak[2]; uint64_t len_tmp; if (bits(VAR_5->out_len) != VAR_0) return ORDO_ARG; /* Generate the initial state from the configuration block. */ memset(state->state, 0, SKEIN256_BLOCK); memcpy((unsigned char *)state->VAR_2 + 0, &VAR_5->schema, sizeof(VAR_5->schema)); memcpy((unsigned char *)state->VAR_2 + 4, &VAR_5->version, sizeof(VAR_5->version)); memcpy((unsigned char *)state->VAR_2 + 6, &VAR_5->VAR_6, sizeof(VAR_5->VAR_6)); len_tmp = tole64(VAR_5->out_len); memcpy((unsigned char *)state->VAR_2 + 8, &len_tmp, sizeof(len_tmp)); memcpy((unsigned char *)state->VAR_2 + 16, &VAR_5->VAR_7, sizeof(VAR_5->VAR_7)); make_tweak(tweak, SKEIN_UBI_CFG, SKEIN256_BLOCK, 1, 1); skein256_compress(state->VAR_2, state->state, tweak); } else { /* No parameters, use default configuration block. */ memcpy(state->state, skein256_iv, VAR_0); /* Configuration block is actually little-endian. */ state->state[0] = fmle64(state->state[0]); state->state[1] = fmle64(state->state[1]); state->state[2] = fmle64(state->state[2]); state->state[3] = fmle64(state->state[3]); } return ORDO_SUCCESS; } void FUNC_0(struct SKEIN256_STATE *state, const void *buffer, size_t len) { if (!len) return; if (state->block_len + len > SKEIN256_BLOCK) { size_t pad = (size_t)(SKEIN256_BLOCK - state->block_len); uint64_t tweak[2]; memcpy(offset(state->VAR_2, state->block_len), buffer, pad); state->VAR_4 += pad; make_tweak(tweak, SKEIN_UBI_MSG, state->VAR_4, state->VAR_4 <= SKEIN256_BLOCK, 0); /* can't be the last block */ skein256_compress(state->VAR_2, state->state, tweak); state->block_len = 0; buffer = offset(buffer, pad); len -= pad; /* Do NOT process the final block. */ while (len > SKEIN256_BLOCK) { memcpy(state->VAR_2, buffer, SKEIN256_BLOCK); state->VAR_4 += SKEIN256_BLOCK; make_tweak(tweak, SKEIN_UBI_MSG, state->VAR_4, state->VAR_4 <= SKEIN256_BLOCK, 0); skein256_compress(state->VAR_2, state->state, tweak); buffer = offset(buffer, SKEIN256_BLOCK); len -= SKEIN256_BLOCK; } } memcpy(offset(state->VAR_2, state->block_len), buffer, len); state->block_len += len; } void skein256_final(struct SKEIN256_STATE *state, void *digest) { uint64_t tweak[2]; /* Here, we need to process one complete block - the Skein specification * mandates zero-fill, so erase any residual input data in the state. */ memset(offset(state->VAR_2, state->block_len), 0x00, (size_t)(SKEIN256_BLOCK - state->block_len)); /* However, only the actual input data counts towards the length. */ state->VAR_4 += state->block_len; make_tweak(tweak, SKEIN_UBI_MSG, state->VAR_4, state->VAR_4 <= SKEIN256_BLOCK, 1); /* this'll be the last block */ skein256_compress(state->VAR_2, state->state, tweak); { uint64_t out[4]; state->VAR_2[0] = 0; state->VAR_2[1] = 0; state->VAR_2[2] = 0; state->VAR_2[3] = 0; out[0] = state->state[0]; out[1] = state->state[1]; out[2] = state->state[2]; out[3] = state->state[3]; make_tweak(tweak, SKEIN_UBI_OUT, sizeof(uint64_t), 1, 1); skein256_compress(state->VAR_2, out, tweak); memcpy(digest, out, SKEIN256_BLOCK); } } /*===----------------------------------------------------------------------===*/ void make_tweak(uint64_t tweak[2], uint64_t type, uint64_t position, uint64_t first, uint64_t final) { tweak[0] = tole64(position); tweak[1] = tole64((final << 63) | (first << 62) | (type << 56)); } void skein256_compress(const uint64_t * RESTRICT VAR_2, uint64_t * RESTRICT state, uint64_t * RESTRICT tweak) { struct THREEFISH256_PARAMS VAR_5; struct CLASS_1 cipher; VAR_5.tweak[0] = tweak[0]; VAR_5.tweak[1] = tweak[1]; threefish256_init(&cipher, state, VAR_0, &VAR_5); memcpy(state, VAR_2, VAR_0); FUNC_1(&cipher, state); threefish256_final(&cipher); FUNC_2(state, VAR_2, VAR_0); }
0.239937
{'VAR_0': 'SKEIN256_INTERNAL', 'VAR_1': 'HOT_CODE', 'VAR_2': 'block', 'VAR_3': 'OPAQUE', 'VAR_4': 'msg_len', 'CLASS_0': 'SKEIN256_PARAMS', 'VAR_5': 'params', 'VAR_6': 'reserved', 'VAR_7': 'unused', 'FUNC_0': 'skein256_update', 'CLASS_1': 'THREEFISH256_STATE', 'FUNC_1': 'threefish256_forward', 'FUNC_2': 'xor_buffer'}
#pragma once #include "render/GraphicsNode.h" #include "entity.h" #include <vector> class Map; class Enemy; struct Player : Entity { float moveSpeed = 0.05f; float radius; GraphicsNode* gNode; Vector aimDir; float range = 10.f; const long int shootingRate = 500; // coolDown effect long int shootingTime = -1; // in seconds currently public: bool shotFired = false; Player(); ~Player(); void Shoot(Map* map, std::vector<Enemy>* enemies); };
#pragma once #include "IMPORT_0" #include "entity.h" #include <vector> class Map; class Enemy; struct Player : Entity { float VAR_0 = 0.05f; float VAR_1; GraphicsNode* gNode; Vector VAR_2; float VAR_3 = 10.f; const long int VAR_4 = 500; // coolDown effect long int shootingTime = -1; // in seconds currently public: VAR_5 shotFired = false; Player(); ~Player(); void Shoot(Map* map, std::vector<Enemy>* enemies); };
0.27946
{'IMPORT_0': 'render/GraphicsNode.h', 'VAR_0': 'moveSpeed', 'VAR_1': 'radius', 'VAR_2': 'aimDir', 'VAR_3': 'range', 'VAR_4': 'shootingRate', 'VAR_5': 'bool'}
// // MainTableViewController.h // PTKit // // Created by 彭腾 on 16/2/24. // Copyright © 2016年 PT. All rights reserved. // #import <UIKit/UIKit.h> @interface MainTableViewController : UITableViewController @end
// // MainTableViewController.h // PTKit // // Created by 彭腾 on 16/2/24. // Copyright © 2016年 PT. All rights reserved. // #import <UIKit/UIKit.h> @CLASS_0 VAR_0 : VAR_1 @VAR_2
0.890498
{'CLASS_0': 'interface', 'VAR_0': 'MainTableViewController', 'VAR_1': 'UITableViewController', 'VAR_2': 'end'}
/* * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights reserved. * Copyright (c) 2015-2017 Cray Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * BSD license below: * * 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. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <getopt.h> #include <poll.h> #include <time.h> #include <string.h> #include <pthread.h> #include <unistd.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include "gnix_datagram.h" #include "gnix_cm_nic.h" #include <criterion/criterion.h> #include "gnix_rdma_headers.h" #include "common.h" #include "common.h" /* Note: Set to ~FI_NOTIFY_FLAGS_ONLY since this was written before api 1.5 */ static uint64_t mode_bits = ~FI_NOTIFY_FLAGS_ONLY; static struct fid_fabric *fab; static struct fid_domain *dom; static struct fid_ep *ep; static struct fi_info *hints; static struct fi_info *fi; static struct gnix_fid_ep *ep_priv; const char my_cdm_id[] = "3000"; void dg_setup(void) { int ret = 0; char my_hostname[HOST_NAME_MAX]; hints = fi_allocinfo(); cr_assert(hints, "fi_allocinfo"); hints->domain_attr->mr_mode = GNIX_DEFAULT_MR_MODE; hints->domain_attr->cq_data_size = 4; hints->mode = mode_bits; hints->fabric_attr->prov_name = strdup("gni"); ret = gethostname(my_hostname, sizeof(my_hostname)); cr_assert(!ret, "gethostname"); ret = fi_getinfo(fi_version(), my_hostname, my_cdm_id, FI_SOURCE, hints, &fi); cr_assert(!ret, "fi_getinfo"); ret = fi_fabric(fi->fabric_attr, &fab, NULL); cr_assert(!ret, "fi_fabric"); ret = fi_domain(fab, fi, &dom, NULL); cr_assert(!ret, "fi_domain"); ret = fi_endpoint(dom, fi, &ep, NULL); cr_assert(!ret, "fi_endpoint"); } void dg_setup_prog_manual(void) { int ret = 0; hints = fi_allocinfo(); cr_assert(hints, "fi_allocinfo"); hints->domain_attr->mr_mode = GNIX_DEFAULT_MR_MODE; hints->domain_attr->cq_data_size = 4; hints->domain_attr->control_progress = FI_PROGRESS_MANUAL; hints->mode = mode_bits; hints->fabric_attr->prov_name = strdup("gni"); ret = fi_getinfo(fi_version(), NULL, 0, 0, hints, &fi); cr_assert(!ret, "fi_getinfo"); ret = fi_fabric(fi->fabric_attr, &fab, NULL); cr_assert(!ret, "fi_fabric"); ret = fi_domain(fab, fi, &dom, NULL); cr_assert(!ret, "fi_domain"); ret = fi_endpoint(dom, fi, &ep, NULL); cr_assert(!ret, "fi_endpoint"); } void dg_teardown(void) { int ret = 0; ret = fi_close(&ep->fid); cr_assert(!ret, "failure in closing ep."); ret = fi_close(&dom->fid); cr_assert(!ret, "failure in closing domain."); ret = fi_close(&fab->fid); cr_assert(!ret, "failure in closing fabric."); fi_freeinfo(fi); fi_freeinfo(hints); } /******************************************************************************* * Allocation Tests: * * try different datagram allocation/free patterns and see if something * explodes. ******************************************************************************/ TestSuite(dg_allocation, .init = dg_setup, .fini = dg_teardown); Test(dg_allocation, dgram_verify_cdm_id) { uint32_t correct = atol(my_cdm_id); struct gnix_cm_nic *cm_nic; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->my_name.gnix_addr.cdm_id == correct), "cm_nic incorrect cdm_id"); } Test(dg_allocation, dgram_alloc_wc) { int ret = 0, i; struct gnix_cm_nic *cm_nic; struct gnix_datagram **dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); fab_priv = container_of(fab, struct gnix_fid_fabric, fab_fid); dgram_ptr = calloc(fab_priv->n_wc_dgrams, sizeof(struct gnix_datagram *)); cr_assert((dgram_ptr != NULL), "calloc failed"); for (i = 0; i < fab_priv->n_wc_dgrams; i++) { ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_WC, &dgram_ptr[i]); cr_assert(!ret, "_gnix_dgram_alloc wc"); } for (i = 0; i < fab_priv->n_wc_dgrams; i++) { ret = _gnix_dgram_free(dgram_ptr[i]); cr_assert(!ret, "_gnix_dgram_free wc"); } free(dgram_ptr); } Test(dg_allocation, dgram_alloc_wc_alt) { int ret = 0, i; struct gnix_cm_nic *cm_nic; struct gnix_datagram *dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); fab_priv = container_of(fab, struct gnix_fid_fabric, fab_fid); for (i = 0; i < fab_priv->n_wc_dgrams; i++) { ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_WC, &dgram_ptr); cr_assert(!ret, "_gnix_dgram_alloc wc"); ret = _gnix_dgram_free(dgram_ptr); cr_assert(!ret, "_gnix_dgram_free wc"); } } Test(dg_allocation, dgram_alloc_bnd) { int ret = 0, i; struct gnix_cm_nic *cm_nic; struct gnix_datagram **dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); fab_priv = container_of(fab, struct gnix_fid_fabric, fab_fid); dgram_ptr = calloc(fab_priv->n_bnd_dgrams, sizeof(struct gnix_datagram *)); cr_assert((dgram_ptr != NULL), "calloc failed"); for (i = 0; i < fab_priv->n_bnd_dgrams; i++) { ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_BND, &dgram_ptr[i]); cr_assert(!ret, "_gnix_dgram_alloc bnd"); } for (i = 0; i < fab_priv->n_wc_dgrams; i++) { ret = _gnix_dgram_free(dgram_ptr[i]); cr_assert(!ret, "_gnix_dgram_free bnd"); } free(dgram_ptr); } Test(dg_allocation, dgram_alloc_wc_bnd) { int ret = 0, i; struct gnix_cm_nic *cm_nic; struct gnix_datagram *dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); fab_priv = container_of(fab, struct gnix_fid_fabric, fab_fid); for (i = 0; i < fab_priv->n_bnd_dgrams; i++) { ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_BND, &dgram_ptr); cr_assert(!ret, "_gnix_dgram_alloc bnd"); ret = _gnix_dgram_free(dgram_ptr); cr_assert(!ret, "_gnix_dgram_free bnd"); } } Test(dg_allocation, dgram_pack_unpack) { int ret = 0; ssize_t len; struct gnix_cm_nic *cm_nic; struct gnix_datagram *dgram_ptr; char in_buf[] = "0xdeadbeef"; char out_buf[GNI_DATAGRAM_MAXSIZE]; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_BND, &dgram_ptr); cr_assert(!ret, "_gnix_dgram_alloc bnd"); /* * check pack/unpack for GNIX_DGRAM_IN_BUF */ len = _gnix_dgram_pack_buf(dgram_ptr, GNIX_DGRAM_IN_BUF, in_buf, sizeof(in_buf)); cr_assert(len > 0); cr_assert_eq(len, (ssize_t)sizeof(in_buf)); len = _gnix_dgram_unpack_buf(dgram_ptr, GNIX_DGRAM_IN_BUF, out_buf, sizeof(in_buf)); cr_assert(len > 0); cr_assert_eq(len, (ssize_t)sizeof(in_buf)); cr_assert_eq(0, strcmp(in_buf, out_buf)); /* * check pack/unpack for GNIX_DGRAM_OUT_BUF */ len = _gnix_dgram_pack_buf(dgram_ptr, GNIX_DGRAM_OUT_BUF, in_buf, sizeof(in_buf)); cr_assert(len > 0); cr_assert_eq(len, (ssize_t)sizeof(in_buf)); memset(out_buf, 0, sizeof(out_buf)); len = _gnix_dgram_unpack_buf(dgram_ptr, GNIX_DGRAM_OUT_BUF, out_buf, sizeof(in_buf)); cr_assert(len > 0); cr_assert_eq(len, (ssize_t)sizeof(in_buf)); cr_assert_eq(0, strcmp(in_buf, out_buf)); ret = _gnix_dgram_free(dgram_ptr); cr_assert(!ret, "_gnix_dgram_free bnd"); } static struct gnix_address local_address; static int dgram_match; static int dgram_callback_fn(struct gnix_datagram *the_dgram, struct gnix_address where_from, gni_post_state_t dgram_state) { if (dgram_state != GNI_POST_COMPLETED) { fprintf(stderr, "dgram_state check failed %s %d\n", __func__, __LINE__); return -FI_EIO; } if ((where_from.device_addr != local_address.device_addr) || (where_from.cdm_id != local_address.cdm_id)) { fprintf(stderr, "where from check failed %s %d\n", __func__, __LINE__); return -FI_EIO; } dgram_match = 1; return 0; } Test(dg_allocation, dgram_wc_post_exchg) { int ret = 0; struct gnix_cm_nic *cm_nic; struct gnix_datagram *dgram_wc, *dgram_bnd; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_WC, &dgram_wc); cr_assert(!ret, "_gnix_dgram_alloc wc"); dgram_wc->callback_fn = dgram_callback_fn; ret = _gnix_dgram_wc_post(dgram_wc); cr_assert((ret == 0), "_gnix_dgram_alloc wc"); ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_BND, &dgram_bnd); cr_assert((ret == 0), "_gnix_dgram_alloc bnd"); dgram_bnd->target_addr = cm_nic->my_name.gnix_addr; local_address = cm_nic->my_name.gnix_addr; dgram_bnd->callback_fn = dgram_callback_fn; ret = _gnix_dgram_bnd_post(dgram_bnd); cr_assert(ret == 0); /* * progress auto, don't need to do anything */ while (dgram_match != 1) { ret = _gnix_cm_nic_progress(cm_nic); cr_assert(ret == 0); pthread_yield(); } ret = _gnix_dgram_free(dgram_bnd); cr_assert(!ret, "_gnix_dgram_free bnd"); ret = _gnix_dgram_free(dgram_wc); cr_assert(!ret, "_gnix_dgram_free wc"); } Test(dg_allocation, dgram_wc_post_exchg_manual, .init = dg_setup_prog_manual) { int ret = 0; struct gnix_cm_nic *cm_nic; struct gnix_datagram *dgram_wc, *dgram_bnd; ep_priv = container_of(ep, struct gnix_fid_ep, ep_fid); cm_nic = ep_priv->cm_nic; cr_assert((cm_nic != NULL), "cm_nic NULL"); cr_assert(cm_nic->ctrl_progress == FI_PROGRESS_MANUAL); cr_assert((cm_nic->dgram_hndl != NULL), "cm_nic dgram_hndl NULL"); ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_WC, &dgram_wc); cr_assert(!ret, "_gnix_dgram_alloc wc"); dgram_wc->callback_fn = dgram_callback_fn; ret = _gnix_dgram_wc_post(dgram_wc); cr_assert((ret == 0), "_gnix_dgram_alloc wc"); ret = _gnix_dgram_alloc(cm_nic->dgram_hndl, GNIX_DGRAM_BND, &dgram_bnd); cr_assert((ret == 0), "_gnix_dgram_alloc bnd"); dgram_bnd->target_addr = cm_nic->my_name.gnix_addr; local_address = cm_nic->my_name.gnix_addr; dgram_bnd->callback_fn = dgram_callback_fn; ret = _gnix_dgram_bnd_post(dgram_bnd); cr_assert(ret == 0); /* * progress auto, don't need to do anything */ while (dgram_match != 1) { ret = _gnix_cm_nic_progress(cm_nic); cr_assert(ret == 0); pthread_yield(); } ret = _gnix_dgram_free(dgram_bnd); cr_assert(!ret, "_gnix_dgram_free bnd"); ret = _gnix_dgram_free(dgram_wc); cr_assert(!ret, "_gnix_dgram_free wc"); }
/* * Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights reserved. * Copyright (c) 2015-2017 Cray Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * BSD license below: * * 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. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <IMPORT_0> #include <stdlib.h> #include <IMPORT_1> #include <IMPORT_2> #include <poll.h> #include <IMPORT_3> #include <IMPORT_4> #include <pthread.h> #include <IMPORT_5> #include <IMPORT_6> #include <IMPORT_0> #include <stdlib.h> #include <IMPORT_7> #include "gnix_datagram.h" #include "gnix_cm_nic.h" #include <criterion/criterion.h> #include "IMPORT_8" #include "IMPORT_9" #include "IMPORT_9" /* Note: Set to ~FI_NOTIFY_FLAGS_ONLY since this was written before api 1.5 */ static uint64_t mode_bits = ~FI_NOTIFY_FLAGS_ONLY; static struct fid_fabric *fab; static struct CLASS_0 *VAR_0; static struct CLASS_1 *ep; static struct fi_info *VAR_1; static struct fi_info *VAR_2; static struct CLASS_2 *ep_priv; const char VAR_4[] = "3000"; void dg_setup(void) { int VAR_5 = 0; char VAR_6[VAR_7]; VAR_1 = FUNC_0(); FUNC_1(VAR_1, "fi_allocinfo"); VAR_1->domain_attr->mr_mode = GNIX_DEFAULT_MR_MODE; VAR_1->domain_attr->cq_data_size = 4; VAR_1->mode = mode_bits; VAR_1->fabric_attr->VAR_8 = FUNC_2("gni"); VAR_5 = gethostname(VAR_6, sizeof(VAR_6)); FUNC_1(!VAR_5, "gethostname"); VAR_5 = fi_getinfo(FUNC_3(), VAR_6, VAR_4, VAR_9, VAR_1, &VAR_2); FUNC_1(!VAR_5, "fi_getinfo"); VAR_5 = FUNC_4(VAR_2->fabric_attr, &fab, NULL); FUNC_1(!VAR_5, "fi_fabric"); VAR_5 = FUNC_5(fab, VAR_2, &VAR_0, NULL); FUNC_1(!VAR_5, "fi_domain"); VAR_5 = FUNC_6(VAR_0, VAR_2, &ep, NULL); FUNC_1(!VAR_5, "fi_endpoint"); } void FUNC_7(void) { int VAR_5 = 0; VAR_1 = FUNC_0(); FUNC_1(VAR_1, "fi_allocinfo"); VAR_1->domain_attr->mr_mode = GNIX_DEFAULT_MR_MODE; VAR_1->domain_attr->cq_data_size = 4; VAR_1->domain_attr->control_progress = VAR_11; VAR_1->mode = mode_bits; VAR_1->fabric_attr->VAR_8 = FUNC_2("gni"); VAR_5 = fi_getinfo(FUNC_3(), NULL, 0, 0, VAR_1, &VAR_2); FUNC_1(!VAR_5, "fi_getinfo"); VAR_5 = FUNC_4(VAR_2->fabric_attr, &fab, NULL); FUNC_1(!VAR_5, "fi_fabric"); VAR_5 = FUNC_5(fab, VAR_2, &VAR_0, NULL); FUNC_1(!VAR_5, "fi_domain"); VAR_5 = FUNC_6(VAR_0, VAR_2, &ep, NULL); FUNC_1(!VAR_5, "fi_endpoint"); } void FUNC_8(void) { int VAR_5 = 0; VAR_5 = fi_close(&ep->VAR_13); FUNC_1(!VAR_5, "failure in closing ep."); VAR_5 = fi_close(&VAR_0->VAR_13); FUNC_1(!VAR_5, "failure in closing domain."); VAR_5 = fi_close(&fab->VAR_13); FUNC_1(!VAR_5, "failure in closing fabric."); fi_freeinfo(VAR_2); fi_freeinfo(VAR_1); } /******************************************************************************* * Allocation Tests: * * try different datagram allocation/free patterns and see if something * explodes. ******************************************************************************/ FUNC_9(VAR_14, .init = dg_setup, .fini = VAR_12); Test(VAR_14, dgram_verify_cdm_id) { uint32_t VAR_15 = FUNC_10(VAR_4); struct CLASS_3 *VAR_16; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->my_name.gnix_addr.VAR_17 == VAR_15), "cm_nic incorrect cdm_id"); } Test(VAR_14, dgram_alloc_wc) { int VAR_5 = 0, VAR_18; struct CLASS_3 *VAR_16; struct gnix_datagram **dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); fab_priv = FUNC_11(fab, struct gnix_fid_fabric, VAR_20); dgram_ptr = FUNC_12(fab_priv->n_wc_dgrams, sizeof(struct gnix_datagram *)); FUNC_1((dgram_ptr != NULL), "calloc failed"); for (VAR_18 = 0; VAR_18 < fab_priv->n_wc_dgrams; VAR_18++) { VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_21, &dgram_ptr[VAR_18]); FUNC_1(!VAR_5, "_gnix_dgram_alloc wc"); } for (VAR_18 = 0; VAR_18 < fab_priv->n_wc_dgrams; VAR_18++) { VAR_5 = _gnix_dgram_free(dgram_ptr[VAR_18]); FUNC_1(!VAR_5, "_gnix_dgram_free wc"); } FUNC_14(dgram_ptr); } Test(VAR_14, dgram_alloc_wc_alt) { int VAR_5 = 0, VAR_18; struct CLASS_3 *VAR_16; struct gnix_datagram *dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); fab_priv = FUNC_11(fab, struct gnix_fid_fabric, VAR_20); for (VAR_18 = 0; VAR_18 < fab_priv->n_wc_dgrams; VAR_18++) { VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_21, &dgram_ptr); FUNC_1(!VAR_5, "_gnix_dgram_alloc wc"); VAR_5 = _gnix_dgram_free(dgram_ptr); FUNC_1(!VAR_5, "_gnix_dgram_free wc"); } } Test(VAR_14, dgram_alloc_bnd) { int VAR_5 = 0, VAR_18; struct CLASS_3 *VAR_16; struct gnix_datagram **dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); fab_priv = FUNC_11(fab, struct gnix_fid_fabric, VAR_20); dgram_ptr = FUNC_12(fab_priv->n_bnd_dgrams, sizeof(struct gnix_datagram *)); FUNC_1((dgram_ptr != NULL), "calloc failed"); for (VAR_18 = 0; VAR_18 < fab_priv->n_bnd_dgrams; VAR_18++) { VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_22, &dgram_ptr[VAR_18]); FUNC_1(!VAR_5, "_gnix_dgram_alloc bnd"); } for (VAR_18 = 0; VAR_18 < fab_priv->n_wc_dgrams; VAR_18++) { VAR_5 = _gnix_dgram_free(dgram_ptr[VAR_18]); FUNC_1(!VAR_5, "_gnix_dgram_free bnd"); } FUNC_14(dgram_ptr); } Test(VAR_14, dgram_alloc_wc_bnd) { int VAR_5 = 0, VAR_18; struct CLASS_3 *VAR_16; struct gnix_datagram *dgram_ptr; struct gnix_fid_fabric *fab_priv; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); fab_priv = FUNC_11(fab, struct gnix_fid_fabric, VAR_20); for (VAR_18 = 0; VAR_18 < fab_priv->n_bnd_dgrams; VAR_18++) { VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_22, &dgram_ptr); FUNC_1(!VAR_5, "_gnix_dgram_alloc bnd"); VAR_5 = _gnix_dgram_free(dgram_ptr); FUNC_1(!VAR_5, "_gnix_dgram_free bnd"); } } Test(VAR_14, VAR_23) { int VAR_5 = 0; ssize_t len; struct CLASS_3 *VAR_16; struct gnix_datagram *dgram_ptr; char in_buf[] = "0xdeadbeef"; char out_buf[GNI_DATAGRAM_MAXSIZE]; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_22, &dgram_ptr); FUNC_1(!VAR_5, "_gnix_dgram_alloc bnd"); /* * check pack/unpack for GNIX_DGRAM_IN_BUF */ len = FUNC_15(dgram_ptr, GNIX_DGRAM_IN_BUF, in_buf, sizeof(in_buf)); FUNC_1(len > 0); FUNC_16(len, (ssize_t)sizeof(in_buf)); len = _gnix_dgram_unpack_buf(dgram_ptr, GNIX_DGRAM_IN_BUF, out_buf, sizeof(in_buf)); FUNC_1(len > 0); FUNC_16(len, (ssize_t)sizeof(in_buf)); FUNC_16(0, FUNC_17(in_buf, out_buf)); /* * check pack/unpack for GNIX_DGRAM_OUT_BUF */ len = FUNC_15(dgram_ptr, GNIX_DGRAM_OUT_BUF, in_buf, sizeof(in_buf)); FUNC_1(len > 0); FUNC_16(len, (ssize_t)sizeof(in_buf)); FUNC_18(out_buf, 0, sizeof(out_buf)); len = _gnix_dgram_unpack_buf(dgram_ptr, GNIX_DGRAM_OUT_BUF, out_buf, sizeof(in_buf)); FUNC_1(len > 0); FUNC_16(len, (ssize_t)sizeof(in_buf)); FUNC_16(0, FUNC_17(in_buf, out_buf)); VAR_5 = _gnix_dgram_free(dgram_ptr); FUNC_1(!VAR_5, "_gnix_dgram_free bnd"); } static struct gnix_address local_address; static int dgram_match; static int FUNC_19(struct gnix_datagram *the_dgram, struct gnix_address VAR_25, CLASS_4 dgram_state) { if (dgram_state != VAR_26) { fprintf(VAR_27, "dgram_state check failed %s %d\n", __func__, VAR_28); return -VAR_29; } if ((VAR_25.VAR_30 != local_address.VAR_30) || (VAR_25.VAR_17 != local_address.VAR_17)) { fprintf(VAR_27, "where from check failed %s %d\n", __func__, VAR_28); return -VAR_29; } dgram_match = 1; return 0; } Test(VAR_14, VAR_31) { int VAR_5 = 0; struct CLASS_3 *VAR_16; struct gnix_datagram *dgram_wc, *VAR_32; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_21, &dgram_wc); FUNC_1(!VAR_5, "_gnix_dgram_alloc wc"); dgram_wc->VAR_33 = VAR_24; VAR_5 = _gnix_dgram_wc_post(dgram_wc); FUNC_1((VAR_5 == 0), "_gnix_dgram_alloc wc"); VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_22, &VAR_32); FUNC_1((VAR_5 == 0), "_gnix_dgram_alloc bnd"); VAR_32->VAR_34 = VAR_16->my_name.gnix_addr; local_address = VAR_16->my_name.gnix_addr; VAR_32->VAR_33 = VAR_24; VAR_5 = _gnix_dgram_bnd_post(VAR_32); FUNC_1(VAR_5 == 0); /* * progress auto, don't need to do anything */ while (dgram_match != 1) { VAR_5 = _gnix_cm_nic_progress(VAR_16); FUNC_1(VAR_5 == 0); pthread_yield(); } VAR_5 = _gnix_dgram_free(VAR_32); FUNC_1(!VAR_5, "_gnix_dgram_free bnd"); VAR_5 = _gnix_dgram_free(dgram_wc); FUNC_1(!VAR_5, "_gnix_dgram_free wc"); } Test(VAR_14, VAR_35, .init = VAR_10) { int VAR_5 = 0; struct CLASS_3 *VAR_16; struct gnix_datagram *dgram_wc, *VAR_32; ep_priv = FUNC_11(ep, struct VAR_3, ep_fid); VAR_16 = ep_priv->VAR_16; FUNC_1((VAR_16 != NULL), "cm_nic NULL"); FUNC_1(VAR_16->ctrl_progress == VAR_11); FUNC_1((VAR_16->VAR_19 != NULL), "cm_nic dgram_hndl NULL"); VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_21, &dgram_wc); FUNC_1(!VAR_5, "_gnix_dgram_alloc wc"); dgram_wc->VAR_33 = VAR_24; VAR_5 = _gnix_dgram_wc_post(dgram_wc); FUNC_1((VAR_5 == 0), "_gnix_dgram_alloc wc"); VAR_5 = FUNC_13(VAR_16->VAR_19, VAR_22, &VAR_32); FUNC_1((VAR_5 == 0), "_gnix_dgram_alloc bnd"); VAR_32->VAR_34 = VAR_16->my_name.gnix_addr; local_address = VAR_16->my_name.gnix_addr; VAR_32->VAR_33 = VAR_24; VAR_5 = _gnix_dgram_bnd_post(VAR_32); FUNC_1(VAR_5 == 0); /* * progress auto, don't need to do anything */ while (dgram_match != 1) { VAR_5 = _gnix_cm_nic_progress(VAR_16); FUNC_1(VAR_5 == 0); pthread_yield(); } VAR_5 = _gnix_dgram_free(VAR_32); FUNC_1(!VAR_5, "_gnix_dgram_free bnd"); VAR_5 = _gnix_dgram_free(dgram_wc); FUNC_1(!VAR_5, "_gnix_dgram_free wc"); }
0.530523
{'IMPORT_0': 'stdio.h', 'IMPORT_1': 'errno.h', 'IMPORT_2': 'getopt.h', 'IMPORT_3': 'time.h', 'IMPORT_4': 'string.h', 'IMPORT_5': 'unistd.h', 'IMPORT_6': 'limits.h', 'IMPORT_7': 'inttypes.h', 'IMPORT_8': 'gnix_rdma_headers.h', 'IMPORT_9': 'common.h', 'CLASS_0': 'fid_domain', 'VAR_0': 'dom', 'CLASS_1': 'fid_ep', 'VAR_1': 'hints', 'VAR_2': 'fi', 'CLASS_2': 'gnix_fid_ep', 'VAR_3': 'gnix_fid_ep', 'VAR_4': 'my_cdm_id', 'VAR_5': 'ret', 'VAR_6': 'my_hostname', 'VAR_7': 'HOST_NAME_MAX', 'FUNC_0': 'fi_allocinfo', 'FUNC_1': 'cr_assert', 'VAR_8': 'prov_name', 'FUNC_2': 'strdup', 'FUNC_3': 'fi_version', 'VAR_9': 'FI_SOURCE', 'FUNC_4': 'fi_fabric', 'FUNC_5': 'fi_domain', 'FUNC_6': 'fi_endpoint', 'FUNC_7': 'dg_setup_prog_manual', 'VAR_10': 'dg_setup_prog_manual', 'VAR_11': 'FI_PROGRESS_MANUAL', 'FUNC_8': 'dg_teardown', 'VAR_12': 'dg_teardown', 'VAR_13': 'fid', 'FUNC_9': 'TestSuite', 'VAR_14': 'dg_allocation', 'VAR_15': 'correct', 'FUNC_10': 'atol', 'CLASS_3': 'gnix_cm_nic', 'VAR_16': 'cm_nic', 'FUNC_11': 'container_of', 'VAR_17': 'cdm_id', 'VAR_18': 'i', 'VAR_19': 'dgram_hndl', 'VAR_20': 'fab_fid', 'FUNC_12': 'calloc', 'FUNC_13': '_gnix_dgram_alloc', 'VAR_21': 'GNIX_DGRAM_WC', 'FUNC_14': 'free', 'VAR_22': 'GNIX_DGRAM_BND', 'VAR_23': 'dgram_pack_unpack', 'FUNC_15': '_gnix_dgram_pack_buf', 'FUNC_16': 'cr_assert_eq', 'FUNC_17': 'strcmp', 'FUNC_18': 'memset', 'FUNC_19': 'dgram_callback_fn', 'VAR_24': 'dgram_callback_fn', 'VAR_25': 'where_from', 'CLASS_4': 'gni_post_state_t', 'VAR_26': 'GNI_POST_COMPLETED', 'VAR_27': 'stderr', 'VAR_28': '__LINE__', 'VAR_29': 'FI_EIO', 'VAR_30': 'device_addr', 'VAR_31': 'dgram_wc_post_exchg', 'VAR_32': 'dgram_bnd', 'VAR_33': 'callback_fn', 'VAR_34': 'target_addr', 'VAR_35': 'dgram_wc_post_exchg_manual'}
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>. // #import "MTAppDelegate_Shared.h" #import "PBSystemServiceNowPlayingDelegate.h" @class MTTVApplicationController, NSOperationQueue, NSString, NSURL, TVStoreApplicationSetupHelper; @interface MTAppDelegate_ATV : MTAppDelegate_Shared <PBSystemServiceNowPlayingDelegate> { NSOperationQueue *_updateQueue; // 8 = 0x8 _Bool _hasSetupAfterBecomingActive; // 16 = 0x10 NSURL *_urlToOpenWhenApplicationHasFinishedLaunching; // 24 = 0x18 TVStoreApplicationSetupHelper *_setupHelper; // 32 = 0x20 } + (id)createWindow; // IMP=0x00000001000406a0 @property(nonatomic) _Bool hasSetupAfterBecomingActive; // @synthesize hasSetupAfterBecomingActive=_hasSetupAfterBecomingActive; @property(retain, nonatomic) TVStoreApplicationSetupHelper *setupHelper; // @synthesize setupHelper=_setupHelper; @property(retain, nonatomic) NSURL *urlToOpenWhenApplicationHasFinishedLaunching; // @synthesize urlToOpenWhenApplicationHasFinishedLaunching=_urlToOpenWhenApplicationHasFinishedLaunching; - (void).cxx_destruct; // IMP=0x0000000100040b24 - (void)_presetDialogWithError:(long long)arg1 appController:(id)arg2; // IMP=0x0000000100040954 - (void)_loadWithBootURL:(id)arg1 withLaunchOptions:(id)arg2; // IMP=0x0000000100040728 - (id)rootViewController; // IMP=0x000000010004064c - (void)setupAfterBecomingActive; // IMP=0x00000001000405f8 - (id)updateQueue; // IMP=0x000000010004053c - (void)systemServicePresentNowPlayingUI; // IMP=0x00000001000404dc - (void)applicationDidBecomeActive:(id)arg1; // IMP=0x00000001000403c8 - (_Bool)application:(id)arg1 openURL:(id)arg2 options:(id)arg3; // IMP=0x00000001000402bc - (_Bool)application:(id)arg1 didFinishLaunchingWithOptions:(id)arg2; // IMP=0x000000010003fe84 - (_Bool)application:(id)arg1 willFinishLaunchingWithOptions:(id)arg2; // IMP=0x000000010003fbbc // Remaining properties @property(retain, nonatomic) MTTVApplicationController *appController; // @dynamic appController; @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>. // #import "MTAppDelegate_Shared.h" #import "PBSystemServiceNowPlayingDelegate.h" @class VAR_0, VAR_1, NSString, VAR_2, TVStoreApplicationSetupHelper; @interface VAR_3 : VAR_4 <PBSystemServiceNowPlayingDelegate> { CLASS_1 *VAR_5; // 8 = 0x8 _Bool VAR_6; // 16 = 0x10 CLASS_2 *_urlToOpenWhenApplicationHasFinishedLaunching; // 24 = 0x18 TVStoreApplicationSetupHelper *VAR_7; // 32 = 0x20 } + (ID_0)createWindow; // IMP=0x00000001000406a0 @VAR_9(nonatomic) _Bool hasSetupAfterBecomingActive; // @synthesize hasSetupAfterBecomingActive=_hasSetupAfterBecomingActive; @FUNC_0(VAR_10, nonatomic) TVStoreApplicationSetupHelper *setupHelper; // @synthesize setupHelper=_setupHelper; @FUNC_0(VAR_10, nonatomic) CLASS_2 *urlToOpenWhenApplicationHasFinishedLaunching; // @synthesize urlToOpenWhenApplicationHasFinishedLaunching=_urlToOpenWhenApplicationHasFinishedLaunching; - (void).cxx_destruct; // IMP=0x0000000100040b24 - (void)VAR_11:(long long)ID_1 VAR_13:(VAR_8)VAR_14; // IMP=0x0000000100040954 - (void)_loadWithBootURL:(VAR_8)CLASS_3 VAR_15:(VAR_8)VAR_14; // IMP=0x0000000100040728 - (ID_0)rootViewController; // IMP=0x000000010004064c - (void)VAR_16; // IMP=0x00000001000405f8 - (ID_0)updateQueue; // IMP=0x000000010004053c - (void)VAR_17; // IMP=0x00000001000404dc - (void)applicationDidBecomeActive:(VAR_8)VAR_12; // IMP=0x00000001000403c8 - (_Bool)VAR_18:(VAR_8)CLASS_3 openURL:(VAR_8)VAR_14 VAR_19:(VAR_8)arg3; // IMP=0x00000001000402bc - (_Bool)VAR_18:(VAR_8)CLASS_3 VAR_20:(VAR_8)VAR_14; // IMP=0x000000010003fe84 - (_Bool)VAR_18:(VAR_8)CLASS_3 VAR_21:(VAR_8)VAR_14; // IMP=0x000000010003fbbc // Remaining properties @FUNC_0(VAR_10, nonatomic) CLASS_0 *VAR_13; // @dynamic appController; @FUNC_0(VAR_22, copy) NSString *VAR_23; @FUNC_0(VAR_22, copy) NSString *VAR_24; @VAR_9(ID_2) VAR_25 VAR_26 long VAR_27; @VAR_9(ID_2) VAR_28 VAR_29; @CLASS_4
0.477578
{'VAR_0': 'MTTVApplicationController', 'CLASS_0': 'MTTVApplicationController', 'VAR_1': 'NSOperationQueue', 'CLASS_1': 'NSOperationQueue', 'VAR_2': 'NSURL', 'CLASS_2': 'NSURL', 'VAR_3': 'MTAppDelegate_ATV', 'VAR_4': 'MTAppDelegate_Shared', 'VAR_5': '_updateQueue', 'VAR_6': '_hasSetupAfterBecomingActive', 'VAR_7': '_setupHelper', 'ID_0': 'id', 'VAR_8': 'id', 'VAR_9': 'property', 'FUNC_0': 'property', 'VAR_10': 'retain', 'VAR_11': '_presetDialogWithError', 'ID_1': 'arg1', 'CLASS_3': 'arg1', 'VAR_12': 'arg1', 'VAR_13': 'appController', 'VAR_14': 'arg2', 'VAR_15': 'withLaunchOptions', 'VAR_16': 'setupAfterBecomingActive', 'VAR_17': 'systemServicePresentNowPlayingUI', 'VAR_18': 'application', 'VAR_19': 'options', 'VAR_20': 'didFinishLaunchingWithOptions', 'VAR_21': 'willFinishLaunchingWithOptions', 'VAR_22': 'readonly', 'ID_2': 'readonly', 'VAR_23': 'debugDescription', 'VAR_24': 'description', 'VAR_25': 'unsigned', 'VAR_26': 'long', 'VAR_27': 'hash', 'VAR_28': 'Class', 'VAR_29': 'superclass', 'CLASS_4': 'end'}
#pragma once #include <deque> #include <ida.hpp> #include <idd.hpp> //-------------------------------------------------------------------------- // Very simple class to store pending events enum queue_pos_t { IN_FRONT, IN_BACK }; struct eventlist_t : public std::deque<debug_event_t> { private: bool synced; public: // save a pending event void enqueue(const debug_event_t &ev, queue_pos_t pos) { if (pos != IN_BACK) push_front(ev); else push_back(ev); } // retrieve a pending event bool retrieve(debug_event_t *event) { if (empty()) return false; // get the first event and return it *event = front(); pop_front(); return true; } };
#pragma once #include <IMPORT_0> #include <IMPORT_1> #include <IMPORT_2> //-------------------------------------------------------------------------- // Very simple class to store pending events enum CLASS_0 { IN_FRONT, IN_BACK }; struct CLASS_1 : VAR_1 std::IMPORT_0<VAR_2> { private: bool synced; public: // save a pending event VAR_3 enqueue(const CLASS_2 &VAR_4, VAR_0 pos) { if (pos != IN_BACK) push_front(VAR_4); else push_back(VAR_4); } // retrieve a pending event bool FUNC_0(CLASS_2 *VAR_5) { if (FUNC_1()) return false; // get the first event and return it *VAR_5 = FUNC_2(); FUNC_3(); return true; } };
0.611217
{'IMPORT_0': 'deque', 'IMPORT_1': 'ida.hpp', 'IMPORT_2': 'idd.hpp', 'CLASS_0': 'queue_pos_t', 'VAR_0': 'queue_pos_t', 'CLASS_1': 'eventlist_t', 'VAR_1': 'public', 'VAR_2': 'debug_event_t', 'CLASS_2': 'debug_event_t', 'VAR_3': 'void', 'VAR_4': 'ev', 'FUNC_0': 'retrieve', 'VAR_5': 'event', 'FUNC_1': 'empty', 'FUNC_2': 'front', 'FUNC_3': 'pop_front'}
#include "keymap_common.h" // Poker fix with set(state transition) // Fn + Esc = ` // Fn + {left, down, up, right} = {home, pgdown, pgup, end} const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ KEYMAP_ANSI( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \ LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), /* 1: Poker with Arrow */ KEYMAP_ANSI( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ TRNS,TRNS,TRNS, TRNS, FN1, LEFT,DOWN,RGHT), /* 2: Poker with Esc */ KEYMAP_ANSI( ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS, TRNS, FN2, TRNS,TRNS,TRNS), /* 3: Poker with Arrow and Esc */ KEYMAP_ANSI( ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ TRNS,TRNS,TRNS, TRNS, FN3, LEFT,DOWN,RGHT), /* 4: Poker Fn'd */ KEYMAP_ANSI( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ TRNS,FN6, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ TRNS,TRNS,TRNS, FN5, FN4, TRNS,TRNS,TRNS), /* 5: Poker Fn'd arrow */ KEYMAP_ANSI( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ TRNS,FN7, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \ TRNS,TRNS,TRNS, FN4, FN5, HOME,PGDN,END), /* 6: Poker Fn'd Esc */ KEYMAP_ANSI( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ TRNS,FN4, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ TRNS,TRNS,TRNS, FN7, FN6, TRNS,TRNS,TRNS), /* 7: Poker Fn'd Arrow + Esc */ KEYMAP_ANSI( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ TRNS,FN5, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \ TRNS,TRNS,TRNS, FN6, FN7, HOME,PGDN,END), }; /* * Fn action definition */ const uint16_t PROGMEM fn_actions[] = { /* Poker Layout */ [0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press [1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press [2] = ACTION_LAYER_SET(6, ON_PRESS), // FN2 move to Fn'd Esc when press [3] = ACTION_LAYER_SET(7, ON_PRESS), // FN3 move to Fn'd arrow + Esc when press //[4] = ACTION_LAYER_CLEAR(ON_RELEASE), // FN4 clear overlay when release [4] = ACTION_LAYER_SET(0, ON_RELEASE), // FN4 clear overlay when release [5] = ACTION_LAYER_SET(1, ON_RELEASE), // FN5 move to arrow when release [6] = ACTION_LAYER_SET(2, ON_RELEASE), // FN6 move to Esc when release [7] = ACTION_LAYER_SET(3, ON_RELEASE), // FN7 move to arrow + Esc when release [8] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN8 Task(RControl,RShift+Esc) };
#include "keymap_common.h" // Poker fix with set(state transition) // Fn + Esc = ` // Fn + {left, down, up, right} = {home, pgdown, pgup, end} const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ KEYMAP_ANSI( VAR_0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, VAR_1, P, LBRC,RBRC,BSLS, \ LCTL,A, S, VAR_2, F, G, H, VAR_3, K, L, VAR_4,VAR_5, ENT, \ LSFT,Z, X, C, V, B, N, M, VAR_6,DOT, SLSH, RSFT, \ LCTL,VAR_7,LALT, SPC, FN0, RGUI,APP, RCTL), /* 1: Poker with Arrow */ KEYMAP_ANSI( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, VAR_8, \ TRNS,TRNS,TRNS, TRNS, FN1, LEFT,DOWN,RGHT), /* 2: Poker with Esc */ KEYMAP_ANSI( ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS, TRNS, FN2, TRNS,TRNS,TRNS), /* 3: Poker with Arrow and Esc */ KEYMAP_ANSI( ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, VAR_8, \ TRNS,TRNS,TRNS, TRNS, FN3, LEFT,DOWN,RGHT), /* 4: Poker Fn'd */ KEYMAP_ANSI( ESC, F1, F2, F3, VAR_9, F5, F6, F7, F8, F9, F10, VAR_10, F12, TRNS, \ TRNS,FN6, VAR_8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,VAR_11,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ TRNS,TRNS,TRNS, FN5, VAR_12, TRNS,TRNS,TRNS), /* 5: Poker Fn'd arrow */ KEYMAP_ANSI( ESC, F1, F2, F3, VAR_9, F5, F6, F7, F8, F9, F10, VAR_10, F12, TRNS, \ TRNS,FN7, VAR_8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,VAR_11,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \ TRNS,TRNS,TRNS, VAR_12, FN5, HOME,PGDN,END), /* 6: Poker Fn'd Esc */ KEYMAP_ANSI( VAR_0, F1, F2, F3, VAR_9, F5, F6, F7, F8, F9, F10, VAR_10, F12, TRNS, \ TRNS,VAR_12, VAR_8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,VAR_11,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ TRNS,TRNS,TRNS, FN7, FN6, TRNS,TRNS,TRNS), /* 7: Poker Fn'd Arrow + Esc */ KEYMAP_ANSI( VAR_0, F1, F2, F3, VAR_9, F5, F6, F7, F8, F9, F10, VAR_10, F12, TRNS, \ TRNS,FN5, VAR_8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,VAR_11,PAUS,TRNS,FN8, END, TRNS, \ TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \ TRNS,TRNS,TRNS, FN6, FN7, HOME,PGDN,END), }; /* * Fn action definition */ const uint16_t PROGMEM fn_actions[] = { /* Poker Layout */ [0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press [1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press [2] = ACTION_LAYER_SET(6, ON_PRESS), // FN2 move to Fn'd Esc when press [3] = ACTION_LAYER_SET(7, ON_PRESS), // FN3 move to Fn'd arrow + Esc when press //[4] = ACTION_LAYER_CLEAR(ON_RELEASE), // FN4 clear overlay when release [4] = ACTION_LAYER_SET(0, ON_RELEASE), // FN4 clear overlay when release [5] = ACTION_LAYER_SET(1, ON_RELEASE), // FN5 move to arrow when release [6] = ACTION_LAYER_SET(2, ON_RELEASE), // FN6 move to Esc when release [7] = ACTION_LAYER_SET(3, ON_RELEASE), // FN7 move to arrow + Esc when release [8] = FUNC_0(MOD_RCTL|MOD_RSFT, KC_ESC), // FN8 Task(RControl,RShift+Esc) };
0.163008
{'VAR_0': 'GRV', 'VAR_1': 'O', 'VAR_2': 'D', 'VAR_3': 'J', 'VAR_4': 'SCLN', 'VAR_5': 'QUOT', 'VAR_6': 'COMM', 'VAR_7': 'LGUI', 'VAR_8': 'UP', 'VAR_9': 'F4', 'VAR_10': 'F11', 'VAR_11': 'SLCK', 'VAR_12': 'FN4', 'FUNC_0': 'ACTION_MODS_KEY'}
#include <stdio.h> #include <stdlib.h> struct record{ char name[10]; int age; }; int main(void){ struct record array[2]={{"ken",24},{"Knuth",28}}; FILE *fp = fopen("recfile","w"); if(fp == NULL){ perror("Open file recfile"); exit(1); } fwrite(array,sizeof(struct record),2,fp); fclose(fp); return 0; }
#include <stdio.h> #include <IMPORT_0> struct CLASS_0{ char name[10]; int age; }; int FUNC_0(void){ struct CLASS_0 VAR_0[2]={{"ken",24},{"Knuth",28}}; CLASS_1 *VAR_1 = FUNC_1("recfile","w"); if(VAR_1 == NULL){ FUNC_2("Open file recfile"); FUNC_3(1); } FUNC_4(VAR_0,sizeof(struct CLASS_0),2,VAR_1); FUNC_5(VAR_1); return 0; }
0.823671
{'IMPORT_0': 'stdlib.h', 'CLASS_0': 'record', 'FUNC_0': 'main', 'VAR_0': 'array', 'CLASS_1': 'FILE', 'VAR_1': 'fp', 'FUNC_1': 'fopen', 'FUNC_2': 'perror', 'FUNC_3': 'exit', 'FUNC_4': 'fwrite', 'FUNC_5': 'fclose'}
/* * Copyright © 2013 Cisco Systems, Inc. All rights reserved. * * See COPYING in top-level directory. */ #ifndef NETLOC_MAP_RENAME_H #define NETLOC_MAP_RENAME_H #include <hwloc/autogen/config.h> /* JMS To be filled in after rapid prototyping... */ #endif /* NETLOC_MAP_RENAME_H */
/* * Copyright © 2013 Cisco Systems, Inc. All rights reserved. * * See COPYING in top-level directory. */ #ifndef VAR_0 #define VAR_0 #include <hwloc/autogen/config.h> /* JMS To be filled in after rapid prototyping... */ #endif /* NETLOC_MAP_RENAME_H */
0.656671
{'VAR_0': 'NETLOC_MAP_RENAME_H'}
#ifndef IDENTIFIERCONFLICTWITHFUNCTION_H #define IDENTIFIERCONFLICTWITHFUNCTION_H #include "CompileException.h" namespace thewizardplusplus { namespace wizard_basic_0 { namespace exceptions { class IdentifierConflictWithFunction : public CompileException { public: static const std::string MESSAGE; IdentifierConflictWithFunction(const std::string& identifier); }; } } } #endif
#ifndef IDENTIFIERCONFLICTWITHFUNCTION_H #define IDENTIFIERCONFLICTWITHFUNCTION_H #include "IMPORT_0" namespace VAR_0 { namespace wizard_basic_0 { namespace exceptions { CLASS_0 VAR_1 : public CompileException { public: VAR_2 VAR_3 std::string MESSAGE; IdentifierConflictWithFunction(const std::string& identifier); }; } } } #endif
0.446216
{'IMPORT_0': 'CompileException.h', 'VAR_0': 'thewizardplusplus', 'CLASS_0': 'class', 'VAR_1': 'IdentifierConflictWithFunction', 'VAR_2': 'static', 'VAR_3': 'const'}
/* * generate_random_full_tree: generates, in the given generation space, * a random full tree of * the specified depth. */ void generate_random_full_tree ( int space, int depth, function_set *fset ) { int i, j; int save; if ( depth == 0 ) { i = random_int(fset->terminal_count)+(fset->function_count); gensp_next(space)->f = (fset->cset)+i; if ( (fset->cset)[i].ephem_gen ) gensp_next(space)->d = new_ephemeral_const ( (fset->cset)+i ); return; } i = random_int(fset->function_count); gensp_next(space)->f = (fset->cset)+i; switch ( (fset->cset)[i].type ) { case FUNC_DATA: case EVAL_DATA: for ( j = 0; j < (fset->cset)[i].arity; ++j ) { generate_random_full_tree ( space, depth-1, fset ); } break; case FUNC_EXPR: case EVAL_EXPR: for ( j = 0; j < (fset->cset)[i].arity; ++j ) { save = gensp_next_int ( space ); generate_random_full_tree ( space, depth-1, fset ); gensp[space].data[save].s = gensp[space].used-save-1; } break; } return; }
/* * generate_random_full_tree: generates, in the given generation space, * a random full tree of * the specified depth. */ void generate_random_full_tree ( int space, int depth, function_set *fset ) { int i, j; int save; if ( depth == 0 ) { i = random_int(fset->terminal_count)+(fset->function_count); gensp_next(space)->f = (fset->cset)+i; if ( (fset->cset)[i].ephem_gen ) gensp_next(space)->d = new_ephemeral_const ( (fset->cset)+i ); return; } i = random_int(fset->function_count); gensp_next(space)->f = (fset->cset)+i; switch ( (fset->cset)[i].type ) { case FUNC_DATA: case EVAL_DATA: for ( j = 0; j < (fset->cset)[i].arity; ++j ) { generate_random_full_tree ( space, depth-1, fset ); } break; case FUNC_EXPR: case EVAL_EXPR: for ( j = 0; j < (fset->cset)[i].arity; ++j ) { save = gensp_next_int ( space ); generate_random_full_tree ( space, depth-1, fset ); gensp[space].data[save].s = gensp[space].used-save-1; } break; } return; }
0.016385
{}
#include <unistd.h> #include <stdbool.h> #include <stdint.h> #define SEQ_start 0 #define SEQ_end 1 #define CHANGE_root 0 struct piece { /* Offset of data in data buffer. Never changes. */ size_t off; /* Length of data. Only changes if the piece was the last added and more text is added onto the end of it. */ size_t len; /* Position in sequence. Changes whenever it needs to. */ size_t pos; /* Previous and next piece in linked list. Changes as it needs to. */ ssize_t prev, next; }; struct change { /* Pieces that were added. */ ssize_t apieces[3]; size_t napieces; /* Start and end of slice of pieces that were removed. Should only be -1 if this change is the root change which should never be undone. */ ssize_t rstart, rend; /* Previous and next piece around pieces. */ ssize_t prev, next; /* Positions in sequence's changes array. */ ssize_t parent; ssize_t children; /* Head of my sibling list. */ ssize_t sibling; /* Next of my siblings. */ }; struct sequence { struct piece *pieces; size_t plen, pmax; struct change *changes; size_t clen, cmax; ssize_t changehead; uint8_t *data; size_t dlen, dmax; }; /* Creates a new sequence around data, data may be NULL. len is the number of set bytes in data, max is the current size of the allocation for data. */ struct sequence * sequencenew(uint8_t *data, size_t len); /* Frees a sequence and all it's pieces. */ void sequencefree(struct sequence *s); /* Finds the piece after piece p that contains index pos. Sets i to be the offset of pos in the piece and returns the piece. */ ssize_t sequencepiecefind(struct sequence *s, ssize_t p, size_t pos, size_t *i); /* Replaces the text from and including begin up to but not including end with the len bytes in data. data must be valid utf8 (encoding, bad code points don't matter) otherwise bad things will probably happen. If len is zero this works as a delete. If end is equal to begin this works as an insert. */ bool sequencereplace(struct sequence *s, size_t begin, size_t end, const uint8_t *data, size_t len); size_t sequencecodepoint(struct sequence *s, size_t pos, int32_t *code); size_t sequenceprevcodepoint(struct sequence *s, size_t pos, int32_t *code); /* Fulls out buf with the contentes of the sequence starting at pos and going for at most len bytes. Does NOT null terminate buf. Yes you could use sequencecodepoint in a loop but this will be much faster. */ size_t sequenceget(struct sequence *s, size_t pos, uint8_t *buf, size_t len); size_t sequencelen(struct sequence *s); /* Attempts to find the word that the byte pos is part of. */ bool sequencefindword(struct sequence *s, size_t pos, size_t *start, size_t *len); /* Go up change tree. */ bool sequencechangeup(struct sequence *s); /* Go down change tree. */ bool sequencechangedown(struct sequence *s); /* Cycle through sibling branches. */ bool sequencechangecycle(struct sequence *s); /* Finds the index of the start of the line after the line i is in. */ size_t sequenceindexline(struct sequence *s, size_t i); size_t sequenceindexnextline(struct sequence *s, size_t i); /* Finds the index of the start of the line before the line i is is. */ size_t sequenceindexprevline(struct sequence *s, size_t i); size_t sequenceindexpos(struct sequence *s, size_t line, size_t col); /* For debugging. */ /* Prints tree from change c with string prefix h. */ void sequenceprintchangetree(struct sequence *s, char *h, ssize_t c); /* Prints the sequence in a format that shows pieces. */ void sequenceprint(struct sequence *s);
#include <unistd.h> #include <stdbool.h> #include <IMPORT_0> #define VAR_0 0 #define SEQ_end 1 #define CHANGE_root 0 struct CLASS_0 { /* Offset of data in data buffer. Never changes. */ size_t off; /* Length of data. Only changes if the piece was the last added and more text is added onto the end of it. */ size_t VAR_1; /* Position in sequence. Changes whenever it needs to. */ size_t pos; /* Previous and next piece in linked list. Changes as it needs to. */ ssize_t VAR_2, VAR_3; }; struct change { /* Pieces that were added. */ ssize_t VAR_4[3]; size_t VAR_5; /* Start and end of slice of pieces that were removed. Should only be -1 if this change is the root change which should never be undone. */ ssize_t VAR_6, rend; /* Previous and next piece around pieces. */ ssize_t VAR_2, VAR_3; /* Positions in sequence's changes array. */ ssize_t parent; ssize_t children; /* Head of my sibling list. */ ssize_t sibling; /* Next of my siblings. */ }; struct CLASS_1 { struct CLASS_0 *pieces; size_t VAR_7, VAR_8; struct change *changes; size_t clen, VAR_9; ssize_t changehead; uint8_t *VAR_10; size_t dlen, VAR_11; }; /* Creates a new sequence around data, data may be NULL. len is the number of set bytes in data, max is the current size of the allocation for data. */ struct CLASS_1 * sequencenew(uint8_t *VAR_10, size_t VAR_1); /* Frees a sequence and all it's pieces. */ void FUNC_0(struct CLASS_1 *VAR_12); /* Finds the piece after piece p that contains index pos. Sets i to be the offset of pos in the piece and returns the piece. */ ssize_t FUNC_1(struct CLASS_1 *VAR_12, ssize_t p, size_t pos, size_t *i); /* Replaces the text from and including begin up to but not including end with the len bytes in data. data must be valid utf8 (encoding, bad code points don't matter) otherwise bad things will probably happen. If len is zero this works as a delete. If end is equal to begin this works as an insert. */ bool FUNC_2(struct CLASS_1 *VAR_12, size_t begin, size_t end, const uint8_t *VAR_10, size_t VAR_1); size_t FUNC_3(struct CLASS_1 *VAR_12, size_t pos, int32_t *VAR_13); size_t FUNC_4(struct CLASS_1 *VAR_12, size_t pos, int32_t *VAR_13); /* Fulls out buf with the contentes of the sequence starting at pos and going for at most len bytes. Does NOT null terminate buf. Yes you could use sequencecodepoint in a loop but this will be much faster. */ size_t FUNC_5(struct CLASS_1 *VAR_12, size_t pos, uint8_t *VAR_14, size_t VAR_1); size_t sequencelen(struct CLASS_1 *VAR_12); /* Attempts to find the word that the byte pos is part of. */ bool sequencefindword(struct CLASS_1 *VAR_12, size_t pos, size_t *VAR_15, size_t *VAR_1); /* Go up change tree. */ bool FUNC_6(struct CLASS_1 *VAR_12); /* Go down change tree. */ bool FUNC_7(struct CLASS_1 *VAR_12); /* Cycle through sibling branches. */ bool FUNC_8(struct CLASS_1 *VAR_12); /* Finds the index of the start of the line after the line i is in. */ size_t sequenceindexline(struct CLASS_1 *VAR_12, size_t i); size_t sequenceindexnextline(struct CLASS_1 *VAR_12, size_t i); /* Finds the index of the start of the line before the line i is is. */ size_t sequenceindexprevline(struct CLASS_1 *VAR_12, size_t i); size_t FUNC_9(struct CLASS_1 *VAR_12, size_t VAR_16, size_t VAR_17); /* For debugging. */ /* Prints tree from change c with string prefix h. */ void sequenceprintchangetree(struct CLASS_1 *VAR_12, char *h, ssize_t VAR_18); /* Prints the sequence in a format that shows pieces. */ void sequenceprint(struct CLASS_1 *VAR_12);
0.555125
{'IMPORT_0': 'stdint.h', 'VAR_0': 'SEQ_start', 'CLASS_0': 'piece', 'VAR_1': 'len', 'VAR_2': 'prev', 'VAR_3': 'next', 'VAR_4': 'apieces', 'VAR_5': 'napieces', 'VAR_6': 'rstart', 'CLASS_1': 'sequence', 'VAR_7': 'plen', 'VAR_8': 'pmax', 'VAR_9': 'cmax', 'VAR_10': 'data', 'VAR_11': 'dmax', 'FUNC_0': 'sequencefree', 'VAR_12': 's', 'FUNC_1': 'sequencepiecefind', 'FUNC_2': 'sequencereplace', 'FUNC_3': 'sequencecodepoint', 'VAR_13': 'code', 'FUNC_4': 'sequenceprevcodepoint', 'FUNC_5': 'sequenceget', 'VAR_14': 'buf', 'VAR_15': 'start', 'FUNC_6': 'sequencechangeup', 'FUNC_7': 'sequencechangedown', 'FUNC_8': 'sequencechangecycle', 'FUNC_9': 'sequenceindexpos', 'VAR_16': 'line', 'VAR_17': 'col', 'VAR_18': 'c'}
#include<stdio.h> long long n,m,k,i,j,tmp; long long s[100]; long long f[100][2][2]; long long fun(void) { long long i,ans; memset(f,0,sizeof(f)); f[0][0][0]=1; for (i=0;i<n/2;i++) { if ((s[i]==1||s[i]==-1)&&(s[n-i-1]==1||s[n-i-1]==-1)) { f[i+1][0][1]+=f[i][0][1]; f[i+1][1][1]+=f[i][1][1]; } if ((s[i]==1||s[i]==-1)&&(s[n-i-1]==0||s[n-i-1]==-1)) { f[i+1][1][0]+=f[i][1][0]; f[i+1][1][1]+=f[i][1][1]; } if ((s[i]==0||s[i]==-1)&&(s[n-i-1]==0||s[n-i-1]==-1)) { f[i+1][0][1]+=f[i][0][1]+f[i][0][0]; f[i+1][1][1]+=f[i][1][1]+f[i][1][0]; } if ((s[i]==0||s[i]==-1)&&(s[n-i-1]==1||s[n-i-1]==-1)) { f[i+1][1][0]+=f[i][1][0]+f[i][0][0]; f[i+1][1][1]+=f[i][1][1]+f[i][0][1]; } } ans=f[n/2][1][1]; if (n%2==1) { if (s[n/2]==-1) ans=2*ans+2*f[n/2][1][0]+f[n/2][0][1]; else if (s[n/2]==0) ans=ans+f[n/2][1][0]+f[n/2][0][1]; else ans=ans+f[n/2][0][1]; } else { ans=ans+f[n/2][1][0]+f[n/2][0][1]; } for (i=0;i<n;i++) if (s[i]==1) return ans; return (ans-1); } main() { for (i=0;i<100;i++) s[i]=-1; scanf("%lld%lld",&n,&k); tmp=fun(); if (tmp<k) { printf("-1\n"); }else { for (i=0;i<n;i++) { s[i]=0; tmp=fun(); if (tmp<k) { k-=tmp; s[i]=1; } printf("%d",s[i]); } printf("\n"); } }
#include<IMPORT_0> long long VAR_0,m,VAR_1,i,VAR_2,tmp; long long VAR_3[100]; long long VAR_4[100][2][2]; long long FUNC_0(void) { long long i,ans; FUNC_1(VAR_4,0,sizeof(VAR_4)); VAR_4[0][0][0]=1; for (i=0;i<VAR_0/2;i++) { if ((VAR_3[i]==1||VAR_3[i]==-1)&&(VAR_3[VAR_0-i-1]==1||VAR_3[VAR_0-i-1]==-1)) { VAR_4[i+1][0][1]+=VAR_4[i][0][1]; VAR_4[i+1][1][1]+=VAR_4[i][1][1]; } if ((VAR_3[i]==1||VAR_3[i]==-1)&&(VAR_3[VAR_0-i-1]==0||VAR_3[VAR_0-i-1]==-1)) { VAR_4[i+1][1][0]+=VAR_4[i][1][0]; VAR_4[i+1][1][1]+=VAR_4[i][1][1]; } if ((VAR_3[i]==0||VAR_3[i]==-1)&&(VAR_3[VAR_0-i-1]==0||VAR_3[VAR_0-i-1]==-1)) { VAR_4[i+1][0][1]+=VAR_4[i][0][1]+VAR_4[i][0][0]; VAR_4[i+1][1][1]+=VAR_4[i][1][1]+VAR_4[i][1][0]; } if ((VAR_3[i]==0||VAR_3[i]==-1)&&(VAR_3[VAR_0-i-1]==1||VAR_3[VAR_0-i-1]==-1)) { VAR_4[i+1][1][0]+=VAR_4[i][1][0]+VAR_4[i][0][0]; VAR_4[i+1][1][1]+=VAR_4[i][1][1]+VAR_4[i][0][1]; } } ans=VAR_4[VAR_0/2][1][1]; if (VAR_0%2==1) { if (VAR_3[VAR_0/2]==-1) ans=2*ans+2*VAR_4[VAR_0/2][1][0]+VAR_4[VAR_0/2][0][1]; else if (VAR_3[VAR_0/2]==0) ans=ans+VAR_4[VAR_0/2][1][0]+VAR_4[VAR_0/2][0][1]; else ans=ans+VAR_4[VAR_0/2][0][1]; } else { ans=ans+VAR_4[VAR_0/2][1][0]+VAR_4[VAR_0/2][0][1]; } for (i=0;i<VAR_0;i++) if (VAR_3[i]==1) return ans; return (ans-1); } main() { for (i=0;i<100;i++) VAR_3[i]=-1; FUNC_2("%lld%lld",&VAR_0,&VAR_1); tmp=FUNC_0(); if (tmp<VAR_1) { printf("-1\n"); }else { for (i=0;i<VAR_0;i++) { VAR_3[i]=0; tmp=FUNC_0(); if (tmp<VAR_1) { VAR_1-=tmp; VAR_3[i]=1; } printf("%d",VAR_3[i]); } printf("\n"); } }
0.564741
{'IMPORT_0': 'stdio.h', 'VAR_0': 'n', 'VAR_1': 'k', 'VAR_2': 'j', 'VAR_3': 's', 'VAR_4': 'f', 'FUNC_0': 'fun', 'FUNC_1': 'memset', 'FUNC_2': 'scanf'}
/* Copyright (c) 2012, individual contributors * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #import <Foundation/Foundation.h> #import "AsyncSocket.h" #import "GNNetworkResponse.h" #import "GNNetworkNotification.h" #import "GNNetworkRequest.h" #import "GNNetworkMessageProtocol.h" extern NSString * const GN_NETWORK_ERROR_DOMAIN; extern const NSInteger GNErrorBadVersion; extern const NSInteger GNErrorBadProtocol; typedef void(^MediatorClientCallback)(NSError *error); typedef void(^MediatorMessageHandler)(id<GNNetworkMessageProtocol>msg); /* * Low-level client protocol to the Genesis Mediator server. * Use GNAPIClient if you want to higher-level variant. */ @interface GNMediatorClient : NSObject <AsyncSocketDelegate> { AsyncSocket *socket; MediatorClientCallback connectCallback, disconnectCallback; MediatorMessageHandler fallbackMessageHandler; NSMutableDictionary *messageHandlers; BOOL sslEnabled; } @property (nonatomic) NSTimeInterval connectionTimeout; @property (nonatomic, strong) NSString *host; @property (nonatomic) uint16_t port; @property (nonatomic) uint16_t serverVersion; @property (nonatomic) BOOL compress; @property (nonatomic, readonly) BOOL isConnected; - (id)initWithHost:(NSString *)ipAddress onPort:(uint16_t)portNum; - (void)setDisconnectBlock:(MediatorClientCallback)onDisconnectBlock; - (BOOL)connectWithSSL:(BOOL)isSecure withBlock:(MediatorClientCallback)doBlock; - (void)disconnect; - (void)request:(id<GNNetworkMessageProtocol>)request withCallback:(MediatorMessageHandler)doBlock; - (void)send:(id<GNNetworkMessageProtocol>)request; - (void)setFallbackMessageHandler:(MediatorMessageHandler)handler; @end
/* Copyright (c) 2012, individual contributors * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #import <Foundation/Foundation.h> #import "AsyncSocket.h" #import "GNNetworkResponse.h" #import "GNNetworkNotification.h" #import "GNNetworkRequest.h" #import "GNNetworkMessageProtocol.h" extern NSString * const GN_NETWORK_ERROR_DOMAIN; extern const CLASS_0 GNErrorBadVersion; extern const CLASS_0 GNErrorBadProtocol; typedef void(^MediatorClientCallback)(CLASS_1 *error); typedef void(^MediatorMessageHandler)(CLASS_2<GNNetworkMessageProtocol>VAR_1); /* * Low-level client protocol to the Genesis Mediator server. * Use GNAPIClient if you want to higher-level variant. */ @interface GNMediatorClient : NSObject <AsyncSocketDelegate> { AsyncSocket *socket; MediatorClientCallback connectCallback, VAR_2; MediatorMessageHandler fallbackMessageHandler; NSMutableDictionary *messageHandlers; BOOL VAR_3; } @property (ID_1) NSTimeInterval connectionTimeout; @property (VAR_4, strong) NSString *host; @property (ID_1) VAR_5 port; @property (ID_1) VAR_5 serverVersion; @property (ID_1) BOOL compress; @property (VAR_4, readonly) BOOL isConnected; - (ID_0)VAR_6:(NSString *)ipAddress VAR_7:(uint16_t)portNum; - (void)setDisconnectBlock:(MediatorClientCallback)VAR_8; - (BOOL)VAR_9:(BOOL)isSecure withBlock:(MediatorClientCallback)doBlock; - (void)disconnect; - (void)request:(VAR_0<GNNetworkMessageProtocol>)request withCallback:(MediatorMessageHandler)doBlock; - (void)send:(VAR_0<GNNetworkMessageProtocol>)request; - (void)setFallbackMessageHandler:(MediatorMessageHandler)handler; @end
0.200858
{'CLASS_0': 'NSInteger', 'CLASS_1': 'NSError', 'CLASS_2': 'id', 'ID_0': 'id', 'VAR_0': 'id', 'VAR_1': 'msg', 'VAR_2': 'disconnectCallback', 'VAR_3': 'sslEnabled', 'ID_1': 'nonatomic', 'VAR_4': 'nonatomic', 'VAR_5': 'uint16_t', 'VAR_6': 'initWithHost', 'VAR_7': 'onPort', 'VAR_8': 'onDisconnectBlock', 'VAR_9': 'connectWithSSL'}
// // WSDayNewsController.h // 网易新闻 // // Created by WackoSix on 16/1/10. // Copyright © 2016年 WackoSix. All rights reserved. // #import <UIKit/UIKit.h> @interface WSDayNewsController : UIViewController + (instancetype)dayNews; @end
// // WSDayNewsController.h // 网易新闻 // // Created by WackoSix on 16/1/10. // Copyright © 2016年 WackoSix. All rights reserved. // #import <UIKit/UIKit.h> @CLASS_0 VAR_0 : VAR_1 + (ID_0)VAR_2; @CLASS_1
0.806594
{'CLASS_0': 'interface', 'VAR_0': 'WSDayNewsController', 'VAR_1': 'UIViewController', 'ID_0': 'instancetype', 'VAR_2': 'dayNews', 'CLASS_1': 'end'}
#include<stdio.h> #include<string.h> int mm[128]; int n,m; int main() { char str[16]; int cnt=0,t,i,j; for(scanf("%d %d",&n,&m);n--;) { scanf("%s",str); if (str[0]=='a') { scanf("%d",&t); for(i=0,j=-1;i<m;i++) { if (!mm[i] && i-j>=t) break; else if (mm[i]) j=i; } if (i<m) { printf("%d\n",++cnt); for(++j;j<=i;j++) mm[j]=cnt; } else puts("NULL"); } else if (str[0]=='e') { scanf("%d",&t); for(i=j=0;i<m;i++) if (mm[i]==t) mm[i]=0,j=1; if (!j || t==0) puts("ILLEGAL_ERASE_ARGUMENT"); } else for(i=j=0;i<m;i++) if (mm[i]) t=mm[i],mm[i]=0,mm[j++]=t; } return 0; }
#include<stdio.h> #include<string.h> int mm[128]; int n,m; int main() { char str[16]; int cnt=0,t,i,j; for(scanf("%d %d",&n,&m);n--;) { scanf("%s",str); if (str[0]=='a') { scanf("%d",&t); for(i=0,j=-1;i<m;i++) { if (!mm[i] && i-j>=t) break; else if (mm[i]) j=i; } if (i<m) { printf("%d\n",++cnt); for(++j;j<=i;j++) mm[j]=cnt; } else puts("NULL"); } else if (str[0]=='e') { scanf("%d",&t); for(i=j=0;i<m;i++) if (mm[i]==t) mm[i]=0,j=1; if (!j || t==0) puts("ILLEGAL_ERASE_ARGUMENT"); } else for(i=j=0;i<m;i++) if (mm[i]) t=mm[i],mm[i]=0,mm[j++]=t; } return 0; }
0.067055
{}
/*! \file usbd_conf.h \brief the header file of USB device configuration \version 2020-03-10, V1.0.0, firmware for GD32E50x \version 2020-08-26, V1.1.0, firmware for GD32E50x \version 2021-03-23, V1.2.0, firmware for GD32E50x */ /* Copyright (c) 2021, GigaDevice Semiconductor Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __USBD_CONF_H #define __USBD_CONF_H #include "usb_conf.h" #define USBD_CFG_MAX_NUM 1U #define USBD_ITF_MAX_NUM 1U #define CDC_COM_INTERFACE 0U #define USB_STR_DESC_MAX_SIZE 255U #define CDC_DATA_IN_EP EP1_IN /* EP1 for data IN */ #define CDC_DATA_OUT_EP EP1_OUT /* EP1 for data OUT */ #define CDC_CMD_EP EP2_IN /* EP2 for CDC commands */ #define USB_STRING_COUNT 4U #define USB_CDC_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */ #define APP_RX_DATA_SIZE 2048U /* Total size of IN buffer: APP_RX_DATA_SIZE*8 / MAX_BAUDARATE * 1000 should be > CDC_IN_FRAME_INTERVAL*8 */ /* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */ #ifdef USE_USB_HS #define USB_CDC_DATA_PACKET_SIZE 512U /* Endpoint IN & OUT Packet size */ #define CDC_IN_FRAME_INTERVAL 40U /* Number of micro-frames between IN transfers */ #else #define USB_CDC_DATA_PACKET_SIZE 64U /* Endpoint IN & OUT Packet size */ #define CDC_IN_FRAME_INTERVAL 5U /* Number of frames between IN transfers */ #endif /* USE_USB_HS */ #endif /* __USBD_CONF_H */
/*! \file usbd_conf.h \brief the header file of USB device configuration \version 2020-03-10, V1.0.0, firmware for GD32E50x \version 2020-08-26, V1.1.0, firmware for GD32E50x \version 2021-03-23, V1.2.0, firmware for GD32E50x */ /* Copyright (c) 2021, GigaDevice Semiconductor Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VAR_0 #define VAR_0 #include "IMPORT_0" #define VAR_1 1U #define VAR_2 1U #define CDC_COM_INTERFACE 0U #define USB_STR_DESC_MAX_SIZE 255U #define VAR_3 EP1_IN /* EP1 for data IN */ #define CDC_DATA_OUT_EP EP1_OUT /* EP1 for data OUT */ #define VAR_4 EP2_IN /* EP2 for CDC commands */ #define VAR_5 4U #define USB_CDC_CMD_PACKET_SIZE 8U /* Control Endpoint Packet size */ #define VAR_6 2048U /* Total size of IN buffer: APP_RX_DATA_SIZE*8 / MAX_BAUDARATE * 1000 should be > CDC_IN_FRAME_INTERVAL*8 */ /* CDC Endpoints parameters: you can fine tune these values depending on the needed baudrates and performance. */ #ifdef VAR_7 #define VAR_8 512U /* Endpoint IN & OUT Packet size */ #define VAR_9 40U /* Number of micro-frames between IN transfers */ #else #define VAR_8 64U /* Endpoint IN & OUT Packet size */ #define VAR_9 5U /* Number of frames between IN transfers */ #endif /* USE_USB_HS */ #endif /* __USBD_CONF_H */
0.723067
{'VAR_0': '__USBD_CONF_H', 'IMPORT_0': 'usb_conf.h', 'VAR_1': 'USBD_CFG_MAX_NUM', 'VAR_2': 'USBD_ITF_MAX_NUM', 'VAR_3': 'CDC_DATA_IN_EP', 'VAR_4': 'CDC_CMD_EP', 'VAR_5': 'USB_STRING_COUNT', 'VAR_6': 'APP_RX_DATA_SIZE', 'VAR_7': 'USE_USB_HS', 'VAR_8': 'USB_CDC_DATA_PACKET_SIZE', 'VAR_9': 'CDC_IN_FRAME_INTERVAL'}