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
c9e2d7134ae25fe7dc974442383d70424f46201b
854
h
C
Classes/XPCService/DSUnixTaskServiceMain.h
Discontinuity-srl/DSUnixTask
f0a0c577d0e16a6ed9dc081d6e5f8f56f055e30a
[ "MIT" ]
7
2015-02-04T10:44:13.000Z
2020-12-10T16:07:17.000Z
Classes/XPCService/DSUnixTaskServiceMain.h
Discontinuity-srl/DSUnixTask
f0a0c577d0e16a6ed9dc081d6e5f8f56f055e30a
[ "MIT" ]
null
null
null
Classes/XPCService/DSUnixTaskServiceMain.h
Discontinuity-srl/DSUnixTask
f0a0c577d0e16a6ed9dc081d6e5f8f56f055e30a
[ "MIT" ]
null
null
null
// // DSUnixTaskServiceMain.h // // Created by Fabio Pelosin on 04/03/13. // Copyright (c) 2013 Discontinuity s.r.l. unipersonale. MIT License. // #import <Foundation/Foundation.h> //------------------------------------------------------------------------------ // Main //------------------------------------------------------------------------------ /** Helper function to be called in the main() function of the XPC Service. (It would suffice as the whole body of the function). */ void runUnixTaskXPCService(); //------------------------------------------------------------------------------ // DSUnixTaskXPCListenerDelegate //------------------------------------------------------------------------------ /** The delegate of the executable XPC service. */ @interface DSUnixTaskXPCListenerDelegate : NSObject <NSXPCListenerDelegate> @end
28.466667
82
0.457845
71f0921605beebae184ad79beaf99049fb3eca25
373
h
C
QZLCategoryKit/Classes/Category/LSExtension.h
VamCriss/QZLCategoryKit
63584ba9361ded5de2838054e1ee2a57a95fc41c
[ "MIT" ]
null
null
null
QZLCategoryKit/Classes/Category/LSExtension.h
VamCriss/QZLCategoryKit
63584ba9361ded5de2838054e1ee2a57a95fc41c
[ "MIT" ]
null
null
null
QZLCategoryKit/Classes/Category/LSExtension.h
VamCriss/QZLCategoryKit
63584ba9361ded5de2838054e1ee2a57a95fc41c
[ "MIT" ]
null
null
null
// // LSExtension.h // LawSiri // // Created by Criss on 2017/11/27. // Copyright © 2017年 iCourt. All rights reserved. // #ifndef LSExtension_h #define LSExtension_h #import "UITableViewCell+LSExtension.h" #import "UITableView+LSExtension.h" #import "UILabel+LSExtension.h" #import "NSString+LSExtension.h" #import "UIImage+LSExtension.h" #endif /* LSExtension_h */
19.631579
50
0.734584
f36642e846e753f7a63f9dbae02592ec8e6a1ed0
227
h
C
MacUpdateKit/MacUpdateKit/UI/MUKView.h
HsiangHo/MacUpdateKit
fd9682fd90f8a315c1c531ac8bae31d92b5bae1c
[ "MIT" ]
2
2019-06-09T14:33:38.000Z
2020-04-22T14:50:04.000Z
MacUpdateKit/MacUpdateKit/UI/MUKView.h
HsiangHo/MacUpdateKit
fd9682fd90f8a315c1c531ac8bae31d92b5bae1c
[ "MIT" ]
1
2019-08-18T11:33:03.000Z
2019-08-18T11:33:03.000Z
MacUpdateKit/MacUpdateKit/UI/MUKView.h
HsiangHo/MacUpdateKit
fd9682fd90f8a315c1c531ac8bae31d92b5bae1c
[ "MIT" ]
1
2021-11-01T09:57:59.000Z
2021-11-01T09:57:59.000Z
// // MUKView.h // MacUpdateKit // // Created by Jovi on 6/3/19. // Copyright © 2019 Jovi. All rights reserved. // #import <Cocoa/Cocoa.h> NS_ASSUME_NONNULL_BEGIN @interface MUKView : NSView @end NS_ASSUME_NONNULL_END
12.611111
47
0.700441
7e65e8f4a9811ebbaa26fb7010c5fd99e6a2b821
907
h
C
src/include/kernel/string.h
lml256/fengos
81b1fb7ac40089eb431b0d1fa1be7ac0329746a3
[ "MIT" ]
1
2021-07-02T03:14:49.000Z
2021-07-02T03:14:49.000Z
src/include/kernel/string.h
lml256/fengos
81b1fb7ac40089eb431b0d1fa1be7ac0329746a3
[ "MIT" ]
null
null
null
src/include/kernel/string.h
lml256/fengos
81b1fb7ac40089eb431b0d1fa1be7ac0329746a3
[ "MIT" ]
null
null
null
#ifndef _KERNEL_STRING_H_ #define _KERNEL_STRING_H_ #include <boot/string.h> #ifndef __HAVE_ARCH_MEMCPY extern void *memcpy(void *, void *, size_t); #endif #ifndef __HAVE_ARCH_MEMSET extern void *memset(void *, u8, size_t); #endif #ifndef __HAVE_ARCH_STRCPY extern void *strcpy(char *dest, const char *src); #endif static inline void *strncpy(char *dest, const char *src, size_t n) { size_t i; for (i = 0; i < n && *src != 0; i++, src++) dest[i] = *src; return dest; } #ifndef __HAVE_ARCH_STRLEN extern size_t strlen(const char *s); #endif #ifndef __HAVA_ARCH_STRCMP extern int strcmp(const char *str1, const char *str2); #endif static inline int strncmp(const char *str1, const char *str2, size_t n) { size_t i; int retval; for (i = 0; i < n; i++, str1++, str2++) { retval = *str1 - *str2; if (retval) break; } return retval; } #endif
18.895833
71
0.653804
631156ae19f47011d2ef1a823a15008b1beb8e03
971
h
C
src/RIOT/pkg/lvgl/include/lvgl_riot.h
ARte-team/ARte
19f17f57522e1b18ba390718fc94be246451837b
[ "MIT" ]
2
2020-04-30T08:17:45.000Z
2020-05-23T08:46:54.000Z
src/RIOT/pkg/lvgl/include/lvgl_riot.h
ARte-team/ARte
19f17f57522e1b18ba390718fc94be246451837b
[ "MIT" ]
null
null
null
src/RIOT/pkg/lvgl/include/lvgl_riot.h
ARte-team/ARte
19f17f57522e1b18ba390718fc94be246451837b
[ "MIT" ]
null
null
null
/* * Copyright (C) 2019 Inria * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup pkg_lvgl * @{ * * @file * @brief Definition for the LittlevGL engine initialization * * @author Alexandre Abadie <alexandre.abadie@inria.fr> */ #ifndef LVGL_RIOT_H #define LVGL_RIOT_H #include "disp_dev.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Initialize the lvgl display engine * * @param[in] dev Pointer to the generic display device */ void lvgl_init(disp_dev_t *dev); /** * @brief Wakeup lvgl when inactive * * This function unblocks the lvgl task handler thread and will indirectly * trigger an activity. After calling this function, lvgl remains awake during * the next LVGL_INACTIVITY_PERIOD_MS ms. */ void lvgl_wakeup(void); #ifdef __cplusplus } #endif #endif /* LVGL_RIOT_H */
19.816327
78
0.703399
2fb88a1e106f56dfd749f8970219941e37b8754c
2,565
h
C
keypad.h
skysoft/KeypadInterface
2a4d9be38a98b02ab1d72a223ff776639afcbbab
[ "MIT" ]
null
null
null
keypad.h
skysoft/KeypadInterface
2a4d9be38a98b02ab1d72a223ff776639afcbbab
[ "MIT" ]
null
null
null
keypad.h
skysoft/KeypadInterface
2a4d9be38a98b02ab1d72a223ff776639afcbbab
[ "MIT" ]
null
null
null
/** * @file keypad.h * @author Embedded Laboratory * @date June 16, 2016 * @brief Matrix Keypad Related Macros and Function Prototypes. * */ #ifndef KEYPAD_H_ #define KEYPAD_H_ #define _XTAL_FREQ 4000000 #include <xc.h> #include <stdbool.h> #include <stdint.h> #define MAX_ROW 4 /**< Maximum Row.*/ #define MAX_COL 4 /**< Maximum Column.*/ #define ROW_1_PIN PORTCbits.RC3 /**< Col 1 Pin Number.*/ #define ROW_1_DIR TRISCbits.TRISC3 /**< Col 1 Direction.*/ #define ROW_2_PIN PORTCbits.RC2 /**< Col 2 Pin Number.*/ #define ROW_2_DIR TRISCbits.TRISC2 /**< Col 2 Direction.*/ #define ROW_3_PIN PORTCbits.RC1 /**< Col 3 Pin Number.*/ #define ROW_3_DIR TRISCbits.TRISC1 /**< Col 3 Direction.*/ #define ROW_4_PIN PORTCbits.RC0 /**< Col 4 Pin Number.*/ #define ROW_4_DIR TRISCbits.TRISC0 /**< Col 4 Direction.*/ #define COL_1_PIN PORTAbits.RA3 /**< Row 1 Pin Number.*/ //#define COL_1_DIR TRISAbits.TRISA3 /**< Row 1 Direction.*/ #define COL_2_PIN PORTAbits.RA2 /**< Row 2 Pin Number.*/ #define COL_2_DIR TRISAbits.TRISA2 /**< Row 2 Direction.*/ #define COL_3_PIN PORTAbits.RA1 /**< Row 3 Pin Number.*/ #define COL_3_DIR TRISAbits.TRISA1 /**< Row 3 Direction.*/ #define COL_4_PIN PORTAbits.RA0 /**< Row 4 Pin Number.*/ #define COL_4_DIR TRISAbits.TRISA0 /**< Row 5 Direction.*/ #define NO_KEYs 255u /**< No Key Pressed.*/ #define NO_KEY 0u /**< No Key Pressed.*/ /** * @brief Keypad States * * Different States of Matrix Keypad used by State Machine. */ typedef enum _Keypad_State_e { KEYPAD_UP = 0, /**< Key Up State, Initial State.*/ KEYPAD_PRESSED, /**< Key Pressed Detected State.*/ KEYPAD_DOWN, /**< Key Still Pressed State.*/ KEYPAD_HELD, /**< Key Hold Down for Repetetion State.*/ KEYPAD_RELEASED, /**< Key Release State.*/ KEYPAD_DEBOUNCE /**< Key Debouncing State.*/ } Keypad_State_e; /** * @brief Keypad Structure * * Handle Matrix Keypad Data. */ typedef struct _Keypad_s { uint8_t keyPressed; /**< Key Pressed Detected.*/ uint8_t keySensed; /**< Key Sensed based on algorithm.*/ uint32_t keyStatus_timeStamp; /**< Key State Change Timestamp.*/ Keypad_State_e keypad_state; /**< Keypad Current State.*/ } Keypad_s; /* Public Function Prototypes*/ void Initialize_Keypad( void ); uint8_t getKey( void ); #endif /* KEYPAD_H_ */
32.884615
71
0.620273
f39cdf80a86dfcfb0044b3d6035337ab80600f24
1,843
c
C
engine/client/cd_sdl.c
BryanHaley/fteqw-applesilicon
06714d400c13c3f50bcd03e3d2184648a71ddb29
[ "Intel" ]
1
2022-03-20T01:14:23.000Z
2022-03-20T01:14:23.000Z
engine/client/cd_sdl.c
BryanHaley/fteqw-applesilicon
06714d400c13c3f50bcd03e3d2184648a71ddb29
[ "Intel" ]
null
null
null
engine/client/cd_sdl.c
BryanHaley/fteqw-applesilicon
06714d400c13c3f50bcd03e3d2184648a71ddb29
[ "Intel" ]
null
null
null
#include "quakedef.h" #include <SDL.h> #ifndef HAVE_CDPLAYER //nothing #elif SDL_MAJOR_VERSION >= 2 //sdl2 has no cd support. sod off. #include "cd_null.c" #else extern cvar_t bgmvolume; static qboolean initialized = false; static SDL_CD *cddevice; void CDAudio_Eject(void) { if (SDL_CDEject(cddevice)) Con_DPrintf("SDL_CDEject failed\n"); } void CDAudio_CloseDoor(void) { Con_Printf("SDL does not support this\n"); } int CDAudio_GetAudioDiskInfo(void) { switch (SDL_CDStatus(cddevice)) { case CD_ERROR: Con_Printf("SDL_CDStatus returned error\n"); return -1; case CD_TRAYEMPTY: return 0; default: break; } return cddevice->numtracks; } void CDAudio_Play(int track) { if (SDL_CDPlayTracks(cddevice, track, 0, 1, 0)) { Con_Printf("CDAudio: track %i is not audio\n", track); return; } if (!bgmvolume.value) CDAudio_Pause (); return; } void CDAudio_Stop(void) { if (SDL_CDStop(cddevice)) Con_DPrintf("CDAudio: SDL_CDStop failed"); } void CDAudio_Pause(void) { if (SDL_CDPause(cddevice)) Con_DPrintf("CDAudio: SDL_CDPause failed"); } void CDAudio_Resume(void) { if (SDL_CDResume(cddevice)) { Con_DPrintf("CDAudio: SDL_CDResume failed\n"); return; } } void CDAudio_Update(void) { } void CDAudio_Init(void) { } qboolean CDAudio_Startup(void) { if (initialized) return !!cddevice; if (!bgmvolume.value) return false; initialized = true; SDL_InitSubSystem(SDL_INIT_CDROM|SDL_INIT_NOPARACHUTE); if(!SDL_CDNumDrives()) { Con_DPrintf("CDAudio_Init: No CD drives\n"); return false; } cddevice = SDL_CDOpen(0); if (!cddevice) { Con_Printf("CDAudio_Init: SDL_CDOpen failed\n"); return false; } return true; } void CDAudio_Shutdown(void) { if (!initialized) return; CDAudio_Stop(); SDL_CDClose(cddevice); cddevice = NULL; initialized = false; } #endif
13.962121
56
0.710798
285a662c0f1c050aec55931496433cd7c24b5fa9
212
h
C
Example/Pods/Target Support Files/Pods-MZRelationalCollectionController_Example/Pods-MZRelationalCollectionController_Example-umbrella.h
moshozen/MZRelationalCollectionController
a4c1b8957907e1a803a85e921f0afc840ef5dd6e
[ "MIT" ]
1
2016-02-02T05:13:25.000Z
2016-02-02T05:13:25.000Z
Example/Pods/Target Support Files/Pods-MZRelationalCollectionController_Example/Pods-MZRelationalCollectionController_Example-umbrella.h
moshozen/MZRelationalCollectionController
a4c1b8957907e1a803a85e921f0afc840ef5dd6e
[ "MIT" ]
null
null
null
Example/Pods/Target Support Files/Pods-MZRelationalCollectionController_Example/Pods-MZRelationalCollectionController_Example-umbrella.h
moshozen/MZRelationalCollectionController
a4c1b8957907e1a803a85e921f0afc840ef5dd6e
[ "MIT" ]
null
null
null
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_MZRelationalCollectionController_ExampleVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_MZRelationalCollectionController_ExampleVersionString[];
30.285714
99
0.896226
d8b924facd5a445ab2657cc29c99513cd1c19852
560
c
C
DMA/2D_Array/DMAin2dArrayUsingPointersRowConstant.c
balaji303/Wolverine
1c1097fcbfcb17227389fc8180fcd362751b3f11
[ "Apache-2.0" ]
8
2019-10-16T05:28:13.000Z
2021-05-12T06:24:10.000Z
DMA/2D_Array/DMAin2dArrayUsingPointersRowConstant.c
balaji303/Wolverine
1c1097fcbfcb17227389fc8180fcd362751b3f11
[ "Apache-2.0" ]
4
2020-10-01T16:14:26.000Z
2021-10-03T01:41:14.000Z
DMA/2D_Array/DMAin2dArrayUsingPointersRowConstant.c
balaji303/Wolverine
1c1097fcbfcb17227389fc8180fcd362751b3f11
[ "Apache-2.0" ]
3
2020-08-26T02:33:37.000Z
2021-10-02T14:06:29.000Z
#include <stdio.h> #include <stdlib.h> int main(){ int (*a)[4],column,j,i; printf("Enter column\n"); scanf("%d",&column); a=malloc(column*sizeof(column)); for(i=0;i<column;i++){ for(j=0;j<4;j++){ printf("row -%d column-%d\n",i,j); scanf("%d",&a[i][j]); } } for(i=0;i<column;i++){ for(j=0;j<4;j++){ // printf("row -%d column-%d ",i,j); printf("%d",a[i][j]); } printf("\n"); } free(a); return 0; }
12.444444
49
0.394643
4dfd5418831fdafebaee430d32c3b299b6937c02
260
h
C
Pod/Classes/PortraitOnly/PortraitOnlyNavigationController.h
raostudios/RSInterfaceKit
8461a5883a101e5270792573256ad20af06ed634
[ "MIT" ]
5
2016-01-05T23:36:46.000Z
2019-04-16T01:42:06.000Z
Pod/Classes/PortraitOnly/PortraitOnlyNavigationController.h
raostudios/RSInterfaceKit
8461a5883a101e5270792573256ad20af06ed634
[ "MIT" ]
10
2016-01-06T02:43:30.000Z
2019-03-21T21:39:31.000Z
Pod/Classes/PortraitOnly/PortraitOnlyNavigationController.h
raostudios/RSInterfaceKit
8461a5883a101e5270792573256ad20af06ed634
[ "MIT" ]
null
null
null
// // PortraitOnlyNavigationController.h // TheBigClock // // Created by Rao, Venkat on 2/11/15. // Copyright (c) 2015 Venkat Rao. All rights reserved. // #import <UIKit/UIKit.h> @interface PortraitOnlyNavigationController : UINavigationController @end
18.571429
68
0.738462
9e7cdbb83c3db6e6c1ce41b2cd4f6aeb9892d31d
581
h
C
production/include/executor/configuration.h
Lewerow/DetailIdentifier
bd5e0b3b55b5ce5b24db51ae45ed53298d331687
[ "MIT" ]
null
null
null
production/include/executor/configuration.h
Lewerow/DetailIdentifier
bd5e0b3b55b5ce5b24db51ae45ed53298d331687
[ "MIT" ]
null
null
null
production/include/executor/configuration.h
Lewerow/DetailIdentifier
bd5e0b3b55b5ce5b24db51ae45ed53298d331687
[ "MIT" ]
null
null
null
#ifndef EXECUTOR_CONFIGURATION_FOIEJf9ejw98fjerfjkdmcxlxdk0923j4fuierjndfkljweorifrjhneijkdewdwqdwqd #define EXECUTOR_CONFIGURATION_FOIEJf9ejw98fjerfjkdmcxlxdk0923j4fuierjndfkljweorifrjhneijkdewdwqdwqd #include <common/basic_configuration.h> namespace executor { class configuration : public common::basic_configuration { class impl; public: configuration(const boost::program_options::variables_map&, logger::logger&); ~configuration(); std::string input_filename() const; std::string output_filename() const; private: std::unique_ptr<impl> pimpl; }; } #endif
26.409091
100
0.820998
2cf9369b5fce41ed99e7a5057427a027a9cbdc0e
3,976
c
C
examples/protocols/https_server/main/main.c
jarijokinen/esp-idf
e599b794bebebe66c6bb6d0af31a9451510ad3d4
[ "Apache-2.0" ]
480
2021-07-15T05:32:09.000Z
2022-03-31T09:25:46.000Z
examples/protocols/https_server/main/main.c
jarijokinen/esp-idf
e599b794bebebe66c6bb6d0af31a9451510ad3d4
[ "Apache-2.0" ]
5
2022-02-18T03:13:54.000Z
2022-03-31T12:06:43.000Z
examples/protocols/https_server/main/main.c
jarijokinen/esp-idf
e599b794bebebe66c6bb6d0af31a9451510ad3d4
[ "Apache-2.0" ]
150
2021-07-15T05:58:30.000Z
2022-03-31T08:27:50.000Z
/* Simple HTTP + SSL Server Example This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include <esp_wifi.h> #include <esp_event.h> #include <esp_log.h> #include <esp_system.h> #include <nvs_flash.h> #include <sys/param.h> #include "esp_netif.h" #include "esp_eth.h" #include "protocol_examples_common.h" #include <esp_https_server.h> /* A simple example that demonstrates how to create GET and POST * handlers and start an HTTPS server. */ static const char *TAG = "example"; /* An HTTP GET handler */ static esp_err_t root_get_handler(httpd_req_t *req) { httpd_resp_set_type(req, "text/html"); httpd_resp_send(req, "<h1>Hello Secure World!</h1>", -1); // -1 = use strlen() return ESP_OK; } static const httpd_uri_t root = { .uri = "/", .method = HTTP_GET, .handler = root_get_handler }; static httpd_handle_t start_webserver(void) { httpd_handle_t server = NULL; // Start the httpd server ESP_LOGI(TAG, "Starting server"); httpd_ssl_config_t conf = HTTPD_SSL_CONFIG_DEFAULT(); extern const unsigned char cacert_pem_start[] asm("_binary_cacert_pem_start"); extern const unsigned char cacert_pem_end[] asm("_binary_cacert_pem_end"); conf.cacert_pem = cacert_pem_start; conf.cacert_len = cacert_pem_end - cacert_pem_start; extern const unsigned char prvtkey_pem_start[] asm("_binary_prvtkey_pem_start"); extern const unsigned char prvtkey_pem_end[] asm("_binary_prvtkey_pem_end"); conf.prvtkey_pem = prvtkey_pem_start; conf.prvtkey_len = prvtkey_pem_end - prvtkey_pem_start; esp_err_t ret = httpd_ssl_start(&server, &conf); if (ESP_OK != ret) { ESP_LOGI(TAG, "Error starting server!"); return NULL; } // Set URI handlers ESP_LOGI(TAG, "Registering URI handlers"); httpd_register_uri_handler(server, &root); return server; } static void stop_webserver(httpd_handle_t server) { // Stop the httpd server httpd_ssl_stop(server); } static void disconnect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { httpd_handle_t* server = (httpd_handle_t*) arg; if (*server) { stop_webserver(*server); *server = NULL; } } static void connect_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { httpd_handle_t* server = (httpd_handle_t*) arg; if (*server == NULL) { *server = start_webserver(); } } void app_main(void) { static httpd_handle_t server = NULL; ESP_ERROR_CHECK(nvs_flash_init()); ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_event_loop_create_default()); /* Register event handlers to start server when Wi-Fi or Ethernet is connected, * and stop server when disconnection happens. */ #ifdef CONFIG_EXAMPLE_CONNECT_WIFI ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &connect_handler, &server)); ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED, &disconnect_handler, &server)); #endif // CONFIG_EXAMPLE_CONNECT_WIFI #ifdef CONFIG_EXAMPLE_CONNECT_ETHERNET ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &connect_handler, &server)); ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ETHERNET_EVENT_DISCONNECTED, &disconnect_handler, &server)); #endif // CONFIG_EXAMPLE_CONNECT_ETHERNET /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. * Read "Establishing Wi-Fi or Ethernet Connection" section in * examples/protocols/README.md for more information about this function. */ ESP_ERROR_CHECK(example_connect()); }
31.0625
119
0.719819
36db77f89d8f7eada7fefdd56f990d443e4d92c8
3,086
h
C
src/TRF/trf-def.h
wbengine/TRF
599de0b06d5bede1d5fad4ad69124e9c81e0e489
[ "Apache-2.0" ]
6
2016-07-26T03:20:51.000Z
2019-11-24T07:27:19.000Z
src/TRF/trf-def.h
wbengine/TRF
599de0b06d5bede1d5fad4ad69124e9c81e0e489
[ "Apache-2.0" ]
null
null
null
src/TRF/trf-def.h
wbengine/TRF
599de0b06d5bede1d5fad4ad69124e9c81e0e489
[ "Apache-2.0" ]
4
2017-08-14T17:02:23.000Z
2021-03-02T18:03:01.000Z
// 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. // // Copyright 2014-2015 Tsinghua University // Author: wb.th08@gmail.com (Bin Wang), ozj@tsinghua.edu.cn (Zhijian Ou) // // All h, cpp, cc, and script files (e.g. bat, sh, pl, py) should include the above // license declaration. Different coding language may use different comment styles. #pragma once #include "wb-system.h" using namespace wb; namespace trf { typedef double PValue; typedef double LogP; typedef double Prob; const float INF = 1e20; const float LogP_zero = -INF; /// ����Logp��probת�� inline Prob LogP2Prob(LogP x) { return (x <= LogP_zero / 2) ? 0 : exp((double)(x)); } inline LogP Prob2LogP(Prob x) { return ((x) <= 0) ? LogP_zero : log((double)(x)); } ///����log[exp(x) + exp(y)] inline LogP Log_Sum(LogP x, LogP y) { return (x > y) ? x + Prob2LogP(1 + LogP2Prob(y - x)) : y + Prob2LogP(1 + LogP2Prob(x - y)); } /// ����log[exp(x)-exp(y)] inline LogP Log_Sub(LogP x, LogP y) { return (x > y) ? x + Prob2LogP(1 - LogP2Prob(y - x)) : y + Prob2LogP( LogP2Prob(x - y) - 1); } /// log summate all the values in array inline LogP Log_Sum(LogP *p, int num) { LogP sum = LogP_zero; for (int i = 0; i < num; i++) { sum = Log_Sum(sum, p[i]); } return sum; } /// һά�ֲ���һ�� /** * \param [in] pdProbs �ֲ� * \param [in] nNum ��������� */ LogP LogLineNormalize(LogP* pdProbs, int nNum); /// һά�ֲ���һ�� /** * \param [in] pdProbs �����ֲ� * \param [in] nNum ��������� */ int LogLineSampling(const LogP* pdProbs, int nNum); /// һά���� /** * \param [in] pdProbs �������ķֲ�����Ҫ��һ�� * \param [in] nNum ���������, sample from 0 to nNum-1 * \return �����õ��������� */ void LineNormalize(Prob* pdProbs, int nNum); /// һά���� /** * \param [in] pdProbs �������Ķ����ֲ��ֲ�����Ҫ��һ�� * \param [in] nNum ���������, sample from 0 to nNum-1 * \return �����õ��������� */ int LineSampling(const Prob* pdProbs, int nNum); /// MH�����Ľ��� bool Acceptable(Prob prob); /// position��������һ�����������ȡ��n�����������滻�������ǰn��λ�� /** * \param [in] a ��Ҫ���������� * \param [in] len ���鳤�� * \param [out] n ��Ҫ�����ĸ��� */ void RandomPos(int *a, int len, int n); /// get a random float between dmin and dmax double Rand(double dmin, double dmax); /// smooth a distribution void EasySmooth(Prob *p, int num, Prob threshold = 1e-5); /// Get the AIS intermediate factor beta_t /* t -> current intermediate number (from 0 to T-1); T -> total intermadiate number. */ double GetAISFactor(int t, int T); /// calculate the sigmoid function f(x) = 1/(1+exp(-x)) double SigmFunc(double x); }
29.961165
95
0.579391
82dc016526302c12ce2ea1dcd2e3461cca0ff66c
1,853
h
C
dngsdk/dng_file_stream.h
Jamaika1/dng_sdk_1.5.1---gpr_sdk_1.0.0
756dd48267158149b994d87f916e35b352c31113
[ "BSD-3-Clause" ]
null
null
null
dngsdk/dng_file_stream.h
Jamaika1/dng_sdk_1.5.1---gpr_sdk_1.0.0
756dd48267158149b994d87f916e35b352c31113
[ "BSD-3-Clause" ]
null
null
null
dngsdk/dng_file_stream.h
Jamaika1/dng_sdk_1.5.1---gpr_sdk_1.0.0
756dd48267158149b994d87f916e35b352c31113
[ "BSD-3-Clause" ]
null
null
null
/*****************************************************************************/ // Copyright 2006-2019 Adobe Systems Incorporated // All Rights Reserved. // // NOTICE: Adobe permits you to use, modify, and distribute this file in // accordance with the terms of the Adobe license agreement accompanying it. /*****************************************************************************/ /** \file * Simple, portable, file read/write support. */ /*****************************************************************************/ #ifndef __dng_file_stream__ #define __dng_file_stream__ /*****************************************************************************/ #include "dng_stream.h" /*****************************************************************************/ /// \brief A stream to/from a disk file. See dng_stream for read/write interface class dng_file_stream: public dng_stream { private: FILE *fFile; public: /// Open a stream on a file. /// \param filename Pathname in platform synax. /// \param output Set to true if writing, false otherwise. /// \param bufferSize size of internal buffer to use. Defaults to 4k. dng_file_stream (const char *filename, bool output = false, uint32 bufferSize = kDefaultBufferSize); #if qWinOS dng_file_stream (const wchar_t *filename, bool output = false, uint32 bufferSize = kDefaultBufferSize); #endif // qWinOS virtual ~dng_file_stream (); protected: virtual uint64 DoGetLength (); virtual void DoRead (void *data, uint32 count, uint64 offset); virtual void DoWrite (const void *data, uint32 count, uint64 offset); }; /*****************************************************************************/ #endif /*****************************************************************************/
25.383562
80
0.483001
d0df816b8e3395c1e86f3a84857d27883e657484
3,696
h
C
thirdparty/physx/APEXSDK/module/clothing_legacy/include/ConversionClothingMaterialLibraryParameters_0p4_0p5.h
johndpope/echo
e9ce2f4037e8a5d49b74cc7a9d9ee09f296e7fa7
[ "MIT" ]
null
null
null
thirdparty/physx/APEXSDK/module/clothing_legacy/include/ConversionClothingMaterialLibraryParameters_0p4_0p5.h
johndpope/echo
e9ce2f4037e8a5d49b74cc7a9d9ee09f296e7fa7
[ "MIT" ]
2
2015-06-21T17:38:11.000Z
2015-06-22T20:54:42.000Z
thirdparty/physx/APEXSDK/module/clothing_legacy/include/ConversionClothingMaterialLibraryParameters_0p4_0p5.h
johndpope/echo
e9ce2f4037e8a5d49b74cc7a9d9ee09f296e7fa7
[ "MIT" ]
null
null
null
/* * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an express * license agreement from NVIDIA CORPORATION is strictly prohibited. */ #ifndef CONVERSIONCLOTHINGMATERIALLIBRARYPARAMETERS_0P4_0P5H_H #define CONVERSIONCLOTHINGMATERIALLIBRARYPARAMETERS_0P4_0P5H_H #include "ParamConversionTemplate.h" #include "ClothingMaterialLibraryParameters_0p4.h" #include "ClothingMaterialLibraryParameters_0p5.h" namespace physx { namespace apex { namespace legacy { typedef ParamConversionTemplate<ClothingMaterialLibraryParameters_0p4, ClothingMaterialLibraryParameters_0p5, 4, 5> ConversionClothingMaterialLibraryParameters_0p4_0p5Parent; class ConversionClothingMaterialLibraryParameters_0p4_0p5: ConversionClothingMaterialLibraryParameters_0p4_0p5Parent { public: static NxParameterized::Conversion* Create(NxParameterized::Traits* t) { void* buf = t->alloc(sizeof(ConversionClothingMaterialLibraryParameters_0p4_0p5)); return buf ? PX_PLACEMENT_NEW(buf, ConversionClothingMaterialLibraryParameters_0p4_0p5)(t) : 0; } protected: ConversionClothingMaterialLibraryParameters_0p4_0p5(NxParameterized::Traits* t) : ConversionClothingMaterialLibraryParameters_0p4_0p5Parent(t) {} const NxParameterized::PrefVer* getPreferredVersions() const { static NxParameterized::PrefVer prefVers[] = { //TODO: // Add your preferred versions for included references here. // Entry format is // { (const char*)longName, (PxU32)preferredVersion } { 0, 0 } // Terminator (do not remove!) }; PX_UNUSED(prefVers[0]); // Make compiler happy return 0; } bool convert() { //TODO: // Write custom conversion code here using mNewData and mLegacyData members. // // Note that // - mNewData has already been initialized with default values // - same-named/same-typed members have already been copied // from mLegacyData to mNewData // - included references were moved to mNewData // (and updated to preferred versions according to getPreferredVersions) // // For more info see the versioning wiki. PxU32 numMaterials = (physx::PxU32)mNewData->materials.arraySizes[0]; ClothingMaterialLibraryParameters_0p4NS::ClothingMaterial_Type* oldMaterials = mLegacyData->materials.buf; ClothingMaterialLibraryParameters_0p5NS::ClothingMaterial_Type* newMaterials = mNewData->materials.buf; PX_ASSERT((PxU32)mLegacyData->materials.arraySizes[0] == numMaterials); for (PxU32 i = 0; i < numMaterials; ++i) { ClothingMaterialLibraryParameters_0p4NS::ClothingMaterial_Type& oldMat = oldMaterials[i]; ClothingMaterialLibraryParameters_0p5NS::ClothingMaterial_Type& newMat = newMaterials[i]; newMat.verticalStretchingStiffness = oldMat.stretchingStiffness; newMat.horizontalStretchingStiffness = oldMat.stretchingStiffness; newMat.verticalStiffnessScaling.range = 1.0f; newMat.verticalStiffnessScaling.scale = 1.0f; newMat.horizontalStiffnessScaling.range = oldMat.stretchingLimit.limit; newMat.horizontalStiffnessScaling.scale = oldMat.stretchingLimit.stiffness; newMat.bendingStiffnessScaling.range = oldMat.bendingLimit.limit; newMat.bendingStiffnessScaling.scale = oldMat.bendingLimit.stiffness; newMat.shearingStiffnessScaling.range = oldMat.shearingLimit.limit; newMat.shearingStiffnessScaling.scale = oldMat.shearingLimit.stiffness; } return true; } }; } } } // namespace physx::apex #endif
35.538462
174
0.794102
aab313b6da3bbe379294f6a20a1104c14a00f794
950
h
C
include/vpi/hal/rotation/PotentiometerRotationSensor.h
VexWPILib/PhysicalDriveTuner
6e73638166bca7e7a025449c8d2c940a78496b0d
[ "BSD-3-Clause" ]
null
null
null
include/vpi/hal/rotation/PotentiometerRotationSensor.h
VexWPILib/PhysicalDriveTuner
6e73638166bca7e7a025449c8d2c940a78496b0d
[ "BSD-3-Clause" ]
null
null
null
include/vpi/hal/rotation/PotentiometerRotationSensor.h
VexWPILib/PhysicalDriveTuner
6e73638166bca7e7a025449c8d2c940a78496b0d
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) VexWPIApi contributors. // Open Source Software; you can modify and/or share it under the terms of // the VexWPIApi BSD license file in the root directory of this project. #pragma once #include "vex.h" #include "vpi/hal/rotation/AbstractRotationSensor.h" namespace vpi { class PotentiometerRotationSensor : public AbstractRotationSensor { public: PotentiometerRotationSensor(vex::pot p) : m_pot(p) {} QAngle GetValue() override { m_timestamp = 1000 * (uint32_t)Brain.Timer.value(); // Milliseconds? TODO return (m_pot.angle(vex::rotationUnits::deg) * degree - m_lastReset); } void Reset() override { m_lastReset = m_pot.angle(vex::rotationUnits::deg) * degree; } QAngularSpeed GetAngularSpeed() override { return 0 * rpm; } protected: vex::pot m_pot; QAngle m_lastReset = 0_rad; }; } // end vpi
28.787879
83
0.645263
d2b4ee194e6fb90ba6a4e65d8da3cb691d8418ab
509
h
C
CodeXL/AMDTApplicationFramework/src/afSingletonsDelete.h
jeongjoonyoo/CodeXL
ea6d623d0530aa3a862ef0bf60ad2923a2f8f8a5
[ "MIT" ]
1,025
2016-04-19T21:36:08.000Z
2020-04-26T05:12:53.000Z
CodeXL/AMDTApplicationFramework/src/afSingletonsDelete.h
jeongjoonyoo/CodeXL
ea6d623d0530aa3a862ef0bf60ad2923a2f8f8a5
[ "MIT" ]
244
2016-04-20T02:05:43.000Z
2020-04-29T17:40:49.000Z
CodeXL/AMDTApplicationFramework/src/afSingletonsDelete.h
jeongjoonyoo/CodeXL
ea6d623d0530aa3a862ef0bf60ad2923a2f8f8a5
[ "MIT" ]
161
2016-04-20T03:23:53.000Z
2020-04-14T01:46:55.000Z
//================================================================================== // Copyright (c) 2016 , Advanced Micro Devices, Inc. All rights reserved. // /// \author AMD Developer Tools Team /// \file afSingletonsDelete.h /// //================================================================================== #ifndef __AFSINGLETONSDELETE_H #define __AFSINGLETONSDELETE_H class afSingletonsDelete { public: afSingletonsDelete(); ~afSingletonsDelete(); }; #endif //__AFSINGLETONSDELETE_H
24.238095
84
0.495088
d2be16645c7a3ac723a94e9ef468ff2bd85d5216
19,121
h
C
cpu_decode_official.h
ykst/mocimaf
b3bc23100e7f87633107c76629549749d1fceb1d
[ "MIT" ]
3
2019-11-28T11:20:04.000Z
2021-03-12T21:39:26.000Z
cpu_decode_official.h
ykst/mocimaf
b3bc23100e7f87633107c76629549749d1fceb1d
[ "MIT" ]
null
null
null
cpu_decode_official.h
ykst/mocimaf
b3bc23100e7f87633107c76629549749d1fceb1d
[ "MIT" ]
1
2021-09-12T23:16:03.000Z
2021-09-12T23:16:03.000Z
// *** WARNING *** // This file is generated by gen6502.rb // Keep untouched or ruin the abstraction // generated file #pragma once #include "cpu.h" #include "cpu_decode.h" #include "utils.h" // [BRK] OP:00 Mode:IMPLIED Length:1 Memory:- // Semantics:PUSH16(PC + 1), P((P & 0xcf) | 0x30), PUSH(P), I(1), VEC(0xfffe) static inline void cpu_decode_00_brk(cpu_t *self) { // PUSH16(PC + 1) cpu_push16(self, self->reg.pc + 1); // P((P & 0xcf) | 0x30) self->reg.p = (self->reg.p & 0xcf) | 0x30; // PUSH(P) cpu_push(self, self->reg.p); // I(1) self->reg.int_disable = (bool)(1); // VEC(0xfffe) self->reg.pc = cpu_read_vector(self, 0xfffe); } // [ORA] OP:01 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:T(A | T), N, Z, A static inline void cpu_decode_01_ora(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(A | T) tmp = self->reg.a | tmp; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [ASL] OP:06 Mode:ZERO_PAGE Length:2 Memory:RMW // Semantics:T(R), C(T & 0x80), W, T(T << 1), N, Z, W static inline void cpu_decode_06_asl(cpu_t *self, uint16_t addr) { uint16_t tmp; // T(R) tmp = cpu_read(self, addr); // C(T & 0x80) self->reg.carry = (bool)(tmp & 0x80); // W(T) cpu_write(self, addr, tmp); // T(T << 1) tmp = tmp << 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // W(T) cpu_write(self, addr, tmp); } // [PHP] OP:08 Mode:IMPLIED Length:1 Memory:- // Semantics:PUSH((P & 0xcf) | 0x30) static inline void cpu_decode_08_php(cpu_t *self) { // PUSH((P & 0xcf) | 0x30) cpu_push(self, (self->reg.p & 0xcf) | 0x30); } // [ASL] OP:0A Mode:ACCUMULATOR Length:1 Memory:- // Semantics:T(A << 1), C(A & 0x80), N, Z, A static inline void cpu_decode_0A_asl(cpu_t *self) { uint16_t tmp; // T(A << 1) tmp = self->reg.a << 1; // C(A & 0x80) self->reg.carry = (bool)(self->reg.a & 0x80); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [BPL] OP:10 Mode:RELATIVE Length:2 Memory:W // Semantics:B(!N) static inline void cpu_decode_10_bpl(cpu_t *self, uint16_t addr) { // B(!N) cpu_decode_branch(self, addr, !self->reg.negative); } // [CLC] OP:18 Mode:IMPLIED Length:1 Memory:- // Semantics:C(0) static inline void cpu_decode_18_clc(cpu_t *self) { // C(0) self->reg.carry = (bool)(0); } // [JSR] OP:20 Mode:ABSOLUTE Length:3 Memory:W // Semantics:PUSH16(PC - 1), G(1), PC(M) static inline void cpu_decode_20_jsr(cpu_t *self, uint16_t addr) { // PUSH16(PC - 1) cpu_push16(self, self->reg.pc - 1); // G(1) bus_clock_cpu(self->shared_bus, 1); // PC(M) self->reg.pc = addr; } // [AND] OP:21 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:T(A & T), N, Z, A static inline void cpu_decode_21_and(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(A & T) tmp = self->reg.a & tmp; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [BIT] OP:24 Mode:ZERO_PAGE Length:2 Memory:R // Semantics:N, Z(T & A), V(T & 0x40) static inline void cpu_decode_24_bit(cpu_t *self, uint8_t value) { uint16_t tmp = value; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T & A) self->reg.zero = !((tmp & self->reg.a) & 0xff); // V(T & 0x40) self->reg.overflow = (bool)(tmp & 0x40); } // [ROL] OP:26 Mode:ZERO_PAGE Length:2 Memory:RMW // Semantics:T(R), W, T((T << 1) | C), C(T & 0x100), N, Z, W static inline void cpu_decode_26_rol(cpu_t *self, uint16_t addr) { uint16_t tmp; // T(R) tmp = cpu_read(self, addr); // W(T) cpu_write(self, addr, tmp); // T((T << 1) | C) tmp = (tmp << 1) | self->reg.carry; // C(T & 0x100) self->reg.carry = (bool)(tmp & 0x100); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // W(T) cpu_write(self, addr, tmp); } // [PLP] OP:28 Mode:IMPLIED Length:1 Memory:- // Semantics:R(PC), P((P & 0x30) | (PULL & ~0x30)), IRQ_DELAY(1) static inline void cpu_decode_28_plp(cpu_t *self) { // R(PC) (void)cpu_read(self, self->reg.pc); // P((P & 0x30) | (PULL & ~0x30)) self->reg.p = (self->reg.p & 0x30) | (cpu_pull(self) & ~0x30); // IRQ_DELAY(1) self->irq_poll_delay = 1; } // [ROL] OP:2A Mode:ACCUMULATOR Length:1 Memory:- // Semantics:T((A << 1) | C), C(T & 0x100), N, Z, A static inline void cpu_decode_2A_rol(cpu_t *self) { uint16_t tmp; // T((A << 1) | C) tmp = (self->reg.a << 1) | self->reg.carry; // C(T & 0x100) self->reg.carry = (bool)(tmp & 0x100); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [BMI] OP:30 Mode:RELATIVE Length:2 Memory:W // Semantics:B(N) static inline void cpu_decode_30_bmi(cpu_t *self, uint16_t addr) { // B(N) cpu_decode_branch(self, addr, self->reg.negative); } // [SEC] OP:38 Mode:IMPLIED Length:1 Memory:- // Semantics:C(1) static inline void cpu_decode_38_sec(cpu_t *self) { // C(1) self->reg.carry = (bool)(1); } // [RTI] OP:40 Mode:IMPLIED Length:1 Memory:- // Semantics:R(PC), P((P & 0x30) | (PULL & ~0x30)), PC(PULL16) static inline void cpu_decode_40_rti(cpu_t *self) { // R(PC) (void)cpu_read(self, self->reg.pc); // P((P & 0x30) | (PULL & ~0x30)) self->reg.p = (self->reg.p & 0x30) | (cpu_pull(self) & ~0x30); // PC(PULL16) self->reg.pc = cpu_pull16(self); } // [EOR] OP:41 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:T(A ^ T), N, Z, A static inline void cpu_decode_41_eor(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(A ^ T) tmp = self->reg.a ^ tmp; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [LSR] OP:46 Mode:ZERO_PAGE Length:2 Memory:RMW // Semantics:T(R), W, C(T & 0x01), T(T >> 1), N, Z, W static inline void cpu_decode_46_lsr(cpu_t *self, uint16_t addr) { uint16_t tmp; // T(R) tmp = cpu_read(self, addr); // W(T) cpu_write(self, addr, tmp); // C(T & 0x01) self->reg.carry = (bool)(tmp & 0x01); // T(T >> 1) tmp = tmp >> 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // W(T) cpu_write(self, addr, tmp); } // [PHA] OP:48 Mode:IMPLIED Length:1 Memory:- // Semantics:PUSH(A) static inline void cpu_decode_48_pha(cpu_t *self) { // PUSH(A) cpu_push(self, self->reg.a); } // [LSR] OP:4A Mode:ACCUMULATOR Length:1 Memory:- // Semantics:T(A), C(T & 0x01), T(T >> 1), N, Z, A static inline void cpu_decode_4A_lsr(cpu_t *self) { uint16_t tmp; // T(A) tmp = self->reg.a; // C(T & 0x01) self->reg.carry = (bool)(tmp & 0x01); // T(T >> 1) tmp = tmp >> 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [JMP] OP:4C Mode:ABSOLUTE Length:3 Memory:W // Semantics:PC(M) static inline void cpu_decode_4C_jmp(cpu_t *self, uint16_t addr) { // PC(M) self->reg.pc = addr; } // [BVC] OP:50 Mode:RELATIVE Length:2 Memory:W // Semantics:B(!V) static inline void cpu_decode_50_bvc(cpu_t *self, uint16_t addr) { // B(!V) cpu_decode_branch(self, addr, !self->reg.overflow); } // [CLI] OP:58 Mode:IMPLIED Length:1 Memory:- // Semantics:I(0), IRQ_DELAY(1) static inline void cpu_decode_58_cli(cpu_t *self) { // I(0) self->reg.int_disable = (bool)(0); // IRQ_DELAY(1) self->irq_poll_delay = 1; } // [RTS] OP:60 Mode:IMPLIED Length:1 Memory:- // Semantics:R(PC), G(1), PC(PULL16 + 1) static inline void cpu_decode_60_rts(cpu_t *self) { // R(PC) (void)cpu_read(self, self->reg.pc); // G(1) bus_clock_cpu(self->shared_bus, 1); // PC(PULL16 + 1) self->reg.pc = cpu_pull16(self) + 1; } // [ADC] OP:61 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:T(T + A + C), N(T & 0x80), Z, C(T > 0xff), V((A ^ O ^ 0x80) & (A ^ T) & 0x80), A static inline void cpu_decode_61_adc(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(T + A + C) tmp = tmp + self->reg.a + self->reg.carry; // N(T & 0x80) self->reg.negative = ((tmp & 0x80) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // C(T > 0xff) self->reg.carry = (bool)(tmp > 0xff); // V((A ^ O ^ 0x80) & (A ^ T) & 0x80) self->reg.overflow = (bool)((self->reg.a ^ value ^ 0x80) & (self->reg.a ^ tmp) & 0x80); // A(T) self->reg.a = tmp; } // [ROR] OP:66 Mode:ZERO_PAGE Length:2 Memory:RMW // Semantics:T(R), W, T(T | (C ? 0x100 : 0)), C(T & 0x01), T(T >> 1), N, Z, W static inline void cpu_decode_66_ror(cpu_t *self, uint16_t addr) { uint16_t tmp; // T(R) tmp = cpu_read(self, addr); // W(T) cpu_write(self, addr, tmp); // T(T | (C ? 0x100 : 0)) tmp = tmp | (self->reg.carry ? 0x100 : 0); // C(T & 0x01) self->reg.carry = (bool)(tmp & 0x01); // T(T >> 1) tmp = tmp >> 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // W(T) cpu_write(self, addr, tmp); } // [PLA] OP:68 Mode:IMPLIED Length:1 Memory:- // Semantics:R(PC), A(PULL), N(A), Z(A) static inline void cpu_decode_68_pla(cpu_t *self) { // R(PC) (void)cpu_read(self, self->reg.pc); // A(PULL) self->reg.a = cpu_pull(self); // N(A) self->reg.negative = ((self->reg.a) >> 7) & 1; // Z(A) self->reg.zero = !((self->reg.a) & 0xff); } // [ROR] OP:6A Mode:ACCUMULATOR Length:1 Memory:- // Semantics:T(A | (C ? 0x100 : 0)), C(T & 0x01), T(T >> 1), N, Z, A static inline void cpu_decode_6A_ror(cpu_t *self) { uint16_t tmp; // T(A | (C ? 0x100 : 0)) tmp = self->reg.a | (self->reg.carry ? 0x100 : 0); // C(T & 0x01) self->reg.carry = (bool)(tmp & 0x01); // T(T >> 1) tmp = tmp >> 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [BVS] OP:70 Mode:RELATIVE Length:2 Memory:W // Semantics:B(V) static inline void cpu_decode_70_bvs(cpu_t *self, uint16_t addr) { // B(V) cpu_decode_branch(self, addr, self->reg.overflow); } // [SEI] OP:78 Mode:IMPLIED Length:1 Memory:- // Semantics:I(1) static inline void cpu_decode_78_sei(cpu_t *self) { // I(1) self->reg.int_disable = (bool)(1); } // [STA] OP:81 Mode:PRE_INDIRECT_X Length:2 Memory:W // Semantics:W(A) static inline void cpu_decode_81_sta(cpu_t *self, uint16_t addr) { // W(A) cpu_write(self, addr, self->reg.a); } // [STY] OP:84 Mode:ZERO_PAGE Length:2 Memory:W // Semantics:W(Y) static inline void cpu_decode_84_sty(cpu_t *self, uint16_t addr) { // W(Y) cpu_write(self, addr, self->reg.y); } // [STX] OP:86 Mode:ZERO_PAGE Length:2 Memory:W // Semantics:W(X) static inline void cpu_decode_86_stx(cpu_t *self, uint16_t addr) { // W(X) cpu_write(self, addr, self->reg.x); } // [DEY] OP:88 Mode:IMPLIED Length:1 Memory:- // Semantics:Y(Y - 1), N(Y), Z(Y) static inline void cpu_decode_88_dey(cpu_t *self) { // Y(Y - 1) self->reg.y = self->reg.y - 1; // N(Y) self->reg.negative = ((self->reg.y) >> 7) & 1; // Z(Y) self->reg.zero = !((self->reg.y) & 0xff); } // [TXA] OP:8A Mode:IMPLIED Length:1 Memory:- // Semantics:A(X), N(A), Z(A) static inline void cpu_decode_8A_txa(cpu_t *self) { // A(X) self->reg.a = self->reg.x; // N(A) self->reg.negative = ((self->reg.a) >> 7) & 1; // Z(A) self->reg.zero = !((self->reg.a) & 0xff); } // [BCC] OP:90 Mode:RELATIVE Length:2 Memory:W // Semantics:B(!C) static inline void cpu_decode_90_bcc(cpu_t *self, uint16_t addr) { // B(!C) cpu_decode_branch(self, addr, !self->reg.carry); } // [TYA] OP:98 Mode:IMPLIED Length:1 Memory:- // Semantics:A(Y), N(A), Z(A) static inline void cpu_decode_98_tya(cpu_t *self) { // A(Y) self->reg.a = self->reg.y; // N(A) self->reg.negative = ((self->reg.a) >> 7) & 1; // Z(A) self->reg.zero = !((self->reg.a) & 0xff); } // [TXS] OP:9A Mode:IMPLIED Length:1 Memory:- // Semantics:S(X) static inline void cpu_decode_9A_txs(cpu_t *self) { // S(X) self->reg.s = self->reg.x; } // [LDY] OP:A0 Mode:IMMEDIATE Length:2 Memory:- // Semantics:N, Z, Y static inline void cpu_decode_A0_ldy(cpu_t *self, uint8_t value) { uint16_t tmp = value; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // Y(T) self->reg.y = tmp; } // [LDA] OP:A1 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:N, Z, A static inline void cpu_decode_A1_lda(cpu_t *self, uint8_t value) { uint16_t tmp = value; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // A(T) self->reg.a = tmp; } // [LDX] OP:A2 Mode:IMMEDIATE Length:2 Memory:- // Semantics:N, Z, X static inline void cpu_decode_A2_ldx(cpu_t *self, uint8_t value) { uint16_t tmp = value; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // X(T) self->reg.x = tmp; } // [TAY] OP:A8 Mode:IMPLIED Length:1 Memory:- // Semantics:Y(A), N(Y), Z(Y) static inline void cpu_decode_A8_tay(cpu_t *self) { // Y(A) self->reg.y = self->reg.a; // N(Y) self->reg.negative = ((self->reg.y) >> 7) & 1; // Z(Y) self->reg.zero = !((self->reg.y) & 0xff); } // [TAX] OP:AA Mode:IMPLIED Length:1 Memory:- // Semantics:X(A), N(X), Z(X) static inline void cpu_decode_AA_tax(cpu_t *self) { // X(A) self->reg.x = self->reg.a; // N(X) self->reg.negative = ((self->reg.x) >> 7) & 1; // Z(X) self->reg.zero = !((self->reg.x) & 0xff); } // [BCS] OP:B0 Mode:RELATIVE Length:2 Memory:W // Semantics:B(C) static inline void cpu_decode_B0_bcs(cpu_t *self, uint16_t addr) { // B(C) cpu_decode_branch(self, addr, self->reg.carry); } // [CLV] OP:B8 Mode:IMPLIED Length:1 Memory:- // Semantics:V(0) static inline void cpu_decode_B8_clv(cpu_t *self) { // V(0) self->reg.overflow = (bool)(0); } // [TSX] OP:BA Mode:IMPLIED Length:1 Memory:- // Semantics:X(S), N(X), Z(X) static inline void cpu_decode_BA_tsx(cpu_t *self) { // X(S) self->reg.x = self->reg.s; // N(X) self->reg.negative = ((self->reg.x) >> 7) & 1; // Z(X) self->reg.zero = !((self->reg.x) & 0xff); } // [CPY] OP:C0 Mode:IMMEDIATE Length:2 Memory:- // Semantics:T(Y - T), C(T < 0x100), N, Z static inline void cpu_decode_C0_cpy(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(Y - T) tmp = self->reg.y - tmp; // C(T < 0x100) self->reg.carry = (bool)(tmp < 0x100); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); } // [CMP] OP:C1 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:T(A - T), C(T < 0x100), N, Z static inline void cpu_decode_C1_cmp(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(A - T) tmp = self->reg.a - tmp; // C(T < 0x100) self->reg.carry = (bool)(tmp < 0x100); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); } // [DEC] OP:C6 Mode:ZERO_PAGE Length:2 Memory:RMW // Semantics:T(R), W, T(T - 1), N, Z, W static inline void cpu_decode_C6_dec(cpu_t *self, uint16_t addr) { uint16_t tmp; // T(R) tmp = cpu_read(self, addr); // W(T) cpu_write(self, addr, tmp); // T(T - 1) tmp = tmp - 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // W(T) cpu_write(self, addr, tmp); } // [INY] OP:C8 Mode:IMPLIED Length:1 Memory:- // Semantics:Y(Y + 1), N(Y), Z(Y) static inline void cpu_decode_C8_iny(cpu_t *self) { // Y(Y + 1) self->reg.y = self->reg.y + 1; // N(Y) self->reg.negative = ((self->reg.y) >> 7) & 1; // Z(Y) self->reg.zero = !((self->reg.y) & 0xff); } // [DEX] OP:CA Mode:IMPLIED Length:1 Memory:- // Semantics:X(X - 1), N(X), Z(X) static inline void cpu_decode_CA_dex(cpu_t *self) { // X(X - 1) self->reg.x = self->reg.x - 1; // N(X) self->reg.negative = ((self->reg.x) >> 7) & 1; // Z(X) self->reg.zero = !((self->reg.x) & 0xff); } // [BNE] OP:D0 Mode:RELATIVE Length:2 Memory:W // Semantics:B(!Z) static inline void cpu_decode_D0_bne(cpu_t *self, uint16_t addr) { // B(!Z) cpu_decode_branch(self, addr, !self->reg.zero); } // [CLD] OP:D8 Mode:IMPLIED Length:1 Memory:- // Semantics:D(0) static inline void cpu_decode_D8_cld(cpu_t *self) { // D(0) self->reg.decimal = (bool)(0); } // [CPX] OP:E0 Mode:IMMEDIATE Length:2 Memory:- // Semantics:T(X - T), C(T < 0x100), N, Z static inline void cpu_decode_E0_cpx(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(X - T) tmp = self->reg.x - tmp; // C(T < 0x100) self->reg.carry = (bool)(tmp < 0x100); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); } // [SBC] OP:E1 Mode:PRE_INDIRECT_X Length:2 Memory:R // Semantics:T(A - T - (C ? 0 : 1)), N, Z, V((A ^ T) & (A ^ O) & 0x80), C(T < 0x100), A static inline void cpu_decode_E1_sbc(cpu_t *self, uint8_t value) { uint16_t tmp = value; // T(A - T - (C ? 0 : 1)) tmp = self->reg.a - tmp - (self->reg.carry ? 0 : 1); // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // V((A ^ T) & (A ^ O) & 0x80) self->reg.overflow = (bool)((self->reg.a ^ tmp) & (self->reg.a ^ value) & 0x80); // C(T < 0x100) self->reg.carry = (bool)(tmp < 0x100); // A(T) self->reg.a = tmp; } // [INC] OP:E6 Mode:ZERO_PAGE Length:2 Memory:RMW // Semantics:T(R), W, T(T + 1), N, Z, W static inline void cpu_decode_E6_inc(cpu_t *self, uint16_t addr) { uint16_t tmp; // T(R) tmp = cpu_read(self, addr); // W(T) cpu_write(self, addr, tmp); // T(T + 1) tmp = tmp + 1; // N(T) self->reg.negative = ((tmp) >> 7) & 1; // Z(T) self->reg.zero = !((tmp) & 0xff); // W(T) cpu_write(self, addr, tmp); } // [INX] OP:E8 Mode:IMPLIED Length:1 Memory:- // Semantics:X(X + 1), N(X), Z(X) static inline void cpu_decode_E8_inx(cpu_t *self) { // X(X + 1) self->reg.x = self->reg.x + 1; // N(X) self->reg.negative = ((self->reg.x) >> 7) & 1; // Z(X) self->reg.zero = !((self->reg.x) & 0xff); } // [BEQ] OP:F0 Mode:RELATIVE Length:2 Memory:W // Semantics:B(Z) static inline void cpu_decode_F0_beq(cpu_t *self, uint16_t addr) { // B(Z) cpu_decode_branch(self, addr, self->reg.zero); } // [SED] OP:F8 Mode:IMPLIED Length:1 Memory:- // Semantics:D(1) static inline void cpu_decode_F8_sed(cpu_t *self) { // D(1) self->reg.decimal = (bool)(1); }
25.528705
93
0.560588
d2ee54d7165eb9db2b8ef7791bf7922ccaf7b76d
10,047
h
C
include/scn/unicode/utf8.h
GerHobbelt/scnlib
3ebb3d02d8c7e704dde754c74dcac52830ae1cdd
[ "Apache-2.0", "MIT" ]
null
null
null
include/scn/unicode/utf8.h
GerHobbelt/scnlib
3ebb3d02d8c7e704dde754c74dcac52830ae1cdd
[ "Apache-2.0", "MIT" ]
null
null
null
include/scn/unicode/utf8.h
GerHobbelt/scnlib
3ebb3d02d8c7e704dde754c74dcac52830ae1cdd
[ "Apache-2.0", "MIT" ]
null
null
null
// Copyright 2017 Elias Kosunen // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // This file is a part of scnlib: // https://github.com/eliaskosunen/scnlib // // The contents of this file are based on utfcpp: // https://github.com/nemtrif/utfcpp // Copyright (c) 2006 Nemanja Trifunovic // Distributed under the Boost Software License, version 1.0 #ifndef SCN_UNICODE_UTF8_H #define SCN_UNICODE_UTF8_H #include "../detail/error.h" #include "../util/expected.h" #include "common.h" namespace scn { SCN_BEGIN_NAMESPACE namespace detail { namespace utf8 { template <typename Octet> constexpr bool is_trail(Octet o) { return (mask8(o) >> 6) == 2; } template <typename Octet> SCN_CONSTEXPR14 int get_sequence_length(Octet ch) { uint8_t lead = detail::mask8(ch); if (lead < 0x80) { return 1; } else if ((lead >> 5) == 6) { return 2; } else if ((lead >> 4) == 0xe) { return 3; } else if ((lead >> 3) == 0x1e) { return 4; } return 0; } SCN_CONSTEXPR14 bool is_overlong_sequence(code_point cp, std::ptrdiff_t len) { if (cp < 0x80) { if (len != 1) { return true; } } else if (cp < 0x800) { if (len != 2) { return true; } } else if (cp < 0x10000) { if (len != 3) { return true; } } return false; } template <typename I, typename S> SCN_CONSTEXPR14 error increase_safely(I& it, S end) { if (++it == end) { return {error::invalid_encoding, "Unexpected end of range when decoding utf8 " "(partial codepoint)"}; } if (!is_trail(*it)) { return {error::invalid_encoding, "Invalid utf8 codepoint parsed"}; } return {}; } template <typename I, typename S> SCN_CONSTEXPR14 error get_sequence_1(I& it, S end, code_point& cp) { SCN_EXPECT(it != end); cp = make_code_point(mask8(*it)); return {}; } template <typename I, typename S> SCN_CONSTEXPR14 error get_sequence_2(I& it, S end, code_point& cp) { SCN_EXPECT(it != end); uint32_t c = mask8(*it); auto e = increase_safely(it, end); if (!e) { return e; } c = static_cast<uint32_t>((c << 6u) & 0x7ffu) + (static_cast<uint32_t>(*it) & 0x3fu); cp = make_code_point(c); return {}; } template <typename I, typename S> SCN_CONSTEXPR14 error get_sequence_3(I& it, S end, code_point& cp) { SCN_EXPECT(it != end); uint32_t c = mask8(*it); auto e = increase_safely(it, end); if (!e) { return e; } c = static_cast<uint32_t>((c << 12u) & 0xffffu) + (static_cast<uint32_t>(mask8(*it) << 6u) & 0xfffu); e = increase_safely(it, end); if (!e) { return e; } c += static_cast<uint32_t>(*it) & 0x3fu; cp = make_code_point(c); return {}; } template <typename I, typename S> SCN_CONSTEXPR14 error get_sequence_4(I& it, S end, code_point& cp) { SCN_EXPECT(it != end); uint32_t c = mask8(*it); auto e = increase_safely(it, end); if (!e) { return e; } c = ((c << 18u) & 0x1fffffu) + (static_cast<uint32_t>(mask8(*it) << 12u) & 0x3ffffu); e = increase_safely(it, end); if (!e) { return e; } c += static_cast<uint32_t>(mask8(*it) << 6u) & 0xfffu; e = increase_safely(it, end); if (!e) { return e; } c += static_cast<uint32_t>(*it) & 0x3fu; cp = make_code_point(c); return {}; } template <typename I, typename S> SCN_CONSTEXPR14 error validate_next(I& it, S end, code_point& cp) { SCN_EXPECT(it != end); int len = get_sequence_length(*it); error e{}; switch (len) { case 1: e = get_sequence_1(it, end, cp); break; case 2: e = get_sequence_2(it, end, cp); break; case 3: e = get_sequence_3(it, end, cp); break; case 4: e = get_sequence_4(it, end, cp); break; default: return {error::invalid_encoding, "Invalid lead byte for utf8"}; } if (!e) { return e; } if (!is_valid_code_point(cp) || is_overlong_sequence(cp, len)) { return {error::invalid_encoding, "Invalid utf8 code point"}; } ++it; return {}; } template <typename I, typename S> SCN_CONSTEXPR14 expected<I> parse_code_point(I begin, S end, code_point& cp) { code_point c{}; auto e = validate_next(begin, end, c); if (e) { cp = c; return {begin}; } return e; } template <typename I> I append(code_point cp, I it) { SCN_EXPECT(is_code_point_valid(cp)); if (cp < 0x80) { *(it++) = static_cast<uint8_t>(cp); } else if (cp < 0x800) { *(it++) = static_cast<uint8_t>( (static_cast<uint32_t>(cp) >> 6u) | 0xc0u); *(it++) = static_cast<uint8_t>( (static_cast<uint32_t>(cp) & 0x3fu) | 0x80u); } else if (cp < 0x10000) { *(it++) = static_cast<uint8_t>( (static_cast<uint32_t>(cp) >> 12u) | 0xe0u); *(it++) = static_cast<uint8_t>( ((static_cast<uint32_t>(cp) >> 6u) & 0x3fu) | 0x80u); *(it++) = static_cast<uint8_t>( (static_cast<uint32_t>(cp) & 0x3fu) | 0x80u); } else { *(it++) = static_cast<uint8_t>( (static_cast<uint32_t>(cp) >> 18u) | 0xf0u); *(it++) = static_cast<uint8_t>( ((static_cast<uint32_t>(cp) >> 12u) & 0x3fu) | 0x80u); *(it++) = static_cast<uint8_t>( ((static_cast<uint32_t>(cp) >> 6u) & 0x3fu) | 0x80u); *(it++) = static_cast<uint8_t>( (static_cast<uint32_t>(cp) & 0x3fu) | 0x80u); } return it; } template <typename I, typename S> SCN_CONSTEXPR14 expected<I> encode_code_point(I begin, S end, code_point cp) { SCN_EXPECT(begin + 4 <= end); if (!is_code_point_valid(cp)) { return error(error::invalid_encoding, "Invalid code point, cannot encode in UTF-8"); } return {append(cp, begin)}; } template <typename I, typename S> SCN_CONSTEXPR14 expected<std::ptrdiff_t> code_point_distance( I begin, S end) { std::ptrdiff_t dist{}; code_point cp{}; for (; begin < end; ++dist) { auto e = validate_next(begin, end, cp); if (!e) { return e; } } return {dist}; } } // namespace utf8 } // namespace detail SCN_END_NAMESPACE } // namespace scn #endif
33.714765
80
0.402807
303efe030799216f8851f99b28771b3d234be82e
791
c
C
OpAritmeticos.c
lesly-chaparro/Ejercicios
1ba82ab0de5121290c5a9cd47681a02e19329213
[ "MIT" ]
null
null
null
OpAritmeticos.c
lesly-chaparro/Ejercicios
1ba82ab0de5121290c5a9cd47681a02e19329213
[ "MIT" ]
null
null
null
OpAritmeticos.c
lesly-chaparro/Ejercicios
1ba82ab0de5121290c5a9cd47681a02e19329213
[ "MIT" ]
null
null
null
/*OPERADORES ARITMETICOS Lesly Chaparro*/ /* ++ Incremento -- Decremento - Resta / Division * Multiplicacion % modulo */ #include <stdio.h> int main() { int num1, num2; //Solo con un valor (num1) printf("\nEscribe el numero base: "); scanf("%d",&num1); printf("\n\tINCREMENTO CON UN SOLO VALOR\n"); num1++; //postincremento printf("\t\tPostincremento (num1++): %d \n",num1); ++num1; //preincremento printf("\t\tPreincremento (++num1): %d \n",num1); /*Con ambos valores (num1 y num2) El num2 es solo de almacen de num1 */ num2 =num1++; printf("\n\tINCREMENTO CON DOS VALORES\n"); printf("\t\tPostincremento (num2=num1++): %d\n"); num2 = ++num1; printf("\t\tPreincremento con ambos valores (num2=++num1): %d\n"); return 0; }
23.264706
70
0.615676
306edb99978df3cd3234ca8fcc890433efb94c31
1,438
h
C
OrbitGl/FunctionsDataView.h
EmperorYP7/orb
33210e928243eb803b4b01fe9b82f89656d2f061
[ "BSD-2-Clause" ]
1
2021-01-10T16:32:07.000Z
2021-01-10T16:32:07.000Z
OrbitGl/FunctionsDataView.h
EmperorYP7/orbit
33210e928243eb803b4b01fe9b82f89656d2f061
[ "BSD-2-Clause" ]
null
null
null
OrbitGl/FunctionsDataView.h
EmperorYP7/orbit
33210e928243eb803b4b01fe9b82f89656d2f061
[ "BSD-2-Clause" ]
null
null
null
// Copyright (c) 2020 The Orbit 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 ORBIT_GL_FUNCTIONS_DATA_VIEW_H_ #define ORBIT_GL_FUNCTIONS_DATA_VIEW_H_ #include "DataView.h" #include "capture_data.pb.h" class FunctionsDataView : public DataView { public: FunctionsDataView(); const std::vector<Column>& GetColumns() override; int GetDefaultSortingColumn() override { return kColumnAddress; } std::vector<std::string> GetContextMenu(int clicked_index, const std::vector<int>& selected_indices) override; std::string GetValue(int row, int column) override; void OnContextMenu(const std::string& action, int menu_index, const std::vector<int>& item_indices) override; void OnDataChanged() override; protected: void DoSort() override; void DoFilter() override; void ParallelFilter(); orbit_client_protos::FunctionInfo& GetFunction(int row) const; std::vector<std::string> m_FilterTokens; enum ColumnIndex { kColumnSelected, kColumnName, kColumnSize, kColumnFile, kColumnLine, kColumnModule, kColumnAddress, kNumColumns }; static const std::string kMenuActionSelect; static const std::string kMenuActionUnselect; static const std::string kMenuActionDisassembly; }; #endif // ORBIT_GL_FUNCTIONS_DATA_VIEW_H_
28.76
93
0.725313
684074189ee49b16ee3f896ab66b65bba0bc8f25
5,449
c
C
tasmota/Tasmota-8.4.0/lib/bearssl-esp8266/src/symcipher/poly1305_i15.c
zorcec/SARAH
c7936ce9467fb11594b6ae4a937d6766060bec05
[ "MIT" ]
null
null
null
tasmota/Tasmota-8.4.0/lib/bearssl-esp8266/src/symcipher/poly1305_i15.c
zorcec/SARAH
c7936ce9467fb11594b6ae4a937d6766060bec05
[ "MIT" ]
null
null
null
tasmota/Tasmota-8.4.0/lib/bearssl-esp8266/src/symcipher/poly1305_i15.c
zorcec/SARAH
c7936ce9467fb11594b6ae4a937d6766060bec05
[ "MIT" ]
null
null
null
/* * Copyright (c) 2017 Thomas Pornin <pornin@bolet.org> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "t_inner.h" /* * This is a "reference" implementation of Poly1305 that uses the * generic "i15" code for big integers. It is slow, but it handles all * big-integer operations with generic code, thereby avoiding most * tricky situations with carry propagation and modular reduction. */ /* * Modulus: 2^130-5. */ static const uint16_t P1305[] = { 0x008A, 0x7FFB, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0x03FF }; /* * -p mod 2^15. */ #define P0I 0x4CCD /* * R^2 mod p, for conversion to Montgomery representation (R = 2^135, * since we use 9 words of 15 bits each, and 15*9 = 135). */ static const uint16_t R2[] = { 0x008A, 0x6400, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; /* * Perform the inner processing of blocks for Poly1305. The "r" array * is in Montgomery representation, while the "a" array is not. */ static void poly1305_inner(uint16_t *a, const uint16_t *r, const void *data, size_t len) { const unsigned char *buf; buf = data; while (len > 0) { unsigned char tmp[16], rev[16]; uint16_t b[10]; uint32_t ctl; int i; /* * If there is a partial block, right-pad it with zeros. */ if (len < 16) { memset(tmp, 0, sizeof tmp); memcpy(tmp, buf, len); buf = tmp; len = 16; } /* * Decode next block and apply the "high bit". Since * decoding is little-endian, we must byte-swap the buffer. */ for (i = 0; i < 16; i ++) { rev[i] = buf[15 - i]; } br_i15_decode_mod(b, rev, sizeof rev, P1305); b[9] |= 0x0100; /* * Add the accumulator to the decoded block (modular * addition). */ ctl = br_i15_add(b, a, 1); ctl |= NOT(br_i15_sub(b, P1305, 0)); br_i15_sub(b, P1305, ctl); /* * Multiply by r, result is the new accumulator value. */ br_i15_montymul(a, b, r, P1305, P0I); buf += 16; len -= 16; } } /* * Byteswap a 16-byte value. */ static void byteswap16(unsigned char *buf) { int i; for (i = 0; i < 8; i ++) { unsigned x; x = buf[i]; buf[i] = buf[15 - i]; buf[15 - i] = x; } } /* see bearssl_block.h */ void br_poly1305_i15_run(const void *key, const void *iv, void *data, size_t len, const void *aad, size_t aad_len, void *tag, br_chacha20_run ichacha, int encrypt) { unsigned char pkey[32], foot[16]; uint16_t t[10], r[10], acc[10]; /* * Compute the MAC key. The 'r' value is the first 16 bytes of * pkey[]. */ memset(pkey, 0, sizeof pkey); ichacha(key, iv, 0, pkey, sizeof pkey); /* * If encrypting, ChaCha20 must run first, followed by Poly1305. * When decrypting, the operations are reversed. */ if (encrypt) { ichacha(key, iv, 1, data, len); } /* * Run Poly1305. We must process the AAD, then ciphertext, then * the footer (with the lengths). Note that the AAD and ciphertext * are meant to be padded with zeros up to the next multiple of 16, * and the length of the footer is 16 bytes as well. */ /* * Apply the "clamping" operation on the encoded 'r' value. */ pkey[ 3] &= 0x0F; pkey[ 7] &= 0x0F; pkey[11] &= 0x0F; pkey[15] &= 0x0F; pkey[ 4] &= 0xFC; pkey[ 8] &= 0xFC; pkey[12] &= 0xFC; /* * Decode the clamped 'r' value. Decoding should use little-endian * so we must byteswap the value first. */ byteswap16(pkey); br_i15_decode_mod(t, pkey, 16, P1305); /* * Convert 'r' to Montgomery representation. */ br_i15_montymul(r, t, R2, P1305, P0I); /* * Accumulator is 0. */ br_i15_zero(acc, 0x8A); /* * Process the additional authenticated data, ciphertext, and * footer in due order. */ br_enc64le(foot, (uint64_t)aad_len); br_enc64le(foot + 8, (uint64_t)len); poly1305_inner(acc, r, aad, aad_len); poly1305_inner(acc, r, data, len); poly1305_inner(acc, r, foot, sizeof foot); /* * Decode the value 's'. Again, a byteswap is needed. */ byteswap16(pkey + 16); br_i15_decode_mod(t, pkey + 16, 16, P1305); /* * Add the value 's' to the accumulator. That addition is done * modulo 2^128, so we just ignore the carry. */ br_i15_add(acc, t, 1); /* * Encode the result (128 low bits) to the tag. Encoding should * be little-endian. */ br_i15_encode(tag, 16, acc); byteswap16(tag); /* * If decrypting, then ChaCha20 runs _after_ Poly1305. */ if (!encrypt) { ichacha(key, iv, 1, data, len); } }
24.545045
76
0.662874
6505cd801209290132ad06b46398fc4c23b42783
294
h
C
IronManMod/MobileRadioName.h
Maxirp/IronManMod
b5810610f0d2488f8e26a129d26d20d7cd0295e5
[ "MIT" ]
1
2020-09-18T14:18:47.000Z
2020-09-18T14:18:47.000Z
IronManMod/MobileRadioName.h
Maxirp/GTAIronMan
b5810610f0d2488f8e26a129d26d20d7cd0295e5
[ "MIT" ]
null
null
null
IronManMod/MobileRadioName.h
Maxirp/GTAIronMan
b5810610f0d2488f8e26a129d26d20d7cd0295e5
[ "MIT" ]
1
2020-09-15T13:29:04.000Z
2020-09-15T13:29:04.000Z
#pragma once #include "game_sa\CFont.h" class MobileRadioName { public: static void InstallPatches(); static void MySetRadioNameScale(float x, float y); static void MyDrawRadioName(float x, float y, char *name); static void MySetRadioNameAlignment(eFontAlignment alignment); };
29.4
66
0.755102
653bca0313ba4b0ef8300320794e1cba0f116dcd
61,177
c
C
sdk-6.5.20/src/appl/diag/dnx/swstate/auto_generated/diagnostic/dnx_sch_config_commandline.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/src/appl/diag/dnx/swstate/auto_generated/diagnostic/dnx_sch_config_commandline.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/src/appl/diag/dnx/swstate/auto_generated/diagnostic/dnx_sch_config_commandline.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/** \file dnx/swstate/auto_generated/diagnostic/dnx_sch_config_commandline.c * * sw state functions definitions * * DO NOT EDIT THIS FILE! * This file is auto-generated. * Edits to this file will be lost when it is regenerated. */ /* * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ #ifdef BSL_LOG_MODULE #error "BSL_LOG_MODULE redefined" #endif #define BSL_LOG_MODULE BSL_LS_SWSTATEDNX_GENERAL #include <shared/error.h> #include <shared/bsl.h> #include <appl/diag/sand/diag_sand_framework.h> #include <appl/diag/sand/diag_sand_utils.h> #include <soc/dnxc/swstate/dnxc_sw_state_c_includes.h> #include <soc/dnx/swstate/auto_generated/diagnostic/dnx_sch_config_diagnostic.h> #include "dnx_sch_config_commandline.h" #include <soc/dnx/swstate/auto_generated/access/dnx_sch_config_access.h> #if defined(DNX_SW_STATE_DIAGNOSTIC) sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_cmds[] = { {"hr_group_bw", NULL, sh_dnx_swstate_dnx_sch_config_hr_group_bw_cmds, NULL, &dnx_swstate_dnx_sch_config_hr_group_bw_man}, {"groups_bw", NULL, sh_dnx_swstate_dnx_sch_config_groups_bw_cmds, NULL, &dnx_swstate_dnx_sch_config_groups_bw_man}, {"ipf_config_mode", NULL, sh_dnx_swstate_dnx_sch_config_ipf_config_mode_cmds, NULL, &dnx_swstate_dnx_sch_config_ipf_config_mode_man}, {"flow", NULL, sh_dnx_swstate_dnx_sch_config_flow_cmds, NULL, &dnx_swstate_dnx_sch_config_flow_man}, {"connector", NULL, sh_dnx_swstate_dnx_sch_config_connector_cmds, NULL, &dnx_swstate_dnx_sch_config_connector_man}, {"se", NULL, sh_dnx_swstate_dnx_sch_config_se_cmds, NULL, &dnx_swstate_dnx_sch_config_se_man}, {"dump", sh_dnx_swstate_dnx_sch_config_dump_cmd, NULL, dnx_swstate_dnx_sch_config_dump_options, &dnx_swstate_dnx_sch_config_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_size_get_options, &dnx_swstate_dnx_sch_config_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_diagnostic_operation_counters_man}, {NULL} }; shr_error_e sh_dnx_swstate_dnx_sch_config_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint8 is_init; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); cosq_config.is_init(unit, &is_init); if (is_init) { SHR_IF_ERR_EXIT(cosq_config_dump(unit, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_dump_options[] = { {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_dump_man = { "swstate dnx_sch_config dump", "print the module's content", "swstate dnx_sch_config dump", "swstate dnx_sch_config dump nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~", 0); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_size_get_man = { "swstate dnx_sch_config size_get", "print the module's size", "swstate dnx_sch_config size_get", "swstate dnx_sch_config size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_diagnostic_operation_counters_man = { "swstate dnx_sch_config diagnostic_operation_counters", "print the module's diagnostic operation counters", "swstate dnx_sch_config diagnostic_operation_counters", "swstate dnx_sch_config diagnostic_operation_counters", }; sh_sand_man_t dnx_swstate_dnx_sch_config_man = { cmd_dnx_swstate_dnx_sch_config_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_desc[] = "swstate dnx_sch_config commands"; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_hr_group_bw_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_hr_group_bw_dump_cmd, NULL, dnx_swstate_dnx_sch_config_hr_group_bw_dump_options, &dnx_swstate_dnx_sch_config_hr_group_bw_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_hr_group_bw_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_hr_group_bw_size_get_options, &dnx_swstate_dnx_sch_config_hr_group_bw_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_hr_group_bw_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_hr_group_bw_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_hr_group_bw_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_hr_group_bw_man = { cmd_dnx_swstate_dnx_sch_config_hr_group_bw_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_hr_group_bw_desc[] = "cosq_config hr_group_bw commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_hr_group_bw_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int hr_group_bw_idx_0 = 0; int hr_group_bw_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("hr_group_bw_idx_0", hr_group_bw_idx_0); SH_SAND_GET_INT32("hr_group_bw_idx_1", hr_group_bw_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_hr_group_bw_dump(unit, hr_group_bw_idx_0, hr_group_bw_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_hr_group_bw_dump_options[] = { {"hr_group_bw_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"hr_group_bw_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_hr_group_bw_dump_man = { "swstate dump", "print the variable value", "cosq_config hr_group_bw dump [,hr_group_bw_idx_0=<int>,hr_group_bw_idx_1=<int>]\n", "cosq_config hr_group_bw dump hr_group_bw_idx_0=0 hr_group_bw_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_hr_group_bw_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~HR_GROUP_BW~", 0); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_hr_group_bw_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_hr_group_bw_size_get_man = { "swstate size_get", "print the variable size", "cosq_config hr_group_bw size_get", "cosq_config hr_group_bw size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_hr_group_bw_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~HR_GROUP_BW~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_hr_group_bw_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_hr_group_bw_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config hr_group_bw diagnostic_operation_counters", "cosq_config hr_group_bw diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_groups_bw_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_groups_bw_dump_cmd, NULL, dnx_swstate_dnx_sch_config_groups_bw_dump_options, &dnx_swstate_dnx_sch_config_groups_bw_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_groups_bw_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_groups_bw_size_get_options, &dnx_swstate_dnx_sch_config_groups_bw_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_groups_bw_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_groups_bw_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_groups_bw_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_groups_bw_man = { cmd_dnx_swstate_dnx_sch_config_groups_bw_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_groups_bw_desc[] = "cosq_config groups_bw commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_groups_bw_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int groups_bw_idx_0 = 0; int groups_bw_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("groups_bw_idx_0", groups_bw_idx_0); SH_SAND_GET_INT32("groups_bw_idx_1", groups_bw_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_groups_bw_dump(unit, groups_bw_idx_0, groups_bw_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_groups_bw_dump_options[] = { {"groups_bw_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"groups_bw_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_groups_bw_dump_man = { "swstate dump", "print the variable value", "cosq_config groups_bw dump [,groups_bw_idx_0=<int>,groups_bw_idx_1=<int>]\n", "cosq_config groups_bw dump groups_bw_idx_0=0 groups_bw_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_groups_bw_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~GROUPS_BW~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->groups_bw)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_groups_bw_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_groups_bw_size_get_man = { "swstate size_get", "print the variable size", "cosq_config groups_bw size_get", "cosq_config groups_bw size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_groups_bw_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~GROUPS_BW~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_groups_bw_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_groups_bw_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config groups_bw diagnostic_operation_counters", "cosq_config groups_bw diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_ipf_config_mode_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_ipf_config_mode_dump_cmd, NULL, dnx_swstate_dnx_sch_config_ipf_config_mode_dump_options, &dnx_swstate_dnx_sch_config_ipf_config_mode_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_ipf_config_mode_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_ipf_config_mode_size_get_options, &dnx_swstate_dnx_sch_config_ipf_config_mode_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_ipf_config_mode_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_ipf_config_mode_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_ipf_config_mode_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_ipf_config_mode_man = { cmd_dnx_swstate_dnx_sch_config_ipf_config_mode_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_ipf_config_mode_desc[] = "cosq_config ipf_config_mode commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_ipf_config_mode_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_ipf_config_mode_dump(unit, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_ipf_config_mode_dump_options[] = { {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_ipf_config_mode_dump_man = { "swstate dump", "print the variable value", "cosq_config ipf_config_mode dump []\n", "cosq_config ipf_config_mode dump nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_ipf_config_mode_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~IPF_CONFIG_MODE~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->ipf_config_mode)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_ipf_config_mode_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_ipf_config_mode_size_get_man = { "swstate size_get", "print the variable size", "cosq_config ipf_config_mode size_get", "cosq_config ipf_config_mode size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_ipf_config_mode_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~IPF_CONFIG_MODE~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_ipf_config_mode_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_ipf_config_mode_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config ipf_config_mode diagnostic_operation_counters", "cosq_config ipf_config_mode diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_flow_cmds[] = { {"credit_src", NULL, sh_dnx_swstate_dnx_sch_config_flow_credit_src_cmds, NULL, &dnx_swstate_dnx_sch_config_flow_credit_src_man}, {"dump", sh_dnx_swstate_dnx_sch_config_flow_dump_cmd, NULL, dnx_swstate_dnx_sch_config_flow_dump_options, &dnx_swstate_dnx_sch_config_flow_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_flow_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_flow_size_get_options, &dnx_swstate_dnx_sch_config_flow_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_flow_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_flow_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_flow_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_man = { cmd_dnx_swstate_dnx_sch_config_flow_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_flow_desc[] = "cosq_config flow commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int flow_idx_0 = 0; int flow_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("flow_idx_0", flow_idx_0); SH_SAND_GET_INT32("flow_idx_1", flow_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_flow_dump(unit, flow_idx_0, flow_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_dump_options[] = { {"flow_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"flow_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_dump_man = { "swstate dump", "print the variable value", "cosq_config flow dump [,flow_idx_0=<int>,flow_idx_1=<int>]\n", "cosq_config flow dump flow_idx_0=0 flow_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~", 0); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_size_get_man = { "swstate size_get", "print the variable size", "cosq_config flow size_get", "cosq_config flow size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config flow diagnostic_operation_counters", "cosq_config flow diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_flow_credit_src_cmds[] = { {"weight", NULL, sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_cmds, NULL, &dnx_swstate_dnx_sch_config_flow_credit_src_weight_man}, {"mode", NULL, sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_cmds, NULL, &dnx_swstate_dnx_sch_config_flow_credit_src_mode_man}, {"dump", sh_dnx_swstate_dnx_sch_config_flow_credit_src_dump_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_dump_options, &dnx_swstate_dnx_sch_config_flow_credit_src_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_flow_credit_src_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_size_get_options, &dnx_swstate_dnx_sch_config_flow_credit_src_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_flow_credit_src_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_flow_credit_src_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_man = { cmd_dnx_swstate_dnx_sch_config_flow_credit_src_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_flow_credit_src_desc[] = "cosq_config flow credit_src commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int flow_idx_0 = 0; int flow_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("flow_idx_0", flow_idx_0); SH_SAND_GET_INT32("flow_idx_1", flow_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_flow_credit_src_dump(unit, flow_idx_0, flow_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_dump_options[] = { {"flow_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"flow_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_dump_man = { "swstate dump", "print the variable value", "cosq_config flow credit_src dump [,flow_idx_0=<int>,flow_idx_1=<int>]\n", "cosq_config flow credit_src dump flow_idx_0=0 flow_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~CREDIT_SRC~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->flow[0][0].credit_src)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_size_get_man = { "swstate size_get", "print the variable size", "cosq_config flow credit_src size_get", "cosq_config flow credit_src size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~CREDIT_SRC~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config flow credit_src diagnostic_operation_counters", "cosq_config flow credit_src diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_dump_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_weight_dump_options, &dnx_swstate_dnx_sch_config_flow_credit_src_weight_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_weight_size_get_options, &dnx_swstate_dnx_sch_config_flow_credit_src_weight_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_weight_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_flow_credit_src_weight_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_man = { cmd_dnx_swstate_dnx_sch_config_flow_credit_src_weight_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_flow_credit_src_weight_desc[] = "cosq_config flow credit_src weight commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int flow_idx_0 = 0; int flow_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("flow_idx_0", flow_idx_0); SH_SAND_GET_INT32("flow_idx_1", flow_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_flow_credit_src_weight_dump(unit, flow_idx_0, flow_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_dump_options[] = { {"flow_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"flow_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_dump_man = { "swstate dump", "print the variable value", "cosq_config flow credit_src weight dump [,flow_idx_0=<int>,flow_idx_1=<int>]\n", "cosq_config flow credit_src weight dump flow_idx_0=0 flow_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~CREDIT_SRC~WEIGHT~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->flow[0][0].credit_src.weight)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_size_get_man = { "swstate size_get", "print the variable size", "cosq_config flow credit_src weight size_get", "cosq_config flow credit_src weight size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_weight_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~CREDIT_SRC~WEIGHT~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_weight_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config flow credit_src weight diagnostic_operation_counters", "cosq_config flow credit_src weight diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_dump_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_mode_dump_options, &dnx_swstate_dnx_sch_config_flow_credit_src_mode_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_mode_size_get_options, &dnx_swstate_dnx_sch_config_flow_credit_src_mode_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_flow_credit_src_mode_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_flow_credit_src_mode_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_man = { cmd_dnx_swstate_dnx_sch_config_flow_credit_src_mode_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_flow_credit_src_mode_desc[] = "cosq_config flow credit_src mode commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int flow_idx_0 = 0; int flow_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("flow_idx_0", flow_idx_0); SH_SAND_GET_INT32("flow_idx_1", flow_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_flow_credit_src_mode_dump(unit, flow_idx_0, flow_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_dump_options[] = { {"flow_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"flow_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_dump_man = { "swstate dump", "print the variable value", "cosq_config flow credit_src mode dump [,flow_idx_0=<int>,flow_idx_1=<int>]\n", "cosq_config flow credit_src mode dump flow_idx_0=0 flow_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~CREDIT_SRC~MODE~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->flow[0][0].credit_src.mode)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_size_get_man = { "swstate size_get", "print the variable size", "cosq_config flow credit_src mode size_get", "cosq_config flow credit_src mode size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_flow_credit_src_mode_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~FLOW~CREDIT_SRC~MODE~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_flow_credit_src_mode_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config flow credit_src mode diagnostic_operation_counters", "cosq_config flow credit_src mode diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_connector_cmds[] = { {"num_cos", NULL, sh_dnx_swstate_dnx_sch_config_connector_num_cos_cmds, NULL, &dnx_swstate_dnx_sch_config_connector_num_cos_man}, {"connection_valid", NULL, sh_dnx_swstate_dnx_sch_config_connector_connection_valid_cmds, NULL, &dnx_swstate_dnx_sch_config_connector_connection_valid_man}, {"src_modid", NULL, sh_dnx_swstate_dnx_sch_config_connector_src_modid_cmds, NULL, &dnx_swstate_dnx_sch_config_connector_src_modid_man}, {"dump", sh_dnx_swstate_dnx_sch_config_connector_dump_cmd, NULL, dnx_swstate_dnx_sch_config_connector_dump_options, &dnx_swstate_dnx_sch_config_connector_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_connector_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_connector_size_get_options, &dnx_swstate_dnx_sch_config_connector_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_connector_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_connector_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_connector_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_man = { cmd_dnx_swstate_dnx_sch_config_connector_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_connector_desc[] = "cosq_config connector commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int connector_idx_0 = 0; int connector_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("connector_idx_0", connector_idx_0); SH_SAND_GET_INT32("connector_idx_1", connector_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_connector_dump(unit, connector_idx_0, connector_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_dump_options[] = { {"connector_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"connector_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_dump_man = { "swstate dump", "print the variable value", "cosq_config connector dump [,connector_idx_0=<int>,connector_idx_1=<int>]\n", "cosq_config connector dump connector_idx_0=0 connector_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~", 0); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_size_get_man = { "swstate size_get", "print the variable size", "cosq_config connector size_get", "cosq_config connector size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config connector diagnostic_operation_counters", "cosq_config connector diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_connector_num_cos_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_connector_num_cos_dump_cmd, NULL, dnx_swstate_dnx_sch_config_connector_num_cos_dump_options, &dnx_swstate_dnx_sch_config_connector_num_cos_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_connector_num_cos_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_connector_num_cos_size_get_options, &dnx_swstate_dnx_sch_config_connector_num_cos_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_connector_num_cos_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_connector_num_cos_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_connector_num_cos_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_num_cos_man = { cmd_dnx_swstate_dnx_sch_config_connector_num_cos_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_connector_num_cos_desc[] = "cosq_config connector num_cos commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_num_cos_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int connector_idx_0 = 0; int connector_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("connector_idx_0", connector_idx_0); SH_SAND_GET_INT32("connector_idx_1", connector_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_connector_num_cos_dump(unit, connector_idx_0, connector_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_num_cos_dump_options[] = { {"connector_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"connector_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_num_cos_dump_man = { "swstate dump", "print the variable value", "cosq_config connector num_cos dump [,connector_idx_0=<int>,connector_idx_1=<int>]\n", "cosq_config connector num_cos dump connector_idx_0=0 connector_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_num_cos_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~NUM_COS~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->connector[0][0].num_cos)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_num_cos_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_num_cos_size_get_man = { "swstate size_get", "print the variable size", "cosq_config connector num_cos size_get", "cosq_config connector num_cos size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_num_cos_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~NUM_COS~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_num_cos_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_num_cos_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config connector num_cos diagnostic_operation_counters", "cosq_config connector num_cos diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_connector_connection_valid_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_connector_connection_valid_dump_cmd, NULL, dnx_swstate_dnx_sch_config_connector_connection_valid_dump_options, &dnx_swstate_dnx_sch_config_connector_connection_valid_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_connector_connection_valid_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_connector_connection_valid_size_get_options, &dnx_swstate_dnx_sch_config_connector_connection_valid_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_connector_connection_valid_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_connector_connection_valid_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_connector_connection_valid_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_connection_valid_man = { cmd_dnx_swstate_dnx_sch_config_connector_connection_valid_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_connector_connection_valid_desc[] = "cosq_config connector connection_valid commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_connection_valid_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int connector_idx_0 = 0; int connector_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("connector_idx_0", connector_idx_0); SH_SAND_GET_INT32("connector_idx_1", connector_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_connector_connection_valid_dump(unit, connector_idx_0, connector_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_connection_valid_dump_options[] = { {"connector_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"connector_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_connection_valid_dump_man = { "swstate dump", "print the variable value", "cosq_config connector connection_valid dump [,connector_idx_0=<int>,connector_idx_1=<int>]\n", "cosq_config connector connection_valid dump connector_idx_0=0 connector_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_connection_valid_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~CONNECTION_VALID~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->connector[0][0].connection_valid)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_connection_valid_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_connection_valid_size_get_man = { "swstate size_get", "print the variable size", "cosq_config connector connection_valid size_get", "cosq_config connector connection_valid size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_connection_valid_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~CONNECTION_VALID~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_connection_valid_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_connection_valid_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config connector connection_valid diagnostic_operation_counters", "cosq_config connector connection_valid diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_connector_src_modid_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_connector_src_modid_dump_cmd, NULL, dnx_swstate_dnx_sch_config_connector_src_modid_dump_options, &dnx_swstate_dnx_sch_config_connector_src_modid_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_connector_src_modid_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_connector_src_modid_size_get_options, &dnx_swstate_dnx_sch_config_connector_src_modid_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_connector_src_modid_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_connector_src_modid_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_connector_src_modid_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_src_modid_man = { cmd_dnx_swstate_dnx_sch_config_connector_src_modid_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_connector_src_modid_desc[] = "cosq_config connector src_modid commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_src_modid_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int connector_idx_0 = 0; int connector_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("connector_idx_0", connector_idx_0); SH_SAND_GET_INT32("connector_idx_1", connector_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_connector_src_modid_dump(unit, connector_idx_0, connector_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_src_modid_dump_options[] = { {"connector_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"connector_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_src_modid_dump_man = { "swstate dump", "print the variable value", "cosq_config connector src_modid dump [,connector_idx_0=<int>,connector_idx_1=<int>]\n", "cosq_config connector src_modid dump connector_idx_0=0 connector_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_src_modid_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~SRC_MODID~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->connector[0][0].src_modid)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_src_modid_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_src_modid_size_get_man = { "swstate size_get", "print the variable size", "cosq_config connector src_modid size_get", "cosq_config connector src_modid size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_connector_src_modid_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~CONNECTOR~SRC_MODID~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_connector_src_modid_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_connector_src_modid_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config connector src_modid diagnostic_operation_counters", "cosq_config connector src_modid diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_se_cmds[] = { {"child_count", NULL, sh_dnx_swstate_dnx_sch_config_se_child_count_cmds, NULL, &dnx_swstate_dnx_sch_config_se_child_count_man}, {"dump", sh_dnx_swstate_dnx_sch_config_se_dump_cmd, NULL, dnx_swstate_dnx_sch_config_se_dump_options, &dnx_swstate_dnx_sch_config_se_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_se_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_se_size_get_options, &dnx_swstate_dnx_sch_config_se_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_se_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_se_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_se_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_man = { cmd_dnx_swstate_dnx_sch_config_se_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_se_desc[] = "cosq_config se commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_se_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int se_idx_0 = 0; int se_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("se_idx_0", se_idx_0); SH_SAND_GET_INT32("se_idx_1", se_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_se_dump(unit, se_idx_0, se_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_se_dump_options[] = { {"se_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"se_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_dump_man = { "swstate dump", "print the variable value", "cosq_config se dump [,se_idx_0=<int>,se_idx_1=<int>]\n", "cosq_config se dump se_idx_0=0 se_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_se_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~SE~", 0); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_se_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_size_get_man = { "swstate size_get", "print the variable size", "cosq_config se size_get", "cosq_config se size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_se_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~SE~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_se_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config se diagnostic_operation_counters", "cosq_config se diagnostic_operation_counters", }; sh_sand_cmd_t sh_dnx_swstate_dnx_sch_config_se_child_count_cmds[] = { {"dump", sh_dnx_swstate_dnx_sch_config_se_child_count_dump_cmd, NULL, dnx_swstate_dnx_sch_config_se_child_count_dump_options, &dnx_swstate_dnx_sch_config_se_child_count_dump_man}, {"size_get", sh_dnx_swstate_dnx_sch_config_se_child_count_size_get_cmd, NULL, dnx_swstate_dnx_sch_config_se_child_count_size_get_options, &dnx_swstate_dnx_sch_config_se_child_count_size_get_man}, {"diagnostic_operation_counters", sh_dnx_swstate_dnx_sch_config_se_child_count_diagnostic_operation_counters_cmd, NULL, dnx_swstate_dnx_sch_config_se_child_count_diagnostic_operation_counters_options, &dnx_swstate_dnx_sch_config_se_child_count_diagnostic_operation_counters_man}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_child_count_man = { cmd_dnx_swstate_dnx_sch_config_se_child_count_desc, NULL, NULL, NULL, }; const char cmd_dnx_swstate_dnx_sch_config_se_child_count_desc[] = "cosq_config se child_count commands"; shr_error_e sh_dnx_swstate_dnx_sch_config_se_child_count_dump_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { int se_idx_0 = 0; int se_idx_1 = 0; dnx_sw_state_dump_filters_t filters; SHR_FUNC_INIT_VARS(unit); SH_SAND_GET_INT32("se_idx_0", se_idx_0); SH_SAND_GET_INT32("se_idx_1", se_idx_1); SH_SAND_GET_BOOL("nocontent", filters.nocontent); SH_SAND_GET_STR("typefilter", filters.typefilter); SH_SAND_GET_STR("namefilter", filters.namefilter); SHR_IF_ERR_EXIT(cosq_config_se_child_count_dump(unit, se_idx_0, se_idx_1, filters)); if (!filters.nocontent) { dnx_sw_state_dump_detach_file(unit); } SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_se_child_count_dump_options[] = { {"se_idx_0", SAL_FIELD_TYPE_INT32, "index", NULL}, {"se_idx_1", SAL_FIELD_TYPE_INT32, "index", NULL}, {"nocontent", SAL_FIELD_TYPE_BOOL, "Decision if to perform content dump or to print the access tree.", "false"}, {"typefilter", SAL_FIELD_TYPE_STR, "Filter for the variable type.", ""}, {"namefilter", SAL_FIELD_TYPE_STR, "Filter for the variable name.", ""}, {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_child_count_dump_man = { "swstate dump", "print the variable value", "cosq_config se child_count dump [,se_idx_0=<int>,se_idx_1=<int>]\n", "cosq_config se child_count dump se_idx_0=0 se_idx_1=0 nocontent=false typefilter="" namefilter="" ", }; shr_error_e sh_dnx_swstate_dnx_sch_config_se_child_count_size_get_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { uint32 size = 0; SHR_FUNC_INIT_VARS(unit); size = dnx_sw_state_info_size_get(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~SE~CHILD_COUNT~", sizeof(((dnx_sch_config_t*)sw_state_roots_array[unit][DNX_SCH_CONFIG_MODULE_ID])->se[0][0].child_count)); dnx_sw_state_size_print(size); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_se_child_count_size_get_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_child_count_size_get_man = { "swstate size_get", "print the variable size", "cosq_config se child_count size_get", "cosq_config se child_count size_get", }; shr_error_e sh_dnx_swstate_dnx_sch_config_se_child_count_diagnostic_operation_counters_cmd(int unit, args_t *args, sh_sand_control_t *sand_control) { SHR_FUNC_INIT_VARS(unit); dnx_sw_state_diagnostic_operation_counters_print(cosq_config_info[unit], cosq_config_layout_str, COSQ_CONFIG_INFO_NOF_ENTRIES, "COSQ_CONFIG~SE~CHILD_COUNT~"); SHR_EXIT(); exit: SHR_FUNC_EXIT; } sh_sand_option_t dnx_swstate_dnx_sch_config_se_child_count_diagnostic_operation_counters_options[] = { {NULL} }; sh_sand_man_t dnx_swstate_dnx_sch_config_se_child_count_diagnostic_operation_counters_man = { "swstate diagnostic_operation_counters", "print the diagnostic operation counters", "cosq_config se child_count diagnostic_operation_counters", "cosq_config se child_count diagnostic_operation_counters", }; #endif /* DNX_SW_STATE_DIAGNOSTIC */ #undef BSL_LOG_MODULE
34.100892
319
0.791686
4572fff7cab24b2ba134ae55bb5452e43ba2b5b8
475
h
C
DateTime/PluginSystemTime.h
Haojia521/TrafficMonitorPlugins
80a7c17c4f55f1e115a5122c2305c79bc334d766
[ "MIT" ]
null
null
null
DateTime/PluginSystemTime.h
Haojia521/TrafficMonitorPlugins
80a7c17c4f55f1e115a5122c2305c79bc334d766
[ "MIT" ]
null
null
null
DateTime/PluginSystemTime.h
Haojia521/TrafficMonitorPlugins
80a7c17c4f55f1e115a5122c2305c79bc334d766
[ "MIT" ]
null
null
null
#pragma once #include "PluginInterface.h" class CPluginSystemTime : public IPluginItem { public: CPluginSystemTime(); public: // 通过 IPluginItem 继承 virtual const wchar_t* GetItemName() const override; virtual const wchar_t* GetItemId() const override; virtual const wchar_t* GetItemLableText() const override; virtual const wchar_t* GetItemValueText() const override; virtual const wchar_t* GetItemValueSampleText() const override; private: };
25
67
0.751579
ca337953d955f77b0696adc26a395a389d80eb61
1,879
h
C
src/inspector/inspector_socket.h
mganandraj/v8-jsi
aff826a5567a4fd0fd66b3f3af1187400a666fa9
[ "MIT" ]
null
null
null
src/inspector/inspector_socket.h
mganandraj/v8-jsi
aff826a5567a4fd0fd66b3f3af1187400a666fa9
[ "MIT" ]
null
null
null
src/inspector/inspector_socket.h
mganandraj/v8-jsi
aff826a5567a4fd0fd66b3f3af1187400a666fa9
[ "MIT" ]
null
null
null
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. // This code is based on the old node inspector implementation. See LICENSE_NODE for Node.js' project license details #pragma once #include <string> #include <vector> #include "inspector_tcp.h" template <typename T, void(*function)(T*)> struct FunctionDeleter { void operator()(T* pointer) const { function(pointer); } typedef std::unique_ptr<T, FunctionDeleter> Pointer; }; template <typename T, void(*function)(T*)> using DeleteFnPtr = typename FunctionDeleter<T, function>::Pointer; namespace inspector { class ProtocolHandler; // HTTP Wrapper around a uv_tcp_t class InspectorSocket { public: class Delegate { public: virtual void OnHttpGet(const std::string& host, const std::string& path) = 0; virtual void OnSocketUpgrade(const std::string& host, const std::string& path, const std::string& accept_key) = 0; virtual void OnWsFrame(const std::vector<char>& frame) = 0; virtual ~Delegate() {} }; using DelegatePointer = std::unique_ptr<Delegate>; using Pointer = std::unique_ptr<InspectorSocket>; static Pointer Accept(std::shared_ptr<tcp_connection> connection, DelegatePointer delegate); ~InspectorSocket(); void AcceptUpgrade(const std::string& accept_key); void CancelHandshake(); void Write(const char* data, size_t len); void SwitchProtocol(ProtocolHandler* handler); std::string GetHost(); private: static void Shutdown(ProtocolHandler*); InspectorSocket() = default; DeleteFnPtr<ProtocolHandler, Shutdown> protocol_handler_; InspectorSocket(const InspectorSocket&) = delete; InspectorSocket& operator=(const InspectorSocket&) = delete; }; } // namespace inspector
30.306452
118
0.682278
2c4511336bc94669735c0135dd3e6b60d1e41612
16,657
h
C
enduser/zone_internetgames/src/client/shell/winfrx/dibfrx.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
enduser/zone_internetgames/src/client/shell/winfrx/dibfrx.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
enduser/zone_internetgames/src/client/shell/winfrx/dibfrx.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
#ifndef __FRX_DIB_H__ #define __FRX_DIB_H__ #include <windows.h> #include "ResourceManager.h" #include "tchar.h" #include "palfrx.h" #include "debugfrx.h" namespace FRX { // WARNING: since Dib Sections are not true devices, Windows does not know // when to flush the GDI buffer of actions taken against the Section's DC. So // if you do call GDI functions on a Dib Section, you must call GdiFlush() // before blitting to the Section. Otherwise the operations may be performed // in the wrong order. // Copy source dib into destination dib while clipping to destination. void DibBlt( BYTE* pDstBits, long DstPitch, long DstHeight, BYTE* pSrcBits, long SrcPitch, long SrcHeight, long depth, long dx, long dy, long sx, long sy, long width, long height, BOOL bFlipRTL = FALSE); // Copy source dib into destination dib with transparency while clipping // to destination. void DibTBlt( BYTE* pDstBits, long DstPitch, long DstHeight, BYTE* pSrcBits, long SrcPitch, long SrcHeight, long depth, long dx, long dy, long sx, long sy, long width, long height, BYTE* TransIdx ); // Rectangle fill of destination dib void DibFill( BYTE* pDstBits, long DstPitch, long DstHeight, long depth, long dx, long dy, long width, long height, BYTE ColorIdx ); // WIDTHBYTES performs DWORD-aligning of DIB scanlines. The "bits" // parameter is the bit count for the scanline (biWidth * biBitCount), // and this function returns the number of DWORD-aligned bytes needed // to hold those bits. inline long WidthBytes( long bits ) { return (((bits + 31) & ~31) >> 3); } /////////////////////////////////////////////////////////////////////////////// // Macros /////////////////////////////////////////////////////////////////////////////// // Draw prototypes only differ by class types, so this macro simplifies // the declaring the function protoypes. #define DrawFunctionPrototypes( DstClass ) \ void Draw( DstClass& dest, long x, long y, BOOL bFlipRTL = FALSE ); \ void Draw( DstClass& dest, long dx, long dy, long sx, long sy, long width, long height ); \ void Draw( DstClass& dest, long dx, long dy, const RECT* rc ); \ void DrawT( DstClass& dest, long x, long y ); \ void DrawT( DstClass& dest, long dx, long dy, long sx, long sy, long width, long height ); \ void DrawT( DstClass& dest, long dx, long dy, const RECT* rc ); // Draw implementations only differ by class types, so this macro simplifies // the defining the inline functions. #define DrawFunctionImpl(SrcClass, DstClass) \ inline void SrcClass::Draw( DstClass& dest, long x, long y, BOOL bFlipRTL ) \ { \ if(GetDepth() != dest.GetDepth()) \ return; \ DibBlt( \ dest.GetBits(), dest.GetPitch(), dest.GetHeight(), \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ x, y, \ 0, 0, \ GetWidth(), GetHeight(), bFlipRTL ); \ } \ inline void SrcClass::Draw( DstClass& dest, long dx, long dy, long sx, long sy, long width, long height ) \ { \ if(GetDepth() != dest.GetDepth()) \ return; \ DibBlt( \ dest.GetBits(), dest.GetPitch(), dest.GetHeight(), \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ dx, dy, \ sx, sy, \ width, height ); \ } \ inline void SrcClass::Draw( DstClass& dest, long dx, long dy, const RECT* rc ) \ { \ if(GetDepth() != dest.GetDepth()) \ return; \ DibBlt( \ dest.GetBits(), dest.GetPitch(), dest.GetHeight(), \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ dx, dy, \ rc->left, rc->top, \ rc->right - rc->left + 1, rc->bottom - rc->top + 1 ); \ } \ inline void SrcClass::DrawT( DstClass& dest, long x, long y ) \ { \ if(GetDepth() != dest.GetDepth()) \ return; \ DibTBlt( \ dest.GetBits(), dest.GetPitch(), dest.GetHeight(), \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ x, y, \ 0, 0, \ GetWidth(), GetHeight(), \ m_arbTransIdx ); \ } \ inline void SrcClass::DrawT( DstClass& dest, long dx, long dy, long sx, long sy, long width, long height ) \ { \ if(GetDepth() != dest.GetDepth()) \ return; \ DibTBlt( \ dest.GetBits(), dest.GetPitch(), dest.GetHeight(), \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ dx, dy, \ sx, sy, \ width, height, \ m_arbTransIdx ); \ } \ inline void SrcClass::DrawT( DstClass& dest, long dx, long dy, const RECT* rc ) \ { \ if(GetDepth() != dest.GetDepth()) \ return; \ DibTBlt( \ dest.GetBits(), dest.GetPitch(), dest.GetHeight(), \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ dx, dy, \ rc->left, rc->top, \ rc->right - rc->left + 1, rc->bottom - rc->top + 1, \ m_arbTransIdx ); \ } // Fill prototypes only differ by class types, so this macro simplifies // the declaring the function protoypes. #define FillFunctionPrototypes(DstClass) \ void Fill( BYTE idx ); \ void Fill( long dx, long dy, long width, long height, BYTE idx ); \ void Fill( const RECT* rc, BYTE idx ); // Fill implementations only differ by class types, so this macro simplifies // the defining the inline functions. #define FillFunctionImpl(DstClass) \ inline void DstClass::Fill( BYTE idx ) \ { \ FillMemory( GetBits(), (DWORD) GetPitch() * GetHeight(), idx ); \ } \ inline void DstClass::Fill( long dx, long dy, long width, long height, BYTE idx ) \ { \ DibFill( \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ dx, dy, \ width, height, \ idx ); \ } \ inline void DstClass::Fill( const RECT* rc, BYTE idx ) \ { \ DibFill( \ GetBits(), GetPitch(), GetHeight(), GetDepth(), \ rc->left, rc->top, \ rc->right - rc->left + 1, rc->bottom - rc->top + 1, \ idx ); \ } // Reference count implementation only differs by class type, so this macro // simplifies defining the inline functions. #define DibRefCntFunctionImpl(DstClass) \ inline ULONG DstClass::AddRef() \ { \ return ++m_RefCnt; \ } \ inline ULONG DstClass::Release() \ { \ WNDFRX_ASSERT( m_RefCnt > 0 ); \ if ( --m_RefCnt <= 0 ) \ { \ delete this; \ return 0; \ } \ return m_RefCnt; \ } /////////////////////////////////////////////////////////////////////////////// // Dib related structures /////////////////////////////////////////////////////////////////////////////// struct FULLBITMAPINFO { BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[256]; }; /////////////////////////////////////////////////////////////////////////////// // Forward references /////////////////////////////////////////////////////////////////////////////// class CDibLite; class CDibSection; /////////////////////////////////////////////////////////////////////////////// // Dib classes /////////////////////////////////////////////////////////////////////////////// class CDib { public: // Constructor and destructor CDib(); ~CDib(); // Reference count ULONG AddRef(); ULONG Release(); HRESULT Load( IResourceManager* pResourceManager, int nResourceId ); // Load bitmap from resource HRESULT Load( HINSTANCE hInstance, int nResourceId ); // Load bitmap from resource HRESULT Load( HINSTANCE hInstance, const TCHAR* szName ); // Load bitmap from file HRESULT Load( const TCHAR* FileName ); // Remap to palette HRESULT RemapToPalette( CPalette& palette, BOOL bUseIndex = FALSE ); // Get dimensions long GetWidth() { return m_pBMI->bmiHeader.biWidth; } long GetHeight() { return m_pBMI->bmiHeader.biHeight; } // Transparency void SetTransparencyIndex( const BYTE* idx ) { if(idx){ CopyMemory(m_arbTransIdx, idx, (GetDepth() + 7) / 8); m_fTransIdx = true; }else m_fTransIdx = false; } BYTE* GetTransparencyIndex() { return m_fTransIdx ? m_arbTransIdx : NULL; } // Get raw data BITMAPINFO* GetBitmapInfo() { return (BITMAPINFO*) m_pBMI; } BYTE* GetBits() { return m_pBits; } long GetPitch() { return m_lPitch; } long GetDepth() { return m_pBMI->bmiHeader.biBitCount; } // Display functions void Draw( HDC dc, long x, long y ); void Draw( HDC dc, long dx, long dy, long sx, long sy, long width, long height ); void Draw( HDC dc, long dx, long dy, const RECT* rc ); FillFunctionPrototypes( CDib ); DrawFunctionPrototypes( CDib ); DrawFunctionPrototypes( CDibLite ); DrawFunctionPrototypes( CDibSection ); protected: // member variables FULLBITMAPINFO* m_pBMI; BYTE* m_pBits; UINT m_iColorTableUsage; long m_lPitch; BYTE m_arbTransIdx[16]; // only (GetDepth() + 7) / 8 bytes are used bool m_fTransIdx; // reference count ULONG m_RefCnt; // helper functions void DeleteBitmap(); HRESULT Load( HBITMAP hbm ); }; class CDibSection { public: // Constructor and destructor CDibSection(); ~CDibSection(); // Reference count ULONG AddRef(); ULONG Release(); // Create bitmap HRESULT Create( long width, long height, CPalette& palette, long depth = 8 ); HRESULT Create( const RECT* rc, CPalette& palette, long depth = 8 ); // Load bitmap from resource (results in read only dib) HRESULT Load( HINSTANCE hInstance, int nResourceId ); // Set ColorTable to the palette HRESULT SetColorTable( CPalette& palette ); // Get dimensions long GetWidth() { return m_DS.dsBmih.biWidth; } long GetHeight() { return m_DS.dsBmih.biHeight; } // Transparency void SetTransparencyIndex( const BYTE* idx ) { if(idx){ CopyMemory(m_arbTransIdx, idx, (GetDepth() + 7) / 8); m_fTransIdx = true; }else m_fTransIdx = false; } BYTE* GetTransparencyIndex() { return m_fTransIdx ? m_arbTransIdx : NULL; } // Get raw data HBITMAP GetHandle() { return m_hBmp; } BYTE* GetBits() { return m_pBits; } HDC GetDC() { return m_hDC; } long GetPitch() { return m_lPitch; } long GetDepth() { return m_DS.dsBmih.biBitCount; } // Display functions void Draw( HDC dc, long x, long y ); void Draw( HDC dc, long dx, long dy, long sx, long sy, long width, long height ); void Draw( HDC dc, long dx, long dy, const RECT* rc ); FillFunctionPrototypes( CDibSection ); DrawFunctionPrototypes( CDib ); DrawFunctionPrototypes( CDibLite ); DrawFunctionPrototypes( CDibSection ); protected: // bitmap information BYTE* m_pBits; HBITMAP m_hBmp; DIBSECTION m_DS; long m_lPitch; BYTE m_arbTransIdx[16]; // only (GetDepth() + 7) / 8 bytes are used bool m_fTransIdx; // reference coun ULONG m_RefCnt; // DC information HDC m_hDC; HBITMAP m_hOldBmp; HPALETTE m_hOldPalette; // helper functions void DeleteBitmap(); }; class CDibLite { public: // Constructor and destructor CDibLite(); ~CDibLite(); // Reference count ULONG AddRef(); ULONG Release(); // Create bitmap HRESULT Create( long width, long height, long depth = 8 ); HRESULT Create( const RECT* rc, long depth = 8 ); HRESULT Load( IResourceManager* m_pResourceManager, int nResourceId ); // Load bitmap from resource HRESULT Load( HINSTANCE hInstance, int nResourceId ); // Remap to palette HRESULT RemapToPalette( CPalette& palette, RGBQUAD* dibColors ); // Get dimensions long GetWidth() { return m_pBMH->biWidth; } long GetHeight() { return m_pBMH->biHeight; } // Transparency void SetTransparencyIndex( const BYTE* idx ) { if(idx){ CopyMemory(m_arbTransIdx, idx, (GetDepth() + 7) / 8); m_fTransIdx = true; }else m_fTransIdx = false; } BYTE* GetTransparencyIndex() { return m_fTransIdx ? m_arbTransIdx : NULL; } // Get raw data BITMAPINFOHEADER* GetBitmapInfoHeader() { return m_pBMH; } BYTE* GetBits() { return m_pBits; } long GetPitch() { return m_lPitch; } long GetDepth() { return m_pBMH->biBitCount; } // Display functions FillFunctionPrototypes( CDibLite ); DrawFunctionPrototypes( CDib ); DrawFunctionPrototypes( CDibLite ); DrawFunctionPrototypes( CDibSection ); protected: // member variables BITMAPINFOHEADER* m_pBMH; BYTE* m_pBits; long m_lPitch; BYTE m_arbTransIdx[16]; // only (GetDepth() + 7) / 8 bytes are used bool m_fTransIdx; // reference count ULONG m_RefCnt; // helper functions void DeleteBitmap(); }; /////////////////////////////////////////////////////////////////////////////// // CDib Inline Functions /////////////////////////////////////////////////////////////////////////////// inline void CDib::Draw( HDC dc, long x, long y ) { long width = GetWidth(); long height = GetHeight(); StretchDIBits( dc, x, y, width, height, 0, 0, width, height, GetBits(), GetBitmapInfo(), m_iColorTableUsage, SRCCOPY ); } inline void CDib::Draw( HDC dc, long dx, long dy, long sx, long sy, long width, long height ) { StretchDIBits( dc, dx, dy, width, height, sx, GetHeight() - (sy + height), width, height, GetBits(), GetBitmapInfo(), m_iColorTableUsage, SRCCOPY ); } inline void CDib::Draw( HDC dc, long dx, long dy, const RECT* rc ) { long width = rc->right - rc->left + 1; long height = rc->bottom - rc->top + 1; StretchDIBits( dc, dx, dy, width, height, rc->left, GetHeight() - (rc->top + height), width, height, GetBits(), GetBitmapInfo(), m_iColorTableUsage, SRCCOPY ); } DibRefCntFunctionImpl( CDib ); FillFunctionImpl( CDib ); DrawFunctionImpl( CDib, CDib ); DrawFunctionImpl( CDib, CDibLite ); DrawFunctionImpl( CDib, CDibSection ); #define NOMIRRORBITMAP 0x80000000 /////////////////////////////////////////////////////////////////////////////// // CDibSection Inline Functions /////////////////////////////////////////////////////////////////////////////// inline HRESULT CDibSection::Create( const RECT* rc, CPalette& palette, long depth ) { return Create( rc->right - rc->left + 1, rc->bottom - rc->top + 1, palette, depth ); } inline void CDibSection::Draw( HDC dc, long x, long y ) { BitBlt( dc, x, y, GetWidth(), GetHeight(), m_hDC, 0, 0, SRCCOPY ); } inline void CDibSection::Draw( HDC dc, long dx, long dy, long sx, long sy, long width, long height ) { BitBlt( dc, dx, dy, width, height, m_hDC, sx, sy, SRCCOPY ); } inline void CDibSection::Draw( HDC dc, long dx, long dy, const RECT* rc ) { BitBlt( dc, dx, dy, rc->right - rc->left + 1, rc->bottom - rc->top + 1, m_hDC, rc->left, rc->top, SRCCOPY ); } DibRefCntFunctionImpl( CDibSection ); FillFunctionImpl( CDibSection ); DrawFunctionImpl( CDibSection, CDib ); DrawFunctionImpl( CDibSection, CDibLite ); DrawFunctionImpl( CDibSection, CDibSection ); /////////////////////////////////////////////////////////////////////////////// // CDibLite Inline Functions /////////////////////////////////////////////////////////////////////////////// inline HRESULT CDibLite::Create( const RECT* rc, long depth ) { return Create( rc->right - rc->left + 1, rc->bottom - rc->top + 1, depth ); } DibRefCntFunctionImpl( CDibLite ); FillFunctionImpl( CDibLite ); DrawFunctionImpl( CDibLite, CDib ); DrawFunctionImpl( CDibLite, CDibLite ); DrawFunctionImpl( CDibLite, CDibSection ); } using namespace FRX; #endif //!__FRX_DIB_H__
31.848948
160
0.554842
2c55ef859e46270d6381f5122f2d9f391716b273
555
h
C
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/c/tz_png_io.h
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2021-12-27T19:14:03.000Z
2021-12-27T19:14:03.000Z
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/c/tz_png_io.h
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2016-12-03T05:33:13.000Z
2016-12-03T05:33:13.000Z
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/c/tz_png_io.h
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
null
null
null
/**@file tz_png_io.h * @author Ting Zhao * @date 03-Jul-2012 */ #ifndef _TZ_PNG_IO_H_ #define _TZ_PNG_IO_H_ #include "tz_cdefs.h" #include "tz_image_lib_defs.h" __BEGIN_DECLS #if defined(HAVE_LIBPNG) #include <png.h> #else typedef int png_info; typedef void* png_infop; #endif Stack* Read_Png(const char *file_path); Mc_Stack* Read_Png_M(const char *file_path); png_infop Read_Png_Info(const char *file_path); BOOL Is_Png(const char *file_path); void Png_Attribute(const char *file_path, int *kind, int *width, int *height); __END_DECLS #endif
17.903226
78
0.758559
c8b2c68c21485bb8cfe486b9bba6fad5136d453c
912
c
C
xinu/lib/ctype_.c
rrjha/dosp
21f3624abfec815434007f76504488896a091f6d
[ "BSD-3-Clause" ]
null
null
null
xinu/lib/ctype_.c
rrjha/dosp
21f3624abfec815434007f76504488896a091f6d
[ "BSD-3-Clause" ]
1
2017-06-14T23:36:20.000Z
2017-06-14T23:36:29.000Z
xinu/lib/ctype_.c
rrjha/dosp
21f3624abfec815434007f76504488896a091f6d
[ "BSD-3-Clause" ]
null
null
null
/* ctype_.c - _ctype_ */ #include <ctype.h> /*------------------------------------------------------------------------ * _ctype_ - Provides _ctype_. *------------------------------------------------------------------------ */ const char _ctype_[] = { 0, _C, _C, _C, _C, _C, _C, _C, _C, _C, _S, _S, _S, _S, _S, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _S, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _N, _N, _N, _N, _N, _N, _N, _N, _N, _N, _P, _P, _P, _P, _P, _P, _P, _U | _X, _U | _X, _U | _X, _U | _X, _U | _X, _U | _X, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _P, _P, _P, _P, _P, _P, _L | _X, _L | _X, _L | _X, _L | _X, _L | _X, _L | _X, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _P, _P, _P, _P, _C };
30.4
74
0.379386
bdbb3802f6991d2403952b7ff15cdd89a724d7d4
599
c
C
05_Inter_Process_Communication/exercises/signal-wait.c
StoyanovBG/LinuxSystemProgramming
50e1a8c8103510942c651fcb5241977b1f270533
[ "MIT" ]
7
2020-03-19T09:21:15.000Z
2022-03-29T19:43:03.000Z
05_Inter_Process_Communication/exercises/signal-wait.c
StoyanovBG/LinuxSystemProgramming
50e1a8c8103510942c651fcb5241977b1f270533
[ "MIT" ]
null
null
null
05_Inter_Process_Communication/exercises/signal-wait.c
StoyanovBG/LinuxSystemProgramming
50e1a8c8103510942c651fcb5241977b1f270533
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <unistd.h> // Main program int main(int argc, char ** argv) { // Signal Structure Initialization int sig; struct sigaction sa; sigset_t newset; sigemptyset(&newset); sigaddset(&newset, SIGINT); // Ctr + C sigprocmask(SIG_BLOCK, &newset, 0); sigaction(SIGTERM, &sa, 0); // Print printf("My pid is %i\n", getpid()); printf("Waiting...\n"); // Forever while(!sigwait(&newset, &sig)) { printf("SIGINT recieved\n"); return EXIT_SUCCESS; // 0 } return EXIT_FAILURE; // -1 }
19.322581
41
0.616027
ec701303aef205c090b74ba2db11c83ac3a77517
15,745
h
C
Include/10.0.17134.0/cppwinrt/winrt/Windows.ApplicationModel.DataTransfer.ShareTarget.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
5
2020-05-29T06:22:17.000Z
2021-11-28T08:21:38.000Z
Include/10.0.17134.0/cppwinrt/winrt/Windows.ApplicationModel.DataTransfer.ShareTarget.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
null
null
null
Include/10.0.17134.0/cppwinrt/winrt/Windows.ApplicationModel.DataTransfer.ShareTarget.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
5
2020-05-30T04:15:11.000Z
2021-11-28T08:48:56.000Z
// C++/WinRT v1.0.180227.3 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #include "winrt/base.h" WINRT_WARNING_PUSH #include "winrt/Windows.Foundation.h" #include "winrt/Windows.Foundation.Collections.h" #include "winrt/impl/Windows.ApplicationModel.Contacts.2.h" #include "winrt/impl/Windows.ApplicationModel.DataTransfer.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.ApplicationModel.DataTransfer.ShareTarget.2.h" #include "winrt/Windows.ApplicationModel.DataTransfer.h" namespace winrt::impl { template <typename D> hstring consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::Title() const { hstring value{}; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->get_Title(put_abi(value))); return value; } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::Title(param::hstring const& value) const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->put_Title(get_abi(value))); } template <typename D> Windows::Storage::Streams::RandomAccessStreamReference consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::Thumbnail() const { Windows::Storage::Streams::RandomAccessStreamReference value{ nullptr }; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->get_Thumbnail(put_abi(value))); return value; } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::Thumbnail(Windows::Storage::Streams::RandomAccessStreamReference const& value) const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->put_Thumbnail(get_abi(value))); } template <typename D> hstring consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::Id() const { hstring value{}; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->get_Id(put_abi(value))); return value; } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::Id(param::hstring const& value) const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->put_Id(get_abi(value))); } template <typename D> Windows::Foundation::Collections::IVector<hstring> consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::SupportedDataFormats() const { Windows::Foundation::Collections::IVector<hstring> value{ nullptr }; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->get_SupportedDataFormats(put_abi(value))); return value; } template <typename D> Windows::Foundation::Collections::IVector<hstring> consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IQuickLink<D>::SupportedFileTypes() const { Windows::Foundation::Collections::IVector<hstring> value{ nullptr }; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink)->get_SupportedFileTypes(put_abi(value))); return value; } template <typename D> Windows::ApplicationModel::DataTransfer::DataPackageView consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::Data() const { Windows::ApplicationModel::DataTransfer::DataPackageView value{ nullptr }; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->get_Data(put_abi(value))); return value; } template <typename D> hstring consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::QuickLinkId() const { hstring value{}; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->get_QuickLinkId(put_abi(value))); return value; } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::RemoveThisQuickLink() const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->RemoveThisQuickLink()); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::ReportStarted() const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->ReportStarted()); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::ReportDataRetrieved() const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->ReportDataRetrieved()); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::ReportSubmittedBackgroundTask() const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->ReportSubmittedBackgroundTask()); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::ReportCompleted(Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink const& quicklink) const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->ReportCompletedWithQuickLink(get_abi(quicklink))); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::ReportCompleted() const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->ReportCompleted()); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation<D>::ReportError(param::hstring const& value) const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation)->ReportError(get_abi(value))); } template <typename D> void consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation2<D>::DismissUI() const { check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation2)->DismissUI()); } template <typename D> Windows::Foundation::Collections::IVectorView<Windows::ApplicationModel::Contacts::Contact> consume_Windows_ApplicationModel_DataTransfer_ShareTarget_IShareOperation3<D>::Contacts() const { Windows::Foundation::Collections::IVectorView<Windows::ApplicationModel::Contacts::Contact> value{ nullptr }; check_hresult(WINRT_SHIM(Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation3)->get_Contacts(put_abi(value))); return value; } template <typename D> struct produce<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink> : produce_base<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink> { HRESULT __stdcall get_Title(HSTRING* value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().Title()); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall put_Title(HSTRING value) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Title(*reinterpret_cast<hstring const*>(&value)); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall get_Thumbnail(void** value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Storage::Streams::RandomAccessStreamReference>(this->shim().Thumbnail()); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall put_Thumbnail(void* value) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Thumbnail(*reinterpret_cast<Windows::Storage::Streams::RandomAccessStreamReference const*>(&value)); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall get_Id(HSTRING* value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().Id()); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall put_Id(HSTRING value) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().Id(*reinterpret_cast<hstring const*>(&value)); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall get_SupportedDataFormats(void** value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IVector<hstring>>(this->shim().SupportedDataFormats()); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall get_SupportedFileTypes(void** value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IVector<hstring>>(this->shim().SupportedFileTypes()); return S_OK; } catch (...) { return to_hresult(); } } }; template <typename D> struct produce<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation> : produce_base<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation> { HRESULT __stdcall get_Data(void** value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::ApplicationModel::DataTransfer::DataPackageView>(this->shim().Data()); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall get_QuickLinkId(HSTRING* value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().QuickLinkId()); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall RemoveThisQuickLink() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().RemoveThisQuickLink(); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall ReportStarted() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ReportStarted(); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall ReportDataRetrieved() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ReportDataRetrieved(); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall ReportSubmittedBackgroundTask() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ReportSubmittedBackgroundTask(); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall ReportCompletedWithQuickLink(void* quicklink) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ReportCompleted(*reinterpret_cast<Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink const*>(&quicklink)); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall ReportCompleted() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ReportCompleted(); return S_OK; } catch (...) { return to_hresult(); } } HRESULT __stdcall ReportError(HSTRING value) noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().ReportError(*reinterpret_cast<hstring const*>(&value)); return S_OK; } catch (...) { return to_hresult(); } } }; template <typename D> struct produce<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation2> : produce_base<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation2> { HRESULT __stdcall DismissUI() noexcept final { try { typename D::abi_guard guard(this->shim()); this->shim().DismissUI(); return S_OK; } catch (...) { return to_hresult(); } } }; template <typename D> struct produce<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation3> : produce_base<D, Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation3> { HRESULT __stdcall get_Contacts(void** value) noexcept final { try { *value = nullptr; typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IVectorView<Windows::ApplicationModel::Contacts::Contact>>(this->shim().Contacts()); return S_OK; } catch (...) { return to_hresult(); } } }; } WINRT_EXPORT namespace winrt::Windows::ApplicationModel::DataTransfer::ShareTarget { inline QuickLink::QuickLink() : QuickLink(get_activation_factory<QuickLink>().ActivateInstance<QuickLink>()) {} } WINRT_EXPORT namespace std { template<> struct hash<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink> : winrt::impl::hash_base<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IQuickLink> {}; template<> struct hash<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation> : winrt::impl::hash_base<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation> {}; template<> struct hash<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation2> : winrt::impl::hash_base<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation2> {}; template<> struct hash<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation3> : winrt::impl::hash_base<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::IShareOperation3> {}; template<> struct hash<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink> : winrt::impl::hash_base<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink> {}; template<> struct hash<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation> : winrt::impl::hash_base<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation> {}; } WINRT_WARNING_POP
35.541761
209
0.675326
2627553f7de1f90c262f2d234d1d1faa9288f45f
40,101
c
C
backports-3.12.8-1/drivers/media/usb/dvb-usb-v2/mxl111sf.c
szehl/ath9k-hmac
cc8cf635f14d3d9c79e2fac57032c88dd3db8daf
[ "Apache-2.0" ]
14
2016-11-22T08:22:05.000Z
2021-11-03T03:23:23.000Z
backports-3.12.8-1/drivers/media/usb/dvb-usb-v2/mxl111sf.c
szehl/ath9k-hmac
cc8cf635f14d3d9c79e2fac57032c88dd3db8daf
[ "Apache-2.0" ]
4
2016-12-19T03:37:35.000Z
2021-01-14T14:06:13.000Z
backports-3.12.8-1/drivers/media/usb/dvb-usb-v2/mxl111sf.c
szehl/ath9k-hmac
cc8cf635f14d3d9c79e2fac57032c88dd3db8daf
[ "Apache-2.0" ]
6
2017-02-01T14:03:37.000Z
2021-09-16T11:56:33.000Z
/* * Copyright (C) 2010 Michael Krufky (mkrufky@kernellabs.com) * * 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. * * see Documentation/dvb/README.dvb-usb for more information */ #include <linux/vmalloc.h> #include <linux/i2c.h> #include "mxl111sf.h" #include "mxl111sf-reg.h" #include "mxl111sf-phy.h" #include "mxl111sf-i2c.h" #include "mxl111sf-gpio.h" #include "mxl111sf-demod.h" #include "mxl111sf-tuner.h" #include "lgdt3305.h" #include "lg2160.h" /* Max transfer size done by I2C transfer functions */ #define MAX_XFER_SIZE 64 int dvb_usb_mxl111sf_debug; module_param_named(debug, dvb_usb_mxl111sf_debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level " "(1=info, 2=xfer, 4=i2c, 8=reg, 16=adv (or-able))."); int dvb_usb_mxl111sf_isoc; module_param_named(isoc, dvb_usb_mxl111sf_isoc, int, 0644); MODULE_PARM_DESC(isoc, "enable usb isoc xfer (0=bulk, 1=isoc)."); int dvb_usb_mxl111sf_spi; module_param_named(spi, dvb_usb_mxl111sf_spi, int, 0644); MODULE_PARM_DESC(spi, "use spi rather than tp for data xfer (0=tp, 1=spi)."); #define ANT_PATH_AUTO 0 #define ANT_PATH_EXTERNAL 1 #define ANT_PATH_INTERNAL 2 int dvb_usb_mxl111sf_rfswitch = #if 0 ANT_PATH_AUTO; #else ANT_PATH_EXTERNAL; #endif module_param_named(rfswitch, dvb_usb_mxl111sf_rfswitch, int, 0644); MODULE_PARM_DESC(rfswitch, "force rf switch position (0=auto, 1=ext, 2=int)."); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); int mxl111sf_ctrl_msg(struct dvb_usb_device *d, u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen) { int wo = (rbuf == NULL || rlen == 0); /* write-only */ int ret; u8 sndbuf[MAX_XFER_SIZE]; if (1 + wlen > sizeof(sndbuf)) { pr_warn("%s: len=%d is too big!\n", __func__, wlen); return -EOPNOTSUPP; } pr_debug("%s(wlen = %d, rlen = %d)\n", __func__, wlen, rlen); memset(sndbuf, 0, 1+wlen); sndbuf[0] = cmd; memcpy(&sndbuf[1], wbuf, wlen); ret = (wo) ? dvb_usbv2_generic_write(d, sndbuf, 1+wlen) : dvb_usbv2_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen); mxl_fail(ret); return ret; } /* ------------------------------------------------------------------------ */ #define MXL_CMD_REG_READ 0xaa #define MXL_CMD_REG_WRITE 0x55 int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data) { u8 buf[2]; int ret; ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_READ, &addr, 1, buf, 2); if (mxl_fail(ret)) { mxl_debug("error reading reg: 0x%02x", addr); goto fail; } if (buf[0] == addr) *data = buf[1]; else { pr_err("invalid response reading reg: 0x%02x != 0x%02x, 0x%02x", addr, buf[0], buf[1]); ret = -EINVAL; } pr_debug("R: (0x%02x, 0x%02x)\n", addr, *data); fail: return ret; } int mxl111sf_write_reg(struct mxl111sf_state *state, u8 addr, u8 data) { u8 buf[] = { addr, data }; int ret; pr_debug("W: (0x%02x, 0x%02x)\n", addr, data); ret = mxl111sf_ctrl_msg(state->d, MXL_CMD_REG_WRITE, buf, 2, NULL, 0); if (mxl_fail(ret)) pr_err("error writing reg: 0x%02x, val: 0x%02x", addr, data); return ret; } /* ------------------------------------------------------------------------ */ int mxl111sf_write_reg_mask(struct mxl111sf_state *state, u8 addr, u8 mask, u8 data) { int ret; u8 val; if (mask != 0xff) { ret = mxl111sf_read_reg(state, addr, &val); #if 1 /* dont know why this usually errors out on the first try */ if (mxl_fail(ret)) pr_err("error writing addr: 0x%02x, mask: 0x%02x, " "data: 0x%02x, retrying...", addr, mask, data); ret = mxl111sf_read_reg(state, addr, &val); #endif if (mxl_fail(ret)) goto fail; } val &= ~mask; val |= data; ret = mxl111sf_write_reg(state, addr, val); mxl_fail(ret); fail: return ret; } /* ------------------------------------------------------------------------ */ int mxl111sf_ctrl_program_regs(struct mxl111sf_state *state, struct mxl111sf_reg_ctrl_info *ctrl_reg_info) { int i, ret = 0; for (i = 0; ctrl_reg_info[i].addr | ctrl_reg_info[i].mask | ctrl_reg_info[i].data; i++) { ret = mxl111sf_write_reg_mask(state, ctrl_reg_info[i].addr, ctrl_reg_info[i].mask, ctrl_reg_info[i].data); if (mxl_fail(ret)) { pr_err("failed on reg #%d (0x%02x)", i, ctrl_reg_info[i].addr); break; } } return ret; } /* ------------------------------------------------------------------------ */ static int mxl1x1sf_get_chip_info(struct mxl111sf_state *state) { int ret; u8 id, ver; char *mxl_chip, *mxl_rev; if ((state->chip_id) && (state->chip_ver)) return 0; ret = mxl111sf_read_reg(state, CHIP_ID_REG, &id); if (mxl_fail(ret)) goto fail; state->chip_id = id; ret = mxl111sf_read_reg(state, TOP_CHIP_REV_ID_REG, &ver); if (mxl_fail(ret)) goto fail; state->chip_ver = ver; switch (id) { case 0x61: mxl_chip = "MxL101SF"; break; case 0x63: mxl_chip = "MxL111SF"; break; default: mxl_chip = "UNKNOWN MxL1X1"; break; } switch (ver) { case 0x36: state->chip_rev = MXL111SF_V6; mxl_rev = "v6"; break; case 0x08: state->chip_rev = MXL111SF_V8_100; mxl_rev = "v8_100"; break; case 0x18: state->chip_rev = MXL111SF_V8_200; mxl_rev = "v8_200"; break; default: state->chip_rev = 0; mxl_rev = "UNKNOWN REVISION"; break; } pr_info("%s detected, %s (0x%x)", mxl_chip, mxl_rev, ver); fail: return ret; } #define get_chip_info(state) \ ({ \ int ___ret; \ ___ret = mxl1x1sf_get_chip_info(state); \ if (mxl_fail(___ret)) { \ mxl_debug("failed to get chip info" \ " on first probe attempt"); \ ___ret = mxl1x1sf_get_chip_info(state); \ if (mxl_fail(___ret)) \ pr_err("failed to get chip info during probe"); \ else \ mxl_debug("probe needed a retry " \ "in order to succeed."); \ } \ ___ret; \ }) /* ------------------------------------------------------------------------ */ #if 0 static int mxl111sf_power_ctrl(struct dvb_usb_device *d, int onoff) { /* power control depends on which adapter is being woken: * save this for init, instead, via mxl111sf_adap_fe_init */ return 0; } #endif static int mxl111sf_adap_fe_init(struct dvb_frontend *fe) { struct dvb_usb_device *d = fe_to_d(fe); struct mxl111sf_state *state = fe_to_priv(fe); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id]; int err; /* exit if we didnt initialize the driver yet */ if (!state->chip_id) { mxl_debug("driver not yet initialized, exit."); goto fail; } pr_debug("%s()\n", __func__); mutex_lock(&state->fe_lock); state->alt_mode = adap_state->alt_mode; if (usb_set_interface(d->udev, 0, state->alt_mode) < 0) pr_err("set interface failed"); err = mxl1x1sf_soft_reset(state); mxl_fail(err); err = mxl111sf_init_tuner_demod(state); mxl_fail(err); err = mxl1x1sf_set_device_mode(state, adap_state->device_mode); mxl_fail(err); mxl111sf_enable_usb_output(state); mxl_fail(err); mxl1x1sf_top_master_ctrl(state, 1); mxl_fail(err); if ((MXL111SF_GPIO_MOD_DVBT != adap_state->gpio_mode) && (state->chip_rev > MXL111SF_V6)) { mxl111sf_config_pin_mux_modes(state, PIN_MUX_TS_SPI_IN_MODE_1); mxl_fail(err); } err = mxl111sf_init_port_expander(state); if (!mxl_fail(err)) { state->gpio_mode = adap_state->gpio_mode; err = mxl111sf_gpio_mode_switch(state, state->gpio_mode); mxl_fail(err); #if 0 err = fe->ops.init(fe); #endif msleep(100); /* add short delay after enabling * the demod before touching it */ } return (adap_state->fe_init) ? adap_state->fe_init(fe) : 0; fail: return -ENODEV; } static int mxl111sf_adap_fe_sleep(struct dvb_frontend *fe) { struct mxl111sf_state *state = fe_to_priv(fe); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id]; int err; /* exit if we didnt initialize the driver yet */ if (!state->chip_id) { mxl_debug("driver not yet initialized, exit."); goto fail; } pr_debug("%s()\n", __func__); err = (adap_state->fe_sleep) ? adap_state->fe_sleep(fe) : 0; mutex_unlock(&state->fe_lock); return err; fail: return -ENODEV; } static int mxl111sf_ep6_streaming_ctrl(struct dvb_frontend *fe, int onoff) { struct mxl111sf_state *state = fe_to_priv(fe); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe->id]; int ret = 0; pr_debug("%s(%d)\n", __func__, onoff); if (onoff) { ret = mxl111sf_enable_usb_output(state); mxl_fail(ret); ret = mxl111sf_config_mpeg_in(state, 1, 1, adap_state->ep6_clockphase, 0, 0); mxl_fail(ret); #if 0 } else { ret = mxl111sf_disable_656_port(state); mxl_fail(ret); #endif } return ret; } static int mxl111sf_ep5_streaming_ctrl(struct dvb_frontend *fe, int onoff) { struct mxl111sf_state *state = fe_to_priv(fe); int ret = 0; pr_debug("%s(%d)\n", __func__, onoff); if (onoff) { ret = mxl111sf_enable_usb_output(state); mxl_fail(ret); ret = mxl111sf_init_i2s_port(state, 200); mxl_fail(ret); ret = mxl111sf_config_i2s(state, 0, 15); mxl_fail(ret); } else { ret = mxl111sf_disable_i2s_port(state); mxl_fail(ret); } if (state->chip_rev > MXL111SF_V6) ret = mxl111sf_config_spi(state, onoff); mxl_fail(ret); return ret; } static int mxl111sf_ep4_streaming_ctrl(struct dvb_frontend *fe, int onoff) { struct mxl111sf_state *state = fe_to_priv(fe); int ret = 0; pr_debug("%s(%d)\n", __func__, onoff); if (onoff) { ret = mxl111sf_enable_usb_output(state); mxl_fail(ret); } return ret; } /* ------------------------------------------------------------------------ */ static struct lgdt3305_config hauppauge_lgdt3305_config = { .i2c_addr = 0xb2 >> 1, .mpeg_mode = LGDT3305_MPEG_SERIAL, .tpclk_edge = LGDT3305_TPCLK_RISING_EDGE, .tpvalid_polarity = LGDT3305_TP_VALID_HIGH, .deny_i2c_rptr = 1, .spectral_inversion = 0, .qam_if_khz = 6000, .vsb_if_khz = 6000, }; static int mxl111sf_lgdt3305_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id) { struct dvb_usb_device *d = adap_to_d(adap); struct mxl111sf_state *state = d_to_priv(d); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id]; int ret; pr_debug("%s()\n", __func__); /* save a pointer to the dvb_usb_device in device state */ state->d = d; adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1; state->alt_mode = adap_state->alt_mode; if (usb_set_interface(d->udev, 0, state->alt_mode) < 0) pr_err("set interface failed"); state->gpio_mode = MXL111SF_GPIO_MOD_ATSC; adap_state->gpio_mode = state->gpio_mode; adap_state->device_mode = MXL_TUNER_MODE; adap_state->ep6_clockphase = 1; ret = mxl1x1sf_soft_reset(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_tuner_demod(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode); if (mxl_fail(ret)) goto fail; ret = mxl111sf_enable_usb_output(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_top_master_ctrl(state, 1); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_port_expander(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode); if (mxl_fail(ret)) goto fail; adap->fe[fe_id] = dvb_attach(lgdt3305_attach, &hauppauge_lgdt3305_config, &d->i2c_adap); if (adap->fe[fe_id]) { state->num_frontends++; adap_state->fe_init = adap->fe[fe_id]->ops.init; adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init; adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep; adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep; return 0; } ret = -EIO; fail: return ret; } static struct lg2160_config hauppauge_lg2160_config = { .lg_chip = LG2160, .i2c_addr = 0x1c >> 1, .deny_i2c_rptr = 1, .spectral_inversion = 0, .if_khz = 6000, }; static int mxl111sf_lg2160_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id) { struct dvb_usb_device *d = adap_to_d(adap); struct mxl111sf_state *state = d_to_priv(d); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id]; int ret; pr_debug("%s()\n", __func__); /* save a pointer to the dvb_usb_device in device state */ state->d = d; adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1; state->alt_mode = adap_state->alt_mode; if (usb_set_interface(d->udev, 0, state->alt_mode) < 0) pr_err("set interface failed"); state->gpio_mode = MXL111SF_GPIO_MOD_MH; adap_state->gpio_mode = state->gpio_mode; adap_state->device_mode = MXL_TUNER_MODE; adap_state->ep6_clockphase = 1; ret = mxl1x1sf_soft_reset(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_tuner_demod(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode); if (mxl_fail(ret)) goto fail; ret = mxl111sf_enable_usb_output(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_top_master_ctrl(state, 1); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_port_expander(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode); if (mxl_fail(ret)) goto fail; ret = get_chip_info(state); if (mxl_fail(ret)) goto fail; adap->fe[fe_id] = dvb_attach(lg2160_attach, &hauppauge_lg2160_config, &d->i2c_adap); if (adap->fe[fe_id]) { state->num_frontends++; adap_state->fe_init = adap->fe[fe_id]->ops.init; adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init; adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep; adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep; return 0; } ret = -EIO; fail: return ret; } static struct lg2160_config hauppauge_lg2161_1019_config = { .lg_chip = LG2161_1019, .i2c_addr = 0x1c >> 1, .deny_i2c_rptr = 1, .spectral_inversion = 0, .if_khz = 6000, .output_if = 2, /* LG2161_OIF_SPI_MAS */ }; static struct lg2160_config hauppauge_lg2161_1040_config = { .lg_chip = LG2161_1040, .i2c_addr = 0x1c >> 1, .deny_i2c_rptr = 1, .spectral_inversion = 0, .if_khz = 6000, .output_if = 4, /* LG2161_OIF_SPI_MAS */ }; static int mxl111sf_lg2161_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id) { struct dvb_usb_device *d = adap_to_d(adap); struct mxl111sf_state *state = d_to_priv(d); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id]; int ret; pr_debug("%s()\n", __func__); /* save a pointer to the dvb_usb_device in device state */ state->d = d; adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1; state->alt_mode = adap_state->alt_mode; if (usb_set_interface(d->udev, 0, state->alt_mode) < 0) pr_err("set interface failed"); state->gpio_mode = MXL111SF_GPIO_MOD_MH; adap_state->gpio_mode = state->gpio_mode; adap_state->device_mode = MXL_TUNER_MODE; adap_state->ep6_clockphase = 1; ret = mxl1x1sf_soft_reset(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_tuner_demod(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode); if (mxl_fail(ret)) goto fail; ret = mxl111sf_enable_usb_output(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_top_master_ctrl(state, 1); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_port_expander(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode); if (mxl_fail(ret)) goto fail; ret = get_chip_info(state); if (mxl_fail(ret)) goto fail; adap->fe[fe_id] = dvb_attach(lg2160_attach, (MXL111SF_V8_200 == state->chip_rev) ? &hauppauge_lg2161_1040_config : &hauppauge_lg2161_1019_config, &d->i2c_adap); if (adap->fe[fe_id]) { state->num_frontends++; adap_state->fe_init = adap->fe[fe_id]->ops.init; adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init; adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep; adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep; return 0; } ret = -EIO; fail: return ret; } static struct lg2160_config hauppauge_lg2161_1019_ep6_config = { .lg_chip = LG2161_1019, .i2c_addr = 0x1c >> 1, .deny_i2c_rptr = 1, .spectral_inversion = 0, .if_khz = 6000, .output_if = 1, /* LG2161_OIF_SERIAL_TS */ }; static struct lg2160_config hauppauge_lg2161_1040_ep6_config = { .lg_chip = LG2161_1040, .i2c_addr = 0x1c >> 1, .deny_i2c_rptr = 1, .spectral_inversion = 0, .if_khz = 6000, .output_if = 7, /* LG2161_OIF_SERIAL_TS */ }; static int mxl111sf_lg2161_ep6_frontend_attach(struct dvb_usb_adapter *adap, u8 fe_id) { struct dvb_usb_device *d = adap_to_d(adap); struct mxl111sf_state *state = d_to_priv(d); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id]; int ret; pr_debug("%s()\n", __func__); /* save a pointer to the dvb_usb_device in device state */ state->d = d; adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 2 : 1; state->alt_mode = adap_state->alt_mode; if (usb_set_interface(d->udev, 0, state->alt_mode) < 0) pr_err("set interface failed"); state->gpio_mode = MXL111SF_GPIO_MOD_MH; adap_state->gpio_mode = state->gpio_mode; adap_state->device_mode = MXL_TUNER_MODE; adap_state->ep6_clockphase = 0; ret = mxl1x1sf_soft_reset(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_tuner_demod(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode); if (mxl_fail(ret)) goto fail; ret = mxl111sf_enable_usb_output(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_top_master_ctrl(state, 1); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_port_expander(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_gpio_mode_switch(state, state->gpio_mode); if (mxl_fail(ret)) goto fail; ret = get_chip_info(state); if (mxl_fail(ret)) goto fail; adap->fe[fe_id] = dvb_attach(lg2160_attach, (MXL111SF_V8_200 == state->chip_rev) ? &hauppauge_lg2161_1040_ep6_config : &hauppauge_lg2161_1019_ep6_config, &d->i2c_adap); if (adap->fe[fe_id]) { state->num_frontends++; adap_state->fe_init = adap->fe[fe_id]->ops.init; adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init; adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep; adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep; return 0; } ret = -EIO; fail: return ret; } static struct mxl111sf_demod_config mxl_demod_config = { .read_reg = mxl111sf_read_reg, .write_reg = mxl111sf_write_reg, .program_regs = mxl111sf_ctrl_program_regs, }; static int mxl111sf_attach_demod(struct dvb_usb_adapter *adap, u8 fe_id) { struct dvb_usb_device *d = adap_to_d(adap); struct mxl111sf_state *state = d_to_priv(d); struct mxl111sf_adap_state *adap_state = &state->adap_state[fe_id]; int ret; pr_debug("%s()\n", __func__); /* save a pointer to the dvb_usb_device in device state */ state->d = d; adap_state->alt_mode = (dvb_usb_mxl111sf_isoc) ? 1 : 2; state->alt_mode = adap_state->alt_mode; if (usb_set_interface(d->udev, 0, state->alt_mode) < 0) pr_err("set interface failed"); state->gpio_mode = MXL111SF_GPIO_MOD_DVBT; adap_state->gpio_mode = state->gpio_mode; adap_state->device_mode = MXL_SOC_MODE; adap_state->ep6_clockphase = 1; ret = mxl1x1sf_soft_reset(state); if (mxl_fail(ret)) goto fail; ret = mxl111sf_init_tuner_demod(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_set_device_mode(state, adap_state->device_mode); if (mxl_fail(ret)) goto fail; ret = mxl111sf_enable_usb_output(state); if (mxl_fail(ret)) goto fail; ret = mxl1x1sf_top_master_ctrl(state, 1); if (mxl_fail(ret)) goto fail; /* dont care if this fails */ mxl111sf_init_port_expander(state); adap->fe[fe_id] = dvb_attach(mxl111sf_demod_attach, state, &mxl_demod_config); if (adap->fe[fe_id]) { state->num_frontends++; adap_state->fe_init = adap->fe[fe_id]->ops.init; adap->fe[fe_id]->ops.init = mxl111sf_adap_fe_init; adap_state->fe_sleep = adap->fe[fe_id]->ops.sleep; adap->fe[fe_id]->ops.sleep = mxl111sf_adap_fe_sleep; return 0; } ret = -EIO; fail: return ret; } static inline int mxl111sf_set_ant_path(struct mxl111sf_state *state, int antpath) { return mxl111sf_idac_config(state, 1, 1, (antpath == ANT_PATH_INTERNAL) ? 0x3f : 0x00, 0); } #define DbgAntHunt(x, pwr0, pwr1, pwr2, pwr3) \ pr_err("%s(%d) FINAL input set to %s rxPwr:%d|%d|%d|%d\n", \ __func__, __LINE__, \ (ANT_PATH_EXTERNAL == x) ? "EXTERNAL" : "INTERNAL", \ pwr0, pwr1, pwr2, pwr3) #define ANT_HUNT_SLEEP 90 #define ANT_EXT_TWEAK 0 static int mxl111sf_ant_hunt(struct dvb_frontend *fe) { struct mxl111sf_state *state = fe_to_priv(fe); int antctrl = dvb_usb_mxl111sf_rfswitch; u16 rxPwrA, rxPwr0, rxPwr1, rxPwr2; /* FIXME: must force EXTERNAL for QAM - done elsewhere */ mxl111sf_set_ant_path(state, antctrl == ANT_PATH_AUTO ? ANT_PATH_EXTERNAL : antctrl); if (antctrl == ANT_PATH_AUTO) { #if 0 msleep(ANT_HUNT_SLEEP); #endif fe->ops.tuner_ops.get_rf_strength(fe, &rxPwrA); mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL); msleep(ANT_HUNT_SLEEP); fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr0); mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL); msleep(ANT_HUNT_SLEEP); fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr1); mxl111sf_set_ant_path(state, ANT_PATH_INTERNAL); msleep(ANT_HUNT_SLEEP); fe->ops.tuner_ops.get_rf_strength(fe, &rxPwr2); if (rxPwr1+ANT_EXT_TWEAK >= rxPwr2) { /* return with EXTERNAL enabled */ mxl111sf_set_ant_path(state, ANT_PATH_EXTERNAL); DbgAntHunt(ANT_PATH_EXTERNAL, rxPwrA, rxPwr0, rxPwr1, rxPwr2); } else { /* return with INTERNAL enabled */ DbgAntHunt(ANT_PATH_INTERNAL, rxPwrA, rxPwr0, rxPwr1, rxPwr2); } } return 0; } static struct mxl111sf_tuner_config mxl_tuner_config = { .if_freq = MXL_IF_6_0, /* applies to external IF output, only */ .invert_spectrum = 0, .read_reg = mxl111sf_read_reg, .write_reg = mxl111sf_write_reg, .program_regs = mxl111sf_ctrl_program_regs, .top_master_ctrl = mxl1x1sf_top_master_ctrl, .ant_hunt = mxl111sf_ant_hunt, }; static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap) { struct mxl111sf_state *state = adap_to_priv(adap); int i; pr_debug("%s()\n", __func__); for (i = 0; i < state->num_frontends; i++) { if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state, &mxl_tuner_config) == NULL) return -EIO; adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength; } return 0; } static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter) { return I2C_FUNC_I2C; } struct i2c_algorithm mxl111sf_i2c_algo = { .master_xfer = mxl111sf_i2c_xfer, .functionality = mxl111sf_i2c_func, #ifdef NEED_ALGO_CONTROL .algo_control = dummy_algo_control, #endif }; static int mxl111sf_init(struct dvb_usb_device *d) { struct mxl111sf_state *state = d_to_priv(d); int ret; static u8 eeprom[256]; struct i2c_client c; ret = get_chip_info(state); if (mxl_fail(ret)) pr_err("failed to get chip info during probe"); mutex_init(&state->fe_lock); if (state->chip_rev > MXL111SF_V6) mxl111sf_config_pin_mux_modes(state, PIN_MUX_TS_SPI_IN_MODE_1); c.adapter = &d->i2c_adap; c.addr = 0xa0 >> 1; ret = tveeprom_read(&c, eeprom, sizeof(eeprom)); if (mxl_fail(ret)) return 0; tveeprom_hauppauge_analog(&c, &state->tv, (0x84 == eeprom[0xa0]) ? eeprom + 0xa0 : eeprom + 0x80); #if 0 switch (state->tv.model) { case 117001: case 126001: case 138001: break; default: printk(KERN_WARNING "%s: warning: " "unknown hauppauge model #%d\n", __func__, state->tv.model); } #endif return 0; } static int mxl111sf_frontend_attach_dvbt(struct dvb_usb_adapter *adap) { return mxl111sf_attach_demod(adap, 0); } static int mxl111sf_frontend_attach_atsc(struct dvb_usb_adapter *adap) { return mxl111sf_lgdt3305_frontend_attach(adap, 0); } static int mxl111sf_frontend_attach_mh(struct dvb_usb_adapter *adap) { return mxl111sf_lg2160_frontend_attach(adap, 0); } static int mxl111sf_frontend_attach_atsc_mh(struct dvb_usb_adapter *adap) { int ret; pr_debug("%s\n", __func__); ret = mxl111sf_lgdt3305_frontend_attach(adap, 0); if (ret < 0) return ret; ret = mxl111sf_attach_demod(adap, 1); if (ret < 0) return ret; ret = mxl111sf_lg2160_frontend_attach(adap, 2); if (ret < 0) return ret; return ret; } static int mxl111sf_frontend_attach_mercury(struct dvb_usb_adapter *adap) { int ret; pr_debug("%s\n", __func__); ret = mxl111sf_lgdt3305_frontend_attach(adap, 0); if (ret < 0) return ret; ret = mxl111sf_attach_demod(adap, 1); if (ret < 0) return ret; ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 2); if (ret < 0) return ret; return ret; } static int mxl111sf_frontend_attach_mercury_mh(struct dvb_usb_adapter *adap) { int ret; pr_debug("%s\n", __func__); ret = mxl111sf_attach_demod(adap, 0); if (ret < 0) return ret; if (dvb_usb_mxl111sf_spi) ret = mxl111sf_lg2161_frontend_attach(adap, 1); else ret = mxl111sf_lg2161_ep6_frontend_attach(adap, 1); return ret; } static void mxl111sf_stream_config_bulk(struct usb_data_stream_properties *stream, u8 endpoint) { pr_debug("%s: endpoint=%d size=8192\n", __func__, endpoint); stream->type = USB_BULK; stream->count = 5; stream->endpoint = endpoint; stream->u.bulk.buffersize = 8192; } static void mxl111sf_stream_config_isoc(struct usb_data_stream_properties *stream, u8 endpoint, int framesperurb, int framesize) { pr_debug("%s: endpoint=%d size=%d\n", __func__, endpoint, framesperurb * framesize); stream->type = USB_ISOC; stream->count = 5; stream->endpoint = endpoint; stream->u.isoc.framesperurb = framesperurb; stream->u.isoc.framesize = framesize; stream->u.isoc.interval = 1; } /* DVB USB Driver stuff */ /* dvbt mxl111sf * bulk EP4/BULK/5/8192 * isoc EP4/ISOC/5/96/564 */ static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend *fe, u8 *ts_type, struct usb_data_stream_properties *stream) { pr_debug("%s: fe=%d\n", __func__, fe->id); *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 4, 96, 564); else mxl111sf_stream_config_bulk(stream, 4); return 0; } static struct dvb_usb_device_properties mxl111sf_props_dvbt = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct mxl111sf_state), .generic_bulk_ctrl_endpoint = 0x02, .generic_bulk_ctrl_endpoint_response = 0x81, .i2c_algo = &mxl111sf_i2c_algo, .frontend_attach = mxl111sf_frontend_attach_dvbt, .tuner_attach = mxl111sf_attach_tuner, .init = mxl111sf_init, .streaming_ctrl = mxl111sf_ep4_streaming_ctrl, .get_stream_config = mxl111sf_get_stream_config_dvbt, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1), } } }; /* atsc lgdt3305 * bulk EP6/BULK/5/8192 * isoc EP6/ISOC/5/24/3072 */ static int mxl111sf_get_stream_config_atsc(struct dvb_frontend *fe, u8 *ts_type, struct usb_data_stream_properties *stream) { pr_debug("%s: fe=%d\n", __func__, fe->id); *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 6, 24, 3072); else mxl111sf_stream_config_bulk(stream, 6); return 0; } static struct dvb_usb_device_properties mxl111sf_props_atsc = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct mxl111sf_state), .generic_bulk_ctrl_endpoint = 0x02, .generic_bulk_ctrl_endpoint_response = 0x81, .i2c_algo = &mxl111sf_i2c_algo, .frontend_attach = mxl111sf_frontend_attach_atsc, .tuner_attach = mxl111sf_attach_tuner, .init = mxl111sf_init, .streaming_ctrl = mxl111sf_ep6_streaming_ctrl, .get_stream_config = mxl111sf_get_stream_config_atsc, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1), } } }; /* mh lg2160 * bulk EP5/BULK/5/8192/RAW * isoc EP5/ISOC/5/96/200/RAW */ static int mxl111sf_get_stream_config_mh(struct dvb_frontend *fe, u8 *ts_type, struct usb_data_stream_properties *stream) { pr_debug("%s: fe=%d\n", __func__, fe->id); *ts_type = DVB_USB_FE_TS_TYPE_RAW; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 5, 96, 200); else mxl111sf_stream_config_bulk(stream, 5); return 0; } static struct dvb_usb_device_properties mxl111sf_props_mh = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct mxl111sf_state), .generic_bulk_ctrl_endpoint = 0x02, .generic_bulk_ctrl_endpoint_response = 0x81, .i2c_algo = &mxl111sf_i2c_algo, .frontend_attach = mxl111sf_frontend_attach_mh, .tuner_attach = mxl111sf_attach_tuner, .init = mxl111sf_init, .streaming_ctrl = mxl111sf_ep5_streaming_ctrl, .get_stream_config = mxl111sf_get_stream_config_mh, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1), } } }; /* atsc mh lgdt3305 mxl111sf lg2160 * bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW * isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW */ static int mxl111sf_get_stream_config_atsc_mh(struct dvb_frontend *fe, u8 *ts_type, struct usb_data_stream_properties *stream) { pr_debug("%s: fe=%d\n", __func__, fe->id); if (fe->id == 0) { *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 6, 24, 3072); else mxl111sf_stream_config_bulk(stream, 6); } else if (fe->id == 1) { *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 4, 96, 564); else mxl111sf_stream_config_bulk(stream, 4); } else if (fe->id == 2) { *ts_type = DVB_USB_FE_TS_TYPE_RAW; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 5, 96, 200); else mxl111sf_stream_config_bulk(stream, 5); } return 0; } static int mxl111sf_streaming_ctrl_atsc_mh(struct dvb_frontend *fe, int onoff) { pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff); if (fe->id == 0) return mxl111sf_ep6_streaming_ctrl(fe, onoff); else if (fe->id == 1) return mxl111sf_ep4_streaming_ctrl(fe, onoff); else if (fe->id == 2) return mxl111sf_ep5_streaming_ctrl(fe, onoff); return 0; } static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct mxl111sf_state), .generic_bulk_ctrl_endpoint = 0x02, .generic_bulk_ctrl_endpoint_response = 0x81, .i2c_algo = &mxl111sf_i2c_algo, .frontend_attach = mxl111sf_frontend_attach_atsc_mh, .tuner_attach = mxl111sf_attach_tuner, .init = mxl111sf_init, .streaming_ctrl = mxl111sf_streaming_ctrl_atsc_mh, .get_stream_config = mxl111sf_get_stream_config_atsc_mh, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1), } } }; /* mercury lgdt3305 mxl111sf lg2161 * tp bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP6/BULK/5/8192/RAW * tp isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW * spi bulk EP6/BULK/5/8192 EP4/BULK/5/8192 EP5/BULK/5/8192/RAW * spi isoc EP6/ISOC/5/24/3072 EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW */ static int mxl111sf_get_stream_config_mercury(struct dvb_frontend *fe, u8 *ts_type, struct usb_data_stream_properties *stream) { pr_debug("%s: fe=%d\n", __func__, fe->id); if (fe->id == 0) { *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 6, 24, 3072); else mxl111sf_stream_config_bulk(stream, 6); } else if (fe->id == 1) { *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 4, 96, 564); else mxl111sf_stream_config_bulk(stream, 4); } else if (fe->id == 2 && dvb_usb_mxl111sf_spi) { *ts_type = DVB_USB_FE_TS_TYPE_RAW; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 5, 96, 200); else mxl111sf_stream_config_bulk(stream, 5); } else if (fe->id == 2 && !dvb_usb_mxl111sf_spi) { *ts_type = DVB_USB_FE_TS_TYPE_RAW; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 6, 24, 3072); else mxl111sf_stream_config_bulk(stream, 6); } return 0; } static int mxl111sf_streaming_ctrl_mercury(struct dvb_frontend *fe, int onoff) { pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff); if (fe->id == 0) return mxl111sf_ep6_streaming_ctrl(fe, onoff); else if (fe->id == 1) return mxl111sf_ep4_streaming_ctrl(fe, onoff); else if (fe->id == 2 && dvb_usb_mxl111sf_spi) return mxl111sf_ep5_streaming_ctrl(fe, onoff); else if (fe->id == 2 && !dvb_usb_mxl111sf_spi) return mxl111sf_ep6_streaming_ctrl(fe, onoff); return 0; } static struct dvb_usb_device_properties mxl111sf_props_mercury = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct mxl111sf_state), .generic_bulk_ctrl_endpoint = 0x02, .generic_bulk_ctrl_endpoint_response = 0x81, .i2c_algo = &mxl111sf_i2c_algo, .frontend_attach = mxl111sf_frontend_attach_mercury, .tuner_attach = mxl111sf_attach_tuner, .init = mxl111sf_init, .streaming_ctrl = mxl111sf_streaming_ctrl_mercury, .get_stream_config = mxl111sf_get_stream_config_mercury, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1), } } }; /* mercury mh mxl111sf lg2161 * tp bulk EP4/BULK/5/8192 EP6/BULK/5/8192/RAW * tp isoc EP4/ISOC/5/96/564 EP6/ISOC/5/24/3072/RAW * spi bulk EP4/BULK/5/8192 EP5/BULK/5/8192/RAW * spi isoc EP4/ISOC/5/96/564 EP5/ISOC/5/96/200/RAW */ static int mxl111sf_get_stream_config_mercury_mh(struct dvb_frontend *fe, u8 *ts_type, struct usb_data_stream_properties *stream) { pr_debug("%s: fe=%d\n", __func__, fe->id); if (fe->id == 0) { *ts_type = DVB_USB_FE_TS_TYPE_188; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 4, 96, 564); else mxl111sf_stream_config_bulk(stream, 4); } else if (fe->id == 1 && dvb_usb_mxl111sf_spi) { *ts_type = DVB_USB_FE_TS_TYPE_RAW; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 5, 96, 200); else mxl111sf_stream_config_bulk(stream, 5); } else if (fe->id == 1 && !dvb_usb_mxl111sf_spi) { *ts_type = DVB_USB_FE_TS_TYPE_RAW; if (dvb_usb_mxl111sf_isoc) mxl111sf_stream_config_isoc(stream, 6, 24, 3072); else mxl111sf_stream_config_bulk(stream, 6); } return 0; } static int mxl111sf_streaming_ctrl_mercury_mh(struct dvb_frontend *fe, int onoff) { pr_debug("%s: fe=%d onoff=%d\n", __func__, fe->id, onoff); if (fe->id == 0) return mxl111sf_ep4_streaming_ctrl(fe, onoff); else if (fe->id == 1 && dvb_usb_mxl111sf_spi) return mxl111sf_ep5_streaming_ctrl(fe, onoff); else if (fe->id == 1 && !dvb_usb_mxl111sf_spi) return mxl111sf_ep6_streaming_ctrl(fe, onoff); return 0; } static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct mxl111sf_state), .generic_bulk_ctrl_endpoint = 0x02, .generic_bulk_ctrl_endpoint_response = 0x81, .i2c_algo = &mxl111sf_i2c_algo, .frontend_attach = mxl111sf_frontend_attach_mercury_mh, .tuner_attach = mxl111sf_attach_tuner, .init = mxl111sf_init, .streaming_ctrl = mxl111sf_streaming_ctrl_mercury_mh, .get_stream_config = mxl111sf_get_stream_config_mercury_mh, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_ISOC(6, 5, 24, 3072, 1), } } }; static const struct usb_device_id mxl111sf_id_table[] = { { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc600, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc601, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc602, &mxl111sf_props_mh, "HCW 126xxx", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc603, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc604, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc609, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60a, &mxl111sf_props_mh, "HCW 126xxx", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc60c, &mxl111sf_props_dvbt, "Hauppauge 126xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc653, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc65b, &mxl111sf_props_atsc_mh, "Hauppauge 126xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb700, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb701, &mxl111sf_props_atsc, "Hauppauge 126xxx ATSC", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb702, &mxl111sf_props_mh, "HCW 117xxx", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb703, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb704, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb753, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb763, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb764, &mxl111sf_props_dvbt, "Hauppauge 117xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd853, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd854, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd863, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd864, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8d4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e3, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8e4, &mxl111sf_props_dvbt, "Hauppauge 138xxx DVBT", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xd8ff, &mxl111sf_props_mercury, "Hauppauge Mercury", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc612, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc613, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61a, &mxl111sf_props_mercury_mh, "Hauppauge 126xxx", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xc61b, &mxl111sf_props_mercury, "Hauppauge WinTV-Aero-M", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb757, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) }, { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xb767, &mxl111sf_props_atsc_mh, "Hauppauge 117xxx ATSC+", NULL) }, { } }; MODULE_DEVICE_TABLE(usb, mxl111sf_id_table); static struct usb_driver mxl111sf_usb_driver = { .name = KBUILD_MODNAME, .id_table = mxl111sf_id_table, .probe = dvb_usbv2_probe, .disconnect = dvb_usbv2_disconnect, .suspend = dvb_usbv2_suspend, .resume = dvb_usbv2_resume, .no_dynamic_id = 1, .soft_unbind = 1, }; module_usb_driver(mxl111sf_usb_driver); MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF"); MODULE_VERSION("1.0"); MODULE_LICENSE("GPL"); /* * Local variables: * c-basic-offset: 8 * End: */
27.964435
104
0.702925
4d02ac2bae8336766f85d4deb2d8662f4f94c24f
4,484
c
C
sdk-6.5.20/libs/sdklt/bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_ser_notification_map.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_ser_notification_map.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_ser_notification_map.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/******************************************************************************* * * DO NOT EDIT THIS FILE! * This file is auto-generated by fltg from * INTERNAL/fltg/xgs/ser/bcm56880_a0/bcm56880_a0_SER_NOTIFICATION.map.ltl for * bcm56880_a0 * * Tool: $SDK/INTERNAL/fltg/bin/fltg * * Edits to this file will be lost when it is regenerated. * * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ #include <bcmlrd/bcmlrd_internal.h> #include <bcmlrd/chip/bcmlrd_id.h> #include <bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_field_data.h> #include <bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_ltm_intf.h> #include <bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_xfrm_field_desc.h> #include <bcmdrd/chip/bcm56880_a0_enum.h> #include "bcmltd/chip/bcmltd_common_enumpool.h" #include "bcm56880_a0_lrd_enumpool.h" #include <bcmltd/bcmltd_handler.h> /* SER_NOTIFICATION field init */ static const bcmlrd_field_data_t bcm56880_a0_lrd_ser_notification_map_field_data_mmd[] = { { /* 0 PT_ID */ .flags = BCMLRD_FIELD_F_READ_ONLY | BCMLTD_FIELD_F_ENUM, .min = &bcm56880_a0_lrd_ifd_u32_0x0, .def = &bcm56880_a0_lrd_ifd_u32_0x2900, .max = &bcm56880_a0_lrd_ifd_u32_0x2900, .depth = 0, .width = 14, .edata = BCM56880_A0_LRD_PTID_T_DATA, }, { /* 1 HW_FAULT */ .flags = BCMLRD_FIELD_F_READ_ONLY, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x1, .depth = 0, .width = 1, .edata = NULL, }, { /* 2 HIGH_SEVERITY_ERR */ .flags = BCMLRD_FIELD_F_READ_ONLY, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x1, .depth = 0, .width = 1, .edata = NULL, }, }; const bcmlrd_map_field_data_t bcm56880_a0_lrd_ser_notification_map_field_data = { .fields = 3, .field = bcm56880_a0_lrd_ser_notification_map_field_data_mmd }; static const bcmlrd_map_table_attr_t bcm56880_a0_lrd_ser_notificationt_attr_entry[] = { { /* 0 */ .key = BCMLRD_MAP_TABLE_ATTRIBUTE_ENTRY_LIMIT, .value = 1, }, { /* 1 */ .key = BCMLRD_MAP_TABLE_ATTRIBUTE_INTERACTIVE, .value = FALSE, }, }; static const bcmlrd_map_attr_t bcm56880_a0_lrd_ser_notificationt_attr_group = { .attributes = 2, .attr = bcm56880_a0_lrd_ser_notificationt_attr_entry, }; static const bcmlrd_map_entry_t bcm56880_a0_lrd_bcmimm_ser_notification_entry[] = { { /* 0 */ .entry_type = BCMLRD_MAP_ENTRY_TABLE_HANDLER, .desc = { .field_id = 0, .field_idx = 0, .minbit = 0, .maxbit = 0, .entry_idx = 0, .reserved = 0 }, .u = { /* handler: bcm56880_a0_lta_bcmimm_ser_notification_cth_handler */ .handler_id = BCMLTD_TABLE_BCM56880_A0_LTA_BCMIMM_SER_NOTIFICATION_CTH_HANDLER_ID } }, }; /* Map conditions */ static const bcmlrd_condition_t bcm56880_a0_lrd_ser_notification_map_condition[] = { { .op = BCMLRD_CONDITION_AND, .table = SER_CONFIGt, .field = SER_CONFIGt_SER_ENABLEf, .value = 1 }, }; static const bcmlrd_cond_expr_t bcm56880_a0_lrd_ser_notification_map_cond_expr[] = { { .num_cond = 1, .cond = bcm56880_a0_lrd_ser_notification_map_condition + 0, }, }; static const bcmlrd_cond_data_t bcm56880_a0_lrd_ser_notification_map_cond = { .table_expr = bcm56880_a0_lrd_ser_notification_map_cond_expr + 0, }; static const bcmlrd_map_group_t bcm56880_a0_lrd_ser_notification_map_group[] = { { .dest = { .kind = BCMLRD_MAP_CUSTOM, .id = 0, }, .entries = 1, .entry = bcm56880_a0_lrd_bcmimm_ser_notification_entry }, }; const bcmlrd_map_t bcm56880_a0_lrd_ser_notification_map = { .src_id = SER_NOTIFICATIONt, .field_data = &bcm56880_a0_lrd_ser_notification_map_field_data, .groups = 1, .group = bcm56880_a0_lrd_ser_notification_map_group, .table_attr = &bcm56880_a0_lrd_ser_notificationt_attr_group, .entry_ops = BCMLRD_MAP_TABLE_ENTRY_OPERATION_LOOKUP | BCMLRD_MAP_TABLE_ENTRY_OPERATION_TRAVERSE, .cond = &bcm56880_a0_lrd_ser_notification_map_cond, };
33.214815
134
0.680196
1e59000f23bde79b274e08e9e24458c44100b568
51,507
h
C
base/Windows/Inc/Ras.h
sphinxlogic/Singularity-RDK-2.0
2968c3b920a5383f7360e3e489aa772f964a7c42
[ "MIT" ]
null
null
null
base/Windows/Inc/Ras.h
sphinxlogic/Singularity-RDK-2.0
2968c3b920a5383f7360e3e489aa772f964a7c42
[ "MIT" ]
null
null
null
base/Windows/Inc/Ras.h
sphinxlogic/Singularity-RDK-2.0
2968c3b920a5383f7360e3e489aa772f964a7c42
[ "MIT" ]
null
null
null
/*++ Copyright (c) Microsoft Corporation. All rights reserved. Module Name: ras.h Abstract: Remote Access external API WINVER values in this file: WINVER < 0x400 = Windows NT 3.5, Windows NT 3.51 WINVER = 0x400 = Windows 95, Windows98, Windows NT4 (default) WINVER > 0x400 = Windows NT4 enhancements WINVER = 0x500 = Windows 2000 --*/ #ifndef _RAS_H_ #define _RAS_H_ #if _MSC_VER > 1000 #pragma once #endif #ifdef __cplusplus extern "C" { #endif #ifndef UNLEN #include <lmcons.h> #endif #include <pshpack4.h> #define RAS_MaxDeviceType 16 #define RAS_MaxPhoneNumber 128 #define RAS_MaxIpAddress 15 #define RAS_MaxIpxAddress 21 #if (WINVER >= 0x400) #define RAS_MaxEntryName 256 #define RAS_MaxDeviceName 128 #define RAS_MaxCallbackNumber RAS_MaxPhoneNumber #else #define RAS_MaxEntryName 20 #define RAS_MaxDeviceName 32 #define RAS_MaxCallbackNumber 48 #endif #define RAS_MaxAreaCode 10 #define RAS_MaxPadType 32 #define RAS_MaxX25Address 200 #define RAS_MaxFacilities 200 #define RAS_MaxUserData 200 #define RAS_MaxReplyMessage 1024 #define RAS_MaxDnsSuffix 256 DECLARE_HANDLE( HRASCONN ); #define LPHRASCONN HRASCONN* #if (WINVER >= 0x501) #define RASCF_AllUsers 0x00000001 #define RASCF_GlobalCreds 0x00000002 #endif /* Identifies an active RAS connection. (See RasEnumConnections) */ #define RASCONNW struct tagRASCONNW RASCONNW { DWORD dwSize; HRASCONN hrasconn; WCHAR szEntryName[ RAS_MaxEntryName + 1 ]; #if (WINVER >= 0x400) WCHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; WCHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; #endif #if (WINVER >= 0x401) WCHAR szPhonebook [ MAX_PATH ]; DWORD dwSubEntry; #endif #if (WINVER >= 0x500) GUID guidEntry; #endif #if (WINVER >= 0x501) DWORD dwFlags; LUID luid; #endif }; #define RASCONNA struct tagRASCONNA RASCONNA { DWORD dwSize; HRASCONN hrasconn; CHAR szEntryName[ RAS_MaxEntryName + 1 ]; #if (WINVER >= 0x400) CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; CHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; #endif #if (WINVER >= 0x401) CHAR szPhonebook [ MAX_PATH ]; DWORD dwSubEntry; #endif #if (WINVER >= 0x500) GUID guidEntry; #endif #if (WINVER >= 0x501) DWORD dwFlags; LUID luid; #endif }; #ifdef UNICODE #define RASCONN RASCONNW #else #define RASCONN RASCONNA #endif #define LPRASCONNW RASCONNW* #define LPRASCONNA RASCONNA* #define LPRASCONN RASCONN* /* Enumerates intermediate states to a connection. (See RasDial) */ #define RASCS_PAUSED 0x1000 #define RASCS_DONE 0x2000 #define RASCONNSTATE enum tagRASCONNSTATE RASCONNSTATE { RASCS_OpenPort = 0, RASCS_PortOpened, RASCS_ConnectDevice, RASCS_DeviceConnected, RASCS_AllDevicesConnected, RASCS_Authenticate, RASCS_AuthNotify, RASCS_AuthRetry, RASCS_AuthCallback, RASCS_AuthChangePassword, RASCS_AuthProject, RASCS_AuthLinkSpeed, RASCS_AuthAck, RASCS_ReAuthenticate, RASCS_Authenticated, RASCS_PrepareForCallback, RASCS_WaitForModemReset, RASCS_WaitForCallback, RASCS_Projected, #if (WINVER >= 0x400) RASCS_StartAuthentication, RASCS_CallbackComplete, RASCS_LogonNetwork, #endif RASCS_SubEntryConnected, RASCS_SubEntryDisconnected, RASCS_Interactive = RASCS_PAUSED, RASCS_RetryAuthentication, RASCS_CallbackSetByCaller, RASCS_PasswordExpired, #if (WINVER >= 0x500) RASCS_InvokeEapUI, #endif RASCS_Connected = RASCS_DONE, RASCS_Disconnected }; #define LPRASCONNSTATE RASCONNSTATE* /* Describes the status of a RAS connection. (See RasConnectionStatus) */ #define RASCONNSTATUSW struct tagRASCONNSTATUSW RASCONNSTATUSW { DWORD dwSize; RASCONNSTATE rasconnstate; DWORD dwError; WCHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; WCHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; #if (WINVER >= 0x401) WCHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; #endif }; #define RASCONNSTATUSA struct tagRASCONNSTATUSA RASCONNSTATUSA { DWORD dwSize; RASCONNSTATE rasconnstate; DWORD dwError; CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; CHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; #if (WINVER >= 0x401) CHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; #endif }; #ifdef UNICODE #define RASCONNSTATUS RASCONNSTATUSW #else #define RASCONNSTATUS RASCONNSTATUSA #endif #define LPRASCONNSTATUSW RASCONNSTATUSW* #define LPRASCONNSTATUSA RASCONNSTATUSA* #define LPRASCONNSTATUS RASCONNSTATUS* /* Describes connection establishment parameters. (See RasDial) */ #define RASDIALPARAMSW struct tagRASDIALPARAMSW RASDIALPARAMSW { DWORD dwSize; WCHAR szEntryName[ RAS_MaxEntryName + 1 ]; WCHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; WCHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ]; WCHAR szUserName[ UNLEN + 1 ]; WCHAR szPassword[ PWLEN + 1 ]; WCHAR szDomain[ DNLEN + 1 ]; #if (WINVER >= 0x401) DWORD dwSubEntry; ULONG_PTR dwCallbackId; #endif }; #define RASDIALPARAMSA struct tagRASDIALPARAMSA RASDIALPARAMSA { DWORD dwSize; CHAR szEntryName[ RAS_MaxEntryName + 1 ]; CHAR szPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; CHAR szCallbackNumber[ RAS_MaxCallbackNumber + 1 ]; CHAR szUserName[ UNLEN + 1 ]; CHAR szPassword[ PWLEN + 1 ]; CHAR szDomain[ DNLEN + 1 ]; #if (WINVER >= 0x401) DWORD dwSubEntry; ULONG_PTR dwCallbackId; #endif }; #ifdef UNICODE #define RASDIALPARAMS RASDIALPARAMSW #else #define RASDIALPARAMS RASDIALPARAMSA #endif #define LPRASDIALPARAMSW RASDIALPARAMSW* #define LPRASDIALPARAMSA RASDIALPARAMSA* #define LPRASDIALPARAMS RASDIALPARAMS* #if (WINVER >= 0x500) #define RASEAPINFO struct tagRASEAPINFO RASEAPINFO { DWORD dwSizeofEapInfo; BYTE *pbEapInfo; }; #endif /* Describes extended connection establishment options. (See RasDial) */ #define RASDIALEXTENSIONS struct tagRASDIALEXTENSIONS RASDIALEXTENSIONS { DWORD dwSize; DWORD dwfOptions; HWND hwndParent; ULONG_PTR reserved; #if (WINVER >= 0x500) ULONG_PTR reserved1; RASEAPINFO RasEapInfo; #endif }; #define LPRASDIALEXTENSIONS RASDIALEXTENSIONS* /* 'dwfOptions' bit flags. */ #define RDEOPT_UsePrefixSuffix 0x00000001 #define RDEOPT_PausedStates 0x00000002 #define RDEOPT_IgnoreModemSpeaker 0x00000004 #define RDEOPT_SetModemSpeaker 0x00000008 #define RDEOPT_IgnoreSoftwareCompression 0x00000010 #define RDEOPT_SetSoftwareCompression 0x00000020 #define RDEOPT_DisableConnectedUI 0x00000040 #define RDEOPT_DisableReconnectUI 0x00000080 #define RDEOPT_DisableReconnect 0x00000100 #define RDEOPT_NoUser 0x00000200 #define RDEOPT_PauseOnScript 0x00000400 #define RDEOPT_Router 0x00000800 #if (WINVER >= 0x500) #define RDEOPT_CustomDial 0x00001000 #endif #if (WINVER >= 0x501) #define RDEOPT_UseCustomScripting 0x00002000 #endif // // This flag when set in the RASENTRYNAME structure // indicates that the phonebook to which this entry // belongs is a system phonebook. // #define REN_User 0x00000000 #define REN_AllUsers 0x00000001 /* Describes an enumerated RAS phone book entry name. (See RasEntryEnum) */ #define RASENTRYNAMEW struct tagRASENTRYNAMEW RASENTRYNAMEW { DWORD dwSize; WCHAR szEntryName[ RAS_MaxEntryName + 1 ]; #if (WINVER >= 0x500) // // If this flag is REN_AllUsers then its a // system phonebook. // DWORD dwFlags; WCHAR szPhonebookPath[MAX_PATH + 1]; #endif }; #define RASENTRYNAMEA struct tagRASENTRYNAMEA RASENTRYNAMEA { DWORD dwSize; CHAR szEntryName[ RAS_MaxEntryName + 1 ]; #if (WINVER >= 0x500) DWORD dwFlags; CHAR szPhonebookPath[MAX_PATH + 1]; #endif }; #ifdef UNICODE #define RASENTRYNAME RASENTRYNAMEW #else #define RASENTRYNAME RASENTRYNAMEA #endif #define LPRASENTRYNAMEW RASENTRYNAMEW* #define LPRASENTRYNAMEA RASENTRYNAMEA* #define LPRASENTRYNAME RASENTRYNAME* /* Protocol code to projection data structure mapping. */ #define RASPROJECTION enum tagRASPROJECTION RASPROJECTION { RASP_Amb = 0x10000, RASP_PppNbf = 0x803F, RASP_PppIpx = 0x802B, RASP_PppIp = 0x8021, #if (WINVER >= 0x500) RASP_PppCcp = 0x80FD, #endif RASP_PppLcp = 0xC021, RASP_Slip = 0x20000 }; #define LPRASPROJECTION RASPROJECTION* /* Describes the result of a RAS AMB (Authentication Message Block) ** projection. This protocol is used with NT 3.1 and OS/2 1.3 downlevel ** RAS servers. */ #define RASAMBW struct tagRASAMBW RASAMBW { DWORD dwSize; DWORD dwError; WCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ]; BYTE bLana; }; #define RASAMBA struct tagRASAMBA RASAMBA { DWORD dwSize; DWORD dwError; CHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ]; BYTE bLana; }; #ifdef UNICODE #define RASAMB RASAMBW #else #define RASAMB RASAMBA #endif #define LPRASAMBW RASAMBW* #define LPRASAMBA RASAMBA* #define LPRASAMB RASAMB* /* Describes the result of a PPP NBF (NetBEUI) projection. */ #define RASPPPNBFW struct tagRASPPPNBFW RASPPPNBFW { DWORD dwSize; DWORD dwError; DWORD dwNetBiosError; WCHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ]; WCHAR szWorkstationName[ NETBIOS_NAME_LEN + 1 ]; BYTE bLana; }; #define RASPPPNBFA struct tagRASPPPNBFA RASPPPNBFA { DWORD dwSize; DWORD dwError; DWORD dwNetBiosError; CHAR szNetBiosError[ NETBIOS_NAME_LEN + 1 ]; CHAR szWorkstationName[ NETBIOS_NAME_LEN + 1 ]; BYTE bLana; }; #ifdef UNICODE #define RASPPPNBF RASPPPNBFW #else #define RASPPPNBF RASPPPNBFA #endif #define LPRASPPPNBFW RASPPPNBFW* #define LPRASPPPNBFA RASPPPNBFA* #define LPRASPPPNBF RASPPPNBF* /* Describes the results of a PPP IPX (Internetwork Packet Exchange) ** projection. */ #define RASPPPIPXW struct tagRASIPXW RASPPPIPXW { DWORD dwSize; DWORD dwError; WCHAR szIpxAddress[ RAS_MaxIpxAddress + 1 ]; }; #define RASPPPIPXA struct tagRASPPPIPXA RASPPPIPXA { DWORD dwSize; DWORD dwError; CHAR szIpxAddress[ RAS_MaxIpxAddress + 1 ]; }; #ifdef UNICODE #define RASPPPIPX RASPPPIPXW #else #define RASPPPIPX RASPPPIPXA #endif #define LPRASPPPIPXW RASPPPIPXW* #define LPRASPPPIPXA RASPPPIPXA* #define LPRASPPPIPX RASPPPIPX* /* Describes the results of a PPP IP (Internet) projection. */ #if (WINVER >= 0x500) /* RASPPPIP 'dwOptions' and 'dwServerOptions' flags. */ #define RASIPO_VJ 0x00000001 #endif #define RASPPPIPW struct tagRASPPPIPW RASPPPIPW { DWORD dwSize; DWORD dwError; WCHAR szIpAddress[ RAS_MaxIpAddress + 1 ]; #ifndef WINNT35COMPATIBLE /* This field was added between Windows NT 3.51 beta and Windows NT 3.51 ** final, and between Windows 95 M8 beta and Windows 95 final. If you do ** not require the server address and wish to retrieve PPP IP information ** from Windows NT 3.5 or early Windows NT 3.51 betas, or on early Windows ** 95 betas, define WINNT35COMPATIBLE. ** ** The server IP address is not provided by all PPP implementations, ** though Windows NT server's do provide it. */ WCHAR szServerIpAddress[ RAS_MaxIpAddress + 1 ]; #endif #if (WINVER >= 0x500) DWORD dwOptions; DWORD dwServerOptions; #endif }; #define RASPPPIPA struct tagRASPPPIPA RASPPPIPA { DWORD dwSize; DWORD dwError; CHAR szIpAddress[ RAS_MaxIpAddress + 1 ]; #ifndef WINNT35COMPATIBLE /* See RASPPPIPW comment. */ CHAR szServerIpAddress[ RAS_MaxIpAddress + 1 ]; #endif #if (WINVER >= 0x500) DWORD dwOptions; DWORD dwServerOptions; #endif }; #ifdef UNICODE #define RASPPPIP RASPPPIPW #else #define RASPPPIP RASPPPIPA #endif #define LPRASPPPIPW RASPPPIPW* #define LPRASPPPIPA RASPPPIPA* #define LPRASPPPIP RASPPPIP* /* Describes the results of a PPP LCP/multi-link negotiation. */ #if (WINVER >= 0x500) /* RASPPPLCP 'dwAuthenticatonProtocol' values. */ #define RASLCPAP_PAP 0xC023 #define RASLCPAP_SPAP 0xC027 #define RASLCPAP_CHAP 0xC223 #define RASLCPAP_EAP 0xC227 /* RASPPPLCP 'dwAuthenticatonData' values. */ #define RASLCPAD_CHAP_MD5 0x05 #define RASLCPAD_CHAP_MS 0x80 #define RASLCPAD_CHAP_MSV2 0x81 /* RASPPPLCP 'dwOptions' and 'dwServerOptions' flags. */ #define RASLCPO_PFC 0x00000001 #define RASLCPO_ACFC 0x00000002 #define RASLCPO_SSHF 0x00000004 #define RASLCPO_DES_56 0x00000008 #define RASLCPO_3_DES 0x00000010 #endif #define RASPPPLCPW struct tagRASPPPLCPW RASPPPLCPW { DWORD dwSize; BOOL fBundled; #if (WINVER >= 0x500) DWORD dwError; DWORD dwAuthenticationProtocol; DWORD dwAuthenticationData; DWORD dwEapTypeId; DWORD dwServerAuthenticationProtocol; DWORD dwServerAuthenticationData; DWORD dwServerEapTypeId; BOOL fMultilink; DWORD dwTerminateReason; DWORD dwServerTerminateReason; WCHAR szReplyMessage[RAS_MaxReplyMessage]; DWORD dwOptions; DWORD dwServerOptions; #endif }; #define RASPPPLCPA struct tagRASPPPLCPA RASPPPLCPA { DWORD dwSize; BOOL fBundled; #if (WINVER >= 0x500) DWORD dwError; DWORD dwAuthenticationProtocol; DWORD dwAuthenticationData; DWORD dwEapTypeId; DWORD dwServerAuthenticationProtocol; DWORD dwServerAuthenticationData; DWORD dwServerEapTypeId; BOOL fMultilink; DWORD dwTerminateReason; DWORD dwServerTerminateReason; CHAR szReplyMessage[RAS_MaxReplyMessage]; DWORD dwOptions; DWORD dwServerOptions; #endif }; #ifdef UNICODE #define RASPPPLCP RASPPPLCPW #else #define RASPPPLCP RASPPPLCPA #endif #define LPRASPPPLCPW RASPPPLCPW* #define LPRASPPPLCPA RASPPPLCPA* #define LPRASPPPLCP RASPPPLCP* /* Describes the results of a SLIP (Serial Line IP) projection. */ #define RASSLIPW struct tagRASSLIPW RASSLIPW { DWORD dwSize; DWORD dwError; WCHAR szIpAddress[ RAS_MaxIpAddress + 1 ]; }; #define RASSLIPA struct tagRASSLIPA RASSLIPA { DWORD dwSize; DWORD dwError; CHAR szIpAddress[ RAS_MaxIpAddress + 1 ]; }; #ifdef UNICODE #define RASSLIP RASSLIPW #else #define RASSLIP RASSLIPA #endif #define LPRASSLIPW RASSLIPW* #define LPRASSLIPA RASSLIPA* #define LPRASSLIP RASSLIP* #if (WINVER >= 0x500) /* Describes the results of a PPP CCP (Compression Control Protocol) projection. */ /* RASPPPCCP 'dwCompressionAlgorithm' values. */ #define RASCCPCA_MPPC 0x00000006 #define RASCCPCA_STAC 0x00000005 /* RASPPPCCP 'dwOptions' values. */ #define RASCCPO_Compression 0x00000001 #define RASCCPO_HistoryLess 0x00000002 #define RASCCPO_Encryption56bit 0x00000010 #define RASCCPO_Encryption40bit 0x00000020 #define RASCCPO_Encryption128bit 0x00000040 #define RASPPPCCP struct tagRASPPPCCP RASPPPCCP { DWORD dwSize; DWORD dwError; DWORD dwCompressionAlgorithm; DWORD dwOptions; DWORD dwServerCompressionAlgorithm; DWORD dwServerOptions; }; #define LPRASPPPCCP RASPPPCCP* #endif /* If using RasDial message notifications, get the notification message code ** by passing this string to the RegisterWindowMessageA() API. ** WM_RASDIALEVENT is used only if a unique message cannot be registered. */ #define RASDIALEVENT "RasDialEvent" #define WM_RASDIALEVENT 0xCCCD /* Prototypes for caller's RasDial callback handler. Arguments are the ** message ID (currently always WM_RASDIALEVENT), the current RASCONNSTATE and ** the error that has occurred (or 0 if none). Extended arguments are the ** handle of the RAS connection and an extended error code. ** ** For RASDIALFUNC2, subsequent callback notifications for all ** subentries can be cancelled by returning FALSE. */ typedef VOID (WINAPI *RASDIALFUNC)( UINT, RASCONNSTATE, DWORD ); typedef VOID (WINAPI *RASDIALFUNC1)( HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD ); typedef DWORD (WINAPI *RASDIALFUNC2)( ULONG_PTR, DWORD, HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD ); /* Information describing a RAS-capable device. */ #define RASDEVINFOW struct tagRASDEVINFOW RASDEVINFOW { DWORD dwSize; WCHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; WCHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; }; #define RASDEVINFOA struct tagRASDEVINFOA RASDEVINFOA { DWORD dwSize; CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; CHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; }; #ifdef UNICODE #define RASDEVINFO RASDEVINFOW #else #define RASDEVINFO RASDEVINFOA #endif #define LPRASDEVINFOW RASDEVINFOW* #define LPRASDEVINFOA RASDEVINFOA* #define LPRASDEVINFO RASDEVINFO* /* RAS country information (currently retrieved from TAPI). */ #define RASCTRYINFO struct RASCTRYINFO RASCTRYINFO { DWORD dwSize; DWORD dwCountryID; DWORD dwNextCountryID; DWORD dwCountryCode; DWORD dwCountryNameOffset; }; /* There is currently no difference between ** RASCTRYINFOA and RASCTRYINFOW. This may ** change in the future. */ #define RASCTRYINFOW RASCTRYINFO #define RASCTRYINFOA RASCTRYINFO #define LPRASCTRYINFOW RASCTRYINFOW* #define LPRASCTRYINFOA RASCTRYINFOW* #define LPRASCTRYINFO RASCTRYINFO* /* A RAS IP address. */ #define RASIPADDR struct RASIPADDR RASIPADDR { BYTE a; BYTE b; BYTE c; BYTE d; }; #if (WINVER >= 0x500) #define ET_None 0 // No encryption #define ET_Require 1 // Require Encryption #define ET_RequireMax 2 // Require max encryption #define ET_Optional 3 // Do encryption if possible. None Ok. #endif #define VS_Default 0 // default (PPTP for now) #define VS_PptpOnly 1 // Only PPTP is attempted. #define VS_PptpFirst 2 // PPTP is tried first. #define VS_L2tpOnly 3 // Only L2TP is attempted. #define VS_L2tpFirst 4 // L2TP is tried first. /* A RAS phone book entry. */ #define RASENTRYA struct tagRASENTRYA RASENTRYA { DWORD dwSize; DWORD dwfOptions; // // Location/phone number. // DWORD dwCountryID; DWORD dwCountryCode; CHAR szAreaCode[ RAS_MaxAreaCode + 1 ]; CHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; DWORD dwAlternateOffset; // // PPP/Ip // RASIPADDR ipaddr; RASIPADDR ipaddrDns; RASIPADDR ipaddrDnsAlt; RASIPADDR ipaddrWins; RASIPADDR ipaddrWinsAlt; // // Framing // DWORD dwFrameSize; DWORD dwfNetProtocols; DWORD dwFramingProtocol; // // Scripting // CHAR szScript[ MAX_PATH ]; // // AutoDial // CHAR szAutodialDll[ MAX_PATH ]; CHAR szAutodialFunc[ MAX_PATH ]; // // Device // CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; CHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; // // X.25 // CHAR szX25PadType[ RAS_MaxPadType + 1 ]; CHAR szX25Address[ RAS_MaxX25Address + 1 ]; CHAR szX25Facilities[ RAS_MaxFacilities + 1 ]; CHAR szX25UserData[ RAS_MaxUserData + 1 ]; DWORD dwChannels; // // Reserved // DWORD dwReserved1; DWORD dwReserved2; #if (WINVER >= 0x401) // // Multilink // DWORD dwSubEntries; DWORD dwDialMode; DWORD dwDialExtraPercent; DWORD dwDialExtraSampleSeconds; DWORD dwHangUpExtraPercent; DWORD dwHangUpExtraSampleSeconds; // // Idle timeout // DWORD dwIdleDisconnectSeconds; #endif #if (WINVER >= 0x500) // // Entry Type // DWORD dwType; // // Encryption type // DWORD dwEncryptionType; // // CustomAuthKey to be used for EAP // DWORD dwCustomAuthKey; // // Guid of the connection // GUID guidId; // // Custom Dial Dll // CHAR szCustomDialDll[MAX_PATH]; // // DwVpnStrategy // DWORD dwVpnStrategy; #endif #if (WINVER >= 0x501) // // More RASEO_* options // DWORD dwfOptions2; // // For future use // DWORD dwfOptions3; CHAR szDnsSuffix[RAS_MaxDnsSuffix]; DWORD dwTcpWindowSize; CHAR szPrerequisitePbk[MAX_PATH]; CHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DWORD dwRedialCount; DWORD dwRedialPause; #endif }; #define RASENTRYW struct tagRASENTRYW RASENTRYW { DWORD dwSize; DWORD dwfOptions; // // Location/phone number // DWORD dwCountryID; DWORD dwCountryCode; WCHAR szAreaCode[ RAS_MaxAreaCode + 1 ]; WCHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; DWORD dwAlternateOffset; // // PPP/Ip // RASIPADDR ipaddr; RASIPADDR ipaddrDns; RASIPADDR ipaddrDnsAlt; RASIPADDR ipaddrWins; RASIPADDR ipaddrWinsAlt; // // Framing // DWORD dwFrameSize; DWORD dwfNetProtocols; DWORD dwFramingProtocol; // // Scripting // WCHAR szScript[ MAX_PATH ]; // // AutoDial // WCHAR szAutodialDll[ MAX_PATH ]; WCHAR szAutodialFunc[ MAX_PATH ]; // // Device // WCHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; WCHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; // // X.25 // WCHAR szX25PadType[ RAS_MaxPadType + 1 ]; WCHAR szX25Address[ RAS_MaxX25Address + 1 ]; WCHAR szX25Facilities[ RAS_MaxFacilities + 1 ]; WCHAR szX25UserData[ RAS_MaxUserData + 1 ]; DWORD dwChannels; // // Reserved // DWORD dwReserved1; DWORD dwReserved2; #if (WINVER >= 0x401) // // Multilink // DWORD dwSubEntries; DWORD dwDialMode; DWORD dwDialExtraPercent; DWORD dwDialExtraSampleSeconds; DWORD dwHangUpExtraPercent; DWORD dwHangUpExtraSampleSeconds; // // Idle timeout // DWORD dwIdleDisconnectSeconds; #endif #if (WINVER >= 0x500) // // Entry Type // DWORD dwType; // // EncryptionType // DWORD dwEncryptionType; // // CustomAuthKey to be used for EAP // DWORD dwCustomAuthKey; // // Guid of the connection // GUID guidId; // // Custom Dial Dll // WCHAR szCustomDialDll[MAX_PATH]; // // Vpn Strategy // DWORD dwVpnStrategy; #endif #if (WINVER >= 0x501) // // More RASEO_* options // DWORD dwfOptions2; // // For future use // DWORD dwfOptions3; WCHAR szDnsSuffix[RAS_MaxDnsSuffix]; DWORD dwTcpWindowSize; WCHAR szPrerequisitePbk[MAX_PATH]; WCHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DWORD dwRedialCount; DWORD dwRedialPause; #endif }; #ifdef UNICODE #define RASENTRY RASENTRYW #else #define RASENTRY RASENTRYA #endif #define LPRASENTRYW RASENTRYW* #define LPRASENTRYA RASENTRYA* #define LPRASENTRY RASENTRY* /* RASENTRY 'dwfOptions' bit flags. */ #define RASEO_UseCountryAndAreaCodes 0x00000001 #define RASEO_SpecificIpAddr 0x00000002 #define RASEO_SpecificNameServers 0x00000004 #define RASEO_IpHeaderCompression 0x00000008 #define RASEO_RemoteDefaultGateway 0x00000010 #define RASEO_DisableLcpExtensions 0x00000020 #define RASEO_TerminalBeforeDial 0x00000040 #define RASEO_TerminalAfterDial 0x00000080 #define RASEO_ModemLights 0x00000100 #define RASEO_SwCompression 0x00000200 #define RASEO_RequireEncryptedPw 0x00000400 #define RASEO_RequireMsEncryptedPw 0x00000800 #define RASEO_RequireDataEncryption 0x00001000 #define RASEO_NetworkLogon 0x00002000 #define RASEO_UseLogonCredentials 0x00004000 #define RASEO_PromoteAlternates 0x00008000 #if (WINVER >= 0x401) #define RASEO_SecureLocalFiles 0x00010000 #endif #if (WINVER >= 0x500) #define RASEO_RequireEAP 0x00020000 #define RASEO_RequirePAP 0x00040000 #define RASEO_RequireSPAP 0x00080000 #define RASEO_Custom 0x00100000 #define RASEO_PreviewPhoneNumber 0x00200000 #define RASEO_SharedPhoneNumbers 0x00800000 #define RASEO_PreviewUserPw 0x01000000 #define RASEO_PreviewDomain 0x02000000 #define RASEO_ShowDialingProgress 0x04000000 #define RASEO_RequireCHAP 0x08000000 #define RASEO_RequireMsCHAP 0x10000000 #define RASEO_RequireMsCHAP2 0x20000000 #define RASEO_RequireW95MSCHAP 0x40000000 #define RASEO_CustomScript 0x80000000 #endif #if (WINVER >= 0x501) // // RASENTRY dwfOptions2 bit flags // #define RASEO2_SecureFileAndPrint 0x00000001 #define RASEO2_SecureClientForMSNet 0x00000002 #define RASEO2_DontNegotiateMultilink 0x00000004 #define RASEO2_DontUseRasCredentials 0x00000008 #define RASEO2_UsePreSharedKey 0x00000010 #define RASEO2_Internet 0x00000020 #define RASEO2_DisableNbtOverIP 0x00000040 #define RASEO2_UseGlobalDeviceSettings 0x00000080 #define RASEO2_ReconnectIfDropped 0x00000100 #define RASEO2_SharePhoneNumbers 0x00000200 #endif /* RASENTRY 'dwProtocols' bit flags. */ #define RASNP_NetBEUI 0x00000001 #define RASNP_Ipx 0x00000002 #define RASNP_Ip 0x00000004 /* RASENTRY 'dwFramingProtocols' bit flags. */ #define RASFP_Ppp 0x00000001 #define RASFP_Slip 0x00000002 #define RASFP_Ras 0x00000004 /* RASENTRY 'szDeviceType' default strings. */ #define RASDT_Modem TEXT("modem") #define RASDT_Isdn TEXT("isdn") #define RASDT_X25 TEXT("x25") #define RASDT_Vpn TEXT("vpn") #define RASDT_Pad TEXT("pad") #define RASDT_Generic TEXT("GENERIC") #define RASDT_Serial TEXT("SERIAL") #define RASDT_FrameRelay TEXT("FRAMERELAY") #define RASDT_Atm TEXT("ATM") #define RASDT_Sonet TEXT("SONET") #define RASDT_SW56 TEXT("SW56") #define RASDT_Irda TEXT("IRDA") #define RASDT_Parallel TEXT("PARALLEL") #if (WINVER >= 0x501) #define RASDT_PPPoE TEXT("PPPoE") #endif // The entry type used to determine which UI properties // are to be presented to user. This generally corresponds // to a Connections "add" wizard selection. // #define RASET_Phone 1 // Phone lines: modem, ISDN, X.25, etc #define RASET_Vpn 2 // Virtual private network #define RASET_Direct 3 // Direct connect: serial, parallel #define RASET_Internet 4 // BaseCamp internet #if (WINVER >= 0x501) #define RASET_Broadband 5 // Broadband #endif /* Old AutoDial DLL function prototype. ** ** This prototype is documented for backward-compatibility ** purposes only. It is superceded by the RASADFUNCA ** and RASADFUNCW definitions below. DO NOT USE THIS ** PROTOTYPE IN NEW CODE. SUPPORT FOR IT MAY BE REMOVED ** IN FUTURE VERSIONS OF RAS. */ typedef BOOL (WINAPI *ORASADFUNC)( HWND, LPSTR, DWORD, LPDWORD ); #if (WINVER >= 0x400) /* Flags for RasConnectionNotification(). */ #define RASCN_Connection 0x00000001 #define RASCN_Disconnection 0x00000002 #define RASCN_BandwidthAdded 0x00000004 #define RASCN_BandwidthRemoved 0x00000008 #endif #if (WINVER >= 0x401) /* RASENTRY 'dwDialMode' values. */ #define RASEDM_DialAll 1 #define RASEDM_DialAsNeeded 2 /* RASENTRY 'dwIdleDisconnectSeconds' constants. */ #define RASIDS_Disabled 0xffffffff #define RASIDS_UseGlobalValue 0 /* AutoDial DLL function parameter block. */ #define RASADPARAMS struct tagRASADPARAMS RASADPARAMS { DWORD dwSize; HWND hwndOwner; DWORD dwFlags; LONG xDlg; LONG yDlg; }; #define LPRASADPARAMS RASADPARAMS* /* AutoDial DLL function parameter block 'dwFlags.' */ #define RASADFLG_PositionDlg 0x00000001 /* Prototype AutoDial DLL function. */ typedef BOOL (WINAPI *RASADFUNCA)( LPSTR, LPSTR, LPRASADPARAMS, LPDWORD ); typedef BOOL (WINAPI *RASADFUNCW)( LPWSTR, LPWSTR, LPRASADPARAMS, LPDWORD ); #ifdef UNICODE #define RASADFUNC RASADFUNCW #else #define RASADFUNC RASADFUNCA #endif /* A RAS phone book multilinked sub-entry. */ #define RASSUBENTRYA struct tagRASSUBENTRYA RASSUBENTRYA { DWORD dwSize; DWORD dwfFlags; // // Device // CHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; CHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; // // Phone numbers // CHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; DWORD dwAlternateOffset; }; #define RASSUBENTRYW struct tagRASSUBENTRYW RASSUBENTRYW { DWORD dwSize; DWORD dwfFlags; // // Device // WCHAR szDeviceType[ RAS_MaxDeviceType + 1 ]; WCHAR szDeviceName[ RAS_MaxDeviceName + 1 ]; // // Phone numbers // WCHAR szLocalPhoneNumber[ RAS_MaxPhoneNumber + 1 ]; DWORD dwAlternateOffset; }; #ifdef UNICODE #define RASSUBENTRY RASSUBENTRYW #else #define RASSUBENTRY RASSUBENTRYA #endif #define LPRASSUBENTRYW RASSUBENTRYW* #define LPRASSUBENTRYA RASSUBENTRYA* #define LPRASSUBENTRY RASSUBENTRY* /* Ras{Get,Set}Credentials structure. These calls ** supercede Ras{Get,Set}EntryDialParams. */ #define RASCREDENTIALSA struct tagRASCREDENTIALSA RASCREDENTIALSA { DWORD dwSize; DWORD dwMask; CHAR szUserName[ UNLEN + 1 ]; CHAR szPassword[ PWLEN + 1 ]; CHAR szDomain[ DNLEN + 1 ]; }; #define RASCREDENTIALSW struct tagRASCREDENTIALSW RASCREDENTIALSW { DWORD dwSize; DWORD dwMask; WCHAR szUserName[ UNLEN + 1 ]; WCHAR szPassword[ PWLEN + 1 ]; WCHAR szDomain[ DNLEN + 1 ]; }; #ifdef UNICODE #define RASCREDENTIALS RASCREDENTIALSW #else #define RASCREDENTIALS RASCREDENTIALSA #endif #define LPRASCREDENTIALSW RASCREDENTIALSW* #define LPRASCREDENTIALSA RASCREDENTIALSA* #define LPRASCREDENTIALS RASCREDENTIALS* /* RASCREDENTIALS 'dwMask' values. */ #define RASCM_UserName 0x00000001 #define RASCM_Password 0x00000002 #define RASCM_Domain 0x00000004 #if (WINVER >= 501) #define RASCM_DefaultCreds 0x00000008 #define RASCM_PreSharedKey 0x00000010 #define RASCM_ServerPreSharedKey 0x00000020 #define RASCM_DDMPreSharedKey 0x00000040 #endif /* AutoDial address properties. */ #define RASAUTODIALENTRYA struct tagRASAUTODIALENTRYA RASAUTODIALENTRYA { DWORD dwSize; DWORD dwFlags; DWORD dwDialingLocation; CHAR szEntry[ RAS_MaxEntryName + 1]; }; #define RASAUTODIALENTRYW struct tagRASAUTODIALENTRYW RASAUTODIALENTRYW { DWORD dwSize; DWORD dwFlags; DWORD dwDialingLocation; WCHAR szEntry[ RAS_MaxEntryName + 1]; }; #ifdef UNICODE #define RASAUTODIALENTRY RASAUTODIALENTRYW #else #define RASAUTODIALENTRY RASAUTODIALENTRYA #endif #define LPRASAUTODIALENTRYW RASAUTODIALENTRYW* #define LPRASAUTODIALENTRYA RASAUTODIALENTRYA* #define LPRASAUTODIALENTRY RASAUTODIALENTRY* /* AutoDial control parameter values for ** Ras{Get,Set}AutodialParam. */ #define RASADP_DisableConnectionQuery 0 #define RASADP_LoginSessionDisable 1 #define RASADP_SavedAddressesLimit 2 #define RASADP_FailedConnectionTimeout 3 #define RASADP_ConnectionQueryTimeout 4 #endif // (WINVER >= 0x401) #if (WINVER >= 0x500) /* RasGetEapUserIdentity bit flags. ** These have the same values as the RAS_EAP_FLAG_ flags in raseapif.h */ #define RASEAPF_NonInteractive 0x00000002 #define RASEAPF_Logon 0x00000004 #define RASEAPF_Preview 0x00000008 /* RasGetEapUserIdentity structure. */ #define RASEAPUSERIDENTITYA struct tagRASEAPUSERIDENTITYA RASEAPUSERIDENTITYA { CHAR szUserName[ UNLEN + 1 ]; DWORD dwSizeofEapInfo; BYTE pbEapInfo[ 1 ]; }; #define RASEAPUSERIDENTITYW struct tagRASEAPUSERIDENTITYW RASEAPUSERIDENTITYW { WCHAR szUserName[ UNLEN + 1 ]; DWORD dwSizeofEapInfo; BYTE pbEapInfo[ 1 ]; }; #ifdef UNICODE #define RASEAPUSERIDENTITY RASEAPUSERIDENTITYW #else #define RASEAPUSERIDENTITY RASEAPUSERIDENTITYA #endif #define LPRASEAPUSERIDENTITYW RASEAPUSERIDENTITYW* #define LPRASEAPUSERIDENTITYA RASEAPUSERIDENTITYA* typedef DWORD (WINAPI *PFNRASGETBUFFER) ( PBYTE *ppBuffer, PDWORD pdwSize ); typedef DWORD (WINAPI *PFNRASFREEBUFFER) ( PBYTE pBufer); typedef DWORD (WINAPI *PFNRASSENDBUFFER) ( HANDLE hPort, PBYTE pBuffer, DWORD dwSize ); typedef DWORD (WINAPI *PFNRASRECEIVEBUFFER) ( HANDLE hPort, PBYTE pBuffer, PDWORD pdwSize, DWORD dwTimeOut, HANDLE hEvent ); typedef DWORD (WINAPI *PFNRASRETRIEVEBUFFER) ( HANDLE hPort, PBYTE pBuffer, PDWORD pdwSize ); typedef DWORD (WINAPI *RasCustomScriptExecuteFn) ( HANDLE hPort, LPCWSTR lpszPhonebook, LPCWSTR lpszEntryName, PFNRASGETBUFFER pfnRasGetBuffer, PFNRASFREEBUFFER pfnRasFreeBuffer, PFNRASSENDBUFFER pfnRasSendBuffer, PFNRASRECEIVEBUFFER pfnRasReceiveBuffer, PFNRASRETRIEVEBUFFER pfnRasRetrieveBuffer, HWND hWnd, RASDIALPARAMS *pRasDialParams, PVOID pvReserved ); #endif // (WINVER >= 0x500) #if (WINVER >= 0x0501) #define RASCOMMSETTINGS struct tagRASCOMMSETTINGS RASCOMMSETTINGS { DWORD dwSize; BYTE bParity; BYTE bStop; BYTE bByteSize; BYTE bAlign; }; typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) ( HANDLE hPort, RASCOMMSETTINGS *pRasCommSettings, PVOID pvReserved ); #define RASCUSTOMSCRIPTEXTENSIONS struct tagRASCUSTOMSCRIPTEXTENSIONS RASCUSTOMSCRIPTEXTENSIONS { DWORD dwSize; PFNRASSETCOMMSETTINGS pfnRasSetCommSettings; }; #endif /* External RAS API function prototypes. */ DWORD APIENTRY RasDialA( LPRASDIALEXTENSIONS, LPCSTR, LPRASDIALPARAMSA, DWORD, LPVOID, LPHRASCONN ); DWORD APIENTRY RasDialW( LPRASDIALEXTENSIONS, LPCWSTR, LPRASDIALPARAMSW, DWORD, LPVOID, LPHRASCONN ); DWORD APIENTRY RasEnumConnectionsA( LPRASCONNA, LPDWORD, LPDWORD ); DWORD APIENTRY RasEnumConnectionsW( LPRASCONNW, LPDWORD, LPDWORD ); DWORD APIENTRY RasEnumEntriesA( LPCSTR, LPCSTR, LPRASENTRYNAMEA, LPDWORD, LPDWORD ); DWORD APIENTRY RasEnumEntriesW( LPCWSTR, LPCWSTR, LPRASENTRYNAMEW, LPDWORD, LPDWORD ); DWORD APIENTRY RasGetConnectStatusA( HRASCONN, LPRASCONNSTATUSA ); DWORD APIENTRY RasGetConnectStatusW( HRASCONN, LPRASCONNSTATUSW ); DWORD APIENTRY RasGetErrorStringA( UINT, LPSTR, DWORD ); DWORD APIENTRY RasGetErrorStringW( UINT, LPWSTR, DWORD ); DWORD APIENTRY RasHangUpA( HRASCONN ); DWORD APIENTRY RasHangUpW( HRASCONN ); DWORD APIENTRY RasGetProjectionInfoA( HRASCONN, RASPROJECTION, LPVOID, LPDWORD ); DWORD APIENTRY RasGetProjectionInfoW( HRASCONN, RASPROJECTION, LPVOID, LPDWORD ); DWORD APIENTRY RasCreatePhonebookEntryA( HWND, LPCSTR ); DWORD APIENTRY RasCreatePhonebookEntryW( HWND, LPCWSTR ); DWORD APIENTRY RasEditPhonebookEntryA( HWND, LPCSTR, LPCSTR ); DWORD APIENTRY RasEditPhonebookEntryW( HWND, LPCWSTR, LPCWSTR ); DWORD APIENTRY RasSetEntryDialParamsA( LPCSTR, LPRASDIALPARAMSA, BOOL ); DWORD APIENTRY RasSetEntryDialParamsW( LPCWSTR, LPRASDIALPARAMSW, BOOL ); DWORD APIENTRY RasGetEntryDialParamsA( LPCSTR, LPRASDIALPARAMSA, LPBOOL ); DWORD APIENTRY RasGetEntryDialParamsW( LPCWSTR, LPRASDIALPARAMSW, LPBOOL ); DWORD APIENTRY RasEnumDevicesA( LPRASDEVINFOA, LPDWORD, LPDWORD ); DWORD APIENTRY RasEnumDevicesW( LPRASDEVINFOW, LPDWORD, LPDWORD ); DWORD APIENTRY RasGetCountryInfoA( LPRASCTRYINFOA, LPDWORD ); DWORD APIENTRY RasGetCountryInfoW( LPRASCTRYINFOW, LPDWORD ); DWORD APIENTRY RasGetEntryPropertiesA( LPCSTR, LPCSTR, LPRASENTRYA, LPDWORD, LPBYTE, LPDWORD ); DWORD APIENTRY RasGetEntryPropertiesW( LPCWSTR, LPCWSTR, LPRASENTRYW, LPDWORD, LPBYTE, LPDWORD ); DWORD APIENTRY RasSetEntryPropertiesA( LPCSTR, LPCSTR, LPRASENTRYA, DWORD, LPBYTE, DWORD ); DWORD APIENTRY RasSetEntryPropertiesW( LPCWSTR, LPCWSTR, LPRASENTRYW, DWORD, LPBYTE, DWORD ); DWORD APIENTRY RasRenameEntryA( LPCSTR, LPCSTR, LPCSTR ); DWORD APIENTRY RasRenameEntryW( LPCWSTR, LPCWSTR, LPCWSTR ); DWORD APIENTRY RasDeleteEntryA( LPCSTR, LPCSTR ); DWORD APIENTRY RasDeleteEntryW( LPCWSTR, LPCWSTR ); DWORD APIENTRY RasValidateEntryNameA( LPCSTR, LPCSTR ); DWORD APIENTRY RasValidateEntryNameW( LPCWSTR, LPCWSTR ); DWORD APIENTRY RasConnectionNotificationA( HRASCONN, HANDLE, DWORD ); DWORD APIENTRY RasConnectionNotificationW( HRASCONN, HANDLE, DWORD ); #if (WINVER >= 0x401) DWORD APIENTRY RasGetSubEntryHandleA( HRASCONN, DWORD, LPHRASCONN ); DWORD APIENTRY RasGetSubEntryHandleW( HRASCONN, DWORD, LPHRASCONN ); DWORD APIENTRY RasGetCredentialsA( LPCSTR, LPCSTR, LPRASCREDENTIALSA); DWORD APIENTRY RasGetCredentialsW( LPCWSTR, LPCWSTR, LPRASCREDENTIALSW ); DWORD APIENTRY RasSetCredentialsA( LPCSTR, LPCSTR, LPRASCREDENTIALSA, BOOL ); DWORD APIENTRY RasSetCredentialsW( LPCWSTR, LPCWSTR, LPRASCREDENTIALSW, BOOL ); DWORD APIENTRY RasGetSubEntryPropertiesA( LPCSTR, LPCSTR, DWORD, LPRASSUBENTRYA, LPDWORD, LPBYTE, LPDWORD ); DWORD APIENTRY RasGetSubEntryPropertiesW( LPCWSTR, LPCWSTR, DWORD, LPRASSUBENTRYW, LPDWORD, LPBYTE, LPDWORD ); DWORD APIENTRY RasSetSubEntryPropertiesA( LPCSTR, LPCSTR, DWORD, LPRASSUBENTRYA, DWORD, LPBYTE, DWORD ); DWORD APIENTRY RasSetSubEntryPropertiesW( LPCWSTR, LPCWSTR, DWORD, LPRASSUBENTRYW, DWORD, LPBYTE, DWORD ); DWORD APIENTRY RasGetAutodialAddressA( LPCSTR, LPDWORD, LPRASAUTODIALENTRYA, LPDWORD, LPDWORD ); DWORD APIENTRY RasGetAutodialAddressW( LPCWSTR, LPDWORD, LPRASAUTODIALENTRYW, LPDWORD, LPDWORD); DWORD APIENTRY RasSetAutodialAddressA( LPCSTR, DWORD, LPRASAUTODIALENTRYA, DWORD, DWORD ); DWORD APIENTRY RasSetAutodialAddressW( LPCWSTR, DWORD, LPRASAUTODIALENTRYW, DWORD, DWORD ); DWORD APIENTRY RasEnumAutodialAddressesA( LPSTR *, LPDWORD, LPDWORD ); DWORD APIENTRY RasEnumAutodialAddressesW( LPWSTR *, LPDWORD, LPDWORD ); DWORD APIENTRY RasGetAutodialEnableA( DWORD, LPBOOL ); DWORD APIENTRY RasGetAutodialEnableW( DWORD, LPBOOL ); DWORD APIENTRY RasSetAutodialEnableA( DWORD, BOOL ); DWORD APIENTRY RasSetAutodialEnableW( DWORD, BOOL ); DWORD APIENTRY RasGetAutodialParamA( DWORD, LPVOID, LPDWORD ); DWORD APIENTRY RasGetAutodialParamW( DWORD, LPVOID, LPDWORD ); DWORD APIENTRY RasSetAutodialParamA( DWORD, LPVOID, DWORD ); DWORD APIENTRY RasSetAutodialParamW( DWORD, LPVOID, DWORD ); #endif #if (WINVER >= 0x500) typedef struct _RAS_STATS { DWORD dwSize; DWORD dwBytesXmited; DWORD dwBytesRcved; DWORD dwFramesXmited; DWORD dwFramesRcved; DWORD dwCrcErr; DWORD dwTimeoutErr; DWORD dwAlignmentErr; DWORD dwHardwareOverrunErr; DWORD dwFramingErr; DWORD dwBufferOverrunErr; DWORD dwCompressionRatioIn; DWORD dwCompressionRatioOut; DWORD dwBps; DWORD dwConnectDuration; } RAS_STATS, *PRAS_STATS; typedef DWORD (WINAPI *RasCustomHangUpFn) ( HRASCONN hRasConn ); typedef DWORD (WINAPI *RasCustomDialFn) ( HINSTANCE hInstDll, LPRASDIALEXTENSIONS lpRasDialExtensions, LPCWSTR lpszPhonebook, LPRASDIALPARAMS lpRasDialParams, DWORD dwNotifierType, LPVOID lpvNotifier, LPHRASCONN lphRasConn, DWORD dwFlags ); typedef DWORD (WINAPI *RasCustomDeleteEntryNotifyFn) ( LPCWSTR lpszPhonebook, LPCWSTR lpszEntry, DWORD dwFlags); #define RCD_SingleUser 0 #define RCD_AllUsers 0x00000001 #define RCD_Eap 0x00000002 #define RCD_Logon 0x00000004 DWORD APIENTRY RasInvokeEapUI( HRASCONN, DWORD, LPRASDIALEXTENSIONS, HWND); DWORD APIENTRY RasGetLinkStatistics(HRASCONN hRasConn, DWORD dwSubEntry, RAS_STATS *lpStatistics); DWORD APIENTRY RasGetConnectionStatistics(HRASCONN hRasConn, RAS_STATS *lpStatistics); DWORD APIENTRY RasClearLinkStatistics(HRASCONN hRasConn, DWORD dwSubEntry); DWORD APIENTRY RasClearConnectionStatistics(HRASCONN hRasConn); DWORD APIENTRY RasGetEapUserDataA( HANDLE hToken, LPCSTR pszPhonebook, LPCSTR pszEntry, BYTE *pbEapData, DWORD *pdwSizeofEapData); DWORD APIENTRY RasGetEapUserDataW( HANDLE hToken, LPCWSTR pszPhonebook, LPCWSTR pszEntry, BYTE *pbEapData, DWORD *pdwSizeofEapData); DWORD APIENTRY RasSetEapUserDataA( HANDLE hToken, LPCSTR pszPhonebook, LPCSTR pszEntry, BYTE *pbEapData, DWORD dwSizeofEapData); DWORD APIENTRY RasSetEapUserDataW( HANDLE hToken, LPCWSTR pszPhonebook, LPCWSTR pszEntry, BYTE *pbEapData, DWORD dwSizeofEapData); DWORD APIENTRY RasGetCustomAuthDataA( LPCSTR pszPhonebook, LPCSTR pszEntry, BYTE *pbCustomAuthData, DWORD *pdwSizeofCustomAuthData); DWORD APIENTRY RasGetCustomAuthDataW( LPCWSTR pszPhonebook, LPCWSTR pszEntry, BYTE *pbCustomAuthData, DWORD *pdwSizeofCustomAuthData); DWORD APIENTRY RasSetCustomAuthDataA( LPCSTR pszPhonebook, LPCSTR pszEntry, BYTE *pbCustomAuthData, DWORD dwSizeofCustomAuthData ); DWORD APIENTRY RasSetCustomAuthDataW( LPCWSTR pszPhonebook, LPCWSTR pszEntry, BYTE *pbCustomAuthData, DWORD dwSizeofCustomAuthData ); DWORD APIENTRY RasGetEapUserIdentityW( LPCWSTR pszPhonebook, LPCWSTR pszEntry, DWORD dwFlags, HWND hwnd, LPRASEAPUSERIDENTITYW* ppRasEapUserIdentity ); DWORD APIENTRY RasGetEapUserIdentityA( LPCSTR pszPhonebook, LPCSTR pszEntry, DWORD dwFlags, HWND hwnd, LPRASEAPUSERIDENTITYA* ppRasEapUserIdentity ); VOID APIENTRY RasFreeEapUserIdentityW( LPRASEAPUSERIDENTITYW pRasEapUserIdentity ); VOID APIENTRY RasFreeEapUserIdentityA( LPRASEAPUSERIDENTITYA pRasEapUserIdentity ); #endif #if (WINVER >= 0x501) DWORD APIENTRY RasDeleteSubEntryA( LPCSTR pszPhonebook, LPCSTR pszEntry, DWORD dwSubentryId); DWORD APIENTRY RasDeleteSubEntryW( LPCWSTR pszPhonebook, LPCWSTR pszEntry, DWORD dwSubEntryId); #endif #ifdef UNICODE #define RasDial RasDialW #define RasEnumConnections RasEnumConnectionsW #define RasEnumEntries RasEnumEntriesW #define RasGetConnectStatus RasGetConnectStatusW #define RasGetErrorString RasGetErrorStringW #define RasHangUp RasHangUpW #define RasGetProjectionInfo RasGetProjectionInfoW #define RasCreatePhonebookEntry RasCreatePhonebookEntryW #define RasEditPhonebookEntry RasEditPhonebookEntryW #define RasSetEntryDialParams RasSetEntryDialParamsW #define RasGetEntryDialParams RasGetEntryDialParamsW #define RasEnumDevices RasEnumDevicesW #define RasGetCountryInfo RasGetCountryInfoW #define RasGetEntryProperties RasGetEntryPropertiesW #define RasSetEntryProperties RasSetEntryPropertiesW #define RasRenameEntry RasRenameEntryW #define RasDeleteEntry RasDeleteEntryW #define RasValidateEntryName RasValidateEntryNameW #if (WINVER >= 0x401) #define RasGetSubEntryHandle RasGetSubEntryHandleW #define RasConnectionNotification RasConnectionNotificationW #define RasGetSubEntryProperties RasGetSubEntryPropertiesW #define RasSetSubEntryProperties RasSetSubEntryPropertiesW #define RasGetCredentials RasGetCredentialsW #define RasSetCredentials RasSetCredentialsW #define RasGetAutodialAddress RasGetAutodialAddressW #define RasSetAutodialAddress RasSetAutodialAddressW #define RasEnumAutodialAddresses RasEnumAutodialAddressesW #define RasGetAutodialEnable RasGetAutodialEnableW #define RasSetAutodialEnable RasSetAutodialEnableW #define RasGetAutodialParam RasGetAutodialParamW #define RasSetAutodialParam RasSetAutodialParamW #endif #if (WINVER >= 0x500) #define RasGetEapUserData RasGetEapUserDataW #define RasSetEapUserData RasSetEapUserDataW #define RasGetCustomAuthData RasGetCustomAuthDataW #define RasSetCustomAuthData RasSetCustomAuthDataW #define RasGetEapUserIdentity RasGetEapUserIdentityW #define RasFreeEapUserIdentity RasFreeEapUserIdentityW #endif #if(WINVER >= 0x501) #define RasDeleteSubEntry RasDeleteSubEntryW #endif #else #define RasDial RasDialA #define RasEnumConnections RasEnumConnectionsA #define RasEnumEntries RasEnumEntriesA #define RasGetConnectStatus RasGetConnectStatusA #define RasGetErrorString RasGetErrorStringA #define RasHangUp RasHangUpA #define RasGetProjectionInfo RasGetProjectionInfoA #define RasCreatePhonebookEntry RasCreatePhonebookEntryA #define RasEditPhonebookEntry RasEditPhonebookEntryA #define RasSetEntryDialParams RasSetEntryDialParamsA #define RasGetEntryDialParams RasGetEntryDialParamsA #define RasEnumDevices RasEnumDevicesA #define RasGetCountryInfo RasGetCountryInfoA #define RasGetEntryProperties RasGetEntryPropertiesA #define RasSetEntryProperties RasSetEntryPropertiesA #define RasRenameEntry RasRenameEntryA #define RasDeleteEntry RasDeleteEntryA #define RasValidateEntryName RasValidateEntryNameA #if (WINVER >= 0x401) #define RasGetSubEntryHandle RasGetSubEntryHandleA #define RasConnectionNotification RasConnectionNotificationA #define RasGetSubEntryProperties RasGetSubEntryPropertiesA #define RasSetSubEntryProperties RasSetSubEntryPropertiesA #define RasGetCredentials RasGetCredentialsA #define RasSetCredentials RasSetCredentialsA #define RasGetAutodialAddress RasGetAutodialAddressA #define RasSetAutodialAddress RasSetAutodialAddressA #define RasEnumAutodialAddresses RasEnumAutodialAddressesA #define RasGetAutodialEnable RasGetAutodialEnableA #define RasSetAutodialEnable RasSetAutodialEnableA #define RasGetAutodialParam RasGetAutodialParamA #define RasSetAutodialParam RasSetAutodialParamA #endif #if (WINVER >= 0x500) #define RasGetEapUserData RasGetEapUserDataA #define RasSetEapUserData RasSetEapUserDataA #define RasGetCustomAuthData RasGetCustomAuthDataA #define RasSetCustomAuthData RasSetCustomAuthDataA #define RasGetEapUserIdentity RasGetEapUserIdentityA #define RasFreeEapUserIdentity RasFreeEapUserIdentityA #endif #if (WINVER >= 0x501) #define RasDeleteSubEntry RasDeleteSubEntryA #endif #endif #ifdef __cplusplus } #endif #include <poppack.h> #endif // _RAS_H_
27.529129
102
0.653406
f028d8cfa4daacba9994ef2602090e3d5dbbae43
13,367
h
C
aws-cpp-sdk-fsx/include/aws/fsx/model/SelfManagedActiveDirectoryAttributes.h
fboranek/aws-sdk-cpp
2aa01e7d5c5431d9702caf9bf21f4e07b6ef15ae
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-fsx/include/aws/fsx/model/SelfManagedActiveDirectoryAttributes.h
fboranek/aws-sdk-cpp
2aa01e7d5c5431d9702caf9bf21f4e07b6ef15ae
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-fsx/include/aws/fsx/model/SelfManagedActiveDirectoryAttributes.h
fboranek/aws-sdk-cpp
2aa01e7d5c5431d9702caf9bf21f4e07b6ef15ae
[ "Apache-2.0" ]
null
null
null
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/fsx/FSx_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace FSx { namespace Model { /** * <p>The configuration of the self-managed Microsoft Active Directory (AD) * directory to which the Windows File Server or ONTAP storage virtual machine * (SVM) instance is joined.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/SelfManagedActiveDirectoryAttributes">AWS * API Reference</a></p> */ class AWS_FSX_API SelfManagedActiveDirectoryAttributes { public: SelfManagedActiveDirectoryAttributes(); SelfManagedActiveDirectoryAttributes(Aws::Utils::Json::JsonView jsonValue); SelfManagedActiveDirectoryAttributes& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline const Aws::String& GetDomainName() const{ return m_domainName; } /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline bool DomainNameHasBeenSet() const { return m_domainNameHasBeenSet; } /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline void SetDomainName(const Aws::String& value) { m_domainNameHasBeenSet = true; m_domainName = value; } /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline void SetDomainName(Aws::String&& value) { m_domainNameHasBeenSet = true; m_domainName = std::move(value); } /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline void SetDomainName(const char* value) { m_domainNameHasBeenSet = true; m_domainName.assign(value); } /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& WithDomainName(const Aws::String& value) { SetDomainName(value); return *this;} /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& WithDomainName(Aws::String&& value) { SetDomainName(std::move(value)); return *this;} /** * <p>The fully qualified domain name of the self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& WithDomainName(const char* value) { SetDomainName(value); return *this;} /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline const Aws::String& GetOrganizationalUnitDistinguishedName() const{ return m_organizationalUnitDistinguishedName; } /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline bool OrganizationalUnitDistinguishedNameHasBeenSet() const { return m_organizationalUnitDistinguishedNameHasBeenSet; } /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline void SetOrganizationalUnitDistinguishedName(const Aws::String& value) { m_organizationalUnitDistinguishedNameHasBeenSet = true; m_organizationalUnitDistinguishedName = value; } /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline void SetOrganizationalUnitDistinguishedName(Aws::String&& value) { m_organizationalUnitDistinguishedNameHasBeenSet = true; m_organizationalUnitDistinguishedName = std::move(value); } /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline void SetOrganizationalUnitDistinguishedName(const char* value) { m_organizationalUnitDistinguishedNameHasBeenSet = true; m_organizationalUnitDistinguishedName.assign(value); } /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline SelfManagedActiveDirectoryAttributes& WithOrganizationalUnitDistinguishedName(const Aws::String& value) { SetOrganizationalUnitDistinguishedName(value); return *this;} /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline SelfManagedActiveDirectoryAttributes& WithOrganizationalUnitDistinguishedName(Aws::String&& value) { SetOrganizationalUnitDistinguishedName(std::move(value)); return *this;} /** * <p>The fully qualified distinguished name of the organizational unit within the * self-managed AD directory to which the Windows File Server or ONTAP storage * virtual machine (SVM) instance is joined.</p> */ inline SelfManagedActiveDirectoryAttributes& WithOrganizationalUnitDistinguishedName(const char* value) { SetOrganizationalUnitDistinguishedName(value); return *this;} /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline const Aws::String& GetFileSystemAdministratorsGroup() const{ return m_fileSystemAdministratorsGroup; } /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline bool FileSystemAdministratorsGroupHasBeenSet() const { return m_fileSystemAdministratorsGroupHasBeenSet; } /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline void SetFileSystemAdministratorsGroup(const Aws::String& value) { m_fileSystemAdministratorsGroupHasBeenSet = true; m_fileSystemAdministratorsGroup = value; } /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline void SetFileSystemAdministratorsGroup(Aws::String&& value) { m_fileSystemAdministratorsGroupHasBeenSet = true; m_fileSystemAdministratorsGroup = std::move(value); } /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline void SetFileSystemAdministratorsGroup(const char* value) { m_fileSystemAdministratorsGroupHasBeenSet = true; m_fileSystemAdministratorsGroup.assign(value); } /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline SelfManagedActiveDirectoryAttributes& WithFileSystemAdministratorsGroup(const Aws::String& value) { SetFileSystemAdministratorsGroup(value); return *this;} /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline SelfManagedActiveDirectoryAttributes& WithFileSystemAdministratorsGroup(Aws::String&& value) { SetFileSystemAdministratorsGroup(std::move(value)); return *this;} /** * <p>The name of the domain group whose members have administrative privileges for * the FSx file system.</p> */ inline SelfManagedActiveDirectoryAttributes& WithFileSystemAdministratorsGroup(const char* value) { SetFileSystemAdministratorsGroup(value); return *this;} /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline const Aws::String& GetUserName() const{ return m_userName; } /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline bool UserNameHasBeenSet() const { return m_userNameHasBeenSet; } /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline void SetUserName(const Aws::String& value) { m_userNameHasBeenSet = true; m_userName = value; } /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline void SetUserName(Aws::String&& value) { m_userNameHasBeenSet = true; m_userName = std::move(value); } /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline void SetUserName(const char* value) { m_userNameHasBeenSet = true; m_userName.assign(value); } /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline SelfManagedActiveDirectoryAttributes& WithUserName(const Aws::String& value) { SetUserName(value); return *this;} /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline SelfManagedActiveDirectoryAttributes& WithUserName(Aws::String&& value) { SetUserName(std::move(value)); return *this;} /** * <p>The user name for the service account on your self-managed AD domain that FSx * uses to join to your AD domain.</p> */ inline SelfManagedActiveDirectoryAttributes& WithUserName(const char* value) { SetUserName(value); return *this;} /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline const Aws::Vector<Aws::String>& GetDnsIps() const{ return m_dnsIps; } /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline bool DnsIpsHasBeenSet() const { return m_dnsIpsHasBeenSet; } /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline void SetDnsIps(const Aws::Vector<Aws::String>& value) { m_dnsIpsHasBeenSet = true; m_dnsIps = value; } /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline void SetDnsIps(Aws::Vector<Aws::String>&& value) { m_dnsIpsHasBeenSet = true; m_dnsIps = std::move(value); } /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& WithDnsIps(const Aws::Vector<Aws::String>& value) { SetDnsIps(value); return *this;} /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& WithDnsIps(Aws::Vector<Aws::String>&& value) { SetDnsIps(std::move(value)); return *this;} /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& AddDnsIps(const Aws::String& value) { m_dnsIpsHasBeenSet = true; m_dnsIps.push_back(value); return *this; } /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& AddDnsIps(Aws::String&& value) { m_dnsIpsHasBeenSet = true; m_dnsIps.push_back(std::move(value)); return *this; } /** * <p>A list of up to two IP addresses of DNS servers or domain controllers in the * self-managed AD directory.</p> */ inline SelfManagedActiveDirectoryAttributes& AddDnsIps(const char* value) { m_dnsIpsHasBeenSet = true; m_dnsIps.push_back(value); return *this; } private: Aws::String m_domainName; bool m_domainNameHasBeenSet; Aws::String m_organizationalUnitDistinguishedName; bool m_organizationalUnitDistinguishedNameHasBeenSet; Aws::String m_fileSystemAdministratorsGroup; bool m_fileSystemAdministratorsGroupHasBeenSet; Aws::String m_userName; bool m_userNameHasBeenSet; Aws::Vector<Aws::String> m_dnsIps; bool m_dnsIpsHasBeenSet; }; } // namespace Model } // namespace FSx } // namespace Aws
42.570064
193
0.711154
9f15712b3d34ab6dad3068121bb53ec3306400e8
488
h
C
VivilyVedioPlayer/Controller/HomeViewController/BaseViewController.h
hongkong792/VivilyPlayer
0d8f3e084582e5247fad52e0a3b796e6876eda5a
[ "Apache-2.0" ]
null
null
null
VivilyVedioPlayer/Controller/HomeViewController/BaseViewController.h
hongkong792/VivilyPlayer
0d8f3e084582e5247fad52e0a3b796e6876eda5a
[ "Apache-2.0" ]
null
null
null
VivilyVedioPlayer/Controller/HomeViewController/BaseViewController.h
hongkong792/VivilyPlayer
0d8f3e084582e5247fad52e0a3b796e6876eda5a
[ "Apache-2.0" ]
null
null
null
// // BaseViewController.h // VivilyVedioPlayer // // Created by yangxianggang on 17/3/11. // Copyright © 2017年 yangxianggang. All rights reserved. // #import <UIKit/UIKit.h> #import "MBProgressHUD.h" @interface BaseViewController : UIViewController /** *用了自定义的手势,则系统的手势被关闭 */ @property (nonatomic,assign)BOOL isPanGestureEnable; @property (nonatomic,retain)MBProgressHUD *hud; - (void)addHudView; - (void)addHudViewWithMessage:(NSString *)message; - (void)removeHudView; @end
19.52
57
0.745902
121a5e3a046eedd7ff385f40dc448bc61f3b97e0
4,140
h
C
include/NovelRT.h
FiniteReality/NovelRT
3d51eceb4f5fc630db3ea51fe3981febcc10c578
[ "MIT" ]
null
null
null
include/NovelRT.h
FiniteReality/NovelRT
3d51eceb4f5fc630db3ea51fe3981febcc10c578
[ "MIT" ]
null
null
null
include/NovelRT.h
FiniteReality/NovelRT
3d51eceb4f5fc630db3ea51fe3981febcc10c578
[ "MIT" ]
null
null
null
// Copyright © Matt Jones and Contributors. Licensed under the MIT Licence (MIT). See LICENCE.md in the repository root for more information. #ifndef NOVELRT_H #define NOVELRT_H //cstdlib #include <cmath> #include <cstdint> //stdlib #include <algorithm> #include <array> #include <filesystem> #include <fstream> #include <functional> #include <iostream> #include <limits> #include <map> #include <memory> #include <sstream> #include <stdexcept> #include <string> #include <tuple> #include <typeinfo> #include <type_traits> #include <vector> //Freetype #include <ft2build.h> #include FT_FREETYPE_H //glad #include <glad.h> //GLFW3 #define GLFW_INCLUDE_NONE #include <GLFW/glfw3.h> //GLM #include <glm/glm.hpp> #include <glm/gtx/rotate_vector.hpp> //OpenAL #include <AL/al.h> #include <AL/alc.h> //LibSndfile #include <sndfile.h> //nethost #include <coreclr_delegates.h> #include <hostfxr.h> //spdlog #include "spdlog/spdlog.h" #include "spdlog/sinks/stdout_color_sinks.h" #include "spdlog/async.h" //libpng #include "png.h" namespace NovelRT { typedef class Atom Atom; typedef class DebugService DebugService; typedef class LoggingService LoggingService; typedef class NovelRunner NovelRunner; } namespace NovelRT::Animation { typedef class SpriteAnimator SpriteAnimator; } namespace NovelRT::Audio { typedef std::vector<ALuint> SoundBank; typedef std::vector<ALuint> MusicBank; typedef class AudioService AudioService; } namespace NovelRT::DotNet { typedef class RuntimeService RuntimeService; } namespace NovelRT::Graphics { typedef class Texture Texture; typedef class BasicFillRect BasicFillRect; typedef class Camera Camera; typedef class ImageRect ImageRect; typedef class RenderingService RenderingService; typedef class RenderObject RenderObject; typedef class TextRect TextRect; } namespace NovelRT::Input { typedef class BasicInteractionRect BasicInteractionRect; typedef class InteractionObject InteractionObject; typedef class InteractionService InteractionService; } namespace NovelRT::Timing { typedef class StepTimer StepTimer; } namespace NovelRT::Windowing { typedef class WindowingService WindowingService; } //enums #include "NovelRT/Input/KeyCode.h" #include "NovelRT/Input/KeyState.h" #include "NovelRT/Graphics/CameraFrameState.h" //value types #include "NovelRT/Atom.h" #include "NovelRT/Utilities/Event.h" //these have to exist up here due to inclue order issues #include "NovelRT/Utilities/Lazy.h" #include "NovelRT/Utilities/Misc.h" #include "NovelRT/Animation/AnimatorPlayState.h" #include "NovelRT/Animation/SpriteAnimatorFrame.h" #include "NovelRT/Maths/GeoVector.h" #include "NovelRT/Maths/GeoMatrix4.h" #include "NovelRT/Maths/GeoBounds.h" #include "NovelRT/Maths/QuadTreePoint.h" #include "NovelRT/Maths/QuadTree.h" #include "NovelRT/Transform.h" #include "NovelRT/Graphics/GraphicsCharacterRenderData.h" #include "NovelRT/Graphics/ImageData.h" #include "NovelRT/Graphics/ShaderProgram.h" #include "NovelRT/Graphics/RGBAConfig.h" //base types #include "NovelRT/LoggingService.h" //this isn't in the services section due to include order/dependencies. #include "NovelRT/Timing/StepTimer.h" #include "NovelRT/NovelRunner.h" #include "NovelRT/WorldObject.h" //Animation types #include "NovelRT/Animation/SpriteAnimatorState.h" #include "NovelRT/Animation/SpriteAnimator.h" //Graphics types #include "NovelRT/Graphics/Camera.h" #include "NovelRT/Graphics/Texture.h" #include "NovelRT/Graphics/FontSet.h" #include "NovelRT/Graphics/RenderObject.h" #include "NovelRT/Graphics/BasicFillRect.h" #include "NovelRT/Graphics/GraphicsCharacterRenderDataHelper.h" #include "NovelRT/Graphics/ImageRect.h" #include "NovelRT/Graphics/TextRect.h" //Input types #include "NovelRT/Input/InteractionObject.h" #include "NovelRT/Input/BasicInteractionRect.h" //Engine service types #include "NovelRT/Audio/AudioService.h" #include "NovelRT/DebugService.h" #include "NovelRT/DotNet/RuntimeService.h" #include "NovelRT/Input/InteractionService.h" #include "NovelRT/Windowing/WindowingService.h" #include "NovelRT/Graphics/RenderingService.h" #endif //!NOVELRT_H
25.243902
141
0.785507
29cd8f760eb385a5552051845d6e959863a5f102
283
h
C
src/optixRenderer/include/inout/relativePath.h
kevinkingo/OptixRenderer
dbfbabfa7a96527fed84878c0d34eaca2ee8fae7
[ "MIT" ]
41
2020-06-26T03:58:23.000Z
2022-02-20T07:45:11.000Z
src/optixRenderer/include/inout/relativePath.h
A-guridi/thesis_render
c03b5b988c41a2d8c4b774037ff4039e03501b87
[ "MIT" ]
5
2020-12-05T13:39:17.000Z
2022-03-23T01:27:32.000Z
src/optixRenderer/include/inout/relativePath.h
A-guridi/thesis_render
c03b5b988c41a2d8c4b774037ff4039e03501b87
[ "MIT" ]
20
2020-06-27T22:18:51.000Z
2022-03-01T23:28:22.000Z
#ifndef RELATIVEPATH_HEADER #define RELATIVEPATH_HEADER #include <assert.h> #include <vector> #include <string> #include <iostream> void splitPath(std::vector<std::string>& strs, std::string inputPath ); std::string relativePath(std::string root, std::string inputPath); #endif
18.866667
71
0.759717
af4583e3484b905a1372bc0fefe7148caa16abb0
1,806
h
C
src/inc/plugins/oracle/OraclePlugin.h
pytf/intelligent-protector
0d454b54fc91e42accf402c5584f8526cdb7a170
[ "Apache-2.0" ]
5
2017-03-21T09:11:55.000Z
2018-11-19T14:44:36.000Z
src/inc/plugins/oracle/OraclePlugin.h
pytf/intelligent-protector
0d454b54fc91e42accf402c5584f8526cdb7a170
[ "Apache-2.0" ]
3
2018-02-06T06:17:10.000Z
2020-07-10T17:29:47.000Z
src/inc/plugins/oracle/OraclePlugin.h
pytf/intelligent-protector
0d454b54fc91e42accf402c5584f8526cdb7a170
[ "Apache-2.0" ]
7
2018-02-06T03:54:13.000Z
2021-09-08T10:51:38.000Z
/******************************************************************************* * Copyright @ Huawei Technologies Co., Ltd. 2017-2018. All rights reserved. ********************************************************************************/ #ifndef __AGENT_ORACLE_PLUGIN_H__ #define __AGENT_ORACLE_PLUGIN_H__ #include "common/Types.h" #include "plugins/ServicePlugin.h" #include "apps/oracle/Oracle.h" #define REST_PARAM_ORACLE_ARCHIVE_LOG_MODE "archiveLogMode" class COraclePlugin : public CServicePlugin { private: COracle m_oracle; public: COraclePlugin(); ~COraclePlugin(); mp_int32 DoAction(CRequestMsg* req, CResponseMsg* rsp); private: mp_int32 QueryInfo(CRequestMsg* req, CResponseMsg* rsp); mp_int32 QueryPDBInfo(CRequestMsg* req, CResponseMsg* rsp); mp_int32 StartPDB(CRequestMsg* req, CResponseMsg* rsp); mp_int32 QueryLunInfo(CRequestMsg* req, CResponseMsg* rsp); mp_int32 StartDB(CRequestMsg* req, CResponseMsg* rsp); mp_int32 StopDB(CRequestMsg* req, CResponseMsg* rsp); mp_int32 Test(CRequestMsg* req, CResponseMsg* rsp); mp_int32 CheckArchiveThreshold(CRequestMsg* req, CResponseMsg* rsp); mp_int32 Freeze(CRequestMsg* req, CResponseMsg* rsp); mp_int32 Thaw(CRequestMsg* req, CResponseMsg* rsp); mp_int32 ArchiveDB(CRequestMsg* req, CResponseMsg* rsp); mp_int32 StartASMInstance(CRequestMsg* req, CResponseMsg* rsp); mp_int32 StopASMInstance(CRequestMsg* req, CResponseMsg* rsp); mp_int32 StartRACCluster(CRequestMsg* req, CResponseMsg* rsp); mp_int32 GetDBFreezeState(CRequestMsg* req, CResponseMsg* rsp); mp_int32 GetDBAuthParam(CRequestMsg* req, oracle_db_info_t &stDBInfo); mp_int32 GetPDBAuthParam(CRequestMsg* req, oracle_pdb_req_info_t &stPDBInfo); }; #endif //__AGENT_ORACLE_PLUGIN_H__
38.425532
81
0.697674
0abc495f40c12c97b5af0dcca222d313e535ac95
359
h
C
include/mt_clock_task_internal.h
bassettmb/mach_time
bdd81fb1fb04ddcf9dd16ec9b5b47e65a4555e9f
[ "MIT" ]
null
null
null
include/mt_clock_task_internal.h
bassettmb/mach_time
bdd81fb1fb04ddcf9dd16ec9b5b47e65a4555e9f
[ "MIT" ]
null
null
null
include/mt_clock_task_internal.h
bassettmb/mach_time
bdd81fb1fb04ddcf9dd16ec9b5b47e65a4555e9f
[ "MIT" ]
null
null
null
#ifndef MT_CLOCK_TASK_INTERNAL_H #define MT_CLOCK_TASK_INTERNAL_H #include <mach/mach_types.h> #include <time.h> int mt_clock_task_getres(mach_port_t port, struct timespec *res); int mt_clock_task_gettime(mach_port_t port, struct timespec *ts); int mt_clock_task_settime(mach_port_t port, const struct timespec *ts); #endif /* !MT_CLOCK_TASK_INTERNAL_H */
29.916667
71
0.816156
eba116931e4ab45a58ffb738df312010b09f704b
2,800
c
C
cbuffer.c
armarpc/cbuffer
f910ecdc135e5fa029a3a238f90e6f0d29c0b8e2
[ "BSD-3-Clause" ]
null
null
null
cbuffer.c
armarpc/cbuffer
f910ecdc135e5fa029a3a238f90e6f0d29c0b8e2
[ "BSD-3-Clause" ]
null
null
null
cbuffer.c
armarpc/cbuffer
f910ecdc135e5fa029a3a238f90e6f0d29c0b8e2
[ "BSD-3-Clause" ]
null
null
null
/** * Copyright (c) 2014, Willem-Hendrik Thiart * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <sys/mman.h> #include <unistd.h> #include "cbuffer.h" #define fail() assert(0) /** OSX needs some help here */ #ifndef MAP_ANONYMOUS # define MAP_ANONYMOUS MAP_ANON #endif static void __create_buffer_mirror(cbuf_t* cb) { char path[] = "/tmp/cb-XXXXXX"; int fd, status; void *address; fd = mkstemp(path); if (fd < 0) fail(); status = unlink(path); if (status) fail(); status = ftruncate(fd, cb->size); if (status) fail(); /* create the array of data */ cb->data = mmap(NULL, cb->size << 1, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (cb->data == MAP_FAILED) fail(); address = mmap(cb->data, cb->size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, 0); if (address != cb->data) fail(); address = mmap(cb->data + cb->size, cb->size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, 0); if (address != cb->data + cb->size) fail(); status = close(fd); if (status) fail(); } cbuf_t *cbuf_new(const unsigned int order) { cbuf_t *me = malloc(sizeof(cbuf_t)); me->size = 1UL << order; me->head = me->tail = 0; __create_buffer_mirror(me); return me; } void cbuf_free(cbuf_t *me) { munmap(me->data, me->size << 1); free(me); } int cbuf_is_empty(const cbuf_t *me) { return me->head == me->tail; } int cbuf_offer(cbuf_t *me, const unsigned char *data, const int size) { /* prevent buffer from getting completely full or over commited */ if (cbuf_unusedspace(me) <= size) return 0; int written = cbuf_unusedspace(me); written = size < written ? size : written; memcpy(me->data + me->tail, data, written); unsigned int new_tail = me->tail + written; if (me->size < new_tail) new_tail %= me->size; me->tail = new_tail; return written; } unsigned char *cbuf_peek(const cbuf_t *me) { if (cbuf_is_empty(me)) return NULL; return me->data + me->head; } unsigned char *cbuf_poll(cbuf_t *me, const unsigned int size) { if (cbuf_is_empty(me)) return NULL; void *end = me->data + me->head; me->head += size; return end; } int cbuf_size(const cbuf_t *me) { return me->size; } int cbuf_usedspace(const cbuf_t *me) { if (me->head <= me->tail) return me->tail - me->head; else return me->size - (me->head - me->tail); } int cbuf_unusedspace(const cbuf_t *me) { return me->size - cbuf_usedspace(me); }
21.052632
80
0.596071
cb72c2b0895a6c7294778801efb3c6d12bb07632
503
h
C
Include/cpython/interpreteridobject.h
ThePrez/cpython
65aa64fae89a24491aae84ba0329eb8f3c68c389
[ "CNRI-Python-GPL-Compatible" ]
854
2017-09-11T16:42:28.000Z
2022-03-27T14:17:09.000Z
Include/cpython/interpreteridobject.h
ThePrez/cpython
65aa64fae89a24491aae84ba0329eb8f3c68c389
[ "CNRI-Python-GPL-Compatible" ]
164
2017-09-24T20:40:32.000Z
2021-10-30T01:35:05.000Z
Include/cpython/interpreteridobject.h
ThePrez/cpython
65aa64fae89a24491aae84ba0329eb8f3c68c389
[ "CNRI-Python-GPL-Compatible" ]
73
2017-09-13T18:07:48.000Z
2022-03-17T13:02:29.000Z
#ifndef Py_CPYTHON_INTERPRETERIDOBJECT_H # error "this header file must not be included directly" #endif #ifdef __cplusplus extern "C" { #endif /* Interpreter ID Object */ PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type; PyAPI_FUNC(PyObject *) _PyInterpreterID_New(int64_t); PyAPI_FUNC(PyObject *) _PyInterpreterState_GetIDObject(PyInterpreterState *); PyAPI_FUNC(PyInterpreterState *) _PyInterpreterID_LookUp(PyObject *); PyAPI_FUNC(int64_t) _Py_CoerceID(PyObject *); #ifdef __cplusplus } #endif
22.863636
77
0.807157
a014ccb14751144c76fcf2174bb8b1ddb0c30870
3,514
h
C
src/gpu/batches/GrCopySurfaceBatch.h
jrmuizel/skia-wr
cbea8437804cb7f94c43319491d9dba7b039483d
[ "BSD-3-Clause" ]
null
null
null
src/gpu/batches/GrCopySurfaceBatch.h
jrmuizel/skia-wr
cbea8437804cb7f94c43319491d9dba7b039483d
[ "BSD-3-Clause" ]
null
null
null
src/gpu/batches/GrCopySurfaceBatch.h
jrmuizel/skia-wr
cbea8437804cb7f94c43319491d9dba7b039483d
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrCopySurfaceBatch_DEFINED #define GrCopySurfaceBatch_DEFINED #include "GrBatch.h" #include "GrBatchFlushState.h" #include "GrGpu.h" #include "GrRenderTarget.h" class GrCopySurfaceBatch final : public GrBatch { public: DEFINE_BATCH_CLASS_ID /** This should not really be exposed as Create() will apply this clipping, but there is * currently a workaround in GrContext::copySurface() for non-render target dsts that relies * on it. */ static bool ClipSrcRectAndDstPoint(const GrSurface* dst, const GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint, SkIRect* clippedSrcRect, SkIPoint* clippedDstPoint); static GrBatch* Create(GrSurface* dst, GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint); const char* name() const override { return "CopySurface"; } // TODO: this needs to be updated to return GrSurfaceProxy::UniqueID GrGpuResource::UniqueID renderTargetUniqueID() const override { // TODO: When we have CopyContexts it seems that this should return the ID // of the SurfaceProxy underlying the CopyContext. GrRenderTarget* rt = fDst.get()->asRenderTarget(); return rt ? rt->uniqueID() : GrGpuResource::UniqueID::InvalidID(); } // TODO: this seems odd - figure it out and add a comment! GrRenderTarget* renderTarget() const override { return nullptr; } SkString dumpInfo() const override { SkString string; string.printf("SRC: 0x%p, DST: 0x%p, SRECT: [L: %d, T: %d, R: %d, B: %d], " "DPT:[X: %d, Y: %d]", fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY); string.append(INHERITED::dumpInfo()); return string; } private: GrCopySurfaceBatch(GrSurface* dst, GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint) : INHERITED(ClassID()) , fDst(dst) , fSrc(src) , fSrcRect(srcRect) , fDstPoint(dstPoint) { SkRect bounds = SkRect::MakeXYWH(SkIntToScalar(dstPoint.fX), SkIntToScalar(dstPoint.fY), SkIntToScalar(srcRect.width()), SkIntToScalar(srcRect.height())); this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); } bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override { return false; } void onPrepare(GrBatchFlushState*) override {} void onDraw(GrBatchFlushState* state, const SkRect& /*bounds*/) override { if (!state->commandBuffer()) { state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoint); } else { // currently we are not sending copies through the GrGpuCommandBuffer SkASSERT(false); } } GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; SkIRect fSrcRect; SkIPoint fDstPoint; typedef GrBatch INHERITED; }; #endif
38.615385
98
0.600455
48d18a517c7a9b68803e17309354ac575b0308ca
5,547
c
C
osloader/osloader.c
NikhilKalige/uefi_freertos_beagleboard
5296f465d9f2a905283a9a2d365adb597abd4a1c
[ "MIT" ]
null
null
null
osloader/osloader.c
NikhilKalige/uefi_freertos_beagleboard
5296f465d9f2a905283a9a2d365adb597abd4a1c
[ "MIT" ]
null
null
null
osloader/osloader.c
NikhilKalige/uefi_freertos_beagleboard
5296f465d9f2a905283a9a2d365adb597abd4a1c
[ "MIT" ]
null
null
null
#include <Uefi.h> #include <Library/UefiBootServicesTableLib.h> #include <Library/UefiRuntimeServicesTableLib.h> #include <Library/DevicePathLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/ShellLib.h> #include <Library/ArmLib.h> #include <Library/UefiLib.h> #include <Protocol/LoadedImage.h> #include <Protocol/LoadFile.h> #include <Library/UefiApplicationEntryPoint.h> #include "elf_common.h" #include "elf32.h" #define CheckStatus(Status, Code) {\ if(EFI_ERROR(Status)){\ Print(L"Error: Status = %d, LINE=%d in %s\n", (Status), __LINE__, __func__);\ Code;\ }\ } // Freertos function prototype typedef VOID (*freertos_elf)(EFI_RUNTIME_SERVICES* runtime); /** Guid value for saving variable */ EFI_GUID rtos_var = { 0xAA, 0xBB, 0xCC, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C } }; STATIC EFI_STATUS PreparePlatformHardware(VOID) { // Turn off MMU ArmDisableMmu(); return EFI_SUCCESS; } EFI_STATUS EFIAPI LoadFileByName ( IN CONST CHAR16 *FileName, OUT UINT8 **FileData, OUT UINTN *FileSize ) { EFI_STATUS Status; SHELL_FILE_HANDLE FileHandle; EFI_FILE_INFO *Info; UINTN Size; UINT8 *Data; Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ, 0); CheckStatus(Status, return(Status)); Info = ShellGetFileInfo(FileHandle); Size = (UINTN)Info->FileSize; FreePool(Info); Data = AllocateRuntimeZeroPool(Size); if(Data == NULL) { Print(L"Error: AllocateRuntimeZeroPool failed\n"); return(EFI_OUT_OF_RESOURCES); } // Read file into Buffer Status = ShellReadFile(FileHandle, &Size, Data); CheckStatus(Status, return(Status)); // Close file Status = ShellCloseFile(&FileHandle); CheckStatus(Status, return(Status)); *FileSize = Size; *FileData = Data; return EFI_SUCCESS; } EFI_STATUS EFIAPI ElfLoadSegment ( IN CONST VOID *ElfImage, OUT VOID **EntryPoint ) { Elf32_Ehdr *ElfHdr; UINT8 *ProgramHdr; Elf32_Phdr *ProgramHdrPtr; UINTN Index; ElfHdr = (Elf32_Ehdr *)ElfImage; ProgramHdr = (UINT8 *)ElfImage + ElfHdr->e_phoff; // Load every loadable ELF segment into memory for(Index = 0; Index < ElfHdr->e_phnum; Index++) { ProgramHdrPtr = (Elf32_Phdr *)ProgramHdr; if(ProgramHdrPtr->p_type == PT_LOAD) { VOID *FileSegment; VOID *MemSegment; VOID *ExtraZeroes; UINTN ExtraZeroesCount; // Load the segment in memory FileSegment = (VOID *)((UINTN)ElfImage + ProgramHdrPtr->p_offset); MemSegment = (VOID *)ProgramHdrPtr->p_vaddr; gBS->CopyMem(MemSegment, FileSegment, ProgramHdrPtr->p_filesz); ExtraZeroes = (UINT8 *)MemSegment + ProgramHdrPtr->p_filesz; ExtraZeroesCount = ProgramHdrPtr->p_memsz - ProgramHdrPtr->p_filesz; if(ExtraZeroesCount > 0) { gBS->SetMem(ExtraZeroes, 0x00, ExtraZeroesCount); } } ProgramHdr += ElfHdr->e_phentsize; } *EntryPoint = (VOID *)ElfHdr->e_entry; return (EFI_SUCCESS); } EFI_STATUS EFIAPI UefiMain(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) { EFI_STATUS Status; CHAR16 *FileName = L"fs0:\\rtosdemo.elf"; UINTN FileSize; UINT8 *FileData; VOID *EntryPoint = NULL; UINTN MemoryMapSize = 0; EFI_MEMORY_DESCRIPTOR *MemoryMap = NULL; UINTN MapKey; UINTN DescriptorSize; UINT32 DescriptorVersion; UINT16 var_value; UINTN len; /** Freertos function ptr */ freertos_elf start_elf; // Load the ELF file to buffer Print(L"Loading File %s\n", FileName); Status = LoadFileByName(FileName, &FileData, &FileSize); CheckStatus(Status, return(-1)); Print(L"Upload section to memory\n"); Status = ElfLoadSegment(FileData, &EntryPoint); CheckStatus(Status, return(-1)); Status = gBS->GetMemoryMap(&MemoryMapSize, MemoryMap, &MapKey, &DescriptorSize, &DescriptorVersion); if (Status != EFI_BUFFER_TOO_SMALL) { CheckStatus(Status, return(-1)); } MemoryMap = (EFI_MEMORY_DESCRIPTOR *)AllocateZeroPool(MemoryMapSize); if (MemoryMap == NULL) { Print(L"Error: Allocate Pages failed\n"); return(-1); } Print(L"ExitBootServices and Execute the program freertos\n"); Status = gBS->GetMemoryMap(&MemoryMapSize, MemoryMap, &MapKey, &DescriptorSize, &DescriptorVersion); CheckStatus(Status, return(-1)); Status = gBS->ExitBootServices(gImageHandle, MapKey); CheckStatus(Status, return(-1)); /** Set value to store */ var_value = 31; Status = gRT->SetVariable(L"FREERTOS", &rtos_var, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(UINT16), &var_value ); Status = PreparePlatformHardware(); CheckStatus(Status, return(-1)); var_value = 67; Status = gRT->GetVariable(L"FREERTOS", &rtos_var, NULL, &len, &var_value); if (EFI_ERROR (Status)) { var_value = 32; } // Jump to the entrypoint of executable // goto *EntryPoint; start_elf = (freertos_elf)EntryPoint; start_elf(gRT); return 0; }
28.740933
98
0.629169
6a9995466e45e4d1511da4a223ec1318bec7fdfa
2,053
h
C
src/headers/maycloud/attagparser.h
orgtechservice/libmaycloud
b6e58e637160d32ecf022ba2e2ae1b243597bc28
[ "MIT" ]
4
2020-06-27T18:30:17.000Z
2020-07-23T17:39:15.000Z
src/headers/maycloud/attagparser.h
orgtechservice/libmaycloud
b6e58e637160d32ecf022ba2e2ae1b243597bc28
[ "MIT" ]
null
null
null
src/headers/maycloud/attagparser.h
orgtechservice/libmaycloud
b6e58e637160d32ecf022ba2e2ae1b243597bc28
[ "MIT" ]
null
null
null
#ifndef MAWAR_ATTAGPARSER_H #define MAWAR_ATTAGPARSER_H #include <maycloud/stream.h> #include <maycloud/tagbuilder.h> #include <maycloud/xmlparser.h> #include <maycloud/xml_types.h> #include <maycloud/xml_tag.h> #include <iostream> /** * Паресер XML-файлов * * ATTagParser парсит файл целиком в один ATXmlTag */ class ATTagParser: protected nanosoft::XMLParser, protected ATTagBuilder { public: /** * Конструктор парсера */ ATTagParser(); /** * Деструктор парсера */ ~ATTagParser(); /** * Парсинг файла * @param path путь к файлу * @return тег в случае успеха и NULL в случае ошибки */ ATXmlTag * parseFile(const char *path); ATXmlTag * parseFile(const std::string &path); /** * Парсинг произвольного потока * @param s поток с данными * @return тег в случае успеха и NULL в случае ошибки */ ATXmlTag * parseStream(nanosoft::stream &s); /** * Парсинг строки * @param xml XML * @return тег в случае успеха и NULL в случае ошибки */ ATXmlTag * parseString(const std::string &xml); protected: /** * Обработчик открытия тега */ virtual void onStartElement(const std::string &name, const attributes_t &attributes); /** * Обработчик символьных данных */ virtual void onCharacterData(const std::string &cdata); /** * Обработчик закрытия тега */ virtual void onEndElement(const std::string &name); /** * Обработчик ошибок парсера */ void onParseError(const char *message); private: /** * Глубина обрабатываемого тега */ int depth; }; /** * Парсинг файла * @param path путь к файлу * @return тег в случае успеха и NULL в случае ошибки */ ATXmlTag * parse_xml_file(const char *path); ATXmlTag * parse_xml_file(const std::string &path); /** * Парсинг произвольного потока * @param s поток с данными * @return тег в случае успеха и NULL в случае ошибки */ ATXmlTag * parse_xml_stream(nanosoft::stream &s); /** * Парсинг произвольной строки * @param xml XML * @return тег в случае успеха и NULL в случае ошибки */ ATXmlTag * parse_xml_string(const std::string &xml); #endif // MAWAR_ATTAGPARSER_H
20.127451
86
0.714077
acb78a61b848c321686177cc44a8726b53f69339
1,046
h
C
packager/app/widevine_encryption_flags.h
Acidburn0zzz/shaka-packager
c540e5afa0a649285dc5a2c2a1ce68cc76ab1bd5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2016-07-26T04:05:06.000Z
2016-07-26T04:05:06.000Z
packager/app/widevine_encryption_flags.h
Acidburn0zzz/shaka-packager
c540e5afa0a649285dc5a2c2a1ce68cc76ab1bd5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
packager/app/widevine_encryption_flags.h
Acidburn0zzz/shaka-packager
c540e5afa0a649285dc5a2c2a1ce68cc76ab1bd5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd // // Defines command line flags for widevine_encryption. #ifndef APP_WIDEVINE_ENCRYPTION_FLAGS_H_ #define APP_WIDEVINE_ENCRYPTION_FLAGS_H_ #include <gflags/gflags.h> DECLARE_bool(enable_widevine_encryption); DECLARE_bool(enable_widevine_decryption); DECLARE_bool(include_common_pssh); DECLARE_string(key_server_url); DECLARE_string(content_id); DECLARE_string(policy); DECLARE_int32(max_sd_pixels); DECLARE_string(signer); DECLARE_string(aes_signing_key); DECLARE_string(aes_signing_iv); DECLARE_string(rsa_signing_key_path); DECLARE_int32(crypto_period_duration); DECLARE_string(protection_scheme); namespace shaka { /// Validate widevine encryption/decryption flags. /// @return true on success, false otherwise. bool ValidateWidevineCryptoFlags(); } // namespace shaka #endif // APP_WIDEVINE_ENCRYPTION_FLAGS_H_
28.27027
57
0.820268
be132d7e009c61e6bd5d4deef8b6f73ff74b271c
1,447
c
C
hw2/parse.c
catmalon/The-Linux-Programming-Interface
e695dc9fd3d5d843806c4677b9577f19f245d071
[ "Apache-2.0" ]
null
null
null
hw2/parse.c
catmalon/The-Linux-Programming-Interface
e695dc9fd3d5d843806c4677b9577f19f245d071
[ "Apache-2.0" ]
null
null
null
hw2/parse.c
catmalon/The-Linux-Programming-Interface
e695dc9fd3d5d843806c4677b9577f19f245d071
[ "Apache-2.0" ]
null
null
null
/* * parse.c : use whitespace to tokenise a line * Initialise a vector big enough */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "shell.h" /* Parse a commandline string into an argv array. */ char** parse(char *line) { static char delim[] = " \t\n"; /* SPACE or TAB or NL */ int count = 0; char *token = NULL; char **newArgv = NULL; /* Nothing entered. */ if (line == NULL) { return NULL; } /* Init strtok with commandline, then get first token. * Return NULL if no tokens in line. */ if (!(token = strtok(line, delim))) { return NULL; } count++; /* Create array with room for first token.*/ newArgv = (char **) realloc(newArgv, sizeof(char*) * count); newArgv[0] = token; printf("[%d] : %s\n", count-1, newArgv[count-1]); /* While there are more tokens... * * - Get next token. * - Resize array. * - Give token its own memory, then install it. * * Fill in code. */ while (token = strtok(NULL, delim)) { count++; newArgv = (char **) realloc(newArgv, sizeof(char*) * count); newArgv[count-1] = token; printf("[%d] : %s\n", count-1, newArgv[count-1]); } newArgv = (char **) realloc(newArgv, sizeof(char*) * ++count); newArgv[count-1] = NULL; return newArgv; } /* * Free memory associated with argv array passed in. * Argv array is assumed created with parse() above. */ void free_argv(char **oldArgv) { free(oldArgv); }
22.261538
63
0.608155
38081eb6ffb6e9ea379b09d7f2462eb7502b65c4
628
h
C
YDIMKit/messageCells/YDTextMessageCell.h
zhoushaowen/YDIMKit
ac141b65650b04af68ba4aaea9b9c9a52171bc87
[ "Apache-2.0" ]
null
null
null
YDIMKit/messageCells/YDTextMessageCell.h
zhoushaowen/YDIMKit
ac141b65650b04af68ba4aaea9b9c9a52171bc87
[ "Apache-2.0" ]
null
null
null
YDIMKit/messageCells/YDTextMessageCell.h
zhoushaowen/YDIMKit
ac141b65650b04af68ba4aaea9b9c9a52171bc87
[ "Apache-2.0" ]
null
null
null
// // YDTextMessageCell.h // chatList // // Created by r_zhou on 2016/10/28. // Copyright © 2016年 r_zhous. All rights reserved. // #import <UIKit/UIKit.h> #import "YDMessageCell.h" #import "YDBaseMessage.h" @class YDTextMessageCell; @protocol YDTextMessageCellDelegate <NSObject> - (void)textMessageCell:(YDTextMessageCell *)aCell headTapGesture:(id)sender; - (void)textMessageCell:(YDTextMessageCell *)aCell onDeleteMenuAction:(id)sender; @end @interface YDTextMessageCell : YDMessageCell @property (strong, nonatomic) id<YDTextMessageCellDelegate> delegate; - (CGFloat)rowHeightWithModel:(YDBaseMessage *)model; @end
25.12
81
0.772293
0786b9a2b90f7dae02a0de3969115b43ceb7e8a2
62
c
C
add.c
AliceOh/wasmer-C-embed-wasm
b9221c82c44ff5b67ac84e96016fc5ebc7aa8c8a
[ "MIT" ]
null
null
null
add.c
AliceOh/wasmer-C-embed-wasm
b9221c82c44ff5b67ac84e96016fc5ebc7aa8c8a
[ "MIT" ]
null
null
null
add.c
AliceOh/wasmer-C-embed-wasm
b9221c82c44ff5b67ac84e96016fc5ebc7aa8c8a
[ "MIT" ]
null
null
null
int add_one(int value) { value += 1; return value; }
10.333333
24
0.564516
c4163746ddeae21a10d12f63224842cccce9ea46
1,162
h
C
csrc/helpers.h
arunkmv/game-of-life
4293576b33e59ec6e21269976ffd28949b5b1b96
[ "BSD-3-Clause" ]
null
null
null
csrc/helpers.h
arunkmv/game-of-life
4293576b33e59ec6e21269976ffd28949b5b1b96
[ "BSD-3-Clause" ]
null
null
null
csrc/helpers.h
arunkmv/game-of-life
4293576b33e59ec6e21269976ffd28949b5b1b96
[ "BSD-3-Clause" ]
null
null
null
#ifndef GAME_OF_LIFE_HELPERS #define GAME_OF_LIFE_HELPERS #include "dut.h" #include <array> static void step(dut &m, int times = 1) { for (int i = 0; i < times; i++) { m.clock = 0; m.eval(); m.clock = 1; m.eval(); } } template<size_t gridX, size_t gridY> static void poke(std::array <std::array<unsigned char, gridX>, gridY> pattern, dut &m) { m.io_pause = 1; step(m); m.io_pause = 0; m.io_write_enable = 1; step(m); for (int i = 0; i < gridY; i++) { for (int j = 0; j < gridX; j++) { m.io_y_addr = i; m.io_x_addr = j; m.io_write_state = pattern[i][j]; step(m); } } m.io_write_enable = 0; m.eval(); } template<size_t gridX, size_t gridY> static void peek(dut &m) { for (int i = gridY - 1; i >= 0; i--) { for (int j = gridX - 1; j >= 0; j--) { m.io_y_addr = i; m.io_x_addr = j; step(m); if (m.io_state == 1) printf("* "); else printf(" "); } printf("\n"); } } #endif //GAME_OF_LIFE_HELPERS
21.127273
88
0.474182
33170378f2fd75467b0f9cf693d535aaf702cd78
49,972
h
C
benchmarks/Benchmarks/TDLCA_Segmentation/Segmentation1LCacc.h
cdsc-github/parade-ara-simulator
00c977200a8e7aa31b03d560886ec80840a3c416
[ "BSD-3-Clause" ]
31
2015-12-15T19:14:10.000Z
2021-12-31T17:40:21.000Z
benchmarks/Benchmarks/TDLCA_Segmentation/Segmentation1LCacc.h
cdsc-github/parade-ara-simulator
00c977200a8e7aa31b03d560886ec80840a3c416
[ "BSD-3-Clause" ]
5
2015-12-04T08:06:47.000Z
2020-08-09T21:49:46.000Z
benchmarks/Benchmarks/TDLCA_Segmentation/Segmentation1LCacc.h
cdsc-github/parade-ara-simulator
00c977200a8e7aa31b03d560886ec80840a3c416
[ "BSD-3-Clause" ]
21
2015-11-05T08:25:45.000Z
2021-06-19T02:24:50.000Z
#ifndef LCACC_HEADER_SECTION #define LCACC_HEADER_SECTION #include "SimicsHeader.h" #include <stdint.h> #include <cassert> #include <vector> #define LCACC_STATUS_TLB_MISS 45 #define LCACC_STATUS_COMPLETED 46 #define LCACC_STATUS_ERROR 3 #define LCACC_STATUS_PENDING 4 #define LCACC_GAM_WAIT 5 #define LCACC_GAM_GRANT 4 #define LCACC_GAM_ERROR 6 #define LCACC_GAM_REVOKE 7 #define LCACC_CMD_BEGIN_TASK 42 #define LCACC_CMD_CANCEL_TASK 43 #define LCACC_CMD_TLB_SERVICE 44 #define LCACC_CMD_BEGIN_TASK_SIGNATURE 47 #define LCACC_CMD_BEGIN_PROGRAM 50 #define BIN_CMD_ARBITRATE_RESPONSE 102 #define LWI_WAIT 2 #define LWI_PROCEED 1 #define LWI_ERROR 0 template <class From, class To> class TypeConverter { public: union { From from; To to; }; }; template <class From, class To> inline To ConvertToType(From f) { TypeConverter<From, To> x; x.from = f; return x.to; } template <class From> class ByteConverter { public: union { From from; uint8_t bytes[sizeof(From)]; }; }; template <class From> inline void ConvertToBytes(std::vector<uint8_t>& dst, size_t index, From f) { ByteConverter<From> c; c.from = f; for(size_t i = 0; i < sizeof(From); i++) { assert(i + index < dst.size()); dst[i + index] = c.bytes[i]; } } class LCAccNode { std::vector<std::vector<uint8_t>*> lcaccIDReplacementBuffer; std::vector<size_t> lcaccIDReplacementIndex; bool lcaccIDDecided; public: uint32_t lcaccOpCode; uint32_t spmWindowSize; uint32_t spmWindowCount; uint32_t spmWindowOffset; uint32_t lcaccID; inline LCAccNode(uint32_t init_lcaccOpCode) { lcaccOpCode = init_lcaccOpCode; spmWindowSize = 0; spmWindowCount = 0; spmWindowOffset = 0; lcaccIDDecided = false; lcaccID = 0; } inline LCAccNode(uint32_t init_lcaccOpCode, uint32_t init_spmWindowSize, uint32_t init_spmWindowCount, uint32_t init_spmWindowOffset) { lcaccOpCode = init_lcaccOpCode; spmWindowSize = init_spmWindowSize; spmWindowCount = init_spmWindowCount; spmWindowOffset = init_spmWindowOffset; lcaccIDDecided = false; lcaccID = 0; } inline LCAccNode(uint32_t init_lcaccOpCode, uint32_t init_spmWindowSize, uint32_t init_spmWindowCount, uint32_t init_spmWindowOffset, uint32_t init_lcaccID) { lcaccOpCode = init_lcaccOpCode; spmWindowSize = init_spmWindowSize; spmWindowCount = init_spmWindowCount; spmWindowOffset = init_spmWindowOffset; lcaccIDDecided = true; lcaccID = init_lcaccID; } inline void SetSPMConfig(uint32_t init_spmWindowSize, uint32_t init_spmWindowCount, uint32_t init_spmWindowOffset) { spmWindowSize = init_spmWindowSize; spmWindowCount = init_spmWindowCount; spmWindowOffset = init_spmWindowOffset; } inline void PlaceLCAccID(std::vector<uint8_t>& buffer, size_t index) { if(lcaccIDDecided) { ConvertToBytes<uint32_t>(buffer, index, lcaccID); } lcaccIDReplacementBuffer.push_back(&buffer); lcaccIDReplacementIndex.push_back(index); } inline void SetLCAccID(uint32_t init_lcaccID) { simics_assert(!lcaccIDDecided); lcaccIDDecided = true; lcaccID = init_lcaccID; for(size_t i = 0; i < lcaccIDReplacementBuffer.size(); i++) { ConvertToBytes<uint32_t>(*lcaccIDReplacementBuffer[i], lcaccIDReplacementIndex[i], lcaccID); } } inline void Reset() { lcaccIDDecided = false; } }; class MicroprogramWriter { int16_t computesHaveBeenWritten; int16_t transfersHaveBeenWritten; bool finalized; std::vector<uint8_t> buffer; bool signature; uint32_t taskGrain; public: class ComputeArgIndex { public: uint32_t baseAddr; uint32_t elementSize; std::vector<uint32_t> size; std::vector<int32_t> stride; inline ComputeArgIndex(uint32_t init_baseAddr, uint32_t init_elementSize, const std::vector<uint32_t>& init_size, const std::vector<int32_t>& init_stride) { baseAddr = init_baseAddr; elementSize = init_elementSize; size = init_size; stride = init_stride; } }; inline MicroprogramWriter(bool init_signature) { finalized = false; computesHaveBeenWritten = 0; transfersHaveBeenWritten = 0; taskGrain = 0; signature = init_signature; if(signature) { for(int i = 0; i < sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint32_t) + sizeof(uint32_t); i++) { buffer.push_back(0); } } else { for(int i = 0; i < sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint32_t); i++) { buffer.push_back(0); } } } inline void SetTaskGrain(uint32_t tg) { simics_assert(!finalized); simics_assert(!signature); taskGrain = tg; } inline void AddTransfer(LCAccNode& src, uintptr_t srcBaseAddr, const std::vector<uint32_t>& srcSize, const std::vector<int32_t>& srcStride, void* dst, const std::vector<uint32_t>& blockSize, const std::vector<int32_t>& blockStride, const std::vector<uint32_t>& elementSize, const std::vector<int32_t>& elementStride, uint32_t atomSize) { simics_assert(!finalized); simics_assert(computesHaveBeenWritten); simics_assert(srcSize.size() == srcStride.size()); simics_assert(blockSize.size() == blockStride.size()); simics_assert(elementSize.size() == elementStride.size()); transfersHaveBeenWritten++; int chunkSize = sizeof(uintptr_t) * 2 + sizeof(uint32_t) * (3 + srcSize.size() + blockSize.size() + elementSize.size()) + sizeof(int32_t) * (1 + srcSize.size() + blockSize.size() + elementSize.size()) + sizeof(uint8_t) * 5; size_t chunkPosition = buffer.size(); for(int i = 0; i < chunkSize; i++) { buffer.push_back(0); } src.PlaceLCAccID(buffer, chunkPosition); chunkPosition += sizeof(uint32_t); ConvertToBytes<uintptr_t>(buffer, chunkPosition, (uintptr_t)(srcBaseAddr)); chunkPosition += sizeof(uintptr_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(1)); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(srcSize.size())); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(-1)); chunkPosition += sizeof(uint32_t); ConvertToBytes<uintptr_t>(buffer, chunkPosition, (uintptr_t)(dst)); chunkPosition += sizeof(uintptr_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(blockSize.size())); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(elementSize.size())); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(src.spmWindowCount)); chunkPosition += sizeof(uint32_t);//first, position the element in the spm ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(src.spmWindowSize)); chunkPosition += sizeof(int32_t); for(size_t i = 0; i < srcSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(srcSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(srcStride[i])); chunkPosition += sizeof(int32_t); } for(size_t i = 0; i < blockSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(blockSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(blockStride[i])); chunkPosition += sizeof(int32_t); } for(size_t i = 0; i < elementSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(elementSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(elementStride[i])); chunkPosition += sizeof(int32_t); } ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(atomSize)); chunkPosition += sizeof(uint8_t); } inline void AddTransfer(const void* src, const std::vector<uint32_t>& blockSize, const std::vector<int32_t>& blockStride, const std::vector<uint32_t>& elementSize, const std::vector<int32_t>& elementStride, LCAccNode& dst, uintptr_t dstBaseAddr, const std::vector<uint32_t>& dstSize, const std::vector<int32_t>& dstStride, uint32_t atomSize) { simics_assert(!finalized); simics_assert(computesHaveBeenWritten); simics_assert(dstSize.size() == dstStride.size()); simics_assert(blockSize.size() == blockStride.size()); simics_assert(elementSize.size() == elementStride.size()); transfersHaveBeenWritten++; int chunkSize = sizeof(uintptr_t) * 2 + sizeof(uint32_t) * (3 + dstSize.size() + blockSize.size() + elementSize.size()) + sizeof(int32_t) * (1 + dstSize.size() + blockSize.size() + elementSize.size()) + sizeof(uint8_t) * 5; size_t chunkPosition = buffer.size(); for(int i = 0; i < chunkSize; i++) { buffer.push_back(0); } ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(-1)); chunkPosition += sizeof(uint32_t); ConvertToBytes<uintptr_t>(buffer, chunkPosition, (uintptr_t)(src)); chunkPosition += sizeof(uintptr_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(blockSize.size())); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(elementSize.size())); chunkPosition += sizeof(uint8_t); dst.PlaceLCAccID(buffer, chunkPosition); chunkPosition += sizeof(uint32_t); ConvertToBytes<uintptr_t>(buffer, chunkPosition, (uintptr_t)(dstBaseAddr)); chunkPosition += sizeof(uintptr_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(1)); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(dstSize.size())); chunkPosition += sizeof(uint8_t); for(size_t i = 0; i < blockSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(blockSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(blockStride[i])); chunkPosition += sizeof(int32_t); } for(size_t i = 0; i < elementSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(elementSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(elementStride[i])); chunkPosition += sizeof(int32_t); } ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(dst.spmWindowCount)); chunkPosition += sizeof(uint32_t);//first, position the element in the spm ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(dst.spmWindowSize)); chunkPosition += sizeof(int32_t); for(size_t i = 0; i < dstSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(dstSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(dstStride[i])); chunkPosition += sizeof(int32_t); } ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(atomSize)); chunkPosition += sizeof(uint8_t); } inline void AddTransfer(LCAccNode& src, uint32_t srcBaseAddr, const std::vector<uint32_t>& srcSize, const std::vector<int32_t>& srcStride, LCAccNode& dst, uint32_t dstBaseAddr, const std::vector<uint32_t>& dstSize, const std::vector<int32_t>& dstStride, uint32_t atomSize) { simics_assert(!finalized); simics_assert(computesHaveBeenWritten); simics_assert(dstSize.size() == dstStride.size()); simics_assert(srcSize.size() == srcStride.size()); transfersHaveBeenWritten++; int chunkSize = sizeof(uintptr_t) * 2 + sizeof(uint32_t) * (4 + srcSize.size() + dstSize.size()) + sizeof(int32_t) * (2 + srcSize.size() + dstSize.size()) + sizeof(uint8_t) * 5; size_t chunkPosition = buffer.size(); for(int i = 0; i < chunkSize; i++) { buffer.push_back(0); } src.PlaceLCAccID(buffer, chunkPosition); chunkPosition += sizeof(uint32_t); ConvertToBytes<uintptr_t>(buffer, chunkPosition, (uintptr_t)(srcBaseAddr)); chunkPosition += sizeof(uintptr_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(1)); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(srcSize.size())); chunkPosition += sizeof(uint8_t); dst.PlaceLCAccID(buffer, chunkPosition); chunkPosition += sizeof(uint32_t); ConvertToBytes<uintptr_t>(buffer, chunkPosition, (uintptr_t)(dstBaseAddr)); chunkPosition += sizeof(uintptr_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(1)); chunkPosition += sizeof(uint8_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(dstSize.size())); chunkPosition += sizeof(uint8_t); //Source first ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(src.spmWindowCount)); chunkPosition += sizeof(uint32_t);//first, position the element in the spm ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(src.spmWindowSize)); chunkPosition += sizeof(int32_t); for(size_t i = 0; i < srcSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(srcSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(srcStride[i])); chunkPosition += sizeof(int32_t); } //Destination next ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(dst.spmWindowCount)); chunkPosition += sizeof(uint32_t);//first, position the element in the spm ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(dst.spmWindowSize)); chunkPosition += sizeof(int32_t); for(size_t i = 0; i < dstSize.size(); i++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(dstSize[i])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(dstStride[i])); chunkPosition += sizeof(int32_t); } ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(atomSize)); chunkPosition += sizeof(uint8_t); } inline void AddCompute(LCAccNode& node, const std::vector<ComputeArgIndex>& indexSet, const std::vector<uint64_t>& registers) { simics_assert(!finalized); simics_assert(!transfersHaveBeenWritten); computesHaveBeenWritten++; int chunkSize = sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint8_t) + (sizeof(uint64_t) * registers.size()); for(size_t i = 0; i < indexSet.size(); i++) { chunkSize += sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint8_t) + ((sizeof(int32_t) * indexSet[i].stride.size()) + (sizeof(uint32_t) * indexSet[i].size.size())); } size_t chunkPosition = buffer.size(); for(int i = 0; i < chunkSize; i++) { buffer.push_back(0); } ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(node.lcaccOpCode)); chunkPosition += sizeof(uint32_t); ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(node.spmWindowCount)); chunkPosition += sizeof(uint32_t); ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(node.spmWindowSize)); chunkPosition += sizeof(uint32_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(indexSet.size())); chunkPosition += sizeof(uint8_t); for(size_t i = 0; i < indexSet.size(); i++) { simics_assert(indexSet[i].size.size() == indexSet[i].stride.size()); ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(indexSet[i].baseAddr)); chunkPosition += sizeof(uint32_t); ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(indexSet[i].size.size())); chunkPosition += sizeof(uint8_t); for(size_t j = 0; j < indexSet[i].size.size(); j++) { ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(indexSet[i].size[j])); chunkPosition += sizeof(uint32_t); ConvertToBytes<int32_t>(buffer, chunkPosition, (int32_t)(indexSet[i].stride[j])); chunkPosition += sizeof(int32_t); } ConvertToBytes<uint32_t>(buffer, chunkPosition, (uint32_t)(indexSet[i].elementSize)); chunkPosition += sizeof(uint32_t); } ConvertToBytes<uint8_t>(buffer, chunkPosition, (uint8_t)(registers.size())); chunkPosition += sizeof(uint8_t); for(size_t i = 0; i < registers.size(); i++) { ConvertToBytes<uint64_t>(buffer, chunkPosition, (uint64_t)(registers[i])); chunkPosition += sizeof(uint64_t); } } inline void Finalize(uint32_t skipTasks, uint32_t numberOfTasks) { simics_assert(!finalized); if(signature) { ConvertToBytes<uint8_t>(buffer, 0, transfersHaveBeenWritten); ConvertToBytes<uint8_t>(buffer, sizeof(uint8_t), computesHaveBeenWritten); ConvertToBytes<uint32_t>(buffer, sizeof(uint8_t) + sizeof(uint8_t), skipTasks); ConvertToBytes<uint32_t>(buffer, sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint32_t), numberOfTasks); } else { simics_assert(skipTasks == 0); ConvertToBytes<uint16_t>(buffer, 0, computesHaveBeenWritten); ConvertToBytes<uint16_t>(buffer, sizeof(uint16_t), transfersHaveBeenWritten); ConvertToBytes<uint32_t>(buffer, sizeof(uint16_t) + sizeof(uint16_t), taskGrain); ConvertToBytes<uint32_t>(buffer, sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t), numberOfTasks); } finalized = true; } inline void Finalize(uint32_t numberOfTasks) { Finalize(0, numberOfTasks); } inline uint8_t* GetBuffer() { simics_assert(finalized); return &(buffer.at(0)); } inline uint32_t GetBufferSize() const { simics_assert(finalized); return (uint32_t)(buffer.size()); } inline bool IsFinalized() const { return finalized; } }; inline void PrepareAsync_td(int thread, InterruptArgs& isrArgs) { isrArgs.threadID = thread; isrArgs.lcaccID = 0; isrArgs.lcaccMode = 0; LWI_RegisterInterruptHandler(&isrArgs); } inline void FireAsync_td_buf(uint8_t* buf, uint32_t bufSize, int thread) { LCAcc_Command(thread, 0, LCACC_CMD_BEGIN_PROGRAM, buf, bufSize, 0, 0); } inline void WaitAsync_td(int thread, InterruptArgs& isrArgs, int count) { for(int i = 0; i < count; i++) { bool stillWorking = true; while(stillWorking) { InterruptArgs* args = 0; while((args = LWI_CheckInterrupt(thread)) == 0); simics_assert(args->lcaccMode == 0); switch(args->status) { case(LCACC_STATUS_TLB_MISS): LCAcc_Command(args->threadID, args->lcaccID, LCACC_CMD_TLB_SERVICE, (void*)(args->v[0]), 0, 0, 0); break; case(LCACC_STATUS_COMPLETED): stillWorking = false; break; default: simics_assert(0); stillWorking = false; } LWI_ClearInterrupt(thread); } } } #endif #ifndef LCACC_BODY_SIG__Segmentation1LCacc__X #define LCACC_BODY_SIG__Segmentation1LCacc__X #define LCACC_CLASS_SIG__Segmentation1LCacc__s 1 class InstanceData_sig__Segmentation1LCacc { public: InterruptArgs GAM_INTERACTION; int threadID; uint32_t binBufSize; unsigned int pendingAccelerators; unsigned int reservedAccelerators; unsigned int acceleratorVectorLength; int allocatedAcceleratorCount__segmentation1Mega; int allocatedAcceleratorIDSet__segmentation1Mega[1]; float (*LCAcc_FuncArgs__phi); float (*LCAcc_FuncArgs__u0); float (*LCAcc_FuncArgs__result); int LCAcc_FuncVars__sizeX; int LCAcc_FuncVars__sizeY; int LCAcc_FuncVars__sizeZ; int LCAcc_FuncVars__chunkX; int LCAcc_FuncVars__chunkY; int LCAcc_FuncVars__chunkZ; float LCAcc_FuncVars__dx; float LCAcc_FuncVars__dy; float LCAcc_FuncVars__dz; float LCAcc_FuncVars__lambda1; float LCAcc_FuncVars__lambda2; float LCAcc_FuncVars__mu; float LCAcc_FuncVars__c1; float LCAcc_FuncVars__c2; MicroprogramWriter acceleratorSignature__s; LCAccNode node_s; InterruptArgs HandlerArgs__s; inline void Reset() { pendingAccelerators = 0; allocatedAcceleratorCount__segmentation1Mega = 0; reservedAccelerators = 0; allocatedAcceleratorIDSet__segmentation1Mega[0] = 0; HandlerArgs__s.threadID = threadID; HandlerArgs__s.status = 0; HandlerArgs__s.taskIndex = 0; HandlerArgs__s.lcaccMode = LCACC_CLASS_SIG__Segmentation1LCacc__s; node_s.Reset(); } inline InstanceData_sig__Segmentation1LCacc() : acceleratorSignature__s(true), node_s(301), threadID(0) { Reset(); } }; inline void (*GAMHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance, InterruptArgs* args))(InstanceData_sig__Segmentation1LCacc*) ; inline void Cleanup_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance); inline void StartEverythingHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance); inline void StopEverythingHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance); inline void ErrorHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance); inline void Wait_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance); inline unsigned int DelayEstimate_sig__Segmentation1LCacc(int vectorSize) { return 1; } inline void (*ProgressHandler_sig__Segmentation1LCacc__s(InstanceData_sig__Segmentation1LCacc* instance, InterruptArgs* args))(InstanceData_sig__Segmentation1LCacc*); //This is a procedurally generated interrupt-based program from a RAGraph data structure for function Segmentation1LCacc inline void Wait_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance) { while(1) { int thread = instance->threadID; InterruptArgs* args = 0; void (*progress)(InstanceData_sig__Segmentation1LCacc*); while((args = LWI_CheckInterrupt(thread)) == 0); switch(args->lcaccMode) { case(0): progress = GAMHandler_sig__Segmentation1LCacc(instance, args); break; case(LCACC_CLASS_SIG__Segmentation1LCacc__s): progress = ProgressHandler_sig__Segmentation1LCacc__s(instance, args); break; default: ErrorHandler_sig__Segmentation1LCacc(instance); simics_assert(0); } LWI_ClearInterrupt(instance->threadID); if(progress) { progress(instance); return; } } } inline void (*GAMHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance, InterruptArgs* args))(InstanceData_sig__Segmentation1LCacc*) { int i; int lcaccMode; int count; int lcaccID; switch(args->status) { case(LCACC_GAM_WAIT): lcaccMode = args->v[0]; count = args->v[1]; switch(lcaccMode) { case(301)://Mode: segmentation1Mega for(i = 0; i < 1; i++) { instance->reservedAccelerators++; LCAcc_Reserve(args->threadID, args->v[2 + 2 * i], 1); } break; } if(instance->reservedAccelerators == 1) { instance->reservedAccelerators = 0; LCAcc_Reserve(args->threadID, 0, DelayEstimate_sig__Segmentation1LCacc(instance->acceleratorVectorLength)); } return 0; break; case(LCACC_GAM_GRANT): lcaccMode = args->v[0]; lcaccID = args->v[1]; switch(lcaccMode) { case(301): if(instance->allocatedAcceleratorCount__segmentation1Mega == 1) { return ErrorHandler_sig__Segmentation1LCacc; } else { instance->pendingAccelerators++; instance->allocatedAcceleratorIDSet__segmentation1Mega[instance->allocatedAcceleratorCount__segmentation1Mega] = lcaccID; instance->allocatedAcceleratorCount__segmentation1Mega++; } break; default: return ErrorHandler_sig__Segmentation1LCacc; } if(instance->allocatedAcceleratorCount__segmentation1Mega == 1) { return StartEverythingHandler_sig__Segmentation1LCacc; } else { return 0; } break; case(LCACC_GAM_ERROR): return ErrorHandler_sig__Segmentation1LCacc; break; case(LCACC_GAM_REVOKE)://assumed thus far never to occur return ErrorHandler_sig__Segmentation1LCacc; break; default: return ErrorHandler_sig__Segmentation1LCacc; } } inline void Cleanup_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance) { int i; LWI_UnregisterInterruptHandler(instance->GAM_INTERACTION.threadID, 0); if(instance->allocatedAcceleratorIDSet__segmentation1Mega[0] != 0) { LCAcc_Free(instance->HandlerArgs__s.threadID, instance->HandlerArgs__s.lcaccID); LWI_UnregisterInterruptHandler(instance->HandlerArgs__s.threadID, instance->HandlerArgs__s.lcaccID); } } inline void StopEverythingHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance) { Cleanup_sig__Segmentation1LCacc(instance); } inline void ErrorHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance) { Cleanup_sig__Segmentation1LCacc(instance); simics_assert(0); } inline void (*ProgressHandler_sig__Segmentation1LCacc__s(InstanceData_sig__Segmentation1LCacc* instance, InterruptArgs* args))(InstanceData_sig__Segmentation1LCacc*) { switch(args->status) { case(LCACC_STATUS_TLB_MISS): LCAcc_Command(args->threadID, args->lcaccID, LCACC_CMD_TLB_SERVICE, (void*)(args->v[0]), 0, 0, 0); return 0; case(LCACC_STATUS_COMPLETED): instance->pendingAccelerators--; if(instance->pendingAccelerators == 0) { return StopEverythingHandler_sig__Segmentation1LCacc; } else { return 0; } case(LCACC_STATUS_ERROR): return ErrorHandler_sig__Segmentation1LCacc; default: simics_assert(0); return 0; } } inline void StartEverythingHandler_sig__Segmentation1LCacc(InstanceData_sig__Segmentation1LCacc* instance) { int index; instance->HandlerArgs__s.threadID = instance->threadID; instance->HandlerArgs__s.lcaccID = instance->allocatedAcceleratorIDSet__segmentation1Mega[0]; instance->node_s.SetLCAccID(instance->HandlerArgs__s.lcaccID); instance->HandlerArgs__s.status = 0; instance->HandlerArgs__s.taskIndex = 0; instance->HandlerArgs__s.lcaccMode = LCACC_CLASS_SIG__Segmentation1LCacc__s; LWI_RegisterInterruptHandler(&(instance->HandlerArgs__s)); simics_assert(instance->acceleratorSignature__s.IsFinalized()); LCAcc_Command(instance->HandlerArgs__s.threadID, instance->HandlerArgs__s.lcaccID, LCACC_CMD_BEGIN_TASK_SIGNATURE, instance->acceleratorSignature__s.GetBuffer(), instance->acceleratorSignature__s.GetBufferSize(), 0, 0); Wait_sig__Segmentation1LCacc(instance);// wait for everything to finish } inline void CreateBuffer_Segmentation1LCacc_sig(int thread, InstanceData_sig__Segmentation1LCacc* instance, float (*phi), float (*u0), float (*result), int sizeX, int sizeY, int sizeZ, int chunkX, int chunkY, int chunkZ, float dx, float dy, float dz, float lambda1, float lambda2, float mu, float c1, float c2) { simics_assert(chunkX > 0); simics_assert(chunkY > 0); simics_assert(chunkZ > 0); simics_assert((sizeX - 2) > 0); simics_assert((sizeY - 2) > 0); simics_assert((sizeZ - 2) > 0); simics_assert((sizeX - 2) % chunkX == 0); simics_assert((sizeY - 2) % chunkY == 0); simics_assert((sizeZ - 2) % chunkZ == 0); simics_assert(phi != result); simics_assert(u0 != result); int index, i; instance->binBufSize = 0; instance->threadID = thread; instance->GAM_INTERACTION.threadID = thread; instance->GAM_INTERACTION.lcaccID = 0; instance->GAM_INTERACTION.lcaccMode = 0; instance->node_s.SetSPMConfig((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ)), 3, 0); instance->LCAcc_FuncArgs__phi = phi; instance->LCAcc_FuncArgs__u0 = u0; instance->LCAcc_FuncArgs__result = result; instance->LCAcc_FuncVars__sizeX = sizeX; instance->LCAcc_FuncVars__sizeY = sizeY; instance->LCAcc_FuncVars__sizeZ = sizeZ; instance->LCAcc_FuncVars__chunkX = chunkX; instance->LCAcc_FuncVars__chunkY = chunkY; instance->LCAcc_FuncVars__chunkZ = chunkZ; instance->LCAcc_FuncVars__dx = dx; instance->LCAcc_FuncVars__dy = dy; instance->LCAcc_FuncVars__dz = dz; instance->LCAcc_FuncVars__lambda1 = lambda1; instance->LCAcc_FuncVars__lambda2 = lambda2; instance->LCAcc_FuncVars__mu = mu; instance->LCAcc_FuncVars__c1 = c1; instance->LCAcc_FuncVars__c2 = c2; instance->allocatedAcceleratorCount__segmentation1Mega = 0; LCAccNode& VNR_vardecl_0(instance->node_s); void* VNR_vardecl_1(instance->LCAcc_FuncArgs__phi); void* VNR_vardecl_2(instance->LCAcc_FuncArgs__u0); void* VNR_vardecl_3(instance->LCAcc_FuncArgs__result); std::vector<uint32_t> VNR_vardecl_4; VNR_vardecl_4.push_back(((chunkX + 1) - (1)) / (1)); VNR_vardecl_4.push_back(((chunkY + 1) - (1)) / (1)); VNR_vardecl_4.push_back(((chunkZ + 1) - (1)) / (1)); std::vector<int32_t> VNR_vardecl_5; VNR_vardecl_5.push_back((1) * (sizeof(float) * (chunkY + 2) * (chunkZ + 2))); VNR_vardecl_5.push_back((1) * (sizeof(float) * (chunkZ + 2))); VNR_vardecl_5.push_back((1) * (sizeof(float))); MicroprogramWriter::ComputeArgIndex VNR_vardecl_6((0) + ((((1) * (sizeof(float) * (chunkY + 2) * (chunkZ + 2))) + ((1) * (sizeof(float) * (chunkZ + 2))) + ((1) * (sizeof(float))))), sizeof(float), VNR_vardecl_4, VNR_vardecl_5); std::vector<uint32_t> VNR_vardecl_7; VNR_vardecl_7.push_back(((chunkX) - (0)) / (1)); VNR_vardecl_7.push_back(((chunkY) - (0)) / (1)); VNR_vardecl_7.push_back(((chunkZ) - (0)) / (1)); std::vector<int32_t> VNR_vardecl_8; VNR_vardecl_8.push_back((1) * (sizeof(float) * (chunkY) * (chunkZ))); VNR_vardecl_8.push_back((1) * (sizeof(float) * (chunkZ))); VNR_vardecl_8.push_back((1) * (sizeof(float))); MicroprogramWriter::ComputeArgIndex VNR_vardecl_9(((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2))) + ((((0) * (sizeof(float) * (chunkY) * (chunkZ))) + ((0) * (sizeof(float) * (chunkZ))) + ((0) * (sizeof(float))))), sizeof(float), VNR_vardecl_7, VNR_vardecl_8); MicroprogramWriter::ComputeArgIndex VNR_vardecl_10(((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ))) + ((((0) * (sizeof(float) * (chunkY) * (chunkZ))) + ((0) * (sizeof(float) * (chunkZ))) + ((0) * (sizeof(float))))), sizeof(float), VNR_vardecl_7, VNR_vardecl_8); std::vector<MicroprogramWriter::ComputeArgIndex> VNR_vardecl_11; VNR_vardecl_11.push_back(VNR_vardecl_6); VNR_vardecl_11.push_back(VNR_vardecl_9); VNR_vardecl_11.push_back(VNR_vardecl_10); std::vector<uint64_t> VNR_vardecl_12; VNR_vardecl_12.push_back(ConvertToType<int, uint64_t>(chunkX)/*Register width*/); VNR_vardecl_12.push_back(ConvertToType<int, uint64_t>(chunkY)/*Register height*/); VNR_vardecl_12.push_back(ConvertToType<int, uint64_t>(chunkZ)/*Register depth*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(dx)/*Register dx*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(dy)/*Register dy*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(dz)/*Register dz*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(lambda1)/*Register lambda1*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(lambda2)/*Register lambda2*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(mu)/*Register mu*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(c1)/*Register c1*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(c2)/*Register c2*/); std::vector<uint32_t> VNR_vardecl_13; VNR_vardecl_13.push_back(((sizeX - 1) - (1)) / (chunkX)); VNR_vardecl_13.push_back(((sizeY - 1) - (1)) / (chunkY)); VNR_vardecl_13.push_back(((sizeZ - 1) - (1)) / (chunkZ)); std::vector<int32_t> VNR_vardecl_14; VNR_vardecl_14.push_back((chunkX) * ((sizeof(float) * (sizeY) * (sizeZ)))); VNR_vardecl_14.push_back((chunkY) * ((sizeof(float) * (sizeZ)))); VNR_vardecl_14.push_back((chunkZ) * ((sizeof(float)))); std::vector<uint32_t> VNR_vardecl_15; VNR_vardecl_15.push_back(((chunkX + 2) - (0)) / (1)); VNR_vardecl_15.push_back(((chunkY + 2) - (0)) / (1)); VNR_vardecl_15.push_back(((chunkZ + 2) - (0)) / (1)); std::vector<int32_t> VNR_vardecl_16; VNR_vardecl_16.push_back((1) * ((sizeof(float) * (sizeY) * (sizeZ)))); VNR_vardecl_16.push_back((1) * ((sizeof(float) * (sizeZ)))); VNR_vardecl_16.push_back((1) * ((sizeof(float)))); std::vector<int32_t> VNR_vardecl_17; VNR_vardecl_17.push_back((1) * ((sizeof(float)) * (chunkY + 2) * (chunkZ + 2))); VNR_vardecl_17.push_back((1) * ((sizeof(float)) * (chunkZ + 2))); VNR_vardecl_17.push_back((1) * ((sizeof(float)))); std::vector<uint32_t> VNR_vardecl_18; VNR_vardecl_18.push_back(((chunkY) - (0)) / (1)); VNR_vardecl_18.push_back(((chunkY) - (0)) / (1)); VNR_vardecl_18.push_back(((chunkZ) - (0)) / (1)); std::vector<int32_t> VNR_vardecl_19; VNR_vardecl_19.push_back((1) * ((sizeof(float)) * (chunkY) * (chunkZ))); VNR_vardecl_19.push_back((1) * ((sizeof(float)) * (chunkZ))); VNR_vardecl_19.push_back((1) * ((sizeof(float)))); //produce compute set //See VNR_vardecl_11 for index variable decl //See VNR_vardecl_12 for register set decl instance->acceleratorSignature__s.AddCompute(VNR_vardecl_0, VNR_vardecl_11, VNR_vardecl_12); //produce transfer set //transfer from phi to s //Search VNR_vardecl_13 for source block size. //Search VNR_vardecl_14 for source block stride. //Search VNR_vardecl_15 for source element size. //Search VNR_vardecl_16 for source element stride. //Search VNR_vardecl_15 for destination size. //Search VNR_vardecl_17 for destination stride. instance->acceleratorSignature__s.AddTransfer(VNR_vardecl_1, VNR_vardecl_13, VNR_vardecl_14, VNR_vardecl_15, VNR_vardecl_16, VNR_vardecl_0, (0) + ((((0) * ((sizeof(float)) * (chunkY + 2) * (chunkZ + 2))) + ((0) * ((sizeof(float)) * (chunkZ + 2))) + ((0) * ((sizeof(float)))))), VNR_vardecl_15, VNR_vardecl_17, sizeof(float)); //transfer from u0 to s //Search VNR_vardecl_13 for source block size. //Search VNR_vardecl_14 for source block stride. //Search VNR_vardecl_18 for source element size. //Search VNR_vardecl_16 for source element stride. //Search VNR_vardecl_18 for destination size. //Search VNR_vardecl_19 for destination stride. instance->acceleratorSignature__s.AddTransfer(VNR_vardecl_2, VNR_vardecl_13, VNR_vardecl_14, VNR_vardecl_18, VNR_vardecl_16, VNR_vardecl_0, ((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2))) + ((((0) * ((sizeof(float)) * (chunkY) * (chunkZ))) + ((0) * ((sizeof(float)) * (chunkZ))) + ((0) * ((sizeof(float)))))), VNR_vardecl_18, VNR_vardecl_19, sizeof(float)); //transfer from s to result //Search VNR_vardecl_7 for source size. //Search VNR_vardecl_19 for source stride. //Search VNR_vardecl_13 for destination block size. //Search VNR_vardecl_14 for destination block stride. //Search VNR_vardecl_7 for destination element size. //Search VNR_vardecl_16 for destination element stride. instance->acceleratorSignature__s.AddTransfer(VNR_vardecl_0, ((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ))) + ((((0) * ((sizeof(float)) * (chunkY) * (chunkZ))) + ((0) * ((sizeof(float)) * (chunkZ))) + ((0) * ((sizeof(float)))))), VNR_vardecl_7, VNR_vardecl_19, VNR_vardecl_3, VNR_vardecl_13, VNR_vardecl_14, VNR_vardecl_7, VNR_vardecl_16, sizeof(float)); instance->acceleratorSignature__s.Finalize((((sizeX - 1) - (1)) / (chunkX)) * (((sizeY - 1) - (1)) / (chunkY)) * (((sizeZ - 1) - (1)) / (chunkZ))); } inline void Segmentation1LCacc_sig_buf(int threadID, InstanceData_sig__Segmentation1LCacc* instance) { instance->Reset(); LWI_RegisterInterruptHandler(&(instance->GAM_INTERACTION)); LCAcc_Request(threadID, 301, 1);//request something of type AcceleratorType Wait_sig__Segmentation1LCacc(instance);// wait for everything to finish } inline void Segmentation1LCacc_sig(int threadID, float (*phi), float (*u0), float (*result), int sizeX, int sizeY, int sizeZ, int chunkX, int chunkY, int chunkZ, float dx, float dy, float dz, float lambda1, float lambda2, float mu, float c1, float c2) { InstanceData_sig__Segmentation1LCacc instance; CreateBuffer_Segmentation1LCacc_sig(threadID, &instance, phi, u0, result, sizeX, sizeY, sizeZ, chunkX, chunkY, chunkZ, dx, dy, dz, lambda1, lambda2, mu, c1, c2); Segmentation1LCacc_sig_buf(threadID, &instance); } class BiN_Segmentation1LCacc_Arbitrator_sig { std::vector<InstanceData_sig__Segmentation1LCacc*> instanceSet; std::vector<uint32_t> performancePoint; std::vector<uint32_t> cachePressureMod; std::vector<uint32_t> ops; std::vector<uint32_t> count; int threadID; int allocatedAcceleratorCount__segmentation1Mega; int allocatedAcceleratorIDSet__segmentation1Mega[1]; InterruptArgs isr; public: inline BiN_Segmentation1LCacc_Arbitrator_sig(int thread) { ops.push_back(301); count.push_back(1); threadID = thread; } inline void AddConfig(InstanceData_sig__Segmentation1LCacc* inst, uint32_t performance, uint32_t cacheMod) { simics_assert(inst->acceleratorSignature__s.IsFinalized()); instanceSet.push_back(inst); performancePoint.push_back(performance); cachePressureMod.push_back(cacheMod); } inline void Run() { isr.threadID = threadID; isr.lcaccID = 0; isr.lcaccMode = 0; for(size_t i = 0; i < instanceSet.size(); i++) { instanceSet[i]->Reset(); } LWI_RegisterInterruptHandler(&isr); int allocatedAcceleratorCount__segmentation1Mega = 0; LCAcc_Request(threadID, 301, 1);//request something of type AcceleratorType bool cont = true; uint32_t bufferSize = 0; bool bufKnown = false; uint32_t bufferID; int reserves = 0; while(cont) { InterruptArgs* args = 0; while((args = LWI_CheckInterrupt(threadID)) == 0); simics_assert(args == &isr); switch(args->status) { case(LCACC_GAM_WAIT): { int mode = args->v[0]; switch(mode) { case(301)://Mode: segmentation1Mega for(int i = 0; i < 1; i++) { reserves++; LCAcc_Reserve(threadID, args->v[2 + 2 * i], 1); } break; } if(reserves == 1) { for(size_t i = 0; i < instanceSet.size(); i++) { LCAcc_SendBiNCurve(threadID, instanceSet[i]->binBufSize, performancePoint[i], cachePressureMod[i]); } LCAcc_Reserve(threadID, 0, 1); } } break; case(LCACC_GAM_GRANT): { uint32_t lcaccMode = args->v[0]; uint32_t lcaccID = args->v[1]; uint32_t bufSize = args->v[3]; if(!bufKnown) { bufferSize = bufSize; bufKnown = true; } else { simics_assert(bufferSize == bufSize); } switch(lcaccMode) { case(301): simics_assert(allocatedAcceleratorCount__segmentation1Mega < 1); allocatedAcceleratorIDSet__segmentation1Mega[allocatedAcceleratorCount__segmentation1Mega] = lcaccID; allocatedAcceleratorCount__segmentation1Mega++; break; default: simics_assert(0); } if(allocatedAcceleratorCount__segmentation1Mega == 1) { cont = false; } } break; default: simics_assert(0); } LWI_ClearInterrupt(threadID); } simics_assert(bufKnown); InstanceData_sig__Segmentation1LCacc* inst = NULL; for(size_t i = 0; i < instanceSet.size(); i++) { if(instanceSet[i]->binBufSize == bufferSize) { inst = instanceSet[i]; break; } } simics_assert(inst); for(int i = 0; i < 1; i++) { inst->allocatedAcceleratorIDSet__segmentation1Mega[i] = allocatedAcceleratorIDSet__segmentation1Mega[i]; } inst->allocatedAcceleratorCount__segmentation1Mega = allocatedAcceleratorCount__segmentation1Mega; inst->pendingAccelerators = 1; StartEverythingHandler_sig__Segmentation1LCacc(inst); } }; #endif #ifndef LCACC_BODY_TD__Segmentation1LCacc__X #define LCACC_BODY_TD__Segmentation1LCacc__X inline void Wait_td__Segmentation1LCacc(int thread) { int stillWorking = (thread == 0) ? 0 : 1; while(stillWorking) { InterruptArgs* args = 0; while((args = LWI_CheckInterrupt(thread)) == 0); simics_assert(args->lcaccMode == 0); switch(args->status) { case(LCACC_STATUS_TLB_MISS): LCAcc_Command(args->threadID, args->lcaccID, LCACC_CMD_TLB_SERVICE, (void*)(args->v[0]), 0, 0, 0); break; case(LCACC_STATUS_COMPLETED): stillWorking = 0; break; default: simics_assert(0); stillWorking = 0; } LWI_ClearInterrupt(thread); } } inline void CreateBuffer_Segmentation1LCacc_td(uint8_t** buffer, uint32_t* bufferSize, uint8_t** constCluster, int thread, float (*phi), float (*u0), float (*result), int sizeX, int sizeY, int sizeZ, int chunkX, int chunkY, int chunkZ, float dx, float dy, float dz, float lambda1, float lambda2, float mu, float c1, float c2) { simics_assert(chunkX > 0); simics_assert(chunkY > 0); simics_assert(chunkZ > 0); simics_assert((sizeX - 2) > 0); simics_assert((sizeY - 2) > 0); simics_assert((sizeZ - 2) > 0); simics_assert((sizeX - 2) % chunkX == 0); simics_assert((sizeY - 2) % chunkY == 0); simics_assert((sizeZ - 2) % chunkZ == 0); simics_assert(phi != result); simics_assert(u0 != result); MicroprogramWriter mw(false); void* LCAcc_FuncArgs__phi = phi; void* LCAcc_FuncArgs__u0 = u0; void* LCAcc_FuncArgs__result = result; { void* VNR_vardecl_0(phi); void* VNR_vardecl_1(u0); void* VNR_vardecl_2(result); LCAccNode VNR_vardecl_3(301, (sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ)), 3, 0, 0); std::vector<uint32_t> VNR_vardecl_4; VNR_vardecl_4.push_back(((chunkX + 1) - (1)) / (1)); VNR_vardecl_4.push_back(((chunkY + 1) - (1)) / (1)); VNR_vardecl_4.push_back(((chunkZ + 1) - (1)) / (1)); std::vector<int32_t> VNR_vardecl_5; VNR_vardecl_5.push_back((1) * (sizeof(float) * (chunkY + 2) * (chunkZ + 2))); VNR_vardecl_5.push_back((1) * (sizeof(float) * (chunkZ + 2))); VNR_vardecl_5.push_back((1) * (sizeof(float))); MicroprogramWriter::ComputeArgIndex VNR_vardecl_6((0) + ((((1) * (sizeof(float) * (chunkY + 2) * (chunkZ + 2))) + ((1) * (sizeof(float) * (chunkZ + 2))) + ((1) * (sizeof(float))))), sizeof(float), VNR_vardecl_4, VNR_vardecl_5); std::vector<uint32_t> VNR_vardecl_7; VNR_vardecl_7.push_back(((chunkX) - (0)) / (1)); VNR_vardecl_7.push_back(((chunkY) - (0)) / (1)); VNR_vardecl_7.push_back(((chunkZ) - (0)) / (1)); std::vector<int32_t> VNR_vardecl_8; VNR_vardecl_8.push_back((1) * (sizeof(float) * (chunkY) * (chunkZ))); VNR_vardecl_8.push_back((1) * (sizeof(float) * (chunkZ))); VNR_vardecl_8.push_back((1) * (sizeof(float))); MicroprogramWriter::ComputeArgIndex VNR_vardecl_9(((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2))) + ((((0) * (sizeof(float) * (chunkY) * (chunkZ))) + ((0) * (sizeof(float) * (chunkZ))) + ((0) * (sizeof(float))))), sizeof(float), VNR_vardecl_7, VNR_vardecl_8); MicroprogramWriter::ComputeArgIndex VNR_vardecl_10(((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ))) + ((((0) * (sizeof(float) * (chunkY) * (chunkZ))) + ((0) * (sizeof(float) * (chunkZ))) + ((0) * (sizeof(float))))), sizeof(float), VNR_vardecl_7, VNR_vardecl_8); std::vector<MicroprogramWriter::ComputeArgIndex> VNR_vardecl_11; VNR_vardecl_11.push_back(VNR_vardecl_6); VNR_vardecl_11.push_back(VNR_vardecl_9); VNR_vardecl_11.push_back(VNR_vardecl_10); std::vector<uint64_t> VNR_vardecl_12; VNR_vardecl_12.push_back(ConvertToType<int, uint64_t>(chunkX)/*Register width*/); VNR_vardecl_12.push_back(ConvertToType<int, uint64_t>(chunkY)/*Register height*/); VNR_vardecl_12.push_back(ConvertToType<int, uint64_t>(chunkZ)/*Register depth*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(dx)/*Register dx*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(dy)/*Register dy*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(dz)/*Register dz*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(lambda1)/*Register lambda1*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(lambda2)/*Register lambda2*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(mu)/*Register mu*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(c1)/*Register c1*/); VNR_vardecl_12.push_back(ConvertToType<float, uint64_t>(c2)/*Register c2*/); std::vector<uint32_t> VNR_vardecl_13; VNR_vardecl_13.push_back(((sizeX - 1) - (1)) / (chunkX)); VNR_vardecl_13.push_back(((sizeY - 1) - (1)) / (chunkY)); VNR_vardecl_13.push_back(((sizeZ - 1) - (1)) / (chunkZ)); std::vector<int32_t> VNR_vardecl_14; VNR_vardecl_14.push_back((chunkX) * ((sizeof(float) * (sizeY) * (sizeZ)))); VNR_vardecl_14.push_back((chunkY) * ((sizeof(float) * (sizeZ)))); VNR_vardecl_14.push_back((chunkZ) * ((sizeof(float)))); std::vector<uint32_t> VNR_vardecl_15; VNR_vardecl_15.push_back(((chunkX + 2) - (0)) / (1)); VNR_vardecl_15.push_back(((chunkY + 2) - (0)) / (1)); VNR_vardecl_15.push_back(((chunkZ + 2) - (0)) / (1)); std::vector<int32_t> VNR_vardecl_16; VNR_vardecl_16.push_back((1) * ((sizeof(float) * (sizeY) * (sizeZ)))); VNR_vardecl_16.push_back((1) * ((sizeof(float) * (sizeZ)))); VNR_vardecl_16.push_back((1) * ((sizeof(float)))); std::vector<int32_t> VNR_vardecl_17; VNR_vardecl_17.push_back((1) * ((sizeof(float)) * (chunkY + 2) * (chunkZ + 2))); VNR_vardecl_17.push_back((1) * ((sizeof(float)) * (chunkZ + 2))); VNR_vardecl_17.push_back((1) * ((sizeof(float)))); std::vector<uint32_t> VNR_vardecl_18; VNR_vardecl_18.push_back(((chunkY) - (0)) / (1)); VNR_vardecl_18.push_back(((chunkY) - (0)) / (1)); VNR_vardecl_18.push_back(((chunkZ) - (0)) / (1)); std::vector<int32_t> VNR_vardecl_19; VNR_vardecl_19.push_back((1) * ((sizeof(float)) * (chunkY) * (chunkZ))); VNR_vardecl_19.push_back((1) * ((sizeof(float)) * (chunkZ))); VNR_vardecl_19.push_back((1) * ((sizeof(float)))); //See VNR_vardecl_11 for index variable decl //See VNR_vardecl_12 for register set decl mw.AddCompute(VNR_vardecl_3, VNR_vardecl_11, VNR_vardecl_12); //transfer from phi to s //Search VNR_vardecl_13 for source block size. //Search VNR_vardecl_14 for source block stride. //Search VNR_vardecl_15 for source element size. //Search VNR_vardecl_16 for source element stride. //Search VNR_vardecl_15 for destination size. //Search VNR_vardecl_17 for destination stride. mw.AddTransfer(VNR_vardecl_0, VNR_vardecl_13, VNR_vardecl_14, VNR_vardecl_15, VNR_vardecl_16, VNR_vardecl_3, (0) + ((((0) * ((sizeof(float)) * (chunkY + 2) * (chunkZ + 2))) + ((0) * ((sizeof(float)) * (chunkZ + 2))) + ((0) * ((sizeof(float)))))), VNR_vardecl_15, VNR_vardecl_17, sizeof(float)); //transfer from u0 to s //Search VNR_vardecl_13 for source block size. //Search VNR_vardecl_14 for source block stride. //Search VNR_vardecl_18 for source element size. //Search VNR_vardecl_16 for source element stride. //Search VNR_vardecl_18 for destination size. //Search VNR_vardecl_19 for destination stride. mw.AddTransfer(VNR_vardecl_1, VNR_vardecl_13, VNR_vardecl_14, VNR_vardecl_18, VNR_vardecl_16, VNR_vardecl_3, ((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2))) + ((((0) * ((sizeof(float)) * (chunkY) * (chunkZ))) + ((0) * ((sizeof(float)) * (chunkZ))) + ((0) * ((sizeof(float)))))), VNR_vardecl_18, VNR_vardecl_19, sizeof(float)); //transfer from s to result //Search VNR_vardecl_7 for source size. //Search VNR_vardecl_19 for source stride. //Search VNR_vardecl_13 for destination block size. //Search VNR_vardecl_14 for destination block stride. //Search VNR_vardecl_7 for destination element size. //Search VNR_vardecl_16 for destination element stride. mw.AddTransfer(VNR_vardecl_3, ((sizeof(float) * (chunkX + 2) * (chunkY + 2) * (chunkZ + 2)) + (sizeof(float) * (chunkX) * (chunkY) * (chunkZ))) + ((((0) * ((sizeof(float)) * (chunkY) * (chunkZ))) + ((0) * ((sizeof(float)) * (chunkZ))) + ((0) * ((sizeof(float)))))), VNR_vardecl_7, VNR_vardecl_19, VNR_vardecl_2, VNR_vardecl_13, VNR_vardecl_14, VNR_vardecl_7, VNR_vardecl_16, sizeof(float)); mw.SetTaskGrain(0); mw.Finalize((((sizeX - 1) - (1)) / (chunkX)) * (((sizeY - 1) - (1)) / (chunkY)) * (((sizeZ - 1) - (1)) / (chunkZ))); } *buffer = new uint8_t[mw.GetBufferSize()]; *bufferSize = mw.GetBufferSize(); memcpy(*buffer, mw.GetBuffer(), mw.GetBufferSize()); Touch(thread, *buffer, *bufferSize); } inline void Segmentation1LCacc_td_buf(uint8_t* buf, uint32_t bufSize, int thread) { InterruptArgs isrArgs; isrArgs.threadID = thread; isrArgs.lcaccID = 0; isrArgs.lcaccMode = 0; LWI_RegisterInterruptHandler(&isrArgs); LCAcc_Command(thread, isrArgs.lcaccID, LCACC_CMD_BEGIN_PROGRAM, buf, bufSize, 0, 0); Wait_td__Segmentation1LCacc(thread);// wait for everything to finish } void Segmentation1LCacc_td(int thread, float (*phi), float (*u0), float (*result), int sizeX, int sizeY, int sizeZ, int chunkX, int chunkY, int chunkZ, float dx, float dy, float dz, float lambda1, float lambda2, float mu, float c1, float c2) { uint32_t bufSize; uint8_t* buffer; uint8_t* constCluster = NULL; CreateBuffer_Segmentation1LCacc_td(&buffer, &bufSize, &constCluster, thread, phi, u0, result, sizeX, sizeY, sizeZ, chunkX, chunkY, chunkZ, dx, dy, dz, lambda1, lambda2, mu, c1, c2); Segmentation1LCacc_td_buf(buffer, bufSize, thread); if(constCluster) { delete [] constCluster; } delete [] buffer; } inline uint32_t Segmentation1LCacc_CalculateBiNSize(int sizeX, int sizeY, int sizeZ, int chunkX, int chunkY, int chunkZ, float dx, float dy, float dz, float lambda1, float lambda2, float mu, float c1, float c2) { return 0; } class BiN_Segmentation1LCacc_Arbitrator_td { std::vector<uint8_t*> bufSet; std::vector<uint32_t> bufSizeSet; std::vector<uint32_t> binSizeSet; std::vector<uint32_t> performancePoint; std::vector<uint32_t> cachePressureMod; InterruptArgs isr; public: inline BiN_Segmentation1LCacc_Arbitrator_td(){} inline void AddConfig(uint8_t* buf, uint32_t bufSize, uint32_t binSize, uint32_t performance, uint32_t cacheMod) { bufSet.push_back(buf); bufSizeSet.push_back(bufSize); binSizeSet.push_back(binSize); performancePoint.push_back(performance); cachePressureMod.push_back(cacheMod); } inline void Run(int threadID) { isr.threadID = threadID; isr.lcaccID = 0; isr.lcaccMode = 0; LCAcc_DeclareLCAccUse(threadID, 301, 1); //requests for segmentation1Mega for(size_t i = 0; i < binSizeSet.size(); i++) { LCAcc_SendBiNCurve(threadID, binSizeSet[i], performancePoint[i], cachePressureMod[i]); } LCAcc_SendBiNCurve(threadID, 0, 0, 0); LWI_RegisterInterruptHandler(&isr); bool cont = true; uint32_t bufferSize = 0; InterruptArgs* args = 0; while((args = LWI_CheckInterrupt(threadID)) == 0); simics_assert(args == &isr); switch(args->status) { case(BIN_CMD_ARBITRATE_RESPONSE): { bufferSize = args->v[0]; cont = false; } break; default: simics_assert(0); } LWI_ClearInterrupt(threadID); for(size_t i = 0; i < binSizeSet.size(); i++) { if(binSizeSet[i] == bufferSize) { Segmentation1LCacc_td_buf(bufSet[i], bufSizeSet[i], threadID); return; } } simics_assert(0); } }; #endif
43.41616
422
0.726547
3322ff02ffeee1498ec7240c5c7f31ca0a3a7d73
1,299
h
C
memreas/AddMemreasShareMediaViewController.h
memreas/memreas-ios-public
86c7a39096a9d1613cb0aa64e8c27278ee350aa9
[ "MIT" ]
null
null
null
memreas/AddMemreasShareMediaViewController.h
memreas/memreas-ios-public
86c7a39096a9d1613cb0aa64e8c27278ee350aa9
[ "MIT" ]
null
null
null
memreas/AddMemreasShareMediaViewController.h
memreas/memreas-ios-public
86c7a39096a9d1613cb0aa64e8c27278ee350aa9
[ "MIT" ]
null
null
null
#import <Foundation/Foundation.h> #import "MasterViewController.h" @import Photos; @class MyConstant; @class GalleryManager; @class MediaItem; @class GridCell; @class ShareCreator; @class MIOSDeviceDetails; @import GoogleMobileAds; @interface AddMemreasShareMediaViewController : MasterViewController { } // // properties // @property (weak, nonatomic) IBOutlet UIView *viewLoading; @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *snifferLoading; @property (weak, nonatomic) IBOutlet UIButton *btnDetails; @property (weak, nonatomic) IBOutlet UIButton *btnMedia; @property (weak, nonatomic) IBOutlet UICollectionView *collectionView; @property (weak, nonatomic) IBOutlet UITextField *txtComment; @property (weak, nonatomic) IBOutlet UIButton *btnAudioComment; @property (weak, nonatomic) IBOutlet UIButton *btnNext; @property (weak, nonatomic) IBOutlet UIButton *btnDone; @property (weak, nonatomic) IBOutlet UIButton *btnCancel; @property (nonatomic,strong) NSString *eventID; - (IBAction)handleAudioComment:(id)sender; - (IBAction)handleNextAction:(id)sender; - (IBAction)handleDoneAction:(id)sender; - (IBAction)handleCancelAction:(id)sender; - (IBAction)handleAddMediaPopup:(id)sender; @property (weak, nonatomic) IBOutlet GADBannerView *bannerView; // // methods // @end
28.23913
77
0.789838
775c6e2e9a60dc3bbeece1deac41e1c5839c64cd
3,178
c
C
ch06/icmpdesterr_bcast.c
GongCun/TCPIP_Illustrated_1thEd_Volume1
e1ad947a053b47efec2a1167565efb1f0e9f7fed
[ "MIT" ]
null
null
null
ch06/icmpdesterr_bcast.c
GongCun/TCPIP_Illustrated_1thEd_Volume1
e1ad947a053b47efec2a1167565efb1f0e9f7fed
[ "MIT" ]
null
null
null
ch06/icmpdesterr_bcast.c
GongCun/TCPIP_Illustrated_1thEd_Volume1
e1ad947a053b47efec2a1167565efb1f0e9f7fed
[ "MIT" ]
null
null
null
#include "tcpi.h" #define WAITTIME 5 static void sig_alrm(int signo) { printf("timeout\n"); exit(1); } static void make_icmp_recv(int, int); int main(int argc, char *argv[]) { if (argc != 2) err_quit("Usage: %s <IPaddr>", basename(argv[0])); int udpfd, sport, dport; struct sockaddr_in to, from; pid_t pid; const int on = 1; if ((udpfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) err_sys("socket UDP error"); if (setsockopt(udpfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) < 0) err_sys("setsockopt broadcast error"); sport = (getpid() & 0xffff) | 0x8000; dport = (time(0) & 0xffff) | 0x8000; #ifdef _DEBUG printf("sport = %d, dport = %d\n", sport, dport); #endif if ((pid = fork()) < 0) { err_sys("fork error"); } else if (pid == 0) { /* child process */ if (signal(SIGALRM, sig_alrm) == SIG_ERR) err_sys("signal error"); alarm(WAITTIME); make_icmp_recv(sport, dport); alarm(0); exit(0); } /* * parent continue... */ sleep(1); /* parent must wait for child ready */ /* Bind source UDP port */ bzero(&from, sizeof(struct sockaddr_in)); from.sin_family = AF_INET; from.sin_addr.s_addr = htonl(0); from.sin_port = htons(sport); if (bind(udpfd, (struct sockaddr *)&from, sizeof(from)) < 0) err_sys("bind source UDP port error"); /* Send the UDP packet */ bzero(&to, sizeof(struct sockaddr_in)); to.sin_family = AF_INET; if (inet_pton(AF_INET, argv[1], &to.sin_addr) != 1) err_quit("inet_pton error"); to.sin_port = htons(dport); if (sendto(udpfd, "a", 1, 0, (struct sockaddr *)&to, sizeof(to)) != 1) err_sys("send UDP packet error"); wait(NULL); return 0; } /* Child process continue, never returns */ static void make_icmp_recv(int sport, int dport) { char buf[MAXLINE], Src[32], Dst[32]; int sockfd, n, len, iplen, size; u_char *ptr; struct sockaddr_in sockaddr; struct icmp *icmp; struct ip *ip; struct udphdr *udp; if ((sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0) err_sys("socket RAW error"); setuid(getuid()); /* don't need special permissions any more */ size = 60 * 1024; /* OK if setsockopt fails */ setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); for (;;) { len = sizeof(sockaddr); n = icmp_recv(sockfd, (u_char *) buf, sizeof(buf), (struct sockaddr *)&sockaddr, (socklen_t *) & len, &ptr); if (n < 8) /* not enough ICMP data */ continue; icmp = (struct icmp *)ptr; if (icmp->icmp_type == 3 && icmp->icmp_code == 3) { /* ICMP port * unreachable */ ip = (struct ip *)(ptr + 8); /* Check if not enough IP or UDP data */ if ((iplen = ip->ip_hl * 4) < 20 || ip->ip_p != IPPROTO_UDP) continue; if (n - 8 - iplen < 8) continue; udp = (struct udphdr *)(ptr + 8 + iplen); if (udp->uh_sport == htons(sport) && udp->uh_dport == htons(dport)) { /* Never use inet_ntoa() */ printf("Caught ICMP Port Unreachable error\nFrom %s:%d to %s:%d\n", inet_ntop(AF_INET, &ip->ip_src, Src, sizeof(Src)), sport, inet_ntop(AF_INET, &ip->ip_dst, Dst, sizeof(Dst)), dport); } } } return; }
25.424
110
0.610761
0d1547a779dd43e27350f926d0388962f721adaa
4,342
h
C
components/autofill/core/common/password_generation_util.h
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
components/autofill/core/common/password_generation_util.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
components/autofill/core/common/password_generation_util.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_GENERATION_UTIL_H_ #define COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_GENERATION_UTIL_H_ namespace autofill { namespace password_generation { // Enumerates various events related to the password generation process. // Do not remove items from this enum as they are used for UMA stats logging. enum PasswordGenerationEvent { // No Account creation form is detected. NO_SIGN_UP_DETECTED, // Account creation form is detected. SIGN_UP_DETECTED, // DEPRECATED: Password generation icon shown (old UI). DEPRECATED_ICON_SHOWN, // DEPRECATED: Password generation bubble shown (old UI). DEPRECATED_BUBBLE_SHOWN, // Password generation could be triggered if the user selects the appropriate // element. GENERATION_AVAILABLE, // Password generation popup is shown after user focuses the appropriate // password field. // DEPRECATED: These reports were triggered when the popup could have shown // not when it did show so they paint an unreliable picture. Newer stats // are only incremented per page, which is more useful to judge the // effectiveness of the UI. DEPRECATED_GENERATION_POPUP_SHOWN, // Generated password was accepted by the user. PASSWORD_ACCEPTED, // User focused the password field containing the generated password. // DEPRECATED: These reports were triggered when the popup could have shown // not when it did show so they paint an unreliable picture. Newer stats // are only incremented per page, which is more useful to judge the // effectiveness of the UI. DEPRECATED_EDITING_POPUP_SHOWN, // Password was changed after generation. PASSWORD_EDITED, // Generated password was deleted by the user PASSWORD_DELETED, // Password generation popup is shown after user focuses the appropriate // password field. GENERATION_POPUP_SHOWN, // User focused the password field containing the generated password. EDITING_POPUP_SHOWN, // Generation enabled because autocomplete attributes for username and // new-password are set. AUTOCOMPLETE_ATTRIBUTES_ENABLED_GENERATION, // Generation is triggered by the user from the context menu. PASSWORD_GENERATION_CONTEXT_MENU_PRESSED, // Context menu with generation item was shown. PASSWORD_GENERATION_CONTEXT_MENU_SHOWN, // Number of enum entries, used for UMA histogram reporting macros. EVENT_ENUM_COUNT }; // Wrapper to store the user interactions with the password generation bubble. struct PasswordGenerationActions { // Whether the user has clicked on the learn more link. bool learn_more_visited; // Whether the user has accepted the generated password. bool password_accepted; // Whether the user has manually edited password entry. bool password_edited; // Whether the user has clicked on the regenerate button. bool password_regenerated; PasswordGenerationActions(); ~PasswordGenerationActions(); }; void LogUserActions(PasswordGenerationActions actions); void LogPasswordGenerationEvent(PasswordGenerationEvent event); // Enumerates user actions after password generation bubble is shown. // These are visible for testing purposes. enum UserAction { // User closes the bubble without any meaningful actions (e.g. use backspace // key, close the bubble, click outside the bubble, etc). IGNORE_FEATURE, // User navigates to the learn more page. Note that in the current // implementation this will result in closing the bubble so this action // doesn't overlap with the following two actions. LEARN_MORE, // User accepts the generated password without manually editing it (but // including changing it through the regenerate button). ACCEPT_ORIGINAL_PASSWORD, // User accepts the gererated password after manually editing it. ACCEPT_AFTER_EDITING, // Number of enum entries, used for UMA histogram reporting macros. ACTION_ENUM_COUNT }; // Returns true if Password Generation is enabled according to the field // trial result and the flags. bool IsPasswordGenerationEnabled(); } // namespace password_generation } // namespace autofill #endif // COMPONENTS_AUTOFILL_CORE_COMMON_PASSWORD_GENERATION_UTIL_H_
33.921875
79
0.781207
9896ef1a66b1bfb9bf9ee0a483b504500ddb2bb1
362
h
C
GoogleDrive/GoogleDrive/GoogleDrive-BridgingHeader.h
AnkitiOSiDev/Google-Drive-File-browser
b08bb737d48433aa4bed8fe1778a302c660ed0b3
[ "MIT" ]
1
2021-03-18T13:02:55.000Z
2021-03-18T13:02:55.000Z
GoogleDrive/GoogleDrive/GoogleDrive-BridgingHeader.h
AnkitiOSiDev/Google-Drive-File-browser
b08bb737d48433aa4bed8fe1778a302c660ed0b3
[ "MIT" ]
null
null
null
GoogleDrive/GoogleDrive/GoogleDrive-BridgingHeader.h
AnkitiOSiDev/Google-Drive-File-browser
b08bb737d48433aa4bed8fe1778a302c660ed0b3
[ "MIT" ]
null
null
null
// // GoogleDrive-BridgingHeader.h // GoogleDrive // // Created by Ankit on 20/04/19. // Copyright © 2019 Ankit. All rights reserved. // #ifndef GoogleDrive_BridgingHeader_h #define GoogleDrive_BridgingHeader_h #import <GTMSessionFetcher/GTMSessionFetcher.h> #import <GTMSessionFetcher/GTMSessionFetcherService.h> #endif /* GoogleDrive_BridgingHeader_h */
24.133333
54
0.78453
817026ea94218ee8b13e4a6764e7d4b8324e9203
23,991
h
C
sxe13.1.pb-c.h
inexinferis/sXeMu
70705553033228c98de2608ca2be6231065f83cf
[ "MIT" ]
1
2021-06-04T02:34:55.000Z
2021-06-04T02:34:55.000Z
sxe13.1.pb-c.h
inexinferis/sXeMu
70705553033228c98de2608ca2be6231065f83cf
[ "MIT" ]
null
null
null
sxe13.1.pb-c.h
inexinferis/sXeMu
70705553033228c98de2608ca2be6231065f83cf
[ "MIT" ]
6
2019-04-03T14:01:36.000Z
2020-04-19T01:54:34.000Z
#ifndef PROTOBUF_C_sxe13_2e1_2eproto__INCLUDED #define PROTOBUF_C_sxe13_2e1_2eproto__INCLUDED #include "protobuf-c/protobuf-c.h" PROTOBUF_C_BEGIN_DECLS typedef struct _SXEUnknown1 SXEUnknown1; typedef struct _SXEUnknown2 SXEUnknown2; typedef struct _SXEUnknown3 SXEUnknown3; typedef struct _SXEUnknown4 SXEUnknown4; typedef struct _SXEUnknown5 SXEUnknown5; typedef struct _SXEUnknown6 SXEUnknown6; typedef struct _SXEUnknown7 SXEUnknown7; typedef struct _SXEUnknown8 SXEUnknown8; typedef struct _SXEUnknown9 SXEUnknown9; typedef struct _SXEUnknown10 SXEUnknown10; typedef struct _SXEUnknown11 SXEUnknown11; typedef struct _SXEUnknown12 SXEUnknown12; typedef struct _SXEUnknown13 SXEUnknown13; typedef struct _SXEUnknown14 SXEUnknown14; typedef struct _SXEUnknown15 SXEUnknown15; typedef struct _SXEProtocol SXEProtocol; /* --- enums --- */ /* --- messages --- */ struct _SXEUnknown1 { ProtobufCMessage base; int32_t p01unknown1; protobuf_c_boolean has_p02unknown2; int32_t p02unknown2; protobuf_c_boolean has_p03unknown3; int32_t p03unknown3; protobuf_c_boolean has_p04unknown4; int32_t p04unknown4; protobuf_c_boolean has_p05unknown5; int32_t p05unknown5; protobuf_c_boolean has_p06unknown6; int32_t p06unknown6; protobuf_c_boolean has_p07unknown7; int32_t p07unknown7; protobuf_c_boolean has_p08unknown8; int32_t p08unknown8; protobuf_c_boolean has_p09unknown9; int32_t p09unknown9; int32_t p11unknown10; int32_t p10unknown11; }; #define SXE___UNKNOWN1__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown1__descriptor) \ , 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0, 0 } struct _SXEUnknown2 { ProtobufCMessage base; int32_t p01unknown1; int32_t p05unknown2; protobuf_c_boolean has_p06unknown3; int32_t p06unknown3; int32_t p11unknown4; protobuf_c_boolean has_p07unknown5; int32_t p07unknown5; int32_t p04unknown6; protobuf_c_boolean has_p08unknown7; int32_t p08unknown7; int32_t p02unknown8; protobuf_c_boolean has_p09unknown9; int32_t p09unknown9; ProtobufCBinaryData p10unknown10; int32_t p03unknown11; }; #define SXE___UNKNOWN2__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown2__descriptor) \ , 0, 0, 0,0, 0, 0,0, 0, 0,0, 0, 0,0, {0,NULL}, 0 } struct _SXEUnknown3 { ProtobufCMessage base; protobuf_c_boolean has_p05unknown1; int32_t p05unknown1; int32_t p03unknown2; protobuf_c_boolean has_p06unknown3; int32_t p06unknown3; protobuf_c_boolean has_p07unknown4; int32_t p07unknown4; int32_t p02unknown5; protobuf_c_boolean has_p08unknown6; int32_t p08unknown6; protobuf_c_boolean has_p04unknown7; int32_t p04unknown7; int32_t p13unknown8; protobuf_c_boolean has_p09unknown9; int32_t p09unknown9; protobuf_c_boolean has_p10unknown10; int32_t p10unknown10; int32_t p01unknown11; protobuf_c_boolean has_p11unknown12; int32_t p11unknown12; protobuf_c_boolean has_p12unknown13; int32_t p12unknown13; }; #define SXE___UNKNOWN3__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown3__descriptor) \ , 0,0, 0, 0,0, 0,0, 0, 0,0, 0,0, 0, 0,0, 0,0, 0, 0,0, 0,0 } struct _SXEUnknown4 { ProtobufCMessage base; int32_t p05unknown1; protobuf_c_boolean has_p08unknown2; int32_t p08unknown2; protobuf_c_boolean has_p07unknown3; int32_t p07unknown3; protobuf_c_boolean has_p09unknown4; int32_t p09unknown4; int32_t p04unknown5; protobuf_c_boolean has_p10unknown6; int32_t p10unknown6; protobuf_c_boolean has_p13unknown7; ProtobufCBinaryData p13unknown7; protobuf_c_boolean has_p11unknown8; int32_t p11unknown8; int32_t p03unknown9; protobuf_c_boolean has_p12unknown10; int32_t p12unknown10; int32_t p01unknown11; protobuf_c_boolean has_p02unknown12; int32_t p02unknown12; protobuf_c_boolean has_p06unknown13; ProtobufCBinaryData p06unknown13; }; #define SXE___UNKNOWN4__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown4__descriptor) \ , 0, 0,0, 0,0, 0,0, 0, 0,0, 0,{0,NULL}, 0,0, 0, 0,0, 0, 0,0, 0,{0,NULL} } struct _SXEUnknown5 { ProtobufCMessage base; int32_t p01unknown1; protobuf_c_boolean has_p02unknown2; int32_t p02unknown2; protobuf_c_boolean has_p03unknown3; int32_t p03unknown3; protobuf_c_boolean has_p04unknown4; int32_t p04unknown4; protobuf_c_boolean has_p05unknown5; int32_t p05unknown5; protobuf_c_boolean has_p06unknown6; int32_t p06unknown6; protobuf_c_boolean has_p07unknown7; int32_t p07unknown7; protobuf_c_boolean has_p08unknown8; int32_t p08unknown8; protobuf_c_boolean has_p09unknown9; int32_t p09unknown9; }; #define SXE___UNKNOWN5__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown5__descriptor) \ , 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 } struct _SXEUnknown6 { ProtobufCMessage base; protobuf_c_boolean has_p02unknown1; int32_t p02unknown1; int32_t p04unknown2; protobuf_c_boolean has_p03unknown3; int32_t p03unknown3; ProtobufCBinaryData p01unknown4; }; #define SXE___UNKNOWN6__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown6__descriptor) \ , 0,0, 0, 0,0, {0,NULL} } struct _SXEUnknown7 { ProtobufCMessage base; protobuf_c_boolean has_p02unknown1; int32_t p02unknown1; ProtobufCBinaryData p01unknown2; }; #define SXE___UNKNOWN7__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown7__descriptor) \ , 0,0, {0,NULL} } struct _SXEUnknown8 { ProtobufCMessage base; protobuf_c_boolean has_p02unknown1; int32_t p02unknown1; int32_t p03unknown2; ProtobufCBinaryData p01unknown3; }; #define SXE___UNKNOWN8__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown8__descriptor) \ , 0,0, 0, {0,NULL} } struct _SXEUnknown9 { ProtobufCMessage base; protobuf_c_boolean has_p02unknown1; int32_t p02unknown1; ProtobufCBinaryData p01unknown2; }; #define SXE___UNKNOWN9__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown9__descriptor) \ , 0,0, {0,NULL} } struct _SXEUnknown10 { ProtobufCMessage base; ProtobufCBinaryData p01unknown1; }; #define SXE___UNKNOWN10__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown10__descriptor) \ , {0,NULL} } struct _SXEUnknown11 { ProtobufCMessage base; int32_t p01unknown1; }; #define SXE___UNKNOWN11__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown11__descriptor) \ , 0 } struct _SXEUnknown12 { ProtobufCMessage base; int32_t p02unknown1; int32_t p03unknown2; int32_t p01unknown3; }; #define SXE___UNKNOWN12__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown12__descriptor) \ , 0, 0, 0 } struct _SXEUnknown13 { ProtobufCMessage base; ProtobufCBinaryData p03unknown1; int32_t p04unknown2; int32_t p02unknown3; int32_t p01unknown4; int32_t p05unknown5; }; #define SXE___UNKNOWN13__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown13__descriptor) \ , {0,NULL}, 0, 0, 0, 0 } struct _SXEUnknown14 { ProtobufCMessage base; int32_t p03unknown1; int32_t p02unknown2; ProtobufCBinaryData p01unknown3; }; #define SXE___UNKNOWN14__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown14__descriptor) \ , 0, 0, {0,NULL} } struct _SXEUnknown15 { ProtobufCMessage base; ProtobufCBinaryData p01unknown1; }; #define SXE___UNKNOWN15__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___unknown15__descriptor) \ , {0,NULL} } struct _SXEProtocol { ProtobufCMessage base; SXEUnknown1 *p08unknown1; SXEUnknown2 *p07unknown2; SXEUnknown3 *p06unknown3; SXEUnknown4 *p05unknown4; SXEUnknown5 *p09unknown5; SXEUnknown6 *p04unknown6; SXEUnknown7 *p03unknown7; SXEUnknown8 *p02unknown8; SXEUnknown9 *p01unknown9; SXEUnknown10 *p10unknown10; SXEUnknown11 *p11unknown11; SXEUnknown12 *p12unknown12; SXEUnknown13 *p14unknown13; SXEUnknown14 *p15unknown14; SXEUnknown15 *p13unknown15; }; #define SXE___PROTOCOL__INIT \ { PROTOBUF_C_MESSAGE_INIT (&sxe___protocol__descriptor) \ , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } /* SXEUnknown1 methods */ void sxe___unknown1__init (SXEUnknown1 *message); size_t sxe___unknown1__get_packed_size (const SXEUnknown1 *message); size_t sxe___unknown1__pack (const SXEUnknown1 *message, uint8_t *out); size_t sxe___unknown1__pack_to_buffer (const SXEUnknown1 *message, ProtobufCBuffer *buffer); SXEUnknown1 * sxe___unknown1__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown1__free_unpacked (SXEUnknown1 *message, ProtobufCAllocator *allocator); /* SXEUnknown2 methods */ void sxe___unknown2__init (SXEUnknown2 *message); size_t sxe___unknown2__get_packed_size (const SXEUnknown2 *message); size_t sxe___unknown2__pack (const SXEUnknown2 *message, uint8_t *out); size_t sxe___unknown2__pack_to_buffer (const SXEUnknown2 *message, ProtobufCBuffer *buffer); SXEUnknown2 * sxe___unknown2__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown2__free_unpacked (SXEUnknown2 *message, ProtobufCAllocator *allocator); /* SXEUnknown3 methods */ void sxe___unknown3__init (SXEUnknown3 *message); size_t sxe___unknown3__get_packed_size (const SXEUnknown3 *message); size_t sxe___unknown3__pack (const SXEUnknown3 *message, uint8_t *out); size_t sxe___unknown3__pack_to_buffer (const SXEUnknown3 *message, ProtobufCBuffer *buffer); SXEUnknown3 * sxe___unknown3__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown3__free_unpacked (SXEUnknown3 *message, ProtobufCAllocator *allocator); /* SXEUnknown4 methods */ void sxe___unknown4__init (SXEUnknown4 *message); size_t sxe___unknown4__get_packed_size (const SXEUnknown4 *message); size_t sxe___unknown4__pack (const SXEUnknown4 *message, uint8_t *out); size_t sxe___unknown4__pack_to_buffer (const SXEUnknown4 *message, ProtobufCBuffer *buffer); SXEUnknown4 * sxe___unknown4__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown4__free_unpacked (SXEUnknown4 *message, ProtobufCAllocator *allocator); /* SXEUnknown5 methods */ void sxe___unknown5__init (SXEUnknown5 *message); size_t sxe___unknown5__get_packed_size (const SXEUnknown5 *message); size_t sxe___unknown5__pack (const SXEUnknown5 *message, uint8_t *out); size_t sxe___unknown5__pack_to_buffer (const SXEUnknown5 *message, ProtobufCBuffer *buffer); SXEUnknown5 * sxe___unknown5__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown5__free_unpacked (SXEUnknown5 *message, ProtobufCAllocator *allocator); /* SXEUnknown6 methods */ void sxe___unknown6__init (SXEUnknown6 *message); size_t sxe___unknown6__get_packed_size (const SXEUnknown6 *message); size_t sxe___unknown6__pack (const SXEUnknown6 *message, uint8_t *out); size_t sxe___unknown6__pack_to_buffer (const SXEUnknown6 *message, ProtobufCBuffer *buffer); SXEUnknown6 * sxe___unknown6__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown6__free_unpacked (SXEUnknown6 *message, ProtobufCAllocator *allocator); /* SXEUnknown7 methods */ void sxe___unknown7__init (SXEUnknown7 *message); size_t sxe___unknown7__get_packed_size (const SXEUnknown7 *message); size_t sxe___unknown7__pack (const SXEUnknown7 *message, uint8_t *out); size_t sxe___unknown7__pack_to_buffer (const SXEUnknown7 *message, ProtobufCBuffer *buffer); SXEUnknown7 * sxe___unknown7__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown7__free_unpacked (SXEUnknown7 *message, ProtobufCAllocator *allocator); /* SXEUnknown8 methods */ void sxe___unknown8__init (SXEUnknown8 *message); size_t sxe___unknown8__get_packed_size (const SXEUnknown8 *message); size_t sxe___unknown8__pack (const SXEUnknown8 *message, uint8_t *out); size_t sxe___unknown8__pack_to_buffer (const SXEUnknown8 *message, ProtobufCBuffer *buffer); SXEUnknown8 * sxe___unknown8__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown8__free_unpacked (SXEUnknown8 *message, ProtobufCAllocator *allocator); /* SXEUnknown9 methods */ void sxe___unknown9__init (SXEUnknown9 *message); size_t sxe___unknown9__get_packed_size (const SXEUnknown9 *message); size_t sxe___unknown9__pack (const SXEUnknown9 *message, uint8_t *out); size_t sxe___unknown9__pack_to_buffer (const SXEUnknown9 *message, ProtobufCBuffer *buffer); SXEUnknown9 * sxe___unknown9__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown9__free_unpacked (SXEUnknown9 *message, ProtobufCAllocator *allocator); /* SXEUnknown10 methods */ void sxe___unknown10__init (SXEUnknown10 *message); size_t sxe___unknown10__get_packed_size (const SXEUnknown10 *message); size_t sxe___unknown10__pack (const SXEUnknown10 *message, uint8_t *out); size_t sxe___unknown10__pack_to_buffer (const SXEUnknown10 *message, ProtobufCBuffer *buffer); SXEUnknown10 * sxe___unknown10__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown10__free_unpacked (SXEUnknown10 *message, ProtobufCAllocator *allocator); /* SXEUnknown11 methods */ void sxe___unknown11__init (SXEUnknown11 *message); size_t sxe___unknown11__get_packed_size (const SXEUnknown11 *message); size_t sxe___unknown11__pack (const SXEUnknown11 *message, uint8_t *out); size_t sxe___unknown11__pack_to_buffer (const SXEUnknown11 *message, ProtobufCBuffer *buffer); SXEUnknown11 * sxe___unknown11__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown11__free_unpacked (SXEUnknown11 *message, ProtobufCAllocator *allocator); /* SXEUnknown12 methods */ void sxe___unknown12__init (SXEUnknown12 *message); size_t sxe___unknown12__get_packed_size (const SXEUnknown12 *message); size_t sxe___unknown12__pack (const SXEUnknown12 *message, uint8_t *out); size_t sxe___unknown12__pack_to_buffer (const SXEUnknown12 *message, ProtobufCBuffer *buffer); SXEUnknown12 * sxe___unknown12__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown12__free_unpacked (SXEUnknown12 *message, ProtobufCAllocator *allocator); /* SXEUnknown13 methods */ void sxe___unknown13__init (SXEUnknown13 *message); size_t sxe___unknown13__get_packed_size (const SXEUnknown13 *message); size_t sxe___unknown13__pack (const SXEUnknown13 *message, uint8_t *out); size_t sxe___unknown13__pack_to_buffer (const SXEUnknown13 *message, ProtobufCBuffer *buffer); SXEUnknown13 * sxe___unknown13__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown13__free_unpacked (SXEUnknown13 *message, ProtobufCAllocator *allocator); /* SXEUnknown14 methods */ void sxe___unknown14__init (SXEUnknown14 *message); size_t sxe___unknown14__get_packed_size (const SXEUnknown14 *message); size_t sxe___unknown14__pack (const SXEUnknown14 *message, uint8_t *out); size_t sxe___unknown14__pack_to_buffer (const SXEUnknown14 *message, ProtobufCBuffer *buffer); SXEUnknown14 * sxe___unknown14__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown14__free_unpacked (SXEUnknown14 *message, ProtobufCAllocator *allocator); /* SXEUnknown15 methods */ void sxe___unknown15__init (SXEUnknown15 *message); size_t sxe___unknown15__get_packed_size (const SXEUnknown15 *message); size_t sxe___unknown15__pack (const SXEUnknown15 *message, uint8_t *out); size_t sxe___unknown15__pack_to_buffer (const SXEUnknown15 *message, ProtobufCBuffer *buffer); SXEUnknown15 * sxe___unknown15__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___unknown15__free_unpacked (SXEUnknown15 *message, ProtobufCAllocator *allocator); /* SXEProtocol methods */ void sxe___protocol__init (SXEProtocol *message); size_t sxe___protocol__get_packed_size (const SXEProtocol *message); size_t sxe___protocol__pack (const SXEProtocol *message, uint8_t *out); size_t sxe___protocol__pack_to_buffer (const SXEProtocol *message, ProtobufCBuffer *buffer); SXEProtocol * sxe___protocol__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data); void sxe___protocol__free_unpacked (SXEProtocol *message, ProtobufCAllocator *allocator); /* --- per-message closures --- */ typedef void (*SXEUnknown1_Closure) (const SXEUnknown1 *message, void *closure_data); typedef void (*SXEUnknown2_Closure) (const SXEUnknown2 *message, void *closure_data); typedef void (*SXEUnknown3_Closure) (const SXEUnknown3 *message, void *closure_data); typedef void (*SXEUnknown4_Closure) (const SXEUnknown4 *message, void *closure_data); typedef void (*SXEUnknown5_Closure) (const SXEUnknown5 *message, void *closure_data); typedef void (*SXEUnknown6_Closure) (const SXEUnknown6 *message, void *closure_data); typedef void (*SXEUnknown7_Closure) (const SXEUnknown7 *message, void *closure_data); typedef void (*SXEUnknown8_Closure) (const SXEUnknown8 *message, void *closure_data); typedef void (*SXEUnknown9_Closure) (const SXEUnknown9 *message, void *closure_data); typedef void (*SXEUnknown10_Closure) (const SXEUnknown10 *message, void *closure_data); typedef void (*SXEUnknown11_Closure) (const SXEUnknown11 *message, void *closure_data); typedef void (*SXEUnknown12_Closure) (const SXEUnknown12 *message, void *closure_data); typedef void (*SXEUnknown13_Closure) (const SXEUnknown13 *message, void *closure_data); typedef void (*SXEUnknown14_Closure) (const SXEUnknown14 *message, void *closure_data); typedef void (*SXEUnknown15_Closure) (const SXEUnknown15 *message, void *closure_data); typedef void (*SXEProtocol_Closure) (const SXEProtocol *message, void *closure_data); /* --- services --- */ /* --- descriptors --- */ extern const ProtobufCMessageDescriptor sxe___unknown1__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown2__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown3__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown4__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown5__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown6__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown7__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown8__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown9__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown10__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown11__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown12__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown13__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown14__descriptor; extern const ProtobufCMessageDescriptor sxe___unknown15__descriptor; extern const ProtobufCMessageDescriptor sxe___protocol__descriptor; PROTOBUF_C_END_DECLS #endif /* PROTOBUF_sxe13_2e1_2eproto__INCLUDED */
34.420373
96
0.635113
60bbfbd369e3eb0070b7e6fd595df42ca00ae131
1,276
c
C
sources/linux/mutex.c
stxent/osw
99dfe665230bb36ccbefee88c2cf7805500ffcbf
[ "MIT" ]
null
null
null
sources/linux/mutex.c
stxent/osw
99dfe665230bb36ccbefee88c2cf7805500ffcbf
[ "MIT" ]
null
null
null
sources/linux/mutex.c
stxent/osw
99dfe665230bb36ccbefee88c2cf7805500ffcbf
[ "MIT" ]
null
null
null
/* * mutex.c * Copyright (C) 2012 xent * Project is distributed under the terms of the MIT License */ #include <osw/mutex.h> #include <time.h> /*----------------------------------------------------------------------------*/ enum Result mutexInit(struct Mutex *) __attribute__((weak)); /*----------------------------------------------------------------------------*/ enum Result mutexInit(struct Mutex *mutex) { return pthread_mutex_init(&mutex->handle, 0) == 0 ? E_OK : E_ERROR; } /*----------------------------------------------------------------------------*/ void mutexDeinit(struct Mutex *mutex) { pthread_mutex_destroy(&mutex->handle); } /*----------------------------------------------------------------------------*/ bool mutexTryLock(struct Mutex *mutex, unsigned int interval) { int res; if (interval) { struct timespec timestamp; clock_gettime(CLOCK_REALTIME, &timestamp); timestamp.tv_sec += interval / 1000; timestamp.tv_nsec += (interval % 1000) * 1000000; if (timestamp.tv_nsec >= 1000000000) { timestamp.tv_nsec -= 1000000000; ++timestamp.tv_sec; } res = pthread_mutex_timedlock(&mutex->handle, &timestamp); } else { res = pthread_mutex_trylock(&mutex->handle); } return res == 0; }
26.040816
80
0.505486
b845b90111d55c7bd88fc0533d115399c6e72f7e
3,092
h
C
src/Anim/Anim.h
floooh/oryol-animation
c9350be596ae2ccdb67756cc08accd79b37c10d6
[ "MIT" ]
15
2016-11-23T10:18:29.000Z
2021-11-24T16:49:08.000Z
src/Anim/Anim.h
floooh/oryol-animation
c9350be596ae2ccdb67756cc08accd79b37c10d6
[ "MIT" ]
3
2017-06-25T09:51:48.000Z
2017-06-26T17:41:00.000Z
src/Anim/Anim.h
floooh/oryol-animation
c9350be596ae2ccdb67756cc08accd79b37c10d6
[ "MIT" ]
3
2017-01-25T06:04:59.000Z
2022-02-04T19:39:36.000Z
#pragma once //------------------------------------------------------------------------------ /** @class Oryol::Anim @ingroup Anim @brief animation system facade */ #include "Anim/AnimTypes.h" #include "Anim/private/animInstance.h" #include "Resource/ResourceLabel.h" #include "Resource/Locator.h" #include "Core/Time/Duration.h" namespace Oryol { class Anim { public: /// setup the animation module static void Setup(const AnimSetup& setup = AnimSetup()); /// discard the animation module static void Discard(); /// check if animation module is setup static bool IsValid(); /// get the original AnimSetup object static const struct AnimSetup& AnimSetup(); /// get the animation systems current absolute time static double CurrentTime(); /// generate new resource label and push on label stack static ResourceLabel PushLabel(); /// push explicit resource label on label stack static void PushLabel(ResourceLabel label); /// pop resource label from label stack static ResourceLabel PopLabel(); /// create an anim resource object template<class SETUP> static Id Create(const SETUP& setup); /// lookup an resource id by name static Id Lookup(const Locator& name); /// destroy one or several anim resources by label static void Destroy(ResourceLabel label); /// return true if a valid anim library exists for id static bool HasLibrary(const Id& libId); /// access an animation library static const AnimLibrary& Library(const Id& libId); /// lookup a clip index by name static int ClipIndex(const Id& libId, const StringAtom& clipName); /// write anim library keys static void WriteKeys(const Id& libId, const uint8_t* ptr, int numBytes); /// return true if a valid anim skeleton exists for id static bool HasSkeleton(const Id& skelId); /// access a skeleton static const AnimSkeleton& Skeleton(const Id& skelId); /// begin new frame, clears all active instances static void NewFrame(); /// add an active instance for the current frame static bool AddActiveInstance(const Id& instId); /// evaluate all active animation instances static void Evaluate(double frameDurationInSeconds); /// access to current samples of an active anim instance (valid after Anim::Evaluate()) static const Slice<float>& Samples(const Id& instId); /// access to evaluated skeleton skinning matrix info static const AnimSkinMatrixInfo& SkinMatrixInfo(); /// enqueue an animation job, return job id static AnimJobId Play(const Id& instId, const AnimJob& job); /// stop a specific animation job static void Stop(const Id& instId, AnimJobId jobId, bool allowFadeOut=true); /// stop all jobs on a mixing track static void StopTrack(const Id& instId, int trackIndex, bool allowFadeOut=true); /// stop all jobs static void StopAll(const Id& instId, bool allowFadeOut=true); /// access to anim instance static const _priv::animInstance& instance(const Id& instId); }; } // namespace Oryol
37.253012
91
0.689198
b854c3e07b1e8e3c471a1baac220a26a5a48ed74
1,009
c
C
net/rras/ras/autodial/rasadhlp/init.c
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
net/rras/ras/autodial/rasadhlp/init.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
net/rras/ras/autodial/rasadhlp/init.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*++ Copyright (c) 1996 Microsoft Corporation MODULE NAME init.c ABSTRACT Initialization for the Autodial helper DLL. AUTHOR Anthony Discolo (adiscolo) 22-Apr-1996 REVISION HISTORY --*/ #define UNICODE #define _UNICODE #include <nt.h> #include <ntrtl.h> #include <nturtl.h> #include <stdlib.h> #include <windows.h> #include <stdio.h> #define DEBUGGLOBALS #include <debug.h> BOOL WINAPI InitAcsHelperDLL( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) /*++ DESCRIPTION Initialize the DLL. All we do right now is to initialize the debug tracing library. ARGUMENTS hinstDLL: fdwReason: lpvReserved: RETURN VALUE Always TRUE. --*/ { switch (fdwReason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); break; case DLL_PROCESS_DETACH: break; default: break; } return TRUE; }
14.013889
62
0.611497
11740a262385df8972efb407793758aabba78657
21,168
h
C
src/tuning_GS1_grt_rtw/tuning_GS1.h
MRASL/gsft_control
49b4be84a93756f6576c404719721a2ccd1f5670
[ "BSD-3-Clause" ]
1
2021-04-28T01:46:37.000Z
2021-04-28T01:46:37.000Z
src/tuning_GS1_grt_rtw/tuning_GS1.h
MRASL/gsft_control
49b4be84a93756f6576c404719721a2ccd1f5670
[ "BSD-3-Clause" ]
null
null
null
src/tuning_GS1_grt_rtw/tuning_GS1.h
MRASL/gsft_control
49b4be84a93756f6576c404719721a2ccd1f5670
[ "BSD-3-Clause" ]
1
2021-09-12T20:33:59.000Z
2021-09-12T20:33:59.000Z
/* * tuning_GS1.h * * Student License - for use by students to meet course requirements and * perform academic research at degree granting institutions only. Not * for government, commercial, or other organizational use. * * Code generation for model "tuning_GS1". * * Model version : 1.2475 * Simulink Coder version : 8.12 (R2017a) 16-Feb-2017 * C++ source code generated on : Mon Aug 12 09:51:25 2019 * * Target selection: grt.tlc * Note: GRT includes extra infrastructure and instrumentation for prototyping * Embedded hardware selection: 32-bit Generic * Code generation objective: Execution efficiency * Validation result: Passed (1), Warnings (3), Error (0) */ #ifndef RTW_HEADER_tuning_GS1_h_ #define RTW_HEADER_tuning_GS1_h_ #include <cmath> #include <string.h> #ifndef tuning_GS1_COMMON_INCLUDES_ # define tuning_GS1_COMMON_INCLUDES_ #include "rtwtypes.h" #include "rtw_continuous.h" #include "rtw_solver.h" #endif /* tuning_GS1_COMMON_INCLUDES_ */ #include "tuning_GS1_types.h" /* Shared type includes */ #include "multiword_types.h" /* Macros for accessing real-time model data structure */ #ifndef rtmGetBlkStateChangeFlag # define rtmGetBlkStateChangeFlag(rtm) ((rtm)->blkStateChange) #endif #ifndef rtmSetBlkStateChangeFlag # define rtmSetBlkStateChangeFlag(rtm, val) ((rtm)->blkStateChange = (val)) #endif #ifndef rtmGetContStateDisabled # define rtmGetContStateDisabled(rtm) ((rtm)->contStateDisabled) #endif #ifndef rtmSetContStateDisabled # define rtmSetContStateDisabled(rtm, val) ((rtm)->contStateDisabled = (val)) #endif #ifndef rtmGetContStates # define rtmGetContStates(rtm) ((rtm)->contStates) #endif #ifndef rtmSetContStates # define rtmSetContStates(rtm, val) ((rtm)->contStates = (val)) #endif #ifndef rtmGetDerivCacheNeedsReset # define rtmGetDerivCacheNeedsReset(rtm) ((rtm)->derivCacheNeedsReset) #endif #ifndef rtmSetDerivCacheNeedsReset # define rtmSetDerivCacheNeedsReset(rtm, val) ((rtm)->derivCacheNeedsReset = (val)) #endif #ifndef rtmGetIntgData # define rtmGetIntgData(rtm) ((rtm)->intgData) #endif #ifndef rtmSetIntgData # define rtmSetIntgData(rtm, val) ((rtm)->intgData = (val)) #endif #ifndef rtmGetOdeF # define rtmGetOdeF(rtm) ((rtm)->odeF) #endif #ifndef rtmSetOdeF # define rtmSetOdeF(rtm, val) ((rtm)->odeF = (val)) #endif #ifndef rtmGetOdeY # define rtmGetOdeY(rtm) ((rtm)->odeY) #endif #ifndef rtmSetOdeY # define rtmSetOdeY(rtm, val) ((rtm)->odeY = (val)) #endif #ifndef rtmGetPeriodicContStateIndices # define rtmGetPeriodicContStateIndices(rtm) ((rtm)->periodicContStateIndices) #endif #ifndef rtmSetPeriodicContStateIndices # define rtmSetPeriodicContStateIndices(rtm, val) ((rtm)->periodicContStateIndices = (val)) #endif #ifndef rtmGetPeriodicContStateRanges # define rtmGetPeriodicContStateRanges(rtm) ((rtm)->periodicContStateRanges) #endif #ifndef rtmSetPeriodicContStateRanges # define rtmSetPeriodicContStateRanges(rtm, val) ((rtm)->periodicContStateRanges = (val)) #endif #ifndef rtmGetZCCacheNeedsReset # define rtmGetZCCacheNeedsReset(rtm) ((rtm)->zCCacheNeedsReset) #endif #ifndef rtmSetZCCacheNeedsReset # define rtmSetZCCacheNeedsReset(rtm, val) ((rtm)->zCCacheNeedsReset = (val)) #endif #ifndef rtmGetdX # define rtmGetdX(rtm) ((rtm)->derivs) #endif #ifndef rtmSetdX # define rtmSetdX(rtm, val) ((rtm)->derivs = (val)) #endif #ifndef rtmGetErrorStatus # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) #endif #ifndef rtmSetErrorStatus # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) #endif #ifndef rtmGetStopRequested # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag) #endif #ifndef rtmSetStopRequested # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val)) #endif #ifndef rtmGetStopRequestedPtr # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag)) #endif #ifndef rtmGetT # define rtmGetT(rtm) (rtmGetTPtr((rtm))[0]) #endif /* Block signals (auto storage) */ typedef struct { real_T LOE_FDD[6]; /* '<Root>/Vector Concatenate' */ real_T Sum2; /* '<S66>/Sum2' */ real_T Sum3; /* '<S66>/Sum3' */ real_T T_outer[3]; /* '<S6>/T_outer' */ real_T Fcn1; /* '<S6>/Fcn1' */ real_T Product; /* '<S68>/Product' */ real_T Fcn; /* '<S6>/Fcn' */ real_T Product_d; /* '<S67>/Product' */ real_T u[6]; /* '<Root>/ ' */ real_T Sum3_d; /* '<S13>/Sum3' */ real_T Sum3_n; /* '<S14>/Sum3' */ real_T Sum3_h; /* '<S15>/Sum3' */ real_T Sum3_l; /* '<S16>/Sum3' */ real_T Sum1; /* '<S66>/Sum1' */ real_T Sum4; /* '<S66>/Sum4' */ real_T Product2[6]; /* '<S65>/Product2' */ real_T Product3[6]; /* '<S64>/Product3' */ } B_tuning_GS1_T; /* Block states (auto storage) for system '<Root>' */ typedef struct { real_T MemoryX_DSTATE[6]; /* '<S5>/MemoryX' */ real_T Memory_PreviousInput[6]; /* '<S3>/Memory' */ uint8_T icLoad; /* '<S5>/MemoryX' */ boolean_T MeasurementUpdate_MODE; /* '<S39>/MeasurementUpdate' */ boolean_T EnabledSubsystem_MODE; /* '<S44>/Enabled Subsystem' */ } DW_tuning_GS1_T; /* Continuous states (auto storage) */ typedef struct { real_T Integrator1_CSTATE; /* '<S16>/Integrator1' */ real_T Integrator1_CSTATE_d; /* '<S13>/Integrator1' */ real_T Integrator1_CSTATE_p; /* '<S14>/Integrator1' */ real_T Integrator1_CSTATE_n; /* '<S15>/Integrator1' */ real_T Integrator1_CSTATE_pc; /* '<S66>/Integrator1' */ real_T Integrator_CSTATE; /* '<S66>/Integrator' */ } X_tuning_GS1_T; /* State derivatives (auto storage) */ typedef struct { real_T Integrator1_CSTATE; /* '<S16>/Integrator1' */ real_T Integrator1_CSTATE_d; /* '<S13>/Integrator1' */ real_T Integrator1_CSTATE_p; /* '<S14>/Integrator1' */ real_T Integrator1_CSTATE_n; /* '<S15>/Integrator1' */ real_T Integrator1_CSTATE_pc; /* '<S66>/Integrator1' */ real_T Integrator_CSTATE; /* '<S66>/Integrator' */ } XDot_tuning_GS1_T; /* State disabled */ typedef struct { boolean_T Integrator1_CSTATE; /* '<S16>/Integrator1' */ boolean_T Integrator1_CSTATE_d; /* '<S13>/Integrator1' */ boolean_T Integrator1_CSTATE_p; /* '<S14>/Integrator1' */ boolean_T Integrator1_CSTATE_n; /* '<S15>/Integrator1' */ boolean_T Integrator1_CSTATE_pc; /* '<S66>/Integrator1' */ boolean_T Integrator_CSTATE; /* '<S66>/Integrator' */ } XDis_tuning_GS1_T; #ifndef ODE4_INTG #define ODE4_INTG /* ODE4 Integration Data */ typedef struct { real_T *y; /* output */ real_T *f[4]; /* derivatives */ } ODE4_IntgData; #endif /* Constant parameters (auto storage) */ typedef struct { /* Expression: M_bias' * Referenced by: '<S3>/Constant' */ real_T Constant_Value[3]; /* Expression: Ib * Referenced by: '<S3>/Constant1' */ real_T Constant1_Value[9]; /* Expression: pInitialization.M * Referenced by: '<S21>/KalmanGainM' */ real_T KalmanGainM_Value[18]; /* Expression: pInitialization.C * Referenced by: '<S5>/C' */ real_T C_Value[18]; /* Expression: [-1 1 -1 1 -1 1]' * Referenced by: '<S4>/Gain2' */ real_T Gain2_Gain[6]; /* Expression: [-1 0 1 1 0 -1]' * Referenced by: '<S4>/Gain' */ real_T Gain_Gain[6]; /* Expression: [1 1 1 -1 -1 -1]' * Referenced by: '<S4>/Gain1' */ real_T Gain1_Gain[6]; /* Expression: B_CA_ENU_inv(:,2:3) * Referenced by: '<Root>/Control Allocation' */ real_T ControlAllocation_Gain[12]; /* Expression: pInitialization.A * Referenced by: '<S5>/A' */ real_T A_Value[36]; /* Expression: pInitialization.L * Referenced by: '<S21>/KalmanGainL' */ real_T KalmanGainL_Value[18]; } ConstP_tuning_GS1_T; /* External inputs (root inport signals with auto storage) */ typedef struct { real_T X[12]; /* '<Root>/X' */ real_T Y0[4]; /* '<Root>/Y0' */ real_T mode; /* '<Root>/mode' */ real_T ref[4]; /* '<Root>/ref' */ real_T LOE_t[6]; /* '<Root>/LOE_t' */ real_T LOE_a[6]; /* '<Root>/LOE_a' */ real_T LOE_cal[6]; /* '<Root>/LOE_cal' */ real_T LOE_mode; /* '<Root>/LOE_mode' */ } ExtU_tuning_GS1_T; /* External outputs (root outports fed by signals with auto storage) */ typedef struct { real_T motor_command[6]; /* '<Root>/motor_command' */ real_T ref_out[4]; /* '<Root>/ref_out' */ real_T LOE_true[6]; /* '<Root>/LOE_true' */ real_T LOE13_estimated[3]; /* '<Root>/LOE13_estimated' */ real_T thrust_pre[6]; /* '<Root>/thrust_pre' */ real_T thrust_after[6]; /* '<Root>/thrust_after' */ real_T acc_Kalman[3]; /* '<Root>/acc_Kalman' */ real_T M_Kalman[3]; /* '<Root>/M_Kalman' */ real_T vel_Kalman[3]; /* '<Root>/vel_Kalman' */ real_T gain_GS[12]; /* '<Root>/gain_GS' */ } ExtY_tuning_GS1_T; /* Real-time Model Data Structure */ struct tag_RTM_tuning_GS1_T { const char_T *errorStatus; RTWSolverInfo solverInfo; X_tuning_GS1_T *contStates; int_T *periodicContStateIndices; real_T *periodicContStateRanges; real_T *derivs; boolean_T *contStateDisabled; boolean_T zCCacheNeedsReset; boolean_T derivCacheNeedsReset; boolean_T blkStateChange; real_T odeY[6]; real_T odeF[4][6]; ODE4_IntgData intgData; /* * Sizes: * The following substructure contains sizes information * for many of the model attributes such as inputs, outputs, * dwork, sample times, etc. */ struct { int_T numContStates; int_T numPeriodicContStates; int_T numSampTimes; } Sizes; /* * Timing: * The following substructure contains information regarding * the timing information for the model. */ struct { uint32_T clockTick0; uint32_T clockTickH0; time_T stepSize0; uint32_T clockTick1; uint32_T clockTickH1; struct { uint8_T TID[3]; } TaskCounters; SimTimeStep simTimeStep; boolean_T stopRequestedFlag; time_T *t; time_T tArray[3]; } Timing; }; #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif /* Constant parameters (auto storage) */ extern const ConstP_tuning_GS1_T tuning_GS1_ConstP; /* Class declaration for model tuning_GS1 */ class tuning_GS1ModelClass { /* public data and function members */ public: /* External inputs */ ExtU_tuning_GS1_T tuning_GS1_U; /* External outputs */ ExtY_tuning_GS1_T tuning_GS1_Y; /* model initialize function */ void initialize(); /* model step function */ void step(); /* model terminate function */ void terminate(); /* Constructor */ tuning_GS1ModelClass(); /* Destructor */ ~tuning_GS1ModelClass(); /* Real-Time Model get method */ RT_MODEL_tuning_GS1_T * getRTM(); /* private data and function members */ private: /* Block signals */ B_tuning_GS1_T tuning_GS1_B; /* Block states */ DW_tuning_GS1_T tuning_GS1_DW; X_tuning_GS1_T tuning_GS1_X; /* Block continuous states */ /* Real-Time Model */ RT_MODEL_tuning_GS1_T tuning_GS1_M; /* Continuous states update member function*/ void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si ); /* Derivatives member function */ void tuning_GS1_derivatives(); }; /*- * These blocks were eliminated from the model due to optimizations: * * Block '<S21>/ConstantP' : Unused code path elimination * Block '<S21>/CovarianceZ' : Unused code path elimination * Block '<S60>/Data Type Duplicate' : Unused code path elimination * Block '<S61>/Data Type Duplicate' : Unused code path elimination * Block '<S62>/Conversion' : Unused code path elimination * Block '<S62>/Data Type Duplicate' : Unused code path elimination * Block '<S63>/Conversion' : Unused code path elimination * Block '<S63>/Data Type Duplicate' : Unused code path elimination * Block '<S22>/Add1' : Unused code path elimination * Block '<S22>/Product' : Unused code path elimination * Block '<S22>/Product1' : Unused code path elimination * Block '<S23>/Data Type Duplicate' : Unused code path elimination * Block '<S24>/Data Type Duplicate' : Unused code path elimination * Block '<S25>/Data Type Duplicate' : Unused code path elimination * Block '<S26>/Data Type Duplicate' : Unused code path elimination * Block '<S27>/Conversion' : Unused code path elimination * Block '<S27>/Data Type Duplicate' : Unused code path elimination * Block '<S28>/Conversion' : Unused code path elimination * Block '<S28>/Data Type Duplicate' : Unused code path elimination * Block '<S29>/Conversion' : Unused code path elimination * Block '<S29>/Data Type Duplicate' : Unused code path elimination * Block '<S30>/Conversion' : Unused code path elimination * Block '<S30>/Data Type Duplicate' : Unused code path elimination * Block '<S31>/Conversion' : Unused code path elimination * Block '<S31>/Data Type Duplicate' : Unused code path elimination * Block '<S32>/Conversion' : Unused code path elimination * Block '<S32>/Data Type Duplicate' : Unused code path elimination * Block '<S33>/Conversion' : Unused code path elimination * Block '<S33>/Data Type Duplicate' : Unused code path elimination * Block '<S34>/Conversion' : Unused code path elimination * Block '<S34>/Data Type Duplicate' : Unused code path elimination * Block '<S35>/Data Type Duplicate' : Unused code path elimination * Block '<S36>/Data Type Duplicate' : Unused code path elimination * Block '<S37>/Data Type Duplicate' : Unused code path elimination * Block '<S5>/G' : Unused code path elimination * Block '<S5>/H' : Unused code path elimination * Block '<S5>/ManualSwitchPZ' : Unused code path elimination * Block '<S5>/N' : Unused code path elimination * Block '<S5>/P0' : Unused code path elimination * Block '<S5>/Q' : Unused code path elimination * Block '<S5>/R' : Unused code path elimination * Block '<S40>/Constant' : Unused code path elimination * Block '<S5>/Reset' : Unused code path elimination * Block '<S5>/Reshapeyhat' : Unused code path elimination * Block '<S59>/CheckSignalProperties' : Unused code path elimination * Block '<Root>/ ' : Eliminated since input and output rates are identical * Block '<Root>/ ' : Eliminated since input and output rates are identical * Block '<Root>/ ' : Eliminated since input and output rates are identical * Block '<S60>/Conversion' : Eliminate redundant data type conversion * Block '<S61>/Conversion' : Eliminate redundant data type conversion * Block '<S23>/Conversion' : Eliminate redundant data type conversion * Block '<S24>/Conversion' : Eliminate redundant data type conversion * Block '<S25>/Conversion' : Eliminate redundant data type conversion * Block '<S26>/Conversion' : Eliminate redundant data type conversion * Block '<S5>/DataTypeConversionEnable' : Eliminate redundant data type conversion * Block '<S35>/Conversion' : Eliminate redundant data type conversion * Block '<S36>/Conversion' : Eliminate redundant data type conversion * Block '<S37>/Conversion' : Eliminate redundant data type conversion * Block '<S39>/Reshape' : Reshape block reduction * Block '<S5>/ReshapeX0' : Reshape block reduction * Block '<S5>/Reshapeu' : Reshape block reduction * Block '<S5>/Reshapexhat' : Reshape block reduction * Block '<S5>/Reshapey' : Reshape block reduction * Block '<S66>/Reshape' : Reshape block reduction * Block '<S66>/Reshape1' : Reshape block reduction * Block '<S67>/Reshape' : Reshape block reduction * Block '<S68>/Reshape' : Reshape block reduction * Block '<Root>/Rate Transition' : Eliminated since input and output rates are identical */ /*- * The generated code includes comments that allow you to trace directly * back to the appropriate location in the model. The basic format * is <system>/block_name, where system is the system number (uniquely * assigned by Simulink) and block_name is the name of the block. * * Use the MATLAB hilite_system command to trace the generated code back * to the model. For example, * * hilite_system('<S3>') - opens system 3 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 * * Here is the system hierarchy for this model * * '<Root>' : 'tuning_GS1' * '<S1>' : 'tuning_GS1/Actuator_Fault' * '<S2>' : 'tuning_GS1/FDD' * '<S3>' : 'tuning_GS1/FDD_Kalman' * '<S4>' : 'tuning_GS1/GS_controller' * '<S5>' : 'tuning_GS1/Kalman Filter' * '<S6>' : 'tuning_GS1/Nominal_xy_Controller' * '<S7>' : 'tuning_GS1/Test_config_and_data' * '<S8>' : 'tuning_GS1/Thrust2command' * '<S9>' : 'tuning_GS1/FDD_Kalman/Cross Product' * '<S10>' : 'tuning_GS1/FDD_Kalman/MATLAB Function1' * '<S11>' : 'tuning_GS1/FDD_Kalman/Cross Product/Subsystem' * '<S12>' : 'tuning_GS1/FDD_Kalman/Cross Product/Subsystem2' * '<S13>' : 'tuning_GS1/GS_controller/psi_GS_controller' * '<S14>' : 'tuning_GS1/GS_controller/x_GS_controller' * '<S15>' : 'tuning_GS1/GS_controller/y_GS_controller' * '<S16>' : 'tuning_GS1/GS_controller/z_GS_controller' * '<S17>' : 'tuning_GS1/GS_controller/psi_GS_controller/MATLAB Function' * '<S18>' : 'tuning_GS1/GS_controller/x_GS_controller/MATLAB Function' * '<S19>' : 'tuning_GS1/GS_controller/y_GS_controller/MATLAB Function' * '<S20>' : 'tuning_GS1/GS_controller/z_GS_controller/MATLAB Function' * '<S21>' : 'tuning_GS1/Kalman Filter/CalculatePL' * '<S22>' : 'tuning_GS1/Kalman Filter/CalculateYhat' * '<S23>' : 'tuning_GS1/Kalman Filter/DataTypeConversionA' * '<S24>' : 'tuning_GS1/Kalman Filter/DataTypeConversionB' * '<S25>' : 'tuning_GS1/Kalman Filter/DataTypeConversionC' * '<S26>' : 'tuning_GS1/Kalman Filter/DataTypeConversionD' * '<S27>' : 'tuning_GS1/Kalman Filter/DataTypeConversionG' * '<S28>' : 'tuning_GS1/Kalman Filter/DataTypeConversionH' * '<S29>' : 'tuning_GS1/Kalman Filter/DataTypeConversionN' * '<S30>' : 'tuning_GS1/Kalman Filter/DataTypeConversionP' * '<S31>' : 'tuning_GS1/Kalman Filter/DataTypeConversionP0' * '<S32>' : 'tuning_GS1/Kalman Filter/DataTypeConversionQ' * '<S33>' : 'tuning_GS1/Kalman Filter/DataTypeConversionR' * '<S34>' : 'tuning_GS1/Kalman Filter/DataTypeConversionReset' * '<S35>' : 'tuning_GS1/Kalman Filter/DataTypeConversionX' * '<S36>' : 'tuning_GS1/Kalman Filter/DataTypeConversionX0' * '<S37>' : 'tuning_GS1/Kalman Filter/DataTypeConversionu' * '<S38>' : 'tuning_GS1/Kalman Filter/MemoryP' * '<S39>' : 'tuning_GS1/Kalman Filter/Observer' * '<S40>' : 'tuning_GS1/Kalman Filter/ReducedQRN' * '<S41>' : 'tuning_GS1/Kalman Filter/ScalarExpansionP0' * '<S42>' : 'tuning_GS1/Kalman Filter/ScalarExpansionQ' * '<S43>' : 'tuning_GS1/Kalman Filter/ScalarExpansionR' * '<S44>' : 'tuning_GS1/Kalman Filter/UseCurrentEstimator' * '<S45>' : 'tuning_GS1/Kalman Filter/checkA' * '<S46>' : 'tuning_GS1/Kalman Filter/checkB' * '<S47>' : 'tuning_GS1/Kalman Filter/checkC' * '<S48>' : 'tuning_GS1/Kalman Filter/checkD' * '<S49>' : 'tuning_GS1/Kalman Filter/checkEnable' * '<S50>' : 'tuning_GS1/Kalman Filter/checkG' * '<S51>' : 'tuning_GS1/Kalman Filter/checkH' * '<S52>' : 'tuning_GS1/Kalman Filter/checkN' * '<S53>' : 'tuning_GS1/Kalman Filter/checkP0' * '<S54>' : 'tuning_GS1/Kalman Filter/checkQ' * '<S55>' : 'tuning_GS1/Kalman Filter/checkR' * '<S56>' : 'tuning_GS1/Kalman Filter/checkReset' * '<S57>' : 'tuning_GS1/Kalman Filter/checkX0' * '<S58>' : 'tuning_GS1/Kalman Filter/checku' * '<S59>' : 'tuning_GS1/Kalman Filter/checky' * '<S60>' : 'tuning_GS1/Kalman Filter/CalculatePL/DataTypeConversionL' * '<S61>' : 'tuning_GS1/Kalman Filter/CalculatePL/DataTypeConversionM' * '<S62>' : 'tuning_GS1/Kalman Filter/CalculatePL/DataTypeConversionP' * '<S63>' : 'tuning_GS1/Kalman Filter/CalculatePL/DataTypeConversionZ' * '<S64>' : 'tuning_GS1/Kalman Filter/Observer/MeasurementUpdate' * '<S65>' : 'tuning_GS1/Kalman Filter/UseCurrentEstimator/Enabled Subsystem' * '<S66>' : 'tuning_GS1/Nominal_xy_Controller/XY State Feedback' * '<S67>' : 'tuning_GS1/Nominal_xy_Controller/pitch_controller_SF' * '<S68>' : 'tuning_GS1/Nominal_xy_Controller/roll_controller_SF' * '<S69>' : 'tuning_GS1/Test_config_and_data/FFW' * '<S70>' : 'tuning_GS1/Test_config_and_data/LOE_' * '<S71>' : 'tuning_GS1/Test_config_and_data/MATLAB Function' */ #endif /* RTW_HEADER_tuning_GS1_h_ */
37.006993
111
0.666619
696846d3cbd285e6c05ed39856635919a4fef460
308
h
C
vulkanwrapper/InstanceFunctionList.h
chbaker0/vulkan-engine
b0e2a4278a35511b6205f15b5211fafc4c32dbd5
[ "MIT" ]
null
null
null
vulkanwrapper/InstanceFunctionList.h
chbaker0/vulkan-engine
b0e2a4278a35511b6205f15b5211fafc4c32dbd5
[ "MIT" ]
null
null
null
vulkanwrapper/InstanceFunctionList.h
chbaker0/vulkan-engine
b0e2a4278a35511b6205f15b5211fafc4c32dbd5
[ "MIT" ]
null
null
null
#define VKW_INSTANCE_FUNCTION_LIST \ X(vkGetInstanceProcAddr) \ X(vkGetDeviceProcAddr) \ X(vkEnumeratePhysicalDevices) \ X(vkGetPhysicalDeviceProperties) \ X(vkGetPhysicalDeviceQueueFamilyProperties) \ X(vkGetPhysicalDeviceFeatures) \ X(vkDestroyInstance) \ X(vkCreateDevice)
30.8
49
0.756494
fd4e1a93a0272975b8f0f52ee15158d5c8e802bd
1,970
h
C
geo3d/include/CGAL/Tools/Label.h
vipuserr/vipuserr-Geological-hazard
2b29c03cdac6f5e1ceac4cd2f15b594040ef909c
[ "MIT" ]
187
2019-01-23T04:07:11.000Z
2022-03-27T03:44:58.000Z
3rd_party/cgal_4.9/include/cgal/Tools/Label.h
nimzi/CGALViewer
25e28196a9192c2b7174a5656f441f97b9c94bd8
[ "MIT" ]
8
2019-03-22T13:27:38.000Z
2020-06-18T13:23:23.000Z
3rd_party/cgal_4.9/include/cgal/Tools/Label.h
nimzi/CGALViewer
25e28196a9192c2b7174a5656f441f97b9c94bd8
[ "MIT" ]
34
2019-02-13T01:11:12.000Z
2022-02-28T03:29:40.000Z
// Copyright (c) 2005 Stanford University (USA). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 3 of the License, // or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // // // Author(s) : Daniel Russel <drussel@alumni.princeton.edu> #ifndef CGAL_LABEL_H_ #define CGAL_LABEL_H_ #include <CGAL/basic.h> #include <iostream> #include <sstream> namespace CGAL { //! A type which provides opaque, typed identifiers. /*! Basically this is just an int with a type associated with it and one value (-1) picked out as the null value. It implements comparisons and things. */ template <class A_Type> class Label { protected: typedef Label<A_Type> This; int id_; public: //! Construct it from an int explicit Label(int i):id_(i){} //! Construct a default (null) label Label():id_(-1) { if(0) print(); // make sure it is compiled } //! Make the next label CGAL_GETNR(This, successor, return This(id_+1)); CGAL_IS(valid, return id_ >=0); CGAL_GETNR(unsigned int, index, CGAL_assertion(is_valid()); return id_); CGAL_COMPARISONS1(id_); std::ostream& write(std::ostream &out) const { if (id_ == -1) out << "(N)"; else out << "(" << id_ << ")"; return out; } void print() const { write(std::cout); } //! Convert to a string std::string string() const { std::ostringstream os; write(os); return os.str(); } }; CGAL_OUTPUT1(Label) } //namespace CGAL #endif
23.452381
79
0.670051
fd8a736384bc7bfad4879d0d60edbd5361dd6c6d
2,618
h
C
baremetal/arm/target.h
ghsecuritylab/ellcc-mirror
b03a4afac74d50cf0987554b8c0cd8209bcb92a2
[ "BSD-2-Clause" ]
null
null
null
baremetal/arm/target.h
ghsecuritylab/ellcc-mirror
b03a4afac74d50cf0987554b8c0cd8209bcb92a2
[ "BSD-2-Clause" ]
null
null
null
baremetal/arm/target.h
ghsecuritylab/ellcc-mirror
b03a4afac74d50cf0987554b8c0cd8209bcb92a2
[ "BSD-2-Clause" ]
null
null
null
/** Generic ARM specific definitions. */ #ifndef _target_h_ #define _target_h_ #define Mode_USR 0x10 #define Mode_FIQ 0x11 #define Mode_IRQ 0x12 #define Mode_SVC 0x13 #define Mode_ABT 0x17 #define Mode_UND 0x1B #define Mode_SYS 0x1F #define INITIAL_PSR Mode_SYS #define T_bit 0x20 #define F_bit 0x40 #define I_bit 0x80 #if !defined(__ASSEMBLER__) typedef struct context { union { uint32_t r0; uint32_t a1; }; union { uint32_t r1; uint32_t a2; }; union { uint32_t r2; uint32_t a3; }; union { uint32_t r3; uint32_t a4; }; union { uint32_t r4; uint32_t v1; }; union { uint32_t r5; uint32_t v2; }; union { uint32_t r6; uint32_t v3; }; union { uint32_t r7; uint32_t v4; }; union { uint32_t r8; uint32_t v5; }; union { uint32_t r9; uint32_t v6; }; union { uint32_t r10; uint32_t v7; }; union { uint32_t r11; uint32_t v8; }; union { uint32_t r12; uint32_t ip; }; // r13 is sp. Not saved here. union { uint32_t r14; uint32_t lr; }; union { uint32_t r15; uint32_t pc; }; uint32_t cpsr; } Context; static inline void context_set_return(Context *cp, int value) { cp->a1 = value; } static inline uint32_t __update_cpsr(uint32_t clear, uint32_t eor) __attribute__((__unused__)); static inline uint32_t __update_cpsr(uint32_t clear, uint32_t set) { uint32_t old, new; asm volatile("mrs %0, cpsr\n" // Get the cpsr. "bic %1, %0, %2\n" // Clear the affected bits. "eor %1, %1, %3\n" // Set the desited bits. "msr cpsr_c, %1\n" // Update the cpsr // The old value is in r0. : "=&r" (old), "=&r" (new) : "r" (clear), "r" (set) : "memory"); return old; } /** Turn off all interrupts. * @return The current interrupt level. */ static inline int splhigh(void) { return __update_cpsr(F_bit | I_bit, F_bit | I_bit); } /** Turn on all interrupts. * @return The current interrupt level. */ static inline int spl0(void) { return __update_cpsr(F_bit | I_bit, 0); } /** Set the interrupt level. * @param level The level to set. */ static inline void splx(int s) { __update_cpsr(F_bit | I_bit, s & (F_bit | I_bit)); } #endif // !defined(__ASSEMBLER__) #endif // _target_h_
19.392593
95
0.55042
9196b99ca0cbc000b2a399cccf9648c35c4c6a95
491
h
C
node_modules/nativescript-ui-chart/platforms/ios/TNSChart.framework/PrivateHeaders/TKChartAnnotation_Internal.h
DwGonzalez/NSPlayground
d602cf1ba5314b51a5ceeff9787aa8c3301f8773
[ "MIT" ]
11
2020-07-23T10:16:18.000Z
2022-03-09T15:36:39.000Z
node_modules/nativescript-ui-chart/platforms/ios/TNSChart.framework/PrivateHeaders/TKChartAnnotation_Internal.h
DwGonzalez/NSPlayground
d602cf1ba5314b51a5ceeff9787aa8c3301f8773
[ "MIT" ]
7
2020-08-11T08:32:31.000Z
2022-02-27T05:26:33.000Z
node_modules/nativescript-ui-chart/platforms/ios/TNSChart.framework/PrivateHeaders/TKChartAnnotation_Internal.h
DwGonzalez/NSPlayground
d602cf1ba5314b51a5ceeff9787aa8c3301f8773
[ "MIT" ]
3
2021-05-25T08:25:11.000Z
2022-03-31T22:14:15.000Z
// // TKChartAnnotation_Internal.h // TelerikUI // // Copyright (c) 2014 Telerik. All rights reserved. // #import "TKChartAnnotation.h" @class TKStyleSheet; @class TKStyleNode; /** An extension of the TKChartAnnotation class. */ @interface TKChartAnnotation () /** The style sheet of the annotation. */ @property (nonatomic, strong) TKStyleSheet *styleSheet; /** Gets the TKStyleNode instance which represents the current annotation style. */ -(TKStyleNode*)getStyleNode; @end
17.535714
77
0.733198
919a27a0eff5aa95d545ea1cd1b7b6b0a2f732cb
6,269
c
C
test/test_ipc_5.c
av-7/TrainOS
051dcd27fd0a5f77a7e86cfc556a82ae396e49a5
[ "MIT" ]
null
null
null
test/test_ipc_5.c
av-7/TrainOS
051dcd27fd0a5f77a7e86cfc556a82ae396e49a5
[ "MIT" ]
null
null
null
test/test_ipc_5.c
av-7/TrainOS
051dcd27fd0a5f77a7e86cfc556a82ae396e49a5
[ "MIT" ]
null
null
null
#include <kernel.h> #include <test.h> void test_ipc_5_first_sender_process(PROCESS self, PARAM param) { PORT receiver_port = (PORT) param; int data = 1; check_process("Sender 3", STATE_MESSAGE_BLOCKED, FALSE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(43); } check_process("Receiver", STATE_RECEIVE_BLOCKED, FALSE); check_process("Sender 2", STATE_READY, TRUE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(test_result); } kprintf("%s: sending a message to the second port using send()...\n", self->name); send(receiver_port, &data); kprintf("%s: received = %d\n", self->name, data); if (data != 11) test_failed(39); check_process("Receiver", STATE_RECEIVE_BLOCKED, FALSE); check_process("Sender 3", STATE_MESSAGE_BLOCKED, FALSE); check_process("Sender 2", STATE_READY, TRUE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(test_result); } return_to_boot(); } void test_ipc_5_second_sender_process(PROCESS self, PARAM param) { PORT receiver_port = (PORT) param; int data = 2; check_process("Receiver", STATE_RECEIVE_BLOCKED, FALSE); check_process("Sender 3", STATE_MESSAGE_BLOCKED, FALSE); check_process("Sender 1", STATE_REPLY_BLOCKED, FALSE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(test_result); } kprintf("%s: sending a message to the second port using message()...\n", self->name); message(receiver_port, &data); test_failed(54); } void test_ipc_5_third_sender_process(PROCESS self, PARAM param) { PORT receiver_port = (PORT) param; int data = 3; check_process("Receiver", STATE_RECEIVE_BLOCKED, FALSE); check_process("Sender 2", STATE_READY, TRUE); check_process("Sender 1", STATE_READY, TRUE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(test_result); } kprintf("%s: sending a message to the first port using message()...\n", self->name); message(receiver_port, &data); test_failed(37); } void test_ipc_5_receiver_process(PROCESS self, PARAM param) { PORT receiver_port1; PORT receiver_port2; PROCESS sender1; PROCESS sender2; int* data1; int* data2; /* Close the default port and create a new port. Here we make * sure that close_port() and create_port() works. */ receiver_port1 = self->first_port; kprintf("%s: closing the first port...\n", self->name); close_port(receiver_port1); check_port(receiver_port1, self->name, FALSE); if (test_result != 0) test_failed(test_result); receiver_port2 = create_port(); check_port(receiver_port2, self->name, TRUE); if (test_result != 0) test_failed(test_result); create_process(test_ipc_5_first_sender_process, 6, (PARAM) receiver_port2, "Sender 1"); create_process(test_ipc_5_second_sender_process, 5, (PARAM) receiver_port2, "Sender 2"); create_process(test_ipc_5_third_sender_process, 7, (PARAM) receiver_port1, "Sender 3"); /* * receive first message */ kprintf("%s: receiving first message...\n", self->name); data1 = (int*) receive(&sender1); kprintf("%s: received a message from %s, parameter = %d.\n", self->name, sender1->name, *data1); if (string_compare(sender1->name, "Sender 3") == 1) test_failed(60); if (string_compare(sender1->name, "Sender 1") != 1) test_failed(58); check_process("Sender 3", STATE_MESSAGE_BLOCKED, FALSE); check_process("Sender 2", STATE_READY, TRUE); check_process("Sender 1", STATE_REPLY_BLOCKED, FALSE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(test_result); } /* * receive seconde message */ kprintf("%s: receiving second message...\n", self->name); data2 = (int*) receive(&sender2); kprintf("%s: received a message from %s, parameter = %d.\n", self->name, sender2->name, *data2); if (string_compare(sender2->name, "Sender 3") == 1) test_failed(60); if (string_compare(sender2->name, "Sender 1") == 1) test_failed(44); if (string_compare(sender2->name, "Sender 2") != 1) test_failed(58); check_process("Sender 3", STATE_MESSAGE_BLOCKED, FALSE); check_process("Sender 2", STATE_READY, TRUE); check_process("Sender 1", STATE_REPLY_BLOCKED, FALSE); if (test_result != 0) { print_all_processes(kernel_window); test_failed(test_result); } kprintf("%s: replying %s...\n", self->name, sender1->name); *data1 = 11; reply(sender1); /* We do the third receive. Since there is no message pending, * this process will become RECEIVE_BLOCKED so that the sender * will continue to run. */ data1 = (int*) receive(&sender1); test_failed(47); } /* * This test creates one receiver process and three sender processes. * Here is the sequence of events as they happen: * - receiver_process() creates a second port and closes the initial port. * - receiver process creates three sender processes with different * priorities. * - receiver process calls receive(). Since there are no messages * pending, the receiver becomes RECEIVE_BLOCKED * - execution resumes in third_sender_process(). This process calls * message() on the closed port. The sender becomes MESSAGE_BLOCKED. * Since the sender sends a message to the closed port, the receiver * will not be woken up. * - execution resumes in first_sender_process(). This process does a * send() to the open port. This will unblock the receiver. * Execution resumes with the receiver. * - receiver calls receive() again to receive the next message. * - Execution resumes at second_sender_process() * - This process does a message() to the open port of the receiver. * - Execution resumes at the receiver * - Receiver does a reply() to the first sender * - Receiver calls receive() * - Execution resumes in the first sender() */ void test_ipc_5() { test_reset(); create_process(test_ipc_5_receiver_process, 7, 0, "Receiver"); resign(); }
30.139423
77
0.673632
dc079c7dbb159ece908735914fe68c19415313d1
2,514
c
C
src/core/rt/malloc/static.c
aument-lang/aument
5db67132fa1976deafbac246c6613d4ebcceb4f8
[ "Apache-2.0" ]
30
2021-03-13T08:06:32.000Z
2022-03-21T10:09:58.000Z
src/core/rt/malloc/static.c
aument-lang/aument
5db67132fa1976deafbac246c6613d4ebcceb4f8
[ "Apache-2.0" ]
2
2021-03-28T14:40:37.000Z
2021-04-01T08:56:31.000Z
src/core/rt/malloc/static.c
chm8d/aulang
5db67132fa1976deafbac246c6613d4ebcceb4f8
[ "Apache-2.0" ]
null
null
null
// This source file is part of the Aument language // Copyright (c) 2021 the aument contributors // // Licensed under Apache License v2.0 with Runtime Library Exception // See LICENSE.txt for license information #ifdef AU_IS_INTERPRETER #include <assert.h> #include <stdalign.h> #include <stddef.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "../malloc.h" #endif void au_malloc_init() {} void au_malloc_set_collect(int collect) { (void)collect; } size_t au_malloc_heap_size() { return 0; } // ** objects ** struct au_obj_malloc_header { au_obj_del_fn_t del_fn; size_t rc; char data[]; }; #define MAX_RC (SIZE_MAX) #define PTR_TO_OBJ_HEADER(PTR) \ (struct au_obj_malloc_header *)((uintptr_t)PTR - \ sizeof(struct au_obj_malloc_header)) void *au_obj_malloc(size_t size, au_obj_del_fn_t del_fn) { AU_STATIC_ASSERT( sizeof(struct au_obj_malloc_header) % alignof(max_align_t) == 0, "struct au_obj_malloc_header must divisible by the maximum " "alignment"); struct au_obj_malloc_header *header = malloc(sizeof(struct au_obj_malloc_header) + size); header->del_fn = del_fn; header->rc = 1; return header->data; } void *au_obj_realloc(void *ptr, size_t size) { struct au_obj_malloc_header *old_header = PTR_TO_OBJ_HEADER(ptr); if (old_header->rc > 1) abort(); struct au_obj_malloc_header *header = realloc(old_header, sizeof(struct au_obj_malloc_header) + size); return header->data; } void au_obj_free(void *ptr) { struct au_obj_malloc_header *header = PTR_TO_OBJ_HEADER(ptr); if (header->rc != 0) abort(); if (header->del_fn != 0) header->del_fn(ptr); free(header); } void au_obj_ref(void *ptr) { struct au_obj_malloc_header *header = PTR_TO_OBJ_HEADER(ptr); if (AU_UNLIKELY(header->rc == MAX_RC)) abort(); header->rc++; } void au_obj_deref(void *ptr) { struct au_obj_malloc_header *header = PTR_TO_OBJ_HEADER(ptr); if (AU_UNLIKELY(header->rc == 0)) abort(); header->rc--; if (header->rc == 0) au_obj_free(ptr); } // ** data ** void *au_data_malloc(size_t size) { return malloc(size); } void *au_data_calloc(size_t count, size_t size) { return calloc(count, size); } void *au_data_realloc(void *ptr, size_t size) { return realloc(ptr, size); } void au_data_free(void *ptr) { free(ptr); }
27.326087
75
0.655927
7ce1bd7761b5a9f167cbb03905b3088612f5bcbf
1,503
h
C
Labyrint/labyball/Classes/Native/UnityEngine_UnityEngine_RectTransform3317474837.h
mimietti/Labyball
c4b03f5b5d5ec1a1cae5831d22391bc2a171230f
[ "MIT" ]
null
null
null
Labyrint/labyball/Classes/Native/UnityEngine_UnityEngine_RectTransform3317474837.h
mimietti/Labyball
c4b03f5b5d5ec1a1cae5831d22391bc2a171230f
[ "MIT" ]
23
2016-07-21T13:03:02.000Z
2016-10-03T12:43:01.000Z
Labyrint/labyrinti1/Classes/Native/UnityEngine_UnityEngine_RectTransform3317474837.h
mimietti/Labyball
c4b03f5b5d5ec1a1cae5831d22391bc2a171230f
[ "MIT" ]
1
2019-09-08T17:32:17.000Z
2019-09-08T17:32:17.000Z
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // UnityEngine.RectTransform/ReapplyDrivenProperties struct ReapplyDrivenProperties_t3247703954; #include "UnityEngine_UnityEngine_Transform284553113.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.RectTransform struct RectTransform_t3317474837 : public Transform_t284553113 { public: public: }; struct RectTransform_t3317474837_StaticFields { public: // UnityEngine.RectTransform/ReapplyDrivenProperties UnityEngine.RectTransform::reapplyDrivenProperties ReapplyDrivenProperties_t3247703954 * ___reapplyDrivenProperties_2; public: inline static int32_t get_offset_of_reapplyDrivenProperties_2() { return static_cast<int32_t>(offsetof(RectTransform_t3317474837_StaticFields, ___reapplyDrivenProperties_2)); } inline ReapplyDrivenProperties_t3247703954 * get_reapplyDrivenProperties_2() const { return ___reapplyDrivenProperties_2; } inline ReapplyDrivenProperties_t3247703954 ** get_address_of_reapplyDrivenProperties_2() { return &___reapplyDrivenProperties_2; } inline void set_reapplyDrivenProperties_2(ReapplyDrivenProperties_t3247703954 * value) { ___reapplyDrivenProperties_2 = value; Il2CppCodeGenWriteBarrier(&___reapplyDrivenProperties_2, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
28.903846
177
0.840319
8781ac4b8d547d599c8fc057341d6171cff4d7f1
3,514
c
C
c rewrite/process.c
pjm0/hatching
6a6ae9e502ed40ca49266b38d40e1f3918316eec
[ "BSD-3-Clause" ]
null
null
null
c rewrite/process.c
pjm0/hatching
6a6ae9e502ed40ca49266b38d40e1f3918316eec
[ "BSD-3-Clause" ]
null
null
null
c rewrite/process.c
pjm0/hatching
6a6ae9e502ed40ca49266b38d40e1f3918316eec
[ "BSD-3-Clause" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #include "lib.h" #define PPM_HEADER "P6\n%d %d\n%d\n" #define CONTRAST 0.1 int loadPpmRead(PpmWrapper *img, char *filename) { img->f = fopen(filename, "rb"); if (!img->f) { return 0; } else if (fscanf(img->f, PPM_HEADER, &(img->width), &(img->height), &(img->maxVal))<0) { return 0; } printf(PPM_HEADER, img->width, img->height, img->maxVal); return 1; } int loadPpmWrite(PpmWrapper *img, char *filename) { img->f = fopen(filename, "wb"); printf(PPM_HEADER, img->width, img->height, img->maxVal); if (!img->f) { return 0; } else if (fprintf(img->f, PPM_HEADER, img->width, img->height, img->maxVal)<0) { return 0; } return 1; } void batchProcessNormals(char *outFN) { } int processNormals(ShadeContext *context, char *normalFN, char *lightFN, char *outFN) { PpmWrapper normalMap, lightMap, output; int normalFileOK = loadPpmRead(&normalMap, normalFN); output.height = normalMap.height; output.width = normalMap.width; output.maxVal = 255; int outputFileOK = loadPpmWrite(&output, outFN); if (!(normalFileOK && outputFileOK)) { return 0; } int lightMapFileOK = loadPpmRead(&lightMap, lightFN); for (int j = 0; j < normalMap.height; ++j) { for (int i = 0; i < normalMap.width; ++i) { int n; context->contrast = CONTRAST; RGB24 normColor, lightColor, outColor; RGB48 normColor48, lightColor48; double brightness; if (normalMap.maxVal > 255) { fread(&(normColor48.rgb), 2, 3, normalMap.f); rgb48ToNormal(&normColor48, &(context->normal), normalMap.maxVal); } else { fread(&(normColor.rgb), 1, 3, normalMap.f); rgbToNormal(&normColor, &(context->normal), normalMap.maxVal); } if (lightMapFileOK) { if (lightMap.maxVal > 255) { fread(&(lightColor48.rgb), 2, 3, lightMap.f); context->brightness = (lightColor48.rgb[0]+lightColor48.rgb[1]+lightColor48.rgb[2]) / 3 / lightMap.maxVal; } else { fread(&(lightColor.rgb), 2, 3, lightMap.f); context->brightness = (lightColor.rgb[0]+lightColor.rgb[1]+lightColor.rgb[2]) / 3 / lightMap.maxVal; } } else { context->brightness = getBrightness(&(context->normal), &(context->lightV), context->contrast); } shadeSphereGrid(&outColor, context); fwrite(&(outColor.rgb), 1, 3, output.f); // printf("Norm (%d %d %d) Light (%d %d %d) out (%d %d %d)\n", normColor.rgb[0], normColor.rgb[1], normColor.rgb[2], // lightColor.rgb[0], lightColor.rgb[1], lightColor.rgb[2], // outColor.rgb[0], outColor.rgb[1], outColor.rgb[2]); } } fflush(output.f); fclose(normalMap.f); fclose(output.f); if (lightMap.f) fclose(lightMap.f); return 0; } int main(int argc, char **argv) { ShadeContext context; context.latSections = 100; context.lonSections = 2; context.lightV.v[0] = 1; context.lightV.v[1] = 0; context.lightV.v[2] = 0; normalize(&(context.lightV)); if (argc == 3) { processNormals(&context, argv[1], (char *)NULL, argv[2]); } else if (argc == 4) { processNormals(&context, argv[1], argv[2], argv[3]); } }
32.841121
128
0.563745
c666240f93b2db5b57e4a8a84dab0431f8fda5d1
3,685
h
C
include/bbclient/bb_socket_errors.h
campbellhome/bbclient
5f9ad881ac65c17f736c3421fddb4e726f23741a
[ "MIT" ]
null
null
null
include/bbclient/bb_socket_errors.h
campbellhome/bbclient
5f9ad881ac65c17f736c3421fddb4e726f23741a
[ "MIT" ]
null
null
null
include/bbclient/bb_socket_errors.h
campbellhome/bbclient
5f9ad881ac65c17f736c3421fddb4e726f23741a
[ "MIT" ]
null
null
null
// Copyright (c) 2012-2019 Matt Campbell // MIT license (see License.txt) #pragma once #include "bb_sockets.h" #if BB_ENABLED #if BB_USING(BB_COMPILER_MSVC) // clang-format off #define BBNET_EWOULDBLOCK WSAEWOULDBLOCK #define BBNET_EINPROGRESS WSAEINPROGRESS #define BBNET_EALREADY WSAEALREADY #define BBNET_ENOTSOCK WSAENOTSOCK #define BBNET_EDESTADDRREQ WSAEDESTADDRREQ #define BBNET_EMSGSIZE WSAEMSGSIZE #define BBNET_EPROTOTYPE WSAEPROTOTYPE #define BBNET_ENOPROTOOPT WSAENOPROTOOPT #define BBNET_EPROTONOSUPPORT WSAEPROTONOSUPPORT #define BBNET_ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT #define BBNET_EOPNOTSUPP WSAEOPNOTSUPP #define BBNET_EPFNOSUPPORT WSAEPFNOSUPPORT #define BBNET_EAFNOSUPPORT WSAEAFNOSUPPORT #define BBNET_EADDRINUSE WSAEADDRINUSE #define BBNET_EADDRNOTAVAIL WSAEADDRNOTAVAIL #define BBNET_ENETDOWN WSAENETDOWN #define BBNET_ENETUNREACH WSAENETUNREACH #define BBNET_ENETRESET WSAENETRESET #define BBNET_ECONNABORTED WSAECONNABORTED #define BBNET_ECONNRESET WSAECONNRESET #define BBNET_ENOBUFS WSAENOBUFS #define BBNET_EISCONN WSAEISCONN #define BBNET_ENOTCONN WSAENOTCONN #define BBNET_ESHUTDOWN WSAESHUTDOWN #define BBNET_ETOOMANYREFS WSAETOOMANYREFS #define BBNET_ETIMEDOUT WSAETIMEDOUT #define BBNET_ECONNREFUSED WSAECONNREFUSED #define BBNET_ELOOP WSAELOOP #define BBNET_ENAMETOOLONG WSAENAMETOOLONG #define BBNET_EHOSTDOWN WSAEHOSTDOWN #define BBNET_EHOSTUNREACH WSAEHOSTUNREACH #define BBNET_ENOTEMPTY WSAENOTEMPTY #define BBNET_EPROCLIM WSAEPROCLIM #define BBNET_EUSERS WSAEUSERS #define BBNET_EDQUOT WSAEDQUOT #define BBNET_ESTALE WSAESTALE #define BBNET_EREMOTE WSAEREMOTE //#define BBNET_EPIPE WSAEPIPE // clang-format on #else // #if BB_USING(BB_COMPILER_MSVC) // clang-format off #define BBNET_EWOULDBLOCK EWOULDBLOCK #define BBNET_EINPROGRESS EINPROGRESS #define BBNET_EALREADY EALREADY #define BBNET_ENOTSOCK ENOTSOCK #define BBNET_EDESTADDRREQ EDESTADDRREQ #define BBNET_EMSGSIZE EMSGSIZE #define BBNET_EPROTOTYPE EPROTOTYPE #define BBNET_ENOPROTOOPT ENOPROTOOPT #define BBNET_EPROTONOSUPPORT EPROTONOSUPPORT #define BBNET_ESOCKTNOSUPPORT ESOCKTNOSUPPORT #define BBNET_EOPNOTSUPP EOPNOTSUPP #define BBNET_EPFNOSUPPORT EPFNOSUPPORT #define BBNET_EAFNOSUPPORT EAFNOSUPPORT #define BBNET_EADDRINUSE EADDRINUSE #define BBNET_EADDRNOTAVAIL EADDRNOTAVAIL #define BBNET_ENETDOWN ENETDOWN #define BBNET_ENETUNREACH ENETUNREACH #define BBNET_ENETRESET ENETRESET #define BBNET_ECONNABORTED ECONNABORTED #define BBNET_ECONNRESET ECONNRESET #define BBNET_ENOBUFS ENOBUFS #define BBNET_EISCONN EISCONN #define BBNET_ENOTCONN ENOTCONN #define BBNET_ESHUTDOWN ESHUTDOWN #define BBNET_ETOOMANYREFS ETOOMANYREFS #define BBNET_ETIMEDOUT ETIMEDOUT #define BBNET_ECONNREFUSED ECONNREFUSED #define BBNET_ELOOP ELOOP #define BBNET_ENAMETOOLONG ENAMETOOLONG #define BBNET_EHOSTDOWN EHOSTDOWN #define BBNET_EHOSTUNREACH EHOSTUNREACH #define BBNET_ENOTEMPTY ENOTEMPTY //#define BBNET_EPROCLIM EPROCLIM #define BBNET_EUSERS EUSERS #define BBNET_EDQUOT EDQUOT #define BBNET_ESTALE ESTALE #define BBNET_EREMOTE EREMOTE #define BBNET_EPIPE EPIPE // clang-format on #endif // #else // #if BB_USING(BB_COMPILER_MSVC) #if defined(__cplusplus) extern "C" { #endif const char *bbnet_error_to_string(int err); #if defined(__cplusplus) } #endif #endif // #if BB_ENABLED
33.807339
49
0.769064
0b6c4047e748706f32929bbf3da98f2ffc332f1f
564
h
C
Self-examinationPlan/Self-examination/Category/NSDate+Extension.h
MilkHeart/Self-examination
a2f25a8acabbb915ae33914403844712e0d3f442
[ "MIT" ]
null
null
null
Self-examinationPlan/Self-examination/Category/NSDate+Extension.h
MilkHeart/Self-examination
a2f25a8acabbb915ae33914403844712e0d3f442
[ "MIT" ]
null
null
null
Self-examinationPlan/Self-examination/Category/NSDate+Extension.h
MilkHeart/Self-examination
a2f25a8acabbb915ae33914403844712e0d3f442
[ "MIT" ]
null
null
null
// // NSDate+Extension.h // Self-examination // // Created by milk on 2017/6/22. // Copyright © 2017年 milk. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDate (Extension) + (NSString *)getNowMonthAndDay; + (NSString *)getNowYear; + (NSString *)formatterDate:(NSDate *)date; + (NSString *)formatterDateForSQL:(NSDate *)date; + (NSString *)formatterDateForWeek:(NSDate *)date; + (NSString *)formatterDateForYear:(NSDate *)date; + (NSString *)getNowWeek; + (NSDate *)formatterDateFromInteger:(NSString *)timeIntervalStr; @end
18.8
66
0.70922
3cc5ec8fc5418b9932d976d80f30dfeca9fb93ea
1,060
h
C
GameEngine/Headers/IndexBuffer.h
GPUWorks/OpenGL-Mini-CAD-2D
fedb903302f82a1d1ff0ca6776687a60a237008a
[ "MIT" ]
1
2021-08-10T02:48:57.000Z
2021-08-10T02:48:57.000Z
GameEngine/Headers/IndexBuffer.h
GPUWorks/OpenGL-Mini-CAD-2D
fedb903302f82a1d1ff0ca6776687a60a237008a
[ "MIT" ]
null
null
null
GameEngine/Headers/IndexBuffer.h
GPUWorks/OpenGL-Mini-CAD-2D
fedb903302f82a1d1ff0ca6776687a60a237008a
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include <set> #include <iostream> #include <GLEW\glew.h> #include <glm\glm.hpp> #include "IndexBufferTree.h" namespace storage { class IndexBuffer { private: GLenum usage; GLuint ebo; GLuint indices_no; GLuint segment_indices_no; GLuint segments_no; GLuint byte_index_size; GLuint byte_segment_size; GLuint byte_buffer_size; ds::IndexBufferTree allocator; public: //------------------------------ Constructors IndexBuffer(); IndexBuffer(GLenum usage, GLuint indices_no, GLuint segment_indices_no); //------------------------------ Secondary Functions void generateBuffer(); void bindBuffer(); //------------------------------ Secondary Functions (Provide Data) GLint insertData(GLuint indices_no, const void* data); void insertData(GLuint offset, GLuint indices_no, const void* data); //------------------------------ Secondary Functions (Retrieve Data) void memoryAllocationAndDataInitialization(); void clean(); }; }
21.2
75
0.622642
4c7f6f7418c3d15c44cac89bcff7db2e8f1bc7af
165
h
C
fp_core/src/main/include/fruitpunch/version.h
submain/fruitpunch
31773128238830d3d335c1915877dc0db56836cd
[ "MIT" ]
null
null
null
fp_core/src/main/include/fruitpunch/version.h
submain/fruitpunch
31773128238830d3d335c1915877dc0db56836cd
[ "MIT" ]
null
null
null
fp_core/src/main/include/fruitpunch/version.h
submain/fruitpunch
31773128238830d3d335c1915877dc0db56836cd
[ "MIT" ]
1
2020-08-14T02:51:47.000Z
2020-08-14T02:51:47.000Z
// This file is supposed to be rewritten by maven during each build. // Do not edit it directly. #define FP_CORE_VERSION_MAJOR "0" #define FP_CORE_VERSION_MINOR "35"
41.25
68
0.781818
487e6f101d1bc8d18bb31f47fa7d09f98cfff5ff
4,659
h
C
player.h
NX1125/cg-tf
84a2e05908066efcbe797d35c6498f69a51ad917
[ "MIT" ]
null
null
null
player.h
NX1125/cg-tf
84a2e05908066efcbe797d35c6498f69a51ad917
[ "MIT" ]
null
null
null
player.h
NX1125/cg-tf
84a2e05908066efcbe797d35c6498f69a51ad917
[ "MIT" ]
null
null
null
/* * File: airplane.h * Author: gg * * Created on 5 de dezembro de 2019, 19:41 */ #ifndef AIRPLANE_H #define AIRPLANE_H #include "wfobj.h" #include "takeoff.h" #include "airplanemovement.h" #include "teleportable.h" #include "projectile.h" #include "cannon.h" #include "propeller.h" #include "minimapitem.h" #include "bomb.h" #include "resetlistener.h" enum Behaviour { ON_GROUND, TAKING_OFF, CONTROLLING, GAME_OVER }; class player_death_listener_t { public: // Bring some flowers, ok? virtual void onPlayerDeath() = 0; }; class bomb_listener_t { public: virtual void onBombThrow(bomb_t* b) = 0; }; class player_t : public teleportable_t, public obstacle_t, public mini_map_item_t, public reset_listener_t { private: static wf_object_t* sPlayerBodyModel; static float sPlayerBodyModelRadius; static vector3f sBombDoor; /** * The location that the player will be drawn. The position can be updated * by overriding it. */ point3f position; /** * The horizontal angle of the model to be rendered. This is done in the xy * plane. It is similar to longitude. */ float horizontal = 0; /** * The vertical angle of the model to be rendered. It is similar to * latitude. */ float vertical = 0; /** * The velocity of the horizontal angle. The airplane rotates around the * axis from the back to the front with this angle to have an effect of * movement. */ float horizontalAngularVelocity = 0; float horizontalAngularVelocityDrawing = 0; /** * The behaviour of the player through time. Initially, the player object * is waiting for the player to press 'u' to then start the takeoff. */ Behaviour mBehaviour = Behaviour::ON_GROUND; takeoff_t* takeoff; airplane_movement_t* controller; cannon_t* cannon; propeller_t* propellerRight; propeller_t* propellerLeft; /** * The radius given in the settings. */ float radius; float velocityFactor = 1.0f; bool dead = false; projectile_manager_t* manager = NULL; float bulletVelocityFactor = 1.0f; vector3f cockpitOffset; player_death_listener_t* death = NULL; bomb_listener_t* bombListener = NULL; public: player_t(takeoff_t* takeoff, float radius); void cockpitView(); void cannonView(); void setManager(projectile_manager_t* manager); void setBulletVelocityFactor(float bulletVelocityFactor) { this->bulletVelocityFactor = bulletVelocityFactor; } void setDeathListener(player_death_listener_t* death) { this->death = death; } void setBombListener(bomb_listener_t* bombListener) { this->bombListener = bombListener; } /** * Moves the player to inside the arena if it hit the roof or the ground. */ void clipZ(float height); void setVelocityFactor(float velocityFactor) { this->velocityFactor = velocityFactor; } void draw(bool cockpit, bool gun, bool body, bool aim); void keyPress(unsigned char key); void keyRelease(unsigned char key); void mousePress(int button); Behaviour getBehaviour() const { return mBehaviour; } point3f getPosition() const { return position; } float getRadius() const { return radius; } float getHorizontal() const { return horizontal; } float getVertical() const { return vertical; } vector3f getDirection(float v) const; vector3f getVelocity() const; void update(int millis); static void sInit(wf_object_loader_t& loader); bool canTeleport() const { return mBehaviour == Behaviour::CONTROLLING; } const char* getName() const override; void setPosition(const point3f& p) override; bool isDead() const { return dead; } /** * Throw a bomb. */ void bomb(); /** * Fire a bullet. */ void fire(); void kill(); void won(); bool canDie() const; /** * Both x and y are between 0 and 1. */ void setCannonAxis(float x, float y); bool isAlive() const override { return !dead; } void drawMapElement(circle_blueprint_t* blueprint) const override; void reset() override { position = takeoff->getStart(); mBehaviour = Behaviour::ON_GROUND; takeoff->reset(); controller->reset(); cannon->reset(); propellerLeft->reset(); propellerRight->reset(); dead = false; } }; #endif /* AIRPLANE_H */
20.344978
108
0.639408
21c85b27511eb438dbfb4523332eab934be22b20
3,864
h
C
decoder/ff_lexical.h
kho/cdec
d88186af251ecae60974b20395ce75807bfdda35
[ "BSD-3-Clause-LBNL", "Apache-2.0" ]
114
2015-01-11T05:41:03.000Z
2021-08-31T03:47:12.000Z
decoder/ff_lexical.h
kho/cdec
d88186af251ecae60974b20395ce75807bfdda35
[ "BSD-3-Clause-LBNL", "Apache-2.0" ]
29
2015-01-09T01:00:09.000Z
2019-09-25T06:04:02.000Z
decoder/ff_lexical.h
kho/cdec
d88186af251ecae60974b20395ce75807bfdda35
[ "BSD-3-Clause-LBNL", "Apache-2.0" ]
50
2015-02-13T13:48:39.000Z
2019-08-07T09:45:11.000Z
#ifndef FF_LEXICAL_H_ #define FF_LEXICAL_H_ #include <vector> #include <map> #include "trule.h" #include "ff.h" #include "hg.h" #include "array2d.h" #include "wordid.h" #include <sstream> #include <cassert> #include <cmath> #include "filelib.h" #include "stringlib.h" #include "sentence_metadata.h" #include "lattice.h" #include "fdict.h" #include "verbose.h" #include "tdict.h" #include "hg.h" using namespace std; namespace { string Escape(const string& x) { string y = x; for (int i = 0; i < y.size(); ++i) { if (y[i] == '=') y[i]='_'; if (y[i] == ';') y[i]='_'; } return y; } } class LexicalFeatures : public FeatureFunction { public: LexicalFeatures(const std::string& param) { if (param.empty()) { cerr << "LexicalFeatures: using T,D,I\n"; T_ = true; I_ = true; D_ = true; } else { const vector<string> argv = SplitOnWhitespace(param); assert(argv.size() == 3); T_ = (bool) atoi(argv[0].c_str()); I_ = (bool) atoi(argv[1].c_str()); D_ = (bool) atoi(argv[2].c_str()); cerr << "T=" << T_ << " I=" << I_ << " D=" << D_ << endl; } }; static std::string usage(bool p,bool d) { return usage_helper("LexicalFeatures","[0/1 0/1 0/1]","Sparse lexical word translation indicator features. If arguments are supplied, specify like this: translations insertions deletions",p,d); } protected: virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta, const HG::Edge& edge, const std::vector<const void*>& ant_contexts, SparseVector<double>* features, SparseVector<double>* estimated_features, void* context) const; virtual void PrepareForInput(const SentenceMetadata& smeta); private: mutable std::map<const TRule*, SparseVector<double> > rule2feats_; bool T_; bool I_; bool D_; }; void LexicalFeatures::PrepareForInput(const SentenceMetadata& smeta) { rule2feats_.clear(); // std::map<const TRule*, SparseVector<double> > } void LexicalFeatures::TraversalFeaturesImpl(const SentenceMetadata& smeta, const HG::Edge& edge, const std::vector<const void*>& ant_contexts, SparseVector<double>* features, SparseVector<double>* estimated_features, void* context) const { map<const TRule*, SparseVector<double> >::iterator it = rule2feats_.find(edge.rule_.get()); if (it == rule2feats_.end()) { const TRule& rule = *edge.rule_; it = rule2feats_.insert(make_pair(&rule, SparseVector<double>())).first; SparseVector<double>& f = it->second; std::vector<bool> sf(edge.rule_->FLength(),false); // stores if source tokens are visited by alignment points std::vector<bool> se(edge.rule_->ELength(),false); // stores if target tokens are visited by alignment points int fid = 0; // translations for (unsigned i=0;i<rule.a_.size();++i) { const AlignmentPoint& ap = rule.a_[i]; sf[ap.s_] = true; // mark index as seen se[ap.t_] = true; // mark index as seen ostringstream os; os << "LT:" << Escape(TD::Convert(rule.f_[ap.s_])) << ":" << Escape(TD::Convert(rule.e_[ap.t_])); fid = FD::Convert(os.str()); if (fid <= 0) continue; if (T_) f.add_value(fid, 1.0); } // word deletions for (unsigned i=0;i<sf.size();++i) { if (!sf[i] && rule.f_[i] > 0) {// if not visited and is terminal ostringstream os; os << "LD:" << Escape(TD::Convert(rule.f_[i])); fid = FD::Convert(os.str()); if (fid <= 0) continue; if (D_) f.add_value(fid, 1.0); } } // word insertions for (unsigned i=0;i<se.size();++i) { if (!se[i] && rule.e_[i] >= 1) {// if not visited and is terminal ostringstream os; os << "LI:" << Escape(TD::Convert(rule.e_[i])); fid = FD::Convert(os.str()); if (fid <= 0) continue; if (I_) f.add_value(fid, 1.0); } } } (*features) += it->second; } #endif
29.953488
198
0.625259
14f741ec1646da9845e052508cdf32b1b1c696e1
116
c
C
libc/libgloss/m32r/unlink.c
The0x539/wasp
5f83aab7bf0c0915b1d3491034d35b091c7aebdf
[ "MIT" ]
453
2016-07-29T23:26:30.000Z
2022-02-21T01:09:13.000Z
libc/libgloss/m32r/unlink.c
The0x539/wasp
5f83aab7bf0c0915b1d3491034d35b091c7aebdf
[ "MIT" ]
175
2018-05-30T03:06:15.000Z
2019-02-06T23:54:24.000Z
libc/libgloss/m32r/unlink.c
The0x539/wasp
5f83aab7bf0c0915b1d3491034d35b091c7aebdf
[ "MIT" ]
57
2016-07-29T23:34:09.000Z
2021-07-13T18:17:02.000Z
#include <sys/types.h> #include <sys/stat.h> #include "syscall.h" #include "eit.h" int _unlink () { return -1; }
10.545455
22
0.637931
bc1d0ce7e97dcadcb0f7bed3081f3040dd7ed383
348
h
C
Projects/Quip/QuipWindowController.h
krisl/quip
a386f8bcecf59de9e9c7a6d6d8c077e49b72fb19
[ "MIT" ]
null
null
null
Projects/Quip/QuipWindowController.h
krisl/quip
a386f8bcecf59de9e9c7a6d6d8c077e49b72fb19
[ "MIT" ]
null
null
null
Projects/Quip/QuipWindowController.h
krisl/quip
a386f8bcecf59de9e9c7a6d6d8c077e49b72fb19
[ "MIT" ]
1
2020-07-11T22:45:16.000Z
2020-07-11T22:45:16.000Z
#import <Cocoa/Cocoa.h> #import "QuipStatusView.h" #import "QuipTextView.h" @interface QuipWindowController : NSWindowController<NSWindowDelegate> @property (nonatomic, weak) IBOutlet NSScrollView * scrollView; @property (nonatomic, weak) IBOutlet QuipStatusView * statusView; @property (nonatomic, weak) IBOutlet QuipTextView * textView; @end
26.769231
70
0.793103
218072d291d79a6f4fcb1ba008575502303f1dac
610
h
C
Tapur_Open/spconfig-0.1.3/src/stack.h
yamamoto123/tapur_open
927cf6fc1fc58abd4cd6aed251a0646256eff63b
[ "Apache-2.0" ]
6
2015-03-02T14:59:45.000Z
2017-03-16T20:53:31.000Z
Tapur_Open/spconfig-0.1.3/src/stack.h
yamamoto123/tapur_open
927cf6fc1fc58abd4cd6aed251a0646256eff63b
[ "Apache-2.0" ]
null
null
null
Tapur_Open/spconfig-0.1.3/src/stack.h
yamamoto123/tapur_open
927cf6fc1fc58abd4cd6aed251a0646256eff63b
[ "Apache-2.0" ]
null
null
null
/* stack.h - v0.1.3 * * a basic procedural stack */ /* Copyright (C) 2003 softpixel (http://softpixel.com/) * This file is covered by a BSD-Style License, available in * the LICENSE file in the root directory of this package, as well as at * http://prj.softpixel.com/licenses/#bsd */ /* Simple stack push/pop operations. internal to spconfig */ typedef struct itemS { void* val; struct itemS *next; }item; typedef struct { item *stack; int depth; }Stack; void finiCache(); Stack* newStack(); void freeStack(Stack*stack); void stackPush(Stack*stack,void*val); void* stackPop(Stack*stack);
19.0625
72
0.7
7106482b0c919bcfbc7aefa91347a2e3f0d7668c
1,782
h
C
src/Wrappers/Type2TwoColDataSource.h
fsaintjacques/cstore
3300a81c359c4a48e13ad397e3eb09384f57ccd7
[ "BSD-2-Clause" ]
14
2016-07-11T04:08:09.000Z
2022-03-11T05:56:59.000Z
src/Wrappers/Type2TwoColDataSource.h
ibrarahmad/cstore
3300a81c359c4a48e13ad397e3eb09384f57ccd7
[ "BSD-2-Clause" ]
null
null
null
src/Wrappers/Type2TwoColDataSource.h
ibrarahmad/cstore
3300a81c359c4a48e13ad397e3eb09384f57ccd7
[ "BSD-2-Clause" ]
13
2016-06-01T10:41:15.000Z
2022-01-06T09:01:15.000Z
#ifndef Type2TwoColDataSource_H_ #define Type2TwoColDataSource_H_ #include "../common/DataSource.h" #include "IntDataSource.h" using namespace std; class Type2TwoColDataSource : public DataSource { public: Type2TwoColDataSource(AM* am_, bool valSorted_, const string& valfile_); virtual ~Type2TwoColDataSource(); // Gets the next value block from the operator virtual Block* getNextValBlock(int colIndex_); // Skips to the first block with this value // Returns NULL if the value is outside the range of the column virtual Block* skipToValBlock(int colIndex_, int val_) { throw UnexpectedException("not implemented"); } // Gets the next position block (bitstring of positions) from the operator virtual PosBlock* getNextPosBlock(int colIndex_); // Skips to the first block with this position // Returns NULL if the value is outside the range of the column virtual PosBlock* skipToPosBlock(int colIndex_, int pos_) { throw UnexpectedException("not implemented"); } bool iterOK(int i); bool blockOK(int i); protected: enum BlockType {VAL, POS}; void init_cursors(); void update_blocks(); void* getNextXBlock(int colIndex_, BlockType type); ROSAM* valam; ROSAM* valfileam; IntDataSource* valfileds; AM* am; bool valSorted; int nvalues; int* cursor_to_val_map; unsigned int startpos; unsigned int consensus_ep; Type2Block** currblocks; PosType2Block** currPosBlocks; PosType2Block::PosType2BlockIter** iters; Type2Block outPosBlockBackingBlock; PosType2Block outPosBlock; MultiBlock outDataBlock; BlockWithPos outBlock; int* mb_buffer; unsigned int mb_bufsize; bool firstcall; int nseen; string valfile; PosBlock* curPosBlock; unsigned int curpos_end; Block* curValBlock; }; #endif /*Type2TwoColDataSource_H_*/
24.410959
75
0.767677
8e0f489694a8947c0a1a0e3e223e48d7dd8d636a
1,764
h
C
modules/drivers/lidar/common/driver_factory/driver_base.h
jzjonah/apollo
bc534789dc0548bf2d27f8d72fe255d5c5e4f951
[ "Apache-2.0" ]
22,688
2017-07-04T23:17:19.000Z
2022-03-31T18:56:48.000Z
modules/drivers/lidar/common/driver_factory/driver_base.h
WJY-Mark/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
[ "Apache-2.0" ]
4,804
2017-07-04T22:30:12.000Z
2022-03-31T12:58:21.000Z
modules/drivers/lidar/common/driver_factory/driver_base.h
WJY-Mark/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
[ "Apache-2.0" ]
9,985
2017-07-04T22:01:17.000Z
2022-03-31T14:18:16.000Z
/****************************************************************************** * Copyright 2020 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ /** * @file * @brief Defines the CanFrame struct and CanClient interface. */ #pragma once #include <cstdint> #include <cstring> #include <memory> #include <sstream> #include <string> #include <vector> #include "cyber/common/log.h" #include "cyber/cyber.h" /** * @namespace apollo::drivers::lidar * @brief apollo::drivers::lidar */ namespace apollo { namespace drivers { namespace lidar { /** * @class LidarDriver * @brief The class which defines the lidar driver . */ class LidarDriver { public: /** * @brief Constructor */ LidarDriver() {} explicit LidarDriver(const std::shared_ptr<::apollo::cyber::Node>& node) : node_(node) {} /** * @brief Destructor */ virtual ~LidarDriver() = default; /** * @brief Initialize the lidar driver. * @return If the initialization is successful. */ virtual bool Init() = 0; protected: std::shared_ptr<cyber::Node> node_; }; } // namespace lidar } // namespace drivers } // namespace apollo
24.5
79
0.631519
2a08495ac26be58de5643c48a8d113bbbfb5d0b6
86
h
C
ios/Classes/IrSensorPlugin.h
Yeikel200/ir_sensor_plugin
0676f89774f7be1a1f92f4825ee4f11522cbd311
[ "MIT" ]
8
2020-09-06T10:11:44.000Z
2021-10-05T19:20:54.000Z
ios/Classes/IrSensorPlugin.h
yeikel16/ir_sensor_plugin
0676f89774f7be1a1f92f4825ee4f11522cbd311
[ "MIT" ]
4
2020-07-29T17:31:58.000Z
2021-08-22T17:54:13.000Z
ios/Classes/IrSensorPlugin.h
yeikel16/ir_sensor_plugin
0676f89774f7be1a1f92f4825ee4f11522cbd311
[ "MIT" ]
4
2021-03-23T16:03:49.000Z
2021-09-15T09:38:20.000Z
#import <Flutter/Flutter.h> @interface IrSensorPlugin : NSObject<FlutterPlugin> @end
17.2
51
0.790698
ba1d52af75e0b1a22ed8624a5548bc60ea5f7760
397
h
C
game.h
FONQRI/Game_Tutorial
70fe27c31e79f46ac2e1ff93add7ca13c89be420
[ "MIT" ]
null
null
null
game.h
FONQRI/Game_Tutorial
70fe27c31e79f46ac2e1ff93add7ca13c89be420
[ "MIT" ]
null
null
null
game.h
FONQRI/Game_Tutorial
70fe27c31e79f46ac2e1ff93add7ca13c89be420
[ "MIT" ]
null
null
null
#ifndef GAME_H #define GAME_H #include<QWidget> #include <QGraphicsView> #include <QGraphicsScene> #include <QTimer> #include "enemy.h" #include "Score.h" #include "Helth.h" #include"Player.h" class Game:public QGraphicsView { public: Game(QWidget * parent=0); QGraphicsScene *scene; Player *player; Score *score; Helth *helth; int place[3]={5}; }; #endif // GAME_H
13.689655
31
0.677582
db82ebd4eae24aa34047d0f3c0e45611a271efbf
1,041
h
C
vespalib/src/vespa/vespalib/datastore/compact_buffer_candidates.h
Anlon-Burke/vespa
5ecd989b36cc61716bf68f032a3482bf01fab726
[ "Apache-2.0" ]
null
null
null
vespalib/src/vespa/vespalib/datastore/compact_buffer_candidates.h
Anlon-Burke/vespa
5ecd989b36cc61716bf68f032a3482bf01fab726
[ "Apache-2.0" ]
null
null
null
vespalib/src/vespa/vespalib/datastore/compact_buffer_candidates.h
Anlon-Burke/vespa
5ecd989b36cc61716bf68f032a3482bf01fab726
[ "Apache-2.0" ]
null
null
null
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "compact_buffer_candidate.h" #include <vector> namespace vespalib::datastore { /* * Class representing candidate buffers for compaction. */ class CompactBufferCandidates { std::vector<CompactBufferCandidate> _candidates; size_t _used; size_t _dead; uint32_t _max_buffers; double _active_buffers_ratio; double _ratio; size_t _slack; uint32_t _free_buffers; public: CompactBufferCandidates(uint32_t num_buffers, uint32_t max_buffers, double active_buffers_ratio, double ratio, size_t slack); ~CompactBufferCandidates(); void add(uint32_t buffer_id, size_t used, size_t dead); void set_free_buffers(uint32_t free_buffers); void select(std::vector<uint32_t>& buffers); }; }
33.580645
129
0.622478
b959c80fc63f59db890406767bc80da20954506c
1,206
c
C
Assignment-1/a1_5.c
sarannak/C_Code_3rd_Sem
765537ef4e6830ccfdbe3987189837b45c60bea4
[ "MIT" ]
null
null
null
Assignment-1/a1_5.c
sarannak/C_Code_3rd_Sem
765537ef4e6830ccfdbe3987189837b45c60bea4
[ "MIT" ]
null
null
null
Assignment-1/a1_5.c
sarannak/C_Code_3rd_Sem
765537ef4e6830ccfdbe3987189837b45c60bea4
[ "MIT" ]
null
null
null
/*C program display 3 tuple form of a sparse matrix*/ #include<stdio.h> #define row 50 #define col 50 int three_tuple(int[][col],int,int,int[][3]); //Fucntion Declaration int main() { int sparse[row][col],t[50][3],i,j,m,n,m1; printf("Enter no. of rows and cols of a sparse matrix:\n"); scanf("%d%d",&m,&n); printf("Enter elements of the sparse matrix:\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) { printf("a%d%d=",i+1,j+1); scanf("%d",&sparse[i][j]); //Input sparse matrix } } m1=three_tuple(sparse,m,n,t); //Fucntion call printf("\nDisplaying 3 tuple form:\n"); for(i=0;i<m1;i++) { for(j=0;j<3;j++) printf(" %d",t[i][j]); //Printing 3-tuple form printf("\n"); } printf("\n"); return 0; } //End of program int three_tuple(int sparse[][col],int m,int n,int t[][3]) //Fucntion Definition { int i,j,k=1; for(i=0;i<m;i++) { for(j=0;j<n;j++) { if(sparse[i][j]>0) { t[k][0]=i+1; t[k][1]=j+1; t[k][2]=sparse[i][j]; k++; } } } k=k-1; t[0][0]=i; t[0][1]=j; t[0][2]=k; return k+1; //returning no. of rows of 3 tuple form } //End of function
18.272727
81
0.515755
b37464f87403d4b7287ffe3444a9d0315568b05c
2,990
c
C
STM32F767IGT6/common/Func/SupportFunc/system_stm32f7xx.c
dinkdeng/STM32_IAR
8d9e8f780b78f6e7f9088e2b9cb7f8edd214020d
[ "MIT" ]
2
2018-04-06T05:15:53.000Z
2021-06-02T16:52:18.000Z
STM32F767IGT6/common/Func/SupportFunc/system_stm32f7xx.c
dinkdeng/STM32_IAR
8d9e8f780b78f6e7f9088e2b9cb7f8edd214020d
[ "MIT" ]
null
null
null
STM32F767IGT6/common/Func/SupportFunc/system_stm32f7xx.c
dinkdeng/STM32_IAR
8d9e8f780b78f6e7f9088e2b9cb7f8edd214020d
[ "MIT" ]
null
null
null
#include "stm32f7xx.h" /**设置系统晶振*/ #if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) #endif /* HSE_VALUE */ /**内置高速时钟定义 */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /**设置中断向量表的偏移*/ #define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ /**初始化的时候使用内部高速时钟,所以是16MHZ*/ uint32_t SystemCoreClock = 16000000; const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /**系统初始化*/ void SystemInit(void) { /**根据芯片配置决定是否使能FPU */ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ #endif /**打开系统低速时钟,其他状态恢复复位值 */ RCC->CR |= (uint32_t)0x00000001; /**初始化时钟配置寄存器 */ RCC->CFGR = 0x00000000; /**关闭HSE 时钟安全系统和PLL */ RCC->CR &= (uint32_t)0xFEF6FFFF; /**复位PLL的配置 */ RCC->PLLCFGR = 0x24003010; /**关闭时钟旁路 */ RCC->CR &= (uint32_t)0xFFFBFFFF; /**禁用全部的时钟安全中断 */ RCC->CIR = 0x00000000; /**根据宏定义配置,设置中断向量表的偏移 */ #ifdef VECT_TAB_SRAM SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #else SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ #endif } /**根据当前RCC寄存器的状态计算当前系统内核时钟,并更新那个时钟变量 */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; switch (tmp) { case 0x00: /* HSI used as system clock source */ SystemCoreClock = HSI_VALUE; break; case 0x04: /* HSE used as system clock source */ SystemCoreClock = HSE_VALUE; break; case 0x08: /* PLL used as system clock source */ /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; if (pllsource != 0) { /* HSE used as PLL clock source */ pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); } else { /* HSI used as PLL clock source */ pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); } pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; SystemCoreClock = pllvco/pllp; break; default: SystemCoreClock = HSI_VALUE; break; } /* Compute HCLK frequency --------------------------------------------------*/ /* Get HCLK prescaler */ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; /* HCLK frequency */ SystemCoreClock >>= tmp; }
28.75
92
0.562876
27b0966e0371667087aa3ca026fa8935335ec4e5
887
h
C
src/FrictionPairService.h
WienerTakesAll/WienerTakesAll
6accbf6f0ac04cf990134072474e71f2bc59e7d0
[ "Apache-2.0" ]
2
2018-01-07T02:26:22.000Z
2018-04-06T16:07:01.000Z
src/FrictionPairService.h
WienerTakesAll/WienerTakesAll
6accbf6f0ac04cf990134072474e71f2bc59e7d0
[ "Apache-2.0" ]
39
2018-01-12T00:21:12.000Z
2018-04-13T12:08:20.000Z
src/FrictionPairService.h
WienerTakesAll/WienerTakesAll
6accbf6f0ac04cf990134072474e71f2bc59e7d0
[ "Apache-2.0" ]
null
null
null
#pragma once #include <vector> #include "PxPhysicsAPI.h" // Gives the friction values between defined tire and surface types enum TireTypes { STANDARD = 0, NUM_TIRE_TYPES }; enum SurfaceTypes { TYPICAL = 0, NUM_SURFACE_TYPES }; // For use by PhysicsSystem class FrictionPairService { public: FrictionPairService(float standard_to_typical_friction, physx::PxMaterial* typical_material); ~FrictionPairService(); const physx::PxVehicleDrivableSurfaceToTireFrictionPairs& get_friction_pairs() const; void set_materials(physx::PxMaterial* typical_material); void set_friction_data(float standard_to_typical_friction); private: void initialize_friction_pairs(); std::vector<physx::PxMaterial*> surface_materials_; std::vector<std::vector<float>> friction_data_; physx::PxVehicleDrivableSurfaceToTireFrictionPairs* friction_pairs_; };
26.088235
97
0.771139
476d280eccb9d5063f51eaff57926fd4285782a8
1,356
h
C
platform/mcu/xr871/include/audio/manager/audio_manager.h
jinlongliu/AliOS-Things
ce051172a775f987183e7aca88bb6f3b809ea7b0
[ "Apache-2.0" ]
4
2019-11-22T04:28:29.000Z
2021-07-06T10:45:10.000Z
platform/mcu/xr871/include/audio/manager/audio_manager.h
IamBaoMouMou/AliOS-Things
195a9160b871b3d78de6f8cf6c2ab09a71977527
[ "Apache-2.0" ]
3
2018-12-17T13:06:46.000Z
2018-12-28T01:40:59.000Z
platform/mcu/xr871/include/audio/manager/audio_manager.h
IamBaoMouMou/AliOS-Things
195a9160b871b3d78de6f8cf6c2ab09a71977527
[ "Apache-2.0" ]
6
2019-08-30T09:43:03.000Z
2021-04-05T04:20:41.000Z
#ifndef AUDIO_MANAGER_H #define AUDIO_MANAGER_H #include "kernel/os/os_mutex.h" #include "driver/chip/hal_codec.h" #ifdef __cplusplus extern "C" { #endif #define MANAGER_MUTEX_INIT(a) OS_MutexCreate(a) #define MANAGER_MUTEX_LOCK(a) OS_MutexLock(a,OS_WAIT_FOREVER) #define MANAGER_MUTEX_UNLOCK(a) OS_MutexUnlock(a) #define MANAGER_NUTEX_DESTROY(a) OS_MutexDelete(a) #define MANAGER_MUTEX OS_Mutex_t typedef struct mgrctl mgrctl; struct mgrctl_ops { int (*volume)(mgrctl* m, uint32_t dev, uint8_t vol); int (*path)(mgrctl* m, uint32_t dev, uint8_t dev_en); int (*mute)(mgrctl* m, uint32_t dev, uint8_t mute); int (*eqscene)(mgrctl* m, uint8_t scene); }; struct mgrctl { struct mgrctl_ops* ops; }; typedef struct { mgrctl base; int8_t is_initialize; int8_t playback; int8_t record; uint16_t current_dev; /* bit mask of output devices */ MANAGER_MUTEX lock; } mgrctl_ctx; typedef enum { AUDIO_DEVICE_MANAGER_VOLUME = 0, AUDIO_DEVICE_MANAGER_PATH, AUDIO_DEVICE_MANAGER_MUTE, AUDIO_DEVICE_MANAGER_EQSCENE, AUDIO_DEVICE_MANAGER_NONE, } AudioManagerCommand; int aud_mgr_init(); int aud_mgr_deinit(); int aud_mgr_handler(AudioManagerCommand event, uint32_t dev, uint32_t param); int aud_mgr_maxvol(); mgrctl_ctx* aud_mgr_ctx(); #ifdef __cplusplus } #endif #endif
22.983051
77
0.736726
24bd794af06aba9c9b46974c5c8b535c01deb40b
359
h
C
src/ChaosConnectApp.h
chaoscircuit/chaosconnect
19774bba59a9b84d454057a2cda1c2e370b496b0
[ "BSD-3-Clause" ]
1
2021-11-09T23:45:29.000Z
2021-11-09T23:45:29.000Z
src/ChaosConnectApp.h
chaoscircuit/chaosconnect
19774bba59a9b84d454057a2cda1c2e370b496b0
[ "BSD-3-Clause" ]
null
null
null
src/ChaosConnectApp.h
chaoscircuit/chaosconnect
19774bba59a9b84d454057a2cda1c2e370b496b0
[ "BSD-3-Clause" ]
null
null
null
/** * \file ChaosConnectApp.h * \brief Main Application Header File */ #ifndef __CHAOSCONNECTFRMApp_h__ #define __CHAOSCONNECTFRMApp_h__ #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include <wx/wx.h> #else #include <wx/wxprec.h> #endif class ChaosConnectFrmApp : public wxApp { public: bool OnInit(); int OnExit(); }; #endif
13.296296
39
0.729805
2ae1f1737ce3cbcebf3d915403bef2f71ffcaf5c
1,069
c
C
src/bridge_ptr.c
hercules-ci/haskell-tree-sitter
dc635db99f0af0e62af321efc1ba20fa1e0cb14a
[ "BSD-3-Clause" ]
null
null
null
src/bridge_ptr.c
hercules-ci/haskell-tree-sitter
dc635db99f0af0e62af321efc1ba20fa1e0cb14a
[ "BSD-3-Clause" ]
null
null
null
src/bridge_ptr.c
hercules-ci/haskell-tree-sitter
dc635db99f0af0e62af321efc1ba20fa1e0cb14a
[ "BSD-3-Clause" ]
null
null
null
#include "tree_sitter/api.h" #include <assert.h> #include <stdio.h> #include <string.h> #include "tree_sitter_ptr.h" void debugPrintCurrentNode(tree_sitter_ptr *p) { TSNode n = ts_tree_cursor_current_node(&p->cursor); printf("type: %s \n", ts_node_type(n)); } void ts_ptr_init(TSTree *tree, tree_sitter_ptr *p) { assert(tree != NULL); TSNode rootNode = ts_tree_root_node(tree); assert(rootNode.id != NULL); p->rootNode = rootNode; } void ts_ptr_goto_first_child(tree_sitter_ptr *p) { p->cursor = ts_tree_cursor_new(p->rootNode); if (ts_tree_cursor_goto_first_child(&p->cursor)) { debugPrintCurrentNode(p); } } void ts_ptr_goto_next_sibling(tree_sitter_ptr *p) { if (ts_tree_cursor_goto_next_sibling(&p->cursor)) { debugPrintCurrentNode(p); } } const char *ts_ptr_current_type(tree_sitter_ptr *p) { TSNode n = ts_tree_cursor_current_node(&p->cursor); debugPrintCurrentNode(p); return ts_node_type(n); } void ts_ptr_free(tree_sitter_ptr *p) { ts_tree_cursor_delete(&p->cursor); }
21.38
55
0.702526
9a41ade7af3f89d649650b6600ceb694aab6cb6e
1,335
c
C
applets/meta/meta.c
hko-s/canokey-core
1742eb3ea6dbac4893b4c4039d19dba5d32accbf
[ "Apache-2.0" ]
null
null
null
applets/meta/meta.c
hko-s/canokey-core
1742eb3ea6dbac4893b4c4039d19dba5d32accbf
[ "Apache-2.0" ]
null
null
null
applets/meta/meta.c
hko-s/canokey-core
1742eb3ea6dbac4893b4c4039d19dba5d32accbf
[ "Apache-2.0" ]
null
null
null
// SPDX-License-Identifier: Apache-2.0 #include <common.h> #include <meta.h> #define TAG_USB_SUPPORT 0x01 #define TAG_SN 0x02 #define TAG_USB_ENABLED 0x03 #define TAG_FORM_FACTOR 0x04 #define TAG_NFC_SUPPORT 0x0D #define TAG_NFC_ENABLED 0x0E int meta_process_apdu(const CAPDU *capdu, RAPDU *rapdu) { LL = 0; SW = SW_NO_ERROR; switch (INS) { case META_INS_SELECT: if (P1 != 0x04 || P2 != 0x00) EXCEPT(SW_WRONG_P1P2); memcpy(RDATA, "5.5.5", 5); // a fake version LL = 5; break; case META_INS_READ_META: if (P1 != 0x00 || P2 != 0x00) EXCEPT(SW_WRONG_P1P2); RDATA[0] = 25; RDATA[1] = TAG_USB_SUPPORT; // FIDO2|OATH|PIV|OPENPGP|U2F RDATA[2] = 2; RDATA[3] = 0x02; RDATA[4] = 0x3A; RDATA[5] = TAG_SN; RDATA[6] = 4; fill_sn(RDATA + 7); RDATA[11] = TAG_FORM_FACTOR; RDATA[12] = 1; RDATA[13] = 0x41; RDATA[14] = TAG_USB_ENABLED; // FIDO2|OATH|PIV|OPENPGP|U2F RDATA[15] = 2; RDATA[16] = 0x02; RDATA[17] = 0x3A; RDATA[18] = TAG_NFC_SUPPORT; // FIDO2|OATH|PIV|OPENPGP|U2F RDATA[19] = 2; RDATA[20] = 0x02; RDATA[21] = 0x3A; RDATA[22] = TAG_NFC_ENABLED; // FIDO2|OATH|PIV|OPENPGP|U2F RDATA[23] = 2; RDATA[24] = 0x02; RDATA[25] = 0x3A; LL = 26; break; default: EXCEPT(SW_INS_NOT_SUPPORTED); } return 0; }
23.839286
62
0.621723
00fbd971fdfa2c791213cafc14444ced6393f623
603
h
C
wfuikit/WFChatUIKit/Vendor/ChatInputBar/WFCULocationViewController.h
52im/ios-chat
7863a445d566618fa0971143a6a2031298c1ac3e
[ "MIT" ]
5
2019-10-09T10:15:09.000Z
2020-06-12T04:13:52.000Z
iOSWildfireChatUICommon/Classes/Vendor/ChatInputBar/WFCULocationViewController.h
lengqingfeng/iOSWildfireChatUICommon
6da312602878f6de19931109bacb5ee7da1f7d64
[ "MIT" ]
null
null
null
iOSWildfireChatUICommon/Classes/Vendor/ChatInputBar/WFCULocationViewController.h
lengqingfeng/iOSWildfireChatUICommon
6da312602878f6de19931109bacb5ee7da1f7d64
[ "MIT" ]
4
2019-10-09T10:15:15.000Z
2020-06-12T04:24:20.000Z
// // LocationViewController.h // WFChat UIKit // // Created by WF Chat on 2017/10/28. // Copyright © 2017年 WildFireChat. All rights reserved. // #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @class WFCULocationPoint; @protocol LocationViewControllerDelegate <NSObject> - (void)onSendLocation:(WFCULocationPoint *)locationPoint; @end @interface WFCULocationViewController : UIViewController<MKMapViewDelegate> //选择地理位置 - (instancetype)initWithDelegate:(id<LocationViewControllerDelegate>)delegate; //显示地理位置 - (instancetype)initWithLocationPoint:(WFCULocationPoint *)locationPoint; @end
20.793103
78
0.781095
13dd89dce6bffbfa6f03119fee6ef1b1c6c01f47
595
h
C
HappyAmoy/Classes/Mine/View/MineFirstSectionCell.h
ClickGetBonus/HappyAmoy
3b6b1223de806c57374bf3038f3af9675cdb1021
[ "MIT" ]
1
2019-07-16T10:38:35.000Z
2019-07-16T10:38:35.000Z
HappyAmoy/Classes/Mine/View/MineFirstSectionCell.h
ClickGetBonus/HappyAmoy
3b6b1223de806c57374bf3038f3af9675cdb1021
[ "MIT" ]
null
null
null
HappyAmoy/Classes/Mine/View/MineFirstSectionCell.h
ClickGetBonus/HappyAmoy
3b6b1223de806c57374bf3038f3af9675cdb1021
[ "MIT" ]
null
null
null
// // MineFirstSectionCell.h // HappyAmoy // // Created by apple on 2018/7/20. // Copyright © 2018年 apple. All rights reserved. // #import <UIKit/UIKit.h> @class MineFirstSectionCell; @protocol MineFirstSectionCellDelegate <NSObject> @optional - (void)mineFirstSectionCell:(MineFirstSectionCell *)mineFirstSectionCell didSelectItemAtIndex:(NSInteger)index; @end @interface MineFirstSectionCell : UITableViewCell /** 代理 */ @property (weak, nonatomic) id<MineFirstSectionCellDelegate> delegate; /** 余额数组 */ @property (strong, nonatomic) NSMutableArray *balanceArray; @end
20.517241
112
0.747899
785d820ce5e251e064d5a701a86e776c33629ada
364
h
C
kongxia/Views/Message/chat/chatcell/ZZChatRealTimeStartCell.h
zuwome/kongxia
87f6f33410da1fedd315089c9a92917b5226125d
[ "MIT" ]
null
null
null
kongxia/Views/Message/chat/chatcell/ZZChatRealTimeStartCell.h
zuwome/kongxia
87f6f33410da1fedd315089c9a92917b5226125d
[ "MIT" ]
1
2022-01-08T05:58:03.000Z
2022-01-08T05:58:03.000Z
kongxia/Views/Message/chat/chatcell/ZZChatRealTimeStartCell.h
zuwome/kongxia
87f6f33410da1fedd315089c9a92917b5226125d
[ "MIT" ]
null
null
null
// // ZZChatRealTimeStartCell.h // zuwome // // Created by angBiu on 2016/11/17. // Copyright © 2016年 zz. All rights reserved. // #import "ZZChatBaseCell.h" /** * 聊天 ---- 实时定位 开始cell */ @interface ZZChatRealTimeStartCell : ZZChatBaseCell @property (nonatomic, strong) UIImageView *locationImgView; @property (nonatomic, strong) UILabel *titleLabel; @end
19.157895
59
0.711538
4f1c21d486b87b0336c848e95dd668bfa74a09d1
198
h
C
karman-application/inc/radio/radioTask.h
AIAANortheastern/karman-ARM-avionics
fd82b5a5567189558d1f1552f62161ad45a17cb6
[ "MIT" ]
null
null
null
karman-application/inc/radio/radioTask.h
AIAANortheastern/karman-ARM-avionics
fd82b5a5567189558d1f1552f62161ad45a17cb6
[ "MIT" ]
null
null
null
karman-application/inc/radio/radioTask.h
AIAANortheastern/karman-ARM-avionics
fd82b5a5567189558d1f1552f62161ad45a17cb6
[ "MIT" ]
1
2018-10-11T00:27:52.000Z
2018-10-11T00:27:52.000Z
/* * radioTask.h * * Created on: Feb 8, 2018 * Author: Andrew Kaster */ #ifndef INC_RADIO_RADIOTASK_H_ #define INC_RADIO_RADIOTASK_H_ #endif /* INC_RADIO_RADIOTASK_H_ */
14.142857
36
0.646465
1a1f0515c410812a4aba6916dfed2a431589cb52
177
h
C
Source/States/StatePause.h
messier12/hoecard
188196ea3b08067c8a2b5aab8c3ac550b568e75c
[ "MIT" ]
null
null
null
Source/States/StatePause.h
messier12/hoecard
188196ea3b08067c8a2b5aab8c3ac550b568e75c
[ "MIT" ]
null
null
null
Source/States/StatePause.h
messier12/hoecard
188196ea3b08067c8a2b5aab8c3ac550b568e75c
[ "MIT" ]
null
null
null
// // Created by dion on 14/12/2020. // #ifndef SFML_FRAMEWORK_STATEPAUSE_H #define SFML_FRAMEWORK_STATEPAUSE_H class StatePause { }; #endif //SFML_FRAMEWORK_STATEPAUSE_H
11.8
36
0.768362
1a5001c4b23c2dd062745331d357d3b627c0d017
1,025
h
C
Pod/selectPhoto/helper/LNPhotoSelectManager.h
LenaMay/LNSelectPhotos
592985ea1cbe693a4afaf5152b52457b72ee3e83
[ "MIT" ]
null
null
null
Pod/selectPhoto/helper/LNPhotoSelectManager.h
LenaMay/LNSelectPhotos
592985ea1cbe693a4afaf5152b52457b72ee3e83
[ "MIT" ]
null
null
null
Pod/selectPhoto/helper/LNPhotoSelectManager.h
LenaMay/LNSelectPhotos
592985ea1cbe693a4afaf5152b52457b72ee3e83
[ "MIT" ]
null
null
null
// // LNPhotoSelectManager.h // selectPhotos // // Created by Lina on 2018/5/31. // Copyright © 2018年 Lina. All rights reserved. // #import <Foundation/Foundation.h> #import "LNPhotoModel.h" typedef void (^photoArrBlock)(NSArray *selectPhotoArray); typedef void (^photCamaraBlock)(UIImage *image); @interface LNPhotoSelectManager : NSObject //数组内为LNPhotoModel对象包含三个参数:photoIdentifier 照片id photoAsset照片信息 albumIdentifier照片ID @property (nonatomic, strong) NSArray *selectPhotoArray; @property (nonatomic, assign) NSInteger selectCount; @property (nonatomic, assign)NSInteger maxCount; @property (nonatomic, assign)BOOL isOnly; @property (nonatomic, assign)BOOL isCanEdit; @property (nonatomic, assign)BOOL isCanPreView; @property (nonatomic, assign)NSInteger type; @property(nonatomic,copy) photoArrBlock selectPhotosBlock; /** 获取单例对象 PhotoManager */ + (instancetype)sharedManager; - (LNPhotoModel *)modelWithPhotoIdentifier:(NSString *)photoIdentifier; //所有数据置空 每一次 调用相册都要将其置空 - (void)clear; @end
27.702703
88
0.771707
9eadbf9a678c84e9c9fa4b4788ae59f480a27dd1
4,961
c
C
crypto/rand/rand_err.c
nmathewson/openssl
fd2941c8bded64d80e4953c718e675052dac32cb
[ "OpenSSL" ]
null
null
null
crypto/rand/rand_err.c
nmathewson/openssl
fd2941c8bded64d80e4953c718e675052dac32cb
[ "OpenSSL" ]
null
null
null
crypto/rand/rand_err.c
nmathewson/openssl
fd2941c8bded64d80e4953c718e675052dac32cb
[ "OpenSSL" ]
1
2018-12-27T05:40:27.000Z
2018-12-27T05:40:27.000Z
/* * Generated by util/mkerr.pl DO NOT EDIT * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/err.h> #include <openssl/randerr.h> #ifndef OPENSSL_NO_ERR static const ERR_STRING_DATA RAND_str_functs[] = { {ERR_PACK(ERR_LIB_RAND, RAND_F_DRBG_BYTES, 0), "drbg_bytes"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_DRBG_GET_ENTROPY, 0), "drbg_get_entropy"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_DRBG_SETUP, 0), "drbg_setup"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_GET_ENTROPY, 0), "get_entropy"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_BYTES, 0), "RAND_bytes"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_GENERATE, 0), "RAND_DRBG_generate"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_INSTANTIATE, 0), "RAND_DRBG_instantiate"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_NEW, 0), "RAND_DRBG_new"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_RESEED, 0), "RAND_DRBG_reseed"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_RESTART, 0), "rand_drbg_restart"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_SET, 0), "RAND_DRBG_set"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_DRBG_UNINSTANTIATE, 0), "RAND_DRBG_uninstantiate"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_LOAD_FILE, 0), "RAND_load_file"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_ADD, 0), "RAND_POOL_add"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_ADD_BEGIN, 0), "RAND_POOL_add_begin"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_ADD_END, 0), "RAND_POOL_add_end"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_BYTES_NEEDED, 0), "RAND_POOL_bytes_needed"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_POOL_NEW, 0), "RAND_POOL_new"}, {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_WRITE_FILE, 0), "RAND_write_file"}, {0, NULL} }; static const ERR_STRING_DATA RAND_str_reasons[] = { {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ADDITIONAL_INPUT_TOO_LONG), "additional input too long"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ALREADY_INSTANTIATED), "already instantiated"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ARGUMENT_OUT_OF_RANGE), "argument out of range"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_CANNOT_OPEN_FILE), "Cannot open file"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_DRBG_NOT_INITIALISED), "drbg not initialised"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ENTROPY_INPUT_TOO_LONG), "entropy input too long"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ENTROPY_OUT_OF_RANGE), "entropy out of range"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED), "error entropy pool was ignored"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_INITIALISING_DRBG), "error initialising drbg"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_INSTANTIATING_DRBG), "error instantiating drbg"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT), "error retrieving additional input"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_ENTROPY), "error retrieving entropy"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_NONCE), "error retrieving nonce"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FAILED_TO_CREATE_LOCK), "failed to create lock"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FUNC_NOT_IMPLEMENTED), "Function not implemented"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FWRITE_ERROR), "Error writing file"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_GENERATE_ERROR), "generate error"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_INTERNAL_ERROR), "internal error"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_IN_ERROR_STATE), "in error state"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_A_REGULAR_FILE), "Not a regular file"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_INSTANTIATED), "not instantiated"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED), "no drbg implementation selected"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PERSONALISATION_STRING_TOO_LONG), "personalisation string too long"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PRNG_NOT_SEEDED), "PRNG not seeded"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RANDOM_POOL_OVERFLOW), "random pool overflow"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG), "request too large for drbg"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RESEED_ERROR), "reseed error"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_SELFTEST_FAILURE), "selftest failure"}, {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNSUPPORTED_DRBG_TYPE), "unsupported drbg type"}, {0, NULL} }; #endif int ERR_load_RAND_strings(void) { #ifndef OPENSSL_NO_ERR if (ERR_func_error_string(RAND_str_functs[0].error) == NULL) { ERR_load_strings_const(RAND_str_functs); ERR_load_strings_const(RAND_str_reasons); } #endif return 1; }
45.513761
79
0.743802
36a47437f97420c0c7be3e87edd810903ed05045
1,369
h
C
drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.h
fergy/aplit_linux-5
a6ef4cb0e17e1eec9743c064e65f730c49765711
[ "MIT" ]
31
2021-04-27T08:50:40.000Z
2022-03-01T02:26:21.000Z
drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.h
fergy/aplit_linux-5
a6ef4cb0e17e1eec9743c064e65f730c49765711
[ "MIT" ]
13
2021-07-10T04:36:17.000Z
2022-03-03T10:50:05.000Z
drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.h
fergy/aplit_linux-5
a6ef4cb0e17e1eec9743c064e65f730c49765711
[ "MIT" ]
12
2021-04-06T02:23:10.000Z
2022-02-28T11:43:19.000Z
/* SPDX-License-Identifier: GPL-2.0 */ /****************************************************************************** * * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ #ifndef __INC_MP_RF_HW_IMG_8723B_H #define __INC_MP_RF_HW_IMG_8723B_H /****************************************************************************** * RadioA.TXT ******************************************************************************/ void ODM_ReadAndConfig_MP_8723B_RadioA(/* TC: Test Chip, MP: MP Chip */ PDM_ODM_T pDM_Odm ); /****************************************************************************** * TxPowerTrack_SDIO.TXT ******************************************************************************/ void ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO(/* TC: Test Chip, MP: MP Chip */ PDM_ODM_T pDM_Odm ); u32 ODM_GetVersion_MP_8723B_TxPowerTrack_SDIO(void); /****************************************************************************** * TXPWR_LMT.TXT ******************************************************************************/ void ODM_ReadAndConfig_MP_8723B_TXPWR_LMT(/* TC: Test Chip, MP: MP Chip */ PDM_ODM_T pDM_Odm ); u32 ODM_GetVersion_MP_8723B_TXPWR_LMT(void); #endif
32.595238
79
0.368152
d2124bdcb93380b882a63fcc5c836c7312089a46
17,330
h
C
Cores/snes9x/PVSNES/SNES/SNESCore/fxinst.h
werminghoff/Provenance
de61b4a64a3eb8e2774e0a8ed53488c6c7aa6cb2
[ "BSD-3-Clause" ]
2
2021-02-04T22:41:57.000Z
2021-03-27T07:28:02.000Z
Cores/snes9x/PVSNES/SNES/SNESCore/fxinst.h
werminghoff/Provenance
de61b4a64a3eb8e2774e0a8ed53488c6c7aa6cb2
[ "BSD-3-Clause" ]
null
null
null
Cores/snes9x/PVSNES/SNES/SNESCore/fxinst.h
werminghoff/Provenance
de61b4a64a3eb8e2774e0a8ed53488c6c7aa6cb2
[ "BSD-3-Clause" ]
3
2019-02-19T12:55:12.000Z
2019-05-30T08:33:23.000Z
/*********************************************************************************** Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com), Jerremy Koot (jkoot@snes9x.com) (c) Copyright 2002 - 2004 Matthew Kendora (c) Copyright 2002 - 2005 Peter Bortas (peter@bortas.org) (c) Copyright 2004 - 2005 Joel Yliluoma (http://iki.fi/bisqwit/) (c) Copyright 2001 - 2006 John Weidman (jweidman@slip.net) (c) Copyright 2002 - 2006 funkyass (funkyass@spam.shaw.ca), Kris Bleakley (codeviolation@hotmail.com) (c) Copyright 2002 - 2010 Brad Jorsch (anomie@users.sourceforge.net), Nach (n-a-c-h@users.sourceforge.net), (c) Copyright 2002 - 2011 zones (kasumitokoduck@yahoo.com) (c) Copyright 2006 - 2007 nitsuja (c) Copyright 2009 - 2018 BearOso, OV2 (c) Copyright 2017 qwertymodo (c) Copyright 2011 - 2017 Hans-Kristian Arntzen, Daniel De Matteis (Under no circumstances will commercial rights be given) BS-X C emulator code (c) Copyright 2005 - 2006 Dreamer Nom, zones C4 x86 assembler and some C emulation code (c) Copyright 2000 - 2003 _Demo_ (_demo_@zsnes.com), Nach, zsKnight (zsknight@zsnes.com) C4 C++ code (c) Copyright 2003 - 2006 Brad Jorsch, Nach DSP-1 emulator code (c) Copyright 1998 - 2006 _Demo_, Andreas Naive (andreasnaive@gmail.com), Gary Henderson, Ivar (ivar@snes9x.com), John Weidman, Kris Bleakley, Matthew Kendora, Nach, neviksti (neviksti@hotmail.com) DSP-2 emulator code (c) Copyright 2003 John Weidman, Kris Bleakley, Lord Nightmare (lord_nightmare@users.sourceforge.net), Matthew Kendora, neviksti DSP-3 emulator code (c) Copyright 2003 - 2006 John Weidman, Kris Bleakley, Lancer, z80 gaiden DSP-4 emulator code (c) Copyright 2004 - 2006 Dreamer Nom, John Weidman, Kris Bleakley, Nach, z80 gaiden OBC1 emulator code (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com), Kris Bleakley Ported from x86 assembler to C by sanmaiwashi SPC7110 and RTC C++ emulator code used in 1.39-1.51 (c) Copyright 2002 Matthew Kendora with research by zsKnight, John Weidman, Dark Force SPC7110 and RTC C++ emulator code used in 1.52+ (c) Copyright 2009 byuu, neviksti S-DD1 C emulator code (c) Copyright 2003 Brad Jorsch with research by Andreas Naive, John Weidman S-RTC C emulator code (c) Copyright 2001 - 2006 byuu, John Weidman ST010 C++ emulator code (c) Copyright 2003 Feather, John Weidman, Kris Bleakley, Matthew Kendora Super FX x86 assembler emulator code (c) Copyright 1998 - 2003 _Demo_, pagefault, zsKnight Super FX C emulator code (c) Copyright 1997 - 1999 Ivar, Gary Henderson, John Weidman Sound emulator code used in 1.5-1.51 (c) Copyright 1998 - 2003 Brad Martin (c) Copyright 1998 - 2006 Charles Bilyue' Sound emulator code used in 1.52+ (c) Copyright 2004 - 2007 Shay Green (gblargg@gmail.com) S-SMP emulator code used in 1.54+ (c) Copyright 2016 byuu SH assembler code partly based on x86 assembler code (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) 2xSaI filter (c) Copyright 1999 - 2001 Derek Liauw Kie Fa HQ2x, HQ3x, HQ4x filters (c) Copyright 2003 Maxim Stepin (maxim@hiend3d.com) NTSC filter (c) Copyright 2006 - 2007 Shay Green GTK+ GUI code (c) Copyright 2004 - 2018 BearOso Win32 GUI code (c) Copyright 2003 - 2006 blip, funkyass, Matthew Kendora, Nach, nitsuja (c) Copyright 2009 - 2018 OV2 Mac OS GUI code (c) Copyright 1998 - 2001 John Stiles (c) Copyright 2001 - 2011 zones Libretro port (c) Copyright 2011 - 2017 Hans-Kristian Arntzen, Daniel De Matteis (Under no circumstances will commercial rights be given) Specific ports contains the works of other authors. See headers in individual files. Snes9x homepage: http://www.snes9x.com/ Permission to use, copy, modify and/or distribute Snes9x in both binary and source form, for non-commercial purposes, is hereby granted without fee, providing that this license information and copyright notice appear with all copies and any derived work. This software is provided 'as-is', without any express or implied warranty. In no event shall the authors be held liable for any damages arising from the use of this software or it's derivatives. Snes9x is freeware for PERSONAL USE only. Commercial users should seek permission of the copyright holders first. Commercial use includes, but is not limited to, charging money for Snes9x or software derived from Snes9x, including Snes9x or derivatives in commercial game bundles, and/or using Snes9x as a promotion for your commercial product. The copyright holders request that bug fixes and improvements to the code should be forwarded to them so everyone can benefit from the modifications in future versions. Super NES and Super Nintendo Entertainment System are trademarks of Nintendo Co., Limited and its subsidiary companies. ***********************************************************************************/ #ifndef _FXINST_H_ #define _FXINST_H_ /* * FxChip(GSU) register space specification * (Register address space 3000-32ff) * * The 16 generic 16 bit registers: * (Some have a special function in special circumstances) * 3000 - R0 default source/destination register * 3002 - R1 pixel plot X position register * 3004 - R2 pixel plot Y position register * 3006 - R3 * 3008 - R4 lower 16 bit result of lmult * 300a - R5 * 300c - R6 multiplier for fmult and lmult * 300e - R7 fixed point texel X position for merge * 3010 - R8 fixed point texel Y position for merge * 3012 - R9 * 3014 - R10 * 3016 - R11 return address set by link * 3018 - R12 loop counter * 301a - R13 loop point address * 301c - R14 rom address for getb, getbh, getbl, getbs * 301e - R15 program counter * * 3020-302f - unused * * Other internal registers * 3030 - SFR status flag register (16bit) * 3032 - unused * 3033 - BRAMR Backup RAM register (8bit) * 3034 - PBR program bank register (8bit) * 3035 - unused * 3036 - ROMBR rom bank register (8bit) * 3037 - CFGR control flags register (8bit) * 3038 - SCBR screen base register (8bit) * 3039 - CLSR clock speed register (8bit) * 303a - SCMR screen mode register (8bit) * 303b - VCR version code register (8bit) (read only) * 303c - RAMBR ram bank register (8bit) * 303d - unused * 303e - CBR cache base register (16bit) * * 3040-30ff - unused * * 3100-32ff - CACHERAM 512 bytes of GSU cache memory * * SFR status flag register bits: * 0 - * 1 Z Zero flag * 2 CY Carry flag * 3 S Sign flag * 4 OV Overflow flag * 5 G Go flag (set to 1 when the GSU is running) * 6 R Set to 1 when reading ROM using R14 address * 7 - * 8 ALT1 Mode set-up flag for the next instruction * 9 ALT2 Mode set-up flag for the next instruction * 10 IL Immediate lower 8-bit flag * 11 IH Immediate higher 8-bit flag * 12 B Set to 1 when the WITH instruction is executed * 13 - * 14 - * 15 IRQ Set to 1 when GSU caused an interrupt * Set to 0 when read by 658c16 * * BRAMR = 0, BackupRAM is disabled * BRAMR = 1, BackupRAM is enabled * * CFGR control flags register bits: * 0 - * 1 - * 2 - * 3 - * 4 - * 5 MS0 Multiplier speed, 0=standard, 1=high speed * 6 - * 7 IRQ Set to 1 when GSU interrupt request is masked * * CLSR clock speed register bits: * 0 CLSR clock speed, 0 = 10.7Mhz, 1 = 21.4Mhz * * SCMR screen mode register bits: * 0 MD0 color depth mode bit 0 * 1 MD1 color depth mode bit 1 * 2 HT0 screen height bit 1 * 3 RAN RAM access control * 4 RON ROM access control * 5 HT1 screen height bit 2 * 6 - * 7 - * * RON = 0 SNES CPU has ROM access * RON = 1 GSU has ROM access * * RAN = 0 SNES has game pak RAM access * RAN = 1 GSU has game pak RAM access * * HT1 HT0 Screen height mode * 0 0 128 pixels high * 0 1 160 pixels high * 1 0 192 pixels high * 1 1 OBJ mode * * MD1 MD0 Color depth mode * 0 0 4 color mode * 0 1 16 color mode * 1 0 not used * 1 1 256 color mode * * CBR cache base register bits: * 15-4 Specify base address for data to cache from ROM or RAM * 3-0 Are 0 when address is read * * Write access to the program counter (301e) from * the SNES-CPU will start the GSU, and it will not * stop until it reaches a stop instruction. * */ // Number of banks in GSU RAM #define FX_RAM_BANKS 4 // Emulate proper R14 ROM access (slower, but safer) #define FX_DO_ROMBUFFER // Address checking (definately slow) //#define FX_ADDRESS_CHECK struct FxRegs_s { // FxChip registers uint32 avReg[16]; // 16 Generic registers uint32 vColorReg; // Internal color register uint32 vPlotOptionReg; // Plot option register uint32 vStatusReg; // Status register uint32 vPrgBankReg; // Program bank index register uint32 vRomBankReg; // Rom bank index register uint32 vRamBankReg; // Ram bank index register uint32 vCacheBaseReg; // Cache base address register uint32 vCacheFlags; // Saying what parts of the cache was written to uint32 vLastRamAdr; // Last RAM address accessed uint32 *pvDreg; // Pointer to current destination register uint32 *pvSreg; // Pointer to current source register uint8 vRomBuffer; // Current byte read by R14 uint8 vPipe; // Instructionset pipe uint32 vPipeAdr; // The address of where the pipe was read from // Status register optimization stuff uint32 vSign; // v & 0x8000 uint32 vZero; // v == 0 uint32 vCarry; // a value of 1 or 0 int32 vOverflow; // (v >= 0x8000 || v < -0x8000) // Other emulator variables int32 vErrorCode; uint32 vIllegalAddress; uint8 bBreakPoint; uint32 vBreakPoint; uint32 vStepPoint; uint8 *pvRegisters; // 768 bytes located in the memory at address 0x3000 uint32 nRamBanks; // Number of 64kb-banks in FxRam (Don't confuse it with SNES-Ram!!!) uint8 *pvRam; // Pointer to FxRam uint32 nRomBanks; // Number of 32kb-banks in Cart-ROM uint8 *pvRom; // Pointer to Cart-ROM uint32 vMode; // Color depth/mode uint32 vPrevMode; // Previous depth uint8 *pvScreenBase; uint8 *apvScreen[32]; // Pointer to each of the 32 screen colums int32 x[32]; uint32 vScreenHeight; // 128, 160, 192 or 256 (could be overriden by cmode) uint32 vScreenRealHeight; // 128, 160, 192 or 256 uint32 vPrevScreenHeight; uint32 vScreenSize; void (*pfPlot) (void); void (*pfRpix) (void); uint8 *pvRamBank; // Pointer to current RAM-bank uint8 *pvRomBank; // Pointer to current ROM-bank uint8 *pvPrgBank; // Pointer to current program ROM-bank uint8 *apvRamBank[FX_RAM_BANKS]; // Ram bank table (max 256kb) uint8 *apvRomBank[256]; // Rom bank table uint8 bCacheActive; uint8 *pvCache; // Pointer to the GSU cache uint8 avCacheBackup[512]; // Backup of ROM when the cache has replaced it uint32 vCounter; uint32 vInstCount; uint32 vSCBRDirty; // If SCBR is written, our cached screen pointers need updating uint8 *avRegAddr; // To reference avReg in snapshot.cpp }; extern struct FxRegs_s GSU; // GSU registers #define GSU_R0 0x000 #define GSU_R1 0x002 #define GSU_R2 0x004 #define GSU_R3 0x006 #define GSU_R4 0x008 #define GSU_R5 0x00a #define GSU_R6 0x00c #define GSU_R7 0x00e #define GSU_R8 0x010 #define GSU_R9 0x012 #define GSU_R10 0x014 #define GSU_R11 0x016 #define GSU_R12 0x018 #define GSU_R13 0x01a #define GSU_R14 0x01c #define GSU_R15 0x01e #define GSU_SFR 0x030 #define GSU_BRAMR 0x033 #define GSU_PBR 0x034 #define GSU_ROMBR 0x036 #define GSU_CFGR 0x037 #define GSU_SCBR 0x038 #define GSU_CLSR 0x039 #define GSU_SCMR 0x03a #define GSU_VCR 0x03b #define GSU_RAMBR 0x03c #define GSU_CBR 0x03e #define GSU_CACHERAM 0x100 // SFR flags #define FLG_Z (1 << 1) #define FLG_CY (1 << 2) #define FLG_S (1 << 3) #define FLG_OV (1 << 4) #define FLG_G (1 << 5) #define FLG_R (1 << 6) #define FLG_ALT1 (1 << 8) #define FLG_ALT2 (1 << 9) #define FLG_IL (1 << 10) #define FLG_IH (1 << 11) #define FLG_B (1 << 12) #define FLG_IRQ (1 << 15) // Test flag #define TF(a) (GSU.vStatusReg & FLG_##a) #define CF(a) (GSU.vStatusReg &= ~FLG_##a) #define SF(a) (GSU.vStatusReg |= FLG_##a) // Test and set flag if condition, clear if not #define TS(a, b) GSU.vStatusReg = ((GSU.vStatusReg & (~FLG_##a)) | ((!!(##b)) * FLG_##a)) // Testing ALT1 & ALT2 bits #define ALT0 (!TF(ALT1) && !TF(ALT2)) #define ALT1 ( TF(ALT1) && !TF(ALT2)) #define ALT2 (!TF(ALT1) && TF(ALT2)) #define ALT3 ( TF(ALT1) && TF(ALT2)) // Sign extend from 8/16 bit to 32 bit #define SEX8(a) ((int32) ((int8) (a))) #define SEX16(a) ((int32) ((int16) (a))) // Unsign extend from 8/16 bit to 32 bit #define USEX8(a) ((uint32) ((uint8) (a))) #define USEX16(a) ((uint32) ((uint16) (a))) #define SUSEX16(a) ((int32) ((uint16) (a))) // Set/Clr Sign and Zero flag #define TSZ(num) TS(S, ((num) & 0x8000)); TS(Z, (!USEX16(num))) // Clear flags #define CLRFLAGS GSU.vStatusReg &= ~(FLG_ALT1 | FLG_ALT2 | FLG_B); GSU.pvDreg = GSU.pvSreg = &R0 // Read current RAM-Bank #define RAM(adr) GSU.pvRamBank[USEX16(adr)] // Read current ROM-Bank #define ROM(idx) GSU.pvRomBank[USEX16(idx)] // Access the current value in the pipe #define PIPE GSU.vPipe // Access data in the current program bank #define PRGBANK(idx) GSU.pvPrgBank[USEX16(idx)] // Update pipe from ROM #if 0 #define FETCHPIPE { PIPE = PRGBANK(R15); GSU.vPipeAdr = (GSU.vPrgBankReg << 16) + R15; } #else #define FETCHPIPE { PIPE = PRGBANK(R15); } #endif // ABS #define ABS(x) ((x) < 0 ? -(x) : (x)) // Access source register #define SREG (*GSU.pvSreg) // Access destination register #define DREG (*GSU.pvDreg) #ifndef FX_DO_ROMBUFFER // Don't read R14 #define READR14 // Don't test and/or read R14 #define TESTR14 #else // Read R14 #define READR14 GSU.vRomBuffer = ROM(R14) // Test and/or read R14 #define TESTR14 if (GSU.pvDreg == &R14) READR14 #endif // Access to registers #define R0 GSU.avReg[0] #define R1 GSU.avReg[1] #define R2 GSU.avReg[2] #define R3 GSU.avReg[3] #define R4 GSU.avReg[4] #define R5 GSU.avReg[5] #define R6 GSU.avReg[6] #define R7 GSU.avReg[7] #define R8 GSU.avReg[8] #define R9 GSU.avReg[9] #define R10 GSU.avReg[10] #define R11 GSU.avReg[11] #define R12 GSU.avReg[12] #define R13 GSU.avReg[13] #define R14 GSU.avReg[14] #define R15 GSU.avReg[15] #define SFR GSU.vStatusReg #define PBR GSU.vPrgBankReg #define ROMBR GSU.vRomBankReg #define RAMBR GSU.vRamBankReg #define CBR GSU.vCacheBaseReg #define SCBR USEX8(GSU.pvRegisters[GSU_SCBR]) #define SCMR USEX8(GSU.pvRegisters[GSU_SCMR]) #define COLR GSU.vColorReg #define POR GSU.vPlotOptionReg #define BRAMR USEX8(GSU.pvRegisters[GSU_BRAMR]) #define VCR USEX8(GSU.pvRegisters[GSU_VCR]) #define CFGR USEX8(GSU.pvRegisters[GSU_CFGR]) #define CLSR USEX8(GSU.pvRegisters[GSU_CLSR]) // Execute instruction from the pipe, and fetch next byte to the pipe #define FX_STEP \ { \ uint32 vOpcode = (uint32) PIPE; \ FETCHPIPE; \ (*fx_OpcodeTable[(GSU.vStatusReg & 0x300) | vOpcode])(); \ } extern void (*fx_PlotTable[]) (void); extern void (*fx_OpcodeTable[]) (void); // Set this define if branches are relative to the instruction in the delay slot (I think they are) #define BRANCH_DELAY_RELATIVE #endif
31.057348
99
0.6176
aafc3eca59c5799ccb3a788855411b7d6d718b3f
2,553
h
C
Dump/WBP_TopNavButton_classes.h
patrickcjk/RogueCompanyDump
fc83446500e8713f12e9f6a95cfa07f756a6b5c3
[ "MIT" ]
null
null
null
Dump/WBP_TopNavButton_classes.h
patrickcjk/RogueCompanyDump
fc83446500e8713f12e9f6a95cfa07f756a6b5c3
[ "MIT" ]
null
null
null
Dump/WBP_TopNavButton_classes.h
patrickcjk/RogueCompanyDump
fc83446500e8713f12e9f6a95cfa07f756a6b5c3
[ "MIT" ]
1
2021-02-25T00:48:25.000Z
2021-02-25T00:48:25.000Z
// WidgetBlueprintGeneratedClass WBP_TopNavButton.WBP_TopNavButton_C // Size: 0x570 (Inherited: 0x4e0) struct UWBP_TopNavButton_C : public UKSWidget { struct FPointerToUberGraphFrame UberGraphFrame; // 0x4e0(0x08) struct UCanvasPanel* NewIndicator; // 0x4e8(0x08) struct UWBP_CallToAction_C* WBP_CallToAction; // 0x4f0(0x08) struct UWBP_subscreen_nav_tab_C* WBP_subscreen_nav_tab; // 0x4f8(0x08) struct FText Message; // 0x500(0x18) struct FMulticastInlineDelegate OnClicked; // 0x518(0x10) struct FMulticastInlineDelegate OnHovered; // 0x528(0x10) struct FMulticastInlineDelegate OnUnhovered; // 0x538(0x10) struct FName TargetViewState; // 0x548(0x08) struct TArray<struct FName> RelatedViewStates; // 0x550(0x10) struct FMulticastInlineDelegate OnNonRouteClicked; // 0x560(0x10) void SetNewIndicator(bool Visible); // Function WBP_TopNavButton.WBP_TopNavButton_C.SetNewIndicator void IsDisabled(bool Disabled); // Function WBP_TopNavButton.WBP_TopNavButton_C.IsDisabled void IsActive(bool Active); // Function WBP_TopNavButton.WBP_TopNavButton_C.IsActive void PreConstruct(bool IsDesignTime); // Function WBP_TopNavButton.WBP_TopNavButton_C.PreConstruct void SetMessage(struct FText Message); // Function WBP_TopNavButton.WBP_TopNavButton_C.SetMessage void Construct(); // Function WBP_TopNavButton.WBP_TopNavButton_C.Construct void DisableButton(bool IsDisabled); // Function WBP_TopNavButton.WBP_TopNavButton_C.DisableButton void SetActive(bool IsActive); // Function WBP_TopNavButton.WBP_TopNavButton_C.SetActive void GamepadConfirm(); // Function WBP_TopNavButton.WBP_TopNavButton_C.GamepadConfirm void InitializeWidget(struct APUMG_HUD* HUD); // Function WBP_TopNavButton.WBP_TopNavButton_C.InitializeWidget void HandleButtonClick(struct UWBP_subscreen_nav_tab_C* Tab); // Function WBP_TopNavButton.WBP_TopNavButton_C.HandleButtonClick void ExecuteUbergraph_WBP_TopNavButton(int32_t EntryPoint); // Function WBP_TopNavButton.WBP_TopNavButton_C.ExecuteUbergraph_WBP_TopNavButton void OnNonRouteClicked__DelegateSignature(struct UKSWidget* ButtonClicked); // Function WBP_TopNavButton.WBP_TopNavButton_C.OnNonRouteClicked__DelegateSignature void OnUnhovered__DelegateSignature(); // Function WBP_TopNavButton.WBP_TopNavButton_C.OnUnhovered__DelegateSignature void OnHovered__DelegateSignature(); // Function WBP_TopNavButton.WBP_TopNavButton_C.OnHovered__DelegateSignature void OnClicked__DelegateSignature(struct FName TargetViewState); // Function WBP_TopNavButton.WBP_TopNavButton_C.OnClicked__DelegateSignature };
75.088235
161
0.849197
d2f7be7d9bf5bab781193e660ac36ed611f3120f
2,032
h
C
src/core/lib/gprpp/overload.h
warlock135/grpc
81e13e4fa9c0cdf7dc131ce548e1604c895b738c
[ "Apache-2.0" ]
7
2019-03-26T02:47:46.000Z
2021-03-25T08:05:37.000Z
src/core/lib/gprpp/overload.h
SanjanaSingh897/grpc
2d858866eb95ce5de8ccc8c35189a12733d8ca79
[ "Apache-2.0" ]
15
2017-06-20T10:02:58.000Z
2021-05-06T02:23:13.000Z
src/core/lib/gprpp/overload.h
SanjanaSingh897/grpc
2d858866eb95ce5de8ccc8c35189a12733d8ca79
[ "Apache-2.0" ]
13
2017-12-06T12:39:29.000Z
2022-03-29T05:50:44.000Z
// Copyright 2021 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef GRPC_CORE_LIB_GPRPP_OVERLOAD_H #define GRPC_CORE_LIB_GPRPP_OVERLOAD_H #include <grpc/impl/codegen/port_platform.h> #include <utility> namespace grpc_core { template <typename... Cases> struct OverloadType; // Compose one overload with N more -- use inheritance to leverage using and the // empty base class optimization. template <typename Case, typename... Cases> struct OverloadType<Case, Cases...> : public Case, public OverloadType<Cases...> { explicit OverloadType(Case&& c, Cases&&... cases) : Case(std::forward<Case>(c)), OverloadType<Cases...>(std::forward<Cases>(cases)...) {} using Case::operator(); using OverloadType<Cases...>::operator(); }; // Overload of a single case is just that case itself template <typename Case> struct OverloadType<Case> : public Case { explicit OverloadType(Case&& c) : Case(std::forward<Case>(c)) {} using Case::operator(); }; /// Compose callables into a single callable. /// e.g. given [](int i) { puts("a"); } and [](double d) { puts("b"); }, /// return a callable object like: /// struct { /// void operator()(int i) { puts("a"); } /// void operator()(double i) { puts("b"); } /// }; /// Preserves all captures. template <typename... Cases> OverloadType<Cases...> Overload(Cases... cases) { return OverloadType<Cases...>(std::move(cases)...); } } // namespace grpc_core #endif // GRPC_CORE_LIB_GPRPP_OVERLOAD_H
33.866667
80
0.687992