hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
588 values
lang
stringclasses
305 values
max_stars_repo_path
stringlengths
3
363
max_stars_repo_name
stringlengths
5
118
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:00:35
2022-03-31 23:43:49
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 12:37:38
2022-03-31 23:59:52
max_issues_repo_path
stringlengths
3
363
max_issues_repo_name
stringlengths
5
118
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
363
max_forks_repo_name
stringlengths
5
135
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:02
2022-03-31 23:27:27
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 08:55:07
2022-03-31 23:59:24
content
stringlengths
5
1.05M
avg_line_length
float64
1.13
1.04M
max_line_length
int64
1
1.05M
alphanum_fraction
float64
0
1
3e62ebd4efa8e4cac40724f91e641805f0bf92d0
365
h
C
VWallet/Presentation/Password/PasswordInputViewController.h
Eratos1122/Cold-Wallet-iOS
b5b8878f377e0de541181323fc99917e6066292a
[ "Apache-2.0" ]
2
2019-01-11T09:38:23.000Z
2019-01-29T15:12:33.000Z
VWallet/Presentation/Password/PasswordInputViewController.h
Eratos1122/Cold-Wallet-iOS
b5b8878f377e0de541181323fc99917e6066292a
[ "Apache-2.0" ]
null
null
null
VWallet/Presentation/Password/PasswordInputViewController.h
Eratos1122/Cold-Wallet-iOS
b5b8878f377e0de541181323fc99917e6066292a
[ "Apache-2.0" ]
1
2022-03-18T06:05:53.000Z
2022-03-18T06:05:53.000Z
// // PasswordInputViewController.h // Wallet // // All rights reserved. // #import <UIKit/UIKit.h> #import "PasswordInputModel.h" NS_ASSUME_NONNULL_BEGIN @interface PasswordInputViewController : UIViewController - (instancetype)initWithModel:(PasswordInputModel *_Nullable)model result:(void(^ __nullable)(BOOL success))result; @end NS_ASSUME_NONNULL_END
18.25
115
0.783562
c45c87d592e9090f9b29997c0f0774b8a11501d0
149
h
C
src/qhebot/lib/qbot.h
zzboss/qhebot-openblock-extension
2fdadc1303046e231cef4df29594a11893b31e7c
[ "MIT" ]
null
null
null
src/qhebot/lib/qbot.h
zzboss/qhebot-openblock-extension
2fdadc1303046e231cef4df29594a11893b31e7c
[ "MIT" ]
null
null
null
src/qhebot/lib/qbot.h
zzboss/qhebot-openblock-extension
2fdadc1303046e231cef4df29594a11893b31e7c
[ "MIT" ]
null
null
null
#ifndef _QHEDUINO_H_ #define _QHEDUINO_H_ #include <Arduino.h> #include <qheduino_SR04.h> #include <qheduino_CAR.h> #include <PS2X_lib.h> #endif
12.416667
26
0.758389
3feb076679d6a20f31ddcd5ec25a310ecb318f00
1,025
h
C
client/src/gui/text.h
Lukasz98/Free-Imperium
fadbcf0394474ce710b0370ea6762af2da958c53
[ "MIT" ]
2
2020-04-09T09:34:53.000Z
2022-01-22T14:31:57.000Z
client/src/gui/text.h
Lukasz98/Free-Imperium
fadbcf0394474ce710b0370ea6762af2da958c53
[ "MIT" ]
null
null
null
client/src/gui/text.h
Lukasz98/Free-Imperium
fadbcf0394474ce710b0370ea6762af2da958c53
[ "MIT" ]
null
null
null
#pragma once #include <algorithm> #include <sstream> #include "../graphics/texture.h" #include "../graphics/rectangle.h" #include "../asset_manager.h" #include "object.h" class Text : public Object { std::unique_ptr<Rectangle> background; std::unique_ptr<Rectangle> content; Color color, bgColor; float height, maxWidth; std::string text, valueName; bool centered; glm::vec3 centerTo; void set(); public: Text(const Text & t) = delete; Text(glm::vec3 parentPos, std::unordered_map<std::string, std::string> & values, float maxWidth = 10000.0f, int id = 0); ~Text() override; void SetPos(glm::vec3 p) override; void Draw() override; void SetClick(GuiClick c) override; void SetContent(const std::string & ct) override; void Move(glm::vec3 p) override; void MakeCentered(glm::vec3 newPos) override; std::string GetValueName() const override { return valueName; } std::string GetContent() const override { return text; } };
24.404762
124
0.665366
e21257a3a9807a736179748ffe5ccb01ea28f3a1
271
h
C
FollowMe/FollowMe/Travel/Controllers/SearchTravelViewController.h
wangyan-1993/FollowMe
dc916156154fe111a77e7ae2cfe2b5079c4ff350
[ "Apache-2.0" ]
null
null
null
FollowMe/FollowMe/Travel/Controllers/SearchTravelViewController.h
wangyan-1993/FollowMe
dc916156154fe111a77e7ae2cfe2b5079c4ff350
[ "Apache-2.0" ]
null
null
null
FollowMe/FollowMe/Travel/Controllers/SearchTravelViewController.h
wangyan-1993/FollowMe
dc916156154fe111a77e7ae2cfe2b5079c4ff350
[ "Apache-2.0" ]
null
null
null
// // SearchTravelViewController.h // FollowMe // // Created by SCJY on 16/3/16. // Copyright © 2016年 SCJY. All rights reserved. // #import <UIKit/UIKit.h> @interface SearchTravelViewController : UIViewController @property(nonatomic, copy) NSString *cityName; @end
19.357143
56
0.730627
64e4e3f5b9a64e34e31d85ad4bf68a518e95586a
1,529
h
C
GameBoard.h
tredd2016/Breakthrough
eb29dffdf9d593402616463e8ae8b576e2802749
[ "MIT" ]
null
null
null
GameBoard.h
tredd2016/Breakthrough
eb29dffdf9d593402616463e8ae8b576e2802749
[ "MIT" ]
null
null
null
GameBoard.h
tredd2016/Breakthrough
eb29dffdf9d593402616463e8ae8b576e2802749
[ "MIT" ]
null
null
null
#ifndef GAMEBOARD_H #define GAMEBOARD_H #include "Player.h" #include "AI.h" #include "Human.h" #include<iostream> #include<string> #include<sstream> #include<cctype> #include<cmath> #include<random> #include<regex> using namespace std; struct Tile{ int rowPosition; int coulmPosition; Tile(int r, int c) : rowPosition(r), coulmPosition(c) {} }; struct Move{ int rowPosition; int coulmPosition; char direction; // f - forward , l - left, r - right Move(int r, int c, char d) : rowPosition(r), coulmPosition(c), direction(d) {} }; class GameBoard{ // todo: find a way to make the board private public: char Board[8][8]; // Try making these pointers? Player activePlayer, passivePlayer; GameBoard(); GameBoard(Player p1, Player p2); // Constructor 2 player //GameBoard(Player p1, AIPlayer p2); // Constructor - human v AI GameBoard(const GameBoard& b); // Copy Constuctor //Overloaded operators friend ostream& operator<<(ostream& os, const GameBoard& b); //Member functions void printBoard(); void initBoard(); char** getBoard(); void setActPlayer(Player p); Player getActPlayer(); // should be const? may cause problems later... void setPassivePlayer(Player p); Player getPassivePlayer(); void changeTurn(); void setBoardPiece(int rowPos, int coulmPos, char playPiece); Tile calcMove(Move m); void makeMove(); void makeMove(Move m); bool isValidMove(Move m); bool isGG(); Move getMove(); //AI Moves vector<Move> AIAllMoves(); void AImakeMove(); void playGame(); }; #endif
19.35443
79
0.709614
6ab0031c083f1a24f7b6add16038fa8946b0c0a9
10,498
h
C
example/driver_ssd1306_advance.h
hepingood/ssd1306
b183947de4b684dee6bc75ba553073a50e83cf61
[ "MIT" ]
551
2021-05-16T07:15:16.000Z
2022-03-31T23:26:31.000Z
example/driver_ssd1306_advance.h
hepingood/ssd1306
b183947de4b684dee6bc75ba553073a50e83cf61
[ "MIT" ]
1
2022-03-15T03:26:31.000Z
2022-03-20T04:22:19.000Z
example/driver_ssd1306_advance.h
hepingood/ssd1306
b183947de4b684dee6bc75ba553073a50e83cf61
[ "MIT" ]
154
2021-12-05T07:22:00.000Z
2022-03-31T19:44:15.000Z
/** * Copyright (c) 2015 - present LibDriver All rights reserved * * The MIT License (MIT) * * 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. * * @file driver_ssd1306_advance.h * @brief driver ssd1306 advance header file * @version 2.0.0 * @author Shifeng Li * @date 2021-03-30 * * <h3>history</h3> * <table> * <tr><th>Date <th>Version <th>Author <th>Description * <tr><td>2021/03/30 <td>2.0 <td>Shifeng Li <td>format the code * <tr><td>2020/12/10 <td>1.0 <td>Shifeng Li <td>first upload * </table> */ #ifndef _DRIVER_SSD1306_ADVANCE_H_ #define _DRIVER_SSD1306_ADVANCE_H_ #include "driver_ssd1306_interface.h" #ifdef __cplusplus extern "C"{ #endif /** * @addtogroup ssd1306_example_driver * @{ */ /** * @brief ssd1306 advance example default definition */ #define SSD1306_ADVANCE_DEFAULT_DESELECT_LEVEL SSD1306_DESELECT_LEVEL_0P77 /**< set deselect level 0.77 */ #define SSD1306_ADVANCE_DEFAULT_LEFT_RIGHT_REMAP SSD1306_LEFT_RIGHT_REMAP_DISABLE /**< disable remap */ #define SSD1306_ADVANCE_DEFAULT_PIN_CONF SSD1306_PIN_CONF_ALTERNATIVE /**< set alternative */ #define SSD1306_ADVANCE_DEFAULT_PHASE1_PERIOD 0x01 /**< set phase 1 */ #define SSD1306_ADVANCE_DEFAULT_PHASE2_PERIOD 0x0F /**< set phase F */ #define SSD1306_ADVANCE_DEFAULT_OSCILLATOR_FREQUENCY 0x08 /**< set 8 */ #define SSD1306_ADVANCE_DEFAULT_CLOCK_DIVIDE 0x00 /**< set clock div 0 */ #define SSD1306_ADVANCE_DEFAULT_DISPLAY_OFFSET 0x00 /**< set display offset */ #define SSD1306_ADVANCE_DEFAULT_MULTIPLEX_RATIO 0x3F /**< set ratio */ #define SSD1306_ADVANCE_DEFAULT_DISPLAY_MODE SSD1306_DISPLAY_MODE_NORMAL /**< set normal mode */ #define SSD1306_ADVANCE_DEFAULT_SCAN_DIRECTION SSD1306_SCAN_DIRECTION_COMN_1_START /**< set scan 1 */ #define SSD1306_ADVANCE_DEFAULT_SEGMENT SSD1306_SEGMENT_COLUMN_ADDRESS_127 /**< set column 127 */ #define SSD1306_ADVANCE_DEFAULT_CONTRAST 0xCF /**< set contrast CF */ #define SSD1306_ADVANCE_DEFAULT_ZOOM_IN SSD1306_ZOOM_IN_DISABLE /**< disable zoom in */ #define SSD1306_ADVANCE_DEFAULT_FADE_BLINKING_MODE SSD1306_FADE_BLINKING_MODE_DISABLE /**< disable fade */ #define SSD1306_ADVANCE_DEFAULT_FADE_FRAMES 0x00 /**< set frame 0 */ #define SSD1306_ADVANCE_DEFAULT_DISPLAY_START_LINE 0x00 /**< set start line 0 */ #define SSD1306_ADVANCE_DEFAULT_HIGH_COLUMN_START_ADDRESS 0x00 /**< set high start 0 */ #define SSD1306_ADVANCE_DEFAULT_LOW_COLUMN_START_ADDRESS 0x00 /**< set low start 0 */ #define SSD1306_ADVANCE_DEFAULT_PAGE_ADDRESS_RANGE_START 0x00 /**< set page range start */ #define SSD1306_ADVANCE_DEFAULT_PAGE_ADDRESS_RANGE_END 0x07 /**< set page range end */ #define SSD1306_ADVANCE_DEFAULT_COLUMN_ADDRESS_RANGE_START 0x00 /**< set range start */ #define SSD1306_ADVANCE_DEFAULT_COLUMN_ADDRESS_RANGE_END 0x7F /**< set range end */ /** * @brief advance example init * @param[in] interface is the interface type * @param[in] addr is the iic device address * @return status code * - 0 success * - 1 init failed * @note none */ uint8_t ssd1306_advance_init(ssd1306_interface_t interface, ssd1306_address_t addr); /** * @brief advance example deinit * @return status code * - 0 success * - 1 deinit failed * @note none */ uint8_t ssd1306_advance_deinit(void); /** * @brief advance example display on * @return status code * - 0 success * - 1 display on failed * @note none */ uint8_t ssd1306_advance_display_on(void); /** * @brief advance example display off * @return status code * - 0 success * - 1 display off failed * @note none */ uint8_t ssd1306_advance_display_off(void); /** * @brief advance example clear * @return status code * - 0 success * - 1 clear failed * @note none */ uint8_t ssd1306_advance_clear(void); /** * @brief advance example write a point * @param[in] x is the coordinate x * @param[in] y is the coordinate y * @param[in] data is the written data * @return status code * - 0 success * - 1 write point failed * @note none */ uint8_t ssd1306_advance_write_point(uint8_t x, uint8_t y, uint8_t data); /** * @brief advance example read a point * @param[in] x is the coordinate x * @param[in] y is the coordinate y * @param[out] *data points to a data buffer * @return status code * - 0 success * - 1 read point failed * @note none */ uint8_t ssd1306_advance_read_point(uint8_t x, uint8_t y, uint8_t *data); /** * @brief advance example draw a string * @param[in] x is the coordinate x * @param[in] y is the coordinate y * @param[in] *str points to a written string address * @param[in] len is the length of the string * @param[in] color is the display color * @param[in] font is the display font size * @return status code * - 0 success * - 1 write string failed * @note none */ uint8_t ssd1306_advance_string(uint8_t x, uint8_t y, char *str, uint16_t len, uint8_t color, ssd1306_font_t font); /** * @brief advance example fill a rectangle * @param[in] left is the left coordinate x * @param[in] top is the left coordinate y * @param[in] right is the right coordinate x * @param[in] bottom is the right coordinate y * @param[in] color is the display color * @return status code * - 0 success * - 1 fill rect failed * @note none */ uint8_t ssd1306_advance_rect(int8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t color); /** * @brief advance example draw a picture * @param[in] left is the left coordinate x * @param[in] top is the left coordinate y * @param[in] right is the right coordinate x * @param[in] bottom is the right coordinate y * @param[in] *img points to a image buffer * @return status code * - 0 success * - 1 draw picture failed * @note none */ uint8_t ssd1306_advance_picture(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t *img); /** * @brief advance example enable the zoom in * @return status code * - 0 success * - 1 enable zoom in failed * @note none */ uint8_t ssd1306_advance_enable_zoom_in(void); /** * @brief advance example disable the zoom in * @return status code * - 0 success * - 1 disable zoom in failed * @note none */ uint8_t ssd1306_advance_disable_zoom_in(void); /** * @brief advance example set the fade blinking mode * @param[in] mode is the fade blinking mode * @param[in] frames is the fade or blinking frames * @return status code * - 0 success * - 1 set fade blinking mode failed * @note frames max is 0x0F and div is (frames + 1) * 8 */ uint8_t ssd1306_advance_fade_blinking(ssd1306_fade_blinking_mode_t mode, uint8_t frames); /** * @brief advance example deactivate the scroll * @return status code * - 0 success * - 1 deactivate scroll failed * @note none */ uint8_t ssd1306_advance_deactivate_scroll(void); /** * @brief advance example enable the left horizontal scroll * @param[in] start_page_addr is the start page address * @param[in] end_page_addr is the end page address * @param[in] rows is the row address * @param[in] frames is the scroll frames * @return status code * - 0 success * - 1 enable left horizontal scroll failed * @note start_page_addr <= 0x07, end_page_addr <= 0x07, rows <= 0x3F */ uint8_t ssd1306_advance_vertical_left_horizontal_scroll(uint8_t start_page_addr, uint8_t end_page_addr, uint8_t rows, ssd1306_scroll_frame_t frames); /** * @brief advance example enable the right horizontal scroll * @param[in] start_page_addr is the start page address * @param[in] end_page_addr is the end page address * @param[in] rows is the row address * @param[in] frames is the scroll frames * @return status code * - 0 success * - 1 enable right horizontal scroll failed * @note start_page_addr <= 0x07, end_page_addr <= 0x07, rows <= 0x3F */ uint8_t ssd1306_advance_vertical_right_horizontal_scroll(uint8_t start_page_addr, uint8_t end_page_addr, uint8_t rows, ssd1306_scroll_frame_t frames); /** * @} */ #ifdef __cplusplus } #endif #endif
39.171642
139
0.626596
6bbbd9566c92f9c772ece2e41ee9f46bdae8075b
30
h
C
Engine/Source/ThirdParty/openexr/OpenEXR-1.7.1/openexr-1.7.1/IlmImfExamples/lowLevelIoExamples.h
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
1
2022-01-29T18:36:12.000Z
2022-01-29T18:36:12.000Z
Engine/Source/ThirdParty/openexr/OpenEXR-1.7.1/openexr-1.7.1/IlmImfExamples/lowLevelIoExamples.h
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
2
2015-06-21T17:38:11.000Z
2015-06-22T20:54:42.000Z
Engine/Source/ThirdParty/openexr/OpenEXR-1.7.1/openexr-1.7.1/IlmImfExamples/lowLevelIoExamples.h
PopCap/GameIdea
201e1df50b2bc99afc079ce326aa0a44b178a391
[ "BSD-2-Clause" ]
null
null
null
void lowLevelIoExamples ();
7.5
27
0.733333
5bebc99761c61599eda6884adce636f8aafc3ca3
18
c
C
tests/suite/desugaring/16-parameter_type_list_incomplete_fundef.error.c
talsewell/cerberus
c8c6d25f0cb8d4cd2672ffd0790fb0de3f2a51e3
[ "BSD-2-Clause" ]
12
2020-09-03T09:57:26.000Z
2022-01-28T04:28:00.000Z
tests/suite/desugaring/16-parameter_type_list_incomplete_fundef.error.c
talsewell/cerberus
c8c6d25f0cb8d4cd2672ffd0790fb0de3f2a51e3
[ "BSD-2-Clause" ]
182
2021-02-26T23:07:40.000Z
2022-02-10T12:33:45.000Z
tests/suite/desugaring/16-parameter_type_list_incomplete_fundef.error.c
talsewell/cerberus
c8c6d25f0cb8d4cd2672ffd0790fb0de3f2a51e3
[ "BSD-2-Clause" ]
4
2020-09-02T11:54:39.000Z
2022-03-16T23:23:11.000Z
void f(void x) {}
9
17
0.555556
55713d5b12fb589432f57c8ab6d0597fdda94e3b
3,077
h
C
Zprh.h
jfrech/Zpr-h
d45e6a204ef39b3c44ae41d222912d81ee37a3ef
[ "MIT" ]
2
2020-03-11T00:32:08.000Z
2020-03-21T15:39:26.000Z
Zprh.h
jfrech/Zpr-h
d45e6a204ef39b3c44ae41d222912d81ee37a3ef
[ "MIT" ]
null
null
null
Zprh.h
jfrech/Zpr-h
d45e6a204ef39b3c44ae41d222912d81ee37a3ef
[ "MIT" ]
null
null
null
/* ======================================================================== == If the below constant memory size PROGRAM_TEXT_MEMORY too small, == == a segmentation fault is a probable result. No checks will be made. == ======================================================================== */ #ifndef MAIN_H #define MAIN_H #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <time.h> #include "types.h" #include "util.h" #include "pargs.h" #include "rule.h" #include "match.h" #include "sugar.h" #define MAXIMUM_NUMBER_OF_NEVER_USED_RULES_SHOWN (16) #define WATCH_MAXIMUM_PROGRAM_TEXT (1000) #define WATCH_MINIMUM_ELAPSED_CLOCKS (CLOCKS_PER_SEC / 2) /* Number of rules that can be used. */ #ifndef RULE_MEMORY #define RULE_MEMORY ((size_t) (1ul << 10)) #endif /* Number of bytes all rules combined can harbor. */ #ifndef RULE_TEXT_MEMORY #define RULE_TEXT_MEMORY ((size_t) (1ul << 20)) #endif /* Number of bytes the program text can occupy. Is also used for the temporary program text. */ #ifndef PROGRAM_TEXT_MEMORY #define PROGRAM_TEXT_MEMORY ((size_t) (1ul << 30)) #endif #define RULE_TEXT_HAS_ROOM(initial_rule_text, rule_text, bytes) \ ((RULE_TEXT_MEMORY) >= ((rule_text) - (initial_rule_text)) + (bytes)) #define REQUIRE_RULE_TEXT_BYTES(line, initial_rule_text, rule_text, bytes) { \ if (!RULE_TEXT_HAS_ROOM(initial_rule_text, rule_text, bytes)) { \ PARSE_ERROR(line, "rule_text memory exhausted.\n"); } } #ifdef MONOCHROME #define ANSI_RESET "" #define ANSI_COLOR_ERROR "" #define ANSI_COLOR_DEBUG "" #define ANSI_COLOR_INFO "" #define ANSI_COLOR_WATCH "" #define ANSI_COLOR_MORE "" #define ANSI_COLOR_NOT_PRINTABLE "" #else #define ANSI_RESET "\33[0m" #define ANSI_COLOR_ERROR "\33[91m" #define ANSI_COLOR_DEBUG "\33[37m" #define ANSI_COLOR_INFO "\33[32m" #define ANSI_COLOR_WATCH "\33[93m" #define ANSI_COLOR_MORE "\33[34m" #define ANSI_COLOR_NOT_PRINTABLE "\33[35m" #endif #define _ERROR(...) { fprintf(stderr, __VA_ARGS__); } #define _INFO(...) { if (SHOW_INFO) { fprintf(stderr, __VA_ARGS__); } } #define _DEBUG(...) { if (SHOW_DEBUG) { fprintf(stderr, __VA_ARGS__); } } #define _WATCH(...) { fprintf(stderr, __VA_ARGS__); } #define ERROR(...) { _ERROR(ANSI_COLOR_ERROR "[error (%s)]" ANSI_RESET " " \ , __func__); _ERROR(__VA_ARGS__); } #define INFO(...) { _INFO(ANSI_COLOR_INFO "[info (%s)]" ANSI_RESET " " \ , __func__); _INFO(__VA_ARGS__); } #define DEBUG(...) { _DEBUG(ANSI_COLOR_DEBUG "[debug (%s)]" ANSI_RESET " " \ , __func__); _DEBUG(__VA_ARGS__); } #define WATCH(iteration, ...) { _WATCH(ANSI_COLOR_WATCH "[watch %zu]" \ ANSI_RESET " ", iteration); \ _WATCH(__VA_ARGS__); } #define PARSE_ERROR(line, ...) { \ ERROR("Line %zu: ", line); _ERROR(__VA_ARGS__); return false; } #define PARSE_DEBUG(line, ...) { \ DEBUG("Line %zu: ", line); _DEBUG(__VA_ARGS__); } void print_help(); extern bool SHOW_INFO; extern bool SHOW_DEBUG; #endif
33.086022
78
0.641209
0dbb9a83b828c7031721a6dbf3bebb0ca2ae1f0d
1,166
h
C
OrionUO/GUI/GUIComboboxText.h
shiryux/UOA-OrionUO
fd81d57db51efd39ecfaaa19fd0fb881bde8fef8
[ "MIT" ]
1
2019-04-13T09:30:27.000Z
2019-04-13T09:30:27.000Z
OrionUO/GUI/GUIComboboxText.h
shiryux/UOA-OrionUO
fd81d57db51efd39ecfaaa19fd0fb881bde8fef8
[ "MIT" ]
null
null
null
OrionUO/GUI/GUIComboboxText.h
shiryux/UOA-OrionUO
fd81d57db51efd39ecfaaa19fd0fb881bde8fef8
[ "MIT" ]
null
null
null
/*********************************************************************************** ** ** GUIComboboxText.h ** ** Компонента для отображения текста комбобокса ** ** Copyright (C) August 2016 Hotride ** ************************************************************************************ */ //---------------------------------------------------------------------------------- #ifndef GUICOMBOBOXTEXT_H #define GUICOMBOBOXTEXT_H //---------------------------------------------------------------------------------- class CGUIComboboxText : public CGUIText { public: CGUIComboboxText(const ushort &color, const uchar &font, const string &str, const int &width = 0, const TEXT_ALIGN_TYPE &align = TS_LEFT, const ushort &flags = 0); CGUIComboboxText(const ushort &color, const uchar &font, const wstring &str, const int &width = 0, const TEXT_ALIGN_TYPE &align = TS_LEFT, const ushort &flags = 0); virtual ~CGUIComboboxText(); virtual void OnMouseEnter(); virtual void OnMouseExit(); }; //---------------------------------------------------------------------------------- #endif //----------------------------------------------------------------------------------
41.642857
165
0.42024
df244737db1a279eb153ce1dfe17d469bea72c32
3,319
h
C
src/core/src/core/helper/variant.h
maoxiezhao/Cjing3D-Test
711667cc7a62fc5d07e7cedd6dfbc57c64bfbfa2
[ "MIT" ]
null
null
null
src/core/src/core/helper/variant.h
maoxiezhao/Cjing3D-Test
711667cc7a62fc5d07e7cedd6dfbc57c64bfbfa2
[ "MIT" ]
null
null
null
src/core/src/core/helper/variant.h
maoxiezhao/Cjing3D-Test
711667cc7a62fc5d07e7cedd6dfbc57c64bfbfa2
[ "MIT" ]
1
2022-03-06T14:43:51.000Z
2022-03-06T14:43:51.000Z
#pragma once #include "core\common\definitions.h" #include "core\helper\stringID.h" #include "core\string\string.h" #include "core\serialization\serializedObject.h" #include "math\maths.h" #include <variant> #include <type_traits> namespace Cjing3D { #define _VARIANT_TYPES \ std::monostate, \ char, \ unsigned char, \ int, \ unsigned int, \ bool, \ float, \ double, \ String, \ void*, \ I32x2, \ I32x3, \ I32x4 using VariantType = std::variant<_VARIANT_TYPES>; /** * \brief the class of Variant */ class Variant : public SerializedObject { public: Variant(){} template<typename T, typename = std::enable_if_t<!std::is_same<T, Variant>::value> > Variant(T value) { mVariant = value; mType = MappingType<T>(); } Variant(const Variant& var) { mVariant = var.GetVariant(); mType = var.GetType(); } Variant& operator=(const Variant& var) { mVariant = var.GetVariant(); mType = var.GetType(); return *this; } Variant(Variant&& var) = default; Variant& operator=(Variant&& var) = default; ~Variant() = default; const VariantType& GetVariant()const { return mVariant; } template <typename T> const T& GetValue()const { return std::get<T>(mVariant); } template <typename T> void SetValue(T&& value) { mVariant = value; } bool IsEmpty()const { return mType == TYPE_UNKNOW; } public: enum Type { TYPE_UNKNOW, TYPE_CHAR, TYPE_UNSIGNED_CHAR, TYPE_INT, TYPE_UNSIGNED_INT, TYPE_BOOL, TYPE_FLOAT, TYPE_DOUBLE, TYPE_STRING, TYPE_VOID_PTR, TYPE_I32X2, TYPE_I32X3, TYPE_I32X4 }; template <typename ResourceT> Type MappingType(); Type GetType()const { return mType; } // json serialize void Serialize(JsonArchive& archive)const override; void Unserialize(JsonArchive& archive)override; private: VariantType mVariant; Type mType = TYPE_UNKNOW; }; using VariantArray = std::vector<Variant>; using VariantMap = std::map<StringID, Variant>; //////////////////////////////////////////////////////////////////////// template<> inline Variant::Type Variant::MappingType<char>() { return TYPE_CHAR; } template<> inline Variant::Type Variant::MappingType<unsigned char>() { return TYPE_UNSIGNED_CHAR; } template<> inline Variant::Type Variant::MappingType<int>() { return TYPE_INT; } template<> inline Variant::Type Variant::MappingType<unsigned int>() { return TYPE_UNSIGNED_INT; } template<> inline Variant::Type Variant::MappingType<bool>() { return TYPE_BOOL; } template<> inline Variant::Type Variant::MappingType<float>() { return TYPE_FLOAT; } template<> inline Variant::Type Variant::MappingType<double>() { return TYPE_FLOAT; } template<> inline Variant::Type Variant::MappingType<String>() { return TYPE_STRING; } template<> inline Variant::Type Variant::MappingType<void*>() { return TYPE_VOID_PTR; } template<> inline Variant::Type Variant::MappingType<I32x2>() { return TYPE_I32X2; } template<> inline Variant::Type Variant::MappingType<I32x3>() { return TYPE_I32X3; } template<> inline Variant::Type Variant::MappingType<I32x4>() { return TYPE_I32X4; } }
19.074713
86
0.643869
8ab7bcf8bde9b01170022f1920f91d8c0cbc6583
1,799
h
C
src/app/face/AsyncWorker.h
sniperkit/snk.fork.drishti_hunter_test
106c4924930290928a0e350a9f8b54ea39a8c40d
[ "BSD-3-Clause" ]
1
2018-02-01T00:35:33.000Z
2018-02-01T00:35:33.000Z
src/app/face/AsyncWorker.h
sniperkit/snk.fork.drishti_hunter_test
106c4924930290928a0e350a9f8b54ea39a8c40d
[ "BSD-3-Clause" ]
4
2017-10-23T04:18:28.000Z
2017-10-26T18:38:47.000Z
src/app/face/AsyncWorker.h
sniperkit/snk.fork.drishti_hunter_test
106c4924930290928a0e350a9f8b54ea39a8c40d
[ "BSD-3-Clause" ]
1
2018-08-12T17:26:36.000Z
2018-08-12T17:26:36.000Z
/*! @file AsyncWorker @author David Hirvonen @brief Simple asynchronous worker (1 item job queue) \copyright Copyright 2018 Elucideye, Inc. All rights reserved. \license{This project is released under the 3 Clause BSD License.} */ #include <mutex> #include <condition_variable> #ifndef __AsyncWorker_h__ #define __AsyncWorker_h__ template <typename Callable> struct AsyncWorker { void loop() { while (running) { // Wait until main() sends data: std::unique_lock<std::mutex> lock(mutex); cv.wait(lock, [this] { return this->ready; }); // call the callback/lambda: action(); ready = false; processed = true; // Manual unlocking is done before notifying, to avoid waking up // the waiting thread only to block again (see notify_one for details): lock.unlock(); cv.notify_one(); } } void start() { worker = std::thread([&] { loop(); }); } void stop() { running = false; post([] {}); // post sentinel } void post(const Callable& callback) { action = callback; // send data to the worker thread: { std::lock_guard<std::mutex> lock(mutex); ready = true; } cv.notify_one(); // wait for the worker: { std::unique_lock<std::mutex> lock(mutex); cv.wait(lock, [this] { return this->processed; }); } } // Synchronization { std::mutex mutex; std::condition_variable cv; bool ready = false; bool processed = false; std::thread worker; Callable action; bool running = true; // } }; #endif // __AsyncWorker_h__
21.939024
83
0.553641
a860dc9fcdced72b3d9b0d210e0c3725fc0c7e1c
8,348
c
C
c07/ex04(ft_convert_base)/ft_convert_base.c
ShadowOfBeing/COMPLETED_PISCINE_C
5e518b135a694ffb850a8bf0af9a7c3637584b3a
[ "MIT" ]
180
2020-12-26T19:36:48.000Z
2022-03-31T02:49:42.000Z
c07/ex04(ft_convert_base)/ft_convert_base.c
HALIP192/COMPLETED_PISCINE_C
c4b9be847e55bb9611ef78b8a9a2acfcf3c828f3
[ "MIT" ]
5
2021-01-23T11:59:02.000Z
2022-03-20T16:36:56.000Z
c07/ex04(ft_convert_base)/ft_convert_base.c
HALIP192/COMPLETED_PISCINE_C
c4b9be847e55bb9611ef78b8a9a2acfcf3c828f3
[ "MIT" ]
83
2021-01-19T01:18:58.000Z
2022-03-20T20:48:39.000Z
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_convert_base.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: evgenkarlson <RTFM@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 12:33:14 by evgenkarlson #+# #+# */ /* Updated: 2021/02/16 23:38:04 by evgenkarlson ### ########.fr */ /* */ /* ************************************************************************** */ /* ************************************************************************** */ /* ************************************************************************** ** ** ** ** - Создать функцию, которая возвращает результат преобразования строки 'nbr' ** из базового типа 'base_from' в базовый тип 'base_to'. ** ** - 'nbr', 'base_from' и 'base_to' могут быть не доступен для записи. ** ** - 'nbr' будет следовать тем же правилам, что и 'ft_atoi_base' (из другого ** модуля). Остерегайтесь '+', '-' и пробелов. ** ** - Число, представленное 'nbr', должно уместиться внутри 'int'. ** ** - Если база, отражающая систему счисления, неверна, следует вернуть нулевой ** указатель(NULL). ** ** - Возвращаемое число может иметь знак минус '-' при необходимости, но оно не ** должно иметь никаких пробелов и никакого знака '+'. ** ** - Вот как функция должна быть обьявлена: ** ** char *ft_convert_base(char *nbr, char *base_from, char *base_to); ** ** ** ** ************************************************************************** ** ** ** Скомпилируй файл тест. В нем можно увидеть как работает эта функция вживую ** ** ************************************************************************** */ /* ************************************************************************** */ int ft_ctoi(char c) { if (c >= '0' && c <= '9') return (c - '0'); if (c >= 'A' && c <= 'F') return (c - 'A' + 10); if (c >= 'a' && c <= 'f') return (c - 'a' + 10); return (-1); } int ft_pow(int nb, int power) { int result; result = 1; if(power < 0) return (0); if(power == 0) return (1); while (power--) result *= nb; return (result); } int ft_check_base(char *base) { int i; int z; i = 0; if (!base || !base[1]) return (0); while (base[i]) { if (!((base[i] >= '0' && base[i] <= '9') || (base[i] >= 'a' \ && base[i] <= 'z') || (base[i] >= 'A' && base[i] <= 'Z'))) return (0); z = i + 1; while (base[z]) { if (base[i] >= base[z]) return (0); z++; } i++; } return (i); } int ft_atoi_base(char *str, char *base) { int num; int negative; int i; int pow; int base_type; negative = 1; i = 0; if((base_type = ft_check_base(base))) { if (*str == '-') { i++; negative = -1; } while (str[i]) i++; pow = 0; num = 0; while (--i >= 0) { if ((ft_ctoi(str[i]) != -1) && (ft_ctoi(str[i]) < base_type)) num += ft_ctoi(str[i]) * ft_pow(base_type, pow++); } return (num * negative); } return (0); } void *ft_itoa_base(int nbr, char *base) { int i; int j; int base_type; int n[16]; char *final; i = 0; if ((base_type = ft_check_base(base))) { if (nbr < 0) { nbr = -nbr; n[i] = '-'; i++; } while (nbr) { n[i] = nbr % base_type; nbr /= base_type; i++; } if ((final = malloc(sizeof(char) * (i + 1))) == ((void *)0)) return (((void *)0)); if ((n[0] == '-')) final[0] = n[0]; j = 1; while (i > 0) { --i; final[j] = base[n[i]]; j++; } final[j] = '\0'; } return (final); } char *ft_convert_base(char *nbr, char *base_from, char *base_to) { int dec; char *final; dec = ft_atoi_base(nbr, base_from); final = ft_itoa_base(dec, base_to); return (final); } /* ************************************************************************** */ /* ************************************************************************** */ int ft_ctoi(char c) { if (c >= '0' && c <= '9') return (c - '0'); if (c >= 'A' && c <= 'F') return (c - 'A' + 10); if (c >= 'a' && c <= 'f') return (c - 'a' + 10); return (-1); } int ft_pow(int nb, int power) { int result; result = 1; if(power < 0) return (0); if(power == 0) return (1); while (power--) result *= nb; return (result); } int ft_atoi_base(char *str, int base_type) { int num; int negative; int i; int pow; negative = 1; i = 0; if ((base_type >= 2)) { if (*str == '-') { i++; negative = -1; } while (str[i]) i++; pow = 0; num = 0; while (--i >= 0) { if ((ft_ctoi(str[i]) != -1) && (ft_ctoi(str[i]) < base_type)) { num += ft_ctoi(str[i]) * ft_pow(base_type, pow++); } } return (num * negative); } return (0); } char *ft_itoa_base(int nbr, int base_type) { int i; int j; char temp[16]; char *final; i = 0; if ((base_type >= 2)) { if (nbr < 0) { nbr = -nbr; temp[i] = '-'; i++; } while (nbr) { temp[i] = nbr % base_type; nbr /= base_type; i++; } if ((final = (char *)malloc(sizeof(char) * (i + 1))) == ((void *)0)) return (((void *)0)); if ((temp[0] == '-')) final[0] = temp[0]; j = 1; while (i > 1) { --i; if (temp[i] < 10) final[j] = temp[i] + '0'; if (temp[i] >= 10) final[j] = temp[i] - 10 + 'A'; /* ******************************************************************************** ** ** SHORT: final[j] = (temp[i] < 10) ? (temp[i] + '0') : (temp[i] - 10 + 'A'); ** ** ******************************************************************************** **/ j++; } final[j] = '\0'; } return (final); } int ft_check_base(char *base) { int i; int z; i = 0; if (!base || !base[1]) return (0); while (base[i]) { if (!((base[i] >= '0' && base[i] <= '9') || (base[i] >= 'a' \ && base[i] <= 'z') || (base[i] >= 'A' && base[i] <= 'Z'))) return (0); z = i + 1; while (base[z]) { if (base[i] == base[z]) return (0); z++; } i++; } return (i); } char *ft_convert_base(char *nbr, char *base_from, char *base_to) { int dec; char *final; dec = ft_atoi_base(nbr, ft_check_base(base_from)); final = ft_itoa_base(dec, ft_check_base(base_to)); return (final); } /* ************************************************************************** */ /* ************************************************************************** */ #include <stdlib.h> #include <stdio.h> int ft_strlen(char *str) { int i; i = 0; while (str[i]) i++; return (i); } int ft_power(int nb, int power) { int result; result = 1; if (power < 0) return (0); if (power == 0) return (result); while (power--) result *= nb; return (result); } int ft_convert_to_dec(char *str, int basesize, int len) { int total; int i; char ch; i = -1; ch = 0; total = 0; while (str[++i]) { ch = str[i]; if (str[i] >= 'A' && str[i] <= 'F') { ch = 10 + (ch - 'A'); total += ch * ft_power(basesize, len--); } if (str[i] >= 'a' && str[i] <= 'f') { ch = 10 + (ch - 'a'); total += ch * ft_power(basesize, len--); } else if (str[i] >= '0' && str[i] <= '9') { ch -= '0'; total += ch * ft_power(basesize, len--); } } return (total / basesize); } char *ft_convert_to_base(int nbr, int base_len, char *base_to, int sign) { int len; int tmp; char *result; len = 0; tmp = nbr; while (tmp) { tmp /= base_len; len++; } if (!(result = (char *)malloc(sizeof(char) * len))) return ((void *)0); result[len] = '\0'; while (nbr) { result[--len] = base_to[nbr % base_len]; nbr /= base_len; } result[0] = (sign == -1) ? '-' : result[0]; return (result); } char *ft_convert_base(char *nbr, char *base_from, char *base_to) { int len; int sign; len = ft_strlen(nbr); while (*nbr) { if (*nbr++ == '-') { len--; sign = -1; } } return (ft_convert_to_base(\ ft_get_dec(nbr, ft_strlen(base_from), len),\ ft_strlen(base_to),\ base_to,\ sign )); }
19.279446
87
0.413752
a3315db8a2e28456006bdf4eb1b1886c78c8cf46
6,954
c
C
app/websocket/websocket.c
fghjhuang/ESP8266_RTOS_SDK-master
97fb61b0640a4dfd62b4f8ba633b5baa78de3bb3
[ "BSD-3-Clause" ]
5
2017-11-23T15:40:50.000Z
2018-07-03T08:41:41.000Z
app/websocket/websocket.c
fghjhuang/ESP8266_RTOS_SDK-master
97fb61b0640a4dfd62b4f8ba633b5baa78de3bb3
[ "BSD-3-Clause" ]
null
null
null
app/websocket/websocket.c
fghjhuang/ESP8266_RTOS_SDK-master
97fb61b0640a4dfd62b4f8ba633b5baa78de3bb3
[ "BSD-3-Clause" ]
1
2021-03-16T03:45:18.000Z
2021-03-16T03:45:18.000Z
/* * LibNoPoll: A websocket library * Copyright (C) 2013 Advanced Software Production Line, S.L. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * * You may find a copy of the license under this software is released * at COPYING file. This is LGPL software: you are welcome to develop * proprietary applications using this library without any royalty or * fee but returning back any change, improvement or addition in the * form of source code, project image, documentation patches, etc. * * For commercial support on build Websocket enabled solutions * contact us: * * Postal address: * Advanced Software Production Line, S.L. * Edificio Alius A, Oficina 102, * C/ Antonio Suarez Nº 10, * Alcalá de Henares 28802 Madrid * Spain * * Email address: * info@aspl.es - http://www.aspl.es/nopoll */ #include <nopoll/nopoll.h> #include "ssl_compat-1.0.h" #include "esp_common.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "cJSON.h" //#define local_host_ip "192.168.88.236" #define hostip "192.168.88.236" #define local_host_url "ws://192.168.88.236:9054" #define local_host_port "9054" char local_host_ip[100]; noPollCtx * ctx; noPollConn * conn; int iter; nopoll_bool debug = nopoll_false; nopoll_bool show_critical_only = nopoll_false; LOCAL xQueueHandle Web_QueueStop = NULL; char *gethousedata="{\"type\":x0000,\"UserName\":\"xxxxxxxxx\",\"Password\":\"123123q\"}"; typedef struct { char *Password; char *UserName; int VMHomeId; int VMHomeName; char success; int type; } PERSON; //#define local_host_ports "9443" void __report_critical (noPollCtx * ctx, noPollDebugLevel level, const char * log_msg, noPollPtr user_data) { if (level == NOPOLL_LEVEL_CRITICAL) { printf ("CRITICAL: %s\n", log_msg); } return; } noPollCtx * create_ctx (void) { /* create a context */ noPollCtx * ctx = nopoll_ctx_new (); nopoll_log_enable (ctx, debug); nopoll_log_color_enable (ctx, debug); /* configure handler */ if (show_critical_only) nopoll_log_set_handler (ctx, __report_critical, NULL); return ctx; } void initConnection() { /* create context */ ctx = create_ctx(); /* check connections registered */ if (nopoll_ctx_conns(ctx) != 0) { printf( "ERROR: expected to find 0 registered connections but found: %d\n", nopoll_ctx_conns(ctx)); } /* end if */ nopoll_ctx_unref(ctx); /* reinit again */ ctx = create_ctx(); printf("connect to ip\r\n"); printf(local_host_ip); printf("\r\n"); printf("\r\n"); /* call to create a connection */ conn = nopoll_conn_new(ctx, local_host_ip, local_host_port, NULL, local_host_url, NULL, NULL); if (!nopoll_conn_is_ok(conn)) { printf( "ERROR: Expected to find proper client connection status, but found error.. (conn=%p, conn->session=%d, NOPOLL_INVALID_SOCKET=%d, errno=%d, strerr=%s)..\n", conn, (int) nopoll_conn_socket(conn), (int) NOPOLL_INVALID_SOCKET, errno, strerror(errno)); } } void ICACHE_FLASH_ATTR revData_task(void *pvParameters) { noPollMsg * msg; while (1) { iter = 0; while ((msg = nopoll_conn_get_msg(conn)) == NULL) { if (!nopoll_conn_is_ok(conn)) { printf( "ERROR: received websocket connection close during wait reply..\n"); } nopoll_sleep(10000); if (iter > 10) break; } printf("Recieve data:%s\n", (const char *) nopoll_msg_get_payload(msg)); cJSON*root=cJSON_Parse((char *) nopoll_msg_get_payload(msg)); cJSON*item=cJSON_GetObjectItem(root,"UserName"); printf(item->valuestring); printf("\r\n"); cJSON_Delete(root); nopoll_msg_unref(msg); } vTaskDelete(NULL); } nopoll_bool test_01 (void) { initConnection(); xTaskCreate(revData_task, "revData_task", 512, NULL, 2, NULL); printf ("Test 01: sending basic content..\n"); /* send content text(utf-8) */ if (nopoll_conn_send_text (conn, gethousedata,strlen(gethousedata)) != strlen(gethousedata)) { printf ("ERROR: Expected to find proper send operation..\n"); return nopoll_false; } vTaskDelay(2000 / portTICK_RATE_MS); return nopoll_true; } LOCAL int websocket_main (char *argv) { int iterator = *argv; printf("interator:%d\n",iterator); switch (iterator) { case 1: if (test_01()) { printf("Test 01: Simple request/reply [ OK ]\n"); } else { printf("Test 01: Simple request/reply [ FAILED ]\n"); } break; default: break; } /* call to cleanup */ nopoll_cleanup_library (); printf ("All tests ok!!\n"); return 0; } LOCAL void websocket_task(void *pvParameters) { bool ValueFromReceive = false; portBASE_TYPE xStatus; vTaskDelay(2000 / portTICK_RATE_MS); websocket_main((char*)pvParameters); while (1) { xStatus = xQueueReceive(Web_QueueStop,&ValueFromReceive,0); if (xStatus == pdPASS && ValueFromReceive == true){ printf("websocket_task exit signal\n"); /* finish connection */ nopoll_conn_close (conn); /* finish */ nopoll_ctx_unref (ctx); break; } /* send content text(utf-8) */ if (nopoll_conn_send_text (conn, gethousedata,strlen(gethousedata)) != strlen(gethousedata)) { printf ("ERROR: Expected to find proper send operation..\n"); } vTaskDelay(3000 / portTICK_RATE_MS); printf("websocket_task111\n"); } vQueueDelete(Web_QueueStop); Web_QueueStop = NULL; vTaskDelete(NULL); printf("delete the websocket_task\n"); } /*start the websocket task*/ void websocket_start(void *optarg,char *localip,unsigned char len) { //uint8 ip[len]; memcpy(local_host_ip,localip,len); //local_host_ip=localip; printf(local_host_ip); printf("\r\n"); printf("\r\n"); printf(hostip); printf("\r\n"); printf("\r\n"); if (Web_QueueStop == NULL){ Web_QueueStop = xQueueCreate(1,1); } if (Web_QueueStop != NULL){ xTaskCreate(websocket_task, "websocket_task", 2048, optarg, 2, NULL); } } /*stop the websocket task*/ sint8 websocket_stop(void) { bool ValueToSend = true; portBASE_TYPE xStatus; if (Web_QueueStop == NULL) return -1; xStatus = xQueueSend(Web_QueueStop,&ValueToSend,0); if (xStatus != pdPASS) return -1; else return pdPASS; } /* end-of-file-found */
27.058366
160
0.685936
0d284c3196fffb34709a3b5722467f29233751c8
752
c
C
nitan/d/kunlun/kekexili.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
1
2019-03-27T07:25:16.000Z
2019-03-27T07:25:16.000Z
nitan/d/kunlun/kekexili.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
nitan/d/kunlun/kekexili.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
// Room: /d/kunlun/kekexili.c // Last Modified by winder on Nov. 14 2000 #include <ansi.h> #include <room.h> inherit ROOM; void create() { set("short", "可可西里山"); set("long",@long 可可西里山又稱可可稀立山,蒙古語為“青山”的意思。西起木孜 塔格峯,東接巴顏喀拉山,山勢平緩,凍土廣佈,高處少永久性積雪與 冰川。除北側有淡水湖欽馬湖外,其餘南北星羅棋佈的湖泊均為鹹水湖。 草木稀疏,人煙極少。 long); set("exits",([ "east" : __DIR__"bayankala", "northwest" : __DIR__"shankou", "north" : __DIR__"xuedi", ])); set("objects",([ // "/d/mingjiao/npc/yinli" : 1, ])); set("outdoors", "kunlun"); set("coor/x", -100000); set("coor/y", 20000); set("coor/z", 30); setup(); replace_program(ROOM); }
24.258065
49
0.514628
070d343c010366380d718fab7888c867368655c4
1,284
h
C
PassKitUI.framework/PKAddressTextField.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
4
2021-10-06T12:15:26.000Z
2022-02-21T02:26:00.000Z
PassKitUI.framework/PKAddressTextField.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
null
null
null
PassKitUI.framework/PKAddressTextField.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
1
2021-10-08T07:40:53.000Z
2021-10-08T07:40:53.000Z
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/PassKitUI.framework/PassKitUI */ @interface PKAddressTextField : UITextField { <PKAddressTextFieldDelegate> * _addressDelegate; PKUniqueAddressField * _addressField; UIColor * _defaultColor; UIColor * _invalidColor; bool _isInvalid; long long _style; } @property (nonatomic) <PKAddressTextFieldDelegate> *addressDelegate; @property (nonatomic, retain) PKUniqueAddressField *addressField; @property (nonatomic, retain) UIColor *defaultColor; @property (nonatomic, retain) UIColor *invalidColor; @property (nonatomic, readonly) bool isInvalid; @property (nonatomic) long long style; - (void).cxx_destruct; - (id)addressDelegate; - (id)addressField; - (id)defaultColor; - (id)initWithFrame:(struct CGRect { struct CGPoint { double x_1_1_1; double x_1_1_2; } x1; struct CGSize { double x_2_1_1; double x_2_1_2; } x2; })arg1 style:(long long)arg2; - (void)insertTextSuggestion:(id)arg1; - (id)invalidColor; - (bool)isInvalid; - (void)setAddressDelegate:(id)arg1; - (void)setAddressField:(id)arg1; - (void)setDefaultColor:(id)arg1; - (void)setInvalidColor:(id)arg1; - (void)setIsInvalid:(bool)arg1 showErrorGlyph:(bool)arg2; - (void)setStyle:(long long)arg1; - (long long)style; @end
33.789474
175
0.754673
50735c74ffd4047455c70b19045cd8318996cdcc
377
h
C
Computer-Architecture/lab7/rtl/myCPU/mycpu.h
D-Hank/UCAS-CS
e2b8a214057e6a411e742a78a988b43a49c7741f
[ "MIT" ]
9
2020-12-02T05:42:03.000Z
2022-03-29T11:25:26.000Z
Computer-Architecture/lab7/rtl/myCPU/mycpu.h
Hambaobao/UCAS-CS
e2b8a214057e6a411e742a78a988b43a49c7741f
[ "MIT" ]
null
null
null
Computer-Architecture/lab7/rtl/myCPU/mycpu.h
Hambaobao/UCAS-CS
e2b8a214057e6a411e742a78a988b43a49c7741f
[ "MIT" ]
4
2021-03-27T04:02:55.000Z
2022-01-26T06:35:22.000Z
`ifndef MYCPU_H `define MYCPU_H `define BR_BUS_WD 33 `define FS_TO_DS_BUS_WD 64 // `define DS_TO_ES_BUS_WD 137 `define DS_TO_ES_BUS_WD 155 `define ES_TO_MS_BUS_WD 109 `define MS_TO_WS_BUS_WD 70 `define WS_TO_RF_BUS_WD 38 `define NO_DEST 0 `define DO_DEST 1 `define NO_SRC 0 `define DO_SRC 1 `endif
17.952381
33
0.644562
a1ff64daa7e2dd88ec2893711cc39dd77b330165
851
h
C
include/clock.h
GreenDjango/sprite-coder
a0be3af70dc44ff901217a5c1bd19ff249d27d98
[ "MIT" ]
null
null
null
include/clock.h
GreenDjango/sprite-coder
a0be3af70dc44ff901217a5c1bd19ff249d27d98
[ "MIT" ]
2
2019-11-18T18:49:42.000Z
2019-11-21T10:44:33.000Z
include/clock.h
GreenDjango/sprite-coder
a0be3af70dc44ff901217a5c1bd19ff249d27d98
[ "MIT" ]
null
null
null
#ifndef __CLOCK_H__ # define __CLOCK_H__ #include <stddef.h> #include <stdint.h> // Clock library specifique informations. #if defined(GLIB_CSFML) // Include all CSFML specific header. #include <SFML/System.h> #else #error "No clock library specified" #endif // Internal parameter. #ifndef CLOCK_STACK_SIZE #define CLOCK_STACK_SIZE (4) #endif // Define internal clock data structure. struct clock_info_s { void (*callback)(volatile void *arg); volatile void *arg; uint32_t timeout; void *private; }; // Constructor / destructor. extern int clock_initialize(void); extern void clock_fini(void); // General abstractions extern int clock_create(uint32_t timeout, void *callback, void *arg); extern uint32_t clock_getTime(int clock_id); extern int clock_restart(int clock_id); extern int clock_destroy(int clock_id); #endif /*__CLOCK_H__*/
21.275
69
0.766157
de3b3048367e14afc1e81cbcba134eb2e3692837
2,056
h
C
frameworks/core/components/svg/svg_line_component.h
chaoyangcui/ace_ace_engine
05ebe2d6d2674777f5dc64fd735088dcf1a42cd9
[ "Apache-2.0" ]
null
null
null
frameworks/core/components/svg/svg_line_component.h
chaoyangcui/ace_ace_engine
05ebe2d6d2674777f5dc64fd735088dcf1a42cd9
[ "Apache-2.0" ]
null
null
null
frameworks/core/components/svg/svg_line_component.h
chaoyangcui/ace_ace_engine
05ebe2d6d2674777f5dc64fd735088dcf1a42cd9
[ "Apache-2.0" ]
1
2021-09-13T12:07:42.000Z
2021-09-13T12:07:42.000Z
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SVG_SVG_LINE_COMPONENT_H #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SVG_SVG_LINE_COMPONENT_H #include "frameworks/core/components/svg/svg_sharp.h" #include "frameworks/core/pipeline/base/component_group.h" namespace OHOS::Ace { class SvgLineComponent : public ComponentGroup, public SvgSharp { DECLARE_ACE_TYPE(SvgLineComponent, ComponentGroup, SvgSharp); public: SvgLineComponent() = default; explicit SvgLineComponent(const std::list<RefPtr<Component>>& children) : ComponentGroup(children) {}; ~SvgLineComponent() override = default; RefPtr<RenderNode> CreateRenderNode() override; RefPtr<Element> CreateElement() override; void SetX1(const Dimension& x1) { x1_ = x1; } void SetX2(const Dimension& x2) { x2_ = x2; } void SetY1(const Dimension& y1) { y1_ = y1; } void SetY2(const Dimension& y2) { y2_ = y2; } const Dimension& GetX1() const { return x1_; } const Dimension& GetX2() const { return x2_; } const Dimension& GetY1() const { return y1_; } const Dimension& GetY2() const { return y2_; } private: Dimension x1_; Dimension y1_; Dimension x2_; Dimension y2_; }; } // namespace OHOS::Ace #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SVG_SVG_LINE_COMPONENT_H
23.906977
106
0.689689
9401b57ba14774f3a631a4ef9173290cf0d6dd69
1,239
h
C
TokenChest/include.h
tokenok/tokenchest
7da55833314dd5935f1176426095fa6ba9a028b8
[ "Apache-2.0" ]
3
2018-04-26T08:58:20.000Z
2021-10-10T01:11:15.000Z
TokenChest/include.h
tokenok/tokenchest
7da55833314dd5935f1176426095fa6ba9a028b8
[ "Apache-2.0" ]
null
null
null
TokenChest/include.h
tokenok/tokenchest
7da55833314dd5935f1176426095fa6ba9a028b8
[ "Apache-2.0" ]
2
2017-11-11T18:11:25.000Z
2018-04-01T13:21:02.000Z
#pragma once #include <Windows.h> #include <string> #include <map> #include "d2data.h" #include "tabcontrolhandler.h" #pragma warning(disable: 4503) const TCHAR className[] = TEXT("TokenChest"); BOOL CALLBACK FinderDialogProc(HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK TabPage1Proc(HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK TabPage2Proc(HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK TabPage3Proc(HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK TradeTabPage1Proc(HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK TradeTabPage2Proc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK kbhookProc(int, WPARAM, LPARAM); extern HINSTANCE g_hInst; extern HHOOK kbhook; extern TabClass g_TAB; extern TabClass g_Tradetab; extern HWND g_finder; extern HWND g_ttab3; extern HWND g_ttab3_1; extern int g_is_auto_log; extern BOOL g_use_cust_color; extern const COLORREF g_cust_color; extern HBRUSH g_h_cust_color; extern HFONT g_boldfont; extern std::vector<ItemCode> g_itemcodes; extern std::vector<CharacterData> g_characters; extern std::map<std::string, std::map<std::string, std::map<std::string, std::map<std::string, std::vector<ItemData*>>>>> g_realms; void write_itemcodes(std::vector<ItemCode> &itemcodes); void ShowStatus(std::string status);
24.78
131
0.77724
940c7eaadf5928c90953887d5d513dd4c78e83d6
1,989
h
C
Core/Transform.h
zemo/naali
a02ee7a0547c5233579eda85dedb934b61c546ab
[ "Apache-2.0" ]
null
null
null
Core/Transform.h
zemo/naali
a02ee7a0547c5233579eda85dedb934b61c546ab
[ "Apache-2.0" ]
null
null
null
Core/Transform.h
zemo/naali
a02ee7a0547c5233579eda85dedb934b61c546ab
[ "Apache-2.0" ]
1
2021-09-04T12:37:34.000Z
2021-09-04T12:37:34.000Z
#ifndef incl_Core_CTransform_h #define incl_Core_CTransform_h #include "CoreMath.h" #include "Vector3D.h" #include "Matrix4.h" #include <QMetaType> struct Transform { Vector3df position; Vector3df rotation; Vector3df scale; Transform(): position(0,0,0), rotation(0,0,0), scale(1,1,1) { } Transform(const Vector3df &pos, const Vector3df &rot, const Vector3df &scale): position(pos), rotation(rot), scale(scale) { } void SetPos(float x, float y, float z) { position.x = x; position.y = y; position.z = z; } void SetRot(float x, float y, float z) { rotation.x = x; rotation.y = y; rotation.z = z; } //! Set scale. Note! scale cannot contain zero value. void SetScale(float x, float y, float z) { scale.x = x; scale.y = y; scale.z = z; } /// Converts this Transform object to a Matrix4 that represents the same Transform. The order of operations is 1. Scale 2. Rotate 3. Translate. void ToMatrix4(Matrix4 &dst) const { ///\todo Our Matrix4 class is bad and should be removed, since it uses D3D (v*M) convention. /// This itself is not "bad", but what's bad is that all the rest of our system uses the (M*v) convention. Matrix4 translate; translate.makeIdentity(); translate.setTranslation(position); Matrix4 rotate; rotate.setRotationDegrees(rotation); Matrix4 scaleMat; scaleMat.makeIdentity(); scaleMat.setScale(scale); dst = scaleMat * rotate * translate; } bool operator == (const Transform& rhs) const { return (position == rhs.position) && (rotation == rhs.rotation) && (scale == rhs.scale); } bool operator != (const Transform& rhs) const { return !(*this == rhs); } }; Q_DECLARE_METATYPE(Transform) #endif
23.678571
147
0.587733
0c65a28883eac3282bfecf020c47896d8a4da9bd
6,696
c
C
sys/kern/kern_fork.c
weiss/original-bsd
b44636d7febc9dcf553118bd320571864188351d
[ "Unlicense" ]
114
2015-01-18T22:55:52.000Z
2022-02-17T10:45:02.000Z
sys/kern/kern_fork.c
JamesLinus/original-bsd
b44636d7febc9dcf553118bd320571864188351d
[ "Unlicense" ]
null
null
null
sys/kern/kern_fork.c
JamesLinus/original-bsd
b44636d7febc9dcf553118bd320571864188351d
[ "Unlicense" ]
29
2015-11-03T22:05:22.000Z
2022-02-08T15:36:37.000Z
/* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * %sccs.include.redist.c% * * @(#)kern_fork.c 8.8 (Berkeley) 02/14/95 */ #include <sys/param.h> #include <sys/systm.h> #include <sys/map.h> #include <sys/filedesc.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/proc.h> #include <sys/resourcevar.h> #include <sys/vnode.h> #include <sys/file.h> #include <sys/acct.h> #include <sys/ktrace.h> /* ARGSUSED */ fork(p, uap, retval) struct proc *p; void *uap; register_t *retval; { return (fork1(p, 0, retval)); } /* ARGSUSED */ vfork(p, uap, retval) struct proc *p; void *uap; register_t *retval; { return (fork1(p, 1, retval)); } int nprocs = 1; /* process 0 */ fork1(p1, isvfork, retval) register struct proc *p1; int isvfork; register_t *retval; { register struct proc *p2; register uid_t uid; struct proc *newproc; struct proc **hash; int count; static int nextpid, pidchecked = 0; /* * Although process entries are dynamically created, we still keep * a global limit on the maximum number we will create. Don't allow * a nonprivileged user to use the last process; don't let root * exceed the limit. The variable nprocs is the current number of * processes, maxproc is the limit. */ uid = p1->p_cred->p_ruid; if ((nprocs >= maxproc - 1 && uid != 0) || nprocs >= maxproc) { tablefull("proc"); return (EAGAIN); } /* * Increment the count of procs running with this uid. Don't allow * a nonprivileged user to exceed their current limit. */ count = chgproccnt(uid, 1); if (uid != 0 && count > p1->p_rlimit[RLIMIT_NPROC].rlim_cur) { (void)chgproccnt(uid, -1); return (EAGAIN); } /* Allocate new proc. */ MALLOC(newproc, struct proc *, sizeof(struct proc), M_PROC, M_WAITOK); /* * Find an unused process ID. We remember a range of unused IDs * ready to use (from nextpid+1 through pidchecked-1). */ nextpid++; retry: /* * If the process ID prototype has wrapped around, * restart somewhat above 0, as the low-numbered procs * tend to include daemons that don't exit. */ if (nextpid >= PID_MAX) { nextpid = 100; pidchecked = 0; } if (nextpid >= pidchecked) { int doingzomb = 0; pidchecked = PID_MAX; /* * Scan the active and zombie procs to check whether this pid * is in use. Remember the lowest pid that's greater * than nextpid, so we can avoid checking for a while. */ p2 = allproc.lh_first; again: for (; p2 != 0; p2 = p2->p_list.le_next) { while (p2->p_pid == nextpid || p2->p_pgrp->pg_id == nextpid) { nextpid++; if (nextpid >= pidchecked) goto retry; } if (p2->p_pid > nextpid && pidchecked > p2->p_pid) pidchecked = p2->p_pid; if (p2->p_pgrp->pg_id > nextpid && pidchecked > p2->p_pgrp->pg_id) pidchecked = p2->p_pgrp->pg_id; } if (!doingzomb) { doingzomb = 1; p2 = zombproc.lh_first; goto again; } } nprocs++; p2 = newproc; p2->p_stat = SIDL; /* protect against others */ p2->p_pid = nextpid; LIST_INSERT_HEAD(&allproc, p2, p_list); p2->p_forw = p2->p_back = NULL; /* shouldn't be necessary */ LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); /* * Make a proc table entry for the new process. * Start by zeroing the section of proc that is zero-initialized, * then copy the section that is copied directly from the parent. */ bzero(&p2->p_startzero, (unsigned) ((caddr_t)&p2->p_endzero - (caddr_t)&p2->p_startzero)); bcopy(&p1->p_startcopy, &p2->p_startcopy, (unsigned) ((caddr_t)&p2->p_endcopy - (caddr_t)&p2->p_startcopy)); /* * Duplicate sub-structures as needed. * Increase reference counts on shared objects. * The p_stats and p_sigacts substructs are set in vm_fork. */ p2->p_flag = P_INMEM; if (p1->p_flag & P_PROFIL) startprofclock(p2); MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred), M_SUBPROC, M_WAITOK); bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred)); p2->p_cred->p_refcnt = 1; crhold(p1->p_ucred); /* bump references to the text vnode (for procfs) */ p2->p_textvp = p1->p_textvp; if (p2->p_textvp) VREF(p2->p_textvp); p2->p_fd = fdcopy(p1); /* * If p_limit is still copy-on-write, bump refcnt, * otherwise get a copy that won't be modified. * (If PL_SHAREMOD is clear, the structure is shared * copy-on-write.) */ if (p1->p_limit->p_lflags & PL_SHAREMOD) p2->p_limit = limcopy(p1->p_limit); else { p2->p_limit = p1->p_limit; p2->p_limit->p_refcnt++; } if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT) p2->p_flag |= P_CONTROLT; if (isvfork) p2->p_flag |= P_PPWAIT; LIST_INSERT_AFTER(p1, p2, p_pglist); p2->p_pptr = p1; LIST_INSERT_HEAD(&p1->p_children, p2, p_sibling); LIST_INIT(&p2->p_children); #ifdef KTRACE /* * Copy traceflag and tracefile if enabled. * If not inherited, these were zeroed above. */ if (p1->p_traceflag&KTRFAC_INHERIT) { p2->p_traceflag = p1->p_traceflag; if ((p2->p_tracep = p1->p_tracep) != NULL) VREF(p2->p_tracep); } #endif /* * This begins the section where we must prevent the parent * from being swapped. */ p1->p_flag |= P_NOSWAP; /* * Set return values for child before vm_fork, * so they can be copied to child stack. * We return parent pid, and mark as child in retval[1]. * NOTE: the kernel stack may be at a different location in the child * process, and thus addresses of automatic variables (including retval) * may be invalid after vm_fork returns in the child process. */ retval[0] = p1->p_pid; retval[1] = 1; if (vm_fork(p1, p2, isvfork)) { /* * Child process. Set start time and get to work. */ (void) splclock(); p2->p_stats->p_start = time; (void) spl0(); p2->p_acflag = AFORK; return (0); } /* * Make child runnable and add to run queue. */ (void) splhigh(); p2->p_stat = SRUN; setrunqueue(p2); (void) spl0(); /* * Now can be swapped. */ p1->p_flag &= ~P_NOSWAP; /* * Preserve synchronization semantics of vfork. If waiting for * child to exec or exit, set P_PPWAIT on child, and sleep on our * proc (in case of exit). */ if (isvfork) while (p2->p_flag & P_PPWAIT) tsleep(p1, PWAIT, "ppwait", 0); /* * Return child pid to parent process, * marking us as parent via retval[1]. */ retval[0] = p2->p_pid; retval[1] = 0; return (0); }
25.557252
73
0.660544
40d29a3d659827655c3f1a977ad24f51a2712be3
3,120
h
C
examples/amr-merge-tree/include/fab-block.h
skn123/reeber
7fe16b6addef2c7b2289a40afa0064d9299fcc5e
[ "BSD-3-Clause-LBNL" ]
4
2020-07-08T03:39:37.000Z
2021-04-30T18:20:39.000Z
examples/amr-merge-tree/include/fab-block.h
skn123/reeber
7fe16b6addef2c7b2289a40afa0064d9299fcc5e
[ "BSD-3-Clause-LBNL" ]
1
2020-08-28T16:51:53.000Z
2020-09-01T02:12:34.000Z
examples/amr-merge-tree/include/fab-block.h
skn123/reeber
7fe16b6addef2c7b2289a40afa0064d9299fcc5e
[ "BSD-3-Clause-LBNL" ]
3
2020-07-22T23:24:11.000Z
2020-08-28T16:27:39.000Z
#pragma once #include <diy/serialization.hpp> #include <diy/grid.hpp> #include <diy/vertices.hpp> #include <reeber/format.h> #include <reeber/amr_helper.h> template<class T, unsigned D> struct FabBlock { using Shape = diy::Point<int, D>; using Vertex = diy::Point<int, D>; using Grid = diy::Grid<T, D>; using GridRef = diy::GridRef<T, D>; FabBlock() : fab(fab_storage_.data(), fab_storage_.shape(), fab_storage_.c_order()) { } FabBlock(T* data, const Shape& shape) : fab(data, shape, /* c_order = */ false) { } FabBlock(T* data, const std::vector<std::string>& extra_names, const std::vector<T*>& extra_data, const Shape& shape) : fab(data, shape, /* c_order = */ false), extra_names_(extra_names) { for(T* extra_ptr : extra_data) { extra_fabs_.emplace_back(extra_ptr, shape, false); } } ~FabBlock() { for (auto& fab : extra_fabs_) delete[] fab.data(); if (fab.data() != fab_storage_.data()) delete[] fab.data(); } static void* create() { return new FabBlock; } static void destroy(void* b) { delete static_cast<FabBlock*>(b); } static void save(const void* b_, diy::BinaryBuffer& bb); static void load(void* b_, diy::BinaryBuffer& bb); int level_ { -1 }; diy::Grid<T, D> fab_storage_; // container, in case we own the data diy::GridRef<T, D> fab; std::vector<std::string> extra_names_; // vector of names additional components std::vector<diy::GridRef<T, D>> extra_fabs_; // vector of additional components' data }; template<class T, unsigned D> void FabBlock<T, D>::save(const void* b_, diy::BinaryBuffer& bb) { auto* b = static_cast<const FabBlock<T, D>*>(b_); diy::save(bb, b->fab.shape()); diy::save(bb, b->fab.c_order()); diy::save(bb, b->fab.data(), b->fab.size()); } template<class T, unsigned D> void FabBlock<T, D>::load(void* b_, diy::BinaryBuffer& bb) { auto* b = static_cast<FabBlock<T, D>*>(b_); Shape shape; bool c_order; diy::load(bb, shape); diy::load(bb, c_order); b->fab_storage_ = decltype(b->fab_storage_)(shape, c_order); diy::load(bb, b->fab_storage_.data(), b->fab_storage_.size()); b->fab = decltype(b->fab)(b->fab_storage_.data(), shape, c_order); // fab points to the data in fab_storage_ } template<class T, unsigned D> void change_to_c_order(FabBlock<T, D>* b) { using Block = FabBlock<T, D>; using Vertex = typename Block::Vertex; using Grid = typename Block::Grid; if (b->fab_storage_.c_order()) return; Grid tmp_grid(b->fab_storage_.shape(), true); diy::for_each(b->fab_storage_.shape(), [&](const Vertex v) { tmp_grid(v) = b->fab(v); }); b->fab_storage_.swap(tmp_grid); assert(b->fab_storage_.c_order()); b->fab = decltype(b->fab)(b->fab_storage_.data(), b->fab_storage_.shape(), b->fab_storage_.c_order()); // fab points to the data in fab_storage_ }
25.365854
123
0.6
40e1dafa4bed2a218aea75c8a753ea5ab1142fb9
12,197
h
C
vendor/libhydrogen/impl/x25519.h
minond/ffi-hydrogen
258e4a9cbb01e9fe999892c8d88247ff2a5847e6
[ "MIT" ]
1
2019-07-25T17:25:46.000Z
2019-07-25T17:25:46.000Z
vendor/libhydrogen/impl/x25519.h
minond/ffi-hydrogen
258e4a9cbb01e9fe999892c8d88247ff2a5847e6
[ "MIT" ]
null
null
null
vendor/libhydrogen/impl/x25519.h
minond/ffi-hydrogen
258e4a9cbb01e9fe999892c8d88247ff2a5847e6
[ "MIT" ]
null
null
null
/* * Based on Michael Hamburg's STROBE reference implementation. * Copyright (c) 2015-2016 Cryptography Research, Inc. * MIT License (MIT) */ #if defined(__GNUC__) && defined(__SIZEOF_INT128__) # define hydro_x25519_WBITS 64 #else # define hydro_x25519_WBITS 32 #endif #if hydro_x25519_WBITS == 64 typedef uint64_t hydro_x25519_limb_t; typedef __uint128_t hydro_x25519_dlimb_t; typedef __int128_t hydro_x25519_sdlimb_t; # define hydro_x25519_eswap_limb(X) LOAD64_LE((const uint8_t *) &(X)) # define hydro_x25519_LIMB(x) x##ull #elif hydro_x25519_WBITS == 32 typedef uint32_t hydro_x25519_limb_t; typedef uint64_t hydro_x25519_dlimb_t; typedef int64_t hydro_x25519_sdlimb_t; # define hydro_x25519_eswap_limb(X) LOAD32_LE((const uint8_t *) &(X)) # define hydro_x25519_LIMB(x) (uint32_t)(x##ull), (uint32_t)((x##ull) >> 32) #else # error "Need to know hydro_x25519_WBITS" #endif #define hydro_x25519_NLIMBS (256 / hydro_x25519_WBITS) typedef hydro_x25519_limb_t hydro_x25519_fe[hydro_x25519_NLIMBS]; typedef hydro_x25519_limb_t hydro_x25519_scalar_t[hydro_x25519_NLIMBS]; static const hydro_x25519_limb_t hydro_x25519_MONTGOMERY_FACTOR = (hydro_x25519_limb_t) 0xd2b51da312547e1bull; static const hydro_x25519_scalar_t hydro_x25519_sc_p = { hydro_x25519_LIMB(0x5812631a5cf5d3ed), hydro_x25519_LIMB(0x14def9dea2f79cd6), hydro_x25519_LIMB(0x0000000000000000), hydro_x25519_LIMB(0x1000000000000000) }; static const hydro_x25519_scalar_t hydro_x25519_sc_r2 = { hydro_x25519_LIMB(0xa40611e3449c0f01), hydro_x25519_LIMB(0xd00e1ba768859347), hydro_x25519_LIMB(0xceec73d217f5be65), hydro_x25519_LIMB(0x0399411b7c309a3d) }; static const uint8_t hydro_x25519_BASE_POINT[hydro_x25519_BYTES] = { 9 }; static const hydro_x25519_limb_t hydro_x25519_a24[1] = { 121665 }; static inline hydro_x25519_limb_t hydro_x25519_umaal(hydro_x25519_limb_t *carry, hydro_x25519_limb_t acc, hydro_x25519_limb_t mand, hydro_x25519_limb_t mier) { hydro_x25519_dlimb_t tmp = (hydro_x25519_dlimb_t) mand * mier + acc + *carry; *carry = tmp >> hydro_x25519_WBITS; return (hydro_x25519_limb_t) tmp; } static inline hydro_x25519_limb_t hydro_x25519_adc(hydro_x25519_limb_t *carry, hydro_x25519_limb_t acc, hydro_x25519_limb_t mand) { hydro_x25519_dlimb_t total = (hydro_x25519_dlimb_t) *carry + acc + mand; *carry = total >> hydro_x25519_WBITS; return (hydro_x25519_limb_t) total; } static inline hydro_x25519_limb_t hydro_x25519_adc0(hydro_x25519_limb_t *carry, hydro_x25519_limb_t acc) { hydro_x25519_dlimb_t total = (hydro_x25519_dlimb_t) *carry + acc; *carry = total >> hydro_x25519_WBITS; return (hydro_x25519_limb_t) total; } static void hydro_x25519_propagate(hydro_x25519_fe x, hydro_x25519_limb_t over) { hydro_x25519_limb_t carry; int i; over = x[hydro_x25519_NLIMBS - 1] >> (hydro_x25519_WBITS - 1) | over << 1; x[hydro_x25519_NLIMBS - 1] &= ~((hydro_x25519_limb_t) 1 << (hydro_x25519_WBITS - 1)); carry = over * 19; for (i = 0; i < hydro_x25519_NLIMBS; i++) { x[i] = hydro_x25519_adc0(&carry, x[i]); } } static void hydro_x25519_add(hydro_x25519_fe out, const hydro_x25519_fe a, const hydro_x25519_fe b) { hydro_x25519_limb_t carry = 0; int i; for (i = 0; i < hydro_x25519_NLIMBS; i++) { out[i] = hydro_x25519_adc(&carry, a[i], b[i]); } hydro_x25519_propagate(out, carry); } static void hydro_x25519_sub(hydro_x25519_fe out, const hydro_x25519_fe a, const hydro_x25519_fe b) { hydro_x25519_sdlimb_t carry = -38; int i; for (i = 0; i < hydro_x25519_NLIMBS; i++) { out[i] = carry = carry + a[i] - b[i]; carry >>= hydro_x25519_WBITS; } hydro_x25519_propagate(out, 1 + carry); } static void hydro_x25519_swapin(hydro_x25519_limb_t *x, const uint8_t *in) { int i; memcpy(x, in, sizeof(hydro_x25519_fe)); for (i = 0; i < hydro_x25519_NLIMBS; i++) { x[i] = hydro_x25519_eswap_limb(x[i]); } } static void hydro_x25519_swapout(uint8_t *out, hydro_x25519_limb_t *x) { int i; for (i = 0; i < hydro_x25519_NLIMBS; i++) { x[i] = hydro_x25519_eswap_limb(x[i]); } memcpy(out, x, sizeof(hydro_x25519_fe)); } static void hydro_x25519_mul(hydro_x25519_fe out, const hydro_x25519_fe a, const hydro_x25519_fe b, int nb) { hydro_x25519_limb_t accum[2 * hydro_x25519_NLIMBS] = { 0 }; hydro_x25519_limb_t carry2; int i, j; for (i = 0; i < nb; i++) { carry2 = 0; hydro_x25519_limb_t mand = b[i]; for (j = 0; j < hydro_x25519_NLIMBS; j++) { accum[i + j] = hydro_x25519_umaal(&carry2, accum[i + j], mand, a[j]); } accum[i + j] = carry2; } carry2 = 0; for (j = 0; j < hydro_x25519_NLIMBS; j++) { const hydro_x25519_limb_t mand = 38; out[j] = hydro_x25519_umaal(&carry2, accum[j], mand, accum[j + hydro_x25519_NLIMBS]); } hydro_x25519_propagate(out, carry2); } static void hydro_x25519_sqr(hydro_x25519_fe out, const hydro_x25519_fe a) { hydro_x25519_mul(out, a, a, hydro_x25519_NLIMBS); } static void hydro_x25519_mul1(hydro_x25519_fe out, const hydro_x25519_fe a) { hydro_x25519_mul(out, a, out, hydro_x25519_NLIMBS); } static void hydro_x25519_sqr1(hydro_x25519_fe a) { hydro_x25519_mul1(a, a); } static void hydro_x25519_condswap(hydro_x25519_limb_t a[2 * hydro_x25519_NLIMBS], hydro_x25519_limb_t b[2 * hydro_x25519_NLIMBS], hydro_x25519_limb_t doswap) { int i; for (i = 0; i < 2 * hydro_x25519_NLIMBS; i++) { hydro_x25519_limb_t xorv = (a[i] ^ b[i]) & doswap; a[i] ^= xorv; b[i] ^= xorv; } } static int hydro_x25519_canon(hydro_x25519_fe x) { hydro_x25519_sdlimb_t carry; hydro_x25519_limb_t carry0 = 19; hydro_x25519_limb_t res; int i; for (i = 0; i < hydro_x25519_NLIMBS; i++) { x[i] = hydro_x25519_adc0(&carry0, x[i]); } hydro_x25519_propagate(x, carry0); carry = -19; res = 0; for (i = 0; i < hydro_x25519_NLIMBS; i++) { res |= x[i] = carry += x[i]; carry >>= hydro_x25519_WBITS; } return ((hydro_x25519_dlimb_t) res - 1) >> hydro_x25519_WBITS; } static void hydro_x25519_ladder_part1(hydro_x25519_fe xs[5]) { hydro_x25519_limb_t *x2 = xs[0], *z2 = xs[1], *x3 = xs[2], *z3 = xs[3], *t1 = xs[4]; hydro_x25519_add(t1, x2, z2); // t1 = A hydro_x25519_sub(z2, x2, z2); // z2 = B hydro_x25519_add(x2, x3, z3); // x2 = C hydro_x25519_sub(z3, x3, z3); // z3 = D hydro_x25519_mul1(z3, t1); // z3 = DA hydro_x25519_mul1(x2, z2); // x3 = BC hydro_x25519_add(x3, z3, x2); // x3 = DA+CB hydro_x25519_sub(z3, z3, x2); // z3 = DA-CB hydro_x25519_sqr1(t1); // t1 = AA hydro_x25519_sqr1(z2); // z2 = BB hydro_x25519_sub(x2, t1, z2); // x2 = E = AA-BB hydro_x25519_mul(z2, x2, hydro_x25519_a24, // z2 = E*a24 sizeof(hydro_x25519_a24) / sizeof(hydro_x25519_a24[0])); hydro_x25519_add(z2, z2, t1); // z2 = E*a24 + AA } static void hydro_x25519_ladder_part2(hydro_x25519_fe xs[5], const hydro_x25519_fe x1) { hydro_x25519_limb_t *x2 = xs[0], *z2 = xs[1], *x3 = xs[2], *z3 = xs[3], *t1 = xs[4]; hydro_x25519_sqr1(z3); // z3 = (DA-CB)^2 hydro_x25519_mul1(z3, x1); // z3 = x1 * (DA-CB)^2 hydro_x25519_sqr1(x3); // x3 = (DA+CB)^2 hydro_x25519_mul1(z2, x2); // z2 = AA*(E*a24+AA) hydro_x25519_sub(x2, t1, x2); // x2 = BB again hydro_x25519_mul1(x2, t1); // x2 = AA*BB } static void hydro_x25519_core(hydro_x25519_fe xs[5], const uint8_t scalar[hydro_x25519_BYTES], const uint8_t *x1, bool clamp) { hydro_x25519_limb_t swap; hydro_x25519_limb_t *x2 = xs[0], *x3 = xs[2], *z3 = xs[3]; hydro_x25519_fe x1i; int i; hydro_x25519_swapin(x1i, x1); x1 = (const uint8_t *) x1i; swap = 0; mem_zero(xs, 4 * sizeof(hydro_x25519_fe)); x2[0] = z3[0] = 1; memcpy(x3, x1, sizeof(hydro_x25519_fe)); for (i = 255; i >= 0; i--) { uint8_t bytei = scalar[i / 8]; hydro_x25519_limb_t doswap; hydro_x25519_fe x1_dup; if (clamp) { if (i / 8 == 0) { bytei &= ~7; } else if (i / 8 == hydro_x25519_BYTES - 1) { bytei &= 0x7F; bytei |= 0x40; } } doswap = 1U + ~(hydro_x25519_limb_t)((bytei >> (i % 8)) & 1); hydro_x25519_condswap(x2, x3, swap ^ doswap); swap = doswap; hydro_x25519_ladder_part1(xs); memcpy(x1_dup, x1, sizeof x1_dup); hydro_x25519_ladder_part2(xs, x1_dup); } hydro_x25519_condswap(x2, x3, swap); } static int hydro_x25519_scalarmult(uint8_t out[hydro_x25519_BYTES], const uint8_t scalar[hydro_x25519_BYTES], const uint8_t x1[hydro_x25519_BYTES], bool clamp) { hydro_x25519_fe xs[5]; hydro_x25519_limb_t *x2, *z2, *z3; hydro_x25519_limb_t *prev; int i; int ret; hydro_x25519_core(xs, scalar, x1, clamp); /* Precomputed inversion chain */ x2 = xs[0]; z2 = xs[1]; z3 = xs[3]; prev = z2; /* Raise to the p-2 = 0x7f..ffeb */ for (i = 253; i >= 0; i--) { hydro_x25519_sqr(z3, prev); prev = z3; if (i >= 8 || (0xeb >> i & 1)) { hydro_x25519_mul1(z3, z2); } } /* Here prev = z3 */ /* x2 /= z2 */ hydro_x25519_mul1(x2, z3); ret = hydro_x25519_canon(x2); hydro_x25519_swapout(out, x2); if (clamp == 0) { return 0; } return ret; } static inline int hydro_x25519_scalarmult_base(uint8_t pk[hydro_x25519_PUBLICKEYBYTES], const uint8_t sk[hydro_x25519_SECRETKEYBYTES]) { return hydro_x25519_scalarmult(pk, sk, hydro_x25519_BASE_POINT, 1); } static inline void hydro_x25519_scalarmult_base_uniform(uint8_t pk[hydro_x25519_PUBLICKEYBYTES], const uint8_t sk[hydro_x25519_SECRETKEYBYTES]) { if (hydro_x25519_scalarmult(pk, sk, hydro_x25519_BASE_POINT, 0) != 0) { abort(); } } static void hydro_x25519_sc_montmul(hydro_x25519_scalar_t out, const hydro_x25519_scalar_t a, const hydro_x25519_scalar_t b) { hydro_x25519_limb_t hic = 0; int i, j; for (i = 0; i < hydro_x25519_NLIMBS; i++) { hydro_x25519_limb_t carry = 0, carry2 = 0, mand = a[i], mand2 = hydro_x25519_MONTGOMERY_FACTOR; for (j = 0; j < hydro_x25519_NLIMBS; j++) { hydro_x25519_limb_t acc = out[j]; acc = hydro_x25519_umaal(&carry, acc, mand, b[j]); if (j == 0) { mand2 *= acc; } acc = hydro_x25519_umaal(&carry2, acc, mand2, hydro_x25519_sc_p[j]); if (j > 0) { out[j - 1] = acc; } } /* Add two carry registers and high carry */ out[hydro_x25519_NLIMBS - 1] = hydro_x25519_adc(&hic, carry, carry2); } /* Reduce */ hydro_x25519_sdlimb_t scarry = 0; for (i = 0; i < hydro_x25519_NLIMBS; i++) { out[i] = scarry = scarry + out[i] - hydro_x25519_sc_p[i]; scarry >>= hydro_x25519_WBITS; } hydro_x25519_limb_t need_add = -(scarry + hic); hydro_x25519_limb_t carry = 0; for (i = 0; i < hydro_x25519_NLIMBS; i++) { out[i] = hydro_x25519_umaal(&carry, out[i], need_add, hydro_x25519_sc_p[i]); } }
31.763021
98
0.607608
dc0a7051e70a093a95105836b7c387b24adaf1bb
568
h
C
src/unity/djinni/objc/DBMutationRecord+Private.h
orobio/gulden-official
a329faf163b15eabc7ff1d9f07ea87f66df8d27d
[ "MIT" ]
158
2016-01-08T10:38:37.000Z
2022-02-01T06:28:05.000Z
src/unity/djinni/objc/DBMutationRecord+Private.h
orobio/gulden-official
a329faf163b15eabc7ff1d9f07ea87f66df8d27d
[ "MIT" ]
196
2015-11-19T10:59:24.000Z
2021-10-07T14:52:13.000Z
src/unity/djinni/objc/DBMutationRecord+Private.h
orobio/gulden-official
a329faf163b15eabc7ff1d9f07ea87f66df8d27d
[ "MIT" ]
71
2016-06-25T23:29:04.000Z
2022-03-14T10:57:19.000Z
// AUTOGENERATED FILE - DO NOT MODIFY! // This file generated by Djinni from libunity.djinni #import "DBMutationRecord.h" #include "mutation_record.hpp" static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); @class DBMutationRecord; namespace djinni_generated { struct MutationRecord { using CppType = ::MutationRecord; using ObjcType = DBMutationRecord*; using Boxed = MutationRecord; static CppType toCpp(ObjcType objc); static ObjcType fromCpp(const CppType& cpp); }; } // namespace djinni_generated
22.72
90
0.753521
effd749be693921e5a4a5bf904143c019e7e0b0d
1,628
h
C
basketball_move/include/robot_move_pkg/move_srv.h
nwpu-basketball-robot/basketball_2018
bd3420b6020fa549fd8f1ce77b9bd33e15560fe9
[ "MIT" ]
1
2019-03-23T08:50:43.000Z
2019-03-23T08:50:43.000Z
basketball_move/include/robot_move_pkg/move_srv.h
nwpu-basketball-robot/basketball_2018
bd3420b6020fa549fd8f1ce77b9bd33e15560fe9
[ "MIT" ]
null
null
null
basketball_move/include/robot_move_pkg/move_srv.h
nwpu-basketball-robot/basketball_2018
bd3420b6020fa549fd8f1ce77b9bd33e15560fe9
[ "MIT" ]
1
2021-06-14T08:07:43.000Z
2021-06-14T08:07:43.000Z
#include "ros/ros.h" #include "basketball_msgs/move_to_point.h" #include "basketball_msgs/robot_rotate.h" #include "basketball_msgs/focus_target.h" #include "basketball_msgs/robot_state.h" #include "geometry_msgs/Twist.h" #include "tf/tf.h" #include "tf/transform_listener.h" #include "nav_msgs/Odometry.h" #include <mutex> struct ObsMsg{ ros::Time detectTime; double x ; double y ; }; class MovetoPoint { public: MovetoPoint(ros::NodeHandle &node) ; ~MovetoPoint() ; protected: private: ros::ServiceServer move_to_point ; ros::ServiceServer robot_rotate ; ros::ServiceServer focus_target ; ros::Publisher world_locate_puber ; ros::Publisher robot_rotate_puber ; ros::Publisher focus_target_puber ; ros::Subscriber odom_subscriber ; ros::Subscriber obs_subscriber ; ros::NodeHandle mtp_nh ; tf::TransformListener odom_listener ; tf::StampedTransform odom_tf ; nav_msgs::Odometry odom ; ObsMsg obstacle ; std::mutex odom_mutex ; std::mutex chassis_mutex ; ros::Time StartTime ; bool AchiveHomePoint ; bool moveable ; bool ReturnHome ; bool MTPServiceCallBack(basketball_msgs::move_to_point::Request&, basketball_msgs::move_to_point::Response&) ; bool ROTServiceCallBack(basketball_msgs::robot_rotate::Request&, basketball_msgs::robot_rotate::Response&) ; bool TGTServiceCallBack(basketball_msgs::focus_target::Request&, basketball_msgs::focus_target::Response&) ; void ObsSubCallBack(const basketball_msgs::robot_state::ConstPtr&) ; void OdomSubCallBack(const nav_msgs::Odometry::ConstPtr&) ; };
32.56
114
0.734644
c6ab265af8e0230f2df7b95aae4a436f06a67dea
4,209
c
C
firmware/coreboot/src/mainboard/lippert/toucan-af/mainboard.c
fabiojna02/OpenCellular
45b6a202d6b2e2485c89955b9a6da920c4d56ddb
[ "CC-BY-4.0", "BSD-3-Clause" ]
1
2019-11-04T07:11:25.000Z
2019-11-04T07:11:25.000Z
firmware/coreboot/src/mainboard/lippert/toucan-af/mainboard.c
fabiojna02/OpenCellular
45b6a202d6b2e2485c89955b9a6da920c4d56ddb
[ "CC-BY-4.0", "BSD-3-Clause" ]
13
2018-10-12T21:29:09.000Z
2018-10-25T20:06:51.000Z
firmware/coreboot/src/mainboard/lippert/toucan-af/mainboard.c
fabiojna02/OpenCellular
45b6a202d6b2e2485c89955b9a6da920c4d56ddb
[ "CC-BY-4.0", "BSD-3-Clause" ]
null
null
null
/* * This file is part of the coreboot project. * * Copyright (C) 2011 Advanced Micro Devices, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <stdlib.h> #include <console/console.h> #include <device/device.h> #include <device/pci.h> #include <arch/io.h> #include <device/pci_def.h> #include <southbridge/amd/sb800/sb800.h> #include <arch/acpi.h> #include "SBPLATFORM.h" #include "OEM.h" /* SMBUS0_BASE_ADDRESS */ #include <southbridge/amd/cimx/sb800/gpio_oem.h> #include "mainboard/lippert/frontrunner-af/sema.h" static void init(struct device *dev) { volatile u8 *spi_base; // base addr of Hudson's SPI host controller printk(BIOS_DEBUG, CONFIG_MAINBOARD_PART_NUMBER " ENTER %s\n", __func__); /* Init Hudson GPIOs. */ printk(BIOS_DEBUG, "Init FCH GPIOs @ 0x%08x\n", ACPI_MMIO_BASE+GPIO_BASE); FCH_IOMUX( 50) = 2; // GPIO50: FCH_ARST#_GATE resets stuck PCIe devices FCH_GPIO ( 50) = 0xC0; // = output set to 1 as it's never needed FCH_IOMUX(197) = 2; // GPIO197: BIOS_DEFAULTS# FCH_GPIO (197) = 0x28; // = input, disable int. pull-up FCH_IOMUX( 56) = 1; // GPIO58-56: REV_ID2-0 FCH_GPIO ( 56) = 0x28; // = inputs, disable int. pull-ups FCH_IOMUX( 57) = 1; FCH_GPIO ( 57) = 0x28; FCH_IOMUX( 58) = 1; FCH_GPIO ( 58) = 0x28; FCH_IOMUX(187) = 2; // GPIO187,188,166,GPO160: GPO0-3 on COM Express connector FCH_GPIO (187) = 0x08; // = outputs, disable PUs, default to 0 FCH_IOMUX(188) = 2; FCH_GPIO (188) = 0x08; FCH_IOMUX(166) = 2; FCH_GPIO (166) = 0x08; // needed to make GPO160 work (Hudson Register Reference section 2.3.6.1) FCH_PMIO(0xDC) &= ~0x80; FCH_PMIO(0xE6) = (FCH_PMIO(0xE6) & ~0x02) | 0x01; FCH_IOMUX(160) = 1; FCH_GPIO (160) = 0x08; FCH_IOMUX(189) = 1; // GPIO189-192: GPI0-3 on COM Express connector FCH_IOMUX(190) = 1; // default to inputs with int. PU FCH_IOMUX(191) = 1; FCH_IOMUX(192) = 1; if (!fch_gpio_state(197)) // just in case anyone cares printk(BIOS_INFO, "BIOS_DEFAULTS jumper is present.\n"); printk(BIOS_INFO, "Board revision ID: %u\n", fch_gpio_state(58)<<2 | fch_gpio_state(57)<<1 | fch_gpio_state(56)); /* Lower SPI speed from default 66 to 22 MHz for SST 25VF032B */ spi_base = (u8*)((uintptr_t)pci_read_config32(dev_find_slot(0, PCI_DEVFN(0x14, 3)), 0xA0) & 0xFFFFFFE0); spi_base[0x0D] = (spi_base[0x0D] & ~0x30) | 0x20; // NormSpeed in SPI_Cntrl1 register /* Notify the SMC we're alive and kicking, or after a while it will * effect a power cycle and switch to the alternate BIOS chip. * Should be done as late as possible. * Failure here does not matter if watchdog was already disabled, * by configuration or previous boot, so ignore return value. */ sema_send_alive(); printk(BIOS_DEBUG, CONFIG_MAINBOARD_PART_NUMBER " EXIT %s\n", __func__); } /********************************************** * Enable the dedicated functions of the board. **********************************************/ static void mainboard_enable(struct device *dev) { printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); dev->ops->init = init; /* enable GPP CLK0 thru CLK1 */ /* disable GPP CLK2 thru SLT_GFX_CLK */ u8 *misc_mem_clk_cntrl = (u8 *)(ACPI_MMIO_BASE + MISC_BASE); write8(misc_mem_clk_cntrl + 0, 0xFF); write8(misc_mem_clk_cntrl + 1, 0x00); write8(misc_mem_clk_cntrl + 2, 0x00); write8(misc_mem_clk_cntrl + 3, 0x00); write8(misc_mem_clk_cntrl + 4, 0x00); /* * Initialize ASF registers to an arbitrary address because someone * long ago set things up this way inside the SPD read code. The * SPD read code has been made generic and moved out of the board * directory, so the ASF init is being done here. */ pm_iowrite(0x29, 0x80); pm_iowrite(0x28, 0x61); } struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, };
38.263636
105
0.694702
0b8d73f5137f0e6ef24e68d84ac1b57535325864
143
c
C
src/monetary/strfmon.c
ung-org/lib-c
55fc64c7ffd7792bc88451a736c2e94e5865282f
[ "MIT" ]
null
null
null
src/monetary/strfmon.c
ung-org/lib-c
55fc64c7ffd7792bc88451a736c2e94e5865282f
[ "MIT" ]
null
null
null
src/monetary/strfmon.c
ung-org/lib-c
55fc64c7ffd7792bc88451a736c2e94e5865282f
[ "MIT" ]
null
null
null
#include <monetary.h> ssize_t strfmon(char * restrict s, size_t maxsize, const char * restrict format, ...) { } /* XOPEN(4) POSIX(200809) */
13
85
0.671329
a710bbd95fe790d8538a115b633a7fd7d8e297f2
66
c
C
src/imop/lib/testcases/cfgTests/declaration.c
amannougrahiya/imop-compiler
a0f0c9aaea00c6e5d37a17172c5db2967822ba9b
[ "MIT" ]
10
2020-02-24T20:39:06.000Z
2021-11-01T03:33:22.000Z
src/imop/lib/testcases/cfgTests/declaration.c
anonymousoopsla21/homeostasis
e56c5c2f8392027ad5a49a45d7ac49a139c33674
[ "MIT" ]
2
2020-02-25T20:30:46.000Z
2020-07-18T19:05:27.000Z
src/imop/lib/testcases/cfgTests/declaration.c
anonymousoopsla21/homeostasis
e56c5c2f8392027ad5a49a45d7ac49a139c33674
[ "MIT" ]
2
2020-03-11T11:53:47.000Z
2021-08-23T06:49:57.000Z
int main() { int x, y; x = 10; int z; x = 10; x++; z = x; }
7.333333
12
0.378788
4c8973de221063e94f50f47171b0e35d7ffdca01
208
h
C
tests/testAutopas/tests/containers/verletClusterLists/VerletClusterTowerTest.h
TheH0bbit/autopas_dem
d7761e6ba0f6353fb97ecf78fb60873a00e41e17
[ "BSD-2-Clause" ]
null
null
null
tests/testAutopas/tests/containers/verletClusterLists/VerletClusterTowerTest.h
TheH0bbit/autopas_dem
d7761e6ba0f6353fb97ecf78fb60873a00e41e17
[ "BSD-2-Clause" ]
null
null
null
tests/testAutopas/tests/containers/verletClusterLists/VerletClusterTowerTest.h
TheH0bbit/autopas_dem
d7761e6ba0f6353fb97ecf78fb60873a00e41e17
[ "BSD-2-Clause" ]
null
null
null
/** * @file VerletClusterTowerTest.h * @author humig * @date 05.02.2020 */ #pragma once #include <gtest/gtest.h> #include "AutoPasTestBase.h" class VerletClusterTowerTest : public AutoPasTestBase {};
14.857143
57
0.716346
4271e2a84df07193a2cc7f601c173bda2060c6d0
354
h
C
PhotoBox/Views/InfoTableViewCell.h
patricksan/delightful
bde5e955b56d8f913de2d63f256576463a8fa765
[ "MIT" ]
null
null
null
PhotoBox/Views/InfoTableViewCell.h
patricksan/delightful
bde5e955b56d8f913de2d63f256576463a8fa765
[ "MIT" ]
null
null
null
PhotoBox/Views/InfoTableViewCell.h
patricksan/delightful
bde5e955b56d8f913de2d63f256576463a8fa765
[ "MIT" ]
null
null
null
// // InfoTableViewCell.h // Delightful // // Created by Nico Prananta on 5/18/14. // Copyright (c) 2014-2016 DelightfulDev. All rights reserved. // #import <UIKit/UIKit.h> @interface InfoTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *infoTextLabel; - (void)setText:(NSString *)text detail:(NSString *)detail; @end
20.823529
63
0.725989
712d2c517eaed2738faac76d64eeb0597157c35c
273
h
C
EBFoundation.h
lassomedia/EBFoundation
991e776cb957560c53b0233dd2b789af1aea4752
[ "MIT" ]
null
null
null
EBFoundation.h
lassomedia/EBFoundation
991e776cb957560c53b0233dd2b789af1aea4752
[ "MIT" ]
null
null
null
EBFoundation.h
lassomedia/EBFoundation
991e776cb957560c53b0233dd2b789af1aea4752
[ "MIT" ]
null
null
null
#import <EBFoundation/EBAssert.h> #import <EBFoundation/EBBlockValueTransformer.h> #import <EBFoundation/EBObservation.h> #import <EBFoundation/EBSingleton.h> #import <EBFoundation/EBTime.h> #import <EBFoundation/EBUtilities.h> #import <EBFoundation/NSTimer+EBBlockTimer.h>
39
48
0.820513
abdebbfa0530f3fffa3837af98a50b58a44aa8c8
77
h
C
Libraries/ulptool/src/ulp_examples/ulp_i2c_bitbang/ulp_main.h
Karna-A/Sys-Engineering
90cef9f6f6d50ac63a6c6cb716973bfff0209bbc
[ "MIT" ]
1
2020-11-10T02:45:57.000Z
2020-11-10T02:45:57.000Z
Libraries/ulptool/src/ulp_examples/ulp_i2c_bitbang/ulp_main.h
Karna-A/Sys-Engineering
90cef9f6f6d50ac63a6c6cb716973bfff0209bbc
[ "MIT" ]
null
null
null
Libraries/ulptool/src/ulp_examples/ulp_i2c_bitbang/ulp_main.h
Karna-A/Sys-Engineering
90cef9f6f6d50ac63a6c6cb716973bfff0209bbc
[ "MIT" ]
null
null
null
#include "Arduino.h" extern uint32_t ulp_entry; extern uint32_t ulp_result;
15.4
27
0.805195
5e9b88c272fe88be6a6294af5d94edc0b4215e9c
334
h
C
PrivateFrameworks/WebKitLegacy.framework/WebMIMETypeRegistry.h
shaojiankui/iOS10-Runtime-Headers
6b0d842bed0c52c2a7c1464087b3081af7e10c43
[ "MIT" ]
36
2016-04-20T04:19:04.000Z
2018-10-08T04:12:25.000Z
PrivateFrameworks/WebKitLegacy.framework/WebMIMETypeRegistry.h
shaojiankui/iOS10-Runtime-Headers
6b0d842bed0c52c2a7c1464087b3081af7e10c43
[ "MIT" ]
null
null
null
PrivateFrameworks/WebKitLegacy.framework/WebMIMETypeRegistry.h
shaojiankui/iOS10-Runtime-Headers
6b0d842bed0c52c2a7c1464087b3081af7e10c43
[ "MIT" ]
10
2016-06-16T02:40:44.000Z
2019-01-15T03:31:45.000Z
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy */ @interface WebMIMETypeRegistry : NSObject + (bool)isSupportedImageMIMEType:(id)arg1; + (bool)isSupportedMediaMIMEType:(id)arg1; + (id)mimeTypeForExtension:(id)arg1; + (id)preferredExtensionForMIMEType:(id)arg1; @end
25.692308
79
0.793413
99995ad8e84f517df34c2e99aa9de049d4603d51
5,767
c
C
ext/leevel/throttler/provider/register.zep.c
17734027950/leevel
b7131cae43eb40278b7300419d306c7285cab6d5
[ "MIT" ]
null
null
null
ext/leevel/throttler/provider/register.zep.c
17734027950/leevel
b7131cae43eb40278b7300419d306c7285cab6d5
[ "MIT" ]
null
null
null
ext/leevel/throttler/provider/register.zep.c
17734027950/leevel
b7131cae43eb40278b7300419d306c7285cab6d5
[ "MIT" ]
null
null
null
#ifdef HAVE_CONFIG_H #include "../../../ext_config.h" #endif #include <php.h> #include "../../../php_ext.h" #include "../../../ext.h" #include <Zend/zend_operators.h> #include <Zend/zend_exceptions.h> #include <Zend/zend_interfaces.h> #include "kernel/main.h" #include "kernel/fcall.h" #include "kernel/memory.h" #include "kernel/array.h" #include "kernel/object.h" /** * throttler 服务提供者 * * @author Xiangmin Liu <635750556@qq.com> * * @since 2018.01.28 * @version 1.0 */ ZEPHIR_INIT_CLASS(Leevel_Throttler_Provider_Register) { ZEPHIR_REGISTER_CLASS_EX(Leevel\\Throttler\\Provider, Register, leevel, throttler_provider_register, leevel_di_provider_ce, leevel_throttler_provider_register_method_entry, 0); return SUCCESS; } /** * 创建一个服务容器提供者实例 * * @param \Leevel\Di\IContainer $container * @return void */ PHP_METHOD(Leevel_Throttler_Provider_Register, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *container, container_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&container_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &container); ZEPHIR_CALL_PARENT(NULL, leevel_throttler_provider_register_ce, getThis(), "__construct", &_0, 0, container); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } /** * 注册服务 * * @return void */ PHP_METHOD(Leevel_Throttler_Provider_Register, register) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "throttler", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "middleware", NULL, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } /** * 可用服务提供者 * * @return array */ PHP_METHOD(Leevel_Throttler_Provider_Register, providers) { zval _1; zval _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_create_array(return_value, 2, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(&_0); zephir_create_array(&_0, 2, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Leevel\\Throttler\\Throttler"); zephir_array_fast_append(&_0, &_1); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "Leevel\\Throttler\\IThrottler"); zephir_array_fast_append(&_0, &_1); zephir_array_update_string(return_value, SL("throttler"), &_0, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "Leevel\\Throttler\\Middleware\\Throttler"); zephir_array_fast_append(return_value, &_1); RETURN_MM(); } /** * {@inheritdoc} */ PHP_METHOD(Leevel_Throttler_Provider_Register, isDeferred) { zval *this_ptr = getThis(); RETURN_BOOL(1); } /** * 注册 throttler 服务 * * @return void */ PHP_METHOD(Leevel_Throttler_Provider_Register, throttler) { zval _3; zend_class_entry *_2; zval _0, _1, _4; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY); _2 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); ZEPHIR_INIT_VAR(&_3); zephir_create_array(&_3, 2, 0 TSRMLS_CC); zephir_array_fast_append(&_3, this_ptr); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "throttlerClosure"); zephir_array_fast_append(&_3, &_4); ZEPHIR_CALL_CE_STATIC(&_1, _2, "fromcallable", NULL, 0, &_3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "throttler"); ZEPHIR_CALL_METHOD(NULL, &_0, "singleton", NULL, 0, &_4, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } /** * 创建 throttler 服务闭包 * * @param \Leevel\Di\IContainer $container * @return \Leevel\Throttler\Throttler */ PHP_METHOD(Leevel_Throttler_Provider_Register, throttlerClosure) { zend_class_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *container, container_sub, throttler, _1, _2, _3, _4, _5, _6; zval *this_ptr = getThis(); ZVAL_UNDEF(&container_sub); ZVAL_UNDEF(&throttler); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_5); ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &container); ZEPHIR_INIT_VAR(&throttler); if (!_0) { _0 = zephir_fetch_class_str_ex(SL("Leevel\\Throttler\\Throttler"), ZEND_FETCH_CLASS_AUTO); } object_init_ex(&throttler, _0); if (zephir_has_constructor(&throttler TSRMLS_CC)) { ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "caches"); ZEPHIR_CALL_METHOD(&_1, container, "make", NULL, 0, &_2); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "option"); ZEPHIR_CALL_METHOD(&_4, container, "make", NULL, 0, &_2); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "throttler\\driver"); ZEPHIR_CALL_METHOD(&_5, &_4, "get", NULL, 0, &_2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_3, &_1, "connect", NULL, 0, &_5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &throttler, "__construct", NULL, 0, &_3); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "request"); ZEPHIR_CALL_METHOD(&_6, container, "make", NULL, 0, &_2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &throttler, "setrequest", NULL, 0, &_6); zephir_check_call_status(); RETURN_CCTOR(&throttler); } /** * 注册 middleware 服务 * * @return void */ PHP_METHOD(Leevel_Throttler_Provider_Register, middleware) { zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Leevel\\Throttler\\Middleware\\Throttler"); ZEPHIR_CALL_METHOD(NULL, &_0, "singleton", NULL, 0, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); }
22.884921
177
0.729149
61ca0d3fd8cd4b9abc8bfca527f85a3cbdbe58fc
1,600
h
C
server/server.h
WhyWeStillHere/kalinin-tcp-console-game
461f1acd56256ed18210bb3c362049ab5b5d2e7b
[ "MIT" ]
null
null
null
server/server.h
WhyWeStillHere/kalinin-tcp-console-game
461f1acd56256ed18210bb3c362049ab5b5d2e7b
[ "MIT" ]
null
null
null
server/server.h
WhyWeStillHere/kalinin-tcp-console-game
461f1acd56256ed18210bb3c362049ab5b5d2e7b
[ "MIT" ]
null
null
null
#pragma once #include <arpa/inet.h> #include <unordered_map> #include <csignal> #include <cstdio> #include <cstdlib> #include <cstring> #include <netinet/in.h> #include <stdexcept> #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> #include <syslog.h> #include <unistd.h> #include <unordered_map> #include <vector> #include <pthread.h> #include "../lib/info_structures/room_info.h" #include "../lib/network_utilities/send_command.h" #include "../lib/network_utilities/tcp_connection.h" #include "../lib/network_utilities/tcp_utilities.h" #include "io_context.h" #include "room.h" enum ServerStartUpType { DAEMON, PROGRAM }; enum ManagerStates { START, SENDING_ROOMS, WAITING_COMMAND, JOINING_ROOM, CREATING_ROOM }; class GameServer { public: //TODO: Bad place for configure!!! explicit GameServer(const ServerStartUpType type); ~GameServer(); GameServer(const GameServer&) = delete; GameServer(GameServer&&) = delete; void Run(); void Init(const char* ip_string, const int port); private: void ConfigureDaemon(); void CloseConnection(int fd); static void ExitHandler(int signum); void ConfigureSignals(); void ManageEvents(int event_num, epoll_event* events); void AddNewConnection(); void ManageState(int fd); void ConnectToRoom(int fd); void CreateRoom(int fd); static void* RoomTread(void* arg); int socket_ = -1; uint64_t ID = 1; static volatile sig_atomic_t exit_flag_; std::unordered_map<int, TcpConnection<ManagerStates> > connections_; std::unordered_map<int, RoomInfo> rooms_; IOContext io_context_; };
22.222222
70
0.735
6118e1d3113fbfbc97b13c3357db8a5783bc034f
836
h
C
src/ObjectSerializer/Include/Everything.h
RtsAiResearch/IStrategizer
2005060d40190041e4d541e23b6148336241d690
[ "Apache-2.0" ]
14
2015-12-09T15:27:07.000Z
2022-02-08T06:27:03.000Z
ObjectSerializer/Include/Everything.h
RtsAiResearch/Serialization
c19ab398a8ecfb91e65d591456d6cd601f7f458d
[ "Apache-2.0" ]
null
null
null
ObjectSerializer/Include/Everything.h
RtsAiResearch/Serialization
c19ab398a8ecfb91e65d591456d6cd601f7f458d
[ "Apache-2.0" ]
2
2015-02-21T02:44:08.000Z
2017-08-09T06:43:22.000Z
#ifndef EVERYTHING_H #define EVERYTHING_H #ifndef _NOEXCLUSIONS #include "Exclude.h" /* Define Preprocessor variables to */ /* exclude un-wanted header files. */ #endif #include "Environment.h" #include <windows.h> #include <tchar.h> #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <io.h> #include <WinSock2.h> #include "support.h" #ifdef _MT #include <process.h> #endif /* DWORD_PTR (pointer precision unsigned integer) is used for integers * that are converted to handles or pointers * This eliminates Win64 warnings regarding conversion between * 32 and 64-bit data, as HANDLEs and pointers are 64 bits in * Win64 (See Chapter 16). This is enable only if _Wp64 is defined. */ #if !defined(_Wp64) #define DWORD_PTR DWORD #define LONG_PTR LONG #define INT_PTR INT #endif #endif // EVERYTHING_H
25.333333
71
0.736842
5ecb47ff0b0aa68c0105fed06e4bd65bf3e5c095
15,948
c
C
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gmemoryinputstream.c
sotaoverride/backup
ca53a10b72295387ef4948a9289cb78ab70bc449
[ "Apache-2.0" ]
null
null
null
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gmemoryinputstream.c
sotaoverride/backup
ca53a10b72295387ef4948a9289cb78ab70bc449
[ "Apache-2.0" ]
null
null
null
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gmemoryinputstream.c
sotaoverride/backup
ca53a10b72295387ef4948a9289cb78ab70bc449
[ "Apache-2.0" ]
null
null
null
/* GIO - GLib Input, Output and Streaming Library * * Copyright (C) 2006-2007 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, see * <http://www.gnu.org/licenses/>. * * Author: Christian Kellner <gicmo@gnome.org> */ #include "config.h" #include "gmemoryinputstream.h" #include "ginputstream.h" #include "gioerror.h" #include "glibintl.h" #include "gpollableinputstream.h" #include "gseekable.h" #include "gtask.h" #include "string.h" /** * SECTION:gmemoryinputstream * @short_description: Streaming input operations on memory chunks * @include: gio/gio.h * @see_also: #GMemoryOutputStream * * #GMemoryInputStream is a class for using arbitrary * memory chunks as input for GIO streaming input operations. * * As of GLib 2.34, #GMemoryInputStream implements * #GPollableInputStream. */ struct _GMemoryInputStreamPrivate { GSList* chunks; gsize len; gsize pos; }; static gssize g_memory_input_stream_read(GInputStream* stream, void* buffer, gsize count, GCancellable* cancellable, GError** error); static gssize g_memory_input_stream_skip(GInputStream* stream, gsize count, GCancellable* cancellable, GError** error); static gboolean g_memory_input_stream_close(GInputStream* stream, GCancellable* cancellable, GError** error); static void g_memory_input_stream_skip_async(GInputStream* stream, gsize count, int io_priority, GCancellable* cancellabl, GAsyncReadyCallback callback, gpointer datae); static gssize g_memory_input_stream_skip_finish(GInputStream* stream, GAsyncResult* result, GError** error); static void g_memory_input_stream_close_async(GInputStream* stream, int io_priority, GCancellable* cancellabl, GAsyncReadyCallback callback, gpointer data); static gboolean g_memory_input_stream_close_finish(GInputStream* stream, GAsyncResult* result, GError** error); static void g_memory_input_stream_seekable_iface_init(GSeekableIface* iface); static goffset g_memory_input_stream_tell(GSeekable* seekable); static gboolean g_memory_input_stream_can_seek(GSeekable* seekable); static gboolean g_memory_input_stream_seek(GSeekable* seekable, goffset offset, GSeekType type, GCancellable* cancellable, GError** error); static gboolean g_memory_input_stream_can_truncate(GSeekable* seekable); static gboolean g_memory_input_stream_truncate(GSeekable* seekable, goffset offset, GCancellable* cancellable, GError** error); static void g_memory_input_stream_pollable_iface_init( GPollableInputStreamInterface* iface); static gboolean g_memory_input_stream_is_readable(GPollableInputStream* stream); static GSource* g_memory_input_stream_create_source(GPollableInputStream* stream, GCancellable* cancellable); static void g_memory_input_stream_finalize(GObject* object); G_DEFINE_TYPE_WITH_CODE( GMemoryInputStream, g_memory_input_stream, G_TYPE_INPUT_STREAM, G_ADD_PRIVATE(GMemoryInputStream) G_IMPLEMENT_INTERFACE(G_TYPE_SEEKABLE, g_memory_input_stream_seekable_iface_init); G_IMPLEMENT_INTERFACE(G_TYPE_POLLABLE_INPUT_STREAM, g_memory_input_stream_pollable_iface_init);) static void g_memory_input_stream_class_init(GMemoryInputStreamClass* klass) { GObjectClass* object_class; GInputStreamClass* istream_class; object_class = G_OBJECT_CLASS(klass); object_class->finalize = g_memory_input_stream_finalize; istream_class = G_INPUT_STREAM_CLASS(klass); istream_class->read_fn = g_memory_input_stream_read; istream_class->skip = g_memory_input_stream_skip; istream_class->close_fn = g_memory_input_stream_close; istream_class->skip_async = g_memory_input_stream_skip_async; istream_class->skip_finish = g_memory_input_stream_skip_finish; istream_class->close_async = g_memory_input_stream_close_async; istream_class->close_finish = g_memory_input_stream_close_finish; } static void g_memory_input_stream_finalize(GObject* object) { GMemoryInputStream* stream; GMemoryInputStreamPrivate* priv; stream = G_MEMORY_INPUT_STREAM(object); priv = stream->priv; g_slist_free_full(priv->chunks, (GDestroyNotify)g_bytes_unref); G_OBJECT_CLASS(g_memory_input_stream_parent_class)->finalize(object); } static void g_memory_input_stream_seekable_iface_init(GSeekableIface* iface) { iface->tell = g_memory_input_stream_tell; iface->can_seek = g_memory_input_stream_can_seek; iface->seek = g_memory_input_stream_seek; iface->can_truncate = g_memory_input_stream_can_truncate; iface->truncate_fn = g_memory_input_stream_truncate; } static void g_memory_input_stream_pollable_iface_init( GPollableInputStreamInterface* iface) { iface->is_readable = g_memory_input_stream_is_readable; iface->create_source = g_memory_input_stream_create_source; } static void g_memory_input_stream_init(GMemoryInputStream* stream) { stream->priv = g_memory_input_stream_get_instance_private(stream); } /** * g_memory_input_stream_new: * * Creates a new empty #GMemoryInputStream. * * Returns: a new #GInputStream */ GInputStream* g_memory_input_stream_new(void) { GInputStream* stream; stream = g_object_new(G_TYPE_MEMORY_INPUT_STREAM, NULL); return stream; } /** * g_memory_input_stream_new_from_data: * @data: (array length=len) (element-type guint8) (transfer full): input data * @len: length of the data, may be -1 if @data is a nul-terminated string * @destroy: (nullable): function that is called to free @data, or %NULL * * Creates a new #GMemoryInputStream with data in memory of a given size. * * Returns: new #GInputStream read from @data of @len bytes. **/ GInputStream* g_memory_input_stream_new_from_data(const void* data, gssize len, GDestroyNotify destroy) { GInputStream* stream; stream = g_memory_input_stream_new(); g_memory_input_stream_add_data(G_MEMORY_INPUT_STREAM(stream), data, len, destroy); return stream; } /** * g_memory_input_stream_new_from_bytes: * @bytes: a #GBytes * * Creates a new #GMemoryInputStream with data from the given @bytes. * * Returns: new #GInputStream read from @bytes * * Since: 2.34 **/ GInputStream* g_memory_input_stream_new_from_bytes(GBytes* bytes) { GInputStream* stream; stream = g_memory_input_stream_new(); g_memory_input_stream_add_bytes(G_MEMORY_INPUT_STREAM(stream), bytes); return stream; } /** * g_memory_input_stream_add_data: * @stream: a #GMemoryInputStream * @data: (array length=len) (element-type guint8) (transfer full): input data * @len: length of the data, may be -1 if @data is a nul-terminated string * @destroy: (nullable): function that is called to free @data, or %NULL * * Appends @data to data that can be read from the input stream */ void g_memory_input_stream_add_data(GMemoryInputStream* stream, const void* data, gssize len, GDestroyNotify destroy) { GBytes* bytes; if (len == -1) len = strlen(data); /* It's safe to discard the const here because we're chaining the * destroy callback. */ bytes = g_bytes_new_with_free_func(data, len, destroy, (void*)data); g_memory_input_stream_add_bytes(stream, bytes); g_bytes_unref(bytes); } /** * g_memory_input_stream_add_bytes: * @stream: a #GMemoryInputStream * @bytes: input data * * Appends @bytes to data that can be read from the input stream. * * Since: 2.34 */ void g_memory_input_stream_add_bytes(GMemoryInputStream* stream, GBytes* bytes) { GMemoryInputStreamPrivate* priv; g_return_if_fail(G_IS_MEMORY_INPUT_STREAM(stream)); g_return_if_fail(bytes != NULL); priv = stream->priv; priv->chunks = g_slist_append(priv->chunks, g_bytes_ref(bytes)); priv->len += g_bytes_get_size(bytes); } static gssize g_memory_input_stream_read(GInputStream* stream, void* buffer, gsize count, GCancellable* cancellable, GError** error) { GMemoryInputStream* memory_stream; GMemoryInputStreamPrivate* priv; GSList* l; GBytes* chunk; gsize len; gsize offset, start, rest, size; memory_stream = G_MEMORY_INPUT_STREAM(stream); priv = memory_stream->priv; count = MIN(count, priv->len - priv->pos); offset = 0; for (l = priv->chunks; l; l = l->next) { chunk = (GBytes*)l->data; len = g_bytes_get_size(chunk); if (offset + len > priv->pos) break; offset += len; } start = priv->pos - offset; rest = count; for (; l && rest > 0; l = l->next) { const guint8* chunk_data; chunk = (GBytes*)l->data; chunk_data = g_bytes_get_data(chunk, &len); size = MIN(rest, len - start); memcpy((guint8*)buffer + (count - rest), chunk_data + start, size); rest -= size; start = 0; } priv->pos += count; return count; } static gssize g_memory_input_stream_skip(GInputStream* stream, gsize count, GCancellable* cancellable, GError** error) { GMemoryInputStream* memory_stream; GMemoryInputStreamPrivate* priv; memory_stream = G_MEMORY_INPUT_STREAM(stream); priv = memory_stream->priv; count = MIN(count, priv->len - priv->pos); priv->pos += count; return count; } static gboolean g_memory_input_stream_close(GInputStream* stream, GCancellable* cancellable, GError** error) { return TRUE; } static void g_memory_input_stream_skip_async(GInputStream* stream, gsize count, int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { GTask* task; gssize nskipped; GError* error = NULL; nskipped = G_INPUT_STREAM_GET_CLASS(stream)->skip(stream, count, cancellable, &error); task = g_task_new(stream, cancellable, callback, user_data); g_task_set_source_tag(task, g_memory_input_stream_skip_async); if (error) g_task_return_error(task, error); else g_task_return_int(task, nskipped); g_object_unref(task); } static gssize g_memory_input_stream_skip_finish(GInputStream* stream, GAsyncResult* result, GError** error) { g_return_val_if_fail(g_task_is_valid(result, stream), -1); return g_task_propagate_int(G_TASK(result), error); } static void g_memory_input_stream_close_async(GInputStream* stream, int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { GTask* task; task = g_task_new(stream, cancellable, callback, user_data); g_task_set_source_tag(task, g_memory_input_stream_close_async); g_task_return_boolean(task, TRUE); g_object_unref(task); } static gboolean g_memory_input_stream_close_finish(GInputStream* stream, GAsyncResult* result, GError** error) { return TRUE; } static goffset g_memory_input_stream_tell(GSeekable* seekable) { GMemoryInputStream* memory_stream; GMemoryInputStreamPrivate* priv; memory_stream = G_MEMORY_INPUT_STREAM(seekable); priv = memory_stream->priv; return priv->pos; } static gboolean g_memory_input_stream_can_seek(GSeekable* seekable) { return TRUE; } static gboolean g_memory_input_stream_seek(GSeekable* seekable, goffset offset, GSeekType type, GCancellable* cancellable, GError** error) { GMemoryInputStream* memory_stream; GMemoryInputStreamPrivate* priv; goffset absolute; memory_stream = G_MEMORY_INPUT_STREAM(seekable); priv = memory_stream->priv; switch (type) { case G_SEEK_CUR: absolute = priv->pos + offset; break; case G_SEEK_SET: absolute = offset; break; case G_SEEK_END: absolute = priv->len + offset; break; default: g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, _("Invalid GSeekType supplied")); return FALSE; } if (absolute < 0 || absolute > priv->len) { g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, _("Invalid seek request")); return FALSE; } priv->pos = absolute; return TRUE; } static gboolean g_memory_input_stream_can_truncate(GSeekable* seekable) { return FALSE; } static gboolean g_memory_input_stream_truncate(GSeekable* seekable, goffset offset, GCancellable* cancellable, GError** error) { g_set_error_literal(error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, _("Cannot truncate GMemoryInputStream")); return FALSE; } static gboolean g_memory_input_stream_is_readable(GPollableInputStream* stream) { return TRUE; } static GSource* g_memory_input_stream_create_source(GPollableInputStream* stream, GCancellable* cancellable) { GSource *base_source, *pollable_source; base_source = g_timeout_source_new(0); pollable_source = g_pollable_source_new_full(stream, base_source, cancellable); g_source_unref(base_source); return pollable_source; }
32.283401
80
0.62547
66f13c6fe54c67c8370c2c6a69469c6f0f524a43
301
h
C
src/ave_miscentered_delta_sigma/ave_miscentered_delta_sigma.h
tmcclintock/DeltaSigma_miscentering
12b4875a3b2c7d4ebbf588a15c1cc3ee6e49e0c7
[ "MIT" ]
null
null
null
src/ave_miscentered_delta_sigma/ave_miscentered_delta_sigma.h
tmcclintock/DeltaSigma_miscentering
12b4875a3b2c7d4ebbf588a15c1cc3ee6e49e0c7
[ "MIT" ]
null
null
null
src/ave_miscentered_delta_sigma/ave_miscentered_delta_sigma.h
tmcclintock/DeltaSigma_miscentering
12b4875a3b2c7d4ebbf588a15c1cc3ee6e49e0c7
[ "MIT" ]
null
null
null
#include "ave_miscentered_delta_sigma_in_bin.h" #include "../constants/constants.h" int calc_ave_miscentered_delta_sigma(double*R,int NR, double*miscentered_delta_sigma, int Nbins,double R_bin_min, double R_bin_max, double*Rbins, double*ave_delta_sigma);
30.1
53
0.710963
ba7909b1c35bbd00a7cded5990e216a083f30790
481
h
C
PrivateFrameworks/PhotosUICore/PXSRestoreDefaultSettingsRowAction.h
phatblat/macOSPrivateFrameworks
9047371eb80f925642c8a7c4f1e00095aec66044
[ "MIT" ]
17
2018-11-13T04:02:58.000Z
2022-01-20T09:27:13.000Z
PrivateFrameworks/PhotosUICore/PXSRestoreDefaultSettingsRowAction.h
phatblat/macOSPrivateFrameworks
9047371eb80f925642c8a7c4f1e00095aec66044
[ "MIT" ]
3
2018-04-06T02:02:27.000Z
2018-10-02T01:12:10.000Z
PrivateFrameworks/PhotosUICore/PXSRestoreDefaultSettingsRowAction.h
phatblat/macOSPrivateFrameworks
9047371eb80f925642c8a7c4f1e00095aec66044
[ "MIT" ]
1
2018-09-28T13:54:23.000Z
2018-09-28T13:54:23.000Z
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <PhotosUICore/PXSRowAction.h> @class NSString; @interface PXSRestoreDefaultSettingsRowAction : PXSRowAction { NSString *_settingsKeyPath; } + (id)actionWithSettingsKeyPath:(id)arg1; @property(copy, nonatomic) NSString *settingsKeyPath; // @synthesize settingsKeyPath=_settingsKeyPath; - (void).cxx_destruct; - (id)init; @end
20.913043
102
0.72973
0fcda88254b7712161f10adf44d6f21f9244ca5b
3,076
h
C
src/kerror.h
tmbx/libktools
08a95694e342dfb0225299c3ed5fcf64d7ff180b
[ "BSD-3-Clause" ]
null
null
null
src/kerror.h
tmbx/libktools
08a95694e342dfb0225299c3ed5fcf64d7ff180b
[ "BSD-3-Clause" ]
null
null
null
src/kerror.h
tmbx/libktools
08a95694e342dfb0225299c3ed5fcf64d7ff180b
[ "BSD-3-Clause" ]
null
null
null
#ifndef __K_ERROR_H__ #define __K_ERROR_H__ #include <kstr.h> #include <karray.h> #include <errno.h> #include <string.h> /* This has to be defined in order for this code to work. */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif /** * Each time you push an error, a kerror_node instance is pushed on the stack. * You shoud not instanciate nodes directly nor delete them directly. */ struct kerror_node { /* File name where the error occurred. Static C string. */ char *file; /* Function name where the error occurred. Static C string. */ char *function; /* Line where the error occurred. */ int line; /* Module where the error occurred. Each module has a unique integer code. * XXX LB: it would probably be best to use a static C string here. In the * current scheme some modules are getting conflicting IDs. */ int module; /* Level of the error. The semantics of 'level' are specific to each module. */ int level; /* Error string. */ kstr text; }; /* This structure represents an error stack. */ struct kerror { karray stack; }; /* Use the following macro to create a new error node and push it on the * stack. Or wrap it in your module so you dont have to specify module and * level. */ #define KERROR_PUSH(module, level, ...) \ kerror_push(kerror_node_new(__FILE__, __LINE__, __FUNCTION__, module, level, __VA_ARGS__)) #define KERROR_SET(module, level, ...) ({\ kerror_reset(); \ kerror_push(kerror_node_new(__FILE__, __LINE__, __FUNCTION__, module, level, __VA_ARGS__)); \ }) #ifdef BUILDING_KTOOLS # define KTOOLS_ERROR_PUSH(...) \ KERROR_PUSH(0, 0, __VA_ARGS__) # define KTOOLS_ERROR_SET(...) \ KERROR_SET(0, 0, __VA_ARGS__) #endif /* BUILDING_KTOOLS */ struct kerror_node *kerror_node_new_v(const char *file, int line, const char *function, int module, int level, const char *format, va_list args); void kerror_node_destroy(struct kerror_node *node); void kerror_init(struct kerror *self); void kerror_clean(struct kerror *self); void kerror_reset_stack(struct kerror *self); void kerror_reset(); struct kerror * kerror_get_current(); void kerror_initialize(); void kerror_finalize(); int kerror_has_error(); void kerror_push(struct kerror_node *node); kstr *kerror_str(); kstr *kerror_str_n(int n); void kerror_fatal_set_handler(void (*handler)()); void kerror_fatal(const char *format, ...); char * kerror_sys(int error); char * kerror_sys_buf(int error, char buf[1000]); /* This function calls kerror_sys with errno as its parameter. */ static inline char * kerror_syserror() { return kerror_sys(errno); } static inline struct kerror_node *kerror_node_new(const char *file, int line, const char *function, int module, int level, const char *format, ...) { struct kerror_node *node; va_list args; va_start(args, format); node = kerror_node_new_v(file, line, function, module, level, format, args); va_end(args); return node; } #endif /*__K_ERROR_H__*/
30.455446
123
0.697984
b5a995eac64b8d280108e7db5d134e3584c7587d
6,557
h
C
opensoap/src/server/SOAPMessageFunc.h
kbore/pbis-open
a05eb9309269b6402b4d6659bc45961986ea5eab
[ "Apache-2.0" ]
372
2016-10-28T10:50:35.000Z
2022-03-18T19:54:37.000Z
opensoap/src/server/SOAPMessageFunc.h
kbore/pbis-open
a05eb9309269b6402b4d6659bc45961986ea5eab
[ "Apache-2.0" ]
317
2016-11-02T17:41:48.000Z
2021-11-08T20:28:19.000Z
opensoap/src/server/SOAPMessageFunc.h
kenferrara/pbis-open
690c325d947b2bf6fb3032f9d660e41b94aea4be
[ "Apache-2.0" ]
107
2016-11-03T19:25:16.000Z
2022-03-20T21:15:22.000Z
/* -*- mode: c++; -*- *----------------------------------------------------------------------------- * $RCSfile: SOAPMessageFunc.h,v $ * * See Copyright for the status of this software. * * The OpenSOAP Project * http://opensoap.jp/ *----------------------------------------------------------------------------- */ #ifndef SOAP_MESSAGEFUNC_H #define SOAP_MESSAGEFUNC_H #include <string> #include <vector> #include <OpenSOAP/Defines.h> #include <OpenSOAP/String.h> #include <OpenSOAP/Envelope.h> //class MsgAttrHandler; #include "MsgAttrHandler.h" static const int OPENSOAP_MESSAGE_LIMIT_SIZE = 1048576; extern std::string OPENSOAP_API createSOAPFaultMessage (std::string faultcodeStr, std::string faultstringStr, std::string faultactorStr, std::string detailStr); extern bool OPENSOAP_API extractOperation(OpenSOAP::MsgAttrHandler& msgAttrHndl, std::string& operationName, std::string* nsPtr = NULL); /* check Messaage ID */ extern bool OPENSOAP_API isItMsgID(OpenSOAP::MsgAttrHandler& msgAttrHndl, bool& itIsMsgID, std::string& msgId); /* check sync or async, and ttl info */ extern bool OPENSOAP_API getAsyncInfoFromHeader(OpenSOAP::MsgAttrHandler& msgAttrHndl, bool& asyncHeaderExist, bool& isAsync); /* check forward */ extern bool OPENSOAP_API getFwdInfoFromHeader(OpenSOAP::MsgAttrHandler& msgAttrHndl, bool& fwdPathExist, std::vector<std::string>& fwdPath, bool& hopCountExist, unsigned int& hopCount); /* Received Path */ bool OPENSOAP_API getReceivedPathInfo(const std::string& soapMsg, bool& receivedPathExist, std::vector<std::string>& receivedPath); /* check TTL */ extern bool OPENSOAP_API getTTLInfo(OpenSOAP::MsgAttrHandler& msgAttrHndl, bool& ttlHeaderExist, unsigned int& ttl, std::string& ttlType); // get message ID from SOAPmessage extern std::string OPENSOAP_API getMsgIDContent(OpenSOAP::MsgAttrHandler& msgAttrHndl); //create fault message for timeout extern std::string OPENSOAP_API makeTimeoutMessage(); //create fault message for operation not exist extern std::string OPENSOAP_API makeOperationNotFoundMessage(); //create fault message for invalid request message extern std::string OPENSOAP_API makeInvalidRequestMessage(); //----- create Falut Messgage of No Entry -----// extern std::string OPENSOAP_API makeNoEntryMessage(); //----- create Falut Messgage in the case of -----// //----- Response from Serive is Empty -----// std::string OPENSOAP_API makeResponseIsEmptyMessage(); //----- create Falut Messgage for limit size over -----// extern std::string OPENSOAP_API makeLimitSizeOverMessage(long limitSize); extern std::string OPENSOAP_API makeFaultMessage(std::string& faultcode, std::string& faultstring); #if 0 //----- attach message ID into request SOAP message ----------// //----- create response SOAPMessage contained message ID -----// //----- use in MsgDrv ----------------------------------------// extern bool OPENSOAP_API attachMsgID(OpenSOAP::MsgAttrHandler& msgAttrHndl, const std::string& fileIdOfRequestSoapMsg, const std::string& operationName, std::string& response); #endif //if 0 //----- attach message ID into SOAP message -----// //----- return message ID -----// //----- use in SrvDrv -----// extern std::string OPENSOAP_API attachOrUpdateMsgID(std::string& soapMsg, std::string msgIDContent); //----- attach backward path to response message, -----// //----- if this server is the final receiver of async fwd message -----// //----- This is used by SrvDrv -----// extern bool OPENSOAP_API attachBackwardPathToResponse(std::string& msgFromService, OpenSOAP::MsgAttrHandler& ); //const std::string& msgFromMsgDrv); //----- attach ttl to response message, -----// //----- if this server is the final receiver of async fwd message -----// //----- This is used by SrvDrv -----// extern bool OPENSOAP_API attachTTLToResponse(std::string& msgFromService, const std::string& msgFromMsgDrv); //attach received_path into SOAP message extern bool OPENSOAP_API attachReceivedPath(std::string& soapMsg, const std::string& url); //attach or update backward_path SOAPmessage extern bool OPENSOAP_API updateBackwardPath(std::string& soapMsg, const std::string& backwardURL); //attach message ID //use service extern bool OPENSOAP_API attachMsgID(std::string& soapMsg, const std::string& msgIDContent); //check response message // use MsgDrv, Forwarder extern bool OPENSOAP_API isItResponseMessage(OpenSOAP::MsgAttrHandler& msgAttrHndl); //----- attach header for Service communication -----// std::string OPENSOAP_API attachHeaderForService(const std::string& soapMsg, const std::string charEnc = ""); //----- remove header for Service communication -----// std::string OPENSOAP_API removeHeaderForService(std::string& soapMsg); //----- return hostname with FQDN -----// std::string OPENSOAP_API getLocalhostName(); //----- check tag undelete ------// bool OPENSOAP_API hasUndeleteTag(OpenSOAP::MsgAttrHandler& msgAttrHndl); //----- convert enc -----// int OPENSOAP_API convertEncoding(std::string& soapMsg, const std::string& fromEnc, const std::string& toEnc); #if 0 //del 2003/06/30 //---- recv message from CGI stdin int OPENSOAP_API recvStdinCGI(std::string& soapMsg); #endif //----- convert enc -----// int OPENSOAP_API convertEncoding(OpenSOAPByteArrayPtr fromStr, const std::string& fromEnc, const std::string& toEnc, std::string& soapMsg); //----- get charset for convert enc ------// bool OPENSOAP_API getEncodingCharset(const std::string& soapMsg, std::string& fromEnc, //std::string& toEnc, bool forCGI = false); //----- replace xml encoding charset -----// bool OPENSOAP_API replaceXmlEncoding(std::string& soapMsg, const std::string& toEnc); std::string OPENSOAP_API createResponseSoapMsgAsResult(const std::string& result); std::string OPENSOAP_API createResponseSoapMsgAsMessageId(const std::string& messageId); int OPENSOAP_API createResponseEnvelopeAsResult(const std::string& result, OpenSOAPEnvelopePtr& request); int OPENSOAP_API createResponseEnvelopeAsMessageId(const std::string& messageId, OpenSOAPEnvelopePtr& request); int OPENSOAP_API convertEnvelopeToString(OpenSOAPEnvelopePtr& request, std::string& response, const char* charEnc); #endif /* SOAP_MESSAGEFUNC_H */
23.007018
79
0.685069
b90dee5fe0bf716ad41820a52f1083dd507d4a08
1,866
h
C
VKHDHeaders/VKNote.h
Anonym0uz/VKPreferences
872932a34c7b0057369c2c7aa9861222b121c3db
[ "MIT" ]
4
2018-11-02T01:08:31.000Z
2019-03-19T20:27:09.000Z
VKHDHeaders/VKNote.h
Anonym0uz/VKPreferences
872932a34c7b0057369c2c7aa9861222b121c3db
[ "MIT" ]
null
null
null
VKHDHeaders/VKNote.h
Anonym0uz/VKPreferences
872932a34c7b0057369c2c7aa9861222b121c3db
[ "MIT" ]
1
2018-11-02T01:08:36.000Z
2018-11-02T01:08:36.000Z
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "VKObject.h" #import "Attachable.h" @class NSNumber, NSString; @interface VKNote : VKObject <Attachable> { NSNumber *_id; NSNumber *_owner_id; NSString *_title; NSString *_text; NSString *_text_wiki; NSNumber *_date; NSNumber *_comments; NSNumber *_read_comments; NSNumber *_privacy; NSNumber *_comment_privacy; NSNumber *_can_comment; NSString *_view_url; } @property(copy, nonatomic) NSString *view_url; // @synthesize view_url=_view_url; @property(retain, nonatomic) NSNumber *can_comment; // @synthesize can_comment=_can_comment; @property(retain, nonatomic) NSNumber *comment_privacy; // @synthesize comment_privacy=_comment_privacy; @property(retain, nonatomic) NSNumber *privacy; // @synthesize privacy=_privacy; @property(retain, nonatomic) NSNumber *read_comments; // @synthesize read_comments=_read_comments; @property(retain, nonatomic) NSNumber *comments; // @synthesize comments=_comments; @property(retain, nonatomic) NSNumber *date; // @synthesize date=_date; @property(copy, nonatomic) NSString *text_wiki; // @synthesize text_wiki=_text_wiki; @property(copy, nonatomic) NSString *text; // @synthesize text=_text; @property(copy, nonatomic) NSString *title; // @synthesize title=_title; @property(retain, nonatomic) NSNumber *owner_id; // @synthesize owner_id=_owner_id; @property(retain, nonatomic) NSNumber *id; // @synthesize id=_id; - (void).cxx_destruct; - (id)attachmentStringLight; - (id)attachmentString; - (id)objectString; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
34.555556
104
0.747053
02a552d0861e6a680b8c2c499ce920c7dc4bddb8
279
h
C
Grungy Sponge/GrungySponge/GrungySponge/Game/Game.h
larsolm/Archives
18968c18b80777e589bc8a704b4375be2fff8eea
[ "MIT" ]
null
null
null
Grungy Sponge/GrungySponge/GrungySponge/Game/Game.h
larsolm/Archives
18968c18b80777e589bc8a704b4375be2fff8eea
[ "MIT" ]
null
null
null
Grungy Sponge/GrungySponge/GrungySponge/Game/Game.h
larsolm/Archives
18968c18b80777e589bc8a704b4375be2fff8eea
[ "MIT" ]
null
null
null
#pragma once #include "GrungySponge/Game/DirtManager.h" #include "GrungySponge/Game/GameManager.h" #include "GrungySponge/Game/LevelDescription.h" #include "GrungySponge/Game/WorldDescription.h" namespace GrungySponge { namespace Game { void Include(); } }
18.6
47
0.734767
fe9d70014962e793ab0279dcc66f6efe8abd1f16
5,037
c
C
src/xroe-app/ip.c
Xilinx/wireless-apps
250286191912d53583b9a08b2f806505804b154a
[ "BSD-3-Clause" ]
10
2018-12-14T20:58:31.000Z
2022-02-14T05:59:49.000Z
src/xroe-app/ip.c
nanakeys/wireless-apps
927f559c3cf18e10c43a711021210d97c465c32f
[ "BSD-3-Clause" ]
1
2020-07-22T02:28:05.000Z
2020-07-22T02:28:05.000Z
src/xroe-app/ip.c
nanakeys/wireless-apps
927f559c3cf18e10c43a711021210d97c465c32f
[ "BSD-3-Clause" ]
12
2018-12-18T09:34:16.000Z
2022-02-16T12:08:37.000Z
// SPDX-License-Identifier: BSD-3-Clause /****************************************************************************** * * Copyright (C) 2018 Xilinx, Inc. * ******************************************************************************/ /** * @file ip.c * @addtogroup command_parser * @{ * * A sample command parser for the RoE Framer software modules. * ******************************************************************************/ /***************************** Include Files *********************************/ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <syslog.h> #include <errno.h> #include <inttypes.h> #include <xroe_types.h> #include <ip_str.h> #include <xroe_api.h> /** * IP_MAX_COMMANDS Number of commands handled by the IP module. */ #define IP_MAX_COMMANDS 4 /************************** Function Prototypes ******************************/ int ip_help_func(int argc, char **argv, char *resp); int ip_peek_func(int argc, char **argv, char *resp); int ip_poke_func(int argc, char **argv, char *resp); /** * ip_cmds The commands handled by the IP module. */ commands_t ip_cmds[IP_MAX_COMMANDS] = { /* Keep this first */ {"help", IP_HELP_STR, ip_help_func}, /* Insert commands here */ {"peek", IP_PEEK_STR, ip_peek_func}, {"poke", IP_POKE_STR, ip_poke_func}, /* Keep this last - insert commands above */ {NULL, NULL, NULL} }; /*****************************************************************************/ /** * * Returns help strings for IP commands. * * * @param [in] argc Number of string arguments. * @param [in] argv Array of strings containg arguments. * @param [out] resp Pointer to string to place response text in. * * @return * - 0 * ******************************************************************************/ int ip_help_func(int argc, char **argv, char *resp) { int i; char *str = resp; str += sprintf(str, "ip help:\n"); for(i=0; ip_cmds[i].cmd != NULL; i++) { str += sprintf(str, "\t%s\t : %s", ip_cmds[i].cmd, ip_cmds[i].helptxt); } return 0; } /*****************************************************************************/ /** * * Returns the 32-bits at the given memory address. * * * @param [in] argc Number of string arguments. * @param [in] argv Array of strings containg arguments. * @param [out] resp Pointer to string to place response text in. * * @return * - 0 * ******************************************************************************/ int ip_peek_func(int argc, char **argv, char *resp) { int buf; int addr; int read = 0; char *str = resp; if(argc == 0) { sprintf(str, "\t%s", IP_PEEK_STR); return(1); } addr = strtol(argv[0], NULL, 0); read = IP_API_Read(addr, (uint8_t *)&buf, sizeof(buf)); if(!read) { str += sprintf(str, "peek: 0x%08x : 0x%08x\n", addr, buf); } else { str += sprintf(str, "ip peek 0x%08x: error %d\n", addr, read); } return 0; } /*****************************************************************************/ /** * * Writes the 32-bits given to the given memory address. * * * @param [in] argc Number of string arguments. * @param [in] argv Array of strings containg arguments. * @param [out] resp Pointer to string to place response text in. * * @return * - 0 * ******************************************************************************/ int ip_poke_func(int argc, char **argv, char *resp) { int buf; int addr; int write = 0; char *str = resp; if(argc < 2) { sprintf(str, "\t%s", IP_POKE_STR); return(1); } addr = strtol(argv[0], NULL, 0); buf = strtol(argv[1], NULL, 0); str += sprintf(str, "addr: 0x%08x, value: 0x%08x\n", addr, buf); write = IP_API_Write(addr, (uint8_t *)&buf, sizeof(buf)); if(!write) { str += sprintf(str, "poke: 0x%08x : 0x%08x\n", addr, buf); } else { str += sprintf(str, "ip poke 0x%08x: error %d\n", addr, write); } return 0; } /*****************************************************************************/ /** * * Parses the input command string and calls a handler function (if found). * * * @param [in] argc Number of string arguments. * @param [in] argv Array of strings containg arguments. * @param [out] resp Pointer to string to place response text in. * * @return * - 1 if no commands tokens found. * - 2 if no handler found for command. * - 0 otherwise. * ******************************************************************************/ int ip_func(int argc, char **argv, char *resp) { int count = 0; int found = 0; char *str = resp; if(argc == 0) { sprintf(str, "\t%s", IP_USAGE_STR); return(1); } for(count=0; ip_cmds[count].cmd != NULL; count++) { if(strcmp(argv[0], ip_cmds[count].cmd)==0) { found = 1; /* Call the handler function for the command given */ ip_cmds[count].func(argc-1, &argv[1], str); } } if(!found) { str += sprintf(str, "Command %s not found, try \"help\"\n", argv[0]); return(2); } return 0; } /** @} */
23
81
0.507445
f29ec257b1c05d0efd23417a46ae87e4f396d017
1,909
h
C
PrototypeCommon/include/PrototypeCommon/Logger.h
o-micron/Prototype
5b9d60d9dd80e7c8a1a2b0aaf19c2d90c1814139
[ "Apache-2.0" ]
2
2021-08-19T17:15:49.000Z
2021-12-28T22:48:47.000Z
PrototypeCommon/include/PrototypeCommon/Logger.h
o-micron/Prototype
5b9d60d9dd80e7c8a1a2b0aaf19c2d90c1814139
[ "Apache-2.0" ]
null
null
null
PrototypeCommon/include/PrototypeCommon/Logger.h
o-micron/Prototype
5b9d60d9dd80e7c8a1a2b0aaf19c2d90c1814139
[ "Apache-2.0" ]
null
null
null
/// Copyright 2021 Omar Sherif Fathy /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. #pragma once #include "Definitions.h" #include <deque> #include <map> #include <string> struct PrototypeLoggerReferencedLog { PrototypeLoggerReferencedLog(std::string filepath, int line, std::string text) : filepath(std::move(filepath)) , line(line) , text(std::move(text)) {} std::string filepath; int line; std::string text; }; struct PrototypeLoggerData { PrototypeLoggerData() : maxLogsCount(1024) {} std::deque<PrototypeLoggerReferencedLog> logs; size_t maxLogsCount; }; struct PrototypeLogger { PrototypeLogger() = delete; ~PrototypeLogger() = delete; static void trace(const char* message, ...); static void log(const char* file, int line, const char* message); static void warn(const char* message, ...); static void error(const char* message, ...); static void fatal(const char* message, ...); static void dump(const char* path, const char* data); static PrototypeLoggerData* data(); static void setData(PrototypeLoggerData* data); private: static void print(const char* status, const char* message, va_list args); static PrototypeLoggerData* _data; };
30.301587
83
0.652698
0469634f6e3426b96d2131b8e7aec5f120b30781
3,796
h
C
Temp/il2cppOutput/il2cppOutput/Vuforia_UnityExtensions_Vuforia_TargetFinderImpl_I2369108641.h
408794550/871AR
3f903d01ae05522413f7be7abb286d1944d00bbb
[ "Apache-2.0" ]
1
2018-08-16T10:43:30.000Z
2018-08-16T10:43:30.000Z
Temp/il2cppOutput/il2cppOutput/Vuforia_UnityExtensions_Vuforia_TargetFinderImpl_I2369108641.h
408794550/871AR
3f903d01ae05522413f7be7abb286d1944d00bbb
[ "Apache-2.0" ]
null
null
null
Temp/il2cppOutput/il2cppOutput/Vuforia_UnityExtensions_Vuforia_TargetFinderImpl_I2369108641.h
408794550/871AR
3f903d01ae05522413f7be7abb286d1944d00bbb
[ "Apache-2.0" ]
null
null
null
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_ValueType3507792607.h" #include "mscorlib_System_IntPtr2504060609.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Vuforia.TargetFinderImpl/InternalTargetSearchResult #pragma pack(push, tp, 1) struct InternalTargetSearchResult_t2369108641 { public: // System.IntPtr Vuforia.TargetFinderImpl/InternalTargetSearchResult::TargetNamePtr IntPtr_t ___TargetNamePtr_0; // System.IntPtr Vuforia.TargetFinderImpl/InternalTargetSearchResult::UniqueTargetIdPtr IntPtr_t ___UniqueTargetIdPtr_1; // System.IntPtr Vuforia.TargetFinderImpl/InternalTargetSearchResult::MetaDataPtr IntPtr_t ___MetaDataPtr_2; // System.IntPtr Vuforia.TargetFinderImpl/InternalTargetSearchResult::TargetSearchResultPtr IntPtr_t ___TargetSearchResultPtr_3; // System.Single Vuforia.TargetFinderImpl/InternalTargetSearchResult::TargetSize float ___TargetSize_4; // System.Int32 Vuforia.TargetFinderImpl/InternalTargetSearchResult::TrackingRating int32_t ___TrackingRating_5; public: inline static int32_t get_offset_of_TargetNamePtr_0() { return static_cast<int32_t>(offsetof(InternalTargetSearchResult_t2369108641, ___TargetNamePtr_0)); } inline IntPtr_t get_TargetNamePtr_0() const { return ___TargetNamePtr_0; } inline IntPtr_t* get_address_of_TargetNamePtr_0() { return &___TargetNamePtr_0; } inline void set_TargetNamePtr_0(IntPtr_t value) { ___TargetNamePtr_0 = value; } inline static int32_t get_offset_of_UniqueTargetIdPtr_1() { return static_cast<int32_t>(offsetof(InternalTargetSearchResult_t2369108641, ___UniqueTargetIdPtr_1)); } inline IntPtr_t get_UniqueTargetIdPtr_1() const { return ___UniqueTargetIdPtr_1; } inline IntPtr_t* get_address_of_UniqueTargetIdPtr_1() { return &___UniqueTargetIdPtr_1; } inline void set_UniqueTargetIdPtr_1(IntPtr_t value) { ___UniqueTargetIdPtr_1 = value; } inline static int32_t get_offset_of_MetaDataPtr_2() { return static_cast<int32_t>(offsetof(InternalTargetSearchResult_t2369108641, ___MetaDataPtr_2)); } inline IntPtr_t get_MetaDataPtr_2() const { return ___MetaDataPtr_2; } inline IntPtr_t* get_address_of_MetaDataPtr_2() { return &___MetaDataPtr_2; } inline void set_MetaDataPtr_2(IntPtr_t value) { ___MetaDataPtr_2 = value; } inline static int32_t get_offset_of_TargetSearchResultPtr_3() { return static_cast<int32_t>(offsetof(InternalTargetSearchResult_t2369108641, ___TargetSearchResultPtr_3)); } inline IntPtr_t get_TargetSearchResultPtr_3() const { return ___TargetSearchResultPtr_3; } inline IntPtr_t* get_address_of_TargetSearchResultPtr_3() { return &___TargetSearchResultPtr_3; } inline void set_TargetSearchResultPtr_3(IntPtr_t value) { ___TargetSearchResultPtr_3 = value; } inline static int32_t get_offset_of_TargetSize_4() { return static_cast<int32_t>(offsetof(InternalTargetSearchResult_t2369108641, ___TargetSize_4)); } inline float get_TargetSize_4() const { return ___TargetSize_4; } inline float* get_address_of_TargetSize_4() { return &___TargetSize_4; } inline void set_TargetSize_4(float value) { ___TargetSize_4 = value; } inline static int32_t get_offset_of_TrackingRating_5() { return static_cast<int32_t>(offsetof(InternalTargetSearchResult_t2369108641, ___TrackingRating_5)); } inline int32_t get_TrackingRating_5() const { return ___TrackingRating_5; } inline int32_t* get_address_of_TrackingRating_5() { return &___TrackingRating_5; } inline void set_TrackingRating_5(int32_t value) { ___TrackingRating_5 = value; } }; #pragma pack(pop, tp) #ifdef __clang__ #pragma clang diagnostic pop #endif
38.734694
173
0.82666
ccb6747502ff352df235214141303d0e8ef505b4
416
h
C
AnimationCollection/AnimationCollection/TransitioningAnimastion/PresentingAnimator.h
QinKingHan/AnimationCollection
513dfd484c9ca7d16ccbb7918fabb75079500931
[ "MIT" ]
1
2017-04-13T01:37:13.000Z
2017-04-13T01:37:13.000Z
AnimationCollection/AnimationCollection/TransitioningAnimastion/PresentingAnimator.h
QinKingHan/AnimationCollection
513dfd484c9ca7d16ccbb7918fabb75079500931
[ "MIT" ]
null
null
null
AnimationCollection/AnimationCollection/TransitioningAnimastion/PresentingAnimator.h
QinKingHan/AnimationCollection
513dfd484c9ca7d16ccbb7918fabb75079500931
[ "MIT" ]
null
null
null
// // PresentingAnimator.h // AnimationCollection // // Created by 鑫鑫 on 2017/4/13. // Copyright © 2017年 xinxin. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface PresentingAnimator : NSObject<UIViewControllerAnimatedTransitioning> /** 初始化 width 传0默认104.f @param width 传0默认104.f @return PresentingAnimator */ +(instancetype)initWithWidth:(CGFloat)width; @end
19.809524
79
0.742788
91f8240f2397b0200fded6cde94e1e9c2a957977
70
c
C
tests/fixtures/stm32f3_project/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c
vznncv/vznncv-cubemx-tools
9d73b578f1afb056accdbbefb66fe1f49337cd84
[ "MIT" ]
3
2018-06-08T23:09:59.000Z
2022-02-17T20:24:25.000Z
tests/fixtures/stm32f3_project/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c
vznncv/vznncv-cubemx-tools
9d73b578f1afb056accdbbefb66fe1f49337cd84
[ "MIT" ]
null
null
null
tests/fixtures/stm32f3_project/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c
vznncv/vznncv-cubemx-tools
9d73b578f1afb056accdbbefb66fe1f49337cd84
[ "MIT" ]
null
null
null
Content stub: Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c
23.333333
55
0.885714
4aa8a3bc30621204827c89c0a2816c0c5cb77cd0
1,700
h
C
intraface/core/HPEstimator.h
FaceAR/intraface-win
46ee608b0a6b5dad2e501252fa013d4028bc0b12
[ "Apache-2.0" ]
4
2016-07-22T09:42:30.000Z
2020-10-31T12:26:42.000Z
intraface/core/HPEstimator.h
KeeganRen/intraface-win
46ee608b0a6b5dad2e501252fa013d4028bc0b12
[ "Apache-2.0" ]
null
null
null
intraface/core/HPEstimator.h
KeeganRen/intraface-win
46ee608b0a6b5dad2e501252fa013d4028bc0b12
[ "Apache-2.0" ]
5
2016-07-22T09:43:25.000Z
2020-06-10T05:54:40.000Z
#ifndef __HP_ESTIMATOR_H__ #define __HP_ESTIMATOR_H__ #include <intraface/Macros.h> //#include <opencv2/core/core_c.h> #include <opencv2/core/core.hpp> using namespace std; namespace facio { /** @ingroup core */ struct HeadPose { enum { PITCH=0, YAW, ROLL }; cv::Mat rot; ///< head rotation matrix used for pre-multiplying cv::Point3f angles; ///< head rotation angles: pitch, yaw, roll cv::Point3f xyz; ///< head translation } ; /** @ingroup core */ /// <summary> /// An abstract class that provides a template for various head pose estimation algorithms /// </summary> class HPEstimator { public: /// <summary> /// Initializes a new instance of the <see cref="HPEstimator"/> class. /// </summary> HPEstimator() : m_focalLength(-1.f), m_prinPoint(cv::Point2f(0.f,0.f)) {} /// <summary> /// Initializes a new instance of the <see cref="HPEstimator"/> class. /// </summary> /// <param name="focalLength">The focal length of the camera in pixels.</param> /// <param name="prinPoint">The principle point of the camera.</param> /*HPEstimator(float focalLength, cv::Point2f prinPoint) : m_focalLength(focalLength), m_prinPoint(prinPoint) {}*/ /// <summary> /// Finalizes an instance of the <see cref="HPEstimator"/> class. /// </summary> virtual ~HPEstimator() {} /// <summary> /// A pure virtual function that estimates the head pose /// </summary> /// <param name="X">The image projection of the facial landmarks.</param> /// <param name="pose">The head pose.</param> virtual void estimateHP(const cv::Mat& X, HeadPose& pose) = 0; protected: float m_focalLength; cv::Point2f m_prinPoint; }; } #endif
23.287671
91
0.663529
faacaa0c47571dcabcb108325afb5b01d9e43170
329
h
C
include/Red/Text/Rendering/FreeType/FreeType.h
OutOfTheVoid/ProjectRed
801327283f5a302be130c90d593b39957c84cce5
[ "MIT" ]
1
2020-06-14T06:14:50.000Z
2020-06-14T06:14:50.000Z
include/Red/Text/Rendering/FreeType/FreeType.h
OutOfTheVoid/ProjectRed
801327283f5a302be130c90d593b39957c84cce5
[ "MIT" ]
null
null
null
include/Red/Text/Rendering/FreeType/FreeType.h
OutOfTheVoid/ProjectRed
801327283f5a302be130c90d593b39957c84cce5
[ "MIT" ]
null
null
null
#ifndef RED_TEXT_RENDERING_FREETYPE_FREETYPE_H #define RED_TEXT_RENDERING_FREETYPE_FREETYPE_H #include <Red/Text/Rendering/Rendering.h> #ifdef RED_OPT_TEXT_RENDERING_FREETYPE namespace Red { namespace Text { namespace Rendering { namespace FreeType { } } } } #endif #endif
9.969697
46
0.68997
7840ecaea88fb3718a625f638a66b41d5ca2b74c
855
c
C
libxlsxwriter/test/unit/utility/test_quote_sheetname.c
White-116/xlsxd
b7f467cda76e93dd17bc7aaa2879e6c112ce4cf9
[ "BSD-3-Clause" ]
7
2019-07-24T14:25:45.000Z
2022-03-06T04:29:39.000Z
libxlsxwriter/test/unit/utility/test_quote_sheetname.c
White-116/xlsxd
b7f467cda76e93dd17bc7aaa2879e6c112ce4cf9
[ "BSD-3-Clause" ]
14
2019-07-03T11:03:05.000Z
2022-01-18T13:55:13.000Z
libxlsxwriter/test/unit/utility/test_quote_sheetname.c
White-116/xlsxd
b7f467cda76e93dd17bc7aaa2879e6c112ce4cf9
[ "BSD-3-Clause" ]
3
2019-08-06T21:35:29.000Z
2021-07-08T08:11:34.000Z
/* * Tests for the libxlsxwriter library. * * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org * */ #include "../ctest.h" #include "../helper.h" #include "xlsxwriter/utility.h" // Test _datetime_to_excel_date(). CTEST(utility, lxw_quote_sheetname) { ASSERT_STR("Sheet1", lxw_quote_sheetname("Sheet1")); ASSERT_STR("Sheet.2", lxw_quote_sheetname("Sheet.2")); ASSERT_STR("Sheet_3", lxw_quote_sheetname("Sheet_3")); ASSERT_STR("'Sheet4'", lxw_quote_sheetname("'Sheet4'")); ASSERT_STR("'Sheet 5'", lxw_quote_sheetname("Sheet 5")); ASSERT_STR("'Sheet!6'", lxw_quote_sheetname("Sheet!6")); ASSERT_STR("'Sheet''7'", lxw_quote_sheetname("Sheet'7")); ASSERT_STR("'a''''''''''''''''''''''''''''''''''''''''''''''''''''''''''b'", lxw_quote_sheetname("a'''''''''''''''''''''''''''''b")); }
31.666667
80
0.594152
d8dd53c5205dd240c136d8d3074cfc1b18cc7a2d
2,441
h
C
PrivateFrameworks/VideosExtras.framework/VideosExtrasZoomableImageView.h
shaojiankui/iOS10-Runtime-Headers
6b0d842bed0c52c2a7c1464087b3081af7e10c43
[ "MIT" ]
36
2016-04-20T04:19:04.000Z
2018-10-08T04:12:25.000Z
PrivateFrameworks/VideosExtras.framework/VideosExtrasZoomableImageView.h
shaojiankui/iOS10-Runtime-Headers
6b0d842bed0c52c2a7c1464087b3081af7e10c43
[ "MIT" ]
null
null
null
PrivateFrameworks/VideosExtras.framework/VideosExtrasZoomableImageView.h
shaojiankui/iOS10-Runtime-Headers
6b0d842bed0c52c2a7c1464087b3081af7e10c43
[ "MIT" ]
10
2016-06-16T02:40:44.000Z
2019-01-15T03:31:45.000Z
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/VideosExtras.framework/VideosExtras */ @interface VideosExtrasZoomableImageView : UIScrollView <UIScrollViewDelegate, VideosExtrasZoomingImageTransitionParticipant> { UIImage * _image; struct CGSize { double width; double height; } _imageSize; struct CGPoint { double x; double y; } _pointToCenterAfterResize; double _scaleToRestoreAfterResize; UIImageView * _zoomView; } @property (readonly, copy) NSString *debugDescription; @property (readonly, copy) NSString *description; @property (readonly) unsigned long long hash; @property (nonatomic, retain) UIImage *image; @property (nonatomic) struct CGSize { double x1; double x2; } imageSize; @property (nonatomic) struct CGPoint { double x1; double x2; } pointToCenterAfterResize; @property (nonatomic) double scaleToRestoreAfterResize; @property (readonly) Class superclass; @property (nonatomic, retain) UIImageView *zoomView; - (void).cxx_destruct; - (struct CGPoint { double x1; double x2; })_maximumContentOffset; - (struct CGPoint { double x1; double x2; })_minimumContentOffset; - (void)_prepareToResize; - (void)_recoverFromResizing; - (void)_updateMinimumAndMaximumZoomScalesForCurrentBounds; - (void)dealloc; - (void)finalizeZoomingImageTransitionWithContext:(id)arg1 transitionFinished:(bool)arg2; - (id)image; - (struct CGSize { double x1; double x2; })imageSize; - (id)initWithFrame:(struct CGRect { struct CGPoint { double x_1_1_1; double x_1_1_2; } x1; struct CGSize { double x_2_1_1; double x_2_1_2; } x2; })arg1; - (void)layoutSubviews; - (void)performZoomingImageTransitionWithContext:(id)arg1; - (struct CGPoint { double x1; double x2; })pointToCenterAfterResize; - (void)prepareZoomingImageTransitionWithContext:(id)arg1; - (double)scaleToRestoreAfterResize; - (void)setFrame:(struct CGRect { struct CGPoint { double x_1_1_1; double x_1_1_2; } x1; struct CGSize { double x_2_1_1; double x_2_1_2; } x2; })arg1; - (void)setImage:(id)arg1; - (void)setImageSize:(struct CGSize { double x1; double x2; })arg1; - (void)setPointToCenterAfterResize:(struct CGPoint { double x1; double x2; })arg1; - (void)setScaleToRestoreAfterResize:(double)arg1; - (void)setZoomView:(id)arg1; - (id)viewForZoomingInScrollView:(id)arg1; - (void)zoomToPoint:(struct CGPoint { double x1; double x2; })arg1 animated:(bool)arg2; - (id)zoomView; @end
43.589286
153
0.754609
9e8161070d38f9620b47af3a65e4393483ef977a
1,208
h
C
BasicFaceTracking/SharedContent/Templates/UWPSDKSampleCX/SampleConfiguration.h
corbanvilla/COV-Face-Tracking
e27f66eeb884509354c194c0f20d2adfb3ec41c9
[ "MIT" ]
null
null
null
BasicFaceTracking/SharedContent/Templates/UWPSDKSampleCX/SampleConfiguration.h
corbanvilla/COV-Face-Tracking
e27f66eeb884509354c194c0f20d2adfb3ec41c9
[ "MIT" ]
null
null
null
BasicFaceTracking/SharedContent/Templates/UWPSDKSampleCX/SampleConfiguration.h
corbanvilla/COV-Face-Tracking
e27f66eeb884509354c194c0f20d2adfb3ec41c9
[ "MIT" ]
null
null
null
//********************************************************* // // 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 #include "pch.h" namespace SDKTemplate { value struct Scenario; partial ref class MainPage { internal: static property Platform::String^ FEATURE_NAME { Platform::String^ get() { return "$safeprojectname$ C++/CX Sample"; } } static property Platform::Array<Scenario>^ scenarios { Platform::Array<Scenario>^ get() { return scenariosInner; } } private: static Platform::Array<Scenario>^ scenariosInner; }; public value struct Scenario { Platform::String^ Title; Platform::String^ ClassName; }; }
25.166667
61
0.509106
cfa46e017a67b67b9239c94a19430af9f37eda35
1,923
h
C
include/swift/Driver/FrontendUtil.h
cachemeifyoucan/swift
6780f3d8c71904ba26c0fca33a1004b5776b9be2
[ "Apache-2.0" ]
15
2019-09-05T14:56:40.000Z
2021-06-06T14:09:23.000Z
include/swift/Driver/FrontendUtil.h
SunSatan/swift
aa6e600d6adeea630eb304f7572ef4ef71c262dd
[ "Apache-2.0" ]
8
2020-08-29T22:47:59.000Z
2020-09-20T03:24:15.000Z
include/swift/Driver/FrontendUtil.h
SunSatan/swift
aa6e600d6adeea630eb304f7572ef4ef71c262dd
[ "Apache-2.0" ]
3
2017-07-19T07:46:15.000Z
2021-08-22T23:44:00.000Z
//===--- FrontendUtil.h - Driver Utilities for Frontend ---------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef SWIFT_DRIVER_FRONTENDUTIL_H #define SWIFT_DRIVER_FRONTENDUTIL_H #include "swift/Basic/LLVM.h" #include "llvm/ADT/STLExtras.h" #include <memory> namespace swift { class DiagnosticEngine; namespace driver { /// Generates the list of arguments that would be passed to the compiler /// frontend from the given driver arguments. /// /// \param ArgList The driver arguments (i.e. normal arguments for \c swiftc). /// \param Diags The DiagnosticEngine used to report any errors parsing the /// arguments. /// \param Action Called with the list of frontend arguments if there were no /// errors in processing \p ArgList. This is a callback rather than a return /// value to avoid copying the arguments more than necessary. /// \param ForceNoOutputs If true, override the output mode to "-typecheck" and /// produce no outputs. For example, this disables "-emit-module" and "-c" and /// prevents the creation of temporary files. /// /// \returns True on error, or if \p Action returns true. /// /// \note This function is not intended to create invocations which are /// suitable for use in REPL or immediate modes. bool getSingleFrontendInvocationFromDriverArguments( ArrayRef<const char *> ArgList, DiagnosticEngine &Diags, llvm::function_ref<bool(ArrayRef<const char *> FrontendArgs)> Action, bool ForceNoOutputs = false); } // end namespace driver } // end namespace swift #endif
36.283019
80
0.707228
9a818eec588b00e2606a1183ae5e794b27dfcea6
1,973
h
C
ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
google-ar/chromium
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
777
2017-08-29T15:15:32.000Z
2022-03-21T05:29:41.000Z
ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
harrymarkovskiy/WebARonARCore
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
66
2017-08-30T18:31:18.000Z
2021-08-02T10:59:35.000Z
ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h
harrymarkovskiy/WebARonARCore
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
123
2017-08-30T01:19:34.000Z
2022-03-17T22:55:31.000Z
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ #define ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ #include "ash/common/keyboard/keyboard_ui_observer.h" #include "ash/common/system/tray/tray_background_view.h" #include "base/macros.h" #include "ui/keyboard/keyboard_controller_observer.h" namespace views { class ImageView; } namespace ash { // TODO(sky): make this visible on non-chromeos platforms. class VirtualKeyboardTray : public TrayBackgroundView, public KeyboardUIObserver, public keyboard::KeyboardControllerObserver { public: explicit VirtualKeyboardTray(WmShelf* wm_shelf); ~VirtualKeyboardTray() override; // TrayBackgroundView: void SetShelfAlignment(ShelfAlignment alignment) override; base::string16 GetAccessibleNameForTray() override; void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; void ClickedOutsideBubble() override; bool PerformAction(const ui::Event& event) override; // KeyboardUIObserver: void OnKeyboardEnabledStateChanged(bool new_enabled) override; // keyboard::KeyboardControllerObserver: void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; void OnKeyboardClosed() override; private: // Creates a new border for the icon. The padding is determined based on the // alignment of the shelf. void SetIconBorderForShelfAlignment(); void ObserveKeyboardController(); void UnobserveKeyboardController(); // Weak pointer, will be parented by TrayContainer for its lifetime. views::ImageView* icon_; WmShelf* wm_shelf_; DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardTray); }; } // namespace ash #endif // ASH_COMMON_SYSTEM_CHROMEOS_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_
32.883333
79
0.782058
82917291f5bd90044b42a42c2d4fcd82b251ffc0
3,009
c
C
Runtime/port/portexn.c
dkuspawono/TILT-Compiler
966ae8de37ac0d729aa2b5baeae7580aed7294de
[ "MIT-CMU" ]
44
2015-01-14T15:58:10.000Z
2021-11-14T17:09:10.000Z
Runtime/port/portexn.c
dkuspawono/TILT-Compiler
966ae8de37ac0d729aa2b5baeae7580aed7294de
[ "MIT-CMU" ]
null
null
null
Runtime/port/portexn.c
dkuspawono/TILT-Compiler
966ae8de37ac0d729aa2b5baeae7580aed7294de
[ "MIT-CMU" ]
3
2015-09-26T06:31:15.000Z
2018-01-07T12:45:23.000Z
#include "s.h" #include "r.h" enum { /* The fields of an exn record. */ Stamp=0, Arg, Name, BadStamp = ~1, }; static val_t subStamp = BadStamp; static val_t divStamp = BadStamp; static val_t ovflStamp = BadStamp; static val_t sysErrStamp = BadStamp; static val_t libFailStamp = BadStamp; static val_t get_stamp(exn e) { return get_record(e,Stamp); } static val_t get_arg(exn e) { return get_record(e,Arg); } string exnNameRuntime(exn e) { return (string)get_record(e,Name); } /* The Basis library should use the following to tell the runtime about some key ML level exceptions. */ unit registerSubExnRuntime(exn exn) { subStamp = get_stamp(exn); return empty_record; } unit registerDivExnRuntime(exn exn) { divStamp = get_stamp(exn); return empty_record; } unit registerOvflExnRuntime(exn exn) { ovflStamp = get_stamp(exn); return empty_record; } unit registerSysErrExnRuntime(exn exn) { sysErrStamp = get_stamp(exn); return empty_record; } unit registerLibFailExnRuntime(exn exn) { libFailStamp = get_stamp(exn); return empty_record; } val_t getSubStamp(void) { if(subStamp == BadStamp) DIE("SubStamp uninitialized"); return subStamp; } val_t getDivStamp(void) { if(divStamp == BadStamp) DIE("DivStamp uninitialized"); return divStamp; } val_t getOvflStamp(void) { if(ovflStamp == BadStamp) DIE("OverflowStamp uninitialized"); return ovflStamp; } static val_t getSysErrStamp(void) { if(sysErrStamp == BadStamp) DIE("SysErrStamp uninitialized"); return sysErrStamp; } static val_t getLibFailStamp(void) { if(libFailStamp == BadStamp) DIE("libFailStamp uninitialized"); return libFailStamp; } string exnMessageRuntime(exn exn) { char buf[1024]; val_t exnstamp = get_stamp(exn); if (exnstamp == getDivStamp()) { strcpy(buf, "divide by zero"); } else if (exnstamp == getOvflStamp()) { strcpy(buf, "overflow"); } else if (exnstamp == getSubStamp()) { strcpy(buf, "subscript out of bounds"); } else if (exnstamp == getLibFailStamp()) { const char* prefix = "LibFail: "; string msg = (string) get_arg(exn); int msg_len = stringlen(msg); assert(sizeof(buf) > sizeof(prefix) + msg_len); sprintf(buf, "%s%.*s", prefix, msg_len, stringbuf(msg)); } else if (exnstamp == getSysErrStamp()) { ptr_t exnarg = (ptr_t)get_arg(exn); const char* prefix = "SysErr: "; string msg = (string) get_record(exnarg, 0); int msg_len = stringlen(msg); ptr_t err_option = (ptr_t) get_record(exnarg, 1); int isSome = err_option != 0; int err = isSome ? (int)get_record(err_option, 0) : 0; char err_buf[40]; if (isSome) { sprintf(err_buf, " (errno=%d)", err); } else { *err_buf = '\0'; } assert(sizeof(buf) > sizeof(prefix) + msg_len + strlen(err_buf)); sprintf(buf, "%s%.*s%s", prefix, msg_len, stringbuf(msg), err_buf); } else { string name = exnNameRuntime(exn); int name_len = stringlen(name); assert(sizeof(buf) > name_len); sprintf(buf, "%.*s", name_len, stringbuf(name)); } return cstring2mlstring_alloc(buf); }
19.288462
69
0.698903
961c0bf5650b55cc5abfa44a765a8adbf87c54e0
1,413
h
C
include/circt/Conversion/Passes.h
jopperm/circt
56d7fa356d6662111cfc5026c4288e4755ae1393
[ "Apache-2.0" ]
null
null
null
include/circt/Conversion/Passes.h
jopperm/circt
56d7fa356d6662111cfc5026c4288e4755ae1393
[ "Apache-2.0" ]
1
2021-11-25T14:12:00.000Z
2021-11-26T17:09:53.000Z
include/circt/Conversion/Passes.h
jopperm/circt
56d7fa356d6662111cfc5026c4288e4755ae1393
[ "Apache-2.0" ]
null
null
null
//===- Passes.h - Conversion Pass Construction and Registration -*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This fle contains the declarations to register conversion passes. // //===----------------------------------------------------------------------===// #ifndef CIRCT_CONVERSION_PASSES_H #define CIRCT_CONVERSION_PASSES_H #include "circt/Conversion/AffineToStaticLogic.h" #include "circt/Conversion/CalyxToHW.h" #include "circt/Conversion/ExportVerilog.h" #include "circt/Conversion/FIRRTLToHW.h" #include "circt/Conversion/HWToLLHD.h" #include "circt/Conversion/HandshakeToFIRRTL.h" #include "circt/Conversion/LLHDToLLVM.h" #include "circt/Conversion/SCFToCalyx.h" #include "circt/Conversion/StandardToHandshake.h" #include "circt/Conversion/StandardToStaticLogic.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassRegistry.h" namespace mlir { namespace arith { class ArithmeticDialect; } // namespace arith } // namespace mlir namespace circt { // Generate the code for registering conversion passes. #define GEN_PASS_REGISTRATION #include "circt/Conversion/Passes.h.inc" } // namespace circt #endif // CIRCT_CONVERSION_PASSES_H
32.113636
80
0.688606
aaf5bd45b246d0ce89653cad2097f00af47ee255
1,911
h
C
Engine/Src/SFEngine/Application/SFApplicationBase.h
blue3k/StormForge
1557e699a673ae9adcc8f987868139f601ec0887
[ "Apache-2.0" ]
1
2020-06-20T07:35:25.000Z
2020-06-20T07:35:25.000Z
Engine/Src/SFEngine/Application/SFApplicationBase.h
blue3k/StormForge
1557e699a673ae9adcc8f987868139f601ec0887
[ "Apache-2.0" ]
null
null
null
Engine/Src/SFEngine/Application/SFApplicationBase.h
blue3k/StormForge
1557e699a673ae9adcc8f987868139f601ec0887
[ "Apache-2.0" ]
null
null
null
//////////////////////////////////////////////////////////////////////////////// // // CopyRight (c) 2016 Kyungkun Ko // // Author : KyungKun Ko // // Description : Basic android application // // //////////////////////////////////////////////////////////////////////////////// #pragma once #include "Container/SFCircularPageQueue.h" #include "EngineObject/SFEngineObject.h" #include "EngineObject/SFEngineTask.h" #include "SFEngine.h" namespace SF { class Command; class ApplicationBase : public LibraryComponent { public: private: Heap m_Heap; CircularPageQueueAtomic<Command*> m_CommandQueue; bool m_IsPaused; private: public: ApplicationBase(); ~ApplicationBase(); IHeap& GetHeap() { return *m_Heap.get(); } virtual Result InitializeComponent() override; virtual void DeinitializeComponent() override; virtual bool HandleKeyInput(int type, int action, int flags, int keyCode) { return false; } virtual bool HandleInput(int type, int motionAction, int flags, int buttonState, float x, float y) { return false; } bool IsPaused() { return m_IsPaused; } void SetPaused(bool paused) { m_IsPaused = paused; } template<class CommandType> CommandType* SendCommand() { auto pCommand = new(GetHeap()) CommandType(this); pCommand->Request(); return pCommand; } template<class CommandType, class ...ArgTypes> CommandType* SendCommand(ArgTypes... args) { auto pCommand = new(GetHeap()) CommandType(this, args...); pCommand->Request(); return pCommand; } }; ///////////////////////////////////////////////////////////////// // // Command // class AppTask : public EngineTask { private: public: AppTask(); }; //class InputCommand : public Command //{ //public: // virtual void Run() override; //}; }
18.553398
119
0.570382
5ca6d943f193a1a817adb2c20fcf491b0680127f
3,487
h
C
src/webkit/glue/dom_operations.h
jxjnjjn/chromium
435c1d02fd1b99001dc9e1e831632c894523580d
[ "Apache-2.0" ]
9
2018-09-21T05:36:12.000Z
2021-11-15T15:14:36.000Z
src/webkit/glue/dom_operations.h
jxjnjjn/chromium
435c1d02fd1b99001dc9e1e831632c894523580d
[ "Apache-2.0" ]
null
null
null
src/webkit/glue/dom_operations.h
jxjnjjn/chromium
435c1d02fd1b99001dc9e1e831632c894523580d
[ "Apache-2.0" ]
3
2018-11-28T14:54:13.000Z
2020-07-02T07:36:07.000Z
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_DOM_OPERATIONS_H__ #define WEBKIT_GLUE_DOM_OPERATIONS_H__ #include <string> #include <vector> #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h" #include "webkit/glue/webkit_glue_export.h" namespace WebKit { class WebDocument; class WebElement; class WebString; class WebView; } // A collection of operations that access the underlying WebKit DOM directly. namespace webkit_glue { // Structure for storage the result of getting all savable resource links // for current page. The consumer of the SavableResourcesResult is responsible // for keeping these pointers valid for the lifetime of the // SavableResourcesResult instance. struct SavableResourcesResult { // vector which contains all savable links of sub resource. std::vector<GURL>* resources_list; // vector which contains corresponding all referral links of sub resource, // it matched with links one by one. std::vector<GURL>* referrer_urls_list; // and the corresponding referrer policies. std::vector<WebKit::WebReferrerPolicy>* referrer_policies_list; // vector which contains all savable links of main frame and sub frames. std::vector<GURL>* frames_list; // Constructor. SavableResourcesResult( std::vector<GURL>* resources_list, std::vector<GURL>* referrer_urls_list, std::vector<WebKit::WebReferrerPolicy>* referrer_policies_list, std::vector<GURL>* frames_list) : resources_list(resources_list), referrer_urls_list(referrer_urls_list), referrer_policies_list(referrer_policies_list), frames_list(frames_list) { } private: DISALLOW_COPY_AND_ASSIGN(SavableResourcesResult); }; // Get all savable resource links from current webview, include main frame // and sub-frame. After collecting all savable resource links, this function // will send those links to embedder. Return value indicates whether we get // all saved resource links successfully. WEBKIT_GLUE_EXPORT bool GetAllSavableResourceLinksForCurrentPage( WebKit::WebView* view, const GURL& page_url, SavableResourcesResult* savable_resources_result, const char** savable_schemes); // Returns true if the element with |element_id| as its id has autocomplete // on. bool ElementDoesAutoCompleteForElementWithId(WebKit::WebView* view, const std::string& element_id); // Returns the value in an elements resource url attribute. For IMG, SCRIPT or // INPUT TYPE=image, returns the value in "src". For LINK TYPE=text/css, returns // the value in "href". For BODY, TABLE, TR, TD, returns the value in // "background". For BLOCKQUOTE, Q, DEL, INS, returns the value in "cite" // attribute. Otherwise returns a null WebString. WEBKIT_GLUE_EXPORT WebKit::WebString GetSubResourceLinkFromElement( const WebKit::WebElement& element); // Puts the meta-elements of |document| that have the attribute |attribute_name| // with a value of |attribute_value| in |meta_elements|. WEBKIT_GLUE_EXPORT void GetMetaElementsWithAttribute( WebKit::WebDocument* document, const base::string16& attribute_name, const base::string16& atribute_value, std::vector<WebKit::WebElement>* meta_elements); } // namespace webkit_glue #endif // WEBKIT_GLUE_DOM_OPERATIONS_H__
39.625
81
0.762833
47abe6fdb1707eeb047580a880aec4122ef41b5c
421
h
C
tests/check-compat.h
awujek/lldpd
e25f1966e0d0b810ab88813b519e52efe4c62923
[ "0BSD" ]
312
2015-01-18T15:36:55.000Z
2020-11-10T02:58:53.000Z
tests/check-compat.h
awujek/lldpd
e25f1966e0d0b810ab88813b519e52efe4c62923
[ "0BSD" ]
308
2015-01-12T13:57:09.000Z
2020-11-12T01:22:42.000Z
tests/check-compat.h
awujek/lldpd
e25f1966e0d0b810ab88813b519e52efe4c62923
[ "0BSD" ]
129
2015-01-20T03:42:22.000Z
2020-09-26T01:46:27.000Z
#ifndef _CHECK_COMPAT_H #define _CHECK_COMPAT_H #if (CHECK_MAJOR_VERSION == 0 && (CHECK_MINOR_VERSION < 9 || (CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION < 10))) # define ck_assert_ptr_eq(X,Y) do { \ void* _ck_x = (X); \ void* _ck_y = (Y); \ ck_assert_msg(_ck_x == _ck_y, \ "Assertion '"#X"=="#Y"' failed: "#X"==%p, "#Y"==%p", \ _ck_x, _ck_y); \ } while (0) #endif #endif
28.066667
117
0.572447
df924a1d91d7a863e9894c210d4ffbfce3f4bee3
6,523
h
C
src/Pegasus/Compiler/objname.h
ncultra/Pegasus-2.5
4a0b9a1b37e2eae5c8105fdea631582dc2333f9a
[ "MIT" ]
null
null
null
src/Pegasus/Compiler/objname.h
ncultra/Pegasus-2.5
4a0b9a1b37e2eae5c8105fdea631582dc2333f9a
[ "MIT" ]
null
null
null
src/Pegasus/Compiler/objname.h
ncultra/Pegasus-2.5
4a0b9a1b37e2eae5c8105fdea631582dc2333f9a
[ "MIT" ]
1
2022-03-07T22:54:02.000Z
2022-03-07T22:54:02.000Z
//%2005//////////////////////////////////////////////////////////////////////// // // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; // IBM Corp.; EMC Corporation, The Open Group. // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // EMC Corporation; VERITAS Software Corporation; The Open Group. // // 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. // //============================================================================== // // Author: Bob Blair (bblair@bmc.com) // // Modified By: // //%///////////////////////////////////////////////////////////////////////////// // // Header for a class to generate CIMValue objects from String values // // // // Make an object reference available in its parts. // // An object name has 3 parts: namespaceType, namespaceHandle and modelPath // For example, in the object name // http://somehost:1234/a/b/c:myobj.first="top", last="cat" // the parts are // namespaceType -- http: // namespaceHandle -- /somehost:a/b/c // modelPath -- myobj.first="top", last="cat" // // The namespaceHandle has two components: host and path. // In the example above, this divides as // host -- somehost // path -- /a/b/c // // The host may have two components: a host name and a port. // host -- hostname:1234 // // The modelPath has two components as well: className and CIMKeyBindings. // In the example, // className -- myobj // CIMKeyBindings -- first="top", last="cat" // // This class allows you to convert among various forms of the object name: // -- the String (as above) // -- the decomposed pieces // -- an instance object // -- a reference object // // This class uses components from pegasus/Common #ifndef _PEGASUS_COMPILER_OBJNAME_H_ #define _PEGASUS_COMPILER_OBJNAME_H_ #include <Pegasus/Common/CIMObjectPath.h> #include <Pegasus/Common/CIMInstance.h> #include <Pegasus/Common/String.h> #include <Pegasus/Compiler/Linkage.h> PEGASUS_NAMESPACE_BEGIN class PEGASUS_COMPILER_LINKAGE namespaceHandle { private: String _Stringrep; String _host; String _path; void namespaceHandleRepToComponents(const String &rep); const String &namespaceHandleComponentsToRep(); public: namespaceHandle(const String &Stringrep); namespaceHandle(const String &host, const String &path); ~namespaceHandle() {;} const String &Stringrep() { return _Stringrep == "" ? namespaceHandleComponentsToRep() : _Stringrep; } const String &host() { return _host; } const String &path() { return _path; } }; class PEGASUS_COMPILER_LINKAGE modelPath { private: String _Stringrep; String _className; String _keyString; Array<CIMKeyBinding> _KeyBindings; void modelPathRepToComponents(const String &rep); const String &modelPathComponentsToRep(); public: modelPath(const String &Stringrep); modelPath(const String &classname, const String &keyString); modelPath(const String &classname, const Array<CIMKeyBinding>&bindings); ~modelPath(); static CIMKeyBinding::Type KeyBindingTypeOf(const String &s); const String &Stringrep() { return modelPathComponentsToRep(); } const String &className() { return _className; } const String &keyString() { return KeyBindingsToKeyString(); } const String &KeyBindingsToKeyString(); const Array<CIMKeyBinding>& KeyBindings() { return _KeyBindings; } }; class PEGASUS_COMPILER_LINKAGE objectName { private: String _Stringrep; String _namespaceType; namespaceHandle *_namespaceHandle; modelPath *_modelPath; CIMObjectPath *_reference; CIMInstance *_instance; Array<CIMKeyBinding> _empty; public: objectName(); objectName(const String &Stringrep); objectName(const String &namespaceType, const String &namespaceHandle, const String &modelPath); objectName(const String &namespaceType, const String &host, const String &path, const String &modelpath); objectName(const String &namespaceType, const String &host, const String &path, const String &classname, const String &keyString); objectName(const CIMInstance &instance); ~objectName(); void set(const String &rep); void set(const String &namespaceType, const String &namespaceHandle, const String &modelPath); const String &Stringrep() { return _Stringrep; } const String &namespaceType() { return _namespaceType; } const String &handle() const { return _namespaceHandle ? _namespaceHandle->Stringrep() : String::EMPTY; } const String &host() const { return _namespaceHandle ? _namespaceHandle->host() : String::EMPTY; } const String &path() { return _namespaceHandle ? _namespaceHandle->path() : String::EMPTY; } const String &modelpath() { return _modelPath ? _modelPath->Stringrep() : String::EMPTY; } const String &className() const { return _modelPath ? _modelPath->className() : String::EMPTY; } const String &keyString() { return _modelPath ? _modelPath->keyString() : String::EMPTY; } const Array<CIMKeyBinding> &KeyBindings() const { return _modelPath ? _modelPath->KeyBindings() : _empty; } const CIMInstance *instance() { return _instance; } }; PEGASUS_NAMESPACE_END #endif
37.705202
80
0.700751
d7e6a97ff69f53ed6975c93ccdbf175df343accb
1,594
h
C
include/RE/Offsets.h
lfrazer/EngineFixesSkyrimVR
ecec3baec20b6dbdcb5afe4a56186134dca2ff5a
[ "MIT" ]
6
2020-04-08T04:45:19.000Z
2020-12-06T04:48:26.000Z
include/RE/Offsets.h
lfrazer/EngineFixesSkyrimVR
ecec3baec20b6dbdcb5afe4a56186134dca2ff5a
[ "MIT" ]
null
null
null
include/RE/Offsets.h
lfrazer/EngineFixesSkyrimVR
ecec3baec20b6dbdcb5afe4a56186134dca2ff5a
[ "MIT" ]
1
2020-04-10T18:10:51.000Z
2020-04-10T18:10:51.000Z
namespace RE { namespace Offset { // Fixed with VR addresses namespace MemoryManager { // DirectSig: 48 89 5C 24 ? 55 57 41 54 41 55 41 57 48 83 EC 30 65 48 8B 04 25 ? ? ? ? // DIFF: 1.00 0.99 ------- 0000000140C02260 sub_0000000140C02260 0000000140C3D0E0 Heap__Allocate constexpr std::uintptr_t Allocate = 0xC3D0E0; //0x00C02260; // 1_5_97 // DirectSig: 48 85 D2 0F 84 ? ? ? ? 48 89 5C 24 ? 48 89 54 24 ? 57 48 83 EC 20 80 39 00 //1.00 0.99 ------- 0000000140C02560 sub_0000000140C02560 0000000140C3D3E0 Heap__Free call reference matching 21 21 21 79 79 79 27 27 27 constexpr std::uintptr_t Deallocate = 0xC3D3E0; //0x00C02560; // 1_5_97 // DirectSig: 40 53 48 83 EC 20 83 3D ? ? ? ? ? 74 1F //1.00 0.99 ------- 00000001400FCFE0 sub_00000001400FCFE0 000000014010D590 sub_000000014010D590 call reference matching 3 3 3 16 16 16 2 2 2 constexpr std::uintptr_t GetSingleton = 0x10D590; //0x000FCFE0; // 1_5_97 // DirectSig: 40 56 57 41 54 41 56 41 57 48 83 EC 30 48 C7 44 24 ? ? ? ? ? 48 89 5C 24 ? 48 89 6C 24 ? 48 8B F1 33 ED //1.00 0.99 ------- 0000000140C01800 sub_0000000140C01800 0000000140C3C680 sub_0000000140C3C680 call reference matching 8 8 8 62 62 62 10 10 10 constexpr std::uintptr_t GetThreadScrapHeap = 0xC3C680; //0x00C01800; // 1_5_97 // IndirectSig: E8 ? ? ? ? 3B 77 48 // 1.00 0.99 ------- 0000000140C024B0 sub_0000000140C024B0 0000000140C3D330 sub_0000000140C3D330 call reference matching 7 7 7 48 48 48 8 8 8 constexpr std::uintptr_t Reallocate = 0xC3D330; //0x00C024B0; // 1_5_97 } } }
43.081081
148
0.683187
a3c039f129050a27c7cd360b19a36e29ede24b25
2,039
h
C
Project 19-/Common/Material.h
MKXJun/DX11-Without-DirectX-SDK
31756de150248fc8f4ccb6ce0c5e2837da718c2d
[ "MIT" ]
3
2018-05-29T12:18:08.000Z
2018-06-20T16:14:13.000Z
Project 19-/Common/Material.h
MKXJun/DX11-Without-DirectX-SDK
31756de150248fc8f4ccb6ce0c5e2837da718c2d
[ "MIT" ]
null
null
null
Project 19-/Common/Material.h
MKXJun/DX11-Without-DirectX-SDK
31756de150248fc8f4ccb6ce0c5e2837da718c2d
[ "MIT" ]
null
null
null
//*************************************************************************************** // MeshData.h by X_Jun(MKXJun) (C) 2018-2022 All Rights Reserved. // Licensed under the MIT License. // // 存放材质与属性 // Material and property storage. //*************************************************************************************** #pragma once #ifndef MATERIAL_H #define MATERIAL_H #include <string_view> #include <unordered_map> #include "XUtil.h" #include "Property.h" class Material { public: Material() = default; void Clear() { m_Properties.clear(); } template<class T> void Set(std::string_view name, const T& value) { static_assert(IsVariantMember<T, Property>::value, "Type T isn't one of the Property types!"); m_Properties[StringToID(name)] = value; } template<class T> const T& Get(std::string_view name) const { auto it = m_Properties.find(StringToID(name)); return std::get<T>(it->second); } template<class T> T& Get(std::string_view name) { return const_cast<T&>(static_cast<const Material*>(this)->Get<T>(name)); } template<class T> bool Has(std::string_view name) const { auto it = m_Properties.find(StringToID(name)); if (it == m_Properties.end() || !std::holds_alternative<T>(it->second)) return false; return true; } template<class T> const T* TryGet(std::string_view name) const { auto it = m_Properties.find(StringToID(name)); if (it != m_Properties.end()) return &std::get<T>(it->second); else return nullptr; } template<class T> T* TryGet(std::string_view name) { return const_cast<T*>(static_cast<const Material*>(this)->TryGet<T>(name)); } bool HasProperty(std::string_view name) const { return m_Properties.find(StringToID(name)) != m_Properties.end(); } private: std::unordered_map<XID, Property> m_Properties; }; #endif
23.436782
102
0.562531
d8ca323e3214c696439d7e553e52ce12e582bad9
4,992
h
C
MPLAB.X/pin_manager.h
furbrain/XPRESS-Loader
2b9c013f487b9e78c352dee30d2f1ba048f89cb8
[ "Apache-2.0" ]
null
null
null
MPLAB.X/pin_manager.h
furbrain/XPRESS-Loader
2b9c013f487b9e78c352dee30d2f1ba048f89cb8
[ "Apache-2.0" ]
null
null
null
MPLAB.X/pin_manager.h
furbrain/XPRESS-Loader
2b9c013f487b9e78c352dee30d2f1ba048f89cb8
[ "Apache-2.0" ]
null
null
null
/** @Generated Pin Manager Header File @Company: Microchip Technology Inc. @File Name: pin_manager.h @Summary: This is the Pin Manager file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs @Description This header file provides APIs for driver for . Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.77 Device : PIC16F1455 Driver Version : 2.11 The generated drivers are tested against the following: Compiler : XC8 2.05 and above MPLAB : MPLAB X 5.20 */ /* (c) 2018 Microchip Technology Inc. and its subsidiaries. Subject to your compliance with these terms, you may use Microchip software and any derivatives exclusively with Microchip products. It is your responsibility to comply with third party license terms applicable to your use of third party software (including open source software) that may accompany Microchip software. THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. */ #ifndef PIN_MANAGER_H #define PIN_MANAGER_H /** Section: Included Files */ #include <xc.h> #define INPUT 1 #define OUTPUT 0 #define HIGH 1 #define LOW 0 #define ANALOG 1 #define DIGITAL 0 #define PULL_UP_ENABLED 1 #define PULL_UP_DISABLED 0 // get/set NEOPIXEL aliases #define NEOPIXEL_TRIS TRISCbits.TRISC2 #define NEOPIXEL_LAT LATCbits.LATC2 #define NEOPIXEL_PORT PORTCbits.RC2 #define NEOPIXEL_ANS ANSELCbits.ANSC2 #define NEOPIXEL_SetHigh() do { LATCbits.LATC2 = 1; } while(0) #define NEOPIXEL_SetLow() do { LATCbits.LATC2 = 0; } while(0) #define NEOPIXEL_Toggle() do { LATCbits.LATC2 = ~LATCbits.LATC2; } while(0) #define NEOPIXEL_GetValue() PORTCbits.RC2 #define NEOPIXEL_SetDigitalInput() do { TRISCbits.TRISC2 = 1; } while(0) #define NEOPIXEL_SetDigitalOutput() do { TRISCbits.TRISC2 = 0; } while(0) #define NEOPIXEL_SetAnalogMode() do { ANSELCbits.ANSC2 = 1; } while(0) #define NEOPIXEL_SetDigitalMode() do { ANSELCbits.ANSC2 = 0; } while(0) // get/set LED aliases #define LED_TRIS TRISCbits.TRISC3 #define LED_LAT LATCbits.LATC3 #define LED_PORT PORTCbits.RC3 #define LED_ANS ANSELCbits.ANSC3 #define LED_SetHigh() do { LATCbits.LATC3 = 1; } while(0) #define LED_SetLow() do { LATCbits.LATC3 = 0; } while(0) #define LED_Toggle() do { LATCbits.LATC3 = ~LATCbits.LATC3; } while(0) #define LED_GetValue() PORTCbits.RC3 #define LED_SetDigitalInput() do { TRISCbits.TRISC3 = 1; } while(0) #define LED_SetDigitalOutput() do { TRISCbits.TRISC3 = 0; } while(0) #define LED_SetAnalogMode() do { ANSELCbits.ANSC3 = 1; } while(0) #define LED_SetDigitalMode() do { ANSELCbits.ANSC3 = 0; } while(0) // get/set RC4 procedures #define RC4_SetHigh() do { LATCbits.LATC4 = 1; } while(0) #define RC4_SetLow() do { LATCbits.LATC4 = 0; } while(0) #define RC4_Toggle() do { LATCbits.LATC4 = ~LATCbits.LATC4; } while(0) #define RC4_GetValue() PORTCbits.RC4 #define RC4_SetDigitalInput() do { TRISCbits.TRISC4 = 1; } while(0) #define RC4_SetDigitalOutput() do { TRISCbits.TRISC4 = 0; } while(0) // get/set RC5 procedures #define RC5_SetHigh() do { LATCbits.LATC5 = 1; } while(0) #define RC5_SetLow() do { LATCbits.LATC5 = 0; } while(0) #define RC5_Toggle() do { LATCbits.LATC5 = ~LATCbits.LATC5; } while(0) #define RC5_GetValue() PORTCbits.RC5 #define RC5_SetDigitalInput() do { TRISCbits.TRISC5 = 1; } while(0) #define RC5_SetDigitalOutput() do { TRISCbits.TRISC5 = 0; } while(0) /** @Param none @Returns none @Description GPIO and peripheral I/O initialization @Example PIN_MANAGER_Initialize(); */ void PIN_MANAGER_Initialize (void); /** * @Param none * @Returns none * @Description Interrupt on Change Handling routine * @Example PIN_MANAGER_IOC(); */ void PIN_MANAGER_IOC(void); #endif // PIN_MANAGER_H /** End of File */
35.404255
106
0.659856
945ad5279d34a67167ed4ccf4ada09b5c44ed79c
1,352
h
C
trunk/LogonNP/Npaux.h
fengjixuchui/LogonNP
0dd40de6edc49ba9a81a108ea66ba348f64c7d20
[ "MIT" ]
null
null
null
trunk/LogonNP/Npaux.h
fengjixuchui/LogonNP
0dd40de6edc49ba9a81a108ea66ba348f64c7d20
[ "MIT" ]
null
null
null
trunk/LogonNP/Npaux.h
fengjixuchui/LogonNP
0dd40de6edc49ba9a81a108ea66ba348f64c7d20
[ "MIT" ]
2
2022-01-16T08:52:06.000Z
2022-03-23T17:34:48.000Z
/*--------------------------------------------------------------- THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. Copyright (C) 1998 - 2000. Microsoft Corporation. All rights reserved. npaux.h ---------------------------------------------------------------*/ #if !defined (INC_NPAUX_H) #define INC_NPAUX_H // // Unicode strings are counted 16-bit character strings. If they are // NULL terminated, Length does not include trailing NULL. // typedef struct _UNICODE_STRING { USHORT Length; USHORT MaximumLength; #ifdef MIDL_PASS [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer; #else // MIDL_PASS PWSTR Buffer; #endif // MIDL_PASS } UNICODE_STRING; typedef UNICODE_STRING *PUNICODE_STRING; #define UNICODE_NULL ((WCHAR)0) // winnt typedef enum _MSV1_0_LOGON_SUBMIT_TYPE { Dummy } MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE; typedef struct _MSV1_0_INTERACTIVE_LOGON { MSV1_0_LOGON_SUBMIT_TYPE MessageType; UNICODE_STRING LogonDomainName; UNICODE_STRING UserName; UNICODE_STRING Password; } MSV1_0_INTERACTIVE_LOGON, *PMSV1_0_INTERACTIVE_LOGON; #endif
27.04
75
0.669379
7f5a7dfddbd5b552adda0600aae1493aac0758fb
588
c
C
cvec.c
graphitemaster/cvec
f87460dbda4aa94df980a603c0a62c535cf43d99
[ "Unlicense" ]
56
2016-10-16T01:22:47.000Z
2022-03-27T22:54:45.000Z
cvec.c
graphitemaster/cvec
f87460dbda4aa94df980a603c0a62c535cf43d99
[ "Unlicense" ]
1
2016-10-17T11:19:51.000Z
2016-10-17T11:19:51.000Z
cvec.c
graphitemaster/cvec
f87460dbda4aa94df980a603c0a62c535cf43d99
[ "Unlicense" ]
9
2016-10-16T09:13:35.000Z
2021-07-11T20:23:32.000Z
#include "cvec.h" void vec_grow(void **vector, size_t more, size_t type_size) { vector_t *meta = vector_meta(*vector); size_t count = 0; void *data = NULL; if (*vector) { count = 2 * meta->allocated + more; data = realloc(meta, type_size * count + sizeof *meta); } else { count = more + 1; data = malloc(type_size * count + sizeof *meta); ((vector_t *)data)->used = 0; } meta = (vector_t *)data; meta->allocated = count; *vector = meta + 1; } void vec_delete(void *vector) { free(vector_meta(vector)); }
23.52
63
0.573129
cf9b7fc9116a57fe27dcac1d64324fe801185f93
361
h
C
Friendly/Controllers/MenuWorkflow/MessagesWorkflow/PrivateRoomChat Module/UserInterface/View/FRPrivateRoomChatController.h
vikingdr/Friendly
ea690b061fc1dae59345f24d361dc032713e16de
[ "MIT" ]
null
null
null
Friendly/Controllers/MenuWorkflow/MessagesWorkflow/PrivateRoomChat Module/UserInterface/View/FRPrivateRoomChatController.h
vikingdr/Friendly
ea690b061fc1dae59345f24d361dc032713e16de
[ "MIT" ]
null
null
null
Friendly/Controllers/MenuWorkflow/MessagesWorkflow/PrivateRoomChat Module/UserInterface/View/FRPrivateRoomChatController.h
vikingdr/Friendly
ea690b061fc1dae59345f24d361dc032713e16de
[ "MIT" ]
null
null
null
// // FRPrivateRoomChatInteractor.h // Friendly // // Created by Matthew James on 17.07.2016. // Copyright (c) 2016 Accucode Inc. All rights reserved. // #import "BSTableController.h" @class FRPrivateRoomChatDataSource; @interface FRPrivateRoomChatController : BSTableController - (void)updateDataSource:(FRPrivateRoomChatDataSource*)dataSource; @end
19
66
0.770083
3c3209cecff2a0c80cc002918904324bcb8e97f0
952
c
C
test/chora/benchmarks/icrasuite/sv-benchmarks/loop-invgen/id_trans_true-unreach-call.c
jbreck/duet-jbreck
3bf4aa0c69983d15f199bf02f294d356c354e932
[ "MIT" ]
1
2020-08-15T15:26:25.000Z
2020-08-15T15:26:25.000Z
test/chora/benchmarks/sv-comp/sv-benchmarks/loop-invgen/id_trans_true-unreach-call.c
jbreck/duet-jbreck
3bf4aa0c69983d15f199bf02f294d356c354e932
[ "MIT" ]
null
null
null
test/chora/benchmarks/sv-comp/sv-benchmarks/loop-invgen/id_trans_true-unreach-call.c
jbreck/duet-jbreck
3bf4aa0c69983d15f199bf02f294d356c354e932
[ "MIT" ]
null
null
null
// from FreePastry source, file Id.java /** * Internal method for mapping byte[] -> int[] * * @param material The input byte[] * @return THe int[] */ /* protected static int[] trans(byte[] material) { int[] array = new int[nlen]; for (int j = 0; (j < IdBitLength / 8) && (j < material.length); j++) { int k = material[j] & 0xff; array[j / 4] |= k << ((j % 4) * 8); } return array; } */ #include "assert.h" int main() { int idBitLength, material_length, nlen; int j, k; nlen = __VERIFIER_nondet_int(); idBitLength = __VERIFIER_nondet_int(); material_length = __VERIFIER_nondet_int(); __VERIFIER_assume( nlen == idBitLength / 32 ); for (j = 0; (j < idBitLength / 8) && (j < material_length); j++) { __VERIFIER_assert( 0 <= j); __VERIFIER_assert( j < material_length ); __VERIFIER_assert( 0 <= j/4 ); //__VERIFIER_assert( j/4 < nlen); } return 0; }
24.410256
74
0.577731
2c93c2e9b98dc6fedb20bdcebc5f4085ee16323f
19,754
c
C
ds18b20.c
matjazv/ds18b20
6008a21bccc626982a35d6610759870711a2bcb7
[ "MIT" ]
1
2020-07-23T19:44:47.000Z
2020-07-23T19:44:47.000Z
ds18b20.c
matjazv/ds18b20
6008a21bccc626982a35d6610759870711a2bcb7
[ "MIT" ]
null
null
null
ds18b20.c
matjazv/ds18b20
6008a21bccc626982a35d6610759870711a2bcb7
[ "MIT" ]
null
null
null
/* ds18b20.c * * Copyright (C) 2020 Matjaz Verbole * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/portmacro.h" #include "esp_system.h" #include "driver/gpio.h" #include "esp32/rom/ets_sys.h" #include "ds18b20.h" #define LOGGING_ENABLED 1 #if LOGGING_ENABLED #include "esp_log.h" #endif #define READ_ROM_COMMAND 0x33 #define MATCH_ROM_COMMAND 0x55 #define SKIP_ROM_COMMAND 0xCC #define SEARCH_ROM_COMMAND 0xF0 #define ALARM_SEARCH_COMMAND 0xEC #define WRITE_SCRATCHPAD_COMMAND 0x4E #define READ_SCRATCHPAD_COMMAND 0xBE #define COPY_SCRATCHPAD_COMMAND 0x48 #define CONVERT_TEMP_COMMAND 0x44 #define RECALL_E2_COMMAND 0xB8 #define READ_POWER_SUPLY_COMMAND 0xB4 static const char *TAG = "ds18b20"; static gpio_num_t DQ_GPIO; static bool parasitePower; // global variables for search ROM function static int8_t lastMatchedBitPosition = -1; static bool needToWriteOne = false; static bool lastROMFound = false; static void wait_us(uint32_t us) { ets_delay_us(us); } static uint8_t CRC8(const uint8_t *addr, uint8_t len) { uint8_t crc = 0; while (len--) { uint8_t inbyte = *addr++; for (uint8_t i=8; i>0; i--) { uint8_t mix = (crc ^ inbyte) & 0x01; crc >>= 1; if (mix) crc ^= 0x8C; //Generator polynomial = 10001100 inbyte >>= 1; } } return crc; } static void write_bit(uint8_t bit) { gpio_set_direction(DQ_GPIO, GPIO_MODE_OUTPUT); gpio_set_level(DQ_GPIO, 0); wait_us(10); if (bit == 1) { gpio_set_level(DQ_GPIO, 1); } wait_us(50); gpio_set_level(DQ_GPIO, 1); } static uint8_t read_bit(void) { uint8_t bit = 0; gpio_set_direction(DQ_GPIO, GPIO_MODE_OUTPUT); gpio_set_level(DQ_GPIO, 0); wait_us(1); gpio_set_direction(DQ_GPIO, GPIO_MODE_INPUT); wait_us(12); if (gpio_get_level(DQ_GPIO) == 1) { bit = 1; } wait_us(47); return bit; } static void write_byte(uint8_t data) { uint8_t bit; for(uint8_t i=0; i<8; i++) { bit = data>>i; bit &= 0x01; write_bit(bit); } } static uint8_t read_byte(void) { uint8_t data = 0; for (uint8_t i=0; i<8; i++) { if(read_bit()) { data |= 0x01<<i; } } return data; } static bool initialization_sequence(void) { gpio_set_direction(DQ_GPIO, GPIO_MODE_OUTPUT); gpio_set_level(DQ_GPIO, 0); wait_us(480); gpio_set_level(DQ_GPIO, 1); gpio_set_direction(DQ_GPIO, GPIO_MODE_INPUT); wait_us(60); if(gpio_get_level(DQ_GPIO) != 0) { return false; } wait_us(420); if(gpio_get_level(DQ_GPIO) == 1) { return true; } return false; } static bool read_ROM(uint8_t *data) { if (data == NULL) { return false; } write_byte(READ_ROM_COMMAND); for (uint8_t i=0; i<8; i++) { data[i] = read_byte(); } #if LOGGING_ENABLED ESP_LOGI(TAG, "Family code: %x", data[0]); ESP_LOGI(TAG, "Serial number: %x%x%x%x%x%x", data[1], data[2], data[3], data[4], data[5], data[6]); ESP_LOGI(TAG, "CRC: %x", data[7]); #endif return (data[7] == CRC8(data, 7)); } static bool match_ROM(uint8_t *ROMData) { if (ROMData == NULL) { return false; } write_byte(MATCH_ROM_COMMAND); for (uint8_t i=0; i<8; i++) { write_byte(ROMData[i]); } return true; } static void skip_ROM(void) { write_byte(SKIP_ROM_COMMAND); } static void reset_search(void) { lastMatchedBitPosition = -1; needToWriteOne = false; lastROMFound = false; } static bool search_ROM(bool alarmSearch, uint8_t *address) { if (lastROMFound == true) { reset_search(); return false; } if (!alarmSearch) { write_byte(SEARCH_ROM_COMMAND); } else { write_byte(ALARM_SEARCH_COMMAND); } char data[8] = {0}; uint8_t lastZero = 0; for (uint8_t bitPosition=0; bitPosition<64; bitPosition++) { uint8_t bitValue = read_bit(); uint8_t complementValue = read_bit(); // no device attached to the 1-Wire bus if (bitValue && complementValue) { reset_search(); return false; } if (!bitValue && !complementValue) { if (bitPosition == lastMatchedBitPosition) { bitValue = 1; } else if (bitPosition > lastMatchedBitPosition) { bitValue = 0; lastZero = bitPosition; } else { // there are still devices attached which have conflicting bits in this position bitValue = (data[bitPosition / 8] << (bitPosition % 8)) & 1; if (!bitValue) { lastZero = bitPosition; } } } data[bitPosition / 8] |= bitValue << (bitPosition % 8); write_bit(bitValue); } for (uint8_t i=0; i<8; i++) { address[i] = data[i]; } lastMatchedBitPosition = lastZero; if (!lastMatchedBitPosition) { lastROMFound = true; } #if LOGGING_ENABLED if (!alarmSearch) { ESP_LOGI(TAG, "Found new ROM code: %x%x%x%x%x%x%x%x", data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); } else { ESP_LOGI(TAG, "Alarm for sensor with ROM code: %x%x%x%x%x%x%x%x", data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); } #endif return true; } static bool write_scratchpad(uint8_t *data) { if (data == NULL) { return false; } #if LOGGING_ENABLED ESP_LOGI(TAG, "Setting Temp. High: %x", data[0]); ESP_LOGI(TAG, "Setting Temp. Low: %x", data[1]); ESP_LOGI(TAG, "Setting Config: %x", data[2]); #endif write_byte(WRITE_SCRATCHPAD_COMMAND); for (uint8_t i=0; i<3; i++) { write_byte(data[i]); } return initialization_sequence(); } static bool read_scratchpad(uint8_t *data) { if (data == NULL) { return false; } write_byte(READ_SCRATCHPAD_COMMAND); for (uint8_t i=0; i<9; i++) { data[i] = read_byte(); } #if LOGGING_ENABLED ESP_LOGI(TAG, "Temperature: %x%x", data[0], data[1]); ESP_LOGI(TAG, "Temp. High User: %x", data[2]); ESP_LOGI(TAG, "Temp. Low User: %x", data[3]); ESP_LOGI(TAG, "Config: %x", data[4]); ESP_LOGI(TAG, "CRC: %x", data[8]); #endif if (initialization_sequence() != true) { return false; } return (data[8] == CRC8(data, 8)); } static bool copy_scratchpad(void) { write_byte(COPY_SCRATCHPAD_COMMAND); if (parasitePower == false) { gpio_set_direction(DQ_GPIO, GPIO_MODE_INPUT); // max NV write cycle time is 10ms for (uint8_t i=0; i<10; i++) { //vTaskDelay(1 / portTICK_RATE_MS); wait_us(1000); if (read_bit() == 1) { return true; } } } else { // in parasite mode get chip strong pullup for // at least 10ms time gpio_set_direction(DQ_GPIO, GPIO_MODE_OUTPUT); gpio_set_level(DQ_GPIO, 1); vTaskDelay(10 / portTICK_RATE_MS); gpio_set_level(DQ_GPIO, 0); return true; } return false; } static bool convert_temperature(uint8_t waitTime) { write_byte(CONVERT_TEMP_COMMAND); if (parasitePower == false) { gpio_set_direction(DQ_GPIO, GPIO_MODE_INPUT); // max temperature conversion time is: // 94ms for 9 bit resolution // 188ms for 10 bit resolution // 375ms for 11 bit resolution // 750ms for 12 bit resolution for (uint8_t i=0; i<10; i++) { vTaskDelay(waitTime / portTICK_RATE_MS); if (read_bit() == 1) { return true; } } } else { // in parasite mode get chip strong pullup for // at least conversion time gpio_set_direction(DQ_GPIO, GPIO_MODE_OUTPUT); gpio_set_level(DQ_GPIO, 1); vTaskDelay((waitTime * 10) / portTICK_RATE_MS); gpio_set_level(DQ_GPIO, 0); return true; } return false; } static bool recall_E2(void) { write_byte(RECALL_E2_COMMAND); gpio_set_direction(DQ_GPIO, GPIO_MODE_INPUT); // max temperature conversion time is: // 94ms for 9 bit resolution // 188ms for 10 bit resolution // 375ms for 11 bit resolution // 750ms for 12 bit resolution for (uint8_t i=0; i<10; i++) { vTaskDelay(75 / portTICK_RATE_MS); if (read_bit() == 1) { return true; } } return false; } static bool read_power_suply(bool *parasite) { write_byte(READ_POWER_SUPLY_COMMAND); gpio_set_direction(DQ_GPIO, GPIO_MODE_INPUT); if (read_bit() == 1) { *parasite = false; } else { *parasite = true; } return true; } static bool get_temperature_wait_time(uint8_t *waitTime, uint8_t *address) { thermRes res; if (ds18b20_get_thermometer_resolution(&res, address) != true) { return false; } // in convert_temperature there is a for loop with 10 repetitions // because of that maximum waitTime is divided by 10 and rounded up switch(res) { case RES_9_BIT: *waitTime = 10; break; case RES_10_BIT: *waitTime = 20; break; case RES_11_BIT: *waitTime = 40; break; case RES_12_BIT: *waitTime = 80; break; default: *waitTime = 80; break; } return true; } bool ds18b20_init(uint8_t GPIO) { DQ_GPIO = GPIO; gpio_pad_select_gpio(DQ_GPIO); if (initialization_sequence() != true) { return false; } skip_ROM(); if (read_power_suply(&parasitePower) != true) { return false; } #if LOGGING_ENABLED ESP_LOGI(TAG, "Parasite power: %s", parasitePower ? "enabled" : "disabled"); #endif return true; } bool ds18b20_is_parasite_power_mode(void) { return parasitePower; } bool ds18b20_search_ROM(uint8_t *address) { if (initialization_sequence() != true) { return false; } if (search_ROM(false, address) != true) { return false; } return true; } bool ds18b20_alarm_search(uint8_t *address) { if (initialization_sequence() != true) { return false; } if (search_ROM(true, address) != true) { return false; } return true; } bool ds18b20_single_get_family_code(uint8_t *code) { if (initialization_sequence() != true) { return false; } uint8_t data[8]; if (read_ROM(data) != true) { return false; } *code = data[0]; return true; } bool ds18b20_single_get_serial_number(uint8_t *serialNumber) { if (initialization_sequence() != true) { return false; } uint8_t data[8]; if (read_ROM(data) != true) { return false; } serialNumber[0] = data[1]; serialNumber[1] = data[2]; serialNumber[2] = data[3]; serialNumber[3] = data[4]; serialNumber[4] = data[5]; serialNumber[5] = data[6]; return true; } bool ds18b20_get_temperature(float *temperature, uint8_t *address) { uint8_t waitConversionTime; if (get_temperature_wait_time(&waitConversionTime, address) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (convert_temperature(waitConversionTime) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } *temperature = (float)(scratchpadData[0] + (scratchpadData[1] * 256)) / 16; return true; } bool ds18b20_get_thermometer_resolution(thermRes *res, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } *res = (scratchpadData[4] & 0x60) >> 5; return true; } bool ds18b20_set_thermometer_resolution(thermRes res, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } // if old resolution equals new resolution skip setting it if ((scratchpadData[4] & 0x60) >> 5 == res) { return true; } uint8_t saveData[3]; saveData[0] = scratchpadData[2]; saveData[1] = scratchpadData[3]; saveData[2] = res << 5; if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (write_scratchpad(saveData) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (copy_scratchpad() != true) { return false; } return true; } #if USE_EEPROM_FOR_ALARM bool ds18b20_set_alarm_temperature(int8_t temperatureHigh, int8_t temperatureLow, uint8_t *address) { if (temperatureHigh < temperatureLow) { return false; } if (temperatureHigh > 125) { temperatureHigh = 125; } if (temperatureLow < -55) { temperatureLow = -55; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } // if both old temperatures equal new temperatures skip setting them if ((scratchpadData[2] == temperatureHigh) && (scratchpadData[3] == (uint8_t)temperatureLow)) { return true; } uint8_t saveData[3]; saveData[0] = temperatureHigh; saveData[1] = temperatureLow; saveData[2] = scratchpadData[4]; if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (write_scratchpad(saveData) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (copy_scratchpad() != true) { return false; } return true; } bool ds18b20_set_alarm_temperature_high(int8_t temperatureHigh, uint8_t *address) { if (temperatureHigh > 125) { temperatureHigh = 125; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } }; uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } // if old high temperature equals new high temperature skip setting if (scratchpadData[2] == temperatureHigh) { return true; } uint8_t saveData[3]; saveData[0] = temperatureHigh; saveData[1] = scratchpadData[3]; saveData[2] = scratchpadData[4]; if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (write_scratchpad(saveData) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } }; if (copy_scratchpad() != true) { return false; } return true; } bool ds18b20_set_alarm_temperature_low(int8_t temperatureLow, uint8_t *address) { if (temperatureLow < -55) { temperatureLow = -55; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } // if old low temperature equals new low temperature skip setting if (scratchpadData[3] == temperatureLow) { return true; } uint8_t saveData[3]; saveData[0] = scratchpadData[2]; saveData[1] = temperatureLow; saveData[2] = scratchpadData[4]; if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (write_scratchpad(saveData) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (copy_scratchpad() != true) { return false; } return true; } bool ds18b20_get_alarm_temperature(int8_t *temperatureHigh, int8_t *temperatureLow, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } *temperatureHigh = scratchpadData[2]; *temperatureLow = scratchpadData[3]; return true; } bool ds18b20_get_alarm_temperature_high(int8_t *temperatureHigh, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } *temperatureHigh = scratchpadData[2]; return true; } bool ds18b20_get_alarm_temperature_low(int8_t *temperatureLow, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } *temperatureLow = scratchpadData[3]; return true; } #else bool ds18b20_single_set_data_EEPROM(uint16_t data, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } // if old data equals new data skip rewriting it if ((scratchpadData[2] == (uint8_t)(data>>8)) && (scratchpadData[3] == (uint8_t)data)) { return true; } uint8_t saveData[3]; saveData[0] = (uint8_t)(data>>8); saveData[1] = (uint8_t)data; saveData[2] = scratchpadData[4]; if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (write_scratchpad(saveData) != true) { return false; } if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } if (copy_scratchpad() != true) { return false; } return true; } bool ds18b20_single_read_data_EEPROM(uint16_t *data, uint8_t *address) { if (initialization_sequence() != true) { return false; } if (address == NULL) { skip_ROM(); } else { if (match_ROM(address) != true) { return false; } } uint8_t scratchpadData[9]; if (read_scratchpad(scratchpadData) != true) { return false; } *data = ((uint16_t)scratchpadData[2]<<8) | scratchpadData[3]; return true; } #endif
18.073193
142
0.627316
d60253f84d6aa82e94b82d85fb9cbf356c7123f7
373
h
C
include/hx711.h
bitengineers/esp32_hx711
7764ae0f2b2a90cce1c27b7e80933613f6064fb0
[ "Apache-2.0" ]
null
null
null
include/hx711.h
bitengineers/esp32_hx711
7764ae0f2b2a90cce1c27b7e80933613f6064fb0
[ "Apache-2.0" ]
null
null
null
include/hx711.h
bitengineers/esp32_hx711
7764ae0f2b2a90cce1c27b7e80933613f6064fb0
[ "Apache-2.0" ]
null
null
null
#pragma once #include <stdint.h> #ifdef __cplusplus extern "C" { #endif // __cplusplus void hx711_init(void); void hx711_deinit(void); void hx711_powerdown(void); void hx711_wait_for_ready(void); uint32_t hx711_measure(void); uint32_t hx711_get_zero_offset(void); void hx711_set_zero_offset(uint32_t offset); #ifdef __cplusplus } #endif // __cplusplus
16.217391
46
0.753351
96479f7362fba9bd29b6e5497bd36ef8fd3a0835
3,180
h
C
Applications/DataExplorer/Base/ImportFileTypes.h
norihiro-w/ogs
ac990b1aa06a583dba3e32efa3009ef0c6f46ae4
[ "BSD-4-Clause" ]
null
null
null
Applications/DataExplorer/Base/ImportFileTypes.h
norihiro-w/ogs
ac990b1aa06a583dba3e32efa3009ef0c6f46ae4
[ "BSD-4-Clause" ]
25
2015-02-04T20:34:21.000Z
2018-12-10T20:19:57.000Z
Applications/DataExplorer/Base/ImportFileTypes.h
norihiro-w/ogs
ac990b1aa06a583dba3e32efa3009ef0c6f46ae4
[ "BSD-4-Clause" ]
null
null
null
/** * \file * \author Karsten Rink * \date 2012-08-20 * \brief Definition of the ImportFileTypes enumeration. * * \copyright * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.org/project/license * */ #ifndef IMPORTFILETYPES_H #define IMPORTFILETYPES_H #include <string> /** * \brief Types of supported import file formats. */ class ImportFileType { public: enum type { OGS = 0, OGS_GEO, OGS_STN, OGS_MSH, FEFLOW, GMS, GMSH, NETCDF, PETREL, POLYRASTER, RASTER, SHAPE, TETGEN, VTK }; static std::string convertImportFileTypeToString(ImportFileType::type t) { if (t==ImportFileType::FEFLOW) return "FEFLOW"; else if (t==ImportFileType::GMS) return "GMS"; else if (t==ImportFileType::GMSH) return "GMSH"; else if (t==ImportFileType::NETCDF) return "NetCDF"; else if (t==ImportFileType::OGS) return "OGS"; else if (t==ImportFileType::OGS_GEO) return "OGS geometry"; else if (t==ImportFileType::OGS_STN) return "OGS station list"; else if (t==ImportFileType::OGS_MSH) return "OGS mesh"; else if (t==ImportFileType::PETREL) return "Petrel"; else if((t==ImportFileType::RASTER) || (t==ImportFileType::POLYRASTER)) return "Raster"; else if (t==ImportFileType::SHAPE) return "Shape"; else if (t==ImportFileType::TETGEN) return "TetGen node"; else if (t==ImportFileType::VTK) return "VTK"; else return ""; } static std::string getFileSuffixString(ImportFileType::type t) { if (t==ImportFileType::FEFLOW) return "FEFLOW files (*.fem)"; else if (t==ImportFileType::GMS) return "GMS files (*.txt *.3dm)"; else if (t==ImportFileType::GMSH) return "GMSH mesh files (*.msh)"; else if (t==ImportFileType::NETCDF) return "NetCDF files (*.nc)"; else if (t==ImportFileType::OGS) return "OpenGeosys files (*.gsp *.gml *.vtu *.stn);;GeoSys legacy files (*.gli *.msh);;All files (* *.*)"; else if (t==ImportFileType::OGS_GEO) return "OpenGeosys files (*.gml *.gli)"; else if (t==ImportFileType::OGS_STN) return "OpenGeosys files (*.stn)"; else if (t==ImportFileType::OGS_MSH) return "OpenGeosys files (*.vtu *.msh)"; else if (t==ImportFileType::PETREL) return "Petrel files (*)"; else if (t==ImportFileType::RASTER) return "Raster files (*.asc *.grd *.bmp *.jpg *.png *.tif)"; else if (t==ImportFileType::SHAPE) return "ESRI Shape files (*.shp)"; else if (t==ImportFileType::TETGEN) return "TetGen node files (*.node *.poly *.smesh)"; else if (t==ImportFileType::VTK) return "VTK files (*.vtk *.vti *.vtr *.vts *.vtp *.vtu)"; else return "All files (*.*)"; } }; #endif //IMPORTFILETYPES_H
33.125
118
0.581132
c5b9313590614f438eb6e0661564da477c65b1d2
131
c
C
src/imop/lib/testcases/extensions/anon-union.c
amannougrahiya/imop-compiler
a0f0c9aaea00c6e5d37a17172c5db2967822ba9b
[ "MIT" ]
10
2020-02-24T20:39:06.000Z
2021-11-01T03:33:22.000Z
src/imop/lib/testcases/extensions/anon-union.c
anonymousoopsla21/homeostasis
e56c5c2f8392027ad5a49a45d7ac49a139c33674
[ "MIT" ]
2
2020-02-25T20:30:46.000Z
2020-07-18T19:05:27.000Z
src/imop/lib/testcases/extensions/anon-union.c
anonymousoopsla21/homeostasis
e56c5c2f8392027ad5a49a45d7ac49a139c33674
[ "MIT" ]
2
2020-03-11T11:53:47.000Z
2021-08-23T06:49:57.000Z
struct { char code; union { char chid[4]; int numid; }; char *name; } morx;
16.375
28
0.366412
68043585d5546e21728d61f9997f6bc330881f89
889
h
C
include/fast_io_hosted.h
EwoutH/fast_io
1393ef01b82dffa87f3008ec0898431865870a1f
[ "MIT" ]
2
2020-07-20T06:07:20.000Z
2020-10-21T08:53:49.000Z
include/fast_io_hosted.h
EwoutH/fast_io
1393ef01b82dffa87f3008ec0898431865870a1f
[ "MIT" ]
null
null
null
include/fast_io_hosted.h
EwoutH/fast_io
1393ef01b82dffa87f3008ec0898431865870a1f
[ "MIT" ]
null
null
null
#pragma once /* https://en.cppreference.com/w/cpp/freestanding There are two kinds of implementations defined by the C++ standard: hosted and freestanding implementations. For hosted implementations the set of standard library headers required by the C++ standard is much larger than for freestanding ones. */ //fast_io_hosted defines what we could use in a hosted environment. #include"fast_io_freestanding.h" #include"fast_io_hosted/mmap.h" #include"fast_io_hosted/platforms/native.h" #include"fast_io_hosted/omap.h" #include"fast_io_hosted/iomutex.h" #include"fast_io_hosted/chrono.h" #include"fast_io_hosted/process/native.h" #include"fast_io_hosted/global_new.h" #include"fast_io_hosted/parallel.h" #if __cpp_impl_coroutine >= 201902 #include<coroutine> #include"fast_io_hosted/async_coro.h" #endif //#include<clocale> //#include"fast_io_hosted/posix_locale.h"
37.041667
135
0.791901
d0b2861a39fccadfb1de277cbf7ac63ecb4fd007
1,327
h
C
shrike/shrike_module_handler.h
sporiyano/rgat
2ed2fa42710b06054c1bc45dc3c31406b32954f9
[ "Apache-2.0" ]
null
null
null
shrike/shrike_module_handler.h
sporiyano/rgat
2ed2fa42710b06054c1bc45dc3c31406b32954f9
[ "Apache-2.0" ]
null
null
null
shrike/shrike_module_handler.h
sporiyano/rgat
2ed2fa42710b06054c1bc45dc3c31406b32954f9
[ "Apache-2.0" ]
1
2018-03-06T03:40:01.000Z
2018-03-06T03:40:01.000Z
/* Copyright 2017 Nia Catlin 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. */ /* Header for the thread that manages each instrumented process */ #pragma once #include "stdafx.h" #include "base_thread.h" //#include "traceStructs.h" #include "thread_trace_reader.h" class shrike_module_handler : public base_thread { public: shrike_module_handler(binaryTarget *binaryptr, traceRecord* runRecordptr, wstring pipeid) : base_thread() { binary = binaryptr; runRecord = runRecordptr; inputpipename = wstring(L"\\\\.\\pipe\\"); inputpipename += pipeid; }; wstring inputpipename; HANDLE controlPipe; private: binaryTarget *binary; traceRecord* runRecord; vector < base_thread *> threadList; vector < thread_trace_reader *> readerThreadList; PROCESS_DATA *piddata = NULL; void main_loop(); void start_thread_rendering(PID_TID TID); };
26.019608
90
0.768651
10edd20f7e6dc8119f12b76ed3a0e3688f4b7cfb
1,641
h
C
tools/profiler/Profiler.h
prozum/SPPL
77de5db600a89b84bc8e6e851c9a766cd5203ce2
[ "MIT" ]
4
2016-03-17T19:38:51.000Z
2016-10-30T18:54:17.000Z
tools/profiler/Profiler.h
prozum/sppl
77de5db600a89b84bc8e6e851c9a766cd5203ce2
[ "MIT" ]
null
null
null
tools/profiler/Profiler.h
prozum/sppl
77de5db600a89b84bc8e6e851c9a766cd5203ce2
[ "MIT" ]
null
null
null
#include "Driver.h" #include "Interpreter.h" #include "Node.h" #include "Parser.h" #include "Visitor.h" #include <vector> namespace profiler { class Profiler : public Visitor { public: Profiler(Program &node); void instruction_time_profile(int runs); void user_time_profile(int runs); void visit(Program &node); void visit(Function &node); void visit(Case &node); void visit(Or &node); void visit(And &node); void visit(Equal &node); void visit(NotEqual &node); void visit(Lesser &node); void visit(Greater &node); void visit(LesserEq &node); void visit(GreaterEq &node); void visit(Add &node); void visit(Sub &node); void visit(Mul &node); void visit(Div &node); void visit(Mod &node); void visit(ListAdd &node); void visit(Par &node); void visit(Not &node); void visit(Int &node); void visit(Float &node); void visit(Bool &node); void visit(Char &node); void visit(String &node); void visit(ListPattern &node); void visit(TuplePattern &node); void visit(ListSplit &node); void visit(List &node); void visit(Tuple &node); void visit(Id &node); void visit(Call &node); void visit(Type &node); private: enum ProfilerMode { INSTRUCTION_TIME, // count instructions USER_TIME, // measures run time DEPENDENCY_CHECK // calculate the function deps }; // indicates which mode the profiler is in ProfilerMode mode; parser::Driver driver; int runs; vector<int> time_units; Program *node; Function curr_fun; int case_num; }; }
23.782609
56
0.641682
2c564385c4798881b48ece10ab3ad3b164493a43
24,936
h
C
aws-cpp-sdk-glue/include/aws/glue/model/Table.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-glue/include/aws/glue/model/Table.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-glue/include/aws/glue/model/Table.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
1
2019-01-18T13:03:55.000Z
2019-01-18T13:03:55.000Z
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/glue/Glue_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/DateTime.h> #include <aws/glue/model/StorageDescriptor.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSMap.h> #include <aws/glue/model/Column.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Glue { namespace Model { /** * <p>Represents a collection of related data organized in columns and * rows.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/Table">AWS API * Reference</a></p> */ class AWS_GLUE_API Table { public: Table(); Table(Aws::Utils::Json::JsonView jsonValue); Table& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline const Aws::String& GetName() const{ return m_name; } /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline Table& WithName(const Aws::String& value) { SetName(value); return *this;} /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline Table& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** * <p>Name of the table. For Hive compatibility, this must be entirely * lowercase.</p> */ inline Table& WithName(const char* value) { SetName(value); return *this;} /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline const Aws::String& GetDatabaseName() const{ return m_databaseName; } /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline void SetDatabaseName(const Aws::String& value) { m_databaseNameHasBeenSet = true; m_databaseName = value; } /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline void SetDatabaseName(Aws::String&& value) { m_databaseNameHasBeenSet = true; m_databaseName = std::move(value); } /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline void SetDatabaseName(const char* value) { m_databaseNameHasBeenSet = true; m_databaseName.assign(value); } /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline Table& WithDatabaseName(const Aws::String& value) { SetDatabaseName(value); return *this;} /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline Table& WithDatabaseName(Aws::String&& value) { SetDatabaseName(std::move(value)); return *this;} /** * <p>Name of the metadata database where the table metadata resides. For Hive * compatibility, this must be all lowercase.</p> */ inline Table& WithDatabaseName(const char* value) { SetDatabaseName(value); return *this;} /** * <p>Description of the table.</p> */ inline const Aws::String& GetDescription() const{ return m_description; } /** * <p>Description of the table.</p> */ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** * <p>Description of the table.</p> */ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** * <p>Description of the table.</p> */ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** * <p>Description of the table.</p> */ inline Table& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** * <p>Description of the table.</p> */ inline Table& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** * <p>Description of the table.</p> */ inline Table& WithDescription(const char* value) { SetDescription(value); return *this;} /** * <p>Owner of the table.</p> */ inline const Aws::String& GetOwner() const{ return m_owner; } /** * <p>Owner of the table.</p> */ inline void SetOwner(const Aws::String& value) { m_ownerHasBeenSet = true; m_owner = value; } /** * <p>Owner of the table.</p> */ inline void SetOwner(Aws::String&& value) { m_ownerHasBeenSet = true; m_owner = std::move(value); } /** * <p>Owner of the table.</p> */ inline void SetOwner(const char* value) { m_ownerHasBeenSet = true; m_owner.assign(value); } /** * <p>Owner of the table.</p> */ inline Table& WithOwner(const Aws::String& value) { SetOwner(value); return *this;} /** * <p>Owner of the table.</p> */ inline Table& WithOwner(Aws::String&& value) { SetOwner(std::move(value)); return *this;} /** * <p>Owner of the table.</p> */ inline Table& WithOwner(const char* value) { SetOwner(value); return *this;} /** * <p>Time when the table definition was created in the Data Catalog.</p> */ inline const Aws::Utils::DateTime& GetCreateTime() const{ return m_createTime; } /** * <p>Time when the table definition was created in the Data Catalog.</p> */ inline void SetCreateTime(const Aws::Utils::DateTime& value) { m_createTimeHasBeenSet = true; m_createTime = value; } /** * <p>Time when the table definition was created in the Data Catalog.</p> */ inline void SetCreateTime(Aws::Utils::DateTime&& value) { m_createTimeHasBeenSet = true; m_createTime = std::move(value); } /** * <p>Time when the table definition was created in the Data Catalog.</p> */ inline Table& WithCreateTime(const Aws::Utils::DateTime& value) { SetCreateTime(value); return *this;} /** * <p>Time when the table definition was created in the Data Catalog.</p> */ inline Table& WithCreateTime(Aws::Utils::DateTime&& value) { SetCreateTime(std::move(value)); return *this;} /** * <p>Last time the table was updated.</p> */ inline const Aws::Utils::DateTime& GetUpdateTime() const{ return m_updateTime; } /** * <p>Last time the table was updated.</p> */ inline void SetUpdateTime(const Aws::Utils::DateTime& value) { m_updateTimeHasBeenSet = true; m_updateTime = value; } /** * <p>Last time the table was updated.</p> */ inline void SetUpdateTime(Aws::Utils::DateTime&& value) { m_updateTimeHasBeenSet = true; m_updateTime = std::move(value); } /** * <p>Last time the table was updated.</p> */ inline Table& WithUpdateTime(const Aws::Utils::DateTime& value) { SetUpdateTime(value); return *this;} /** * <p>Last time the table was updated.</p> */ inline Table& WithUpdateTime(Aws::Utils::DateTime&& value) { SetUpdateTime(std::move(value)); return *this;} /** * <p>Last time the table was accessed. This is usually taken from HDFS, and may * not be reliable.</p> */ inline const Aws::Utils::DateTime& GetLastAccessTime() const{ return m_lastAccessTime; } /** * <p>Last time the table was accessed. This is usually taken from HDFS, and may * not be reliable.</p> */ inline void SetLastAccessTime(const Aws::Utils::DateTime& value) { m_lastAccessTimeHasBeenSet = true; m_lastAccessTime = value; } /** * <p>Last time the table was accessed. This is usually taken from HDFS, and may * not be reliable.</p> */ inline void SetLastAccessTime(Aws::Utils::DateTime&& value) { m_lastAccessTimeHasBeenSet = true; m_lastAccessTime = std::move(value); } /** * <p>Last time the table was accessed. This is usually taken from HDFS, and may * not be reliable.</p> */ inline Table& WithLastAccessTime(const Aws::Utils::DateTime& value) { SetLastAccessTime(value); return *this;} /** * <p>Last time the table was accessed. This is usually taken from HDFS, and may * not be reliable.</p> */ inline Table& WithLastAccessTime(Aws::Utils::DateTime&& value) { SetLastAccessTime(std::move(value)); return *this;} /** * <p>Last time column statistics were computed for this table.</p> */ inline const Aws::Utils::DateTime& GetLastAnalyzedTime() const{ return m_lastAnalyzedTime; } /** * <p>Last time column statistics were computed for this table.</p> */ inline void SetLastAnalyzedTime(const Aws::Utils::DateTime& value) { m_lastAnalyzedTimeHasBeenSet = true; m_lastAnalyzedTime = value; } /** * <p>Last time column statistics were computed for this table.</p> */ inline void SetLastAnalyzedTime(Aws::Utils::DateTime&& value) { m_lastAnalyzedTimeHasBeenSet = true; m_lastAnalyzedTime = std::move(value); } /** * <p>Last time column statistics were computed for this table.</p> */ inline Table& WithLastAnalyzedTime(const Aws::Utils::DateTime& value) { SetLastAnalyzedTime(value); return *this;} /** * <p>Last time column statistics were computed for this table.</p> */ inline Table& WithLastAnalyzedTime(Aws::Utils::DateTime&& value) { SetLastAnalyzedTime(std::move(value)); return *this;} /** * <p>Retention time for this table.</p> */ inline int GetRetention() const{ return m_retention; } /** * <p>Retention time for this table.</p> */ inline void SetRetention(int value) { m_retentionHasBeenSet = true; m_retention = value; } /** * <p>Retention time for this table.</p> */ inline Table& WithRetention(int value) { SetRetention(value); return *this;} /** * <p>A storage descriptor containing information about the physical storage of * this table.</p> */ inline const StorageDescriptor& GetStorageDescriptor() const{ return m_storageDescriptor; } /** * <p>A storage descriptor containing information about the physical storage of * this table.</p> */ inline void SetStorageDescriptor(const StorageDescriptor& value) { m_storageDescriptorHasBeenSet = true; m_storageDescriptor = value; } /** * <p>A storage descriptor containing information about the physical storage of * this table.</p> */ inline void SetStorageDescriptor(StorageDescriptor&& value) { m_storageDescriptorHasBeenSet = true; m_storageDescriptor = std::move(value); } /** * <p>A storage descriptor containing information about the physical storage of * this table.</p> */ inline Table& WithStorageDescriptor(const StorageDescriptor& value) { SetStorageDescriptor(value); return *this;} /** * <p>A storage descriptor containing information about the physical storage of * this table.</p> */ inline Table& WithStorageDescriptor(StorageDescriptor&& value) { SetStorageDescriptor(std::move(value)); return *this;} /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline const Aws::Vector<Column>& GetPartitionKeys() const{ return m_partitionKeys; } /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline void SetPartitionKeys(const Aws::Vector<Column>& value) { m_partitionKeysHasBeenSet = true; m_partitionKeys = value; } /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline void SetPartitionKeys(Aws::Vector<Column>&& value) { m_partitionKeysHasBeenSet = true; m_partitionKeys = std::move(value); } /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline Table& WithPartitionKeys(const Aws::Vector<Column>& value) { SetPartitionKeys(value); return *this;} /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline Table& WithPartitionKeys(Aws::Vector<Column>&& value) { SetPartitionKeys(std::move(value)); return *this;} /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline Table& AddPartitionKeys(const Column& value) { m_partitionKeysHasBeenSet = true; m_partitionKeys.push_back(value); return *this; } /** * <p>A list of columns by which the table is partitioned. Only primitive types are * supported as partition keys.</p> */ inline Table& AddPartitionKeys(Column&& value) { m_partitionKeysHasBeenSet = true; m_partitionKeys.push_back(std::move(value)); return *this; } /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline const Aws::String& GetViewOriginalText() const{ return m_viewOriginalText; } /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline void SetViewOriginalText(const Aws::String& value) { m_viewOriginalTextHasBeenSet = true; m_viewOriginalText = value; } /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline void SetViewOriginalText(Aws::String&& value) { m_viewOriginalTextHasBeenSet = true; m_viewOriginalText = std::move(value); } /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline void SetViewOriginalText(const char* value) { m_viewOriginalTextHasBeenSet = true; m_viewOriginalText.assign(value); } /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline Table& WithViewOriginalText(const Aws::String& value) { SetViewOriginalText(value); return *this;} /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline Table& WithViewOriginalText(Aws::String&& value) { SetViewOriginalText(std::move(value)); return *this;} /** * <p>If the table is a view, the original text of the view; otherwise * <code>null</code>.</p> */ inline Table& WithViewOriginalText(const char* value) { SetViewOriginalText(value); return *this;} /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline const Aws::String& GetViewExpandedText() const{ return m_viewExpandedText; } /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline void SetViewExpandedText(const Aws::String& value) { m_viewExpandedTextHasBeenSet = true; m_viewExpandedText = value; } /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline void SetViewExpandedText(Aws::String&& value) { m_viewExpandedTextHasBeenSet = true; m_viewExpandedText = std::move(value); } /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline void SetViewExpandedText(const char* value) { m_viewExpandedTextHasBeenSet = true; m_viewExpandedText.assign(value); } /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline Table& WithViewExpandedText(const Aws::String& value) { SetViewExpandedText(value); return *this;} /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline Table& WithViewExpandedText(Aws::String&& value) { SetViewExpandedText(std::move(value)); return *this;} /** * <p>If the table is a view, the expanded text of the view; otherwise * <code>null</code>.</p> */ inline Table& WithViewExpandedText(const char* value) { SetViewExpandedText(value); return *this;} /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline const Aws::String& GetTableType() const{ return m_tableType; } /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline void SetTableType(const Aws::String& value) { m_tableTypeHasBeenSet = true; m_tableType = value; } /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline void SetTableType(Aws::String&& value) { m_tableTypeHasBeenSet = true; m_tableType = std::move(value); } /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline void SetTableType(const char* value) { m_tableTypeHasBeenSet = true; m_tableType.assign(value); } /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline Table& WithTableType(const Aws::String& value) { SetTableType(value); return *this;} /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline Table& WithTableType(Aws::String&& value) { SetTableType(std::move(value)); return *this;} /** * <p>The type of this table (<code>EXTERNAL_TABLE</code>, * <code>VIRTUAL_VIEW</code>, etc.).</p> */ inline Table& WithTableType(const char* value) { SetTableType(value); return *this;} /** * <p>These key-value pairs define properties associated with the table.</p> */ inline const Aws::Map<Aws::String, Aws::String>& GetParameters() const{ return m_parameters; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline void SetParameters(const Aws::Map<Aws::String, Aws::String>& value) { m_parametersHasBeenSet = true; m_parameters = value; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline void SetParameters(Aws::Map<Aws::String, Aws::String>&& value) { m_parametersHasBeenSet = true; m_parameters = std::move(value); } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& WithParameters(const Aws::Map<Aws::String, Aws::String>& value) { SetParameters(value); return *this;} /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& WithParameters(Aws::Map<Aws::String, Aws::String>&& value) { SetParameters(std::move(value)); return *this;} /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(const Aws::String& key, const Aws::String& value) { m_parametersHasBeenSet = true; m_parameters.emplace(key, value); return *this; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(Aws::String&& key, const Aws::String& value) { m_parametersHasBeenSet = true; m_parameters.emplace(std::move(key), value); return *this; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(const Aws::String& key, Aws::String&& value) { m_parametersHasBeenSet = true; m_parameters.emplace(key, std::move(value)); return *this; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(Aws::String&& key, Aws::String&& value) { m_parametersHasBeenSet = true; m_parameters.emplace(std::move(key), std::move(value)); return *this; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(const char* key, Aws::String&& value) { m_parametersHasBeenSet = true; m_parameters.emplace(key, std::move(value)); return *this; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(Aws::String&& key, const char* value) { m_parametersHasBeenSet = true; m_parameters.emplace(std::move(key), value); return *this; } /** * <p>These key-value pairs define properties associated with the table.</p> */ inline Table& AddParameters(const char* key, const char* value) { m_parametersHasBeenSet = true; m_parameters.emplace(key, value); return *this; } /** * <p>Person or entity who created the table.</p> */ inline const Aws::String& GetCreatedBy() const{ return m_createdBy; } /** * <p>Person or entity who created the table.</p> */ inline void SetCreatedBy(const Aws::String& value) { m_createdByHasBeenSet = true; m_createdBy = value; } /** * <p>Person or entity who created the table.</p> */ inline void SetCreatedBy(Aws::String&& value) { m_createdByHasBeenSet = true; m_createdBy = std::move(value); } /** * <p>Person or entity who created the table.</p> */ inline void SetCreatedBy(const char* value) { m_createdByHasBeenSet = true; m_createdBy.assign(value); } /** * <p>Person or entity who created the table.</p> */ inline Table& WithCreatedBy(const Aws::String& value) { SetCreatedBy(value); return *this;} /** * <p>Person or entity who created the table.</p> */ inline Table& WithCreatedBy(Aws::String&& value) { SetCreatedBy(std::move(value)); return *this;} /** * <p>Person or entity who created the table.</p> */ inline Table& WithCreatedBy(const char* value) { SetCreatedBy(value); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet; Aws::String m_databaseName; bool m_databaseNameHasBeenSet; Aws::String m_description; bool m_descriptionHasBeenSet; Aws::String m_owner; bool m_ownerHasBeenSet; Aws::Utils::DateTime m_createTime; bool m_createTimeHasBeenSet; Aws::Utils::DateTime m_updateTime; bool m_updateTimeHasBeenSet; Aws::Utils::DateTime m_lastAccessTime; bool m_lastAccessTimeHasBeenSet; Aws::Utils::DateTime m_lastAnalyzedTime; bool m_lastAnalyzedTimeHasBeenSet; int m_retention; bool m_retentionHasBeenSet; StorageDescriptor m_storageDescriptor; bool m_storageDescriptorHasBeenSet; Aws::Vector<Column> m_partitionKeys; bool m_partitionKeysHasBeenSet; Aws::String m_viewOriginalText; bool m_viewOriginalTextHasBeenSet; Aws::String m_viewExpandedText; bool m_viewExpandedTextHasBeenSet; Aws::String m_tableType; bool m_tableTypeHasBeenSet; Aws::Map<Aws::String, Aws::String> m_parameters; bool m_parametersHasBeenSet; Aws::String m_createdBy; bool m_createdByHasBeenSet; }; } // namespace Model } // namespace Glue } // namespace Aws
36.034682
176
0.658245
c8a1c1dfa4ce7f6bdccc067701843a921b7605bf
1,928
c
C
cmds/avatar/_wp.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
cmds/avatar/_wp.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
4
2021-03-15T18:56:39.000Z
2021-08-17T17:08:22.000Z
cmds/avatar/_wp.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> #include <daemons.h> inherit DAEMON; string class_str(object ob); int cmd_wp() { object *peo, ob; string *names, name, str; mapping map; int i, num, xxx; string posxxx; if(!objectp(TP)) { return 0; } posxxx = lower_case((string)TP->query_position()); if(posxxx == "builder" || posxxx == "apprentice") { tell_object(TP,"You cannot use this command as a builder or apprentice."); return 1; } peo = users(); num = sizeof(peo); names = allocate(num); map = ([]); for(i=0;i<num;i++){ name = peo[i]->query_name(); if(!name) continue; if(wizardp(peo[i])) continue; names[i] = name; map[name] = peo[i]; } names -= ({0}); names = sort_array(names, "alphabetical_sort", FILTERS_D); for(i=0;i<sizeof(names);i++) { str = ""; name = names[i]; ob = map[name]; name = capitalize(name); if(ob->query_invis()) name = "("+name+")"; name = arrange_string(name, 16); if (avatarp(ob)) { str += "%^BOLD%^Av "; } else if (high_mortalp(ob)) { str += "%^BOLD%^%^BLUE%^Hm "; } else if (ob->query("advanced_player")) { str += "%^BOLD%^%^GREEN%^Ap "; } else if (newbiep(ob)) { str += "%^BOLD%^%^CYAN%^Nb "; } else { str += "%^BOLD%^ "; } str += "%^BOLD%^%^RED%^"+name+"%^RESET%^"; if(objectp(environment(ob))) { str += replace_string(environment(ob)->query_short()+"%^RESET%^","\n",""); if(environment(ob)->query("alternative world")) { str += " (%^BOLD%^%^CYAN%^Alternative version : "+environment(ob)->query("alternative world")+"%^RESET%^)"; } } else { str += "Invalid Environment"; } tell_object(TP, str); } return 1; } void help(){ write("This tells you where people are."); }
24.1
119
0.506743
ea99f56222d01d1296d9770210e1494d53195df2
1,028
h
C
hill/conversion.h
riju-stone/encrypto-pedia
9169732a35717d17eef860b5f4da2e1e7b82a1ac
[ "MIT" ]
null
null
null
hill/conversion.h
riju-stone/encrypto-pedia
9169732a35717d17eef860b5f4da2e1e7b82a1ac
[ "MIT" ]
null
null
null
hill/conversion.h
riju-stone/encrypto-pedia
9169732a35717d17eef860b5f4da2e1e7b82a1ac
[ "MIT" ]
null
null
null
#pragma once #include <string> using namespace std; void letterconverter(string message, float numbers[]) { string listofchars = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM "; for (int a = 0; a < message.length(); a++) for (int b = 0; b < listofchars.length(); b++) if (message[a] == listofchars[b]) numbers[a] = b; numbers[message.length()] = 77777; } void onebythrees(float numbers[], float onebythrees[1000][3]) { for (int a = 0; a < 1000; a++) for (int b = 0; b < 3; b++) { if (numbers[3 * a + b] != 77777) onebythrees[a][b] = numbers[3 * a + b]; else { switch (b) { case 1: onebythrees[a][1] = 777; onebythrees[a][2] = 777; break; case 2: onebythrees[a][2] = 777; break; } break; } } } void numberconverter(string& message, float numbers[100000]) { string listofchars = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM "; for (int a = 0; numbers[a] != 777; a++) cout << listofchars[numbers[a]]; cout << endl; }
21.416667
78
0.608949
968394e2296f9c011f9c5f9f0f3f7e90fedc9d4a
1,204
c
C
sw/apps/sequential_tests/bubblesort/bubblesort.c
riscveval/Pulpino
7ad47f3761db74a8f681d952e125664fd5abe71e
[ "Apache-2.0" ]
1
2018-02-10T14:34:07.000Z
2018-02-10T14:34:07.000Z
sw/apps/sequential_tests/bubblesort/bubblesort.c
Instrumented-Pulpino/pulpino
fd82e75a7781b7d629d64071c6d8ae78bddcf360
[ "Apache-2.0" ]
null
null
null
sw/apps/sequential_tests/bubblesort/bubblesort.c
Instrumented-Pulpino/pulpino
fd82e75a7781b7d629d64071c6d8ae78bddcf360
[ "Apache-2.0" ]
1
2021-12-14T23:43:32.000Z
2021-12-14T23:43:32.000Z
#include "utils.h" #include <stdio.h> #include "bar.h" #include "bench.h" /* Bubble sort code */ #define N 100 void check_bubbleSort(testresult_t *result, void (*start)(), void (*stop)()); testcase_t testcases[] = { { .name = "bubbleSort", .test = check_bubbleSort }, {0, 0} }; int main() { return run_suite(testcases); } void bubbleSort(volatile int*,int); __attribute__ ((section(".heapsram"))) int array[N]; void check_bubbleSort(testresult_t *result, void (*start)(), void (*stop)()) { int i,j; int n = N; printf("Start bubblesort\n"); start(); for (j = 0; j<2; j++) { for (i=0;i<n;i++) array[i] = 2*n-i; bubbleSort(array, n); } stop(); for (i=0;i<n;i++) { if (array[N-1-i] != 2*n-i) { printf("expected: %d, actual: %d\n",2*n-i,array[N-1-i]); result->errors++; } } } void bubbleSort(volatile int* array, int n) { int c,d; int swap; for (c = 0 ; c < ( n - 1 ); c++) { for (d = 0 ; d < n - c - 1; d++) { if (array[d] > array[d+1]) /* For decreasing order use < */ { swap = array[d]; array[d] = array[d+1]; array[d+1] = swap; } } } }
16.493151
78
0.51412
1e6c4c9be5d887da155c6878b2b4a369027b2995
43
h
C
tests/test_source_file.h
TyRoXx/Lpg
cbee7e6cceba239dd3832d393d047b4204897fdc
[ "MIT" ]
2
2020-03-29T12:58:39.000Z
2021-06-22T16:58:08.000Z
tests/test_source_file.h
mamazu/Lpg
cbee7e6cceba239dd3832d393d047b4204897fdc
[ "MIT" ]
139
2017-05-20T15:57:22.000Z
2021-10-31T14:45:06.000Z
tests/test_source_file.h
mamazu/Lpg
cbee7e6cceba239dd3832d393d047b4204897fdc
[ "MIT" ]
2
2017-05-17T18:02:18.000Z
2018-09-21T08:13:19.000Z
#pragma once void test_source_file(void);
10.75
28
0.790698
1eb040a7df2e1c16bb2f7a0e4b27557c1a9e9696
2,859
h
C
src/cc/betprotocol.h
sandsunsurf/safecoin
bf0e7e7b97b9f6fdb024fa35c10ae25bd2dcf974
[ "Unlicense" ]
null
null
null
src/cc/betprotocol.h
sandsunsurf/safecoin
bf0e7e7b97b9f6fdb024fa35c10ae25bd2dcf974
[ "Unlicense" ]
null
null
null
src/cc/betprotocol.h
sandsunsurf/safecoin
bf0e7e7b97b9f6fdb024fa35c10ae25bd2dcf974
[ "Unlicense" ]
null
null
null
/****************************************************************************** * Copyright © 2014-2018 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * * holder information and the developer policies on copyright and licensing. * * * * Unless otherwise agreed in a custom licensing agreement, no part of the * * SuperNET software, including this file may be copied, modified, propagated * * or distributed except according to the terms contained in the LICENSE file * * * * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ #ifndef BETPROTOCOL_H #define BETPROTOCOL_H #include "cc/eval.h" #include "pubkey.h" #include "primitives/transaction.h" #include "cryptoconditions/include/cryptoconditions.h" class MoMProof { public: MerkleBranch branch; uint256 notarisationHash; ADD_SERIALIZE_METHODS; template <typename Stream, typename Operation> inline void SerializationOp(Stream& s, Operation ser_action) { READWRITE(branch); READWRITE(notarisationHash); } }; class BetProtocol { protected: std::vector<CC*> playerConditions(); public: EvalCode disputeCode; std::vector<CPubKey> players; std::vector<unsigned char> vmParams; uint32_t waitBlocks; // Utility BetProtocol(EvalCode dc, std::vector<CPubKey> ps, uint32_t wb, std::vector<uint8_t> vmp) : disputeCode(dc), waitBlocks(wb), vmParams(vmp), players(ps) {} std::vector<CC*> PlayerConditions(); // on PANGEA CC* MakeDisputeCond(); CMutableTransaction MakeSessionTx(CAmount spendFee); CMutableTransaction MakeDisputeTx(uint256 signedSessionTxHash, uint256 vmResultHash); CMutableTransaction MakePostEvidenceTx(uint256 signedSessionTxHash, int playerIndex, std::vector<unsigned char> state); // on SAFE CC* MakePayoutCond(uint256 signedSessionTxHash); CMutableTransaction MakeStakeTx(CAmount totalPayout, uint256 signedSessionTx); CMutableTransaction MakeAgreePayoutTx(std::vector<CTxOut> payouts, uint256 signedStakeTxHash); CMutableTransaction MakeImportPayoutTx(std::vector<CTxOut> payouts, CTransaction signedDisputeTx, uint256 signedStakeTxHash, MoMProof momProof); }; bool GetOpReturnHash(CScript script, uint256 &hash); #endif /* BETPROTOCOL_H */
37.618421
98
0.607205
7af41d7b5ec29ae98292156bf21a8e43f1f2d47f
371
h
C
vulkan/skia_vulkan_header.h
ryansong/engine
5e569095132e0438551784a99ef682bf701d0fd9
[ "BSD-3-Clause" ]
2
2019-03-24T11:32:05.000Z
2019-11-07T04:31:41.000Z
vulkan/skia_vulkan_header.h
ryansong/engine
5e569095132e0438551784a99ef682bf701d0fd9
[ "BSD-3-Clause" ]
null
null
null
vulkan/skia_vulkan_header.h
ryansong/engine
5e569095132e0438551784a99ef682bf701d0fd9
[ "BSD-3-Clause" ]
1
2019-08-21T19:48:02.000Z
2019-08-21T19:48:02.000Z
// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef __ANDROID__ #ifndef VK_USE_PLATFORM_ANDROID_KHR #define VK_USE_PLATFORM_ANDROID_KHR 1 #endif // VK_USE_PLATFORM_ANDROID_KHR #endif // __ANDROID__ #include "third_party/vulkan/src/vulkan/vulkan.h"
30.916667
73
0.795148
9bc3217e898654836dedb1f4b093bec39523331e
561
h
C
macOS/10.13/AppKit.framework/NSAccessibilityStepperArrowButton.h
onmyway133/Runtime-Headers
e9b80e7ab9103f37ad421ad6b8b58ee06369d21f
[ "MIT" ]
30
2016-10-09T20:13:00.000Z
2022-01-24T04:14:57.000Z
macOS/10.12/AppKit.framework/NSAccessibilityStepperArrowButton.h
onmyway133/Runtime-Headers
e9b80e7ab9103f37ad421ad6b8b58ee06369d21f
[ "MIT" ]
null
null
null
macOS/10.12/AppKit.framework/NSAccessibilityStepperArrowButton.h
onmyway133/Runtime-Headers
e9b80e7ab9103f37ad421ad6b8b58ee06369d21f
[ "MIT" ]
7
2017-08-29T14:41:25.000Z
2022-01-19T17:14:54.000Z
/* Generated by RuntimeBrowser Image: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit */ @interface NSAccessibilityStepperArrowButton : NSAccessibilityMockUIElement { BOOL _increments; } + (id)decrementButtonWithParent:(id)arg1; + (id)incrementButtonWithParent:(id)arg1; - (id)accessibilityActionDescription:(id)arg1; - (id)accessibilityActionNames; - (id)accessibilityAttributeNames; - (void)accessibilityPerformAction:(id)arg1; - (BOOL)increments; - (id)initWithIncrements:(BOOL)arg1 parent:(id)arg2; - (BOOL)isEqual:(id)arg1; @end
26.714286
77
0.778966
63dc99ea7e0f081c171f733a8fd9b89fe2c2704b
1,979
h
C
include/CSHARP/CSHARP_MethodUnit.h
unitedtimur/laboratory2_QT_CMAKE
2c0fe5fd108a9839f4f0747bda43c916574fe40f
[ "MIT" ]
null
null
null
include/CSHARP/CSHARP_MethodUnit.h
unitedtimur/laboratory2_QT_CMAKE
2c0fe5fd108a9839f4f0747bda43c916574fe40f
[ "MIT" ]
null
null
null
include/CSHARP/CSHARP_MethodUnit.h
unitedtimur/laboratory2_QT_CMAKE
2c0fe5fd108a9839f4f0747bda43c916574fe40f
[ "MIT" ]
1
2021-02-17T16:59:15.000Z
2021-02-17T16:59:15.000Z
#pragma once #include "include/MethodUnit.h" class CSHARP_MethodUnit : public MethodUnit { public: // См. MethodUnit.h explicit CSHARP_MethodUnit(const std::string& name, const std::string& returnType, const Configuration::Flags& flags); void add(const Configuration::Ptr& unit, const Configuration::Flags& flags) override; std::string compile(const Configuration::UI& level) const override; }; inline CSHARP_MethodUnit::CSHARP_MethodUnit(const std::string& name, const std::string& returnType, const Configuration::Flags& flags) : MethodUnit(name, returnType, flags) { } inline void CSHARP_MethodUnit::add(const Configuration::Ptr& unit, const Configuration::Flags& /*flags*/) { if (unit == nullptr) THROW(__FUNCTION__); // Добавление юнита в тело метода _body.push_back(unit); } inline std::string CSHARP_MethodUnit::compile(const Configuration::UI& level) const { std::string result; // По аналогии с CPP_MethodUnit проверяем все биты и добавляем к результаты нужные модификаторы if (_flags & Configuration::Modifier::ABSTRACT && !(_flags & Configuration::Modifier::ASYNC)) result += "abstract "; // Модификатор как const в c++ if (_flags & Configuration::Modifier::SEALED) result += "sealed "; // Модификатор ассинхронной работы метода, для многопоточности if (_flags & Configuration::Modifier::ASYNC) result += "async "; // Модификатор позволяющий напрямую работать с памятью ( указатели / ссылки ) if (_flags & Configuration::Modifier::UNSAFE) result += "unsafe "; // Виртуальный ли метод if (_flags & Configuration::Modifier::VIRTUAL) result += "virtual "; // Статичный ли метод if (_flags & Configuration::Modifier::STATIC) result += "static "; // Добавляем возвращаемый тип и имя метода result += _returnType + ' ' + _name + "()" + " {\n"; // Генерируем результат с нужными отсупами в теле for (const auto& it : _body) result += it->compile(level + 1); result += generateShift(level) + "}\n"; return result; }
29.537313
136
0.722587
77d5b27002c4f22a284405d1637492662fe6c13c
348
h
C
include/vgl.h
pezy/opengl-redbook
958a97c32eff3a69d1ad28708a6534b36652dd45
[ "MIT" ]
4
2015-06-24T11:01:59.000Z
2017-05-04T11:33:25.000Z
include/vgl.h
pezy/opengl-redbook
958a97c32eff3a69d1ad28708a6534b36652dd45
[ "MIT" ]
null
null
null
include/vgl.h
pezy/opengl-redbook
958a97c32eff3a69d1ad28708a6534b36652dd45
[ "MIT" ]
null
null
null
#ifndef __VGL_H__ #define __VGL_H__ #define GLEW_STATIC #include "GL/glew.h" #ifdef _MSC_VER # ifdef _DEBUG # pragma comment(lib, "glew32sd.lib") # else # pragma comment(lib, "glew32s.lib") # endif #endif #define FREEGLUT_STATIC #include "GL/freeglut.h" #define BUFFER_OFFSET(x) ((const void*) (x)) #endif /* __VGL_H__ */
15.130435
45
0.675287
ae00bc0ade3406c5522f64bebe392e54cae8458f
5,130
h
C
FreeBSD/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
TigerBSD/FreeBSD-Custom-ThinkPad
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
4
2016-08-22T22:02:55.000Z
2017-03-04T22:56:44.000Z
FreeBSD/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
TigerBSD/FreeBSD-Custom-ThinkPad
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
21
2016-08-11T09:43:43.000Z
2017-01-29T12:52:56.000Z
FreeBSD/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
TigerBSD/TigerBSD
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
null
null
null
//===-- LibCxx.h ---------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_LibCxx_h_ #define liblldb_LibCxx_h_ #include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" namespace lldb_private { namespace formatters { bool LibcxxStringSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options); // libc++ std::string bool LibcxxWStringSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options); // libc++ std::wstring bool LibcxxSmartPointerSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options); // libc++ std::shared_ptr<> and std::weak_ptr<> class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: LibcxxVectorBoolSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp); size_t CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; bool Update() override; bool MightHaveChildren() override; size_t GetIndexOfChildWithName(const ConstString &name) override; ~LibcxxVectorBoolSyntheticFrontEnd() override; private: CompilerType m_bool_type; ExecutionContextRef m_exe_ctx_ref; uint64_t m_count; lldb::addr_t m_base_data_address; std::map<size_t,lldb::ValueObjectSP> m_children; }; SyntheticChildrenFrontEnd* LibcxxVectorBoolSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); bool LibcxxContainerSummaryProvider (ValueObject& valobj, Stream& stream, const TypeSummaryOptions& options); class LibCxxMapIteratorSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: LibCxxMapIteratorSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp); size_t CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; bool Update() override; bool MightHaveChildren() override; size_t GetIndexOfChildWithName(const ConstString &name) override; ~LibCxxMapIteratorSyntheticFrontEnd() override; private: ValueObject *m_pair_ptr; }; SyntheticChildrenFrontEnd* LibCxxMapIteratorSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); SyntheticChildrenFrontEnd* LibCxxVectorIteratorSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); class LibcxxSharedPtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: LibcxxSharedPtrSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp); size_t CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; bool Update() override; bool MightHaveChildren() override; size_t GetIndexOfChildWithName(const ConstString &name) override; ~LibcxxSharedPtrSyntheticFrontEnd() override; private: ValueObject* m_cntrl; lldb::ValueObjectSP m_count_sp; lldb::ValueObjectSP m_weak_count_sp; uint8_t m_ptr_size; lldb::ByteOrder m_byte_order; }; SyntheticChildrenFrontEnd* LibcxxSharedPtrSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); SyntheticChildrenFrontEnd* LibcxxStdVectorSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); SyntheticChildrenFrontEnd* LibcxxStdListSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); SyntheticChildrenFrontEnd* LibcxxStdMapSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); SyntheticChildrenFrontEnd* LibcxxStdUnorderedMapSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); SyntheticChildrenFrontEnd* LibcxxInitializerListSyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP); } // namespace formatters } // namespace lldb_private #endif // liblldb_LibCxx_h_
36.126761
163
0.611306
0ee0bd25b8a48bfb357d684c5cbe07c290c553a4
1,432
h
C
usr/libexec/nptocompaniond/NPTOCollectionTargetMapEntry.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
2
2021-11-02T09:23:27.000Z
2022-03-28T08:21:57.000Z
usr/libexec/nptocompaniond/NPTOCollectionTargetMapEntry.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
null
null
null
usr/libexec/nptocompaniond/NPTOCollectionTargetMapEntry.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
1
2022-03-28T08:21:59.000Z
2022-03-28T08:21:59.000Z
// // Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20). // // Copyright (C) 1997-2019 Steve Nygard. // #import <ProtocolBuffer/PBCodable.h> #import "NSCopying-Protocol.h" @class NSData; @interface NPTOCollectionTargetMapEntry : PBCodable <NSCopying> { int _collectionTarget; // 8 = 0x8 NSData *_uuid; // 16 = 0x10 struct { unsigned int collectionTarget:1; } _has; // 24 = 0x18 } - (void).cxx_destruct; // IMP=0x00000001000116b8 @property(nonatomic) int collectionTarget; // @synthesize collectionTarget=_collectionTarget; @property(retain, nonatomic) NSData *uuid; // @synthesize uuid=_uuid; - (void)mergeFrom:(id)arg1; // IMP=0x000000010001160c - (unsigned long long)hash; // IMP=0x00000001000115a4 - (_Bool)isEqual:(id)arg1; // IMP=0x00000001000114c8 - (id)copyWithZone:(struct _NSZone *)arg1; // IMP=0x0000000100011420 - (void)copyTo:(id)arg1; // IMP=0x00000001000113a8 - (void)writeTo:(id)arg1; // IMP=0x0000000100011338 - (_Bool)readFrom:(id)arg1; // IMP=0x0000000100011330 - (id)dictionaryRepresentation; // IMP=0x0000000100011010 - (id)description; // IMP=0x0000000100010f5c @property(nonatomic) _Bool hasCollectionTarget; @property(readonly, nonatomic) _Bool hasUuid; - (id)localIdentifier; // IMP=0x000000010001eb90 - (void)setUuidAsUUID:(id)arg1; // IMP=0x0000000100021724 - (id)uuidAsUUID; // IMP=0x000000010002169c @end
34.095238
120
0.735335
8536b5fb3454ca88cac42552f2c724e0707dfb76
783
h
C
src/Model/satfilemodel.h
tasmanianfox/sat-cnf-converter
a8ea106d8745f9f7ac14f7e8c39f6f6aa4819211
[ "MIT" ]
4
2017-04-01T05:09:51.000Z
2018-06-15T04:43:15.000Z
src/Model/satfilemodel.h
tasmanianfox/sat-cnf-converter
a8ea106d8745f9f7ac14f7e8c39f6f6aa4819211
[ "MIT" ]
null
null
null
src/Model/satfilemodel.h
tasmanianfox/sat-cnf-converter
a8ea106d8745f9f7ac14f7e8c39f6f6aa4819211
[ "MIT" ]
3
2015-09-20T09:17:12.000Z
2021-01-31T09:09:34.000Z
#ifndef MODEL_SATFILEMODEL_H #define MODEL_SATFILEMODEL_H #include "filemodel.h" #include "Collection/chainiterator.h" using namespace Model::Collection; namespace Model { /** * @brief The SatFileModel class * Contains information about SAT file */ class SatFileModel: public FileModel { public: SatFileModel(); int getNumVariables(); void setNumVariables(int numVariables); string getExpresion(); void setExpression(string expression); void debugOutput(); protected: /** * @brief numVariables - number of variables in input SAT file */ int numVariables; /** * @brief expression - expression in SAT format */ string expression; }; } #endif // MODEL_SATFILEMODEL_H
17.4
67
0.659004
e221f810f82fb0c7743f2c6ccf801b83ba8d9c88
1,747
h
C
source/SMEvent.h
romanalarcon/smmake
72bffc8b1534949ac3c7721cde1e030fc1cb6eb3
[ "MIT" ]
1
2018-10-24T13:53:57.000Z
2018-10-24T13:53:57.000Z
source/SMEvent.h
romanalarcon/smmake
72bffc8b1534949ac3c7721cde1e030fc1cb6eb3
[ "MIT" ]
null
null
null
source/SMEvent.h
romanalarcon/smmake
72bffc8b1534949ac3c7721cde1e030fc1cb6eb3
[ "MIT" ]
null
null
null
/* The MIT License (MIT) Copyright (c) 2016 Roman Alarcon 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 __SMEVENT_H #define __SMEVENT_H #include <string> #include <vector> class SMState; class SMEvent { private: std::string _name; std::string _action; const SMState* _source; const SMState* _target; public: SMEvent(const std::string& name, const SMState* source, const SMState* target): _name(name), _source(source), _target(target), _action("") { } void setAction(const std::string& action); std::string getName() const; std::string getAction() const; const SMState * getSource() const; const SMState * getTarget() const; }; #endif
28.639344
84
0.726961
8fbd24d914df83254bf636c62379e51a27c3f41a
913
h
C
FlixBus/FlixBus/userTypeMenuView.h
c371group/FlixBus
87db7a922e40b1f67d9c90661127379e510f17a5
[ "MIT" ]
null
null
null
FlixBus/FlixBus/userTypeMenuView.h
c371group/FlixBus
87db7a922e40b1f67d9c90661127379e510f17a5
[ "MIT" ]
null
null
null
FlixBus/FlixBus/userTypeMenuView.h
c371group/FlixBus
87db7a922e40b1f67d9c90661127379e510f17a5
[ "MIT" ]
null
null
null
#pragma once #include "interfaceView.h" #include "customerInterface.h" #include "accountRepo.h" #include "adminInterface.h" #include "routeRepo.h" /** * \brief userTypeMenuView gives control over user menu. Inherits from interfaceView. */ class userTypeMenuView : public interfaceView { private: // Reference to account repository object. account_repo* acctRep; // Reference to route repository object. route_repo* routeRep; // Reference to revenue object. revenue* revenue_; public: // Constructor that assigns account repository reference. userTypeMenuView(account_repo*); // Constructor takes account repository, route repository and revenue references. userTypeMenuView(account_repo*, route_repo*, revenue*); // Prepared the menu void preLoad(account_repo*); // Menu logic is located here. int menuLogic(); // Returns reference of an account repository. account_repo* getAcctRep(); };
24.675676
85
0.765608
d4063d2c1917dcdd5d797228e267a2d163894b01
282
h
C
src/Plugins/GoatTracker/gt2/gdisplay.h
slajerek/RetroDebugger
e761e4f9efd103a05e65ef283423b142fa4324c7
[ "Apache-2.0", "MIT" ]
34
2021-05-29T07:04:17.000Z
2022-03-10T20:16:03.000Z
src/Plugins/GoatTracker/gt2/gdisplay.h
slajerek/RetroDebugger
e761e4f9efd103a05e65ef283423b142fa4324c7
[ "Apache-2.0", "MIT" ]
6
2021-12-25T13:05:21.000Z
2022-01-19T17:35:17.000Z
src/Plugins/GoatTracker/gt2/gdisplay.h
slajerek/RetroDebugger
e761e4f9efd103a05e65ef283423b142fa4324c7
[ "Apache-2.0", "MIT" ]
6
2021-12-24T18:37:41.000Z
2022-02-06T23:06:02.000Z
#ifndef GDISPLAY_H #define GDISPLAY_H #define CNORMAL 8 #define CMUTE 3 #define CEDIT 10 #define CPLAYING 12 #define CCOMMAND 7 #define CTITLE 15 void printmainscreen(void); void displayupdate(void); void printstatus(void); void resettime(void); void incrementtime(void); #endif
15.666667
27
0.787234
556307ad920bd924e2d9062028f4a7631e7cd203
51,800
c
C
testsuite/EXP_1/test1534.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
34
2017-07-04T14:16:12.000Z
2021-04-22T21:04:43.000Z
testsuite/EXP_1/test1534.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
1
2017-07-06T03:43:44.000Z
2017-07-06T03:43:44.000Z
testsuite/EXP_1/test1534.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
6
2017-07-04T16:30:42.000Z
2019-10-16T05:37:29.000Z
/* CF3 Copyright (c) 2015 ishiura-lab. Released under the MIT license. https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md */ #include<stdio.h> #include<stdint.h> #include<stdlib.h> #include"test1.h" static volatile uint64_t x2 = UINT64_MAX; int64_t x3 = INT64_MAX; int32_t t0 = -23111; static int16_t x11 = INT16_MIN; int16_t x15 = INT16_MIN; int16_t x20 = INT16_MIN; volatile int32_t t4 = -149063772; static int16_t x27 = -905; static uint16_t x28 = UINT16_MAX; uint64_t x30 = UINT64_MAX; int32_t x33 = -1; uint32_t x36 = UINT32_MAX; uint64_t x37 = UINT64_MAX; int8_t x38 = INT8_MAX; static volatile int64_t x40 = 297397405961584170LL; int32_t t10 = -216; uint8_t x53 = 4U; volatile int32_t x54 = INT32_MIN; int32_t x55 = INT32_MIN; volatile int32_t t14 = -431; uint64_t x61 = 312610749621427LLU; int16_t x68 = -2; uint16_t x75 = 3U; int32_t t18 = -116; int64_t x80 = INT64_MIN; int32_t x81 = INT32_MIN; volatile int32_t t20 = 37767976; static volatile int8_t x88 = 0; int16_t x89 = -1; int32_t x94 = INT32_MAX; int32_t t23 = -353788182; int8_t x109 = INT8_MIN; int16_t x114 = -78; int16_t x117 = -15; volatile int32_t t30 = -14721; static volatile int16_t x125 = -1; int8_t x130 = 2; static int32_t t33 = -600064; static int8_t x137 = INT8_MIN; uint32_t x139 = 1U; volatile int32_t t34 = 798588; volatile int64_t x143 = INT64_MIN; int32_t x145 = INT32_MIN; uint16_t x151 = 2U; volatile int32_t t37 = -6934892; int32_t x153 = INT32_MIN; static int32_t x154 = INT32_MAX; volatile uint16_t x161 = 3U; volatile int32_t x163 = -118149051; int32_t x165 = INT32_MAX; int32_t t43 = 0; static int8_t x178 = -11; uint64_t x182 = 39795LLU; uint8_t x184 = UINT8_MAX; int8_t x188 = INT8_MIN; int8_t x194 = INT8_MIN; uint8_t x203 = 3U; volatile int16_t x207 = INT16_MAX; int32_t x211 = INT32_MAX; static int16_t x215 = -1; static volatile int32_t t53 = 225222720; uint8_t x218 = UINT8_MAX; uint32_t x222 = 107U; volatile int32_t t55 = 908342249; int32_t t56 = 5176; uint32_t x231 = 0U; volatile uint64_t x236 = UINT64_MAX; static int64_t x238 = -65905885LL; uint64_t x240 = 144840441499802LLU; int32_t x241 = INT32_MIN; uint16_t x244 = UINT16_MAX; static uint8_t x250 = 2U; int32_t t64 = 10595102; uint64_t x266 = UINT64_MAX; static int64_t x268 = INT64_MIN; uint32_t x274 = 140U; static int16_t x275 = -1; static int32_t x280 = -1; int8_t x283 = INT8_MIN; static volatile int32_t t71 = -1035481; volatile uint8_t x289 = 61U; uint32_t x290 = 337171U; static int16_t x299 = INT16_MIN; volatile int16_t x301 = INT16_MIN; volatile int32_t t76 = -3; int32_t x313 = -249769; int16_t x314 = 687; volatile int32_t x322 = INT32_MIN; static uint32_t x323 = 855382U; int64_t x328 = INT64_MIN; volatile int16_t x332 = -6051; int64_t x334 = INT64_MIN; static int64_t x343 = 2381086827288533LL; static uint32_t x351 = 80U; int32_t x353 = INT32_MIN; static int32_t t88 = -32009973; volatile int64_t x357 = -1LL; int8_t x358 = INT8_MAX; volatile uint64_t x363 = 2196229392401LLU; int32_t x365 = INT32_MIN; uint64_t x368 = 250059774LLU; volatile int64_t x369 = 707446LL; int32_t x371 = INT32_MAX; int16_t x374 = INT16_MAX; volatile int32_t t95 = 36; volatile uint32_t x387 = UINT32_MAX; int32_t x389 = 2557580; uint8_t x390 = 52U; static int8_t x401 = INT8_MIN; int8_t x402 = -1; int16_t x403 = 548; uint8_t x409 = UINT8_MAX; int32_t t104 = -949627; static int8_t x439 = 0; int32_t x443 = -1; static volatile int8_t x444 = 0; volatile int16_t x463 = INT16_MIN; int16_t x468 = INT16_MIN; int16_t x474 = -1; uint32_t x476 = 86704141U; uint64_t x480 = UINT64_MAX; int16_t x482 = INT16_MIN; int64_t x483 = 3295746983LL; static int32_t x484 = INT32_MAX; static int32_t x487 = -1; uint8_t x488 = UINT8_MAX; volatile int32_t t122 = 0; uint8_t x501 = 61U; static volatile int16_t x509 = INT16_MAX; uint8_t x513 = 7U; static uint32_t x521 = UINT32_MAX; int64_t x523 = INT64_MAX; volatile int32_t t130 = -6; int16_t x527 = -478; uint8_t x535 = 0U; volatile uint64_t x540 = 374LLU; int32_t x563 = -1; int8_t x564 = INT8_MIN; volatile int32_t x566 = INT32_MAX; int64_t x569 = INT64_MIN; int16_t x572 = 23; int32_t t142 = -17295336; volatile int32_t t143 = -13541083; volatile int64_t x577 = 13146631204687LL; volatile int32_t t144 = 399; uint64_t x582 = UINT64_MAX; uint8_t x588 = UINT8_MAX; int8_t x589 = INT8_MIN; int16_t x591 = INT16_MAX; int32_t x592 = INT32_MIN; static volatile uint64_t x594 = 11651661511LLU; int32_t x597 = -1; static volatile int16_t x599 = 2; int16_t x603 = INT16_MIN; volatile int64_t x611 = INT64_MIN; volatile int32_t t152 = 12403; int32_t t153 = 1517932; static volatile int32_t x620 = INT32_MIN; volatile int32_t t154 = -68; int8_t x625 = INT8_MAX; static uint16_t x630 = 6865U; int8_t x634 = -1; int8_t x643 = -1; uint16_t x648 = 17U; volatile uint8_t x654 = UINT8_MAX; int32_t t163 = -2; int64_t x658 = 798659551387444379LL; int16_t x662 = INT16_MAX; static int64_t x665 = 3397103889011570LL; int8_t x666 = 10; int32_t x669 = INT32_MIN; volatile int64_t x671 = INT64_MAX; int64_t x672 = 400013LL; static volatile int16_t x675 = INT16_MAX; int32_t t169 = 1443944; int64_t x681 = 0LL; uint8_t x693 = 16U; volatile int32_t t175 = -462; volatile int16_t x705 = -1780; int32_t t176 = -1384; int8_t x714 = -1; int16_t x716 = INT16_MIN; volatile int16_t x717 = INT16_MIN; uint64_t x720 = 3413LLU; volatile int32_t t179 = -929; int8_t x721 = INT8_MIN; volatile int32_t t185 = -1; int16_t x745 = -1; uint32_t x750 = 6709U; uint16_t x752 = UINT16_MAX; static uint8_t x761 = UINT8_MAX; int32_t t190 = -1; uint8_t x768 = 4U; uint16_t x778 = 3272U; volatile int32_t t194 = -6; static int32_t t195 = -524956; volatile uint16_t x785 = UINT16_MAX; int64_t x794 = -490347134663147207LL; void f0(void) { static int8_t x1 = INT8_MIN; static uint8_t x4 = 1U; t0 = (((x1==x2)&x3)==x4); if (t0 != 0) { NG(); } else { ; } } void f1(void) { volatile int32_t x5 = INT32_MIN; static int64_t x6 = 57883393827LL; int32_t x7 = INT32_MIN; int64_t x8 = -364549055686350072LL; volatile int32_t t1 = 1098124; t1 = (((x5==x6)&x7)==x8); if (t1 != 0) { NG(); } else { ; } } void f2(void) { uint8_t x9 = 13U; volatile int64_t x10 = INT64_MIN; uint64_t x12 = 1094091754636477070LLU; volatile int32_t t2 = 401953; t2 = (((x9==x10)&x11)==x12); if (t2 != 0) { NG(); } else { ; } } void f3(void) { int32_t x13 = 5; int64_t x14 = -1LL; static int16_t x16 = 7410; volatile int32_t t3 = -3021012; t3 = (((x13==x14)&x15)==x16); if (t3 != 0) { NG(); } else { ; } } void f4(void) { int16_t x17 = -1; uint32_t x18 = 449535U; int8_t x19 = INT8_MIN; t4 = (((x17==x18)&x19)==x20); if (t4 != 0) { NG(); } else { ; } } void f5(void) { static int64_t x21 = INT64_MAX; int32_t x22 = -1; int64_t x23 = INT64_MIN; int16_t x24 = -3; static int32_t t5 = 0; t5 = (((x21==x22)&x23)==x24); if (t5 != 0) { NG(); } else { ; } } void f6(void) { volatile int16_t x25 = 4; int64_t x26 = INT64_MIN; static volatile int32_t t6 = 113667; t6 = (((x25==x26)&x27)==x28); if (t6 != 0) { NG(); } else { ; } } void f7(void) { int8_t x29 = -1; int8_t x31 = -1; static int32_t x32 = INT32_MAX; int32_t t7 = -527863; t7 = (((x29==x30)&x31)==x32); if (t7 != 0) { NG(); } else { ; } } void f8(void) { int16_t x34 = 1; uint16_t x35 = UINT16_MAX; int32_t t8 = -176457; t8 = (((x33==x34)&x35)==x36); if (t8 != 0) { NG(); } else { ; } } void f9(void) { uint64_t x39 = 2514LLU; volatile int32_t t9 = 5; t9 = (((x37==x38)&x39)==x40); if (t9 != 0) { NG(); } else { ; } } void f10(void) { uint8_t x41 = UINT8_MAX; int64_t x42 = INT64_MIN; int8_t x43 = -1; uint8_t x44 = UINT8_MAX; t10 = (((x41==x42)&x43)==x44); if (t10 != 0) { NG(); } else { ; } } void f11(void) { int64_t x45 = INT64_MIN; static volatile int64_t x46 = -1LL; uint32_t x47 = 33409U; int64_t x48 = INT64_MIN; int32_t t11 = -519037; t11 = (((x45==x46)&x47)==x48); if (t11 != 0) { NG(); } else { ; } } void f12(void) { volatile int8_t x49 = -1; int16_t x50 = 2; uint64_t x51 = 27814346373317LLU; static uint16_t x52 = 20U; volatile int32_t t12 = 0; t12 = (((x49==x50)&x51)==x52); if (t12 != 0) { NG(); } else { ; } } void f13(void) { int32_t x56 = INT32_MAX; int32_t t13 = -217327176; t13 = (((x53==x54)&x55)==x56); if (t13 != 0) { NG(); } else { ; } } void f14(void) { int64_t x57 = 10703273319719081LL; uint64_t x58 = 425158061960448LLU; int64_t x59 = INT64_MIN; volatile int8_t x60 = INT8_MIN; t14 = (((x57==x58)&x59)==x60); if (t14 != 0) { NG(); } else { ; } } void f15(void) { volatile int16_t x62 = INT16_MIN; uint32_t x63 = 81595146U; static int8_t x64 = INT8_MIN; volatile int32_t t15 = -446923; t15 = (((x61==x62)&x63)==x64); if (t15 != 0) { NG(); } else { ; } } void f16(void) { static int64_t x65 = -213551360932784LL; int8_t x66 = 0; uint32_t x67 = 15U; volatile int32_t t16 = 18456607; t16 = (((x65==x66)&x67)==x68); if (t16 != 0) { NG(); } else { ; } } void f17(void) { volatile int64_t x69 = INT64_MAX; volatile int32_t x70 = INT32_MIN; uint64_t x71 = 4708523LLU; static volatile int64_t x72 = -1LL; volatile int32_t t17 = 3270; t17 = (((x69==x70)&x71)==x72); if (t17 != 0) { NG(); } else { ; } } void f18(void) { int64_t x73 = INT64_MIN; uint64_t x74 = UINT64_MAX; int32_t x76 = -11188; t18 = (((x73==x74)&x75)==x76); if (t18 != 0) { NG(); } else { ; } } void f19(void) { volatile int32_t x77 = INT32_MAX; int16_t x78 = INT16_MAX; int64_t x79 = -1LL; static int32_t t19 = -11514; t19 = (((x77==x78)&x79)==x80); if (t19 != 0) { NG(); } else { ; } } void f20(void) { static int32_t x82 = INT32_MAX; int32_t x83 = INT32_MIN; static int8_t x84 = INT8_MIN; t20 = (((x81==x82)&x83)==x84); if (t20 != 0) { NG(); } else { ; } } void f21(void) { int64_t x85 = 38367324988569068LL; int64_t x86 = INT64_MIN; int16_t x87 = INT16_MAX; int32_t t21 = -1; t21 = (((x85==x86)&x87)==x88); if (t21 != 1) { NG(); } else { ; } } void f22(void) { uint8_t x90 = 94U; static int32_t x91 = INT32_MIN; int64_t x92 = 1LL; volatile int32_t t22 = 1; t22 = (((x89==x90)&x91)==x92); if (t22 != 0) { NG(); } else { ; } } void f23(void) { uint16_t x93 = 30839U; uint64_t x95 = 3894211540LLU; static volatile int32_t x96 = INT32_MIN; t23 = (((x93==x94)&x95)==x96); if (t23 != 0) { NG(); } else { ; } } void f24(void) { int32_t x97 = -1; int16_t x98 = INT16_MIN; uint64_t x99 = 2633LLU; volatile int8_t x100 = INT8_MIN; int32_t t24 = 5782396; t24 = (((x97==x98)&x99)==x100); if (t24 != 0) { NG(); } else { ; } } void f25(void) { volatile int16_t x101 = INT16_MIN; int64_t x102 = INT64_MAX; int16_t x103 = 1; int16_t x104 = 0; static int32_t t25 = 134746; t25 = (((x101==x102)&x103)==x104); if (t25 != 1) { NG(); } else { ; } } void f26(void) { uint64_t x105 = 147598LLU; int16_t x106 = 15285; int32_t x107 = INT32_MAX; int16_t x108 = -1; volatile int32_t t26 = 0; t26 = (((x105==x106)&x107)==x108); if (t26 != 0) { NG(); } else { ; } } void f27(void) { static volatile int8_t x110 = 1; volatile uint8_t x111 = UINT8_MAX; int64_t x112 = -3028150805209289288LL; static int32_t t27 = -175027565; t27 = (((x109==x110)&x111)==x112); if (t27 != 0) { NG(); } else { ; } } void f28(void) { uint32_t x113 = UINT32_MAX; uint16_t x115 = 184U; int64_t x116 = -1LL; int32_t t28 = 20; t28 = (((x113==x114)&x115)==x116); if (t28 != 0) { NG(); } else { ; } } void f29(void) { volatile uint16_t x118 = 27859U; uint64_t x119 = 2532LLU; uint64_t x120 = 490011801950032550LLU; static volatile int32_t t29 = -1; t29 = (((x117==x118)&x119)==x120); if (t29 != 0) { NG(); } else { ; } } void f30(void) { volatile int32_t x121 = INT32_MAX; uint64_t x122 = 426795LLU; static int32_t x123 = INT32_MIN; static volatile uint64_t x124 = UINT64_MAX; t30 = (((x121==x122)&x123)==x124); if (t30 != 0) { NG(); } else { ; } } void f31(void) { int8_t x126 = INT8_MAX; int64_t x127 = INT64_MAX; volatile int32_t x128 = INT32_MAX; volatile int32_t t31 = 0; t31 = (((x125==x126)&x127)==x128); if (t31 != 0) { NG(); } else { ; } } void f32(void) { int32_t x129 = INT32_MIN; uint64_t x131 = UINT64_MAX; volatile uint64_t x132 = 1940661LLU; volatile int32_t t32 = 74278; t32 = (((x129==x130)&x131)==x132); if (t32 != 0) { NG(); } else { ; } } void f33(void) { int32_t x133 = -3; uint8_t x134 = 1U; static int64_t x135 = -417078643LL; static volatile uint16_t x136 = 55U; t33 = (((x133==x134)&x135)==x136); if (t33 != 0) { NG(); } else { ; } } void f34(void) { volatile int16_t x138 = -115; static int64_t x140 = INT64_MIN; t34 = (((x137==x138)&x139)==x140); if (t34 != 0) { NG(); } else { ; } } void f35(void) { volatile int32_t x141 = -1; uint64_t x142 = 1826986472754426LLU; int16_t x144 = -1326; int32_t t35 = 32761; t35 = (((x141==x142)&x143)==x144); if (t35 != 0) { NG(); } else { ; } } void f36(void) { volatile int64_t x146 = -1LL; int8_t x147 = -1; volatile int64_t x148 = INT64_MAX; volatile int32_t t36 = -5148114; t36 = (((x145==x146)&x147)==x148); if (t36 != 0) { NG(); } else { ; } } void f37(void) { static uint16_t x149 = 7307U; volatile int8_t x150 = -1; static int8_t x152 = -1; t37 = (((x149==x150)&x151)==x152); if (t37 != 0) { NG(); } else { ; } } void f38(void) { static int8_t x155 = INT8_MIN; static int16_t x156 = INT16_MIN; volatile int32_t t38 = 5; t38 = (((x153==x154)&x155)==x156); if (t38 != 0) { NG(); } else { ; } } void f39(void) { uint64_t x157 = 3531486966866852LLU; int16_t x158 = INT16_MIN; int16_t x159 = INT16_MIN; int8_t x160 = 2; static int32_t t39 = -64345; t39 = (((x157==x158)&x159)==x160); if (t39 != 0) { NG(); } else { ; } } void f40(void) { uint8_t x162 = 0U; int64_t x164 = -442024LL; static int32_t t40 = -5; t40 = (((x161==x162)&x163)==x164); if (t40 != 0) { NG(); } else { ; } } void f41(void) { int64_t x166 = INT64_MAX; uint32_t x167 = 5098U; uint64_t x168 = UINT64_MAX; int32_t t41 = -2; t41 = (((x165==x166)&x167)==x168); if (t41 != 0) { NG(); } else { ; } } void f42(void) { static uint16_t x169 = 5U; int8_t x170 = -56; volatile int32_t x171 = 2; static int8_t x172 = -1; volatile int32_t t42 = 108866; t42 = (((x169==x170)&x171)==x172); if (t42 != 0) { NG(); } else { ; } } void f43(void) { static int8_t x173 = INT8_MAX; volatile int64_t x174 = INT64_MIN; volatile uint64_t x175 = 3590229LLU; uint64_t x176 = 0LLU; t43 = (((x173==x174)&x175)==x176); if (t43 != 1) { NG(); } else { ; } } void f44(void) { uint32_t x177 = 5342U; static int16_t x179 = INT16_MAX; volatile int32_t x180 = INT32_MIN; static volatile int32_t t44 = -44440; t44 = (((x177==x178)&x179)==x180); if (t44 != 0) { NG(); } else { ; } } void f45(void) { int16_t x181 = INT16_MIN; static int32_t x183 = INT32_MAX; int32_t t45 = 385; t45 = (((x181==x182)&x183)==x184); if (t45 != 0) { NG(); } else { ; } } void f46(void) { int32_t x185 = -3809; static int64_t x186 = INT64_MIN; static int16_t x187 = -1; int32_t t46 = -8; t46 = (((x185==x186)&x187)==x188); if (t46 != 0) { NG(); } else { ; } } void f47(void) { static uint32_t x189 = 13U; int16_t x190 = 52; int32_t x191 = -1; static int8_t x192 = 3; volatile int32_t t47 = -495; t47 = (((x189==x190)&x191)==x192); if (t47 != 0) { NG(); } else { ; } } void f48(void) { uint8_t x193 = 46U; volatile int8_t x195 = -38; int16_t x196 = INT16_MAX; volatile int32_t t48 = 6949091; t48 = (((x193==x194)&x195)==x196); if (t48 != 0) { NG(); } else { ; } } void f49(void) { uint16_t x197 = 13U; volatile int16_t x198 = INT16_MIN; int8_t x199 = INT8_MIN; int8_t x200 = INT8_MAX; volatile int32_t t49 = 1451; t49 = (((x197==x198)&x199)==x200); if (t49 != 0) { NG(); } else { ; } } void f50(void) { int32_t x201 = -1; int64_t x202 = INT64_MIN; static int64_t x204 = 40750LL; static volatile int32_t t50 = -2; t50 = (((x201==x202)&x203)==x204); if (t50 != 0) { NG(); } else { ; } } void f51(void) { int8_t x205 = -1; volatile uint32_t x206 = 473931266U; static int8_t x208 = -1; volatile int32_t t51 = -49175227; t51 = (((x205==x206)&x207)==x208); if (t51 != 0) { NG(); } else { ; } } void f52(void) { static volatile uint32_t x209 = 14545U; uint8_t x210 = 5U; uint16_t x212 = 22488U; int32_t t52 = 24; t52 = (((x209==x210)&x211)==x212); if (t52 != 0) { NG(); } else { ; } } void f53(void) { uint8_t x213 = 113U; int64_t x214 = -1LL; uint64_t x216 = UINT64_MAX; t53 = (((x213==x214)&x215)==x216); if (t53 != 0) { NG(); } else { ; } } void f54(void) { uint64_t x217 = 23021051402700LLU; uint8_t x219 = 2U; static int16_t x220 = INT16_MIN; static volatile int32_t t54 = -740377; t54 = (((x217==x218)&x219)==x220); if (t54 != 0) { NG(); } else { ; } } void f55(void) { int8_t x221 = -1; uint64_t x223 = UINT64_MAX; uint64_t x224 = 50005780866513LLU; t55 = (((x221==x222)&x223)==x224); if (t55 != 0) { NG(); } else { ; } } void f56(void) { int32_t x225 = -1; int16_t x226 = -3422; static int32_t x227 = -6052; uint32_t x228 = 49825988U; t56 = (((x225==x226)&x227)==x228); if (t56 != 0) { NG(); } else { ; } } void f57(void) { int32_t x229 = 477; volatile uint8_t x230 = 1U; volatile int16_t x232 = INT16_MIN; static volatile int32_t t57 = 744; t57 = (((x229==x230)&x231)==x232); if (t57 != 0) { NG(); } else { ; } } void f58(void) { static int64_t x233 = 1351051915LL; int64_t x234 = 2303133475751190256LL; volatile int16_t x235 = -1; volatile int32_t t58 = 54050749; t58 = (((x233==x234)&x235)==x236); if (t58 != 0) { NG(); } else { ; } } void f59(void) { int32_t x237 = -1; int32_t x239 = INT32_MIN; volatile int32_t t59 = 46807; t59 = (((x237==x238)&x239)==x240); if (t59 != 0) { NG(); } else { ; } } void f60(void) { static volatile int8_t x242 = -1; int64_t x243 = -1LL; int32_t t60 = -7; t60 = (((x241==x242)&x243)==x244); if (t60 != 0) { NG(); } else { ; } } void f61(void) { static volatile uint16_t x245 = 0U; int64_t x246 = 2841309259LL; static uint16_t x247 = 1U; int32_t x248 = INT32_MIN; volatile int32_t t61 = 1; t61 = (((x245==x246)&x247)==x248); if (t61 != 0) { NG(); } else { ; } } void f62(void) { volatile int32_t x249 = INT32_MAX; static int32_t x251 = -1; int64_t x252 = INT64_MAX; int32_t t62 = 2; t62 = (((x249==x250)&x251)==x252); if (t62 != 0) { NG(); } else { ; } } void f63(void) { static volatile uint8_t x253 = 97U; int8_t x254 = 63; volatile int16_t x255 = 117; int16_t x256 = INT16_MAX; static volatile int32_t t63 = 109333; t63 = (((x253==x254)&x255)==x256); if (t63 != 0) { NG(); } else { ; } } void f64(void) { static volatile uint32_t x257 = UINT32_MAX; volatile int16_t x258 = -1; uint8_t x259 = 52U; uint8_t x260 = UINT8_MAX; t64 = (((x257==x258)&x259)==x260); if (t64 != 0) { NG(); } else { ; } } void f65(void) { uint32_t x261 = 1495U; int64_t x262 = INT64_MAX; int32_t x263 = INT32_MIN; uint8_t x264 = 6U; static int32_t t65 = 5; t65 = (((x261==x262)&x263)==x264); if (t65 != 0) { NG(); } else { ; } } void f66(void) { int64_t x265 = INT64_MIN; int16_t x267 = -1; int32_t t66 = 10; t66 = (((x265==x266)&x267)==x268); if (t66 != 0) { NG(); } else { ; } } void f67(void) { static volatile int32_t x269 = -1; int32_t x270 = INT32_MAX; int64_t x271 = -1LL; int8_t x272 = 48; volatile int32_t t67 = -64100221; t67 = (((x269==x270)&x271)==x272); if (t67 != 0) { NG(); } else { ; } } void f68(void) { uint32_t x273 = 12159428U; int8_t x276 = -42; static int32_t t68 = 3; t68 = (((x273==x274)&x275)==x276); if (t68 != 0) { NG(); } else { ; } } void f69(void) { uint32_t x277 = 386918543U; volatile int64_t x278 = INT64_MAX; volatile int32_t x279 = INT32_MIN; int32_t t69 = 41212768; t69 = (((x277==x278)&x279)==x280); if (t69 != 0) { NG(); } else { ; } } void f70(void) { volatile uint32_t x281 = 1U; int64_t x282 = -1LL; int64_t x284 = INT64_MIN; volatile int32_t t70 = 0; t70 = (((x281==x282)&x283)==x284); if (t70 != 0) { NG(); } else { ; } } void f71(void) { int64_t x285 = 0LL; uint16_t x286 = 88U; int32_t x287 = -1; int32_t x288 = -1; t71 = (((x285==x286)&x287)==x288); if (t71 != 0) { NG(); } else { ; } } void f72(void) { uint32_t x291 = 90335984U; int16_t x292 = 1032; static int32_t t72 = 9170; t72 = (((x289==x290)&x291)==x292); if (t72 != 0) { NG(); } else { ; } } void f73(void) { uint32_t x293 = 12U; volatile int16_t x294 = INT16_MAX; uint16_t x295 = 70U; int16_t x296 = 27; int32_t t73 = 61512; t73 = (((x293==x294)&x295)==x296); if (t73 != 0) { NG(); } else { ; } } void f74(void) { uint16_t x297 = UINT16_MAX; int64_t x298 = -299467715LL; volatile uint16_t x300 = 378U; static volatile int32_t t74 = 951126214; t74 = (((x297==x298)&x299)==x300); if (t74 != 0) { NG(); } else { ; } } void f75(void) { static int16_t x302 = INT16_MAX; int32_t x303 = 10082; uint16_t x304 = UINT16_MAX; volatile int32_t t75 = 69511; t75 = (((x301==x302)&x303)==x304); if (t75 != 0) { NG(); } else { ; } } void f76(void) { volatile int16_t x305 = -7440; static int8_t x306 = INT8_MAX; int16_t x307 = INT16_MIN; int16_t x308 = INT16_MIN; t76 = (((x305==x306)&x307)==x308); if (t76 != 0) { NG(); } else { ; } } void f77(void) { volatile uint64_t x309 = 498731LLU; volatile uint16_t x310 = UINT16_MAX; int8_t x311 = INT8_MIN; int16_t x312 = -1; int32_t t77 = -1634; t77 = (((x309==x310)&x311)==x312); if (t77 != 0) { NG(); } else { ; } } void f78(void) { uint16_t x315 = 822U; int16_t x316 = INT16_MIN; int32_t t78 = 96359; t78 = (((x313==x314)&x315)==x316); if (t78 != 0) { NG(); } else { ; } } void f79(void) { volatile int32_t x317 = -15424374; uint8_t x318 = 43U; uint32_t x319 = 10306445U; int32_t x320 = 16083; volatile int32_t t79 = -1; t79 = (((x317==x318)&x319)==x320); if (t79 != 0) { NG(); } else { ; } } void f80(void) { int32_t x321 = -1; static int8_t x324 = -1; static int32_t t80 = 77732; t80 = (((x321==x322)&x323)==x324); if (t80 != 0) { NG(); } else { ; } } void f81(void) { static int16_t x325 = INT16_MIN; static int32_t x326 = INT32_MIN; int32_t x327 = 135759; volatile int32_t t81 = 15309294; t81 = (((x325==x326)&x327)==x328); if (t81 != 0) { NG(); } else { ; } } void f82(void) { static uint64_t x329 = UINT64_MAX; uint16_t x330 = 3U; uint16_t x331 = UINT16_MAX; int32_t t82 = -175687808; t82 = (((x329==x330)&x331)==x332); if (t82 != 0) { NG(); } else { ; } } void f83(void) { uint32_t x333 = 124563U; static uint16_t x335 = 7835U; int8_t x336 = -1; volatile int32_t t83 = 54208; t83 = (((x333==x334)&x335)==x336); if (t83 != 0) { NG(); } else { ; } } void f84(void) { static int8_t x337 = -1; static int64_t x338 = INT64_MAX; uint64_t x339 = UINT64_MAX; int32_t x340 = INT32_MIN; int32_t t84 = 42; t84 = (((x337==x338)&x339)==x340); if (t84 != 0) { NG(); } else { ; } } void f85(void) { int16_t x341 = -2161; int16_t x342 = INT16_MIN; uint16_t x344 = UINT16_MAX; volatile int32_t t85 = -88489; t85 = (((x341==x342)&x343)==x344); if (t85 != 0) { NG(); } else { ; } } void f86(void) { static volatile int16_t x345 = -1; static uint32_t x346 = 99295700U; int64_t x347 = INT64_MAX; int64_t x348 = INT64_MIN; volatile int32_t t86 = -2; t86 = (((x345==x346)&x347)==x348); if (t86 != 0) { NG(); } else { ; } } void f87(void) { uint32_t x349 = 127063947U; uint64_t x350 = UINT64_MAX; int64_t x352 = -1LL; volatile int32_t t87 = 20; t87 = (((x349==x350)&x351)==x352); if (t87 != 0) { NG(); } else { ; } } void f88(void) { int16_t x354 = INT16_MAX; uint16_t x355 = 31U; int16_t x356 = -349; t88 = (((x353==x354)&x355)==x356); if (t88 != 0) { NG(); } else { ; } } void f89(void) { int16_t x359 = 39; int16_t x360 = 2; static int32_t t89 = -1; t89 = (((x357==x358)&x359)==x360); if (t89 != 0) { NG(); } else { ; } } void f90(void) { uint64_t x361 = 123388915129LLU; static int16_t x362 = INT16_MIN; int16_t x364 = INT16_MIN; volatile int32_t t90 = -3008293; t90 = (((x361==x362)&x363)==x364); if (t90 != 0) { NG(); } else { ; } } void f91(void) { uint16_t x366 = 1677U; int32_t x367 = -17; int32_t t91 = -6243602; t91 = (((x365==x366)&x367)==x368); if (t91 != 0) { NG(); } else { ; } } void f92(void) { int64_t x370 = INT64_MIN; int8_t x372 = -1; int32_t t92 = -81; t92 = (((x369==x370)&x371)==x372); if (t92 != 0) { NG(); } else { ; } } void f93(void) { static int64_t x373 = -1LL; int8_t x375 = INT8_MAX; uint32_t x376 = 2034284962U; volatile int32_t t93 = 64; t93 = (((x373==x374)&x375)==x376); if (t93 != 0) { NG(); } else { ; } } void f94(void) { static int8_t x377 = 0; static int8_t x378 = INT8_MIN; uint64_t x379 = 432429LLU; volatile uint16_t x380 = 8U; static int32_t t94 = -801951672; t94 = (((x377==x378)&x379)==x380); if (t94 != 0) { NG(); } else { ; } } void f95(void) { int8_t x381 = INT8_MIN; volatile int16_t x382 = -1; int16_t x383 = 0; volatile int32_t x384 = INT32_MIN; t95 = (((x381==x382)&x383)==x384); if (t95 != 0) { NG(); } else { ; } } void f96(void) { static uint16_t x385 = 23U; uint64_t x386 = 5552752LLU; volatile int16_t x388 = -1; int32_t t96 = -2942499; t96 = (((x385==x386)&x387)==x388); if (t96 != 0) { NG(); } else { ; } } void f97(void) { int64_t x391 = 42LL; volatile int32_t x392 = INT32_MAX; int32_t t97 = -930611974; t97 = (((x389==x390)&x391)==x392); if (t97 != 0) { NG(); } else { ; } } void f98(void) { volatile int32_t x393 = -391987233; volatile int64_t x394 = INT64_MIN; int64_t x395 = -186LL; uint32_t x396 = 1U; volatile int32_t t98 = 842; t98 = (((x393==x394)&x395)==x396); if (t98 != 0) { NG(); } else { ; } } void f99(void) { int8_t x397 = -11; int16_t x398 = INT16_MAX; int8_t x399 = INT8_MIN; uint16_t x400 = UINT16_MAX; volatile int32_t t99 = 924; t99 = (((x397==x398)&x399)==x400); if (t99 != 0) { NG(); } else { ; } } void f100(void) { volatile int8_t x404 = INT8_MIN; int32_t t100 = -98704; t100 = (((x401==x402)&x403)==x404); if (t100 != 0) { NG(); } else { ; } } void f101(void) { int32_t x405 = INT32_MAX; uint64_t x406 = UINT64_MAX; uint64_t x407 = 12762272852LLU; int64_t x408 = INT64_MIN; int32_t t101 = 1925188; t101 = (((x405==x406)&x407)==x408); if (t101 != 0) { NG(); } else { ; } } void f102(void) { uint64_t x410 = UINT64_MAX; int16_t x411 = INT16_MAX; static uint32_t x412 = 3U; volatile int32_t t102 = 65446; t102 = (((x409==x410)&x411)==x412); if (t102 != 0) { NG(); } else { ; } } void f103(void) { int32_t x413 = -1031631873; int16_t x414 = -14022; uint8_t x415 = 127U; static int64_t x416 = -1LL; volatile int32_t t103 = -59; t103 = (((x413==x414)&x415)==x416); if (t103 != 0) { NG(); } else { ; } } void f104(void) { int8_t x417 = -3; int16_t x418 = INT16_MIN; uint64_t x419 = 44711157946151LLU; uint16_t x420 = UINT16_MAX; t104 = (((x417==x418)&x419)==x420); if (t104 != 0) { NG(); } else { ; } } void f105(void) { static int8_t x421 = 33; int8_t x422 = 18; static int32_t x423 = INT32_MIN; uint32_t x424 = UINT32_MAX; static int32_t t105 = -3861; t105 = (((x421==x422)&x423)==x424); if (t105 != 0) { NG(); } else { ; } } void f106(void) { int32_t x425 = INT32_MIN; int64_t x426 = 1LL; int32_t x427 = 6; volatile uint16_t x428 = UINT16_MAX; int32_t t106 = 13020; t106 = (((x425==x426)&x427)==x428); if (t106 != 0) { NG(); } else { ; } } void f107(void) { int16_t x429 = 734; int16_t x430 = INT16_MAX; int8_t x431 = -1; int32_t x432 = INT32_MAX; volatile int32_t t107 = -677; t107 = (((x429==x430)&x431)==x432); if (t107 != 0) { NG(); } else { ; } } void f108(void) { volatile int16_t x433 = -61; static uint32_t x434 = 189646U; int8_t x435 = -1; uint8_t x436 = 3U; volatile int32_t t108 = -7228644; t108 = (((x433==x434)&x435)==x436); if (t108 != 0) { NG(); } else { ; } } void f109(void) { int64_t x437 = INT64_MAX; uint32_t x438 = UINT32_MAX; int64_t x440 = -116048142132LL; int32_t t109 = 51867747; t109 = (((x437==x438)&x439)==x440); if (t109 != 0) { NG(); } else { ; } } void f110(void) { int64_t x441 = INT64_MIN; uint8_t x442 = 8U; static volatile int32_t t110 = 4306; t110 = (((x441==x442)&x443)==x444); if (t110 != 1) { NG(); } else { ; } } void f111(void) { volatile int64_t x445 = INT64_MIN; int64_t x446 = INT64_MAX; uint32_t x447 = 7357230U; volatile int16_t x448 = -1; static int32_t t111 = -3; t111 = (((x445==x446)&x447)==x448); if (t111 != 0) { NG(); } else { ; } } void f112(void) { int8_t x449 = INT8_MIN; int64_t x450 = INT64_MIN; static int16_t x451 = INT16_MIN; static int8_t x452 = INT8_MIN; int32_t t112 = 11166147; t112 = (((x449==x450)&x451)==x452); if (t112 != 0) { NG(); } else { ; } } void f113(void) { int64_t x453 = INT64_MIN; uint16_t x454 = UINT16_MAX; int32_t x455 = INT32_MIN; int16_t x456 = -1; static volatile int32_t t113 = -34659650; t113 = (((x453==x454)&x455)==x456); if (t113 != 0) { NG(); } else { ; } } void f114(void) { int8_t x457 = -1; uint16_t x458 = 598U; uint32_t x459 = 2011409U; static int32_t x460 = INT32_MIN; volatile int32_t t114 = 1; t114 = (((x457==x458)&x459)==x460); if (t114 != 0) { NG(); } else { ; } } void f115(void) { static int32_t x461 = 13711648; int8_t x462 = 14; int64_t x464 = INT64_MIN; static int32_t t115 = 108; t115 = (((x461==x462)&x463)==x464); if (t115 != 0) { NG(); } else { ; } } void f116(void) { int32_t x465 = -1796280; static int16_t x466 = INT16_MIN; int64_t x467 = 15420LL; volatile int32_t t116 = 44441; t116 = (((x465==x466)&x467)==x468); if (t116 != 0) { NG(); } else { ; } } void f117(void) { uint16_t x469 = 0U; int32_t x470 = INT32_MIN; volatile int16_t x471 = -2009; int8_t x472 = 15; static int32_t t117 = -1034753776; t117 = (((x469==x470)&x471)==x472); if (t117 != 0) { NG(); } else { ; } } void f118(void) { int8_t x473 = -1; static int64_t x475 = -9661604LL; volatile int32_t t118 = 7; t118 = (((x473==x474)&x475)==x476); if (t118 != 0) { NG(); } else { ; } } void f119(void) { int64_t x477 = -202LL; int32_t x478 = -16142; int32_t x479 = INT32_MIN; volatile int32_t t119 = 386; t119 = (((x477==x478)&x479)==x480); if (t119 != 0) { NG(); } else { ; } } void f120(void) { uint16_t x481 = UINT16_MAX; static int32_t t120 = 12923; t120 = (((x481==x482)&x483)==x484); if (t120 != 0) { NG(); } else { ; } } void f121(void) { int8_t x485 = 7; int32_t x486 = -1; volatile int32_t t121 = -2; t121 = (((x485==x486)&x487)==x488); if (t121 != 0) { NG(); } else { ; } } void f122(void) { int16_t x489 = 6870; uint32_t x490 = 27325607U; int16_t x491 = INT16_MAX; static int32_t x492 = 30; t122 = (((x489==x490)&x491)==x492); if (t122 != 0) { NG(); } else { ; } } void f123(void) { static int64_t x493 = INT64_MIN; static volatile int32_t x494 = INT32_MIN; volatile int16_t x495 = INT16_MAX; uint32_t x496 = 733658U; volatile int32_t t123 = 0; t123 = (((x493==x494)&x495)==x496); if (t123 != 0) { NG(); } else { ; } } void f124(void) { static uint16_t x497 = 5602U; volatile int32_t x498 = -981583977; int64_t x499 = INT64_MAX; uint64_t x500 = 30597LLU; static int32_t t124 = -4199; t124 = (((x497==x498)&x499)==x500); if (t124 != 0) { NG(); } else { ; } } void f125(void) { static uint16_t x502 = UINT16_MAX; int64_t x503 = INT64_MIN; int8_t x504 = -1; int32_t t125 = 1024989363; t125 = (((x501==x502)&x503)==x504); if (t125 != 0) { NG(); } else { ; } } void f126(void) { int32_t x505 = 188987651; static int8_t x506 = -1; static uint64_t x507 = UINT64_MAX; int32_t x508 = 1059; volatile int32_t t126 = -8; t126 = (((x505==x506)&x507)==x508); if (t126 != 0) { NG(); } else { ; } } void f127(void) { uint8_t x510 = 3U; uint64_t x511 = 92110479625468LLU; uint64_t x512 = 518LLU; static int32_t t127 = -24; t127 = (((x509==x510)&x511)==x512); if (t127 != 0) { NG(); } else { ; } } void f128(void) { int32_t x514 = INT32_MAX; static volatile int16_t x515 = INT16_MIN; uint32_t x516 = 18U; int32_t t128 = 2220; t128 = (((x513==x514)&x515)==x516); if (t128 != 0) { NG(); } else { ; } } void f129(void) { int16_t x517 = -12; uint64_t x518 = 0LLU; static uint16_t x519 = 18673U; int64_t x520 = -1LL; int32_t t129 = 15133417; t129 = (((x517==x518)&x519)==x520); if (t129 != 0) { NG(); } else { ; } } void f130(void) { int16_t x522 = -7; int16_t x524 = 155; t130 = (((x521==x522)&x523)==x524); if (t130 != 0) { NG(); } else { ; } } void f131(void) { static volatile int64_t x525 = -1LL; uint64_t x526 = UINT64_MAX; uint16_t x528 = 9274U; int32_t t131 = -15289676; t131 = (((x525==x526)&x527)==x528); if (t131 != 0) { NG(); } else { ; } } void f132(void) { uint8_t x529 = UINT8_MAX; static uint8_t x530 = UINT8_MAX; volatile uint64_t x531 = 244LLU; static int64_t x532 = -1LL; volatile int32_t t132 = 3; t132 = (((x529==x530)&x531)==x532); if (t132 != 0) { NG(); } else { ; } } void f133(void) { uint32_t x533 = 770U; static volatile int8_t x534 = INT8_MIN; uint64_t x536 = UINT64_MAX; int32_t t133 = -114948; t133 = (((x533==x534)&x535)==x536); if (t133 != 0) { NG(); } else { ; } } void f134(void) { int8_t x537 = INT8_MAX; uint16_t x538 = 1230U; int16_t x539 = INT16_MIN; int32_t t134 = 2540460; t134 = (((x537==x538)&x539)==x540); if (t134 != 0) { NG(); } else { ; } } void f135(void) { volatile int16_t x541 = -1; static uint32_t x542 = 0U; volatile int16_t x543 = 0; int32_t x544 = -1; volatile int32_t t135 = 56; t135 = (((x541==x542)&x543)==x544); if (t135 != 0) { NG(); } else { ; } } void f136(void) { static int8_t x545 = -15; static int32_t x546 = 7; uint32_t x547 = UINT32_MAX; static int32_t x548 = INT32_MAX; int32_t t136 = 140; t136 = (((x545==x546)&x547)==x548); if (t136 != 0) { NG(); } else { ; } } void f137(void) { int16_t x549 = INT16_MIN; int32_t x550 = INT32_MIN; volatile int8_t x551 = 18; uint8_t x552 = UINT8_MAX; volatile int32_t t137 = 609105; t137 = (((x549==x550)&x551)==x552); if (t137 != 0) { NG(); } else { ; } } void f138(void) { volatile int64_t x553 = -1LL; volatile int16_t x554 = 0; static volatile uint64_t x555 = 474647032LLU; static int64_t x556 = -1LL; static volatile int32_t t138 = -2906; t138 = (((x553==x554)&x555)==x556); if (t138 != 0) { NG(); } else { ; } } void f139(void) { int32_t x557 = INT32_MAX; uint32_t x558 = 117840535U; volatile int16_t x559 = INT16_MIN; volatile int64_t x560 = INT64_MAX; int32_t t139 = 1357741; t139 = (((x557==x558)&x559)==x560); if (t139 != 0) { NG(); } else { ; } } void f140(void) { static int32_t x561 = INT32_MIN; uint16_t x562 = UINT16_MAX; int32_t t140 = 15891; t140 = (((x561==x562)&x563)==x564); if (t140 != 0) { NG(); } else { ; } } void f141(void) { int32_t x565 = 6; static volatile uint64_t x567 = UINT64_MAX; int64_t x568 = -1LL; int32_t t141 = 129718993; t141 = (((x565==x566)&x567)==x568); if (t141 != 0) { NG(); } else { ; } } void f142(void) { static int8_t x570 = INT8_MIN; static uint8_t x571 = UINT8_MAX; t142 = (((x569==x570)&x571)==x572); if (t142 != 0) { NG(); } else { ; } } void f143(void) { uint8_t x573 = UINT8_MAX; uint16_t x574 = 2U; volatile int8_t x575 = INT8_MIN; int8_t x576 = 1; t143 = (((x573==x574)&x575)==x576); if (t143 != 0) { NG(); } else { ; } } void f144(void) { uint64_t x578 = 4849LLU; uint16_t x579 = 940U; int32_t x580 = -207010243; t144 = (((x577==x578)&x579)==x580); if (t144 != 0) { NG(); } else { ; } } void f145(void) { int64_t x581 = INT64_MAX; static int16_t x583 = INT16_MAX; uint8_t x584 = UINT8_MAX; volatile int32_t t145 = -3; t145 = (((x581==x582)&x583)==x584); if (t145 != 0) { NG(); } else { ; } } void f146(void) { volatile uint64_t x585 = 173129405660LLU; volatile uint16_t x586 = 1734U; uint16_t x587 = 4U; int32_t t146 = 0; t146 = (((x585==x586)&x587)==x588); if (t146 != 0) { NG(); } else { ; } } void f147(void) { volatile uint32_t x590 = 727931843U; volatile int32_t t147 = 39; t147 = (((x589==x590)&x591)==x592); if (t147 != 0) { NG(); } else { ; } } void f148(void) { int64_t x593 = INT64_MAX; uint64_t x595 = 127794LLU; int16_t x596 = INT16_MAX; int32_t t148 = 6306631; t148 = (((x593==x594)&x595)==x596); if (t148 != 0) { NG(); } else { ; } } void f149(void) { volatile uint64_t x598 = 212499LLU; int8_t x600 = INT8_MAX; int32_t t149 = -12304413; t149 = (((x597==x598)&x599)==x600); if (t149 != 0) { NG(); } else { ; } } void f150(void) { int16_t x601 = INT16_MAX; static uint32_t x602 = UINT32_MAX; volatile int8_t x604 = INT8_MIN; volatile int32_t t150 = 12101; t150 = (((x601==x602)&x603)==x604); if (t150 != 0) { NG(); } else { ; } } void f151(void) { uint32_t x605 = 72U; uint64_t x606 = 126652LLU; int64_t x607 = INT64_MIN; uint64_t x608 = UINT64_MAX; int32_t t151 = -200; t151 = (((x605==x606)&x607)==x608); if (t151 != 0) { NG(); } else { ; } } void f152(void) { int16_t x609 = INT16_MIN; static int16_t x610 = -1; volatile int64_t x612 = -1LL; t152 = (((x609==x610)&x611)==x612); if (t152 != 0) { NG(); } else { ; } } void f153(void) { int32_t x613 = INT32_MAX; int64_t x614 = INT64_MIN; int16_t x615 = -1; uint64_t x616 = UINT64_MAX; t153 = (((x613==x614)&x615)==x616); if (t153 != 0) { NG(); } else { ; } } void f154(void) { int16_t x617 = -118; uint8_t x618 = UINT8_MAX; uint16_t x619 = UINT16_MAX; t154 = (((x617==x618)&x619)==x620); if (t154 != 0) { NG(); } else { ; } } void f155(void) { volatile int16_t x621 = -1; int16_t x622 = -9; int8_t x623 = 7; int16_t x624 = -1; volatile int32_t t155 = -1025; t155 = (((x621==x622)&x623)==x624); if (t155 != 0) { NG(); } else { ; } } void f156(void) { static int8_t x626 = -37; static int16_t x627 = INT16_MIN; volatile int32_t x628 = -1; int32_t t156 = -344; t156 = (((x625==x626)&x627)==x628); if (t156 != 0) { NG(); } else { ; } } void f157(void) { static uint64_t x629 = 809865LLU; uint32_t x631 = 397U; uint8_t x632 = 115U; volatile int32_t t157 = -1180030; t157 = (((x629==x630)&x631)==x632); if (t157 != 0) { NG(); } else { ; } } void f158(void) { int32_t x633 = INT32_MIN; volatile int16_t x635 = INT16_MIN; int64_t x636 = 61666450914406LL; int32_t t158 = -454; t158 = (((x633==x634)&x635)==x636); if (t158 != 0) { NG(); } else { ; } } void f159(void) { uint16_t x637 = 30953U; volatile uint64_t x638 = UINT64_MAX; int32_t x639 = -527; uint16_t x640 = UINT16_MAX; int32_t t159 = -67394; t159 = (((x637==x638)&x639)==x640); if (t159 != 0) { NG(); } else { ; } } void f160(void) { uint32_t x641 = 61U; volatile uint64_t x642 = 2773LLU; uint64_t x644 = 5LLU; volatile int32_t t160 = -1912223; t160 = (((x641==x642)&x643)==x644); if (t160 != 0) { NG(); } else { ; } } void f161(void) { int16_t x645 = -1; static volatile int8_t x646 = INT8_MAX; volatile int32_t x647 = INT32_MIN; volatile int32_t t161 = -1814; t161 = (((x645==x646)&x647)==x648); if (t161 != 0) { NG(); } else { ; } } void f162(void) { uint64_t x649 = 16419371639355LLU; int32_t x650 = 183308476; volatile int64_t x651 = -412164559LL; int64_t x652 = -10653903674972643LL; volatile int32_t t162 = -54; t162 = (((x649==x650)&x651)==x652); if (t162 != 0) { NG(); } else { ; } } void f163(void) { static volatile uint16_t x653 = UINT16_MAX; uint32_t x655 = UINT32_MAX; static int8_t x656 = INT8_MIN; t163 = (((x653==x654)&x655)==x656); if (t163 != 0) { NG(); } else { ; } } void f164(void) { int8_t x657 = INT8_MIN; int32_t x659 = INT32_MIN; int16_t x660 = -6553; volatile int32_t t164 = -154; t164 = (((x657==x658)&x659)==x660); if (t164 != 0) { NG(); } else { ; } } void f165(void) { int64_t x661 = INT64_MAX; int8_t x663 = INT8_MIN; static int64_t x664 = INT64_MIN; int32_t t165 = 1230; t165 = (((x661==x662)&x663)==x664); if (t165 != 0) { NG(); } else { ; } } void f166(void) { static uint8_t x667 = 18U; int64_t x668 = INT64_MIN; volatile int32_t t166 = -181856; t166 = (((x665==x666)&x667)==x668); if (t166 != 0) { NG(); } else { ; } } void f167(void) { int64_t x670 = -27LL; int32_t t167 = 350425769; t167 = (((x669==x670)&x671)==x672); if (t167 != 0) { NG(); } else { ; } } void f168(void) { uint16_t x673 = UINT16_MAX; int16_t x674 = INT16_MIN; int8_t x676 = 0; static int32_t t168 = -865; t168 = (((x673==x674)&x675)==x676); if (t168 != 1) { NG(); } else { ; } } void f169(void) { int8_t x677 = INT8_MIN; int64_t x678 = INT64_MIN; static uint64_t x679 = 4LLU; int64_t x680 = -1LL; t169 = (((x677==x678)&x679)==x680); if (t169 != 0) { NG(); } else { ; } } void f170(void) { uint16_t x682 = UINT16_MAX; int16_t x683 = -232; int16_t x684 = INT16_MIN; volatile int32_t t170 = -1210149; t170 = (((x681==x682)&x683)==x684); if (t170 != 0) { NG(); } else { ; } } void f171(void) { volatile int32_t x685 = 196860055; int8_t x686 = 1; int64_t x687 = -22926087309038LL; volatile int16_t x688 = 653; volatile int32_t t171 = 0; t171 = (((x685==x686)&x687)==x688); if (t171 != 0) { NG(); } else { ; } } void f172(void) { int16_t x689 = 1; int64_t x690 = INT64_MIN; uint16_t x691 = UINT16_MAX; static int16_t x692 = INT16_MIN; int32_t t172 = 50; t172 = (((x689==x690)&x691)==x692); if (t172 != 0) { NG(); } else { ; } } void f173(void) { uint16_t x694 = UINT16_MAX; int16_t x695 = INT16_MIN; uint16_t x696 = 918U; static volatile int32_t t173 = -65269966; t173 = (((x693==x694)&x695)==x696); if (t173 != 0) { NG(); } else { ; } } void f174(void) { int32_t x697 = -1; int64_t x698 = -1LL; uint16_t x699 = 0U; int16_t x700 = -1; volatile int32_t t174 = -44; t174 = (((x697==x698)&x699)==x700); if (t174 != 0) { NG(); } else { ; } } void f175(void) { int8_t x701 = 0; uint8_t x702 = 0U; int64_t x703 = -760001LL; uint32_t x704 = UINT32_MAX; t175 = (((x701==x702)&x703)==x704); if (t175 != 0) { NG(); } else { ; } } void f176(void) { int16_t x706 = INT16_MIN; uint8_t x707 = 0U; int16_t x708 = 3060; t176 = (((x705==x706)&x707)==x708); if (t176 != 0) { NG(); } else { ; } } void f177(void) { int16_t x709 = 58; static uint32_t x710 = 26U; uint8_t x711 = 45U; int32_t x712 = -1; int32_t t177 = -2; t177 = (((x709==x710)&x711)==x712); if (t177 != 0) { NG(); } else { ; } } void f178(void) { static int64_t x713 = -1LL; int16_t x715 = INT16_MIN; volatile int32_t t178 = -909949; t178 = (((x713==x714)&x715)==x716); if (t178 != 0) { NG(); } else { ; } } void f179(void) { uint64_t x718 = 872974050LLU; int8_t x719 = INT8_MAX; t179 = (((x717==x718)&x719)==x720); if (t179 != 0) { NG(); } else { ; } } void f180(void) { uint64_t x722 = UINT64_MAX; static int8_t x723 = INT8_MAX; int64_t x724 = -1LL; int32_t t180 = -453937; t180 = (((x721==x722)&x723)==x724); if (t180 != 0) { NG(); } else { ; } } void f181(void) { volatile int8_t x725 = INT8_MIN; uint16_t x726 = UINT16_MAX; int64_t x727 = INT64_MAX; uint16_t x728 = 7U; volatile int32_t t181 = 4069; t181 = (((x725==x726)&x727)==x728); if (t181 != 0) { NG(); } else { ; } } void f182(void) { uint32_t x729 = 2080225355U; static volatile int32_t x730 = INT32_MAX; int16_t x731 = INT16_MIN; uint64_t x732 = 1470893609421825LLU; static volatile int32_t t182 = 1; t182 = (((x729==x730)&x731)==x732); if (t182 != 0) { NG(); } else { ; } } void f183(void) { uint8_t x733 = 2U; int64_t x734 = 38025555770646LL; volatile int16_t x735 = INT16_MAX; int64_t x736 = INT64_MIN; static int32_t t183 = -38234; t183 = (((x733==x734)&x735)==x736); if (t183 != 0) { NG(); } else { ; } } void f184(void) { int64_t x737 = INT64_MAX; int32_t x738 = INT32_MAX; int16_t x739 = -1; uint64_t x740 = 1972701LLU; volatile int32_t t184 = -427417449; t184 = (((x737==x738)&x739)==x740); if (t184 != 0) { NG(); } else { ; } } void f185(void) { static int16_t x741 = INT16_MIN; int16_t x742 = -1; volatile int8_t x743 = INT8_MIN; uint8_t x744 = 0U; t185 = (((x741==x742)&x743)==x744); if (t185 != 1) { NG(); } else { ; } } void f186(void) { uint8_t x746 = 61U; volatile int64_t x747 = INT64_MIN; static int16_t x748 = INT16_MIN; volatile int32_t t186 = 5842873; t186 = (((x745==x746)&x747)==x748); if (t186 != 0) { NG(); } else { ; } } void f187(void) { volatile int32_t x749 = -1; int8_t x751 = INT8_MIN; volatile int32_t t187 = 120; t187 = (((x749==x750)&x751)==x752); if (t187 != 0) { NG(); } else { ; } } void f188(void) { static uint8_t x753 = 97U; int64_t x754 = -1LL; int16_t x755 = -1; volatile int32_t x756 = INT32_MIN; volatile int32_t t188 = -38351318; t188 = (((x753==x754)&x755)==x756); if (t188 != 0) { NG(); } else { ; } } void f189(void) { uint64_t x757 = UINT64_MAX; int64_t x758 = 1794868LL; uint8_t x759 = UINT8_MAX; volatile uint32_t x760 = 81U; int32_t t189 = -1444769; t189 = (((x757==x758)&x759)==x760); if (t189 != 0) { NG(); } else { ; } } void f190(void) { static volatile int16_t x762 = -1979; static uint32_t x763 = UINT32_MAX; uint32_t x764 = 215427U; t190 = (((x761==x762)&x763)==x764); if (t190 != 0) { NG(); } else { ; } } void f191(void) { uint32_t x765 = UINT32_MAX; int8_t x766 = 0; int16_t x767 = -6; int32_t t191 = 43; t191 = (((x765==x766)&x767)==x768); if (t191 != 0) { NG(); } else { ; } } void f192(void) { int16_t x769 = INT16_MIN; int64_t x770 = INT64_MAX; int16_t x771 = -18; int64_t x772 = 50898LL; int32_t t192 = -54304877; t192 = (((x769==x770)&x771)==x772); if (t192 != 0) { NG(); } else { ; } } void f193(void) { static volatile int64_t x773 = INT64_MIN; int32_t x774 = INT32_MAX; uint16_t x775 = 1818U; int64_t x776 = INT64_MIN; volatile int32_t t193 = 8104; t193 = (((x773==x774)&x775)==x776); if (t193 != 0) { NG(); } else { ; } } void f194(void) { static uint32_t x777 = 224252U; volatile int16_t x779 = INT16_MIN; int64_t x780 = INT64_MIN; t194 = (((x777==x778)&x779)==x780); if (t194 != 0) { NG(); } else { ; } } void f195(void) { uint16_t x781 = 0U; uint64_t x782 = 378357617594LLU; int64_t x783 = 2LL; int8_t x784 = -1; t195 = (((x781==x782)&x783)==x784); if (t195 != 0) { NG(); } else { ; } } void f196(void) { int32_t x786 = -29513; int32_t x787 = -1; uint64_t x788 = 1825LLU; static int32_t t196 = 126374210; t196 = (((x785==x786)&x787)==x788); if (t196 != 0) { NG(); } else { ; } } void f197(void) { int64_t x789 = -1LL; int64_t x790 = -11487574LL; int64_t x791 = 106LL; static int8_t x792 = INT8_MIN; volatile int32_t t197 = 29; t197 = (((x789==x790)&x791)==x792); if (t197 != 0) { NG(); } else { ; } } void f198(void) { uint8_t x793 = UINT8_MAX; int32_t x795 = 3621; uint32_t x796 = UINT32_MAX; static volatile int32_t t198 = -2084441; t198 = (((x793==x794)&x795)==x796); if (t198 != 0) { NG(); } else { ; } } void f199(void) { int64_t x797 = -11216368450555286LL; volatile int8_t x798 = INT8_MAX; volatile int8_t x799 = -1; int64_t x800 = 1LL; volatile int32_t t199 = 313957; t199 = (((x797==x798)&x799)==x800); if (t199 != 0) { NG(); } else { ; } } int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); f30(); f31(); f32(); f33(); f34(); f35(); f36(); f37(); f38(); f39(); f40(); f41(); f42(); f43(); f44(); f45(); f46(); f47(); f48(); f49(); f50(); f51(); f52(); f53(); f54(); f55(); f56(); f57(); f58(); f59(); f60(); f61(); f62(); f63(); f64(); f65(); f66(); f67(); f68(); f69(); f70(); f71(); f72(); f73(); f74(); f75(); f76(); f77(); f78(); f79(); f80(); f81(); f82(); f83(); f84(); f85(); f86(); f87(); f88(); f89(); f90(); f91(); f92(); f93(); f94(); f95(); f96(); f97(); f98(); f99(); f100(); f101(); f102(); f103(); f104(); f105(); f106(); f107(); f108(); f109(); f110(); f111(); f112(); f113(); f114(); f115(); f116(); f117(); f118(); f119(); f120(); f121(); f122(); f123(); f124(); f125(); f126(); f127(); f128(); f129(); f130(); f131(); f132(); f133(); f134(); f135(); f136(); f137(); f138(); f139(); f140(); f141(); f142(); f143(); f144(); f145(); f146(); f147(); f148(); f149(); f150(); f151(); f152(); f153(); f154(); f155(); f156(); f157(); f158(); f159(); f160(); f161(); f162(); f163(); f164(); f165(); f166(); f167(); f168(); f169(); f170(); f171(); f172(); f173(); f174(); f175(); f176(); f177(); f178(); f179(); f180(); f181(); f182(); f183(); f184(); f185(); f186(); f187(); f188(); f189(); f190(); f191(); f192(); f193(); f194(); f195(); f196(); f197(); f198(); f199(); return 0; }
18.342776
54
0.575
384ca02c4d9c5e22551b16fef19fe0a5f295f143
19,177
c
C
compiler.c
ArthurWHenry/simplec
879d010ad910d8553a84023a47ea3bbd7d31192c
[ "MIT" ]
null
null
null
compiler.c
ArthurWHenry/simplec
879d010ad910d8553a84023a47ea3bbd7d31192c
[ "MIT" ]
null
null
null
compiler.c
ArthurWHenry/simplec
879d010ad910d8553a84023a47ea3bbd7d31192c
[ "MIT" ]
null
null
null
// Arthur Henry // COP3402 - Fall 2019 #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define SIZE 16 char *expr(); char *printOp(char op); char *newTemp(); void printList(); void exitLLVM(); int contains(char identifier); typedef struct node { char var; char *addr; char *num; struct node *next; } node; typedef struct LinkedList { node *head; node *tail; } LinkedList; // NOTE: Variable declarations are all happening at the beginning // of the simplec program. // TODO: Storing the variable names will be a simple tail insertion // into a linked list. // TODO: Loading the variable will be a simple linked list search. // NOTE: When searching, we will be looking for the var field in the node struct. // NOTE: These may be slow operations, but are effective for what we need them to do. // Global file pointer so all functions have access to it. FILE *file; // Keeps a pointer that's in the exact position of the file we're in. char token; // Keeps a pointer that's ahead of every step we make. char lookahead; // Controls where we will be storing our temp values. int temp = 0; // Helps with a program that carries a single integer. char *numG; // The head of our linked list that will hold our variables. // Will allow O(1) insertion at the tail and O(n) lookup. LinkedList *variables; // NOTE: We don't have to add anything to the number just yet, // because we only read declarations at the beginning. // TODO: Make sure that the number is stored properly. (We might // not have to actually store it.) node *createNode(char var, char *addr) { node *newNode = calloc(1, sizeof(node)); // printf("%c\n", var); newNode->var = var; newNode->addr = addr; return newNode; } // Allocating memory for our linked list. LinkedList *createList() { return calloc(1, sizeof(LinkedList)); } // Inserts a new temporary variable at the end of our linked list. void tailInsert(char var, char *addr) { if (variables == NULL) { return; } else if (variables->head == NULL) { variables->head = variables->tail = createNode(var, addr); } else { variables->tail->next = createNode(var, addr); variables->tail = variables->tail->next; } return; } // Returning the address of the node. // i.e., the number of nodes we went through the list char *lookup(char identifier) { node *temp = NULL; // Identifier cannot exist in empty list. if (variables == NULL || variables->tail == NULL) return 0; temp = variables->head; while (temp != NULL) { if (temp->var == identifier) return temp->addr; temp = temp->next; } return NULL; } int isIdentifier(char identifier) { node *temp = NULL; // Identifier cannot exist in empty list. if (variables == NULL || variables->tail == NULL) return 0; temp = variables->head; while (temp != NULL) { if (temp->var == identifier) return 1; temp = temp->next; } return 0; } // Updates the lookahead char. void peek() { // Get character from the file and store in lookahead. lookahead = fgetc(file); // Going back to where the file pointer was previously. ungetc(lookahead, file); } // Updates our current file pointer and lookahead. void consume() { token = fgetc(file); // Everytime we update our token, update the lookahead. peek(); } // Skips spaces encountered. void spaces() { while (lookahead == ' ') consume(); } // Returns 1 if we have a print token in the simpelc file. // Otherwise, returns 0. int printCheck() { peek(); switch(lookahead) { case 'p': // printf("%c\n", token); consume(); case 'r': // printf("%c\n", token); consume(); case 'i': // printf("%c\n", token); consume(); case 'n': // printf("%c\n", token); consume(); case 't': // printf("%c\n", token); consume(); // printf("printing!\n"); return 1; default: return 0; } } // Generates the LLVM code for printing. void printLLVM(char var) { char *tempToPrint; tempToPrint = malloc(sizeof(char) * SIZE); if (!contains(var)) { fprintf(stderr, "error: use of undeclared variable %c\n", var); exitLLVM(); exit(0); } // Checks if there is one value passed into the program. if (temp == 0) { printf(" %%t1 = %s %s, 0\n", printOp('+'), numG); temp++; } // TODO: Load the value of temp onto a new variable, then print that one. strcpy(tempToPrint, lookup(var)); consume(); printf(" %s = load i32, i32* %s\n", newTemp(), tempToPrint); printf(" call void @print_integer(i32 %%t%d)\n\n", temp); } // Prints out the LLVM instruction for the operation we have to perform. // Otherwise, if the symbol is invalid NULL is returned. char *printOp(char op) { switch(op) { case '+': return "add nsw i32"; case '-': return "sub nsw i32"; case '*': return "mul nsw i32"; case '/': return "sdiv i32"; case '%': return "srem i32"; default: break; } return NULL; } // Invalid token was passed into factor(). // This is true according to project1.md specifications. void error() { printf("Error(), exiting.\n"); exit(0); } // Assigns a new temporary variable to a result. char *newTemp() { char *new = malloc(sizeof(char) * (16)); snprintf(new, 16, "%s%d", "%t", ++temp); return new; } // Computes the grammar for factor. char *factor() { int i = 0; char *num = NULL, *addr = NULL, *result = NULL; char identifier; num = malloc(sizeof(char) * 16); numG = malloc(sizeof(char) * 16); // spaces(); // Nested expression encountered. if (lookahead == '(') { consume(); // LPAREN strcpy(num, expr()); consume(); // RPAREN } else if (isdigit(lookahead) || lookahead == '-') { // printf("la: %c\n", lookahead); // Checks for negative numbers. if (lookahead == '-') { consume(); num[i++] = token; } // Sets num to first digit encountered. consume(); num[i++] = token; // Allows for multidigit numbers to be passed in. while (isdigit(lookahead)) { consume(); num[i++] = token; } num[i] = '\0'; // printf("num in factor(): %s\n", num); strcpy(numG, num); return numG; } else if (isIdentifier(lookahead)) { // printf("la: %c (supposed to be y)\n", lookahead); consume(); identifier = token; spaces(); // Checking to see if lookahead already exists in our linked list addr = lookup(identifier); // A variable that doesn't exist is trying to be accessed, return error // to avoid compiling problems. if (addr == NULL) { fprintf(stderr, "error: use of undeclared variable %c\n", identifier); exitLLVM(); exit(0); } result = newTemp(); printf(" %s = load i32, i32* %s\n", result, addr); return result; } else { fprintf(stderr, "error: use of undeclared variable %c\n", lookahead); exitLLVM(); exit(0); } return num; } // Executes the term with a loop. char *term() { char operation; char *left = NULL, *right = NULL, *result = NULL; left = malloc(sizeof(char) * 16); right = malloc(sizeof(char) * 16); result = malloc(sizeof(char) * 16); spaces(); // NOTE: I was having issues here. Just leaving this as a // reference for possible future problems. strcpy(left, factor()); spaces(); // printf("lookahead: %c\n", lookahead); while (lookahead == '*' || lookahead == '/' || lookahead == '%' || lookahead == '=') { spaces(); if (lookahead == '=') printf("%s\n", variables->head->addr); consume(); operation = token; spaces(); strcpy(right, factor()); spaces(); strcpy(result, newTemp()); printf(" %s = %s %s, %s\n", result, printOp(operation), left, right); strcpy(left, result); } // printf("lookahead in term(): %c\n", lookahead); return left; } // Executes the expression with a loop. char *expr() { char operation; char *left = NULL, *right = NULL, *result = NULL; left = malloc(sizeof(char) * 16); right = malloc(sizeof(char) * 16); result = malloc(sizeof(char) * 16); spaces(); strcpy(left, term()); spaces(); while (lookahead == '+' || lookahead == '-') { consume(); operation = token; spaces(); strcpy(right, term()); spaces(); strcpy(result, newTemp()); printf(" %s = %s %s, %s\n", result, printOp(operation), left, right); strcpy(left, result); } return left; } // Opens the file if it exists. Otherwise, we exit the program. void processInputFile(char *filename) { if ((file = fopen(filename, "r")) == NULL) { fprintf(stderr, "File could not be opened in processInputFile().\n"); exit(0); } return; } // Consumes semi colons or new line characters. void semi() { // if (print) // printLLVM(); while (lookahead == ';' || lookahead == '\n') consume(); } // Checks if the linked list already contains the identifier passed in. int contains(char identifier) { node *temp = NULL; // Preventing segfault. if (variables == NULL || variables->tail == NULL) return 0; temp = variables->head; // Iterating through variable list without affecting original state. while (temp != NULL) { // printf("%c -> ", temp->var); // Identifier already exists in the list. if (temp->var == identifier) return 1; temp = temp->next; } // printf("\n"); // Identifier has not been inserted into the list of variables. return 0; } // Prints the linked list to make sure all values exist within the // data structure. (NOTE: It's for debugging purposes.) void printList() { node *temp = NULL; temp = variables->head; while (temp != NULL) { printf("%c -> ", temp->var); temp = temp->next; } printf("\n"); } // Returns 1 if the beginning on the line started with 'read'. // Otherwise, returns 0. int readCheck() { peek(); switch (lookahead) { case 'r': case 'e': case 'a': case 'd': consume(); consume(); consume(); consume(); return 1; default: return 0; } return 0; } // Reads and stores integers. void read() { char identifier; char *addr, *result; addr = malloc(sizeof(char) * SIZE); result = malloc(sizeof(char) * SIZE); spaces(); // Gets identifier. consume(); identifier = token; spaces(); // FIXME: segfaulting here (possible another error) strcpy(addr, lookup(identifier)); if (addr == NULL) { fprintf(stderr, "error: use of undeclared variable %c\n", identifier); exitLLVM(); exit(0); } strcpy(result, newTemp()); printf(" %s = call i32 @read_integer()\n", result); printf(" store i32 %s, i32* %s\n\n", result, addr); } // Assigns values to variables that exist within our linked // list data structure storing all temporary variables. void assign() { char identifier; char *addr, *result; addr = malloc(sizeof(char) * SIZE); result = malloc(sizeof(char) * SIZE); consume(); identifier = token; spaces(); // printf("token: %c\n", token); // Consumes equal sign. consume(); spaces(); // printf("514: token: %c\n", token); // printf("lookahead: %c\n", lookahead); strcpy(result, expr()); spaces(); // Consumes semi colon. semi(); strcpy(addr, lookup(identifier)); if (addr == NULL) { fprintf(stderr, "error: use of undeclared variable %c\n", identifier); exitLLVM(); exit(0); } printf(" store i32 %s, i32* %s\n\n", result, addr); } // Returns 1 if there is an integer delcaration. // Otherwise, returns 0. int declarationCheck() { switch(lookahead) { case 'i': consume(); case 'n': consume(); case 't': consume(); return 1; default: return 0; } return 0; } // Declares a variable by inserting it into our linked list. void declaration() { char identifier; char *result = NULL; result = malloc(sizeof(char) * SIZE); spaces(); // printf("la: %c\n", lookahead); if (contains(lookahead)) { fprintf(stderr, "error: multiple definitions of %c\n", lookahead); exitLLVM(); exit(0); } if (isalpha(lookahead)) { spaces(); // Gets identifier. consume(); identifier = token; consume(); // consumes semi colon // Checking if identifier already exists in symbol table. if (contains(identifier)) error(); strcpy(result, newTemp()); // printList(); // printf(" ; \"int %c;\"\n", identifier); printf(" %s = alloca i32\n\n", result); tailInsert(identifier, result); } semi(); } // Depending on the value of printCheck(), we either print the // variable the SimpleC program is asking for, or computing an expression. void statement() { spaces(); peek(); if (declarationCheck()) { // printf("Going into declaration()...\n"); declaration(); } else if (isIdentifier(lookahead)) { // printf("Going into assign()...\n"); assign(); } else if (readCheck()) { // printf("lookahead: %c\n", lookahead); // printf("Going into read()...\n"); read(); } else if (printCheck()) { // printf("Going into print()...\n"); spaces(); printLLVM(lookahead); } semi(); return; } // Template code that needs to be generated before we execute our // main function. void boilerplate() { printf("target triple = \"x86_64-pc-linux-gnu\"\n" "declare i32 @printf(i8*, ...) #1\n" "@.str = private unnamed_addr constant [4 x i8] c\"%%d%c0A%c00\", align 1\n" "define void @print_integer(i32) #0 {\n" " %%2 = alloca i32, align 4\n" " store i32 %%0, i32* %%2, align 4\n" " %%3 = load i32, i32* %%2, align 4\n" " %%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %%3)\n" " ret void\n" "}\n\n", 92, 92); printf("%%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %%struct._IO_marker*, %%struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, %%struct._IO_codecvt*, %%struct._IO_wide_data*, %%struct._IO_FILE*, i8*, i64, i32, [20 x i8] }\n" "%%struct._IO_marker = type opaque\n" "%%struct._IO_codecvt = type opaque\n" "%%struct._IO_wide_data = type opaque\n\n"); printf("@stderr = external dso_local global %%struct._IO_FILE*, align 8\n" "@.str.1 = private unnamed_addr constant [25 x i8] c\"please enter an integer\\0A\\00\", align 1\n" "@.str.2 = private unnamed_addr constant [3 x i8] c\"%%d\\00\", align 1\n" "@.str.3 = private unnamed_addr constant [6 x i8] c\"scanf\\00\", align 1\n" "@.str.4 = private unnamed_addr constant [24 x i8] c\"no matching characters\\0A\\00\", align 1\n\n"); printf("declare i32* @__errno_location() #2\n" "declare i32 @__isoc99_scanf(i8*, ...) #1\n" "declare void @perror(i8*) #1\n" "declare void @exit(i32) #3\n" "declare i32 @fprintf(%%struct._IO_FILE*, i8*, ...) #1\n\n"); printf("define i32 @read_integer() #0 {\n" " %%1 = alloca i32, align 4\n" " %%2 = alloca i32, align 4\n" " %%3 = call i32* @__errno_location() #4\n" " store i32 0, i32* %%3, align 4\n" " %%4 = load %%struct._IO_FILE*, %%struct._IO_FILE** @stderr, align 8\n" " %%5 = call i32 (%%struct._IO_FILE*, i8*, ...) @fprintf(%%struct._IO_FILE* %%4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i32 0, i32 0))\n" " %%6 = call i32 (i8*, ...) @__isoc99_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i32* %%1)\n" " store i32 %%6, i32* %%2, align 4\n" " %%7 = load i32, i32* %%2, align 4\n" " %%8 = icmp eq i32 %%7, 1\n" " br i1 %%8, label %%9, label %%11\n" "\n" "; <label>:9: ; preds = %%0\n" " %%10 = load i32, i32* %%1, align 4\n" " ret i32 %%10\n" "\n" "; <label>:11: ; preds = %%0\n" " %%12 = call i32* @__errno_location() #4\n" " %%13 = load i32, i32* %%12, align 4\n" " %%14 = icmp ne i32 %%13, 0\n" " br i1 %%14, label %%15, label %%16\n" "\n" "; <label>:15: ; preds = %%11\n" " call void @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0))\n" " call void @exit(i32 1) #5\n" " unreachable\n" "\n" "; <label>:16: ; preds = %%11\n" " %%17 = load %%struct._IO_FILE*, %%struct._IO_FILE** @stderr, align 8\n" " %%18 = call i32 (%%struct._IO_FILE*, i8*, ...) @fprintf(%%struct._IO_FILE* %%17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i32 0, i32 0))\n" " call void @exit(i32 1) #5\n" " unreachable\n" "}\n\n"); printf("define i32 @main() #0 {\n"); } // Prints the exit code for LLVM file. void exitLLVM() { printf(" ret i32 0\n}\n"); } int main(int argc, char **argv) { char c; // Making sure two arguments are passed in. if (argc < 2) { fprintf(stderr, "Proper usage: %s <filename>.\n", argv[0]); return 0; } processInputFile(argv[1]); variables = createList(); boilerplate(); while ((token = fgetc(file)) != EOF) { // Ensures we start at the very beginning of the file. ungetc(token, file); statement(); } exitLLVM(); fclose(file); return 0; }
25.133683
282
0.53658
a826da9e856746a1898f58a22796bb10a433aa21
270
h
C
include/nemo_codes/nemo_codes.h
markplagge/NeMo2
36ec62acc8e4dc8f06ea1ced6997c587895cb6e9
[ "BSD-3-Clause" ]
null
null
null
include/nemo_codes/nemo_codes.h
markplagge/NeMo2
36ec62acc8e4dc8f06ea1ced6997c587895cb6e9
[ "BSD-3-Clause" ]
29
2020-05-29T16:22:16.000Z
2020-07-06T13:45:03.000Z
include/nemo_codes/nemo_codes.h
markplagge/NeMo2
36ec62acc8e4dc8f06ea1ced6997c587895cb6e9
[ "BSD-3-Clause" ]
1
2020-06-28T22:06:23.000Z
2020-06-28T22:06:23.000Z
#ifndef CODES_NEMO_LIBRARY_H #define CODES_NEMO_LIBRARY_H #include <codes/model-net.h> #include <codes/lp-io.h> #include <codes/codes.h> #include <codes/codes_mapping.h> #include <codes/configuration.h> #include <codes/lp-type-lookup.h> #endif //CODES_NEMO_LIBRARY_H
20.769231
33
0.777778
e1f2c2de1ebc41235a786248b56a8632c18168bf
5,097
h
C
library/macros.h
sba1/clib2-1
b874ff71deb55016a20f87483beb1ecbe226c55e
[ "BSD-3-Clause" ]
8
2015-08-16T13:50:38.000Z
2021-12-28T09:22:28.000Z
library/macros.h
DStastny/clib2
38a19f9aff7a9a0615f749ffd83f1d875d1e2f83
[ "BSD-3-Clause" ]
14
2015-09-28T21:58:33.000Z
2021-02-07T14:28:22.000Z
library/macros.h
DStastny/clib2
38a19f9aff7a9a0615f749ffd83f1d875d1e2f83
[ "BSD-3-Clause" ]
13
2017-02-10T19:40:50.000Z
2022-01-12T16:31:30.000Z
/* * $Id: macros.h,v 1.22 2006-01-08 12:04:23 obarthel Exp $ * * :ts=4 * * Portable ISO 'C' (1994) runtime library for the Amiga computer * Copyright (c) 2002-2015 by Olaf Barthel <obarthel (at) gmx.net> * 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. * * - Neither the name of Olaf Barthel nor the names of contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _MACROS_H #define _MACROS_H /****************************************************************************/ #ifndef DOS_DOS_H #include <dos/dos.h> #endif /* DOS_DOS_H */ /****************************************************************************/ #define BUSY ((struct IORequest *)NULL) #define CANNOT ! #define DO_NOTHING ((void)0) #define NO ! #define NOT ! #define DO_NOT ! #define OK (0) #define SAME (0) #define SEEK_ERROR (-1) #define ERROR (-1) /****************************************************************************/ #define NUM_ENTRIES(t) (sizeof(t) / sizeof(t[0])) /****************************************************************************/ #define FLAG_IS_SET(v,f) (((v) & (f)) == (f)) #define FLAG_IS_CLEAR(v,f) (((v) & (f)) == 0 ) /****************************************************************************/ #define SET_FLAG(v,f) ((void)((v) |= (f))) #define CLEAR_FLAG(v,f) ((void)((v) &= ~(f))) /****************************************************************************/ /* Macro to get longword-aligned stack space for a structure Uses ANSI token catenation to form a name for the char array based on the variable name, then creates an appropriately typed pointer to point to the first longword boundary in the char array allocated. */ #define D_S(type, name) \ char a_##name[sizeof(type)+3]; \ type *name = (type *)((ULONG)(a_##name+3) & ~3) /****************************************************************************/ /* BCPL style "NULL"; this should be in <dos/dos.h>. */ #ifndef ZERO #define ZERO ((BPTR)NULL) #endif /* ZERO */ /****************************************************************************/ /* Special data and function attributes; for OS4 most, if not all of them are in a file called <amiga_compiler.h> which is pulled in by the <exec/types.h> header file. */ /****************************************************************************/ #ifndef IsMinListEmpty #define IsMinListEmpty(ml) \ ((struct MinList *)((ml)->mlh_TailPred) == (struct MinList *)(ml)) #endif /****************************************************************************/ #ifndef AMIGA_COMPILER_H #ifdef __SASC #ifndef ASM #define ASM __asm #endif /* ASM */ #ifndef REG #define REG(r,p) register __##r p #endif /* REG */ #ifndef INTERRUPT #define INTERRUPT __interrupt #endif /* INTERRUPT */ #ifndef INLINE #define INLINE __inline #endif /* INLINE */ #endif /* __SASC */ #ifdef __GNUC__ #ifndef ASM #define ASM #endif /* ASM */ #ifndef REG #define REG(r,p) p __asm(#r) #endif /* REG */ #ifndef INTERRUPT #define INTERRUPT __attribute__((__interrupt__)) #endif /* INTERRUPT */ #ifndef INLINE #define INLINE __inline__ #endif /* INLINE */ #endif /* __GNUC__ */ #endif /* AMIGA_COMPILER_H */ /****************************************************************************/ #ifndef WEAK #ifdef __GNUC__ #define WEAK __attribute__((weak)) #else #define WEAK /* WEAK */ #endif /* __GNUC__ */ #endif /* WEAK */ /****************************************************************************/ #ifndef UNUSED #ifdef __GNUC__ #define UNUSED __attribute__((unused)) #else #define UNUSED /* UNUSED */ #endif /* __GNUC__ */ #endif /* UNUSED */ /****************************************************************************/ #ifndef NOCOMMON #ifdef __GNUC__ #define NOCOMMON __attribute__((nocommon)) #else #define NOCOMMON /* NOCOMMON */ #endif /* __GNUC__ */ #endif /* NOCOMMON */ /****************************************************************************/ #endif /* _MACROS_H */
28.47486
78
0.548362
c081b4719faac155c76e5ed0b85fb1f3a63b5cae
2,341
h
C
LQFlexLayoutKit/UITableView+LQFlexLayout.h
chy305chy/LQFlexLayoutKit
382cfee0f6014d58f242565c9329aba5c2a03654
[ "BSD-3-Clause" ]
3
2018-09-06T12:00:30.000Z
2018-09-07T07:08:13.000Z
LQFlexLayoutKit/UITableView+LQFlexLayout.h
chy305chy/LQFlexLayoutKit
382cfee0f6014d58f242565c9329aba5c2a03654
[ "BSD-3-Clause" ]
null
null
null
LQFlexLayoutKit/UITableView+LQFlexLayout.h
chy305chy/LQFlexLayoutKit
382cfee0f6014d58f242565c9329aba5c2a03654
[ "BSD-3-Clause" ]
null
null
null
// // UITableView+LQFlexLayout.h // LQFlexLayoutKit // // Created by cuilanqing on 2018/5/29. // #import <UIKit/UIKit.h> @interface LQIndexPathHeightCache : NSObject // Enable automatically if you're using index path driven height cache @property (nonatomic, assign) BOOL automaticallyInvalidateEnabled; // Height cache - (BOOL)existsHeightAtIndexPath:(NSIndexPath *)indexPath; - (void)cacheHeight:(CGFloat)height byIndexPath:(NSIndexPath *)indexPath; - (CGFloat)heightForIndexPath:(NSIndexPath *)indexPath; - (void)invalidateHeightAtIndexPath:(NSIndexPath *)indexPath; - (void)invalidateAllHeightCache; @end @interface UITableView (LQFlexLayout) @property (nonatomic, assign) CGFloat constraintWidth; /// get cell height -(CGFloat)lq_heightForCellWithIdentifier:(NSString *)identifier configuration:(void (^)(id cell))configuration; /// get cell height from cache -(CGFloat)lq_heightForCellWithIdentifier:(NSString *)identifier cacheByIndexPath:(NSIndexPath *)indexPath configuration:(void (^)(id))configuration; /// get tableView's header or footer view height -(CGFloat)lq_heightForHeaderFooterViewWithIdentifier:(NSString *)identifier configuration:(void (^)(id headerFooterView))configuration; @end @interface UITableView (LQFlexLayoutIndexPathHeightCache) @property (nonatomic, strong, readonly) LQIndexPathHeightCache *lq_indexPathHeightCache; @end @interface UITableViewCell (LQTemplateLayoutCell) /// Indicate this is a template layout cell for calculation only. /// You may need this when there are non-UI side effects when configure a cell. /// Like: /// - (void)configureCell:(FooCell *)cell atIndexPath:(NSIndexPath *)indexPath { /// cell.entity = [self entityAtIndexPath:indexPath]; /// if (!cell.fd_isTemplateLayoutCell) { /// [self notifySomething]; // non-UI side effects /// } /// } /// @property (nonatomic, assign) BOOL lq_isTemplateLayoutCell; @end @interface UITableView (LQIndexPathHeightCacheInvalidation) /// Call this method when you want to reload data but don't want to invalidate /// all height cache by index path, for example, load more data at the bottom of /// table view. - (void)lq_reloadDataWithoutInvalidateIndexPathHeightCache; @end
32.971831
98
0.729603
4beb5b7c8d4c3bdd75f12b7ef7e71bafd67956f4
16,315
h
C
lwmsg/include/lwmsg/data.h
kbore/pbis-open
a05eb9309269b6402b4d6659bc45961986ea5eab
[ "Apache-2.0" ]
372
2016-10-28T10:50:35.000Z
2022-03-18T19:54:37.000Z
lwmsg/include/lwmsg/data.h
kbore/pbis-open
a05eb9309269b6402b4d6659bc45961986ea5eab
[ "Apache-2.0" ]
317
2016-11-02T17:41:48.000Z
2021-11-08T20:28:19.000Z
lwmsg/include/lwmsg/data.h
kenferrara/pbis-open
690c325d947b2bf6fb3032f9d660e41b94aea4be
[ "Apache-2.0" ]
107
2016-11-03T19:25:16.000Z
2022-03-20T21:15:22.000Z
/* * Copyright © BeyondTrust Software 2004 - 2019 * 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. * * BEYONDTRUST MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING TERMS AS * WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT WITH * BEYONDTRUST, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE TERMS OF THAT * SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE APACHE LICENSE, * NOTWITHSTANDING THE ABOVE NOTICE. IF YOU HAVE QUESTIONS, OR WISH TO REQUEST * A COPY OF THE ALTERNATE LICENSING TERMS OFFERED BY BEYONDTRUST, PLEASE CONTACT * BEYONDTRUST AT beyondtrust.com/contact */ /* * Module Name: * * data.h * * Abstract: * * Data model API * * Authors: Brian Koropoff (bkoropoff@likewisesoftware.com) * */ #ifndef __LWMSG_DATA_H__ #define __LWMSG_DATA_H__ #include <lwmsg/status.h> #include <lwmsg/type.h> #include <lwmsg/buffer.h> #include <lwmsg/context.h> /** * @file data.h * @brief Data model API */ /** * @defgroup data Data model * @ingroup public * @brief Data marshaling and manipulation * * The LWMsg data model allows ordinary C data structures to * be converted to and from flat octet-stream representations. * Before data structures can be processed, a type specification * must be constructed which describes the layout and relationships * of the structure fields. For details, see @ref types. * * The top level object passed to or returned by marshaller operations * must always be a pointer. As a convenience, certain top-level type * specifications will automatically be promoted to pointers to accomodate * this restriction: * - Structures * * All operations take a data context which controls tunable * parameters of the data model: * * <ul> * <li>Byte order of the octect representation</li> * </ul> * * In the event of an error, the data context can be queried for * a human-readable diagnostic message. The data context may * also reference an LWMsg context. * */ /*@{*/ /** * @brief Data context * * An opqaue data context which facilitates all * data model operations. */ typedef struct LWMsgDataContext LWMsgDataContext; /** * @brief Create a data context * * Creates a new data context with an optional context. Data operations * which return allocated memory (e.g. #lwmsg_data_unmarshal()) will use * the context's memory management functions. * * @param[in] context an optional context * @param[out] dcontext the created data context * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_context_new( const LWMsgContext* context, LWMsgDataContext** dcontext ); /** * @brief Delete a data context * * Deletes the specified data context. * * @param[in,out] context the data context * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_endstatus */ void lwmsg_data_context_delete( LWMsgDataContext* context ); /** * @brief Set byte order * * Sets the byte order which will be used for atomic data elements * in subsequent marshal and unmarshal operations using the specified * data context. * * The default byte order is network byte order (big endian). This is * the preferred order for data destined for long-term storage or * transmission over a network. * * @param[out] context the data context * @param[in] order the data order */ void lwmsg_data_context_set_byte_order( LWMsgDataContext* context, LWMsgByteOrder order ); /** * @brief Get Byte order * * Gets the byte order which will be used for subsequent marshal and * unmarshal operations on the specified data context. * * @param[in] context the data context * @return the current byte order */ LWMsgByteOrder lwmsg_data_context_get_byte_order( LWMsgDataContext* context ); /** * @brief Get context * * Gets the context which was given to #lwmsg_data_context_new() * when the specified data context was created. * * @param[in] context the data context * @return the context, or NULL if no context was given at creation time */ const LWMsgContext* lwmsg_data_context_get_context( LWMsgDataContext* context ); /** * @brief Free in-memory data graph * * Recursively frees the data graph rooted at <tt>root</tt> * whose type is specified by <tt>type</tt>. Each contiguous * memory object will be freed using the context given to * #lwmsg_data_context_new() when the specified data context * was created. * * The most common application of this function is to free * the entire data graph allocated by a prior unmarshal operation, * such as #lwmsg_data_unmarshal(). * * Because the root of the data graph is always specified by * a generic pointer, <tt>type</tt> is subject to pointer * promotion. * * @param[in,out] context the data context * @param[in] type the type of the root node of the graph * @param[in,out] root the root of the graph */ LWMsgStatus lwmsg_data_free_graph( LWMsgDataContext* context, LWMsgTypeSpec* type, void* root ); /** * @brief Destroy in-memory data graph * * Recursively destroys the data graph rooted at <tt>root</tt> * whose type is specified by <tt>type</tt>. In contrast to * #lwmsg_data_free_graph(), the top-level structure is not freed. * Every child memory object will be freed using the context given * to #lwmsg_data_context_new() when the specified data context * was created. * * @param[in,out] context the data context * @param[in] type the type of the root node of the graph * @param[in,out] root the root of the graph */ LWMsgStatus lwmsg_data_destroy_graph( LWMsgDataContext* context, LWMsgTypeSpec* type, void* root ); /** * @brief Free in-memory data graph (guaranteed success) * * Like #lwmsg_data_free_graph(), but guarantees success: * * - Does not require an #LWMsgDataContext to be allocated * (which could itself fail). Instead, an optional #LWMsgContext * can be passed in to specify the memory manager. * - Does not return an error * * @warning This function has undefined behavior if the passed * data graph is malformed. * * @param[in] context an optional context * @param[in] type the type of the root node of the graph * @param[in,out] root the root of the graph */ void lwmsg_data_free_graph_cleanup( const LWMsgContext* context, LWMsgTypeSpec* type, void* root ); /** * @brief Destroy in-memory data graph (guaranteed success) * * Like #lwmsg_data_destroy_graph(), but guarantees success * in the same way as #lwmsg_data_free_graph_cleanup(). * * @warning This function has undefined behavior if the passed * data graph is malformed. * * @param[in] context an optional context * @param[in] type the type of the root node of the graph * @param[in,out] root the root of the graph */ void lwmsg_data_destroy_graph_cleanup( const LWMsgContext* context, LWMsgTypeSpec* type, void* root ); /** * @brief Marshal a data structure * * Converts a data structure of the specified type to a flat, serialized form, storing * the result in the provided marshalling buffer. * * @param[in,out] context the data context * @param[in] type the type specification which describes the type of the data * @param[in] object the root of the data to marshal * @param[in,out] buffer the marshalling buffer into which the result will be stored * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_code{OVERFLOW, an arithmetic overflow occured while converting an integer to its marshalled form} * @lwmsg_code{UNDERFLOW, an arithmetic underflow occured while converting an integer to its marshalled form} * @lwmsg_etc{the provided context and buffer may raise implementation-specific errors} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_marshal( LWMsgDataContext* context, LWMsgTypeSpec* type, void* object, LWMsgBuffer* buffer ); /** * @brief Marshal a data structure into a simple buffer * * Converts a data structure of the specified type to a flat, serialized form, storing * the result in the provided simple buffer. * * @param[in,out] context the data context * @param[in] type the type specification which describes the type of the data * @param[in] object the root of the data to marshal * @param[out] buffer the buffer into which the result will be stored * @param[in] length the size of the buffer in bytes * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_code{OVERFLOW, an arithmetic overflow occured while converting an integer to its marshalled form} * @lwmsg_code{UNDERFLOW, an arithmetic underflow occured while converting an integer to its marshalled form} * @lwmsg_code{EOF, the buffer was not large enough to hold the entire serialized representation} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_marshal_flat( LWMsgDataContext* context, LWMsgTypeSpec* type, void* object, void* buffer, size_t length ); /** * @brief Marshal a data structure while allocating a buffer * * Converts a data structure of the specified type to a flat, serialized form, automatically * allocating sufficient space for the result. The buffer is allocated using the memory management * functions in context passed to #lwmsg_data_context_new(). * * @param[in,out] context the data context * @param[in] type the type specification which describes the type of the data * @param[in] object the root of the data to marshal * @param[out] buffer the allocated buffer containing the serialized representation * @param[out] length the length of the buffer * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_code{OVERFLOW, an arithmetic overflow occured while converting an integer to its marshalled form} * @lwmsg_code{UNDERFLOW, an arithmetic underflow occured while converting an integer to its marshalled form} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_marshal_flat_alloc( LWMsgDataContext* context, LWMsgTypeSpec* type, void* object, void** buffer, size_t* length ); /** * @brief Unmarshal a data structure * * Converts a serialized data structure to its unmarshalled form, allocating memory as necessary * to form the object graph. * * @param[in,out] context the data context * @param[in] type the type specification which describes the type of the data * @param[in,out] buffer the marshalling buffer from which data will be read * @param[out] out the resulting unmarshalled object * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_code{OVERFLOW, an arithmetic overflow occured while converting an integer to its unmarshalled form} * @lwmsg_code{UNDERFLOW, an arithmetic underflow occured while converting an integer to its unmarshalled form} * @lwmsg_etc{the provided context and buffer may raise implementation-specific errors} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_unmarshal( LWMsgDataContext* context, LWMsgTypeSpec* type, LWMsgBuffer* buffer, void** out ); /** * @brief Unmarshal a data structure into pre-allocated memory * * Converts a serialized data structure to its unmarshalled form without allocating memory for the * top-level structure -- instead, the caller must provide sufficient space for it. Memory for * embedded pointers will still be allocated automatically as in #lwmsg_data_unmarshal(). * * @param[in,out] context the data context * @param[in] type the type specification which describes the type of the data * @param[in,out] buffer the marshalling buffer from which data will be read * @param[out] object the memory object into which the unmarshalled data will be written * @param[in] size the size of <tt>object</tt> in bytes * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_code{OVERFLOW, an arithmetic overflow occured while converting an integer to its unmarshalled form} * @lwmsg_code{UNDERFLOW, an arithmetic underflow occured while converting an integer to its unmarshalled form} * @lwmsg_code{BUFFER_TOO_SMALL, <tt>object</tt> was too small to contain the unmarshalled structure} * @lwmsg_etc{the provided context and buffer may raise implementation-specific errors} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_unmarshal_into( LWMsgDataContext* context, LWMsgTypeSpec* type, LWMsgBuffer* buffer, void* object, size_t size ); /** * @brief Unmarshal a data structure from a simple buffer * * Converts a serialized data structure to its unmarshalled form, allocating memory as necessary * to form the object graph. The serialized form is read from a simple buffer rather than a * full #LWMsgBuffer. * * @param[in,out] context the data context * @param[in] type the type specification which describes the type of the data * @param[in] buffer the simple buffer from which data will be read * @param[in] length the length of the buffer in bytes * @param[out] out the resulting unmarshalled object * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_code{OVERFLOW, an arithmetic overflow occured while converting an integer to its unmarshalled form} * @lwmsg_code{UNDERFLOW, an arithmetic underflow occured while converting an integer to its unmarshalled form} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_unmarshal_flat( LWMsgDataContext* context, LWMsgTypeSpec* type, const void* buffer, size_t length, void** out ); /** * @brief Print textual representation of a data graph to a string * * Prints a human-readable textual representation of a data graph, * automatically allocating and returning a C string containing the * result. The string will be allocated using the context passed * to #lwmsg_data_context_new() when creating the data context. * * @param[in,out] context the data context * @param[in] type a type specification which describes the graph root * @param[in] root the root of the data graph * @param[out] result the resulting string * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_code{MALFORMED, the provided data did not conform in some way to the provided type information} * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_print_graph_alloc( LWMsgDataContext* context, LWMsgTypeSpec* type, void* root, char** result ); /** * @brief Allocate memory block * * Allocates a block of memory using the data context's memory manager. * This is the same memory manager used when reconstructing an object graph * during unmarshalling. * * @param[in] context the data context * @param[in] size the number of bytes to allocate * @param[out] object the allocated block * @lwmsg_status * @lwmsg_success * @lwmsg_memory * @lwmsg_endstatus */ LWMsgStatus lwmsg_data_alloc_memory( LWMsgDataContext* context, size_t size, void** object ); /** * @brief Free memory block * * Frees a block of memory using the data context's memory manager. * This is the same memory manager used when reconstructing an object graph * during unmarshalling. * * @param[in] context the data context * @param[in,out] object the block to free */ void lwmsg_data_free_memory( LWMsgDataContext* context, void* object ); /*@}*/ #endif
32.179487
111
0.740055
ef18f68ea17d37ba9e5aaea4a1d85508f927af94
5,583
h
C
tapi-master/include/tapi/Scanner/APIScanner.h
JunyiXie/ld64
ffaa615b31ff1baa5d6249e4d9a6a21c2ae603ae
[ "Apache-2.0" ]
null
null
null
tapi-master/include/tapi/Scanner/APIScanner.h
JunyiXie/ld64
ffaa615b31ff1baa5d6249e4d9a6a21c2ae603ae
[ "Apache-2.0" ]
null
null
null
tapi-master/include/tapi/Scanner/APIScanner.h
JunyiXie/ld64
ffaa615b31ff1baa5d6249e4d9a6a21c2ae603ae
[ "Apache-2.0" ]
null
null
null
//===- tapi/Scanner/APIScanner.h - TAPI API Scanner -------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// \file /// \brief Defines the TAPI API Scanner. /// //===----------------------------------------------------------------------===// #ifndef TAPI_SCANNER_API_SCANNER_H #define TAPI_SCANNER_API_SCANNER_H #include "tapi/Core/XPI.h" #include "tapi/Defines.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/Mangle.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/AST/VTableBuilder.h" #include "clang/Basic/TargetInfo.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Tooling/Tooling.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Mangler.h" TAPI_NAMESPACE_INTERNAL_BEGIN using clang::ASTContext; using clang::ASTConsumer; using clang::CXXRecordDecl; using clang::FunctionDecl; using clang::ObjCContainerDecl; using clang::ObjCInterfaceDecl; using clang::ObjCIvarDecl; using clang::ObjCCategoryDecl; using clang::ObjCProtocolDecl; using clang::VarDecl; using clang::NamedDecl; using clang::CXXRecordDecl; using clang::DeclContext; using clang::PresumedLoc; using llvm::iterator_range; using clang::CompilerInstance; using clang::ASTFrontendAction; using clang::RecursiveASTVisitor; using clang::CXXMethodDecl; using clang::ThunkInfo; using clang::ItaniumMangleContext; enum class HeaderType; struct ParseContext { std::map<const clang::FileEntry *, HeaderType> files; XPISet *xpi; Architecture arch; int ReturnValue; }; class APIScanner : public ASTConsumer, public RecursiveASTVisitor<APIScanner> { class Flags { struct S { unsigned _ctor : 8; unsigned _dtor : 8; S() : _ctor(0), _dtor(0) {} S(clang::CXXCtorType ctor) : _ctor(ctor), _dtor(0) {} S(clang::CXXDtorType dtor) : _ctor(0), _dtor(dtor) {} } _s; public: Flags() : _s() {} Flags(clang::CXXCtorType ctor) : _s(ctor) {} Flags(clang::CXXDtorType dtor) : _s(dtor) {} clang::CXXCtorType getCtorType() const { return (clang::CXXCtorType)_s._ctor; } clang::CXXDtorType getDtorType() const { return (clang::CXXDtorType)_s._dtor; } }; public: explicit APIScanner(ASTContext &context, ParseContext &parse); void HandleTranslationUnit(ASTContext &context) override; bool VisitCXXRecordDecl(CXXRecordDecl *record); bool VisitFunctionDecl(FunctionDecl *func); bool VisitObjCInterfaceDecl(ObjCInterfaceDecl *interface); bool VisitObjCCategoryDecl(ObjCCategoryDecl *category); bool VisitObjCProtocolDecl(ObjCProtocolDecl *protocol); bool VisitVarDecl(VarDecl *var); bool shouldVisitTemplateInstantiations() const { return true; } private: AvailabilityInfo getAvailabilityInfo(const NamedDecl *decl) const; std::pair<XPIAccess, PresumedLoc> getFileAttributesForDecl(const NamedDecl *decl) const; void recordObjCInstanceVariables( const iterator_range<DeclContext::specific_decl_iterator<ObjCIvarDecl>> ivars); void recordObjCSelectors(ObjCContainer *objcContainer, const ObjCContainerDecl::method_range methods, bool isDynamic = false); void emitVTableSymbols(const CXXRecordDecl *record, PresumedLoc loc, XPIAccess access, AvailabilityInfo info, bool emittedVTable = false); std::string getMangledName(const NamedDecl *decl, Flags flags = Flags()); std::string getBackendMangledName(Twine name) { SmallString<128> finalName; llvm::Mangler::getNameWithPrefix(finalName, name, _dl); return finalName.str(); } std::string getMangledCXXVTableName(const CXXRecordDecl *decl) { SmallString<128> name; llvm::raw_svector_ostream nameStream(name); _mc->mangleCXXVTable(decl, nameStream); return getBackendMangledName(name); } std::string getMangledCXXRTTI(const CXXRecordDecl *decl) { SmallString<128> name; llvm::raw_svector_ostream nameStream(name); _mc->mangleCXXRTTI(clang::QualType(decl->getTypeForDecl(), 0), nameStream); return getBackendMangledName(name); } std::string getMangledCXXRTTIName(const CXXRecordDecl *decl) { SmallString<128> name; llvm::raw_svector_ostream nameStream(name); _mc->mangleCXXRTTIName(clang::QualType(decl->getTypeForDecl(), 0), nameStream); return getBackendMangledName(name); } std::string getMangledCXXThunk(const CXXMethodDecl *decl, const ThunkInfo &thunk) { SmallString<128> name; llvm::raw_svector_ostream nameStream(name); _mc->mangleThunk(decl, thunk, nameStream); return getBackendMangledName(name); } private: clang::ASTContext &_context; clang::SourceManager &_sourceManager; std::unique_ptr<ItaniumMangleContext> _mc; llvm::DataLayout _dl; ParseContext &_parse; bool _isObjCFragile; }; class APIScannerAction : public ASTFrontendAction { public: explicit APIScannerAction(ParseContext &parse) : _parse(parse) {} std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &compiler, StringRef inFile) override { return llvm::make_unique<APIScanner>(compiler.getASTContext(), _parse); } private: ParseContext &_parse; }; TAPI_NAMESPACE_INTERNAL_END #endif // TAPI_SCANNER_API_SCANNER_H
31.189944
80
0.695325
e647805ee91a39c2e80b7a12d50fc46c984cbe0d
1,208
c
C
cv.c
pedrordgs/SO
346edfd48058e424214355a3eb6725f40b5142c3
[ "MIT" ]
null
null
null
cv.c
pedrordgs/SO
346edfd48058e424214355a3eb6725f40b5142c3
[ "MIT" ]
null
null
null
cv.c
pedrordgs/SO
346edfd48058e424214355a3eb6725f40b5142c3
[ "MIT" ]
null
null
null
#include <unistd.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <sys/wait.h> #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <signal.h> #include <time.h> #include "lib.h" /* * Recebe instrucoes pelo stdin, escreve num pipe * responsavel por enviar as instrucoes ao servidor * e de seguida espera pela resposta do servidor * pelo pipe responsavel pelas respostas deste cliente */ int main (int argc, char**argv){ int pid=getpid(); char fifo_name [MAX_BUFFER]; int fdout=-1; sprintf(fifo_name,"/tmp/response_%d",pid); mkfifo(fifo_name,0666); // cria pipe de resposta char buffer [MAX_BUFFER]; int rd; int fd=open("/tmp/instructions_cv",O_WRONLY); // abre pipe de instrucoes while (readln(0,buffer,MAX_BUFFER)>0){ char *instruction = strtok(buffer,"\n"); sprintf(instruction,"%s %d\n",buffer,pid); if (write(fd,instruction,strlen(instruction))<0) perror("writing"); // escreve instrucao para o servidor fdout=open(fifo_name,O_RDONLY); // espera pela resposta do servidor while ((rd=readln(fdout,buffer,MAX_BUFFER))>0){ write(1,buffer,rd); } close(fdout); } close(fd); return 0; }
21.571429
108
0.682119