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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e63c85004eed7fe2666110d294f392b17f9fcd1 | 740 | c | C | code/f_campTreeLogNode.c | tollesonpdx/Last_Minute_Camping_With_C | 29942c8ce6840d42b6f1cad1ea97ecfd9826a083 | [
"MIT"
] | null | null | null | code/f_campTreeLogNode.c | tollesonpdx/Last_Minute_Camping_With_C | 29942c8ce6840d42b6f1cad1ea97ecfd9826a083 | [
"MIT"
] | null | null | null | code/f_campTreeLogNode.c | tollesonpdx/Last_Minute_Camping_With_C | 29942c8ce6840d42b6f1cad1ea97ecfd9826a083 | [
"MIT"
] | null | null | null | // Chad Tolleson Copyright (c) 2019
// New Beginnings - Capstone Project
// filename: f_campTreeLogNode.c
#include "headers.h"
int campTreeLogNode(struct campground* node)
{
FILE* f1 = fopen("capstoneResultsLog.txt","a+");
fprintf(f1,"\n\n");
for (int i = 0; i < 65; i++)
{ fprintf(f1,"="); }
fprintf(f1,"\n");
fprintf(f1,"Campground Name & Code: %s %s\n"
"Lat,Lng: %lf,%lf\n"
"Distance: %lf miles\n"
"Available: ",
node->c_name, node->c_code,
node->c_lat,node->c_long, node->distance);
fprintf(f1,node->c_available ? "yes\n" : "no\n");
fprintf(f1,"Weather Forecast: %s\n",node->c_weathers);
fclose(f1);
return 0;
}
| 28.461538 | 59 | 0.555405 |
f5b38ee5e35cb39b9fb8c88b744013a4dbe996e5 | 157 | h | C | include/start_menu.h | thechurchofcage/Complete-Fire-Red-Upgrade | e8bab9a1aab9d34c019940dab2015bac89ab8918 | [
"WTFPL"
] | null | null | null | include/start_menu.h | thechurchofcage/Complete-Fire-Red-Upgrade | e8bab9a1aab9d34c019940dab2015bac89ab8918 | [
"WTFPL"
] | null | null | null | include/start_menu.h | thechurchofcage/Complete-Fire-Red-Upgrade | e8bab9a1aab9d34c019940dab2015bac89ab8918 | [
"WTFPL"
] | null | null | null | #ifndef GUARD_START_MENU_H
#define GUARD_START_MENU_H
#include "global.h"
void AppendToList(u8* list, u8* pos, u8 newEntry);
#endif // GUARD_START_MENU_H
| 17.444444 | 50 | 0.77707 |
673bcc64fefaadfd796d581db8bacd19aae2c8e5 | 25,323 | h | C | Inc/fat.h | Emeryth/stm32gbcart-fw | 31d491ae4a700c9fd97c6a6a29b2ad72ae3f5e63 | [
"MIT"
] | 31 | 2020-01-22T22:55:56.000Z | 2022-03-31T23:02:05.000Z | Inc/fat.h | Emeryth/stm32gbcart-fw | 31d491ae4a700c9fd97c6a6a29b2ad72ae3f5e63 | [
"MIT"
] | 1 | 2020-05-14T18:58:32.000Z | 2020-05-15T06:32:29.000Z | Inc/fat.h | Emeryth/stm32gbcart-fw | 31d491ae4a700c9fd97c6a6a29b2ad72ae3f5e63 | [
"MIT"
] | 3 | 2020-01-27T10:02:13.000Z | 2021-04-28T08:50:06.000Z | unsigned char fat_bin[] = {
0xeb, 0x3c, 0x90, 0x6d, 0x6b, 0x66, 0x73, 0x2e, 0x66, 0x61, 0x74, 0x00,
0x02, 0x04, 0x01, 0x00, 0x02, 0x00, 0x02, 0x30, 0x09, 0xf8, 0x02, 0x00,
0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x29, 0xbf, 0xe5, 0x2c, 0x5f, 0x4e, 0x4f, 0x20, 0x4e, 0x41,
0x4d, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20,
0x20, 0x20, 0x0e, 0x1f, 0xbe, 0x5b, 0x7c, 0xac, 0x22, 0xc0, 0x74, 0x0b,
0x56, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0x5e, 0xeb, 0xf0, 0x32,
0xe4, 0xcd, 0x16, 0xcd, 0x19, 0xeb, 0xfe, 0x54, 0x68, 0x69, 0x73, 0x20,
0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x20, 0x62, 0x6f, 0x6f,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2e, 0x20,
0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x65,
0x72, 0x74, 0x20, 0x61, 0x20, 0x62, 0x6f, 0x6f, 0x74, 0x61, 0x62, 0x6c,
0x65, 0x20, 0x66, 0x6c, 0x6f, 0x70, 0x70, 0x79, 0x20, 0x61, 0x6e, 0x64,
0x0d, 0x0a, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20,
0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x79, 0x20, 0x61,
0x67, 0x61, 0x69, 0x6e, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x0d, 0x0a, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, 0xf8, 0xff, 0xff, 0x00,
0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00, 0x09, 0xa0, 0x00, 0x0b,
0xc0, 0x00, 0x0d, 0xe0, 0x00, 0x0f, 0x00, 0x01, 0x11, 0x20, 0x01, 0x13,
0x40, 0x01, 0x15, 0x60, 0x01, 0x17, 0x80, 0x01, 0x19, 0xa0, 0x01, 0x1b,
0xc0, 0x01, 0x1d, 0xe0, 0x01, 0x1f, 0x00, 0x02, 0x21, 0x20, 0x02, 0x23,
0x40, 0x02, 0x25, 0x60, 0x02, 0x27, 0x80, 0x02, 0x29, 0xa0, 0x02, 0x2b,
0xc0, 0x02, 0x2d, 0xe0, 0x02, 0x2f, 0x00, 0x03, 0x31, 0x20, 0x03, 0x33,
0x40, 0x03, 0x35, 0x60, 0x03, 0x37, 0x80, 0x03, 0x39, 0xa0, 0x03, 0x3b,
0xc0, 0x03, 0x3d, 0xe0, 0x03, 0x3f, 0x00, 0x04, 0x41, 0x20, 0x04, 0x43,
0x40, 0x04, 0x45, 0x60, 0x04, 0x47, 0x80, 0x04, 0x49, 0xa0, 0x04, 0x4b,
0xc0, 0x04, 0x4d, 0xe0, 0x04, 0x4f, 0x00, 0x05, 0x51, 0x20, 0x05, 0x53,
0x40, 0x05, 0x55, 0x60, 0x05, 0x57, 0x80, 0x05, 0x59, 0xa0, 0x05, 0x5b,
0xc0, 0x05, 0x5d, 0xe0, 0x05, 0x5f, 0x00, 0x06, 0x61, 0x20, 0x06, 0x63,
0x40, 0x06, 0x65, 0x60, 0x06, 0x67, 0x80, 0x06, 0x69, 0xa0, 0x06, 0x6b,
0xc0, 0x06, 0x6d, 0xe0, 0x06, 0x6f, 0x00, 0x07, 0x71, 0x20, 0x07, 0x73,
0x40, 0x07, 0x75, 0x60, 0x07, 0x77, 0x80, 0x07, 0x79, 0xa0, 0x07, 0x7b,
0xc0, 0x07, 0x7d, 0xe0, 0x07, 0x7f, 0x00, 0x08, 0x81, 0x20, 0x08, 0x83,
0x40, 0x08, 0x85, 0x60, 0x08, 0x87, 0x80, 0x08, 0x89, 0xa0, 0x08, 0x8b,
0xc0, 0x08, 0x8d, 0xe0, 0x08, 0x8f, 0x00, 0x09, 0x91, 0x20, 0x09, 0x93,
0x40, 0x09, 0x95, 0x60, 0x09, 0x97, 0x80, 0x09, 0x99, 0xa0, 0x09, 0x9b,
0xc0, 0x09, 0x9d, 0xe0, 0x09, 0x9f, 0x00, 0x0a, 0xa1, 0x20, 0x0a, 0xa3,
0x40, 0x0a, 0xa5, 0x60, 0x0a, 0xa7, 0x80, 0x0a, 0xa9, 0xa0, 0x0a, 0xab,
0xc0, 0x0a, 0xad, 0xe0, 0x0a, 0xaf, 0x00, 0x0b, 0xb1, 0x20, 0x0b, 0xb3,
0x40, 0x0b, 0xb5, 0x60, 0x0b, 0xb7, 0x80, 0x0b, 0xb9, 0xa0, 0x0b, 0xbb,
0xc0, 0x0b, 0xbd, 0xe0, 0x0b, 0xbf, 0x00, 0x0c, 0xc1, 0x20, 0x0c, 0xc3,
0x40, 0x0c, 0xc5, 0x60, 0x0c, 0xc7, 0x80, 0x0c, 0xc9, 0xa0, 0x0c, 0xcb,
0xc0, 0x0c, 0xcd, 0xe0, 0x0c, 0xcf, 0x00, 0x0d, 0xd1, 0x20, 0x0d, 0xd3,
0x40, 0x0d, 0xd5, 0x60, 0x0d, 0xd7, 0x80, 0x0d, 0xd9, 0xa0, 0x0d, 0xdb,
0xc0, 0x0d, 0xdd, 0xe0, 0x0d, 0xdf, 0x00, 0x0e, 0xe1, 0x20, 0x0e, 0xe3,
0x40, 0x0e, 0xe5, 0x60, 0x0e, 0xe7, 0x80, 0x0e, 0xe9, 0xa0, 0x0e, 0xeb,
0xc0, 0x0e, 0xed, 0xe0, 0x0e, 0xef, 0x00, 0x0f, 0xf1, 0x20, 0x0f, 0xf3,
0x40, 0x0f, 0xf5, 0x60, 0x0f, 0xf7, 0x80, 0x0f, 0xf9, 0xa0, 0x0f, 0xfb,
0xc0, 0x0f, 0xfd, 0xe0, 0x0f, 0xff, 0x00, 0x10, 0x01, 0x21, 0x10, 0x03,
0x41, 0x10, 0x05, 0x61, 0x10, 0x07, 0x81, 0x10, 0x09, 0xa1, 0x10, 0x0b,
0xc1, 0x10, 0x0d, 0xe1, 0x10, 0x0f, 0x01, 0x11, 0x11, 0x21, 0x11, 0x13,
0x41, 0x11, 0x15, 0x61, 0x11, 0x17, 0x81, 0x11, 0x19, 0xa1, 0x11, 0x1b,
0xc1, 0x11, 0x1d, 0xe1, 0x11, 0x1f, 0x01, 0x12, 0x21, 0x21, 0x12, 0x23,
0x41, 0x12, 0x25, 0x61, 0x12, 0x27, 0x81, 0x12, 0x29, 0xa1, 0x12, 0x2b,
0xc1, 0x12, 0x2d, 0xe1, 0x12, 0x2f, 0x01, 0x13, 0x31, 0x21, 0x13, 0x33,
0x41, 0x13, 0x35, 0x61, 0x13, 0x37, 0x81, 0x13, 0x39, 0xa1, 0x13, 0x3b,
0xc1, 0x13, 0x3d, 0xe1, 0x13, 0x3f, 0x01, 0x14, 0x41, 0x21, 0x14, 0x43,
0x41, 0x14, 0x45, 0x61, 0x14, 0x47, 0x81, 0x14, 0x49, 0xa1, 0x14, 0x4b,
0xc1, 0x14, 0x4d, 0xe1, 0x14, 0x4f, 0x01, 0x15, 0x51, 0x21, 0x15, 0x53,
0x41, 0x15, 0x55, 0x61, 0x15, 0x57, 0x81, 0x15, 0x59, 0xa1, 0x15, 0x5b,
0xc1, 0x15, 0x5d, 0xe1, 0x15, 0x5f, 0x01, 0x16, 0x61, 0x21, 0x16, 0x63,
0x41, 0x16, 0x65, 0x61, 0x16, 0x67, 0x81, 0x16, 0x69, 0xa1, 0x16, 0x6b,
0xc1, 0x16, 0x6d, 0xe1, 0x16, 0x6f, 0x01, 0x17, 0x71, 0x21, 0x17, 0x73,
0x41, 0x17, 0x75, 0x61, 0x17, 0x77, 0x81, 0x17, 0x79, 0xa1, 0x17, 0x7b,
0xc1, 0x17, 0x7d, 0xe1, 0x17, 0x7f, 0x01, 0x18, 0x81, 0x21, 0x18, 0x83,
0x41, 0x18, 0x85, 0x61, 0x18, 0x87, 0x81, 0x18, 0x89, 0xa1, 0x18, 0x8b,
0xc1, 0x18, 0x8d, 0xe1, 0x18, 0x8f, 0x01, 0x19, 0x91, 0x21, 0x19, 0x93,
0x41, 0x19, 0x95, 0x61, 0x19, 0x97, 0x81, 0x19, 0x99, 0xa1, 0x19, 0x9b,
0xc1, 0x19, 0x9d, 0xe1, 0x19, 0x9f, 0x01, 0x1a, 0xa1, 0x21, 0x1a, 0xa3,
0x41, 0x1a, 0xa5, 0x61, 0x1a, 0xa7, 0x81, 0x1a, 0xa9, 0xa1, 0x1a, 0xab,
0xc1, 0x1a, 0xad, 0xe1, 0x1a, 0xaf, 0x01, 0x1b, 0xb1, 0x21, 0x1b, 0xb3,
0x41, 0x1b, 0xb5, 0x61, 0x1b, 0xb7, 0x81, 0x1b, 0xb9, 0xa1, 0x1b, 0xbb,
0xc1, 0x1b, 0xbd, 0xe1, 0x1b, 0xbf, 0x01, 0x1c, 0xc1, 0x21, 0x1c, 0xc3,
0x41, 0x1c, 0xc5, 0x61, 0x1c, 0xc7, 0x81, 0x1c, 0xc9, 0xa1, 0x1c, 0xcb,
0xc1, 0x1c, 0xcd, 0xe1, 0x1c, 0xcf, 0x01, 0x1d, 0xd1, 0x21, 0x1d, 0xd3,
0x41, 0x1d, 0xd5, 0x61, 0x1d, 0xd7, 0x81, 0x1d, 0xd9, 0xa1, 0x1d, 0xdb,
0xc1, 0x1d, 0xdd, 0xe1, 0x1d, 0xdf, 0x01, 0x1e, 0xe1, 0x21, 0x1e, 0xe3,
0x41, 0x1e, 0xe5, 0x61, 0x1e, 0xe7, 0x81, 0x1e, 0xe9, 0xa1, 0x1e, 0xeb,
0xc1, 0x1e, 0xed, 0xe1, 0x1e, 0xef, 0x01, 0x1f, 0xf1, 0x21, 0x1f, 0xf3,
0x41, 0x1f, 0xf5, 0x61, 0x1f, 0xf7, 0x81, 0x1f, 0xf9, 0xa1, 0x1f, 0xfb,
0xc1, 0x1f, 0xfd, 0xe1, 0x1f, 0xff, 0x01, 0x20, 0x01, 0x22, 0x20, 0xff,
0x4f, 0x20, 0x05, 0x62, 0x20, 0x07, 0x82, 0x20, 0x09, 0xa2, 0x20, 0x0b,
0xc2, 0x20, 0x0d, 0xe2, 0x20, 0x0f, 0x02, 0x21, 0x11, 0x22, 0x21, 0x13,
0x42, 0x21, 0x15, 0x62, 0x21, 0x17, 0x82, 0x21, 0x19, 0xa2, 0x21, 0x1b,
0xc2, 0x21, 0x1d, 0xe2, 0x21, 0x1f, 0x02, 0x22, 0x21, 0x22, 0x22, 0x23,
0x42, 0x22, 0x25, 0x62, 0x22, 0x27, 0x82, 0x22, 0x29, 0xa2, 0x22, 0x2b,
0xc2, 0x22, 0x2d, 0xe2, 0x22, 0x2f, 0x02, 0x23, 0x31, 0x22, 0x23, 0x33,
0x42, 0x23, 0x35, 0x62, 0x23, 0x37, 0x82, 0x23, 0x39, 0xa2, 0x23, 0x3b,
0xc2, 0x23, 0x3d, 0xe2, 0x23, 0x3f, 0x02, 0x24, 0x41, 0x22, 0x24, 0xff,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0xff, 0x00, 0x40, 0x00, 0x05, 0x60, 0x00, 0x07, 0x80, 0x00,
0x09, 0xa0, 0x00, 0x0b, 0xc0, 0x00, 0x0d, 0xe0, 0x00, 0x0f, 0x00, 0x01,
0x11, 0x20, 0x01, 0x13, 0x40, 0x01, 0x15, 0x60, 0x01, 0x17, 0x80, 0x01,
0x19, 0xa0, 0x01, 0x1b, 0xc0, 0x01, 0x1d, 0xe0, 0x01, 0x1f, 0x00, 0x02,
0x21, 0x20, 0x02, 0x23, 0x40, 0x02, 0x25, 0x60, 0x02, 0x27, 0x80, 0x02,
0x29, 0xa0, 0x02, 0x2b, 0xc0, 0x02, 0x2d, 0xe0, 0x02, 0x2f, 0x00, 0x03,
0x31, 0x20, 0x03, 0x33, 0x40, 0x03, 0x35, 0x60, 0x03, 0x37, 0x80, 0x03,
0x39, 0xa0, 0x03, 0x3b, 0xc0, 0x03, 0x3d, 0xe0, 0x03, 0x3f, 0x00, 0x04,
0x41, 0x20, 0x04, 0x43, 0x40, 0x04, 0x45, 0x60, 0x04, 0x47, 0x80, 0x04,
0x49, 0xa0, 0x04, 0x4b, 0xc0, 0x04, 0x4d, 0xe0, 0x04, 0x4f, 0x00, 0x05,
0x51, 0x20, 0x05, 0x53, 0x40, 0x05, 0x55, 0x60, 0x05, 0x57, 0x80, 0x05,
0x59, 0xa0, 0x05, 0x5b, 0xc0, 0x05, 0x5d, 0xe0, 0x05, 0x5f, 0x00, 0x06,
0x61, 0x20, 0x06, 0x63, 0x40, 0x06, 0x65, 0x60, 0x06, 0x67, 0x80, 0x06,
0x69, 0xa0, 0x06, 0x6b, 0xc0, 0x06, 0x6d, 0xe0, 0x06, 0x6f, 0x00, 0x07,
0x71, 0x20, 0x07, 0x73, 0x40, 0x07, 0x75, 0x60, 0x07, 0x77, 0x80, 0x07,
0x79, 0xa0, 0x07, 0x7b, 0xc0, 0x07, 0x7d, 0xe0, 0x07, 0x7f, 0x00, 0x08,
0x81, 0x20, 0x08, 0x83, 0x40, 0x08, 0x85, 0x60, 0x08, 0x87, 0x80, 0x08,
0x89, 0xa0, 0x08, 0x8b, 0xc0, 0x08, 0x8d, 0xe0, 0x08, 0x8f, 0x00, 0x09,
0x91, 0x20, 0x09, 0x93, 0x40, 0x09, 0x95, 0x60, 0x09, 0x97, 0x80, 0x09,
0x99, 0xa0, 0x09, 0x9b, 0xc0, 0x09, 0x9d, 0xe0, 0x09, 0x9f, 0x00, 0x0a,
0xa1, 0x20, 0x0a, 0xa3, 0x40, 0x0a, 0xa5, 0x60, 0x0a, 0xa7, 0x80, 0x0a,
0xa9, 0xa0, 0x0a, 0xab, 0xc0, 0x0a, 0xad, 0xe0, 0x0a, 0xaf, 0x00, 0x0b,
0xb1, 0x20, 0x0b, 0xb3, 0x40, 0x0b, 0xb5, 0x60, 0x0b, 0xb7, 0x80, 0x0b,
0xb9, 0xa0, 0x0b, 0xbb, 0xc0, 0x0b, 0xbd, 0xe0, 0x0b, 0xbf, 0x00, 0x0c,
0xc1, 0x20, 0x0c, 0xc3, 0x40, 0x0c, 0xc5, 0x60, 0x0c, 0xc7, 0x80, 0x0c,
0xc9, 0xa0, 0x0c, 0xcb, 0xc0, 0x0c, 0xcd, 0xe0, 0x0c, 0xcf, 0x00, 0x0d,
0xd1, 0x20, 0x0d, 0xd3, 0x40, 0x0d, 0xd5, 0x60, 0x0d, 0xd7, 0x80, 0x0d,
0xd9, 0xa0, 0x0d, 0xdb, 0xc0, 0x0d, 0xdd, 0xe0, 0x0d, 0xdf, 0x00, 0x0e,
0xe1, 0x20, 0x0e, 0xe3, 0x40, 0x0e, 0xe5, 0x60, 0x0e, 0xe7, 0x80, 0x0e,
0xe9, 0xa0, 0x0e, 0xeb, 0xc0, 0x0e, 0xed, 0xe0, 0x0e, 0xef, 0x00, 0x0f,
0xf1, 0x20, 0x0f, 0xf3, 0x40, 0x0f, 0xf5, 0x60, 0x0f, 0xf7, 0x80, 0x0f,
0xf9, 0xa0, 0x0f, 0xfb, 0xc0, 0x0f, 0xfd, 0xe0, 0x0f, 0xff, 0x00, 0x10,
0x01, 0x21, 0x10, 0x03, 0x41, 0x10, 0x05, 0x61, 0x10, 0x07, 0x81, 0x10,
0x09, 0xa1, 0x10, 0x0b, 0xc1, 0x10, 0x0d, 0xe1, 0x10, 0x0f, 0x01, 0x11,
0x11, 0x21, 0x11, 0x13, 0x41, 0x11, 0x15, 0x61, 0x11, 0x17, 0x81, 0x11,
0x19, 0xa1, 0x11, 0x1b, 0xc1, 0x11, 0x1d, 0xe1, 0x11, 0x1f, 0x01, 0x12,
0x21, 0x21, 0x12, 0x23, 0x41, 0x12, 0x25, 0x61, 0x12, 0x27, 0x81, 0x12,
0x29, 0xa1, 0x12, 0x2b, 0xc1, 0x12, 0x2d, 0xe1, 0x12, 0x2f, 0x01, 0x13,
0x31, 0x21, 0x13, 0x33, 0x41, 0x13, 0x35, 0x61, 0x13, 0x37, 0x81, 0x13,
0x39, 0xa1, 0x13, 0x3b, 0xc1, 0x13, 0x3d, 0xe1, 0x13, 0x3f, 0x01, 0x14,
0x41, 0x21, 0x14, 0x43, 0x41, 0x14, 0x45, 0x61, 0x14, 0x47, 0x81, 0x14,
0x49, 0xa1, 0x14, 0x4b, 0xc1, 0x14, 0x4d, 0xe1, 0x14, 0x4f, 0x01, 0x15,
0x51, 0x21, 0x15, 0x53, 0x41, 0x15, 0x55, 0x61, 0x15, 0x57, 0x81, 0x15,
0x59, 0xa1, 0x15, 0x5b, 0xc1, 0x15, 0x5d, 0xe1, 0x15, 0x5f, 0x01, 0x16,
0x61, 0x21, 0x16, 0x63, 0x41, 0x16, 0x65, 0x61, 0x16, 0x67, 0x81, 0x16,
0x69, 0xa1, 0x16, 0x6b, 0xc1, 0x16, 0x6d, 0xe1, 0x16, 0x6f, 0x01, 0x17,
0x71, 0x21, 0x17, 0x73, 0x41, 0x17, 0x75, 0x61, 0x17, 0x77, 0x81, 0x17,
0x79, 0xa1, 0x17, 0x7b, 0xc1, 0x17, 0x7d, 0xe1, 0x17, 0x7f, 0x01, 0x18,
0x81, 0x21, 0x18, 0x83, 0x41, 0x18, 0x85, 0x61, 0x18, 0x87, 0x81, 0x18,
0x89, 0xa1, 0x18, 0x8b, 0xc1, 0x18, 0x8d, 0xe1, 0x18, 0x8f, 0x01, 0x19,
0x91, 0x21, 0x19, 0x93, 0x41, 0x19, 0x95, 0x61, 0x19, 0x97, 0x81, 0x19,
0x99, 0xa1, 0x19, 0x9b, 0xc1, 0x19, 0x9d, 0xe1, 0x19, 0x9f, 0x01, 0x1a,
0xa1, 0x21, 0x1a, 0xa3, 0x41, 0x1a, 0xa5, 0x61, 0x1a, 0xa7, 0x81, 0x1a,
0xa9, 0xa1, 0x1a, 0xab, 0xc1, 0x1a, 0xad, 0xe1, 0x1a, 0xaf, 0x01, 0x1b,
0xb1, 0x21, 0x1b, 0xb3, 0x41, 0x1b, 0xb5, 0x61, 0x1b, 0xb7, 0x81, 0x1b,
0xb9, 0xa1, 0x1b, 0xbb, 0xc1, 0x1b, 0xbd, 0xe1, 0x1b, 0xbf, 0x01, 0x1c,
0xc1, 0x21, 0x1c, 0xc3, 0x41, 0x1c, 0xc5, 0x61, 0x1c, 0xc7, 0x81, 0x1c,
0xc9, 0xa1, 0x1c, 0xcb, 0xc1, 0x1c, 0xcd, 0xe1, 0x1c, 0xcf, 0x01, 0x1d,
0xd1, 0x21, 0x1d, 0xd3, 0x41, 0x1d, 0xd5, 0x61, 0x1d, 0xd7, 0x81, 0x1d,
0xd9, 0xa1, 0x1d, 0xdb, 0xc1, 0x1d, 0xdd, 0xe1, 0x1d, 0xdf, 0x01, 0x1e,
0xe1, 0x21, 0x1e, 0xe3, 0x41, 0x1e, 0xe5, 0x61, 0x1e, 0xe7, 0x81, 0x1e,
0xe9, 0xa1, 0x1e, 0xeb, 0xc1, 0x1e, 0xed, 0xe1, 0x1e, 0xef, 0x01, 0x1f,
0xf1, 0x21, 0x1f, 0xf3, 0x41, 0x1f, 0xf5, 0x61, 0x1f, 0xf7, 0x81, 0x1f,
0xf9, 0xa1, 0x1f, 0xfb, 0xc1, 0x1f, 0xfd, 0xe1, 0x1f, 0xff, 0x01, 0x20,
0x01, 0x22, 0x20, 0xff, 0x4f, 0x20, 0x05, 0x62, 0x20, 0x07, 0x82, 0x20,
0x09, 0xa2, 0x20, 0x0b, 0xc2, 0x20, 0x0d, 0xe2, 0x20, 0x0f, 0x02, 0x21,
0x11, 0x22, 0x21, 0x13, 0x42, 0x21, 0x15, 0x62, 0x21, 0x17, 0x82, 0x21,
0x19, 0xa2, 0x21, 0x1b, 0xc2, 0x21, 0x1d, 0xe2, 0x21, 0x1f, 0x02, 0x22,
0x21, 0x22, 0x22, 0x23, 0x42, 0x22, 0x25, 0x62, 0x22, 0x27, 0x82, 0x22,
0x29, 0xa2, 0x22, 0x2b, 0xc2, 0x22, 0x2d, 0xe2, 0x22, 0x2f, 0x02, 0x23,
0x31, 0x22, 0x23, 0x33, 0x42, 0x23, 0x35, 0x62, 0x23, 0x37, 0x82, 0x23,
0x39, 0xa2, 0x23, 0x3b, 0xc2, 0x23, 0x3d, 0xe2, 0x23, 0x3f, 0x02, 0x24,
0x41, 0x22, 0x24, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x41, 0x72, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x2e,
0x00, 0x67, 0x00, 0x0f, 0x00, 0x64, 0x62, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x52, 0x4f, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x42, 0x20, 0x20,
0x00, 0x42, 0xe4, 0x5b, 0x23, 0x50, 0x23, 0x50, 0x00, 0x00, 0x26, 0x83,
0x24, 0x4d, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x41, 0x72, 0x00, 0x61,
0x00, 0x6d, 0x00, 0x2e, 0x00, 0x73, 0x00, 0x0f, 0x00, 0x15, 0x61, 0x00,
0x76, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0x52, 0x41, 0x4d, 0x20, 0x20, 0x20, 0x20, 0x20,
0x53, 0x41, 0x56, 0x20, 0x00, 0xb4, 0xe5, 0x5b, 0x23, 0x50, 0x23, 0x50,
0x00, 0x00, 0x16, 0xb7, 0x22, 0x50, 0x03, 0x02, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
unsigned int fat_bin_len = 4096;
| 73.187861 | 73 | 0.648778 |
efb297782b690af736a76706487ae36164219e94 | 6,469 | h | C | macOS/10.13/Contacts.framework/CNSaveRequest.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 30 | 2016-10-09T20:13:00.000Z | 2022-01-24T04:14:57.000Z | macOS/10.13/Contacts.framework/CNSaveRequest.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | null | null | null | macOS/10.13/Contacts.framework/CNSaveRequest.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 7 | 2017-08-29T14:41:25.000Z | 2022-01-19T17:14:54.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/Contacts.framework/Versions/A/Contacts
*/
@interface CNSaveRequest : NSObject <CNObjectValidation, NSSecureCoding> {
NSMutableDictionary * _addedAccountContainersByIdentifier;
NSMutableArray * _addedAccounts;
NSMutableDictionary * _addedContactsByIdentifier;
NSMutableDictionary * _addedContainersByIdentifier;
NSMutableDictionary * _addedGroupsByIdentifier;
NSMutableDictionary * _addedMembersByGroupIdentifier;
NSMutableDictionary * _addedSubgroupsByGroupIdentifier;
NSString * _changeHistoryClientIdentifier;
NSMutableArray * _contactChangeRequests;
NSMutableDictionary * _deletedContactsByIdentifier;
NSMutableDictionary * _deletedContainersByIdentifier;
NSMutableDictionary * _deletedGroupsByIdentifier;
NSString * _meCardIdentifier;
NSMutableDictionary * _movedContainersByIdentifier;
NSMutableDictionary * _parentRecordsByIdentifier;
NSMutableDictionary * _removedMembersByGroupIdentifier;
NSMutableDictionary * _removedSubgroupsByGroupIdentifier;
NSString * _saveRequestIdentifier;
BOOL _unsafeApplyChangesOnly;
NSMutableArray * _updatedContacts;
NSMutableArray * _updatedContainers;
NSMutableArray * _updatedGroups;
}
@property (atomic, readonly, copy) NSDictionary *addedAccountContainersByParentContainerIdentifier;
@property (nonatomic, readonly, copy) NSArray *addedAccounts;
@property (atomic, readonly, copy) NSDictionary *addedContactsByContainerIdentifier;
@property (atomic, readonly, copy) NSDictionary *addedContainersByParentContainerIdentifier;
@property (atomic, readonly, copy) NSDictionary *addedGroupsByContainerIdentifier;
@property (atomic, readonly, copy) NSDictionary *addedMembersByGroupIdentifier;
@property (atomic, readonly, copy) NSDictionary *addedSubgroupsByGroupIdentifier;
@property (nonatomic, readonly, copy) NSArray *allAccountIdentifierStrings;
@property (nonatomic, readonly, copy) NSArray *allContactIdentifiers;
@property (nonatomic, readonly, copy) NSArray *allContacts;
@property (nonatomic, readonly, copy) NSArray *allContainers;
@property (nonatomic, readonly, copy) NSArray *allGroupIdentifiers;
@property (nonatomic, readonly, copy) NSArray *allGroups;
@property (nonatomic, readwrite, copy) NSString *changeHistoryClientIdentifier;
@property (nonatomic, readonly, copy) NSArray *contactChangeRequests;
@property (atomic, readonly, copy) NSString *debugDescription;
@property (atomic, readonly, copy) NSArray *deletedContacts;
@property (atomic, readonly, copy) NSDictionary *deletedContactsByIdentifier;
@property (atomic, readonly, copy) NSArray *deletedContainers;
@property (atomic, readonly, copy) NSArray *deletedGroups;
@property (atomic, readonly, copy) NSString *description;
@property (atomic, readonly) unsigned long long hash;
@property (atomic, readonly, copy) NSString *meCardIdentifier;
@property (atomic, readonly, copy) NSDictionary *movedContainersByParentContainerIdentifier;
@property (atomic, readonly, copy) NSDictionary *removedMembersByGroupIdentifier;
@property (atomic, readonly, copy) NSDictionary *removedSubgroupsByGroupIdentifier;
@property (atomic, readonly, copy) NSString *saveRequestIdentifier;
@property (nonatomic, readonly, copy) NSString *storeIdentifier;
@property (atomic, readonly) Class superclass;
@property (nonatomic, readwrite) BOOL unsafeApplyChangesOnly;
@property (atomic, readonly, copy) NSArray *updatedContacts;
@property (atomic, readonly, copy) NSArray *updatedContainers;
@property (atomic, readonly, copy) NSArray *updatedGroups;
+ (BOOL)supportsSecureCoding;
- (void).cxx_destruct;
- (id)_dictionaryOfArraysFromDictionaryOfDictionaries:(id)arg1;
- (void)_insertContact:(id)arg1 intoDictionary:(id)arg2 complementDictionary:(id)arg3;
- (void)addAccount:(id)arg1;
- (void)addContact:(id)arg1 toContainerWithIdentifier:(id)arg2;
- (void)addContainer:(id)arg1 toAccountWithIdentifier:(id)arg2;
- (void)addContainer:(id)arg1 toContainerWithIdentifier:(id)arg2;
- (void)addGroup:(id)arg1 toContainerWithIdentifier:(id)arg2;
- (void)addMember:(id)arg1 toGroup:(id)arg2;
- (void)addSubgroup:(id)arg1 toGroup:(id)arg2;
- (id)addedAccountContainersByParentContainerIdentifier;
- (id)addedAccounts;
- (id)addedContactsByContainerIdentifier;
- (id)addedContainersByParentContainerIdentifier;
- (id)addedGroupsByContainerIdentifier;
- (id)addedMembersByGroupIdentifier;
- (id)addedSubgroupsByGroupIdentifier;
- (id)allAccountIdentifierStrings;
- (id)allAccountIdentifiers;
- (id)allContactIdentifiers;
- (id)allContacts;
- (id)allContainerIdentifierStrings:(BOOL*)arg1;
- (id)allContainerIdentifiers:(BOOL*)arg1;
- (id)allContainers;
- (id)allGroupIdentifiers;
- (id)allGroups;
- (id)changeHistoryClientIdentifier;
- (id)contactChangeRequests;
- (void)deleteContact:(id)arg1;
- (void)deleteContainer:(id)arg1;
- (void)deleteGroup:(id)arg1;
- (id)deletedContacts;
- (id)deletedContactsByIdentifier;
- (id)deletedContainers;
- (id)deletedGroups;
- (void)encodeWithCoder:(id)arg1;
- (id)flattenedDictionaryForDictionaryOfTuples:(id)arg1;
- (id)groupWithAddedMemberForGroupIdentifier:(id)arg1;
- (id)groupWithAddedSubgroupForGroupIdentifier:(id)arg1;
- (id)groupWithRemovedMemberForGroupIdentifier:(id)arg1;
- (id)groupWithRemovedSubgroupForGroupIdentifier:(id)arg1;
- (id)init;
- (id)initWithCoder:(id)arg1;
- (BOOL)isValid:(id*)arg1;
- (void)linkContact:(id)arg1 toContact:(id)arg2;
- (id)meCardIdentifier;
- (void)moveContainer:(id)arg1 toContainerWithIdentifier:(id)arg2;
- (id)movedContainersByParentContainerIdentifier;
- (void)preferLinkedContactForImage:(id)arg1 inUnifiedContact:(id)arg2;
- (void)preferLinkedContactForName:(id)arg1 inUnifiedContact:(id)arg2;
- (void)queueUpdatedObject:(id)arg1 intoArray:(id)arg2;
- (void)removeMember:(id)arg1 fromGroup:(id)arg2;
- (void)removeSubgroup:(id)arg1 fromGroup:(id)arg2;
- (id)removedMembersByGroupIdentifier;
- (id)removedSubgroupsByGroupIdentifier;
- (id)saveRequestIdentifier;
- (void)setChangeHistoryClientIdentifier:(id)arg1;
- (void)setMeCardIdentifier:(id)arg1;
- (void)setUnsafeApplyChangesOnly:(BOOL)arg1;
- (id)storeIdentifier;
- (void)unlinkContact:(id)arg1;
- (BOOL)unsafeApplyChangesOnly;
- (void)updateContact:(id)arg1;
- (void)updateContainer:(id)arg1;
- (void)updateGroup:(id)arg1;
- (id)updatedContacts;
- (id)updatedContainers;
- (id)updatedGroups;
// CNSaveRequest (WatchOS)
- (void)setLinkIdentifier:(id)arg1 forContact:(id)arg2;
@end
| 46.207143 | 99 | 0.803215 |
3cc309bef3a11c7b41b2873505b75c23387c5a2f | 4,580 | h | C | lib/tensors1d.h | dcseal/finess | 766e583ae9e84480640c7c3b3c157bf40ab87fe4 | [
"BSD-3-Clause"
] | null | null | null | lib/tensors1d.h | dcseal/finess | 766e583ae9e84480640c7c3b3c157bf40ab87fe4 | [
"BSD-3-Clause"
] | null | null | null | lib/tensors1d.h | dcseal/finess | 766e583ae9e84480640c7c3b3c157bf40ab87fe4 | [
"BSD-3-Clause"
] | null | null | null | #ifndef tensors1d_h
#define tensors1d_h
#ifndef NDIMS
#include <dimdefs.h> // for NDIMS (number of spatial dimensions)
#endif
#if (!defined(NDIMS) || !(NDIMS>=0))
#error "NDIMS must be defined"
#endif
// What's the difference between DEEP and DIMS copy? (-DS)
namespace CopyMode
{
enum Enum
{
DEEP = 1,
DIMS = 2,
};
}
class iTensorBase
{
protected:
void init();
iTensorBase(){};
iTensorBase(const iTensorBase& in);
public:
iTensorBase(int size_in):size(size_in){init();}
~iTensorBase();
void setall(int);
const int numel() const { return size; }
#ifdef CHECK_BOUNDS
const int& vget(int k) const;
int& vfetch(int k);
void vset(int k, int value);
#else
const int& vget(int k) const
{
return vec[k];
}
int& vfetch(int k) {
return vec[k];
}
void vset(int k, int value){
vec[k]=value;
}
#endif
protected:
int* vec;
int size;
};
class iTensor1d : public iTensorBase
{
// data
protected:
int b1;
// methods
protected:
iTensor1d(){};
public:
int getidx(int n1) const
{
int k = n1-b1;
return k;
}
int getsize() const { return size; }
public:
// constructor takes size and initial index in each dimension
iTensor1d( int s1i, int b1i ) : b1(b1i) { size=s1i; init(); }
iTensor1d(const iTensor1d& in) : iTensorBase(in), b1(in.b1) {}
const int& get(int n1) const
{ return vget(n1-b1); }
void set(int n1, int value)
{ return vset(n1-b1, value); }
};
class iTensor1 : public iTensor1d
{
public:
iTensor1(int s1i) :
iTensor1d(s1i,1) { }
};
// === major section: dtensors (arrays of double) ===
class dTensorBase
{
private: // disabled
dTensorBase& operator=(const dTensorBase& in);
protected:
void init();
dTensorBase(){};
dTensorBase(const dTensorBase& in, CopyMode::Enum copyMode=CopyMode::DEEP);
void copyfrom(const dTensorBase& in);
public:
dTensorBase(int size_in):size(size_in){init();}
~dTensorBase();
bool check();
void setall(double);
const int numel() const { return size; }
#ifdef CHECK_BOUNDS
const double& vget(int k) const;
double& vfetch(int k);
void vset(int k, double value);
#else
const double& vget(int k) const { return vec[k]; }
double& vfetch(int k) {
return vec[k];
#ifdef CHECK_INIT
if(!(vec[k]==vec[k])) eprintf("vec[%d]=%24.16e",k,vec[k]);
#endif
}
void vset(int k, double value){vec[k]=value;}
#endif
protected:
double* vec;
int size;
};
class dTensor1d : public dTensorBase
{
// data
protected:
int b1;
// methods
private: // disabled
dTensor1d& operator=(const dTensor1d& in);
protected:
dTensor1d(){};
public:
int getidx(int n1) const
{
int k = n1-b1;
return k;
}
int getsize() const { return size; }
public:
// constructor takes size and initial index in each dimension
dTensor1d( int s1i, int b1i ) : b1(b1i) { size=s1i; init(); }
dTensor1d(const dTensor1d& in) : dTensorBase(in), b1(in.b1) {}
void copyfrom(const dTensor1d& in);
const double& get(int n1) const
{ return vget(n1-b1); }
double& fetch(int n1)
{ return vfetch(n1-b1); }
void set(int n1, double value)
{ return vset(n1-b1, value); }
};
class dTensor1 : public dTensor1d
{
public:
dTensor1(int s1i) :
dTensor1d(s1i,1) { }
void copyfrom(const dTensor1& in){ dTensor1d::copyfrom(in); }
private: // disabled
dTensor1& operator=(const dTensor1& in){ copyfrom(in); return *this; }
};
class dTensorBC1 : public dTensor1d
{
private: // disabled
dTensorBC1& operator=(const dTensorBC1& in);
public:
dTensorBC1(int s1i,
int mbc, int ndims=1);
void copyfrom(const dTensorBC1& in);
int getmbc() const {return mbc;}
private:
int S1;
int mbc;
int ndims;
};
// methods for tensors
int count_fields(const char* str_in, char field_sep);
bool str_into_tensor(const char* str, iTensorBase& t, char field_sep);
bool str_into_tensor(const char* str, dTensorBase& t, char field_sep);
#endif
| 25.027322 | 83 | 0.5631 |
a7318c5526736ec836a730dd8c28b7ba1fd4fda4 | 203 | h | C | launcher/include/cmd.h | supnaobed/octop-os | 30a1874b0a437ea5c070e7269c5cf9e743c7141e | [
"Unlicense",
"MIT"
] | null | null | null | launcher/include/cmd.h | supnaobed/octop-os | 30a1874b0a437ea5c070e7269c5cf9e743c7141e | [
"Unlicense",
"MIT"
] | null | null | null | launcher/include/cmd.h | supnaobed/octop-os | 30a1874b0a437ea5c070e7269c5cf9e743c7141e | [
"Unlicense",
"MIT"
] | null | null | null | #ifndef CMD
#define CMD
#define CMDSTOP 0
#define CMDSTART 1
#define CMDPAUSE 2
#define CMDRESUME 3
typedef struct Cmd
{
char * package_id;
int command;
} Cmd;
int readcmd(Cmd * cmd);
#endif | 11.277778 | 23 | 0.699507 |
4ce9a2df98b06857af2302770458ab7c1e757160 | 1,852 | h | C | VelkozSoftRenderer/hittable_list.h | KaoriZh/VelkozSoftRenderer | 3a23a8d9ccd98c68786e17d9e59aeee9f55f76cf | [
"MIT"
] | null | null | null | VelkozSoftRenderer/hittable_list.h | KaoriZh/VelkozSoftRenderer | 3a23a8d9ccd98c68786e17d9e59aeee9f55f76cf | [
"MIT"
] | null | null | null | VelkozSoftRenderer/hittable_list.h | KaoriZh/VelkozSoftRenderer | 3a23a8d9ccd98c68786e17d9e59aeee9f55f76cf | [
"MIT"
] | null | null | null | #pragma once
#include"hittable.h"
#include"aabb.h"
#include<vector>
#include<memory>
using std::shared_ptr;
using std::make_shared;
class hittable_list : public hittable {
public:
hittable_list(){}
hittable_list(shared_ptr<hittable> obj) {
add(obj);
}
void clear() {
objects.clear();
}
void add(shared_ptr<hittable> object) {
objects.push_back(object);
}
virtual bool hit(const ray& r, double t_min, double t_max, hit_record& rec) const override;
virtual bool generate_bounding_box(double t0, double t1, aabb& output_box) const override;
virtual double get_probability(const point3& o, const vec3& v) const override;
virtual vec3 random(const vec3& o) const override;
public:
std::vector<shared_ptr<hittable>> objects;
};
bool hittable_list::hit(const ray& r, double t_min, double t_max, hit_record& rec) const {
hit_record tmp_rec;
bool hit_anything = false;
auto closest_so_far = t_max;
for (const auto& obj : objects) {
if (obj.get()->hit(r, t_min, closest_so_far, tmp_rec)) {
hit_anything = true;
closest_so_far = tmp_rec.t;
rec = tmp_rec;
}
}
return hit_anything;
}
bool hittable_list::generate_bounding_box(double t0, double t1, aabb& output_box) const {
if (objects.empty()) return false;
aabb a;
bool first = true;
for (const auto& obj : objects) {
if (!obj->generate_bounding_box(t0, t1, a)) return false;
output_box = first ? a : aabb_union(output_box, a);
first = false;
}
return true;
}
double hittable_list::get_probability(const point3& o, const vec3& v) const {
auto weight = 1.0 / objects.size();
auto sum = 0.0;
for (const auto& obj : objects) {
sum += weight * obj->get_probability(o, v);
}
return sum;
}
vec3 hittable_list::random(const vec3& o) const {
auto int_size = static_cast<int>(objects.size());
return objects[random_int(0, int_size - 1)]->random(o);
} | 24.368421 | 92 | 0.710583 |
1ee27b2e7aeff6eec388946469a22469af0c2fa2 | 306 | h | C | ports/raspberrypi/boards/adafruit_qt2040_trinkey/mpconfigboard.h | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 3,010 | 2017-01-07T23:43:33.000Z | 2022-03-31T06:02:59.000Z | ports/raspberrypi/boards/adafruit_qt2040_trinkey/mpconfigboard.h | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 4,478 | 2017-01-06T01:35:02.000Z | 2022-03-31T23:03:27.000Z | ports/raspberrypi/boards/adafruit_qt2040_trinkey/mpconfigboard.h | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 1,149 | 2017-01-09T00:35:23.000Z | 2022-03-31T21:24:29.000Z | #define MICROPY_HW_BOARD_NAME "Adafruit QT2040 Trinkey"
#define MICROPY_HW_MCU_NAME "rp2040"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO27)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO17)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO16)
#define DEFAULT_UART_BUS_RX (&pin_GPIO17)
#define DEFAULT_UART_BUS_TX (&pin_GPIO16)
| 27.818182 | 55 | 0.830065 |
bc785e48f086cbb9c59831dcf2eafe2a8b7b94b6 | 1,579 | h | C | L04-Railroad/Student_Code/stack.h | tlyon3/CS235 | 2bdb8eaf66c9adbfe7ec59c0535852fd1cc30eda | [
"MIT"
] | 1 | 2018-03-04T02:58:55.000Z | 2018-03-04T02:58:55.000Z | L04-Railroad/Student_Code/stack.h | tlyon3/CS235 | 2bdb8eaf66c9adbfe7ec59c0535852fd1cc30eda | [
"MIT"
] | 1 | 2015-02-09T21:29:12.000Z | 2015-02-09T21:32:06.000Z | L04-Railroad/Student_Code/stack.h | tlyon3/CS235 | 2bdb8eaf66c9adbfe7ec59c0535852fd1cc30eda | [
"MIT"
] | 4 | 2019-05-20T02:57:47.000Z | 2021-02-11T15:41:15.000Z | #pragma once
#include <cstddef>
#include <iostream>
template <typename ItemType>
class Stack
{
private:
struct Node
{
ItemType item;
Node* next;
Node* prev;
};
//int count;
Node* tail;
Node* head;
public:
ItemType top()
{
if(size()>0)
{
return tail->item;
}
else return -1;
}
void print()
{
Node* n=head;
std::cout<<"Stack("<<size()<<"): ";
while(n!=NULL)
{
std::cout<<n->item<<" ";
n=n->next;
}
std::cout<<std::endl;
}
bool doesExist(ItemType item)
{
Node* n=head;
while(n!=NULL)
{
if(n->item==item)
{
return true;
}
else n=n->next;
}
return false;
}
Stack() :head(NULL),tail(NULL){}
bool push(const ItemType& item)
{
if(!doesExist(item)&&item!=-1)
{
Node* n=new Node();
n->item=item;
if(tail==NULL)
{
head=n;
n->prev=NULL;
}
else
{
tail->next=n;
n->prev=tail;
}
n->next=NULL;
tail=n;
//std::cout<<"Added '"<<item
//<<"' to stack."<<std::endl;
return true;
}
else return false;
}
ItemType pop()
{
if(size()>0)
{
Node* n=tail;
ItemType item=n->item;
tail=n->prev;
if(size()==1)
{
head=NULL;
tail=NULL;
}
else
tail->next=NULL;
delete n;
//std::cout<<"Removed '"<<item
//<<"' from stack"<<std::endl;
return item;
}
else return -1;
}
int size()
{
int listcount=0;
Node* n=head;
if(head==NULL)
{
return 0;
}
while(n!=NULL)
{
listcount++;
n=n->next;
}
return listcount;
}
// ~Stack()
// {
// while(size()>0)
// {
// pop();
// }
// }
}; | 12.531746 | 37 | 0.514883 |
29b18e623e3d2d2a577918a078b5b55f89c1ce35 | 40,791 | h | C | dumpi/common/iodefs.h | sstsimulator/sst-dumpi | 3b0a38c5abbaed54c2f5bfa436db3ce4f025835b | [
"BSD-3-Clause"
] | 9 | 2016-11-10T23:58:57.000Z | 2020-12-30T02:16:52.000Z | dumpi/common/iodefs.h | sstsimulator/sst-dumpi | 3b0a38c5abbaed54c2f5bfa436db3ce4f025835b | [
"BSD-3-Clause"
] | 14 | 2016-11-29T15:58:29.000Z | 2021-08-31T23:38:57.000Z | dumpi/common/iodefs.h | sstsimulator/sst-dumpi | 3b0a38c5abbaed54c2f5bfa436db3ce4f025835b | [
"BSD-3-Clause"
] | 18 | 2016-07-11T18:55:50.000Z | 2021-11-01T07:15:30.000Z | /**
Copyright 2009-2021 National Technology and Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government
retains certain rights in this software.
Sandia National Laboratories is a multimission laboratory managed and operated
by National Technology and Engineering Solutions of Sandia, LLC., a wholly
owned subsidiary of Honeywell International, Inc., for the U.S. Department of
Energy's National Nuclear Security Administration under contract DE-NA0003525.
Copyright (c) 2009-2021, NTESS
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Questions? Contact sst-macro-help@sandia.gov
*/
/**
Copyright 2009-2018 National Technology and Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government
retains certain rights in this software.
Sandia National Laboratories is a multimission laboratory managed and operated
by National Technology and Engineering Solutions of Sandia, LLC., a wholly
owned subsidiary of Honeywell International, Inc., for the U.S. Department of
Energy's National Nuclear Security Administration under contract DE-NA0003525.
Copyright (c) 2009-2018, NTESS
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Questions? Contact sst-macro-help@sandia.gov
*/
#ifndef DUMPI_COMMON_IODEFS_H
#define DUMPI_COMMON_IODEFS_H
#include <dumpi/common/io.h>
#include <dumpi/common/types.h>
#include <dumpi/common/constants.h>
#include <dumpi/common/settings.h>
#include <dumpi/common/debugflags.h>
#include <dumpi/common/funcs.h>
#include <dumpi/dumpiconfig.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#ifndef DUMPI_ON_REDSTORM
#include <arpa/inet.h>
#endif /* ! DUMPI_ON_REDSTORM */
#ifdef __cplusplus
extern "C" {
#endif /* ! __cplusplus */
/**
* \ingroup common_io
* \defgroup common_io_internal common/io/internal: Internal functions \
* and utilities for shared I/O routines.
*/
/*@{*/ /* plop the documentation into the current module */
/**
* Free a memory buffer.
*/
void dumpi_free_membuf(struct dumpi_memory_buffer *buf);
/**
* Flush the memory buffer.
* Writes and sets the buffer position to zero iff file is not NULL.
*/
void dumpi_membuf_flush(dumpi_profile *profile);
/**
* Write to the memory buffer.
* If the memory buffer overflows and the input file is not NULL, this
* forces a dumpi_membuf_flush.
* If the memory buffer overflows and the input file is NULL, the buffer
* is doubled in size.
*/
void dumpi_membuf_write(dumpi_profile *profile, const void *ptr, size_t size,
size_t nmemb);
/**
* Despite the name, this reads straight from the file (we no longer do
* our own input file buffering).
*/
void dumpi_membuf_read(dumpi_profile *profile, void *ptr,
size_t size, size_t nmemb);
/**
* If file is not NULL, return (ftello(file) + dumpi_membuf_pos())
* else return dumpi_membuf_pos().
*/
off_t dumpi_membuf_tell(dumpi_profile *profile);
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_FLUSH(PROFILE) dumpi_membuf_flush(PROFILE)
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_FWRITE(PROFILE, PTR, SIZ, NMB) \
dumpi_membuf_write(PROFILE, PTR, SIZ, NMB)
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_FREAD(PROFILE, PTR, SIZ, NMB) \
dumpi_membuf_read(PROFILE, PTR, SIZ, NMB)
/*#define DUMPI_FREAD(PTR, SIZ, NMB, STR) assert(fread(PTR, SIZ, NMB, STR) == NMB)*/
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_GETC(FILE) fgetc(FILE)
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_WRITE_TELL(PROFILE) dumpi_membuf_tell(PROFILE)
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_READ_TELL(PROFILE) ftello(PROFILE->file)
/**
* Utility definition (dating back to when we used compressed files).
* May be deprecated at a later time.
*/
#define DUMPI_SEEK(PROFILE, OFFSET, WHENCE) \
fseeko(PROFILE->file, OFFSET, WHENCE)
/** Utility routine to get a 8 bit integer from a binary stream. */
static inline uint8_t get8(dumpi_profile *fp) {
uint8_t scratch;
off_t fpos = DUMPI_READ_TELL(fp);
DUMPI_FREAD(fp, &scratch, sizeof(uint8_t), 1);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] get8: Retrieved value %d (0x%02x) "
"at file offset 0x%llx\n", (int)scratch, (int)scratch,
(long long)fpos);
return scratch;
}
/** Utility routine to write a 8 bit integer to a binary stream. */
static inline void put8(dumpi_profile *fp, uint8_t value) {
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] put8: Putting value %d (0x%02x) "
"at file offset 0x%llx\n", (int)value, (int)value,
(long long)DUMPI_WRITE_TELL(fp));
DUMPI_FWRITE(fp, &value, sizeof(uint8_t), 1);
}
/** Utility routine to get a 16 bit integer from a binary stream. */
static inline uint16_t get16(dumpi_profile *fp) {
uint16_t scratch, retval;
off_t fpos = DUMPI_READ_TELL(fp);
DUMPI_FREAD(fp, &scratch, sizeof(uint16_t), 1);
retval = ntohs(scratch);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] get16: Retrieved value %hu from "
"stream value 0x%04hx at file offset 0x%llx\n",
retval, scratch, (long long)fpos);
return retval;
}
/** Utility routine to write a 16 bit integer to a binary stream. */
static inline void put16(dumpi_profile *fp, uint16_t value) {
uint16_t bevalue = htons(value);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] put16: Putting value %hu as "
"stream value 0x%04hx at file offset 0x%llx\n",
value, bevalue, (long long)DUMPI_WRITE_TELL(fp));
DUMPI_FWRITE(fp, &bevalue, sizeof(uint16_t), 1);
}
/** Utility routine to get a 32 bit integer from a binary stream. */
static inline uint32_t get32(dumpi_profile *fp) {
uint32_t scratch, retval;
off_t fpos = DUMPI_READ_TELL(fp);
DUMPI_FREAD(fp, &scratch, sizeof(uint32_t), 1);
retval = ntohl(scratch);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] get32: Retrieved value %u from "
"stream value 0x%08x at file offset 0x%llx\n",
retval, scratch, (long long)fpos);
return retval;
}
/** Utility routine to write a 32 bit integer to a binary stream. */
static inline void put32(dumpi_profile *fp, uint32_t value) {
uint32_t bevalue = htonl(value);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] put32: Putting value %u as "
"stream value 0x%08x at file offset 0x%llx\n",
value, bevalue, (long long)DUMPI_WRITE_TELL(fp));
DUMPI_FWRITE(fp, &bevalue, sizeof(uint32_t), 1);
}
/** Utility routine to get an array of 32-bit values. */
static inline void get32arr(dumpi_profile *fp,
int32_t *count, int32_t **arr)
{
int i;
*count = get32(fp);
if(*count > 0)
*arr = (int32_t*)malloc(*count * sizeof(int32_t));
else
*arr = NULL;
for(i = 0; i < *count; ++i) {
(*arr)[i] = get32(fp);
}
}
/** Utility routine to write an array of 32-bit values. */
static inline void put32arr(dumpi_profile *fp,
int32_t count, const int32_t *arr)
{
int i;
put32(fp, count);
for(i = 0; i < count; ++i) {
put32(fp, arr[i]);
}
}
/** Utility routine to read an array of characters. */
static inline void getchararr(dumpi_profile *fp, int32_t *count, char **arr) {
off_t startpos, endpos;
assert(arr != NULL);
startpos = DUMPI_READ_TELL(fp);
*count = get32(fp);
*arr = (char*)calloc((*count+1), sizeof(char));
assert(*arr != NULL);
if(*count > 0)
DUMPI_FREAD(fp, *arr, (*count)*sizeof(char), 1);
endpos = DUMPI_READ_TELL(fp);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] getchararr: Read std::string \"%s\" with "
"length %d starting at file offset 0x%llx and ending at 0x%llx\n",
*arr, *count, (long long)startpos, (long long)endpos);
}
/** Utility routine to write an array of 32-bit values. */
static inline void putchararr(dumpi_profile *fp,
int64_t countarg, const char *arr)
{
int32_t count = (int32_t) countarg;
off_t startpos, endpos;
startpos = DUMPI_WRITE_TELL(fp);
put32(fp, count);
DUMPI_FWRITE(fp, arr, count*sizeof(char), 1);
endpos = DUMPI_WRITE_TELL(fp);
if(dumpi_debug & DUMPI_DEBUG_TRACEIO_VERBOSE)
fprintf(stderr, "[DUMPI-IO-VERBOSE] putchararr: Wrote std::string \"%s\" with"
" length %d starting at file offset 0x%llx and ending at 0x%llx\n",
arr, count, (long long)startpos, (long long)endpos);
}
/* Utility routine to write a 2D array of 32-bit values. */
/*
static inline
void put32arr2(dumpi_profile *fp,
int32_t rows, int32_t cols, const int32_t * const* arr)
{
int i, j;
put32(fp, rows);
put32(fp, cols);
for(i = 0; i < rows; ++i) {
for(j = 0; j < cols; ++j) {
put32(fp, arr[i][j]);
}
}
}
*/
/* Utility routine to read a 2D array of 32-bit values. */
/*
static inline
void get32arr2(dumpi_profile *fp, int32_t *rows, int32_t *cols,
int32_t **arr)
{
int i, j;
*rows = get32(fp);
*cols = get32(fp);
arr = (int**)calloc((*rows)+1, sizeof(int32_t*));
assert(arr != NULL);
for(i = 0; i < *rows; ++i) {
arr[i] = (int*)malloc((*cols)*sizeof(int32_t));
for(j = 0; j < *cols; ++j) {
arr[i][j] = get32(fp);
}
}
}
*/
/** Utility routine to get a 64 bit integer from a binary stream. */
static inline uint64_t get64(dumpi_profile *fp) {
uint64_t value;
uint32_t high32, low32;
DUMPI_FREAD(fp, &high32, sizeof(uint32_t), 1);
DUMPI_FREAD(fp, &low32, sizeof(uint32_t), 1);
/* Pack the high and low values into a 64-bit value). */
value = ntohl(high32);
value <<= 32;
value |= ntohl(low32);
return value;
}
/** Utility routine to write a 64 bit integer to a binary stream. */
static inline void put64(dumpi_profile *fp, uint64_t value) {
uint32_t high32, low32;
high32 = htonl((uint32_t)(value >> 32));
low32 = htonl((uint32_t)(value));
DUMPI_FWRITE(fp, &high32, sizeof(uint32_t), 1);
DUMPI_FWRITE(fp, &low32, sizeof(uint32_t), 1);
}
/** Utility routine to store a single request value */
static inline void put_single_request(dumpi_profile *fp,
dumpi_request request)
{
put32(fp, request);
}
/** Utility routine to retrieve a single request value */
static inline dumpi_request get_single_request(dumpi_profile *fp) {
return get32(fp);
}
/** Write an array of requests to the stream */
static inline void put_requests(dumpi_profile *fp,
int count, dumpi_request *req)
{
int i;
put32(fp, count);
for(i = 0; i < count; ++i)
put_single_request(fp, req[i]);
}
/* Retrieve an array of request handles from the stream */
static inline void get_requests(dumpi_profile *fp,
int *count, dumpi_request **req)
{
int i;
*count = get32(fp);
*req = (dumpi_request*)malloc(*count * sizeof(dumpi_request));
assert(req);
for(i = 0; i < *count; ++i)
(*req)[i] = get_single_request(fp);
}
/** Read the token for next function. */
static inline dumpi_function dumpi_read_next_function(dumpi_profile *profile)
{
uint16_t next = get16(profile);
/*fprintf(stderr, "Encountered function label %d at offset 0x%llx\n",
(int)next, (long long)DUMPI_READ_TELL(profile));*/
assert(next <= DUMPI_END_OF_STREAM);
if(next != DUMPI_ALL_FUNCTIONS)
return ((dumpi_function)next);
return (dumpi_function)NULL;
}
/** Utility routine to put a function label. */
static inline void put_function_label(dumpi_profile *profile,
dumpi_function fun)
{
put16(profile, (uint16_t)fun);
}
/** Utility routine to get a function label. */
static inline dumpi_function get_function_label(dumpi_profile *profile) {
return ((dumpi_function)get16(profile));
}
/** Utility routine to store a config mask. */
static inline void put_config_mask(dumpi_profile *profile,
const dumpi_perfinfo *perf,
const dumpi_outputs *output)
{
uint8_t mask = (uint8_t)(output->timestamps | output->statuses);
if(output->perfinfo && (perf != NULL && perf->count > 0))
mask |= DUMPI_PERFINFO_MASK;
/* Added to output thread index. */
mask |= DUMPI_THREADID_MASK;
put8(profile, mask);
}
/** Utility routine to retrieve a config mask. */
static inline uint8_t get_config_mask(dumpi_profile *profile) {
uint8_t mask = get8(profile);
return mask;
}
/** Test whether we are reading/writing CPU clock information */
#define DO_TIME_CPU(MASK) (MASK & DUMPI_TIME_CPU)
/** Test whether we are reading/writing wall time information */
#define DO_TIME_WALL(MASK) (MASK & DUMPI_TIME_WALL)
/** Test whether we are reading/writing performance counter information */
#define DO_PERFINFO(MASK) (MASK & DUMPI_PERFINFO_MASK)
/** Utility routine write timestamps to the stream */
static inline void put_times(dumpi_profile *profile,
const dumpi_time *cpu, const dumpi_time *wall,
uint8_t config_mask)
{
if(DO_TIME_CPU(config_mask)) {
put16(profile, (uint16_t)(cpu->start.sec - profile->cpu_time_offset));
put32(profile, cpu->start.nsec);
put16(profile, (uint16_t)(cpu->stop.sec - profile->cpu_time_offset));
put32(profile, cpu->stop.nsec);
}
if(DO_TIME_WALL(config_mask)) {
put16(profile, (uint16_t)(wall->start.sec - profile->wall_time_offset));
put32(profile, wall->start.nsec);
put16(profile, (uint16_t)(wall->stop.sec - profile->wall_time_offset));
put32(profile, wall->stop.nsec);
}
}
/* Utility routine to read timestamps from the stream */
static inline void get_times(dumpi_profile *profile, dumpi_time *cpu,
dumpi_time *wall, uint8_t config_mask)
{
if(DO_TIME_CPU(config_mask)) {
cpu->start.sec = get16(profile) + profile->cpu_time_offset;
cpu->start.nsec = get32(profile);
cpu->stop.sec = get16(profile) + profile->cpu_time_offset;
cpu->stop.nsec = get32(profile);
}
else {
cpu->start.sec = cpu->start.nsec = 0;
cpu->stop.sec = cpu->stop.nsec = 0;
}
if(DO_TIME_WALL(config_mask)) {
wall->start.sec = get16(profile) + profile->wall_time_offset;
wall->start.nsec = get32(profile);
wall->stop.sec = get16(profile) + profile->wall_time_offset;
wall->stop.nsec = get32(profile);
}
else {
wall->start.sec = wall->start.nsec = 0;
wall->stop.sec = wall->stop.nsec = 0;
}
}
/** Utility routine to write a std::string. */
static inline void put_string(dumpi_profile *profile, const char *str) {
uint16_t len = (str ? (uint16_t)strlen(str) : 0);
put16(profile, len);
DUMPI_FWRITE(profile, str, sizeof(char), len);
}
/** Utility routine to read (and allocate) a std::string. */
static inline char* get_string(dumpi_profile *fp) {
char *str;
uint16_t len = get16(fp);
str = (char*)malloc(len+1); str[len] = '\0';
DUMPI_FREAD(fp, str, sizeof(char), len);
return str;
}
/** Utility routine to read a std::string into a preallocated buffer. */
static inline void get_fix_string(dumpi_profile *fp,
char *dest, size_t maxsize)
{
uint16_t len = get16(fp);
assert(len < maxsize);
DUMPI_FREAD(fp, dest, sizeof(char), len);
dest[len] = '\0';
}
/** Put an array of std::strings. */
static inline void put_string_arr(dumpi_profile *fp, int count, char **arr) {
int i;
put32(fp, count);
for(i = 0; i < count; ++i)
put_string(fp, arr[i]);
}
/** Get an array of std::strings */
static inline void get_string_arr(dumpi_profile *fp, int *count, char ***arr){
int i;
*count = get32(fp);
*arr = (char**)malloc(*count * sizeof(char*));
for(i = 0; i < *count; ++i) {
(*arr)[i] = get_string(fp);
}
}
/** Write PAPI performance counter state to the stream */
static inline void put_perfinfo(dumpi_profile *profile,
const dumpi_perfinfo *perf,
const dumpi_outputs *output)
{
assert(profile);
if(output->perfinfo && (perf != NULL && perf->count > 0)) {
int i;
put8(profile, (uint8_t)perf->count);
for(i = 0; i < perf->count; ++i) {
/* put_string(profile, perf->counter_tag[i]); */
put64(profile, perf->invalue[i]);
put64(profile, perf->outvalue[i]);
}
}
}
/** Read PAPI performance counter state from the stream */
static inline void get_perfinfo(dumpi_profile *profile,
dumpi_perfinfo *perf, uint8_t config_mask)
{
perf->count = 0;
if(DO_PERFINFO(config_mask)) {
int i;
perf->count = get8(profile);
/* Read the std::string labels for the performance counters */
dumpi_read_perfctr_labels(profile, &perf->count, perf->counter_tag,
DUMPI_MAX_PERFCTR_NAME);
/* Done reading std::string labels -- get the actual values */
for(i = 0; i < perf->count; ++i) {
perf->invalue[i] = get64(profile);
perf->outvalue[i] = get64(profile);
}
}
}
/** Utility routine to put statuses as requested by the mask */
static inline void put_statuses(dumpi_profile *profile,
int count, const dumpi_status *statuses,
const dumpi_outputs *output)
{
if(output->statuses) {
if(statuses != NULL) {
int i;
put32(profile, count);
for(i = 0; i < count; ++i) {
put32(profile, statuses[i].bytes);
put32(profile, statuses[i].source);
put8(profile, statuses[i].cancelled);
put8(profile, statuses[i].error);
/* There was a mistake in versions prior to 0.6.3 where
* the tag associated with a status wasn't being saved/restored */
if(dumpi_have_version(profile->version, 0, 6, 3)) {
put32(profile, statuses[i].tag);
}
}
}
else {
put32(profile, 0);
}
}
}
/** Utility routine to get statuses as requested by the mask */
static inline dumpi_status* get_statuses(dumpi_profile *profile,
uint8_t config_mask)
{
dumpi_status *statuses = NULL;
if(config_mask & DUMPI_ENABLE) {
int i;
int count = get32(profile);
if(count > 0) {
statuses = (dumpi_status*)malloc(count * sizeof(dumpi_status));
for(i = 0; i < count; ++i) {
statuses[i].bytes = get32(profile);
statuses[i].source = get32(profile);
statuses[i].cancelled = get8(profile);
statuses[i].error = get8(profile);
/* There was a mistake in versions prior to 0.6.3 where
* the tag associated with a status wasn't being saved/restored */
if(dumpi_have_version(profile->version, 0, 6, 3)) {
statuses[i].tag = get32(profile);
}
else {
statuses[i].tag = DUMPI_ANY_TAG;
}
}
}
else {
statuses = DUMPI_STATUS_IGNORE;
}
}
return statuses;
}
/** Shared back-end stuff when starting a new profiled call */
#define STARTWRITE(PROFILE, LABEL) \
assert(val && profile); \
if(output->function[LABEL]) { \
if(dumpi_debug & DUMPI_DEBUG_TRACEIO) { \
fprintf(stderr, "[DUMPI-IO] Writing record for " #LABEL \
" at offset 0x%llx\n", \
(long long)DUMPI_WRITE_TELL(PROFILE)); \
} \
put_function_label(PROFILE, LABEL); \
put_config_mask(PROFILE, perf, output); \
put16(PROFILE, thread); \
put_times(PROFILE, cpu, wall, output->timestamps); \
put_perfinfo(PROFILE, perf, output);
/** Shared back-end stuff when ending a profiled call */
#define ENDWRITE(PROFILE) \
if(dumpi_debug & DUMPI_DEBUG_TRACEIO) { \
fprintf(stderr, "[DUMPI-IO] Completed record at offset 0x%llx\n", \
(long long)DUMPI_WRITE_TELL(PROFILE)); \
} \
}
/*
#define STARTREAD(LABEL) \
uint8_t label, config_mask; \
assert(val && profile && profile); \
label = get_function_label(profile); \
assert(label == LABEL); \
config_mask = get_config_mask(profile); \
get_times(profile, &val->cpu, &val->wall, config_mask);
*/
/** Shared back-end stuff when starting to read a profiled call */
#define STARTREAD(PROFILE, LABEL) \
uint8_t config_mask; \
if(dumpi_debug & DUMPI_DEBUG_TRACEIO) { \
/* we need to correct the file offset by 2 bytes, because we */ \
/* already gobbled up the function label (uint16_t) */ \
fprintf(stderr, "[DUMPI-IO] Reading record for " #LABEL \
" at offset 0x%llx\n", \
(long long)DUMPI_READ_TELL(PROFILE)-sizeof(uint16_t)); \
} \
assert(val && PROFILE && PROFILE->file); \
config_mask = get_config_mask(PROFILE); \
if(config_mask & DUMPI_THREADID_MASK) \
*thread = get16(profile); \
get_times(PROFILE, cpu, wall, config_mask); \
get_perfinfo(PROFILE, perf, config_mask);
/** Shared back-end stuff when finishing a read */
#define ENDREAD(PROFILE) do { \
if(dumpi_debug & DUMPI_DEBUG_TRACEIO) { \
fprintf(stderr, "[DUMPI-IO] Completed reading record at offset 0x%llx\n", \
(long long)DUMPI_READ_TELL(PROFILE)); \
} \
} while(0)
/** Utility definition for integer output */
#define PUT_INT(PROFILE, VAR) put32(PROFILE, ((uint32_t)(VAR)))
/** Utility definition for integer input */
#define GET_INT(PROFILE) get32(profile)
/** Utility definition for integer output */
#define PUT_INT16(PROFILE, VAR) put16(PROFILE, VAR)
/** Utility definition for integer input */
#define GET_INT16(PROFILE) get16(PROFILE)
/** Utility definition for integer output */
#define PUT_INT8(PROFILE, VAR) put8(PROFILE, VAR)
/** Utility definition for integer input */
#define GET_INT8(PROFILE) get8(PROFILE)
/** Utility definition for handling integer arrays */
#define PUT_INT_ARRAY_1(PROFILE, TERM, VALUE) do { \
int i0, len=0; \
for(i0 = 0; TERM; ++i0) ++len; \
put32arr(PROFILE, len, VALUE); \
} while(0)
/** Utility definition for handling integer arrays */
#define GET_INT_ARRAY_1(PROFILE, LEN, VALUE) do { \
get32arr(PROFILE, &(LEN), &(VALUE)); \
} while(0)
/** Utility definition for handling integer arrays */
#define PUT_INT_ARRAY_2(PROFILE, TERM0, TERM1, VALUE) do { \
int i0, i1, len0=0, len1=0; \
for(i0 = 0; (TERM0); ++i0) ++len0; \
put32(PROFILE, len0); \
/* Allow irregular arrays */ \
for(i0 = 0; i0 < len0; ++i0) { \
len1 = 0; \
if((VALUE[i0]) == NULL) { \
put32(PROFILE, 0); \
} \
else { \
for(i1 = 0; TERM1; ++i1) ++len1; \
put32arr(PROFILE, len1, (VALUE)[i0]); \
} \
} \
} while(0)
#define PUT_INT_ARRAY_2B(PROFILE, LEN0, LEN1, VALUE) do { \
int i0; \
put32(PROFILE, LEN0); \
for(i0 = 0; i0 < LEN0; ++i0) { \
put32arr(PROFILE, LEN1, (VALUE)[i0]); \
} \
} while(0)
/** Utility definition for handling integer arrays */
#define GET_INT_ARRAY_2(PROFILE, LEN0, LEN1, VALUE) do { \
int i0; \
LEN0 = get32(PROFILE); \
VALUE = (int**)calloc(LEN0+1, sizeof(int*)); \
assert((VALUE) != NULL); \
for(i0 = 0; i0 < (LEN0); ++i0) { \
get32arr(PROFILE, &(LEN1), (VALUE) + i0); \
} \
} while(0)
/** Utility definition for handling character arrays */
#define PUT_CHAR_ARRAY_1(PROFILE, TERM, VALUE) do { \
int i0, len=0; \
char v0 = VALUE[0]; \
for(i0 = 0; TERM; ++i0) { ++len; v0=VALUE[len]; } \
putchararr(PROFILE, len, VALUE); \
} while(0)
/** Utility definition for handling character arrays */
#define GET_CHAR_ARRAY_1(PROFILE, LEN, VALUE) do { \
getchararr(PROFILE, &(LEN), &(VALUE)); \
} while(0)
/** Utility definition for handling character arrays */
#define PUT_CHAR_ARRAY_2(PROFILE, TERM0, TERM1, VALUE) do { \
int i0, i1, len0=0, len1=0; \
char *v0 = NULL; \
char v1 = VALUE[0][0]; \
if((VALUE) != NULL) \
v0 = VALUE[0]; \
for(i0 = 0; (TERM0); ++i0) { ++len0; v0 = VALUE[len0]; } \
put32(PROFILE, len0); \
/* Allow irregular arrays */ \
for(i0 = 0; i0 < len0; ++i0) { \
v1 = VALUE[i0][0]; \
len1 = 0; \
for(i1 = 0; TERM1; ++i1) { ++len1; v1=VALUE[i0][len1]; } \
putchararr(PROFILE, len1, (VALUE)[i0]); \
} \
} while(0)
/*#define GET_CHAR_ARRAY_2(PROFILE, LEN0, LEN1, VALUE) do { \
int i0; \
LEN0 = get32(PROFILE); \
VALUE = (char**)calloc((LEN0)+1, sizeof(char*)); \
for(i0 = 0; i0 < (LEN0); ++i0) { \
getchararr(PROFILE, &(LEN1), ((VALUE)+i0)); \
} \
} while(0)
*/
/** Utility definition for handling character arrays */
#define GET_CHAR_ARRAY_2(PROFILE, LEN0, LEN1, VALUE) \
do_get_char_array_2(profile, &LEN0, &LEN1, &VALUE)
/** A "debuggable" version of how we retrieve an array of std::strings */
static inline
void do_get_char_array_2(dumpi_profile *profile, int *len0, int *len1,
char ***value)
{
int i0;
*len0 = get32(profile);
*value = (char**)calloc((*len0)+1, sizeof(char*));
for(i0 = 0; i0 < (*len0); ++i0) {
getchararr(profile, len1, ((*value)+i0));
}
}
/** Utility definition for handling character arrays */
#define PUT_CHAR_ARRAY_3(PROFILE, TERM0, TERM1, TERM2, VALUE) do { \
int i0, i1, i2, len0=0, len1=0, len2=0; \
char **v0 = NULL, *v1 = NULL, v2 = '\0'; \
if((VALUE) == NULL) { \
put32(PROFILE, 0); \
} \
else { \
v0 = VALUE[0]; \
for(i0 = 0; (TERM0); ++i0) { ++len0; v0 = VALUE[len0]; } \
put32(PROFILE, len0); \
/* Allow irregular arrays */ \
for(i0 = 0; i0 < len0; ++i0) { \
if(VALUE[i0] == NULL) { \
put32(PROFILE, 0); \
} \
else { \
v1 = VALUE[i0][0]; \
len1 = 0; \
for(i1 = 0; TERM1; ++i1) { ++len1; v1=VALUE[i0][len1]; } \
put32(PROFILE, len1); \
for(i1 = 0; i1 < len1; ++i1) { \
v2 = VALUE[i0][i1][0]; \
len2 = 0; \
for(i2 = 0; TERM2; ++i2) { ++len2; v2=VALUE[i0][i1][len2]; } \
putchararr(PROFILE, len2, (VALUE)[i0][i1]); \
} \
} \
} \
} \
} while(0)
/** Utility definition for handling character arrays */
#define GET_CHAR_ARRAY_3(PROFILE, LEN0, LEN1, LEN2, VALUE) do { \
int i0, i1; \
LEN0 = get32(PROFILE); \
VALUE = (char***)calloc((LEN0)+1, sizeof(char**)); \
for(i0 = 0; i0 < (LEN0); ++i0) { \
LEN1 = get32(PROFILE); \
VALUE[i0] = (char**)calloc((LEN1)+1, sizeof(char*)); \
for(i1 = 0; i1 < (LEN1); ++i1) { \
getchararr(PROFILE, &(LEN2), ((VALUE[i0])+i1)); \
} \
} \
} while(0)
#define PUT_DUMPI_COMBINER(PROFILE, VALUE) PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_COMBINER(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_COMM(PROFILE, VALUE) PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_COMM(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_COMPARISON(PROFILE, VALUE) \
PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_COMPARISON(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_DATATYPE(PROFILE, VALUE) \
PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_DATATYPE(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_DATATYPE_ARRAY_1(PROFILE, TERM, VALUE) do { \
int i0, len0=0; \
for(i0 = 0; (TERM); ++i0) ++len0; \
put32(PROFILE, len0); \
for(i0 = 0; i0 < len0; ++i0) \
PUT_DUMPI_DATATYPE(PROFILE, VALUE[i0]); \
} while(0)
#define GET_DUMPI_DATATYPE_ARRAY_1(PROFILE, LEN, VALUE) do { \
int i0; \
LEN = get32(PROFILE); \
VALUE = (dumpi_datatype*)calloc((LEN)+1, sizeof(dumpi_datatype)); \
for(i0 = 0; i0 < LEN; ++i0) \
VALUE[i0] = GET_DUMPI_DATATYPE(PROFILE); \
} while(0)
#define PUT_DUMPI_DEST(PROFILE, VALUE) PUT_INT(PROFILE, VALUE)
#define GET_DUMPI_DEST(PROFILE) GET_INT(PROFILE)
#define PUT_DUMPI_DISTRIBUTION(PROFILE, VALUE) \
PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_DISTRIBUTION(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_DISTRIBUTION_ARRAY_1(PROFILE, TERM, VALUE) do { \
int i0, len=0; \
for(i0 = 0; TERM; ++i0) ++len; \
put32(PROFILE, len); \
for(i0 = 0; i0 < len; ++i0) \
PUT_DUMPI_DISTRIBUTION(PROFILE, VALUE[i0]); \
} while(0)
#define GET_DUMPI_DISTRIBUTION_ARRAY_1(PROFILE, LEN, VALUE) do { \
int i0; \
LEN = get32(PROFILE); \
VALUE = (dumpi_distribution*)calloc((LEN)+1, sizeof(dumpi_info)); \
for(i0 = 0; i0 < (LEN); ++i0) \
VALUE[i0] = GET_DUMPI_DISTRIBUTION(PROFILE); \
} while(0)
#define PUT_DUMPI_ERRCODE(PROFILE, VALUE) PUT_INT32(PROFILE, VALUE)
#define GET_DUMPI_ERRCODE(PROFILE) GET_INT32(PROFILE)
#define PUT_DUMPI_ERRCODE_ARRAY_1(PROFILE, TERM, VALUE) \
PUT_INT_ARRAY_1(PROFILE, TERM, VALUE)
#define GET_DUMPI_ERRCODE_ARRAY_1(PROFILE, TERM, VALUE) \
GET_INT_ARRAY_1(PROFILE, TERM, VALUE)
#define PUT_DUMPI_ERRHANDLER(PROFILE, VALUE) \
PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_ERRHANDLER(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_FILE(PROFILE, VALUE) PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_FILE(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_FILEMODE(PROFILE, VALUE) PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_FILEMODE(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_GROUP(PROFILE, VALUE) PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_GROUP(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_INFO(PROFILE, VALUE) PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_INFO(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_INFO_ARRAY_1(PROFILE, TERM, VALUE) do { \
int i0, len=0; \
for(i0 = 0; TERM; ++i0) ++len; \
put32(PROFILE, len); \
for(i0 = 0; i0 < len; ++i0) \
PUT_DUMPI_INFO(PROFILE, VALUE[i0]); \
} while(0)
#define GET_DUMPI_INFO_ARRAY_1(PROFILE, LEN, VALUE) do { \
int i0; \
LEN = get32(PROFILE); \
VALUE = (dumpi_info*)calloc((LEN)+1, sizeof(dumpi_info)); \
for(i0 = 0; i0 < (LEN); ++i0) \
VALUE[i0] = GET_DUMPI_INFO(PROFILE); \
} while(0)
#define PUT_DUMPI_KEYVAL(PROFILE, VALUE) PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_KEYVAL(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_COMM_KEYVAL(PROFILE, VALUE) \
PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_COMM_KEYVAL(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_TYPE_KEYVAL(PROFILE, VALUE) \
PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_TYPE_KEYVAL(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_WIN_KEYVAL(PROFILE, VALUE) \
PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_WIN_KEYVAL(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_LOCKTYPE(PROFILE, VALUE) \
PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_LOCKTYPE(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_OP(PROFILE, VALUE) PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_OP(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_ORDERING(PROFILE, VALUE) PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_ORDERING(PROFILE) GET_INT8(PROFILE)
/* Due to a program bug, DUMPI prior to version 0.6.7
* stored requests as 8-bit values (inside a 32-bit memory region) */
#define PUT_DUMPI_REQUEST(PROFILE, VALUE) PUT_INT(PROFILE, VALUE)
#define GET_DUMPI_REQUEST(PROFILE) GET_INT(PROFILE)
#define PUT_DUMPI_REQUEST_ARRAY_1(PROFILE, TERM, VALUE) \
PUT_INT_ARRAY_1(PROFILE, TERM, VALUE)
#define GET_DUMPI_REQUEST_ARRAY_1(PROFILE, TERM, VALUE) \
GET_INT_ARRAY_1(PROFILE, TERM, VALUE)
#define PUT_DUMPI_SOURCE(PROFILE, VALUE) PUT_INT(PROFILE, VALUE)
#define GET_DUMPI_SOURCE(PROFILE) GET_INT(PROFILE)
#define PUT_DUMPI_STATUS(PROFILE, VALUE) put_statuses(PROFILE, 1, VALUE, output)
#define GET_DUMPI_STATUS(PROFILE) get_statuses(PROFILE, config_mask)
#define PUT_DUMPI_STATUS_ARRAY_1(PROFILE, TERM0, VALUE) do { \
int i0, len0=0; \
for(i0 = 0; (TERM0); ++i0) ++len0; \
put_statuses(PROFILE, len0, VALUE, output); \
} while(0)
#define GET_DUMPI_STATUS_ARRAY_1(PROFILE, LEN, VALUE) \
VALUE = get_statuses(PROFILE, config_mask)
#define PUT_DUMPI_TAG(PROFILE, VALUE) PUT_INT(PROFILE, VALUE)
#define GET_DUMPI_TAG(PROFILE) (dumpi_tag)GET_INT(PROFILE)
#define PUT_DUMPI_THREADLEVEL(PROFILE, VALUE) \
PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_THREADLEVEL(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_TOPOLOGY(PROFILE, VALUE) PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_TOPOLOGY(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_TYPECLASS(PROFILE, VALUE) \
PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_TYPECLASS(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_WHENCE(PROFILE, VALUE) PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_WHENCE(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPI_WIN(PROFILE, VALUE) PUT_INT16(PROFILE, ((uint16_t)(VALUE)))
#define GET_DUMPI_WIN(PROFILE) GET_INT16(PROFILE)
#define PUT_DUMPI_WIN_ASSERT(PROFILE, VALUE) \
PUT_INT8(PROFILE, ((uint8_t)(VALUE)))
#define GET_DUMPI_WIN_ASSERT(PROFILE) GET_INT8(PROFILE)
#define PUT_DUMPIO_REQUEST(PROFILE, VALUE) PUT_DUMPI_REQUEST(PROFILE, VALUE)
#define GET_DUMPIO_REQUEST(PROFILE) GET_DUMPI_REQUEST(PROFILE)
#define PUT_DUMPIO_REQUEST_ARRAY_1(PROFILE, TERM, VALUE) \
PUT_DUMPI_REQUEST_ARRAY_1(PROFILE, TERM, VALUE)
#define GET_DUMPIO_REQUEST_ARRAY_1(PROFILE, TERM, VALUE) \
GET_DUMPI_REQUEST_ARRAY_1(PROFILE, TERM, VALUE)
#define PUT_INT64_T(PROFILE, VALUE) put64(PROFILE, VALUE)
#define GET_INT64_T(PROFILE) get64(PROFILE)
/*@}*/ /* Close the scope of the doxygen module */
#ifdef __cplusplus
}
#endif /* ! __cplusplus */
#endif /* ! DUMPI_COMMON_IODEFS_H */
| 38.482075 | 87 | 0.605624 |
094fb5da16a2e79379bc5e0a9eb10f0746867b7f | 1,877 | h | C | usr/libexec/itunesstored/KeyValueStore.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | 2 | 2021-04-15T10:50:21.000Z | 2021-08-19T19:00:09.000Z | usr/sbin/usr/libexec/itunesstored/KeyValueStore.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | usr/sbin/usr/libexec/itunesstored/KeyValueStore.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | //
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <objc/NSObject.h>
@class SSKeyValueStore;
@protocol OS_dispatch_queue;
@interface KeyValueStore : NSObject
{
NSObject<OS_dispatch_queue> *_dispatchQueue; // 8 = 0x8
SSKeyValueStore *_keyValueStore; // 16 = 0x10
}
+ (void)setValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b04ac
+ (void)removeValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b0468
+ (void)removeAllValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b0424
+ (void)removeAccountWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b03e0
+ (void)observeXPCServer:(id)arg1; // IMP=0x00000001001b0328
+ (void)getValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b0250
+ (id)defaultKeyValueStore; // IMP=0x00000001001b0048
- (void)_setValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b0d80
- (void)_removeValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b0bd0
- (void)_removeAllValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b0a60
- (void)_removeAccountWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b098c
- (void)_handleMessage:(id)arg1 connection:(id)arg2 withReplyBlock:(CDUnknownBlockType)arg3; // IMP=0x00000001001b0858
- (void)_handleMessage:(id)arg1 connection:(id)arg2 withBlock:(CDUnknownBlockType)arg3; // IMP=0x00000001001b074c
- (void)_getValuesWithMessage:(id)arg1 connection:(id)arg2; // IMP=0x00000001001b04f0
- (id)valueForDomain:(id)arg1 key:(id)arg2; // IMP=0x00000001001b00f0
- (void)setValue:(id)arg1 forDomain:(id)arg2 key:(id)arg3; // IMP=0x00000001001b00e0
- (void)dealloc; // IMP=0x00000001001afff4
- (id)init; // IMP=0x00000001001aff88
@end
| 48.128205 | 120 | 0.769845 |
71375c9ffe6c6a9c1833d53ce557357415fb4736 | 619 | h | C | Example/Pods/Target Support Files/MGCategoryKit/MGCategoryKit-umbrella.h | shisanshu101/MGSPecs | caae3d79176ee4b51473d5706023dcd5ad55291c | [
"MIT"
] | null | null | null | Example/Pods/Target Support Files/MGCategoryKit/MGCategoryKit-umbrella.h | shisanshu101/MGSPecs | caae3d79176ee4b51473d5706023dcd5ad55291c | [
"MIT"
] | null | null | null | Example/Pods/Target Support Files/MGCategoryKit/MGCategoryKit-umbrella.h | shisanshu101/MGSPecs | caae3d79176ee4b51473d5706023dcd5ad55291c | [
"MIT"
] | null | null | null | #ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "Class.h"
#import "GlobalNotificationConstant.h"
#import "GlobalThirdConfiguration.h"
#import "MacroDefinition.h"
#import "MGCommonConstants.h"
#import "NSArray+Extension.h"
#import "NSDictionary+Extension.h"
#import "NSString+Extension.h"
#import "UIColor+Hex.h"
#import "UIView+Extension.h"
FOUNDATION_EXPORT double MGCategoryKitVersionNumber;
FOUNDATION_EXPORT const unsigned char MGCategoryKitVersionString[];
| 22.925926 | 67 | 0.807754 |
05d85e55dfacb0764d4f9397380831321b39462c | 583 | h | C | Login System/Server/logs/include/logs.h | IsaakGomes/Login-System-in-C | 89a7e59c77141c8205b16bc1ab3a01b9f0019f8d | [
"MIT"
] | null | null | null | Login System/Server/logs/include/logs.h | IsaakGomes/Login-System-in-C | 89a7e59c77141c8205b16bc1ab3a01b9f0019f8d | [
"MIT"
] | null | null | null | Login System/Server/logs/include/logs.h | IsaakGomes/Login-System-in-C | 89a7e59c77141c8205b16bc1ab3a01b9f0019f8d | [
"MIT"
] | null | null | null | #ifndef LOGS_H
#define LOGS_H
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#define LOG_SRV "logs/server_logs.txt"
#define LOG_SRV_C "logs/connection_logs.txt"
#define LOG_DB "logs/database_connection_logs.txt"
#define LOG_ALL "logs/all_logs.txt"
extern void g_time(char *timer_info);
extern void w_log(const char *error, const char *action, const char *log_file, short int enter);
extern void w_connection_log(const char *error, const char *client_addr, const char *action, const char *log_file, short int enter);
#endif | 30.684211 | 132 | 0.763293 |
799fb765ee4164427d8006f1cfc2143bc2fe74dd | 34 | c | C | tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/readdir.c | 7perl/akaros | 19eb5f42223afd2be2968fef4dd50b940045ac90 | [
"LPL-1.02"
] | 1 | 2022-01-10T23:42:13.000Z | 2022-01-10T23:42:13.000Z | tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/readdir.c | 7perl/akaros | 19eb5f42223afd2be2968fef4dd50b940045ac90 | [
"LPL-1.02"
] | null | null | null | tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/readdir.c | 7perl/akaros | 19eb5f42223afd2be2968fef4dd50b940045ac90 | [
"LPL-1.02"
] | null | null | null | #include <sysdeps/unix/readdir.c>
| 17 | 33 | 0.764706 |
79a7dbdb5975f67e7e24bd0d0168b7f56db642eb | 1,801 | h | C | Driver/kernelmode/stdafx.h | egssy0/FancyCheats | 1521c850857e7da7bd3e7db2301393aeeef68394 | [
"Apache-2.0"
] | 1 | 2021-07-01T16:23:44.000Z | 2021-07-01T16:23:44.000Z | Driver/kernelmode/stdafx.h | zanzo420/FancyCheats | 1521c850857e7da7bd3e7db2301393aeeef68394 | [
"Apache-2.0"
] | null | null | null | Driver/kernelmode/stdafx.h | zanzo420/FancyCheats | 1521c850857e7da7bd3e7db2301393aeeef68394 | [
"Apache-2.0"
] | 1 | 2021-06-19T18:39:00.000Z | 2021-06-19T18:39:00.000Z | #pragma once
#include <ntifs.h>
#include <ntddk.h>
#include <ntdddisk.h>
#include <scsi.h>
#include <intrin.h>
#include "structs.h"
typedef struct info_t {
int pid = 0;
DWORD_PTR address;
void* value;
SIZE_T size;
void* data;
}info, *p_info;
#define ctl_write CTL_CODE(FILE_DEVICE_UNKNOWN, 0x0366, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define ctl_read CTL_CODE(FILE_DEVICE_UNKNOWN, 0x0367, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define ctl_base CTL_CODE(FILE_DEVICE_UNKNOWN, 0x0368, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
#define ctl_clear CTL_CODE(FILE_DEVICE_UNKNOWN, 0x0369, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
//io
NTSTATUS unsupported_io(PDEVICE_OBJECT device_obj, PIRP irp);
NTSTATUS create_io(PDEVICE_OBJECT device_obj, PIRP irp);
NTSTATUS close_io(PDEVICE_OBJECT device_obj, PIRP irp);
// memory
void read_mem(int pid, void* addr, void* value, size_t size);
void write_mem(int pid, void* addr, void* value, size_t size);
extern "C" {
NTKERNELAPI NTSTATUS IoCreateDriver(PUNICODE_STRING DriverName, PDRIVER_INITIALIZE InitializationFunction);
NTKERNELAPI NTSTATUS ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS SystemInformationClass, PVOID SystemInformation, ULONG SystemInformationLength, PULONG ReturnLength);
NTKERNELAPI NTSTATUS ObReferenceObjectByName(PUNICODE_STRING ObjectName, ULONG Attributes, PACCESS_STATE PassedAccessState, ACCESS_MASK DesiredAccess, POBJECT_TYPE ObjectType, KPROCESSOR_MODE AccessMode, PVOID ParseContext, PVOID * Object);
NTKERNELAPI NTSTATUS MmCopyVirtualMemory(PEPROCESS SourceProcess, PVOID SourceAddress, PEPROCESS TargetProcess, PVOID TargetAddress, SIZE_T BufferSize, KPROCESSOR_MODE PreviousMode, PSIZE_T ReturnSize);
NTKERNELAPI PVOID PsGetProcessSectionBaseAddress(PEPROCESS Process);
}
| 47.394737 | 242 | 0.80955 |
199a2efb28e401a71d86bd78d64a6a705e57575e | 370 | c | C | armstrong.c | avronr/cbasic | fe07ba3ae2e8e78a3557f12ef8068fb9f7c0d997 | [
"MIT"
] | null | null | null | armstrong.c | avronr/cbasic | fe07ba3ae2e8e78a3557f12ef8068fb9f7c0d997 | [
"MIT"
] | null | null | null | armstrong.c | avronr/cbasic | fe07ba3ae2e8e78a3557f12ef8068fb9f7c0d997 | [
"MIT"
] | null | null | null | #include<stdio.h>
int main()
{
int d, arm=0, num, original, i;
printf("Enter number:\n");
scanf("%d", &num);
original=num;
while (num!=0) {
d=(num%10);
arm+=(d*d*d);
num=num/10;
}
if (arm==original) {
printf("%d is an armstrong number\n", original );
}
else {
printf("%d is not an armstrong number\n", original );
}
return 0;
}
| 17.619048 | 57 | 0.551351 |
95a96820af2db93cfaced0a577d26e5420ef290a | 630 | h | C | AWAREFramework/Frameworks/StudentLifeAudio.framework/Headers/StudentLifeAudio.h | nuKs/AWAREFramework-iOS | 7e0e012cad6cffb7468511ed29c8e58d27c879a2 | [
"Apache-2.0"
] | null | null | null | AWAREFramework/Frameworks/StudentLifeAudio.framework/Headers/StudentLifeAudio.h | nuKs/AWAREFramework-iOS | 7e0e012cad6cffb7468511ed29c8e58d27c879a2 | [
"Apache-2.0"
] | null | null | null | AWAREFramework/Frameworks/StudentLifeAudio.framework/Headers/StudentLifeAudio.h | nuKs/AWAREFramework-iOS | 7e0e012cad6cffb7468511ed29c8e58d27c879a2 | [
"Apache-2.0"
] | null | null | null | //
// StudentLifeAudio.h
// StudentLifeAudio
//
// Created by Yuuki Nishiyama on 2018/05/23.
// Copyright © 2018 Yuuki Nishiyama. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for StudentLifeAudio.
FOUNDATION_EXPORT double StudentLifeAudioVersionNumber;
//! Project version string for StudentLifeAudio.
FOUNDATION_EXPORT const unsigned char StudentLifeAudioVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <StudentLifeAudio/PublicHeader.h>
#import <StudentLifeAudio/AudioPipeline.h>
#import <StudentLifeAudio/VAD.h>
| 30 | 141 | 0.788889 |
253183528973723d47dbf4c0e3defa93c02b968a | 1,580 | h | C | ext/digest/renaming.h | eval-apply/Gauche | 446507510afbecf80f522af972010bcfeb2ea0a8 | [
"BSD-3-Clause"
] | 569 | 2015-01-14T07:51:32.000Z | 2022-03-28T02:47:37.000Z | ext/digest/renaming.h | eval-apply/Gauche | 446507510afbecf80f522af972010bcfeb2ea0a8 | [
"BSD-3-Clause"
] | 612 | 2015-01-26T02:17:56.000Z | 2022-03-26T10:02:28.000Z | ext/digest/renaming.h | eval-apply/Gauche | 446507510afbecf80f522af972010bcfeb2ea0a8 | [
"BSD-3-Clause"
] | 104 | 2015-01-14T09:18:01.000Z | 2022-03-05T02:51:48.000Z | /*
* Rename symbols to avoid conflicts
*
* The symbols will be a part of Gauche library when compiled as static,
* and it may conflict with other libraries. (Compiling as a dynamic
* library, which is the default settings, won't cause a problem, since
* these digest modules will be dlopen()-ed.)
*/
#define MD5_Init Scm_MD5_Init
#define MD5_Update Scm_MD5_Update
#define MD5_Final Scm_MD5_Final
#define MD5_Transform Scm_MD5_Transform
#define MD5_End Scm_MD5_End
#define MD5_File Scm_MD5_File
#define MD5_Data Scm_MD5_Data
#define SHA1_Init Scm_SHA1_Init
#define SHA1_Update Scm_SHA1_Update
#define SHA1_Final Scm_SHA1_Final
#define SHA1_End Scm_SHA1_End
#define SHA1_Data Scm_SHA1_Data
#define SHA224_Init Scm_SHA224_Init
#define SHA224_Update Scm_SHA224_Update
#define SHA224_Final Scm_SHA224_Final
#define SHA224_End Scm_SHA224_End
#define SHA224_Data Scm_SHA224_Data
#define SHA256_Init Scm_SHA256_Init
#define SHA256_Update Scm_SHA256_Update
#define SHA256_Final Scm_SHA256_Final
#define SHA256_End Scm_SHA256_End
#define SHA256_Data Scm_SHA256_Data
#define SHA384_Init Scm_SHA384_Init
#define SHA384_Update Scm_SHA384_Update
#define SHA384_Final Scm_SHA384_Final
#define SHA384_End Scm_SHA384_End
#define SHA384_Data Scm_SHA384_Data
#define SHA512_Init Scm_SHA512_Init
#define SHA512_Update Scm_SHA512_Update
#define SHA512_Final Scm_SHA512_Final
#define SHA512_End Scm_SHA512_End
#define SHA512_Data Scm_SHA512_Data
| 33.617021 | 72 | 0.772152 |
f9ac19c71b1721a5cc0ad01927f14945b05a448b | 200 | c | C | regression/goto-analyzer/sensitivity-test-constants-array-loop/main.c | tobireinhard/cbmc | fc165c119985adf8db9a13493f272a2def4e79fa | [
"BSD-4-Clause"
] | 412 | 2016-04-02T01:14:27.000Z | 2022-03-27T09:24:09.000Z | regression/goto-analyzer/sensitivity-test-constants-array-loop/main.c | tobireinhard/cbmc | fc165c119985adf8db9a13493f272a2def4e79fa | [
"BSD-4-Clause"
] | 4,671 | 2016-02-25T13:52:16.000Z | 2022-03-31T22:14:46.000Z | regression/goto-analyzer/sensitivity-test-constants-array-loop/main.c | tobireinhard/cbmc | fc165c119985adf8db9a13493f272a2def4e79fa | [
"BSD-4-Clause"
] | 266 | 2016-02-23T12:48:00.000Z | 2022-03-22T18:15:51.000Z | static int array[2];
void main(void)
{
int i;
for(i = 0; i < 1; i++)
array[i] = 5;
__CPROVER_assert(array[0] == 5, "array[0] == 5");
__CPROVER_assert(array[1] == 5, "array[1] == 5");
}
| 15.384615 | 51 | 0.53 |
c786110972ded7751d3bcdf2123c910df082be10 | 332 | h | C | iOSSystemCamera/Source/GHTopBarView.h | Liaoworking/iOSSystemCamera | a651b7ca7292e32372d17ce67b4c83ab32876951 | [
"MIT"
] | 4 | 2018-02-06T01:00:32.000Z | 2020-04-28T08:19:32.000Z | iOSSystemCamera/Source/GHTopBarView.h | Liaoworking/iOSSystemCamera | a651b7ca7292e32372d17ce67b4c83ab32876951 | [
"MIT"
] | null | null | null | iOSSystemCamera/Source/GHTopBarView.h | Liaoworking/iOSSystemCamera | a651b7ca7292e32372d17ce67b4c83ab32876951 | [
"MIT"
] | null | null | null | //
// topBarView.h
// iOSSystemCamera
//
// Created by Guanghui Liao on 2/2/18.
// Copyright © 2018 liaoworking. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef void (^btnClickEventBlock)(BOOL isSelec);// 0 未选中 1 已选中
@interface GHTopBarView : UIView
@property (nonatomic, copy) btnClickEventBlock filterBtnClick;
@end
| 23.714286 | 64 | 0.728916 |
c7c327cb375fdc33fe8e3c25c8f6d8ea09075442 | 525 | h | C | Prototype/lib/Sources/NumericOptimization/HelperMacros.h | OHUSAR/OHUSAR.github.io | 2151eb00ad07511da847525bcc16ed744d3b251c | [
"MIT"
] | null | null | null | Prototype/lib/Sources/NumericOptimization/HelperMacros.h | OHUSAR/OHUSAR.github.io | 2151eb00ad07511da847525bcc16ed744d3b251c | [
"MIT"
] | null | null | null | Prototype/lib/Sources/NumericOptimization/HelperMacros.h | OHUSAR/OHUSAR.github.io | 2151eb00ad07511da847525bcc16ed744d3b251c | [
"MIT"
] | null | null | null | #pragma once
namespace NumericOptimization {
namespace Math {
#define INCLUDE_STD_MATH_FUNCTIONS \
using ::cos; \
using ::sin; \
using ::tan; \
using ::acos; \
using ::asin; \
using ::atan; \
using ::atan2; \
using ::cosh; \
using ::sinh; \
using ::tanh; \
using ::acosh; \
using ::asinh; \
using ::atanh; \
using ::exp; \
using ::log; \
using ::log10; \
using ::log2; \
using ::pow; \
using ::sqrt; \
using ::cbrt; \
using ::ceil; \
using ::floor; \
using ::abs;
} } | 16.935484 | 38 | 0.550476 |
0fc50fd5cfc244532b767a2165d52b4f1f318a97 | 3,351 | c | C | src/fs/fs.c | guts-lang/guts | 66de2fca6669e1c7451a053148bc821f5406aed6 | [
"MIT"
] | null | null | null | src/fs/fs.c | guts-lang/guts | 66de2fca6669e1c7451a053148bc821f5406aed6 | [
"MIT"
] | 3 | 2018-06-14T23:41:26.000Z | 2018-06-20T13:28:31.000Z | src/fs/fs.c | guts-lang/guts | 66de2fca6669e1c7451a053148bc821f5406aed6 | [
"MIT"
] | null | null | null | /*
* MIT License
*
* Copyright (c) 2016-2017 Abel Lucas <www.github.com/uael>
*
* 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 "fs.h"
FORCEINLINE void
fs_absolute(char_t __const *path, char_t *out)
{
#ifdef OS_WIN
if (_fullpath(out, path, FS_PATH_MAX) == nil) {
THROW(ex_errno(ERRLVL_ERROR, errno,
"Unable to get absolute path from '%s'", path));
}
#else
char_t *ptr;
if ((ptr = realpath(path, out)) == nil) {
THROW(ex_errno(
ERRLVL_ERROR, errno, "Unable to get absolute path from '%s'", path
));
}
(void) ptr;
#endif
}
FORCEINLINE bool_t
fs_exists(char_t __const *path)
{
#ifdef OS_WIN
if (_access(path, 0) == 0) {
#else
if (access(path, F_OK) == 0) {
#endif
return true;
}
return false;
}
FORCEINLINE u16_t
fs_cwd(char_t *path, u16_t n)
{
char *ret;
#ifdef OS_WIN
if ((ret = _getcwd(path, n)) == nil)
#else
if ((ret = getcwd(path, n)) == nil)
#endif
return 0;
return (i16_t) strlen(ret);
}
FORCEINLINE void
fs_mkdir(char_t __const *path)
{
#ifdef OS_WIN
if (_mkdir(path) < 0) {
#else
if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
#endif
char_t *t, full[FS_PATH_MAX], temp[FS_PATH_MAX] = { 0 };
char_t __const *p, *e;
fs_absolute(path, full);
p = full;
t = temp;
e = temp + FS_PATH_MAX - 1;
for (; t < e && *p; t++) {
*t = *p;
if (*p == '/') {
if (!fs_exists(temp)) {
#ifdef OS_WIN
if (_mkdir(temp) < 0) {
#else
if (mkdir(temp, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
#endif
THROW(ex_errno(
ERRLVL_ERROR, errno, "Unable to create directory '%s'", path
));
}
}
while (*p == '/') p++;
} else p++;
}
#ifdef OS_WIN
if (_mkdir(path) < 0) {
#else
if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
#endif
THROW(ex_errno(
ERRLVL_ERROR, errno, "Unable to create directory '%s'", path
));
}
}
}
FORCEINLINE bool_t
fs_rm(char_t __const *path)
{
#ifdef OS_WIN
if (UNLIKELY(_unlink(path) != 0)) {
#else
if (UNLIKELY(unlink(path) != 0)) {
#endif
return false;
}
return true;
}
FORCEINLINE void
fs_touch(char_t __const *path)
{
i32_t fd;
if (!fs_exists(path))
fs_mkdir(path);
fd_open(&fd, path, FS_OPEN_RO | FS_OPEN_CREAT);
fd_close(&fd);
}
| 23.598592 | 80 | 0.638019 |
57e2da316b9b6b3f84a1c8853d63d839d97c7335 | 6,158 | h | C | src/pronet/pro_rtp/rtp_packet.h | libpronet/libpronet | 78f52fbe002767915553bdf58fb10453e63bf502 | [
"Apache-2.0"
] | 35 | 2018-10-29T06:31:09.000Z | 2022-03-21T08:13:39.000Z | src/pronet/pro_rtp/rtp_packet.h | libpronet/libpronet | 78f52fbe002767915553bdf58fb10453e63bf502 | [
"Apache-2.0"
] | null | null | null | src/pronet/pro_rtp/rtp_packet.h | libpronet/libpronet | 78f52fbe002767915553bdf58fb10453e63bf502 | [
"Apache-2.0"
] | 11 | 2018-11-03T04:45:29.000Z | 2021-11-23T06:09:20.000Z | /*
* Copyright (C) 2018-2019 Eric Tung <libpronet@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"),
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of LibProNet (https://github.com/libpronet/libpronet)
*/
/*
* RFC-1889/1890, RFC-3550/3551
*/
#if !defined(RTP_PACKET_H)
#define RTP_PACKET_H
#include "rtp_base.h"
#include "../pro_util/pro_memory_pool.h"
#include "../pro_util/pro_ref_count.h"
/////////////////////////////////////////////////////////////////////////////
////
#if defined(PRO_TCP2_PAYLOAD_SIZE)
#undef PRO_TCP2_PAYLOAD_SIZE
#endif
#define PRO_TCP2_PAYLOAD_SIZE (1024 * 63)
#if !defined(PRO_TCP4_PAYLOAD_SIZE)
#define PRO_TCP4_PAYLOAD_SIZE (1024 * 1024 * 96)
#endif
struct RTP_EXT
{
PRO_UINT32 mmId;
RTP_MM_TYPE mmType;
#if defined(PRO_WORDS_BIGENDIAN)
unsigned char keyFrame : 1;
unsigned char firstPacketOfFrame : 1;
unsigned char udpxSync : 1;
unsigned char reserved : 5;
#else
unsigned char reserved : 5;
unsigned char udpxSync : 1;
unsigned char firstPacketOfFrame : 1;
unsigned char keyFrame : 1;
#endif
PRO_UINT16 hdrAndPayloadSize; /* tcp message boundary */
DECLARE_SGI_POOL(0)
};
struct RTP_HEADER
{
#if defined(PRO_WORDS_BIGENDIAN)
unsigned char v : 2;
unsigned char p : 1;
unsigned char x : 1;
unsigned char cc : 4;
unsigned char m : 1;
unsigned char pt : 7;
#else
unsigned char cc : 4;
unsigned char x : 1;
unsigned char p : 1;
unsigned char v : 2;
unsigned char pt : 7;
unsigned char m : 1;
#endif
PRO_UINT16 seq;
PRO_UINT32 ts;
union
{
PRO_UINT32 ssrc;
struct
{
PRO_UINT16 dummy;
PRO_UINT16 len2;
};
PRO_UINT32 len4;
};
DECLARE_SGI_POOL(0)
};
struct RTP_PACKET
{
RTP_EXT* ext;
RTP_HEADER* hdr;
char dummyBuffer[sizeof(RTP_EXT) + sizeof(RTP_HEADER)];
DECLARE_SGI_POOL(0)
};
/////////////////////////////////////////////////////////////////////////////
////
class CRtpPacket : public IRtpPacket, public CProRefCount
{
public:
static CRtpPacket* CreateInstance(
const void* payloadBuffer,
unsigned long payloadSize,
RTP_EXT_PACK_MODE packMode
);
static CRtpPacket* CreateInstance(
unsigned long payloadSize,
RTP_EXT_PACK_MODE packMode
);
static CRtpPacket* Clone(const IRtpPacket* packet);
static bool ParseRtpBuffer(
const char* buffer,
PRO_UINT16 size,
RTP_HEADER& hdr, /* network byte order */
const char*& payloadBuffer,
PRO_UINT16& payloadSize
);
static bool ParseExtBuffer(
const char* buffer,
PRO_UINT16 size
);
virtual unsigned long PRO_CALLTYPE AddRef();
virtual unsigned long PRO_CALLTYPE Release();
virtual void PRO_CALLTYPE SetMarker(bool m);
virtual bool PRO_CALLTYPE GetMarker() const;
virtual void PRO_CALLTYPE SetPayloadType(char pt);
virtual char PRO_CALLTYPE GetPayloadType() const;
virtual void PRO_CALLTYPE SetSequence(PRO_UINT16 seq);
virtual PRO_UINT16 PRO_CALLTYPE GetSequence() const;
virtual void PRO_CALLTYPE SetTimeStamp(PRO_UINT32 ts);
virtual PRO_UINT32 PRO_CALLTYPE GetTimeStamp() const;
virtual void PRO_CALLTYPE SetSsrc(PRO_UINT32 ssrc);
virtual PRO_UINT32 PRO_CALLTYPE GetSsrc() const;
virtual void PRO_CALLTYPE SetMmId(PRO_UINT32 mmId);
virtual PRO_UINT32 PRO_CALLTYPE GetMmId() const;
virtual void PRO_CALLTYPE SetMmType(RTP_MM_TYPE mmType);
virtual RTP_MM_TYPE PRO_CALLTYPE GetMmType() const;
virtual void PRO_CALLTYPE SetKeyFrame(bool keyFrame);
virtual bool PRO_CALLTYPE GetKeyFrame() const;
virtual void PRO_CALLTYPE SetFirstPacketOfFrame(bool firstPacket);
virtual bool PRO_CALLTYPE GetFirstPacketOfFrame() const;
virtual const void* PRO_CALLTYPE GetPayloadBuffer() const;
virtual void* PRO_CALLTYPE GetPayloadBuffer();
virtual unsigned long PRO_CALLTYPE GetPayloadSize() const;
virtual PRO_UINT16 PRO_CALLTYPE GetPayloadSize16() const;
virtual RTP_EXT_PACK_MODE PRO_CALLTYPE GetPackMode() const
{
return (m_packMode);
}
virtual void PRO_CALLTYPE SetMagic(PRO_INT64 magic)
{
m_magic = magic;
}
virtual PRO_INT64 PRO_CALLTYPE GetMagic() const
{
return (m_magic);
}
void SetMagic2(PRO_INT64 magic2)
{
m_magic2 = magic2;
}
PRO_INT64 GetMagic2() const
{
return (m_magic2);
}
void SetUdpxSync(bool sync);
bool GetUdpxSync() const;
/*
* Don't use this method unless you know why and how to use it.
*/
const RTP_PACKET& GetPacket() const
{
return (*m_packet);
}
/*
* Don't use this method unless you know why and how to use it.
*/
RTP_PACKET& GetPacket()
{
return (*m_packet);
}
private:
CRtpPacket(RTP_EXT_PACK_MODE packMode);
virtual ~CRtpPacket();
void Init(
const void* payloadBuffer,
unsigned long payloadSize
);
private:
const RTP_EXT_PACK_MODE m_packMode;
PRO_UINT32 m_ssrc; /* for RTP_EPM_TCP2, RTP_EPM_TCP4 */
PRO_INT64 m_magic;
PRO_INT64 m_magic2;
RTP_PACKET* m_packet;
DECLARE_SGI_POOL(0)
};
/////////////////////////////////////////////////////////////////////////////
////
#endif /* RTP_PACKET_H */
| 23.59387 | 77 | 0.625041 |
b95f6054528c8180ee291103cd4abc54b25bceec | 247 | h | C | dbg/seriallog.h | kevinfrei/kbfw | 7fb714003dde5c16654cee4337f07975911b732a | [
"Unlicense"
] | null | null | null | dbg/seriallog.h | kevinfrei/kbfw | 7fb714003dde5c16654cee4337f07975911b732a | [
"Unlicense"
] | null | null | null | dbg/seriallog.h | kevinfrei/kbfw | 7fb714003dde5c16654cee4337f07975911b732a | [
"Unlicense"
] | null | null | null | #pragma once
#include "debuglog.h"
class SerialLog : public DebugLog {
public:
SerialLog() : DebugLog() {}
void init() override;
void logln(const char* str = 0) override;
void log(const char*) override;
void log(uint32_t) override;
}; | 20.583333 | 43 | 0.688259 |
5f5109044316f78cbdd1c160d02705644b0cab52 | 3,255 | h | C | examples/shared_boxes/atomic_integer.h | swils/verifast | b0bdb6b5bb49cb6a6ae5457e703ee3eea9f3463e | [
"MIT"
] | 272 | 2016-01-28T16:01:28.000Z | 2022-03-10T11:53:19.000Z | examples/shared_boxes/atomic_integer.h | swils/verifast | b0bdb6b5bb49cb6a6ae5457e703ee3eea9f3463e | [
"MIT"
] | 207 | 2016-01-28T16:03:17.000Z | 2022-03-11T14:38:58.000Z | examples/shared_boxes/atomic_integer.h | DriesVuylsteke/verifast | 79e814ad7236a7aa99424a03799d27b73b71c4ce | [
"MIT"
] | 59 | 2016-04-03T17:52:17.000Z | 2022-01-28T11:35:57.000Z | #ifndef ATOMIC_INTEGER_H
#define ATOMIC_INTEGER_H
//@ predicate atomic_integer(int* i, real level, predicate(int) I);
/*@
lemma void create_atomic_integer(int* i, real upper_bound, predicate(int) I);
requires integer(i, ?value) &*& I(value);
ensures atomic_integer(i, ?new_level, I) &*& new_level < upper_bound;
@*/
/*@
predicate_family atomic_integer_set_pre(void* index)(int new_value);
predicate_family atomic_integer_set_post(void* index)(int old_value, int new_value);
typedef lemma void atomic_integer_set_lemma(int new_value, predicate(int) I, real level)();
requires atomic_integer_set_pre(this)(new_value) &*& I(?value) &*& current_box_level(level);
ensures atomic_integer_set_post(this)(value, new_value) &*& I(new_value) &*& current_box_level(level);
@*/
void atomic_integer_set(int* i, int v);
//@ requires [?f]atomic_integer(i, ?level, ?I) &*& is_atomic_integer_set_lemma(?lem, v, I, level) &*& atomic_integer_set_pre(lem)(v);
//@ ensures [f]atomic_integer(i, level, I) &*& atomic_integer_set_post(lem)(_, v);
/*@
predicate_family atomic_integer_get_pre(void* index)();
predicate_family atomic_integer_get_post(void* index)(int value);
typedef lemma void atomic_integer_get_lemma(predicate(int) I, real level)();
requires atomic_integer_get_pre(this)() &*& I(?value) &*& current_box_level(level);
ensures atomic_integer_get_post(this)(value) &*& I(value) &*& current_box_level(level);
@*/
int atomic_integer_get(int* i);
//@ requires [?f]atomic_integer(i, ?level, ?I) &*& is_atomic_integer_get_lemma(?lem, I, level) &*& atomic_integer_get_pre(lem)();
//@ ensures [f]atomic_integer(i, level, I) &*& atomic_integer_get_post(lem)(result);
/*@
predicate_family atomic_integer_cas_pre(void* index)(int old, int new);
predicate_family atomic_integer_cas_post(void* index)(bool success, int old, int new);
typedef lemma void atomic_integer_cas_lemma(predicate(int) I, int old, int new, real level)();
requires atomic_integer_cas_pre(this)(old, new) &*& I(?value) &*& current_box_level(level);
ensures atomic_integer_cas_post(this)(value == old, old, new) &*& I(value == old ? new : value) &*& current_box_level(level);
@*/
bool atomic_integer_cas(int* i, int old, int new);
//@ requires [?f]atomic_integer(i, ?level, ?I) &*& is_atomic_integer_cas_lemma(?lem, I, old, new, level) &*& atomic_integer_cas_pre(lem)(old, new);
//@ ensures [f]atomic_integer(i, level, I) &*& atomic_integer_cas_post(lem)(result, old, new);
/*@
predicate_family atomic_integer_inc_pre(void* index)();
predicate_family atomic_integer_inc_post(void* index)(int old);
typedef lemma void atomic_integer_inc_lemma(predicate(int) I, real level)();
requires atomic_integer_inc_pre(this)() &*& I(?value) &*& current_box_level(level);
ensures atomic_integer_inc_post(this)(value) &*& I(value + 1) &*& current_box_level(level);
@*/
int atomic_integer_inc(int* i);
//@ requires [?f]atomic_integer(i, ?level, ?I) &*& is_atomic_integer_inc_lemma(?lem, I, level) &*& atomic_integer_inc_pre(lem)();
//@ ensures [f]atomic_integer(i, level, I) &*& atomic_integer_inc_post(lem)(result);
/*@
lemma void atomic_integer_dispose(int* i);
requires atomic_integer(i, ?level, ?I);
ensures integer(i, ?value) &*& I(value);
@*/
#endif
| 45.84507 | 150 | 0.729032 |
7e53a405588da9c17dc048e86eb8a5d5cabff0d8 | 1,440 | c | C | C_prac/C_prac/ch9.c | cutz-j/C_programming | 2f547a1f6de902220bee8c445c154ba3e30b45b0 | [
"MIT"
] | null | null | null | C_prac/C_prac/ch9.c | cutz-j/C_programming | 2f547a1f6de902220bee8c445c154ba3e30b45b0 | [
"MIT"
] | null | null | null | C_prac/C_prac/ch9.c | cutz-j/C_programming | 2f547a1f6de902220bee8c445c154ba3e30b45b0 | [
"MIT"
] | null | null | null | #include <stdio.h>
int AddToTotal(int num)
{
static int total;
total += num;
return total;
}
int sub3(void)
{
printf("%d", factorial(15));
return 0;
}
int q9_9_1(void)
{
int num1, num2, num3;
int getMax(num1, num2, num3);
int getMin(num1, num2, num3);
scanf_s("%d %d %d", &num1, &num2, &num3);
getMax(num1, num2, num3);
getMin(num1, num2, num3);
return 0;
}
int getMax(int num1, int num2, int num3)
{
if ((num1 > num2) & (num1 > num3))
{
printf("%d\n", num1);
return num1;
}
else if ((num2 > num1) & (num2 > num1))
{
printf("%d\n", num2);
return num2;
}
else
{
printf("%d\n", num3);
return num3;
}
}
int getMin(int num1, int num2, int num3)
{
if ((num1 < num2) & (num1 < num3))
{
printf("%d\n", num1);
return num1;
}
else if ((num2 < num1) & (num2 < num3))
{
printf("%d\n", num2);
return num2;
}
else
{
printf("%d\n", num3);
return num3;
}
}
int q9_1_2(void)
{
double num;
double CelToFah(num);
double FahToCel(num);
scanf_s("%lf", &num);
printf("%f\n", CelToFah(num));
printf("%f", FahToCel(num));
}
double CelToFah(double c)
{
return 1.8 * c + 32;
}
double FahToCel(double d)
{
return (d - 32) / 1.8;
}
int fib(int num)
{
if (num == 0 || num == 1)
return num;
else
{
int fib_step = fib(num - 1) + fib(num - 2);
printf("%d\n", fib_step);
return fib_step;
}
}
int factorial(int num)
{
if (num == 1)
return 1;
else
return num * factorial(num - 1);
} | 13.714286 | 45 | 0.577778 |
702f1f275eef9d30d903a5915efbeec3f1683e35 | 1,308 | c | C | piscine/C00/ex06/ft_print_comb2.c | cheremushkin/school21 | aa151406acc0a5fdbcf62c3f27cd5f628e68dd51 | [
"Apache-2.0"
] | null | null | null | piscine/C00/ex06/ft_print_comb2.c | cheremushkin/school21 | aa151406acc0a5fdbcf62c3f27cd5f628e68dd51 | [
"Apache-2.0"
] | null | null | null | piscine/C00/ex06/ft_print_comb2.c | cheremushkin/school21 | aa151406acc0a5fdbcf62c3f27cd5f628e68dd51 | [
"Apache-2.0"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_comb2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lteresia <lteresia@student.21-schoo> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/01 17:49:09 by lteresia #+# #+# */
/* Updated: 2021/09/01 17:49:31 by lteresia ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_print_comb2(void)
{
int i;
int j;
i = 0;
while (i <= 98)
{
j = i + 1;
while (j <= 99)
{
ft_putchar(i / 10 + '0');
ft_putchar(i % 10 + '0');
ft_putchar(' ');
ft_putchar(j / 10 + '0');
ft_putchar(j % 10 + '0');
if (i == 98 && j == 99)
return ;
ft_putchar(',');
ft_putchar(' ');
j++;
}
i++;
}
}
| 29.066667 | 80 | 0.23318 |
f285fc23f6b6ad1ff2215f31766d9d642b6ae42d | 9,175 | c | C | loader/impl_platform.c | atkurtul/vk-rs | e6ba04fe3d5987bada288fad3f5a08d732f74cf1 | [
"MIT"
] | 2 | 2020-07-25T19:54:47.000Z | 2020-07-26T23:56:53.000Z | loader/impl_platform.c | atkurtul/vk-rs | e6ba04fe3d5987bada288fad3f5a08d732f74cf1 | [
"MIT"
] | null | null | null | loader/impl_platform.c | atkurtul/vk-rs | e6ba04fe3d5987bada288fad3f5a08d732f74cf1 | [
"MIT"
] | null | null | null | #include "loader.h"
#include "vulkan/vulkan_android.h"
extern VkInstance instance;
extern VkDevice device;
extern VkPhysicalDevice physicalDevice;
VkResult CreateAndroidSurfaceKHR(
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
VkSurfaceKHR* pSurface) {
return ((PFN_vkCreateAndroidSurfaceKHR)vkCreateAndroidSurfaceKHR)(instance, pCreateInfo, 0, pSurface);
}
VkResult GetAndroidHardwareBufferPropertiesANDROID(
const struct AHardwareBuffer* buffer,
VkAndroidHardwareBufferPropertiesANDROID* pProperties) {
return ((PFN_vkGetAndroidHardwareBufferPropertiesANDROID)vkGetAndroidHardwareBufferPropertiesANDROID)(device, buffer, pProperties);
}
VkResult GetMemoryAndroidHardwareBufferANDROID(
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
struct AHardwareBuffer** pBuffer) {
return ((PFN_vkGetMemoryAndroidHardwareBufferANDROID)vkGetMemoryAndroidHardwareBufferANDROID)(device, pInfo, pBuffer);
}
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
typedef struct VkWaylandSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWaylandSurfaceCreateFlagsKHR flags;
struct wl_display* display;
struct wl_surface* surface;
} VkWaylandSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
extern VkInstance instance;
extern VkPhysicalDevice physicalDevice;
VkResult CreateWaylandSurfaceKHR(
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
VkSurfaceKHR* pSurface) {
return ((PFN_vkCreateWaylandSurfaceKHR)vkCreateWaylandSurfaceKHR)(instance, pCreateInfo, 0, pSurface);
}
VkBool32 GetPhysicalDeviceWaylandPresentationSupportKHR(
uint32_t queueFamilyIndex,
struct wl_display* display) {
return ((PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)vkGetPhysicalDeviceWaylandPresentationSupportKHR)(physicalDevice, queueFamilyIndex, display);
}
typedef unsigned xcb_window_t;
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
typedef struct VkXcbSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXcbSurfaceCreateFlagsKHR flags;
struct xcb_connection_t* connection;
uint window;
} VkXcbSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct xcb_connection_t* connection, uint visual_id);
VkResult CreateXcbSurfaceKHR(
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
VkSurfaceKHR* pSurface) {
return ((PFN_vkCreateXcbSurfaceKHR)vkCreateXcbSurfaceKHR)(instance, pCreateInfo, 0, pSurface);
}
VkBool32 GetPhysicalDeviceXcbPresentationSupportKHR(
uint32_t queueFamilyIndex,
struct xcb_connection_t* connection,
uint visual_id) {
return ((PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)vkGetPhysicalDeviceXcbPresentationSupportKHR)(physicalDevice, queueFamilyIndex, connection, visual_id);
}
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
typedef struct VkXlibSurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkXlibSurfaceCreateFlagsKHR flags;
void* dpy;
uint64_t window;
} VkXlibSurfaceCreateInfoKHR;
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, void* dpy, uint64_t visualID);
VkResult CreateXlibSurfaceKHR(
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
VkSurfaceKHR* pSurface) {
return ((PFN_vkCreateXlibSurfaceKHR)vkCreateXlibSurfaceKHR)(instance, pCreateInfo, 0, pSurface);
}
VkBool32 GetPhysicalDeviceXlibPresentationSupportKHR(
uint32_t queueFamilyIndex,
void* dpy,
uint64_t visualID) {
return ((PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)vkGetPhysicalDeviceXlibPresentationSupportKHR)(physicalDevice, queueFamilyIndex, dpy, visualID);
}
typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
typedef void *HANDLE;
typedef void *HINSTANCE;
typedef void *HWND;
typedef const wchar_t *LPCWSTR;
typedef unsigned long DWORD;
typedef void *HMONITOR;
#include "vulkan/vulkan_win32.h"
VkResult CreateWin32SurfaceKHR(
const struct VkWin32SurfaceCreateInfoKHR* pCreateInfo,
VkSurfaceKHR* pSurface) {
return ((PFN_vkCreateWin32SurfaceKHR)vkCreateWin32SurfaceKHR)(instance, pCreateInfo, 0, pSurface);
}
VkBool32 GetPhysicalDeviceWin32PresentationSupportKHR() {
return ((PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)vkGetPhysicalDeviceWin32PresentationSupportKHR)(physicalDevice, 0);
}
VkResult GetMemoryWin32HandleKHR(
const struct VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle) {
return ((PFN_vkGetMemoryWin32HandleKHR)vkGetMemoryWin32HandleKHR)(device, pGetWin32HandleInfo, pHandle);
}
VkResult GetMemoryWin32HandlePropertiesKHR(
VkExternalMemoryHandleTypeFlagBits handleType,
HANDLE handle,
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) {
return ((PFN_vkGetMemoryWin32HandlePropertiesKHR)vkGetMemoryWin32HandlePropertiesKHR)(device, handleType, handle, pMemoryWin32HandleProperties);
}
VkResult ImportSemaphoreWin32HandleKHR(
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) {
return ((PFN_vkImportSemaphoreWin32HandleKHR)vkImportSemaphoreWin32HandleKHR)(device, pImportSemaphoreWin32HandleInfo);
}
VkResult GetSemaphoreWin32HandleKHR(
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle) {
return ((PFN_vkGetSemaphoreWin32HandleKHR)vkGetSemaphoreWin32HandleKHR)(device, pGetWin32HandleInfo, pHandle);
}
VkResult ImportFenceWin32HandleKHR(
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) {
return ((PFN_vkImportFenceWin32HandleKHR)vkImportFenceWin32HandleKHR)(device, pImportFenceWin32HandleInfo);
}
VkResult GetFenceWin32HandleKHR(
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle) {
return ((PFN_vkGetFenceWin32HandleKHR)vkGetFenceWin32HandleKHR)(device, pGetWin32HandleInfo, pHandle);
}
VkResult GetMemoryWin32HandleNV(
VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle) {
return ((PFN_vkGetMemoryWin32HandleNV)vkGetMemoryWin32HandleNV)(device, memory, handleType, pHandle);
}
VkResult GetPhysicalDeviceSurfacePresentModes2EXT(
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes) {
return ((PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)vkGetPhysicalDeviceSurfacePresentModes2EXT)(physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes);
}
VkResult AcquireFullScreenExclusiveModeEXT(
VkSwapchainKHR swapchain) {
return ((PFN_vkAcquireFullScreenExclusiveModeEXT)vkAcquireFullScreenExclusiveModeEXT)(device, swapchain);
}
VkResult ReleaseFullScreenExclusiveModeEXT(
VkSwapchainKHR swapchain) {
return ((PFN_vkReleaseFullScreenExclusiveModeEXT)vkReleaseFullScreenExclusiveModeEXT)(device, swapchain);
}
VkResult GetDeviceGroupSurfacePresentModes2EXT(
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes) {
return ((PFN_vkGetDeviceGroupSurfacePresentModes2EXT)vkGetDeviceGroupSurfacePresentModes2EXT)(device, pSurfaceInfo, pModes);
} | 51.544944 | 196 | 0.723597 |
d167a1a8ac1ed17e8a613977f7e3c33534891ce2 | 630 | h | C | aws-cpp-sdk-appstream/include/aws/appstream/model/Permission.h | lintonv/aws-sdk-cpp | 15e19c265ffce19d2046b18aa1b7307fc5377e58 | [
"Apache-2.0"
] | 1 | 2022-02-12T08:09:30.000Z | 2022-02-12T08:09:30.000Z | aws-cpp-sdk-appstream/include/aws/appstream/model/Permission.h | lintonv/aws-sdk-cpp | 15e19c265ffce19d2046b18aa1b7307fc5377e58 | [
"Apache-2.0"
] | 1 | 2022-01-03T23:59:37.000Z | 2022-01-03T23:59:37.000Z | aws-cpp-sdk-appstream/include/aws/appstream/model/Permission.h | ravindra-wagh/aws-sdk-cpp | 7d5ff01b3c3b872f31ca98fb4ce868cd01e97696 | [
"Apache-2.0"
] | 1 | 2021-12-30T04:25:33.000Z | 2021-12-30T04:25:33.000Z | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/appstream/AppStream_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace AppStream
{
namespace Model
{
enum class Permission
{
NOT_SET,
ENABLED,
DISABLED
};
namespace PermissionMapper
{
AWS_APPSTREAM_API Permission GetPermissionForName(const Aws::String& name);
AWS_APPSTREAM_API Aws::String GetNameForPermission(Permission value);
} // namespace PermissionMapper
} // namespace Model
} // namespace AppStream
} // namespace Aws
| 19.6875 | 75 | 0.749206 |
2f1b70bba68fa9e06c28e0d70bf661f8c4d10bd5 | 1,802 | h | C | datastruct/chapter3/list.h | shankusu2017/data_structures_algorithm | 70381e2df0ab4ce585ce472537180610244d3bb5 | [
"MIT"
] | null | null | null | datastruct/chapter3/list.h | shankusu2017/data_structures_algorithm | 70381e2df0ab4ce585ce472537180610244d3bb5 | [
"MIT"
] | null | null | null | datastruct/chapter3/list.h | shankusu2017/data_structures_algorithm | 70381e2df0ab4ce585ce472537180610244d3bb5 | [
"MIT"
] | null | null | null | #ifndef _LIST_H_20180809_2055
#define _LIST_H_20180809_2055
#include "typedef.h"
#include "define.h"
struct Node;
typedef struct Node *PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;
//传递给调用者当做handler类型来用,避免调用者申明一种新的数据类型
typedef List HdlLst;
//创建一个链表
List CreateList(void);
//删除链表L
void DeleteList(List hdl);
//清空链表,保留header
void MakeEmpty(List hdl);
//是否为空
int IsEmpty(List hdl);
//是否为最后一个
int IsLast(List hdl, Position pos);
//将元素X插入到链表L中
Position Insert(List hdl, ElementType X);
//找出元素x在链表L中的位置
Position Find(List hdl, ElementType X);
//删除链表L中第一个元素为X的值
int Delete(List hdl, ElementType X);
//找出链表L中第一个元素为X的前一个节点
Position FindPrevious(List hdl, ElementType X);
//返回链表的头
Position Header(List hdl);
//返回链表的首元素
Position First(List hdl);
Position Advance(Position P);
ElementType Retrieve(Position p);
//打印List的所有元素
void PrintList(List hdl);
void ListDemon(void);
void ListDemon2(void);
/****************双向链表************************/
struct Node2;
typedef struct Node2 *PtrToNode2;
typedef PtrToNode2 Position2;
typedef PtrToNode2 HdlLst2;
//传递给调用者当做handler类型来用,避免调用者申明一种新的数据类型
//创建一个链表
HdlLst2 CreateList2(void);
//删除链表L
void DeleteList2(HdlLst2 hdl);
//清空链表,保留header
void MakeEmpty2(HdlLst2 hdl);
//是否为空
int IsEmpty2(HdlLst2 hdl);
//是否为最后一个
int IsLast2(HdlLst2 hdl, Position2 pos);
//将元素X插入到链表hdl中
Position2 Insert2(HdlLst2 hdl, ElementType X);
//找出元素x在链表L中的位置
Position2 Find2(HdlLst2 hdl, ElementType X);
//删除链表L中第一个元素为X的值
int Delete2(HdlLst2 hdl, ElementType X);
//找出链表L中第一个元素为X的前一个节点
Position2 FindPrevious2(HdlLst2 hdl, ElementType X);
//返回链表的头
Position2 Heade2(HdlLst2 hdl);
//返回链表的首元素
Position2 First2(HdlLst2 hdl);
//打印List的所有元素
void PrintList2(HdlLst2 hdl);
void List2Demon(void);
void List2Demon2(void);
#endif /* _LIST_H_20180809_2055 */
| 16.53211 | 52 | 0.760266 |
280d21c329a82fdd84f2a9d11b57f9c6611fa0ff | 121,540 | w | C | dynamics/src/main/abl/ry/obj/rysdfobjmv.w | gquerret/OpenEdge_Retired_Products | 1358f3d450b65e6b4cfa2236555c54df942a613a | [
"Apache-2.0"
] | 1 | 2021-12-13T12:43:13.000Z | 2021-12-13T12:43:13.000Z | dynamics/src/main/abl/ry/obj/rysdfobjmv.w | gquerret/OpenEdge_Retired_Products | 1358f3d450b65e6b4cfa2236555c54df942a613a | [
"Apache-2.0"
] | null | null | null | dynamics/src/main/abl/ry/obj/rysdfobjmv.w | gquerret/OpenEdge_Retired_Products | 1358f3d450b65e6b4cfa2236555c54df942a613a | [
"Apache-2.0"
] | 2 | 2021-05-12T06:38:07.000Z | 2022-01-20T10:04:46.000Z | &ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI ADM2
&ANALYZE-RESUME
/* Connected Databases
icfdb PROGRESS
*/
&Scoped-define WINDOW-NAME CURRENT-WINDOW
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Update-Object-Version" vTableWin _INLINE
/* Actions: ? ? ? ? af/sup/afverxftrp.p */
/* This has to go above the definitions sections, as that is what it modifies.
If its not, then the definitions section will have been saved before the
XFTR code kicks in and changes it */
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Definition Comments Wizard" vTableWin _INLINE
/* Actions: ? af/cod/aftemwizcw.w ? ? ? */
/* Program Definition Comment Block Wizard
Welcome to the Program Definition Comment Block Wizard. Press Next to proceed.
af/cod/aftemwizpw.w
*/
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
/* Temp-Table and Buffer definitions */
DEFINE TEMP-TABLE RowObject
{"ry/obj/ryemptysdo.i"}.
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS vTableWin
/*---------------------------------------------------------------------------------
File: rysdfobjmv.w
Description: SmartDataField Viewer
Purpose:
Parameters: <none>
History:
--------
(v:010000) Task: 0 UserRef:
Date: 07/05/2002 Author: Mark Davies (MIP)
Update Notes: Created from Template rysttviewv.w
---------------------------------------------------------------------------------*/
/* This .W file was created with the Progress UIB. */
/*-------------------------------------------------------------------------------*/
/* Create an unnamed pool to store all the widgets created
by this procedure. This is a good default which assures
that this procedure's triggers and internal procedures
will execute in this procedure's storage, and that proper
cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
/* *************************** Definitions ************************** */
/* MIP-GET-OBJECT-VERSION pre-processors
The following pre-processors are maintained automatically when the object is
saved. They pull the object and version from Roundtable if possible so that it
can be displayed in the about window of the container */
&scop object-name rysdfobjmv.w
DEFINE VARIABLE lv_this_object_name AS CHARACTER INITIAL "{&object-name}":U NO-UNDO.
&scop object-version 000000
/* Parameters Definitions --- */
/* Local Variable Definitions --- */
/* object identifying preprocessor */
&glob astra2-staticSmartDataViewer yes
{src/adm2/globals.i}
&GLOBAL-DEFINE define-only YES
{launch.i }
DEFINE VARIABLE ghContainerSource AS HANDLE NO-UNDO.
DEFINE VARIABLE glAppBuilder AS LOGICAL NO-UNDO.
DEFINE VARIABLE ghToolbar AS HANDLE NO-UNDO.
DEFINE VARIABLE ghDataTable AS HANDLE NO-UNDO.
DEFINE VARIABLE ghDynLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE ghDynCombo AS HANDLE NO-UNDO.
DEFINE VARIABLE glNew AS LOGICAL NO-UNDO.
DEFINE VARIABLE glStaticSDF AS LOGICAL NO-UNDO.
DEFINE VARIABLE ghSDFObject AS HANDLE NO-UNDO.
DEFINE VARIABLE glNeedToSave AS LOGICAL NO-UNDO.
DEFINE VARIABLE glIsDynView AS LOGICAL NO-UNDO.
DEFINE VARIABLE glUsedExisting AS LOGICAL NO-UNDO.
DEFINE VARIABLE gcComboClasses AS CHARACTER NO-UNDO.
DEFINE VARIABLE gcLookupClasses AS CHARACTER NO-UNDO.
DEFINE VARIABLE glAppliedLeave AS LOGICAL NO-UNDO.
DEFINE VARIABLE glUpdateMasterOnly AS LOGICAL NO-UNDO.
DEFINE VARIABLE glValidationError AS LOGICAL NO-UNDO.
DEFINE VARIABLE glCheckChange AS LOGICAL NO-UNDO.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
/* ******************** Preprocessor Definitions ******************** */
&Scoped-define PROCEDURE-TYPE SmartDataViewer
&Scoped-define DB-AWARE no
&Scoped-define ADM-CONTAINER FRAME
&Scoped-define ADM-SUPPORTED-LINKS Data-Target,Update-Source,TableIO-Target,GroupAssign-Source,GroupAssign-Target
/* Include file with RowObject temp-table definition */
&Scoped-define DATA-FIELD-DEFS "ry/obj/ryemptysdo.i"
/* Name of designated FRAME-NAME and/or first browse and/or first query */
&Scoped-define FRAME-NAME frMain
/* Standard List Definitions */
&Scoped-Define ENABLED-OBJECTS toUseCache coObjType ToSave fiProdModObj
&Scoped-Define DISPLAYED-OBJECTS raSource toUseCache fiFieldName coObjType ~
ToSave fiObjectDescription
/* Custom List Definitions */
/* ADM-ASSIGN-FIELDS,List-2,List-3,List-4,List-5,List-6 */
/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME
/* ************************ Function Prototypes ********************** */
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD clearDetails vTableWin
FUNCTION clearDetails RETURNS LOGICAL
( plClearAll AS LOGICAL ) FORWARD.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getDataViewSource vTableWin
FUNCTION getDataViewSource RETURNS HANDLE
( /* parameter-definitions */ ) FORWARD.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getSDFProc vTableWin
FUNCTION getSDFProc RETURNS HANDLE
( /* parameter-definitions */ ) FORWARD.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD setDataObjectName vTableWin
FUNCTION setDataObjectName RETURNS LOGICAL
( INPUT pcName AS CHARACTER ) FORWARD.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD setToolbarHandle vTableWin
FUNCTION setToolbarHandle RETURNS LOGICAL
( INPUT phToolbarHandle AS HANDLE ) FORWARD.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
/* *********************** Control Definitions ********************** */
/* Definitions of handles for SmartObjects */
DEFINE VARIABLE hCustomSuperProcedure AS HANDLE NO-UNDO.
DEFINE VARIABLE hDataObject AS HANDLE NO-UNDO.
DEFINE VARIABLE hObjectFilename AS HANDLE NO-UNDO.
DEFINE VARIABLE hProductModule AS HANDLE NO-UNDO.
DEFINE VARIABLE hResultCode AS HANDLE NO-UNDO.
/* Definitions of the field level widgets */
DEFINE BUTTON buSynch
LABEL "&Synch with Master"
SIZE 19.6 BY 1.14 TOOLTIP "Synch the instance properties with that of the master"
BGCOLOR 8 .
DEFINE BUTTON buSynchInstances
LABEL "&Synch Instances ..."
SIZE 20 BY 1.14 TOOLTIP "Synchronize instances with master"
BGCOLOR 8 .
DEFINE BUTTON buWhereUsed
LABEL "&Where Used"
SIZE 20 BY 1.14 TOOLTIP "Find out where this SDF is currently used."
BGCOLOR 8 .
DEFINE VARIABLE coObjType AS CHARACTER FORMAT "X(256)":U
LABEL "SDF type"
VIEW-AS COMBO-BOX INNER-LINES 5
DROP-DOWN-LIST
SIZE 52.8 BY 1 TOOLTIP "Select a Smart Data Field Type" NO-UNDO.
DEFINE VARIABLE fiDataObjectTypes AS CHARACTER FORMAT "X(70)":U
VIEW-AS FILL-IN
SIZE 2 BY 1 NO-UNDO.
DEFINE VARIABLE fiFieldName AS CHARACTER FORMAT "X(75)":U
LABEL "Field name"
VIEW-AS FILL-IN
SIZE 48 BY 1 TOOLTIP "The field name of the underlying field the SDF was dropped onto." NO-UNDO.
DEFINE VARIABLE fiObjectDescription AS CHARACTER FORMAT "X(35)":U
LABEL "Description"
VIEW-AS FILL-IN
SIZE 48.8 BY 1 TOOLTIP "Description of SmartDataField" NO-UNDO.
DEFINE VARIABLE fiProdModObj AS CHARACTER FORMAT "X(15)":U
VIEW-AS FILL-IN
SIZE 2 BY 1 NO-UNDO.
DEFINE VARIABLE fiValidTypes AS CHARACTER FORMAT "X(70)":U
VIEW-AS FILL-IN
SIZE 2 BY 1 TOOLTIP "Do not remove" NO-UNDO.
DEFINE VARIABLE raSource AS CHARACTER
CONTEXT-HELP-ID 0
VIEW-AS RADIO-SET HORIZONTAL
RADIO-BUTTONS
"Database query", "DB",
"DataObject", "SDO"
SIZE 43.8 BY .86 NO-UNDO.
DEFINE VARIABLE ToSave AS LOGICAL INITIAL no
LABEL "Save as SmartObject"
VIEW-AS TOGGLE-BOX
SIZE 24.8 BY .81 NO-UNDO.
DEFINE VARIABLE toUseCache AS LOGICAL INITIAL no
LABEL "Use cache"
VIEW-AS TOGGLE-BOX
SIZE 20.4 BY .81 TOOLTIP "If set then the SDF cache manager will be used to retrieve data where available" NO-UNDO.
/* ************************ Frame Definitions *********************** */
DEFINE FRAME frMain
raSource AT ROW 5.38 COL 20.2 NO-LABEL
toUseCache AT ROW 3.14 COL 95.8
fiFieldName AT ROW 2.05 COL 93.8 COLON-ALIGNED
buSynch AT ROW 4.05 COL 124.2
coObjType AT ROW 2.05 COL 17.8 COLON-ALIGNED
fiValidTypes AT ROW 2.05 COL 67 COLON-ALIGNED NO-LABEL
ToSave AT ROW 4.05 COL 95.8
fiObjectDescription AT ROW 4.14 COL 17.8 COLON-ALIGNED
fiProdModObj AT ROW 1 COL 69 NO-LABEL
buWhereUsed AT ROW 4.05 COL 74.6
fiDataObjectTypes AT ROW 6.48 COL 68.2 COLON-ALIGNED NO-LABEL
buSynchInstances AT ROW 5.43 COL 74.6
"Data source:" VIEW-AS TEXT
SIZE 13 BY .62 AT ROW 5.38 COL 6.8
SPACE(124.00) SKIP(1.43)
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY USE-DICT-EXPS
SIDE-LABELS NO-UNDERLINE THREE-D NO-AUTO-VALIDATE
AT COL 1 ROW 1 SCROLLABLE .
/* *********************** Procedure Settings ************************ */
&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
Type: SmartDataViewer
Compile into:
Data Source: "ry/obj/ryemptysdo.w"
Allow: Basic,DB-Fields,Smart
Container Links: Data-Target,Update-Source,TableIO-Target,GroupAssign-Source,GroupAssign-Target
Frames: 1
Add Fields to: Neither
Other Settings: PERSISTENT-ONLY COMPILE
Temp-Tables and Buffers:
TABLE: RowObject D "?" ?
ADDITIONAL-FIELDS:
{ry/obj/ryemptysdo.i}
END-FIELDS.
END-TABLES.
*/
/* This procedure should always be RUN PERSISTENT. Report the error, */
/* then cleanup and return. */
IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
VIEW-AS ALERT-BOX ERROR BUTTONS OK.
RETURN.
END.
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS
/* ************************* Create Window ************************** */
&ANALYZE-SUSPEND _CREATE-WINDOW
/* DESIGN Window definition (used by the UIB)
CREATE WINDOW vTableWin ASSIGN
HEIGHT = 6.71
WIDTH = 142.8.
/* END WINDOW DEFINITION */
*/
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB vTableWin
/* ************************* Included-Libraries *********************** */
{src/adm2/viewer.i}
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
/* *********** Runtime Attributes and AppBuilder Settings *********** */
&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
/* SETTINGS FOR WINDOW vTableWin
VISIBLE,,RUN-PERSISTENT */
/* SETTINGS FOR FRAME frMain
NOT-VISIBLE FRAME-NAME Size-to-Fit Custom */
ASSIGN
FRAME frMain:SCROLLABLE = FALSE
FRAME frMain:HIDDEN = TRUE.
/* SETTINGS FOR BUTTON buSynch IN FRAME frMain
NO-ENABLE */
ASSIGN
buSynch:HIDDEN IN FRAME frMain = TRUE.
/* SETTINGS FOR BUTTON buSynchInstances IN FRAME frMain
NO-ENABLE */
ASSIGN
buSynchInstances:HIDDEN IN FRAME frMain = TRUE.
/* SETTINGS FOR BUTTON buWhereUsed IN FRAME frMain
NO-ENABLE */
ASSIGN
buWhereUsed:HIDDEN IN FRAME frMain = TRUE.
/* SETTINGS FOR FILL-IN fiDataObjectTypes IN FRAME frMain
NO-DISPLAY NO-ENABLE */
ASSIGN
fiDataObjectTypes:HIDDEN IN FRAME frMain = TRUE.
/* SETTINGS FOR FILL-IN fiFieldName IN FRAME frMain
NO-ENABLE */
/* SETTINGS FOR FILL-IN fiObjectDescription IN FRAME frMain
NO-ENABLE */
/* SETTINGS FOR FILL-IN fiProdModObj IN FRAME frMain
NO-DISPLAY ALIGN-L */
ASSIGN
fiProdModObj:HIDDEN IN FRAME frMain = TRUE.
/* SETTINGS FOR FILL-IN fiValidTypes IN FRAME frMain
NO-DISPLAY NO-ENABLE */
ASSIGN
fiValidTypes:HIDDEN IN FRAME frMain = TRUE.
/* SETTINGS FOR RADIO-SET raSource IN FRAME frMain
NO-ENABLE */
ASSIGN
ToSave:HIDDEN IN FRAME frMain = TRUE.
/* _RUN-TIME-ATTRIBUTES-END */
&ANALYZE-RESUME
/* Setting information for Queries and Browse Widgets fields */
&ANALYZE-SUSPEND _QUERY-BLOCK FRAME frMain
/* Query rebuild information for FRAME frMain
_Options = "NO-LOCK"
_Query is NOT OPENED
*/ /* FRAME frMain */
&ANALYZE-RESUME
/* ************************ Control Triggers ************************ */
&Scoped-define SELF-NAME buSynch
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL buSynch vTableWin
ON CHOOSE OF buSynch IN FRAME frMain /* Synch with Master */
DO:
DEFINE VARIABLE cMessage AS CHARACTER NO-UNDO.
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cSDFType AS CHARACTER NO-UNDO.
cMessage = "Are you sure that you want to apply the values from the Master object to your instance?".
RUN askQuestion IN gshSessionManager (INPUT cMessage, /* messages */
INPUT "&Yes,&No":U, /* button list */
INPUT "&Yes":U, /* default */
INPUT "&No":U, /* cancel */
INPUT "Apply Master Values":U, /* title */
INPUT "":U, /* datatype */
INPUT "":U, /* format */
INPUT-OUTPUT cAnswer, /* answer */
OUTPUT cButton /* button pressed */
).
IF cButton <> "&Yes":U THEN
RETURN NO-APPLY.
ELSE DO:
{get lookupHandle hLookup hObjectFileName}.
RUN getObjectDetail IN ghContainerSource (INPUT hLookup:SCREEN-VALUE,
OUTPUT ghDataTable).
ghDataTable:FIND-FIRST().
ghDataTable:BUFFER-DELETE().
ghDataTable:FIND-LAST().
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
END.
/* Update this viewer. Only update the instance attributes,
and not the master values (like the obejct_filename).
*/
toUseCache:CHECKED = ghDataTable:BUFFER-FIELD("lUseCache":U):BUFFER-VALUE.
setDataObjectName(ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE).
RUN changesMade.
ASSIGN buSynch:SENSITIVE = FALSE
buSynch:HIDDEN = TRUE.
END.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME buSynchInstances
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL buSynchInstances vTableWin
ON CHOOSE OF buSynchInstances IN FRAME frMain /* Synch Instances ... */
DO:
RUN synchInstances.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME buWhereUsed
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL buWhereUsed vTableWin
ON CHOOSE OF buWhereUsed IN FRAME frMain /* Where Used */
DO:
RUN whereUsed.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME coObjType
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL coObjType vTableWin
ON TAB OF coObjType IN FRAME frMain /* SDF type */
DO:
APPLY "VALUE-CHANGED":U TO SELF.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL coObjType vTableWin
ON VALUE-CHANGED OF coObjType IN FRAME frMain /* SDF type */
DO:
DEFINE VARIABLE hContainer AS HANDLE NO-UNDO.
DEFINE VARIABLE hFolder AS HANDLE NO-UNDO.
DEFINE VARIABLE cDataValue AS CHARACTER NO-UNDO.
{get dataValue CDataValue hObjectFileName}.
{get ContainerSource hContainer}.
hFolder = WIDGET-HANDLE(DYNAMIC-FUNCTION("linkHandles":U IN hContainer,"Page-Source":U)).
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
RUN disableFolderPage IN hFolder (INPUT 2).
RUN enableFolderPage IN hFolder (INPUT 1).
RUN selectPage IN hContainer (INPUT 1).
IF glNew AND cDataValue <> "":U THEN
RUN "leaveLookup" IN hObjectFileName.
DISABLE raSource WITH FRAME {&FRAME-NAME}.
RUN disableField IN hDataObject.
RUN assignNewValue IN hDataObject (INPUT "":U, INPUT "":U, INPUT FALSE).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
RUN disableFolderPage IN hFolder (INPUT 1).
RUN enableFolderPage IN hFolder (INPUT 2).
RUN selectPage IN hContainer (INPUT 2).
IF glNew AND cDataValue <> "":U THEN
RUN "leaveLookup" IN hObjectFileName.
ENABLE raSource WITH FRAME {&FRAME-NAME}.
ASSIGN raSource:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "DB":U.
END.
APPLY "entry":U TO SELF.
RETURN NO-APPLY.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME fiFieldName
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fiFieldName vTableWin
ON VALUE-CHANGED OF fiFieldName IN FRAME frMain /* Field name */
DO:
RUN changesMade.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME fiObjectDescription
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fiObjectDescription vTableWin
ON VALUE-CHANGED OF fiObjectDescription IN FRAME frMain /* Description */
DO:
RUN changesMade.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME raSource
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL raSource vTableWin
ON VALUE-CHANGED OF raSource IN FRAME frMain
DO:
ASSIGN raSource.
IF raSource = 'SDO':U THEN
RUN enableField IN hDataObject.
ELSE DO:
RUN disableField IN hDataObject.
RUN clearField IN hDataObject.
DYNAMIC-FUNCTION('setDataSourceName':U IN ghDynCombo,
INPUT '':U).
END.
RUN changeSource IN ghDynCombo (INPUT raSource).
RUN changesMade.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME ToSave
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ToSave vTableWin
ON VALUE-CHANGED OF ToSave IN FRAME frMain /* Save as SmartObject */
DO:
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE hProdModCombo AS HANDLE NO-UNDO.
ASSIGN toSave.
IF glCheckChange THEN
RUN changesMade.
IF NOT glStaticSDF THEN
RETURN NO-APPLY.
{get ComboHandle hProdModCombo hProductModule}.
IF toSave THEN DO:
glNew = TRUE.
RUN enableField IN hObjectFileName.
IF NOT glStaticSDF THEN
RUN disableButton IN hObjectFileName.
ASSIGN hProdModCombo:SCREEN-VALUE = hProdModCombo:ENTRY(1).
RUN enableField IN hProductModule.
{get LookupHandle hLookup hObjectFileName}.
hLookup:SCREEN-VALUE = "":U.
ENABLE fiObjectDescription toUseCache WITH FRAME {&FRAME-NAME}.
IF VALID-HANDLE(ghToolbar) THEN
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "cbCancel":U).
END.
ELSE DO:
ASSIGN hProdModCombo:LIST-ITEM-PAIRS = hProdModCombo:LIST-ITEM-PAIRS.
RUN setFields ("Cancel":U).
END.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&Scoped-define SELF-NAME toUseCache
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL toUseCache vTableWin
ON VALUE-CHANGED OF toUseCache IN FRAME frMain /* Use cache */
DO:
RUN changesMade.
END.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&UNDEFINE SELF-NAME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK vTableWin
/* *************************** Main Block *************************** */
&IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
RUN initializeObject.
&ENDIF
/************************ INTERNAL PROCEDURES ********************/
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
/* ********************** Internal Procedures *********************** */
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects vTableWin _ADM-CREATE-OBJECTS
PROCEDURE adm-create-objects :
/*------------------------------------------------------------------------------
Purpose: Create handles for all SmartObjects used in this procedure.
After SmartObjects are initialized, then SmartLinks are added.
Parameters: <none>
------------------------------------------------------------------------------*/
DEFINE VARIABLE currentPage AS INTEGER NO-UNDO.
ASSIGN currentPage = getCurrentPage().
CASE currentPage:
WHEN 0 THEN DO:
RUN constructObject (
INPUT 'ry/obj/rysdfdatasource.w':U ,
INPUT FRAME frMain:HANDLE ,
INPUT 'DisplayedFieldryc_smartobject.object_filenameKeyFieldryc_smartobject.object_filenameFieldLabelDataObject nameFieldTooltipPress F4 for LookupKeyFormatX(70)KeyDatatypecharacterDisplayFormatX(70)DisplayDatatypecharacterBaseQueryStringFOR EACH gsc_object_type NO-LOCK, EACH ryc_smartobject NO-LOCK
WHERE ryc_smartobject.object_type_obj = gsc_object_type.object_type_obj,
FIRST gsc_product_module NO-LOCK
WHERE gsc_product_module.product_module_obj = ryc_smartobject.product_module_obj AND [&FilterSet=|&EntityList=GSCPM,RYCSO]
BY gsc_object_type.object_type_code BY ryc_smartobject.object_filename INDEXED-REPOSITIONQueryTablesgsc_object_type,ryc_smartobject,gsc_product_moduleBrowseFieldsryc_smartobject.object_filename,gsc_object_type.object_type_code,gsc_product_module.product_module_code,ryc_smartobject.object_descriptionBrowseFieldDataTypescharacter,character,character,characterBrowseFieldFormatsX(70)|X(35)|X(35)|X(35)RowsToBatch200BrowseTitleLookupViewerLinkedFieldsLinkedFieldDataTypesLinkedFieldFormatsViewerLinkedWidgetsColumnLabelsColumnFormatSDFFileNameSDFTemplateLookupImageadeicon/select.bmpParentFieldfiDataObjectTypesParentFilterQueryLOOKUP(gsc_object_type.object_type_code,~'&1~') > 0|MaintenanceObjectMaintenanceSDOCustomSuperProcPhysicalTableNamesTempTablesQueryBuilderJoinCodeQueryBuilderOptionListQueryBuilderOrderListQueryBuilderTableOptionListQueryBuilderTuneOptionsQueryBuilderWhereClausesPopupOnAmbiguousyesPopupOnUniqueAmbiguousnoPopupOnNotAvailnoBlankOnNotAvailnoMappedFieldsUseCacheyesSuperProcedureDataSourceNameFieldNamefiDataObjectDisplayFieldyesEnableFieldyesLocalFieldyesHideOnInitnoDisableOnInitnoObjectLayout':U ,
OUTPUT hDataObject ).
RUN repositionObject IN hDataObject ( 6.43 , 20.00 ) NO-ERROR.
RUN resizeObject IN hDataObject ( 1.00 , 50.00 ) NO-ERROR.
RUN constructObject (
INPUT 'adm2/dynlookup.w':U ,
INPUT FRAME frMain:HANDLE ,
INPUT 'DisplayedFieldryc_smartobject.object_filenameKeyFieldryc_smartobject.object_filenameFieldLabelSmartDataFieldFieldTooltipPress F4 to Lookup existing SmartDataFieldsKeyFormatx(256)KeyDatatypecharacterDisplayFormatx(256)DisplayDatatypecharacterBaseQueryStringFOR EACH gsc_object_type NO-LOCK, EACH ryc_smartobject NO-LOCK
WHERE ryc_smartobject.object_type_obj = gsc_object_type.object_type_obj,
FIRST gsc_product_module NO-LOCK
WHERE gsc_product_module.product_module_obj = ryc_smartobject.product_module_obj AND [&FilterSet=|&EntityList=GSCPM,RYCSO]
BY gsc_object_type.object_type_code BY ryc_smartobject.object_filename INDEXED-REPOSITIONQueryTablesgsc_object_type,ryc_smartobject,gsc_product_moduleBrowseFieldsryc_smartobject.object_filename,gsc_object_type.object_type_code,gsc_product_module.product_module_code,ryc_smartobject.object_descriptionBrowseFieldDataTypescharacter,character,character,characterBrowseFieldFormatsRowsToBatch200BrowseTitleLookup SmartDataFieldViewerLinkedFieldsgsc_object_type.object_type_code,gsc_product_module.product_module_code,ryc_smartobject.object_descriptionLinkedFieldDataTypescharacter,character,characterLinkedFieldFormatsViewerLinkedWidgetscoObjType,?,fiObjectDescriptionColumnLabelsColumnFormatSDFFileNameSDFTemplateLookupImageadeicon/select.bmpParentFieldfiValidTypesParentFilterQueryLOOKUP(gsc_object_type.object_type_code,~'&1~') > 0|MaintenanceObjectMaintenanceSDOCustomSuperProcPhysicalTableNamesTempTablesQueryBuilderJoinCodeQueryBuilderOptionListQueryBuilderOrderListQueryBuilderTableOptionListQueryBuilderTuneOptionsQueryBuilderWhereClausesPopupOnAmbiguousyesPopupOnUniqueAmbiguousnoPopupOnNotAvailnoBlankOnNotAvailnoMappedFieldsUseCacheyesSuperProcedureDataSourceNameFieldNamefiSmartDataFieldDisplayFieldyesEnableFieldyesLocalFieldyesHideOnInitnoDisableOnInitnoObjectLayout':U ,
OUTPUT hObjectFilename ).
RUN repositionObject IN hObjectFilename ( 1.00 , 19.80 ) NO-ERROR.
RUN resizeObject IN hObjectFilename ( 1.00 , 50.00 ) NO-ERROR.
RUN constructObject (
INPUT 'adm2/dynlookup.w':U ,
INPUT FRAME frMain:HANDLE ,
INPUT 'DisplayedFieldryc_customization_result.customization_result_codeKeyFieldryc_customization_result.customization_result_objFieldLabelResult codeFieldTooltipPress F4 For LookupKeyFormat->>>>>>>>>>>>>>>>>9.999999999KeyDatatypedecimalDisplayFormatX(70)DisplayDatatypecharacterBaseQueryStringFOR EACH ryc_customization_type NO-LOCK,
EACH ryc_customization_result NO-LOCK
WHERE ryc_customization_result.customization_type_obj = ryc_customization_type.customization_type_obj INDEXED-REPOSITIONQueryTablesryc_customization_type,ryc_customization_resultBrowseFieldsryc_customization_result.customization_result_code,ryc_customization_result.customization_result_desc,ryc_customization_result.system_owned,ryc_customization_type.customization_type_code,ryc_customization_type.customization_type_desc,ryc_customization_type.api_nameBrowseFieldDataTypescharacter,character,logical,character,character,characterBrowseFieldFormatsX(70)|X(70)|YES/NO|X(15)|X(35)|X(70)RowsToBatch200BrowseTitleResult Code LookupViewerLinkedFieldsLinkedFieldDataTypesLinkedFieldFormatsViewerLinkedWidgetsColumnLabelsColumnFormatSDFFileNameSDFTemplateLookupImageadeicon/select.bmpParentFieldParentFilterQueryMaintenanceObjectMaintenanceSDOCustomSuperProcPhysicalTableNamesTempTablesQueryBuilderJoinCodeQueryBuilderOptionListQueryBuilderOrderListQueryBuilderTableOptionListQueryBuilderTuneOptionsQueryBuilderWhereClausesPopupOnAmbiguousyesPopupOnUniqueAmbiguousnoPopupOnNotAvailnoBlankOnNotAvailnoMappedFieldsUseCacheyesSuperProcedureDataSourceNameFieldName<Local2>DisplayFieldyesEnableFieldyesLocalFieldyesHideOnInitnoDisableOnInitnoObjectLayout':U ,
OUTPUT hResultCode ).
RUN repositionObject IN hResultCode ( 2.05 , 19.80 ) NO-ERROR.
RUN resizeObject IN hResultCode ( 1.00 , 50.00 ) NO-ERROR.
RUN constructObject (
INPUT 'adm2/dynlookup.w':U ,
INPUT FRAME frMain:HANDLE ,
INPUT 'DisplayedFieldryc_smartobject.object_filenameKeyFieldryc_smartobject.object_filenameFieldLabelSuper procedureFieldTooltipPress F4 to Lookup a Super ProcedureKeyFormatX(70)KeyDatatypecharacterDisplayFormatX(70)DisplayDatatypecharacterBaseQueryStringFOR EACH gsc_object_type NO-LOCK
WHERE gsc_object_type.object_type_code = ~'PROCEDURE~':U,
EACH ryc_smartobject NO-LOCK
WHERE ryc_smartobject.object_type_obj = gsc_object_type.object_type_obj,
FIRST gsc_product_module NO-LOCK
WHERE gsc_product_module.product_module_obj = ryc_smartobject.product_module_obj AND [&FilterSet=|&EntityList=GSCPM,RYCSO] INDEXED-REPOSITIONQueryTablesgsc_object_type,ryc_smartobject,gsc_product_moduleBrowseFieldsryc_smartobject.object_filename,ryc_smartobject.object_description,gsc_product_module.product_module_code,ryc_smartobject.template_smartobject,ryc_smartobject.object_pathBrowseFieldDataTypescharacter,character,character,logical,characterBrowseFieldFormatsX(70)|X(35)|X(35)|YES/NO|X(70)RowsToBatch200BrowseTitleLookup Custom Super ProcedureViewerLinkedFieldsryc_smartobject.object_pathLinkedFieldDataTypescharacterLinkedFieldFormatsX(70)ViewerLinkedWidgetsColumnLabelsColumnFormatSDFFileNameSDFTemplateLookupImageadeicon/select.bmpParentFieldParentFilterQueryMaintenanceObjectMaintenanceSDOCustomSuperProcPhysicalTableNamesTempTablesQueryBuilderJoinCodeQueryBuilderOptionListQueryBuilderOrderListQueryBuilderTableOptionListQueryBuilderTuneOptionsQueryBuilderWhereClausesPopupOnAmbiguousyesPopupOnUniqueAmbiguousnoPopupOnNotAvailnoBlankOnNotAvailnoMappedFieldsUseCacheyesSuperProcedureDataSourceNameFieldName<Local5>DisplayFieldyesEnableFieldyesLocalFieldyesHideOnInitnoDisableOnInitnoObjectLayout':U ,
OUTPUT hCustomSuperProcedure ).
RUN repositionObject IN hCustomSuperProcedure ( 3.10 , 19.80 ) NO-ERROR.
RUN resizeObject IN hCustomSuperProcedure ( 1.00 , 50.00 ) NO-ERROR.
RUN constructObject (
INPUT 'adm2/dyncombo.w':U ,
INPUT FRAME frMain:HANDLE ,
INPUT 'DisplayedFieldgsc_product_module.product_module_code,gsc_product_module.product_module_descriptionKeyFieldgsc_product_module.product_module_codeFieldLabelProduct moduleFieldTooltipSelect a Product Module from the listKeyFormatX(35)KeyDatatypecharacterDisplayFormatX(35)DisplayDatatypecharacterBaseQueryStringFOR EACH gsc_product_module
WHERE [&FilterSet=|&EntityList=GSCPM] NO-LOCK BY gsc_product_module.product_module_code INDEXED-REPOSITIONQueryTablesgsc_product_moduleSDFFileNameSDFTemplateParentFieldParentFilterQueryDescSubstitute&1 / &2ComboDelimiterListItemPairsInnerLines5SortnoComboFlagFlagValueBuildSequence1SecurednoCustomSuperProcPhysicalTableNamesTempTablesQueryBuilderJoinCodeQueryBuilderOptionListQueryBuilderOrderListQueryBuilderTableOptionListQueryBuilderTuneOptionsQueryBuilderWhereClausesUseCacheyesSuperProcedureDataSourceNameFieldNamefiProductModuleDisplayFieldyesEnableFieldyesLocalFieldyesHideOnInitnoDisableOnInitnoObjectLayout':U ,
OUTPUT hProductModule ).
RUN repositionObject IN hProductModule ( 1.00 , 95.80 ) NO-ERROR.
RUN resizeObject IN hProductModule ( 1.00 , 48.00 ) NO-ERROR.
/* Adjust the tab order of the smart objects. */
RUN adjustTabOrder ( hDataObject ,
raSource:HANDLE IN FRAME frMain , 'AFTER':U ).
RUN adjustTabOrder ( hObjectFilename ,
ToSave:HANDLE IN FRAME frMain , 'AFTER':U ).
RUN adjustTabOrder ( hResultCode ,
hObjectFilename , 'AFTER':U ).
RUN adjustTabOrder ( hCustomSuperProcedure ,
hResultCode , 'AFTER':U ).
RUN adjustTabOrder ( hProductModule ,
fiProdModObj:HANDLE IN FRAME frMain , 'AFTER':U ).
END. /* Page 0 */
END CASE.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE assignSDFValues vTableWin
PROCEDURE assignSDFValues :
/*------------------------------------------------------------------------------
Purpose: This procedure will assign the SDF's other details to the
fields on this viewer
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE hProdModCombo AS HANDLE NO-UNDO.
IF NOT VALID-HANDLE(ghDataTable) THEN
RETURN.
ghDataTable:FIND-FIRST().
IF NOT ghDataTable:AVAILABLE THEN
RETURN.
DO WITH FRAME {&FRAME-NAME}:
{get LookupHandle hLookup hObjectFileName}.
IF ghDataTable:BUFFER-FIELD("cSDFFileName":U):BUFFER-VALUE <> "":U THEN DO:
hLookup:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cSDFFileName":U):BUFFER-VALUE.
IF glStaticSDF THEN DO:
ASSIGN toSave:CHECKED = TRUE.
APPLY "VALUE-CHANGED":U TO toSave.
END.
END.
ELSE
hLookup:SCREEN-VALUE = "":U.
DYNAMIC-FUNCTION("setDataValue":U IN hProductModule, ghDataTable:BUFFER-FIELD("cProductModule":U):BUFFER-VALUE).
ASSIGN fiObjectDescription:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cObjectDescription":U):BUFFER-VALUE
fiFieldName:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cActualField":U):BUFFER-VALUE
toUseCache:CHECKED = ghDataTable:BUFFER-FIELD("lUseCache":U):BUFFER-VALUE.
setDataObjectName(ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE).
RUN assignNewValue IN hCustomSuperProcedure (INPUT ghDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE, INPUT ghDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE, TRUE).
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE changesMade vTableWin
PROCEDURE changesMade :
/*------------------------------------------------------------------------------
Purpose: This event will be published from the maintenance viewer to
indicate that we should enable the save and reset buttons.
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
IF INDEX(PROGRAM-NAME(2),"rysdflkupv":U) > 0 OR
INDEX(PROGRAM-NAME(2),"rysdfcombv":U) > 0 THEN
DISABLE coObjType WITH FRAME {&FRAME-NAME}.
IF (glNew AND NOT glStaticSDF) THEN
RETURN.
RUN setFields (INPUT "Change":U).
IF glStaticSDF AND NOT glNew THEN
RUN disableButton IN hObjectFileName.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE checkForStaticSDF vTableWin
PROCEDURE checkForStaticSDF :
/*------------------------------------------------------------------------------
Purpose: This procedure will check if this SDF Maintenance window was
launched from a Static SDF field.
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cRunAttribute AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSDFType AS CHARACTER NO-UNDO.
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE lExisting AS LOGICAL NO-UNDO.
DEFINE VARIABLE hCompare AS HANDLE NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE cMessage AS CHARACTER NO-UNDO.
DEFINE VARIABLE hContainer AS HANDLE NO-UNDO.
DEFINE VARIABLE cHiddenActions AS CHARACTER NO-UNDO.
DEFINE VARIABLE hProdModCombo AS HANDLE NO-UNDO.
DEFINE VARIABLE hRepDesignManager AS HANDLE NO-UNDO.
DEFINE VARIABLE cViewerFields AS CHARACTER NO-UNDO.
DEFINE VARIABLE hDataSourceHandle AS HANDLE NO-UNDO.
glStaticSDF = FALSE.
{get RunAttribute cRunAttribute ghContainerSource}.
{get ContainerHandle hContainer ghContainerSource}.
IF cRunAttribute <> "":U THEN
ASSIGN ghSDFObject = WIDGET-HANDLE(ENTRY(1,cRunAttribute,CHR(3))) NO-ERROR.
IF cRunAttribute = "":U OR
NOT VALID-HANDLE(ghSDFObject) THEN DO:
ASSIGN fiValidTypes:SCREEN-VALUE IN FRAME {&FRAME-NAME} = gcComboClasses + ",":U + gcLookupClasses.
IF cRunAttribute = "":U THEN DO:
hContainer:TITLE = hContainer:TITLE + " (Master Properties)".
RETURN.
END.
END.
IF VALID-HANDLE(ghSDFObject) THEN DO:
/* Get details required for MAPPING fields */
RUN returnViewerFields IN ghSDFObject (OUTPUT cViewerFields) NO-ERROR.
IF NOT ERROR-STATUS:ERROR THEN
PUBLISH "viewerFields":U FROM ghContainerSource (cViewerFields).
RUN returnDataSourceHandle IN ghSDFObject (OUTPUT hDataSourceHandle) NO-ERROR.
IF NOT ERROR-STATUS:ERROR THEN
PUBLISH "dataSourceHandle":U FROM ghContainerSource (hDataSourceHandle).
END.
/* When user used 'Edit Master' option on popup menu */
IF cRunAttribute <> "":U AND
NOT VALID-HANDLE(ghSDFObject) THEN DO:
hContainer:TITLE = hContainer:TITLE + " (Master Properties)".
IF ENTRY(1,cRunAttribute,CHR(3)) = "NOMASTER":U THEN DO:
RUN showMessages IN gshSessionManager (INPUT "No Master Object (SmartDataField) could be found for this object.",
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "No Master Exists",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN "EXIT":U.
END.
glUpdateMasterOnly = TRUE.
RUN setFields ("Find":U).
RUN assignNewValue IN hObjectFilename (INPUT cRunAttribute,INPUT cRunAttribute,FALSE).
cHiddenActions = cHiddenActions + (IF cHiddenActions = "":U THEN "":U ELSE ",":U)
+ "cbSaveAs".
DYNAMIC-FUNCTION("sethiddenActions":U IN ghToolbar, cHiddenActions).
RETURN.
END.
IF VALID-HANDLE(ghSDFObject) THEN DO:
glUpdateMasterOnly = FALSE.
/* Set the Title to indicate that we are editing instance properties */
hContainer:TITLE = hContainer:TITLE + " (Instance Properties)".
glIsDynView = FALSE.
IF DYNAMIC-FUNCTION("getViewerType":U IN ghSDFObject) BEGINS "Dyn":U THEN
glIsDynView = TRUE.
cSDFType = DYNAMIC-FUNCTION("getSDFType":U IN ghSDFObject) NO-ERROR.
IF LOOKUP(cSDFType, gcLookupClasses) = 0
AND LOOKUP(cSDFType, gcComboClasses) = 0
THEN DO:
MESSAGE "The Static SDF is invalid" cSDFType
VIEW-AS ALERT-BOX ERROR.
END.
glStaticSDF = TRUE.
RUN setFields ("New":U).
glNew = TRUE.
DO WITH FRAME {&FRAME-NAME}:
IF LOOKUP(cSDFType, gcLookupClasses) <> 0 THEN
ASSIGN coObjType:LIST-ITEMS = gcLookupClasses.
ELSE
ASSIGN coObjType:LIST-ITEMS = gcComboClasses.
ASSIGN coObjType:SCREEN-VALUE = cSDFType NO-ERROR.
APPLY "VALUE-CHANGED":U TO coObjType.
ASSIGN fiValidTypes:SCREEN-VALUE IN FRAME {&FRAME-NAME} = gcLookupClasses + ",":U + gcComboClasses.
END.
ASSIGN toSave:CHECKED IN FRAME {&FRAME-NAME} = TRUE.
RUN enablefield IN hProductModule.
IF NUM-ENTRIES(cRunAttribute,CHR(3)) >= 2 AND
ENTRY(2,cRunAttribute,CHR(3)) <> "NEW":U THEN
DO:
RUN assignNewValue IN hObjectFileName (INPUT ENTRY(2,cRunAttribute,CHR(3)), INPUT ENTRY(2,cRunAttribute,CHR(3)), FALSE).
/* If we are using an existing SDF - assign it's Super */
IF VALID-HANDLE(ghDataTable) AND
ghDataTable:AVAILABLE THEN
DO:
IF ghDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE <> "":U THEN
RUN assignNewValue IN hCustomSuperProcedure (INPUT ghDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE, INPUT "":U, INPUT FALSE).
IF ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE <> "":U THEN
DO:
setDataObjectName(ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE).
raSource:SCREEN-VALUE = "SDO":U.
RUN enableField IN hDataObject.
END.
END.
END.
ELSE DO:
IF LOOKUP(cSDFType, gcComboClasses) <> 0 THEN
ghDataTable = DYNAMIC-FUNCTION("getComboTable":U IN ghContainerSource).
ELSE
IF LOOKUP(cSDFType, gcLookupClasses) <> 0 THEN
ghDataTable = DYNAMIC-FUNCTION("getLookupTable":U IN ghContainerSource).
ghDataTable = ghDataTable:DEFAULT-BUFFER-HANDLE.
ghDataTable:BUFFER-CREATE().
/* Set default value */
ASSIGN ghDataTable:BUFFER-FIELD("lUseCache":U):BUFFER-VALUE = TRUE.
RUN populateSDFData IN ghSDFObject (INPUT-OUTPUT ghDataTable).
/* If we are using an existing SDF - assign it's Super */
IF VALID-HANDLE(ghDataTable) AND
ghDataTable:AVAILABLE THEN
DO:
IF ghDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE <> "":U THEN
RUN assignNewValue IN hCustomSuperProcedure (INPUT ghDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE, INPUT "":U, INPUT FALSE).
IF ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE <> "":U THEN
DO:
setDataObjectName(ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE).
raSource:SCREEN-VALUE = "SDO":U.
RUN enableField IN hDataObject.
END.
END.
END.
{get LookupHandle hLookup hObjectFileName}.
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:FIND-FIRST().
IF ghDataTable:AVAILABLE THEN DO:
/* Allow the change of the Field Name if it is a local field */
ASSIGN fiObjectDescription:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cObjectDescription":U):BUFFER-VALUE
fiFieldName:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cActualField":U):BUFFER-VALUE
toUseCache:CHECKED = ghDataTable:BUFFER-FIELD("lUseCache":U):BUFFER-VALUE.
/*
RUN assignSDFValues.
*/
IF NUM-ENTRIES(cRunAttribute,CHR(3)) >= 3 AND
ENTRY(3,cRunAttribute,CHR(3)) <> "":U THEN
fiFieldName:SCREEN-VALUE = ENTRY(3,cRunAttribute,CHR(3)).
IF fiFieldName:SCREEN-VALUE <> "":U AND
NUM-ENTRIES(fiFieldName:SCREEN-VALUE,".":U) >= 3 AND
ENTRY(1,fiFieldName:SCREEN-VALUE,".":U) = ENTRY(2,fiFieldName:SCREEN-VALUE,".":U) THEN
fiFieldName:SCREEN-VALUE = SUBSTRING(fiFieldName:SCREEN-VALUE,LENGTH(ENTRY(1,fiFieldName:SCREEN-VALUE,".":U)) + 2).
IF ghDataTable:BUFFER-FIELD("lLocalField":U):BUFFER-VALUE = TRUE AND
glIsDynView = FALSE THEN
ENABLE fiFieldName toUseCache WITH FRAME {&FRAME-NAME}.
/* If we are on a DynViewer, and we have been told by the caller
that we are a NEW SDF, then ensure that we create a new Master
object in addition (well, prior to) to the instance.
*/
IF glIsDynView AND
num-entries(cRunAttribute, chr(3)) ge 2 and
entry(2, cRunAttribute, chr(3)) eq 'New':u then
glUpdateMasterOnly = TRUE.
IF ghDataTable:BUFFER-FIELD("cSDFFileName":U):BUFFER-VALUE = "":U THEN DO:
ASSIGN toSave:CHECKED IN FRAME {&FRAME-NAME} = FALSE.
glCheckChange = FALSE.
APPLY "VALUE-CHANGED":U TO toSave IN FRAME {&FRAME-NAME}.
glCheckChange = TRUE.
glNew = TRUE.
{get ComboHandle hProdModCombo hProductModule}.
ASSIGN hProdModCombo:LIST-ITEM-PAIRS = hProdModCombo:LIST-ITEM-PAIRS.
END.
ELSE DO:
hLookup:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cSDFFileName":U):BUFFER-VALUE.
/* First check if we have a valid smartobject that exists */
/* Check whether object name already exists */
ASSIGN hRepDesignManager = DYNAMIC-FUNCTION("getManagerHandle":U, INPUT "RepositoryDesignManager":U).
IF DYNAMIC-FUNCTION("ObjectExists":U IN hRepDesignManager, INPUT hLookup:SCREEN-VALUE) THEN DO:
RUN disableField IN hObjectFileName.
RUN disableField IN hProductModule.
/* We need to get the field from the DB and do a buffer-compare */
SESSION:SET-WAIT-STATE("GENERAL":U).
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Retrieving data from Repository. Please Wait...").
CREATE BUFFER hCompare FOR TABLE ghDataTable BUFFER-NAME "CompareBuffer".
RUN getObjectDetail IN ghContainerSource (INPUT hLookup:SCREEN-VALUE,
OUTPUT ghDataTable).
ghDataTable:FIND-FIRST().
IF VALID-HANDLE(hCompare) THEN DO:
hCompare:FIND-LAST().
IF hCompare:AVAILABLE THEN DO WITH FRAME {&FRAME-NAME}:
ASSIGN fiObjectDescription:SCREEN-VALUE = hCompare:BUFFER-FIELD("cObjectDescription":U):BUFFER-VALUE.
DYNAMIC-FUNCTION("setDataValue":U IN hProductModule, hCompare:BUFFER-FIELD("cProductModule":U):BUFFER-VALUE).
/* Issue 20030718-002 , ColumnFormat from master not displayed */
IF LOOKUP(cSDFType, gcLookupClasses) > 0 AND ghDataTable:BUFFER-FIELD("cColumnFormat":U):BUFFER-VALUE = "" THEN
ghDataTable:BUFFER-FIELD("cColumnFormat":U):BUFFER-VALUE = hCompare:BUFFER-FIELD("cColumnFormat":U):BUFFER-VALUE .
glNew = FALSE.
IF hCompare:BUFFER-COMPARE(ghDataTable,"","cActualField,cLookupImage,cObjectDescription,cProductModule,dFieldWidth","") = FALSE THEN DO:
ASSIGN buSynch:HIDDEN = FALSE
buSynch:SENSITIVE = TRUE.
/* Delete the mast object's record from the temp-table */
ghDataTable:FIND-LAST().
ghDataTable:BUFFER-DELETE().
END.
END.
END.
DELETE WIDGET hCompare.
SESSION:SET-WAIT-STATE("":U).
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"").
END.
/* SDF Name specified does not exist in Repository */
ELSE DO:
ASSIGN hLookup:SCREEN-VALUE = "":U.
ASSIGN toSave:CHECKED = FALSE.
APPLY "VALUE-CHANGED":U TO toSave.
END.
END.
ENABLE toUseCache WITH FRAME {&FRAME-NAME}.
IF glIsDynView AND VALID-HANDLE(ghToolbar) THEN
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "New,cbCancel":U).
END. /* Avail ghDataTable */
END.
/* Do not disable the Type combo if we have subclasses */
IF NUM-ENTRIES(coObjType:LIST-ITEMS) = 1 OR NOT glNew THEN
DISABLE coObjType WITH FRAME {&FRAME-NAME}.
IF NOT glIsDynView OR lExisting = FALSE THEN DO:
IF LOOKUP(cSDFType, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(cSDFType, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
END.
END.
END.
/* Ensure the Product Module combo doesn't show values */
IF NOT glUpdateMasterOnly THEN DO:
{get ComboHandle hProdModCombo hProductModule}.
hProdModCombo:LIST-ITEM-PAIRS = hProdModCombo:LIST-ITEM-PAIRS.
/* Also ensure that super procedure lookup is disabled */
RUN disableField IN hCustomSuperProcedure.
IF VALID-HANDLE(ghSDFObject) AND
DYNAMIC-FUNCTION("isOnLocalField":U IN ghSDFObject) = TRUE AND
glIsDynView = FALSE THEN
ENABLE fiFieldName WITH FRAME {&FRAME-NAME}.
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE checkIfSDFExists vTableWin
PROCEDURE checkIfSDFExists :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cMessage AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE hRepDesignManager AS HANDLE NO-UNDO.
{get LookupHandle hLookup hObjectFileName}.
/* Check whether object name already exists */
ASSIGN hRepDesignManager = DYNAMIC-FUNCTION("getManagerHandle":U, INPUT "RepositoryDesignManager":U).
IF DYNAMIC-FUNCTION("ObjectExists":U IN hRepDesignManager,INPUT hLookup:SCREEN-VALUE ) THEN
DO:
cMessage = hLookup:SCREEN-VALUE + " already exists in the repository.~n~n" +
"To avoid overwriting it, please specify another object name or select the existing master ~n" +
"from the SmartDataField lookup.".
RUN showMessages IN gshSessionManager (INPUT cMessage,
INPUT "INF":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Already exists",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN "OBJECT-EXISTS".
END. /* if it exists */
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE comboValueChanged vTableWin
PROCEDURE comboValueChanged :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER pcKeyFieldValue AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcScreenValue AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER phField AS HANDLE NO-UNDO.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataChanged vTableWin
PROCEDURE dataChanged :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cMessageList AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
IF glNeedToSave OR
(glNew AND NOT glStaticSDF) THEN DO:
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) +
{af/sup2/aferrortxt.i 'AF' '131' '' '' '"this SmartDataField"'}.
RUN askQuestion IN gshSessionManager (INPUT cMessageList, /* message to display */
INPUT "&YES,&NO,&Cancel":U, /* button list */
INPUT "&YES":U, /* default button */
INPUT "&Cancel":U, /* cancel button */
INPUT "Add new SmartObject":U, /* window title */
INPUT "":U, /* data type of question */
INPUT "":U, /* format mask for question */
INPUT-OUTPUT cAnswer, /* character value of answer to question */
OUTPUT cButton /* button pressed */
).
/* Save before we close */
IF cButton = "&YES":U THEN
RETURN "NEED_TO_SAVE":U.
/* Don't save - just leave */
IF cButton = "&NO":U THEN
RETURN.
/* Just return back to screen */
IF cButton = "&Cancel":U THEN
RETURN "DO_NOTHING":U.
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE destroyObject vTableWin
PROCEDURE destroyObject :
/*------------------------------------------------------------------------------
Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/
/* Code placed here will execute PRIOR to standard behavior. */
RUN SUPER.
/* Code placed here will execute AFTER standard behavior. */
DEFINE VARIABLE h AS HANDLE NO-UNDO.
DEFINE VARIABLE h2 AS HANDLE NO-UNDO.
h = SESSION:FIRST-PROCEDURE.
DO WHILE VALID-HANDLE(h).
h2 = h.
h = h:NEXT-SIBLING.
IF VALID-HANDLE(h2) AND
INDEX(h2:FILE-NAME,"rysdfsuprp") > 0 THEN
DELETE PROCEDURE h2.
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI vTableWin _DEFAULT-DISABLE
PROCEDURE disable_UI :
/*------------------------------------------------------------------------------
Purpose: DISABLE the User Interface
Parameters: <none>
Notes: Here we clean-up the user-interface by deleting
dynamic widgets we have created and/or hide
frames. This procedure is usually called when
we are ready to "clean-up" after running.
------------------------------------------------------------------------------*/
/* Hide all frames. */
HIDE FRAME frMain.
IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject vTableWin
PROCEDURE initializeObject :
/*------------------------------------------------------------------------------
Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cAppBuilder AS CHARACTER NO-UNDO.
DEFINE VARIABLE hObjectLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cRunAttribute AS CHARACTER NO-UNDO.
ASSIGN gcComboClasses = DYNAMIC-FUNCTION("getClassChildrenFromDB":U IN gshRepositoryManager, INPUT "dynLookup,dynCombo")
gcLookupClasses = ENTRY(1, gcComboClasses, CHR(3))
gcComboClasses = ENTRY(2, gcComboClasses, CHR(3)).
ASSIGN fiDataObjectTypes:SCREEN-VALUE IN FRAME {&FRAME-NAME} = DYNAMIC-FUNCTION("getClassChildrenFromDB":U IN gshRepositoryManager, INPUT "Data":U).
/* Code placed here will execute PRIOR to standard behavior. */
{get ContainerSource ghContainerSource}.
{get RunAttribute cRunAttribute ghContainerSource}.
IF cRunAttribute <> "":U THEN
ghSDFObject = WIDGET-HANDLE(ENTRY(1,cRunAttribute,CHR(3))) NO-ERROR.
SUBSCRIBE PROCEDURE THIS-PROCEDURE TO "lookupDisplayComplete":U IN THIS-PROCEDURE.
SUBSCRIBE PROCEDURE THIS-PROCEDURE TO "enableSearchLookups":U IN ghContainerSource.
SUBSCRIBE PROCEDURE THIS-PROCEDURE TO "enableViewerObjects":U IN ghContainerSource.
SUBSCRIBE PROCEDURE THIS-PROCEDURE TO "comboValueChanged":U IN THIS-PROCEDURE.
SUBSCRIBE PROCEDURE THIS-PROCEDURE TO "lookupComplete":U IN THIS-PROCEDURE.
RUN SUPER.
{set FieldHidden TRUE hResultCode}.
/* Code placed here will execute AFTER standard behavior. */
DO WITH FRAME {&FRAME-NAME}:
RUN adjustTabOrder (hObjectFilename, hResultCode, 'BEFORE':U).
RUN resizeObject (FRAME {&FRAME-NAME}:HEIGHT-CHARS, FRAME {&FRAME-NAME}:WIDTH-CHARS).
END.
ghDynLookup = WIDGET-HANDLE(DYNAMIC-FUNCTION("linkHandles":U,"DynLookup-Target":U)).
ghDynCombo = WIDGET-HANDLE(DYNAMIC-FUNCTION("linkHandles":U,"DynCombo-Target":U)).
cAppBuilder = DYNAMIC-FUNCTION("getUserProperty":U IN ghContainerSource, "AppBuilder":U).
IF cAppBuilder = "yes":U THEN
glAppBuilder = TRUE.
RUN displayFields IN TARGET-PROCEDURE (?).
APPLY "VALUE-CHANGED":U TO coObjType IN FRAME {&FRAME-NAME}.
SUBSCRIBE TO "changesMade":U IN ghContainerSource.
{get LookupHandle hObjectLookup hObjectFileName}.
ON RETURN OF hObjectLookup OR LEAVE OF hObjectLookup OR TAB OF hObjectLookup PERSISTENT RUN leftLookup IN TARGET-PROCEDURE.
ON ANY-PRINTABLE OF hObjectLookup PERSISTENT RUN leaveObjectNameLookup IN TARGET-PROCEDURE.
RUN adjustTabOrder (hObjectFilename,coObjType:HANDLE,"BEFORE":U).
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE leaveObjectNameLookup vTableWin
PROCEDURE leaveObjectNameLookup :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DYNAMIC-FUNCTION("setDataModified":U IN hObjectFileName, TRUE).
IF glNew AND glStaticSDF THEN
RUN changesMade.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE leftLookup vTableWin
PROCEDURE leftLookup :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
/* To fix issue #8012 */
IF glValidationError THEN DO:
glValidationError = FALSE.
RETURN.
END.
{get LookupHandle hLookup hObjectFileName}.
IF glNew AND glStaticSDF AND hLookup:SCREEN-VALUE = "":U THEN
RETURN.
IF glNew AND (LASTKEY = KEYCODE("TAB") OR
LASTKEY = 609 /* Mouse Click */ OR
LASTKEY = 619 OR
LASTKEY = -1 OR
LASTKEY = 13) AND NOT glAppliedLeave THEN DO:
glAppliedLeave = TRUE.
RUN leavelookup IN hObjectFileName.
RETURN.
END.
IF NOT glNew AND hLookup:SCREEN-VALUE <> "":U THEN
RUN leavelookup IN hObjectFileName.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE lookupComplete vTableWin
PROCEDURE lookupComplete :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER pcColumnNames AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcColumnValues AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcKeyFieldValue AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcDisplayedFieldValue AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcOldFieldValue AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER plLookup AS LOGICAL NO-UNDO.
DEFINE INPUT PARAMETER phObject AS HANDLE NO-UNDO.
DEFINE VARIABLE cMessage AS CHARACTER NO-UNDO.
DEFINE VARIABLE cMessageList AS CHARACTER NO-UNDO.
DEFINE VARIABLE hLookupFillin AS HANDLE NO-UNDO.
DEFINE VARIABLE cProductModule AS CHARACTER NO-UNDO.
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPath AS CHARACTER NO-UNDO.
IF 1 = 2 THEN VIEW FRAME {&FRAME-NAME}. /* Lazy frame scoping */
/* Check if it was a valid object */
IF phObject = hObjectFileName THEN DO:
IF (pcKeyFieldValue = "":U OR pcColumnValues = "":U OR NUM-ENTRIES(pcColumnNames) <> NUM-ENTRIES(pcColumnValues, CHR(1))) AND NOT glNew THEN
DO:
glUsedExisting = FALSE.
cMessage = "Could find details for this Smart Data Field " + pcDisplayedFieldValue.
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) +
{af/sup2/aferrortxt.i 'AF' '11' '' '' '"SmartObject Record"' '"the name you specified"'}.
RUN showMessages IN gshSessionManager (INPUT cMessageList,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Error - Smart Data Field not found",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN.
END.
/* We are adding a new record */
IF pcDisplayedFieldValue <> "":U AND glNew THEN DO:
glUsedExisting = FALSE.
IF NOT glStaticSDF THEN DO:
{get LookupHandle hLookupFillin hObjectFileName}.
hLookupFillin:SCREEN-VALUE = pcDisplayedFieldValue.
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:EMPTY-TEMP-TABLE().
ghDataTable = ?.
END.
IF coObjType:SCREEN-VALUE = ? THEN
coObjType:SCREEN-VALUE = coObjType:ENTRY(1).
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0 THEN
ghDataTable = DYNAMIC-FUNCTION("getComboTable":U IN ghContainerSource).
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0 THEN
ghDataTable = DYNAMIC-FUNCTION("getLookupTable":U IN ghContainerSource).
ghDataTable = ghDataTable:DEFAULT-BUFFER-HANDLE.
ghDataTable:BUFFER-CREATE().
IF NOT glStaticSDF THEN DO:
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
END.
END.
END.
ELSE DO: /* Static SDFs */
/* The user specified a valid SDF */
IF pcKeyFieldValue <> "":U THEN DO:
/* Check if we should warn the user that we will be throwing away any
existing data in all the fields */
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:FIND-FIRST() NO-ERROR.
IF ghDataTable:AVAILABLE AND
(ghDataTable:BUFFER-FIELD("cBaseQueryString"):BUFFER-VALUE <> "":U OR
ghDataTable:BUFFER-FIELD("cDataSourceName"):BUFFER-VALUE <> "":U) THEN DO:
cMessage = "You have selected an existing SmartDataField to be used, but it seems that you " +
"have already specified some details for this SmartDataField.~n~nDo you wish to continue loading " +
"the data from the selected SmartDataField and clear any existing details for this SmartDataField?".
RUN askQuestion IN gshSessionManager (INPUT cMessage, /* messages */
INPUT "&Yes,&No":U, /* button list */
INPUT "&Yes":U, /* default */
INPUT "&No":U, /* cancel */
INPUT "Use Existing SmartDataField":U, /* title */
INPUT "":U, /* datatype */
INPUT "":U, /* format */
INPUT-OUTPUT cAnswer, /* answer */
OUTPUT cButton /* button pressed */
).
IF cButton <> "&YES":U THEN DO:
{get LookupHandle hLookupFillin hObjectFileName}.
IF VALID-HANDLE(ghDataTable) THEN
hLookupFillin:SCREEN-VALUE = ghDataTable:BUFFER-FIELD("cActualField":U):BUFFER-VALUE.
ELSE
hLookupFillin:SCREEN-VALUE = "":U.
RETURN.
END.
END.
END.
glUsedExisting = TRUE.
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:EMPTY-TEMP-TABLE().
ghDataTable = ?.
END.
SESSION:SET-WAIT-STATE("GENERAL":U).
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Retrieving data from Repository. Please Wait...").
RUN getObjectDetail IN ghContainerSource (INPUT pcDisplayedFieldValue,
OUTPUT ghDataTable).
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:FIND-FIRST().
IF ghDataTable:AVAILABLE THEN DO WITH FRAME {&FRAME-NAME}:
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
RUN assignNewValue IN hDataObject(INPUT ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE,
INPUT ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE,
INPUT FALSE).
END.
END.
END.
SESSION:SET-WAIT-STATE("":U).
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"":U).
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:FIND-FIRST() NO-ERROR.
IF ghDataTable:AVAILABLE AND
(ghDataTable:BUFFER-FIELD("cBaseQueryString"):BUFFER-VALUE <> "":U OR
ghDataTable:BUFFER-FIELD("cDataSourceName"):BUFFER-VALUE <> "":U) THEN DO:
/* Now that we have loaded the data - we need to disable the UI and
just leave the user to save this data to the SDV or cancel.
This is done since we do not want them to make changes to the
master record and save this record again - they can only change
the master using the SDF Maintenance window from the Build menu */
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "New,cbCopy,cbDelete,cbFind,cbUndo":U).
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "cbSave,cbCancel":U).
RUN disableField IN hObjectFileName.
RUN disableField IN hProductModule.
RUN disableField IN hCustomSuperProcedure.
ASSIGN toSave:CHECKED IN FRAME {&FRAME-NAME} = FALSE.
DISABLE fiObjectDescription toUseCache toSave buWhereUsed buSynchInstances WITH FRAME {&FRAME-NAME}.
PUBLISH "disableObject" FROM ghContainerSource.
glNeedToSave = TRUE.
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Click on the Save to save to your SDF or Cancel for a new SDF":U).
IF pcColumnValues <> "":U AND
pcColumnValues <> ? THEN DO:
cProductModule = ENTRY(LOOKUP("gsc_product_module.product_module_code",pcColumnNames),pcColumnValues,CHR(1)).
{set DataValue cProductModule hProductModule }.
END.
END.
END.
ELSE DO:
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:EMPTY-TEMP-TABLE().
ghDataTable = ?.
END.
IF coObjType:SCREEN-VALUE = ? THEN
coObjType:SCREEN-VALUE = coObjType:ENTRY(1).
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0 THEN
ghDataTable = DYNAMIC-FUNCTION("getComboTable":U IN ghContainerSource).
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0 THEN
ghDataTable = DYNAMIC-FUNCTION("getLookupTable":U IN ghContainerSource).
ghDataTable = ghDataTable:DEFAULT-BUFFER-HANDLE.
ghDataTable:BUFFER-CREATE().
IF NOT glStaticSDF THEN DO:
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
END.
END.
END.
END.
ELSE DO: /* If not, then just make sure that the name is displayed in the lookup field */
{get LookupHandle hLookupFillin hObjectFileName}.
hLookupFillin:SCREEN-VALUE = pcDisplayedFieldValue.
END.
END.
END.
ELSE DO:
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:EMPTY-TEMP-TABLE().
ghDataTable = ?.
END.
IF fiObjectDescription:SCREEN-VALUE = ? OR
fiObjectDescription:SCREEN-VALUE = "?":U THEN
ASSIGN fiObjectDescription:SCREEN-VALUE = "":U.
SESSION:SET-WAIT-STATE("GENERAL":U).
/* Determine what the object type is, rebuild and reposition the combo */
DEFINE VARIABLE cObjectTypeCode AS CHARACTER NO-UNDO.
ASSIGN coObjType:LIST-ITEMS = gcComboClasses + "," + gcLookupClasses
cObjectTypeCode = ENTRY(LOOKUP("gsc_object_type.object_type_code":U, pcColumnNames), pcColumnValues, CHR(1)) NO-ERROR.
IF LOOKUP(cObjectTypeCode, gcLookupClasses) <> 0 THEN
ASSIGN coObjType:LIST-ITEMS = gcLookupClasses.
ELSE
IF LOOKUP(cObjectTypeCode, gcComboClasses) <> 0 THEN
ASSIGN coObjType:LIST-ITEMS = gcComboClasses.
ASSIGN coObjType:SCREEN-VALUE = cObjectTypeCode NO-ERROR.
IF coObjType:SCREEN-VALUE = ? OR coObjType:SCREEN-VALUE = "" THEN
ASSIGN coObjType:SCREEN-VALUE = coObjType:ENTRY(1) NO-ERROR.
APPLY "VALUE-CHANGED":U TO coObjType IN FRAME {&FRAME-NAME}.
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Retrieving data from Repository. Please Wait...").
RUN getObjectDetail IN ghContainerSource (INPUT pcDisplayedFieldValue,
OUTPUT ghDataTable).
IF VALID-HANDLE(ghDataTable) THEN DO:
ghDataTable:FIND-FIRST().
IF ghDataTable:AVAILABLE THEN DO WITH FRAME {&FRAME-NAME}:
RUN assignSDFValues.
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
END.
END.
END.
SESSION:SET-WAIT-STATE("":U).
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"":U).
END.
DO WITH FRAME {&FRAME-NAME}:
IF NOT glNew THEN DO:
cProductModule = ENTRY(LOOKUP("gsc_product_module.product_module_code",pcColumnNames),pcColumnValues,CHR(1)).
{set DataValue cProductModule hProductModule }.
END.
END.
IF NOT glNew THEN
RUN setFields (INPUT "Modify":U).
END.
ELSE IF phObject = hDataObject THEN
DO:
IF pcDisplayedFieldValue <> pcOldFieldValue THEN
DO:
IF VALID-HANDLE(ghDynCombo) THEN
DO:
DYNAMIC-FUNCTION('setDataSourceName':U IN ghDynCombo, INPUT pcDisplayedFieldValue).
RUN populateComboFromSDO IN ghDynCombo.
END.
RUN changesMade.
END.
END.
ELSE IF phObject = hCustomSuperProcedure THEN
DO:
IF pcDisplayedFieldValue <> pcOldFieldValue THEN
RUN changesMade.
END.
ELSE DO:
IF pcDisplayedFieldValue <> pcOldFieldValue AND
pcDisplayedFieldValue <> "":U THEN
RUN changesMade.
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE removeSDF vTableWin
PROCEDURE removeSDF :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cSDFFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
RUN askQuestion IN gshSessionManager (INPUT "Do you wish to delete the current SmartDataField?", /* messages */
INPUT "&Yes,&No":U, /* button list */
INPUT "&No":U, /* default */
INPUT "&No":U, /* cancel */
INPUT "Delete SmartDataField":U, /* title */
INPUT "":U, /* datatype */
INPUT "":U, /* format */
INPUT-OUTPUT cAnswer, /* answer */
OUTPUT cButton /* button pressed */
).
IF cButton <> "&YES":U THEN
RETURN.
SESSION:SET-WAIT-STATE("GENERAL":U).
{get DataValue cSDFFileName hObjectFileName}.
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Removing SmartDataField from repository. Please Wait...").
RUN removeSDF IN ghContainerSource (INPUT cSDFFileName).
SESSION:SET-WAIT-STATE("":U).
IF ERROR-STATUS:ERROR OR
RETURN-VALUE <> "":U THEN DO:
RUN showMessages IN gshSessionManager (INPUT RETURN-VALUE,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Error Removing SmartDataField",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN.
END.
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"").
clearDetails(TRUE).
RUN setFields ("Find":U).
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE resetData vTableWin
PROCEDURE resetData :
/*------------------------------------------------------------------------------
Purpose: This procedure will cancel any changes made without saving and
reset the data back to the original state
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cSDFName AS CHARACTER NO-UNDO.
IF NOT VALID-HANDLE(ghDataTable) THEN DO:
cSDFName = DYNAMIC-FUNCTION("getDataValue":U IN hObjectFilename).
RUN getObjectDetail IN ghContainerSource (INPUT cSDFName,
OUTPUT ghDataTable).
END.
IF VALID-HANDLE(ghDataTable) THEN DO:
clearDetails(FALSE).
RUN assignSDFValues.
ghDataTable:FIND-FIRST().
IF ghDataTable:AVAILABLE THEN DO WITH FRAME {&FRAME-NAME}:
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) <> 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN
RUN setInfo IN ghDynLookup (INPUT ghDataTable).
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) <> 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN
RUN setInfo IN ghDynCombo (INPUT ghDataTable).
END.
END.
END.
RUN setFields (INPUT "Modify":U).
glNeedToSave = FALSE.
IF glStaticSDF THEN
RUN disableButton IN hObjectFileName.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE resizeObject vTableWin
PROCEDURE resizeObject :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER pdHeight AS DECIMAL NO-UNDO.
DEFINE INPUT PARAMETER pdWidth AS DECIMAL NO-UNDO.
IF pdWidth < FRAME {&FRAME-NAME}:WIDTH-CHARS THEN
DO:
RUN resizeViewerObjects (INPUT pdHeight, INPUT pdWidth).
FRAME {&FRAME-NAME}:WIDTH-CHARS = pdWidth.
END.
ELSE
DO:
FRAME {&FRAME-NAME}:WIDTH-CHARS = pdWidth.
RUN resizeViewerObjects (INPUT pdHeight, INPUT pdWidth).
END.
RETURN.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE resizeViewerObjects vTableWin
PROCEDURE resizeViewerObjects :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER pdHeight AS DECIMAL NO-UNDO.
DEFINE INPUT PARAMETER pdWidth AS DECIMAL NO-UNDO.
DEFINE VARIABLE dNewColumn AS DECIMAL NO-UNDO.
DEFINE VARIABLE dNewWidth AS DECIMAL NO-UNDO.
DEFINE VARIABLE lSuccess AS LOGICAL NO-UNDO.
DEFINE VARIABLE hLabelHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE hHandle AS HANDLE NO-UNDO.
IF DYNAMIC-FUNCTION("getObjectInitialized":U) = FALSE THEN
RETURN.
DO WITH FRAME {&FRAME-NAME}:
ASSIGN
hLabelHandle = DYNAMIC-FUNCTION("getLabelHandle":U IN hCustomSuperProcedure)
dNewWidth = pdWidth - (hLabelHandle:WIDTH-CHARS + 0.50) - fiObjectDescription:COLUMN
dNewWidth = dNewWidth / 2
dNewColumn = fiObjectDescription:COLUMN + hLabelHandle:WIDTH-CHARS + dNewWidth + .5
hHandle = fiFieldName:SIDE-LABEL-HANDLE
fiObjectDescription:WIDTH-CHARS = dNewWidth
coObjType:WIDTH-CHARS = dNewWidth
buWhereUsed:COLUMN = dNewColumn + 5
buSynchInstances:COLUMN = dNewColumn + 5
toSave:COLUMN = dNewColumn + 5
toUSeCache:COLUMN = dNewColumn + 5
fiFieldName:COLUMN = dNewColumn + 5
fiFieldName:WIDTH = dNewWidth - 4.80
hHandle:COLUMN = (dNewColumn + 5) - hHandle:WIDTH
buSynch:COLUMN = pdWidth - buSynch:WIDTH - 1
.
RUN resizeObject IN hCustomSuperProcedure (1.00, dNewWidth).
RUN resizeObject IN hObjectFilename (1.00, dNewWidth).
RUN resizeObject IN hResultCode (1.00, dNewWidth).
RUN repositionObject IN hProductModule (1.00, dNewColumn + 5).
RUN resizeObject IN hProductModule (1.05, dNewWidth - 4.80).
RUN resizeObject IN hDataObject (1.00, dNewWidth).
END.
RETURN.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE saveAs vTableWin
PROCEDURE saveAs :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cMessageList AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPrefValue AS CHARACTER NO-UNDO.
{get LookupHandle hLookup hObjectFileName}.
RUN askQuestion IN gshSessionManager (INPUT "Enter the new name to save this SmartDataField as", /* message to display */
INPUT "&Save,&Cancel":U, /* button list */
INPUT "&Save":U, /* default button */
INPUT "&Cancel":U, /* cancel button */
INPUT "Save SmartDataField As...":U, /* window title */
INPUT "CHARACTER":U, /* data type of question */
INPUT "X(30)":U, /* format mask for question */
INPUT-OUTPUT cAnswer, /* character value of answer to question */
OUTPUT cButton /* button pressed */
).
IF cButton = "&Cancel" THEN
RETURN.
IF cAnswer = "":U THEN DO:
cMessageList = {af/sup2/aferrortxt.i 'AF' '5' '' '' '"new SmartDataField name"'}.
RUN showMessages IN gshSessionManager (INPUT cMessageList,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "New SmartDataField name required",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RUN saveAs.
RETURN.
END.
cPrefValue = hLookup:SCREEN-VALUE.
hLookup:SCREEN-VALUE = cAnswer.
RUN checkIfSDFExists.
IF RETURN-VALUE = "OBJECT-EXISTS" THEN DO:
hLookup:SCREEN-VALUE = cPrefValue.
RUN saveAs.
RETURN.
END.
RUN changesMade.
ASSIGN glNew = TRUE
glStaticSDF = FALSE.
RUN enableField IN hProductModule.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE saveDetails vTableWin
PROCEDURE saveDetails :
/*------------------------------------------------------------------------------
Purpose: This procedure will save the details back to the temp-table and
ensure that data is saved back to the repository.
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hDataTable AS HANDLE NO-UNDO.
DEFINE VARIABLE hObjectLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cProductModule AS CHARACTER NO-UNDO.
DEFINE VARIABLE cError AS CHARACTER NO-UNDO.
DEFINE VARIABLE cRunAttribute AS CHARACTER NO-UNDO.
{get RunAttribute cRunAttribute ghContainerSource}.
SESSION:SET-WAIT-STATE("GENERAL":U).
IF 1 = 2 THEN VIEW FRAME {&FRAME-NAME}. /* Lazy frame scoping */
ASSIGN fiObjectDescription
fiFieldName
toUseCache.
{get LookupHandle hObjectLookup hObjectFileName}.
{get DataValue cProductModule hProductModule}.
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynLookup) THEN DO:
RUN assignValues IN ghDynLookup.
hDataTable = DYNAMIC-FUNCTION("getDataTable":U IN ghDynLookup).
END.
END.
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0
THEN DO:
IF VALID-HANDLE(ghDynCombo) THEN DO:
RUN assignValues IN ghDynCombo.
hDataTable = DYNAMIC-FUNCTION("getDataTable":U IN ghDynCombo).
END.
END.
IF VALID-HANDLE(hDataTable) THEN DO:
hDataTable:FIND-FIRST().
ASSIGN hDataTable:BUFFER-FIELD("cSDFFileName":U):BUFFER-VALUE = hObjectLookup:SCREEN-VALUE
hDataTable:BUFFER-FIELD("cObjectDescription":U):BUFFER-VALUE = fiObjectDescription
hDataTable:BUFFER-FIELD("cActualField":U):BUFFER-VALUE = fiFieldName
hDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE = DYNAMIC-FUNCTION("getDataValue":U IN hCustomSuperProcedure)
hDataTable:BUFFER-FIELD("lUseCache":U):BUFFER-VALUE = toUseCache.
END.
/* Save to the Repository */
IF (glStaticSDF AND toSave AND glNew) OR
NOT glStaticSDF OR
(glIsDynView AND glStaticSDF AND glUpdateMasterOnly) THEN DO:
RUN saveSDFInfo IN ghContainerSource (INPUT hDataTable,
INPUT coObjType:SCREEN-VALUE,
INPUT cProductModule).
SESSION:SET-WAIT-STATE("":U).
IF ERROR-STATUS:ERROR OR
RETURN-VALUE <> "":U THEN DO:
cError = RETURN-VALUE.
SESSION:SET-WAIT-STATE("":U).
RUN showMessages IN gshSessionManager (INPUT RETURN-VALUE,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Error Saving SDF to Repository",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN cError.
END.
END.
/* If updating the master object, set the instance values
by running the 'Set' functions for all attributes */
IF glUpdateMasterOnly THEN
RUN SetSDFMaster IN THIS-PROCEDURE (INPUT hDataTable).
/* Save to Static SDF */
IF glStaticSDF AND
VALID-HANDLE(ghSDFObject) THEN DO:
SESSION:SET-WAIT-STATE("GENERAL":U).
RUN saveSDFDetails IN ghSDFObject (INPUT hDataTable).
SESSION:SET-WAIT-STATE("":U).
IF ERROR-STATUS:ERROR OR
RETURN-VALUE <> "":U THEN DO:
cError = RETURN-VALUE.
SESSION:SET-WAIT-STATE("":U).
RUN showMessages IN gshSessionManager (INPUT RETURN-VALUE,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Error Saving SDF to Static Object",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN cError.
END.
/* This is to ensure that the buttons on the toolbar is not reset */
glNeedToSave = FALSE.
END.
IF VALID-HANDLE(hDataTable) THEN DO:
hDataTable = ?.
END.
glNeedToSave = FALSE.
IF NUM-ENTRIES(cRunAttribute,CHR(3)) >= 2 AND
ENTRY(2,cRunAttribute,CHR(3)) = "NEW":U THEN
DYNAMIC-FUNCTION("setRunAttribute":U IN ghContainerSource, REPLACE(cRunAttribute,"NEW":U,hObjectLookup:SCREEN-VALUE)).
SESSION:SET-WAIT-STATE("":U).
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE setFields vTableWin
PROCEDURE setFields :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER pcState AS CHARACTER NO-UNDO.
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cDataSourceName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cRunAttribute AS CHARACTER NO-UNDO.
IF NOT VALID-HANDLE(ghToolbar) THEN
RETURN.
ASSIGN glNew = FALSE.
RUN enableButton IN hObjectFilename.
{get LookupHandle hLookup hObjectFileName}.
{get RunAttribute cRunAttribute ghContainerSource}.
IF glStaticSDF AND NOT glIsDynView THEN
ASSIGN toSave:SENSITIVE IN FRAME {&FRAME-NAME} = TRUE
toSave:HIDDEN IN FRAME {&FRAME-NAME} = FALSE.
ELSE
ASSIGN toSave:SENSITIVE IN FRAME {&FRAME-NAME} = FALSE
toSave:HIDDEN IN FRAME {&FRAME-NAME} = TRUE.
ASSIGN toUSeCache:SENSITIVE IN FRAME {&FRAME-NAME} = TRUE.
IF glStaticSDF AND toSave:CHECKED AND hLookup:SENSITIVE THEN
glNew = TRUE.
IF NUM-ENTRIES(cRunAttribute,CHR(3)) >= 2 AND
ENTRY(2,cRunAttribute,CHR(3)) = "NEW":U THEN
glNew = TRUE.
CASE pcState:
WHEN "Init" THEN DO:
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbModify,cbCancel,cbCopy,cbDelete,cbSave,cbSaveAs,cbFind,cbUndo":U).
END.
WHEN "New":U THEN DO:
ASSIGN buSynch:HIDDEN = TRUE
buSynch:SENSITIVE = FALSE.
ASSIGN glAppliedLeave = FALSE.
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "New,cbCopy,cbDelete,cbSaveAs,cbFind,cbUndo":U).
RUN enableField IN hObjectFilename.
IF NOT glStaticSDF THEN DO:
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "cbSave,cbCancel":U).
RUN enableField IN hProductModule.
RUN disableButton IN hObjectFilename.
END.
RUN enableField IN hCustomSuperProcedure.
DISABLE buWhereUsed buSynchInstances WITH FRAME {&FRAME-NAME}.
ASSIGN coObjType:LIST-ITEMS = gcLookupClasses + "," + gcComboClasses
coObjType:SCREEN-VALUE = coObjType:ENTRY(1) NO-ERROR.
APPLY "value-changed":U TO coObjType.
ENABLE coObjType fiObjectDescription toUseCache
WITH FRAME {&FRAME-NAME}.
PUBLISH "disableObject" FROM ghContainerSource.
glNew = TRUE.
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Create new Smart Data Field.").
END.
WHEN "Find":U THEN DO:
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbCancel,cbCopy,cbDelete,cbSave,cbSaveAs,cbFind,cbUndo":U).
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New":U).
ASSIGN buSynch:HIDDEN = TRUE
buSynch:SENSITIVE = FALSE.
DISABLE buWhereUsed buSynchInstances fiFieldName raSource WITH FRAME {&FRAME-NAME}.
RUN disableField IN hProductModule.
RUN disableField IN hCustomSuperProcedure.
ASSIGN raSource:SCREEN-VALUE = "DB":U.
RUN assignNewValue IN hDataObject (INPUT "":U, INPUT "":U, INPUT FALSE).
RUN disableField IN hDataObject.
RUN enableField IN hObjectFilename.
DISABLE buWhereUsed buSynchInstances coObjType fiObjectDescription toUseCache WITH FRAME {&FRAME-NAME}.
PUBLISH "disableObject" FROM ghContainerSource.
DYNAMIC-FUNCTION("statusText":U IN ghContainerSource,"Find an existing Smart Data Field.").
END.
WHEN "Modify":U THEN DO:
IF NOT glStaticSDF THEN DO:
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbCancel,cbSave,cbUndo":U).
IF NOT glUpdateMasterOnly THEN
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete,cbSaveAs":U).
ELSE
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete":U).
RUN disableField IN hObjectFilename.
RUN disableField IN hProductModule.
RUN enableField IN hCustomSuperProcedure.
ENABLE fiObjectDescription buWhereUsed buSynchInstances WITH FRAME {&FRAME-NAME}.
END.
ELSE
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbSave,cbUndo":U).
IF glUpdateMasterOnly THEN
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete":U).
ENABLE toUSeCache WITH FRAME {&FRAME-NAME}.
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0 THEN
DO:
ENABLE raSource WITH FRAME {&FRAME-NAME}.
ghDataTable = DYNAMIC-FUNCTION("getComboTable":U IN ghContainerSource).
ghDataTable = ghDataTable:DEFAULT-BUFFER-HANDLE.
ghDataTable:FIND-FIRST().
IF ghDataTable:AVAILABLE THEN
DO:
cDataSourceName = ghDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE.
IF cDataSourceName NE "":U THEN
DO:
setDataObjectName(INPUT cDataSourceName).
RUN enableField IN hDataObject.
END.
END.
END.
END.
WHEN "Cancel":U THEN DO:
IF glUsedExisting THEN DO:
clearDetails(TRUE).
RUN setFields ("New":U).
RUN checkForStaticSDF.
glUsedExisting = FALSE.
RETURN.
END.
IF glIsDynView THEN DO:
RUN disableButton IN hObjectFilename.
RETURN.
END.
RUN disableField IN hProductModule.
DISABLE buWhereUsed buSynchInstances coObjType fiObjectDescription toUseCache
WITH FRAME {&FRAME-NAME}.
ASSIGN raSource:SCREEN-VALUE = "DB":U.
RUN assignNewValue IN hDataObject (INPUT "":U, INPUT "":U, INPUT FALSE).
IF NOT glStaticSDF THEN DO:
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbCancel,cbSave":U).
IF NOT glUpdateMasterOnly THEN
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete,cbSaveAs":U).
ELSE
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete":U).
RUN enableField IN hObjectFilename.
RUN disableField IN hCustomSuperProcedure.
clearDetails(TRUE).
RUN setFields ("FIND":U).
glNeedToSave = FALSE.
END.
ELSE DO:
RUN disableField IN hObjectFilename.
RUN disableButton IN hObjectFilename.
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbCancel":U).
hLookup:SCREEN-VALUE = "":U.
ASSIGN toSave:CHECKED IN FRAME {&FRAME-NAME} = FALSE
fiObjectDescription:SCREEN-VALUE IN FRAME {&FRAME-NAME} = "":U.
APPLY "VALUE-CHANGED":U TO toSave IN FRAME {&FRAME-NAME}.
ENABLE toSave WITH FRAME {&FRAME-NAME}.
IF NOT glNeedToSave THEN
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbSave":U).
END.
END.
WHEN "Save":U THEN DO:
glNeedToSave = FALSE.
IF NOT glStaticSDF THEN DO:
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbCancel,cbSave,cbUndo":U).
IF NOT glUpdateMasterOnly THEN
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete,cbSaveAs":U).
ELSE
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete":U).
RUN disableField IN hObjectFilename.
RUN disableField IN hProductModule.
RUN enableField IN hCustomSuperProcedure.
ENABLE fiObjectDescription toUseCache buWhereUsed buSynchInstances WITH FRAME {&FRAME-NAME}.
END.
ELSE DO:
RUN disableButton IN hObjectFileName.
IF glIsDynView OR glStaticSDF THEN
RUN disableField IN hObjectFileName.
IF NOT glUsedExisting THEN
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbSave,cbUndo,cbCancel":U).
IF glUsedExisting THEN DO:
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "cbSave":U).
DISABLE toSave WITH FRAME {&FRAME-NAME}.
END.
END.
IF glUpdateMasterOnly THEN
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete":U).
END.
WHEN "Change":U THEN DO:
glNeedToSave = TRUE.
IF NOT glStaticSDF AND glNew THEN
RUN disableButton IN hObjectFileName.
DYNAMIC-FUNCTION("disableActions":U IN ghToolbar, "New,cbCopy,cbFind,cbDelete":U).
DYNAMIC-FUNCTION("enableActions":U IN ghToolbar, "cbSave,cbUndo":U).
END.
END CASE.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE setSDFMaster vTableWin
PROCEDURE setSDFMaster :
/*------------------------------------------------------------------------------
Purpose: Upon saving a master object, all of the instance properties are
set to equal the master properties. Otherwise, if a dynamic viewer
is opened and then the master SDF is changed, the code will
incorrectly write out the previous value of the master object.
Parameters: phDataTable Table containing property values
Notes:
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER phDataTable AS HANDLE NO-UNDO.
DEFINE VARIABLE hFrame AS HANDLE NO-UNDO.
DEFINE VARIABLE cFieldLabel AS CHARACTER NO-UNDO.
DEFINE VARIABLE dSuperProcObjectObj AS DECIMAL NO-UNDO.
DEFINE VARIABLE hSMO AS HANDLE NO-UNDO.
IF NOT VALID-HANDLE(phDataTable) THEN
RETURN "Invalid handle to Data Table".
ASSIGN hSMO = getSDFProc().
IF NOT VALID-HANDLE(hSMO) THEN RETURN.
phDataTable:FIND-FIRST().
/* Add pathed name for super proc */
IF phDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE <> "":U THEN
DO:
ASSIGN dSuperProcObjectObj = DYNAMIC-FUNCTION("getSmartObjectObj":U IN gshRepositoryManager,
INPUT phDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE, INPUT 0).
IF dSuperProcObjectObj EQ 0 THEN
phDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE = "":U.
ELSE
/* Store the relatively pathed object name */
ASSIGN phDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE = DYNAMIC-FUNCTION("getObjectPathedName":U IN gshRepositoryManager,
INPUT dSuperProcObjectObj).
END.
/* Common properties fro dyncombos and dynlookups */
DYNAMIC-FUNCTION('setDisplayedField':U IN hSMO, phDataTable:BUFFER-FIELD("cDisplayedField":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setKeyField':U IN hSMO, phDataTable:BUFFER-FIELD("cKeyField":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setFieldLabel':U IN hSMO, phDataTable:BUFFER-FIELD("cFieldLabel":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setFieldTooltip':U IN hSMO, phDataTable:BUFFER-FIELD("cFieldTooltip":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setSDFFileName':U IN hSMO, phDataTable:BUFFER-FIELD("cSDFFileName":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setSDFTemplate':U IN hSMO, phDataTable:BUFFER-FIELD("cSDFTemplate":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setParentField':U IN hSMO, phDataTable:BUFFER-FIELD("cParentField":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setParentFilterQuery':U IN hSMO, phDataTable:BUFFER-FIELD("cParentFilterQuery":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setSuperProcedure':U IN hSMO, phDataTable:BUFFER-FIELD("cCustomSuperProc":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setPhysicalTableNames':U IN hSMO, phDataTable:BUFFER-FIELD("cPhysicalTableNames":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setTempTables':U IN hSMO, phDataTable:BUFFER-FIELD("cTempTables":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryBuilderJoinCode':U IN hSMO, phDataTable:BUFFER-FIELD('cQueryBuilderJoinCode':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryBuilderOptionList':U IN hSMO, phDataTable:BUFFER-FIELD('cQueryBuilderOptionList':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryBuilderTableOptionList':U IN hSMO, phDataTable:BUFFER-FIELD('cQueryBuilderTableOptionList':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryBuilderOrderList':U IN hSMO, phDataTable:BUFFER-FIELD('cQueryBuilderOrderList':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryBuilderTuneOptions':U IN hSMO, phDataTable:BUFFER-FIELD('cQueryBuilderTuneOptions':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryBuilderWhereClauses':U IN hSMO, phDataTable:BUFFER-FIELD('cQueryBuilderWhereClauses':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setEnableField':U IN hSMO, phDataTable:BUFFER-FIELD('lEnableField':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setDisplayField':U IN hSMO, phDataTable:BUFFER-FIELD('lDisplayField':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setUseCache':U IN hSMO, phDataTable:BUFFER-FIELD('lUseCache':U):BUFFER-VALUE).
IF phDataTable:BUFFER-FIELD('lLocalField':U):BUFFER-VALUE THEN
DYNAMIC-FUNCTION('setFieldName':U IN hSMO, phDataTable:BUFFER-FIELD('cActualField':U):BUFFER-VALUE).
IF phDataTable:BUFFER-FIELD("cDataSourceName":U):BUFFER-VALUE = "":U THEN
DO:
DYNAMIC-FUNCTION('setKeyFormat':U IN hSMO, phDataTable:BUFFER-FIELD("cKeyFormat":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setKeyDataType':U IN hSMO, phDataTable:BUFFER-FIELD("cKeyDataType":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setDisplayFormat':U IN hSMO, phDataTable:BUFFER-FIELD("cDisplayFormat":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setDisplayDataType':U IN hSMO, phDataTable:BUFFER-FIELD("cDisplayDataType":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setBaseQueryString':U IN hSMO, phDataTable:BUFFER-FIELD("cBaseQueryString":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setQueryTables':U IN hSMO, phDataTable:BUFFER-FIELD("cQueryTables":U):BUFFER-VALUE).
END.
IF LOOKUP(coObjType:SCREEN-VALUE IN FRAME {&FRAME-NAME}, gcLookupClasses) > 0 THEN
DO:
/* Lookup only */
DYNAMIC-FUNCTION('setBrowseFields':U IN hSMO, phDataTable:BUFFER-FIELD("cBrowseFields":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setBrowseFieldDataTypes':U IN hSMO, phDataTable:BUFFER-FIELD("cBrowseFieldDataTypes":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setBrowseFieldFormats':U IN hSMO, phDataTable:BUFFER-FIELD("cBrowseFieldFormats":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setViewerLinkedFields':U IN hSMO, phDataTable:BUFFER-FIELD("cViewerLinkedFields":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setViewerLinkedWidgets':U IN hSMO, phDataTable:BUFFER-FIELD("cViewerLinkedWidgets":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setLinkedFieldDataTypes':U IN hSMO, phDataTable:BUFFER-FIELD("cLinkedFieldDataTypes":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setLinkedFieldFormats':U IN hSMO, phDataTable:BUFFER-FIELD("cLinkedFieldFormats":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setColumnLabels':U IN hSMO, phDataTable:BUFFER-FIELD("cColumnLabels":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setColumnFormat':U IN hSMO, phDataTable:BUFFER-FIELD("cColumnFormat":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setBrowseTitle':U IN hSMO, phDataTable:BUFFER-FIELD('cBrowseTitle':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setRowsToBatch':U IN hSMO, phDataTable:BUFFER-FIELD('iRowsToBatch':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setMaintenanceObject':U IN hSMO, phDataTable:BUFFER-FIELD('cMaintenanceObject':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setMaintenanceSDO':U IN hSMO, phDataTable:BUFFER-FIELD('cMaintenanceSDO':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setLookupImage':U IN hSMO, phDataTable:BUFFER-FIELD('cLookupImage':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setPopupOnAmbiguous':U IN hSMO, phDataTable:BUFFER-FIELD('lPopupOnAmbiguous':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setPopupOnUniqueAmbiguous':U IN hSMO, phDataTable:BUFFER-FIELD('lPopupOnUniqueAmbiguous':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setPopupOnNotAvail':U IN hSMO, phDataTable:BUFFER-FIELD('lPopupOnNotAvail':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setBlankOnNotAvail':U IN hSMO, phDataTable:BUFFER-FIELD('lBlankOnNotAvail':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setMappedFields':U IN hSMO, phDataTable:BUFFER-FIELD('cMappedFields':U):BUFFER-VALUE).
END.
ELSE IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0 THEN
DO:
/*COMBO ONLY */
DYNAMIC-FUNCTION('setComboFlag':U IN hSMO, phDataTable:BUFFER-FIELD("cComboFlag":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setDescSubstitute':U IN hSMO, phDataTable:BUFFER-FIELD("cDescSubstitute":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setFlagValue':U IN hSMO, phDataTable:BUFFER-FIELD("cFlagValue":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setBuildSequence':U IN hSMO, phDataTable:BUFFER-FIELD("iBuildSequence":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setInnerLines':U IN hSMO, phDataTable:BUFFER-FIELD("iInnerLines":U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setSort':U IN hSMO, phDataTable:BUFFER-FIELD('lSort':U):BUFFER-VALUE).
DYNAMIC-FUNCTION('setDataSourceName':U IN hSMO, phDataTable:BUFFER-FIELD('cDataSourceName':U):BUFFER-VALUE).
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE synchInstances vTableWin
PROCEDURE synchInstances :
/*------------------------------------------------------------------------------
Purpose: Synchronizes instances of this master object by removing
instance attribute overrides for data-related attribute
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cAnswer AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cQuestion AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSDFName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cWhereUsed AS CHARACTER NO-UNDO.
cQuestion = 'Synchronizing instances with this master SmartDataField ':U +
'will remove data-related attribute overrides for every instance of this object. ':U +
'Examples of data-related attributes are: base query string, displayed field, key field, ':U +
'description substitute and display format.':U + CHR(13) + CHR(13) +
'Do you wish to continue?':U.
RUN askQuestion IN gshSessionManager ( INPUT cQuestion,
INPUT "&Yes,&No":U, /* button list */
INPUT "&No":U, /* default */
INPUT "&No":U, /* cancel */
INPUT "Continue synchronization":U, /* title */
INPUT "":U, /* datatype */
INPUT "":U, /* format */
INPUT-OUTPUT cAnswer, /* answer */
OUTPUT cButton /* button pressed */ ).
IF cButton = "&Yes":U OR cButton = "Yes":U THEN
DO:
{get DataValue cSDFName hObjectFileName}.
{launch.i &PLIP = 'ry/app/rysdfsynchp.p'
&IPROC = 'synchInstances'
&ONAPP = 'YES'
&PLIST = "(INPUT cSDFName)"
&AUTOKILL = YES}
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE validateData vTableWin
PROCEDURE validateData :
/*------------------------------------------------------------------------------
Purpose: This procedure will validate the data on the screen to ensure
that the data enetered is valid.
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cObjectFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cProductModule AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
DEFINE VARIABLE cMessage AS CHARACTER NO-UNDO.
DEFINE VARIABLE cMessageList AS CHARACTER NO-UNDO.
DEFINE VARIABLE hFileNameLookup AS HANDLE NO-UNDO.
DEFINE VARIABLE cRunAttribute AS CHARACTER NO-UNDO.
DEFINE VARIABLE hRepDesignManager AS HANDLE NO-UNDO.
DEFINE VARIABLE cSuperProc AS CHARACTER NO-UNDO.
DEFINE VARIABLE hDesignManager AS HANDLE NO-UNDO.
SESSION:SET-WAIT-STATE("GENERAL":U).
DO WITH FRAME {&FRAME-NAME}:
IF fiObjectDescription:SCREEN-VALUE = "?":U OR
fiObjectDescription:SCREEN-VALUE = ? THEN
fiObjectDescription:SCREEN-VALUE = "":U.
ASSIGN fiObjectDescription
coObjType
toSave.
{get DataValue cSuperProc hCustomSuperProcedure}.
END.
{get RunAttribute cRunAttribute ghContainerSource}.
IF NUM-ENTRIES(cRunAttribute,CHR(3)) >= 2 AND
ENTRY(2,cRunAttribute,CHR(3)) = "NEW":U THEN
glNew = TRUE.
IF NOT glStaticSDF OR
(glStaticSDF AND toSave AND glNew) OR
glIsDynView THEN DO:
{get LookupHandle hFileNameLookup hObjectFileName}.
{get DataValue cProductModule hProductModule}.
cObjectFileName = hFileNameLookup:SCREEN-VALUE.
IF cObjectFileName = "":U THEN
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) +
{af/sup2/aferrortxt.i 'AF' '1' '' '' '"Object Filename"'}.
/* Check whether object name already exists */
ASSIGN hRepDesignManager = DYNAMIC-FUNCTION("getManagerHandle":U, INPUT "RepositoryDesignManager":U).
IF DYNAMIC-FUNCTION("ObjectExists":U IN hRepDesignManager, INPUT cObjectFileName )
AND glNew AND NOT glUsedExisting THEN DO:
glValidationError = TRUE.
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) +
{af/sup2/aferrortxt.i 'AF' '31' '' '' '"SmartDataField"' '"this name"'}.
IF cMessageList <> "":U THEN DO:
RUN showMessages IN gshSessionManager (INPUT cMessageList,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Validation Error",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN ERROR "VALIDATION-FAILED":U.
END.
END.
IF cProductModule = "":U THEN
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) +
{af/sup2/aferrortxt.i 'AF' '1' '' '' '"Product Module"'}.
END.
/* Check for valid super procedure */
ASSIGN hRepDesignManager = DYNAMIC-FUNCTION("getManagerHandle":U, INPUT "RepositoryDesignManager":U).
IF cSuperProc <> "":U AND
DYNAMIC-FUNCTION("ObjectExists":U IN hRepDesignManager,INPUT cSuperProc) = FALSE THEN DO:
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) +
{af/sup2/aferrortxt.i 'AF' '5' '' '' '"super procedure"'}.
IF cMessageList <> "":U THEN DO:
RUN showMessages IN gshSessionManager (INPUT cMessageList,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Validation Error",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN ERROR "VALIDATION-FAILED":U.
END.
END.
IF LOOKUP(coObjType:SCREEN-VALUE, gcLookupClasses) > 0 THEN
RUN validateData IN ghDynLookup (OUTPUT cMessage).
ELSE
IF LOOKUP(coObjType:SCREEN-VALUE, gcComboClasses) > 0 THEN
RUN validateData IN ghDynCombo (OUTPUT cMessage).
cMessageList = cMessageList + (IF NUM-ENTRIES(cMessageList,CHR(3)) > 0 THEN CHR(3) ELSE '':U) + cMessage.
SESSION:SET-WAIT-STATE("":U).
IF cMessageList <> "":U THEN DO:
RUN showMessages IN gshSessionManager (INPUT cMessageList,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Validation Error",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN ERROR "VALIDATION-FAILED":U.
END.
/* Check if the name specified to save to exists in the Repository */
IF glNew AND NOT glStaticSDF AND cObjectFileName <> "":U THEN DO:
RUN getObjectNames IN gshRepositoryManager ( INPUT cObjectFileName,
INPUT "",
OUTPUT cObjectFileName,
OUTPUT cObjectFileName).
IF cObjectFileName <> "":U THEN DO:
cMessage = "Object Name '" + cObjectFileName + "'".
cMessageList = {af/sup2/aferrortxt.i 'AF' '31' '' '' '"SmartDataField"' "cMessage"}.
RUN showMessages IN gshSessionManager (INPUT cMessageList,
INPUT "ERR":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Validation Error",
INPUT YES,
INPUT ?,
OUTPUT cButton).
RETURN ERROR "VALIDATION-FAILED":U.
END.
ELSE RETURN.
END.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE valueChanged vTableWin
PROCEDURE valueChanged :
/*------------------------------------------------------------------------------
Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
/* Code placed here will execute PRIOR to standard behavior. */
RUN SUPER.
/* Code placed here will execute AFTER standard behavior. */
/* We only want to trigger the change event when we change
the super procedure lookup's value */
{get LookupHandle hLookup hCustomSuperProcedure}.
IF VALID-HANDLE(FOCUS) AND
FOCUS = hLookup THEN
RUN changesMade.
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE whereUsed vTableWin
PROCEDURE whereUsed :
/*------------------------------------------------------------------------------
Purpose: This procedure will run a proc on the AppServer to determine if
the current SDF is used anywhere.
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE cSDFName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cWhereUsed AS CHARACTER NO-UNDO.
DEFINE VARIABLE cButton AS CHARACTER NO-UNDO.
{get DataValue cSDFName hObjectFileName}.
{launch.i &PLIP = 'ry/app/rysdfusedp.p'
&IPROC = 'whereSDFUsed'
&ONAPP = 'YES'
&PLIST = "(INPUT cSDFName, OUTPUT cWhereUsed)"
&AUTOKILL = YES}
IF cWhereUsed <> "":U THEN
RUN showMessages IN gshSessionManager (INPUT cWhereUsed,
INPUT "MES":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Where Used",
INPUT YES,
INPUT ?,
OUTPUT cButton).
ELSE
RUN showMessages IN gshSessionManager (INPUT "This SmartDataField is currently not used anywhere in the application.",
INPUT "INF":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "OK":U,
INPUT "Where Used",
INPUT YES,
INPUT ?,
OUTPUT cButton).
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
/* ************************ Function Implementations ***************** */
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION clearDetails vTableWin
FUNCTION clearDetails RETURNS LOGICAL
( plClearAll AS LOGICAL ) :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
IF VALID-HANDLE(ghContainerSource) THEN
PUBLISH "clearAll":U FROM ghContainerSource.
IF plClearAll THEN DO:
/* Clear old data out of frame */
DO WITH FRAME {&FRAME-NAME}:
ASSIGN fiObjectDescription:SCREEN-VALUE = "":U
fiFieldName:SCREEN-VALUE = "":U
toUseCache:CHECKED = TRUE.
END.
RUN assignNewValue IN hObjectFilename (INPUT "":U, INPUT "":U, INPUT FALSE).
RUN assignNewValue IN hCustomSuperProcedure (INPUT "":U, INPUT "":U, INPUT FALSE).
END.
RETURN TRUE. /* Function return value. */
END FUNCTION.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getDataViewSource vTableWin
FUNCTION getDataViewSource RETURNS HANDLE
( /* parameter-definitions */ ) :
/*------------------------------------------------------------------------------
Purpose: get the Viewer's DataView object
Notes: DataSourcename Lookup and combo viewer needs this (early)
(There is a mechanism in checkForstaticSDF that actively publishes
the datasource, but that is too late for this)
- This ONLY returns a handle if it is actuially DataView source.
------------------------------------------------------------------------------*/
DEFINE VARIABLE hDataSourceHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE lDBAware AS LOGICAL NO-UNDO.
IF VALID-HANDLE(ghSDFObject) THEN
RUN returnDataSourceHandle IN ghSDFObject (OUTPUT hDataSourceHandle) NO-ERROR.
IF VALID-HANDLE(hDataSourceHandle) THEN
DO:
/* if the DataSource is not DBAware then it is a DataView */
{get DBAware lDBAware hDataSourceHandle}.
IF NOT lDBAware THEN
RETURN hDataSourceHandle.
END.
RETURN ?.
END FUNCTION.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getSDFProc vTableWin
FUNCTION getSDFProc RETURNS HANDLE
( /* parameter-definitions */ ) :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
DEFINE VARIABLE hSource AS HANDLE NO-UNDO.
DEFINE VARIABLE hProc AS HANDLE NO-UNDO.
{get ContainerSource hSource}.
hProc = DYNAMIC-FUNCTION("getSDFProcHandle" IN hSource).
RETURN hProc. /* Function return value. */
END FUNCTION.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION setDataObjectName vTableWin
FUNCTION setDataObjectName RETURNS LOGICAL
( INPUT pcName AS CHARACTER ) :
/*------------------------------------------------------------------------------
Purpose: Sets data object name lookup screen value and sets radio set
SCREEN-VALUE
Notes: assignNewValue is not used because that invoked lookupComplete which
is not always desired
------------------------------------------------------------------------------*/
DEFINE VARIABLE hLookup AS HANDLE NO-UNDO.
{get LookupHandle hLookup hDataObject}.
ASSIGN hLookup:SCREEN-VALUE = pcName.
raSource:SCREEN-VALUE IN FRAME {&FRAME-NAME} = IF pcName = "":U THEN "DB":U
ELSE "SDO":U.
IF pcName = "":U THEN
do:
RUN disableField IN hDataObject.
run clearField in hDataObject.
end. /* not SDO-based */
RETURN TRUE. /* Function return value. */
END FUNCTION.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION setToolbarHandle vTableWin
FUNCTION setToolbarHandle RETURNS LOGICAL
( INPUT phToolbarHandle AS HANDLE ) :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/
ASSIGN ghToolbar = phToolbarHandle.
RETURN TRUE. /* Function return value. */
END FUNCTION.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
| 44.650992 | 1,388 | 0.603958 |
94f2230cf251bc3c6bad99ec914e6dc1bd8c46b9 | 2,061 | c | C | src/worlds/quests/save_quest.c | Mikatech/my_rpg | 89d4d8ee362aeb247ad328cada032b01cb83f782 | [
"MIT"
] | 7 | 2021-07-05T20:19:50.000Z | 2021-10-15T12:29:49.000Z | src/worlds/quests/save_quest.c | Davphla/my_rpg | 89d4d8ee362aeb247ad328cada032b01cb83f782 | [
"MIT"
] | null | null | null | src/worlds/quests/save_quest.c | Davphla/my_rpg | 89d4d8ee362aeb247ad328cada032b01cb83f782 | [
"MIT"
] | 1 | 2021-07-05T20:46:04.000Z | 2021-07-05T20:46:04.000Z | /*
** EPITECH PROJECT, 2021
** B-MUL-200-LYN-2-1-myrpg-david.gozlan
** File description:
** save_quest
*/
#include "rpg.h"
#include "../world.h"
static void fill_content(pars_data_t *obj, char *data_name, int value)
{
obj->data_name = my_strdup(data_name);
obj->type = kint;
obj->values.kint = value;
obj->next = NULL;
}
static void fill_array(pars_data_t *data, quest_t *quest)
{
quest_step_t *step = quest->step[quest->current_step];
pars_data_t *cur;
for (int i = 0; step->objective[i]; i += 1) {
data->values.kint = step->objective[i]->cur_nb;
data->data_name = NULL;
data->type = kint;
data->next = malloc(sizeof(pars_data_t));
cur = data;
data = data->next;
}
free(data);
cur->next = NULL;
}
static void save_content(quest_t *quest, pars_data_t *obj)
{
fill_content(obj, "id", quest->quest_id);
obj->next = malloc(sizeof(pars_data_t));
obj = obj->next;
fill_content(obj, "step", quest->current_step);
obj->next = malloc(sizeof(pars_data_t));
obj = obj->next;
obj->data_name = my_strdup("objective");
obj->values.kobj = malloc(sizeof(pars_data_t));
obj->type = kobj;
fill_array(obj->values.kobj, quest);
obj->next = NULL;
}
static pars_data_t *null_quest(pars_data_t *data)
{
data->data_name = my_strdup("NO_QUEST");
data->next = NULL;
data->type = kint;
data->values.kint = 0;
return (data);
}
pars_data_t *save_quests_progress(quest_t *quest)
{
pars_data_t *data = malloc(sizeof(pars_data_t));
pars_data_t *first = data;
if (quest == NULL) {
return (null_quest(data));
}
for (; quest; quest = quest->next) {
data->type = kobj;
data->data_name = NULL;
data->values.kobj = malloc(sizeof(pars_data_t));
save_content(quest, data->values.kobj);
if (!quest->next)
data->next = NULL;
else {
data->next = malloc(sizeof(pars_data_t));
data = data->next;
}
}
return (first);
} | 25.444444 | 70 | 0.60359 |
9e0aac4d5fd4457ff7c2b52ee70c74352016bdb1 | 912 | c | C | dataset/Lab-4/2828/271443_correct.c | jyi/ITSP | 0553f683f99403efb5ef440af826c1d229a52376 | [
"MIT"
] | 18 | 2017-06-14T07:55:45.000Z | 2022-03-24T09:32:43.000Z | dataset/Lab-4/2828/271443_correct.c | jyi/ITSP | 0553f683f99403efb5ef440af826c1d229a52376 | [
"MIT"
] | 2 | 2017-07-25T13:44:39.000Z | 2018-03-16T06:43:40.000Z | dataset/Lab-4/2828/271443_correct.c | jyi/ITSP | 0553f683f99403efb5ef440af826c1d229a52376 | [
"MIT"
] | 5 | 2017-07-29T19:09:37.000Z | 2021-04-10T16:39:48.000Z | /*numPass=7, numTotal=7
Verdict:ACCEPTED, Visibility:1, Input:"H", ExpOutput:"Capital Letter", Output:"Capital Letter"
Verdict:ACCEPTED, Visibility:1, Input:"6", ExpOutput:"Digit", Output:"Digit"
Verdict:ACCEPTED, Visibility:1, Input:"l", ExpOutput:"Small Letter", Output:"Small Letter"
Verdict:ACCEPTED, Visibility:1, Input:"3", ExpOutput:"Digit", Output:"Digit"
Verdict:ACCEPTED, Visibility:0, Input:"A", ExpOutput:"Capital Letter", Output:"Capital Letter"
Verdict:ACCEPTED, Visibility:0, Input:"9", ExpOutput:"Digit", Output:"Digit"
Verdict:ACCEPTED, Visibility:0, Input:"z", ExpOutput:"Small Letter", Output:"Small Letter"
*/
#include<stdio.h>
int main()
{
char x;
scanf("%c",&x);
if ((x>='A')&&(x<='Z'))
printf("Capital Letter");
else
if((x>='a')&&(x<='z'))
printf("Small Letter");
else
if((x>=48)&&(x<=57))
printf("Digit");
return 0;
} | 36.48 | 94 | 0.642544 |
b10eca24265922bce3ecca721f32c29d7596ae2a | 315 | c | C | tests/slicing/sources/dynalloc5.c | mchalupa/libdg | a0808569e12af1d82f61ecc5d8cdd3a4b58e8ee0 | [
"MIT"
] | 316 | 2016-02-19T19:08:02.000Z | 2022-03-29T02:05:59.000Z | tests/slicing/sources/dynalloc5.c | mchalupa/libdg | a0808569e12af1d82f61ecc5d8cdd3a4b58e8ee0 | [
"MIT"
] | 366 | 2015-04-17T15:34:44.000Z | 2022-03-31T16:38:13.000Z | tests/slicing/sources/dynalloc5.c | mchalupa/libdg | a0808569e12af1d82f61ecc5d8cdd3a4b58e8ee0 | [
"MIT"
] | 116 | 2016-02-03T15:42:12.000Z | 2022-03-02T19:58:58.000Z | #include <stdlib.h>
struct item {
int a;
};
/* use function pointer */
void *(*memalloc)(unsigned long size) = malloc;
struct item *alloc() {
struct item *i = memalloc(sizeof *i);
i->a = 13;
return i;
}
int main(void) {
struct item *i = alloc();
test_assert(i->a == 13);
return 0;
}
| 15 | 47 | 0.574603 |
367823d3442154ae58c12dd60ad79473db7c362d | 2,576 | h | C | modules/http2/h2_h2.h | cgiluadev/httpd | b132631f1905d4a1dd065859a98e1f583e50e258 | [
"Apache-2.0"
] | 2 | 2015-06-27T23:56:37.000Z | 2018-05-29T05:07:15.000Z | modules/http2/h2_h2.h | cgiluadev/httpd | b132631f1905d4a1dd065859a98e1f583e50e258 | [
"Apache-2.0"
] | null | null | null | modules/http2/h2_h2.h | cgiluadev/httpd | b132631f1905d4a1dd065859a98e1f583e50e258 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:33:12.000Z | 2020-11-06T11:00:44.000Z | /* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* 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 __mod_h2__h2_h2__
#define __mod_h2__h2_h2__
/**
* List of ALPN protocol identifiers that we support in cleartext
* negotiations. NULL terminated.
*/
extern const char *h2_clear_protos[];
/**
* List of ALPN protocol identifiers that we support in TLS encrypted
* negotiations. NULL terminated.
*/
extern const char *h2_tls_protos[];
/**
* Provide a user readable description of the HTTP/2 error code-
* @param h2_error http/2 error code, as in rfc 7540, ch. 7
* @return textual description of code or that it is unknown.
*/
const char *h2_h2_err_description(unsigned int h2_error);
/*
* One time, post config initialization.
*/
apr_status_t h2_h2_init(apr_pool_t *pool, server_rec *s);
/* Is the connection a TLS connection?
*/
int h2_h2_is_tls(conn_rec *c);
/* Register apache hooks for h2 protocol
*/
void h2_h2_register_hooks(void);
/**
* Check if the given connection fulfills the requirements as configured.
* @param c the connection
* @param require_all != 0 iff any missing connection properties make
* the test fail. For example, a cipher might not have been selected while
* the handshake is still ongoing.
* @return != 0 iff connection requirements are met
*/
int h2_is_acceptable_connection(conn_rec *c, int require_all);
/**
* Check if the "direct" HTTP/2 mode of protocol handling is enabled
* for the given connection.
* @param c the connection to check
* @return != 0 iff direct mode is enabled
*/
int h2_allows_h2_direct(conn_rec *c);
/**
* Check if the "Upgrade" HTTP/1.1 mode of protocol switching is enabled
* for the given connection.
* @param c the connection to check
* @return != 0 iff Upgrade switching is enabled
*/
int h2_allows_h2_upgrade(conn_rec *c);
#endif /* defined(__mod_h2__h2_h2__) */
| 32.2 | 77 | 0.743012 |
36aa1f19cd7f8e7e6264d79ad410383edea44d59 | 1,423 | h | C | Frameworks/UIKit.framework/_UIRotatingAlertController.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 36 | 2016-04-20T04:19:04.000Z | 2018-10-08T04:12:25.000Z | Frameworks/UIKit.framework/_UIRotatingAlertController.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | null | null | null | Frameworks/UIKit.framework/_UIRotatingAlertController.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 10 | 2016-06-16T02:40:44.000Z | 2019-01-15T03:31:45.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/UIKit.framework/UIKit
*/
@interface _UIRotatingAlertController : UIAlertController {
unsigned long long _arrowDirections;
bool _isRotating;
<UIPopoverPresentationControllerDelegate> * _popoverPresentationControllerDelegateWhileRotating;
UIViewController * _presentedViewControllerWhileRotating;
bool _readyToPresentAfterRotation;
<_UIRotatingAlertControllerDelegate> * _rotatingSheetDelegate;
}
@property (nonatomic) unsigned long long arrowDirections;
@property (nonatomic) <_UIRotatingAlertControllerDelegate> *rotatingSheetDelegate;
- (void).cxx_destruct;
- (void)_didRotateAndLayout;
- (void)_presentingViewControllerDidChange:(id)arg1;
- (void)_presentingViewControllerWillChange:(id)arg1;
- (bool)_shouldAbortAdaptationFromTraitCollection:(id)arg1 toTraitCollection:(id)arg2 withTransitionCoordinator:(id)arg3;
- (void)_updateSheetPositionAfterRotation;
- (unsigned long long)arrowDirections;
- (void)dealloc;
- (void)didRotate:(id)arg1;
- (void)doneWithSheet;
- (id)init;
- (bool)presentSheet;
- (bool)presentSheetFromRect:(struct CGRect { struct CGPoint { double x_1_1_1; double x_1_1_2; } x1; struct CGSize { double x_2_1_1; double x_2_1_2; } x2; })arg1;
- (id)rotatingSheetDelegate;
- (void)setArrowDirections:(unsigned long long)arg1;
- (void)setRotatingSheetDelegate:(id)arg1;
- (void)willRotate:(id)arg1;
@end
| 39.527778 | 162 | 0.797611 |
3c22a40969c307e448593094855590013c9d6546 | 8,714 | h | C | OsiInterface/GameDefinitions/Surface.h | wuergrob/ositools | 4161bd129e691496dcd2aa1e9b8bdd889a61168f | [
"MIT"
] | null | null | null | OsiInterface/GameDefinitions/Surface.h | wuergrob/ositools | 4161bd129e691496dcd2aa1e9b8bdd889a61168f | [
"MIT"
] | null | null | null | OsiInterface/GameDefinitions/Surface.h | wuergrob/ositools | 4161bd129e691496dcd2aa1e9b8bdd889a61168f | [
"MIT"
] | null | null | null | #pragma once
#include "BaseTypes.h"
#include "Enumerations.h"
#include "EntitySystem.h"
namespace dse
{
namespace eoc
{
struct AiGrid;
}
#pragma pack(push, 1)
namespace esv
{
struct Surface;
struct SurfaceAction;
struct SurfaceManager;
struct Level;
struct SurfaceCell
{
glm::i16vec2 Position;
};
struct SubSurface
{
Surface* Surface;
uint64_t SurfaceStateFlags;
CompactObjectSet<SurfaceCell> SurfaceCells1;
CompactObjectSet<SurfaceCell> SurfaceCells2;
uint16_t SurfaceIndex;
uint8_t Position[2];
int field_44;
};
struct Surface : ProtectedGameObject<Surface>
{
FixedString FS1;
NetId NetID;
uint8_t _Pad0[4];
ObjectHandle MyHandle;
SurfaceType SurfaceType;
uint8_t Flags;
uint8_t _Pad1[3];
int field_20;
int CombatComponentIdx;
int TeamId;
uint8_t _Pad2[4];
ObjectHandle OwnerHandle;
float LifeTime;
int8_t Level;
uint8_t _Pad3[3];
bool LifeTimeFromTemplate;
uint8_t _Pad4[3];
float StatusChance;
uint64_t PrimSetSurfaceCell[3];
uint64_t TransformActionObjectHandles[14];
uint16_t Index;
uint8_t _Pad5[6];
SurfaceManager* SurfaceManager;
bool NeedsSplitEvaluation;
uint8_t _Pad6[3];
float OwnershipTimer;
bool field_E8;
uint8_t _Pad7[7];
ObjectSet<SubSurface*> SubSurfaces;
};
struct SurfaceCollectCellsFlood
{
void* VMT;
__int64 field_8;
__int64 field_10;
__int64 field_18;
__int64 field_20;
__int64 field_28;
PrimitiveSet<SurfaceCell> Cells;
};
struct SurfaceManager : public ObjectFactory<Surface, (uint32_t)ObjectType::Unknown>
{
BaseComponentProcessingSystem ComponentProcessingSystem;
uint64_t field_98;
ObjectSet<SurfaceAction*> SurfaceActions;
Array<Surface*> Surfaces;
uint64_t field_E0;
PrimitiveSet<SurfaceCell> SurfaceCells;
SurfaceCollectCellsFlood CollectCellsFlood;
ObjectSet<PrimitiveSet<SurfaceCell>> SurfaceCellSetsByLayer;
RefMap<uint64_t, uint64_t> field_158;
};
struct SurfaceAction : ProtectedGameObject<SurfaceAction>
{
void* VMT;
Level* Level;
ObjectHandle MyHandle;
};
struct CreateSurfaceActionBase : public SurfaceAction
{
ObjectHandle OwnerHandle; // Init param
float Duration; // Init param
float StatusChance; // Init param
float Position[3]; // Init param
SurfaceType SurfaceType; // Init param
ObjectHandle SurfaceHandlesByType[79];
PrimitiveSet<SurfaceCell>* SurfaceChanges[79];
PrimitiveSet<SurfaceCell>* SurfaceCellsByLayer[2];
};
struct CreateSurfaceAction : public CreateSurfaceActionBase
{
float Radius; // Init param
float ExcludeRadius;
float MaxHeight; // Init param
bool IgnoreIrreplacableSurfaces; // Init param
bool CheckExistingSurfaces;
uint8_t _Pad1[2];
uint64_t SurfaceCollisionFlags;
uint64_t SurfaceCollisionNotOnFlags;
uint64_t LineCheckBlock; // Init param
float Timer;
float GrowTimer;
int GrowStep;
int CurrentCellCount;
PrimitiveSet<SurfaceCell> SurfaceCells;
uint32_t SurfaceLayer;
};
struct ChangeSurfaceOnPathAction : public CreateSurfaceActionBase
{
ObjectHandle OH;
int Radius;
bool IsFinished;
uint8_t _Pad1[3];
PrimitiveSet<SurfaceCell> SurfaceCells;
bool IgnoreIrreplacableSurfaces;
bool CheckExistingSurfaces;
uint8_t _Pad2[2];
uint32_t SurfaceCollisionFlags;
uint32_t SurfaceCollisionNotOnFlags;
bool IgnoreOwnerCells;
};
struct CreatePuddleAction : public CreateSurfaceActionBase
{
int SurfaceCells; // Init param
int Step; // Init param
float GrowSpeed; // Init param
uint8_t _Pad1[4];
bool IsFinished;
bool IgnoreIrreplacableSurfaces; // Init param
uint8_t _Pad2[6];
PrimitiveSet<SurfaceCell> CellAtGrow;
PrimitiveSet<SurfaceCell> ClosedCells;
float GrowTimer;
};
struct ExtinguishFireAction : public CreateSurfaceActionBase
{
float Position[3];
int Radius;
int Percentage;
int GrowTimer;
int Step;
uint8_t _Pad1[4];
PrimitiveSet<SurfaceCell> field_558;
PrimitiveSet<SurfaceCell> field_570;
};
struct TransformSurfaceAction : public SurfaceAction
{
float Timer;
SurfaceTransformActionType SurfaceTransformAction; // Init param
SurfaceType OriginSurface; // Init param
int SurfaceLayer; // Init param
float GrowCellPerSecond;
bool Finished;
uint8_t _Pad1[3];
void* CellSearcher;
ObjectHandle OwnerHandle; // Init param
float Position[3]; // Init param
float SurfaceLifetime; // Init param
float SurfaceStatusChance; // Init param
uint8_t _Pad2[4];
RefMap<SurfaceType, ObjectHandle> SurfaceMap;
RefMap<SurfaceType, PrimitiveSet<SurfaceCell>> SurfaceCellMap;
PrimitiveSet<SurfaceCell> SurfaceRemoveGroundCellMap;
PrimitiveSet<SurfaceCell> SurfaceRemoveCloudCellMap;
};
struct RectangleSurfaceAction : public CreateSurfaceActionBase
{
float Target[3];
uint8_t _Pad1[4];
int field_548;
float SurfaceArea_M;
float Width;
float Length;
float GrowTimer;
float MaxHeight;
int GrowStep;
uint8_t _Pad2[4];
uint64_t Flags;
DamagePairList DamageList;
bool field_590;
uint8_t _Pad3[7];
uint64_t LineCheckBlock;
uint64_t field_5A0;
float CurrentGrowTimer;
uint8_t _Pad4[4];
PrimitiveSet<SurfaceCell> SurfaceCells;
ObjectSet<ObjectHandle> Characters;
ObjectSet<ObjectHandle> Items;
uint64_t CurrentCellCount;
};
struct PolygonSurfaceAction : public CreateSurfaceActionBase
{
FixedString field_538;
ObjectSet<glm::vec2> PolygonVertices; // Init param
int field_560;
uint8_t _Pad1[4];
DamagePairList DamageList;
char field_588;
uint8_t _Pad2[7];
__int64 field_590;
float CurrentGrowTimer;
float GrowTimer; // Init param
float PositionXZ[2];
int GrowStep; // Init param
int LastSurfaceCellCount;
PrimitiveSet<SurfaceCell> SurfaceCells;
ObjectSet<ObjectHandle> Characters;
ObjectSet<ObjectHandle> Items;
char field_608;
};
struct SwapSurfaceAction : public CreateSurfaceActionBase
{
float Radius;
float ExcludeRadius;
float MaxHeight;
float Target[3];
bool IgnoreIrreplacableSurfaces;
bool CheckExistingSurfaces;
uint8_t _Pad1[6];
uint64_t SurfaceCollisionFlags;
uint64_t SurfaceCollisionNotOnFlags;
uint64_t LineCheckBlock;
float Timer;
float GrowTimer;
int GrowStep;
int CurrentCellCount;
PrimitiveSet<SurfaceCell> SurfaceCells;
PrimitiveSet<SurfaceCell> TargetCells;
RefMap<dse::SurfaceType, PrimitiveSet<SurfaceCell>> SurfaceCellMap;
RefMap<dse::SurfaceType, PrimitiveSet<SurfaceCell>> TargetCellMap;
};
struct SurfaceActionFactory : public ObjectFactory<SurfaceAction, (uint32_t)ObjectType::ServerSurfaceAction>
{};
}
#pragma pack(pop)
}
| 32.036765 | 116 | 0.575281 |
2c8ff57732d46d5f49803a4bcd0dae8906bc698a | 2,365 | h | C | folly/experimental/symbolizer/LineReader.h | facebookxx/folly | 2da5b6427c302c34e72c4f0aedaa1d9ed892f6fe | [
"Apache-2.0"
] | 19,046 | 2015-01-01T17:01:10.000Z | 2022-03-31T23:01:43.000Z | folly/experimental/symbolizer/LineReader.h | facebookxx/folly | 2da5b6427c302c34e72c4f0aedaa1d9ed892f6fe | [
"Apache-2.0"
] | 1,493 | 2015-01-11T15:47:13.000Z | 2022-03-28T18:13:58.000Z | folly/experimental/symbolizer/LineReader.h | facebookxx/folly | 2da5b6427c302c34e72c4f0aedaa1d9ed892f6fe | [
"Apache-2.0"
] | 4,818 | 2015-01-01T12:28:16.000Z | 2022-03-31T16:22:10.000Z | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <cstddef>
#include <folly/Range.h>
namespace folly {
namespace symbolizer {
/**
* Async-signal-safe line reader.
*/
class LineReader {
public:
/**
* Create a line reader that reads into a user-provided buffer (of size
* bufSize).
*/
LineReader(int fd, char* buf, size_t bufSize);
LineReader(const LineReader&) = delete;
LineReader& operator=(const LineReader&) = delete;
enum State {
kReading,
kEof,
kError,
};
/**
* Read the next line from the file.
*
* If the line is at most bufSize characters long, including the trailing
* newline, it will be returned (including the trailing newline).
*
* If the line is longer than bufSize, we return the first bufSize bytes
* (which won't include a trailing newline) and then continue from that
* point onwards.
*
* The lines returned are not null-terminated.
*
* Returns kReading with a valid line, kEof if at end of file, or kError
* if a read error was encountered.
*
* Example:
* bufSize = 10
* input has "hello world\n"
* The first call returns "hello worl"
* The second call returns "d\n"
*/
State readLine(StringPiece& line);
private:
int const fd_;
char* const buf_;
char* const bufEnd_;
// buf_ <= bol_ <= eol_ <= end_ <= bufEnd_
//
// [buf_, end_): current buffer contents (read from file)
//
// [buf_, bol_): free (already processed, can be discarded)
// [bol_, eol_): current line, including \n if it exists, eol_ points
// 1 character past the \n
// [eol_, end_): read, unprocessed
// [end_, bufEnd_): free
char* bol_;
char* eol_;
char* end_;
State state_;
};
} // namespace symbolizer
} // namespace folly
| 26.277778 | 75 | 0.668076 |
19047a53cc35f9d5f2b5e23a8839feda30edcd37 | 727 | h | C | System/Library/PrivateFrameworks/VectorKit.framework/VKLabelExternalIconElement.h | lechium/tvOS130Headers | 6b47cdcd4a6f453b399aa9d742b5d0f7e3f732fd | [
"MIT"
] | 11 | 2019-11-06T04:48:48.000Z | 2022-02-09T17:48:15.000Z | System/Library/PrivateFrameworks/VectorKit.framework/VKLabelExternalIconElement.h | lechium/tvOS130Headers | 6b47cdcd4a6f453b399aa9d742b5d0f7e3f732fd | [
"MIT"
] | 1 | 2020-04-16T01:41:56.000Z | 2020-04-16T04:32:00.000Z | System/Library/PrivateFrameworks/VectorKit.framework/VKLabelExternalIconElement.h | lechium/tvOS130Headers | 6b47cdcd4a6f453b399aa9d742b5d0f7e3f732fd | [
"MIT"
] | 3 | 2019-12-22T20:17:53.000Z | 2021-01-25T09:47:49.000Z | /*
* This header is generated by classdump-dyld 1.0
* on Tuesday, November 5, 2019 at 2:46:39 AM Mountain Standard Time
* Operating System: Version 13.0 (Build 17J586)
* Image Source: /System/Library/PrivateFrameworks/VectorKit.framework/VectorKit
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <VectorKit/VectorKit-Structs.h>
#import <VectorKit/NSSecureCoding.h>
@interface VKLabelExternalIconElement : NSObject <NSSecureCoding> {
LabelExternalIconElement _element;
}
+(BOOL)supportsSecureCoding;
-(void)encodeWithCoder:(id)arg1 ;
-(id)initWithCoder:(id)arg1 ;
-(const LabelExternalIconElement*)element;
-(id)initWithIconElement:(const LabelExternalIconElement*)arg1 ;
@end
| 30.291667 | 81 | 0.78542 |
300bf018bde89b63a612410b866dadd86732708b | 25,007 | c | C | sdk-6.5.20/libs/sdklt/bcmpkt/chip/bcm56990_b0/bcm56990_b0_pkt_lbhdr.c | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/libs/sdklt/bcmpkt/chip/bcm56990_b0/bcm56990_b0_pkt_lbhdr.c | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/libs/sdklt/bcmpkt/chip/bcm56990_b0/bcm56990_b0_pkt_lbhdr.c | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | /*******************************************************************************
*
* DO NOT EDIT THIS FILE!
* This file is auto-generated from the registers file.
* Edits to this file will be lost when it is regenerated.
* Tool: INTERNAL/regs/xgs/generate-pmd.pl
*
* 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.
*
* This file provides LBHDR access functions for BCM56990_B0.
*/
#include <sal/sal_types.h>
#include <bsl/bsl.h>
#include <bcmpkt/bcmpkt_lbhdr_internal.h>
#define MASK(_bn) (((uint32_t)0x1<<(_bn))-1)
#define WORD_FIELD_GET(_d,_s,_l) (((_d) >> (_s)) & MASK(_l))
#define WORD_FIELD_SET(_d,_s,_l,_v) (_d)=(((_d) & ~(MASK(_l) << (_s))) | (((_v) & MASK(_l)) << (_s)))
#define WORD_FIELD_MASK(_d,_s,_l) (_d)=((_d) | (MASK(_l) << (_s)))
/*******************************************************************************
* SWFORMAT: LBHDR
* BLOCKS:
* SIZE: 128
*/
static void bcmpkt_lbhdr_start_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_START with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[0], 24, 8, val);
}
static uint32_t bcmpkt_lbhdr_start_get(uint32_t *data)
{
uint32_t val;
val = WORD_FIELD_GET(data[0], 24, 8);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_START value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_header_type_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_HEADER_TYPE with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[0], 15, 5, val);
}
static uint32_t bcmpkt_lbhdr_header_type_get(uint32_t *data)
{
uint32_t val;
val = WORD_FIELD_GET(data[0], 15, 5);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_HEADER_TYPE value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_input_priority_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_INPUT_PRIORITY with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[0], 20, 4, val);
}
static uint32_t bcmpkt_lbhdr_input_priority_get(uint32_t *data)
{
uint32_t val;
val = WORD_FIELD_GET(data[0], 20, 4);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_INPUT_PRIORITY value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_pkt_profile_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_PKT_PROFILE with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[1], 26, 3, val);
}
static uint32_t bcmpkt_lbhdr_pkt_profile_get(uint32_t *data)
{
uint32_t val;
val = WORD_FIELD_GET(data[1], 26, 3);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_PKT_PROFILE value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_visibility_pkt_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_VISIBILITY_PKT with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[1], 29, 1, val);
}
static uint32_t bcmpkt_lbhdr_visibility_pkt_get(uint32_t *data)
{
uint32_t val;
val = WORD_FIELD_GET(data[1], 29, 1);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_VISIBILITY_PKT value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_source_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_SOURCE with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[1], 30, 2, val & MASK(2));
WORD_FIELD_SET(data[0], 0, 14, (val >> 2) & MASK(14));
}
static uint32_t bcmpkt_lbhdr_source_get(uint32_t *data)
{
uint32_t val;
val = (WORD_FIELD_GET(data[1], 30, 2) | (WORD_FIELD_GET(data[0], 0, 14) << 2)) ;
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_SOURCE value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_source_type_set(uint32_t *data, uint32_t val)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_SOURCE_TYPE with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[0], 14, 1, val);
}
static uint32_t bcmpkt_lbhdr_source_type_get(uint32_t *data)
{
uint32_t val;
val = WORD_FIELD_GET(data[0], 14, 1);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_SOURCE_TYPE value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_trill_ac_cng_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_AC) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_TRILL_AC_CNG with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 4, 2, val);
}
static uint32_t bcmpkt_lbhdr_trill_ac_cng_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_AC) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 4, 2);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_TRILL_AC_CNG value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_trill_ac_tc_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_AC) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_TRILL_AC_TC with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 0, 4, val);
}
static uint32_t bcmpkt_lbhdr_trill_ac_tc_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_AC) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 0, 4);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_TRILL_AC_TC value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_trill_nw_cng_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_NW) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_TRILL_NW_CNG with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 4, 2, val);
}
static uint32_t bcmpkt_lbhdr_trill_nw_cng_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_NW) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 4, 2);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_TRILL_NW_CNG value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_trill_nw_tc_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_NW) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_TRILL_NW_TC with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 0, 4, val);
}
static uint32_t bcmpkt_lbhdr_trill_nw_tc_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_TRILL_NW) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 0, 4);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_TRILL_NW_TC value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_dest_type_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_DEST_TYPE with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 11, 4, val);
}
static uint32_t bcmpkt_lbhdr_eth_dest_type_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 11, 4);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_DEST_TYPE value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_dest_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_DEST with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 15, 16, val);
}
static uint32_t bcmpkt_lbhdr_eth_dest_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 15, 16);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_DEST value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_dp_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_DP with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[2], 7, 2, val);
}
static uint32_t bcmpkt_lbhdr_eth_dp_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[2], 7, 2);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_DP value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_ecmp_member_id_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_ECMP_MEMBER_ID with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[2], 9, 14, val);
}
static uint32_t bcmpkt_lbhdr_eth_ecmp_member_id_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[2], 9, 14);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_ECMP_MEMBER_ID value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_int_cn_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_INT_CN with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[2], 1, 2, val);
}
static uint32_t bcmpkt_lbhdr_eth_int_cn_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[2], 1, 2);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_INT_CN value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_int_pri_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_INT_PRI with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[2], 3, 4, val);
}
static uint32_t bcmpkt_lbhdr_eth_int_pri_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[2], 3, 4);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_INT_PRI value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_mcast_lb_index_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_MCAST_LB_INDEX with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[1], 6, 8, val);
}
static uint32_t bcmpkt_lbhdr_eth_mcast_lb_index_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[1], 6, 8);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_MCAST_LB_INDEX value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_mcast_lb_index_vld_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_MCAST_LB_INDEX_VLD with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[1], 14, 1, val);
}
static uint32_t bcmpkt_lbhdr_eth_mcast_lb_index_vld_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[1], 14, 1);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_MCAST_LB_INDEX_VLD value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_pp_port_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_PP_PORT with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 0, 9, val);
}
static uint32_t bcmpkt_lbhdr_eth_pp_port_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 0, 9);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_PP_PORT value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_qos_fields_vld_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_QOS_FIELDS_VLD with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[2], 0, 1, val);
}
static uint32_t bcmpkt_lbhdr_eth_qos_fields_vld_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[2], 0, 1);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_QOS_FIELDS_VLD value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_routed_pkt_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_ROUTED_PKT with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 31, 1, val);
}
static uint32_t bcmpkt_lbhdr_eth_routed_pkt_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 31, 1);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_ROUTED_PKT value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_eth_subflow_type_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETH_SUBFLOW_TYPE with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[3], 9, 2, val);
}
static uint32_t bcmpkt_lbhdr_eth_subflow_type_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[3], 9, 2);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETH_SUBFLOW_TYPE value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_ethernet_vrf_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETHERNET_VRF with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[2], 23, 9, val & MASK(9));
WORD_FIELD_SET(data[1], 0, 4, (val >> 9) & MASK(4));
}
static uint32_t bcmpkt_lbhdr_ethernet_vrf_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = (WORD_FIELD_GET(data[2], 23, 9) | (WORD_FIELD_GET(data[1], 0, 4) << 9)) ;
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETHERNET_VRF value %u from device BCM56990_B0.\n"), val));
return val;
}
static void bcmpkt_lbhdr_ethernet_vrf_valid_set(uint32_t *data, uint32_t val)
{
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_ERROR(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return;
}
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Set field BCMPKT_LBHDR_ETHERNET_VRF_VALID with value %u on device BCM56990_B0.\n"), val));
WORD_FIELD_SET(data[1], 4, 1, val);
}
static uint32_t bcmpkt_lbhdr_ethernet_vrf_valid_get(uint32_t *data)
{
uint32_t val;
if (bcmpkt_lbhdr_header_type_get(data) != BCMPKT_LBHDR_HEADER_T_ETHERNET) {
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("View doesn't match!\n")));
return 0;
}
val = WORD_FIELD_GET(data[1], 4, 1);
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR,
(BSL_META("Get field BCMPKT_LBHDR_ETHERNET_VRF_VALID value %u from device BCM56990_B0.\n"), val));
return val;
}
static uint32_t bcmpkt_lbhdr_i_size_get(uint32_t *data, uint32_t **addr)
{
LOG_DEBUG(BSL_LS_BCMPKT_LBHDR, (BSL_META("Get BCMPKT_LBHDR_I_SIZE on device BCM56990_B0.\n")));
return 4;
}
const bcmpkt_lbhdr_fget_t bcm56990_b0_lbhdr_fget = {
{
bcmpkt_lbhdr_start_get,
bcmpkt_lbhdr_header_type_get,
bcmpkt_lbhdr_input_priority_get,
bcmpkt_lbhdr_pkt_profile_get,
bcmpkt_lbhdr_visibility_pkt_get,
bcmpkt_lbhdr_source_get,
bcmpkt_lbhdr_source_type_get,
bcmpkt_lbhdr_trill_ac_cng_get,
bcmpkt_lbhdr_trill_ac_tc_get,
NULL,
bcmpkt_lbhdr_trill_nw_cng_get,
bcmpkt_lbhdr_trill_nw_tc_get,
bcmpkt_lbhdr_eth_dest_type_get,
bcmpkt_lbhdr_eth_dest_get,
bcmpkt_lbhdr_eth_dp_get,
bcmpkt_lbhdr_eth_ecmp_member_id_get,
bcmpkt_lbhdr_eth_int_cn_get,
bcmpkt_lbhdr_eth_int_pri_get,
bcmpkt_lbhdr_eth_mcast_lb_index_get,
bcmpkt_lbhdr_eth_mcast_lb_index_vld_get,
bcmpkt_lbhdr_eth_pp_port_get,
bcmpkt_lbhdr_eth_qos_fields_vld_get,
bcmpkt_lbhdr_eth_routed_pkt_get,
bcmpkt_lbhdr_eth_subflow_type_get,
bcmpkt_lbhdr_ethernet_vrf_get,
bcmpkt_lbhdr_ethernet_vrf_valid_get,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
const bcmpkt_lbhdr_fset_t bcm56990_b0_lbhdr_fset = {
{
bcmpkt_lbhdr_start_set,
bcmpkt_lbhdr_header_type_set,
bcmpkt_lbhdr_input_priority_set,
bcmpkt_lbhdr_pkt_profile_set,
bcmpkt_lbhdr_visibility_pkt_set,
bcmpkt_lbhdr_source_set,
bcmpkt_lbhdr_source_type_set,
bcmpkt_lbhdr_trill_ac_cng_set,
bcmpkt_lbhdr_trill_ac_tc_set,
NULL,
bcmpkt_lbhdr_trill_nw_cng_set,
bcmpkt_lbhdr_trill_nw_tc_set,
bcmpkt_lbhdr_eth_dest_type_set,
bcmpkt_lbhdr_eth_dest_set,
bcmpkt_lbhdr_eth_dp_set,
bcmpkt_lbhdr_eth_ecmp_member_id_set,
bcmpkt_lbhdr_eth_int_cn_set,
bcmpkt_lbhdr_eth_int_pri_set,
bcmpkt_lbhdr_eth_mcast_lb_index_set,
bcmpkt_lbhdr_eth_mcast_lb_index_vld_set,
bcmpkt_lbhdr_eth_pp_port_set,
bcmpkt_lbhdr_eth_qos_fields_vld_set,
bcmpkt_lbhdr_eth_routed_pkt_set,
bcmpkt_lbhdr_eth_subflow_type_set,
bcmpkt_lbhdr_ethernet_vrf_set,
bcmpkt_lbhdr_ethernet_vrf_valid_set,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
}
};
const bcmpkt_lbhdr_figet_t bcm56990_b0_lbhdr_figet = {
{
bcmpkt_lbhdr_i_size_get
}
};
static shr_enum_map_t bcm56990_b0_lbhdr_view_types[] = {
{"trill_nw", 1},
{"trill_ac", 2},
{"ethernet", 3},
{NULL, -1},
};
/* -2: unsupported, -1: global, others: view's value */
static int bcm56990_b0_lbhdr_view_infos[BCMPKT_LBHDR_FID_COUNT] = {
-1, -1, -1, -1, -1, -1, -1, 2, 2, -2, 1, 1, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -2, -2, -2, -2, -2, -2,
-2, -2, -2, -2, -2, -2, -2, -2, -2,
};
void bcm56990_b0_lbhdr_view_info_get(bcmpkt_pmd_view_info_t *info)
{
info->view_infos = bcm56990_b0_lbhdr_view_infos;
info->view_types = bcm56990_b0_lbhdr_view_types;
info->view_type_get = bcmpkt_lbhdr_header_type_get;
}
| 35.622507 | 134 | 0.687368 |
cf94e4172403ac1e334dee23b87e9d27bd020e83 | 453 | h | C | Entitas/ESMatcher.h | arne-schroppe/entitas | 416407d6e88280ac6cedeefcbdd68b9ac7c15ee3 | [
"MIT"
] | 1 | 2019-08-06T06:49:16.000Z | 2019-08-06T06:49:16.000Z | Entitas/ESMatcher.h | arne-schroppe/entitas | 416407d6e88280ac6cedeefcbdd68b9ac7c15ee3 | [
"MIT"
] | null | null | null | Entitas/ESMatcher.h | arne-schroppe/entitas | 416407d6e88280ac6cedeefcbdd68b9ac7c15ee3 | [
"MIT"
] | null | null | null | #import <Foundation/Foundation.h>
@interface ESMatcher : NSObject <NSCopying>
+ (ESMatcher *)allOf:(Class)firstClass, ... NS_REQUIRES_NIL_TERMINATION;
+ (ESMatcher *)allOfSet:(NSSet *)componentTypes;
+ (ESMatcher *)anyOf:(Class)firstClass, ... NS_REQUIRES_NIL_TERMINATION;
+ (ESMatcher *)anyOfSet:(NSSet *)componentTypes;
+ (ESMatcher *)just:(Class)someClass;
- (BOOL)areComponentsMatching:(NSSet *)componentTypes;
- (NSSet *)componentTypes;
@end | 26.647059 | 72 | 0.748344 |
c5fccccf78c04d0b0bca1e9fee1f5b1d5fbe404d | 5,126 | h | C | LiteOS/components/fs/include/los_vfs.h | lambda666/liteos_in_raspberry_ubuntu20 | ca716a3d22796dc20f1bafaf548167752546e02f | [
"Apache-2.0"
] | null | null | null | LiteOS/components/fs/include/los_vfs.h | lambda666/liteos_in_raspberry_ubuntu20 | ca716a3d22796dc20f1bafaf548167752546e02f | [
"Apache-2.0"
] | null | null | null | LiteOS/components/fs/include/los_vfs.h | lambda666/liteos_in_raspberry_ubuntu20 | ca716a3d22796dc20f1bafaf548167752546e02f | [
"Apache-2.0"
] | null | null | null | /* ----------------------------------------------------------------------------
* Copyright (c) Huawei Technologies Co., Ltd. 2013-2021. All rights reserved.
* Description: Virtual Fs HeadFile
* Author: Huawei LiteOS Team
* Create: 2013-01-01
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --------------------------------------------------------------------------- */
#ifndef _LOS_VFS_H
#define _LOS_VFS_H
#if defined(LOSCFG_COMPONENTS_FS_VFS)
#include <stdio.h>
#include <stdint.h>
#include <los_typedef.h>
#include "sys/stat.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#define LOS_MAX_DIR_NAME_LEN 255
#define LOS_MAX_FILE_NAME_LEN 32
#define LOS_FS_MAX_NAME_LEN LOS_MAX_FILE_NAME_LEN
#define LOS_MAX_FILES 8
#define LOS_FD_OFFSET 3
#define LOS_MAX_FD (LOS_MAX_FILES + LOS_FD_OFFSET)
#define STDOUT 1
struct file;
struct mount_point;
struct dir;
struct dirent;
typedef long off_t;
#define VFS_ERROR (-1)
#define OK 0
#if defined(__GNUC__) || defined(__CC_ARM)
#define VFS_ERRNO_SET(err) (errno = (err))
#else
#define VFS_ERRNO_SET(err)
#endif
struct file_ops {
int (*open)(struct file *, const char *, int);
int (*close)(struct file *);
ssize_t (*read)(struct file *, char *, size_t);
ssize_t (*write)(struct file *, const char *, size_t);
off_t (*lseek)(struct file *, off_t, int);
off64_t (*lseek64)(struct file *, off64_t, int);
int (*stat)(struct mount_point *, const char *, struct stat *);
int (*unlink)(struct mount_point *, const char *);
int (*rename)(struct mount_point *, const char *, const char *);
int (*ioctl)(struct file *, int, unsigned long);
int (*sync)(struct file *);
int (*opendir)(struct dir *, const char *);
int (*readdir)(struct dir *, struct dirent *);
int (*closedir)(struct dir *);
int (*mkdir)(struct mount_point *, const char *);
};
struct file_system {
const char fs_name[LOS_FS_MAX_NAME_LEN];
struct file_ops *fs_fops;
struct file_system *fs_next;
volatile uint32_t fs_refs;
};
struct mount_point {
struct file_system *m_fs;
struct mount_point *m_next;
const char *m_path;
volatile uint32_t m_refs;
UINT32 m_mutex;
void *m_data; /* used by fs private data for this mount point (like /sdb1, /sdb2), */
};
#define FILE_STATUS_NOT_USED 0
#define FILE_STATUS_INITING 1
#define FILE_STATUS_READY 2
#define FILE_STATUS_CLOSING 3
#define VFS_TYPE_FILE 0
#define VFS_TYPE_DIR 1
struct file {
struct file_ops *f_fops;
UINT32 f_flags;
UINT32 f_status;
off_t f_offset;
off64_t f_offset64;
struct mount_point *f_mp; /* can get private mount data here */
UINT32 f_owner; /* the task that openned this file */
void *f_data;
const char *full_path;
};
struct dirent {
char name[LOS_MAX_DIR_NAME_LEN + 1];
UINT32 type;
UINT32 size;
};
struct dir {
struct mount_point *d_mp; /* can get private mount data here */
struct dirent d_dent;
off_t d_offset;
void *d_data;
};
int mkdir(const char *path, mode_t mode);
struct dir *opendir(const char *path);
struct dirent *readdir(struct dir *dir);
int closedir(struct dir *dir);
int LOS_VfsInit(void);
int LOS_FsRegister(struct file_system *fs);
int LOS_FsUnregister(struct file_system *fs);
int LOS_FsMount(const char *fsname, const char *path, void *data);
int LOS_FsUnmount(const char *path);
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /* LOSCFG_COMPONENTS_FS_VFS */
#endif /* _LOS_VFS_H */
| 32.858974 | 101 | 0.687281 |
d0baf614c8babe061948e833ae4ae66eac9aaedc | 2,220 | h | C | mp/src/game/shared/hl2mp/weapon_slam.h | WorldGamers/Mobile-Forces-Source | fd188305e2690e193e17dba4cc6bcafa46dc34e3 | [
"CC-BY-4.0"
] | 3 | 2016-06-23T16:09:35.000Z | 2017-02-22T21:57:56.000Z | mp/src/game/shared/hl2mp/weapon_slam.h | WorldGamers/Mobile-Forces-Source | fd188305e2690e193e17dba4cc6bcafa46dc34e3 | [
"CC-BY-4.0"
] | null | null | null | mp/src/game/shared/hl2mp/weapon_slam.h | WorldGamers/Mobile-Forces-Source | fd188305e2690e193e17dba4cc6bcafa46dc34e3 | [
"CC-BY-4.0"
] | 1 | 2020-03-09T08:27:02.000Z | 2020-03-09T08:27:02.000Z | //========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: SLAM
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#ifndef WEAPONSLAM_H
#define WEAPONSLAM_H
#include "basegrenade_shared.h"
#include "weapon_hl2mpbasehlmpcombatweapon.h"
enum
{
SLAM_TRIPMINE_READY,
SLAM_SATCHEL_THROW,
SLAM_SATCHEL_ATTACH,
};
#ifdef CLIENT_DLL
#define CWeapon_SLAM C_Weapon_SLAM
#endif
class CWeapon_SLAM : public CBaseHL2MPCombatWeapon
{
public:
DECLARE_CLASS( CWeapon_SLAM, CBaseHL2MPCombatWeapon );
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
CNetworkVar( int, m_tSlamState );
CNetworkVar( bool, m_bDetonatorArmed );
CNetworkVar( bool, m_bNeedDetonatorDraw);
CNetworkVar( bool, m_bNeedDetonatorHolster);
CNetworkVar( bool, m_bNeedReload);
CNetworkVar( bool, m_bClearReload);
CNetworkVar( bool, m_bThrowSatchel);
CNetworkVar( bool, m_bAttachSatchel);
CNetworkVar( bool, m_bAttachTripmine);
float m_flWallSwitchTime;
void Spawn( void );
void Precache( void );
void PrimaryAttack( void );
void SecondaryAttack( void );
void WeaponIdle( void );
void Weapon_Switch( void );
void SLAMThink( void );
void SetPickupTouch( void );
void SlamTouch( CBaseEntity *pOther ); // default weapon touch
void ItemPostFrame( void );
bool Reload( void );
void SetSlamState( int newState );
bool CanAttachSLAM(void); // In position where can attach SLAM?
bool AnyUndetonatedCharges(void);
void StartTripmineAttach( void );
void TripmineAttach( void );
void StartSatchelDetonate( void );
void SatchelDetonate( void );
void StartSatchelThrow( void );
void StartSatchelAttach( void );
void SatchelThrow( void );
void SatchelAttach( void );
bool Deploy( void );
bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL );
CWeapon_SLAM();
#ifndef CLIENT_DLL
DECLARE_ACTTABLE();
DECLARE_DATADESC();
#endif
private:
CWeapon_SLAM( const CWeapon_SLAM & );
};
#endif //WEAPONSLAM_H
| 24.395604 | 81 | 0.648198 |
a92f3b38178a608b025b2a8c1fb0aa459d224fed | 3,159 | h | C | Sample/ClientSource/cocos2dx/kazmath/include/kazmath/vec2.h | wenhulove333/ScutServer | 338a50ff577c0e2ef2276a2883a8bfe28517c79b | [
"MIT"
] | 2 | 2017-05-27T13:32:28.000Z | 2019-05-28T15:11:33.000Z | Sample/ClientSource/cocos2dx/kazmath/include/kazmath/vec2.h | wenhulove333/ScutServer | 338a50ff577c0e2ef2276a2883a8bfe28517c79b | [
"MIT"
] | null | null | null | Sample/ClientSource/cocos2dx/kazmath/include/kazmath/vec2.h | wenhulove333/ScutServer | 338a50ff577c0e2ef2276a2883a8bfe28517c79b | [
"MIT"
] | 4 | 2016-08-27T05:26:16.000Z | 2019-12-27T07:07:09.000Z | /*
Copyright (c) 2008, Luke Benstead.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef VEC2_H_INCLUDED
#define VEC2_H_INCLUDED
#include "platform/CCPlatformMacros.h"
struct kmMat3;
#ifndef kmScalar
#define kmScalar float
#endif
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
typedef struct kmVec2 {
kmScalar x;
kmScalar y;
} kmVec2;
#pragma pack(pop)
#ifdef __cplusplus
extern "C" {
#endif
CC_DLL kmVec2* kmVec2Fill(kmVec2* pOut, kmScalar x, kmScalar y);
CC_DLL kmScalar kmVec2Length(const kmVec2* pIn); ///< Returns the length of the vector
CC_DLL kmScalar kmVec2LengthSq(const kmVec2* pIn); ///< Returns the square of the length of the vector
CC_DLL kmVec2* kmVec2Normalize(kmVec2* pOut, const kmVec2* pIn); ///< Returns the vector passed in set to unit length
CC_DLL kmVec2* kmVec2Add(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2); ///< Adds 2 vectors and returns the result
CC_DLL kmScalar kmVec2Dot(const kmVec2* pV1, const kmVec2* pV2); /** Returns the Dot product which is the cosine of the angle between the two vectors multiplied by their lengths */
CC_DLL kmVec2* kmVec2Subtract(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2); ///< Subtracts 2 vectors and returns the result
CC_DLL kmVec2* kmVec2Transform(kmVec2* pOut, const kmVec2* pV1, const struct kmMat3* pM); /** Transform the Vector */
CC_DLL kmVec2* kmVec2TransformCoord(kmVec2* pOut, const kmVec2* pV, const struct kmMat3* pM); ///<Transforms a 2D vector by a given matrix, projecting the result back into w = 1.
CC_DLL kmVec2* kmVec2Scale(kmVec2* pOut, const kmVec2* pIn, const kmScalar s); ///< Scales a vector to length s
CC_DLL int kmVec2AreEqual(const kmVec2* p1, const kmVec2* p2); ///< Returns 1 if both vectors are equal
#ifdef __cplusplus
}
#endif
#endif // VEC2_H_INCLUDED
| 47.149254 | 181 | 0.754353 |
2eb0bf1c7e6093084f6b3586f5a113d167bf58dd | 730 | h | C | src/installer/osx/Downloader.h | badlee/TideSDK | fe6f6c93c6cab3395121696f48d3b55d43e1eddd | [
"Apache-2.0"
] | 1 | 2021-09-18T10:10:39.000Z | 2021-09-18T10:10:39.000Z | src/installer/osx/Downloader.h | hexmode/TideSDK | 2c0276de08d7b760b53416bbd8038d79b8474fc5 | [
"Apache-2.0"
] | 1 | 2022-02-08T08:45:29.000Z | 2022-02-08T08:45:29.000Z | src/installer/osx/Downloader.h | hexmode/TideSDK | 2c0276de08d7b760b53416bbd8038d79b8474fc5 | [
"Apache-2.0"
] | null | null | null | /**
* Copyright (c) 2012 - 2014 TideSDK contributors
* http://www.tidesdk.org
* Includes modified sources under the Apache 2 License
* Copyright (c) 2008 - 2012 Appcelerator Inc
* Refer to LICENSE for details of distribution and use.
**/
#import <Cocoa/Cocoa.h>
@interface Downloader : NSObject {
NSString* suggestedFilename;
NSString* userAgent;
NSMutableURLRequest* downloadRequest;
NSURLConnection* downloadConnection;
NSProgressIndicator* progress;
NSMutableData* data;
long long expectedBytes;
BOOL completed;
}
-(id)initWithURL:(NSURL*)url progress:(NSProgressIndicator*)p;
-(BOOL)isDownloadComplete;
-(BOOL)completed;
-(void)setCompleted:(BOOL)value;
-(NSString*)suggestedFilename;
-(NSData*)data;
@end
| 24.333333 | 62 | 0.758904 |
03287c12c85b8fbd613cc768cf7d940a9c36277d | 1,313 | c | C | user/c/src/test.c | rcore-os/aCore | a3fb0a47162d4d68347f144ec6552431d26e2ded | [
"MIT"
] | 30 | 2020-10-15T15:59:53.000Z | 2022-01-14T20:51:14.000Z | user/c/src/test.c | rcore-os/aCore | a3fb0a47162d4d68347f144ec6552431d26e2ded | [
"MIT"
] | null | null | null | user/c/src/test.c | rcore-os/aCore | a3fb0a47162d4d68347f144ec6552431d26e2ded | [
"MIT"
] | 3 | 2020-10-17T07:14:47.000Z | 2021-04-12T12:06:20.000Z | #include <asynccall.h>
#include <barrier.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
puts("Hello, World!");
char str[] = "PID: 0";
str[5] = getpid() + 48;
puts(str);
sched_yield();
for (int i = 0; i < argc; i++) {
puts(argv[i]);
}
sched_yield();
struct async_call_buffer buffer;
async_call_buffer_init(16, 16, &buffer);
for (int i = 0; i < 10; i++) {
int cached_tail = *buffer.req_ring.ktail;
struct req_ring_entry* req = req_ring_get_entry(&buffer, cached_tail);
req->user_data = 0x1000 + i;
char str[] = "Hello, async call!\n";
async_call_write(req, stdout, str, strlen(str), 0);
smp_store_release(buffer.req_ring.ktail, cached_tail + 1);
}
sched_yield();
while (smp_load_acquire(buffer.comp_ring.ktail) < 10) {
while (*buffer.comp_ring.khead < smp_load_acquire(buffer.comp_ring.ktail)) {
int cached_head = *buffer.comp_ring.khead;
struct comp_ring_entry* comp = comp_ring_get_entry(&buffer, cached_head);
if (comp->user_data != 0x1000 + cached_head) {
return 1;
}
smp_store_release(buffer.comp_ring.khead, cached_head + 1);
}
}
return 0;
}
| 29.177778 | 85 | 0.594059 |
eada71ed809580b67fde467963be2e06a95ccfd7 | 2,337 | h | C | kernel/generic/include/typedefs.h | narke/Einherjar.tmp | 8c2c6385e1280907fa081a767572c4ccd6c32a82 | [
"BSD-3-Clause"
] | 3 | 2016-04-17T18:24:31.000Z | 2021-06-05T16:59:40.000Z | kernel/generic/include/typedefs.h | narke/Einherjar.tmp | 8c2c6385e1280907fa081a767572c4ccd6c32a82 | [
"BSD-3-Clause"
] | null | null | null | kernel/generic/include/typedefs.h | narke/Einherjar.tmp | 8c2c6385e1280907fa081a767572c4ccd6c32a82 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2001-2004 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @addtogroup generic
* @{
*/
/** @file
*/
#ifndef KERN_TYPEDEFS_H_
#define KERN_TYPEDEFS_H_
#include <stdint.h>
#include <arch/common.h>
#include <arch/types.h>
#include <abi/bool.h>
#define NULL ((void *) 0)
#define false 0
#define true 1
typedef struct {
uint64_t lo;
int64_t hi;
} __attribute__ ((aligned(16))) int128_t;
typedef struct {
uint64_t lo;
uint64_t hi;
} __attribute__ ((aligned(16))) uint128_t;
typedef struct {
volatile atomic_count_t count;
} atomic_t;
typedef void (* function)();
typedef uint32_t container_id_t;
typedef int32_t inr_t;
typedef int32_t devno_t;
typedef volatile uint8_t ioport8_t;
typedef volatile uint16_t ioport16_t;
typedef volatile uint32_t ioport32_t;
#ifdef __32_BITS__
/** Explicit 64-bit arguments passed to syscalls. */
typedef uint64_t sysarg64_t;
#endif /* __32_BITS__ */
#endif
/** @}
*/
| 27.821429 | 76 | 0.748823 |
1430e7ed8ab4c2d52edb04310c53e8cb9c468e85 | 4,600 | h | C | src/PatternLife.h | fblumenberg/LedMatrix | b6f35070008b5561f7d4d62f6eda5064641823a1 | [
"MIT"
] | 1 | 2019-02-24T19:57:58.000Z | 2019-02-24T19:57:58.000Z | src/PatternLife.h | fblumenberg/LedMatrix | b6f35070008b5561f7d4d62f6eda5064641823a1 | [
"MIT"
] | null | null | null | src/PatternLife.h | fblumenberg/LedMatrix | b6f35070008b5561f7d4d62f6eda5064641823a1 | [
"MIT"
] | null | null | null | /*
* Aurora: https://github.com/pixelmatix/aurora
* Copyright (c) 2014 Jason Coon
*
* Portions of this code are adapted from Andrew: http://pastebin.com/f22bfe94d
* which, in turn, was "Adapted from the Life example on the Processing.org site"
*
* Made much more colorful by J.B. Langston: https://github.com/jblang/aurora/commit/6db5a884e3df5d686445c4f6b669f1668841929b
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef PatternLife_H
#define PatternLife_H
#include "Drawable.h"
class Cell {
public:
byte alive : 1;
byte prev : 1;
byte hue: 6;
byte brightness;
};
class PatternLife : public Drawable {
private:
Cell world[MATRIX_WIDTH][MATRIX_HEIGHT];
unsigned int density = 50;
int generation = 0;
void randomFillWorld() {
for (int i = 0; i < MATRIX_WIDTH; i++) {
for (int j = 0; j < MATRIX_HEIGHT; j++) {
if (random(100) < density) {
world[i][j].alive = 1;
world[i][j].brightness = 255;
}
else {
world[i][j].alive = 0;
world[i][j].brightness = 0;
}
world[i][j].prev = world[i][j].alive;
world[i][j].hue = 0;
}
}
}
int neighbours(int x, int y) {
return (world[(x + 1) % MATRIX_WIDTH][y].prev) +
(world[x][(y + 1) % MATRIX_HEIGHT].prev) +
(world[(x + MATRIX_WIDTH - 1) % MATRIX_WIDTH][y].prev) +
(world[x][(y + MATRIX_HEIGHT - 1) % MATRIX_HEIGHT].prev) +
(world[(x + 1) % MATRIX_WIDTH][(y + 1) % MATRIX_HEIGHT].prev) +
(world[(x + MATRIX_WIDTH - 1) % MATRIX_WIDTH][(y + 1) % MATRIX_HEIGHT].prev) +
(world[(x + MATRIX_WIDTH - 1) % MATRIX_WIDTH][(y + MATRIX_HEIGHT - 1) % MATRIX_HEIGHT].prev) +
(world[(x + 1) % MATRIX_WIDTH][(y + MATRIX_HEIGHT - 1) % MATRIX_HEIGHT].prev);
}
public:
PatternLife() {
name = (char *)"Life";
}
unsigned int DrawFrame() {
if (generation == 0) {
matrix.FillScreen(black);
randomFillWorld();
}
// Display current generation
for (int i = 0; i < MATRIX_WIDTH; i++) {
for (int j = 0; j < MATRIX_HEIGHT; j++) {
matrix.SetPixelColor(i,j,matrix.ColorFromCurrentPalette(world[i][j].hue * 4, world[i][j].brightness));
}
}
// Birth and death cycle
for (int x = 0; x < MATRIX_WIDTH; x++) {
for (int y = 0; y < MATRIX_HEIGHT; y++) {
// Default is for cell to stay the same
if (world[x][y].brightness > 0 && world[x][y].prev == 0)
world[x][y].brightness *= 0.9;
int count = neighbours(x, y);
if (count == 3 && world[x][y].prev == 0) {
// A new cell is born
world[x][y].alive = 1;
world[x][y].hue += 2;
world[x][y].brightness = 255;
} else if ((count < 2 || count > 3) && world[x][y].prev == 1) {
// Cell dies
world[x][y].alive = 0;
}
}
}
// Copy next generation into place
for (int x = 0; x < MATRIX_WIDTH; x++) {
for (int y = 0; y < MATRIX_HEIGHT; y++) {
world[x][y].prev = world[x][y].alive;
}
}
generation++;
if (generation >= 256)
generation = 0;
return 60;
}
};
#endif
| 35.658915 | 125 | 0.553043 |
6ce17393c9b3a927ca8be306641a0cac3d58c0b5 | 23,644 | h | C | jre_emul/android/platform/external/icu/data/_com_ibm_icu_impl_data_icudt58b_zone_ur_IN_res.h | life-beam/j2objc | 471504a735b48d5d4ace51afa1542cc4790a921a | [
"Apache-2.0"
] | 1 | 2022-01-19T14:48:54.000Z | 2022-01-19T14:48:54.000Z | jre_emul/android/platform/external/icu/data/_com_ibm_icu_impl_data_icudt58b_zone_ur_IN_res.h | FD-/j2objc | 316bb5a9e9986fa05106fd267da93b8ae60ca212 | [
"Apache-2.0"
] | null | null | null | jre_emul/android/platform/external/icu/data/_com_ibm_icu_impl_data_icudt58b_zone_ur_IN_res.h | FD-/j2objc | 316bb5a9e9986fa05106fd267da93b8ae60ca212 | [
"Apache-2.0"
] | 1 | 2019-05-06T00:18:50.000Z | 2019-05-06T00:18:50.000Z | //
// Generated by gen_resource_source.py
//
#ifndef _COM_IBM_ICU_IMPL_DATA_ICUDT58B_ZONE_UR_IN_RES_H
#define _COM_IBM_ICU_IMPL_DATA_ICUDT58B_ZONE_UR_IN_RES_H
static jbyte _com_ibm_icu_impl_data_icudt58b_zone_ur_IN_res[] = {
0x00, 0x20, 0xDA, 0x27, 0x00, 0x14, 0x00, 0x00, 0x01, 0x00,
0x02, 0x00, 0x52, 0x65, 0x73, 0x42, 0x03, 0x00, 0x00, 0x00,
0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x00, 0x03, 0x9D, 0x00, 0x80, 0xC0, 0x08,
0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x03, 0xA1, 0x00, 0x00,
0x03, 0xA1, 0x00, 0x00, 0x00, 0x38, 0x80, 0xC0, 0x00, 0x04,
0x00, 0x00, 0x03, 0x48, 0xF9, 0x85, 0x50, 0x53, 0x00, 0x00,
0x06, 0x27, 0x06, 0xA9, 0x06, 0x31, 0x06, 0x27, 0x00, 0x00,
0x06, 0x2F, 0x06, 0x28, 0x06, 0x26, 0x06, 0xCC, 0x00, 0x00,
0x06, 0x2A, 0x06, 0xBE, 0x06, 0x48, 0x06, 0x44, 0x06, 0xD2,
0x00, 0x00, 0x06, 0xAF, 0x06, 0x48, 0x06, 0x33, 0x00, 0x20,
0x06, 0x28, 0x06, 0xD2, 0x00, 0x00, 0x06, 0xAF, 0x06, 0x44,
0x06, 0xCC, 0x06, 0x33, 0x00, 0x20, 0x06, 0x28, 0x06, 0xD2,
0x00, 0x00, 0x06, 0x28, 0x06, 0x48, 0x06, 0x88, 0x06, 0x27,
0x06, 0x7E, 0x06, 0xCC, 0x06, 0x33, 0x06, 0x79, 0x00, 0x00,
0x06, 0x39, 0x06, 0x31, 0x06, 0x28, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x86,
0x06, 0x44, 0x06, 0xCC, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x00, 0x32, 0x00, 0x2E,
0x00, 0x31, 0x00, 0x2E, 0x00, 0x32, 0x00, 0x37, 0x00, 0x2E,
0x00, 0x37, 0x00, 0x39, 0x00, 0x00, 0x06, 0x7E, 0x06, 0xCC,
0x06, 0x31, 0x06, 0x48, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0xA9, 0x06, 0xCC,
0x06, 0x45, 0x06, 0x28, 0x06, 0x31, 0x06, 0x2C, 0x00, 0x20,
0x06, 0x28, 0x06, 0xD2, 0x00, 0x00, 0x06, 0xAF, 0x06, 0x31,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x00, 0x20, 0x06, 0x2A,
0x06, 0x31, 0x06, 0xA9, 0x00, 0x00, 0x06, 0x27, 0x06, 0xCC,
0x06, 0x31, 0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x46,
0x06, 0xCC, 0x06, 0x7E, 0x06, 0x27, 0x06, 0x44, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x28, 0x06, 0xBE, 0x06, 0x48, 0x06, 0x79, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x45, 0x06, 0x27, 0x06, 0x44,
0x06, 0x2F, 0x06, 0xCC, 0x06, 0x7E, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x48,
0x06, 0x48, 0x06, 0x33, 0x06, 0x79, 0x06, 0x27, 0x06, 0xA9,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x22, 0x06, 0x31, 0x06, 0x45, 0x06, 0xCC,
0x06, 0x46, 0x06, 0xCC, 0x06, 0x27, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x27,
0x06, 0x33, 0x06, 0x31, 0x06, 0x27, 0x06, 0x26, 0x06, 0xCC,
0x06, 0x44, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x27, 0x06, 0xCC, 0x06, 0x45,
0x06, 0xCC, 0x06, 0x32, 0x06, 0x48, 0x06, 0x46, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x28, 0x06, 0x48, 0x06, 0x44, 0x06, 0xCC, 0x06, 0x48,
0x06, 0xCC, 0x06, 0x27, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x31, 0x06, 0x48,
0x06, 0x2A, 0x06, 0xBE, 0x06, 0xCC, 0x06, 0x31, 0x06, 0x27,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x33, 0x06, 0x48, 0x06, 0x31, 0x06, 0xCC,
0x06, 0x46, 0x06, 0x27, 0x06, 0x45, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x7E,
0x06, 0x27, 0x06, 0xA9, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x86, 0x06, 0x44, 0x06, 0xCC,
0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0xA9, 0x06, 0x31, 0x06, 0x3A, 0x06, 0x33, 0x06, 0x2A,
0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x00, 0x7B, 0x00, 0x30,
0x00, 0x7D, 0x00, 0x20, 0x06, 0x2F, 0x06, 0x46, 0x00, 0x20,
0x06, 0xA9, 0x06, 0x27, 0x00, 0x20, 0x06, 0x48, 0x06, 0x42,
0x06, 0x2A, 0x00, 0x00, 0x06, 0x27, 0x06, 0x32, 0x06, 0x28,
0x06, 0xA9, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27, 0x06, 0x46,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x27, 0x06, 0xCC, 0x06, 0xA9, 0x06, 0x48,
0x06, 0x27, 0x06, 0x88, 0x06, 0x48, 0x06, 0x31, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x2A, 0x06, 0x27, 0x06, 0x2C, 0x06, 0xA9, 0x06, 0x33,
0x06, 0x2A, 0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x7E,
0x06, 0xCC, 0x06, 0x31, 0x06, 0x27, 0x06, 0xAF, 0x06, 0x48,
0x06, 0x26, 0x06, 0xD2, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x7E, 0x06, 0xCC,
0x06, 0x31, 0x06, 0x48, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45,
0x06, 0x31, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0xCC, 0x06, 0x48, 0x06, 0x31,
0x06, 0x48, 0x06, 0xAF, 0x06, 0x48, 0x06, 0x26, 0x06, 0xD2,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x00, 0x7B, 0x00, 0x30, 0x00, 0x7D, 0x00, 0x20,
0x06, 0x45, 0x06, 0x39, 0x06, 0xCC, 0x06, 0x27, 0x06, 0x31,
0x06, 0xCC, 0x00, 0x20, 0x06, 0x48, 0x06, 0x42, 0x06, 0x2A,
0x00, 0x00, 0x06, 0x27, 0x06, 0x2A, 0x06, 0x2A, 0x06, 0x48,
0x06, 0x42, 0x06, 0x42, 0x06, 0x48, 0x06, 0x31, 0x06, 0x2A,
0x06, 0x48, 0x06, 0x31, 0x06, 0x45, 0x06, 0xCC, 0x06, 0x2A,
0x00, 0x00, 0x06, 0x27, 0x06, 0x41, 0x06, 0x3A, 0x06, 0x27,
0x06, 0x46, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27, 0x06, 0x46,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x28, 0x06, 0x46, 0x06, 0xAF, 0x06, 0x44,
0x06, 0xC1, 0x00, 0x20, 0x06, 0x2F, 0x06, 0xCC, 0x06, 0x34,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x48, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x32,
0x06, 0x48, 0x06, 0x26, 0x06, 0xCC, 0x06, 0x44, 0x06, 0x27,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0xAF, 0x06, 0x27, 0x06, 0x44, 0x06, 0x27,
0x06, 0x7E, 0x06, 0x27, 0x06, 0xAF, 0x06, 0x48, 0x06, 0x32,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x22, 0x06, 0x30, 0x06, 0x31, 0x06, 0x28,
0x06, 0x27, 0x06, 0x26, 0x06, 0xCC, 0x06, 0x2C, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x2A, 0x06, 0x31, 0x06, 0xA9,
0x06, 0x45, 0x06, 0x27, 0x06, 0x46, 0x06, 0x33, 0x06, 0x2A,
0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x2C, 0x06, 0x27,
0x06, 0x31, 0x06, 0x2C, 0x06, 0xCC, 0x06, 0x27, 0x00, 0x20,
0x06, 0x33, 0x06, 0x45, 0x06, 0x31, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x46,
0x06, 0xCC, 0x06, 0x48, 0x06, 0x32, 0x06, 0xCC, 0x00, 0x20,
0x06, 0x44, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x41, 0x06, 0x31, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x86,
0x00, 0x20, 0x06, 0xAF, 0x06, 0xCC, 0x06, 0x27, 0x06, 0x46,
0x06, 0x27, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x22, 0x06, 0x31, 0x06, 0x45,
0x06, 0xCC, 0x06, 0x46, 0x06, 0xCC, 0x06, 0x27, 0x00, 0x20,
0x06, 0x33, 0x06, 0x45, 0x06, 0x31, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x27,
0x06, 0xCC, 0x06, 0x45, 0x06, 0xCC, 0x06, 0x32, 0x06, 0x48,
0x06, 0x46, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x39, 0x06, 0x31, 0x06, 0x28, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x48, 0x06, 0x33,
0x06, 0x37, 0x06, 0xCC, 0x00, 0x20, 0x06, 0xCC, 0x06, 0x48,
0x06, 0x31, 0x06, 0x7E, 0x00, 0x20, 0x06, 0xA9, 0x06, 0x27,
0x00, 0x20, 0x06, 0x48, 0x06, 0x42, 0x06, 0x2A, 0x00, 0x00,
0x06, 0x7E, 0x06, 0x27, 0x06, 0xA9, 0x06, 0x33, 0x06, 0x2A,
0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45,
0x06, 0x31, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x86, 0x06, 0x44, 0x06, 0xCC,
0x00, 0x20, 0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46,
0x06, 0x88, 0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0xA9,
0x06, 0x48, 0x06, 0x44, 0x06, 0x45, 0x06, 0x28, 0x06, 0xCC,
0x06, 0x27, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0xAF, 0x06, 0x31, 0x06, 0xCC, 0x06, 0x46,
0x00, 0x20, 0x06, 0x48, 0x06, 0x86, 0x00, 0x20, 0x06, 0x45,
0x06, 0xCC, 0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x27, 0x06, 0x32,
0x06, 0x28, 0x06, 0xA9, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x27, 0x06, 0xCC, 0x06, 0x33, 0x06, 0x79,
0x06, 0x31, 0x00, 0x20, 0x06, 0x22, 0x06, 0x26, 0x06, 0x44,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x2E,
0x06, 0x44, 0x06, 0xCC, 0x06, 0x2C, 0x00, 0x20, 0x06, 0x33,
0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31,
0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x7E, 0x06, 0xCC, 0x06, 0x31,
0x06, 0x27, 0x06, 0xAF, 0x06, 0x48, 0x06, 0x26, 0x06, 0xD2,
0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x7E, 0x06, 0xCC, 0x06, 0x31, 0x06, 0x48, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0xCC, 0x06, 0x48,
0x06, 0x31, 0x06, 0x48, 0x06, 0xAF, 0x06, 0x48, 0x06, 0x26,
0x06, 0xD2, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x27, 0x06, 0x46, 0x06, 0x88, 0x06, 0xCC,
0x06, 0x27, 0x00, 0x20, 0x06, 0x33, 0x06, 0x79, 0x06, 0xCC,
0x06, 0x46, 0x06, 0x88, 0x06, 0x31, 0x06, 0x88, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x27, 0x06, 0xCC, 0x06, 0x31, 0x06, 0x27, 0x06, 0x46,
0x00, 0x20, 0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46,
0x06, 0x88, 0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x28,
0x06, 0x46, 0x06, 0xAF, 0x06, 0x44, 0x06, 0xC1, 0x00, 0x20,
0x06, 0x2F, 0x06, 0xCC, 0x06, 0x34, 0x00, 0x20, 0x06, 0x33,
0x06, 0x45, 0x06, 0x31, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x45, 0x06, 0xA9,
0x06, 0x48, 0x06, 0x22, 0x06, 0x31, 0x06, 0xCC, 0x00, 0x20,
0x06, 0x22, 0x06, 0x26, 0x06, 0x44, 0x06, 0xCC, 0x06, 0x46,
0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x22, 0x06, 0x30, 0x06, 0x31,
0x06, 0x28, 0x06, 0x27, 0x06, 0x26, 0x06, 0xCC, 0x06, 0x2C,
0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45,
0x06, 0x31, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x2A, 0x06, 0x31, 0x06, 0xA9,
0x06, 0x45, 0x06, 0x27, 0x06, 0x46, 0x06, 0x33, 0x06, 0x2A,
0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x33, 0x06, 0x45,
0x06, 0x31, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x2C, 0x06, 0x27, 0x06, 0x31,
0x06, 0x2C, 0x06, 0xCC, 0x06, 0x27, 0x00, 0x20, 0x06, 0x33,
0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31,
0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x45, 0x06, 0x34, 0x06, 0x31,
0x06, 0x42, 0x06, 0xCC, 0x00, 0x20, 0x06, 0x42, 0x06, 0x32,
0x06, 0x27, 0x06, 0x2E, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x45, 0x06, 0x3A, 0x06, 0x31,
0x06, 0x28, 0x06, 0xCC, 0x00, 0x20, 0x06, 0x42, 0x06, 0x32,
0x06, 0x27, 0x06, 0x2E, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x22, 0x06, 0x31, 0x06, 0x45,
0x06, 0xCC, 0x06, 0x46, 0x06, 0xCC, 0x06, 0x27, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x27, 0x06, 0x33,
0x06, 0x31, 0x06, 0x27, 0x06, 0x26, 0x06, 0xCC, 0x06, 0x44,
0x00, 0x20, 0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46,
0x06, 0x88, 0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x7E,
0x06, 0x27, 0x06, 0xA9, 0x06, 0x33, 0x06, 0x2A, 0x06, 0x27,
0x06, 0x46, 0x00, 0x20, 0x06, 0x33, 0x06, 0x79, 0x06, 0xCC,
0x06, 0x46, 0x06, 0x88, 0x06, 0x31, 0x06, 0x88, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0xA9, 0x06, 0x48, 0x06, 0x44, 0x06, 0x45, 0x06, 0x28,
0x06, 0xCC, 0x06, 0x27, 0x00, 0x20, 0x06, 0x33, 0x06, 0x79,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31, 0x06, 0x88,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x27, 0x06, 0x32, 0x06, 0x28, 0x06, 0xA9,
0x06, 0x33, 0x06, 0x2A, 0x06, 0x27, 0x06, 0x46, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x27, 0x06, 0xCC,
0x06, 0x33, 0x06, 0x79, 0x06, 0x31, 0x00, 0x20, 0x06, 0x22,
0x06, 0x26, 0x06, 0x44, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x00, 0x20, 0x06, 0x33, 0x06, 0x45, 0x06, 0x31, 0x00, 0x20,
0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00,
0x06, 0x28, 0x06, 0x31, 0x06, 0x27, 0x06, 0x32, 0x06, 0xCC,
0x06, 0x44, 0x06, 0xCC, 0x06, 0x27, 0x00, 0x20, 0x06, 0x33,
0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31,
0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x41, 0x06, 0x27, 0x06, 0xA9,
0x00, 0x20, 0x06, 0x44, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x00, 0x20, 0x06, 0x22, 0x06, 0x26, 0x06, 0x44, 0x06, 0xCC,
0x06, 0x46, 0x06, 0x88, 0x06, 0x32, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x7E,
0x06, 0xCC, 0x06, 0x31, 0x06, 0x27, 0x06, 0xAF, 0x06, 0x48,
0x06, 0x26, 0x06, 0xD2, 0x00, 0x20, 0x06, 0x33, 0x06, 0x79,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31, 0x06, 0x88,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0xCC, 0x06, 0x48, 0x06, 0x31, 0x06, 0x48,
0x06, 0xAF, 0x06, 0x48, 0x06, 0x26, 0x06, 0xD2, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x28, 0x06, 0x46,
0x06, 0xAF, 0x06, 0x44, 0x06, 0xC1, 0x00, 0x20, 0x06, 0x2F,
0x06, 0xCC, 0x06, 0x34, 0x00, 0x20, 0x06, 0x33, 0x06, 0x79,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31, 0x06, 0x88,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x41, 0x06, 0x31, 0x06, 0x46, 0x06, 0x27,
0x06, 0x46, 0x06, 0x88, 0x06, 0x48, 0x00, 0x20, 0x06, 0x88,
0x06, 0xCC, 0x00, 0x20, 0x06, 0x46, 0x06, 0x48, 0x06, 0x31,
0x06, 0x46, 0x06, 0xC1, 0x06, 0x27, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x22,
0x06, 0x30, 0x06, 0x31, 0x06, 0x28, 0x06, 0x27, 0x06, 0x26,
0x06, 0xCC, 0x06, 0x2C, 0x06, 0x27, 0x06, 0x46, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x2A, 0x06, 0x31,
0x06, 0xA9, 0x06, 0x45, 0x06, 0x27, 0x06, 0x46, 0x06, 0x33,
0x06, 0x2A, 0x06, 0x27, 0x06, 0x46, 0x00, 0x20, 0x06, 0x33,
0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31,
0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x46, 0x06, 0xCC, 0x06, 0x48,
0x06, 0x32, 0x06, 0xCC, 0x00, 0x20, 0x06, 0x44, 0x06, 0xCC,
0x06, 0x46, 0x06, 0x88, 0x00, 0x20, 0x06, 0x33, 0x06, 0x79,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31, 0x06, 0x88,
0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26, 0x06, 0x45,
0x00, 0x00, 0x06, 0x27, 0x06, 0xCC, 0x06, 0x33, 0x06, 0x79,
0x06, 0x31, 0x00, 0x20, 0x06, 0x22, 0x06, 0x26, 0x06, 0x44,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x00, 0x20, 0x06, 0x33,
0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x31,
0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27, 0x06, 0x26,
0x06, 0x45, 0x00, 0x00, 0x06, 0x41, 0x06, 0x27, 0x06, 0xA9,
0x00, 0x20, 0x06, 0x44, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x00, 0x20, 0x06, 0x22, 0x06, 0x26, 0x06, 0x44, 0x06, 0xCC,
0x06, 0x46, 0x06, 0x88, 0x06, 0x32, 0x00, 0x20, 0x06, 0x33,
0x06, 0x45, 0x06, 0x31, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x41, 0x06, 0x27,
0x06, 0xA9, 0x00, 0x20, 0x06, 0x44, 0x06, 0xCC, 0x06, 0x46,
0x06, 0x88, 0x00, 0x20, 0x06, 0x22, 0x06, 0x26, 0x06, 0x44,
0x06, 0xCC, 0x06, 0x46, 0x06, 0x88, 0x06, 0x32, 0x00, 0x20,
0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46, 0x06, 0x88,
0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79, 0x06, 0x27,
0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x06, 0x41, 0x06, 0x31,
0x06, 0x46, 0x06, 0x27, 0x06, 0x46, 0x06, 0x88, 0x06, 0x48,
0x00, 0x20, 0x06, 0x88, 0x06, 0xCC, 0x00, 0x20, 0x06, 0x46,
0x06, 0x48, 0x06, 0x31, 0x06, 0x46, 0x06, 0xC1, 0x06, 0x27,
0x00, 0x20, 0x06, 0x33, 0x06, 0x79, 0x06, 0xCC, 0x06, 0x46,
0x06, 0x88, 0x06, 0x31, 0x06, 0x88, 0x00, 0x20, 0x06, 0x79,
0x06, 0x27, 0x06, 0x26, 0x06, 0x45, 0x00, 0x00, 0x00, 0x01,
0x00, 0x22, 0x80, 0xC1, 0x00, 0x01, 0x00, 0x22, 0x81, 0x0F,
0x00, 0x01, 0x00, 0x22, 0x80, 0xD8, 0x00, 0x01, 0x00, 0x22,
0x80, 0xD1, 0x00, 0x01, 0x00, 0x22, 0x81, 0x19, 0x00, 0x01,
0x00, 0x22, 0x82, 0x43, 0x00, 0x01, 0x00, 0x22, 0x80, 0xCB,
0x00, 0x01, 0x00, 0x22, 0x80, 0xC6, 0x00, 0x01, 0x00, 0x22,
0x80, 0xE0, 0x00, 0x01, 0x15, 0x82, 0x82, 0x52, 0x00, 0x03,
0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x82, 0xF0, 0x81, 0x77,
0x5C, 0xBB, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82,
0x51, 0x19, 0x80, 0xE9, 0x83, 0x01, 0x00, 0x03, 0x15, 0xE6,
0x1B, 0xF2, 0x15, 0x82, 0x69, 0xBB, 0x5A, 0x5D, 0x7B, 0x41,
0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x82, 0xDF,
0x81, 0x5D, 0x84, 0x83, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2,
0x15, 0x82, 0x84, 0x1F, 0x82, 0x8E, 0x85, 0x89, 0x00, 0x03,
0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x83, 0xF9, 0x82, 0x61,
0x85, 0x5B, 0x00, 0x01, 0x15, 0x82, 0x81, 0x39, 0x00, 0x01,
0x15, 0x82, 0x81, 0x84, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2,
0x15, 0x82, 0x54, 0x3C, 0x44, 0x49, 0x85, 0x03, 0x00, 0x03,
0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x81, 0xB8, 0x80, 0xF2,
0x83, 0x34, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82,
0x83, 0x45, 0x3D, 0x74, 0x84, 0xC2, 0x00, 0x03, 0x15, 0xE6,
0x1B, 0xF2, 0x15, 0x82, 0x84, 0xED, 0x83, 0x79, 0x85, 0xD1,
0x00, 0x01, 0x15, 0x82, 0x81, 0xEE, 0x00, 0x03, 0x15, 0xE6,
0x1B, 0xF2, 0x15, 0x82, 0x80, 0xBF, 0x83, 0x12, 0x69, 0x43,
0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x85, 0xEB,
0x85, 0x19, 0x86, 0x05, 0x00, 0x01, 0x15, 0x82, 0x82, 0xCE,
0x00, 0x01, 0x15, 0x82, 0x83, 0x56, 0x00, 0x01, 0x15, 0x82,
0x82, 0x7F, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82,
0x82, 0xAE, 0x54, 0x9C, 0x84, 0x47, 0x00, 0x01, 0x15, 0x82,
0x83, 0x8B, 0x00, 0x01, 0x15, 0x82, 0x82, 0xD4, 0x00, 0x01,
0x15, 0x82, 0x83, 0xD3, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2,
0x15, 0x82, 0x57, 0x1B, 0x81, 0x23, 0x83, 0xE6, 0x00, 0x03,
0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x5C, 0xA6, 0x81, 0x6A,
0x84, 0x98, 0x00, 0x01, 0x15, 0x82, 0x84, 0x5B, 0x00, 0x01,
0x15, 0x82, 0x84, 0x6F, 0x00, 0x01, 0x15, 0x82, 0x81, 0xC5,
0x00, 0x01, 0x15, 0x82, 0x84, 0x0C, 0x00, 0x01, 0x15, 0x82,
0x81, 0x45, 0x00, 0x01, 0x15, 0x82, 0x81, 0x2E, 0x00, 0x03,
0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x69, 0x2B, 0x82, 0xBE,
0x85, 0xB9, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82,
0x7B, 0x09, 0x85, 0x72, 0x86, 0x23, 0x00, 0x03, 0x15, 0xE6,
0x1B, 0xF2, 0x15, 0x82, 0x83, 0x23, 0x81, 0xAB, 0x84, 0xAD,
0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x83, 0x9D,
0x82, 0x0A, 0x85, 0x2F, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2,
0x15, 0x82, 0x82, 0x18, 0x81, 0x05, 0x83, 0xAF, 0x00, 0x01,
0x15, 0x82, 0x81, 0x91, 0x00, 0x01, 0x15, 0x82, 0x81, 0x9E,
0x00, 0x01, 0x15, 0x82, 0x81, 0xFC, 0x00, 0x03, 0x15, 0xE6,
0x1B, 0xF2, 0x15, 0x82, 0x84, 0x33, 0x82, 0x9E, 0x85, 0xA1,
0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2, 0x15, 0x82, 0x83, 0xC1,
0x82, 0x26, 0x85, 0x45, 0x00, 0x03, 0x15, 0xE6, 0x1B, 0xF2,
0x15, 0x82, 0x83, 0x67, 0x81, 0xE0, 0x84, 0xD7, 0x00, 0x01,
0x15, 0x82, 0x82, 0x70, 0x00, 0x01, 0x15, 0x82, 0x81, 0x51,
0xAA, 0xAA, 0x00, 0x38, 0x03, 0x06, 0x07, 0xE3, 0x09, 0x97,
0x09, 0xA9, 0x09, 0xBB, 0x01, 0x7E, 0x0E, 0x2C, 0x10, 0xA1,
0x15, 0x96, 0x02, 0x9D, 0x1B, 0x8D, 0x1C, 0x07, 0x1C, 0x7E,
0x1C, 0x9A, 0x1C, 0xB1, 0x1D, 0x2F, 0x1D, 0x4B, 0x1D, 0x5B,
0x1D, 0x67, 0x1D, 0x74, 0x1D, 0xB9, 0x1D, 0xF9, 0x1E, 0x4A,
0x1E, 0x56, 0x1E, 0x63, 0x1E, 0xBB, 0x1E, 0xD3, 0x1E, 0xFB,
0x1F, 0x04, 0x1F, 0x20, 0x1F, 0x70, 0x1F, 0x7A, 0x1F, 0xB4,
0x20, 0x25, 0x20, 0x3C, 0x20, 0x62, 0x20, 0x7A, 0x20, 0xBA,
0x20, 0xEA, 0x21, 0x14, 0x21, 0xBE, 0x21, 0xDC, 0x22, 0x16,
0x22, 0x3E, 0x22, 0x6D, 0x22, 0x7B, 0x22, 0xF6, 0x23, 0x67,
0x23, 0x98, 0x23, 0xCA, 0x23, 0xE8, 0x23, 0xF5, 0x24, 0x12,
0x24, 0x41, 0x02, 0xCD, 0x02, 0xE2, 0xAA, 0xAA, 0x50, 0x00,
0x05, 0x82, 0x50, 0x00, 0x05, 0x85, 0x50, 0x00, 0x05, 0x88,
0x50, 0x00, 0x05, 0x8B, 0x50, 0x00, 0x05, 0x8E, 0x50, 0x00,
0x05, 0x91, 0x50, 0x00, 0x05, 0x94, 0x50, 0x00, 0x05, 0x97,
0x50, 0x00, 0x05, 0x9A, 0x60, 0x00, 0x05, 0xF8, 0x50, 0x00,
0x05, 0x9D, 0x50, 0x00, 0x05, 0xA0, 0x50, 0x00, 0x05, 0xA7,
0x50, 0x00, 0x05, 0xAE, 0x50, 0x00, 0x05, 0xB5, 0x50, 0x00,
0x05, 0xBC, 0x50, 0x00, 0x05, 0xC3, 0x50, 0x00, 0x05, 0xCA,
0x50, 0x00, 0x05, 0xCD, 0x50, 0x00, 0x05, 0xD0, 0x50, 0x00,
0x05, 0xD7, 0x50, 0x00, 0x05, 0xDE, 0x50, 0x00, 0x05, 0xE5,
0x50, 0x00, 0x05, 0xEC, 0x50, 0x00, 0x05, 0xEF, 0x50, 0x00,
0x05, 0xF6, 0x50, 0x00, 0x05, 0xFD, 0x50, 0x00, 0x06, 0x00,
0x50, 0x00, 0x06, 0x03, 0x50, 0x00, 0x06, 0x06, 0x50, 0x00,
0x06, 0x0D, 0x50, 0x00, 0x06, 0x10, 0x50, 0x00, 0x06, 0x13,
0x50, 0x00, 0x06, 0x16, 0x50, 0x00, 0x06, 0x1D, 0x50, 0x00,
0x06, 0x24, 0x50, 0x00, 0x06, 0x27, 0x50, 0x00, 0x06, 0x2A,
0x50, 0x00, 0x06, 0x2D, 0x50, 0x00, 0x06, 0x30, 0x50, 0x00,
0x06, 0x33, 0x50, 0x00, 0x06, 0x36, 0x50, 0x00, 0x06, 0x3D,
0x50, 0x00, 0x06, 0x44, 0x50, 0x00, 0x06, 0x4B, 0x50, 0x00,
0x06, 0x52, 0x50, 0x00, 0x06, 0x59, 0x50, 0x00, 0x06, 0x5C,
0x50, 0x00, 0x06, 0x5F, 0x50, 0x00, 0x06, 0x62, 0x50, 0x00,
0x06, 0x69, 0x50, 0x00, 0x06, 0x70, 0x50, 0x00, 0x06, 0x77,
0x50, 0x00, 0x06, 0x7A, 0x60, 0x00, 0x81, 0xD2, 0x60, 0x00,
0x82, 0x34, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xAA, 0xAA,
0x60, 0x00, 0x80, 0xFB, 0x20, 0x00, 0x03, 0x48, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
};
J2OBJC_RESOURCE(\
_com_ibm_icu_impl_data_icudt58b_zone_ur_IN_res, \
3760, \
0x8ddec9bc);
#endif
| 60.470588 | 65 | 0.647818 |
aa027402e286c101b2aa9efbdac8930c6ff18055 | 3,133 | h | C | StatisticsModule.h | VeronikaDmytryk/UserAuthentificationController | 3471e933c8b2b2fc394e4f4143405442ed5bb23f | [
"MIT"
] | 1 | 2019-12-15T07:32:12.000Z | 2019-12-15T07:32:12.000Z | StatisticsModule.h | VeronikaDmytryk/UserAuthentificationController | 3471e933c8b2b2fc394e4f4143405442ed5bb23f | [
"MIT"
] | null | null | null | StatisticsModule.h | VeronikaDmytryk/UserAuthentificationController | 3471e933c8b2b2fc394e4f4143405442ed5bb23f | [
"MIT"
] | null | null | null | /*
Author: Veronika Dmytryk
Date: Fall 2019
Description: A definition of StatisticsModule class for Autentication Controller
*/
#ifndef STATISTICS_H
#define STATISTICS_H
#include <iostream>
#include <list>
using namespace std;
// a struct defined user statistic object
struct userStatistics{
string username;
int passwordsCount;
// constructor
userStatistics(string _username = "EMPTY", int passwords = 0) {
username = _username;
passwordsCount = passwords;
}
// overriding operator==, for comparing userStatistics object only fy username
friend bool operator==(const userStatistics &a, const userStatistics &b) {
return a.username == b.username;
}
};
class StatisticsModule {
private:
list<userStatistics> registrationStatistics; // list to hold registered users data
public:
// adds user to the statistics list
void addUser(string username) {
userStatistics newUser(username, 1);
registrationStatistics.push_back(newUser);
}
// removes user from the statistics list
void removeUser(string username) {
userStatistics userToRemove(username);
registrationStatistics.remove(userToRemove);
}
// user returns number of stored passwords, or 0 if user is not registered
int getPasswords(string username) {
userStatistics user(username);
list<userStatistics>::iterator iter = find(registrationStatistics.begin(), registrationStatistics.end(), user);
if (registrationStatistics.end() == iter ) {
return 0;
} else {
return iter->passwordsCount;
}
}
// increments the number of passwords for specific user
int incrementPasswords(string username) {
userStatistics user(username);
list<userStatistics>::iterator iter = find(registrationStatistics.begin(), registrationStatistics.end(), user);
if (registrationStatistics.end() == iter ) {
return 0;
} else {
iter->passwordsCount = iter->passwordsCount + 1;
return 1;
}
}
// returns the number of registered users
int getNumberOfRegisteredUsers() {
return registrationStatistics.size();
}
// prints all user - passwords pairs
void printAllUsers() {
cout<<endl<<"Username - Passwords Statistics"<<endl;
cout<<"---------------------------------"<<endl;
for(list<userStatistics>::iterator it = registrationStatistics.begin(); it != registrationStatistics.end(); ++it){
cout<<it->username<<": "<<it->passwordsCount<<endl;
}
}
// Iterator functions for RegistrationModule
list<userStatistics>::iterator begin() {
return registrationStatistics.begin();
}
list<userStatistics>::iterator end() {
return registrationStatistics.end();
}
};
#endif | 32.978947 | 126 | 0.603894 |
6f77c57db9a15c912ccc06400cde80d175d15704 | 3,657 | h | C | apps/digit_recognition/firmware/src/config/sam_e51_igat/gfx/legato/generated/screen/le_gen_screen_CkrScrn1.h | Microchip-MPLAB-Harmony/tflite-micro-apps | af7664f319c43a8dc9949430757d93d8ab597abb | [
"BSD-3-Clause-Attribution"
] | null | null | null | apps/digit_recognition/firmware/src/config/sam_e51_igat/gfx/legato/generated/screen/le_gen_screen_CkrScrn1.h | Microchip-MPLAB-Harmony/tflite-micro-apps | af7664f319c43a8dc9949430757d93d8ab597abb | [
"BSD-3-Clause-Attribution"
] | null | null | null | apps/digit_recognition/firmware/src/config/sam_e51_igat/gfx/legato/generated/screen/le_gen_screen_CkrScrn1.h | Microchip-MPLAB-Harmony/tflite-micro-apps | af7664f319c43a8dc9949430757d93d8ab597abb | [
"BSD-3-Clause-Attribution"
] | 1 | 2022-01-25T08:45:11.000Z | 2022-01-25T08:45:11.000Z | #ifndef LE_GEN_SCREEN_CKRSCRN1_H
#define LE_GEN_SCREEN_CKRSCRN1_H
#include "gfx/legato/legato.h"
#include "gfx/legato/generated/le_gen_scheme.h"
#include "gfx/legato/generated/le_gen_assets.h"
// DOM-IGNORE-BEGIN
#ifdef __cplusplus // Provide C++ Compatibility
extern "C" {
#endif
// DOM-IGNORE-END
// screen member widget declarations
extern leWidget* CkrScrn1_PanelWidget1;
extern leImageWidget* CkrScrn1_ImageWidget1;
extern leWidget* CkrScrn1_PanelWidget3;
extern leWidget* CkrScrn1_MainPanel;
extern leImageWidget* CkrScrn1_ImageWidget2;
extern leImageWidget* CkrScrn1_ImageWidget3;
extern leImageWidget* CkrScrn1_ImageWidget4;
extern leWidget* CkrScrn1_Badge;
extern leWidget* CkrScrn1_ClockPanel;
extern leImageWidget* CkrScrn1_ImageWidget8;
extern leWidget* CkrScrn1_PanelWidget0;
extern leButtonWidget* CkrScrn1_ButtonWidget0;
extern leButtonWidget* CkrScrn1_DemoModeOnButton;
extern leImageWidget* CkrScrn1_ImageWidget7;
extern leButtonWidget* CkrScrn1_HomeButton;
extern leImageWidget* CkrScrn1_ImageWidget5;
extern leLabelWidget* CkrScrn1_FPSLabel;
extern leListWheelWidget* CkrScrn1_ListWheelWidget2;
extern leButtonWidget* CkrScrn1_ReheatButton;
extern leButtonWidget* CkrScrn1_BroilButton;
extern leButtonWidget* CkrScrn1_CookButton;
extern leButtonWidget* CkrScrn1_BakeButton;
extern leLabelWidget* CkrScrn1_LabelWidget1;
extern leLabelWidget* CkrScrn1_LabelWidget3;
extern leLabelWidget* CkrScrn1_LabelWidget0;
extern leLabelWidget* CkrScrn1_HourLabel;
extern leImageWidget* CkrScrn1_ImageWidget6;
extern leLabelWidget* CkrScrn1_ColonLabel;
extern leLabelWidget* CkrScrn1_MinuteLabel;
extern leImageWidget* CkrScrn1_ImageWidget0;
extern leProgressBarWidget* CkrScrn1_ProgressBarWidget0;
extern leImageWidget* CkrScrn1_ModeImageWidget;
extern leRectangleWidget* CkrScrn1_RectangleWidget3;
extern leRectangleWidget* CkrScrn1_RectangleWidget2;
extern leRectangleWidget* CkrScrn1_RectangleWidget1;
extern leRectangleWidget* CkrScrn1_RectangleWidget0;
extern leLabelWidget* CkrScrn1_CookTimeLabel;
extern leButtonWidget* CkrScrn1_RestartButton;
extern leButtonWidget* CkrScrn1_SliderButton0;
extern leButtonWidget* CkrScrn1_CancelButton;
// event handlers
// !!THESE MUST BE IMPLEMENTED IN THE APPLICATION CODE!!
void event_CkrScrn1_ButtonWidget0_OnReleased(leButtonWidget* btn);
void event_CkrScrn1_HomeButton_OnPressed(leButtonWidget* btn);
void event_CkrScrn1_ListWheelWidget2_OnSelectionChanged(leListWheelWidget* wgt, int32_t idx);
void event_CkrScrn1_ReheatButton_OnReleased(leButtonWidget* btn);
void event_CkrScrn1_BroilButton_OnReleased(leButtonWidget* btn);
void event_CkrScrn1_CookButton_OnReleased(leButtonWidget* btn);
void event_CkrScrn1_BakeButton_OnReleased(leButtonWidget* btn);
void event_CkrScrn1_RestartButton_OnReleased(leButtonWidget* btn);
void event_CkrScrn1_CancelButton_OnReleased(leButtonWidget* btn);
// screen lifecycle functions
// DO NOT CALL THESE DIRECTLY
leResult screenInit_CkrScrn1(void); // called when Legato is initialized
leResult screenShow_CkrScrn1(void); // called when screen is shown
void screenHide_CkrScrn1(void); // called when screen is hidden
void screenDestroy_CkrScrn1(void); // called when Legato is destroyed
void screenUpdate_CkrScrn1(void); // called when Legato is updating
leWidget* screenGetRoot_CkrScrn1(uint32_t lyrIdx); // gets a root widget for this screen
// Screen Events:
void CkrScrn1_OnShow(void); // called when this screen is shown
void CkrScrn1_OnHide(void); // called when this screen is hidden
void CkrScrn1_OnUpdate(void); // called when this screen is updated
//DOM-IGNORE-BEGIN
#ifdef __cplusplus
}
#endif
//DOM-IGNORE-END
#endif // LE_GEN_SCREEN_CKRSCRN1_H
| 40.186813 | 93 | 0.853979 |
6f9c0af5e3417d59101c2e0ea53be997a887085d | 3,977 | h | C | usr.sbin/ppp/prompt.h | TrustedBSD/sebsd | fd5de6f587183087cf930779701d5713e8ca64cc | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2017-04-06T21:39:15.000Z | 2019-10-09T17:34:14.000Z | usr.sbin/ppp/prompt.h | TrustedBSD/sebsd | fd5de6f587183087cf930779701d5713e8ca64cc | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | usr.sbin/ppp/prompt.h | TrustedBSD/sebsd | fd5de6f587183087cf930779701d5713e8ca64cc | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-01-04T06:36:39.000Z | 2020-01-04T06:36:39.000Z | /*-
* Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: src/usr.sbin/ppp/prompt.h,v 1.10 2002/08/27 20:11:58 brian Exp $
*/
#define LOCAL_AUTH 0x01
#define LOCAL_NO_AUTH 0x02
#define LOCAL_DENY 0x03
#define LOCAL_CX 0x04 /* OR'd value - require a context */
#define LOCAL_CX_OPT 0x08 /* OR'd value - optional context */
struct server;
struct datalink;
struct bundle;
struct cmdargs;
struct prompt {
struct fdescriptor desc;
int fd_in, fd_out;
struct datalink *TermMode; /* The modem we're talking directly to */
FILE *Term; /* sits on top of fd_out */
u_char auth; /* Local Authorized status */
struct server *owner; /* who created me */
struct bundle *bundle; /* who I'm controlling */
unsigned nonewline : 1; /* need a newline before our prompt ? */
unsigned needprompt : 1; /* Show a prompt at the next UpdateSet() */
unsigned active : 1; /* Is the prompt active (^Z) */
unsigned readtilde : 1; /* We've read a ``~'' from fd_in */
struct {
const char *type; /* Type of connection */
char from[40]; /* Source of connection */
} src;
struct prompt *next; /* Maintained in log.c */
u_long logmask; /* Maintained in log.c */
struct termios oldtio; /* Original tty mode */
struct termios comtio; /* Command level tty mode */
};
#define descriptor2prompt(d) \
((d)->type == PROMPT_DESCRIPTOR ? (struct prompt *)(d) : NULL)
#define PROMPT_STD (-1)
extern struct prompt *prompt_Create(struct server *, struct bundle *, int);
extern void prompt_Destroy(struct prompt *, int);
extern void prompt_Required(struct prompt *);
#ifdef __GNUC__
extern void prompt_Printf(struct prompt *, const char *, ...)
__attribute__ ((format (printf, 2, 3)));
#else
extern void prompt_Printf(struct prompt *, const char *, ...);
#endif
#ifdef __GNUC__
extern void prompt_vPrintf(struct prompt *, const char *, va_list)
__attribute__ ((format (printf, 2, 0)));
#else
extern void prompt_vPrintf(struct prompt *, const char *, va_list);
#endif
#define PROMPT_DONT_WANT_INT 1
#define PROMPT_WANT_INT 0
extern void prompt_TtyInit(struct prompt *);
extern void prompt_TtyCommandMode(struct prompt *);
extern void prompt_TtyTermMode(struct prompt *, struct datalink *);
extern void prompt_TtyOldMode(struct prompt *);
extern pid_t prompt_pgrp(struct prompt *);
extern int PasswdCommand(struct cmdargs const *);
extern void prompt_Suspend(struct prompt *);
extern void prompt_Continue(struct prompt *);
#define prompt_IsTermMode(p, dl) ((p)->TermMode == (dl) ? 1 : 0)
#define prompt_IsController(p) (!(p) || (p)->owner ? 0 : 1)
#define prompt_Required(p) ((p)->needprompt = 1)
| 41 | 77 | 0.719638 |
a58d56f639e7c02643c7306ce7fcba96bd92d793 | 844 | h | C | gstd/src/Table.h | georgephilipp/cppgstd_legacy | e130860da7700aae42b915bc36a7efa4cae06d56 | [
"MIT"
] | null | null | null | gstd/src/Table.h | georgephilipp/cppgstd_legacy | e130860da7700aae42b915bc36a7efa4cae06d56 | [
"MIT"
] | null | null | null | gstd/src/Table.h | georgephilipp/cppgstd_legacy | e130860da7700aae42b915bc36a7efa4cae06d56 | [
"MIT"
] | null | null | null | /*
* File: Table.h
* Author: gschoenh
*
* Created on December 6, 2013, 1:37 PM
*/
#include "stdafx.h"
#ifndef TABLE_H
#define TABLE_H
#include"standard.h"
namespace msii810161816
{
namespace gstd
{
template<typename datatypename>
class Table
{
public:
Table() {}
//Table(const Table& orig);
virtual ~Table() {}
std::vector<std::vector<datatypename> > content;
Table(std::vector<datatypename> col)
{
int size = col.size();
content.resize(size);
for(int i=0;i<size;i++)
content[i].push_back(col[i]);
}
private:
};
}
}
#endif /* TABLE_H */
| 18.347826 | 60 | 0.441943 |
024b3f6a65d817779544fb352d1f25d63ec37ad5 | 1,568 | h | C | SDKs/CryCode/3.8.1/CryEngine/CryAction/MaterialEffects/MFXFlowGraphEffect.h | amrhead/FireNET | 34d439aa0157b0c895b20b2b664fddf4f9b84af1 | [
"BSD-2-Clause"
] | 4 | 2017-12-18T20:10:16.000Z | 2021-02-07T21:21:24.000Z | SDKs/CryCode/3.8.1/CryEngine/CryAction/MaterialEffects/MFXFlowGraphEffect.h | amrhead/FireNET | 34d439aa0157b0c895b20b2b664fddf4f9b84af1 | [
"BSD-2-Clause"
] | null | null | null | SDKs/CryCode/3.8.1/CryEngine/CryAction/MaterialEffects/MFXFlowGraphEffect.h | amrhead/FireNET | 34d439aa0157b0c895b20b2b664fddf4f9b84af1 | [
"BSD-2-Clause"
] | 3 | 2019-03-11T21:36:15.000Z | 2021-02-07T21:21:26.000Z | ////////////////////////////////////////////////////////////////////////////
//
// Crytek Engine Source File.
// Copyright (C), Crytek Studios, 2006.
// -------------------------------------------------------------------------
// File name: MFXFlowGraphEffect.h
// Version: v1.00
// Created: 29/11/2006 by AlexL-Benito GR
// Compilers: Visual Studio.NET
// Description:
// -------------------------------------------------------------------------
// History:
//
////////////////////////////////////////////////////////////////////////////
#ifndef __MFXFLOWGRAPHEFFECT_H__
#define __MFXFLOWGRAPHEFFECT_H__
#pragma once
#include "MFXEffectBase.h"
struct SMFXFlowGraphParams
{
static const int MAX_CUSTOM_PARAMS = 4;
string fgName;
float maxdistSq; // max distance (squared) for spawning this effect
float params[MAX_CUSTOM_PARAMS];
SMFXFlowGraphParams()
{
maxdistSq = 0.0f;
memset(¶ms, 0, sizeof(params));
}
};
class CMFXFlowGraphEffect :
public CMFXEffectBase
{
public:
CMFXFlowGraphEffect();
virtual ~CMFXFlowGraphEffect();
//IMFXEffect
virtual void Execute(const SMFXRunTimeEffectParams& params) override;
virtual void LoadParamsFromXml(const XmlNodeRef& paramsNode) override;
virtual void SetCustomParameter(const char* customParameter, const SMFXCustomParamValue& customParameterValue) override;
virtual void GetResources(SMFXResourceList& resourceList) const override;
virtual void GetMemoryUsage( ICrySizer *pSizer ) const override;
//~IMFXEffect
private:
SMFXFlowGraphParams m_flowGraphParams;
};
#endif
| 28 | 121 | 0.614158 |
e2e1848bb1ecaa6cf79f14db6d5a8c6e24ed4cf9 | 8,251 | h | C | Player.h | ahadrauf/magician_wars | a9b43ce520fc528b470aec10437f79dbd951547b | [
"MIT"
] | null | null | null | Player.h | ahadrauf/magician_wars | a9b43ce520fc528b470aec10437f79dbd951547b | [
"MIT"
] | null | null | null | Player.h | ahadrauf/magician_wars | a9b43ce520fc528b470aec10437f79dbd951547b | [
"MIT"
] | null | null | null | #pragma once
#include "Person.h"
#include "Enemy.h"
#include "List.h"
#include "Item.h"
#include "Skill.h"
#include <iomanip>
class Player : public Person
{
public:
Player(string n, int l = 1, int h = 50, int m = 30, int aP = 12, int dP = 8, int mA = 12, int mD = 7, int e = 0, int mo = 500)
: Person(n, l, h, m, aP, dP, mA, mD), money(mo), exp(e) //accepts default arguments
{
addSkill(Fireball());
equipHelm(OldHelm());
equipWeapon(OldSword());
equipArmor(OldVest());
}
void addSkill(Skill s)
{
skills.insertAtBack(new Skill(s));
}
void addItem(Item i)
{
items.insert(new Item(i));
}
bool useSkill(Skill &s, Enemy &e)
{
return s.useSkill(this, &e);
}
bool useItem(Item *i, Enemy &e)
{
if (items.deleteElement(i)) //checks if item is in inventory
{
i->performEffect(this, &e); //if it is, perform effect
return true;
}
else //if it isn't, return false
{
cout << "The item " << i->getName() << " was not in your inventory" << endl;
return false;
}
}
int getEXP() { return exp; }
int getMoney() { return money; }
void receiveEXP(Enemy &e) //receives exp and levels up if exp >= 100
{
int add = 35 * e.getLevel();
if (add > 80)
add = 80 + e.getLevel() / 3;
cout << "You got " << add << " EXP!" << endl;
exp += add;
if (exp >= 100)
{
Person temp = *this;
increaseLevel();
exp -= 100;
if (getLevel() == 5)
addSkill(FireStorm());
if (getLevel() == 10)
addSkill(LavaPlume());
cout << endl;
cout << "You leveled up!" << endl;
cout << "HP + " << getHP() - temp.getHP() << endl;
cout << "MP + " << getMP() - temp.getMP() << endl;
cout << "ATK + " << getPhysicalAttack() - temp.getPhysicalAttack() << endl;
cout << "DEF + " << getPhysicalDefense() - temp.getPhysicalDefense() << endl;
cout << "MAG + " << getMagicalAttack() - temp.getMagicalAttack() << endl;
cout << "RES + " << getMagicalDefense() - temp.getMagicalDefense() << endl << endl;
}
}
void receiveMoney(Enemy &e) //receives money
{
int add = e.getLevel() * 50;
cout << "You got " << add << " coins!" << endl;
money += add;
}
//normal item/skill displays
void displayItemList()
{
items.print();
}
void displaySkillList()
{
skills.print();
}
bool isPlayer(Person *obj)
{
Player *p = dynamic_cast<Player *>(obj);
return p ? true : false;
}
//uses polymorphism to unequip/equip helms/weapons/armor
void equipHelm(Equip &e)
{
if (helm)
unequipHelm(*helm);
e.equipItem(this);
helm = new Equip(e);
}
void equipWeapon(Equip &e)
{
if (weapon)
unequipWeapon(*weapon);
e.equipItem(this);
weapon = new Equip(e);
}
void equipArmor(Equip &e)
{
if (armor)
unequipArmor(*armor);
e.equipItem(this);
armor = new Equip(e);
}
void unequipHelm(Equip &e)
{
e.unequipItem(this);
}
void unequipWeapon(Equip &e)
{
e.unequipItem(this);
}
void unequipArmor(Equip &e)
{
e.unequipItem(this);
}
//uses polymorphism to add items based on item type (normal / equip)
bool addItemMain()
{
int choice = displayMenu();
if (choice == 16)
return false;
system("cls");
Item *i = getItem(choice);
Equip *e = dynamic_cast<Equip *>(i);
if (e)
{
Helm *h = dynamic_cast<Helm *>(e);
Sword *s = dynamic_cast<Sword *>(e);
Vest *v = dynamic_cast<Vest *>(e);
if (h)
equipHelm(*h);
else if (s)
equipWeapon(*s);
else if (v)
equipArmor(*v);
}
else
addItem(*i);
cout << "You got a " << i->getName() << "!\n\n";
system("pause");
system("cls");
return true;
}
//uses item from items list
bool useItemMain(Enemy &e)
{
displayItemList();
if (items.getSize() == 0)
{
system("pause");
return false;
}
int choice;
cout << "Enter the number of the item in the list (1 - " << items.getSize() << ") or enter -1 to quit: ";
cin >> choice;
if (choice == -1)
return false;
while (choice < 0 || choice > items.getSize())
{
cout << "Enter a number from 1 to " << items.getSize() << ": ";
cin >> choice;
}
//uses the item
string name = items[choice]->getName();
if (name == "Potion")
useItem(new Potion(), e);
else if (name == "Hi-Potion")
useItem(new HiPotion(), e);
else if (name == "Full Potion")
useItem(new FullPotion(), e);
else if (name == "Ether")
useItem(new Ether(), e);
else if (name == "Hi-Ether")
useItem(new HiEther(), e);
else if (name == "Full Ether")
useItem(new FullEther(), e);
else if (name == "Bomb")
useItem(new Bomb(), e);
cout << "You used a " << name << "!" << endl;
system("pause");
system("cls");
return true;
}
//displays skills --> user chooses one to use
bool useSkillMain(Enemy &e)
{
cout << "MP Remaining: " << getMP() << endl << endl;
for (int i = 1; i <= skills.getSize(); i++)
{
cout << i << " - " << skills[i]->getName() << "\t\t" << skills[i]->getDescription() << "\t\t" << skills[i]->getMPCost() << endl;
}
cout << (skills.getSize() + 1) << " - Quit" << endl;
int choice;
do
{
cout << "Enter a skill to use (1 - " << skills.getSize() << ") or press " << (skills.getSize() + 1) << " to quit: ";
cin >> choice;
} while (choice < 0 || choice > skills.getSize() + 1);
system("cls");
if (choice == skills.getSize() + 1)
return false;
else
return useSkill(*getSkill(choice), e);
}
//standard menu for items
int displayMenu()
{
bool valid = true;
int choice;
Item *i;
do
{
cout << "Money: " << money << endl << endl;
for (int c = 1; c <= 15; c++)
{
cout << setw(2) << left << c << " - " << setw(20) << left << getItem(c)->getName() <<
setw(40) << left << getItem(c)->getDescription() << setw(5) << left << getItem(c)->getCost() << endl;
}
cout << "16 - Exit" << endl << endl;
cout << "Enter the number of the item (1-16): ";
cin >> choice;
i = getItem(choice);
if (i != NULL)
{
if (money < i->getCost())
{
valid = false;
system("cls");
cout << "You don't have enough money for this item." << endl << endl;
}
else
{
valid = true;
system("cls");
}
}
} while ((choice < 0 || choice > 16) || !valid);
if (i != NULL)
money -= i->getCost(); //subtracts money
return choice;
}
//facilitates getting items (composition works better than inheritance, and menu systems use numbers)
Item *getItem(const int &n)
{
switch (n)
{
case 1: return new Potion();;
case 2: return new HiPotion();
case 3: return new FullPotion();
case 4: return new Ether();
case 5: return new HiEther();
case 6: return new FullEther();
case 7: return new Bomb();
case 8: return new HardHelm();
case 9: return new SharpSword();
case 10: return new OldStaff();
case 11: return new LeatherVest();
case 12: return new LegendaryHat();
case 13: return new LegendaryKatana();
case 14: return new LegendaryCoat();
case 15: return new LegendaryWand();
default: return NULL;
}
}
Skill *getSkill(const int &n)
{
switch (n)
{
case 1: return new Fireball();
case 2: return new FireStorm();
case 3: return new LavaPlume();
default: return NULL;
}
}
//for main function
void displayEquips()
{
cout << setw(20) << left << "Name" << setw(30) << left << "Description" << setw(4) << left << "ATK" << setw(4) << "DEF" <<
setw(4) << "MAG" << setw(4) << "RES" << endl;
cout << setw(20) << left << ("Helm: " + helm->getName()) << setw(30) << left << helm->getDescription() <<
setw(4) << left << helm->getAtk() << setw(4) << helm->getDef() << setw(4) << helm->getMag() << setw(4) << helm->getRes() << endl;
cout << setw(20) << left << ("Sword: " + weapon->getName()) << setw(30) << left << weapon->getDescription() <<
setw(4) << left << weapon->getAtk() << setw(4) << weapon->getDef() << setw(4) << weapon->getMag() << setw(4) << weapon->getRes() << endl;
cout << setw(20) << left << ("Armor: " + armor->getName()) << setw(30) << left << armor->getDescription() <<
setw(4) << left << armor->getAtk() << setw(4) << armor->getDef() << setw(4) << armor->getMag() << setw(4) << armor->getRes() << endl;
system("pause");
system("cls");
}
private:
List<Item *> items;
List<Skill *> skills;
Equip *helm = NULL;
Equip *weapon = NULL;
Equip *armor = NULL;
int money;
int exp;
}; | 25.232416 | 140 | 0.575203 |
53be0475979c54ded161e3746ef269bc5c4e25de | 474 | h | C | DamageAnalysisApp.h | Htresnal/DamageAnalysisTool | b6330c1c53243e6dc9b3f318ec87e1f3408763e5 | [
"MIT"
] | null | null | null | DamageAnalysisApp.h | Htresnal/DamageAnalysisTool | b6330c1c53243e6dc9b3f318ec87e1f3408763e5 | [
"MIT"
] | null | null | null | DamageAnalysisApp.h | Htresnal/DamageAnalysisTool | b6330c1c53243e6dc9b3f318ec87e1f3408763e5 | [
"MIT"
] | null | null | null | /***************************************************************
* Name: DamageAnalysisApp.h
* Purpose: Defines Application Class
* Author: ()
* Created: 2016-02-05
* Copyright: ()
* License:
**************************************************************/
#ifndef DAMAGEANALYSISAPP_H
#define DAMAGEANALYSISAPP_H
#include <wx/app.h>
class DamageAnalysisApp : public wxApp
{
public:
virtual bool OnInit();
};
#endif // DAMAGEANALYSISAPP_H
| 21.545455 | 64 | 0.489451 |
8506748ae035f5df791ae75d534ab1c221b84db5 | 14,713 | h | C | release/src-rt-6.x.4708/router/mysql/storage/innodb_plugin/include/fsp0fsp.h | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 278 | 2015-11-03T03:01:20.000Z | 2022-01-20T18:21:05.000Z | release/src-rt-6.x.4708/router/mysql/storage/innodb_plugin/include/fsp0fsp.h | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 374 | 2015-11-03T12:37:22.000Z | 2021-12-17T14:18:08.000Z | release/src-rt-6.x.4708/router/mysql/storage/innodb_plugin/include/fsp0fsp.h | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 96 | 2015-11-22T07:47:26.000Z | 2022-01-20T19:52:19.000Z | /*****************************************************************************
Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
/**************************************************//**
@file include/fsp0fsp.h
File space management
Created 12/18/1995 Heikki Tuuri
*******************************************************/
#ifndef fsp0fsp_h
#define fsp0fsp_h
#include "univ.i"
#include "mtr0mtr.h"
#include "fut0lst.h"
#include "ut0byte.h"
#include "page0types.h"
#include "fsp0types.h"
/**********************************************************************//**
Initializes the file space system. */
UNIV_INTERN
void
fsp_init(void);
/*==========*/
/**********************************************************************//**
Gets the current free limit of the system tablespace. The free limit
means the place of the first page which has never been put to the
free list for allocation. The space above that address is initialized
to zero. Sets also the global variable log_fsp_current_free_limit.
@return free limit in megabytes */
UNIV_INTERN
ulint
fsp_header_get_free_limit(void);
/*===========================*/
/**********************************************************************//**
Gets the size of the system tablespace from the tablespace header. If
we do not have an auto-extending data file, this should be equal to
the size of the data files. If there is an auto-extending data file,
this can be smaller.
@return size in pages */
UNIV_INTERN
ulint
fsp_header_get_tablespace_size(void);
/*================================*/
/**********************************************************************//**
Reads the file space size stored in the header page.
@return tablespace size stored in the space header */
UNIV_INTERN
ulint
fsp_get_size_low(
/*=============*/
page_t* page); /*!< in: header page (page 0 in the tablespace) */
/**********************************************************************//**
Reads the space id from the first page of a tablespace.
@return space id, ULINT UNDEFINED if error */
UNIV_INTERN
ulint
fsp_header_get_space_id(
/*====================*/
const page_t* page); /*!< in: first page of a tablespace */
/**********************************************************************//**
Reads the space flags from the first page of a tablespace.
@return flags */
UNIV_INTERN
ulint
fsp_header_get_flags(
/*=================*/
const page_t* page); /*!< in: first page of a tablespace */
/**********************************************************************//**
Reads the compressed page size from the first page of a tablespace.
@return compressed page size in bytes, or 0 if uncompressed */
UNIV_INTERN
ulint
fsp_header_get_zip_size(
/*====================*/
const page_t* page); /*!< in: first page of a tablespace */
/**********************************************************************//**
Writes the space id and compressed page size to a tablespace header.
This function is used past the buffer pool when we in fil0fil.c create
a new single-table tablespace. */
UNIV_INTERN
void
fsp_header_init_fields(
/*===================*/
page_t* page, /*!< in/out: first page in the space */
ulint space_id, /*!< in: space id */
ulint flags); /*!< in: tablespace flags (FSP_SPACE_FLAGS):
0, or table->flags if newer than COMPACT */
/**********************************************************************//**
Initializes the space header of a new created space and creates also the
insert buffer tree root if space == 0. */
UNIV_INTERN
void
fsp_header_init(
/*============*/
ulint space, /*!< in: space id */
ulint size, /*!< in: current size in blocks */
mtr_t* mtr); /*!< in: mini-transaction handle */
/**********************************************************************//**
Increases the space size field of a space. */
UNIV_INTERN
void
fsp_header_inc_size(
/*================*/
ulint space, /*!< in: space id */
ulint size_inc,/*!< in: size increment in pages */
mtr_t* mtr); /*!< in: mini-transaction handle */
/**********************************************************************//**
Creates a new segment.
@return the block where the segment header is placed, x-latched, NULL
if could not create segment because of lack of space */
UNIV_INTERN
buf_block_t*
fseg_create(
/*========*/
ulint space, /*!< in: space id */
ulint page, /*!< in: page where the segment header is placed: if
this is != 0, the page must belong to another segment,
if this is 0, a new page will be allocated and it
will belong to the created segment */
ulint byte_offset, /*!< in: byte offset of the created segment header
on the page */
mtr_t* mtr); /*!< in: mtr */
/**********************************************************************//**
Creates a new segment.
@return the block where the segment header is placed, x-latched, NULL
if could not create segment because of lack of space */
UNIV_INTERN
buf_block_t*
fseg_create_general(
/*================*/
ulint space, /*!< in: space id */
ulint page, /*!< in: page where the segment header is placed: if
this is != 0, the page must belong to another segment,
if this is 0, a new page will be allocated and it
will belong to the created segment */
ulint byte_offset, /*!< in: byte offset of the created segment header
on the page */
ibool has_done_reservation, /*!< in: TRUE if the caller has already
done the reservation for the pages with
fsp_reserve_free_extents (at least 2 extents: one for
the inode and the other for the segment) then there is
no need to do the check for this individual
operation */
mtr_t* mtr); /*!< in: mtr */
/**********************************************************************//**
Calculates the number of pages reserved by a segment, and how many pages are
currently used.
@return number of reserved pages */
UNIV_INTERN
ulint
fseg_n_reserved_pages(
/*==================*/
fseg_header_t* header, /*!< in: segment header */
ulint* used, /*!< out: number of pages used (<= reserved) */
mtr_t* mtr); /*!< in: mtr handle */
/**********************************************************************//**
Allocates a single free page from a segment. This function implements
the intelligent allocation strategy which tries to minimize
file space fragmentation.
@param[in/out] seg_header segment header
@param[in] hint hint of which page would be desirable
@param[in] direction if the new page is needed because
of an index page split, and records are
inserted there in order, into which
direction they go alphabetically: FSP_DOWN,
FSP_UP, FSP_NO_DIR
@param[in/out] mtr mini-transaction
@return X-latched block, or NULL if no page could be allocated */
#define fseg_alloc_free_page(seg_header, hint, direction, mtr) \
fseg_alloc_free_page_general(seg_header, hint, direction, \
FALSE, mtr, mtr)
/**********************************************************************//**
Allocates a single free page from a segment. This function implements
the intelligent allocation strategy which tries to minimize file space
fragmentation.
@retval NULL if no page could be allocated
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
UNIV_INTERN
buf_block_t*
fseg_alloc_free_page_general(
/*=========================*/
fseg_header_t* seg_header,/*!< in/out: segment header */
ulint hint, /*!< in: hint of which page would be
desirable */
byte direction,/*!< in: if the new page is needed because
of an index page split, and records are
inserted there in order, into which
direction they go alphabetically: FSP_DOWN,
FSP_UP, FSP_NO_DIR */
ibool has_done_reservation, /*!< in: TRUE if the caller has
already done the reservation for the page
with fsp_reserve_free_extents, then there
is no need to do the check for this individual
page */
mtr_t* mtr, /*!< in/out: mini-transaction */
mtr_t* init_mtr)/*!< in/out: mtr or another mini-transaction
in which the page should be initialized.
If init_mtr!=mtr, but the page is already
latched in mtr, do not initialize the page. */
__attribute__((warn_unused_result, nonnull));
/**********************************************************************//**
Reserves free pages from a tablespace. All mini-transactions which may
use several pages from the tablespace should call this function beforehand
and reserve enough free extents so that they certainly will be able
to do their operation, like a B-tree page split, fully. Reservations
must be released with function fil_space_release_free_extents!
The alloc_type below has the following meaning: FSP_NORMAL means an
operation which will probably result in more space usage, like an
insert in a B-tree; FSP_UNDO means allocation to undo logs: if we are
deleting rows, then this allocation will in the long run result in
less space usage (after a purge); FSP_CLEANING means allocation done
in a physical record delete (like in a purge) or other cleaning operation
which will result in less space usage in the long run. We prefer the latter
two types of allocation: when space is scarce, FSP_NORMAL allocations
will not succeed, but the latter two allocations will succeed, if possible.
The purpose is to avoid dead end where the database is full but the
user cannot free any space because these freeing operations temporarily
reserve some space.
Single-table tablespaces whose size is < 32 pages are a special case. In this
function we would liberally reserve several 64 page extents for every page
split or merge in a B-tree. But we do not want to waste disk space if the table
only occupies < 32 pages. That is why we apply different rules in that special
case, just ensuring that there are 3 free pages available.
@return TRUE if we were able to make the reservation */
UNIV_INTERN
ibool
fsp_reserve_free_extents(
/*=====================*/
ulint* n_reserved,/*!< out: number of extents actually reserved; if we
return TRUE and the tablespace size is < 64 pages,
then this can be 0, otherwise it is n_ext */
ulint space, /*!< in: space id */
ulint n_ext, /*!< in: number of extents to reserve */
ulint alloc_type,/*!< in: FSP_NORMAL, FSP_UNDO, or FSP_CLEANING */
mtr_t* mtr); /*!< in: mtr */
/**********************************************************************//**
This function should be used to get information on how much we still
will be able to insert new data to the database without running out the
tablespace. Only free extents are taken into account and we also subtract
the safety margin required by the above function fsp_reserve_free_extents.
@return available space in kB */
UNIV_INTERN
ullint
fsp_get_available_space_in_free_extents(
/*====================================*/
ulint space); /*!< in: space id */
/**********************************************************************//**
Frees a single page of a segment. */
UNIV_INTERN
void
fseg_free_page(
/*===========*/
fseg_header_t* seg_header, /*!< in: segment header */
ulint space, /*!< in: space id */
ulint page, /*!< in: page offset */
mtr_t* mtr); /*!< in: mtr handle */
/**********************************************************************//**
Frees part of a segment. This function can be used to free a segment
by repeatedly calling this function in different mini-transactions.
Doing the freeing in a single mini-transaction might result in
too big a mini-transaction.
@return TRUE if freeing completed */
UNIV_INTERN
ibool
fseg_free_step(
/*===========*/
fseg_header_t* header, /*!< in, own: segment header; NOTE: if the header
resides on the first page of the frag list
of the segment, this pointer becomes obsolete
after the last freeing step */
mtr_t* mtr); /*!< in: mtr */
/**********************************************************************//**
Frees part of a segment. Differs from fseg_free_step because this function
leaves the header page unfreed.
@return TRUE if freeing completed, except the header page */
UNIV_INTERN
ibool
fseg_free_step_not_header(
/*======================*/
fseg_header_t* header, /*!< in: segment header which must reside on
the first fragment page of the segment */
mtr_t* mtr); /*!< in: mtr */
/***********************************************************************//**
Checks if a page address is an extent descriptor page address.
@return TRUE if a descriptor page */
UNIV_INLINE
ibool
fsp_descr_page(
/*===========*/
ulint zip_size,/*!< in: compressed page size in bytes;
0 for uncompressed pages */
ulint page_no);/*!< in: page number */
/***********************************************************//**
Parses a redo log record of a file page init.
@return end of log record or NULL */
UNIV_INTERN
byte*
fsp_parse_init_file_page(
/*=====================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr, /*!< in: buffer end */
buf_block_t* block); /*!< in: block or NULL */
/*******************************************************************//**
Validates the file space system and its segments.
@return TRUE if ok */
UNIV_INTERN
ibool
fsp_validate(
/*=========*/
ulint space); /*!< in: space id */
/*******************************************************************//**
Prints info of a file space. */
UNIV_INTERN
void
fsp_print(
/*======*/
ulint space); /*!< in: space id */
#ifdef UNIV_DEBUG
/*******************************************************************//**
Validates a segment.
@return TRUE if ok */
UNIV_INTERN
ibool
fseg_validate(
/*==========*/
fseg_header_t* header, /*!< in: segment header */
mtr_t* mtr); /*!< in: mtr */
#endif /* UNIV_DEBUG */
#ifdef UNIV_BTR_PRINT
/*******************************************************************//**
Writes info of a segment. */
UNIV_INTERN
void
fseg_print(
/*=======*/
fseg_header_t* header, /*!< in: segment header */
mtr_t* mtr); /*!< in: mtr */
#endif /* UNIV_BTR_PRINT */
#ifndef UNIV_NONINL
#include "fsp0fsp.ic"
#endif
#endif
| 39.980978 | 79 | 0.608781 |
8f61dd603d13e87a501a74dd3bb9bebfd037f319 | 584 | h | C | Libraries/gtkmm/lib/x86/pangomm/include/pangommconfig.h | utilForever/Wings | 1dbf0c88cf3cc97b48788c23abc50c32447e228a | [
"MIT"
] | 3 | 2017-01-19T09:30:50.000Z | 2017-03-20T10:47:20.000Z | Libraries/gtkmm/lib/x86/pangomm/include/pangommconfig.h | utilForever/Wings | 1dbf0c88cf3cc97b48788c23abc50c32447e228a | [
"MIT"
] | null | null | null | Libraries/gtkmm/lib/x86/pangomm/include/pangommconfig.h | utilForever/Wings | 1dbf0c88cf3cc97b48788c23abc50c32447e228a | [
"MIT"
] | 2 | 2017-01-19T09:32:19.000Z | 2021-03-15T16:00:43.000Z | /* pango/pangommconfig.h. Generated from pangommconfig.h.in by configure. */
/* This file is part of pangomm. */
#ifndef PANGOMM_PANGOMMCONFIG_H_INCLUDED
#define PANGOMM_PANGOMMCONFIG_H_INCLUDED
#include <glibmmconfig.h>
/* Define to omit deprecated API from the library. */
/* #undef PANGOMM_DISABLE_DEPRECATED */
/* Major version number of pangomm. */
#define PANGOMM_MAJOR_VERSION 2
/* Micro version number of pangomm. */
#define PANGOMM_MICRO_VERSION 0
/* Minor version number of pangomm. */
#define PANGOMM_MINOR_VERSION 40
#endif /* !PANGOMM_PANGOMMCONFIG_H_INCLUDED */
| 27.809524 | 78 | 0.77226 |
e9df8931c3b2e250980f7dce2f38684355835d46 | 190 | c | C | librt/libc/src/unistd.c | kl4w3i/ppci | f3be0d4ebc1ac57907fd9c21e886ab70b2805c21 | [
"BSD-2-Clause"
] | 161 | 2020-05-31T03:29:42.000Z | 2022-03-07T08:36:19.000Z | librt/libc/src/unistd.c | pfalcon/ppci | ea72967c8984757b4665a2fb0db095f32687eabf | [
"BSD-2-Clause"
] | 74 | 2020-05-26T18:05:48.000Z | 2021-02-13T21:55:39.000Z | librt/libc/src/unistd.c | pfalcon/ppci | ea72967c8984757b4665a2fb0db095f32687eabf | [
"BSD-2-Clause"
] | 19 | 2020-05-27T19:22:11.000Z | 2022-02-17T18:53:52.000Z | #include "stdlib.h"
#include "unistd.h"
ssize_t read(int fd, void *buf, size_t count){
return (size_t) syscall(0, fd, buf, count);
}
int close(int fd){
return syscall(3, fd, 0, 0);
}
| 17.272727 | 46 | 0.647368 |
e9e392b6db08976f17faf6f51c3f41b66863aab2 | 35,915 | c | C | libred/src/parser.c | davidgm94/redflag | c9a19d3c3ed7696bb2a5c8f35424e1f996947e2d | [
"MIT"
] | 1 | 2021-04-03T11:52:43.000Z | 2021-04-03T11:52:43.000Z | libred/src/parser.c | davidgm94/redflag | c9a19d3c3ed7696bb2a5c8f35424e1f996947e2d | [
"MIT"
] | null | null | null | libred/src/parser.c | davidgm94/redflag | c9a19d3c3ed7696bb2a5c8f35424e1f996947e2d | [
"MIT"
] | null | null | null | #include "compiler_types.h"
#include "parser.h"
#include "lexer.h"
#include "os.h"
#include <stdarg.h>
#include <stdio.h>
GEN_BUFFER_FUNCTIONS(node, nb, ASTNodeBuffer, ASTNode*)
static inline ASTNode*parse_expression(ParseContext*pc);
static inline ASTNode*parse_primary_expr(ParseContext*pc);
static inline ASTNode*parse_compound_st(ParseContext*pc);
static inline ASTNode*create_type_node(ParseContext*pc);
static inline ASTNode*parse_statement(ParseContext*pc);
static inline void copy_base_node(ASTNode*dst, const ASTNode*src, AST_ID id)
{
redassert(offsetof(ASTNode, sym_decl) ==
(sizeof(dst->node_id) + sizeof(dst->node_line) + sizeof(dst->node_column) + sizeof(dst->node_padding)));
dst->node_id = id;
dst->node_line = src->node_line;
dst->node_column = src->node_column;
}
static inline void fill_base_node(ASTNode*bn, Token*t, AST_ID id)
{
bn->node_id = id;
bn->node_line = t->start_line;
bn->node_column = t->start_column;
}
static inline AST_ID get_node_type(ASTNode*n)
{
return n->node_id;
}
static inline ASTNode*create_symbol_node(Token*t)
{
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, t, AST_TYPE_SYM_EXPR);
node->sym_expr.name = &t->str_lit.str;
return node;
}
static void error(ParseContext*pc, Token*token, const char*format, ...)
{
fprintf(stdout, "error parsing token %s at line %zu column %zu: ", token_name(token->id), token->start_line + 1,
token->start_column + 1);
va_list args;
va_start(args, format);
vfprintf(stdout, format, args);
va_end(args);
os_exit(1);
}
static inline void invalid_token_error(ParseContext*pc, Token*token)
{
error(pc, token, "invalid token: '%s'", token_name(token->id));
}
static inline Token*get_token_i(ParseContext*pc, size_t i)
{
if (pc->current_token + i >= pc->token_buffer->len)
{
return null;
}
return &pc->token_buffer->ptr[pc->current_token + i];
}
static inline Token*get_token(ParseContext*pc)
{
return get_token_i(pc, 0);
}
static inline Token*consume_token(ParseContext*pc)
{
Token*token = get_token(pc);
#if RED_PARSER_VERBOSE
PRINT_TOKEN_WITH_PREFIX("Consuming", token, pc->current_token, symbol_name);
#endif
pc->current_token += 1;
return token;
}
static inline Token*consume_token_if(ParseContext*pc, TokenID id)
{
Token*eaten = get_token(pc);
if (eaten->id == id)
{
return consume_token(pc);
}
return NULL;
}
static inline Token*expect_token(ParseContext*pc, TokenID id)
{
Token*token = consume_token(pc);
if (token->id != id)
{
error(pc, token, "expected token '%s', found '%s'", token_name(id), token_name(token->id));
}
return token;
}
static inline Token*expect_token_if_not(ParseContext*pc, TokenID expected_token, TokenID if_not_this_one)
{
Token*token = get_token(pc);
if (token->id != if_not_this_one)
{
token = expect_token(pc, expected_token);
return token;
}
return null;
}
static inline void put_back_token(ParseContext*pc)
{
#if RED_PARSER_VERBOSE
Token* wrong_token = get_token(pc);
#endif
pc->current_token -= 1;
#if RED_PARSER_VERBOSE
Token* good_token = get_token(pc);
StringBuffer* wrong_symbol = wrong_token->id == TOKEN_ID_SYMBOL ? token_buffer(wrong_token) : NULL;
StringBuffer* good_symbol = good_token->id == TOKEN_ID_SYMBOL ? token_buffer(good_token) : NULL;
print("Current token #%zu: %s name: %s ******** Putting back token #%zu: %s name: %s\n", pc->current_token + 1, token_name(wrong_token->id), wrong_symbol ? wrong_symbol->ptr : "not a symbol", pc->current_token, token_name(good_token->id), good_symbol ? good_symbol->ptr : "not a symbol");
#endif
}
static inline ASTNode*create_basic_type_node(ParseContext*pc)
{
Token*token = consume_token_if(pc, TOKEN_ID_SYMBOL);
if (!token)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, token, AST_TYPE_TYPE_EXPR);
node->type_expr.kind = TYPE_KIND_PRIMITIVE;
node->type_expr.name = &token->str_lit.str;
return node;
}
static inline ASTNode*create_type_node_array(ParseContext*pc)
{
Token*left_bracket = expect_token(pc, TOKEN_ID_LEFT_BRACKET);
ASTNode*elem_count_node = parse_expression(pc);
expect_token(pc, TOKEN_ID_RIGHT_BRACKET);
ASTNode*type_node = create_type_node(pc);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, left_bracket, AST_TYPE_TYPE_EXPR);
node->type_expr.kind = TYPE_KIND_ARRAY;
node->type_expr.array.element_count_expr = elem_count_node;
node->type_expr.array.type = type_node;
return node;
}
const char*primitive_types[] =
{
"u8", "u16", "u32", "u64",
"s8", "s16", "s32", "s64",
"f32", "f64",
};
static bool is_basic_type(Token*type_token)
{
char*type_str = type_token->str_lit.str.ptr;
for (u32 i = 0;
i < array_length(primitive_types);
i++)
{
if (strcmp(type_str, primitive_types[i]) == 0)
{
return true;
}
}
return false;
}
static inline ASTNode*create_complex_type_node(ParseContext*pc)
{
Token*token = consume_token_if(pc, TOKEN_ID_SYMBOL);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, token, AST_TYPE_TYPE_EXPR);
node->type_expr.kind = TYPE_KIND_COMPLEX_TO_BE_DETERMINED;
node->type_expr.name = &token->str_lit.str;
return node;
}
static inline ASTNode*create_type_node_pointer(ParseContext*pc)
{
Token*p_token = expect_token(pc, TOKEN_ID_AMPERSAND);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, p_token, AST_TYPE_TYPE_EXPR);
node->type_expr.kind = TYPE_KIND_POINTER;
node->type_expr.pointer_.type = create_type_node(pc);
return node;
}
static inline ASTNode*create_type_node_raw_string_type(ParseContext*pc)
{
Token*str_token = expect_token(pc, TOKEN_ID_KEYWORD_RAW_STRING);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, str_token, AST_TYPE_TYPE_EXPR);
// TODO: buggy
node->type_expr.kind = TYPE_KIND_RAW_STRING;
node->type_expr.name = token_buffer(str_token);
return node;
}
static inline ASTNode*create_type_node(ParseContext*pc)
{
Token*token = get_token(pc);
TokenID type = token->id;
switch (type)
{
case TOKEN_ID_SYMBOL:
if (is_basic_type(token))
{
return create_basic_type_node(pc);
}
else
{
return create_complex_type_node(pc);
}
case TOKEN_ID_LEFT_BRACKET:
return create_type_node_array(pc);
case TOKEN_ID_AMPERSAND:
return create_type_node_pointer(pc);
case TOKEN_ID_KEYWORD_RAW_STRING:
return create_type_node_raw_string_type(pc);
default:
RED_NOT_IMPLEMENTED;
return null;
}
}
static inline ASTNode*parse_param_decl(ParseContext*pc)
{
Token*name = expect_token(pc, TOKEN_ID_SYMBOL);
ASTNode*symbol_node = create_symbol_node(name);
ASTNode*type_node = create_type_node(pc);
if (get_token(pc)->id != TOKEN_ID_RIGHT_PARENTHESIS)
{
expect_token(pc, TOKEN_ID_COMMA);
}
ASTNode*param = NEW(ASTNode, 1);
fill_base_node(param, name, AST_TYPE_PARAM_DECL);
param->param_decl.sym = symbol_node;
param->param_decl.type = type_node;
return param;
}
static inline ASTNodeBuffer parse_param_decl_list(ParseContext*pc)
{
// Left parenthesis is already consumed
//expect_token(pc, TOKEN_ID_LEFT_PARENTHESIS);
ASTNodeBuffer nb = ZERO_INIT;
while (get_token(pc)->id != TOKEN_ID_RIGHT_PARENTHESIS)
{
ASTNode*param = parse_param_decl(pc);
if (param)
{
node_append(&nb, param);
}
else
{
os_exit(1);
}
}
expect_token(pc, TOKEN_ID_RIGHT_PARENTHESIS);
return nb;
}
static inline ASTNode*parse_sym_decl(ParseContext*pc)
{
Token*mut_token = consume_token_if(pc, TOKEN_ID_KEYWORD_CONST);
if (!mut_token)
{
mut_token = consume_token_if(pc, TOKEN_ID_KEYWORD_VAR);
if (!mut_token)
{
return null;
}
}
bool is_const = mut_token->id == TOKEN_ID_KEYWORD_CONST;
Token*sym_name = expect_token(pc, TOKEN_ID_SYMBOL);
// TODO: should flexibilize this in order to support type inferring in the future
ASTNode*sym_type_node = create_type_node(pc);
// TODO: This means no value assigned, uninitialized (left to the backend?????)
ASTNode*sym_node = null;
Token*semicolon = consume_token_if(pc, TOKEN_ID_SEMICOLON);
if (semicolon)
{
sym_node = NEW(ASTNode, 1);
fill_base_node(sym_node, mut_token, AST_TYPE_SYM_DECL);
sym_node->sym_decl.is_const = is_const;
sym_node->sym_decl.sym = create_symbol_node(sym_name);
sym_node->sym_decl.type = sym_type_node;
return sym_node;
}
expect_token(pc, TOKEN_ID_EQ);
ASTNode*expression = parse_expression(pc);
expect_token(pc, TOKEN_ID_SEMICOLON);
sym_node = NEW(ASTNode, 1);
fill_base_node(sym_node, mut_token, AST_TYPE_SYM_DECL);
sym_node->sym_decl.is_const = is_const;
sym_node->sym_decl.sym = create_symbol_node(sym_name);
sym_node->sym_decl.type = sym_type_node;
sym_node->sym_decl.value = expression;
return sym_node;
}
/*
Var declaration
Branch (if-else)
return expression
variable assignment (bin op?)
*/
static inline ASTNode*parse_int_literal(ParseContext*pc)
{
Token*token = consume_token_if(pc, TOKEN_ID_INT_LIT);
if (!token)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, token, AST_TYPE_INT_LIT);
node->int_lit.bigint = token_bigint(token);
return node;
}
static inline ASTNode*parse_string_literal(ParseContext*pc)
{
Token*str_lit_token = expect_token(pc, TOKEN_ID_STRING_LIT);
if (!str_lit_token)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, str_lit_token, AST_TYPE_STRING_LIT);
node->string_lit.str_lit = token_buffer(str_lit_token);
return node;
}
static inline ASTNode*parse_symbol_expr(ParseContext*pc)
{
Token*token = get_token(pc);
if (token->id != TOKEN_ID_SYMBOL)
{
return null;
}
// TODO: this should also take into account new types
if (is_basic_type(token))
{
return create_type_node(pc);
}
consume_token(pc);
ASTNode*node = create_symbol_node(token);
if (consume_token_if(pc, TOKEN_ID_LEFT_BRACKET))
{
ASTNode*bracket_access = parse_expression(pc);
expect_token(pc, TOKEN_ID_RIGHT_BRACKET);
node->sym_expr.subscript_type = AST_SYMBOL_SUBSCRIPT_TYPE_BRACKET_ACCESS;
node->sym_expr.subscript = bracket_access;
}
else if (consume_token_if(pc, TOKEN_ID_DOT))
{
// TODO: this parse_expression can generate problems if the it is a container field access
ASTNode*access = parse_expression(pc);
node->sym_expr.subscript_type = AST_SYMBOL_SUBSCRIPT_TYPE_DOT_ACCESS;
node->sym_expr.subscript = access;
}
return node;
}
static inline ASTNode*parse_branch_block(ParseContext*pc)
{
ASTNode*branch_block = NULL;
Token*if_token = expect_token(pc, TOKEN_ID_KEYWORD_IF);
ASTNode*condition_node = parse_expression(pc);
if (!condition_node)
{
return null;
}
ASTNode*if_block = parse_expression(pc);
if (!if_block)
{
RED_NOT_IMPLEMENTED;
return null;
}
Token*else_token = consume_token_if(pc, TOKEN_ID_KEYWORD_ELSE);
if (!else_token)
{
branch_block = NEW(ASTNode, 1);
fill_base_node(branch_block, if_token, AST_TYPE_BRANCH_EXPR);
branch_block->branch_expr.condition = condition_node;
branch_block->branch_expr.if_block = if_block;
branch_block->branch_expr.else_block = null;
return branch_block;
}
Token*else_if_token = get_token(pc);
if (else_if_token->id != TOKEN_ID_KEYWORD_IF)
{
// IF-ELSE BLOCK
// parse else block
ASTNode*else_block = parse_expression(pc);
if (!else_block)
{
RED_NOT_IMPLEMENTED;
return null;
}
redassert(else_block->node_id == AST_TYPE_COMPOUND_STATEMENT);
branch_block = NEW(ASTNode, 1);
fill_base_node(branch_block, if_token, AST_TYPE_BRANCH_EXPR);
branch_block->branch_expr.condition = condition_node;
branch_block->branch_expr.if_block = if_block;
branch_block->branch_expr.else_block = else_block;
return branch_block;
}
branch_block = NEW(ASTNode, 1);
fill_base_node(branch_block, if_token, AST_TYPE_BRANCH_EXPR);
branch_block->branch_expr.condition = condition_node;
branch_block->branch_expr.if_block = if_block;
ASTNode*branch_it = branch_block;
do
{
ASTNode*new_branch_block;
else_if_token = get_token(pc);
if (else_if_token->id == TOKEN_ID_KEYWORD_IF)
{
new_branch_block = parse_branch_block(pc);
branch_it->branch_expr.else_block = new_branch_block;
branch_it = branch_it->branch_expr.else_block;
}
else
{
RED_UNREACHABLE;
return null;
}
} while ((else_token = consume_token_if(pc, TOKEN_ID_KEYWORD_ELSE)));
return branch_block;
}
static inline ASTNode*parse_return_statement(ParseContext*pc)
{
Token*ret_token = consume_token_if(pc, TOKEN_ID_KEYWORD_RETURN);
if (!ret_token)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, ret_token, AST_TYPE_RETURN_STATEMENT);
node->return_expr.expr = parse_expression(pc);
expect_token(pc, TOKEN_ID_SEMICOLON);
return node;
}
static inline ASTNode*parse_while_expr(ParseContext*pc)
{
Token*token = expect_token(pc, TOKEN_ID_KEYWORD_WHILE);
ASTNode*while_condition = parse_expression(pc);
if (!while_condition)
{
os_exit_with_message("Expected expression after while statement\n");
return null;
}
ASTNode*while_block = parse_expression(pc);
if (!while_block)
{
os_exit_with_message("Expected block after while statement and condition\n");
return null;
}
ASTNode*while_node = NEW(ASTNode, 1);
fill_base_node(while_node, token, AST_TYPE_LOOP_EXPR);
while_node->loop_expr.condition = while_condition;
while_node->loop_expr.body = while_block;
return while_node;
}
static inline ASTNode*parse_for_expr(ParseContext*pc)
{
Token*for_token = expect_token(pc, TOKEN_ID_KEYWORD_FOR);
ASTNode*init_statement = parse_expression(pc);
if (!init_statement)
{
return null;
}
expect_token(pc, TOKEN_ID_SEMICOLON);
ASTNode*condition = parse_expression(pc);
if (!condition)
{
return null;
}
expect_token(pc, TOKEN_ID_SEMICOLON);
ASTNode*post_iteration_statement = parse_expression(pc);
if (!post_iteration_statement)
{
return null;
}
ASTNode*loop_body = parse_expression(pc);
if (!loop_body)
{
return null;
}
redassert(loop_body->node_id == AST_TYPE_COMPOUND_STATEMENT);
node_append(&loop_body->compound_statement.statements, post_iteration_statement);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, for_token, AST_TYPE_LOOP_EXPR);
node->loop_expr.condition = condition;
node->loop_expr.body = loop_body;
return node;
}
static inline ASTNode*parse_fn_call_expr(ParseContext*pc)
{
Token*fn_expr_token = get_token(pc);
if (fn_expr_token->id != TOKEN_ID_SYMBOL || get_token_i(pc, 1)->id != TOKEN_ID_LEFT_PARENTHESIS)
{
return null;
}
consume_token(pc);
consume_token(pc);
// TODO: modify to admit arguments
ASTNode*param_arr[256];
u8 param_count = 0;
while (get_token(pc)->id != TOKEN_ID_RIGHT_PARENTHESIS)
{
param_arr[param_count] = parse_expression(pc);
param_count++;
consume_token_if(pc, TOKEN_ID_COMMA);
}
expect_token(pc, TOKEN_ID_RIGHT_PARENTHESIS);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, fn_expr_token, AST_TYPE_FN_CALL);
node->fn_call.name = *token_buffer(fn_expr_token);
node->fn_call.args = NEW(ASTNode*, param_count);
memcpy(node->fn_call.args, param_arr, sizeof(ASTNode*) * param_count);
node->fn_call.arg_count = param_count;
return node;
}
static inline ASTNode*parse_array_literal(ParseContext*pc)
{
Token*left_bracket = expect_token(pc, TOKEN_ID_LEFT_BRACKET);
ASTNodeBuffer node_buffer = ZERO_INIT;
ASTNode*value;
while (get_token(pc)->id != TOKEN_ID_RIGHT_BRACKET && (value = parse_expression(pc)))
{
node_append(&node_buffer, value);
expect_token_if_not(pc, TOKEN_ID_COMMA, TOKEN_ID_RIGHT_BRACKET);
}
expect_token(pc, TOKEN_ID_RIGHT_BRACKET);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, left_bracket, AST_TYPE_ARRAY_LIT);
node->array_lit.values = node_buffer;
return node;
}
static inline bool is_switch_case_start(ParseContext*pc)
{
Token*token = get_token(pc);
TokenID id = token->id;
return id == TOKEN_ID_SYMBOL || id == TOKEN_ID_KEYWORD_DEFAULT || id == TOKEN_ID_INT_LIT;
}
static inline void parse_switch_case(ParseContext*pc, ASTNodeBuffer*switch_case_buffer)
{
Token*case_token = get_token(pc);
//Token* case_token = consume_token_if(pc, TOKEN_ID_SYMBOL);
//if (!case_token)
//{
// case_token = consume_token_if(pc, TOKEN_ID_KEYWORD_DEFAULT);
// if (!case_token)
// {
// case_token = consume_token_if(pc, TOKEN_ID_INT_LIT);
// if (!case_token)
// {
// return null;
// }
// }
//}
// if case_expr is null, it is the default case
ASTNode*case_expr = parse_primary_expr(pc);
ASTNodeBuffer case_buffer = ZERO_INIT;
node_append(&case_buffer, case_expr);
if (case_expr)
{
while (consume_token_if(pc, TOKEN_ID_KEYWORD_OR))
{
case_expr = parse_primary_expr(pc);
if (!case_expr)
{
RED_UNREACHABLE;
}
node_append(&case_buffer, case_expr);
}
}
expect_token(pc, TOKEN_ID_COLON);
ASTNode*case_body = parse_expression(pc);
if (!case_body)
{
os_exit_with_message("No body in switch statement");
}
if (case_body->node_id != AST_TYPE_COMPOUND_STATEMENT)
{
ASTNode*one_st_body = case_body;
ASTNode*new_compound_st = NEW(ASTNode, 1);
copy_base_node(new_compound_st, one_st_body, AST_TYPE_COMPOUND_STATEMENT);
node_append(&new_compound_st->compound_statement.statements, one_st_body);
new_compound_st->compound_statement.no_scope = true;
case_body = new_compound_st;
}
for (u32 i = 0;
i < case_buffer.len;
i++)
{
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, case_token, AST_TYPE_SWITCH_CASE);
node->switch_case.case_value = case_buffer.ptr[i];
node->switch_case.case_body = case_body;
node_append(switch_case_buffer, node);
}
}
static inline ASTNode*parse_switch_statement(ParseContext*pc)
{
Token*switch_token = expect_token(pc, TOKEN_ID_KEYWORD_SWITCH);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, switch_token, AST_TYPE_SWITCH_STATEMENT);
ASTNode*expr_to_switch_on = parse_expression(pc);
if (!expr_to_switch_on)
{
return null;
}
node->switch_expr.expr_to_switch_on = expr_to_switch_on;
expect_token(pc, TOKEN_ID_LEFT_BRACE);
while (is_switch_case_start(pc))
{
parse_switch_case(pc, &node->switch_expr.cases);
}
expect_token(pc, TOKEN_ID_RIGHT_BRACE);
return node;
}
static inline ASTNode*parse_size_directive(ParseContext*pc, Token*dir_token)
{
ASTNode*expression = parse_expression(pc);
if (!expression)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, dir_token, AST_TYPE_SIZE_EXPR);
node->size_expr.expr = expression;
return node;
}
static inline ASTNode*parse_compiler_directive(ParseContext*pc)
{
expect_token(pc, TOKEN_ID_HASH);
Token*dir_token = expect_token(pc, TOKEN_ID_SYMBOL);
if (strcmp(sb_ptr(token_buffer(dir_token)), "size") == 0)
{
return parse_size_directive(pc, dir_token);
}
RED_NOT_IMPLEMENTED;
return null;
}
static inline ASTNode*parse_primary_expr(ParseContext*pc)
{
Token*t = get_token(pc);
TokenID id = t->id;
switch (id)
{
case TOKEN_ID_LEFT_BRACKET:
return parse_array_literal(pc);
case TOKEN_ID_LEFT_BRACE:
return parse_compound_st(pc);
case TOKEN_ID_LEFT_PARENTHESIS:
{
expect_token(pc, TOKEN_ID_LEFT_PARENTHESIS);
ASTNode*node = parse_expression(pc);
expect_token(pc, TOKEN_ID_RIGHT_PARENTHESIS);
return node;
}
case TOKEN_ID_KEYWORD_IF:
return parse_branch_block(pc);
case TOKEN_ID_KEYWORD_SWITCH:
return parse_switch_statement(pc);
case TOKEN_ID_KEYWORD_WHILE:
return parse_while_expr(pc);
case TOKEN_ID_KEYWORD_FOR:
return parse_for_expr(pc);
case TOKEN_ID_KEYWORD_RETURN:
return parse_return_statement(pc);
case TOKEN_ID_INT_LIT:
return parse_int_literal(pc);
case TOKEN_ID_STRING_LIT:
return parse_string_literal(pc);
case TOKEN_ID_SYMBOL:
// TODO: fix
if (get_token_i(pc, 1)->id == TOKEN_ID_LEFT_PARENTHESIS)
{
return parse_fn_call_expr(pc);
}
else
{
return parse_symbol_expr(pc);
}
case TOKEN_ID_END_OF_FILE:
return null;
// default switch case, just return null
case TOKEN_ID_KEYWORD_DEFAULT:
consume_token(pc);
return null;
case TOKEN_ID_HASH:
return parse_compiler_directive(pc);
default:
RED_NOT_IMPLEMENTED;
return null;
}
}
static inline ASTNode*parse_right_expr(ParseContext*pc, ASTNode**left_expr)
{
while (true)
{
Token*token = get_token(pc);
if (token_is_binop_char(token->id))
{
consume_token(pc);
}
else
{
return *left_expr;
}
ASTNode*right_expr = parse_expression(pc);
if (!right_expr)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
copy_base_node(node, *left_expr, AST_TYPE_BIN_EXPR);
node->bin_expr.op = token->id;
node->bin_expr.left = *left_expr;
node->bin_expr.right = right_expr;
*left_expr = node;
}
}
static inline ASTNode*parse_expression(ParseContext*pc)
{
ASTNode*left_expr = parse_primary_expr(pc);
if (!left_expr)
{
return null;
}
return parse_right_expr(pc, &left_expr);
}
static inline ASTNode*parse_fn_call_statement(ParseContext*pc)
{
ASTNode*node = parse_fn_call_expr(pc);
if (!node)
{
return null;
}
expect_token(pc, TOKEN_ID_SEMICOLON);
return node;
}
static inline ASTNode*parse_statement(ParseContext*pc)
{
ASTNode*node = parse_sym_decl(pc);
if (node)
{
return node;
}
node = parse_fn_call_statement(pc);
if (node)
{
return node;
}
node = parse_return_statement(pc);
if (node)
{
return node;
}
node = parse_expression(pc);
if (node)
{
bool add_semicolon = node->node_id != AST_TYPE_BRANCH_EXPR && node->node_id != AST_TYPE_COMPOUND_STATEMENT &&
node->node_id != AST_TYPE_LOOP_EXPR && node->node_id != AST_TYPE_SWITCH_STATEMENT;
if (add_semicolon)
{
expect_token(pc, TOKEN_ID_SEMICOLON);
}
return node;
}
RED_NOT_IMPLEMENTED;
return null;
}
static inline ASTNode*parse_compound_st(ParseContext*pc)
{
Token*start_block = consume_token_if(pc, TOKEN_ID_LEFT_BRACE);
if (!start_block)
{
return nullptr;
}
ASTNode*block = NEW(ASTNode, 1);
fill_base_node(block, start_block, AST_TYPE_COMPOUND_STATEMENT);
// Empty blocks are not allowed
if (get_token(pc)->id == TOKEN_ID_RIGHT_BRACE)
{
return nullptr;
}
do
{
ASTNode*statement = parse_statement(pc);
if (statement)
{
node_append(&block->compound_statement.statements, statement);
}
else
{
os_exit_with_message("Couldn't parse statement");
}
} while (get_token(pc)->id != TOKEN_ID_RIGHT_BRACE);
expect_token(pc, TOKEN_ID_RIGHT_BRACE);
return block;
}
bool parse_file_load_or_import(ParseContext*pc, SBBuffer* file_list, const char*include_type)
{
Token*hash_token = get_token(pc);
if (hash_token->id != TOKEN_ID_HASH)
{
return false;
}
Token* directive_name = get_token_i(pc, 1);
if (directive_name->id != TOKEN_ID_SYMBOL)
{
os_exit_with_message("Expected symbol after directive hash");
return false;
}
if (strcmp(sb_ptr(token_buffer(directive_name)), include_type) != 0)
{
return false;
}
consume_token(pc);
consume_token(pc);
Token*file_str_token = consume_token_if(pc, TOKEN_ID_STRING_LIT);
if (!file_str_token)
{
os_exit_with_message("Expected string literal holding the filename to be included");
return false;
}
if (file_list)
{
SB*file_str = token_buffer(file_str_token);
SB** file_list_it = file_list->ptr;
u32 file_list_count = file_list->len;
for (u32 i = 0;
i < file_list_count;
i++)
{
SB* file_in_list = file_list_it[i];
if (sb_cmp(file_str, file_in_list))
{
os_exit_with_message("File %s included twice", file_in_list);
return false;
}
}
sb_buffer_append(file_list, file_str);
return true;
}
else
{
return true;
}
}
static inline ASTModule load_lex_and_parse_included_module(const char* file_path, SB* module)
{
SB* module_file = os_file_load(file_path);
if (!module_file)
{
os_exit_with_message("Can't find module %s\n", file_path);
}
LexingResult module_lex_result = lex_file(module_file);
redassert(module_lex_result.error.len == 0);
ASTModule module_ast = parse_module(&module_lex_result.tokens, module);
return module_ast;
}
static inline ASTNode*parse_fn_proto(ParseContext*pc)
{
Token*identifier = get_token(pc);
if (identifier->id != TOKEN_ID_SYMBOL)
{
print("expected identifier for function prototype, found: %s\n", token_name(identifier->id));
return null;
}
Token*eq_sign = get_token_i(pc, 1);
if (eq_sign->id != TOKEN_ID_EQ)
{
print("Expected %s token for function prototype, found: %s\n", token_name(TOKEN_ID_EQ),
token_name(eq_sign->id));
return nullptr;
}
Token*left_parenthesis = get_token_i(pc, 2);
if (left_parenthesis->id != TOKEN_ID_LEFT_PARENTHESIS)
{
print("Expected %s token for function prototype, found: %s\n", token_name(TOKEN_ID_LEFT_PARENTHESIS),
token_name(left_parenthesis->id));
return nullptr;
}
// name
consume_token(pc);
// equal
consume_token(pc);
consume_token(pc);
ASTNodeBuffer param_list = parse_param_decl_list(pc);
Token*return_type = get_token(pc);
if (!return_type && (!(get_token(pc)->id == TOKEN_ID_SEMICOLON || get_token(pc)->id == TOKEN_ID_LEFT_BRACE)))
{
invalid_token_error(pc, get_token(pc));
}
ASTNode*return_type_node = NULL;
if (return_type->id != TOKEN_ID_LEFT_BRACE)
{
return_type_node = create_type_node(pc);
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, identifier, AST_TYPE_FN_PROTO);
node->fn_proto.params = param_list;
node->fn_proto.sym = create_symbol_node(identifier);
node->fn_proto.ret_type = return_type_node;
return node;
}
static inline ASTNode*parse_fn_decl(ParseContext*pc)
{
Token*extern_token = consume_token_if(pc, TOKEN_ID_KEYWORD_EXTERN);
if (!extern_token)
{
return null;
}
ASTNode*proto = parse_fn_proto(pc);
if (!proto)
{
print("Error parsing function prototype for function (token %zu)\n", pc->current_token);
return null;
}
expect_token(pc, TOKEN_ID_SEMICOLON);
ASTNode*node = NEW(ASTNode, 1);
copy_base_node(node, proto, AST_TYPE_FN_DEF);
node->fn_def.proto = proto;
node->fn_def.body = NULL;
return node;
}
static inline ASTNode*parse_fn_definition(ParseContext*pc)
{
ASTNode*proto = parse_fn_proto(pc);
if (!proto)
{
print("Error parsing function prototype for function (token %zu)\n", pc->current_token);
return null;
}
ASTNode*body = parse_compound_st(pc);
if (!body)
{
print("Error parsing function %s body\n", sb_ptr(proto->fn_proto.sym->sym_expr.name));
return null;
}
ASTNode*fn_def = NEW(ASTNode, 1);
copy_base_node(fn_def, proto, AST_TYPE_FN_DEF);
fn_def->fn_def.proto = proto;
fn_def->fn_def.body = body;
return fn_def;
}
static inline bool is_complex_type_start(ParseContext*pc, TokenID container_type)
{
Token*sym_name = get_token(pc);
if (sym_name->id != TOKEN_ID_SYMBOL)
{
return false;
}
Token*eq = get_token_i(pc, 1);
if (eq->id != TOKEN_ID_EQ)
{
return false;
}
Token*struct_tok = get_token_i(pc, 2);
if (struct_tok->id != container_type)
{
return false;
}
return true;
}
static inline ASTNode*parse_container_field(ParseContext*pc)
{
Token*name = consume_token_if(pc, TOKEN_ID_SYMBOL);
if (!name)
{
return null;
}
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, name, AST_TYPE_FIELD_DECL);
node->field_decl.sym = create_symbol_node(name);
node->field_decl.type = create_type_node(pc);
return node;
}
static inline ASTNodeBuffer parse_container_fields(ParseContext*pc)
{
ASTNodeBuffer fields = ZERO_INIT;
if (!consume_token_if(pc, TOKEN_ID_LEFT_BRACE))
{
os_exit_with_message("Expected opening brace in container declaration");
}
do
{
ASTNode*field = parse_container_field(pc);
if (field)
{
node_append(&fields, field);
expect_token(pc, TOKEN_ID_SEMICOLON);
}
else
{
os_exit_with_message("Can't parse field");
}
} while (get_token(pc)->id != TOKEN_ID_RIGHT_BRACE);
expect_token(pc, TOKEN_ID_RIGHT_BRACE);
return fields;
}
static inline ASTNode*parse_enum_field(ParseContext*pc, u32 count, bool*parse_enum_value)
{
Token*name = consume_token_if(pc, TOKEN_ID_SYMBOL);
if (!name)
{
return null;
}
ASTNode*value = null;
bool parsing_enum_value = (bool) consume_token_if(pc, TOKEN_ID_EQ);
if (parsing_enum_value)
{
if (count > 0 && !(*parse_enum_value))
{
os_exit_with_message("Enum coherence missing");
return null;
}
value = parse_expression(pc);
}
else
{
if (count > 0 && (*parse_enum_value))
{
os_exit_with_message("Enum coherence missing");
return null;
}
}
*parse_enum_value = parsing_enum_value;
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, name, AST_TYPE_ENUM_DECL);
node->enum_field.name = token_buffer(name);
node->enum_field.field_value = value;
return node;
}
static inline ASTNodeBuffer parse_enum_fields(ParseContext*pc)
{
ASTNodeBuffer fields = ZERO_INIT;
if (!consume_token_if(pc, TOKEN_ID_LEFT_BRACE))
{
os_exit_with_message("Expected opening brace in container declaration");
}
u32 count = 0;
bool parse_enum_value = false;
do
{
ASTNode*field = parse_enum_field(pc, count, &parse_enum_value);
if (field)
{
count++;
node_append(&fields, field);
expect_token(pc, TOKEN_ID_SEMICOLON);
}
else
{
os_exit_with_message("Can't parse field");
}
} while (get_token(pc)->id != TOKEN_ID_RIGHT_BRACE);
expect_token(pc, TOKEN_ID_RIGHT_BRACE);
return fields;
}
static inline ASTNode*parse_struct_decl(ParseContext*pc)
{
if (!is_complex_type_start(pc, TOKEN_ID_KEYWORD_STRUCT))
{
return null;
}
Token*first = consume_token(pc);
consume_token(pc);
consume_token(pc);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, first, AST_TYPE_STRUCT_DECL);
node->struct_decl.fields = parse_container_fields(pc);
node->struct_decl.name = first->str_lit.str;
return node;
}
static inline ASTNode*parse_enum_decl(ParseContext*pc)
{
if (!is_complex_type_start(pc, TOKEN_ID_KEYWORD_ENUM))
{
return null;
}
Token*name = expect_token(pc, TOKEN_ID_SYMBOL);
expect_token(pc, TOKEN_ID_EQ);
expect_token(pc, TOKEN_ID_KEYWORD_ENUM);
ASTNode*node = NEW(ASTNode, 1);
fill_base_node(node, name, AST_TYPE_ENUM_DECL);
// default enums are 32-bit
node->enum_decl.type = ENUM_TYPE_U32;
node->enum_decl.name = token_buffer(name);
node->enum_decl.fields = parse_enum_fields(pc);
return node;
}
bool parse_top_level_declaration(ParseContext*pc, ASTModule*module_ast)
{
ASTNode*node;
if ((node = parse_struct_decl(pc)))
{
node_append(&module_ast->struct_decls, node);
return true;
}
if ((node = parse_enum_decl(pc)))
{
node_append(&module_ast->enum_decls, node);
return true;
}
if ((node = parse_sym_decl(pc)))
{
node_append(&module_ast->global_sym_decls, node);
return true;
}
if ((node = parse_fn_decl(pc)))
{
node_append(&module_ast->fn_definitions, node);
return true;
}
if ((node = parse_fn_definition(pc)))
{
node_append(&module_ast->fn_definitions, node);
return true;
}
return false;
}
ASTModule parse_module(TokenBuffer*tb, SB*module_name)
{
ASTModule module_ast = ZERO_INIT;
module_ast.name = module_name;
ParseContext pc = ZERO_INIT;
pc.token_buffer = tb;
// If main module, skip all the include directives first
if (strcmp(sb_ptr(module_name), "main") == 0)
{
while (parse_file_load_or_import(&pc, NULL, "import"));
while (parse_file_load_or_import(&pc, NULL, "load"));
}
while (get_token(&pc))
{
bool result = parse_top_level_declaration(&pc, &module_ast);
if (!result)
{
os_exit_with_message("Error parsing top level declaration");
}
}
return module_ast;
}
ASTModule load_lex_and_parse_user_module(SB* module_filename)
{
// TODO: Here we should handle include folders indicated by the build module
return load_lex_and_parse_included_module(sb_ptr(module_filename), module_filename);
}
ASTModule load_lex_and_parse_system_module(SB* module_name)
{
char file_path[1024] = "";
strcat(file_path, "../std/");
strcat(file_path, sb_ptr(module_name));
strcat(file_path, ".red");
return load_lex_and_parse_included_module(file_path, module_name);
}
| 27.044428 | 292 | 0.653265 |
5f94128f684d3ec8e90513ed1489b07f5929481d | 312 | h | C | src/ui_game_menu.h | moverest/bagh-chal | 6a59d30e7344ab2d80457826d792ce7d9db4c313 | [
"MIT"
] | 2 | 2021-06-01T20:17:37.000Z | 2021-08-24T01:21:58.000Z | src/ui_game_menu.h | moverest/bagh-chal | 6a59d30e7344ab2d80457826d792ce7d9db4c313 | [
"MIT"
] | null | null | null | src/ui_game_menu.h | moverest/bagh-chal | 6a59d30e7344ab2d80457826d792ce7d9db4c313 | [
"MIT"
] | 2 | 2017-06-11T19:35:31.000Z | 2020-01-05T03:55:07.000Z | #ifndef __UI_GAME_MENU_H__
#define __UI_GAME_MENU_H__
#include "ai.h"
#include "graphics.h"
bool ui_game_menu(void *graphics_context,
graphics_callbacks_t graphics,
ai_callbacks_t **tiger_ai,
ai_callbacks_t **goat_ai);
#endif
| 22.285714 | 57 | 0.596154 |
5821403ff2944f1ca0bda903d404cb7fbcd7128e | 9,531 | c | C | src/usb/usb_conf.c | andriy-bilynskyy/STM32-AES-Bootloader | 910c67b9333e10d817a516adf62fc273936b8bad | [
"MIT"
] | 12 | 2020-09-24T11:20:57.000Z | 2021-11-08T21:10:48.000Z | src/usb/usb_conf.c | andriy-bilynskyy/STM32-AES-Bootloader | 910c67b9333e10d817a516adf62fc273936b8bad | [
"MIT"
] | 1 | 2020-08-23T16:46:50.000Z | 2020-11-23T09:57:30.000Z | src/usb/usb_conf.c | andriy-bilynskyy/STM32-AES-Bootloader | 910c67b9333e10d817a516adf62fc273936b8bad | [
"MIT"
] | 4 | 2020-07-24T09:01:01.000Z | 2021-06-15T14:56:08.000Z | /*
********************************************************************************
**
** (C) 2020 Andrii Bilynskyi <andriy.bilynskyy@gmail.com>
**
** This code is licensed under the MIT.
**
********************************************************************************
*/
#include "usb_lib.h"
/*******************************************************************************
* USB descriptors
******************************************************************************/
static const uint8_t usb_cdc_device_descriptor[] = {
0x12, /* bLength 0x12*/
0x01, /* bDescriptorType */
0x00,
0x02, /* bcdUSB = 2.00 */
0x00, /* bDeviceClass: Described in interface */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
USB_CDC_EP0_PACK, /* bMaxPacketSize0 */
0xCD,
0xAB, /* idVendor = 0xABCD */
0xCD,
0xAB, /* idProduct = 0xABCD */
0x00,
0x02, /* bcdDevice = 2.00 */
1, /* Index of string descriptor describing manufacturer */
2, /* Index of string descriptor describing product */
0, /* Index of string descriptor describing the device's SN */
0x01 /* bNumConfigurations */
};
static const uint8_t usb_cdc_config_descriptor[] = {
/* Configuration Descriptor */
0x09, /* bLength: Configuration Descriptor size */
0x02, /* bDescriptorType: Configuration */
0x2C, /* wTotalLength: Number of returned bytes */
0x00,
0x01, /* bNumInterfaces: One interface */
0x01, /* bConfigurationValue: One Configuration */
0x00, /* iConfiguration: Index of string descriptor describing config */
0xC0, /* bmAttributes: self powered */
0x00, /* MaxPower 0 mA */
/* Interface Descriptor */
0x09, /* bLength: Interface Descriptor size */
0x04, /* bDescriptorType: Interface */
0x00, /* bInterfaceNumber: First Interface */
0x00, /* bAlternateSetting: None */
0x03, /* bNumEndpoints: Three endpoints used */
0x02, /* bInterfaceClass: Communication Interface Class */
0x02, /* bInterfaceSubClass: Abstract Control Model */
0x00, /* bInterfaceProtocol: None */
0x00, /* iInterface: */
/* Union Functional Descriptor */
0x05, /* bFunctionLength */
0x24, /* bDescriptorType: CS_INTERFACE */
0x06, /* bDescriptorSubtype: Union func desc */
0x00, /* bMasterInterface: Communication class interface */
0x00, /* bSlaveInterface0: Data Class Interface */
/* Endpoint 1 Descriptor MCU TX */
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: Endpoint */
0x81, /* bEndpointAddress: (IN1) */
0x02, /* bmAttributes: Bulk */
USB_CDC_EP1_PACK, /* wMaxPacketSize: */
0x00,
0x00, /* bInterval */
/* Endpoint 2 Descriptor MCU serial config */
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: Endpoint */
0x82, /* bEndpointAddress: (IN2) */
0x03, /* bmAttributes: Interrupt */
USB_CDC_EP2_PACK, /* wMaxPacketSize: */
0x00,
0xFF, /* bInterval: */
/* Endpoint 3 Descriptor MCU RX */
0x07, /* bLength: Endpoint Descriptor size */
0x05, /* bDescriptorType: Endpoint */
0x03, /* bEndpointAddress: (OUT3) */
0x02, /* bmAttributes: Bulk */
USB_CDC_EP3_PACK, /* wMaxPacketSize: */
0x00,
0x00 /* bInterval: ignore for Bulk transfer */
};
static const uint8_t usb_cdc_lang_id_descriptor[] = {
0x04, /* bLength: LangID Descriptor size */
0x03, /* bDescriptorType: String */
0x09,
0x04 /* LangID: 0x0409 - U.S. English */
};
static const uint8_t usb_cdc_vendor_str_descriptor[] = {
0x16, /* bLength: Vendor string Descriptor size */
0x03, /* bDescriptorType: String */
/* Manufacturer: "EmSoftware" */
'E',0,'m',0,'S',0,'o',0,'f',0,'t',0,'w',0,'a',0,'r',0,'e',0
};
static const uint8_t usb_cdc_product_str_descriptor[] = {
0x22, /* bLength: Product string Descriptor size */
0x03, /* bDescriptorType: String */
/* Product name: "Virtual COM Port" */
'V',0,'i',0,'r',0,'t',0,'u',0,'a',0,'l',0,' ',0,'C',0,'O',0,'M',0,' ',0,
'P',0,'o',0,'r',0,'t',0
};
/*******************************************************************************
* Driver USB structures
******************************************************************************/
DEVICE Device_Table = {
USB_CDC_EP_CNT, /* Four endpoints */
1 /* One configuration */
};
ONE_DESCRIPTOR Device_Descriptor = {
(uint8_t*)usb_cdc_device_descriptor,
sizeof(usb_cdc_device_descriptor)
};
ONE_DESCRIPTOR Config_Descriptor = {
(uint8_t*)usb_cdc_config_descriptor,
sizeof(usb_cdc_config_descriptor)
};
ONE_DESCRIPTOR String_Descriptor[] = {
{
(uint8_t*)usb_cdc_lang_id_descriptor,
sizeof(usb_cdc_lang_id_descriptor)
},
{
(uint8_t*)usb_cdc_vendor_str_descriptor,
sizeof(usb_cdc_vendor_str_descriptor)
},
{
(uint8_t*)usb_cdc_product_str_descriptor,
sizeof(usb_cdc_product_str_descriptor)
}
};
static void usb_cdc_init(void);
static void usb_cdc_reset(void);
static void usb_cdc_in(void);
static void usb_cdc_out(void);
static RESULT usb_cdc_data_setup(uint8_t RequestNo);
static RESULT usb_cdc_no_data_setp(uint8_t RequestNo);
static RESULT usb_cdc_get_interface_settings(uint8_t Interface,
uint8_t AlternateSetting);
static uint8_t * usb_cdc_get_device_descriptor(uint16_t Length);
static uint8_t * usb_cdc_get_config_descriptor(uint16_t Length);
static uint8_t * usb_cdc_get_str_descriptor(uint16_t Length);
static void usb_cdc_set_configuration(void);
DEVICE_PROP Device_Property = {
usb_cdc_init,
usb_cdc_reset,
usb_cdc_in,
usb_cdc_out,
usb_cdc_data_setup,
usb_cdc_no_data_setp,
usb_cdc_get_interface_settings,
usb_cdc_get_device_descriptor,
usb_cdc_get_config_descriptor,
usb_cdc_get_str_descriptor,
0,
USB_CDC_MAX_PACK
};
USER_STANDARD_REQUESTS User_Standard_Requests = {
NOP_Process,
usb_cdc_set_configuration,
NOP_Process,
NOP_Process,
NOP_Process,
NOP_Process,
NOP_Process,
NOP_Process,
NOP_Process
};
extern bool usb_cdc_ready;
static void usb_cdc_init(void) {
usb_cdc_ready = FALSE;
/* Set Virtual_Com_Port DEVICE as not configured */
pInformation->Current_Configuration = 0;
/* Connect the device */
_SetCNTR(CNTR_FRES);
wInterrupt_Mask = 0;
_SetCNTR(wInterrupt_Mask);
SetISTR(0);
/* Perform basic device initialization operations */
USB_SIL_Init();
}
static void usb_cdc_reset(void) {
usb_cdc_ready = FALSE;
/* Set Virtual_Com_Port DEVICE as not configured */
pInformation->Current_Configuration = 0;
/* Current Feature initialization */
pInformation->Current_Feature = usb_cdc_config_descriptor[7];
/* Set Virtual_Com_Port DEVICE with the default Interface*/
pInformation->Current_Interface = 0;
SetBTABLE(BTABLE_ADDRESS);
/* Initialize Endpoint 0 */
SetEPType(ENDP0, EP_CONTROL);
SetEPTxStatus(ENDP0, EP_TX_STALL);
SetEPRxAddr(ENDP0, ENDP0_RXADDR);
SetEPTxAddr(ENDP0, ENDP0_TXADDR);
Clear_Status_Out(ENDP0);
SetEPRxCount(ENDP0, Device_Property.MaxPacketSize);
SetEPRxValid(ENDP0);
/* Initialize Endpoint 1 */
SetEPType(ENDP1, EP_BULK);
SetEPTxAddr(ENDP1, ENDP1_TXADDR);
SetEPTxStatus(ENDP1, EP_TX_NAK);
SetEPRxStatus(ENDP1, EP_RX_DIS);
/* Initialize Endpoint 2 */
SetEPType(ENDP2, EP_INTERRUPT);
SetEPTxAddr(ENDP2, ENDP2_TXADDR);
SetEPRxStatus(ENDP2, EP_RX_DIS);
SetEPTxStatus(ENDP2, EP_TX_NAK);
/* Initialize Endpoint 3 */
SetEPType(ENDP3, EP_BULK);
SetEPRxAddr(ENDP3, ENDP3_RXADDR);
SetEPRxCount(ENDP3, USB_CDC_EP3_PACK);
SetEPRxStatus(ENDP3, EP_RX_VALID);
SetEPTxStatus(ENDP3, EP_TX_DIS);
/* Set this device to response on default address */
SetDeviceAddress(0);
}
static void usb_cdc_in(void) {}
static void usb_cdc_out(void) {}
static RESULT usb_cdc_data_setup(uint8_t RequestNo) {
return USB_UNSUPPORT;
}
static RESULT usb_cdc_no_data_setp(uint8_t RequestNo) {
return USB_UNSUPPORT;
}
static RESULT usb_cdc_get_interface_settings(uint8_t Interface,
uint8_t AlternateSetting) {
RESULT result = USB_UNSUPPORT;
if(!Interface && !AlternateSetting) {
result = USB_SUCCESS;
}
return result;
}
static uint8_t * usb_cdc_get_device_descriptor(uint16_t Length) {
return Standard_GetDescriptorData(Length, &Device_Descriptor);
}
static uint8_t * usb_cdc_get_config_descriptor(uint16_t Length) {
return Standard_GetDescriptorData(Length, &Config_Descriptor);
}
static uint8_t * usb_cdc_get_str_descriptor(uint16_t Length) {
uint8_t * result = NULL;
uint8_t w_value = pInformation->USBwValue0;
if (w_value <= 2) {
result = Standard_GetDescriptorData(Length,
&String_Descriptor[w_value]);
}
return result;
}
static void usb_cdc_set_configuration(void) {
DEVICE_INFO *pInfo = &Device_Info;
if(pInfo->Current_Configuration) {
usb_cdc_ready = TRUE;
}
}
| 31.045603 | 81 | 0.61599 |
166edd69b049f0296d372c02731233cd2e10fce5 | 12,918 | h | C | src/constitutive/TACSMaterialProperties.h | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | src/constitutive/TACSMaterialProperties.h | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | src/constitutive/TACSMaterialProperties.h | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | /*
This file is part of TACS: The Toolkit for the Analysis of Composite
Structures, a parallel finite-element code for structural and
multidisciplinary design optimization.
Copyright (C) 2010 University of Toronto
Copyright (C) 2012 University of Michigan
Copyright (C) 2014 Georgia Tech Research Corporation
Additional copyright (C) 2010 Graeme J. Kennedy and Joaquim
R.R.A. Martins All rights reserved.
TACS is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this software except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
#ifndef TACS_MATERIAL_PROPERTIES_H
#define TACS_MATERIAL_PROPERTIES_H
/*
The following classes contain the data necessary to compute the
constitutive relationships or failure data.
*/
#include "TACSObject.h"
enum MaterialType { TACS_ISOTROPIC_MATERIAL,
TACS_ANISOTROPIC_MATERIAL };
/**
This class stores the mechanical and thermal material properties for
isotropic and anisotropic materials.
The goal of this class is to store a set of material properties
that can be queried by constitutive classes for beams, shells,
plane stress and solid elements. The minimum set of properties
consists of isotroic mechanical properties, with zero thermal
expansion.
*/
class TACSMaterialProperties : public TACSObject {
public:
TACSMaterialProperties( TacsScalar _rho, TacsScalar _specific_heat,
TacsScalar _E, TacsScalar _nu,
TacsScalar _ys, TacsScalar _alpha,
TacsScalar _kappa );
TACSMaterialProperties( TacsScalar _rho, TacsScalar _specific_heat,
TacsScalar _E1, TacsScalar _E2, TacsScalar _E3,
TacsScalar _nu12, TacsScalar _nu13, TacsScalar _nu23,
TacsScalar _G12, TacsScalar _G13, TacsScalar _G23,
TacsScalar _T1=0.0, TacsScalar _C1=0.0,
TacsScalar _T2=0.0, TacsScalar _C2=0.0,
TacsScalar _T3=0.0, TacsScalar _C3=0.0,
TacsScalar _S12=0.0, TacsScalar _S13=0.0,
TacsScalar _S23=0.0,
TacsScalar _alpha1=0.0, TacsScalar _alpha2=0.0,
TacsScalar _alpha3=0.0,
TacsScalar _kappa1=0.0, TacsScalar _kappa2=0.0,
TacsScalar _kappa3=0.0 );
~TACSMaterialProperties(){}
// Get the material type
MaterialType getMaterialType();
// Extract material property values
TacsScalar getDensity();
TacsScalar getSpecificHeat();
// Set material property values
void setDensity( TacsScalar _rho );
void setSpecificHeat( TacsScalar _specific_heat );
// Extract the coefficients
void getIsotropicProperties( TacsScalar *_E, TacsScalar *_nu );
void getOrthotropicProperties( TacsScalar *_E1, TacsScalar *_E2,
TacsScalar *_E3,
TacsScalar *_nu12, TacsScalar *_nu13,
TacsScalar *_nu23,
TacsScalar *_G12, TacsScalar *_G13,
TacsScalar *_G23 );
void getStrengthProperties( TacsScalar *_T1, TacsScalar *_C1,
TacsScalar *_T2, TacsScalar *_C2,
TacsScalar *_T3, TacsScalar *_C3,
TacsScalar *_S12, TacsScalar *_S13,
TacsScalar *_S23 );
void getCoefThermalExpansion( TacsScalar *_a1,
TacsScalar *_a2,
TacsScalar *_a3 );
void getThermalConductivity( TacsScalar *_k1,
TacsScalar *_k2,
TacsScalar *_k3 );
// Evaluate the constitutive relationships
void evalTangentStiffness3D( TacsScalar C[] );
void evalTangentStiffness2D( TacsScalar C[] );
// Evaluate the thermal conductivity matrices
void evalTangentHeatFlux3D( TacsScalar Kc[] );
void evalTangentHeatFlux2D( TacsScalar Kc[] );
// Evaluate the thermal strain
void evalThermalStrain3D( TacsScalar e[] );
void evalThermalStrain2D( TacsScalar e[] );
// Compute the failure index using the von Mises stress
TacsScalar vonMisesFailure3D( const TacsScalar stress[] );
TacsScalar vonMisesFailure3DStressSens( const TacsScalar stress[],
TacsScalar sens[] );
// The von Mises failure criteria for plane stress problems
TacsScalar vonMisesFailure2D( const TacsScalar stress[] );
TacsScalar vonMisesFailure2DStressSens( const TacsScalar stress[],
TacsScalar sens[] );
private:
MaterialType mat_type;
// Density
TacsScalar rho;
// Specific heat
TacsScalar specific_heat;
// Isotropic properties
TacsScalar E, nu, G; // Modulus and Poisson ratio
// Coefficient of thermal expansion
TacsScalar alpha;
// Yield stress value
TacsScalar ys;
// Thermal conductivity coefficient
TacsScalar kappa;
// The orthotropic material properties
TacsScalar E1, E2, E3, nu12, nu13, nu23, G12, G13, G23;
// The strength coefficients
TacsScalar T1, C1, T2, C2, T3, C3, S12, S13, S23;
// The thermal coefficients of expansion
TacsScalar alpha1, alpha2, alpha3;
// Thermal conductivity coefficients along each axis
TacsScalar kappa1, kappa2, kappa3;
};
/*
The following class holds the material stiffness and strength
properties for an orthotropic ply. This class is used by several
constitutive classes within TACS.
The stiffness of the ply in the global axis is supplied by the
functions calculateAbar/calculateQbar, where the argument 'angle' is
provided in radians. The failure properties are calculated either
based on a Tsai-Wu failure criterion or a smoothed maximum strain
failure criterion, where the smoothing is performed using a KS
function.
The interaction coefficient for the Tsai-Wu failure criterion is set
to zero by default. If a value of C, the failure stress under
combined in-plane loading, is supplied, the interaction coefficient
is determined. Be careful - the value can easily fall outside
acceptible bounds - these are tested during initialization.
*/
class TACSOrthotropicPly : public TACSObject {
public:
// Create OrthoPly with a full set of orthotropic material relationships
// ---------------------------------------------------------------------
TACSOrthotropicPly( TacsScalar _plyThickness,
TACSMaterialProperties *_properties );
void setKSWeight( TacsScalar _ksWeight );
void setUseMaxStrainCriterion();
void setUseTsaiWuCriterion();
// Retrieve the material properties
// --------------------------------
TacsScalar getDensity();
TacsScalar getPlyThickness();
void getStiffness( TacsScalar *_E1, TacsScalar *_E2, TacsScalar *_nu12,
TacsScalar *_G12, TacsScalar *_G23, TacsScalar *_G13 );
void getLaminateStiffness( TacsScalar *_Q11, TacsScalar *_Q12,
TacsScalar *_Q22, TacsScalar *_Q44,
TacsScalar *_Q55, TacsScalar *_Q66 );
void getStrength( TacsScalar *_Xt, TacsScalar *_Xc, TacsScalar *_Yt,
TacsScalar *_Yc, TacsScalar *_S12, TacsScalar *_C );
void getStrainStrength( TacsScalar *_eXt, TacsScalar *_eXc, TacsScalar *_eYt,
TacsScalar *_eYc, TacsScalar *_eS12 );
void getTsaiWu( TacsScalar *_F1, TacsScalar *_F2,
TacsScalar *_F11, TacsScalar *_F12, TacsScalar *_F22,
TacsScalar *_F66 );
void getLaminateInvariants( TacsScalar *U1, TacsScalar *U2,
TacsScalar *U3, TacsScalar *U4,
TacsScalar *U5, TacsScalar *U6 );
// Calculate the Abar and Qbar matrices and their derivatives
// Taken from Jones, Mechanics of composite materials pg. 51
// ----------------------------------------------------------
void calculateAbar( TacsScalar angle, TacsScalar Abar[] );
void calculateAbarAngleSens( TacsScalar angle, TacsScalar Abar[] );
void calculateQbar( TacsScalar angle, TacsScalar Qbar[] );
void calculateQbarAngleSens( TacsScalar angle, TacsScalar Qbar[] );
// Given the strain in the laminate coordinates, determine the
// stress in the laminate coordinates
// -----------------------------------------------------------
void calculateStress( TacsScalar angle,
const TacsScalar strain[],
TacsScalar stress[] );
// Given the strain in the laminate coordinates, determine the failure load
// ------------------------------------------------------------------------
TacsScalar failure( TacsScalar angle,
const TacsScalar strain[] );
TacsScalar failureStrainSens( TacsScalar angle,
const TacsScalar strain[],
TacsScalar sens[] );
TacsScalar failureAngleSens( TacsScalar angle,
const TacsScalar strain[],
TacsScalar *failSens );
// Calculate the failure load fraction for given
// constant and linear strain components
// ---------------------------------------------
TacsScalar calculateFailLoad( TacsScalar angle,
const TacsScalar cstrain[],
const TacsScalar lstrain[] );
TacsScalar calculateFailLoadStrainSens( TacsScalar angle,
const TacsScalar cstrain[],
const TacsScalar lstrain[],
TacsScalar cSens[],
TacsScalar lSens[] );
TacsScalar calculateFailLoadAngleSens( TacsScalar angle,
const TacsScalar cstrain[],
const TacsScalar lstrain[],
TacsScalar * posSens );
// Transform the stress and strain between global/local frames
// -----------------------------------------------------------
void getPlyStress( const TacsScalar strain[], TacsScalar stress[] );
void transformStressGlobal2Ply( TacsScalar angle,
const TacsScalar global[],
TacsScalar plyStress[] );
void transformStressPly2Global( TacsScalar angle,
const TacsScalar plyStress[],
TacsScalar global[] );
void transformStressGlobal2PlyAngleSens( TacsScalar angle ,
const TacsScalar global[],
TacsScalar plyStress[] );
void transformStressPly2GlobalAngleSens( TacsScalar angle,
const TacsScalar plyStress[],
TacsScalar global[] );
void transformStrainGlobal2Ply( TacsScalar angle,
const TacsScalar global[],
TacsScalar plyStrain[] );
void transformStrainPly2Global( TacsScalar angle,
const TacsScalar plyStrain[],
TacsScalar global[] );
void transformStrainGlobal2PlyAngleSens( TacsScalar angle,
const TacsScalar global[],
TacsScalar plyStrain[] );
void transformStrainPly2GlobalAngleSens( TacsScalar angle,
const TacsScalar plyStrain[],
TacsScalar global[] );
// Get or print other information
// ------------------------------
void testFailSens( double dh, TacsScalar angle );
void printProperties();
const char* getObjectName();
private:
static const char *name;
TACSMaterialProperties *properties;
// The stiffness properties
TacsScalar Q11, Q12, Q22, Q44, Q55, Q66;
TacsScalar C12, C16, C26, C66;
TacsScalar plyThickness;
TacsScalar rho;
TacsScalar E1, E2;
TacsScalar nu12, nu21;
TacsScalar G12, G23, G13;
// Keep track of which failure criterion to use
int useTsaiWuCriterion;
// The stress-based strength properties
TacsScalar Xt, Xc;
TacsScalar Yt, Yc;
TacsScalar S12;
TacsScalar C;
// The coefficients for the Tsai-Wu failure criterion
TacsScalar F1, F2;
TacsScalar F11, F12, F22, F66;
// The strain-based strength properties
TacsScalar eXt, eXc;
TacsScalar eYt, eYc;
TacsScalar eS12;
// The KS weight for the maximum-strain failure criterion
TacsScalar ksWeight;
};
#endif // TACS_MATERIAL_PROPERTIES_H
| 41.140127 | 79 | 0.604041 |
55c4462db927335f0688b08715d1830ddab09edf | 11,992 | c | C | tests/functional/log_test.c | vmware/splinterdb | 020dc748564df601add444c9276228adb4e9b00f | [
"Apache-2.0"
] | 10 | 2022-03-19T16:12:43.000Z | 2022-03-31T02:04:54.000Z | tests/functional/log_test.c | vmware/splinterdb | 020dc748564df601add444c9276228adb4e9b00f | [
"Apache-2.0"
] | 32 | 2022-03-18T23:08:13.000Z | 2022-03-31T01:33:03.000Z | tests/functional/log_test.c | vmware/splinterdb | 020dc748564df601add444c9276228adb4e9b00f | [
"Apache-2.0"
] | 2 | 2022-03-20T01:43:00.000Z | 2022-03-25T07:57:14.000Z | // Copyright 2018-2021 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
/*
* log_test.c --
*
* This file contains tests for Alex's log
*/
#include "platform.h"
#include "log.h"
#include "shard_log.h"
#include "io.h"
#include "allocator.h"
#include "rc_allocator.h"
#include "cache.h"
#include "clockcache.h"
#include "trunk.h"
#include "test.h"
#include "poison.h"
int
test_log_crash(clockcache *cc,
clockcache_config *cache_cfg,
io_handle *io,
allocator *al,
shard_log_config *cfg,
shard_log *log,
task_system *ts,
platform_heap_handle hh,
platform_heap_id hid,
test_message_generator *gen,
uint64 num_entries,
bool crash)
{
platform_status rc;
log_handle *logh;
uint64 i;
char keybuffer[MAX_KEY_SIZE];
slice returned_key;
message returned_message;
uint64 addr;
uint64 magic;
shard_log_iterator itor;
iterator *itorh = (iterator *)&itor;
char key_str[128];
char data_str[128];
bool at_end;
merge_accumulator msg;
platform_assert(cc != NULL);
rc = shard_log_init(log, (cache *)cc, cfg);
platform_assert_status_ok(rc);
logh = (log_handle *)log;
addr = log_addr(logh);
magic = log_magic(logh);
merge_accumulator_init(&msg, hid);
for (i = 0; i < num_entries; i++) {
test_key(keybuffer, TEST_RANDOM, i, 0, 0, cfg->data_cfg->key_size, 0);
generate_test_message(gen, i, &msg);
slice skey = slice_create(1 + (i % cfg->data_cfg->key_size), keybuffer);
log_write(logh, skey, merge_accumulator_to_message(&msg), i);
}
if (crash) {
clockcache_deinit(cc);
rc = clockcache_init(cc,
cache_cfg,
io,
al,
"crashed",
ts,
hh,
hid,
platform_get_module_id());
platform_assert_status_ok(rc);
}
rc = shard_log_iterator_init((cache *)cc, cfg, hid, addr, magic, &itor);
platform_assert_status_ok(rc);
itorh = (iterator *)&itor;
iterator_at_end(itorh, &at_end);
for (i = 0; i < num_entries && !at_end; i++) {
test_key(keybuffer, TEST_RANDOM, i, 0, 0, cfg->data_cfg->key_size, 0);
generate_test_message(gen, i, &msg);
slice skey = slice_create(1 + (i % cfg->data_cfg->key_size), keybuffer);
message mmessage = merge_accumulator_to_message(&msg);
iterator_get_curr(itorh, &returned_key, &returned_message);
if (slice_lex_cmp(skey, returned_key)
|| message_lex_cmp(mmessage, returned_message))
{
platform_default_log("log_test_basic: key or data mismatch\n");
data_key_to_string(cfg->data_cfg, skey, key_str, 128);
data_message_to_string(cfg->data_cfg, mmessage, data_str, 128);
platform_default_log("expected: %s -- %s\n", key_str, data_str);
data_key_to_string(cfg->data_cfg, returned_key, key_str, 128);
data_message_to_string(cfg->data_cfg, returned_message, data_str, 128);
platform_default_log("actual: %s -- %s\n", key_str, data_str);
platform_assert(0);
}
iterator_advance(itorh);
iterator_at_end(itorh, &at_end);
}
platform_default_log("log returned %lu of %lu entries\n", i, num_entries);
shard_log_iterator_deinit(hid, &itor);
shard_log_zap(log);
return 0;
}
typedef struct test_log_thread_params {
shard_log *log;
platform_thread thread;
int thread_id;
test_message_generator *gen;
uint64 num_entries;
} test_log_thread_params;
void
test_log_thread(void *arg)
{
platform_heap_id hid = platform_get_heap_id();
test_log_thread_params *params = (test_log_thread_params *)arg;
shard_log *log = params->log;
log_handle *logh = (log_handle *)log;
int thread_id = params->thread_id;
uint64 num_entries = params->num_entries;
test_message_generator *gen = params->gen;
uint64 i;
char key[MAX_KEY_SIZE];
merge_accumulator msg;
slice skey = slice_create(log->cfg->data_cfg->key_size, key);
merge_accumulator_init(&msg, hid);
for (i = thread_id * num_entries; i < (thread_id + 1) * num_entries; i++) {
test_key(key, TEST_RANDOM, i, 0, 0, log->cfg->data_cfg->key_size, 0);
generate_test_message(gen, i, &msg);
log_write(logh, skey, merge_accumulator_to_message(&msg), i);
}
}
platform_status
test_log_perf(cache *cc,
shard_log_config *cfg,
shard_log *log,
uint64 num_entries,
test_message_generator *gen,
uint64 num_threads,
task_system *ts,
platform_heap_id hid)
{
test_log_thread_params *params =
TYPED_ARRAY_MALLOC(hid, params, num_threads);
platform_assert(params);
uint64 start_time;
platform_status ret;
ret = shard_log_init(log, (cache *)cc, cfg);
platform_assert_status_ok(ret);
for (uint64 i = 0; i < num_threads; i++) {
params[i].log = log;
params[i].thread_id = i;
params[i].gen = gen;
params[i].num_entries = num_entries / num_threads;
}
start_time = platform_get_timestamp();
for (uint64 i = 0; i < num_threads; i++) {
ret = task_thread_create("log_thread",
test_log_thread,
¶ms[i],
0,
ts,
hid,
¶ms[i].thread);
if (!SUCCESS(ret)) {
// Wait for existing threads to quit
for (uint64 j = 0; j < i; j++) {
platform_thread_join(params[i].thread);
}
goto cleanup;
}
}
for (uint64 i = 0; i < num_threads; i++) {
platform_thread_join(params[i].thread);
}
platform_default_log("log insertion rate: %luM insertions/second\n",
SEC_TO_MSEC(num_entries)
/ platform_timestamp_elapsed(start_time));
cleanup:
platform_free(hid, params);
return ret;
}
static void
usage(const char *argv0)
{
platform_error_log("Usage:\n"
"\t%s\n"
"\t%s --perf\n"
"\t%s --crash\n",
argv0,
argv0,
argv0);
config_usage();
}
int
log_test(int argc, char *argv[])
{
platform_status status;
data_config *data_cfg;
io_config io_cfg;
rc_allocator_config al_cfg;
clockcache_config cache_cfg;
shard_log_config log_cfg;
rc_allocator al;
platform_status ret;
int config_argc;
char **config_argv;
bool run_perf_test;
bool run_crash_test;
int rc;
uint64 seed;
task_system *ts;
test_message_generator gen;
if (argc > 1 && strncmp(argv[1], "--perf", sizeof("--perf")) == 0) {
run_perf_test = TRUE;
run_crash_test = FALSE;
config_argc = argc - 2;
config_argv = argv + 2;
} else if (argc > 1 && strncmp(argv[1], "--crash", sizeof("--crash")) == 0) {
run_perf_test = FALSE;
run_crash_test = TRUE;
config_argc = argc - 2;
config_argv = argv + 2;
} else {
run_perf_test = FALSE;
run_crash_test = FALSE;
config_argc = argc - 1;
config_argv = argv + 1;
}
platform_default_log("\nStarted log_test!!\n");
// Create a heap for io, allocator, cache and splinter
platform_heap_handle hh;
platform_heap_id hid;
status = platform_heap_create(platform_get_module_id(), 1 * GiB, &hh, &hid);
platform_assert_status_ok(status);
trunk_config *cfg = TYPED_MALLOC(hid, cfg);
status = test_parse_args(cfg,
&data_cfg,
&io_cfg,
&al_cfg,
&cache_cfg,
&log_cfg,
&seed,
&gen,
config_argc,
config_argv);
if (!SUCCESS(status)) {
platform_error_log("log_test: failed to parse config: %s\n",
platform_status_to_string(status));
/*
* Provided arguments but set things up incorrectly.
* Print usage so client can fix commandline.
*/
usage(argv[0]);
rc = -1;
goto cleanup;
}
platform_io_handle *io = TYPED_MALLOC(hid, io);
platform_assert(io != NULL);
status = io_handle_init(io, &io_cfg, hh, hid);
if (!SUCCESS(status)) {
rc = -1;
goto free_iohandle;
}
uint8 num_bg_threads[NUM_TASK_TYPES] = {0}; // no bg threads
status = test_init_task_system(
hid, io, &ts, cfg->use_stats, FALSE, num_bg_threads);
if (!SUCCESS(status)) {
platform_error_log("Failed to init splinter state: %s\n",
platform_status_to_string(status));
rc = -1;
goto deinit_iohandle;
}
status = rc_allocator_init(
&al, &al_cfg, (io_handle *)io, hh, hid, platform_get_module_id());
platform_assert_status_ok(status);
clockcache *cc = TYPED_MALLOC(hid, cc);
platform_assert(cc != NULL);
status = clockcache_init(cc,
&cache_cfg,
(io_handle *)io,
(allocator *)&al,
"test",
ts,
hh,
hid,
platform_get_module_id());
platform_assert_status_ok(status);
shard_log *log = TYPED_MALLOC(hid, log);
platform_assert(log != NULL);
if (run_perf_test) {
ret = test_log_perf(
(cache *)cc, &log_cfg, log, 200000000, &gen, 16, ts, hid);
rc = -1;
platform_assert_status_ok(ret);
} else if (run_crash_test) {
rc = test_log_crash(cc,
&cache_cfg,
(io_handle *)io,
(allocator *)&al,
&log_cfg,
log,
ts,
hh,
hid,
&gen,
500000,
TRUE /* crash */);
platform_assert(rc == 0);
} else {
rc = test_log_crash(cc,
&cache_cfg,
(io_handle *)io,
(allocator *)&al,
&log_cfg,
log,
ts,
hh,
hid,
&gen,
500000,
FALSE /* don't cash */);
platform_assert(rc == 0);
}
clockcache_deinit(cc);
platform_free(hid, log);
platform_free(hid, cc);
rc_allocator_deinit(&al);
test_deinit_task_system(hid, &ts);
deinit_iohandle:
io_handle_deinit(io);
free_iohandle:
platform_free(hid, io);
cleanup:
platform_free(hid, cfg);
platform_heap_destroy(&hh);
return rc == 0 ? 0 : -1;
}
| 31.557895 | 80 | 0.512759 |
b1f3bf671174d75a4323b4f0e39545bacdd08c92 | 355 | c | C | test/mem_safety/use_after_free/use_after_free-043.c | spurious/safecode-mirror | 238e1a381674528f642e1ee6be1e1b7df465672e | [
"NCSA"
] | 5 | 2015-07-23T09:47:12.000Z | 2019-11-28T01:34:01.000Z | test/mem_safety/use_after_free/use_after_free-043.c | spurious/safecode-mirror | 238e1a381674528f642e1ee6be1e1b7df465672e | [
"NCSA"
] | null | null | null | test/mem_safety/use_after_free/use_after_free-043.c | spurious/safecode-mirror | 238e1a381674528f642e1ee6be1e1b7df465672e | [
"NCSA"
] | 3 | 2015-10-28T18:21:02.000Z | 2019-05-06T18:35:41.000Z | /* Use of a function pointer embedded in a free'd union. */
#include <stdio.h>
#include <stdlib.h>
typedef int (*pfptr)(const char *, ...);
union test
{
pfptr func;
int value;
};
int main()
{
union test *t;
t = malloc(sizeof(union test) * 10);
t[0].value = 1000;
t[8].func = printf;
free(t);
t[8].func("hello world\n");
return 0;
}
| 14.2 | 59 | 0.597183 |
1dc0cacc83f8fd5aeb7deb587545bbd4e41b32c2 | 555 | c | C | ch09/alarm2.c | kakts/c-unix-programming | 61d4b9f6e0dff031bde40c3fa8109b3fe524e6bb | [
"MIT"
] | null | null | null | ch09/alarm2.c | kakts/c-unix-programming | 61d4b9f6e0dff031bde40c3fa8109b3fe524e6bb | [
"MIT"
] | null | null | null | ch09/alarm2.c | kakts/c-unix-programming | 61d4b9f6e0dff031bde40c3fa8109b3fe524e6bb | [
"MIT"
] | null | null | null | /**
* @file alarm2.c
*
* 演習問題9.3
* alarm signalを使って3秒後にhelloを出力して終了する
*/
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
void loop (void) {
int i;
for (i = 0; i < 0xFFFFFF; i++) {
// 時間稼ぎ用のループ
}
}
/**
* シグナルハンドラ関数
* SIGALRMを受け取った時に実行数する
*/
void handler(int sig) {
fprintf(stderr, "hello");
exit(0);
}
int main(void)
{
// alarm実行のシグナルハンドラを設定する
signal(SIGALRM, handler);
alarm(3);
while (1) {
loop(); // 時間稼ぎ
printf(".");
fflush(stdout);
}
} | 14.605263 | 37 | 0.54955 |
ceb4f963c49875a5d6827cccbe225f713d3e006c | 277 | h | C | project2D/newGame.h | DylanGuidry95/TowerOfDameon | f08f133fa4d6cd4459760cee563b6b3082253687 | [
"MIT"
] | null | null | null | project2D/newGame.h | DylanGuidry95/TowerOfDameon | f08f133fa4d6cd4459760cee563b6b3082253687 | [
"MIT"
] | null | null | null | project2D/newGame.h | DylanGuidry95/TowerOfDameon | f08f133fa4d6cd4459760cee563b6b3082253687 | [
"MIT"
] | null | null | null | #pragma once
#include <imgui.h>
#include "Hero.h"
class newGameClass
{
private:
int count = 0;
public:
newGameClass();
void draw(aie::Renderer2D* renderer, int timer, aie::Font* font);
void drawText(aie::Renderer2D* renderer, aie::Font* font);
Hero StartGame(int&);
}; | 16.294118 | 66 | 0.700361 |
076a5338d318a4458a671475e7d7c5f5f99e8c37 | 571 | c | C | pp010.c | Chauhan5devanshi/cke | 98ba75759c9fcfc720a52fb179ed17fe4adaea91 | [
"Apache-2.0"
] | null | null | null | pp010.c | Chauhan5devanshi/cke | 98ba75759c9fcfc720a52fb179ed17fe4adaea91 | [
"Apache-2.0"
] | null | null | null | pp010.c | Chauhan5devanshi/cke | 98ba75759c9fcfc720a52fb179ed17fe4adaea91 | [
"Apache-2.0"
] | null | null | null | /*pp010: Create a header file as pp010.h having a function iseven() which takes a number as input and returns 1
if the number is even else returns 0. Write a program pp010.c, include the header file into it. Create the main function to input a number and check it to be even or odd.*/
#include"stdio.h"
#include"pp010.h" //here, pp010 is a header file
main()
{ int num;
printf("Enter the number :");
scanf("%d",&num);
if(is_even(num))printf("%d is even",num);
else printf("%d is odd",num);
}
/*OUTPUT
Enter the number :34567890
34567890 is even*/
| 38.066667 | 173 | 0.690018 |
a321155becce6e5e98e9a202dc9e70121576c441 | 767 | h | C | src/blogc/content-parser.h | rafaelmartins/blogc | 826db80e884cfd6a716e68db7a7dd01acd4f0936 | [
"BSD-3-Clause"
] | 204 | 2015-07-24T20:52:53.000Z | 2022-03-19T13:32:36.000Z | src/blogc/content-parser.h | rafaelmartins/blogc | 826db80e884cfd6a716e68db7a7dd01acd4f0936 | [
"BSD-3-Clause"
] | 14 | 2015-10-27T14:15:15.000Z | 2020-12-19T22:00:31.000Z | src/blogc/content-parser.h | rafaelmartins/blogc | 826db80e884cfd6a716e68db7a7dd01acd4f0936 | [
"BSD-3-Clause"
] | 22 | 2015-10-04T11:50:31.000Z | 2021-12-25T10:37:50.000Z | /*
* blogc: A blog compiler.
* Copyright (C) 2014-2020 Rafael G. Martins <rafael@rafaelmartins.eng.br>
*
* This program can be distributed under the terms of the BSD License.
* See the file LICENSE.
*/
#ifndef _CONTENT_PARSER_H
#define _CONTENT_PARSER_H
#include <stddef.h>
#include <stdbool.h>
#include "../common/utils.h"
char* blogc_slugify(const char *str);
char* blogc_htmlentities(const char *str);
char* blogc_fix_description(const char *paragraph);
char* blogc_content_parse_inline(const char *src);
bool blogc_is_ordered_list_item(const char *str, size_t prefix_len);
char* blogc_content_parse(const char *src, size_t *end_excerpt,
char **first_header, char **description, char **endl,
bc_slist_t **headers);
#endif /* _CONTENT_PARSER_H */
| 29.5 | 74 | 0.750978 |
ed22793ec1e3e798316a6e7714325e995e0fac19 | 6,793 | h | C | EB_GUIDE_GTF/model_extensions/GaussianBlur/src/GaussianBlur.h | pethipet/eb-guide-examples | 1c14fdb6eebdd8b164d99b519161160ecc5a29cf | [
"MIT"
] | null | null | null | EB_GUIDE_GTF/model_extensions/GaussianBlur/src/GaussianBlur.h | pethipet/eb-guide-examples | 1c14fdb6eebdd8b164d99b519161160ecc5a29cf | [
"MIT"
] | null | null | null | EB_GUIDE_GTF/model_extensions/GaussianBlur/src/GaussianBlur.h | pethipet/eb-guide-examples | 1c14fdb6eebdd8b164d99b519161160ecc5a29cf | [
"MIT"
] | null | null | null | ////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Elektrobit Automotive GmbH
// Alle Rechte vorbehalten. All Rights Reserved.
//
// Information contained herein is subject to change without notice.
// Elektrobit retains ownership and all other rights in the software and each
// component thereof.
// Any reproduction of the software or components thereof without the prior
// written permission of Elektrobit is prohibited.
////////////////////////////////////////////////////////////////////////////////
#ifndef GAUSSIAN_BLUR_H
#define GAUSSIAN_BLUR_H
#include <gtf/scdr/RenderObjectUtils.h>
#include <gtf/scdr/gpu/Framebuffer.h>
#include <gtf/scdr/gpu/SamplerState.h>
#include <gtf/scdr/gpu/ShaderConstant.h>
#include <gtf/scdr/widgets/IWidgetRenderer.h>
#include <gtf/utils/math/matrix4x4.h>
class GaussianBlurRenderObject;
struct GaussianBlurVertex
{
float posX;
float posY;
float texU;
float texV;
};
struct GaussianBlurProperties
{
gtf::scdr::WidgetPropertiesCommon2D common2d;
uint16_t enabled;
uint16_t sigma;
};
struct GaussianBlurFeatures
{
gtf::scdr::WidgetFeaturesCommon2D common2d;
};
struct BlurPassShaderConstants
{
gtf::scdr::ShaderConstant* texture0;
gtf::scdr::ShaderConstant* offsets;
gtf::scdr::ShaderConstant* weights;
gtf::scdr::ShaderConstant* weightCount;
gtf::scdr::ShaderConstant* direction;
};
struct BlitPassShaderConstants
{
gtf::scdr::ShaderConstant* projMat;
gtf::scdr::ShaderConstant* modelMat;
gtf::scdr::ShaderConstant* object2Alpha;
gtf::scdr::ShaderConstant* texture0;
gtf::scdr::ShaderConstant* texture1;
};
struct GaussianBlurGraphicObjects
{
BlurPassShaderConstants blurShaderConstants;
BlitPassShaderConstants shaderConstants;
BlitPassShaderConstants shaderConstantsWithAlphaMask;
gtf::scdr::PipelineStateObject* psoBlur;
gtf::scdr::PipelineStateObject* psoBlit;
gtf::scdr::PipelineStateObject* psoAlphaBlit;
gtf::scdr::VertexBuffer* vertices;
gtf::scdr::SamplerState* sampler0;
gtf::scdr::SamplerState* sampler1;
};
//!
//! \brief Implements a Gaussian blur widget. The blur effect is applied to all child widgets.
//!
class GaussianBlur : public gtf::scdr::IWidgetRenderer
{
private:
GaussianBlur(const GaussianBlur&);
GaussianBlur& operator=(const GaussianBlur&);
GaussianBlur(const gtf::scene::TypeResolver& resolver_);
public:
//!
//! \brief Creates an instance of the GaussianBlur renderer.
//!
//! \param[in] resolver_ The type resolver.
//! \param[in] dataStore_ The DataStore that provides access to various other SCDR interfaces.
//! \param[in] commandBuffer_ The CommandBuffer for creating GPU resources.
//! \param[in] frameAllocator_ An efficient allocator for transient, short-lived memory that can be used during command execution.
//! \param[in] createParams_ A pointer to user specific parameters.
//!
//! \return An instance of the GaussianBlur.
//!
//! \note
//! The lifetime of the createParams_ must extend over the entire lifetime of the program. Also, the
//! instance will be destroyed through destroyInstance on shutdown.
//!
static gtf::scdr::IWidgetRenderer* createInstance(
const gtf::scene::TypeResolver& resolver_,
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_,
const void* createParams_);
//!
//! \brief Destroys an instance of the RippleEffect
//!
//! \param[in] renderer_ The renderer to destroy.
//! \param[in] dataStore_ The DataStore to provide access to various other SCDR interfaces.
//! \param[in] commandBuffer_ The CommandBuffer for destroying GPU resources.
//! \param[in] frameAllocator_ An efficient allocator for transient, short-lived memory that can be used during command execution.
//!
static void destroyInstance(
gtf::scdr::IWidgetRenderer* renderer_,
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_);
~GaussianBlur() = default;
public: // gtf::scdr::WidgetRenderer interface
bool init(
const gtf::scene::TypeResolver& typeResolver_,
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
void deinit(
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
bool update(
gtf::scdr::ResourceLoader& resourceLoader_,
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
bool render(
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
bool begin(
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
bool end(
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
gtf::scdr::RenderObject* createRenderObject(
gtf::properties::Container& widget_,
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
void destroyRenderObject(
gtf::scdr::RenderObject* object_,
gtf::scdr::DataStore& dataStore_,
gtf::scdr::CommandBuffer& commandBuffer_,
gtf::scdr::Allocator& frameAllocator_) final override;
bool traverse(
gtf::properties::Container& widget_,
const gtf::scdr::RenderObjectStackFrame& parentStackFrame_,
gtf::scdr::RenderObjectStackFrame& objectStackFrame_,
gtf::scdr::RenderObject& object_,
gtf::scdr::TraverserContext& traverserContext_) final override;
private:
bool isValid() const;
bool enable(bool enabledPropety_) const;
private:
gtf::scdr::GraphicsApi api;
GaussianBlurRenderObject* objects;
GaussianBlurGraphicObjects graphicObjects;
GaussianBlurProperties properties;
GaussianBlurFeatures features;
};
#endif // GAUSSIAN_BLUR_H
| 35.565445 | 134 | 0.663477 |
4be4ad9030e38a2ea9fe2afb40e6bc3408c4ea7b | 1,365 | h | C | clang-tidy/modernize/DeprecatedHeadersCheck.h | Szelethus/clang-tools-extra | 4bff9e7bc96ac495d7b6b2e8cc6c6f629e824022 | [
"Apache-2.0"
] | null | null | null | clang-tidy/modernize/DeprecatedHeadersCheck.h | Szelethus/clang-tools-extra | 4bff9e7bc96ac495d7b6b2e8cc6c6f629e824022 | [
"Apache-2.0"
] | 2 | 2019-01-24T00:38:27.000Z | 2019-02-28T00:23:56.000Z | clang-tidy/modernize/DeprecatedHeadersCheck.h | Szelethus/clang-tools-extra | 4bff9e7bc96ac495d7b6b2e8cc6c6f629e824022 | [
"Apache-2.0"
] | null | null | null | //===--- DeprecatedHeadersCheck.h - clang-tidy-------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
#include "../ClangTidy.h"
namespace clang {
namespace tidy {
namespace modernize {
/// This check replaces deprecated C library headers with their C++ STL
/// alternatives.
///
/// Before:
/// ~~~{.cpp}
/// #include <header.h>
/// ~~~
///
/// After:
/// ~~~{.cpp}
/// #include <cheader>
/// ~~~
///
/// Example: ``<stdio.h> => <cstdio>``
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/modernize-deprecated-headers.html
class DeprecatedHeadersCheck : public ClangTidyCheck {
public:
DeprecatedHeadersCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerPPCallbacks(CompilerInstance &Compiler) override;
};
} // namespace modernize
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_C_HEADERS_TO_CXX_H
| 29.042553 | 83 | 0.671795 |
d461c9094a1ae7f27962320eaf1bf980d514531e | 5,052 | c | C | HW07/main.c | ruibinjiang/ECE-264-Solutions | a93fcd370bc2bc932fd751864d3b722997d92ac1 | [
"Apache-2.0"
] | null | null | null | HW07/main.c | ruibinjiang/ECE-264-Solutions | a93fcd370bc2bc932fd751864d3b722997d92ac1 | [
"Apache-2.0"
] | null | null | null | HW07/main.c | ruibinjiang/ECE-264-Solutions | a93fcd370bc2bc932fd751864d3b722997d92ac1 | [
"Apache-2.0"
] | null | null | null | //You must modify specific portions of this file
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#ifdef TEST_MERGE
/* The merge(arr, l, m, r) is key process that assumes that arr[l..m] and
arr[m+1..r] are sorted and merges the two sorted sub-arrays into one.*/
void merge(int arr[], int l, int m, int r)
{
/* int l defines the start index of the left sub array
int r defines the end index of the right sub array, if the length of array is n, then r=n-1
int m can be defined as (l+r)/2 or l+(r-l)/2, use the later to avoid overflow
m is the endpoint of the left sub array.
For example- an array of size 5 has start index l= 0, and end index r= 4,
Therefore, m = 2
*/
int n1 = m - l + 1; //The number of elements in the left sub array
int n2 = r - m; //The number of elements in trhe right sub array
//create temporary arrays dynamically to help with sorting
int *L=malloc(sizeof(* L) * n1);
int *R=malloc(sizeof(* R) * n2);
/* NOTE:
L[] is the left sub array
R[] is the right sub array
L[] is different from l. l is the starting index of left sub array.
R[] is different from r. r is the ending index for the right sub array.
Please do not be confused
*/
//WRITE YOUR CODE BELOW THIS
//Initialise variables
int index;
int iL = 0;
int iR = 0;
/*
1.Copy data to temp arrays L[] and R[] from arr[]
2. Merge the temp arrays back into arr[l..r]
3. Copy the remaining elements of L[], check if there
are any
4. Copy the remaining elements of R[], check if there
are any */
for(index = 0; index < n1; index++){
L[index] = arr[l+index];
}
for(index = 0; index < n2; index++){
R[index] = arr[m+1+index];
}
index=l;
while(iL < n1 && iR < n2){
if(L[iL] <= R[iR]){
arr[index] = L[iL];
++iL;
}
else{
arr[index] = R[iR];
++iR;
}
++index;
}
while (iL < n1) {
arr[index] = L[iL];
iL++;
index++;
}
while (iR < n2) {
arr[index] = R[iR];
iR++;
index++;
}
free(L);
free(R);
//DO not modify below this line until specified in comments
}
#endif
/* Merge Sort uses recursion to call itself. Thus, efficiently dividing the array into two halves.
Then it must sort each half individually and finally join them back together using merge() into a single sorted array*/
#ifdef TEST_MERGESSORT
void mergeSort(int arr[], int l, int r)
{
/* int l defines the start index of the left sub array
int r defines the end index of the right sub array
int m has to be defined as (l+r)/2 or l+(r-l)/2, use the later to avoid overflow
m will represent the endpoint of the left sub array.
For example- an array of size 6 has start index l= 0, and end index r= 5,
Therefore, m = 2*/
//MODIFY THE CODE BELOW THIS LINE
/*
1. SET CONDITION for RECURSION
2. Sort first half arr[l..m]
3. Sort second half arr[m+1..r]
4. Use the merge() function to arrange in order */
int m = l + (r - l) / 2;
if (l >= r){return;}
mergeSort(arr, l, m);
mergeSort(arr, m+1, r);
merge(arr, l, m ,r);
//DO not modify below this line until specified in comments
}
#endif
int main(int argc, char * * argv)
{
// read input file
if (argc != 3)
{
fprintf(stderr, "need the name of input and output file\n");
return EXIT_FAILURE;
}
// open file to read
FILE * fptr = fopen(argv[1], "r");
if (fptr == NULL)
{
fprintf(stderr, "fopen fail\n");
// do not fclose (fptr) because fptr failed
return EXIT_FAILURE;
}
// count the number of integers
int value;
int count = 0;
while (fscanf(fptr, "%d", & value) == 1)
{
count ++;
}
// allocate memory to store the numbers
int * arr = malloc(sizeof(int) * count);
if (arr == NULL) // malloc fail
{
fprintf(stderr, "malloc fail\n");
fclose (fptr);
return EXIT_FAILURE;
}
// return to the beginning of the file
fseek (fptr, 0, SEEK_SET);
int ind = 0;
while (ind < count)
{
if (fscanf(fptr, "%d", & arr[ind]) != 1)
{
fprintf(stderr, "fscanf fail\n");
fclose (fptr);
free (arr);
return EXIT_FAILURE;
}
ind ++;
}
fclose(fptr);
#ifdef TEST_MERGESORT
// modify here between ifdef and endif
// do not modify anywhere else in this function
// call mergesort function and provide the correct arguments (Hint: array, start index, end index)
mergeSort(arr, 0, count-1);
#endif
int i;
/* open the file for writing*/
FILE * fp = fopen(argv[2], "w");
if (fp == NULL)
{
fprintf(stderr, "fopen fail\n");
// do not fclose (fp) because fp failed
return EXIT_FAILURE;
}
for (i = 0; i < count; i ++)
{
fprintf (fp,"%d\n", arr[i]);
}
fclose (fp);
free (arr);
return EXIT_SUCCESS;
}
/* After completion of code check for FLAGS:
TEST_MERGE
TEST_MERGESORT
TEST_MERGESSORT
The three flags must be defined for grading*/
| 27.308108 | 119 | 0.604909 |
d46f8faa8ceee751b885678a6579bc782c80f62d | 233 | h | C | qsnake/game/brick.h | SeanChao/Snake-Infinity | 90b257c79aedfd0983a68fc9546fce48d33d3a09 | [
"MIT"
] | null | null | null | qsnake/game/brick.h | SeanChao/Snake-Infinity | 90b257c79aedfd0983a68fc9546fce48d33d3a09 | [
"MIT"
] | null | null | null | qsnake/game/brick.h | SeanChao/Snake-Infinity | 90b257c79aedfd0983a68fc9546fce48d33d3a09 | [
"MIT"
] | null | null | null | #include "point.h"
#include <vector>
class Brick {
private:
std::vector<Point> brick_point;
public:
Brick(int cell_number);
~Brick();
bool inBrick(const Point &p) const;
std::vector<Point>* getBrick();
}; | 16.642857 | 39 | 0.630901 |
54d1d3a4e76f884326dd020d006bfd48b03a8fe1 | 5,627 | c | C | src/kernel/memory.c | macminix/MacMinix | 12262051184fb2fe10ad0a2156546454e38a3e57 | [
"BSD-3-Clause"
] | 30 | 2015-02-17T23:26:16.000Z | 2022-02-22T19:40:04.000Z | src/kernel/memory.c | macminix/MacMinix | 12262051184fb2fe10ad0a2156546454e38a3e57 | [
"BSD-3-Clause"
] | null | null | null | src/kernel/memory.c | macminix/MacMinix | 12262051184fb2fe10ad0a2156546454e38a3e57 | [
"BSD-3-Clause"
] | 7 | 2016-07-02T20:33:49.000Z | 2022-02-23T14:03:58.000Z | /* This file contains the drivers for the following special files:
* /dev/null - null device (data sink)
* /dev/mem - absolute memory
* /dev/kmem - kernel virtual memory
* /dev/ram - RAM disk
* /dev/port - i/o ports ((CHIP == INTEL) only)
*
* The driver supports the following operations (using message format m2):
*
* m_type DEVICE PROC_NR COUNT POSITION ADRRESS
* ----------------------------------------------------------------
* | DISK_READ | device | proc nr | bytes | offset | buf ptr |
* |------------+---------+---------+---------+---------+---------|
* | DISK_WRITE | device | proc nr | bytes | offset | buf ptr |
* |------------+---------+---------+---------+---------+---------|
* | DISK_IOCTL | device | | blocks | ram org | |
* ----------------------------------------------------------------
* |SCATTERED_IO| device | proc nr | requests| | iov ptr |
* ----------------------------------------------------------------
*
*
* The file contains one entry point:
*
* mem_task: main entry when system is brought up
*
*/
#include "kernel.h"
#include <minix/callnr.h>
#include <minix/com.h>
#ifdef PORT_DEV
#define NR_RAMS 5 /* number of RAM-type devices */
#else
#define NR_RAMS 4
#endif
PRIVATE message mess; /* message buffer */
PRIVATE phys_bytes ram_origin[NR_RAMS]; /* origin of each RAM disk */
PRIVATE phys_bytes ram_limit[NR_RAMS]; /* limit of RAM disk per minor dev. */
FORWARD _PROTOTYPE( int do_mem, ( message *m_ptr ) );
FORWARD _PROTOTYPE( int do_setup, ( message *m_ptr ) );
/*===========================================================================*
* mem_task *
*===========================================================================*/
PUBLIC void mem_task()
{
/* Main program of the memory task. */
int r, caller, proc_nr;
/* Initialize this task. */
ram_origin[KMEM_DEV] = code_base;
ram_limit[KMEM_DEV] = ((phys_bytes) sizes[1] << CLICK_SHIFT) +
ram_origin[KMEM_DEV];
#if (CHIP == INTEL)
if (!protected_mode)
ram_limit[MEM_DEV] = 0x100000; /* above 1M em_xfer word count fails */
else
ram_limit[MEM_DEV] = 0x1000000; /* above 16M not mapped on 386 */
ram_limit[PORT_DEV] = 0x10000;
#else
#if (CHIP == M68000)
ram_limit[MEM_DEV] = MEM_BYTES;
#else
#error /* memory limit not set up */
#endif
#endif
/* Here is the main loop of the memory task. It waits for a message, carries
* it out, and sends a reply.
*/
while (TRUE) {
/* First wait for a request to read or write. */
receive(ANY, &mess);
if (mess.m_source < 0)
panic("mem task got message from ", mess.m_source);
caller = mess.m_source;
proc_nr = mess.PROC_NR;
/* Now carry out the work. It depends on the opcode. */
switch(mess.m_type) {
case DISK_READ: r = do_mem(&mess); break;
case DISK_WRITE: r = do_mem(&mess); break;
case SCATTERED_IO: r = do_vrdwt(&mess, do_mem); break;
case DISK_IOCTL: r = do_setup(&mess); break;
default: r = EINVAL; break;
}
/* Finally, prepare and send the reply message. */
mess.m_type = TASK_REPLY;
mess.REP_PROC_NR = proc_nr;
mess.REP_STATUS = r;
send(caller, &mess);
}
}
/*===========================================================================*
* do_mem *
*===========================================================================*/
PRIVATE int do_mem(m_ptr)
register message *m_ptr; /* pointer to read or write message */
{
/* Read or write /dev/null, /dev/mem, /dev/kmem, /dev/ram or /dev/port. */
int device, count, endport, port, portval;
phys_bytes mem_phys, user_phys;
/* Get minor device number and check for /dev/null. */
device = m_ptr->DEVICE;
if (device < 0 || device >= NR_RAMS) return(ENXIO); /* bad minor device */
if (device==NULL_DEV) return(m_ptr->m_type == DISK_READ ? 0 : m_ptr->COUNT);
/* Set up 'mem_phys' for /dev/mem, /dev/kmem, or /dev/ram. */
if (m_ptr->POSITION < 0) return(ENXIO);
mem_phys = ram_origin[device] + m_ptr->POSITION;
if (mem_phys >= ram_limit[device]) return(0);
count = m_ptr->COUNT;
if(mem_phys + count > ram_limit[device]) count = ram_limit[device] - mem_phys;
/* Determine address where data is to go or to come from. */
user_phys = numap(m_ptr->PROC_NR, (vir_bytes) m_ptr->ADDRESS,
(vir_bytes) count);
if (user_phys == 0) return(E_BAD_ADDR);
#ifdef PORT_DEV
/* Do special case of /dev/port. */
if (device == PORT_DEV) {
port = mem_phys;
mem_phys = umap(proc_ptr, D, (vir_bytes) &portval, (vir_bytes) 1);
for (endport = port + count; port != endport; ++port) {
if (m_ptr->m_type == DISK_READ) {
portval = in_byte(port);
phys_copy(mem_phys, user_phys++, (phys_bytes) 1);
} else {
phys_copy(user_phys++, mem_phys, (phys_bytes) 1);
out_byte(port, portval);
}
}
return(count);
}
#endif
/* Copy the data. */
if (m_ptr->m_type == DISK_READ)
phys_copy(mem_phys, user_phys, (long) count);
else
phys_copy(user_phys, mem_phys, (long) count);
return(count);
}
/*===========================================================================*
* do_setup *
*===========================================================================*/
PRIVATE int do_setup(m_ptr)
message *m_ptr; /* pointer to read or write message */
{
/* Set parameters for one of the disk RAMs. */
int device;
device = m_ptr->DEVICE;
if (device != RAM_DEV) return(ENXIO); /* bad minor device */
ram_origin[device] = m_ptr->POSITION;
ram_limit[device] = m_ptr->POSITION + (long) m_ptr->COUNT * BLOCK_SIZE;
return(OK);
}
| 32.906433 | 80 | 0.550382 |
8830cc971fd8b07fa0756fb5504019111376167f | 1,943 | h | C | src/include/OpenGLMeshRender/mesh_traits.h | gig2/OpenGLMeshRender | be37ec36c859ee426b214038037cefd88b8fa7e2 | [
"BSD-3-Clause"
] | null | null | null | src/include/OpenGLMeshRender/mesh_traits.h | gig2/OpenGLMeshRender | be37ec36c859ee426b214038037cefd88b8fa7e2 | [
"BSD-3-Clause"
] | null | null | null | src/include/OpenGLMeshRender/mesh_traits.h | gig2/OpenGLMeshRender | be37ec36c859ee426b214038037cefd88b8fa7e2 | [
"BSD-3-Clause"
] | null | null | null | #include "void_t.h"
#include <type_traits>
// This is what we will use intensivly with
// everything related to enable_if mechanism
// see https://www.fluentcpp.com/2018/05/15/make-sfinae-pretty-1-what-value-sfinae-brings-to-code/
// and the second part
// https://www.fluentcpp.com/2018/05/18/make-sfinae-pretty-2-hidden-beauty-sfinae/
// So it is a multiple part process
// First we begin by declaring some traits at false_type
template <typename T, typename Enabled = void>
struct has_vertices : std::false_type
{
};
template <typename T, typename Enabled = void>
struct has_colors : std::false_type
{
};
template <typename T, typename Enabled = void>
struct has_uv : std::false_type
{
};
// then we specialize those to true_type for Mesh that can
// call the expected function
template <typename MeshT>
struct has_vertices<MeshT, tryToInstanciate<decltype( std::declval<MeshT>().getVerticesPointer() )>>
: std::true_type
{
};
template <typename MeshT>
struct has_colors<MeshT, tryToInstanciate<decltype( std::declval<MeshT>().getColorsPointer() )>>
: std::true_type
{
};
template <typename MeshT>
struct has_uv<MeshT, tryToInstanciate<decltype( std::declval<MeshT>().getUVPointer() )>>
: std::true_type
{
};
// now we make SFINAE more expressive
// so that we can use them more readable
// in our template parameter
template <typename T>
using require_vertices = std::enable_if_t<has_vertices<T>::value, dummy::type>;
template <typename T>
using require_no_vertices = std::enable_if_t<!has_vertices<T>::value, dummy::type>;
template <typename T>
using require_colors = std::enable_if_t<has_colors<T>::value, dummy::type>;
template <typename T>
using require_no_colors = std::enable_if_t<!has_colors<T>::value, dummy::type>;
template <typename T>
using require_uv = std::enable_if_t<has_uv<T>::value, dummy::type>;
template <typename T>
using require_no_uv = std::enable_if_t<!has_uv<T>::value, dummy::type>;
| 26.616438 | 100 | 0.743181 |
f87ce2cfd2cc33232801e82a2df36376f23a6071 | 484 | c | C | test.c | hcnn/stopping_converge | 648a852ac1e518d9310ae6764e3feec2823c35c6 | [
"MIT"
] | null | null | null | test.c | hcnn/stopping_converge | 648a852ac1e518d9310ae6764e3feec2823c35c6 | [
"MIT"
] | null | null | null | test.c | hcnn/stopping_converge | 648a852ac1e518d9310ae6764e3feec2823c35c6 | [
"MIT"
] | null | null | null | #include <stdio.h> // printf
#include "stopping_converge.h"
int main()
{
double lambda = 10;
double f0 = 10.0;
double f1 = 10.1;
bool res;
res = stopping_converge(f1, f0, lambda);
printf("%s\n", res ? "true -> stop" : "false -> proceed");
res = stopping_converge(f1, f0, 1.0);
printf("%s\n", res ? "true -> stop" : "false -> proceed");
res = stopping_converge(f1, f0, 0.9);
printf("%s\n", res ? "true -> stop" : "false -> proceed");
}
| 24.2 | 62 | 0.555785 |
f77d5b36d7ccc4d46d75012ab472e2f1162077e9 | 23,788 | h | C | libical/libical-1.0/src/libical/autogenex/icalderivedproperty.h | imx6uldev/depedency_tools | 0748392a4e97ded2a770b6fbcab281dd3fda2db7 | [
"MIT"
] | null | null | null | libical/libical-1.0/src/libical/autogenex/icalderivedproperty.h | imx6uldev/depedency_tools | 0748392a4e97ded2a770b6fbcab281dd3fda2db7 | [
"MIT"
] | null | null | null | libical/libical-1.0/src/libical/autogenex/icalderivedproperty.h | imx6uldev/depedency_tools | 0748392a4e97ded2a770b6fbcab281dd3fda2db7 | [
"MIT"
] | null | null | null | /* -*- Mode: C -*-
======================================================================
FILE: icalderivedproperties.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedproperty.h,v 1.5 2002-09-01 19:12:31 gray-john Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
======================================================================*/
#ifndef ICALDERIVEDPROPERTY_H
#define ICALDERIVEDPROPERTY_H
#include <time.h>
#include "icalparameter.h"
#include "icalderivedvalue.h"
#include "icalrecur.h"
typedef struct icalproperty_impl icalproperty;
typedef enum icalproperty_kind {
ICAL_ANY_PROPERTY = 0,
ICAL_ACTION_PROPERTY,
ICAL_ALLOWCONFLICT_PROPERTY,
ICAL_ATTACH_PROPERTY,
ICAL_ATTENDEE_PROPERTY,
ICAL_CALID_PROPERTY,
ICAL_CALMASTER_PROPERTY,
ICAL_CALSCALE_PROPERTY,
ICAL_CARID_PROPERTY,
ICAL_CATEGORIES_PROPERTY,
ICAL_CLASS_PROPERTY,
ICAL_COMMENT_PROPERTY,
ICAL_COMPLETED_PROPERTY,
ICAL_CONTACT_PROPERTY,
ICAL_CREATED_PROPERTY,
ICAL_DECREED_PROPERTY,
ICAL_DEFAULTCHARSET_PROPERTY,
ICAL_DEFAULTLOCALE_PROPERTY,
ICAL_DEFAULTTZID_PROPERTY,
ICAL_DESCRIPTION_PROPERTY,
ICAL_DTEND_PROPERTY,
ICAL_DTSTAMP_PROPERTY,
ICAL_DTSTART_PROPERTY,
ICAL_DUE_PROPERTY,
ICAL_DURATION_PROPERTY,
ICAL_EXDATE_PROPERTY,
ICAL_EXPAND_PROPERTY,
ICAL_EXRULE_PROPERTY,
ICAL_FREEBUSY_PROPERTY,
ICAL_GEO_PROPERTY,
ICAL_LASTMODIFIED_PROPERTY,
ICAL_LOCATION_PROPERTY,
ICAL_MAXRESULTS_PROPERTY,
ICAL_MAXRESULTSSIZE_PROPERTY,
ICAL_METHOD_PROPERTY,
ICAL_ORGANIZER_PROPERTY,
ICAL_OWNER_PROPERTY,
ICAL_PERCENTCOMPLETE_PROPERTY,
ICAL_PRIORITY_PROPERTY,
ICAL_PRODID_PROPERTY,
ICAL_QUERY_PROPERTY,
ICAL_QUERYNAME_PROPERTY,
ICAL_RDATE_PROPERTY,
ICAL_RECURRENCEID_PROPERTY,
ICAL_RELATEDTO_PROPERTY,
ICAL_RELCALID_PROPERTY,
ICAL_REPEAT_PROPERTY,
ICAL_REQUESTSTATUS_PROPERTY,
ICAL_RESOURCES_PROPERTY,
ICAL_RRULE_PROPERTY,
ICAL_SCOPE_PROPERTY,
ICAL_SEQUENCE_PROPERTY,
ICAL_STATUS_PROPERTY,
ICAL_SUMMARY_PROPERTY,
ICAL_TARGET_PROPERTY,
ICAL_TRANSP_PROPERTY,
ICAL_TRIGGER_PROPERTY,
ICAL_TZID_PROPERTY,
ICAL_TZNAME_PROPERTY,
ICAL_TZOFFSETFROM_PROPERTY,
ICAL_TZOFFSETTO_PROPERTY,
ICAL_TZURL_PROPERTY,
ICAL_UID_PROPERTY,
ICAL_URL_PROPERTY,
ICAL_VERSION_PROPERTY,
ICAL_X_PROPERTY,
ICAL_XLICCLASS_PROPERTY,
ICAL_XLICCLUSTERCOUNT_PROPERTY,
ICAL_XLICERROR_PROPERTY,
ICAL_XLICMIMECHARSET_PROPERTY,
ICAL_XLICMIMECID_PROPERTY,
ICAL_XLICMIMECONTENTTYPE_PROPERTY,
ICAL_XLICMIMEENCODING_PROPERTY,
ICAL_XLICMIMEFILENAME_PROPERTY,
ICAL_XLICMIMEOPTINFO_PROPERTY,
ICAL_NO_PROPERTY
} icalproperty_kind;
/* ACTION */
icalproperty* icalproperty_new_action(enum icalproperty_action v);
void icalproperty_set_action(icalproperty* prop, enum icalproperty_action v);
enum icalproperty_action icalproperty_get_action(const icalproperty* prop);icalproperty* icalproperty_vanew_action(enum icalproperty_action v, ...);
/* ALLOW-CONFLICT */
icalproperty* icalproperty_new_allowconflict(const char* v);
void icalproperty_set_allowconflict(icalproperty* prop, const char* v);
const char* icalproperty_get_allowconflict(const icalproperty* prop);icalproperty* icalproperty_vanew_allowconflict(const char* v, ...);
/* ATTACH */
icalproperty* icalproperty_new_attach(icalattach * v);
void icalproperty_set_attach(icalproperty* prop, icalattach * v);
icalattach * icalproperty_get_attach(const icalproperty* prop);icalproperty* icalproperty_vanew_attach(icalattach * v, ...);
/* ATTENDEE */
icalproperty* icalproperty_new_attendee(const char* v);
void icalproperty_set_attendee(icalproperty* prop, const char* v);
const char* icalproperty_get_attendee(const icalproperty* prop);icalproperty* icalproperty_vanew_attendee(const char* v, ...);
/* CALID */
icalproperty* icalproperty_new_calid(const char* v);
void icalproperty_set_calid(icalproperty* prop, const char* v);
const char* icalproperty_get_calid(const icalproperty* prop);icalproperty* icalproperty_vanew_calid(const char* v, ...);
/* CALMASTER */
icalproperty* icalproperty_new_calmaster(const char* v);
void icalproperty_set_calmaster(icalproperty* prop, const char* v);
const char* icalproperty_get_calmaster(const icalproperty* prop);icalproperty* icalproperty_vanew_calmaster(const char* v, ...);
/* CALSCALE */
icalproperty* icalproperty_new_calscale(const char* v);
void icalproperty_set_calscale(icalproperty* prop, const char* v);
const char* icalproperty_get_calscale(const icalproperty* prop);icalproperty* icalproperty_vanew_calscale(const char* v, ...);
/* CARID */
icalproperty* icalproperty_new_carid(const char* v);
void icalproperty_set_carid(icalproperty* prop, const char* v);
const char* icalproperty_get_carid(const icalproperty* prop);icalproperty* icalproperty_vanew_carid(const char* v, ...);
/* CATEGORIES */
icalproperty* icalproperty_new_categories(const char* v);
void icalproperty_set_categories(icalproperty* prop, const char* v);
const char* icalproperty_get_categories(const icalproperty* prop);icalproperty* icalproperty_vanew_categories(const char* v, ...);
/* CLASS */
icalproperty* icalproperty_new_class(enum icalproperty_class v);
void icalproperty_set_class(icalproperty* prop, enum icalproperty_class v);
enum icalproperty_class icalproperty_get_class(const icalproperty* prop);icalproperty* icalproperty_vanew_class(enum icalproperty_class v, ...);
/* COMMENT */
icalproperty* icalproperty_new_comment(const char* v);
void icalproperty_set_comment(icalproperty* prop, const char* v);
const char* icalproperty_get_comment(const icalproperty* prop);icalproperty* icalproperty_vanew_comment(const char* v, ...);
/* COMPLETED */
icalproperty* icalproperty_new_completed(struct icaltimetype v);
void icalproperty_set_completed(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_completed(const icalproperty* prop);icalproperty* icalproperty_vanew_completed(struct icaltimetype v, ...);
/* CONTACT */
icalproperty* icalproperty_new_contact(const char* v);
void icalproperty_set_contact(icalproperty* prop, const char* v);
const char* icalproperty_get_contact(const icalproperty* prop);icalproperty* icalproperty_vanew_contact(const char* v, ...);
/* CREATED */
icalproperty* icalproperty_new_created(struct icaltimetype v);
void icalproperty_set_created(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_created(const icalproperty* prop);icalproperty* icalproperty_vanew_created(struct icaltimetype v, ...);
/* DECREED */
icalproperty* icalproperty_new_decreed(const char* v);
void icalproperty_set_decreed(icalproperty* prop, const char* v);
const char* icalproperty_get_decreed(const icalproperty* prop);icalproperty* icalproperty_vanew_decreed(const char* v, ...);
/* DEFAULT-CHARSET */
icalproperty* icalproperty_new_defaultcharset(const char* v);
void icalproperty_set_defaultcharset(icalproperty* prop, const char* v);
const char* icalproperty_get_defaultcharset(const icalproperty* prop);icalproperty* icalproperty_vanew_defaultcharset(const char* v, ...);
/* DEFAULT-LOCALE */
icalproperty* icalproperty_new_defaultlocale(const char* v);
void icalproperty_set_defaultlocale(icalproperty* prop, const char* v);
const char* icalproperty_get_defaultlocale(const icalproperty* prop);icalproperty* icalproperty_vanew_defaultlocale(const char* v, ...);
/* DEFAULT-TZID */
icalproperty* icalproperty_new_defaulttzid(const char* v);
void icalproperty_set_defaulttzid(icalproperty* prop, const char* v);
const char* icalproperty_get_defaulttzid(const icalproperty* prop);icalproperty* icalproperty_vanew_defaulttzid(const char* v, ...);
/* DESCRIPTION */
icalproperty* icalproperty_new_description(const char* v);
void icalproperty_set_description(icalproperty* prop, const char* v);
const char* icalproperty_get_description(const icalproperty* prop);icalproperty* icalproperty_vanew_description(const char* v, ...);
/* DTEND */
icalproperty* icalproperty_new_dtend(struct icaltimetype v);
void icalproperty_set_dtend(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_dtend(const icalproperty* prop);icalproperty* icalproperty_vanew_dtend(struct icaltimetype v, ...);
/* DTSTAMP */
icalproperty* icalproperty_new_dtstamp(struct icaltimetype v);
void icalproperty_set_dtstamp(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_dtstamp(const icalproperty* prop);icalproperty* icalproperty_vanew_dtstamp(struct icaltimetype v, ...);
/* DTSTART */
icalproperty* icalproperty_new_dtstart(struct icaltimetype v);
void icalproperty_set_dtstart(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_dtstart(const icalproperty* prop);icalproperty* icalproperty_vanew_dtstart(struct icaltimetype v, ...);
/* DUE */
icalproperty* icalproperty_new_due(struct icaltimetype v);
void icalproperty_set_due(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_due(const icalproperty* prop);icalproperty* icalproperty_vanew_due(struct icaltimetype v, ...);
/* DURATION */
icalproperty* icalproperty_new_duration(struct icaldurationtype v);
void icalproperty_set_duration(icalproperty* prop, struct icaldurationtype v);
struct icaldurationtype icalproperty_get_duration(const icalproperty* prop);icalproperty* icalproperty_vanew_duration(struct icaldurationtype v, ...);
/* EXDATE */
icalproperty* icalproperty_new_exdate(struct icaltimetype v);
void icalproperty_set_exdate(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_exdate(const icalproperty* prop);icalproperty* icalproperty_vanew_exdate(struct icaltimetype v, ...);
/* EXPAND */
icalproperty* icalproperty_new_expand(int v);
void icalproperty_set_expand(icalproperty* prop, int v);
int icalproperty_get_expand(const icalproperty* prop);icalproperty* icalproperty_vanew_expand(int v, ...);
/* EXRULE */
icalproperty* icalproperty_new_exrule(struct icalrecurrencetype v);
void icalproperty_set_exrule(icalproperty* prop, struct icalrecurrencetype v);
struct icalrecurrencetype icalproperty_get_exrule(const icalproperty* prop);icalproperty* icalproperty_vanew_exrule(struct icalrecurrencetype v, ...);
/* FREEBUSY */
icalproperty* icalproperty_new_freebusy(struct icalperiodtype v);
void icalproperty_set_freebusy(icalproperty* prop, struct icalperiodtype v);
struct icalperiodtype icalproperty_get_freebusy(const icalproperty* prop);icalproperty* icalproperty_vanew_freebusy(struct icalperiodtype v, ...);
/* GEO */
icalproperty* icalproperty_new_geo(struct icalgeotype v);
void icalproperty_set_geo(icalproperty* prop, struct icalgeotype v);
struct icalgeotype icalproperty_get_geo(const icalproperty* prop);icalproperty* icalproperty_vanew_geo(struct icalgeotype v, ...);
/* LAST-MODIFIED */
icalproperty* icalproperty_new_lastmodified(struct icaltimetype v);
void icalproperty_set_lastmodified(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_lastmodified(const icalproperty* prop);icalproperty* icalproperty_vanew_lastmodified(struct icaltimetype v, ...);
/* LOCATION */
icalproperty* icalproperty_new_location(const char* v);
void icalproperty_set_location(icalproperty* prop, const char* v);
const char* icalproperty_get_location(const icalproperty* prop);icalproperty* icalproperty_vanew_location(const char* v, ...);
/* MAXRESULTS */
icalproperty* icalproperty_new_maxresults(int v);
void icalproperty_set_maxresults(icalproperty* prop, int v);
int icalproperty_get_maxresults(const icalproperty* prop);icalproperty* icalproperty_vanew_maxresults(int v, ...);
/* MAXRESULTSSIZE */
icalproperty* icalproperty_new_maxresultssize(int v);
void icalproperty_set_maxresultssize(icalproperty* prop, int v);
int icalproperty_get_maxresultssize(const icalproperty* prop);icalproperty* icalproperty_vanew_maxresultssize(int v, ...);
/* METHOD */
icalproperty* icalproperty_new_method(enum icalproperty_method v);
void icalproperty_set_method(icalproperty* prop, enum icalproperty_method v);
enum icalproperty_method icalproperty_get_method(const icalproperty* prop);icalproperty* icalproperty_vanew_method(enum icalproperty_method v, ...);
/* ORGANIZER */
icalproperty* icalproperty_new_organizer(const char* v);
void icalproperty_set_organizer(icalproperty* prop, const char* v);
const char* icalproperty_get_organizer(const icalproperty* prop);icalproperty* icalproperty_vanew_organizer(const char* v, ...);
/* OWNER */
icalproperty* icalproperty_new_owner(const char* v);
void icalproperty_set_owner(icalproperty* prop, const char* v);
const char* icalproperty_get_owner(const icalproperty* prop);icalproperty* icalproperty_vanew_owner(const char* v, ...);
/* PERCENT-COMPLETE */
icalproperty* icalproperty_new_percentcomplete(int v);
void icalproperty_set_percentcomplete(icalproperty* prop, int v);
int icalproperty_get_percentcomplete(const icalproperty* prop);icalproperty* icalproperty_vanew_percentcomplete(int v, ...);
/* PRIORITY */
icalproperty* icalproperty_new_priority(int v);
void icalproperty_set_priority(icalproperty* prop, int v);
int icalproperty_get_priority(const icalproperty* prop);icalproperty* icalproperty_vanew_priority(int v, ...);
/* PRODID */
icalproperty* icalproperty_new_prodid(const char* v);
void icalproperty_set_prodid(icalproperty* prop, const char* v);
const char* icalproperty_get_prodid(const icalproperty* prop);icalproperty* icalproperty_vanew_prodid(const char* v, ...);
/* QUERY */
icalproperty* icalproperty_new_query(const char* v);
void icalproperty_set_query(icalproperty* prop, const char* v);
const char* icalproperty_get_query(const icalproperty* prop);icalproperty* icalproperty_vanew_query(const char* v, ...);
/* QUERYNAME */
icalproperty* icalproperty_new_queryname(const char* v);
void icalproperty_set_queryname(icalproperty* prop, const char* v);
const char* icalproperty_get_queryname(const icalproperty* prop);icalproperty* icalproperty_vanew_queryname(const char* v, ...);
/* RDATE */
icalproperty* icalproperty_new_rdate(struct icaldatetimeperiodtype v);
void icalproperty_set_rdate(icalproperty* prop, struct icaldatetimeperiodtype v);
struct icaldatetimeperiodtype icalproperty_get_rdate(const icalproperty* prop);icalproperty* icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...);
/* RECURRENCE-ID */
icalproperty* icalproperty_new_recurrenceid(struct icaltimetype v);
void icalproperty_set_recurrenceid(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_recurrenceid(const icalproperty* prop);icalproperty* icalproperty_vanew_recurrenceid(struct icaltimetype v, ...);
/* RELATED-TO */
icalproperty* icalproperty_new_relatedto(const char* v);
void icalproperty_set_relatedto(icalproperty* prop, const char* v);
const char* icalproperty_get_relatedto(const icalproperty* prop);icalproperty* icalproperty_vanew_relatedto(const char* v, ...);
/* RELCALID */
icalproperty* icalproperty_new_relcalid(const char* v);
void icalproperty_set_relcalid(icalproperty* prop, const char* v);
const char* icalproperty_get_relcalid(const icalproperty* prop);icalproperty* icalproperty_vanew_relcalid(const char* v, ...);
/* REPEAT */
icalproperty* icalproperty_new_repeat(int v);
void icalproperty_set_repeat(icalproperty* prop, int v);
int icalproperty_get_repeat(const icalproperty* prop);icalproperty* icalproperty_vanew_repeat(int v, ...);
/* REQUEST-STATUS */
icalproperty* icalproperty_new_requeststatus(struct icalreqstattype v);
void icalproperty_set_requeststatus(icalproperty* prop, struct icalreqstattype v);
struct icalreqstattype icalproperty_get_requeststatus(const icalproperty* prop);icalproperty* icalproperty_vanew_requeststatus(struct icalreqstattype v, ...);
/* RESOURCES */
icalproperty* icalproperty_new_resources(const char* v);
void icalproperty_set_resources(icalproperty* prop, const char* v);
const char* icalproperty_get_resources(const icalproperty* prop);icalproperty* icalproperty_vanew_resources(const char* v, ...);
/* RRULE */
icalproperty* icalproperty_new_rrule(struct icalrecurrencetype v);
void icalproperty_set_rrule(icalproperty* prop, struct icalrecurrencetype v);
struct icalrecurrencetype icalproperty_get_rrule(const icalproperty* prop);icalproperty* icalproperty_vanew_rrule(struct icalrecurrencetype v, ...);
/* SCOPE */
icalproperty* icalproperty_new_scope(const char* v);
void icalproperty_set_scope(icalproperty* prop, const char* v);
const char* icalproperty_get_scope(const icalproperty* prop);icalproperty* icalproperty_vanew_scope(const char* v, ...);
/* SEQUENCE */
icalproperty* icalproperty_new_sequence(int v);
void icalproperty_set_sequence(icalproperty* prop, int v);
int icalproperty_get_sequence(const icalproperty* prop);icalproperty* icalproperty_vanew_sequence(int v, ...);
/* STATUS */
icalproperty* icalproperty_new_status(enum icalproperty_status v);
void icalproperty_set_status(icalproperty* prop, enum icalproperty_status v);
enum icalproperty_status icalproperty_get_status(const icalproperty* prop);icalproperty* icalproperty_vanew_status(enum icalproperty_status v, ...);
/* SUMMARY */
icalproperty* icalproperty_new_summary(const char* v);
void icalproperty_set_summary(icalproperty* prop, const char* v);
const char* icalproperty_get_summary(const icalproperty* prop);icalproperty* icalproperty_vanew_summary(const char* v, ...);
/* TARGET */
icalproperty* icalproperty_new_target(const char* v);
void icalproperty_set_target(icalproperty* prop, const char* v);
const char* icalproperty_get_target(const icalproperty* prop);icalproperty* icalproperty_vanew_target(const char* v, ...);
/* TRANSP */
icalproperty* icalproperty_new_transp(enum icalproperty_transp v);
void icalproperty_set_transp(icalproperty* prop, enum icalproperty_transp v);
enum icalproperty_transp icalproperty_get_transp(const icalproperty* prop);icalproperty* icalproperty_vanew_transp(enum icalproperty_transp v, ...);
/* TRIGGER */
icalproperty* icalproperty_new_trigger(struct icaltriggertype v);
void icalproperty_set_trigger(icalproperty* prop, struct icaltriggertype v);
struct icaltriggertype icalproperty_get_trigger(const icalproperty* prop);icalproperty* icalproperty_vanew_trigger(struct icaltriggertype v, ...);
/* TZID */
icalproperty* icalproperty_new_tzid(const char* v);
void icalproperty_set_tzid(icalproperty* prop, const char* v);
const char* icalproperty_get_tzid(const icalproperty* prop);icalproperty* icalproperty_vanew_tzid(const char* v, ...);
/* TZNAME */
icalproperty* icalproperty_new_tzname(const char* v);
void icalproperty_set_tzname(icalproperty* prop, const char* v);
const char* icalproperty_get_tzname(const icalproperty* prop);icalproperty* icalproperty_vanew_tzname(const char* v, ...);
/* TZOFFSETFROM */
icalproperty* icalproperty_new_tzoffsetfrom(int v);
void icalproperty_set_tzoffsetfrom(icalproperty* prop, int v);
int icalproperty_get_tzoffsetfrom(const icalproperty* prop);icalproperty* icalproperty_vanew_tzoffsetfrom(int v, ...);
/* TZOFFSETTO */
icalproperty* icalproperty_new_tzoffsetto(int v);
void icalproperty_set_tzoffsetto(icalproperty* prop, int v);
int icalproperty_get_tzoffsetto(const icalproperty* prop);icalproperty* icalproperty_vanew_tzoffsetto(int v, ...);
/* TZURL */
icalproperty* icalproperty_new_tzurl(const char* v);
void icalproperty_set_tzurl(icalproperty* prop, const char* v);
const char* icalproperty_get_tzurl(const icalproperty* prop);icalproperty* icalproperty_vanew_tzurl(const char* v, ...);
/* UID */
icalproperty* icalproperty_new_uid(const char* v);
void icalproperty_set_uid(icalproperty* prop, const char* v);
const char* icalproperty_get_uid(const icalproperty* prop);icalproperty* icalproperty_vanew_uid(const char* v, ...);
/* URL */
icalproperty* icalproperty_new_url(const char* v);
void icalproperty_set_url(icalproperty* prop, const char* v);
const char* icalproperty_get_url(const icalproperty* prop);icalproperty* icalproperty_vanew_url(const char* v, ...);
/* VERSION */
icalproperty* icalproperty_new_version(const char* v);
void icalproperty_set_version(icalproperty* prop, const char* v);
const char* icalproperty_get_version(const icalproperty* prop);icalproperty* icalproperty_vanew_version(const char* v, ...);
/* X */
icalproperty* icalproperty_new_x(const char* v);
void icalproperty_set_x(icalproperty* prop, const char* v);
const char* icalproperty_get_x(const icalproperty* prop);icalproperty* icalproperty_vanew_x(const char* v, ...);
/* X-LIC-CLASS */
icalproperty* icalproperty_new_xlicclass(enum icalproperty_xlicclass v);
void icalproperty_set_xlicclass(icalproperty* prop, enum icalproperty_xlicclass v);
enum icalproperty_xlicclass icalproperty_get_xlicclass(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicclass(enum icalproperty_xlicclass v, ...);
/* X-LIC-CLUSTERCOUNT */
icalproperty* icalproperty_new_xlicclustercount(const char* v);
void icalproperty_set_xlicclustercount(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicclustercount(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicclustercount(const char* v, ...);
/* X-LIC-ERROR */
icalproperty* icalproperty_new_xlicerror(const char* v);
void icalproperty_set_xlicerror(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicerror(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicerror(const char* v, ...);
/* X-LIC-MIMECHARSET */
icalproperty* icalproperty_new_xlicmimecharset(const char* v);
void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimecharset(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...);
/* X-LIC-MIMECID */
icalproperty* icalproperty_new_xlicmimecid(const char* v);
void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimecid(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...);
/* X-LIC-MIMECONTENTTYPE */
icalproperty* icalproperty_new_xlicmimecontenttype(const char* v);
void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimecontenttype(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...);
/* X-LIC-MIMEENCODING */
icalproperty* icalproperty_new_xlicmimeencoding(const char* v);
void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimeencoding(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...);
/* X-LIC-MIMEFILENAME */
icalproperty* icalproperty_new_xlicmimefilename(const char* v);
void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimefilename(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...);
/* X-LIC-MIMEOPTINFO */
icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v);
void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimeoptinfo(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...);
#endif /*ICALPROPERTY_H*/
| 48.946502 | 160 | 0.805574 |
fb468b9934ade7dedb707e8ce111123123ff1a05 | 705 | h | C | IncrementalSearchMode.h | tgustafsson/myeditor | c2add8e01664cf58301058af017a9249cfd8832a | [
"Apache-2.0"
] | null | null | null | IncrementalSearchMode.h | tgustafsson/myeditor | c2add8e01664cf58301058af017a9249cfd8832a | [
"Apache-2.0"
] | null | null | null | IncrementalSearchMode.h | tgustafsson/myeditor | c2add8e01664cf58301058af017a9249cfd8832a | [
"Apache-2.0"
] | null | null | null | #pragma once
#include "Mode.h"
#include <string>
class IncrementalSearchMode : public Mode
{
private:
std::wstring m_search;
public:
IncrementalSearchMode(const KeyCords& keys, std::shared_ptr<Control> control, KeyCord::insert_func insert);
virtual std::vector<std::shared_ptr<AttributedString>> syntax_highlight(std::vector<std::shared_ptr<AttributedString>> rows);
void set_search(std::wstring search);
std::wstring get_search() const;
};
void incremental_search_background(std::shared_ptr<Control> control, std::vector<std::shared_ptr<AttributedString>> rows, const std::wstring& search, AttributedString::color active_color, AttributedString::color matched_color);
| 39.166667 | 228 | 0.764539 |
97847a0a05cda594b00eee72668b3b3cbfcca573 | 1,195 | h | C | include/media/AudioResamplerPublic.h | rubis-lab/NANS_framework_av | fc0e7dfab044f96b33c641d7ddf60d5a8f1ac46e | [
"Apache-2.0"
] | 7 | 2017-07-13T10:34:54.000Z | 2021-04-16T05:40:35.000Z | include/media/AudioResamplerPublic.h | rubis-lab/NANS_framework_av | fc0e7dfab044f96b33c641d7ddf60d5a8f1ac46e | [
"Apache-2.0"
] | 1 | 2020-02-05T22:19:24.000Z | 2020-02-05T22:19:24.000Z | include/media/AudioResamplerPublic.h | rubis-lab/NANS_framework_av | fc0e7dfab044f96b33c641d7ddf60d5a8f1ac46e | [
"Apache-2.0"
] | 9 | 2017-07-13T12:33:20.000Z | 2021-06-19T02:46:48.000Z | /*
* Copyright (C) 2014 The Android Open Source Project
*
* 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 ANDROID_AUDIO_RESAMPLER_PUBLIC_H
#define ANDROID_AUDIO_RESAMPLER_PUBLIC_H
// AUDIO_RESAMPLER_DOWN_RATIO_MAX is the maximum ratio between the original
// audio sample rate and the target rate when downsampling,
// as permitted in the audio framework, e.g. AudioTrack and AudioFlinger.
// In practice, it is not recommended to downsample more than 6:1
// for best audio quality, even though the audio framework permits a larger
// downsampling ratio.
// TODO: replace with an API
#define AUDIO_RESAMPLER_DOWN_RATIO_MAX 256
#endif // ANDROID_AUDIO_RESAMPLER_PUBLIC_H
| 39.833333 | 75 | 0.774059 |
202b53973050c5fe6e2b5adeeb3b1065b7bdee92 | 986 | c | C | UCF/Engineering-Computation/Assignment-1/question5.c | tsimmons15/school-work | 09d040c129ebf4c7721acfa62398f85b00732286 | [
"Unlicense"
] | null | null | null | UCF/Engineering-Computation/Assignment-1/question5.c | tsimmons15/school-work | 09d040c129ebf4c7721acfa62398f85b00732286 | [
"Unlicense"
] | null | null | null | UCF/Engineering-Computation/Assignment-1/question5.c | tsimmons15/school-work | 09d040c129ebf4c7721acfa62398f85b00732286 | [
"Unlicense"
] | null | null | null | #include <stdio.h>
#define SIZE 10
#define MAX 10
#define MIN 1
void fillArray(int *arr);
void displayArray(int *arr);
void processArray(int *arr);
int main()
{
int arr[SIZE] = {0};
fillArray(arr);
printf("Array data\n");
displayArray(arr);
processArray(arr);
printf("After processing\n");
displayArray(arr);
return 0;
}
void fillArray(int *arr)
{
int i = 0;
srand(time(NULL));
for (i = 0; i < SIZE; i++)
arr[i] = rand() % MAX + MIN;
return;
}
void displayArray(int *arr)
{
int i = 0;
//printf("Array data\n");
for (i = 0; i < SIZE; i++)
printf("%2d%c ", arr[i], ((i+1) == SIZE) ? ' ' : ',');
printf("\n");
return;
}
void processArray(int *arr)
{
int found[MAX] = {0};
int i = 0;
int index = 0;
for (i = 0; i < SIZE; i++)
{
index = arr[i] - 1;
if (found[index] == 0)
found[index] = 1;
else
arr[i] = -1;
}
return;
}
| 16.163934 | 63 | 0.497972 |
ee57e1ff03715285619c2815de684da61f6cfe66 | 115 | c | C | test/transform/inline/inline_64.tfm.c | vladem/tsar | 3771068d47a8a258ee4a74ad5fc9c246f8aba7cb | [
"Apache-2.0"
] | null | null | null | test/transform/inline/inline_64.tfm.c | vladem/tsar | 3771068d47a8a258ee4a74ad5fc9c246f8aba7cb | [
"Apache-2.0"
] | 11 | 2021-01-28T21:06:08.000Z | 2021-02-24T09:49:35.000Z | tests/transform/inline/inline_64/sample/main.c | zoocide/tsar-test-template | b3047eaa2ad8e4d6c0ab2a86f61a596736dbd762 | [
"Apache-2.0"
] | null | null | null | int foo(int a) { return a--; }
int main() {
int x = 50;
while (foo(x) > 0) {
x -= 1;
}
return 0;
}
| 8.846154 | 30 | 0.426087 |
e38423eba3d9dfbbb5acecc0330197242938ae93 | 19,406 | h | C | ddradseq.h | popgendad/ddradseq | d181de8caf8ead55538f96177e5bf8ca033923f7 | [
"MIT"
] | null | null | null | ddradseq.h | popgendad/ddradseq | d181de8caf8ead55538f96177e5bf8ca033923f7 | [
"MIT"
] | null | null | null | ddradseq.h | popgendad/ddradseq | d181de8caf8ead55538f96177e5bf8ca033923f7 | [
"MIT"
] | null | null | null | /** @file ddradseq.h
* @brief Header for the ddradseq program
* @author Daniel Garrigan Lummei Analytics LLC
* @date November 2016
*
* Contact: dgarriga@lummei.net
* Copyright: MIT license
*/
#ifndef DDRADSEQ_H
#define DDRADEQ_H
#if defined __GNUC__ && !defined __GNUC_STDC_INLINE__ && !defined __GNUC_GNU_INLINE__
#define __GNUC_GNU_INLINE__ 1
#endif
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdbool.h>
#include <emmintrin.h>
#include "khash.h"
#ifdef __GNUC__
#define LIKELY(x) __builtin_expect((x),1)
#define UNLIKELY(x) __builtin_expect((x),0)
#else
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#endif
/** \def BUFLEN
\brief File I/O buffer size
*/
#define BUFLEN 0x20000
/** @def MAX_LINE_LENGTH
* @brief Maximum line length to read from input file.
*/
#define MAX_LINE_LENGTH 400
/** @def BSIZE
* @brief Number of lines in individual parse buffers.
*/
#define BSIZE 4000
/** @def DNAME_LENGTH
* @brief Length of terminal output directory name.
*/
#define DNAME_LENGTH 5
/** @def FORWARD
* @brief Identifier for forward-oriented reads.
*/
#define FORWARD 1
/** @def REVERSE
* @brief Identifier for reverse-oriented reads.
*/
#define REVERSE 2
/** @def DATELEN
* @brief Length of data format YYYY-DD-MM.
*/
#define DATELEN 20
/** @def KSW_XBYTE
* @brief
*/
#define KSW_XBYTE 0x10000
/** @def KSW_XSTOP
* @brief
*/
#define KSW_XSTOP 0x20000
/** @def KSW_XSUBO
* @brief
*/
#define KSW_XSUBO 0x40000
/** @def KSW_XSTART
* @brief
*/
#define KSW_XSTART 0x80000
/******************************************************
* Data structure defintions
******************************************************/
/** @var typedef struct cmdparam_t CMD
* @brief Data structure to hold user-provided command line parameters.
*/
typedef struct cmdparam_t
{
bool across; /**< Flag to pool sequences across flow cells. */
bool mt_mode; /**< Flag to indicate multi-threaded mode. */
char *parent_indir; /**< String holding the full path and name of the parent input directory. */
char *parent_outdir; /**< String holding the full path to the parent output directory. */
char *outdir; /**< String holding the full path to the output directory. */
char *csvfile; /**< String holding the full path of the CSV database input file. */
char *mode; /**< String holding the run-time mode of the program. */
char *glob; /**< String holding the input fastQ file glob expression. */
int dist; /**< The allowable edit distance for a barcode match. */
int score; /**< The alignment score to consider mates properly paired. */
int gapo; /**< The penalty for opening an alignment gap. */
int gape; /**< The penalty for extending an open alignment gap. */
int nthreads; /**< The number of threads to use for parallel computation. */
FILE *lf; /**< Pointer to the log file output stream. */
} CMD;
/** @var typedef struct fastq_t FASTQ
* @brief Data structure to hold a single fastQ entry.
*/
typedef struct fastq_t
{
char *id; /**< String holding the Illumina identifier line for a fastQ entry. */
char *seq; /**< String holding the DNA sequence line for a fastQ entry. */
char *qual; /**< String holding the DNA sequence quality line for a fastQ entry. */
} FASTQ;
/** @var typedef struct ksqr_t ALIGN_RESULT
* @brief Data structure to hold the results of a local sequence alignment.
*/
typedef struct ksqr_t
{
int score; /**< The score of the highest scoring local alignment. */
int target_begin; /**< The position on the target sequence where the highest scoring local alignment begins. */
int target_end; /**< The position on the target sequence where the highest scoring local alignment ends. */
int query_begin; /**< The position on the query sequence where the highest scoring local alignment begins. */
int query_end; /**< The position on the query sequence where the highest scoring local alignment ends. */
int score2; /**< The score of the second highest scoring local alignment. */
int target_end2; /**< The position on the target sequence where the second highest scoring local alignment ends. */
} ALIGN_RESULT;
/** @var typedef struct kswq_t ALIGN_QUERY
* @brief Data structure to hold align query parameters.
*/
typedef struct kswq_t
{
int qlen;
int slen;
unsigned char shift;
unsigned char mdiff;
unsigned char max;
__m128i *qp;
__m128i *H0;
__m128i *H1;
__m128i *E;
__m128i *Hmax;
} ALIGN_QUERY;
/** @var typedef struct barcode_t BARCODE
* @brief Barcode-level data structure.
*/
typedef struct barcode_t
{
char *smplID; /**< The sample identifier from the CSV database file. */
char *outfile; /**< The full path to the output file associated with a biological sample. */
char *buffer; /**< The output buffer associated with a biological sample. */
size_t curr_bytes; /**< The number of bytes currently in the output buffer associated with a biological sample. */
} BARCODE;
/** @def KHASH_MAP_INIT_STR(barcode, BARCODE*)
* @brief Defines the third-level hash
*/
KHASH_MAP_INIT_STR(barcode, BARCODE*)
/** @var typedef struct pool_t POOL
* @brief Pool-level data structure.
*/
typedef struct pool_t
{
char *poolID; /**< The sample pool identifier from the CSV database file. */
char *poolpath; /**< The full path to the output directory associated with a sample pool. */
size_t barcode_length; /**< The length of the pool identifier barcode. */
khash_t(barcode) *b; /**< Pointer to the hash of samples associated with this pool. */
} POOL;
/** @def KHASH_MAP_INIT_STR(pool, POOL*)
* @brief Defines the second-level hash
*/
KHASH_MAP_INIT_STR(pool, POOL*)
/** @def KHASH_MAP_INIT_STR(pool_hash, khash_t(pool)*)
* @brief Defines the top-level hash
*/
KHASH_MAP_INIT_STR(pool_hash, khash_t(pool)*)
/** @def KHASH_MAP_INIT_STR(fastq, FASTQ*)
* @brief Defines the hash to hold fastQ entries
*/
KHASH_MAP_INIT_STR(fastq, FASTQ*)
/** @def KHASH_MAP_INIT_STR(mates, char*)
* @brief Defines the hash to hold mate information
*/
KHASH_MAP_INIT_STR(mates, char*)
/******************************************************
* Function prototypes
******************************************************/
/******************************************************
* Parsing functions
******************************************************/
/** @fn int parse_fastq(const CMD *cp, const int orient, const char *filename, khash_t(pool_hash) *h, khash_t(mates) *m)
* @brief Parses a fastQ file by index sequence.
* @param cp Pointer to command line data structure (read-only).
* @param orient Orientation of reads in fastQ file (read-only).
* @param filename Pointer to string holding fastQ input file name (read-only).
* @param h Pointer to pool_hash hash table with parsing database.
* @param m Pointer to mate information hash table.
* @return Zero on success and non-zero on failure.
*/
extern int parse_fastq(const CMD *cp, const int orient, const char *filename, khash_t(pool_hash) *h, khash_t(mates) *m);
/** @fn int parse_forwardbuffer(const CMD *cp, char *buff, const size_t nl, khash_t(pool_hash) *h, khash_t(mates) *m)
* @brief Parses forward fastQ entries in the buffer.
* @param cp Pointer to command line data structure (read-only).
* @param buff Pointer to string holding the buffer.
* @param nl Number of lines in the buffer (read-only).
* @param h Pointer to pool_hash hash table with parsing database (read-only).
* @param m Pointer to mate information hash table.
* @return Zero on success and non-zero on failure.
*/
extern int parse_forwardbuffer(const CMD *cp, char *buff, const size_t nl, const khash_t(pool_hash) *h, khash_t(mates) *m);
/** @fn int parse_reversebuffer(const CMD *cp, char *buff, const size_t nl, khash_t(pool_hash) *h, khash_t(mates) *m)
* @brief Parses reverse fastQ entries in the buffer.
* @param cp Pointer to command line data structure (read-only).
* @param buff Pointer to string holding the buffer.
* @param nl Number of lines in the buffer (read-only).
* @param h Pointer to pool_hash hash table with parsing database (read-only).
* @param m Pointer to mate information hash table (read-only).
* @return Zero on success and non-zero on failure.
*/
extern int parse_reversebuffer(const CMD *cp, char *buff, const size_t nl, const khash_t(pool_hash) *h, const khash_t(mates) *m);
/******************************************************
* Sequence pairing functions
******************************************************/
/** @fn int pair_mates(const char *filename, const khash_t(fastq) *h, const char *ffor, const char *frev, FILE *lf)
* @brief Pairs mates in two fastQ files.
* @param filename Pointer to string for input forward fastQ (read-only).
* @param h Pointer to hash table to hold forward sequences (read only).
* @param ffor Pointer to string with forward output file name (read only).
* @param frev Pointer to string with reverse output file name (read only).
* @param lf Pointer to log file stream.
* @return Zero on success and non-zero on failure.
*/
extern int pair_mates(const char *filename, const khash_t(fastq) *h, const char *ffor, const char *frev, FILE *lf);
/******************************************************
* Trimend functions
******************************************************/
/** @fn int align_mates(const CMD *cp, const char *fin, const char *rin, const char *fout, const char *rout)
* @brief Align mates in two fastQ files and trim 3' end of reverse sequences.
* @param cp Pointer to command line data structure (read-only).
* @param fin Pointer to string with forward input file name (read-only).
* @param rin Pointer to string with reverse input file name (read-only).
* @param fout Pointer to string with forward output file name (read-only).
* @param rout Pointer to string with reverse output file name (read-only).
* @return Zero on success and non-zero on failure.
*/
extern int align_mates(const CMD *cp, const char *fin, const char *rin, const char *fout, const char *rout);
/******************************************************
* UI functions
******************************************************/
/** @fn CMD *get_cmdline(int argc, char *argv[])
* @brief Reads command line parameters into CMD data structure.
* @param argc Number of command line arguments.
* @param argv Pointer to array of strings holding command line arguments.
* @return Pointer to command line data structure on success or NULL on failure.
*/
extern CMD *get_cmdline(int argc, char *argv[]);
/******************************************************
* I/O management functions
******************************************************/
/** @fn khash_t(pool_hash) *read_csv(const CMD *cp)
* @brief Reads CSV database file into parsing hash database.
* @param cp Pointer to command line data structure (read-only).
* @return Pointer to pool_hash hash table on success or NULL on failure.
*/
extern khash_t(pool_hash) *read_csv(const CMD *cp);
/** @fn int check_csv(const CMD *cp)
* @brief Check the integrity of the input CSV file.
* @param cp Pointer to the command line parameter data structure (read-only).
* @return Zero on pass, non-zero on fail integrity test.
*/
extern int check_csv(const CMD *cp);
/** @fn khash_t(fastq)* fastq_to_db(const char *filename, FILE *lf)
* @brief Populates a fastQ database from fastQ input file.
* @param filename Pointer to string holding input fastQ file name (read-only).
* @param lf Pointer to log file stream.
* @return Pointer to fastQ hash table on success or NULL on failure.
*/
extern khash_t(fastq) *fastq_to_db(const char *filename, FILE *lf);
/******************************************************
* File system functions
******************************************************/
/** @fn int create_dirtree(const CMD *cp, const khash_t(pool_hash) *h)
* @brief Creates and checks output directory tree.
* @param cp Pointer to command line data structure (read-only).
* @param h Pointer to pool_hash hash table with parsing database (read-only).
* @return Zero on success and non-zero on failure.
*/
extern int create_dirtree(const CMD *cp, const khash_t(pool_hash) *h);
/** @fn unsigned int traverse_dirtree(const CMD *cp, const char *caller, char ***flist)
* @ brief Produces a sorted list of all fastQ files in the input directory tree.
* @param [in] cp Pointer to command line data structure (read-only).
* @param [in] caller Pointer to string identifying calling function (read-only).
* @param [out] flist Pointer to array of input file names.
* @return The number of input files found in the input directory tree.
*/
extern unsigned int traverse_dirtree(const CMD *cp, const char *caller, char ***flist);
/******************************************************
* Buffer management functions
******************************************************/
/** @fn char *clean_buffer(char *buff, size_t *nl)
* @brief Limits the buffer to hold only entire fastQ entries.
* @param buff Pointer to the string holding the buffer.
* @param nl Number of new line characters in the buffer.
* @return Pointer to new end of buffer.
*/
extern char *clean_buffer(char *buff, size_t *nl);
/** @fn size_t reset_buffer(char *buff, const char *r)
* @brief Resets the buffer for next read block.
* @param buff Pointer to the string holding the buffer.
* @param r Pointer to new end of buffer (read-only).
* @return The number of leftover characters in the old buffer.
*/
extern size_t reset_buffer(char *buff, const char *r);
/** @fn size_t reset_buffer(char *buff, const char *r)
* @brief Counts newline characters in buffer.
* @param buff Pointer to the string holding the buffer (read-only).
* @return The number of newline characters in the buffer.
*/
extern size_t count_lines(const char *buff);
/** @fn int flush_buffer(int orient, BARCODE *bc)
* @brief Dumps a full buffer to file.
* @param orient Orientation of reads in the buffer.
* @param bc Pointer to BARCODE data structure.
* @param lf Pointer to log file stream.
* @return Zero on success and non-zero on failure.
*/
extern int flush_buffer(int orient, BARCODE *bc, FILE *lf);
/******************************************************
* Memory management functions
******************************************************/
/** @fn int destroy_cmdline(CMD *cp)
* @brief Destroy command line parameter data structure.
* @param cp Pointer to command line data structure.
* @return Zero on success and non-zero on failure.
*/
extern int destroy_cmdline(CMD *cp);
/** @fn int free_db(khash_t(pool_hash) *h)
* @brief Deallocates memory used by CSV database.
* @param h Pointer to pool_hash hash table with parsing database.
* @return Zero on success and non-zero on failure.
*/
extern int free_db(khash_t(pool_hash) *h);
/** @fn int free_pairdb (khash_t(fastq) *h)
* @brief Deallocates memory used by forward fastQ database.
* @param h Pointer to hash table to hold forward sequences.0
* @return Zero on success and non-zero on failure.
*/
extern int free_pairdb(khash_t(fastq) *h);
/** @fn int free_matedb(khash_t(mates) *m)
* @brief Deallocates memory used by mate pair database.
* @param m Pointer to mate information hash table.
* @return Zero on success and non-zero on failure.
*/
extern int free_matedb(khash_t(mates) *m);
/******************************************************
* Alignment functions
******************************************************/
/** @fn ALIGN_RESULT local_align(int qlen, char *query, int tlen, char *target, const char *mat, int gapo, int gape, int xtra, FILE *lf)
* @brief Calculates the local sequence alignment by Smith-Waterman algorithm.
* @param qlen Length of query sequence.
* @param query Pointer string holding query sequence.
* @param tlen Length of the target sequence.
* @param target Pointer to string holding target sequence.
* @param mat Scoring matrix in a one-dimension array (read-only).
* @param gapo Gap penalty.
* @param gape Gap extension penalty.
* @param xtra Status variable.
* @param lf Pointer to log file stream.
* @return ALIGN_RESULT data structure on success
*/
extern ALIGN_RESULT local_align(int qlen, char *query, int tlen, char *target, const char *mat, int gapo, int gape, int xtra, FILE *lf);
/** @fn char *revcom(const char *s, FILE *lf)
* @brief Reverse complement a DNA string with full IUPAC alphabet.
* @param s Pointer to string to be reverse-complemented (read-only).
* @param lf Pointer to log file stream.
* @return Pointer to newly allocated reverse-complemented string on success or NULL on failure.
*/
extern char *revcom(const char *s, FILE *lf);
/******************************************************
* Edit distance functions
******************************************************/
/** @fn int levenshtein(const char *s1, const char *s2)
* @brief Calculates the Levenshtein distance between two strings.
* @param s1 Pointer to the first string (read-only).
* @param s2 Pointer to the second string (read-only).
* @return Edit distance between the two strings.
*/
extern int levenshtein(const char *s1, const char *s2);
/******************************************************
* Log file functions
******************************************************/
/** @fn int log_init(CMD *cp)
* @brief Initialize the ddradseq log file.
* @param cp Pointer to command line data structure (read-only).
* @return Zero on success and non-zero on failure.
*/
extern int log_init(CMD *cp);
/** @fn void loginfo(FILE *lf, const char *format)
* @brief Write informational message to log file.
*/
extern void loginfo(FILE *lf, const char *format, ...);
/** @fn void logwarn(FILE *lf, const char *format)
* @brief Write warning message to log file.
*/
extern void logwarn(FILE *lf, const char *format, ...);
/** @fn void logerror(FILE *lf, const char *format)
* @brief Report error message to both the logfile and standard error.
*/
extern void logerror(FILE *lf, const char *format, ...);
/** @fn int get_timestr(char *s);
* @ brief Fill in current time for log file reporting.
* @param s Pointer to time string.
* @return Zero on success and non-zero on failure.
*/
extern int get_timestr(char *s);
/******************************************************
* Error reporting functions
******************************************************/
/** @fn void error(const char *format)
* @brief Report error to stderr
*/
extern void error(const char *format, ...);
/******************************************************
* Inline utility functions
******************************************************/
/** @fn inline int string_equal(const char *a, const char *b)
* @brief Compare two strings for equality
* @param a Pointer to first string (read-only).
* @param b Pointer to second string (read-only).
* @return Non-zero if strings are equal and zero if the strings are not equal.
*/
static inline int string_equal(const char *a, const char *b)
{
return (strcmp(a, b) == 0);
}
#endif
| 33.574394 | 136 | 0.643615 |
dc6dd3570e00ed04a05df72e4d58436718509b1f | 4,249 | h | C | u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/drivers/ram/k3-j721e/lpddr4_structs_if.h | rlourette/TI_SDK_u-boot-2019.01 | 3000a07c021e84d717e6792a74efcf895a7d7188 | [
"MIT"
] | 1 | 2021-11-21T19:56:29.000Z | 2021-11-21T19:56:29.000Z | u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/drivers/ram/k3-j721e/lpddr4_structs_if.h | rlourette/TI_SDK_u-boot-2019.01 | 3000a07c021e84d717e6792a74efcf895a7d7188 | [
"MIT"
] | null | null | null | u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/drivers/ram/k3-j721e/lpddr4_structs_if.h | rlourette/TI_SDK_u-boot-2019.01 | 3000a07c021e84d717e6792a74efcf895a7d7188 | [
"MIT"
] | null | null | null | /* SPDX-License-Identifier: BSD-3-Clause */
/**********************************************************************
* Copyright (C) 2012-2019 Cadence Design Systems, Inc.
**********************************************************************
* WARNING: This file is auto-generated using api-generator utility.
* api-generator: 12.02.13bb8d5
* Do not edit it manually.
**********************************************************************
* Cadence Core Driver for LPDDR4.
**********************************************************************
*/
#ifndef LPDDR4_STRUCTS_IF_H
#define LPDDR4_STRUCTS_IF_H
#include <linux/types.h>
#include "lpddr4_if.h"
/** @defgroup DataStructure Dynamic Data Structures
* This section defines the data structures used by the driver to provide
* hardware information, modification and dynamic operation of the driver.
* These data structures are defined in the header file of the core driver
* and utilized by the API.
* @{
*/
/**********************************************************************
* Structures and unions
**********************************************************************/
/**
* Configuration of device.
* Object of this type is used for probe and init functions.
*/
struct lpddr4_config_s
{
/** Base address of controller registers */
struct lpddr4_ctlregs_s* ctlbase;
/** Information/warning handler */
lpddr4_infocallback infohandler;
/** Controller interrupt handler */
lpddr4_ctlcallback ctlinterrupthandler;
/** PHY Independent Module interrupt handler */
lpddr4_phyindepcallback phyindepinterrupthandler;
};
/**
* Structure contains private data for Core Driver that should not be used by
* upper layers. This is not a part of API and manipulating of those data may cause
* unpredictable behavior of Core Driver.
*/
struct lpddr4_privatedata_s
{
/** Base address of controller registers */
struct lpddr4_ctlregs_s* ctlbase;
/** Information/warning handler */
lpddr4_infocallback infohandler;
/** Controller interrupt handler */
lpddr4_ctlcallback ctlinterrupthandler;
/** PHY Independent Module interrupt handler */
lpddr4_phyindepcallback phyindepinterrupthandler;
};
/** Structure to contain debug information reported by the driver. */
struct lpddr4_debuginfo_s
{
/** PLL Lock error. */
bool pllerror;
/** I/O calibration error. */
bool iocaliberror;
/** RX offset error. */
bool rxoffseterror;
/** CA training error. */
bool catraingerror;
/** Write levelling error. */
bool wrlvlerror;
/** Gate Level error. */
bool gatelvlerror;
/** Read Level error. */
bool readlvlerror;
/** Write DQ training error. */
bool dqtrainingerror;
};
/** Frequency Set Point mode register values */
struct lpddr4_fspmoderegs_s
{
/** MR1 register data for the FSP. */
uint8_t mr1data_fn[LPDDR4_MAX_CS];
/** MR2 register data for the FSP. */
uint8_t mr2data_fn[LPDDR4_MAX_CS];
/** MR3 register data for the FSP. */
uint8_t mr3data_fn[LPDDR4_MAX_CS];
/** MR11 register data for the FSP. */
uint8_t mr11data_fn[LPDDR4_MAX_CS];
/** MR12 register data for the FSP. */
uint8_t mr12data_fn[LPDDR4_MAX_CS];
/** MR13 register data for the FSP. */
uint8_t mr13data_fn[LPDDR4_MAX_CS];
/** MR14 register data for the FSP. */
uint8_t mr14data_fn[LPDDR4_MAX_CS];
/** MR22 register data for the selected frequency. */
uint8_t mr22data_fn[LPDDR4_MAX_CS];
};
/** Structure to hold data set to initalise registers. */
struct lpddr4_reginitdata_s
{
/** Register initialisation data for the Controller. */
uint32_t denalictlreg[LPDDR4_CTL_REG_COUNT];
/** Should be set to true, if the corresponding denaliCtlReg element has been updated. */
bool updatectlreg[LPDDR4_CTL_REG_COUNT];
/** Register initialisation data for PHY independent module. */
uint32_t denaliphyindepreg[LPDDR4_PHY_INDEP_REG_COUNT];
/** Should be set to true, if the corresponding denaliPhyIndepReg element has been updated. */
bool updatephyindepreg[LPDDR4_PHY_INDEP_REG_COUNT];
/** Register initialisation data for the PHY. */
uint32_t denaliphyreg[LPDDR4_PHY_REG_COUNT];
/** Should be set to true, if the corresponding denaliPhyReg element has been updated. */
bool updatephyreg[LPDDR4_PHY_REG_COUNT];
};
#endif /* LPDDR4_STRUCTS_IF_H */
| 34.827869 | 95 | 0.672629 |
40d07f02674c786cb3890b082dd746ace56f5f90 | 17,595 | h | C | FreeBSD/sys/arm64/include/armreg.h | TigerBSD/FreeBSD-Custom-ThinkPad | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 91 | 2018-11-24T05:33:58.000Z | 2022-03-16T05:58:05.000Z | FreeBSD/sys/arm64/include/armreg.h | TigerBSD/FreeBSD-Custom-ThinkPad | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 21 | 2016-08-11T09:43:43.000Z | 2017-01-29T12:52:56.000Z | FreeBSD/sys/arm64/include/armreg.h | TigerBSD/TigerBSD | 3d092f261b362f73170871403397fc5d6b89d1dc | [
"0BSD"
] | 18 | 2018-11-24T10:35:29.000Z | 2021-04-22T07:22:10.000Z | /*-
* Copyright (c) 2013, 2014 Andrew Turner
* Copyright (c) 2015 The FreeBSD Foundation
* All rights reserved.
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _MACHINE_ARMREG_H_
#define _MACHINE_ARMREG_H_
#define INSN_SIZE 4
#define READ_SPECIALREG(reg) \
({ uint64_t val; \
__asm __volatile("mrs %0, " __STRING(reg) : "=&r" (val)); \
val; \
})
#define WRITE_SPECIALREG(reg, val) \
__asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)val))
/* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */
#define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */
#define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */
#define CNTHCTL_EVNTEN (1 << 2) /* Enable event stream */
#define CNTHCTL_EL1PCEN (1 << 1) /* Allow EL0/1 physical timer access */
#define CNTHCTL_EL1PCTEN (1 << 0) /*Allow EL0/1 physical counter access*/
/* CPACR_EL1 */
#define CPACR_FPEN_MASK (0x3 << 20)
#define CPACR_FPEN_TRAP_ALL1 (0x0 << 20) /* Traps from EL0 and EL1 */
#define CPACR_FPEN_TRAP_EL0 (0x1 << 20) /* Traps from EL0 */
#define CPACR_FPEN_TRAP_ALL2 (0x2 << 20) /* Traps from EL0 and EL1 */
#define CPACR_FPEN_TRAP_NONE (0x3 << 20) /* No traps */
#define CPACR_TTA (0x1 << 28)
/* CTR_EL0 - Cache Type Register */
#define CTR_DLINE_SHIFT 16
#define CTR_DLINE_MASK (0xf << CTR_DLINE_SHIFT)
#define CTR_DLINE_SIZE(reg) (((reg) & CTR_DLINE_MASK) >> CTR_DLINE_SHIFT)
#define CTR_ILINE_SHIFT 0
#define CTR_ILINE_MASK (0xf << CTR_ILINE_SHIFT)
#define CTR_ILINE_SIZE(reg) (((reg) & CTR_ILINE_MASK) >> CTR_ILINE_SHIFT)
/* DCZID_EL0 - Data Cache Zero ID register */
#define DCZID_DZP (1 << 4) /* DC ZVA prohibited if non-0 */
#define DCZID_BS_SHIFT 0
#define DCZID_BS_MASK (0xf << DCZID_BS_SHIFT)
#define DCZID_BS_SIZE(reg) (((reg) & DCZID_BS_MASK) >> DCZID_BS_SHIFT)
/* ESR_ELx */
#define ESR_ELx_ISS_MASK 0x00ffffff
#define ISS_INSN_FnV (0x01 << 10)
#define ISS_INSN_EA (0x01 << 9)
#define ISS_INSN_S1PTW (0x01 << 7)
#define ISS_INSN_IFSC_MASK (0x1f << 0)
#define ISS_DATA_ISV (0x01 << 24)
#define ISS_DATA_SAS_MASK (0x03 << 22)
#define ISS_DATA_SSE (0x01 << 21)
#define ISS_DATA_SRT_MASK (0x1f << 16)
#define ISS_DATA_SF (0x01 << 15)
#define ISS_DATA_AR (0x01 << 14)
#define ISS_DATA_FnV (0x01 << 10)
#define ISS_DATa_EA (0x01 << 9)
#define ISS_DATa_CM (0x01 << 8)
#define ISS_INSN_S1PTW (0x01 << 7)
#define ISS_DATa_WnR (0x01 << 6)
#define ISS_DATA_DFSC_MASK (0x1f << 0)
#define ESR_ELx_IL (0x01 << 25)
#define ESR_ELx_EC_SHIFT 26
#define ESR_ELx_EC_MASK (0x3f << 26)
#define ESR_ELx_EXCEPTION(esr) (((esr) & ESR_ELx_EC_MASK) >> ESR_ELx_EC_SHIFT)
#define EXCP_UNKNOWN 0x00 /* Unkwn exception */
#define EXCP_FP_SIMD 0x07 /* VFP/SIMD trap */
#define EXCP_ILL_STATE 0x0e /* Illegal execution state */
#define EXCP_SVC 0x15 /* SVC trap */
#define EXCP_MSR 0x18 /* MSR/MRS trap */
#define EXCP_INSN_ABORT_L 0x20 /* Instruction abort, from lower EL */
#define EXCP_INSN_ABORT 0x21 /* Instruction abort, from same EL */
#define EXCP_PC_ALIGN 0x22 /* PC alignment fault */
#define EXCP_DATA_ABORT_L 0x24 /* Data abort, from lower EL */
#define EXCP_DATA_ABORT 0x25 /* Data abort, from same EL */
#define EXCP_SP_ALIGN 0x26 /* SP slignment fault */
#define EXCP_TRAP_FP 0x2c /* Trapped FP exception */
#define EXCP_SERROR 0x2f /* SError interrupt */
#define EXCP_SOFTSTP_EL0 0x32 /* Software Step, from lower EL */
#define EXCP_SOFTSTP_EL1 0x33 /* Software Step, from same EL */
#define EXCP_WATCHPT_EL1 0x35 /* Watchpoint, from same EL */
#define EXCP_BRK 0x3c /* Breakpoint */
/* ICC_CTLR_EL1 */
#define ICC_CTLR_EL1_EOIMODE (1U << 1)
/* ICC_IAR1_EL1 */
#define ICC_IAR1_EL1_SPUR (0x03ff)
/* ICC_IGRPEN0_EL1 */
#define ICC_IGRPEN0_EL1_EN (1U << 0)
/* ICC_PMR_EL1 */
#define ICC_PMR_EL1_PRIO_MASK (0xFFUL)
/* ICC_SGI1R_EL1 */
#define ICC_SGI1R_EL1_TL_MASK 0xffffUL
#define ICC_SGI1R_EL1_AFF1_SHIFT 16
#define ICC_SGI1R_EL1_SGIID_SHIFT 24
#define ICC_SGI1R_EL1_AFF2_SHIFT 32
#define ICC_SGI1R_EL1_AFF3_SHIFT 48
#define ICC_SGI1R_EL1_SGIID_MASK 0xfUL
#define ICC_SGI1R_EL1_IRM (0x1UL << 40)
/* ICC_SRE_EL1 */
#define ICC_SRE_EL1_SRE (1U << 0)
/* ICC_SRE_EL2 */
#define ICC_SRE_EL2_SRE (1U << 0)
#define ICC_SRE_EL2_EN (1U << 3)
/* ID_AA64DFR0_EL1 */
#define ID_AA64DFR0_MASK 0xf0f0ffff
#define ID_AA64DFR0_DEBUG_VER_SHIFT 0
#define ID_AA64DFR0_DEBUG_VER_MASK (0xf << ID_AA64DFR0_DEBUG_VER_SHIFT)
#define ID_AA64DFR0_DEBUG_VER(x) ((x) & ID_AA64DFR0_DEBUG_VER_MASK)
#define ID_AA64DFR0_DEBUG_VER_8 (0x6 << ID_AA64DFR0_DEBUG_VER_SHIFT)
#define ID_AA64DFR0_TRACE_VER_SHIFT 4
#define ID_AA64DFR0_TRACE_VER_MASK (0xf << ID_AA64DFR0_TRACE_VER_SHIFT)
#define ID_AA64DFR0_TRACE_VER(x) ((x) & ID_AA64DFR0_TRACE_VER_MASK)
#define ID_AA64DFR0_TRACE_VER_NONE (0x0 << ID_AA64DFR0_TRACE_VER_SHIFT)
#define ID_AA64DFR0_TRACE_VER_IMPL (0x1 << ID_AA64DFR0_TRACE_VER_SHIFT)
#define ID_AA64DFR0_PMU_VER_SHIFT 8
#define ID_AA64DFR0_PMU_VER_MASK (0xf << ID_AA64DFR0_PMU_VER_SHIFT)
#define ID_AA64DFR0_PMU_VER(x) ((x) & ID_AA64DFR0_PMU_VER_MASK)
#define ID_AA64DFR0_PMU_VER_NONE (0x0 << ID_AA64DFR0_PMU_VER_SHIFT)
#define ID_AA64DFR0_PMU_VER_3 (0x1 << ID_AA64DFR0_PMU_VER_SHIFT)
#define ID_AA64DFR0_PMU_VER_IMPL (0xf << ID_AA64DFR0_PMU_VER_SHIFT)
#define ID_AA64DFR0_BRPS_SHIFT 12
#define ID_AA64DFR0_BRPS_MASK (0xf << ID_AA64DFR0_BRPS_SHIFT)
#define ID_AA64DFR0_BRPS(x) \
((((x) >> ID_AA64DFR0_BRPS_SHIFT) & 0xf) + 1)
#define ID_AA64DFR0_WRPS_SHIFT 20
#define ID_AA64DFR0_WRPS_MASK (0xf << ID_AA64DFR0_WRPS_SHIFT)
#define ID_AA64DFR0_WRPS(x) \
((((x) >> ID_AA64DFR0_WRPS_SHIFT) & 0xf) + 1)
#define ID_AA64DFR0_CTX_CMPS_SHIFT 28
#define ID_AA64DFR0_CTX_CMPS_MASK (0xf << ID_AA64DFR0_CTX_CMPS_SHIFT)
#define ID_AA64DFR0_CTX_CMPS(x) \
((((x) >> ID_AA64DFR0_CTX_CMPS_SHIFT) & 0xf) + 1)
/* ID_AA64ISAR0_EL1 */
#define ID_AA64ISAR0_MASK 0x000ffff0
#define ID_AA64ISAR0_AES_SHIFT 4
#define ID_AA64ISAR0_AES_MASK (0xf << ID_AA64ISAR0_AES_SHIFT)
#define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK)
#define ID_AA64ISAR0_AES_NONE (0x0 << ID_AA64ISAR0_AES_SHIFT)
#define ID_AA64ISAR0_AES_BASE (0x1 << ID_AA64ISAR0_AES_SHIFT)
#define ID_AA64ISAR0_AES_PMULL (0x2 << ID_AA64ISAR0_AES_SHIFT)
#define ID_AA64ISAR0_SHA1_SHIFT 8
#define ID_AA64ISAR0_SHA1_MASK (0xf << ID_AA64ISAR0_SHA1_SHIFT)
#define ID_AA64ISAR0_SHA1(x) ((x) & ID_AA64ISAR0_SHA1_MASK)
#define ID_AA64ISAR0_SHA1_NONE (0x0 << ID_AA64ISAR0_SHA1_SHIFT)
#define ID_AA64ISAR0_SHA1_BASE (0x1 << ID_AA64ISAR0_SHA1_SHIFT)
#define ID_AA64ISAR0_SHA2_SHIFT 12
#define ID_AA64ISAR0_SHA2_MASK (0xf << ID_AA64ISAR0_SHA2_SHIFT)
#define ID_AA64ISAR0_SHA2(x) ((x) & ID_AA64ISAR0_SHA2_MASK)
#define ID_AA64ISAR0_SHA2_NONE (0x0 << ID_AA64ISAR0_SHA2_SHIFT)
#define ID_AA64ISAR0_SHA2_BASE (0x1 << ID_AA64ISAR0_SHA2_SHIFT)
#define ID_AA64ISAR0_CRC32_SHIFT 16
#define ID_AA64ISAR0_CRC32_MASK (0xf << ID_AA64ISAR0_CRC32_SHIFT)
#define ID_AA64ISAR0_CRC32(x) ((x) & ID_AA64ISAR0_CRC32_MASK)
#define ID_AA64ISAR0_CRC32_NONE (0x0 << ID_AA64ISAR0_CRC32_SHIFT)
#define ID_AA64ISAR0_CRC32_BASE (0x1 << ID_AA64ISAR0_CRC32_SHIFT)
/* ID_AA64MMFR0_EL1 */
#define ID_AA64MMFR0_MASK 0xffffffff
#define ID_AA64MMFR0_PA_RANGE_SHIFT 0
#define ID_AA64MMFR0_PA_RANGE_MASK (0xf << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE(x) ((x) & ID_AA64MMFR0_PA_RANGE_MASK)
#define ID_AA64MMFR0_PA_RANGE_4G (0x0 << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE_64G (0x1 << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE_1T (0x2 << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE_4T (0x3 << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE_16T (0x4 << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE_256T (0x5 << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_ASID_BITS_SHIFT 4
#define ID_AA64MMFR0_ASID_BITS_MASK (0xf << ID_AA64MMFR0_ASID_BITS_SHIFT)
#define ID_AA64MMFR0_ASID_BITS(x) ((x) & ID_AA64MMFR0_ASID_BITS_MASK)
#define ID_AA64MMFR0_ASID_BITS_8 (0x0 << ID_AA64MMFR0_ASID_BITS_SHIFT)
#define ID_AA64MMFR0_ASID_BITS_16 (0x2 << ID_AA64MMFR0_ASID_BITS_SHIFT)
#define ID_AA64MMFR0_BIGEND_SHIFT 8
#define ID_AA64MMFR0_BIGEND_MASK (0xf << ID_AA64MMFR0_BIGEND_SHIFT)
#define ID_AA64MMFR0_BIGEND(x) ((x) & ID_AA64MMFR0_BIGEND_MASK)
#define ID_AA64MMFR0_BIGEND_FIXED (0x0 << ID_AA64MMFR0_BIGEND_SHIFT)
#define ID_AA64MMFR0_BIGEND_MIXED (0x1 << ID_AA64MMFR0_BIGEND_SHIFT)
#define ID_AA64MMFR0_S_NS_MEM_SHIFT 12
#define ID_AA64MMFR0_S_NS_MEM_MASK (0xf << ID_AA64MMFR0_S_NS_MEM_SHIFT)
#define ID_AA64MMFR0_S_NS_MEM(x) ((x) & ID_AA64MMFR0_S_NS_MEM_MASK)
#define ID_AA64MMFR0_S_NS_MEM_NONE (0x0 << ID_AA64MMFR0_S_NS_MEM_SHIFT)
#define ID_AA64MMFR0_S_NS_MEM_DISTINCT (0x1 << ID_AA64MMFR0_S_NS_MEM_SHIFT)
#define ID_AA64MMFR0_BIGEND_EL0_SHIFT 16
#define ID_AA64MMFR0_BIGEND_EL0_MASK (0xf << ID_AA64MMFR0_BIGEND_EL0_SHIFT)
#define ID_AA64MMFR0_BIGEND_EL0(x) ((x) & ID_AA64MMFR0_BIGEND_EL0_MASK)
#define ID_AA64MMFR0_BIGEND_EL0_FIXED (0x0 << ID_AA64MMFR0_BIGEND_EL0_SHIFT)
#define ID_AA64MMFR0_BIGEND_EL0_MIXED (0x1 << ID_AA64MMFR0_BIGEND_EL0_SHIFT)
#define ID_AA64MMFR0_TGRAN16_SHIFT 20
#define ID_AA64MMFR0_TGRAN16_MASK (0xf << ID_AA64MMFR0_TGRAN16_SHIFT)
#define ID_AA64MMFR0_TGRAN16(x) ((x) & ID_AA64MMFR0_TGRAN16_MASK)
#define ID_AA64MMFR0_TGRAN16_NONE (0x0 << ID_AA64MMFR0_TGRAN16_SHIFT)
#define ID_AA64MMFR0_TGRAN16_IMPL (0x1 << ID_AA64MMFR0_TGRAN16_SHIFT)
#define ID_AA64MMFR0_TGRAN64_SHIFT 24
#define ID_AA64MMFR0_TGRAN64_MASK (0xf << ID_AA64MMFR0_TGRAN64_SHIFT)
#define ID_AA64MMFR0_TGRAN64(x) ((x) & ID_AA64MMFR0_TGRAN64_MASK)
#define ID_AA64MMFR0_TGRAN64_IMPL (0x0 << ID_AA64MMFR0_TGRAN64_SHIFT)
#define ID_AA64MMFR0_TGRAN64_NONE (0xf << ID_AA64MMFR0_TGRAN64_SHIFT)
#define ID_AA64MMFR0_TGRAN4_SHIFT 28
#define ID_AA64MMFR0_TGRAN4_MASK (0xf << ID_AA64MMFR0_TGRAN4_SHIFT)
#define ID_AA64MMFR0_TGRAN4(x) ((x) & ID_AA64MMFR0_TGRAN4_MASK)
#define ID_AA64MMFR0_TGRAN4_IMPL (0x0 << ID_AA64MMFR0_TGRAN4_SHIFT)
#define ID_AA64MMFR0_TGRAN4_NONE (0xf << ID_AA64MMFR0_TGRAN4_SHIFT)
/* ID_AA64PFR0_EL1 */
#define ID_AA64PFR0_MASK 0x0fffffff
#define ID_AA64PFR0_EL0_SHIFT 0
#define ID_AA64PFR0_EL0_MASK (0xf << ID_AA64PFR0_EL0_SHIFT)
#define ID_AA64PFR0_EL0(x) ((x) & ID_AA64PFR0_EL0_MASK)
#define ID_AA64PFR0_EL0_64 (1 << ID_AA64PFR0_EL0_SHIFT)
#define ID_AA64PFR0_EL0_64_32 (2 << ID_AA64PFR0_EL0_SHIFT)
#define ID_AA64PFR0_EL1_SHIFT 4
#define ID_AA64PFR0_EL1_MASK (0xf << ID_AA64PFR0_EL1_SHIFT)
#define ID_AA64PFR0_EL1(x) ((x) & ID_AA64PFR0_EL1_MASK)
#define ID_AA64PFR0_EL1_64 (1 << ID_AA64PFR0_EL1_SHIFT)
#define ID_AA64PFR0_EL1_64_32 (2 << ID_AA64PFR0_EL1_SHIFT)
#define ID_AA64PFR0_EL2_SHIFT 8
#define ID_AA64PFR0_EL2_MASK (0xf << ID_AA64PFR0_EL2_SHIFT)
#define ID_AA64PFR0_EL2(x) ((x) & ID_AA64PFR0_EL2_MASK)
#define ID_AA64PFR0_EL2_NONE (0 << ID_AA64PFR0_EL2_SHIFT)
#define ID_AA64PFR0_EL2_64 (1 << ID_AA64PFR0_EL2_SHIFT)
#define ID_AA64PFR0_EL2_64_32 (2 << ID_AA64PFR0_EL2_SHIFT)
#define ID_AA64PFR0_EL3_SHIFT 12
#define ID_AA64PFR0_EL3_MASK (0xf << ID_AA64PFR0_EL3_SHIFT)
#define ID_AA64PFR0_EL3(x) ((x) & ID_AA64PFR0_EL3_MASK)
#define ID_AA64PFR0_EL3_NONE (0 << ID_AA64PFR0_EL3_SHIFT)
#define ID_AA64PFR0_EL3_64 (1 << ID_AA64PFR0_EL3_SHIFT)
#define ID_AA64PFR0_EL3_64_32 (2 << ID_AA64PFR0_EL3_SHIFT)
#define ID_AA64PFR0_FP_SHIFT 16
#define ID_AA64PFR0_FP_MASK (0xf << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_FP(x) ((x) & ID_AA64PFR0_FP_MASK)
#define ID_AA64PFR0_FP_IMPL (0x0 << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_FP_NONE (0xf << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_ADV_SIMD_SHIFT 20
#define ID_AA64PFR0_ADV_SIMD_MASK (0xf << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_ADV_SIMD(x) ((x) & ID_AA64PFR0_ADV_SIMD_MASK)
#define ID_AA64PFR0_ADV_SIMD_IMPL (0x0 << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_ADV_SIMD_NONE (0xf << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_GIC_BITS 0x4 /* Number of bits in GIC field */
#define ID_AA64PFR0_GIC_SHIFT 24
#define ID_AA64PFR0_GIC_MASK (0xf << ID_AA64PFR0_GIC_SHIFT)
#define ID_AA64PFR0_GIC(x) ((x) & ID_AA64PFR0_GIC_MASK)
#define ID_AA64PFR0_GIC_CPUIF_NONE (0x0 << ID_AA64PFR0_GIC_SHIFT)
#define ID_AA64PFR0_GIC_CPUIF_EN (0x1 << ID_AA64PFR0_GIC_SHIFT)
/* MAIR_EL1 - Memory Attribute Indirection Register */
#define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8))
#define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8))
/* SCTLR_EL1 - System Control Register */
#define SCTLR_RES0 0xc8222400 /* Reserved, write 0 */
#define SCTLR_RES1 0x30d00800 /* Reserved, write 1 */
#define SCTLR_M 0x00000001
#define SCTLR_A 0x00000002
#define SCTLR_C 0x00000004
#define SCTLR_SA 0x00000008
#define SCTLR_SA0 0x00000010
#define SCTLR_CP15BEN 0x00000020
#define SCTLR_THEE 0x00000040
#define SCTLR_ITD 0x00000080
#define SCTLR_SED 0x00000100
#define SCTLR_UMA 0x00000200
#define SCTLR_I 0x00001000
#define SCTLR_DZE 0x00004000
#define SCTLR_UCT 0x00008000
#define SCTLR_nTWI 0x00010000
#define SCTLR_nTWE 0x00040000
#define SCTLR_WXN 0x00080000
#define SCTLR_EOE 0x01000000
#define SCTLR_EE 0x02000000
#define SCTLR_UCI 0x04000000
/* SPSR_EL1 */
/*
* When the exception is taken in AArch64:
* M[4] is 0 for AArch64 mode
* M[3:2] is the exception level
* M[1] is unused
* M[0] is the SP select:
* 0: always SP0
* 1: current ELs SP
*/
#define PSR_M_EL0t 0x00000000
#define PSR_M_EL1t 0x00000004
#define PSR_M_EL1h 0x00000005
#define PSR_M_EL2t 0x00000008
#define PSR_M_EL2h 0x00000009
#define PSR_M_MASK 0x0000001f
#define PSR_F 0x00000040
#define PSR_I 0x00000080
#define PSR_A 0x00000100
#define PSR_D 0x00000200
#define PSR_IL 0x00100000
#define PSR_SS 0x00200000
#define PSR_V 0x10000000
#define PSR_C 0x20000000
#define PSR_Z 0x40000000
#define PSR_N 0x80000000
/* TCR_EL1 - Translation Control Register */
#define TCR_ASID_16 (1 << 36)
#define TCR_IPS_SHIFT 32
#define TCR_IPS_32BIT (0 << TCR_IPS_SHIFT)
#define TCR_IPS_36BIT (1 << TCR_IPS_SHIFT)
#define TCR_IPS_40BIT (2 << TCR_IPS_SHIFT)
#define TCR_IPS_42BIT (3 << TCR_IPS_SHIFT)
#define TCR_IPS_44BIT (4 << TCR_IPS_SHIFT)
#define TCR_IPS_48BIT (5 << TCR_IPS_SHIFT)
#define TCR_TG1_SHIFT 30
#define TCR_TG1_16K (1 << TCR_TG1_SHIFT)
#define TCR_TG1_4K (2 << TCR_TG1_SHIFT)
#define TCR_TG1_64K (3 << TCR_TG1_SHIFT)
#define TCR_SH1_SHIFT 28
#define TCR_SH1_IS (0x3UL << TCR_SH1_SHIFT)
#define TCR_ORGN1_SHIFT 26
#define TCR_ORGN1_WBWA (0x1UL << TCR_ORGN1_SHIFT)
#define TCR_IRGN1_SHIFT 24
#define TCR_IRGN1_WBWA (0x1UL << TCR_IRGN1_SHIFT)
#define TCR_SH0_SHIFT 12
#define TCR_SH0_IS (0x3UL << TCR_SH0_SHIFT)
#define TCR_ORGN0_SHIFT 10
#define TCR_ORGN0_WBWA (0x1UL << TCR_ORGN0_SHIFT)
#define TCR_IRGN0_SHIFT 8
#define TCR_IRGN0_WBWA (0x1UL << TCR_IRGN0_SHIFT)
#define TCR_CACHE_ATTRS ((TCR_IRGN0_WBWA | TCR_IRGN1_WBWA) |\
(TCR_ORGN0_WBWA | TCR_ORGN1_WBWA))
#ifdef SMP
#define TCR_SMP_ATTRS (TCR_SH0_IS | TCR_SH1_IS)
#else
#define TCR_SMP_ATTRS 0
#endif
#define TCR_T1SZ_SHIFT 16
#define TCR_T0SZ_SHIFT 0
#define TCR_T1SZ(x) ((x) << TCR_T1SZ_SHIFT)
#define TCR_T0SZ(x) ((x) << TCR_T0SZ_SHIFT)
#define TCR_TxSZ(x) (TCR_T1SZ(x) | TCR_T0SZ(x))
/* Saved Program Status Register */
#define DBG_SPSR_SS (0x1 << 21)
/* Monitor Debug System Control Register */
#define DBG_MDSCR_SS (0x1 << 0)
#define DBG_MDSCR_KDE (0x1 << 13)
#define DBG_MDSCR_MDE (0x1 << 15)
/* Perfomance Monitoring Counters */
#define PMCR_E (1 << 0) /* Enable all counters */
#define PMCR_P (1 << 1) /* Reset all counters */
#define PMCR_C (1 << 2) /* Clock counter reset */
#define PMCR_D (1 << 3) /* CNTR counts every 64 clk cycles */
#define PMCR_X (1 << 4) /* Export to ext. monitoring (ETM) */
#define PMCR_DP (1 << 5) /* Disable CCNT if non-invasive debug*/
#define PMCR_LC (1 << 6) /* Long cycle count enable */
#define PMCR_IMP_SHIFT 24 /* Implementer code */
#define PMCR_IMP_MASK (0xff << PMCR_IMP_SHIFT)
#define PMCR_IDCODE_SHIFT 16 /* Identification code */
#define PMCR_IDCODE_MASK (0xff << PMCR_IDCODE_SHIFT)
#define PMCR_IDCODE_CORTEX_A57 0x01
#define PMCR_IDCODE_CORTEX_A72 0x02
#define PMCR_IDCODE_CORTEX_A53 0x03
#define PMCR_N_SHIFT 11 /* Number of counters implemented */
#define PMCR_N_MASK (0x1f << PMCR_N_SHIFT)
#endif /* !_MACHINE_ARMREG_H_ */
| 42.706311 | 78 | 0.775675 |
7b6858698cc237855a4923bd0d6d7a71fcdb3b7d | 6,491 | h | C | src/GrainViewer/utils/jsonutils.h | eliemichel/GrainViewer | 91d4922b3185ada90508f0944f2691ba8eba45e3 | [
"MIT"
] | 8 | 2020-12-14T13:14:22.000Z | 2021-12-11T20:04:54.000Z | src/GrainViewer/utils/jsonutils.h | eliemichel/GrainViewer | 91d4922b3185ada90508f0944f2691ba8eba45e3 | [
"MIT"
] | null | null | null | src/GrainViewer/utils/jsonutils.h | eliemichel/GrainViewer | 91d4922b3185ada90508f0944f2691ba8eba45e3 | [
"MIT"
] | 2 | 2020-12-16T10:02:15.000Z | 2021-03-16T16:06:19.000Z | /**
* This file is part of GrainViewer, the reference implementation of:
*
* Michel, Élie and Boubekeur, Tamy (2020).
* Real Time Multiscale Rendering of Dense Dynamic Stackings,
* Computer Graphics Forum (Proc. Pacific Graphics 2020), 39: 169-179.
* https://doi.org/10.1111/cgf.14135
*
* Copyright (c) 2017 - 2020 -- Télécom Paris (Élie Michel <elie.michel@telecom-paris.fr>)
*
* 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 non-infringement. In no event shall the
* authors or copyright holders be liable for any claim, damages or other
* liability, whether in an action of contract, tort or otherwise, arising
* from, out of or in connection with the software or the use or other dealings
* in the Software.
*/
#pragma once
#include "Logger.h"
#include "SerializationType.h"
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <rapidjson/document.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/ostreamwrapper.h>
#include <rapidjson/writer.h>
#include <memory>
#include <string>
#include <vector>
typedef rapidjson::Writer<rapidjson::OStreamWrapper> JsonWriter;
bool openJson(const std::string& filename, rapidjson::Document& d);
bool jrString(const rapidjson::Value& json, const std::string & key, std::string & target, const std::string & parentName);
template<typename T> inline bool _read(T & target, const rapidjson::Value& json) {
return /*json.IsObject() &&*/ target.deserialize(json);
}
template<typename T> inline bool _read(std::vector<T>& target, const rapidjson::Value& json) {
if (!json.IsArray()) return false;
target.reserve(json.Size());
for (int k = 0; k < static_cast<int>(json.Size()); ++k) {
T item;
if (!_read(item, json[k])) {
target.resize(0);
return false;
}
target.push_back(std::move(item));
}
return true;
}
template<> inline bool _read(float & target, const rapidjson::Value& json) {
return json.IsNumber() && ((target = json.GetFloat()) || true);
}
template<> inline bool _read(int & target, const rapidjson::Value& json) {
return json.IsInt() && ((target = json.GetInt()) || true);
}
template<> inline bool _read(bool & target, const rapidjson::Value& json) {
return json.IsBool() && ((target = json.GetBool()) || true);
}
template<> inline bool _read(std::string & target, const rapidjson::Value& json) {
if (!json.IsString()) return false;
target = json.GetString();
return true;
}
template<> inline bool _read(glm::vec3 & target, const rapidjson::Value& json) {
if (!json.IsArray() || json.Size() != 3) return false;
for (int k = 0 ; k < 3 ; ++k) target[k] = json[k].GetFloat();
return true;
}
template<> inline bool _read(glm::vec4& target, const rapidjson::Value& json) {
if (!json.IsArray() || json.Size() != 4) return false;
for (int k = 0; k < 4; ++k) target[k] = json[k].GetFloat();
return true;
}
template<> inline bool _read(glm::quat & target, const rapidjson::Value& json) {
if (!json.IsArray() || json.Size() != 4) return false;
for (int k = 0; k < 4; ++k) target[k] = json[k].GetFloat();
return true;
}
template <typename T>
inline bool jrOption(const rapidjson::Value& json, const std::string & key, T & target, const T& defaultValue = T()) {
if (!json.HasMember(key.c_str())) {
target = defaultValue;
return false;
}
const rapidjson::Value& d = json[key.c_str()];
if (!_read(target, d)) {
WARN_LOG << "Ignoring '" << key << "' (expected type " << SerializationType<T>::Name() << ")";
target = defaultValue;
return false;
}
return true;
}
template<typename T>
inline bool jrArray(const rapidjson::Value& json, const std::string & key, std::vector<T> & target, int size = -1) {
if (json.HasMember(key.c_str())) {
const rapidjson::Value& d = json[key.c_str()];
if (!d.IsArray()) {
WARN_LOG << "Ignoring '" << key << "' (expected an array)";
return false;
}
if (size != -1 && static_cast<int>(d.Size()) != size) {
WARN_LOG << "Ignoring '" << key << "' (expected an array of size " << size << ")";
return false;
}
target.resize(static_cast<size_t>(d.Size()));
for (rapidjson::SizeType i = 0; i < d.Size(); i++) {
const rapidjson::Value& dd = d[i];
T & item = target[static_cast<size_t>(i)];
if (!_read(item, dd)) {
WARN_LOG << "Ignoring '" << key << "' (error while parsing item #" << i << " as type " << SerializationType<T>::Name() << ")";
target.resize(0);
return false;
}
}
}
return true;
}
template<typename T> inline void _write(const T & v, JsonWriter & writer) {
v.writeJson(writer);
}
template<> inline void _write(const float & v, JsonWriter & writer) {
writer.Double(v);
}
template<> inline void _write(const int & v, JsonWriter & writer) {
writer.Int(v);
}
template<> inline void _write(const bool & v, JsonWriter & writer) {
writer.Bool(v);
}
template<> inline void _write(const std::string & v, JsonWriter & writer) {
writer.String(v.c_str());
}
inline void _write(const char* v, JsonWriter & writer) {
writer.String(v);
}
template<typename T>
inline void jwArray(JsonWriter & writer, const std::string & key, const std::vector<T> & values) {
writer.Key(key.c_str());
writer.StartArray();
for (const auto& v : values) {
_write(v, writer);
}
writer.EndArray();
}
template<typename T>
inline void jw(JsonWriter & writer, const std::string & key, const T & v) {
writer.Key(key.c_str());
_write(v, writer);
}
// Utility preprocessor routines to be used with canonical variable names
#define JREAD_DEFAULT(x, d) jrOption(json, #x, m_ ## x, d)
#define JREAD(x) jrOption(json, #x, m_ ## x)
#define JREADp(x) jrOption(json, #x, x)
#define JREAD_ARRAY(x, d) jrArray(json, #x, m_ ## x, d)
#define JREAD_LIST(x) jrArray(json, #x, m_ ## x)
#define JWRITE(x) jw(writer, #x, m_ ## x)
#define JWRITEp(x) jw(writer, #x, x)
| 34.897849 | 130 | 0.677708 |
7bea341e769143ed4a65eb537f6f880deea439fe | 220 | h | C | SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h | codelynx/sdl_ios | 90317e17d408426547b4afed91620bc695a3279c | [
"BSD-3-Clause"
] | 171 | 2015-01-13T14:17:29.000Z | 2022-03-18T19:55:24.000Z | SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h | codelynx/sdl_ios | 90317e17d408426547b4afed91620bc695a3279c | [
"BSD-3-Clause"
] | 1,524 | 2015-01-16T14:31:10.000Z | 2022-03-30T14:37:02.000Z | SmartDeviceLink/public/SDLSubscribeWayPointsResponse.h | codelynx/sdl_ios | 90317e17d408426547b4afed91620bc695a3279c | [
"BSD-3-Clause"
] | 129 | 2015-01-15T19:27:18.000Z | 2021-11-26T01:49:12.000Z | // SDLSubscribeWaypointsResponse.h
//
#import "SDLRPCResponse.h"
NS_ASSUME_NONNULL_BEGIN
/**
Response to SubscribeWayPoints
*/
@interface SDLSubscribeWayPointsResponse : SDLRPCResponse
@end
NS_ASSUME_NONNULL_END
| 13.75 | 57 | 0.809091 |
f46cccd6d81ca7957110c40c6641836a53039cde | 538 | c | C | Light OJ/oj 1006.c | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 6 | 2018-10-15T18:45:05.000Z | 2022-03-29T04:30:10.000Z | Light OJ/oj 1006.c | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | null | null | null | Light OJ/oj 1006.c | dipta007/Competitive-Programming | 998d47f08984703c5b415b98365ddbc84ad289c4 | [
"MIT"
] | 4 | 2018-01-07T06:20:07.000Z | 2019-08-21T15:45:59.000Z | #include <stdio.h>
int a, b, c, d, e, f;
int fn( int n ) {
if( n == 0 ) return a;
if( n == 1 ) return b;
if( n == 2 ) return c;
if( n == 3 ) return d;
if( n == 4 ) return e;
if( n == 5 ) return f;
return( fn(n-1) + fn(n-2) + fn(n-3) + fn(n-4) + fn(n-5) + fn(n-6) );
}
int main() {
int n, caseno = 0, cases;
scanf("%d", &cases);
while( cases-- ) {
scanf("%d %d %d %d %d %d %d", &a, &b, &c, &d, &e, &f, &n);
printf("Case %d: %d\n", ++caseno, fn(n) % 10000007);
}
return 0;
}
| 24.454545 | 72 | 0.421933 |
71a55c95483574f59b656ea7f2d32265cda3aa35 | 2,402 | h | C | Contrib/at67/cpu.h | tbraun-de/gigatron-rom | a7cf71f4bce8e980a2f8ae409cc6c727c7b1e339 | [
"BSD-2-Clause"
] | null | null | null | Contrib/at67/cpu.h | tbraun-de/gigatron-rom | a7cf71f4bce8e980a2f8ae409cc6c727c7b1e339 | [
"BSD-2-Clause"
] | null | null | null | Contrib/at67/cpu.h | tbraun-de/gigatron-rom | a7cf71f4bce8e980a2f8ae409cc6c727c7b1e339 | [
"BSD-2-Clause"
] | null | null | null | #ifndef CPU_H
#define CPU_H
#include <stdint.h>
#include <inttypes.h>
#include <string>
#define MAJOR_VERSION "0.7"
#define MINOR_VERSION "10"
#define VERSION_STR "gtemuSDL v" MAJOR_VERSION "." MINOR_VERSION
#define ROM_INST 0
#define ROM_DATA 1
#define ROM_TITLE_ADDRESS 0xFEB1
#define MAX_TITLE_CHARS 25
#define BOOT_COUNT 0x0004
#define BOOT_CHECK 0x0005
#define ROM_VCPU_DISPATCH 0x0309
#if defined(_WIN32)
#define _EXIT_(f) \
system("pause");\
exit(f);
#else
#define _EXIT_(f) \
system("read"); \
exit(f);
#endif
// At least on Windows, _X is a constant defined somewhere before here
#ifdef _X
#undef _X
#endif
namespace Cpu
{
enum ScanlineMode {Normal=0, VideoB, VideoC, VideoBC, NumScanlineModes};
enum InternalGt1Id {SnakeGt1=0, RacerGt1=1, MandelbrotGt1=2, PicturesGt1=3, CreditsGt1=4, LoaderGt1=5, NumInternalGt1s};
struct State
{
uint16_t _PC;
uint8_t _IR, _D, _AC, _X, _Y, _OUT, _undef;
};
struct InternalGt1
{
uint16_t _start;
uint16_t _patch;
uint16_t _string;
uint8_t _length; // string length
};
uint8_t* getPtrToROM(int& romSize);
void setFreeRAM(uint16_t freeRAM);
void initialiseInternalGt1s(void);
void patchSYS_Exec_88(void);
void patchScanlineModeVideoB(void);
void patchScanlineModeVideoC(void);
void patchTitleIntoRom(const std::string& title);
void patchSplitGt1IntoRom(const std::string& splitGt1path, const std::string& splitGt1name, uint16_t startAddress, InternalGt1Id gt1Id);
#ifndef STAND_ALONE
int64_t getClock(void);
uint8_t getIN(void);
uint8_t getXOUT(void);
uint8_t getRAM(uint16_t address);
uint8_t getROM(uint16_t address, int page);
uint16_t getRAM16(uint16_t address);
uint16_t getROM16(uint16_t address, int page);
float getvCpuUtilisation(void);
void setClock(int64_t clock);
void setIN(uint8_t in);
void setXOUT(uint8_t xout);
void setRAM(uint16_t address, uint8_t data);
void setROM(uint16_t base, uint16_t address, uint8_t data);
void setRAM16(uint16_t address, uint16_t data);
void setROM16(uint16_t base, uint16_t address, uint16_t data);
void setScanlineMode(ScanlineMode scanlineMode);
void initialise(State& S);
State cycle(const State& S);
void reset(bool coldBoot=false);
void vCpuUsage(State& S);
#endif
}
#endif | 24.510204 | 140 | 0.710241 |
ad22bb79e947d16949b248ffca4d9144697ca735 | 265 | h | C | PublicInformationServicePlatform/OtherProjects/Controller/PISPDemoViewController.h | DukeLenny/ProjectModel | 431557ea159abe5e266e359066c4a25c01b2699f | [
"MIT"
] | null | null | null | PublicInformationServicePlatform/OtherProjects/Controller/PISPDemoViewController.h | DukeLenny/ProjectModel | 431557ea159abe5e266e359066c4a25c01b2699f | [
"MIT"
] | null | null | null | PublicInformationServicePlatform/OtherProjects/Controller/PISPDemoViewController.h | DukeLenny/ProjectModel | 431557ea159abe5e266e359066c4a25c01b2699f | [
"MIT"
] | null | null | null | //
// PISPDemoViewController.h
// PublicInformationServicePlatform
//
// Created by LiDinggui on 2018/4/2.
// Copyright © 2018年 DAQSoft. All rights reserved.
//
#import "LDGBaseViewController.h"
@interface PISPDemoViewController : LDGBaseViewController
@end
| 18.928571 | 57 | 0.762264 |
5d98d995007a89e879d01cb99ed06ce7aa77f43e | 630 | h | C | DataClicker/DataClicker/Game.h | GundarsRebuks/DataClicker | e7c8f4275554a0384f85b419dec76a347338f9d3 | [
"MIT"
] | null | null | null | DataClicker/DataClicker/Game.h | GundarsRebuks/DataClicker | e7c8f4275554a0384f85b419dec76a347338f9d3 | [
"MIT"
] | null | null | null | DataClicker/DataClicker/Game.h | GundarsRebuks/DataClicker | e7c8f4275554a0384f85b419dec76a347338f9d3 | [
"MIT"
] | null | null | null | #pragma once
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include "Menu.h"
#include "Player.h"
class Game {
private:
// Variables
// Window
sf::RenderWindow* window;
sf::VideoMode videoMode;
sf::Event event;
// Functions
void initVar();
void initWin();
void initObj();
void pollEvents();
// Objects
Menu* menu;
Player* player;
public:
// Variables
sf::Font font;
// Constructors
Game();
virtual ~Game();
// Accessors
const bool running() const;
// Functions
void update();
void render();
Player* getPlayer();
}; | 14.318182 | 31 | 0.587302 |
42664637d050771270b96543c8a6ddc1ce455ecb | 700 | c | C | src/main.c | nathan-vl/Minesweeper | 211aa0651d64202ea514d544aab2f072ffa6a9d5 | [
"MIT"
] | null | null | null | src/main.c | nathan-vl/Minesweeper | 211aa0651d64202ea514d544aab2f072ffa6a9d5 | [
"MIT"
] | null | null | null | src/main.c | nathan-vl/Minesweeper | 211aa0651d64202ea514d544aab2f072ffa6a9d5 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <string.h>
#include "minesweeper_game.h"
#include "terminal_frontend.h"
int main(int argc, const char *argv[])
{
if (argc > 1)
{
for (int i = 1; i < argc; ++i)
{
const char *arg = argv[i];
if (strcmp(arg, "--help") == 0)
{
printf("Minesweeper 0.1.0\n");
return 0;
}
else
{
printf("Usage: minesweeper [--help]\n");
return 1;
}
}
}
struct MinesweeperGame game = new_minesweeper_game((struct Pos){8, 8}, 16);
play_game(&game);
free_minesweeper_game(&game);
return 0;
}
| 20 | 79 | 0.465714 |
0976f8a7ee9dc94efa7083775d2a991d60083d5e | 5,615 | h | C | cppSRTWrapper/SRTNet.h | Unit-X/srt_tango_2 | 9443457f807ad151c9b543f892c969404e74e3a7 | [
"MIT"
] | 1 | 2020-06-16T11:45:26.000Z | 2020-06-16T11:45:26.000Z | cppSRTWrapper/SRTNet.h | Unit-X/srt_tango_2 | 9443457f807ad151c9b543f892c969404e74e3a7 | [
"MIT"
] | null | null | null | cppSRTWrapper/SRTNet.h | Unit-X/srt_tango_2 | 9443457f807ad151c9b543f892c969404e74e3a7 | [
"MIT"
] | null | null | null | //
// Created by Anders Cedronius on 2019-04-21.
//
#ifndef CPPSRTWRAPPER_SRTNET_H
#define CPPSRTWRAPPER_SRTNET_H
#include <iostream>
#include <functional>
#include <atomic>
#include <thread>
#include <vector>
#include <utility>
#include <cstdlib>
#include <map>
#include <mutex>
#include <any>
#include "../srt/srtcore/srt.h"
#ifdef WIN32
#include <Winsock2.h>
#define _WINSOCKAPI_
#include <ws2tcpip.h>
#include <io.h>
#pragma comment( lib, "ws2_32.lib")
#else
#include <arpa/inet.h>
#endif
#define MAX_WORKERS 20 //Max number of connections to deal with each epoll
//Fill this class with all information you need for the duration of the connection both client and server
class NetworkConnection {
public:
std::any object;
};
namespace SRTNetClearStats {
enum SRTNetClearStats : int {
no,
yes
};
}
namespace SRTNetInstant {
enum SRTNetInstant : int {
no,
yes
};
}
class SRTNet {
public:
SRTNet();
virtual ~SRTNet();
/**
*
* Starts a SRT Server
*
* @param ip Listen IP
* @param port Listen Port
* @param reorder number of packets in re-order window
* @param payloadSize sets the SRT payload size
* @param psk Optional Pre Shared Key (AES-128)
* @return true if server was able to start
*/
bool startServer(std::string ip, uint16_t port, int reorder, int payloadSize,
std::string psk = "");
/**
*
* Starts a SRT Client
*
* @param ip Host IP
* @param port Host Port
* @param reorder number of packets in re-order window
* @param latency Max re-send window (ms) / also the delay of transmission
* @param overhead % extra of the BW that will be allowed for re-transmission packets
* @param payloadSize sets the SRT payload size
* @param psk Optional Pre Shared Key (AES-128)
* @return true if client was able to connect to the server
*
*/
bool startClient(std::string host, uint16_t port, int reorder, int32_t latency, int overhead,
std::shared_ptr<NetworkConnection> &ctx, int payloadSize, std::string psk = "");
/**
*
* Stops the service
*
* @return true if the service stopped successfully.
*/
bool stop();
/**
*
* Send data
*
* @param data pointer to the data
* @param len size of the data
* @param msgCtrl pointer to a SRT_MSGCTRL struct.
* @param targetSystem the target sending the data to.
* @return true if sendData was able to send the data to the target.
*/
bool sendData(uint8_t *data, size_t len, SRT_MSGCTRL *msgCtrl, SRTSOCKET targetSystem = 0);
/**
*
* Get connection statistics
*
* @param currentStats pointer to the statistics struct
* @param clear Clears the data after reading SRTNetClearStats::yes or no
* @param instantaneous Get the parameters now SRTNetInstant::yes or filtered values SRTNetInstant::no
* @param targetSystem The target connection to get statistics about.
* @return true if statistics was populated.
*/
bool getStatistics(SRT_TRACEBSTATS *currentStats, int clear, int instantaneous, SRTSOCKET targetSystem = 0);
/**
*
* Get active clients (A server method)
*
* @param function. pass a function getting the map containing the list of active connections
* Where the map contains the SRTSocketHandle (SRTSOCKET) and it's associated NetworkConnection you provided.
*/
void
getActiveClients(const std::function<void(std::map<SRTSOCKET, std::shared_ptr<NetworkConnection>> &)> &function);
///Callback handling connecting clients
std::function<std::shared_ptr<NetworkConnection>(struct sockaddr &sin,
SRTSOCKET newSocket)> clientConnected = nullptr;
///Callback receiving data type vector
std::function<void(std::unique_ptr<std::vector<uint8_t>> &data, SRT_MSGCTRL &msgCtrl,
std::shared_ptr<NetworkConnection> &ctx, SRTSOCKET socket)> receivedData = nullptr;
///Callback receiving data no copy
std::function<void(const uint8_t *data, size_t len, SRT_MSGCTRL &msgCtrl,
std::shared_ptr<NetworkConnection> &ctx, SRTSOCKET socket)> receivedDataNoCopy = nullptr;
// delete copy and move constructors and assign operators
SRTNet(SRTNet const &) = delete; // Copy construct
SRTNet(SRTNet &&) = delete; // Move construct
SRTNet &operator=(SRTNet const &) = delete; // Copy assign
SRTNet &operator=(SRTNet &&) = delete; // Move assign
SRTSOCKET context = 0;
private:
//Internal variables and methods
enum Mode {
unknown,
server,
client
};
void waitForSRTClient();
void serverEventHandler();
void clientWorker();
void closeAllClientSockets();
bool isIPv4(const std::string &str);
bool isIPv6(const std::string &str);
//Server avtive? true == yes
std::atomic<bool> serverActive;
//Client avtive? true == yes
std::atomic<bool> clientActive;
//Server thread active? true == yes
std::atomic<bool> serverListenThreadActive;
//Client thread active? true == yes
std::atomic<bool> clientThreadActive;
int poll_id = 0;
std::mutex netMtx;
Mode currentMode = Mode::unknown;
std::map<SRTSOCKET, std::shared_ptr<NetworkConnection>> clientList = {};
std::mutex clientListMtx;
std::shared_ptr<NetworkConnection> clientContext = nullptr;
};
#endif //CPPSRTWRAPPER_SRTNET_H
| 29.397906 | 117 | 0.655387 |
5d7225e3588335d298b70e909b5f3cce02d2bf24 | 2,218 | h | C | sdk-6.5.20/include/bcm_int/dnx/port/imb/imb_feu_phy.h | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/include/bcm_int/dnx/port/imb/imb_feu_phy.h | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/include/bcm_int/dnx/port/imb/imb_feu_phy.h | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null |
/*
*
*
*
* This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
*
* Copyright 2007-2020 Broadcom Inc. All rights reserved.
*
*
* DO NOT EDIT THIS FILE!
*/
#ifndef BCM_DNX_SUPPORT
#error "This file is for use by DNX family only!"
#endif /* BCM_DNX_SUPPORT */
#ifndef _IMB_FEU_PHY_H__H_
#define _IMB_FEU_PHY_H__H_
#include <soc/portmod/portmod.h>
#include <bcm/port.h>
#include <bcm/cosq.h>
#include <bcm_int/dnx/port/imb/imb_diag.h>
#include <bcm_int/dnx/cosq/ingress/cosq_ingress_port.h>
#include <soc/dnxc/dnxc_port.h>
/*initialize an IMB.*/
int imb_feu_phy_init(
int unit,
const imb_create_info_t * imb_info,
imb_specific_create_info_t * imb_specific_info);
/*De-initialize an existing IMB.*/
int imb_feu_phy_deinit(
int unit,
const imb_create_info_t * imb_info,
imb_specific_create_info_t * imb_specific_info);
/*Add new IMB (Interface Management Block) port*/
int imb_feu_phy_port_attach(
int unit,
bcm_port_t port,
uint32 flags);
/*Remove an existing IMB (Interface Management Block) port*/
int imb_feu_phy_port_detach(
int unit,
bcm_port_t port);
/*Enable / disable a port*/
int imb_feu_phy_port_enable_set(
int unit,
bcm_port_t port,
uint32 flags,
int enable);
int imb_feu_phy_port_enable_get(
int unit,
bcm_port_t port,
int *enable);
/*Get port's default resource configurations*/
int imb_feu_phy_port_resource_default_get(
int unit,
bcm_port_t port,
uint32 flags,
bcm_port_resource_t * resource);
/*Configure calendar for FlexE related ports*/
int imb_feu_phy_calendar_set(
int unit,
bcm_port_t port,
uint32 flags);
/*IMB post init after speed configuration is ready*/
int imb_feu_phy_post_init(
int unit,
int imb_id);
/*Configure alternative ports for FlexE PHY ports.*/
int imb_feu_phy_alternative_port_set(
int unit,
bcm_port_t port,
const bcm_pbmp_t * alter_ports);
/*FlexE core port related configuration.*/
int imb_feu_phy_flexe_core_port_config_set(
int unit,
bcm_port_t port,
int flexe_core_port,
int speed);
#endif /*_IMB_FEU_PHY_H_*/
| 23.849462 | 134 | 0.725879 |
711cb1b0f99467cf784eb956af5b19d93b48b0a1 | 1,123 | c | C | hv/test/kvm-unit-tests/lib/powerpc/hcall.c | wtliang110/lk_hv | fbbbb280114c44bf321b8f02301a84e3c469d8a2 | [
"MIT"
] | 4 | 2022-02-24T06:16:42.000Z | 2022-02-24T23:49:29.000Z | hv/test/kvm-unit-tests/lib/powerpc/hcall.c | wtliang110/lk_hv | fbbbb280114c44bf321b8f02301a84e3c469d8a2 | [
"MIT"
] | null | null | null | hv/test/kvm-unit-tests/lib/powerpc/hcall.c | wtliang110/lk_hv | fbbbb280114c44bf321b8f02301a84e3c469d8a2 | [
"MIT"
] | null | null | null | /*
* Hypercall helpers
*
* broken_sc1 probing/patching inspired by SLOF, see
* SLOF:lib/libhvcall/brokensc1.c
*
* Copyright (C) 2016, Red Hat Inc, Andrew Jones <drjones@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.
*/
#include <asm/hcall.h>
#include <libcflat.h>
#include "io.h"
int hcall_have_broken_sc1(void)
{
register unsigned long r3 asm("r3") = H_SET_DABR;
register unsigned long r4 asm("r4") = 0;
asm volatile("sc 1"
: "=r" (r3)
: "r" (r3), "r" (r4)
: "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
return r3 == (unsigned long)H_PRIVILEGE;
}
void putchar(int c)
{
unsigned long vty = 0; /* 0 == default */
unsigned long nr_chars = 1;
unsigned long chars = (unsigned long)c << 56;
hcall(H_PUT_TERM_CHAR, vty, nr_chars, chars);
}
int __getchar(void)
{
register unsigned long r3 asm("r3") = H_GET_TERM_CHAR;
register unsigned long r4 asm("r4") = 0; /* 0 == default vty */
register unsigned long r5 asm("r5");
asm volatile (" sc 1 " : "+r"(r3), "+r"(r4), "=r"(r5)
: "r"(r3), "r"(r4));
return r3 == H_SUCCESS && r4 > 0 ? r5 >> 48 : -1;
}
| 23.395833 | 69 | 0.62244 |
5e827fc77d37523fb72c7ef12d9a054ef487faf8 | 447 | h | C | include/network/packetsend.h | benmandrew/c-networking | 19cc83050b83ed2eeada5437022779c2c0d06e46 | [
"MIT"
] | 1 | 2021-12-08T22:48:45.000Z | 2021-12-08T22:48:45.000Z | include/network/packetsend.h | benmandrew/c-networking | 19cc83050b83ed2eeada5437022779c2c0d06e46 | [
"MIT"
] | null | null | null | include/network/packetsend.h | benmandrew/c-networking | 19cc83050b83ed2eeada5437022779c2c0d06e46 | [
"MIT"
] | null | null | null |
#ifndef PACKETSEND_H
#define PACKETSEND_H
#include <arpa/inet.h>
#include <net/route.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "process/core_node.h"
#include "process/fileio.h"
#include "process/logging.h"
int get_open_socket(int port);
int get_socket(void);
int receive(int sockfd, void *buffer, size_t n, struct sockaddr *from);
char *ip_to_str(long ip);
struct rtentry *get_routes(LocalNode *this);
#endif
| 17.192308 | 71 | 0.742729 |
4afa2a74cf3d7cb85238e15a092cc3bd94c783df | 2,182 | h | C | TOF/TOFbase/AliTOFTDCHit.h | AllaMaevskaya/AliRoot | c53712645bf1c7d5f565b0d3228e3a6b9b09011a | [
"BSD-3-Clause"
] | 52 | 2016-12-11T13:04:01.000Z | 2022-03-11T11:49:35.000Z | TOF/TOFbase/AliTOFTDCHit.h | AllaMaevskaya/AliRoot | c53712645bf1c7d5f565b0d3228e3a6b9b09011a | [
"BSD-3-Clause"
] | 1,388 | 2016-11-01T10:27:36.000Z | 2022-03-30T15:26:09.000Z | TOF/TOFbase/AliTOFTDCHit.h | AllaMaevskaya/AliRoot | c53712645bf1c7d5f565b0d3228e3a6b9b09011a | [
"BSD-3-Clause"
] | 275 | 2016-06-21T20:24:05.000Z | 2022-03-31T13:06:19.000Z | #ifndef ALITOFTDCHIT_H
#define ALITOFTDCHIT_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/*
author: Roberto Preghenella (R+), preghenella@bo.infn.it
*/
///////////////////////////////////////////////////////////////
// //
// This class provides a definition for TDC hits. //
// //
///////////////////////////////////////////////////////////////
#include "TObject.h"
#include "AliTOFRawDataFormat.h"
class AliTOFTDCHit : public TObject
{
public:
AliTOFTDCHit(); //default constructor
AliTOFTDCHit(const AliTOFTDCHit &source); //copy contructor
AliTOFTDCHit &operator = (const AliTOFTDCHit &source); //operator =
// AliTOFTDCHit &operator - (const AliTOFTDCHit &source); //operator -
AliTOFTDCHit &operator -= (const AliTOFTDCHit &source); //operator -=
AliTOFTDCHit &operator << (const AliTOFTDCHit &source); //operator <<
virtual ~AliTOFTDCHit(); //destructor
/* getters */
UInt_t GetHitTime() const {return fHitTime;}; //get hit time
UShort_t GetTOTWidth() const {return fTOTWidth;}; //get TOT width
UShort_t GetChan() const {return fChan;}; //get channel
UShort_t GetTDCID() const {return fTDCID;}; //get TDC ID
UShort_t GetEBit() const {return fEBit;}; //get E bit
UShort_t GetPSBits() const {return fPSBits;}; //get PS bits
/* setters */
void SetHitTime(UInt_t HitTime) {fHitTime = HitTime;}; //set hit time
void SetTOTWidth(UShort_t TOTWidth) {fTOTWidth = TOTWidth;}; //set TOT width
void SetChan(UShort_t Chan) {fChan = Chan;}; //set channel
void SetTDCID(UShort_t TDCID) {fTDCID = TDCID;}; //set TDC ID
void SetEBit(UShort_t EBit) {fEBit = EBit;};
void SetPSBits(UShort_t PSBits) {fPSBits = PSBits;}; //set PS bits
private:
UInt_t fHitTime; //hit time [24.4 ps]
UShort_t fTOTWidth; //TOT width [48.8 ps]
UShort_t fChan; //channel
UShort_t fTDCID; //TDC ID
UShort_t fEBit; //E bit
UShort_t fPSBits; //PS bits
ClassDef(AliTOFTDCHit, 1);
};
#endif /* ALITOFTDCHIT_H */
| 38.964286 | 78 | 0.610907 |
393044ed566c0f29e522b2418dbae99bdfc0984c | 278 | h | C | Example/FGPhotoBrowser/FGAppDelegate.h | wangfaguo/FGPhotoBrowser | b1de78765ae55cb13f5180c5cf746453df4ec4b7 | [
"MIT"
] | null | null | null | Example/FGPhotoBrowser/FGAppDelegate.h | wangfaguo/FGPhotoBrowser | b1de78765ae55cb13f5180c5cf746453df4ec4b7 | [
"MIT"
] | null | null | null | Example/FGPhotoBrowser/FGAppDelegate.h | wangfaguo/FGPhotoBrowser | b1de78765ae55cb13f5180c5cf746453df4ec4b7 | [
"MIT"
] | null | null | null | //
// FGAppDelegate.h
// FGPhotoBrowser
//
// Created by wangfaguo on 06/03/2016.
// Copyright (c) 2016 wangfaguo. All rights reserved.
//
@import UIKit;
@interface FGAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| 17.375 | 62 | 0.723022 |
2217fdd05728acf5d3a4b6854771b222c596d43f | 104 | h | C | 3. Cooperative Autonomy/Programa/Configuration.h | diegoalejogm/Mobile-Robotics-Projects | 9b3535766ab785021c693627d3b61d3fb064e1e3 | [
"MIT"
] | 2 | 2019-01-28T16:12:52.000Z | 2019-04-18T03:04:58.000Z | 3. Cooperative Autonomy/Programa/Configuration.h | diegoalejogm/RoboticsProject | 9b3535766ab785021c693627d3b61d3fb064e1e3 | [
"MIT"
] | null | null | null | 3. Cooperative Autonomy/Programa/Configuration.h | diegoalejogm/RoboticsProject | 9b3535766ab785021c693627d3b61d3fb064e1e3 | [
"MIT"
] | 1 | 2018-05-20T15:51:13.000Z | 2018-05-20T15:51:13.000Z | #pragma once
#include"IntegerPoint2D.h"
struct Configuration {
IntegerPoint2D position;
int angle;
}; | 14.857143 | 26 | 0.778846 |
585766b854c8a7716fdd1b9fe5c6e12a83cc8d96 | 228 | c | C | template 01/main.c | sandeepyadav1478/C-Cplus-lab-2015 | 00239570f3e9ad95557b250f60255176bd616ee0 | [
"BSD-3-Clause"
] | null | null | null | template 01/main.c | sandeepyadav1478/C-Cplus-lab-2015 | 00239570f3e9ad95557b250f60255176bd616ee0 | [
"BSD-3-Clause"
] | null | null | null | template 01/main.c | sandeepyadav1478/C-Cplus-lab-2015 | 00239570f3e9ad95557b250f60255176bd616ee0 | [
"BSD-3-Clause"
] | null | null | null | #include<iostream.h>
using namespacestd;
template <classtype1,classtype2>
void myfunc(type1 x,type2 y)
{
cout<<x<<''<<y<<'\n';
}
int main()
{
myfunc(10,"I Like C++");
myfunc(98.6,19L);
return 0;
}
| 15.2 | 33 | 0.570175 |
c9e59cee5c563d8a4fea78361c58f021b50fb527 | 147 | h | C | kernel/include/string.h | nurh/treehouse | 4b3304213f78c1e8d8eda577bba623f5c44361f4 | [
"MIT"
] | null | null | null | kernel/include/string.h | nurh/treehouse | 4b3304213f78c1e8d8eda577bba623f5c44361f4 | [
"MIT"
] | null | null | null | kernel/include/string.h | nurh/treehouse | 4b3304213f78c1e8d8eda577bba623f5c44361f4 | [
"MIT"
] | null | null | null | void *memset(void *s, int c, size_t n);
void *memcpy(void *dest, const void *src, size_t n);
void *memmove(void *dest, const void *src, size_t n);
| 36.75 | 53 | 0.687075 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.