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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bf6ecaf802a2e89b001a28645b0e61b0cb413bb2 | 7,611 | c | C | base/ntsetup/opktools/setupmgr/base/targpath.c | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/ntsetup/opktools/setupmgr/base/targpath.c | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/ntsetup/opktools/setupmgr/base/targpath.c | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | //----------------------------------------------------------------------------
//
// Copyright (c) 1997-1999 Microsoft Corporation
// All rights reserved.
//
// File Name:
// targpath.c
//
// Description:
// This file contains the dialog procedure for the TargetPath page.
//
//----------------------------------------------------------------------------
#include "pch.h"
#include "resource.h"
//---------------------------------------------------------------------------
//
// Function: GreyUnGreyTargPath
//
// Purpose: Called whenever a radio button selection might have changed
// to properly grey out the edit field.
//
//---------------------------------------------------------------------------
VOID GreyUnGreyTargPath(HWND hwnd)
{
BOOL bUnGrey = IsDlgButtonChecked(hwnd, IDC_SPECIFYPATH);
EnableWindow(GetDlgItem(hwnd, IDT_TARGETPATH), bUnGrey);
}
//---------------------------------------------------------------------------
//
// Function: OnSetActiveTargPath
//
// Purpose: Called when SETACTIVE comes.
//
//---------------------------------------------------------------------------
VOID OnSetActiveTargPath(HWND hwnd)
{
int nButtonId = IDC_NOTARGETPATH;
switch ( GenSettings.iTargetPath ) {
case TARGPATH_UNDEFINED:
case TARGPATH_WINNT:
nButtonId = IDC_NOTARGETPATH;
break;
case TARGPATH_AUTO:
nButtonId = IDC_GENERATEPATH;
break;
case TARGPATH_SPECIFY:
nButtonId = IDC_SPECIFYPATH;
break;
default:
AssertMsg(FALSE, "Bad targpath");
break;
}
CheckRadioButton(hwnd, IDC_NOTARGETPATH, IDC_SPECIFYPATH, nButtonId);
SetDlgItemText(hwnd, IDT_TARGETPATH, GenSettings.TargetPath);
GreyUnGreyTargPath(hwnd);
WIZ_BUTTONS(hwnd, PSWIZB_BACK | PSWIZB_NEXT);
}
//----------------------------------------------------------------------------
//
// Function: OnRadioButtonTargPath
//
// Purpose: Called when a radio button is pushed.
//
//----------------------------------------------------------------------------
VOID OnRadioButtonTargPath(HWND hwnd, int nButtonId)
{
CheckRadioButton(hwnd, IDC_NOTARGETPATH, IDC_SPECIFYPATH, nButtonId);
GreyUnGreyTargPath(hwnd);
}
//---------------------------------------------------------------------------
//
// Function: ValidateTargPath
//
// Purpose: Validates whether the pathname passed in is valid or not.
//
//---------------------------------------------------------------------------
BOOL ValidateTargPath(HWND hwnd)
{
//
// If user selected IDC_SPECIFYPATH, validate the pathname entered
//
if ( GenSettings.iTargetPath == TARGPATH_SPECIFY ) {
//
// Give a specific error message for the empty case
//
if ( GenSettings.TargetPath[0] == _T('\0') ) {
ReportErrorId(hwnd, MSGTYPE_ERR, IDS_ERR_SPECIFY_TARGPATH);
SetFocus(GetDlgItem(hwnd, IDT_TARGETPATH));
return FALSE;
}
//
// Give user a specific error message if he entered a drive letter.
// One must use /tempdrive: to specify the target drive.
//
if ( towupper(GenSettings.TargetPath[0]) >= _T('A') &&
towupper(GenSettings.TargetPath[0]) <= _T('Z') &&
GenSettings.TargetPath[1] == _T(':') ) {
ReportErrorId(hwnd, MSGTYPE_ERR, IDS_ERR_DRIVE_IN_TARGPATH);
SetFocus(GetDlgItem(hwnd, IDT_TARGETPATH));
return FALSE;
}
//
// See if it is a valid 8.3 path name with no drive letter.
//
if ( ! IsValidPathNameNoRoot8_3(GenSettings.TargetPath) ) {
ReportErrorId(hwnd, MSGTYPE_ERR, IDS_ERR_INVALID_TARGPATH);
SetFocus(GetDlgItem(hwnd, IDT_TARGETPATH));
return FALSE;
}
}
return TRUE;
}
//---------------------------------------------------------------------------
//
// Function: OnWizNextTargPath
//
// Purpose: Called when NEXT button is pushed. Retrieve and save
// settings.
//
//---------------------------------------------------------------------------
BOOL OnWizNextTargPath(HWND hwnd)
{
//
// Retrieve the selection
//
if ( IsDlgButtonChecked(hwnd, IDC_NOTARGETPATH) )
GenSettings.iTargetPath = TARGPATH_WINNT;
else if ( IsDlgButtonChecked(hwnd, IDC_GENERATEPATH) )
GenSettings.iTargetPath = TARGPATH_AUTO;
else
GenSettings.iTargetPath = TARGPATH_SPECIFY;
//
// Retrieve any pathname typed in.
//
GetDlgItemText(hwnd,
IDT_TARGETPATH,
GenSettings.TargetPath,
MAX_TARGPATH + 1);
//
// Validate values on this page.
//
if ( ValidateTargPath(hwnd) )
return TRUE;
else
return FALSE;
}
//---------------------------------------------------------------------------
//
// Function: DlgTargetPathPage
//
// Purpose: This is the dlg proc for the target path page
//
//---------------------------------------------------------------------------
INT_PTR CALLBACK DlgTargetPathPage(
IN HWND hwnd,
IN UINT uMsg,
IN WPARAM wParam,
IN LPARAM lParam)
{
BOOL bStatus = TRUE;
switch (uMsg) {
case WM_INITDIALOG:
SendDlgItemMessage(hwnd,
IDT_TARGETPATH,
EM_LIMITTEXT,
(WPARAM) MAX_TARGPATH,
(LPARAM) 0);
break;
case WM_COMMAND:
{
UINT nButtonId;
switch ( nButtonId = LOWORD(wParam) ) {
case IDC_NOTARGETPATH:
case IDC_GENERATEPATH:
case IDC_SPECIFYPATH:
if ( HIWORD(wParam) == BN_CLICKED )
OnRadioButtonTargPath(hwnd, LOWORD(wParam));
break;
default:
bStatus = FALSE;
break;
}
}
break;
case WM_NOTIFY:
{
LPNMHDR pnmh = (LPNMHDR)lParam;
switch( pnmh->code ) {
case PSN_QUERYCANCEL:
WIZ_CANCEL(hwnd);
break;
case PSN_SETACTIVE:
g_App.dwCurrentHelp = IDH_INST_FLDR;
OnSetActiveTargPath(hwnd);
break;
case PSN_WIZBACK:
bStatus = FALSE;
break;
case PSN_WIZNEXT:
if ( !OnWizNextTargPath(hwnd) )
WIZ_FAIL(hwnd);
else
bStatus = FALSE;
break;
case PSN_HELP:
WIZ_HELP();
break;
default:
bStatus = FALSE;
break;
}
}
break;
default:
bStatus = FALSE;
break;
}
return bStatus;
}
| 27.576087 | 79 | 0.432663 |
c982b477c3e4019cc795985fe4ad2f96aa19eda9 | 2,071 | h | C | Source/TraceMemo.h | neville1/cpp-namelint | cf584e4c71a59d1cde9b33e12378a59702104a9e | [
"MIT"
] | null | null | null | Source/TraceMemo.h | neville1/cpp-namelint | cf584e4c71a59d1cde9b33e12378a59702104a9e | [
"MIT"
] | null | null | null | Source/TraceMemo.h | neville1/cpp-namelint | cf584e4c71a59d1cde9b33e12378a59702104a9e | [
"MIT"
] | null | null | null | #ifndef __NAMELINT_TRACE_MEMO__H__
#define __NAMELINT_TRACE_MEMO__H__
#include "Config.h"
#include <map>
#include <string>
#include <vector>
using namespace std;
namespace namelint {
class CodePos {
public:
size_t nLine;
size_t nColumn;
};
typedef enum _CheckType {
CT_None = 0,
CT_File,
CT_Function,
CT_Parameter,
CT_Variable,
CT_Max
} CheckType;
class ErrorDetail {
public:
bool bIsPtr;
bool bIsArray;
CodePos Pos;
CheckType Type;
string TargetName;
string TypeName;
string Suggestion;
ErrorDetail(const string &FileName, const string &Suggestion) {
this->Type = CT_File;
this->TargetName = FileName;
this->Suggestion = Suggestion;
}
ErrorDetail(const CodePos &Pos, const CheckType &Type, const bool &bIsPtr,
const bool &bIsArray, const string &TypeName,
const string &Suggestion) {
this->bIsPtr = bIsPtr;
this->bIsArray = bIsArray;
this->Pos = Pos;
this->Type = Type;
this->TargetName = TypeName;
this->Suggestion = Suggestion;
}
ErrorDetail(const CodePos &Pos, const CheckType &Type, const bool &bIsPtr,
const bool &bIsArray, const string &TypeName,
const string &TargetName, const string &Suggestion) {
this->bIsPtr = bIsPtr;
this->bIsArray = bIsArray;
this->Pos = Pos;
this->Type = Type;
this->TypeName = TypeName;
this->TargetName = TargetName;
this->Suggestion = Suggestion;
}
};
class TraceMemo {
public:
struct _Option {
bool bEnableLog;
} Option;
struct _File {
string Source;
string Config;
} File;
struct _Dir {
vector<string> Includes;
} Dir;
struct _Checked {
size_t nFile;
size_t nFunction;
size_t nParameter;
size_t nVariable;
} Checked;
struct _Error {
size_t nFile;
size_t nFunction;
size_t nParameter;
size_t nVariable;
} Error;
vector<ErrorDetail *> ErrorDetailList;
};
} // namespace namelint
#endif | 20.303922 | 77 | 0.634476 |
f966ac55d4e8aacf1ab9c2d87d4d2fefb2ccb3bf | 1,933 | h | C | apps/utils/image_io.h | zhoub/oidn | 483a2d96cc3c05ae36c291847a8205658facbb8f | [
"Apache-2.0"
] | 1,206 | 2019-01-29T04:58:53.000Z | 2022-03-27T07:13:01.000Z | apps/utils/image_io.h | zhoub/oidn | 483a2d96cc3c05ae36c291847a8205658facbb8f | [
"Apache-2.0"
] | 129 | 2019-01-29T20:37:27.000Z | 2022-03-25T13:36:50.000Z | apps/utils/image_io.h | zhoub/oidn | 483a2d96cc3c05ae36c291847a8205658facbb8f | [
"Apache-2.0"
] | 123 | 2019-01-29T14:24:34.000Z | 2022-03-28T06:54:57.000Z | // Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <memory>
#include <string>
#include <vector>
#include <array>
#include <tuple>
namespace oidn {
struct ImageBuffer
{
std::vector<float> buffer;
int width;
int height;
int numChannels;
ImageBuffer()
: width(0),
height(0),
numChannels(0) {}
ImageBuffer(int width, int height, int numChannels)
: buffer(size_t(width) * height * numChannels),
width(width),
height(height),
numChannels(numChannels) {}
operator bool() const
{
return data() != nullptr;
}
const float& operator [](size_t i) const { return buffer[i]; }
float& operator [](size_t i) { return buffer[i]; }
const float* data() const { return buffer.data(); }
float* data() { return buffer.data(); }
size_t size() const { return buffer.size(); }
std::array<int, 3> dims() const { return {width, height, numChannels}; }
};
// Loads an image with an optionally specified number of channels (loads all
// channels by default)
std::shared_ptr<ImageBuffer> loadImage(const std::string& filename, int numChannels = 0);
// Loads an image with/without sRGB to linear conversion
std::shared_ptr<ImageBuffer> loadImage(const std::string& filename, int numChannels, bool srgb);
// Saves an image
void saveImage(const std::string& filename, const ImageBuffer& image);
// Saves an image with/without linear to sRGB conversion
void saveImage(const std::string& filename, const ImageBuffer& image, bool srgb);
// Compares an image to a reference image and returns the number of errors
// and the maximum error value
std::tuple<size_t, float> compareImage(const ImageBuffer& image,
const ImageBuffer& ref,
float threshold);
} // namespace oidn
| 28.850746 | 98 | 0.646146 |
ba259d89f7e029b95272ac22299d26532f774dec | 14,349 | c | C | yla_array.c | xiiilamorte/-lipo-sapr-lab | a69a8f0e4634985d2df2dd1fd39017d99791ac0f | [
"MIT"
] | null | null | null | yla_array.c | xiiilamorte/-lipo-sapr-lab | a69a8f0e4634985d2df2dd1fd39017d99791ac0f | [
"MIT"
] | null | null | null | yla_array.c | xiiilamorte/-lipo-sapr-lab | a69a8f0e4634985d2df2dd1fd39017d99791ac0f | [
"MIT"
] | null | null | null | /*
Array operations: concatenation, insert to left, insert to right.
*/
#include "yla_array.h"
/* Subprogram: array_concatenation
(my global alias of the subprogram in comments: concat)
This program needs 2 global variables for keep iterator of 'while' cycle.
Reductions: CX -- counter,
DX -- second array count
*/
void put_array_concatenation(yla_int_type **prog_ptr, yla_int_type subprog_start_addr, compliance_table *compliance, yla_int_type *prog_counter, yla_int_type global_var[])
{
yla_int_type prog_count = *prog_counter;
yla_int_type cx = global_var[0];
yla_int_type dx = global_var[1];
yla_int_type second_array_count = 0x0025;
yla_int_type arrays_count = 0x0026;
yla_int_type ret = 0x0027;
compliance_table_set_addr(compliance, subprog_start_addr, prog_count);
// Local vars section
// var ret = stack->ptr[top]
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, ret); prog_count += 2;
// var second_array_count = stack->ptr[top]
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, second_array_count); prog_count += 2;
// var count = { CGDUP second_array_count + second_array_count }
put_commd(prog_ptr, CGDUP); prog_count++;
put_value(prog_ptr, second_array_count); prog_count += 2;
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, second_array_count); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, arrays_count); prog_count += 2;
// var cx = second_array_count
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, second_array_count); prog_count += 2;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
// var dx = 0
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, dx); prog_count += 2;
compliance_table_set_addr(compliance, 0x0290, prog_count); /*concat_while_start(290)*/
// Begin program
// while (cx != dx)
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, dx); prog_count += 2;
put_commd(prog_ptr, CCMP); prog_count++;
// If they are equal -- end subprogram (NOT CONFUSE WITH "RET"!)
put_commd(prog_ptr, CJNZ); prog_count++;
put_value(prog_ptr, 0x0299); prog_count += 2; /*concat_end(299)*/
// Else { for while cycle
// Clean comparation result
put_commd(prog_ptr, CSTK); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
// cx-- temporarily
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CSUB); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
// CGDUP cx
put_commd(prog_ptr, CGDUP); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
// cx++ temporarily
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
// CGDEEP cx
put_commd(prog_ptr, CGDEEP); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
// cx-- permanently
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CSUB); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, cx); prog_count += 2;
// } for while cycle
put_commd(prog_ptr, CJMP); prog_count++;
put_value(prog_ptr, 0x0290); prog_count += 2; /*concat_while_start(290)*/
compliance_table_set_addr(compliance, 0x0299, prog_count); /*concat_end(299)*/
// End subprogram
/* Load arrays count and push him in stack.
Deep is needed because of subprogram
keep copy of last array value
in top of stack. */
// Clean comparation result
put_commd(prog_ptr, CSTK); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, arrays_count); prog_count += 2;
put_commd(prog_ptr, CDEEP); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
/* Ret subprogram */
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, ret); prog_count += 2;
put_commd(prog_ptr, CRET); prog_count++;
*prog_counter = prog_count;
}
/* Subprogram: array_insert_left
(my alias for main function: insert_left)
The subprogram inserts value on begin of stack
by fully reorganizing array structure
after insert on begin of stack.
*/
void put_array_insert_left(yla_int_type **prog_ptr, yla_int_type subprog_start_addr, compliance_table *compliance, yla_int_type *prog_counter, yla_int_type global_var[])
{
yla_int_type prog_count = *prog_counter;
yla_int_type ret = 0x0027;
yla_int_type array_count = 0x0028;
yla_int_type iterator = 0x0029;
yla_int_type extra_values = 0x002a;
yla_int_type tmp = 0x002b;
yla_int_type value = 0x002c;
compliance_table_set_addr(compliance, subprog_start_addr, prog_count);
// Local vars section
// var ret = stack->ptr[top]
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, ret); prog_count += 2;
// var value = stack->ptr[top]
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, value); prog_count += 2;
// var array_count = stack->ptr[top]
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
// var iterator = array_count
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
// var extra_values = 0
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
// var tmp = 0
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, tmp); prog_count += 2;
// Begin program
// if (array_count == 0)
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
put_commd(prog_ptr, CCMP); prog_count++;
// {
// If array count is equal to 0 -- then end subprogram
put_commd(prog_ptr, CJNZ); prog_count++;
put_value(prog_ptr, 0x0249); prog_count += 2; /*end(249)*/
// Clean comparation result
put_commd(prog_ptr, CSTK); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
// }
// CGDUP --iterator:
// 1. --iterator
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CSUB); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
// 2. CGDUP iterator
put_commd(prog_ptr, CGDUP); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
// Load value
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, value); prog_count += 2;
// CGDEEP ++iterator:
// 1. ++iterator
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
// 2. CGDEEP iterator
put_commd(prog_ptr, CGDEEP); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
// iterator--
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CSUB); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
/*while(241)*/
compliance_table_set_addr(compliance, 0x0241, prog_count); /*while(241)*/
// while (iterator != 0)
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
put_commd(prog_ptr, CCMP); prog_count++;
// {
// If iterator is equal to 0 -- then end while cycle
put_commd(prog_ptr, CJNZ); prog_count++;
put_value(prog_ptr, 0x0242); prog_count += 2; /*while_end(242)*/
// Clean comparation result
put_commd(prog_ptr, CSTK); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
// CGDUP iterator + extra_values:
// 1. tmp += iterator + extra_values
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, tmp); prog_count += 2;
// 2. CGDUP tmp
put_commd(prog_ptr, CGDUP); prog_count++;
put_value(prog_ptr, tmp); prog_count += 2;
// CDUP 1
put_commd(prog_ptr, CDUP); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
// CDEEP array_count
put_commd(prog_ptr, CGDEEP); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
// extra_values_array++
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
// iterator--
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CSUB); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, iterator); prog_count += 2;
// }
put_commd(prog_ptr, CJMP); prog_count++;
put_value(prog_ptr, 0x0241); prog_count += 2;
/*while_end(242)*/
compliance_table_set_addr(compliance, 0x0242, prog_count); /*while_end(242)*/
// Clean comparation result
put_commd(prog_ptr, CSTK); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
// CGDEEP extra_values--:
// 1. extra_values--
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CSUB); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
// 2. CGDEEP extra_values
put_commd(prog_ptr, CGDEEP); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
// CGSTK extra_values
put_commd(prog_ptr, CGSTK); prog_count++;
put_value(prog_ptr, extra_values); prog_count += 2;
// CLOAD array_count++:
// 1. array_count++
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
// 2. CLOAD array_count
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
/*end(249)*/
compliance_table_set_addr(compliance, 0x0249, prog_count); /*end(249)*/
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, ret); prog_count += 2;
put_commd(prog_ptr, CRET); prog_count++;
*prog_counter = prog_count;
}
/* Subprogram: array_insert_right
(my alias in main function: insert_right)
The subprogram inserts value on end of array
without full reorganization of array structure.
*/
void put_array_insert_right(yla_int_type **prog_ptr, yla_int_type subprog_start_addr, compliance_table *compliance, yla_int_type *prog_counter)
{
yla_int_type prog_count = *prog_counter;
yla_int_type ret = 0x0027;
yla_int_type array_count = 0x0028;
compliance_table_set_addr(compliance, subprog_start_addr, prog_count);
// Local vars section
// var ret = stack->ptr[top]
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, ret); prog_count += 2;
// var array_count = (CDUP 1) ++
put_commd(prog_ptr, CDUP); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CPUSH); prog_count++;
put_value(prog_ptr, 0x0001); prog_count += 2;
put_commd(prog_ptr, CADD); prog_count++;
put_commd(prog_ptr, CSAVE); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
// Begin program
// DUP previous array count
put_commd(prog_ptr, CDEEP); prog_count++;
put_value(prog_ptr, 0x0000); prog_count += 2;
// Load already incremented array count
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, array_count); prog_count += 2;
// End subprogram
put_commd(prog_ptr, CLOAD); prog_count++;
put_value(prog_ptr, ret); prog_count += 2;
put_commd(prog_ptr, CRET); prog_count++;
*prog_counter = prog_count;
} | 37.562827 | 171 | 0.683253 |
c9d75492f6477b00b122a536fde26c15100f9b2a | 545 | h | C | net/protocol_rpc.h | sharkstore/demo | 129f143158de9c7a6ee19fa2d3f4342d35b0083d | [
"Apache-2.0"
] | null | null | null | net/protocol_rpc.h | sharkstore/demo | 129f143158de9c7a6ee19fa2d3f4342d35b0083d | [
"Apache-2.0"
] | null | null | null | net/protocol_rpc.h | sharkstore/demo | 129f143158de9c7a6ee19fa2d3f4342d35b0083d | [
"Apache-2.0"
] | null | null | null | _Pragma("once");
namespace fbase {
namespace dataserver {
namespace net {
class ProtocolRPC : public Protocol {
public:
ProtocolRPC();
~ProtocolRPC();
bool Match(const std::array<uint8_t, 4>& preface) override;
void OnDataArrived(const uint8_t* buf, size_t len) override;
private:
// TODO: remove v1
static const std::array<uint8_t, 4> kMagicV1{0x23, 0x23, 0x23, 0x23};
static const std::array<uint8_t, 4> kMagicV2{0xFB, 0xFB, 0xFB, 0xFB};
};
} // namespace net
} // namespace dataserver
} // namespace fbase
| 22.708333 | 73 | 0.686239 |
444644785ed313c3858e01826e80a8ffbc62b39c | 1,034 | h | C | src/shared/message.h | outscale-fne/enet-test | 711d8603f42e233ccc22a6308ed46fa97f6571d3 | [
"BSD-3-Clause"
] | null | null | null | src/shared/message.h | outscale-fne/enet-test | 711d8603f42e233ccc22a6308ed46fa97f6571d3 | [
"BSD-3-Clause"
] | null | null | null | src/shared/message.h | outscale-fne/enet-test | 711d8603f42e233ccc22a6308ed46fa97f6571d3 | [
"BSD-3-Clause"
] | 1 | 2021-01-25T09:12:42.000Z | 2021-01-25T09:12:42.000Z | #ifndef MESSAGE_H
#define MESSAGE_H
#include "player.h"
#define MSG_TYPE_PLAYER_STATE 1
#define MSG_TYPE_PLAYER_INPUTS 2
#define MSG_TYPE_PLAYER_ASK_JOIN 3
#define MSG_TYPE_SERVER_ANSWER_TO_JOIN 4
#define MSG_TYPE_PLAYER_LEFT 5
#define MSG_TYPE_PLAYER_JOINED 6
struct player_state {
int slot;
struct player player;
};
struct ask_join {
struct player player;
};
struct player_joined {
struct player player;
};
struct join_answer {
int ok;
int slot;
};
struct player_left {
int slot;
};
struct packet{
int type;
union{
struct player_state player_state;
struct inputs inputs;
struct ask_join ask_join;
struct join_answer join_answer;
struct player_left player_left;
};
};
struct packet msg_new_ask_join(struct player* player);
struct packet msg_new_player_state(struct player* player, int slot);
struct packet msg_new_join_answer(int ok, int slot);
struct packet msg_new_left(int slot);
struct packet msg_new_player_inputs(struct inputs inputs);
#endif | 22 | 68 | 0.747582 |
67da6bc0acb465eb2d3cf15d65085e6d4dfa1b19 | 5,739 | c | C | target/hell.c | esoteric-programmer/elvm | e41004888cb2054da8821865192664918d1fb7c3 | [
"MIT"
] | null | null | null | target/hell.c | esoteric-programmer/elvm | e41004888cb2054da8821865192664918d1fb7c3 | [
"MIT"
] | null | null | null | target/hell.c | esoteric-programmer/elvm | e41004888cb2054da8821865192664918d1fb7c3 | [
"MIT"
] | null | null | null | #include <target/util.h>
#include <target/hellutil.h>
static int last_section_type = 0;
static void print_labels(LabelList* labels);
static void print_offset(HellImmediate* offset);
static void print_malbolge_command(unsigned char cmd);
static void print_hell_code(HellCodeAtom* code, HellImmediate* offset);
static void print_hell_data(HellDataAtom* data, HellImmediate* offset, LabelTree* tree);
static void print_hell_program(HellProgram* hell);
void target_hell(Module* module) {
HellProgram* hp = NULL;
make_hell_object(module, &hp);
if (!hp) {
error("oops");
}
print_hell_program(hp);
free_hell_program(&hp);
}
static void print_hell_program(HellProgram* hell) {
if (!hell) {
return;
}
last_section_type = 0;
HellBlock* it = hell->blocks;
while (it) {
if (it->code && it->data) {
error("oops");
}
if (it->code) {
print_hell_code(it->code, it->offset);
}
if (it->data) {
print_hell_data(it->data, it->offset, hell->labels);
}
it = it->next;
}
}
static void print_offset(HellImmediate* offset) {
if (offset) {
if (!offset->suffix) {
error("oops");
}
printf("@%ct",offset->praefix_1t+'0');
if (offset->suffix[0]) {
printf("%s",offset->suffix);
}else{
printf("%c",offset->praefix_1t+'0');
}
printf("\n");
}
}
static void print_labels(LabelList* labels) {
LabelList* it = labels;
while (it) {
if (it->item) {
if (it->item->label) {
printf("%s:\n",it->item->label);
}
}
it = it->next;
}
}
static void print_malbolge_command(unsigned char cmd) {
switch (cmd) {
case MALBOLGE_COMMAND_OPR:
printf("Opr");
break;
case MALBOLGE_COMMAND_ROT:
printf("Rot");
break;
case MALBOLGE_COMMAND_MOVD:
printf("MovD");
break;
case MALBOLGE_COMMAND_JMP:
printf("Jmp");
break;
case MALBOLGE_COMMAND_IN:
printf("In");
break;
case MALBOLGE_COMMAND_OUT:
printf("Out");
break;
case MALBOLGE_COMMAND_HALT:
printf("Hlt");
break;
case MALBOLGE_COMMAND_NOP:
printf("Nop");
break;
default:
error("oops");
}
}
static void print_hell_code(HellCodeAtom* code, HellImmediate* offset) {
if (!code) {
return;
}
if (last_section_type != 1) {
printf(".CODE\n");
}
last_section_type = 1;
print_offset(offset);
HellCodeAtom* it = code;
while (it) {
if (!it->command) {
error("oops");
}
print_labels(it->labels);
XlatCycle* cyc = it->command;
int is_rnop = (cyc->command == MALBOLGE_COMMAND_NOP && cyc->next != NULL)?1:0;
while (cyc->next && is_rnop) {
cyc = cyc->next;
if (cyc->command != MALBOLGE_COMMAND_NOP) {
is_rnop = 0;
}
}
if (is_rnop) {
printf(" RNop\n");
}else{
cyc = it->command;
printf(" ");
while (cyc) {
print_malbolge_command(cyc->command);
cyc = cyc->next;
if (cyc) {
printf("/");
}
}
printf("\n");
}
it = it->next;
}
printf("\n");
}
static void print_hell_data(HellDataAtom* data, HellImmediate* offset, LabelTree* tree) {
if (!data) {
return;
}
if (last_section_type != 2) {
printf(".DATA\n");
}
last_section_type = 2;
print_offset(offset);
HellDataAtom* it = data;
while (it) {
print_labels(it->labels);
if (it->value && it->reference) {
error("oops");
}else if (!it->value && !it->reference) {
printf(" ?\n");
}else if (it->value) {
if (!it->value->suffix) {
error("oops");
}
if (!it->value->suffix[0]) {
printf(" %ct%c\n",'0'+it->value->praefix_1t,'0'+it->value->praefix_1t);
}else{
printf(" %ct%s\n",'0'+it->value->praefix_1t,it->value->suffix);
}
}else if (it->reference) {
printf(" ");
LabelTree* dest = find_label(tree, it->reference->label);
if (!dest) {
error("oops");
}
if (dest->data && !dest->code) {
printf("%s",it->reference->label);
// if (it->reference->offset > 0) -- hack for 8cc
if (it->reference->offset > 0 && (unsigned int)it->reference->offset < ((unsigned int)-1)/2) {
printf(" + %u",it->reference->offset);
// else if (it->reference->offset < 0) -- hack for 8cc
}else if ((unsigned int)it->reference->offset >= ((unsigned int)-1)/2) {
printf(" - %u",-it->reference->offset);
}
printf("\n");
}else if (dest->code && !dest->data) {
// if (it->reference->offset > 0) -- hack for 8cc
if (it->reference->offset == +1) {
printf("R_%s\n",it->reference->label);
// else if (it->reference->offset < 0) -- hack for 8cc
}else if ((unsigned int)it->reference->offset >= ((unsigned int)-1)/2) {
printf("U_%s ",it->reference->label);
HellDataAtom* dest_u = it->next;
for (int i=0; i<-it->reference->offset && dest_u; i++) {
dest_u = dest_u->next;
}
if (!dest_u) {
error("oops");
}
if (dest_u->labels) {
if (dest_u->labels->item) {
if (dest_u->labels->item->label) {
printf("%s\n",dest_u->labels->item->label);
}else{
error("oops");
}
}else{
error("oops");
}
}else{
error("oops");
}
}else if (it->reference->offset == 0) {
printf("%s\n",it->reference->label);
}else{
error("oops");
}
}else{
error("oops");
}
}
it = it->next;
}
printf("\n");
}
| 25.281938 | 102 | 0.537376 |
71d8f3ba7d6ba64a0c28ce5e675c0ada28d29cfb | 2,310 | c | C | tools/testing/selftests/bpf/prog_tests/netns_cookie.c | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | tools/testing/selftests/bpf/prog_tests/netns_cookie.c | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 1 | 2021-01-27T01:29:47.000Z | 2021-01-27T01:29:47.000Z | tools/testing/selftests/bpf/prog_tests/netns_cookie.c | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | // SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
#include "netns_cookie_prog.skel.h"
#include "network_helpers.h"
#ifndef SO_NETNS_COOKIE
#define SO_NETNS_COOKIE 71
#endif
static int duration;
void test_netns_cookie(void)
{
int server_fd = -1, client_fd = -1, cgroup_fd = -1;
int err, val, ret, map, verdict;
struct netns_cookie_prog *skel;
uint64_t cookie_expected_value;
socklen_t vallen = sizeof(cookie_expected_value);
static const char send_msg[] = "message";
skel = netns_cookie_prog__open_and_load();
if (!ASSERT_OK_PTR(skel, "skel_open"))
return;
cgroup_fd = test__join_cgroup("/netns_cookie");
if (CHECK(cgroup_fd < 0, "join_cgroup", "cgroup creation failed\n"))
goto done;
skel->links.get_netns_cookie_sockops = bpf_program__attach_cgroup(
skel->progs.get_netns_cookie_sockops, cgroup_fd);
if (!ASSERT_OK_PTR(skel->links.get_netns_cookie_sockops, "prog_attach"))
goto done;
verdict = bpf_program__fd(skel->progs.get_netns_cookie_sk_msg);
map = bpf_map__fd(skel->maps.sock_map);
err = bpf_prog_attach(verdict, map, BPF_SK_MSG_VERDICT, 0);
if (!ASSERT_OK(err, "prog_attach"))
goto done;
server_fd = start_server(AF_INET6, SOCK_STREAM, "::1", 0, 0);
if (CHECK(server_fd < 0, "start_server", "errno %d\n", errno))
goto done;
client_fd = connect_to_fd(server_fd, 0);
if (CHECK(client_fd < 0, "connect_to_fd", "errno %d\n", errno))
goto done;
ret = send(client_fd, send_msg, sizeof(send_msg), 0);
if (CHECK(ret != sizeof(send_msg), "send(msg)", "ret:%d\n", ret))
goto done;
err = bpf_map_lookup_elem(bpf_map__fd(skel->maps.sockops_netns_cookies),
&client_fd, &val);
if (!ASSERT_OK(err, "map_lookup(sockops_netns_cookies)"))
goto done;
err = getsockopt(client_fd, SOL_SOCKET, SO_NETNS_COOKIE,
&cookie_expected_value, &vallen);
if (!ASSERT_OK(err, "getsockopt"))
goto done;
ASSERT_EQ(val, cookie_expected_value, "cookie_value");
err = bpf_map_lookup_elem(bpf_map__fd(skel->maps.sk_msg_netns_cookies),
&client_fd, &val);
if (!ASSERT_OK(err, "map_lookup(sk_msg_netns_cookies)"))
goto done;
ASSERT_EQ(val, cookie_expected_value, "cookie_value");
done:
if (server_fd != -1)
close(server_fd);
if (client_fd != -1)
close(client_fd);
if (cgroup_fd != -1)
close(cgroup_fd);
netns_cookie_prog__destroy(skel);
}
| 28.518519 | 73 | 0.730303 |
d5a76ffaefc35eee79b7f45a93d25faefa0d2bdb | 231 | c | C | 3-2.c | eeyes-fsd/edo-train | 95cc17a929ff3e65abdf465061196e42996dda63 | [
"MIT"
] | null | null | null | 3-2.c | eeyes-fsd/edo-train | 95cc17a929ff3e65abdf465061196e42996dda63 | [
"MIT"
] | null | null | null | 3-2.c | eeyes-fsd/edo-train | 95cc17a929ff3e65abdf465061196e42996dda63 | [
"MIT"
] | null | null | null | #include <stdio.h>
int main()
{
int num = 10;
printf("num 的地址在 %p\n", &num);
printf("请输入任意整数:");
scanf("%d", &num);
printf("num 的值是 %d\n", num);
printf("num 的地址在 %p\n", &num);
return 0;
} | 16.5 | 35 | 0.47619 |
cb6a48a0724393fee1cf1c3a43ec359315b3bab2 | 101 | c | C | 174.c | hdubey/295-C-Questions | b9086e57c55d0347d0992ee5aa8bae7c61250820 | [
"Unlicense"
] | 1 | 2020-11-10T15:45:45.000Z | 2020-11-10T15:45:45.000Z | 174.c | hdubey/295-C-Questions | b9086e57c55d0347d0992ee5aa8bae7c61250820 | [
"Unlicense"
] | null | null | null | 174.c | hdubey/295-C-Questions | b9086e57c55d0347d0992ee5aa8bae7c61250820 | [
"Unlicense"
] | null | null | null | #include<stdio.h>
main()
{
int a=10,*j;
void *k;
j=&a;
k=&a;
printf("\n%d %d",*j,*k);
} | 11.222222 | 26 | 0.435644 |
02f02c4a6d21b17c92e200acd005e2efa4ed645a | 147 | h | C | project490/src/component410/headers/component410/lib9.h | gradle/perf-native-large | af00fd258fbe9c7d274f386e46847fe12062cc71 | [
"Apache-2.0"
] | 2 | 2016-11-23T17:25:24.000Z | 2016-11-23T17:25:27.000Z | project490/src/component410/headers/component410/lib9.h | gradle/perf-native-large | af00fd258fbe9c7d274f386e46847fe12062cc71 | [
"Apache-2.0"
] | 15 | 2016-09-15T03:19:32.000Z | 2016-09-17T09:15:32.000Z | project490/src/component410/headers/component410/lib9.h | gradle/perf-native-large | af00fd258fbe9c7d274f386e46847fe12062cc71 | [
"Apache-2.0"
] | 2 | 2019-11-09T16:26:55.000Z | 2021-01-13T10:51:09.000Z | #ifndef PROJECT_HEADER_component410_9_H
#define PROJECT_HEADER_component410_9_H
int component410_9();
#endif // PROJECT_HEADER_component410_9_H | 18.375 | 41 | 0.863946 |
27e9eb54b12c2589d71480ead4b411479a11d13a | 343 | h | C | Engine/Code/math_types.h | BarcinoLechiguino/Advanced_Graphics_Programming | cd9e1b55cd2049f87997607845b8f20f6376e78f | [
"MIT"
] | null | null | null | Engine/Code/math_types.h | BarcinoLechiguino/Advanced_Graphics_Programming | cd9e1b55cd2049f87997607845b8f20f6376e78f | [
"MIT"
] | null | null | null | Engine/Code/math_types.h | BarcinoLechiguino/Advanced_Graphics_Programming | cd9e1b55cd2049f87997607845b8f20f6376e78f | [
"MIT"
] | null | null | null | #ifndef __MATH_TYPES_H__
#define __MATH_TYPES_H__
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/gtc/type_ptr.hpp>
typedef glm::vec2 vec2;
typedef glm::vec3 vec3;
typedef glm::vec4 vec4;
typedef glm::ivec2 ivec2;
typedef glm::ivec3 ivec3;
typedef glm::ivec4 ivec4;
typedef glm::mat4 mat4;
#endif // !__MATH_TYPES_H__ | 20.176471 | 32 | 0.763848 |
7e7fc4c6cc243cfcb64da44b745191359231cf21 | 1,367 | h | C | Notes.framework/ICSelectorDelayer.h | reels-research/iOS-Private-Frameworks | 9a4f4534939310a51fdbf5a439dd22487efb0f01 | [
"MIT"
] | 4 | 2021-10-06T12:15:26.000Z | 2022-02-21T02:26:00.000Z | Notes.framework/ICSelectorDelayer.h | reels-research/iOS-Private-Frameworks | 9a4f4534939310a51fdbf5a439dd22487efb0f01 | [
"MIT"
] | null | null | null | Notes.framework/ICSelectorDelayer.h | reels-research/iOS-Private-Frameworks | 9a4f4534939310a51fdbf5a439dd22487efb0f01 | [
"MIT"
] | 1 | 2021-10-08T07:40:53.000Z | 2021-10-08T07:40:53.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/Notes.framework/Notes
*/
@interface ICSelectorDelayer : NSObject {
double _delay;
bool _forceMainThread;
SEL _selector;
id _target;
NSTimer * _timer;
bool _waitToFireUntilRequestsStop;
}
@property double delay;
@property (nonatomic) bool forceMainThread;
@property (nonatomic) SEL selector;
@property (nonatomic) id target;
@property (retain) NSTimer *timer;
@property (nonatomic) bool waitToFireUntilRequestsStop;
- (void).cxx_destruct;
- (void)cancelPreviousFireRequests;
- (double)delay;
- (void)fireImmediately;
- (bool)forceMainThread;
- (id)initWithTarget:(id)arg1 selector:(SEL)arg2 delay:(double)arg3 waitToFireUntilRequestsStop:(bool)arg4;
- (id)initWithTarget:(id)arg1 selector:(SEL)arg2 delay:(double)arg3 waitToFireUntilRequestsStop:(bool)arg4 forceMainThread:(bool)arg5;
- (void)internalCancelFireRequests;
- (void)internalFireImmediately;
- (bool)internalIsScheduledToFire;
- (void)internalRequestFire;
- (bool)isScheduledToFire;
- (void)requestFire;
- (SEL)selector;
- (void)setDelay:(double)arg1;
- (void)setForceMainThread:(bool)arg1;
- (void)setSelector:(SEL)arg1;
- (void)setTarget:(id)arg1;
- (void)setTimer:(id)arg1;
- (void)setWaitToFireUntilRequestsStop:(bool)arg1;
- (id)target;
- (id)timer;
- (bool)waitToFireUntilRequestsStop;
@end
| 29.717391 | 134 | 0.762985 |
4a3ab3b19d0fe70b3c336f984bef48895ce20905 | 2,272 | c | C | src/vbr.c | nguyen-t/ntfs | 82c28bc03cfb333a43fbed828b38459b43d130c1 | [
"MIT"
] | 2 | 2020-06-26T23:24:10.000Z | 2020-06-27T07:56:28.000Z | src/vbr.c | nguyen-t/ntfs | 82c28bc03cfb333a43fbed828b38459b43d130c1 | [
"MIT"
] | null | null | null | src/vbr.c | nguyen-t/ntfs | 82c28bc03cfb333a43fbed828b38459b43d130c1 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include "vbr.h"
VBR* vbr_read(int fd, off_t offset) {
VBR* vbr;
off_t current;
// Save current file pointer
if((current = lseek(fd, 0, SEEK_CUR)) < 0) {
return NULL;
}
// Read VBR starting at offset address
if(lseek(fd, offset, SEEK_SET) < 0) {
return NULL;
}
if((vbr = malloc(sizeof(VBR))) == NULL) {
return NULL;
}
if(read(fd, vbr, sizeof(VBR)) < 0) {
free(vbr);
return NULL;
}
// Reset file pointer
if(lseek(fd, current, SEEK_SET) < 0) {
free(vbr);
return NULL;
}
if(!vbr_check(vbr)) {
free(vbr);
return NULL;
}
return vbr;
}
off_t vbr_mft_offset(VBR* vbr) {
uint16_t sector_size = vbr->bpb.bytes_per_sector;
uint8_t cluster_size = vbr->bpb.sectors_per_cluster;
uint64_t mft_cluster = vbr->ebpb.mft_cluster_number;
off_t offset = vbr->bpb.hidden_sectors;
return sector_size * (cluster_size * mft_cluster + offset);
}
int vbr_check(VBR* vbr) {
// Pointer magic
return *(uint64_t*) vbr->oem_id == *(uint64_t*) VBR_MAGIC;
}
void vbr_print(VBR* vbr) {
printf("Volume Boot Record\n");
printf("OEM ID: %.8s\n", vbr->oem_id);
printf("End of sector marker: 0x%04x\n", vbr->end_of_sector_marker);
printf("BIOS parameter block\n");
printf(" Bytes per sector: %d\n", vbr->bpb.bytes_per_sector);
printf(" Sectors per cluster: %d\n", vbr->bpb.sectors_per_cluster);
printf(" Sectors per track: %d\n", vbr->bpb.sectors_per_track);
printf(" Number of heads: %d\n", vbr->bpb.number_of_heads);
printf(" Media descriptor: 0x%02x\n", vbr->bpb.media_descriptor);
printf(" Hidden sectors: 0x%08x\n", vbr->bpb.hidden_sectors);
printf("Extended BIOS parameter block\n");
printf(" Total sectors: %ld\n", vbr->ebpb.total_sectors);
printf(" MFT cluster number: %ld\n", vbr->ebpb.mft_cluster_number);
printf(" Mirror MFT cluster number: %ld\n", vbr->ebpb.mft_mirror_cluster_number);
printf(" Volume serial number 0x%16lx\n", vbr->ebpb.volume_serial_number);
printf(" Checksum: 0x%08x\n", vbr->ebpb.checksum);
printf("\n");
}
| 31.123288 | 86 | 0.627201 |
9a06d55728a6a9a7bc04c731cdc66f23c9fe3766 | 1,234 | h | C | iOSOpenDev/frameworks/iPodUI.framework/Headers/IUArrayCellConfiguration.h | bzxy/cydia | f8c838cdbd86e49dddf15792e7aa56e2af80548d | [
"MIT"
] | 678 | 2017-11-17T08:33:19.000Z | 2022-03-26T10:40:20.000Z | iOSOpenDev/frameworks/iPodUI.framework/Headers/IUArrayCellConfiguration.h | chenfanfang/Cydia | 5efce785bfd5f1064b9c0f0e29a9cc05aa24cad0 | [
"MIT"
] | 22 | 2019-04-16T05:51:53.000Z | 2021-11-08T06:18:45.000Z | iOSOpenDev/frameworks/iPodUI.framework/Headers/IUArrayCellConfiguration.h | chenfanfang/Cydia | 5efce785bfd5f1064b9c0f0e29a9cc05aa24cad0 | [
"MIT"
] | 170 | 2018-06-10T07:59:20.000Z | 2022-03-22T16:19:33.000Z | /**
* This header is generated by class-dump-z 0.2b.
*
* Source: /System/Library/PrivateFrameworks/iPodUI.framework/iPodUI
*/
#import <iPodUI/iPodUI-Structs.h>
#import <iPodUI/IUTableCellConfiguration.h>
@interface IUArrayCellConfiguration : IUTableCellConfiguration {
unsigned _numberOfStrings; // 52 = 0x34
CGRect *_stringFrames; // 56 = 0x38
id *_strings; // 60 = 0x3c
unsigned _numberOfImages; // 64 = 0x40
CGRect *_imageFrames; // 68 = 0x44
id *_images; // 72 = 0x48
id *_selectedImages; // 76 = 0x4c
}
@property(readonly, assign) unsigned numberOfImages; // G=0x2db71; converted property
- (id)_accessibilityStringsArrayPointer; // 0x2dc35
- (id)stringForLabelAtIndex:(unsigned)index; // 0x2dc09
- (void)setLayoutSize:(CGSize)size; // 0x2db91
- (unsigned)numberOfLabels; // 0x2db81
// converted property getter: - (unsigned)numberOfImages; // 0x2db71
- (id)imageAtIndex:(unsigned)index withModifiers:(unsigned)modifiers; // 0x2db25
- (CGRect)frameForLabelAtIndex:(unsigned)index; // 0x2dac5
- (CGRect)frameForImageAtIndex:(unsigned)index; // 0x2da65
- (void)reloadLayoutInformation; // 0x2d9c1
- (void)dealloc; // 0x2d85d
- (id)initWithStringCount:(unsigned)stringCount imageCount:(unsigned)count; // 0x2d655
@end
| 37.393939 | 86 | 0.749595 |
a432a6acb692bdf3e62e4232cf13ec5cb46476e4 | 692 | h | C | C++/structural_patterns/facade/DataLibrary.h | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | 10 | 2018-10-26T20:02:43.000Z | 2022-03-21T02:00:46.000Z | C++/structural_patterns/facade/DataLibrary.h | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | null | null | null | C++/structural_patterns/facade/DataLibrary.h | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | 2 | 2021-09-27T09:09:39.000Z | 2021-11-19T18:52:40.000Z | // ˅
// ˄
#ifndef STRUCTURAL_PATTERNS_FACADE_DATALIBRARY_H_
#define STRUCTURAL_PATTERNS_FACADE_DATALIBRARY_H_
// ˅
#include <map>
#include <string>
using namespace std;
// ˄
class DataLibrary
{
// ˅
// ˄
private:
static DataLibrary* instance;
public:
static DataLibrary* getInstance();
private:
DataLibrary();
public:
~DataLibrary();
// Read a data library file.
const map<string, string> getProperties(const string& data_library_name) const;
// ˅
public:
protected:
private:
DataLibrary(const DataLibrary&) = delete;
DataLibrary& operator=(const DataLibrary&) = delete;
// ˄
};
// ˅
// ˄
#endif // STRUCTURAL_PATTERNS_FACADE_DATALIBRARY_H_
// ˅
// ˄
| 11.16129 | 80 | 0.692197 |
a4476636cf5d2c5be5a46cc796b4ef520ab2af33 | 3,789 | h | C | applications/sofa/gui/qt/SofaVideoRecorderManager.h | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | applications/sofa/gui/qt/SofaVideoRecorderManager.h | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | applications/sofa/gui/qt/SofaVideoRecorderManager.h | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | /******************************************************************************
* SOFA, Simulation Open-Framework Architecture, development version *
* (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the Free *
* Software Foundation; either version 2 of the License, or (at your option) *
* any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
* more details. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef SOFA_GUI_QT_VIDEORECORDERMANAGER_H
#define SOFA_GUI_QT_VIDEORECORDERMANAGER_H
#include <ui_VideoRecorderManager.h>
#include "SofaGUIQt.h"
#include <vector>
#include <QComboBox>
#include <QSpinBox>
#include <QLabel>
#include <QCheckBox>
namespace sofa
{
namespace gui
{
namespace qt
{
class CaptureOptionsWidget : public QWidget
{
Q_OBJECT
public:
CaptureOptionsWidget( QWidget * parent = 0);
QSpinBox* framerateSpinBox;
QCheckBox* realtimeCheckBox;
QSpinBox* frameskipSpinBox;
};
class MovieOptionsWidget : public QWidget
{
Q_OBJECT
public:
//Codec = <extension, description>
struct Codec
{
std::string extension;
std::string codec;
std::string description;
Codec(std::string e, std::string c, std::string d) : extension(e), codec(c), description(d) {}
Codec(std::string e, std::string d) : extension(e), codec(), description(d) {}
};
MovieOptionsWidget( QWidget * parent = 0);
QComboBox* codecComboBox;
QSpinBox* bitrateSpinBox;
std::vector< Codec > listCodecs;
};
class SofaVideoRecorderManager: public QDialog, public Ui_VideoRecorderManager
{
Q_OBJECT
public:
enum RecordingType { SCREENSHOTS, MOVIE };
SofaVideoRecorderManager();
static SofaVideoRecorderManager* getInstance()
{
static SofaVideoRecorderManager instance;
return &instance;
}
void updateContent();
std::string getCodecExtension();
std::string getCodecName();
unsigned int getFramerate();
unsigned int getBitrate();
bool realtime();
unsigned int getFrameskip();
RecordingType getRecordingType() { return currentRecordingType; }
//helper function
static void internalAddWidget(QWidget* parent, QWidget* widgetToAdd);
public slots:
virtual void onChangeRecordingType();
virtual void close();
protected:
RecordingType currentRecordingType;
CaptureOptionsWidget* captureOptionsWidget;
MovieOptionsWidget* movieOptionsWidget;
QWidget* screenshotsOptionsWidget;
};
}
}
}
#endif //SOFA_GUI_QT_VIDEORECORDERMANAGER_H
| 31.31405 | 102 | 0.571919 |
a49e6567dd29367b33b775ca404b00ea5fd2047a | 1,604 | h | C | WinHier/resource.h | katahiromz/WinHier | 5b2d870ba22b704c2bcb9e12d595187fe7c00dfa | [
"MIT"
] | 5 | 2019-04-22T14:22:57.000Z | 2020-02-02T11:49:28.000Z | WinHier/resource.h | katahiromz/WinHier | 5b2d870ba22b704c2bcb9e12d595187fe7c00dfa | [
"MIT"
] | 3 | 2019-06-17T01:42:29.000Z | 2019-11-21T09:17:45.000Z | WinHier/resource.h | katahiromz/WinHier | 5b2d870ba22b704c2bcb9e12d595187fe7c00dfa | [
"MIT"
] | 2 | 2019-04-22T14:22:40.000Z | 2019-05-04T00:55:38.000Z | //{{NO_DEPENDENCIES}}
// Microsoft Visual C++ Compatible
// This file was automatically generated by RisohEditor.
// WinHier_res.rc
#define IDC_STATIC -1
#define IDC_TARGET 100
#define IDD_MAIN 100
#define IDD_PROPERTIES 101
#define IDI_MAIN 100
#define IDI_NULL 101
#define IDS_SAVEAS 100
#define IDS_FILTER 101
#define IDS_CANTSAVE 102
#define IDS_TXTNAME 103
#define ID_WINDOW_CHOOSED 100
#define ID_PROP 101
#define ID_MESSAGES 102
#define ID_COPYASTEXT 103
#define ID_COPYHWND 104
#define ID_COPYTEXT 105
#define ID_COPYCLASSNAME 106
#define ID_SHOW 107
#define ID_HIDE 108
#define ID_DESTROY 109
#define ID_BLINK 110
#define ID_RESTORE 111
#define ID_BRINGTOTOP 112
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 100
#define _APS_NEXT_COMMAND_VALUE 113
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 300
#endif
#endif
| 36.454545 | 57 | 0.470698 |
2bfc4151d5b2d475e5b18b3748fca850b4b16b00 | 82 | h | C | Pod/Classes/Projection/MOBProjectionEPSG3758.h | jkdubr/Proj4 | dcdf91821720b90423e7d6774d14948d165fbb12 | [
"MIT"
] | 3 | 2015-01-29T15:53:20.000Z | 2019-03-06T03:36:56.000Z | Pod/Classes/Projection/MOBProjectionEPSG3758.h | jkdubr/Proj4 | dcdf91821720b90423e7d6774d14948d165fbb12 | [
"MIT"
] | 1 | 2016-01-12T13:53:40.000Z | 2016-01-12T13:53:40.000Z | Pod/Classes/Projection/MOBProjectionEPSG3758.h | jkdubr/Proj4 | dcdf91821720b90423e7d6774d14948d165fbb12 | [
"MIT"
] | null | null | null | #import "MOBProjection.h"
@interface MOBProjectionEPSG3758 : MOBProjection
@end
| 13.666667 | 48 | 0.804878 |
d8d9a419abda33e4e42b72389314f180dee8d0f1 | 300 | c | C | Semestre_3/IN301/TD/TD04/exo23/principal.c | uvsq-versailles/Licence_2 | 88e265f3f02f71dd1035a7d2d96645657b2f2cb5 | [
"MIT"
] | null | null | null | Semestre_3/IN301/TD/TD04/exo23/principal.c | uvsq-versailles/Licence_2 | 88e265f3f02f71dd1035a7d2d96645657b2f2cb5 | [
"MIT"
] | null | null | null | Semestre_3/IN301/TD/TD04/exo23/principal.c | uvsq-versailles/Licence_2 | 88e265f3f02f71dd1035a7d2d96645657b2f2cb5 | [
"MIT"
] | 5 | 2020-03-08T12:19:08.000Z | 2021-05-18T13:11:18.000Z | #include <stdlib.h>
#include <stdio.h>
#include "circonference.h"
#include "surface.h"
int main(){
float r;
printf("Ecrire un rayon : ");
scanf("%f",&r);
//printf("\n");
printf("Sa circonference est : %f",circonference(r));
printf("\n");
printf("Sa surface est : %f",surface(r));
exit(0);
}
| 18.75 | 54 | 0.623333 |
4df3261f1607784044f57128def0659d47f0d4f9 | 1,819 | c | C | tools/reveal.c | arachsys/pocketcrypt | 3390d57f0875e057cc76cf8374354673f819f287 | [
"MIT"
] | 5 | 2020-08-06T13:05:12.000Z | 2021-12-31T14:48:08.000Z | tools/reveal.c | arachsys/pocketcrypt | 3390d57f0875e057cc76cf8374354673f819f287 | [
"MIT"
] | 1 | 2020-08-25T11:15:20.000Z | 2020-08-25T14:27:52.000Z | tools/reveal.c | arachsys/pocketcrypt | 3390d57f0875e057cc76cf8374354673f819f287 | [
"MIT"
] | 1 | 2020-08-24T19:02:19.000Z | 2020-08-24T19:02:19.000Z | #include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "duplex.h"
#include "swirl.h"
#include "util.h"
static void process(duplex_t state) {
size_t count, length = 0;
uint8_t *data = NULL;
do {
if ((data = realloc(data, length + chunk)) == NULL)
err(EXIT_FAILURE, "realloc");
length += count = get(in, data + length, chunk);
} while (count == chunk);
if (length < duplex_rate)
errx(EXIT_FAILURE, "Input is truncated");
length = length - duplex_rate;
duplex_decrypt(state, data, length);
duplex_pad(state);
duplex_decrypt(state, data + length, duplex_rate);
if (duplex_compare(data + length, 0, duplex_rate))
errx(EXIT_FAILURE, "Authentication failed");
put(out, data, length);
free(data);
}
int main(int argc, char **argv) {
size_t size = argc >= 2 ? strtoul(argv[1], NULL, 10) : 64;
size_t rounds = argc >= 3 ? strtoul(argv[2], NULL, 10) : 2;
if (argc <= 3 && size > 0 && rounds > 0) {
duplex_t seed, state = { 0 };
uint8_t salt[duplex_rate];
void *buffer, *password;
if ((password = getpass("Password: ")) == NULL)
errx(EXIT_FAILURE, "Failed to read password");
if (get(in, salt, duplex_rate) != duplex_rate)
errx(EXIT_FAILURE, "Input is truncated");
duplex_absorb(state, salt, duplex_rate);
duplex_copy(seed, state, sizeof(state));
duplex_absorb(state, password, strlen(password));
duplex_pad(state);
if ((buffer = malloc(size << 20)) == NULL)
err(EXIT_FAILURE, "malloc");
duplex_swirl(state, seed, buffer, size << 20, rounds);
free(buffer);
process(state);
return EXIT_SUCCESS;
}
fprintf(stderr, "Usage: %s [SIZE [ROUNDS]]\n", argv[0]);
fprintf(stderr, "By default, SIZE is 64 (MB) and ROUNDS is 2.\n");
return 64;
}
| 26.75 | 68 | 0.636064 |
9ef1a7c39086d352614b10d7e12bfd75cb34c8c4 | 3,315 | h | C | EventDisplay/src/dict_classes/EventDisplayGeoVolumeBox.h | michaelmackenzie/Offline | 57bcd11d499af77ed0619deeddace51ed2b0b097 | [
"Apache-2.0"
] | null | null | null | EventDisplay/src/dict_classes/EventDisplayGeoVolumeBox.h | michaelmackenzie/Offline | 57bcd11d499af77ed0619deeddace51ed2b0b097 | [
"Apache-2.0"
] | 26 | 2019-11-08T09:56:55.000Z | 2020-09-09T17:25:33.000Z | EventDisplay/src/dict_classes/EventDisplayGeoVolumeBox.h | ryuwd/Offline | 92957f111425910274df61dbcbd2bad76885f993 | [
"Apache-2.0"
] | null | null | null | //
// Class which displays GeoVolumes with a box (used e.g. by the Cube class). It is inherited from ROOT's TGeoVolume and the ComponentInfo class which stores specific information for this support structure. The class' constructure creates a TGeoBox, which is put into the TGeoVolume. The context menu is overwritten with a menu item allowing the user to display information for this vane.
//
//
// Original author Ralf Ehrlich
//
#ifndef EventDisplay_src_dict_classes_EventDisplayGeoVolumeBox_h
#define EventDisplay_src_dict_classes_EventDisplayGeoVolumeBox_h
#include <TGeoBBox.h>
#include <TGeoVolume.h>
#include <TGeoManager.h>
#include "Offline/EventDisplay/src/EventDisplayFrame.h"
#include "Offline/EventDisplay/src/dict_classes/ComponentInfoContainer.h"
#include "Offline/EventDisplay/src/dict_classes/HistDraw.h"
#include <TClass.h>
#include <TList.h>
#include <TClassMenuItem.h>
namespace mu2e_eventdisplay
{
class EventDisplayGeoVolumeBox : public TGeoVolume, public ComponentInfoContainer
{
EventDisplayFrame *_mainframe;
EventDisplayGeoVolumeBox();
EventDisplayGeoVolumeBox(const EventDisplayGeoVolumeBox &);
EventDisplayGeoVolumeBox& operator=(const EventDisplayGeoVolumeBox &);
public:
#ifndef __CINT__
EventDisplayGeoVolumeBox(double dx, double dy, double dz, EventDisplayFrame *mainframe, const boost::shared_ptr<ComponentInfo> info):TGeoVolume(),ComponentInfoContainer(info),_mainframe(mainframe)
{
//bare pointer needed since ROOT manages this object
TGeoBBox *box=new TGeoBBox(nullptr, dx, dy, dz);
SetShape(box);
SetNumber(GetGeoManager()->AddVolume(this)); //this is what happens in the base TGeoVolume constructor
}
#endif
virtual ~EventDisplayGeoVolumeBox()
{
}
virtual const char* ClassName() const
{
TList *l=IsA()->GetMenuList();
l->Clear();
TObject *obj = dynamic_cast<TObject*>(_mainframe);
TClassMenuItem *m = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,IsA(),"Information","showInfo",obj,"TObject*",1); //TClassMenuItem accepts only bare pointers. m needs to be bare pointer because it is managed by ROOT.
l->AddFirst(m);
const std::vector<boost::shared_ptr<TObject> > &histVector = getComponentInfo()->getHistVector();
unsigned int n = _mainframe->getHistDrawVector().size();
for(unsigned int i=n; i<histVector.size(); i++) _mainframe->addHistDraw(); //add more HistDraws if there are more histograms in ComponentInfo
const std::vector<boost::shared_ptr<HistDraw> > histDrawVector = _mainframe->getHistDrawVector();
std::vector<boost::shared_ptr<TObject> >::const_iterator iter=histVector.begin();
std::vector<boost::shared_ptr<HistDraw> >::const_iterator iter2=histDrawVector.begin();
for(; iter!=histVector.end() && iter2!=histDrawVector.end(); iter++, iter2++)
{
m = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,IsA(),(*iter)->GetTitle(),"showHistogram",dynamic_cast<TObject*>(iter2->get()),"TObject*",1); //TClassMenuItem accepts only bare pointers. m needs to be bare pointer because it is managed by ROOT.
l->Add(m);
}
IsA()->SetName(getComponentInfo()->getName()->c_str());
return(IsA()->GetName());
}
ClassDef(EventDisplayGeoVolumeBox,0);
};
}
#endif /* EventDisplay_src_dict_classes_EventDisplayGeoVolumeBox_h */
| 42.5 | 387 | 0.755053 |
7f732fdbffb3d3e8c1bd85591445a1bc44a1e12e | 6,159 | c | C | components/connectivity/Modbus/3rdparty/freemodbus-v1.6/demo/ATSAM3S/demo.c | QingChuanWS/tencentos-tiny-with-tflitemicro-and-iot | e036d344b4729e70877f55026bb11841991f6650 | [
"Apache-2.0"
] | 4 | 2021-02-01T07:14:21.000Z | 2021-04-08T08:24:25.000Z | third_party/freemodbus-v1.6/demo/ATSAM3S/demo.c | xiong1979/edf | 481ca105d78749ed4bf371c95786c97fb8f45a33 | [
"Apache-2.0"
] | null | null | null | third_party/freemodbus-v1.6/demo/ATSAM3S/demo.c | xiong1979/edf | 481ca105d78749ed4bf371c95786c97fb8f45a33 | [
"Apache-2.0"
] | 3 | 2021-01-10T09:56:57.000Z | 2022-02-08T19:56:50.000Z | /*
* FreeModbus Libary: Atmel AT91SAM3S Demo Application
* Copyright (C) 2010 Christian Walter <cwalter@embedded-solutions.at>
*
*
* 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. 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
* IF 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.
*
* File: $Id$
*/
/* ----------------------- AT91SAM3S includes -------------------------------*/
#include <board.h>
#include <usart/usart.h>
/* ----------------------- Modbus includes ----------------------------------*/
#include "mb.h"
#include "mbport.h"
/* ----------------------- Defines ------------------------------------------*/
#define REG_INPUT_START ( 1000 )
#define REG_INPUT_NREGS ( 64 )
#define REG_HOLDING_START ( 1 )
#define REG_HOLDING_NREGS ( 32 )
/* ----------------------- Static functions ---------------------------------*/
static void _SetupHardware( void );
/* ----------------------- Static variables ---------------------------------*/
static USHORT usRegInputStart = REG_INPUT_START;
static USHORT usRegInputBuf[REG_INPUT_NREGS];
static USHORT usRegHoldingStart = REG_HOLDING_START;
static USHORT usRegHoldingBuf[REG_HOLDING_NREGS];
/* ----------------------- Start implementation -----------------------------*/
int
main( void )
{
_SetupHardware( );
const UCHAR ucSlaveID[] = { 0xAA, 0xBB, 0xCC };
eMBErrorCode eStatus;
for( ;; )
{
if( MB_ENOERR != ( eStatus = eMBInit( MB_RTU, 0x0A, 1, 38400, MB_PAR_EVEN ) ) )
{
/* Can not initialize. Add error handling code here. */
}
else
{
if( MB_ENOERR != ( eStatus = eMBSetSlaveID( 0x34, TRUE, ucSlaveID, 3 ) ) )
{
/* Can not set slave id. Check arguments */
}
else if( MB_ENOERR != ( eStatus = eMBEnable( ) ) )
{
/* Enable failed. */
}
else
{
usRegHoldingBuf[0] = 1;
do
{
( void )eMBPoll( );
/* Here we simply count the number of poll cycles. */
usRegInputBuf[0]++;
}
while( usRegHoldingBuf[0] );
( void )eMBDisable( );
( void )eMBClose( );
}
}
}
return 1;
}
void _SetupHardware( void )
{
WDT_Disable( );
uint32_t i = 0;
for( i = 0; i < 35; i++ )
{
NVIC_SetPriority( (IRQn_Type)i, 0xF << 4 ) ;
}
}
eMBErrorCode
eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs )
{
eMBErrorCode eStatus = MB_ENOERR;
int iRegIndex;
if( ( usAddress >= REG_INPUT_START )
&& ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) )
{
iRegIndex = ( int )( usAddress - usRegInputStart );
while( usNRegs > 0 )
{
*pucRegBuffer++ =
( unsigned char )( usRegInputBuf[iRegIndex] >> 8 );
*pucRegBuffer++ =
( unsigned char )( usRegInputBuf[iRegIndex] & 0xFF );
iRegIndex++;
usNRegs--;
}
}
else
{
eStatus = MB_ENOREG;
}
return eStatus;
}
eMBErrorCode
eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode )
{
eMBErrorCode eStatus = MB_ENOERR;
int iRegIndex;
if( ( usAddress >= REG_HOLDING_START ) && ( usAddress + usNRegs <= REG_HOLDING_START + REG_HOLDING_NREGS ) )
{
iRegIndex = ( int )( usAddress - usRegHoldingStart );
switch ( eMode )
{
case MB_REG_READ:
while( usNRegs > 0 )
{
*pucRegBuffer++ = ( unsigned char )( usRegHoldingBuf[iRegIndex] >> 8 );
*pucRegBuffer++ = ( unsigned char )( usRegHoldingBuf[iRegIndex] & 0xFF );
iRegIndex++;
usNRegs--;
}
break;
case MB_REG_WRITE:
while( usNRegs > 0 )
{
usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8;
usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++;
iRegIndex++;
usNRegs--;
}
}
}
else
{
eStatus = MB_ENOREG;
}
return eStatus;
}
eMBErrorCode
eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils,
eMBRegisterMode eMode )
{
return MB_ENOREG;
}
eMBErrorCode
eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete )
{
return MB_ENOREG;
}
| 32.760638 | 113 | 0.532392 |
cfb9f92afe519a3d9988e0c87796ea5099bac26f | 2,230 | h | C | verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h | jm-c/MITgcm | 9f5240b52a9c886dc6564230ed8ea9e09e8fc9eb | [
"MIT"
] | 247 | 2018-02-07T08:33:08.000Z | 2022-03-31T08:55:55.000Z | verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h | jm-c/MITgcm | 9f5240b52a9c886dc6564230ed8ea9e09e8fc9eb | [
"MIT"
] | 580 | 2018-01-31T21:38:08.000Z | 2022-03-31T22:43:30.000Z | verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h | jm-c/MITgcm | 9f5240b52a9c886dc6564230ed8ea9e09e8fc9eb | [
"MIT"
] | 209 | 2018-01-31T20:58:49.000Z | 2022-03-30T06:24:43.000Z | CBOP
C !ROUTINE: AUTODIFF_OPTIONS.h
C !INTERFACE:
C #include "AUTODIFF_OPTIONS.h"
C !DESCRIPTION:
C *==================================================================*
C | CPP options file for AutoDiff (autodiff) package:
C | Control which optional features to compile in this package code.
C *==================================================================*
CEOP
#ifndef AUTODIFF_OPTIONS_H
#define AUTODIFF_OPTIONS_H
#include "PACKAGES_CONFIG.h"
#include "CPP_OPTIONS.h"
#ifdef ALLOW_AUTODIFF
#ifdef ECCO_CPPOPTIONS_H
C-- When multi-package option-file ECCO_CPPOPTIONS.h is used (directly included
C in CPP_OPTIONS.h), this option file is left empty since all options that
C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h
#else /* ndef ECCO_CPPOPTIONS_H */
C ==================================================================
C-- Package-specific Options & Macros go here
C o Include/exclude code in order to be able to automatically
C differentiate the MITgcmUV by using the Tangent Linear and
C Adjoint Model Compiler (TAMC).
#define ALLOW_AUTODIFF_TAMC
C >>> Checkpointing as handled by TAMC
#define ALLOW_TAMC_CHECKPOINTING
C >>> Extract adjoint state
#define ALLOW_AUTODIFF_MONITOR
C >>> and DYNVARS_DIAG adjoint state
#undef ALLOW_AUTODIFF_MONITOR_DIAG
C >>> DO 2-level checkpointing instead of 3-level
c#undef AUTODIFF_2_LEVEL_CHECKPOINT
C extend to 4-level checkpointing
c#undef AUTODIFF_4_LEVEL_CHECKPOINT
C o use divided adjoint to split adjoint computations
#undef ALLOW_DIVIDED_ADJOINT
#define ALLOW_AUTODIFF_WHTAPEIO
C Note: comment out the #define below (instead of having an #undef) to
C enable to set this Option in CPP command line (from the optfile)
c#define AUTODIFF_USE_MDSFINDUNITS
#define ALLOW_PACKUNPACK_METHOD2
#undef AUTODIFF_USE_OLDSTORE_3D
#undef AUTODIFF_USE_OLDSTORE_2D
C o write separate tape files for each ptracer
#undef AUTODIFF_PTRACERS_SPLIT_FILES
C o allow using viscFacInAd to recompute viscosities in AD
#define AUTODIFF_ALLOW_VISCFACADJ
C ==================================================================
#endif /* ndef ECCO_CPPOPTIONS_H */
#endif /* ALLOW_AUTODIFF */
#endif /* AUTODIFF_OPTIONS_H */
| 32.318841 | 79 | 0.694619 |
d6066eab8c29106e11991aeee4ff7beb9876666c | 2,710 | h | C | screen/goScreen.h | Qolzam/robotgo | 3f2bd94d608e642b6032fce9bed7a0dce1deaa4a | [
"Apache-2.0"
] | null | null | null | screen/goScreen.h | Qolzam/robotgo | 3f2bd94d608e642b6032fce9bed7a0dce1deaa4a | [
"Apache-2.0"
] | null | null | null | screen/goScreen.h | Qolzam/robotgo | 3f2bd94d608e642b6032fce9bed7a0dce1deaa4a | [
"Apache-2.0"
] | null | null | null | // Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://github.com/Qolzam/robotgo/blob/master/LICENSE
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#include "../base/types.h"
#include "../base/rgb.h"
#include "screengrab_c.h"
#include "screen_c.h"
// #include "../MMBitmap_c.h"
void padHex(MMRGBHex color, char* hex){
// Length needs to be 7 because snprintf includes a terminating null.
// Use %06x to pad hex value with leading 0s.
snprintf(hex, 7, "%06x", color);
}
char* pad_hex(MMRGBHex color){
char hex[7];
padHex(color, hex);
// destroyMMBitmap(bitmap);
char* str = (char*)calloc(100, sizeof(char*));
if (str) { strcpy(str, hex); }
return str;
}
static uint8_t rgb[3];
uint8_t* color_hex_to_rgb(uint32_t h){
rgb[0] = RED_FROM_HEX(h);
rgb[1] = GREEN_FROM_HEX(h);
rgb[2] = BLUE_FROM_HEX(h);
return rgb;
}
uint32_t color_rgb_to_hex(uint8_t r, uint8_t g, uint8_t b){
return RGB_TO_HEX(r, g, b);
}
MMRGBHex get_px_color(int32_t x, int32_t y){
MMBitmapRef bitmap;
MMRGBHex color;
if (!pointVisibleOnMainDisplay(MMPointInt32Make(x, y))){
return color;
}
bitmap = copyMMBitmapFromDisplayInRect(MMRectInt32Make(x, y, 1, 1));
// bitmap = MMRectMake(x, y, 1, 1);
color = MMRGBHexAtPoint(bitmap, 0, 0);
destroyMMBitmap(bitmap);
return color;
}
char* get_pixel_color(int32_t x, int32_t y){
MMRGBHex color = get_px_color(x, y);
char* s = pad_hex(color);
return s;
}
MMSizeInt32 get_screen_size(){
// Get display size.
MMSizeInt32 displaySize = getMainDisplaySize();
return displaySize;
}
char* set_XDisplay_name(char* name){
#if defined(USE_X11)
setXDisplay(name);
return "success";
#else
return "SetXDisplayName is only supported on Linux";
#endif
}
char* get_XDisplay_name(){
#if defined(USE_X11)
const char* display = getXDisplay();
char* sd = (char*)calloc(100, sizeof(char*));
if (sd) { strcpy(sd, display); }
return sd;
#else
return "GetXDisplayName is only supported on Linux";
#endif
}
// capture_screen capture screen
MMBitmapRef capture_screen(int32_t x, int32_t y, int32_t w, int32_t h){
// if (){
// x = 0;
// y = 0;
// // Get screen size.
// MMSize displaySize = getMainDisplaySize();
// w = displaySize.width;
// h = displaySize.height;
// }
MMBitmapRef bitmap = copyMMBitmapFromDisplayInRect(MMRectInt32Make(x, y, w, h));
// printf("%s\n", bitmap);
return bitmap;
}
| 23.982301 | 81 | 0.698893 |
5ca10c30a3203ccd7326c85e85b7746068b0e4fa | 4,720 | h | C | src/protocols/rdp/channels/rdpei.h | Demonslyr/guacamole-server | 7bbab0efddd2d299baa5e1e400c0860f0fe69047 | [
"Apache-2.0"
] | null | null | null | src/protocols/rdp/channels/rdpei.h | Demonslyr/guacamole-server | 7bbab0efddd2d299baa5e1e400c0860f0fe69047 | [
"Apache-2.0"
] | null | null | null | src/protocols/rdp/channels/rdpei.h | Demonslyr/guacamole-server | 7bbab0efddd2d299baa5e1e400c0860f0fe69047 | [
"Apache-2.0"
] | null | null | null | /*
* 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 GUAC_RDP_CHANNELS_RDPEI_H
#define GUAC_RDP_CHANNELS_RDPEI_H
#include "settings.h"
#include <freerdp/client/rdpei.h>
#include <freerdp/freerdp.h>
#include <guacamole/client.h>
#include <guacamole/timestamp.h>
/**
* The maximum number of simultaneously-tracked touches.
*/
#define GUAC_RDP_RDPEI_MAX_TOUCHES 10
/**
* A single, tracked touch contact.
*/
typedef struct guac_rdp_rdpei_touch {
/**
* Whether this touch is active (1) or inactive (0). An active touch is
* being tracked, while an inactive touch is simple an empty space awaiting
* use by some future touch event.
*/
int active;
/**
* The unique ID representing this touch contact.
*/
int id;
/**
* The X-coordinate of this touch, in pixels.
*/
int x;
/**
* The Y-coordinate of this touch, in pixels.
*/
int y;
} guac_rdp_rdpei_touch;
/**
* Multi-touch input module.
*/
typedef struct guac_rdp_rdpei {
/**
* RDPEI control interface.
*/
RdpeiClientContext* rdpei;
/**
* All currently-tracked touches.
*/
guac_rdp_rdpei_touch touch[GUAC_RDP_RDPEI_MAX_TOUCHES];
} guac_rdp_rdpei;
/**
* Allocates a new RDPEI module, which will ultimately control the RDPEI
* channel once connected. The RDPEI channel allows multi-touch input
* events to be sent to the RDP server.
*
* @return
* A newly-allocated RDPEI module.
*/
guac_rdp_rdpei* guac_rdp_rdpei_alloc();
/**
* Frees the resources associated with support for the RDPEI channel. Only
* resources specific to Guacamole are freed. Resources specific to FreeRDP's
* handling of the RDPEI channel will be freed by FreeRDP. If no resources are
* currently allocated for RDPEI, this function has no effect.
*
* @param rdpei
* The RDPEI module to free.
*/
void guac_rdp_rdpei_free(guac_rdp_rdpei* rdpei);
/**
* Adds FreeRDP's "rdpei" plugin to the list of dynamic virtual channel plugins
* to be loaded by FreeRDP's "drdynvc" plugin. The context of the plugin will
* automatically be assicated with the guac_rdp_rdpei instance pointed to by the
* current guac_rdp_client. The plugin will only be loaded once the "drdynvc"
* plugin is loaded. The "rdpei" plugin ultimately adds support for multi-touch
* input via the RDPEI channel.
*
* If failures occur, messages noting the specifics of those failures will be
* logged, and the RDP side of multi-touch support will not be functional.
*
* This MUST be called within the PreConnect callback of the freerdp instance
* for multi-touch support to be loaded.
*
* @param context
* The rdpContext associated with the active RDP session.
*/
void guac_rdp_rdpei_load_plugin(rdpContext* context);
/**
* Reports to the RDP server that the status of a single touch contact has
* changed. Depending on the amount of force associated with the touch and
* whether the touch has been encountered before, this will result a new touch
* contact, updates to an existing contact, or removal of an existing contact.
* If the RDPEI channel has not yet been connected, touches will be ignored and
* dropped until it is connected.
*
* @param rdpei
* The RDPEI module associated with the RDP session.
*
* @param id
* An arbitrary integer ID unique to the touch being updated.
*
* @param x
* The X-coordinate of the touch, in pixels.
*
* @param y
* The Y-coordinate of the touch, in pixels.
*
* @param force
* The amount of force currently being exerted on the device by the touch
* contact in question, where 1.0 is the maximum amount of force
* representable and 0.0 indicates the contact has been lifted.
*
* @return
* Zero if the touch event was successfully processed, non-zero if the
* touch event had to be dropped.
*/
int guac_rdp_rdpei_touch_update(guac_rdp_rdpei* rdpei, int id, int x, int y,
double force);
#endif
| 30.451613 | 80 | 0.718008 |
5ce1c3f8c768c9cbaf9b7532c16c2cbd0e787374 | 493 | h | C | framework/Source/CLVideokit.h | cleexiang/Videokit | 864e1a35fb57fe25c80a295b0161df606785c8dd | [
"Apache-2.0"
] | 1 | 2017-01-05T15:43:45.000Z | 2017-01-05T15:43:45.000Z | framework/Source/CLVideokit.h | cleexiang/Videokit | 864e1a35fb57fe25c80a295b0161df606785c8dd | [
"Apache-2.0"
] | null | null | null | framework/Source/CLVideokit.h | cleexiang/Videokit | 864e1a35fb57fe25c80a295b0161df606785c8dd | [
"Apache-2.0"
] | null | null | null | //
// CLVideokit.h
// CLVideokit
//
// Created by clee on 16/10/25.
// Copyright © 2016年 lixiang. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for CLVideokit.
FOUNDATION_EXPORT double CLVideokitVersionNumber;
//! Project version string for CLVideokit.
FOUNDATION_EXPORT const unsigned char CLVideokitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <CLVideokit/PublicHeader.h>
| 24.65 | 135 | 0.760649 |
cf037b4970de4e9029210761c1f6f3804650f11b | 3,128 | c | C | RobotSensors/RobotSensors_PC/bluecove/bluecove-2.1.0-sources-all/bluecove-bluez/src/main/c/BlueCoveBlueZ.c | erichstuder/random | 233cf7538a04b4144b700fee7e955744efd204ce | [
"MIT"
] | 1 | 2018-12-08T07:42:04.000Z | 2018-12-08T07:42:04.000Z | RobotSensors/RobotSensors_PC/bluecove/bluecove-2.1.0-sources-all/bluecove-bluez/src/main/c/BlueCoveBlueZ.c | erichstuder/random | 233cf7538a04b4144b700fee7e955744efd204ce | [
"MIT"
] | null | null | null | RobotSensors/RobotSensors_PC/bluecove/bluecove-2.1.0-sources-all/bluecove-bluez/src/main/c/BlueCoveBlueZ.c | erichstuder/random | 233cf7538a04b4144b700fee7e955744efd204ce | [
"MIT"
] | null | null | null | /**
* BlueCove BlueZ module - Java library for Bluetooth on Linux
* Copyright (C) 2008 Vlad Skarzhevskyy
*
* 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.
*
* @version $Id: BlueCoveBlueZ.c 1724 2008-01-31 16:59:24Z skarzhevskyy $
*/
#define CPP__FILE "BlueCoveBlueZ.c"
#include "BlueCoveBlueZ.h"
#include <bluetooth/sdp_lib.h>
JNIEXPORT jboolean JNICALL Java_com_intel_bluetooth_BluetoothStackBlueZ_isNativeCodeLoaded
(JNIEnv *env, jobject peer) {
return JNI_TRUE;
}
JNIEXPORT jint JNICALL Java_com_intel_bluetooth_BluetoothStackBlueZ_getLibraryVersionNative
(JNIEnv *env, jobject peer) {
return com_intel_bluetooth_BluetoothStackBlueZ_BLUECOVE_DBUS_VERSION;
//return com_intel_bluetooth_BluetoothStackBlueZ_NATIVE_LIBRARY_VERSION;
}
JNIEXPORT void JNICALL Java_com_intel_bluetooth_BluetoothStackBlueZ_enableNativeDebug
(JNIEnv *env, jobject peer, jclass loggerClass, jboolean on) {
enableNativeDebug(env, loggerClass, on);
}
int deviceClassBytesToInt(uint8_t* deviceClass) {
return ((deviceClass[2] & 0xff)<<16)|((deviceClass[1] & 0xff)<<8)|(deviceClass[0] & 0xff);
}
jlong deviceAddrToLong(bdaddr_t* address) {
jlong addressLong = 0;
int i;
for (i = sizeof(address->b) - 1; i >= 0; i--) {
addressLong = (addressLong << 8) | address->b[i];
}
return addressLong;
}
void longToDeviceAddr(jlong addr, bdaddr_t* address) {
int i;
for(i = 0; i < sizeof(address->b); i++) {
address->b[i] = (uint8_t)(addr & 0xFF);
addr >>= 8;
}
}
jlong ptr2jlong(void *ptr) {
jlong l = 0;
memcpy(&l, &ptr, sizeof(void*));
return l;
}
void* jlong2ptr(jlong l) {
void* ptr = NULL;
memcpy(&ptr, &l, sizeof(void*));
return ptr;
}
void reverseArray(jbyte* array, int length) {
int i;
jbyte temp;
for(i = 0; i < length / 2; i++) {
temp = array[i];
array[i] = array[length - 1 - i];
array[length - 1 - i] = temp;
}
}
void convertUUIDByteArrayToUUID(JNIEnv *env, jbyteArray byteArray, uuid_t* uuid) {
jbyte *bytes = (*env)->GetByteArrayElements(env, byteArray, 0);
convertUUIDBytesToUUID(bytes, uuid);
// unpin array
(*env)->ReleaseByteArrayElements(env, byteArray, bytes, 0);
}
void convertUUIDBytesToUUID(jbyte *bytes, uuid_t* uuid) {
uuid->type = SDP_UUID128;
memcpy(&uuid->value, bytes, 128/8);
}
| 30.970297 | 94 | 0.695652 |
682aebb0d7d73d598f6f3c62bc4f5a8f3335b591 | 4,146 | c | C | src/theme.c | nielssp/csol-dos | 70cf8fbfe755e1533c6f9419bfd9677aa19d9eb3 | [
"MIT"
] | null | null | null | src/theme.c | nielssp/csol-dos | 70cf8fbfe755e1533c6f9419bfd9677aa19d9eb3 | [
"MIT"
] | null | null | null | src/theme.c | nielssp/csol-dos | 70cf8fbfe755e1533c6f9419bfd9677aa19d9eb3 | [
"MIT"
] | null | null | null | /* csol
* Copyright (c) 2017 Niels Sonnich Poulsen (http://nielssp.dk)
* Licensed under the MIT license.
* See the LICENSE file or http://opensource.org/licenses/MIT for more information.
*/
#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#ifdef POSIX
#include <dirent.h>
#endif
#ifdef MSDOS
#include <dos.h>
#endif
#include "theme.h"
#include "util.h"
#include "rc.h"
struct dir_list {
char *dir;
struct dir_list *next;
};
ThemeList *first_theme = NULL;
ThemeList *last_theme = NULL;
struct dir_list *theme_dirs = NULL;
Theme *new_theme() {
Theme *theme = malloc(sizeof(Theme));
theme->name = NULL;
theme->title = NULL;
theme->heart = NULL;
theme->spade = NULL;
theme->diamond = NULL;
theme->club = NULL;
theme->width = 6;
theme->height = 4;
theme->x_spacing = 2;
theme->y_spacing = 1;
theme->x_margin = 2;
theme->y_margin = 1;
theme->colors = NULL;
theme->background.fg = 7;
theme->background.bg = 0;
theme->empty_layout = init_layout();
theme->back_layout = init_layout();
theme->red_layout = init_layout();
theme->black_layout = init_layout();
return theme;
}
Layout init_layout() {
Layout l;
l.color.fg = 7;
l.color.bg = 0;
l.top = NULL;
l.middle = NULL;
l.bottom = NULL;
l.left_padding = 1;
l.right_padding = 1;
l.text_fields = NULL;
return l;
}
void define_color(Theme *theme, short index, short red, short green, short blue) {
Color *color = malloc(sizeof(Color));
color->next = theme->colors;
color->index = index;
color->red = red;
color->green = green;
color->blue = blue;
theme->colors = color;
}
void register_theme(Theme *theme) {
if (theme->name) {
ThemeList *next = malloc(sizeof(struct theme_list));
next->theme = theme;
next->next = NULL;
if (last_theme) {
last_theme->next = next;
last_theme = next;
} else {
first_theme = last_theme = next;
}
}
}
void register_theme_dir(const char *cwd, const char *dir) {
struct dir_list *theme_dir = malloc(sizeof(struct dir_list));
theme_dir->dir = combine_paths(cwd, dir);
theme_dir->next = theme_dirs;
theme_dirs = theme_dir;
}
void load_theme_dirs() {
struct dir_list *current = theme_dirs;
while (current) {
struct dir_list *next;
#ifdef MSDOS
struct find_t file;
char *path = combine_paths(current->dir, "*");
if (_dos_findfirst(path, _A_ARCH, &file) == 0) {
do {
char *theme_path = combine_paths(current->dir, file.name);
execute_file(theme_path);
free(theme_path);
} while (_dos_findnext(&file) == 0);
}
free(path);
#endif
#if POSIX
struct dirent **files;
int n = scandir(current->dir, &files, NULL, alphasort);
if (n >= 0) {
int i;
for (i = 0; i < n; i++) {
char *theme_path = combine_paths(current->dir, files[i]->d_name);
execute_file(theme_path);
free(theme_path);
free(files[i]);
}
free(files);
}
#endif
next = current->next;
free(current->dir);
free(current);
current = next;
}
theme_dirs = NULL;
}
ThemeList *list_themes() {
return first_theme;
}
Theme *get_theme_in_list(const char *name) {
ThemeList *themes;
for (themes = list_themes(); themes; themes = themes->next) {
if (strcmp(themes->theme->name, name) == 0) {
return themes->theme;
}
}
return NULL;
}
Theme *get_theme(const char *name) {
struct dir_list *theme_dir;
Theme *theme = get_theme_in_list(name);
if (theme) {
return theme;
}
for (theme_dir = theme_dirs; theme_dir; theme_dir = theme_dir->next) {
char *theme_path = combine_paths(theme_dir->dir, name);
if (file_exists(theme_path)) {
execute_file(theme_path);
theme = get_theme_in_list(name);
if (theme) {
free(theme_path);
return theme;
}
}
free(theme_path);
}
return NULL;
}
char *card_suit(Card *card, Theme *theme) {
switch (card->suit) {
case HEART:
return theme->heart;
case SPADE:
return theme->spade;
case DIAMOND:
return theme->diamond;
case CLUB:
return theme->club;
}
return "";
}
| 22.410811 | 83 | 0.631452 |
a9fc2e3485c484c2739b3ae40745103000b6b4d7 | 352 | h | C | src/Radar/RadxData.h | FoolishPineapple/vortrac | a682e6080e83f7ae8fa34f33cc68ea0739390d0d | [
"Apache-2.0"
] | null | null | null | src/Radar/RadxData.h | FoolishPineapple/vortrac | a682e6080e83f7ae8fa34f33cc68ea0739390d0d | [
"Apache-2.0"
] | null | null | null | src/Radar/RadxData.h | FoolishPineapple/vortrac | a682e6080e83f7ae8fa34f33cc68ea0739390d0d | [
"Apache-2.0"
] | null | null | null | #ifndef RADXDATA_H
#define RADXDATA_H
#include "Radx/RadxRay.hh"
#include "RadarData.h"
class RadxData : public RadarData
{
public:
RadxData(const QString &radarname, const float &lat, const float &lon,
const QString &filename);
~RadxData();
bool readVolume();
float *getRayData(RadxRay *fileRay, const char *fieldName);
};
#endif
| 16.761905 | 72 | 0.715909 |
30d760ace88cd66823cd34ba138cfe915e1d0ce0 | 290 | h | C | BMFS/stamp.h | JColonnello/Kernel | a7d7d2325934e8190777816ce8d8eb548852be61 | [
"BSD-3-Clause"
] | null | null | null | BMFS/stamp.h | JColonnello/Kernel | a7d7d2325934e8190777816ce8d8eb548852be61 | [
"BSD-3-Clause"
] | null | null | null | BMFS/stamp.h | JColonnello/Kernel | a7d7d2325934e8190777816ce8d8eb548852be61 | [
"BSD-3-Clause"
] | null | null | null | /* ===============================================================
* Baremetal File System - A file system designed for BareMetal OS
* Copyright (C) 2008 - 2018 Return Infinity
* See COPYING for license information.
* ===============================================================
*/
| 41.428571 | 66 | 0.396552 |
e78f559235a640c9552c2c7b580789fbc60463f3 | 309 | h | C | tomviz/modules/ScalarsComboBox.h | sankhesh/tomviz | 7116f4eb75b30534a24462f4ddfb1694fe41c308 | [
"BSD-3-Clause"
] | 284 | 2015-01-05T08:53:20.000Z | 2022-03-31T07:35:16.000Z | tomviz/modules/ScalarsComboBox.h | sankhesh/tomviz | 7116f4eb75b30534a24462f4ddfb1694fe41c308 | [
"BSD-3-Clause"
] | 1,579 | 2015-03-19T15:56:44.000Z | 2022-03-21T11:29:04.000Z | tomviz/modules/ScalarsComboBox.h | sankhesh/tomviz | 7116f4eb75b30534a24462f4ddfb1694fe41c308 | [
"BSD-3-Clause"
] | 74 | 2015-01-29T16:24:32.000Z | 2022-03-07T21:52:29.000Z | #ifndef tomvizScalarsPicker_h
#define tomvizScalarsPicker_h
#include <QComboBox>
namespace tomviz {
class DataSource;
class Module;
class ScalarsComboBox : public QComboBox
{
Q_OBJECT
public:
ScalarsComboBox(QWidget* parent = nullptr);
void setOptions(DataSource* ds, Module* module);
};
}
#endif
| 14.045455 | 50 | 0.770227 |
b75cfbd6b7923401df7fddb51a103747f19827d5 | 9,439 | h | C | double_robot_project/src/scout_robot/agx_sdk-scout_v2/include/wrp_sdk/platforms/tracer/tracer_protocol.h | Xray0302/dual_arm_project | 34fed790f5b00411f4f5125c3197655eebce2db5 | [
"Apache-2.0"
] | null | null | null | double_robot_project/src/scout_robot/agx_sdk-scout_v2/include/wrp_sdk/platforms/tracer/tracer_protocol.h | Xray0302/dual_arm_project | 34fed790f5b00411f4f5125c3197655eebce2db5 | [
"Apache-2.0"
] | null | null | null | double_robot_project/src/scout_robot/agx_sdk-scout_v2/include/wrp_sdk/platforms/tracer/tracer_protocol.h | Xray0302/dual_arm_project | 34fed790f5b00411f4f5125c3197655eebce2db5 | [
"Apache-2.0"
] | null | null | null | /*
* tracer_protocol.h
*
* Created on: Apr 14, 2020 10:34
* Description:
*
* Copyright (c) 2020 Ruixiang Du (rdu)
*/
#ifndef TRACER_PROTOCOL_H
#define TRACER_PROTOCOL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#define TRACER_CMD_BUF_LEN 32
#define TRACER_STATUS_BUF_LEN 32
#define TRACER_FRAME_SIZE 13
#define TRACER_MOTOR1_ID ((uint8_t)0x00)
#define TRACER_MOTOR2_ID ((uint8_t)0x01)
// CAN Definitions
#define CAN_MSG_MOTION_CMD_ID ((uint32_t)0x111)
#define CAN_MSG_MOTION_STATUS_ID ((uint32_t)0x221)
#define CAN_MSG_LIGHT_CONTROL_CMD_ID ((uint32_t)0x121)
#define CAN_MSG_LIGHT_CONTROL_STATUS_ID ((uint32_t)0x231)
#define CAN_MSG_SYSTEM_STATUS_STATUS_ID ((uint32_t)0x211)
#define CAN_MSG_MOTOR1_DRIVER_STATUS_ID ((uint32_t)0x251)
#define CAN_MSG_MOTOR2_DRIVER_STATUS_ID ((uint32_t)0x252)
#define CAN_MSG_COMTROL_MODE_ID ((uint32_t)0x421)
#define CAN_MSG_ODOMETER_ID ((uint32_t)0x311)
/*--------------------- Control/State Constants ------------------------*/
// Motion Control
#define CTRL_MODE_REMOTE ((uint8_t)0x00)
#define CTRL_MODE_CMD_CAN ((uint8_t)0x01)
#define CTRL_MODE_CMD_UART ((uint8_t)0x02)
#define CTRL_MODE_COMMANDED ((uint8_t)0x03)
#define FAULT_CLR_NONE ((uint8_t)0x00)
#define FAULT_CLR_BAT_UNDER_VOL ((uint8_t)0x01)
#define FAULT_CLR_BAT_OVER_VOL ((uint8_t)0x02)
#define FAULT_CLR_MOTOR1_COMM ((uint8_t)0x03)
#define FAULT_CLR_MOTOR2_COMM ((uint8_t)0x04)
#define FAULT_CLR_MOTOR3_COMM ((uint8_t)0x05)
#define FAULT_CLR_MOTOR4_COMM ((uint8_t)0x06)
#define FAULT_CLR_MOTOR_DRV_OVERHEAT ((uint8_t)0x07)
#define FAULT_CLR_MOTOR_OVERCURRENT ((uint8_t)0x08)
// Light Control
#define LIGHT_DISABLE_CTRL ((uint8_t)0x00)
#define LIGHT_ENABLE_CTRL ((uint8_t)0x01)
#define LIGHT_MODE_CONST_OFF ((uint8_t)0x00)
#define LIGHT_MODE_CONST_ON ((uint8_t)0x01)
#define LIGHT_MODE_BREATH ((uint8_t)0x02)
#define LIGHT_MODE_CUSTOM ((uint8_t)0x03)
// System Status Feedback
#define BASE_STATE_NORMAL ((uint8_t)0x00)
#define BASE_STATE_ESTOP ((uint8_t)0x01)
#define BASE_STATE_EXCEPTION ((uint8_t)0x02)
#define FAULT_CAN_CHECKSUM_ERROR ((uint16_t)0x0100)
#define FAULT_FRONT_STEER_ENCODER_F ((uint16_t)0x0200)
#define FAULT_RC_SIGNAL_LOSS ((uint16_t)0x0400)
#define FAULT_HIGH_BYTE_RESERVED1 ((uint16_t)0x0800)
#define FAULT_HIGH_BYTE_RESERVED2 ((uint16_t)0x1000)
#define FAULT_HIGH_BYTE_RESERVED3 ((uint16_t)0x2000)
#define FAULT_HIGH_BYTE_RESERVED4 ((uint16_t)0x4000)
#define FAULT_HIGH_BYTE_RESERVED5 ((uint16_t)0x8000)
#define FAULT_BAT_UNDER_VOL_F ((uint16_t)0x0001)
#define FAULT_BAT_OVER_VOL_F ((uint16_t)0x0002)
#define FAULT_MOTOR1_COMM_F ((uint16_t)0x0004)
#define FAULT_MOTOR2_COMM_F ((uint16_t)0x0008)
#define FAULT_RESERVED1 ((uint16_t)0x0010)
#define FAULT_RESERVED2 ((uint16_t)0x0020)
#define FAULT_MOTOR_DRV_OVERHEAT_F ((uint16_t)0x0040)
#define FAULT_MOTOR_OVERCURRENT_F ((uint16_t)0x0080)
/*-------------------- Control/Feedback Messages -----------------------*/
/* No padding in the struct */
// reference: https://stackoverflow.com/questions/3318410/pragma-pack-effect
#pragma pack(push, 1)
// Note: id could be different for UART and CAN protocol
// Motion Control
typedef struct {
union
{
struct
{
struct
{
int8_t H_byte;
int8_t L_byte;
}linear_velocity;
struct
{
int8_t H_byte;
int8_t L_byte;
}angular_velocity;
uint8_t reserved0;
uint8_t reserved1;
uint8_t reserved2;
uint8_t reserved3;
} cmd;
uint8_t raw[8];
} data;
} MotionCmdMessage;
typedef struct {
union
{
struct
{
uint8_t control_mode;
uint8_t reserved0;
uint8_t reserved1;
uint8_t reserved2;
uint8_t reserved3;
uint8_t reserved4;
uint8_t reserved5;
uint8_t reserved6;
} cmd;
uint8_t raw[8];
} data;
} ModSelectMessage;
typedef struct {
union
{
struct
{
struct
{
uint8_t high_byte;
uint8_t low_byte;
} linear_velocity;
struct
{
uint8_t high_byte;
uint8_t low_byte;
} angular_velocity;
uint8_t reserved0;
uint8_t reserved1;
uint8_t reserce2;
uint8_t reserce3;
} status;
uint8_t raw[8];
} data;
} MotionStatusMessage;
// System Status Feedback
typedef struct {
union
{
struct
{
uint8_t base_state;
uint8_t control_mode;
struct
{
uint8_t high_byte;
uint8_t low_byte;
} battery_voltage;
uint8_t fault_code;
uint8_t reserved0;
uint8_t reserved1;
uint8_t count;
//uint8_t checksum;
} status;
uint8_t raw[8];
} data;
} SystemStatusMessage;
// Light Control
typedef struct {
union
{
struct
{
uint8_t light_ctrl_enable;
uint8_t front_light_mode;
uint8_t front_light_custom;
uint8_t reserved0;
uint8_t reserved1;
uint8_t reserved2;
uint8_t reserved3;
uint8_t count;
} cmd;
uint8_t raw[8];
} data;
} LightControlMessage;
typedef struct {
union
{
struct
{
uint8_t light_ctrl_enable;
uint8_t front_light_mode;
uint8_t front_light_custom;
uint8_t reserved0;
uint8_t reserved1;
uint8_t reserved2;
uint8_t reserved3;
uint8_t count;
} status;
uint8_t raw[8];
} data;
} LightStatusMessage;
// Motor Driver Feedback
typedef struct
{
uint8_t motor_id;
union {
struct
{
struct
{
uint8_t high_byte;
uint8_t low_byte;
} current;
struct
{
uint8_t high_byte;
uint8_t low_byte;
} rpm;
int8_t temperature;
uint8_t reserved0;
uint8_t count;
uint8_t checksum;
} status;
uint8_t raw[8];
} data;
} MotorDriverStatusMessage;
typedef struct
{
uint8_t motor_id;
union {
struct
{
struct
{
uint8_t high_byte;
uint8_t low_byte;
} rpm;
int8_t reserved0;
int8_t reserved1;
int8_t reserved2;
int8_t reserved3;
int8_t reserved4;
int8_t reserved5;
} status;
uint8_t raw[8];
} data;
} MotorHeightSpeedStatusMessage;
typedef struct
{
uint8_t motor_id;
union {
struct
{
int8_t reserved0;
int8_t reserved1;
int8_t reserved2;
int8_t reserved3;
int8_t reserved4;
int8_t driver_state;
int8_t reserved5;
int8_t reserved6;
} status;
uint8_t raw[8];
} data;
} MotorLowSpeedStatusMessage;
typedef struct
{
uint8_t motor_id;
union {
struct
{
struct
{
uint8_t highest;
uint8_t sec_highest;
uint8_t sec_lowest;
uint8_t lowest;
}leftodometer;
struct
{
uint8_t highest;
uint8_t sec_highest;
uint8_t sec_lowest;
uint8_t lowest;
}rightodometer;
} status;
uint8_t raw[8];
} data;
} OdometerMessage;
// For convenience to access status/control message
typedef enum
{
TracerMsgNone = 0x00,
// status messages
TracerMotionStatusMsg = 0x01,
TracerLightStatusMsg = 0x02,
TracerSystemStatusMsg = 0x03,
TracerMotorDriverStatusMsg = 0x04,
TracerOdometerMsg = 0x05,
TracerHeighSpeedMsg = 0x06,
TracerLowSpeedMsg = 0x07,
// control messages
TracerMotionCmdMsg = 0x21,
TracerLightControlMsg = 0x22,
TracerModeControlMsg = 0x23
} TracerMsgType;
typedef struct
{
TracerMsgType type;
union {
// status messages
MotionStatusMessage motion_status_msg;
LightStatusMessage light_status_msg;
SystemStatusMessage system_status_msg;
MotorDriverStatusMessage motor_driver_status_msg;
OdometerMessage odom_msg;
MotorHeightSpeedStatusMessage motor_heigh_speed_msg;
MotorLowSpeedStatusMessage motor_low_speed_msg;
// control messages
MotionCmdMessage motion_cmd_msg;
LightControlMessage light_control_msg;
ModSelectMessage mode_cmd_msg;
} body;
} TracerMessage;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif /* TRACER_PROTOCOL_H */
| 26.074586 | 76 | 0.586185 |
314ccd47cda43f2bbc75ac23890e51bf394fbba6 | 5,437 | c | C | intel.c | pedrovereza/arq-intel | 82df1db402bcbc79f9ce0cfb23f8b727a9118375 | [
"WTFPL"
] | null | null | null | intel.c | pedrovereza/arq-intel | 82df1db402bcbc79f9ce0cfb23f8b727a9118375 | [
"WTFPL"
] | null | null | null | intel.c | pedrovereza/arq-intel | 82df1db402bcbc79f9ce0cfb23f8b727a9118375 | [
"WTFPL"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
unsigned short memory[5000];
unsigned short endCidades = 0;
unsigned short endEngenheiros = 0;
unsigned short memoryIndex = 0;
unsigned short numero_engenheiros = 3;
unsigned short numero_cidades = 0;
unsigned short totalVisitas = 0;
signed short totalRendimento = 0;
char file_name[100];
char ch;
FILE *fp;
char opcao;
void resumo();
void menu();
void relatorioEngenheiro();
void relatorioGeral();
void mensagemErro();
short rendimentoEngenheiro(int engenheiro);
short rendimentoEngenheiroWithOutput(int engenheiro);
void encerramento();
void parseFile();
void readFile();
short readNumber();
int main() {
printf("Pedro Vereza - Cartao 242250\n");
getchar();
readFile();
resumo();
getchar();
do {
menu();
scanf("%s", &opcao);
switch (opcao) {
case 'a':
readFile();
break;
case 'r':
resumo();
break;
case 'e':
relatorioEngenheiro();
break;
case 'g':
relatorioGeral();
break;
case 'f':
encerramento();
default:
break;
}
} while (opcao != 'f');
return 0;
}
void readFile() {
printf(">>Forneca o nome do arquivo de dados:\n");
scanf("%s", file_name);
fp = fopen(file_name, "r");
parseFile();
fclose(fp);
}
void parseFile() {
numero_engenheiros = readNumber();
numero_cidades = readNumber();
int i = 0;
for (i = 0; i < numero_cidades; ++i) {
memory[i] = readNumber();
}
memoryIndex += i;
endEngenheiros = memoryIndex;
memoryIndex += numero_engenheiros;
for (int j = 0; j < numero_engenheiros; ++j) {
memory[endEngenheiros+j] = memoryIndex;
int visitas = readNumber();
memory[memoryIndex] = visitas;
for (i = 1; i <= visitas; ++i) {
memory[memoryIndex+i] = readNumber();
}
memoryIndex += i;
}
}
short readNumber() {
char numero[8];
for (int i = 0; i < 7; ++i) {
ch = fgetc(fp);
if (ch == ',' || ch == '\n') {
numero[i] = 0;
break;
}
numero[i] = ch;
}
return atoi(numero);
}
void encerramento() {
printf(" ¯\\_(ツ)_/¯");
}
void relatorioEngenheiro() {
int engenheiro = 0;
printf("Forneca o numero do engenheiro:");
scanf("%d", &engenheiro);
if (engenheiro < 0 || engenheiro >= numero_engenheiros) {
mensagemErro();
getchar();
relatorioEngenheiro();
return;
}
rendimentoEngenheiroWithOutput(engenheiro);
}
void mensagemErro(){
printf("Engenheiro não identificado\n");
}
void relatorioGeral() {
printf("\tEngenheiro\tVisitas\tLucro\tPrejuizo\n");
totalVisitas = 0;
totalRendimento = 0;
for (short j = 0; j < numero_engenheiros; ++j) {
printf("\t\t%d", j);
totalRendimento += rendimentoEngenheiro(j);
}
printf("\tTotal\t\t%d", totalVisitas);
if (totalRendimento < 0) {
printf("\t\t\t\t%d", totalRendimento);
}
else {
printf("\t\t%d", totalRendimento);
}
}
short rendimentoEngenheiro(int engenheiro) {
short rendimento = 0;
unsigned short eng = (memory[endEngenheiros + engenheiro]);
unsigned short visitas = memory[eng];
totalVisitas += visitas;
for (short i = 1; i <= visitas; ++i) {
rendimento += memory[endCidades + memory[eng + i]];
}
printf("\t\t%d", visitas);
if (rendimento < 0) {
printf("\t\t\t\t%d", rendimento);
}
else {
printf("\t\t%d", rendimento);
}
printf("\n");
return rendimento;
}
short rendimentoEngenheiroWithOutput(int engenheiro) {
printf("\tRelatorio do engenheiro %d\n", engenheiro);
short rendimento = 0;
unsigned short eng = (memory[endEngenheiros + engenheiro]);
unsigned short visitas = memory[eng];
printf("\tNumero de visitas: %d\n", visitas);
printf("\tCidade\tLucro\tPrejuizo\n");
for (short i = 1; i <= visitas; ++i) {
short cidade = memory[eng + i];
short rendimentoCidade = memory[endCidades + cidade];
if (rendimentoCidade < 0) {
printf("\t\t%d\t\t\t\t%d\n", cidade, rendimentoCidade);
}
else {
printf("\t\t%d\t\t%d\n", cidade, rendimentoCidade);
}
rendimento += rendimentoCidade;
}
if (rendimento < 0) {
printf("\t\tTOTAL\t\t\t%d\n", rendimento);
}
else {
printf("\t\tTOTAL\t%d\n", rendimento);
}
return rendimento;
}
void resumo() {
printf("Arquivo de dados:\n\tNumero de cidades...... %d\n\tNumero de engenheiros.. %d", numero_engenheiros, numero_cidades);
}
void menu() {
printf(">> Caracteres de comandos:\n\t[a] solicita novo arquivo de dados\n\t[g] apresenta o relatorio geral\n\t[e] apresenta relatorio de um engenheiro\n\t[f] encerra o programa\n\t[?] lista os comandos validos\nComando>");
} | 21.238281 | 227 | 0.532095 |
c8998190b27cf65377e14041396c1a32e81b0ec8 | 102,705 | h | C | vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h | haseeAmarathunga/react-native-windows | b33ea7f0c1977bb089d995c37e41e88d1e770919 | [
"MIT"
] | null | null | null | vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h | haseeAmarathunga/react-native-windows | b33ea7f0c1977bb089d995c37e41e88d1e770919 | [
"MIT"
] | null | null | null | vnext/ReactUWP/Views/cppwinrt/winrt/react.uwp.h | haseeAmarathunga/react-native-windows | b33ea7f0c1977bb089d995c37e41e88d1e770919 | [
"MIT"
] | null | null | null | // WARNING: Please don't edit this file. It was generated by C++/WinRT
// v1.0.190111.3
#pragma once
#include "winrt/base.h"
static_assert(
winrt::check_version(CPPWINRT_VERSION, "1.0.190111.3"),
"Mismatched component and base headers.");
#include "winrt/Windows.Foundation.Collections.h"
#include "winrt/Windows.Foundation.h"
#include "winrt/impl/Windows.UI.Composition.2.h"
#include "winrt/impl/Windows.UI.Xaml.2.h"
#include "winrt/impl/Windows.UI.Xaml.Automation.2.h"
#include "winrt/impl/Windows.UI.Xaml.Automation.Peers.2.h"
#include "winrt/impl/Windows.UI.Xaml.Automation.Provider.2.h"
#include "winrt/impl/Windows.UI.Xaml.Controls.2.h"
#include "winrt/impl/Windows.UI.Xaml.Media.2.h"
#include "winrt/impl/react.uwp.2.h"
namespace winrt::impl {
template <typename D>
react::uwp::DynamicAutomationPeer
consume_react_uwp_IDynamicAutomationPeerFactory<D>::CreateInstance(
Windows::UI::Xaml::FrameworkElement const &owner) const {
react::uwp::DynamicAutomationPeer value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPeerFactory)
->CreateInstance(get_abi(owner), put_abi(value)));
return value;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityRoleProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityRoleProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityRole(
Windows::UI::Xaml::UIElement const &element,
react::uwp::AccessibilityRoles const &value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityRole(get_abi(element), get_abi(value)));
}
template <typename D>
react::uwp::AccessibilityRoles
consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::GetAccessibilityRole(
Windows::UI::Xaml::UIElement const &element) const {
react::uwp::AccessibilityRoles result{};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityRole(get_abi(element), put_abi(result)));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateSelectedProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateSelectedProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateSelected(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateSelected(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateSelected(Windows::UI::Xaml::UIElement const
&element) const {
bool result{};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateSelected(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateDisabledProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateDisabledProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateDisabled(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateDisabled(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateDisabled(Windows::UI::Xaml::UIElement const
&element) const {
bool result{};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateDisabled(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateCheckedProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateCheckedProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateChecked(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateChecked(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateChecked(Windows::UI::Xaml::UIElement const
&element) const {
bool result{};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateChecked(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateUncheckedProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateUncheckedProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateUnchecked(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateUnchecked(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateUnchecked(Windows::UI::Xaml::UIElement const
&element) const {
bool result{};
check_hresult(
WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateUnchecked(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateBusyProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateBusyProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateBusy(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateBusy(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateBusy(Windows::UI::Xaml::UIElement const &element)
const {
bool result{};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateBusy(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateExpandedProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateExpandedProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateExpanded(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateExpanded(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateExpanded(Windows::UI::Xaml::UIElement const
&element) const {
bool result{};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateExpanded(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityStateCollapsedProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityStateCollapsedProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityStateCollapsed(
Windows::UI::Xaml::UIElement const &element,
bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityStateCollapsed(get_abi(element), value));
}
template <typename D>
bool consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityStateCollapsed(Windows::UI::Xaml::UIElement const
&element) const {
bool result{};
check_hresult(
WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityStateCollapsed(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::AccessibilityInvokeEventHandlerProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(
WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->get_AccessibilityInvokeEventHandlerProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IDynamicAutomationPropertiesStatics<D>::
SetAccessibilityInvokeEventHandler(
Windows::UI::Xaml::UIElement const &element,
react::uwp::AccessibilityInvokeEventHandler const &value) const {
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->SetAccessibilityInvokeEventHandler(
get_abi(element), get_abi(value)));
}
template <typename D>
react::uwp::AccessibilityInvokeEventHandler
consume_react_uwp_IDynamicAutomationPropertiesStatics<
D>::GetAccessibilityInvokeEventHandler(Windows::UI::Xaml::UIElement const
&element) const {
react::uwp::AccessibilityInvokeEventHandler result{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IDynamicAutomationPropertiesStatics)
->GetAccessibilityInvokeEventHandler(
get_abi(element), put_abi(result)));
return result;
}
template <typename D>
react::uwp::ViewPanel consume_react_uwp_IViewControl<D>::GetPanel() const {
react::uwp::ViewPanel result{nullptr};
check_hresult(
WINRT_SHIM(react::uwp::IViewControl)->GetPanel(put_abi(result)));
return result;
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::InsertAt(
uint32_t index,
Windows::UI::Xaml::UIElement const &value) const {
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->InsertAt(index, get_abi(value)));
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::RemoveAt(uint32_t index) const {
check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->RemoveAt(index));
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::Clear() const {
check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->Clear());
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::FinalizeProperties() const {
check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->FinalizeProperties());
}
template <typename D>
Windows::UI::Xaml::Controls::Border
consume_react_uwp_IViewPanel<D>::GetOuterBorder() const {
Windows::UI::Xaml::Controls::Border result{nullptr};
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->GetOuterBorder(put_abi(result)));
return result;
}
template <typename D>
Windows::UI::Xaml::Media::Brush
consume_react_uwp_IViewPanel<D>::ViewBackground() const {
Windows::UI::Xaml::Media::Brush value{nullptr};
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->get_ViewBackground(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::ViewBackground(
Windows::UI::Xaml::Media::Brush const &value) const {
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->put_ViewBackground(get_abi(value)));
}
template <typename D>
Windows::UI::Xaml::Thickness consume_react_uwp_IViewPanel<D>::BorderThickness()
const {
Windows::UI::Xaml::Thickness value{};
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->get_BorderThickness(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::BorderThickness(
Windows::UI::Xaml::Thickness const &value) const {
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->put_BorderThickness(get_abi(value)));
}
template <typename D>
Windows::UI::Xaml::Media::Brush consume_react_uwp_IViewPanel<D>::BorderBrush()
const {
Windows::UI::Xaml::Media::Brush value{nullptr};
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->get_BorderBrush(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::BorderBrush(
Windows::UI::Xaml::Media::Brush const &value) const {
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->put_BorderBrush(get_abi(value)));
}
template <typename D>
Windows::UI::Xaml::CornerRadius consume_react_uwp_IViewPanel<D>::CornerRadius()
const {
Windows::UI::Xaml::CornerRadius value{};
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->get_CornerRadius(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::CornerRadius(
Windows::UI::Xaml::CornerRadius const &value) const {
check_hresult(
WINRT_SHIM(react::uwp::IViewPanel)->put_CornerRadius(get_abi(value)));
}
template <typename D>
bool consume_react_uwp_IViewPanel<D>::ClipChildren() const {
bool value{};
check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->get_ClipChildren(&value));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanel<D>::ClipChildren(bool value) const {
check_hresult(WINRT_SHIM(react::uwp::IViewPanel)->put_ClipChildren(value));
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::ViewBackgroundProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_ViewBackgroundProperty(put_abi(value)));
return value;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::BorderThicknessProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_BorderThicknessProperty(put_abi(value)));
return value;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::BorderBrushProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_BorderBrushProperty(put_abi(value)));
return value;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::CornerRadiusProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_CornerRadiusProperty(put_abi(value)));
return value;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::ClipChildrenProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_ClipChildrenProperty(put_abi(value)));
return value;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::TopProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_TopProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanelStatics<D>::SetTop(
Windows::UI::Xaml::UIElement const &element,
double value) const {
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->SetTop(get_abi(element), value));
}
template <typename D>
double consume_react_uwp_IViewPanelStatics<D>::GetTop(
Windows::UI::Xaml::UIElement const &element) const {
double result{};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->GetTop(get_abi(element), &result));
return result;
}
template <typename D>
Windows::UI::Xaml::DependencyProperty
consume_react_uwp_IViewPanelStatics<D>::LeftProperty() const {
Windows::UI::Xaml::DependencyProperty value{nullptr};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->get_LeftProperty(put_abi(value)));
return value;
}
template <typename D>
void consume_react_uwp_IViewPanelStatics<D>::SetLeft(
Windows::UI::Xaml::UIElement const &element,
double value) const {
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->SetLeft(get_abi(element), value));
}
template <typename D>
double consume_react_uwp_IViewPanelStatics<D>::GetLeft(
Windows::UI::Xaml::UIElement const &element) const {
double result{};
check_hresult(WINRT_SHIM(react::uwp::IViewPanelStatics)
->GetLeft(get_abi(element), &result));
return result;
}
template <>
struct delegate<react::uwp::AccessibilityInvokeEventHandler> {
template <typename H>
struct type
: implements_delegate<react::uwp::AccessibilityInvokeEventHandler, H> {
type(H &&handler)
: implements_delegate<react::uwp::AccessibilityInvokeEventHandler, H>(
std::forward<H>(handler)) {}
int32_t WINRT_CALL Invoke() noexcept final {
try {
(*this)();
return 0;
} catch (...) {
return to_hresult();
}
}
};
};
template <typename D>
struct produce<D, react::uwp::IDynamicAutomationPeer>
: produce_base<D, react::uwp::IDynamicAutomationPeer> {};
template <typename D>
struct produce<D, react::uwp::IDynamicAutomationPeerFactory>
: produce_base<D, react::uwp::IDynamicAutomationPeerFactory> {
int32_t WINRT_CALL CreateInstance(void *owner, void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
CreateInstance,
WINRT_WRAP(react::uwp::DynamicAutomationPeer),
Windows::UI::Xaml::FrameworkElement const &);
*value = detach_from<react::uwp::DynamicAutomationPeer>(
this->shim().CreateInstance(
*reinterpret_cast<Windows::UI::Xaml::FrameworkElement const *>(
&owner)));
return 0;
} catch (...) {
return to_hresult();
}
}
};
template <typename D>
struct produce<D, react::uwp::IDynamicAutomationProperties>
: produce_base<D, react::uwp::IDynamicAutomationProperties> {};
template <typename D>
struct produce<D, react::uwp::IDynamicAutomationPropertiesStatics>
: produce_base<D, react::uwp::IDynamicAutomationPropertiesStatics> {
int32_t WINRT_CALL
get_AccessibilityRoleProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityRoleProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityRoleProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL SetAccessibilityRole(
void *element,
react::uwp::AccessibilityRoles value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityRole,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
react::uwp::AccessibilityRoles const &);
this->shim().SetAccessibilityRole(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
*reinterpret_cast<react::uwp::AccessibilityRoles const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL GetAccessibilityRole(
void *element,
react::uwp::AccessibilityRoles *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityRole,
WINRT_WRAP(react::uwp::AccessibilityRoles),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<react::uwp::AccessibilityRoles>(
this->shim().GetAccessibilityRole(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(
&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateSelectedProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateSelectedProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateSelectedProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateSelected(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateSelected,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateSelected(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateSelected(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateSelected,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateSelected(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateDisabledProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateDisabledProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateDisabledProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateDisabled(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateDisabled,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateDisabled(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateDisabled(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateDisabled,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateDisabled(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateCheckedProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateCheckedProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateCheckedProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateChecked(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateChecked,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateChecked(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateChecked(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateChecked,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateChecked(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateUncheckedProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateUncheckedProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateUncheckedProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateUnchecked(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateUnchecked,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateUnchecked(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateUnchecked(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateUnchecked,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateUnchecked(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateBusyProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateBusyProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateBusyProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateBusy(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateBusy,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateBusy(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateBusy(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateBusy,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateBusy(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateExpandedProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateExpandedProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateExpandedProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateExpanded(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateExpanded,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateExpanded(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateExpanded(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateExpanded,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateExpanded(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityStateCollapsedProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityStateCollapsedProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityStateCollapsedProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
SetAccessibilityStateCollapsed(void *element, bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityStateCollapsed,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
bool);
this->shim().SetAccessibilityStateCollapsed(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
GetAccessibilityStateCollapsed(void *element, bool *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityStateCollapsed,
WINRT_WRAP(bool),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<bool>(this->shim().GetAccessibilityStateCollapsed(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL
get_AccessibilityInvokeEventHandlerProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
AccessibilityInvokeEventHandlerProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().AccessibilityInvokeEventHandlerProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL SetAccessibilityInvokeEventHandler(
void *element,
void *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetAccessibilityInvokeEventHandler,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
react::uwp::AccessibilityInvokeEventHandler const &);
this->shim().SetAccessibilityInvokeEventHandler(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
*reinterpret_cast<
react::uwp::AccessibilityInvokeEventHandler const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL GetAccessibilityInvokeEventHandler(
void *element,
void **result) noexcept final {
try {
*result = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetAccessibilityInvokeEventHandler,
WINRT_WRAP(react::uwp::AccessibilityInvokeEventHandler),
Windows::UI::Xaml::UIElement const &);
*result = detach_from<react::uwp::AccessibilityInvokeEventHandler>(
this->shim().GetAccessibilityInvokeEventHandler(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(
&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
};
template <typename D>
struct produce<D, react::uwp::IViewControl>
: produce_base<D, react::uwp::IViewControl> {
int32_t WINRT_CALL GetPanel(void **result) noexcept final {
try {
*result = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(GetPanel, WINRT_WRAP(react::uwp::ViewPanel));
*result = detach_from<react::uwp::ViewPanel>(this->shim().GetPanel());
return 0;
} catch (...) {
return to_hresult();
}
}
};
template <typename D>
struct produce<D, react::uwp::IViewPanel>
: produce_base<D, react::uwp::IViewPanel> {
int32_t WINRT_CALL InsertAt(uint32_t index, void *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
InsertAt,
WINRT_WRAP(void),
uint32_t,
Windows::UI::Xaml::UIElement const &);
this->shim().InsertAt(
index,
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL RemoveAt(uint32_t index) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(RemoveAt, WINRT_WRAP(void), uint32_t);
this->shim().RemoveAt(index);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL Clear() noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(Clear, WINRT_WRAP(void));
this->shim().Clear();
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL FinalizeProperties() noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(FinalizeProperties, WINRT_WRAP(void));
this->shim().FinalizeProperties();
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL GetOuterBorder(void **result) noexcept final {
try {
*result = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetOuterBorder, WINRT_WRAP(Windows::UI::Xaml::Controls::Border));
*result = detach_from<Windows::UI::Xaml::Controls::Border>(
this->shim().GetOuterBorder());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_ViewBackground(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
ViewBackground, WINRT_WRAP(Windows::UI::Xaml::Media::Brush));
*value = detach_from<Windows::UI::Xaml::Media::Brush>(
this->shim().ViewBackground());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL put_ViewBackground(void *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
ViewBackground,
WINRT_WRAP(void),
Windows::UI::Xaml::Media::Brush const &);
this->shim().ViewBackground(
*reinterpret_cast<Windows::UI::Xaml::Media::Brush const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_BorderThickness(
struct struct_Windows_UI_Xaml_Thickness *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
BorderThickness, WINRT_WRAP(Windows::UI::Xaml::Thickness));
*value = detach_from<Windows::UI::Xaml::Thickness>(
this->shim().BorderThickness());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL put_BorderThickness(
struct struct_Windows_UI_Xaml_Thickness value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
BorderThickness,
WINRT_WRAP(void),
Windows::UI::Xaml::Thickness const &);
this->shim().BorderThickness(
*reinterpret_cast<Windows::UI::Xaml::Thickness const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_BorderBrush(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
BorderBrush, WINRT_WRAP(Windows::UI::Xaml::Media::Brush));
*value = detach_from<Windows::UI::Xaml::Media::Brush>(
this->shim().BorderBrush());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL put_BorderBrush(void *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
BorderBrush,
WINRT_WRAP(void),
Windows::UI::Xaml::Media::Brush const &);
this->shim().BorderBrush(
*reinterpret_cast<Windows::UI::Xaml::Media::Brush const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_CornerRadius(
struct struct_Windows_UI_Xaml_CornerRadius *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
CornerRadius, WINRT_WRAP(Windows::UI::Xaml::CornerRadius));
*value = detach_from<Windows::UI::Xaml::CornerRadius>(
this->shim().CornerRadius());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL put_CornerRadius(
struct struct_Windows_UI_Xaml_CornerRadius value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
CornerRadius,
WINRT_WRAP(void),
Windows::UI::Xaml::CornerRadius const &);
this->shim().CornerRadius(
*reinterpret_cast<Windows::UI::Xaml::CornerRadius const *>(&value));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_ClipChildren(bool *value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(ClipChildren, WINRT_WRAP(bool));
*value = detach_from<bool>(this->shim().ClipChildren());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL put_ClipChildren(bool value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(ClipChildren, WINRT_WRAP(void), bool);
this->shim().ClipChildren(value);
return 0;
} catch (...) {
return to_hresult();
}
}
};
template <typename D>
struct produce<D, react::uwp::IViewPanelStatics>
: produce_base<D, react::uwp::IViewPanelStatics> {
int32_t WINRT_CALL get_ViewBackgroundProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
ViewBackgroundProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().ViewBackgroundProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_BorderThicknessProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
BorderThicknessProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().BorderThicknessProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_BorderBrushProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
BorderBrushProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().BorderBrushProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_CornerRadiusProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
CornerRadiusProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().CornerRadiusProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_ClipChildrenProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
ClipChildrenProperty,
WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().ClipChildrenProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_TopProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
TopProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().TopProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL SetTop(void *element, double value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetTop,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
double);
this->shim().SetTop(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL GetTop(void *element, double *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetTop, WINRT_WRAP(double), Windows::UI::Xaml::UIElement const &);
*result = detach_from<double>(this->shim().GetTop(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL get_LeftProperty(void **value) noexcept final {
try {
*value = nullptr;
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
LeftProperty, WINRT_WRAP(Windows::UI::Xaml::DependencyProperty));
*value = detach_from<Windows::UI::Xaml::DependencyProperty>(
this->shim().LeftProperty());
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL SetLeft(void *element, double value) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
SetLeft,
WINRT_WRAP(void),
Windows::UI::Xaml::UIElement const &,
double);
this->shim().SetLeft(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element),
value);
return 0;
} catch (...) {
return to_hresult();
}
}
int32_t WINRT_CALL GetLeft(void *element, double *result) noexcept final {
try {
typename D::abi_guard guard(this->shim());
WINRT_ASSERT_DECLARATION(
GetLeft, WINRT_WRAP(double), Windows::UI::Xaml::UIElement const &);
*result = detach_from<double>(this->shim().GetLeft(
*reinterpret_cast<Windows::UI::Xaml::UIElement const *>(&element)));
return 0;
} catch (...) {
return to_hresult();
}
}
};
} // namespace winrt::impl
WINRT_EXPORT namespace winrt::react::uwp {
inline DynamicAutomationPeer::DynamicAutomationPeer(
Windows::UI::Xaml::FrameworkElement const &owner)
: DynamicAutomationPeer(impl::call_factory<
DynamicAutomationPeer,
react::uwp::IDynamicAutomationPeerFactory>(
[&](auto &&f) { return f.CreateInstance(owner); })) {}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityRoleProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityRoleProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityRole(
Windows::UI::Xaml::UIElement const &element,
react::uwp::AccessibilityRoles const &value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.SetAccessibilityRole(element, value); });
}
inline react::uwp::AccessibilityRoles
DynamicAutomationProperties::GetAccessibilityRole(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityRole(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateSelectedProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateSelectedProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateSelected(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityStateSelected(element, value);
});
}
inline bool DynamicAutomationProperties::GetAccessibilityStateSelected(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateSelected(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateDisabledProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateDisabledProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateDisabled(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityStateDisabled(element, value);
});
}
inline bool DynamicAutomationProperties::GetAccessibilityStateDisabled(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateDisabled(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateCheckedProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateCheckedProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateChecked(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityStateChecked(element, value);
});
}
inline bool DynamicAutomationProperties::GetAccessibilityStateChecked(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateChecked(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateUncheckedProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateUncheckedProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateUnchecked(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityStateUnchecked(element, value);
});
}
inline bool DynamicAutomationProperties::GetAccessibilityStateUnchecked(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateUnchecked(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateBusyProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateBusyProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateBusy(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.SetAccessibilityStateBusy(element, value); });
}
inline bool DynamicAutomationProperties::GetAccessibilityStateBusy(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateBusy(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateExpandedProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateExpandedProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateExpanded(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityStateExpanded(element, value);
});
}
inline bool DynamicAutomationProperties::GetAccessibilityStateExpanded(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateExpanded(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityStateCollapsedProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityStateCollapsedProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityStateCollapsed(
Windows::UI::Xaml::UIElement const &element, bool value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityStateCollapsed(element, value);
});
}
inline bool DynamicAutomationProperties::GetAccessibilityStateCollapsed(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.GetAccessibilityStateCollapsed(element); });
}
inline Windows::UI::Xaml::DependencyProperty
DynamicAutomationProperties::AccessibilityInvokeEventHandlerProperty() {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>(
[&](auto &&f) { return f.AccessibilityInvokeEventHandlerProperty(); });
}
inline void DynamicAutomationProperties::SetAccessibilityInvokeEventHandler(
Windows::UI::Xaml::UIElement const &element,
react::uwp::AccessibilityInvokeEventHandler const &value) {
impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.SetAccessibilityInvokeEventHandler(element, value);
});
}
inline react::uwp::AccessibilityInvokeEventHandler
DynamicAutomationProperties::GetAccessibilityInvokeEventHandler(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<
DynamicAutomationProperties,
react::uwp::IDynamicAutomationPropertiesStatics>([&](auto &&f) {
return f.GetAccessibilityInvokeEventHandler(element);
});
}
inline ViewControl::ViewControl()
: ViewControl(impl::call_factory<ViewControl>([](auto &&f) {
return f.template ActivateInstance<ViewControl>();
})) {}
inline ViewPanel::ViewPanel()
: ViewPanel(impl::call_factory<ViewPanel>([](auto &&f) {
return f.template ActivateInstance<ViewPanel>();
})) {}
inline Windows::UI::Xaml::DependencyProperty
ViewPanel::ViewBackgroundProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.ViewBackgroundProperty(); });
}
inline Windows::UI::Xaml::DependencyProperty
ViewPanel::BorderThicknessProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.BorderThicknessProperty(); });
}
inline Windows::UI::Xaml::DependencyProperty
ViewPanel::BorderBrushProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.BorderBrushProperty(); });
}
inline Windows::UI::Xaml::DependencyProperty
ViewPanel::CornerRadiusProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.CornerRadiusProperty(); });
}
inline Windows::UI::Xaml::DependencyProperty
ViewPanel::ClipChildrenProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.ClipChildrenProperty(); });
}
inline Windows::UI::Xaml::DependencyProperty ViewPanel::TopProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.TopProperty(); });
}
inline void ViewPanel::SetTop(
Windows::UI::Xaml::UIElement const &element, double value) {
impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.SetTop(element, value); });
}
inline double ViewPanel::GetTop(Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.GetTop(element); });
}
inline Windows::UI::Xaml::DependencyProperty ViewPanel::LeftProperty() {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.LeftProperty(); });
}
inline void ViewPanel::SetLeft(
Windows::UI::Xaml::UIElement const &element, double value) {
impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.SetLeft(element, value); });
}
inline double ViewPanel::GetLeft(
Windows::UI::Xaml::UIElement const &element) {
return impl::call_factory<ViewPanel, react::uwp::IViewPanelStatics>(
[&](auto &&f) { return f.GetLeft(element); });
}
template <typename L>
AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(L handler)
: AccessibilityInvokeEventHandler(
impl::make_delegate<AccessibilityInvokeEventHandler>(
std::forward<L>(handler))) {}
template <typename F>
AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(F * handler)
: AccessibilityInvokeEventHandler(
[=](auto &&... args) { return handler(args...); }) {}
template <typename O, typename M>
AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(
O * object, M method)
: AccessibilityInvokeEventHandler(
[=](auto &&... args) { return ((*object).*(method))(args...); }) {}
template <typename O, typename M>
AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(
com_ptr<O> && object, M method)
: AccessibilityInvokeEventHandler(
[o = std::move(object), method](auto &&... args) {
return ((*o).*(method))(args...);
}) {}
template <typename O, typename M>
AccessibilityInvokeEventHandler::AccessibilityInvokeEventHandler(
weak_ref<O> && object, M method)
: AccessibilityInvokeEventHandler(
[o = std::move(object), method](auto &&... args) {
if (auto s = o.get()) {
((*s).*(method))(args...);
}
}) {}
inline void AccessibilityInvokeEventHandler::operator()() const {
check_hresult(
(*(impl::abi_t<AccessibilityInvokeEventHandler> **)this)->Invoke());
}
}
namespace winrt::impl {
struct property_react_uwp_IDynamicAutomationPropertiesStatics {
struct named {
struct AccessibilityInvokeEventHandlerProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityInvokeEventHandlerProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityInvokeEventHandlerProperty();
}
};
};
struct AccessibilityRoleProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityRoleProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityRoleProperty();
}
};
};
struct AccessibilityStateBusyProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateBusyProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateBusyProperty();
}
};
};
struct AccessibilityStateCheckedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateCheckedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateCheckedProperty();
}
};
};
struct AccessibilityStateCollapsedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateCollapsedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateCollapsedProperty();
}
};
};
struct AccessibilityStateDisabledProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateDisabledProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateDisabledProperty();
}
};
};
struct AccessibilityStateExpandedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateExpandedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateExpandedProperty();
}
};
};
struct AccessibilityStateSelectedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateSelectedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateSelectedProperty();
}
};
};
struct AccessibilityStateUncheckedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateUncheckedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type =
winrt::react::uwp::IDynamicAutomationPropertiesStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.AccessibilityStateUncheckedProperty();
}
};
};
};
struct list {
using type = impl::typelist<
named::AccessibilityInvokeEventHandlerProperty,
named::AccessibilityRoleProperty,
named::AccessibilityStateBusyProperty,
named::AccessibilityStateCheckedProperty,
named::AccessibilityStateCollapsedProperty,
named::AccessibilityStateDisabledProperty,
named::AccessibilityStateExpandedProperty,
named::AccessibilityStateSelectedProperty,
named::AccessibilityStateUncheckedProperty>;
};
};
struct property_react_uwp_IViewPanel {
struct named {
struct BorderBrush {
struct name {
static constexpr std::wstring_view value{L"BorderBrush"sv};
};
using property_type = winrt::Windows::UI::Xaml::Media::Brush;
using target_type = winrt::react::uwp::IViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.BorderBrush();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.BorderBrush(std::forward<Value>(value));
}
};
};
struct BorderThickness {
struct name {
static constexpr std::wstring_view value{L"BorderThickness"sv};
};
using property_type = winrt::Windows::UI::Xaml::Thickness;
using target_type = winrt::react::uwp::IViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.BorderThickness();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.BorderThickness(std::forward<Value>(value));
}
};
};
struct ClipChildren {
struct name {
static constexpr std::wstring_view value{L"ClipChildren"sv};
};
using property_type = bool;
using target_type = winrt::react::uwp::IViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ClipChildren();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.ClipChildren(std::forward<Value>(value));
}
};
};
struct CornerRadius {
struct name {
static constexpr std::wstring_view value{L"CornerRadius"sv};
};
using property_type = winrt::Windows::UI::Xaml::CornerRadius;
using target_type = winrt::react::uwp::IViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.CornerRadius();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.CornerRadius(std::forward<Value>(value));
}
};
};
struct ViewBackground {
struct name {
static constexpr std::wstring_view value{L"ViewBackground"sv};
};
using property_type = winrt::Windows::UI::Xaml::Media::Brush;
using target_type = winrt::react::uwp::IViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ViewBackground();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.ViewBackground(std::forward<Value>(value));
}
};
};
};
struct list {
using type = impl::typelist<
named::BorderBrush,
named::BorderThickness,
named::ClipChildren,
named::CornerRadius,
named::ViewBackground>;
};
};
struct property_react_uwp_IViewPanelStatics {
struct named {
struct BorderBrushProperty {
struct name {
static constexpr std::wstring_view value{L"BorderBrushProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.BorderBrushProperty();
}
};
};
struct BorderThicknessProperty {
struct name {
static constexpr std::wstring_view value{L"BorderThicknessProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.BorderThicknessProperty();
}
};
};
struct ClipChildrenProperty {
struct name {
static constexpr std::wstring_view value{L"ClipChildrenProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ClipChildrenProperty();
}
};
};
struct CornerRadiusProperty {
struct name {
static constexpr std::wstring_view value{L"CornerRadiusProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.CornerRadiusProperty();
}
};
};
struct LeftProperty {
struct name {
static constexpr std::wstring_view value{L"LeftProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.LeftProperty();
}
};
};
struct TopProperty {
struct name {
static constexpr std::wstring_view value{L"TopProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.TopProperty();
}
};
};
struct ViewBackgroundProperty {
struct name {
static constexpr std::wstring_view value{L"ViewBackgroundProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::IViewPanelStatics;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ViewBackgroundProperty();
}
};
};
};
struct list {
using type = impl::typelist<
named::BorderBrushProperty,
named::BorderThicknessProperty,
named::ClipChildrenProperty,
named::CornerRadiusProperty,
named::LeftProperty,
named::TopProperty,
named::ViewBackgroundProperty>;
};
};
struct property_react_uwp_DynamicAutomationPeer {
struct named {
struct IsSelected {
struct name {
static constexpr std::wstring_view value{L"IsSelected"sv};
};
using property_type = bool;
using target_type = winrt::react::uwp::DynamicAutomationPeer;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.IsSelected();
}
};
};
struct SelectionContainer {
struct name {
static constexpr std::wstring_view value{L"SelectionContainer"sv};
};
using property_type = winrt::Windows::UI::Xaml::Automation::Provider::
IRawElementProviderSimple;
using target_type = winrt::react::uwp::DynamicAutomationPeer;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.SelectionContainer();
}
};
};
struct CanSelectMultiple {
struct name {
static constexpr std::wstring_view value{L"CanSelectMultiple"sv};
};
using property_type = bool;
using target_type = winrt::react::uwp::DynamicAutomationPeer;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.CanSelectMultiple();
}
};
};
struct IsSelectionRequired {
struct name {
static constexpr std::wstring_view value{L"IsSelectionRequired"sv};
};
using property_type = bool;
using target_type = winrt::react::uwp::DynamicAutomationPeer;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.IsSelectionRequired();
}
};
};
struct ToggleState {
struct name {
static constexpr std::wstring_view value{L"ToggleState"sv};
};
using property_type = winrt::Windows::UI::Xaml::Automation::ToggleState;
using target_type = winrt::react::uwp::DynamicAutomationPeer;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ToggleState();
}
};
};
};
struct list {
using type = impl::typelist<
named::IsSelected,
named::SelectionContainer,
named::CanSelectMultiple,
named::IsSelectionRequired,
named::ToggleState>;
};
};
struct property_react_uwp_DynamicAutomationProperties {
struct named {
struct AccessibilityInvokeEventHandlerProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityInvokeEventHandlerProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityInvokeEventHandlerProperty();
}
};
};
struct AccessibilityRoleProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityRoleProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityRoleProperty();
}
};
};
struct AccessibilityStateBusyProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateBusyProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateBusyProperty();
}
};
};
struct AccessibilityStateCheckedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateCheckedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateCheckedProperty();
}
};
};
struct AccessibilityStateCollapsedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateCollapsedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateCollapsedProperty();
}
};
};
struct AccessibilityStateDisabledProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateDisabledProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateDisabledProperty();
}
};
};
struct AccessibilityStateExpandedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateExpandedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateExpandedProperty();
}
};
};
struct AccessibilityStateSelectedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateSelectedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateSelectedProperty();
}
};
};
struct AccessibilityStateUncheckedProperty {
struct name {
static constexpr std::wstring_view value{
L"AccessibilityStateUncheckedProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::DynamicAutomationProperties;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::AccessibilityStateUncheckedProperty();
}
};
};
};
struct list {
using type = impl::typelist<
named::AccessibilityInvokeEventHandlerProperty,
named::AccessibilityRoleProperty,
named::AccessibilityStateBusyProperty,
named::AccessibilityStateCheckedProperty,
named::AccessibilityStateCollapsedProperty,
named::AccessibilityStateDisabledProperty,
named::AccessibilityStateExpandedProperty,
named::AccessibilityStateSelectedProperty,
named::AccessibilityStateUncheckedProperty>;
};
};
struct property_react_uwp_ViewPanel {
struct named {
struct ViewBackground {
struct name {
static constexpr std::wstring_view value{L"ViewBackground"sv};
};
using property_type = winrt::Windows::UI::Xaml::Media::Brush;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ViewBackground();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.ViewBackground(std::forward<Value>(value));
}
};
};
struct CornerRadius {
struct name {
static constexpr std::wstring_view value{L"CornerRadius"sv};
};
using property_type = winrt::Windows::UI::Xaml::CornerRadius;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.CornerRadius();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.CornerRadius(std::forward<Value>(value));
}
};
};
struct ClipChildren {
struct name {
static constexpr std::wstring_view value{L"ClipChildren"sv};
};
using property_type = bool;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.ClipChildren();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.ClipChildren(std::forward<Value>(value));
}
};
};
struct BorderThickness {
struct name {
static constexpr std::wstring_view value{L"BorderThickness"sv};
};
using property_type = winrt::Windows::UI::Xaml::Thickness;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.BorderThickness();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.BorderThickness(std::forward<Value>(value));
}
};
};
struct BorderBrush {
struct name {
static constexpr std::wstring_view value{L"BorderBrush"sv};
};
using property_type = winrt::Windows::UI::Xaml::Media::Brush;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::true_type;
using is_static = std::false_type;
struct getter {
auto operator()(target_type const &target) const {
return target.BorderBrush();
}
};
struct setter {
template <typename Value>
void operator()(target_type const &target, Value &&value) const {
target.BorderBrush(std::forward<Value>(value));
}
};
};
struct BorderBrushProperty {
struct name {
static constexpr std::wstring_view value{L"BorderBrushProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::BorderBrushProperty();
}
};
};
struct BorderThicknessProperty {
struct name {
static constexpr std::wstring_view value{L"BorderThicknessProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::BorderThicknessProperty();
}
};
};
struct ClipChildrenProperty {
struct name {
static constexpr std::wstring_view value{L"ClipChildrenProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::ClipChildrenProperty();
}
};
};
struct CornerRadiusProperty {
struct name {
static constexpr std::wstring_view value{L"CornerRadiusProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::CornerRadiusProperty();
}
};
};
struct LeftProperty {
struct name {
static constexpr std::wstring_view value{L"LeftProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::LeftProperty();
}
};
};
struct TopProperty {
struct name {
static constexpr std::wstring_view value{L"TopProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::TopProperty();
}
};
};
struct ViewBackgroundProperty {
struct name {
static constexpr std::wstring_view value{L"ViewBackgroundProperty"sv};
};
using property_type = winrt::Windows::UI::Xaml::DependencyProperty;
using target_type = winrt::react::uwp::ViewPanel;
using is_readable = std::true_type;
using is_writable = std::false_type;
using is_static = std::true_type;
struct getter {
auto operator()() const {
return target_type::ViewBackgroundProperty();
}
};
};
};
struct list {
using type = impl::typelist<
named::ViewBackground,
named::CornerRadius,
named::ClipChildren,
named::BorderThickness,
named::BorderBrush,
named::BorderBrushProperty,
named::BorderThicknessProperty,
named::ClipChildrenProperty,
named::CornerRadiusProperty,
named::LeftProperty,
named::TopProperty,
named::ViewBackgroundProperty>;
};
};
} // namespace winrt::impl
WINRT_EXPORT namespace winrt::experimental::reflect {
template <>
struct named_property<react::uwp::IDynamicAutomationPropertiesStatics>
: impl::property_react_uwp_IDynamicAutomationPropertiesStatics::named {};
template <>
struct properties<react::uwp::IDynamicAutomationPropertiesStatics>
: impl::property_react_uwp_IDynamicAutomationPropertiesStatics::list {};
template <>
struct named_property<react::uwp::IViewPanel>
: impl::property_react_uwp_IViewPanel::named {};
template <>
struct properties<react::uwp::IViewPanel>
: impl::property_react_uwp_IViewPanel::list {};
template <>
struct named_property<react::uwp::IViewPanelStatics>
: impl::property_react_uwp_IViewPanelStatics::named {};
template <>
struct properties<react::uwp::IViewPanelStatics>
: impl::property_react_uwp_IViewPanelStatics::list {};
template <>
struct named_property<react::uwp::DynamicAutomationPeer>
: impl::property_react_uwp_DynamicAutomationPeer::named {};
template <>
struct properties<react::uwp::DynamicAutomationPeer>
: impl::property_react_uwp_DynamicAutomationPeer::list {};
template <>
struct named_property<react::uwp::DynamicAutomationProperties>
: impl::property_react_uwp_DynamicAutomationProperties::named {};
template <>
struct properties<react::uwp::DynamicAutomationProperties>
: impl::property_react_uwp_DynamicAutomationProperties::list {};
template <>
struct named_property<react::uwp::ViewPanel>
: impl::property_react_uwp_ViewPanel::named {};
template <>
struct properties<react::uwp::ViewPanel>
: impl::property_react_uwp_ViewPanel::list {};
template <>
struct base_type<react::uwp::DynamicAutomationPeer> {
using type =
Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer;
};
template <>
struct base_type<react::uwp::ViewControl> {
using type = Windows::UI::Xaml::Controls::ContentControl;
};
template <>
struct base_type<react::uwp::ViewPanel> {
using type = Windows::UI::Xaml::Controls::Panel;
};
template <>
struct get_enumerator_names<react::uwp::AccessibilityRoles> {
static constexpr std::array<std::wstring_view, 29> value{{
{L"None", 4}, {L"Button", 6}, {L"Link", 4},
{L"Search", 6}, {L"Image", 5}, {L"KeyboardKey", 11},
{L"Text", 4}, {L"Adjustable", 10}, {L"ImageButton", 11},
{L"Header", 6}, {L"Summary", 7}, {L"Alert", 5},
{L"CheckBox", 8}, {L"ComboBox", 8}, {L"Menu", 4},
{L"MenuBar", 7}, {L"MenuItem", 8}, {L"ProgressBar", 11},
{L"Radio", 5}, {L"RadioGroup", 10}, {L"ScrollBar", 9},
{L"SpinButton", 10}, {L"Switch", 6}, {L"Tab", 3},
{L"TabList", 7}, {L"Timer", 5}, {L"ToolBar", 7},
{L"Unknown", 7}, {L"CountRoles", 10},
}};
};
template <>
struct get_enumerator_values<react::uwp::AccessibilityRoles> {
static constexpr std::array<react::uwp::AccessibilityRoles, 29> value{{
react::uwp::AccessibilityRoles::None,
react::uwp::AccessibilityRoles::Button,
react::uwp::AccessibilityRoles::Link,
react::uwp::AccessibilityRoles::Search,
react::uwp::AccessibilityRoles::Image,
react::uwp::AccessibilityRoles::KeyboardKey,
react::uwp::AccessibilityRoles::Text,
react::uwp::AccessibilityRoles::Adjustable,
react::uwp::AccessibilityRoles::ImageButton,
react::uwp::AccessibilityRoles::Header,
react::uwp::AccessibilityRoles::Summary,
react::uwp::AccessibilityRoles::Alert,
react::uwp::AccessibilityRoles::CheckBox,
react::uwp::AccessibilityRoles::ComboBox,
react::uwp::AccessibilityRoles::Menu,
react::uwp::AccessibilityRoles::MenuBar,
react::uwp::AccessibilityRoles::MenuItem,
react::uwp::AccessibilityRoles::ProgressBar,
react::uwp::AccessibilityRoles::Radio,
react::uwp::AccessibilityRoles::RadioGroup,
react::uwp::AccessibilityRoles::ScrollBar,
react::uwp::AccessibilityRoles::SpinButton,
react::uwp::AccessibilityRoles::Switch,
react::uwp::AccessibilityRoles::Tab,
react::uwp::AccessibilityRoles::TabList,
react::uwp::AccessibilityRoles::Timer,
react::uwp::AccessibilityRoles::ToolBar,
react::uwp::AccessibilityRoles::Unknown,
react::uwp::AccessibilityRoles::CountRoles,
}};
};
template <>
struct get_enumerator_names<react::uwp::AccessibilityStates> {
static constexpr std::array<std::wstring_view, 8> value{{
{L"Selected", 8},
{L"Disabled", 8},
{L"Checked", 7},
{L"Unchecked", 9},
{L"Busy", 4},
{L"Expanded", 8},
{L"Collapsed", 9},
{L"CountStates", 11},
}};
};
template <>
struct get_enumerator_values<react::uwp::AccessibilityStates> {
static constexpr std::array<react::uwp::AccessibilityStates, 8> value{{
react::uwp::AccessibilityStates::Selected,
react::uwp::AccessibilityStates::Disabled,
react::uwp::AccessibilityStates::Checked,
react::uwp::AccessibilityStates::Unchecked,
react::uwp::AccessibilityStates::Busy,
react::uwp::AccessibilityStates::Expanded,
react::uwp::AccessibilityStates::Collapsed,
react::uwp::AccessibilityStates::CountStates,
}};
};
}
WINRT_EXPORT namespace std {
template <>
struct hash<winrt::react::uwp::IDynamicAutomationPeer>
: winrt::impl::hash_base<winrt::react::uwp::IDynamicAutomationPeer> {};
template <>
struct hash<winrt::react::uwp::IDynamicAutomationPeerFactory>
: winrt::impl::hash_base<
winrt::react::uwp::IDynamicAutomationPeerFactory> {};
template <>
struct hash<winrt::react::uwp::IDynamicAutomationProperties>
: winrt::impl::hash_base<
winrt::react::uwp::IDynamicAutomationProperties> {};
template <>
struct hash<winrt::react::uwp::IDynamicAutomationPropertiesStatics>
: winrt::impl::hash_base<
winrt::react::uwp::IDynamicAutomationPropertiesStatics> {};
template <>
struct hash<winrt::react::uwp::IViewControl>
: winrt::impl::hash_base<winrt::react::uwp::IViewControl> {};
template <>
struct hash<winrt::react::uwp::IViewPanel>
: winrt::impl::hash_base<winrt::react::uwp::IViewPanel> {};
template <>
struct hash<winrt::react::uwp::IViewPanelStatics>
: winrt::impl::hash_base<winrt::react::uwp::IViewPanelStatics> {};
template <>
struct hash<winrt::react::uwp::DynamicAutomationPeer>
: winrt::impl::hash_base<winrt::react::uwp::DynamicAutomationPeer> {};
template <>
struct hash<winrt::react::uwp::DynamicAutomationProperties>
: winrt::impl::hash_base<winrt::react::uwp::DynamicAutomationProperties> {
};
template <>
struct hash<winrt::react::uwp::ViewControl>
: winrt::impl::hash_base<winrt::react::uwp::ViewControl> {};
template <>
struct hash<winrt::react::uwp::ViewPanel>
: winrt::impl::hash_base<winrt::react::uwp::ViewPanel> {};
}
| 35.698644 | 81 | 0.645363 |
c8a397fb805199a17293222e7d1580598df10107 | 1,053 | h | C | System/Library/PrivateFrameworks/MusicLibrary.framework/ML3MigrationMisgroupedAlbum.h | lechium/tvOS10Headers | f0c99993da6cc502d36fdc5cb4ff90d94b12bf67 | [
"MIT"
] | 4 | 2017-03-23T00:01:54.000Z | 2018-08-04T20:16:32.000Z | System/Library/PrivateFrameworks/MusicLibrary.framework/ML3MigrationMisgroupedAlbum.h | lechium/tvOS10Headers | f0c99993da6cc502d36fdc5cb4ff90d94b12bf67 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/MusicLibrary.framework/ML3MigrationMisgroupedAlbum.h | lechium/tvOS10Headers | f0c99993da6cc502d36fdc5cb4ff90d94b12bf67 | [
"MIT"
] | 4 | 2017-05-14T16:23:26.000Z | 2019-12-21T15:07:59.000Z | /*
* This header is generated by classdump-dyld 1.0
* on Wednesday, March 22, 2017 at 9:05:00 AM Mountain Standard Time
* Operating System: Version 10.1 (Build 14U593)
* Image Source: /System/Library/PrivateFrameworks/MusicLibrary.framework/MusicLibrary
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
@class NSMutableArray, NSArray;
@interface ML3MigrationMisgroupedAlbum : NSObject {
NSMutableArray* _misgroupedTracks;
long long _albumPID;
long long _albumArtistPID;
}
@property (nonatomic,readonly) long long albumPID; //@synthesize albumPID=_albumPID - In the implementation block
@property (nonatomic,readonly) long long albumArtistPID; //@synthesize albumArtistPID=_albumArtistPID - In the implementation block
@property (nonatomic,readonly) NSArray * misgroupedTracks;
-(id)initWithAlbumPID:(long long)arg1 albumArtistPID:(long long)arg2 ;
-(void)addMisgroupedTrack:(id)arg1 ;
-(NSArray *)misgroupedTracks;
-(long long)albumArtistPID;
-(long long)albumPID;
@end
| 35.1 | 146 | 0.761633 |
265bdf5f891b49199ff67e8207ea7729141bde0d | 29,709 | h | C | platform/mcu/msp432p4xx/ti/drivers/I2C.h | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 4 | 2019-11-22T04:28:29.000Z | 2021-07-06T10:45:10.000Z | platform/mcu/msp432p4xx/ti/drivers/I2C.h | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 1 | 2019-04-02T10:03:10.000Z | 2019-04-02T10:03:10.000Z | platform/mcu/msp432p4xx/ti/drivers/I2C.h | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 6 | 2019-08-30T09:43:03.000Z | 2021-04-05T04:20:41.000Z | /*
* Copyright (c) 2015-2018, Texas Instruments Incorporated
* 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 Texas Instruments Incorporated 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.
*/
/*!****************************************************************************
* @file I2C.h
* @brief Inter-Intergrated Circuit driver interface.
*
* To use the I2C driver, ensure that the correct driver library for your
* device is linked in and include this header file as follows:
* @code
* #include <ti/drivers/I2C.h>
* @endcode
*
* This module serves as the main interface for applications using an
* underlying I2C peripheral. Its purpose is to redirect the I2C APIs to
* device specific driver implementations which are specified using a pointer
* to a #I2C_FxnTable.
*
* # Overview #
*
* This section assumes that you have prior knowledge about the I2C protocol.
* For the full I2C-bus specification and user manual, view the \b UM10204
* document available online.
*
* This I2C driver is designed to operate as an I2C master. This driver
* does not support I2C slave mode. This driver assumes it is the only I2C
* master on the I2C bus. Using the I2C APIs, you can transmit and recieve
* data over an I2C bus. The I2C-bus specification does not define how data
* is to be formatted or handled. This allows for flexible implementations
* across different peripheral vendors. As a result, this driver only
* performs the exchange of data between the master and slave(s). The
* application is responsible for manipulating and interpretting the data.
*
* # Thread Safety #
*
* This driver has been designed to operate in a Real-Time Operating System
* (RTOS) environment. This driver protects data transactions with operating
* system primitives supplied by the underlying RTOS.
*
* # Usage #
*
* The following code example opens an I2C instance.
*
* @code
* I2C_Handle i2cHandle;
* I2C_Params i2cParams;
*
* i2cHandle = I2C_open(Board_I2C0, NULL);
*
* if (i2cHandle == NULL) {
* // Error opening I2C
* while (1);
* }
* @endcode
*
* ## I2C Driver Configuration ##
*
* In order to use the I2C APIs, the application is required to provide
* device-specific I2C configuration in the Board.c file. The I2C driver
* interface defines a configuration data structure, #I2C_Config.
*
* The application must declare an array of #I2C_Config elements, named
* \p I2C_config[]. Each element of \p I2C_config[] is populated with
* pointers to a device specific I2C driver implementation's function
* table, driver object, and hardware attributes. The hardware attributes
* define properties such as the I2C peripheral's base address and
* pins. Each element in \p I2C_config[] corresponds to an I2C instance,
* and none of the elements should have \p NULL pointers.
*
* The I2C configuration is device dependent. You will need to check the
* device specific I2C driver documentation. There you will find a
* description of the I2C hardware attributes.
*
* ## Initializing the I2C Driver ##
*
* I2C_init() must be called before any other I2C APIs. This function
* calls the device specific implementation's I2C initialization function
* for each element of \p NVS_config[].
*
* ## Opening the I2C Driver ##
*
* After initializing the I2C driver by calling I2C_init(), the application
* can open an I2C instance by calling I2C_open(). This function
* takes an index into the \p I2C_config[] array and an #I2C_Params structure.
* The #I2C_Handle returned from the I2C_open() is then associated with that
* index into the \p I2C_config[] array.
*
* \note Each I2C index can only be opened exclusively. Calling I2C_open()
* multiple times with the same index will result in an error. The index can
* be re-used if I2C_close() is called first.
*
* This example shows opening an I2C driver instance in callback mode
* with a bit rate of 400kbps.
*
* @code
* I2C_Handle i2cHandle;
* I2C_Params i2cParams;
*
* I2C_Params_init(&i2cParams);
*
* i2cParams.transferMode = I2C_MODE_CALLBACK;
* i2cParams.transferCallbackFxn = myCallbackFunction;
* i2cParams.bitRate = I2C_400kHz;
*
* handle = I2C_open(Board_I2C0, &i2cParams);
*
* if (i2cHandle == NULL) {
* // Error opening I2C
* while (1);
* }
* @endcode
*
* ## Transferring data ##
*
* An I2C data transfer is performed using the I2C_transfer() function. Three
* types of transactions are supported: write, read, and write + read. The
* details of each transaction are specified with an #I2C_Transaction
* structure. Each transfer is completed before another transfer is initiated.
*
* For write + read transactions, the specified data is first written to the
* peripheral, then a repeated start is sent by the driver, which initiates
* the read operation. This type of transfer is useful if an I2C peripheral
* has a pointer register that needs to be adjusted prior to reading from
* the referenced data register.
*
* The below example shows sending three bytes of data to a slave peripheral
* at address 0x50, in blocking mode:
*
* @code
* uint8_t writeBuffer[3];
* I2C_Transaction i2cTransaction;
*
* i2cTransaction.slaveAddress = 0x50;
* i2cTransaction.writeBuf = writeBuffer;
* i2cTransaction.writeCount = 3;
* i2cTransaction.readBuf = NULL;
* i2cTransaction.readCount = 0;
*
* status = I2C_transfer(i2cHandle, &i2cTransaction);
*
* if (status == False) {
* // Unsuccessful I2C transfer
* }
* @endcode
*
* The next example shows reading five bytes of data from the I2C
* peripheral, in blocking mode:
*
* @code
* uint8_t readBuffer[5];
* I2C_Transaction i2cTransaction;
*
* i2cTransaction.slaveAddress = 0x50;
* i2cTransaction.writeBuf = NULL;
* i2cTransaction.writeCount = 0;
* i2cTransaction.readBuf = readBuffer;
* i2cTransaction.readCount = 5;
*
* status = I2C_transfer(i2cHandle, &i2cTransaction);
*
* if (status == False) {
* // Unsuccessful I2C transfer
* }
* @endcode
*
* This example shows writing two bytes and reading four bytes in a
* single transaction.
*
* @code
* uint8_t readBuffer[4];
* uint8_t writeBuffer[2];
* I2C_Transaction i2cTransaction;
*
* i2cTransaction.slaveAddress = 0x50;
* i2cTransaction.writeBuf = writeBuffer;
* i2cTransaction.writeCount = 2;
* i2cTransaction.readBuf = readBuffer;
* i2cTransaction.readCount = 4;
*
* status = I2C_transfer(i2cHandle, &i2cTransaction);
*
* if (status == False) {
* // Unsuccessful I2C transfer
* }
* @endcode
*
* This final example shows usage of asynchronous callback mode, with queuing
* of multiple transactions. Because multiple transactions are simultaneously
* queued, separate #I2C_Transaction structures must be used.
*
* \note #I2C_Transaction structures cannot be \b re-used until the previous
* transaction has completed.
*
* First, the callback function specified by #I2C_Params.transferCallbackFxn
* is created. In this example, the #I2C_Transaction will contain a custom
* application argument. This argument will be a semaphore handle. The
* #I2C_Transaction.arg will point to the semaphore handle. When the callback
* function is called, the #I2C_Transaction.arg is checked for \p NULL. If
* this value is not \p NULL, then it can be assumed the \p arg is pointing
* to a valid semaphore handle. The semaphore handle is then used to call
* \p sem_post(). Hypothetically, this can be used to signal transaction
* completion to the task(s) that queued the transaction(s).
*
* @code
* void callbackFxn(I2C_Handle handle, I2C_Transaction *msg, bool transfer)
* {
*
* // Check for a semaphore handle
* if (msg->arg != NULL) {
*
* // Perform a semaphore post
* sem_post((sem_t *) (msg->arg));
* }
* }
* @endcode
*
* Snippets of the task code that initiates the transactions are shown below.
* Note the use of multiple #I2C_Transaction structures. The handle of the
* semaphore to be posted is specified via \p i2cTransaction2.arg.
* I2C_transfer() is called three times to initiate each transaction.
* Since callback mode is used, these functions return immediately. After
* the transactions have been queued, other work can be done. Eventually,
* \p sem_wait() is called causing the task to block until the transaction
* completes. When the transaction completes, the application's callback
* callback function, \p callbackFxn will be called. Once \p callbackFxn
* above posts the semaphore the task will be unblocked and can resume
* execution.
*
* @code
* void taskfxn(arg0, arg1)
* {
*
* I2C_Transaction i2cTransaction0;
* I2C_Transaction i2cTransaction1;
* I2C_Transaction i2cTransaction2;
*
* // ...
*
* i2cTransaction0.arg = NULL;
* i2cTransaction1.arg = NULL;
* i2cTransaction2.arg = semaphoreHandle;
*
* // ...
*
* I2C_transfer(i2c, &i2cTransaction0);
* I2C_transfer(i2c, &i2cTransaction1);
* I2C_transfer(i2c, &i2cTransaction2);
*
* // ...
*
* sem_wait(semaphoreHandle);
* }
* @endcode
*
* # Implementation #
*
* This top-level I2C module serves as the main interface for RTOS
* applications. Its purpose is to redirect the module's APIs to specific
* peripheral implementations which are specified using a pointer to an
* #I2C_FxnTable.
*
* The I2C driver interface module is joined (at link time) to an
* array of #I2C_Config data structures named \p I2C_config.
* \p I2C_config is typically defined in the Board.c file used for the
* application. If there are multiple instances of I2C peripherals on the
* device, there will typically be multiple #I2C_Config structures defined in
* the board file in the form of an array. Each entry in \p I2C_config
* contains a:
* - #I2C_FxnTable pointer to a set of functions that implement an I2C
* peripheral.
* - (\p void *) data object that is associated with the #I2C_FxnTable
* - (\p void *) hardware attributes that are associated to the #I2C_FxnTable
*
*
******************************************************************************
*/
#ifndef ti_drivers_I2C__include
#define ti_drivers_I2C__include
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
/**
* @defgroup I2C_CONTROL I2C_control command and status codes
* These I2C macros are reservations for I2C.h
* @{
*/
/*!
* Common I2C_control command code reservation offset.
* I2C driver implementations should offset command codes with
* #I2C_CMD_RESERVED growing positively
*
* Example implementation specific command codes:
* @code
* #define I2CXYZ_CMD_COMMAND0 I2C_CMD_RESERVED + 0
* #define I2CXYZ_CMD_COMMAND1 I2C_CMD_RESERVED + 1
* @endcode
*/
#define I2C_CMD_RESERVED (32)
/*!
* Common I2C_control status code reservation offset.
* I2C driver implementations should offset status codes with
* #I2C_STATUS_RESERVED growing negatively.
*
* Example implementation specific status codes:
* @code
* #define I2CXYZ_STATUS_ERROR0 I2C_STATUS_RESERVED - 0
* #define I2CXYZ_STATUS_ERROR1 I2C_STATUS_RESERVED - 1
* #define I2CXYZ_STATUS_ERROR2 I2C_STATUS_RESERVED - 2
* @endcode
*/
#define I2C_STATUS_RESERVED (-32)
/**
* @defgroup I2C_STATUS Status Codes
* I2C_STATUS_* macros are general status codes returned by I2C_control()
* @{
* @ingroup I2C_CONTROL
*/
/*!
* @brief Successful status code returned by I2C_control().
*
* I2C_control() returns #I2C_STATUS_SUCCESS if the control code was executed
* successfully.
*/
#define I2C_STATUS_SUCCESS (0)
/*!
* @brief Generic error status code returned by I2C_control().
*
* I2C_control() returns #I2C_STATUS_ERROR if the control code was not executed
* successfully.
*/
#define I2C_STATUS_ERROR (-1)
/*!
* @brief An error status code returned by I2C_control() for undefined
* command codes.
*
* I2C_control() returns #I2C_STATUS_UNDEFINEDCMD if the control code is not
* recognized by the driver implementation.
*/
#define I2C_STATUS_UNDEFINEDCMD (-2)
/** @}*/
/**
* @defgroup I2C_CMD Command Codes
* I2C_CMD_* macros are general command codes for I2C_control(). Not all I2C
* driver implementations support these command codes.
* @{
* @ingroup I2C_CONTROL
*/
/* Add I2C_CMD_<commands> here */
/** @} end I2C commands */
/** @} end I2C_CONTROL group */
/*!
* @brief A handle that is returned from an I2C_open() call.
*/
typedef struct I2C_Config_ *I2C_Handle;
/*!
* @brief This structure defines the I2C slave address, pointers to write
* and read buffers, and their associated byte counts. If no data
* needs to be written, the write byte count should be zero.
* Similarly, if no data needs to be read, the read byte count
* should be set to zero.
*
* @sa I2C_transfer()
*/
typedef struct I2C_Transaction_ {
void *writeBuf; /*!< Pointer to a buffer containing data to be
written. */
size_t writeCount; /*!< Number of bytes to write from the
\p writeBuf. */
void *readBuf; /*!< Pointer to a buffer to store data read. */
size_t readCount; /*!< Number of bytes to be read from the slave */
uint_least8_t slaveAddress; /*!< Address of the I2C slave peripheral. */
void *arg; /*!< Optional application argument. This argument
will be passed to the callback function
specified by #I2C_Params.transferCallbackFxn
when using #I2C_MODE_CALLBACK. */
void *nextPtr; /*!< This value is used internally by the driver
and must never be modified by the
application. */
} I2C_Transaction;
/*!
* @brief This I2C driver supports two transfer modes of operation:
* blocking and callback. The transfer mode is specified using
* the #I2C_Params structure. The transfer mode defines how the
* I2C_transfer() function behaves for a driver instance.
*
* \note Once an I2C driver instance is opened, the transfer mode can NOT be
* changed. The driver instance can be closed and re-open with a new
* transfer mode. See I2C_open() and I2C_close().
*/
typedef enum I2C_TransferMode_ {
I2C_MODE_BLOCKING, /*!< In blocking mode, a task calling I2C_transfer()
is blocked until the transaction completes. Other
tasks requesting I2C transactions while a
transaction is currently taking place, are also
placed into a blocked state. */
I2C_MODE_CALLBACK /*!< In callback mode, a task calling I2C_transfer()
is not blocked. The application's callback
function, #I2C_Params.transferCallbackFxn, is
called when the transaction is complete. The
callback function will be called from either a
hardware or software interrupt context. This
depends on the device specific driver
implementation. Sequential calls to I2C_transfer()
will put #I2C_Transaction structures onto an
internal queue that automatically starts queued
transactions after the previous transaction has
completed. This queuing occurs regardless of any
error state from previous transactions. The
application callback function will be called as
each transaction is completed. */
} I2C_TransferMode;
/*!
* @brief I2C callback function prototype. The application is responsible
* for declaring a callback function when using #I2C_MODE_CALLBACK.
*
* @param handle Handle to the I2C instance that called the
* I2C_transfer().
*
* @param transaction Pointer to the #I2C_Transaction that just
* completed.
*
* @param transferStatus Result of the I2C transfer.
*/
typedef void (*I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *transaction,
bool transferStatus);
/*!
* @brief Specifies one of the standard I2C bus bit rates for I2C
* communication. You must check that the device specific
* implementation supports the desired #I2C_BitRate_.
*/
typedef enum I2C_BitRate_ {
I2C_100kHz = 0, /*!< 100kbps */
I2C_400kHz = 1, /*!< 400kbps */
I2C_1000kHz = 2, /*!< 1Mbps */
I2C_3330kHz = 3, /*!< 3.33Mbps */
} I2C_BitRate;
/*!
* @brief I2C Parameters
*
* I2C parameters are used with the I2C_open() call. Default values for
* these parameters are set using I2C_Params_init().
*
* @sa I2C_Params_init()
*/
typedef struct I2C_Params_ {
I2C_TransferMode transferMode; /*!<Specifies the #I2C_TransferMode.
Default is blocking. */
I2C_CallbackFxn transferCallbackFxn; /*!< Callback function pointer used
when #I2C_TransferMode is
#I2C_MODE_CALLBACK. */
I2C_BitRate bitRate; /*!< #I2C_BitRate_. The default is
#I2C_100kHz.*/
void *custom; /*!< Custom argument used by driver
implementation */
} I2C_Params;
/*!
* @brief A function pointer to a driver-specific implementation of
* I2C_cancel().
*/
typedef void (*I2C_CancelFxn) (I2C_Handle handle);
/*!
* @brief A function pointer to a driver-specific implementation of
* I2C_close().
*/
typedef void (*I2C_CloseFxn) (I2C_Handle handle);
/*!
* @brief A function pointer to a driver-specific implementation of
* I2C_control().
*/
typedef int_fast16_t (*I2C_ControlFxn) (I2C_Handle handle, uint_fast16_t cmd,
void *controlArg);
/*!
* @brief A function pointer to a driver-specific implementation of
* I2C_init().
*/
typedef void (*I2C_InitFxn) (I2C_Handle handle);
/*!
* @brief A function pointer to a driver-specific implementation of
* I2C_open().
*/
typedef I2C_Handle (*I2C_OpenFxn) (I2C_Handle handle, I2C_Params *params);
/*!
* @brief A function pointer to a driver-specific implementation of
* I2C_transfer().
*/
typedef bool (*I2C_TransferFxn) (I2C_Handle handle,
I2C_Transaction *transaction);
/*!
* @brief The definition of an I2C function table that contains the
* required set of functions to control a specific I2C driver
* implementation.
*/
typedef struct I2C_FxnTable_ {
/*! Cancel all I2C data transfers */
I2C_CancelFxn cancelFxn;
/*! Close the specified peripheral */
I2C_CloseFxn closeFxn;
/*! Implementation-specific control function */
I2C_ControlFxn controlFxn;
/*! Initialize the given data object */
I2C_InitFxn initFxn;
/*! Open the specified peripheral */
I2C_OpenFxn openFxn;
/*! Initiate an I2C data transfer */
I2C_TransferFxn transferFxn;
} I2C_FxnTable;
/*!
* @brief I2C global configuration
*
* The #I2C_Config structure contains a set of pointers used to characterize
* the I2C driver implementation.
*
* This structure needs to be defined before calling I2C_init() and it must
* not be changed thereafter.
*
* @sa I2C_init()
*/
typedef struct I2C_Config_ {
/*! Pointer to a table of driver-specific implementations of I2C APIs */
I2C_FxnTable const *fxnTablePtr;
/*! Pointer to a driver-specific data object */
void *object;
/*! Pointer to a driver-specific hardware attributes structure */
void const *hwAttrs;
} I2C_Config;
/*!
* @brief Cancel all I2C transfers
*
* This function will cancel asynchronous I2C_transfer() operations, and is
* applicable only for #I2C_MODE_CALLBACK. An in progress transfer, as well
* as any queued transfers will be canceled. The individual callback functions
* for each transfer will be called from the context that I2C_cancel() is
* called.
*
* @pre I2C_Transfer() has been called.
*
* @param handle An #I2C_Handle returned from I2C_open()
*
* @note Different I2C slave devices will behave differently when an
* in-progress transfer fails and needs to be canceled. The slave
* may need to be reset, or there may be other slave-specific
* steps that can be used to successfully resume communication.
*
* @sa I2C_transfer()
*/
extern void I2C_cancel(I2C_Handle handle);
/*!
* @brief Close an I2C peripheral specified by an #I2C_Handle
*
* @pre I2C_open() has been called.
*
* @param handle An #I2C_Handle returned from I2C_open()
*
* @sa I2C_open()
*/
extern void I2C_close(I2C_Handle handle);
/*!
* @brief Perform implementation-specific features on a given
* #I2C_Handle.
*
* Commands for I2C_control() can originate from I2C.h or from implementation
* specific I2C.h (I2CCC26XX.h_, I2CMSP432.h_, etc.) files.
* While commands from I2C.h are API portable across driver implementations,
* not all implementations may support all these commands.
* Conversely, commands from driver implementation specific I2C*.h files add
* unique driver capabilities but are not API portable across all I2C driver
* implementations.
*
* Commands supported by I2C.h follow a I2C_CMD_\<cmd\> naming
* convention.<br>
* Commands supported by I2C.h follow a I2C_CMD_\<cmd\> naming
* convention.<br>
* Each control command defines @b arg differently. The types of @b arg are
* documented with each command.
*
* See @ref I2C_CMD "I2C_control command codes" for command codes.
*
* See @ref I2C_STATUS "I2C_control return status codes" for status codes.
*
* @pre I2C_open() has to be called first.
*
* @param handle An #I2C_Handle returned from I2C_open()
*
* @param cmd I2C.h or I2C*.h command.
*
* @param controlArg An optional R/W (read/write) command argument
* accompanied with cmd
*
* @return Implementation-specific return codes. Negative values indicate
* unsuccessful operations.
*
* @sa I2C_open()
*/
extern int_fast16_t I2C_control(I2C_Handle handle, uint_fast16_t cmd,
void *controlArg);
/*!
* @brief Initializes the I2C module
*
* @pre The \p I2C_config structure must exist and be persistent before this
* function can be called. This function must also be called before
* any other I2C driver APIs. This function call does not modify any
* peripheral registers.
*/
extern void I2C_init(void);
/*!
* @brief Initialize a given I2C peripheral as identified by an index value.
* The #I2C_Params structure defines the operating mode, and any
* related settings.
*
* @pre The I2C controller has been initialized, via a previous call to
* I2C_init()
*
* @param index Logical peripheral number for the I2C indexed into
* the I2C_config table
*
* @param params Pointer to a parameter block. Default values will be
* used if \p NULL is specified for \p params. All the
* fields in this structure are are considered read-only.
*
* @return An #I2C_Handle on success, or \p NULL on an error, or if the
* peripheral is already opened.
*
* @sa I2C_init()
* @sa I2C_close()
*/
extern I2C_Handle I2C_open(uint_least8_t index, I2C_Params *params);
/*!
* @brief Initialize an #I2C_Params structure to its default values.
*
* @param params A pointer to #I2C_Params structure for
* initialization.
*
* Defaults values are:
* - #I2C_Params.transferMode = #I2C_MODE_BLOCKING
* - #I2C_Params.transferCallbackFxn = \p NULL
* - #I2C_Params.bitRate = #I2C_100kHz
* - #I2C_Params.custom = \p NULL
*/
extern void I2C_Params_init(I2C_Params *params);
/*!
* @brief Perform an I2C transaction with an I2C slave peripheral.
*
* This function will perform an I2C transfer, as specified by an
* #I2C_Transaction structure.
*
* An I2C transaction may write data to a peripheral, or read data from a
* peripheral, or both write and read data, in a single transaction. If there
* is any data to be written, it will always be sent before any data is read
* from the peripheral.
*
* The data written to the peripheral is preceded with the peripheral's 7-bit
* I2C slave address (with the Write bit set).
* After all the data has been transmitted, the driver will evaluate if any
* data needs to be read from the device.
* If yes, another START bit is sent, along with the same 7-bit I2C slave
* address (with the Read bit). After the specified number of bytes have been
* read, the transfer is ended with a NACK and a STOP bit. Otherwise, if
* no data is to be read, the transfer is concluded with a STOP bit.
*
* In #I2C_MODE_BLOCKING, I2C_transfer() will block thread execution until the
* transaction completes. Therefore, this function must only be called from an
* appropriate thread context (e.g., Task context for the TI-RTOS kernel).
*
* In #I2C_MODE_CALLBACK, the I2C_transfer() call does not block thread
* execution. Instead, a callback function (specified during I2C_open(), via
* the transferCallbackFxn field in the #I2C_Params structure) is called when
* the transfer completes. Success or failure of the transaction is reported
* via the #I2C_CallbackFxn \b bool argument. If a transfer is already in
* progress, the new transaction is put on an internal queue. The driver
* services the queue in a first come first served basis.
*
* @param handle An #I2C_Handle
*
* @param transaction A pointer to an #I2C_Transaction. All of the fields
* within the transaction structure should be considered
* write only, unless otherwise noted in the driver
* implementation.
*
* @note The #I2C_Transaction structure must persist unmodified until the
* corresponding call to I2C_transfer() has completed.
*
* @return In #I2C_MODE_BLOCKING: true for a successful transfer; false for an
* error (for example, an I2C bus fault (NACK)).
*
* In #I2C_MODE_CALLBACK: always true. The #I2C_CallbackFxn \p bool
* argument will be true to indicate success, and false to indicate
* an error.
*
* @sa I2C_open
*/
extern bool I2C_transfer(I2C_Handle handle, I2C_Transaction *transaction);
#ifdef __cplusplus
}
#endif
#endif /* ti_drivers_I2C__include */
| 38.383721 | 81 | 0.651755 |
64a90eb0c442b9b3efc4017c339be7153cfc6f93 | 14,091 | h | C | caffe2/operators/load_save_op.h | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | caffe2/operators/load_save_op.h | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | caffe2/operators/load_save_op.h | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | #ifndef CAFFE2_OPERATORS_LOAD_SAVE_OP_H_
#define CAFFE2_OPERATORS_LOAD_SAVE_OP_H_
#include <cstdio>
#include <map>
#include <unordered_set>
#include <c10/util/string_view.h>
#include "caffe2/core/blob_serialization.h"
#include "caffe2/core/context.h"
#include "caffe2/core/db.h"
#include "caffe2/core/logging.h"
#include "caffe2/core/operator.h"
#include "caffe2/operators/load_save_op_util.h"
#include "caffe2/utils/math.h"
#include "caffe2/utils/proto_utils.h"
namespace caffe2 {
using db::Cursor;
using db::DB;
using db::Transaction;
template <class Context>
class DBExistsOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
explicit DBExistsOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<Context>(operator_def, ws),
ws_(ws),
absolute_path_(
this->template GetSingleArgument<int>("absolute_path", false)),
db_name_(this->template GetSingleArgument<string>("db_name", "")),
db_type_(this->template GetSingleArgument<string>("db_type", "")) {}
bool RunOnDevice() override {
string full_db_name =
absolute_path_ ? db_name_ : (ws_->RootFolder() + "/" + db_name_);
auto* output = Output(0);
output->Resize();
bool* exists = output->template mutable_data<bool>();
*exists = caffe2::db::DBExists(db_type_, full_db_name);
return true;
}
private:
Workspace* ws_;
bool absolute_path_;
std::string db_name_;
std::string db_type_;
};
template <class Context>
class LoadOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
explicit LoadOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<Context>(operator_def, ws),
ws_(ws),
absolute_path_(
this->template GetSingleArgument<int>("absolute_path", false)),
add_prefix_(this->template GetSingleArgument<string>("add_prefix", "")),
strip_prefix_(
this->template GetSingleArgument<string>("strip_prefix", "")),
db_name_(this->template GetSingleArgument<string>("db", "")),
db_names_(this->template GetRepeatedArgument<string>("dbs")),
db_type_(this->template GetSingleArgument<string>("db_type", "")),
db_options_(this->template GetSingleArgument<string>("db_options", "")),
keep_device_(this->template GetSingleArgument<int>("keep_device", 0)),
load_all_(this->template GetSingleArgument<int>("load_all", 0)),
allow_incomplete_(
this->template GetSingleArgument<bool>("allow_incomplete", false)),
blob_names_(
this->template GetRepeatedArgument<string>("source_blob_names")),
shape_(this->template GetRepeatedArgument<int64_t>("shape")) {
if (InputSize() == 0) {
CAFFE_ENFORCE_GT(db_type_.size(), 0, "Must specify a db type.");
if (db_names_.empty()) {
CAFFE_ENFORCE_GT(db_name_.size(), 0, "Must specify a db name.");
db_names_.push_back(db_name_);
db_name_ = "";
} else {
std::set<std::string> db_name_set;
for (const string& db_name : db_names_) {
CAFFE_ENFORCE_GT(db_name.size(), 0, "Db name should not be empty.");
CAFFE_ENFORCE(
db_name_set.insert(db_name).second,
"Duplicated db name: ",
db_name);
}
db_name_ = "";
}
}
CAFFE_ENFORCE(
// NOLINTNEXTLINE(clang-diagnostic-sign-compare)
blob_names_.empty() || blob_names_.size() == OutputSize(),
"Number of output blobs and source_blob_names mismatch.");
CAFFE_ENFORCE(
blob_names_.empty() || strip_prefix_.empty(),
"strip_prefix and source_blob_names are mutually exclusive.");
CAFFE_ENFORCE(
blob_names_.empty() || !load_all_,
"cannot load_all_ while using source_blob_names.");
if (!load_all_) {
// blob_names_ will be filled with ''source blob names'' in file/db
// if argument source_blob_names is not given, then blob_names_ is
// inferred from operator output
if (blob_names_.empty()) {
for (const string& name : operator_def.output()) {
blob_names_.push_back(name);
}
}
int idx = 0;
std::set<std::string> name_set;
for (const string& name : blob_names_) {
CAFFE_ENFORCE(
name_set.insert(name).second,
"Duplicated source blob name: ",
name);
output_indices_[name] = idx++;
}
}
}
void SetCurrentDevice(BlobProto* proto);
bool RunOnDevice() override {
int total_loaded_blobs = 0;
std::unordered_map<string, load_save_op_util::BlobState> blob_states;
if (InputSize() > 0) {
for (int i = 0; i < InputSize(); ++i) {
const db::DBReader& reader = this->template Input<db::DBReader>(i);
extract(i, reader.cursor(), &blob_states, &total_loaded_blobs);
}
} else {
// NOLINTNEXTLINE(clang-diagnostic-sign-compare)
for (int i = 0; i < db_names_.size(); ++i) {
string full_db_name = absolute_path_
? db_names_[i]
: (ws_->RootFolder() + "/" + db_names_[i]);
std::unique_ptr<DB> in_db(
caffe2::db::CreateDB(db_type_, full_db_name, caffe2::db::READ));
if (!db_options_.empty()) {
in_db->SetOptions(db_options_);
}
CAFFE_ENFORCE(
in_db.get(),
"Cannot find db implementation of type ",
db_type_,
" (while trying to open ",
full_db_name,
")");
std::unique_ptr<Cursor> cursor(in_db->NewCursor());
extract(i, cursor.get(), &blob_states, &total_loaded_blobs);
}
}
load_save_op_util::validateBlobStates(blob_states);
// Loaded all the needed blobs.
if (!load_all_ && total_loaded_blobs == OutputSize()) {
VLOG(1) << "Loaded " << total_loaded_blobs << " blobs fully from db(s)";
return true;
}
if (load_all_) {
for (const string& name : this->debug_def().output()) {
CAFFE_ENFORCE(
blob_states.count(name),
"Output blob name ",
name,
" does not exist in the db(s).");
}
return true;
}
// Only loaded a subset of the blobs.
if (allow_incomplete_) {
VLOG(1) << "Loaded " << total_loaded_blobs << " blobs out of "
<< OutputSize() << " blobs from db(s).";
for (const auto& output_index : output_indices_) {
if (!blob_states.count(output_index.first)) {
const auto& blobName = output_index.first;
const auto* blob = ws_->GetBlob(output_index.first);
if (blob == nullptr || blob->GetRaw() == nullptr){
// If blob was not loaded in this op and
// it did not exist in the workspace before,
// remove it.
ws_->RemoveBlob(blobName);
}
}
}
} else {
for (const string& output_name : this->debug_def().output()) {
if (blob_states.count(output_name) == 0) {
LOG(ERROR) << "Failed to load blob: " << output_name;
}
}
CAFFE_THROW(
"Expected to load ",
OutputSize(),
" blobs, got ",
total_loaded_blobs,
" only.\n");
}
return true;
}
private:
void extract(
int db_id,
Cursor* cursor,
std::unordered_map<string, load_save_op_util::BlobState>* blob_states,
int* total_loaded_blobs) {
if (load_all_) {
extractAll(db_id, cursor, blob_states, total_loaded_blobs);
} else {
extractFrom(
db_id,
cursor,
OperatorBase::Outputs(),
blob_states,
total_loaded_blobs);
}
}
void extractAll(
int db_id,
Cursor* cursor,
std::unordered_map<string, load_save_op_util::BlobState>* blob_states,
int* total_loaded_blobs) {
CAFFE_ENFORCE(cursor, "cursor is not valid");
int loaded_blobs = 0;
for (; cursor->Valid(); cursor->Next()) {
const auto key = load_save_op_util::buildBlobNameFromDbKey(
cursor->key(), strip_prefix_, add_prefix_);
if (key_to_dbid_.count(key) && key_to_dbid_[key] != db_id) {
CAFFE_THROW("Duplicate Key ", key, " is found!\n");
} else {
key_to_dbid_[key] = db_id;
}
BlobProto proto;
CAFFE_ENFORCE(
proto.ParseFromString(cursor->value()), "Couldn't parse Proto");
if (!keep_device_) {
// If we are not keeping the device as the one specified in the
// proto, we will set the current device.
SetCurrentDevice(&proto);
}
Blob* blob = ws_->CreateBlob(key);
load_save_op_util::ProcessBlob(
blob, proto, blob_states, key, &loaded_blobs);
}
*total_loaded_blobs += loaded_blobs;
}
void extractFrom(
int db_id,
Cursor* cursor,
const vector<Blob*>& outputs,
std::unordered_map<string, load_save_op_util::BlobState>* blob_states,
int* total_loaded_blobs) {
CAFFE_ENFORCE(cursor);
int loaded_blobs = 0;
for (; cursor->Valid(); cursor->Next()) {
const auto key = load_save_op_util::buildBlobNameFromDbKey(
cursor->key(), strip_prefix_, add_prefix_);
if (!output_indices_.count(key)) {
VLOG(1) << "Key " << key << " not used. Skipping.";
} else {
if (key_to_dbid_.count(key) && key_to_dbid_[key] != db_id) {
CAFFE_THROW("Duplicate Key ", key, " is found!\n");
} else {
key_to_dbid_[key] = db_id;
}
VLOG(2) << "Deserializing blob " << key;
BlobProto proto;
CAFFE_ENFORCE(proto.ParseFromString(cursor->value()));
if (!keep_device_) {
// If we are not keeping the device as the one specified in the
// proto, we will set the current device.
SetCurrentDevice(&proto);
}
auto blobIndex = output_indices_[key];
Blob* blob = outputs.at(blobIndex);
load_save_op_util::ProcessBlob(
blob, proto, blob_states, key, &loaded_blobs);
if (*total_loaded_blobs + loaded_blobs == OutputSize()) {
break;
}
}
}
*total_loaded_blobs += loaded_blobs;
}
private:
Workspace* ws_;
bool absolute_path_;
string add_prefix_;
string strip_prefix_;
string db_name_;
std::vector<std::string> db_names_;
string db_type_;
std::string db_options_;
bool keep_device_;
bool load_all_;
bool allow_incomplete_;
std::map<string, int> output_indices_;
std::map<string, int> key_to_dbid_;
std::vector<std::string> blob_names_;
std::vector<int64_t> shape_;
};
namespace internal {
class TORCH_API SaveOpImpl {
public:
SaveOpImpl(OperatorBase* op, const OperatorDef& operator_def, Workspace* ws);
bool RunOnDevice();
private:
OperatorBase* operator_;
std::string strip_prefix_;
std::string full_db_name_;
std::string db_type_;
std::string db_options_;
std::vector<std::string> blob_names_;
SerializationOptions options_;
};
} // namespace internal
template <class Context>
class SaveOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
explicit SaveOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<Context>(operator_def, ws), impl_(this, operator_def, ws) {}
bool RunOnDevice() override {
return impl_.RunOnDevice();
}
private:
internal::SaveOpImpl impl_;
};
template <typename... Ts>
std::string FormatString(const std::string& pattern, Ts... values) {
// Start with an initial buffer size that is probably enough most of the time.
std::string buffer(256, '\0');
auto bytes_written =
snprintf(&buffer[0], buffer.size(), pattern.c_str(), values...);
if (bytes_written < 0) {
throw std::runtime_error("FormatString failed");
}
// NOLINTNEXTLINE(clang-diagnostic-sign-compare)
if (bytes_written > buffer.size()) {
// Our initial buffer size wasn't enough, resize and run again.
buffer.resize(bytes_written + 1);
bytes_written =
snprintf(&buffer[0], buffer.size(), pattern.c_str(), values...);
if (bytes_written < 0) {
throw std::runtime_error("FormatString failed");
}
}
// Truncate the string to the correct size to trim off the nul terminator.
buffer.resize(bytes_written);
return buffer;
}
// CheckpointOp is a wrapper over a SaveFloatTensorOp that basically allows
// flexible naming over iterations.
// The file pattern in db_name should be a format string that can be passed into
// sprintf with an int argument specifying the current iteration. An example:
// "/path/to/my/checkpoint/checkpoint_at_%d.pb"
template <class Context>
class CheckpointOp final : public Operator<Context> {
public:
explicit CheckpointOp(const OperatorDef& operator_def, Workspace* ws)
: Operator<Context>(operator_def, ws),
db_pattern_(this->template GetSingleArgument<string>("db", "")),
every_(this->template GetSingleArgument<int>("every", 1)),
ws_(ws),
save_op_def_(operator_def) {
CAFFE_ENFORCE_GT(
db_pattern_.size(), 0, "Must specify a checkpoint file pattern.");
CAFFE_ENFORCE_GT(every_, 0, "Checkpoint interval should be positive.");
if (every_ == 1) {
// Just issue a warning, but it's totally legal so we don't do anything.
LOG(WARNING) << "It seems that we are checkpointting every iteration. "
<< "Is that intended?";
}
save_op_def_.set_type("Save");
}
USE_OPERATOR_CONTEXT_FUNCTIONS;
bool RunOnDevice() override {
int64_t iter =
this->template Input<Tensor>(0, CPU).template data<int64_t>()[0];
if (iter % every_ == 0) {
GetMutableArgument("db", true, &save_op_def_)
->set_s(FormatString(db_pattern_, iter));
SaveOp<Context> sub_op(save_op_def_, ws_);
return sub_op.Run();
} else {
return true;
}
}
private:
string db_pattern_;
int every_;
Workspace* ws_;
OperatorDef save_op_def_;
};
} // namespace caffe2
#endif // CAFFE2_OPERATORS_LOAD_SAVE_OP_H_
| 33.077465 | 80 | 0.632106 |
3101696854ecaf52f882204c3375ae520f39ecef | 4,496 | h | C | src/motioncore/protocols/beavy/plain.h | Udbhavbisarya23/MOTION2NX | eb26f639d8c1729cebfa85dd3bf41b770cebe92b | [
"MIT"
] | 6 | 2021-11-05T00:39:47.000Z | 2022-02-26T16:42:55.000Z | src/motioncore/protocols/beavy/plain.h | Udbhavbisarya23/MOTION2NX | eb26f639d8c1729cebfa85dd3bf41b770cebe92b | [
"MIT"
] | 7 | 2021-11-07T06:53:00.000Z | 2022-03-23T11:46:40.000Z | src/motioncore/protocols/beavy/plain.h | Udbhavbisarya23/MOTION2NX | eb26f639d8c1729cebfa85dd3bf41b770cebe92b | [
"MIT"
] | 7 | 2021-11-04T12:01:07.000Z | 2022-03-29T12:15:23.000Z | // MIT License
//
// Copyright (c) 2020 Lennart Braun
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include "gate/new_gate.h"
namespace MOTION::proto::plain {
class BooleanPlainWire;
using BooleanPlainWireVector = std::vector<std::shared_ptr<BooleanPlainWire>>;
template <typename T>
class ArithmeticPlainWire;
template <typename T>
using ArithmeticPlainWireP = std::shared_ptr<ArithmeticPlainWire<T>>;
} // namespace MOTION::proto::plain
namespace MOTION::proto::beavy {
class BEAVYProvider;
class BooleanBEAVYWire;
using BooleanBEAVYWireVector = std::vector<std::shared_ptr<BooleanBEAVYWire>>;
template <typename T>
class ArithmeticBEAVYWire;
template <typename T>
using ArithmeticBEAVYWireP = std::shared_ptr<ArithmeticBEAVYWire<T>>;
namespace detail {
class BasicBooleanBEAVYPlainBinaryGate : public NewGate {
public:
BasicBooleanBEAVYPlainBinaryGate(std::size_t gate_id, BEAVYProvider&, BooleanBEAVYWireVector&&,
plain::BooleanPlainWireVector&&);
BooleanBEAVYWireVector& get_output_wires() noexcept { return outputs_; };
protected:
const BEAVYProvider& beavy_provider_;
std::size_t num_wires_;
const BooleanBEAVYWireVector inputs_beavy_;
const plain::BooleanPlainWireVector inputs_plain_;
BooleanBEAVYWireVector outputs_;
};
template <typename T>
class BasicArithmeticBEAVYPlainBinaryGate : public NewGate {
public:
BasicArithmeticBEAVYPlainBinaryGate(std::size_t gate_id, BEAVYProvider&,
ArithmeticBEAVYWireP<T>&&, plain::ArithmeticPlainWireP<T>&&);
ArithmeticBEAVYWireP<T>& get_output_wire() noexcept { return output_; };
protected:
const BEAVYProvider& beavy_provider_;
const ArithmeticBEAVYWireP<T> input_beavy_;
const plain::ArithmeticPlainWireP<T> input_plain_;
ArithmeticBEAVYWireP<T> output_;
};
} // namespace detail
class BooleanBEAVYXORPlainGate : public detail::BasicBooleanBEAVYPlainBinaryGate {
public:
using detail::BasicBooleanBEAVYPlainBinaryGate::BasicBooleanBEAVYPlainBinaryGate;
bool need_setup() const noexcept override { return true; }
bool need_online() const noexcept override { return true; }
void evaluate_setup() override;
void evaluate_online() override;
};
class BooleanBEAVYANDPlainGate : public detail::BasicBooleanBEAVYPlainBinaryGate {
public:
using detail::BasicBooleanBEAVYPlainBinaryGate::BasicBooleanBEAVYPlainBinaryGate;
bool need_setup() const noexcept override { return true; }
bool need_online() const noexcept override { return true; }
void evaluate_setup() override;
void evaluate_online() override;
};
template <typename T>
class ArithmeticBEAVYADDPlainGate : public detail::BasicArithmeticBEAVYPlainBinaryGate<T> {
public:
using detail::BasicArithmeticBEAVYPlainBinaryGate<T>::BasicArithmeticBEAVYPlainBinaryGate;
bool need_setup() const noexcept override { return true; }
bool need_online() const noexcept override { return true; }
void evaluate_setup() override;
void evaluate_online() override;
};
template <typename T>
class ArithmeticBEAVYMULPlainGate : public detail::BasicArithmeticBEAVYPlainBinaryGate<T> {
public:
using detail::BasicArithmeticBEAVYPlainBinaryGate<T>::BasicArithmeticBEAVYPlainBinaryGate;
bool need_setup() const noexcept override { return true; }
bool need_online() const noexcept override { return true; }
void evaluate_setup() override;
void evaluate_online() override;
};
} // namespace MOTION::proto::beavy
| 38.42735 | 99 | 0.777358 |
c1414446ef0d33a9838ad03db39009f6de04cadb | 10,651 | h | C | include/EASTL/internal/atomic/atomic_integral.h | jakemason/EASTL | 446c3a344ce00a8ee19dbcee73f9f38777649d36 | [
"BSD-3-Clause"
] | null | null | null | include/EASTL/internal/atomic/atomic_integral.h | jakemason/EASTL | 446c3a344ce00a8ee19dbcee73f9f38777649d36 | [
"BSD-3-Clause"
] | null | null | null | include/EASTL/internal/atomic/atomic_integral.h | jakemason/EASTL | 446c3a344ce00a8ee19dbcee73f9f38777649d36 | [
"BSD-3-Clause"
] | null | null | null | /////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////
#ifndef EASTL_ATOMIC_INTERNAL_INTEGRAL_H
#define EASTL_ATOMIC_INTERNAL_INTEGRAL_H
#if defined(EA_PRAGMA_ONCE_SUPPORTED)
#pragma once
#endif
#include "atomic_push_compiler_options.h"
namespace eastl
{
namespace internal
{
#define EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(funcName) \
template <typename Order> \
T funcName(T arg, Order order) EA_NOEXCEPT \
{ \
EASTL_ATOMIC_STATIC_ASSERT_INVALID_MEMORY_ORDER(T); \
} \
\
template <typename Order> \
T funcName(T arg, Order order) volatile EA_NOEXCEPT \
{ \
EASTL_ATOMIC_STATIC_ASSERT_VOLATILE_MEM_FN(T); \
} \
\
T funcName(T arg) volatile EA_NOEXCEPT \
{ \
EASTL_ATOMIC_STATIC_ASSERT_VOLATILE_MEM_FN(T); \
}
#define EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_INC_DEC_OPERATOR_IMPL(operatorOp) \
T operator operatorOp() volatile EA_NOEXCEPT \
{ \
EASTL_ATOMIC_STATIC_ASSERT_VOLATILE_MEM_FN(T); \
} \
\
T operator operatorOp(int) volatile EA_NOEXCEPT \
{ \
EASTL_ATOMIC_STATIC_ASSERT_VOLATILE_MEM_FN(T); \
}
#define EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_ASSIGNMENT_OPERATOR_IMPL(operatorOp) \
T operator operatorOp(T arg) volatile EA_NOEXCEPT \
{ \
EASTL_ATOMIC_STATIC_ASSERT_VOLATILE_MEM_FN(T); \
}
template <typename T, unsigned width = sizeof(T)>
struct atomic_integral_base : public atomic_base_width<T, width>
{
private:
using Base = atomic_base_width<T, width>;
public: /* ctors */
atomic_integral_base(T desired) EA_NOEXCEPT
: Base{ desired }
{
}
atomic_integral_base() EA_NOEXCEPT = default;
atomic_integral_base(const atomic_integral_base&) EA_NOEXCEPT = delete;
public: /* assignment operator */
using Base::operator =;
atomic_integral_base& operator =(const atomic_integral_base&) EA_NOEXCEPT = delete;
atomic_integral_base& operator =(const atomic_integral_base&) volatile EA_NOEXCEPT = delete;
public: /* fetch_add */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(fetch_add)
public: /* add_fetch */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(add_fetch)
public: /* fetch_sub */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(fetch_sub)
public: /* sub_fetch */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(sub_fetch)
public: /* fetch_and */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(fetch_and)
public: /* and_fetch */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(and_fetch)
public: /* fetch_or */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(fetch_or)
public: /* or_fetch */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(or_fetch)
public: /* fetch_xor */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(fetch_xor)
public: /* xor_fetch */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_FUNCS_IMPL(xor_fetch)
public: /* operator++ && operator-- */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_INC_DEC_OPERATOR_IMPL(++)
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_INC_DEC_OPERATOR_IMPL(--)
public: /* operator+= && operator-= */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_ASSIGNMENT_OPERATOR_IMPL(+=)
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_ASSIGNMENT_OPERATOR_IMPL(-=)
public: /* operator&= */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_ASSIGNMENT_OPERATOR_IMPL(&=)
public: /* operator|= */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_ASSIGNMENT_OPERATOR_IMPL(|=)
public: /* operator^= */
EASTL_ATOMIC_INTEGRAL_STATIC_ASSERT_ASSIGNMENT_OPERATOR_IMPL(^=)
};
template <typename T, unsigned width = sizeof(T)>
struct atomic_integral_width;
#define EASTL_ATOMIC_INTEGRAL_FUNC_IMPL(op, bits) \
T retVal; \
EA_PREPROCESSOR_JOIN(op, bits)(T, retVal, this->GetAtomicAddress(), arg); \
return retVal;
#define EASTL_ATOMIC_INTEGRAL_FETCH_IMPL(funcName, op, bits) \
T funcName(T arg) EA_NOEXCEPT \
{ \
EASTL_ATOMIC_INTEGRAL_FUNC_IMPL(op, bits); \
}
#define EASTL_ATOMIC_INTEGRAL_FETCH_ORDER_IMPL(funcName, orderType, op, bits) \
T funcName(T arg, orderType) EA_NOEXCEPT \
{ \
EASTL_ATOMIC_INTEGRAL_FUNC_IMPL(op, bits); \
}
#define EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, Order) \
EA_PREPROCESSOR_JOIN(EA_PREPROCESSOR_JOIN(EASTL_ATOMIC_, fetchOp), Order)
#define EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(funcName, fetchOp, bits) \
using Base::funcName; \
\
EASTL_ATOMIC_INTEGRAL_FETCH_IMPL(funcName, EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, _SEQ_CST_), bits) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ORDER_IMPL(funcName, eastl::internal::memory_order_relaxed_s, \
EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, _RELAXED_), bits) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ORDER_IMPL(funcName, eastl::internal::memory_order_acquire_s, \
EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, _ACQUIRE_), bits) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ORDER_IMPL(funcName, eastl::internal::memory_order_release_s, \
EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, _RELEASE_), bits) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ORDER_IMPL(funcName, eastl::internal::memory_order_acq_rel_s, \
EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, _ACQ_REL_), bits) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ORDER_IMPL(funcName, eastl::internal::memory_order_seq_cst_s, \
EASTL_ATOMIC_INTEGRAL_FETCH_OP_JOIN(fetchOp, _SEQ_CST_), bits)
#define EASTL_ATOMIC_INTEGRAL_FETCH_INC_DEC_OPERATOR_IMPL(operatorOp, preFuncName, postFuncName) \
using Base::operator operatorOp; \
\
T operator operatorOp() EA_NOEXCEPT \
{ \
return preFuncName(1, eastl::memory_order_seq_cst); \
} \
\
T operator operatorOp(int) EA_NOEXCEPT \
{ \
return postFuncName(1, eastl::memory_order_seq_cst); \
}
#define EASTL_ATOMIC_INTEGRAL_FETCH_ASSIGNMENT_OPERATOR_IMPL(operatorOp, funcName) \
using Base::operator operatorOp; \
\
T operator operatorOp(T arg) EA_NOEXCEPT \
{ \
return funcName(arg, eastl::memory_order_seq_cst); \
}
#define EASTL_ATOMIC_INTEGRAL_WIDTH_SPECIALIZE(bytes, bits) \
template <typename T> \
struct atomic_integral_width<T, bytes> : public atomic_integral_base<T, bytes> \
{ \
private: \
\
using Base = atomic_integral_base<T, bytes>; \
\
public: /* ctors */ \
\
atomic_integral_width(T desired) EA_NOEXCEPT \
: Base{ desired } \
{ \
} \
\
atomic_integral_width() EA_NOEXCEPT = default; \
\
atomic_integral_width(const atomic_integral_width&) EA_NOEXCEPT = delete; \
\
public: /* assignment operator */ \
\
using Base::operator =; \
\
atomic_integral_width& operator =(const atomic_integral_width&) EA_NOEXCEPT = delete; \
atomic_integral_width& operator =(const atomic_integral_width&) volatile EA_NOEXCEPT = delete; \
\
public: /* fetch_add */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(fetch_add, FETCH_ADD, bits) \
\
public: /* add_fetch */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(add_fetch, ADD_FETCH, bits) \
\
public: /* fetch_sub */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(fetch_sub, FETCH_SUB, bits) \
\
public: /* sub_fetch */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(sub_fetch, SUB_FETCH, bits) \
\
public: /* fetch_and */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(fetch_and, FETCH_AND, bits) \
\
public: /* and_fetch */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(and_fetch, AND_FETCH, bits) \
\
public: /* fetch_or */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(fetch_or, FETCH_OR, bits) \
\
public: /* or_fetch */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(or_fetch, OR_FETCH, bits) \
\
public: /* fetch_xor */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(fetch_xor, FETCH_XOR, bits) \
\
public: /* xor_fetch */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_FUNCS_IMPL(xor_fetch, XOR_FETCH, bits) \
\
public: /* operator++ && operator-- */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_INC_DEC_OPERATOR_IMPL(++, add_fetch, fetch_add) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_INC_DEC_OPERATOR_IMPL(--, sub_fetch, fetch_sub) \
\
public: /* operator+= && operator-= */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ASSIGNMENT_OPERATOR_IMPL(+=, add_fetch) \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ASSIGNMENT_OPERATOR_IMPL(-=, sub_fetch) \
\
public: /* operator&= */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ASSIGNMENT_OPERATOR_IMPL(&=, and_fetch) \
\
public: /* operator|= */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ASSIGNMENT_OPERATOR_IMPL(|=, or_fetch) \
\
public: /* operator^= */ \
\
EASTL_ATOMIC_INTEGRAL_FETCH_ASSIGNMENT_OPERATOR_IMPL(^=, xor_fetch) \
\
};
#if defined(EASTL_ATOMIC_HAS_8BIT)
EASTL_ATOMIC_INTEGRAL_WIDTH_SPECIALIZE(1, 8)
#endif
#if defined(EASTL_ATOMIC_HAS_16BIT)
EASTL_ATOMIC_INTEGRAL_WIDTH_SPECIALIZE(2, 16)
#endif
#if defined(EASTL_ATOMIC_HAS_32BIT)
EASTL_ATOMIC_INTEGRAL_WIDTH_SPECIALIZE(4, 32)
#endif
#if defined(EASTL_ATOMIC_HAS_64BIT)
EASTL_ATOMIC_INTEGRAL_WIDTH_SPECIALIZE(8, 64)
#endif
#if defined(EASTL_ATOMIC_HAS_128BIT)
EASTL_ATOMIC_INTEGRAL_WIDTH_SPECIALIZE(16, 128)
#endif
} // namespace internal
} // namespace eastl
#include "atomic_pop_compiler_options.h"
#endif /* EASTL_ATOMIC_INTERNAL_INTEGRAL_H */
| 30.962209 | 108 | 0.638062 |
c14c43a893eb11da65e0ef4fae978d7aabd45301 | 1,319 | h | C | Source/Models/User/LTVUser.h | mamaral/LivecodingTV-Objc | d0e6f3080852fdd18e50a104fcd69287ede703b2 | [
"MIT"
] | null | null | null | Source/Models/User/LTVUser.h | mamaral/LivecodingTV-Objc | d0e6f3080852fdd18e50a104fcd69287ede703b2 | [
"MIT"
] | null | null | null | Source/Models/User/LTVUser.h | mamaral/LivecodingTV-Objc | d0e6f3080852fdd18e50a104fcd69287ede703b2 | [
"MIT"
] | null | null | null | //
// LTVUser.h
// LivecodingTV-ObjC
//
// Created by Mike on 4/23/16.
// Copyright © 2016 Mike Amaral. All rights reserved.
//
#import "LTVObject.h"
@interface LTVUser : LTVObject
@property (nonatomic, strong, readonly) NSString *username;
@property (nonatomic, strong, readonly) NSString *slug;
@property (nonatomic, strong, readonly) NSString *country;
@property (nonatomic, strong, readonly) NSString *city;
@property (nonatomic, strong, readonly) NSString *favoriteProgrammingLanguage;
@property (nonatomic, strong, readonly) NSString *favoriteIDE;
@property (nonatomic, strong, readonly) NSString *favoriteCodingBackgroundMusic;
@property (nonatomic, strong, readonly) NSString *favoriteCode;
@property (nonatomic, readonly) NSInteger yearsProgramming;
@property (nonatomic, strong, readonly) NSString *wantLearn;
@property (nonatomic, strong, readonly) NSString *registrationDateString;
@property (nonatomic, strong, readonly) NSString *timezone;
+ (void)getUserWithSlug:(NSString *)slug handler:(void (^)(NSError *error, LTVUser *user))handler;
- (void)getFollowersWithHandler:(void (^)(NSError *error, NSArray *followers))handler;
- (void)getFollowsWithHandler:(void (^)(NSError *error, NSArray *follows))handler;
- (void)getVideosWithHandler:(void (^)(NSError *error, NSArray *videos))handler;
@end
| 39.969697 | 98 | 0.764215 |
e7b891d41ea0d2fb4ddf29cdd2ec136af3f6842f | 1,410 | h | C | Dmensio/render/materials/celshader.h | arttu94/DimensioLegacy | ff32e5a6966154a06b52adbe4eb63e436b6abd37 | [
"MIT"
] | null | null | null | Dmensio/render/materials/celshader.h | arttu94/DimensioLegacy | ff32e5a6966154a06b52adbe4eb63e436b6abd37 | [
"MIT"
] | null | null | null | Dmensio/render/materials/celshader.h | arttu94/DimensioLegacy | ff32e5a6966154a06b52adbe4eb63e436b6abd37 | [
"MIT"
] | null | null | null | #ifndef _CELSHADER_H_
#define _CELSHADER_H_
#include <d3d11.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#include <fstream>
using namespace std;
using namespace DirectX;
class CelShader
{
private:
struct MatrixBufferType
{
XMMATRIX world;
XMMATRIX view;
XMMATRIX projection;
};
struct LightBufferType
{
XMFLOAT4 ambientColor;
XMFLOAT4 diffuseColor;
XMFLOAT3 lightDirection;
float dontTouch;
};
struct DataBufferType
{
float extra1;
float transparent;
float edge;
float colorType;
};
public:
CelShader();
CelShader(const CelShader&);
~CelShader();
bool Initialize(ID3D11Device*, HWND);
void Shutdown();
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT4, float, float, float);
private:
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
void ShutdownShader();
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT4, float, float, float);
void RenderShader(ID3D11DeviceContext*, int);
private:
ID3D11VertexShader* m_vertexShader;
ID3D11PixelShader* m_pixelShader;
ID3D11InputLayout* m_layout;
ID3D11SamplerState* m_sampleState;
ID3D11Buffer* m_matrixBuffer;
ID3D11Buffer* m_lightBuffer;
ID3D11Buffer* m_dataBuffer;
};
#endif
| 21.363636 | 156 | 0.774468 |
f079d7df5d5845090d5d8ba3d091e8b34cbef8a2 | 492 | h | C | 04-Advanced-Class-Members/homework/05-Lectures/ResourceType.h | KostadinovK/Cpp-Advanced | ae2ef3185baecc887dcd231dec900cf8c7da44c9 | [
"Apache-2.0"
] | 1 | 2019-07-21T13:00:31.000Z | 2019-07-21T13:00:31.000Z | C++/C++ Advanced Nov 2019/05. Class Members/Tasks_Description/Task 5 - Lectures_Description and Code/Skeleton/ResourceType.h | galin-kostadinov/Software-Engineering | 55189648d787b35f1e9cd24cc4449c6beda51c90 | [
"MIT"
] | null | null | null | C++/C++ Advanced Nov 2019/05. Class Members/Tasks_Description/Task 5 - Lectures_Description and Code/Skeleton/ResourceType.h | galin-kostadinov/Software-Engineering | 55189648d787b35f1e9cd24cc4449c6beda51c90 | [
"MIT"
] | null | null | null | #ifndef RESOURCE_TYPE_H
#define RESOURCE_TYPE_H
namespace SoftUni {
enum ResourceType {
PRESENTATION,
DEMO,
VIDEO
};
std::ostream& operator<<(std::ostream& out, enum ResourceType t) {
switch (t)
{
case ResourceType::PRESENTATION:
out << "Presentation";
break;
case ResourceType::DEMO:
out << "Demo";
break;
case ResourceType::VIDEO:
out << "Video";
break;
default:
out << "[unknown]";
break;
}
return out;
}
}
#endif // !RESOURCE_TYPE_H
| 14.470588 | 67 | 0.640244 |
bb7cc2a4e1c24031d8dcd0337670d1daeb488b1a | 3,331 | c | C | tpool/test/test.c | stephenfreund/AdaptiveSync | b4c43e47908f6bc9bf0c314c37be449fba6dd890 | [
"MIT"
] | null | null | null | tpool/test/test.c | stephenfreund/AdaptiveSync | b4c43e47908f6bc9bf0c314c37be449fba6dd890 | [
"MIT"
] | null | null | null | tpool/test/test.c | stephenfreund/AdaptiveSync | b4c43e47908f6bc9bf0c314c37be449fba6dd890 | [
"MIT"
] | null | null | null | /* AUTORIGHTS
Copyright (C) 2007 Princeton University
This file is part of Ferret Toolkit.
Ferret Toolkit is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <pthread.h>
#include "tpool.h"
#include "queue.h"
typedef struct {
int count;
} data_t;
typedef struct {
int delay;
queue_t *in;
queue_t *out;
} stage_t;
/* the whole path to the file */
void *first(void *dummy) {
data_t *data = (data_t *)malloc(sizeof(data_t));
queue_t *out = (queue_t *)dummy;
assert(data != NULL);
data->count = 0;
enqueue(out, data);
queue_signal_terminate(out);
return NULL;
}
void *stage(void *dummy) {
data_t *load;
stage_t *stage = (stage_t*)dummy;
while (dequeue(stage->in, (void **)&load) >= 0) {
assert(load != NULL);
usleep(stage->delay * 1000);
load->count++;
enqueue(stage->out, load);
}
queue_signal_terminate(stage->out);
return NULL;
}
void *last(void *dummy) {
queue_t *in = (queue_t *)dummy;
data_t *load;
while (dequeue(in, (void **)&load) >= 0) {
assert(load != NULL);
printf("%d\n", load->count);
free(load);
}
return NULL;
}
#define FIRST 100
#define MID 2
#define LAST 2
#define SIZE 50
static tdesc_t* make_desc(int n, const pthread_attr_t *attr, tpool_start_routine_f start_routine, void *arg) {
tdesc_t *desc = (tdesc_t *)calloc(n, sizeof(tdesc_t));
for (int i = 0; i < n; i++) {
desc[i].attr = attr;
desc[i].start_routine = start_routine;
desc[i].arg = arg;
}
return desc;
}
int main (int argc, char *argv[]) {
queue_t q1;
queue_t q2;
queue_t q3;
queue_init(&q1, SIZE, FIRST);
queue_init(&q2, SIZE, MID);
queue_init(&q3, SIZE, LAST);
tdesc_t *t_first = make_desc(FIRST, NULL, first, &q1);
stage_t s1 = { 100, &q1, &q2 };
tdesc_t *t_seg1 = make_desc(MID, NULL, stage, &s1);
stage_t s2 = { 200, &q2, &q3 };
tdesc_t *t_seg2 = make_desc(MID, NULL, stage, &s2);
tdesc_t *t_last = make_desc(LAST, NULL, last, &q3);
tpool_t *p_first = tpool_create(t_first, FIRST);
tpool_t *p_mid1 = tpool_create(t_seg1, MID);
tpool_t *p_mid2 = tpool_create(t_seg2, MID);
tpool_t *p_last = tpool_create(t_last, LAST);
tpool_join(p_last, NULL);
tpool_join(p_mid2, NULL);
tpool_join(p_mid1, NULL);
tpool_join(p_first, NULL);
tpool_destroy(p_first);
tpool_destroy(p_mid1);
tpool_destroy(p_mid2);
tpool_destroy(p_last);
free(t_first);
free(t_seg1);
free(t_seg2);
free(t_last);
queue_destroy(&q1);
queue_destroy(&q2);
queue_destroy(&q3);
return 0;
}
| 23.457746 | 110 | 0.674572 |
7634e79ff2dfbe52de8dd918a8cc6a526e678fee | 3,811 | h | C | Firmware/STM32/GraphicsDriver/Core/Inc/main.h | benvonhandorf/wifi_led_matrix | bab56db71e85a935d0532ab97903ae2c91b44ed7 | [
"MIT"
] | null | null | null | Firmware/STM32/GraphicsDriver/Core/Inc/main.h | benvonhandorf/wifi_led_matrix | bab56db71e85a935d0532ab97903ae2c91b44ed7 | [
"MIT"
] | null | null | null | Firmware/STM32/GraphicsDriver/Core/Inc/main.h | benvonhandorf/wifi_led_matrix | bab56db71e85a935d0532ab97903ae2c91b44ed7 | [
"MIT"
] | null | null | null | /* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define Matrix_A_Pin GPIO_PIN_2
#define Matrix_A_GPIO_Port GPIOA
#define Matrix_B_Pin GPIO_PIN_3
#define Matrix_B_GPIO_Port GPIOA
#define Matrix_C_Pin GPIO_PIN_4
#define Matrix_C_GPIO_Port GPIOA
#define Matrix_R0_Pin GPIO_PIN_0
#define Matrix_R0_GPIO_Port GPIOB
#define Matrix_G0_Pin GPIO_PIN_1
#define Matrix_G0_GPIO_Port GPIOB
#define Matrix_B0_Pin GPIO_PIN_2
#define Matrix_B0_GPIO_Port GPIOB
#define Matrix2_G1_Pin GPIO_PIN_10
#define Matrix2_G1_GPIO_Port GPIOB
#define Matrix2_B1_Pin GPIO_PIN_11
#define Matrix2_B1_GPIO_Port GPIOB
#define LED_7A_Pin GPIO_PIN_12
#define LED_7A_GPIO_Port GPIOB
#define LED_7B_Pin GPIO_PIN_13
#define LED_7B_GPIO_Port GPIOB
#define LED_8A_Pin GPIO_PIN_14
#define LED_8A_GPIO_Port GPIOB
#define LED_8B_Pin GPIO_PIN_15
#define LED_8B_GPIO_Port GPIOB
#define Matrix_D_Pin GPIO_PIN_8
#define Matrix_D_GPIO_Port GPIOA
#define Matrix_LAT_Pin GPIO_PIN_11
#define Matrix_LAT_GPIO_Port GPIOA
#define Matrix_OE_Pin GPIO_PIN_12
#define Matrix_OE_GPIO_Port GPIOA
#define Matrix_E_Pin GPIO_PIN_15
#define Matrix_E_GPIO_Port GPIOA
#define Matrix_R1_Pin GPIO_PIN_3
#define Matrix_R1_GPIO_Port GPIOB
#define Matrix_G1_Pin GPIO_PIN_4
#define Matrix_G1_GPIO_Port GPIOB
#define Matrix_B1_Pin GPIO_PIN_5
#define Matrix_B1_GPIO_Port GPIOB
#define Matrix2_R0_Pin GPIO_PIN_6
#define Matrix2_R0_GPIO_Port GPIOB
#define Matrix2_G0_Pin GPIO_PIN_7
#define Matrix2_G0_GPIO_Port GPIOB
#define Matrix2_B0_Pin GPIO_PIN_8
#define Matrix2_B0_GPIO_Port GPIOB
#define Matrix2_R1_Pin GPIO_PIN_9
#define Matrix2_R1_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| 31.758333 | 81 | 0.598268 |
763c7078223819133144ddc5661851c9a90a86b1 | 1,161 | h | C | PizzaFactory/PizzaFactory/DB/SQLManager.h | chenhuaizhe/PizzaFactory | 704948b459c489b76a9674647e0881dcd167c145 | [
"Apache-2.0"
] | null | null | null | PizzaFactory/PizzaFactory/DB/SQLManager.h | chenhuaizhe/PizzaFactory | 704948b459c489b76a9674647e0881dcd167c145 | [
"Apache-2.0"
] | null | null | null | PizzaFactory/PizzaFactory/DB/SQLManager.h | chenhuaizhe/PizzaFactory | 704948b459c489b76a9674647e0881dcd167c145 | [
"Apache-2.0"
] | null | null | null | //
// SQLManager.h
// PushUps
//
// Created by ChenYuan's Macbook Air on 2020/1/30.
// Copyright © 2020 chenyuan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <fmdb/FMDB.h>
#import "sqlite3.h"
NS_ASSUME_NONNULL_BEGIN
#define kDB_DIR @"/mydb" //DB_DIR
#define kDataDBName [NSString stringWithFormat:@"%@/data.sqlite", kDB_DIR]
typedef enum{
DATE_TYPE_DATESTAMP = 1998,
DATE_TYPE_CALENDAR = 2000,
} SQLDateType;
@interface SQLManager : NSObject
@property (nonatomic ,strong)FMDatabaseQueue *dataDBQueue;
/*insert DB queue*/
@property (nonatomic ,strong) NSMutableArray *valueStrs;
@property (nonatomic ,strong) NSLock *vsLock;
+ (SQLManager *)shareInstance;
#pragma mark - date
- (NSString *)dateToString:(NSDate *)date;
- (NSString *)calendarToString:(NSDate *)date;
- (NSDateFormatter *)dbDateFormatter:(NSInteger )type;
#pragma mark - insert
- (BOOL)insertModelWithDBQueue:(FMDatabaseQueue *)dbQueue
andTableName:(NSString *)tableName
andColumns:(NSString *)columnStr
andValues:(NSString *)valueStr;
@end
NS_ASSUME_NONNULL_END
| 23.22 | 78 | 0.691645 |
0acad6fd12b306848e83c5680e15010d2c0d0e15 | 456 | h | C | src/node/store/wcryptopro.h | microshine/trusted-crypto | 22a6496bd390ebe2ed516a15636d911fae4c6407 | [
"Apache-2.0"
] | null | null | null | src/node/store/wcryptopro.h | microshine/trusted-crypto | 22a6496bd390ebe2ed516a15636d911fae4c6407 | [
"Apache-2.0"
] | null | null | null | src/node/store/wcryptopro.h | microshine/trusted-crypto | 22a6496bd390ebe2ed516a15636d911fae4c6407 | [
"Apache-2.0"
] | 1 | 2020-07-01T16:32:57.000Z | 2020-07-01T16:32:57.000Z | #ifndef WCRYPTOPRO_H_INCLUDED
#define WCRYPTOPRO_H_INCLUDED
#include "../../wrapper/store/provider_cryptopro.h"
#include <nan.h>
#include "../utils/wrap.h"
#include "../helper.h"
#include "../pki/wcert.h"
#include "../pki/wkey.h"
WRAP_CLASS(ProviderCryptopro){
public:
WProviderCryptopro(){};
~WProviderCryptopro(){};
static void Init(v8::Handle<v8::Object>);
static NAN_METHOD(New);
static NAN_METHOD(GetKey);
};
#endif //WCRYPTOPRO_H_INCLUDED
| 19 | 51 | 0.725877 |
17b29bd5909bfe5a479b42eb833422945a10fffa | 3,004 | c | C | output-bird.c | kristapsdz/rpki-client | 2fe4b93d8a8a0f23d5946a8cabeda6ad37498872 | [
"0BSD"
] | 25 | 2019-06-17T14:12:18.000Z | 2022-01-09T22:19:26.000Z | output-bird.c | kristapsdz/rpki-client | 2fe4b93d8a8a0f23d5946a8cabeda6ad37498872 | [
"0BSD"
] | 17 | 2019-06-19T19:52:25.000Z | 2020-04-05T11:03:26.000Z | output-bird.c | kristapsdz/rpki-client | 2fe4b93d8a8a0f23d5946a8cabeda6ad37498872 | [
"0BSD"
] | 5 | 2019-06-23T15:48:02.000Z | 2020-04-05T01:28:05.000Z | /* $OpenBSD$ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2020 Robert Scheck <robert@fedoraproject.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "config.h"
#include <stdint.h>
#include <stdlib.h>
#include <openssl/ssl.h>
#include "extern.h"
int
output_bird1v4(FILE *out, struct vrp_tree *vrps, void *arg)
{
const char *bird_tablename = arg;
char buf[64];
struct vrp *v;
if (fprintf(out, "roa table %s {\n", bird_tablename) < 0)
return -1;
RB_FOREACH(v, vrp_tree, vrps) {
if (v->afi == AFI_IPV4) {
ip_addr_print(&v->addr, v->afi, buf, sizeof(buf));
if (fprintf(out, "\troa %s max %u as %u;\n", buf,
v->maxlength, v->asid) < 0)
return -1;
}
}
if (fprintf(out, "}\n") < 0)
return -1;
return 0;
}
int
output_bird1v6(FILE *out, struct vrp_tree *vrps, void *arg)
{
const char *bird_tablename = arg;
char buf[64];
struct vrp *v;
if (fprintf(out, "roa table %s {\n", bird_tablename) < 0)
return -1;
RB_FOREACH(v, vrp_tree, vrps) {
if (v->afi == AFI_IPV6) {
ip_addr_print(&v->addr, v->afi, buf, sizeof(buf));
if (fprintf(out, "\troa %s max %u as %u;\n", buf,
v->maxlength, v->asid) < 0)
return -1;
}
}
if (fprintf(out, "}\n") < 0)
return -1;
return 0;
}
int
output_bird2(FILE *out, struct vrp_tree *vrps, void *arg)
{
const char *bird_tablename = arg;
char buf[64];
struct vrp *v;
time_t now = time(NULL);
if (fprintf(out, "define force_roa_table_update = %lld;\n\n"
"roa4 table %s4;\nroa6 table %s6;\n\n"
"protocol static {\n\troa4 { table %s4; };\n\n",
(long long) now, bird_tablename, bird_tablename,
bird_tablename) < 0)
return -1;
RB_FOREACH(v, vrp_tree, vrps) {
if (v->afi == AFI_IPV4) {
ip_addr_print(&v->addr, v->afi, buf, sizeof(buf));
if (fprintf(out, "\troute %s max %u as %u;\n", buf,
v->maxlength, v->asid) < 0)
return -1;
}
}
if (fprintf(out, "}\n\nprotocol static {\n\troa6 { table %s6; };\n\n",
bird_tablename) < 0)
return -1;
RB_FOREACH(v, vrp_tree, vrps) {
if (v->afi == AFI_IPV6) {
ip_addr_print(&v->addr, v->afi, buf, sizeof(buf));
if (fprintf(out, "\troute %s max %u as %u;\n", buf,
v->maxlength, v->asid) < 0)
return -1;
}
}
if (fprintf(out, "}\n") < 0)
return -1;
return 0;
}
| 26.121739 | 75 | 0.640479 |
8d100b3d49af2049f6c7e4b9ac1752b70beba08a | 903 | h | C | VPKReader/TriStateTreeCtrl.h | hufuman/VPKReader | d17af846a8212caa1e739852e266fe8ee6a5c1ea | [
"MIT"
] | 14 | 2015-05-07T15:05:38.000Z | 2020-12-04T07:00:45.000Z | VPKReader/TriStateTreeCtrl.h | hufuman/VPKReader | d17af846a8212caa1e739852e266fe8ee6a5c1ea | [
"MIT"
] | null | null | null | VPKReader/TriStateTreeCtrl.h | hufuman/VPKReader | d17af846a8212caa1e739852e266fe8ee6a5c1ea | [
"MIT"
] | 6 | 2015-05-21T16:03:03.000Z | 2021-05-17T17:17:52.000Z | #pragma once
// CTriStateTreeCtrl
enum TriStateTreeState
{
TSS_None = 0,
TSS_UnChecked = 1,
TSS_Checked = 2,
TSS_Indeterminate = 3,
};
class CTriStateTreeCtrl : public CTreeCtrl
{
DECLARE_DYNAMIC(CTriStateTreeCtrl)
public:
CTriStateTreeCtrl();
virtual ~CTriStateTreeCtrl();
TriStateTreeState GetTriCheck(HTREEITEM hItem);
private:
void CheckSubItem(HTREEITEM hItem, BOOL bChecked);
TriStateTreeState GetSubItemState(HTREEITEM hItem);
void TriUpdateItemState(HTREEITEM hTreeItem, TriStateTreeState state);
protected:
CImageList m_hImageList;
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult);
protected:
virtual void PreSubclassWindow();
public:
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};
| 20.522727 | 74 | 0.727575 |
4f72946a60aac609be49eecb1617f029800967bc | 2,857 | h | C | src/qt/governancelist.h | kittywhiskers/dash | f329625b67eb1943a2f0b68a12b3bd25052e41ab | [
"MIT"
] | null | null | null | src/qt/governancelist.h | kittywhiskers/dash | f329625b67eb1943a2f0b68a12b3bd25052e41ab | [
"MIT"
] | null | null | null | src/qt/governancelist.h | kittywhiskers/dash | f329625b67eb1943a2f0b68a12b3bd25052e41ab | [
"MIT"
] | null | null | null | #ifndef BITCOIN_QT_GOVERNANCELIST_H
#define BITCOIN_QT_GOVERNANCELIST_H
#include <governance/object.h>
#include <primitives/transaction.h>
#include <sync.h>
#include <util/system.h>
#include <QAbstractTableModel>
#include <QDateTime>
#include <QMenu>
#include <QSortFilterProxyModel>
#include <QTimer>
#include <QWidget>
inline constexpr int GOVERNANCELIST_UPDATE_SECONDS = 10;
namespace Ui {
class GovernanceList;
}
class CDeterministicMNList;
class ClientModel;
class Proposal : public QObject
{
private:
Q_OBJECT
const CGovernanceObject* pGovObj;
QString m_title;
QDateTime m_startDate;
QDateTime m_endDate;
float m_paymentAmount;
QString m_url;
public:
Proposal(const CGovernanceObject* p, QObject* parent = nullptr);
QString title() const;
QString hash() const;
QDateTime startDate() const;
QDateTime endDate() const;
float paymentAmount() const;
QString url() const;
bool isActive() const;
QString votingStatus(int nAbsVoteReq) const;
int GetAbsoluteYesCount() const;
void openUrl() const;
QString toJson() const;
};
class ProposalModel : public QAbstractTableModel
{
private:
QList<const Proposal*> m_data;
int nAbsVoteReq = 0;
public:
explicit ProposalModel(QObject* parent = nullptr) :
QAbstractTableModel(parent){};
enum Column : int {
HASH = 0,
TITLE,
START_DATE,
END_DATE,
PAYMENT_AMOUNT,
IS_ACTIVE,
VOTING_STATUS,
_COUNT // for internal use only
};
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
static int columnWidth(int section);
void append(const Proposal* proposal);
void remove(int row);
void reconcile(const std::vector<const Proposal*>& proposals);
void setVotingParams(int nAbsVoteReq);
const Proposal* getProposalAt(const QModelIndex& index) const;
};
/** Governance Manager page widget */
class GovernanceList : public QWidget
{
Q_OBJECT
public:
explicit GovernanceList(QWidget* parent = nullptr);
~GovernanceList() override;
void setClientModel(ClientModel* clientModel);
private:
ClientModel* clientModel{nullptr};
std::unique_ptr<Ui::GovernanceList> ui;
ProposalModel* proposalModel;
QSortFilterProxyModel* proposalModelProxy;
QMenu* proposalContextMenu;
QTimer* timer;
private Q_SLOTS:
void updateProposalList();
void updateProposalCount() const;
void showProposalContextMenu(const QPoint& pos);
void showAdditionalInfo(const QModelIndex& index);
};
#endif // BITCOIN_QT_GOVERNANCELIST_H
| 24.418803 | 91 | 0.720686 |
4f9c6e2fba22fd24c1170dbc0566524db8e9c868 | 67,676 | h | C | bsp/microchip/same70/bsp/hri/hri_twihs_e70b.h | cazure/rt-thread | 1bdde743433d331740766c895ff867df6268df20 | [
"Apache-2.0"
] | 1 | 2022-03-02T12:48:01.000Z | 2022-03-02T12:48:01.000Z | bsp/microchip/same70/bsp/hri/hri_twihs_e70b.h | cazure/rt-thread | 1bdde743433d331740766c895ff867df6268df20 | [
"Apache-2.0"
] | 1 | 2018-12-20T00:02:50.000Z | 2018-12-20T00:02:50.000Z | bsp/microchip/same70/bsp/hri/hri_twihs_e70b.h | cazure/rt-thread | 1bdde743433d331740766c895ff867df6268df20 | [
"Apache-2.0"
] | null | null | null | /**
* \file
*
* \brief SAM TWIHS
*
* Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
*
* \asf_license_start
*
* \page License
*
* Subject to your compliance with these terms, you may use Microchip
* software and any derivatives exclusively with Microchip products.
* It is your responsibility to comply with third party license terms applicable
* to your use of third party software (including open source software) that
* may accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*
* \asf_license_stop
*/
#ifdef _SAME70_TWIHS_COMPONENT_
#ifndef _HRI_TWIHS_E70B_H_INCLUDED_
#define _HRI_TWIHS_E70B_H_INCLUDED_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <hal_atomic.h>
#if defined(ENABLE_TWIHS_CRITICAL_SECTIONS)
#define TWIHS_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
#define TWIHS_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
#else
#define TWIHS_CRITICAL_SECTION_ENTER()
#define TWIHS_CRITICAL_SECTION_LEAVE()
#endif
typedef uint32_t hri_twihs_cr_reg_t;
typedef uint32_t hri_twihs_cwgr_reg_t;
typedef uint32_t hri_twihs_filtr_reg_t;
typedef uint32_t hri_twihs_iadr_reg_t;
typedef uint32_t hri_twihs_imr_reg_t;
typedef uint32_t hri_twihs_mmr_reg_t;
typedef uint32_t hri_twihs_rhr_reg_t;
typedef uint32_t hri_twihs_smbtr_reg_t;
typedef uint32_t hri_twihs_smr_reg_t;
typedef uint32_t hri_twihs_sr_reg_t;
typedef uint32_t hri_twihs_swmr_reg_t;
typedef uint32_t hri_twihs_thr_reg_t;
typedef uint32_t hri_twihs_wpmr_reg_t;
typedef uint32_t hri_twihs_wpsr_reg_t;
static inline void hri_twihs_set_IMR_TXCOMP_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_TXCOMP;
}
static inline bool hri_twihs_get_IMR_TXCOMP_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_TXCOMP) >> TWIHS_IMR_TXCOMP_Pos;
}
static inline void hri_twihs_write_IMR_TXCOMP_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_TXCOMP;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_TXCOMP;
}
}
static inline void hri_twihs_clear_IMR_TXCOMP_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_TXCOMP;
}
static inline void hri_twihs_set_IMR_RXRDY_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_RXRDY;
}
static inline bool hri_twihs_get_IMR_RXRDY_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_RXRDY) >> TWIHS_IMR_RXRDY_Pos;
}
static inline void hri_twihs_write_IMR_RXRDY_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_RXRDY;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_RXRDY;
}
}
static inline void hri_twihs_clear_IMR_RXRDY_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_RXRDY;
}
static inline void hri_twihs_set_IMR_TXRDY_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_TXRDY;
}
static inline bool hri_twihs_get_IMR_TXRDY_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_TXRDY) >> TWIHS_IMR_TXRDY_Pos;
}
static inline void hri_twihs_write_IMR_TXRDY_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_TXRDY;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_TXRDY;
}
}
static inline void hri_twihs_clear_IMR_TXRDY_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_TXRDY;
}
static inline void hri_twihs_set_IMR_SVACC_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SVACC;
}
static inline bool hri_twihs_get_IMR_SVACC_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_SVACC) >> TWIHS_IMR_SVACC_Pos;
}
static inline void hri_twihs_write_IMR_SVACC_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SVACC;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SVACC;
}
}
static inline void hri_twihs_clear_IMR_SVACC_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SVACC;
}
static inline void hri_twihs_set_IMR_GACC_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_GACC;
}
static inline bool hri_twihs_get_IMR_GACC_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_GACC) >> TWIHS_IMR_GACC_Pos;
}
static inline void hri_twihs_write_IMR_GACC_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_GACC;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_GACC;
}
}
static inline void hri_twihs_clear_IMR_GACC_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_GACC;
}
static inline void hri_twihs_set_IMR_OVRE_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_OVRE;
}
static inline bool hri_twihs_get_IMR_OVRE_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_OVRE) >> TWIHS_IMR_OVRE_Pos;
}
static inline void hri_twihs_write_IMR_OVRE_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_OVRE;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_OVRE;
}
}
static inline void hri_twihs_clear_IMR_OVRE_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_OVRE;
}
static inline void hri_twihs_set_IMR_UNRE_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_UNRE;
}
static inline bool hri_twihs_get_IMR_UNRE_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_UNRE) >> TWIHS_IMR_UNRE_Pos;
}
static inline void hri_twihs_write_IMR_UNRE_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_UNRE;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_UNRE;
}
}
static inline void hri_twihs_clear_IMR_UNRE_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_UNRE;
}
static inline void hri_twihs_set_IMR_NACK_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_NACK;
}
static inline bool hri_twihs_get_IMR_NACK_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_NACK) >> TWIHS_IMR_NACK_Pos;
}
static inline void hri_twihs_write_IMR_NACK_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_NACK;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_NACK;
}
}
static inline void hri_twihs_clear_IMR_NACK_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_NACK;
}
static inline void hri_twihs_set_IMR_ARBLST_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_ARBLST;
}
static inline bool hri_twihs_get_IMR_ARBLST_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_ARBLST) >> TWIHS_IMR_ARBLST_Pos;
}
static inline void hri_twihs_write_IMR_ARBLST_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_ARBLST;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_ARBLST;
}
}
static inline void hri_twihs_clear_IMR_ARBLST_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_ARBLST;
}
static inline void hri_twihs_set_IMR_SCL_WS_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SCL_WS;
}
static inline bool hri_twihs_get_IMR_SCL_WS_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_SCL_WS) >> TWIHS_IMR_SCL_WS_Pos;
}
static inline void hri_twihs_write_IMR_SCL_WS_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SCL_WS;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SCL_WS;
}
}
static inline void hri_twihs_clear_IMR_SCL_WS_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SCL_WS;
}
static inline void hri_twihs_set_IMR_EOSACC_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_EOSACC;
}
static inline bool hri_twihs_get_IMR_EOSACC_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_EOSACC) >> TWIHS_IMR_EOSACC_Pos;
}
static inline void hri_twihs_write_IMR_EOSACC_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_EOSACC;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_EOSACC;
}
}
static inline void hri_twihs_clear_IMR_EOSACC_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_EOSACC;
}
static inline void hri_twihs_set_IMR_MCACK_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_MCACK;
}
static inline bool hri_twihs_get_IMR_MCACK_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_MCACK) >> TWIHS_IMR_MCACK_Pos;
}
static inline void hri_twihs_write_IMR_MCACK_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_MCACK;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_MCACK;
}
}
static inline void hri_twihs_clear_IMR_MCACK_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_MCACK;
}
static inline void hri_twihs_set_IMR_TOUT_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_TOUT;
}
static inline bool hri_twihs_get_IMR_TOUT_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_TOUT) >> TWIHS_IMR_TOUT_Pos;
}
static inline void hri_twihs_write_IMR_TOUT_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_TOUT;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_TOUT;
}
}
static inline void hri_twihs_clear_IMR_TOUT_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_TOUT;
}
static inline void hri_twihs_set_IMR_PECERR_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_PECERR;
}
static inline bool hri_twihs_get_IMR_PECERR_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_PECERR) >> TWIHS_IMR_PECERR_Pos;
}
static inline void hri_twihs_write_IMR_PECERR_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_PECERR;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_PECERR;
}
}
static inline void hri_twihs_clear_IMR_PECERR_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_PECERR;
}
static inline void hri_twihs_set_IMR_SMBDAM_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SMBDAM;
}
static inline bool hri_twihs_get_IMR_SMBDAM_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_SMBDAM) >> TWIHS_IMR_SMBDAM_Pos;
}
static inline void hri_twihs_write_IMR_SMBDAM_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SMBDAM;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SMBDAM;
}
}
static inline void hri_twihs_clear_IMR_SMBDAM_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SMBDAM;
}
static inline void hri_twihs_set_IMR_SMBHHM_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SMBHHM;
}
static inline bool hri_twihs_get_IMR_SMBHHM_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_IMR & TWIHS_IMR_SMBHHM) >> TWIHS_IMR_SMBHHM_Pos;
}
static inline void hri_twihs_write_IMR_SMBHHM_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SMBHHM;
} else {
((Twihs *)hw)->TWIHS_IER = TWIHS_IMR_SMBHHM;
}
}
static inline void hri_twihs_clear_IMR_SMBHHM_bit(const void *const hw)
{
((Twihs *)hw)->TWIHS_IDR = TWIHS_IMR_SMBHHM;
}
static inline void hri_twihs_set_IMR_reg(const void *const hw, hri_twihs_imr_reg_t mask)
{
((Twihs *)hw)->TWIHS_IER = mask;
}
static inline hri_twihs_imr_reg_t hri_twihs_get_IMR_reg(const void *const hw, hri_twihs_imr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_IMR;
tmp &= mask;
return tmp;
}
static inline hri_twihs_imr_reg_t hri_twihs_read_IMR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_IMR;
}
static inline void hri_twihs_write_IMR_reg(const void *const hw, hri_twihs_imr_reg_t data)
{
((Twihs *)hw)->TWIHS_IER = data;
((Twihs *)hw)->TWIHS_IDR = ~data;
}
static inline void hri_twihs_clear_IMR_reg(const void *const hw, hri_twihs_imr_reg_t mask)
{
((Twihs *)hw)->TWIHS_IDR = mask;
}
static inline bool hri_twihs_get_SR_TXCOMP_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_TXCOMP) > 0;
}
static inline bool hri_twihs_get_SR_RXRDY_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_RXRDY) > 0;
}
static inline bool hri_twihs_get_SR_TXRDY_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_TXRDY) > 0;
}
static inline bool hri_twihs_get_SR_SVREAD_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SVREAD) > 0;
}
static inline bool hri_twihs_get_SR_SVACC_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SVACC) > 0;
}
static inline bool hri_twihs_get_SR_GACC_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_GACC) > 0;
}
static inline bool hri_twihs_get_SR_OVRE_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_OVRE) > 0;
}
static inline bool hri_twihs_get_SR_UNRE_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_UNRE) > 0;
}
static inline bool hri_twihs_get_SR_NACK_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_NACK) > 0;
}
static inline bool hri_twihs_get_SR_ARBLST_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_ARBLST) > 0;
}
static inline bool hri_twihs_get_SR_SCLWS_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SCLWS) > 0;
}
static inline bool hri_twihs_get_SR_EOSACC_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_EOSACC) > 0;
}
static inline bool hri_twihs_get_SR_MCACK_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_MCACK) > 0;
}
static inline bool hri_twihs_get_SR_TOUT_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_TOUT) > 0;
}
static inline bool hri_twihs_get_SR_PECERR_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_PECERR) > 0;
}
static inline bool hri_twihs_get_SR_SMBDAM_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SMBDAM) > 0;
}
static inline bool hri_twihs_get_SR_SMBHHM_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SMBHHM) > 0;
}
static inline bool hri_twihs_get_SR_SCL_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SCL) > 0;
}
static inline bool hri_twihs_get_SR_SDA_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_SR & TWIHS_SR_SDA) > 0;
}
static inline hri_twihs_sr_reg_t hri_twihs_get_SR_reg(const void *const hw, hri_twihs_sr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SR;
tmp &= mask;
return tmp;
}
static inline hri_twihs_sr_reg_t hri_twihs_read_SR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_SR;
}
static inline hri_twihs_rhr_reg_t hri_twihs_get_RHR_RXDATA_bf(const void *const hw, hri_twihs_rhr_reg_t mask)
{
return (((Twihs *)hw)->TWIHS_RHR & TWIHS_RHR_RXDATA(mask)) >> TWIHS_RHR_RXDATA_Pos;
}
static inline hri_twihs_rhr_reg_t hri_twihs_read_RHR_RXDATA_bf(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_RHR & TWIHS_RHR_RXDATA_Msk) >> TWIHS_RHR_RXDATA_Pos;
}
static inline hri_twihs_rhr_reg_t hri_twihs_get_RHR_reg(const void *const hw, hri_twihs_rhr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_RHR;
tmp &= mask;
return tmp;
}
static inline hri_twihs_rhr_reg_t hri_twihs_read_RHR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_RHR;
}
static inline bool hri_twihs_get_WPSR_WPVS_bit(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_WPSR & TWIHS_WPSR_WPVS) > 0;
}
static inline hri_twihs_wpsr_reg_t hri_twihs_get_WPSR_WPVSRC_bf(const void *const hw, hri_twihs_wpsr_reg_t mask)
{
return (((Twihs *)hw)->TWIHS_WPSR & TWIHS_WPSR_WPVSRC(mask)) >> TWIHS_WPSR_WPVSRC_Pos;
}
static inline hri_twihs_wpsr_reg_t hri_twihs_read_WPSR_WPVSRC_bf(const void *const hw)
{
return (((Twihs *)hw)->TWIHS_WPSR & TWIHS_WPSR_WPVSRC_Msk) >> TWIHS_WPSR_WPVSRC_Pos;
}
static inline hri_twihs_wpsr_reg_t hri_twihs_get_WPSR_reg(const void *const hw, hri_twihs_wpsr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_WPSR;
tmp &= mask;
return tmp;
}
static inline hri_twihs_wpsr_reg_t hri_twihs_read_WPSR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_WPSR;
}
static inline void hri_twihs_set_MMR_MREAD_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR |= TWIHS_MMR_MREAD;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_MMR_MREAD_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp = (tmp & TWIHS_MMR_MREAD) >> TWIHS_MMR_MREAD_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_MMR_MREAD_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp &= ~TWIHS_MMR_MREAD;
tmp |= value << TWIHS_MMR_MREAD_Pos;
((Twihs *)hw)->TWIHS_MMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_MMR_MREAD_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR &= ~TWIHS_MMR_MREAD;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_MMR_MREAD_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR ^= TWIHS_MMR_MREAD;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_MMR_IADRSZ_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR |= TWIHS_MMR_IADRSZ(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_mmr_reg_t hri_twihs_get_MMR_IADRSZ_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp = (tmp & TWIHS_MMR_IADRSZ(mask)) >> TWIHS_MMR_IADRSZ_Pos;
return tmp;
}
static inline void hri_twihs_write_MMR_IADRSZ_bf(const void *const hw, hri_twihs_mmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp &= ~TWIHS_MMR_IADRSZ_Msk;
tmp |= TWIHS_MMR_IADRSZ(data);
((Twihs *)hw)->TWIHS_MMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_MMR_IADRSZ_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR &= ~TWIHS_MMR_IADRSZ(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_MMR_IADRSZ_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR ^= TWIHS_MMR_IADRSZ(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_mmr_reg_t hri_twihs_read_MMR_IADRSZ_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp = (tmp & TWIHS_MMR_IADRSZ_Msk) >> TWIHS_MMR_IADRSZ_Pos;
return tmp;
}
static inline void hri_twihs_set_MMR_DADR_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR |= TWIHS_MMR_DADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_mmr_reg_t hri_twihs_get_MMR_DADR_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp = (tmp & TWIHS_MMR_DADR(mask)) >> TWIHS_MMR_DADR_Pos;
return tmp;
}
static inline void hri_twihs_write_MMR_DADR_bf(const void *const hw, hri_twihs_mmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp &= ~TWIHS_MMR_DADR_Msk;
tmp |= TWIHS_MMR_DADR(data);
((Twihs *)hw)->TWIHS_MMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_MMR_DADR_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR &= ~TWIHS_MMR_DADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_MMR_DADR_bf(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR ^= TWIHS_MMR_DADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_mmr_reg_t hri_twihs_read_MMR_DADR_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp = (tmp & TWIHS_MMR_DADR_Msk) >> TWIHS_MMR_DADR_Pos;
return tmp;
}
static inline void hri_twihs_set_MMR_reg(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_mmr_reg_t hri_twihs_get_MMR_reg(const void *const hw, hri_twihs_mmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_MMR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_MMR_reg(const void *const hw, hri_twihs_mmr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_MMR_reg(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_MMR_reg(const void *const hw, hri_twihs_mmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_MMR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_mmr_reg_t hri_twihs_read_MMR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_MMR;
}
static inline void hri_twihs_set_SMR_NACKEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_NACKEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_NACKEN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_NACKEN) >> TWIHS_SMR_NACKEN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_NACKEN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_NACKEN;
tmp |= value << TWIHS_SMR_NACKEN_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_NACKEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_NACKEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_NACKEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_NACKEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_SMDA_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SMDA;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_SMDA_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SMDA) >> TWIHS_SMR_SMDA_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_SMDA_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SMDA;
tmp |= value << TWIHS_SMR_SMDA_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SMDA_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SMDA;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SMDA_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SMDA;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_SMHH_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SMHH;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_SMHH_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SMHH) >> TWIHS_SMR_SMHH_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_SMHH_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SMHH;
tmp |= value << TWIHS_SMR_SMHH_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SMHH_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SMHH;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SMHH_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SMHH;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_SCLWSDIS_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SCLWSDIS;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_SCLWSDIS_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SCLWSDIS) >> TWIHS_SMR_SCLWSDIS_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_SCLWSDIS_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SCLWSDIS;
tmp |= value << TWIHS_SMR_SCLWSDIS_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SCLWSDIS_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SCLWSDIS;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SCLWSDIS_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SCLWSDIS;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_SADR1EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SADR1EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_SADR1EN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SADR1EN) >> TWIHS_SMR_SADR1EN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_SADR1EN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SADR1EN;
tmp |= value << TWIHS_SMR_SADR1EN_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SADR1EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SADR1EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SADR1EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SADR1EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_SADR2EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SADR2EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_SADR2EN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SADR2EN) >> TWIHS_SMR_SADR2EN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_SADR2EN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SADR2EN;
tmp |= value << TWIHS_SMR_SADR2EN_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SADR2EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SADR2EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SADR2EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SADR2EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_SADR3EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SADR3EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_SADR3EN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SADR3EN) >> TWIHS_SMR_SADR3EN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_SADR3EN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SADR3EN;
tmp |= value << TWIHS_SMR_SADR3EN_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SADR3EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SADR3EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SADR3EN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SADR3EN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_DATAMEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_DATAMEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_SMR_DATAMEN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_DATAMEN) >> TWIHS_SMR_DATAMEN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_SMR_DATAMEN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_DATAMEN;
tmp |= value << TWIHS_SMR_DATAMEN_Pos;
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_DATAMEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_DATAMEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_DATAMEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_DATAMEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_SMR_MASK_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_MASK(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smr_reg_t hri_twihs_get_SMR_MASK_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_MASK(mask)) >> TWIHS_SMR_MASK_Pos;
return tmp;
}
static inline void hri_twihs_write_SMR_MASK_bf(const void *const hw, hri_twihs_smr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_MASK_Msk;
tmp |= TWIHS_SMR_MASK(data);
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_MASK_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_MASK(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_MASK_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_MASK(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smr_reg_t hri_twihs_read_SMR_MASK_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_MASK_Msk) >> TWIHS_SMR_MASK_Pos;
return tmp;
}
static inline void hri_twihs_set_SMR_SADR_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= TWIHS_SMR_SADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smr_reg_t hri_twihs_get_SMR_SADR_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SADR(mask)) >> TWIHS_SMR_SADR_Pos;
return tmp;
}
static inline void hri_twihs_write_SMR_SADR_bf(const void *const hw, hri_twihs_smr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= ~TWIHS_SMR_SADR_Msk;
tmp |= TWIHS_SMR_SADR(data);
((Twihs *)hw)->TWIHS_SMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_SADR_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~TWIHS_SMR_SADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_SADR_bf(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= TWIHS_SMR_SADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smr_reg_t hri_twihs_read_SMR_SADR_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp = (tmp & TWIHS_SMR_SADR_Msk) >> TWIHS_SMR_SADR_Pos;
return tmp;
}
static inline void hri_twihs_set_SMR_reg(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smr_reg_t hri_twihs_get_SMR_reg(const void *const hw, hri_twihs_smr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_SMR_reg(const void *const hw, hri_twihs_smr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMR_reg(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMR_reg(const void *const hw, hri_twihs_smr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smr_reg_t hri_twihs_read_SMR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_SMR;
}
static inline void hri_twihs_set_IADR_IADR_bf(const void *const hw, hri_twihs_iadr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR |= TWIHS_IADR_IADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_iadr_reg_t hri_twihs_get_IADR_IADR_bf(const void *const hw, hri_twihs_iadr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_IADR;
tmp = (tmp & TWIHS_IADR_IADR(mask)) >> TWIHS_IADR_IADR_Pos;
return tmp;
}
static inline void hri_twihs_write_IADR_IADR_bf(const void *const hw, hri_twihs_iadr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_IADR;
tmp &= ~TWIHS_IADR_IADR_Msk;
tmp |= TWIHS_IADR_IADR(data);
((Twihs *)hw)->TWIHS_IADR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_IADR_IADR_bf(const void *const hw, hri_twihs_iadr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR &= ~TWIHS_IADR_IADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_IADR_IADR_bf(const void *const hw, hri_twihs_iadr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR ^= TWIHS_IADR_IADR(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_iadr_reg_t hri_twihs_read_IADR_IADR_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_IADR;
tmp = (tmp & TWIHS_IADR_IADR_Msk) >> TWIHS_IADR_IADR_Pos;
return tmp;
}
static inline void hri_twihs_set_IADR_reg(const void *const hw, hri_twihs_iadr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_iadr_reg_t hri_twihs_get_IADR_reg(const void *const hw, hri_twihs_iadr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_IADR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_IADR_reg(const void *const hw, hri_twihs_iadr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_IADR_reg(const void *const hw, hri_twihs_iadr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_IADR_reg(const void *const hw, hri_twihs_iadr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_IADR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_iadr_reg_t hri_twihs_read_IADR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_IADR;
}
static inline void hri_twihs_set_CWGR_CLDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR |= TWIHS_CWGR_CLDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_get_CWGR_CLDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_CLDIV(mask)) >> TWIHS_CWGR_CLDIV_Pos;
return tmp;
}
static inline void hri_twihs_write_CWGR_CLDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp &= ~TWIHS_CWGR_CLDIV_Msk;
tmp |= TWIHS_CWGR_CLDIV(data);
((Twihs *)hw)->TWIHS_CWGR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_CWGR_CLDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR &= ~TWIHS_CWGR_CLDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_CWGR_CLDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR ^= TWIHS_CWGR_CLDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_read_CWGR_CLDIV_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_CLDIV_Msk) >> TWIHS_CWGR_CLDIV_Pos;
return tmp;
}
static inline void hri_twihs_set_CWGR_CHDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR |= TWIHS_CWGR_CHDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_get_CWGR_CHDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_CHDIV(mask)) >> TWIHS_CWGR_CHDIV_Pos;
return tmp;
}
static inline void hri_twihs_write_CWGR_CHDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp &= ~TWIHS_CWGR_CHDIV_Msk;
tmp |= TWIHS_CWGR_CHDIV(data);
((Twihs *)hw)->TWIHS_CWGR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_CWGR_CHDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR &= ~TWIHS_CWGR_CHDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_CWGR_CHDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR ^= TWIHS_CWGR_CHDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_read_CWGR_CHDIV_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_CHDIV_Msk) >> TWIHS_CWGR_CHDIV_Pos;
return tmp;
}
static inline void hri_twihs_set_CWGR_CKDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR |= TWIHS_CWGR_CKDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_get_CWGR_CKDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_CKDIV(mask)) >> TWIHS_CWGR_CKDIV_Pos;
return tmp;
}
static inline void hri_twihs_write_CWGR_CKDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp &= ~TWIHS_CWGR_CKDIV_Msk;
tmp |= TWIHS_CWGR_CKDIV(data);
((Twihs *)hw)->TWIHS_CWGR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_CWGR_CKDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR &= ~TWIHS_CWGR_CKDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_CWGR_CKDIV_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR ^= TWIHS_CWGR_CKDIV(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_read_CWGR_CKDIV_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_CKDIV_Msk) >> TWIHS_CWGR_CKDIV_Pos;
return tmp;
}
static inline void hri_twihs_set_CWGR_HOLD_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR |= TWIHS_CWGR_HOLD(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_get_CWGR_HOLD_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_HOLD(mask)) >> TWIHS_CWGR_HOLD_Pos;
return tmp;
}
static inline void hri_twihs_write_CWGR_HOLD_bf(const void *const hw, hri_twihs_cwgr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp &= ~TWIHS_CWGR_HOLD_Msk;
tmp |= TWIHS_CWGR_HOLD(data);
((Twihs *)hw)->TWIHS_CWGR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_CWGR_HOLD_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR &= ~TWIHS_CWGR_HOLD(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_CWGR_HOLD_bf(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR ^= TWIHS_CWGR_HOLD(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_read_CWGR_HOLD_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp = (tmp & TWIHS_CWGR_HOLD_Msk) >> TWIHS_CWGR_HOLD_Pos;
return tmp;
}
static inline void hri_twihs_set_CWGR_reg(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_get_CWGR_reg(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_CWGR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_CWGR_reg(const void *const hw, hri_twihs_cwgr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_CWGR_reg(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_CWGR_reg(const void *const hw, hri_twihs_cwgr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CWGR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_cwgr_reg_t hri_twihs_read_CWGR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_CWGR;
}
static inline void hri_twihs_set_SMBTR_PRESC_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR |= TWIHS_SMBTR_PRESC(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_get_SMBTR_PRESC_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_PRESC(mask)) >> TWIHS_SMBTR_PRESC_Pos;
return tmp;
}
static inline void hri_twihs_write_SMBTR_PRESC_bf(const void *const hw, hri_twihs_smbtr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp &= ~TWIHS_SMBTR_PRESC_Msk;
tmp |= TWIHS_SMBTR_PRESC(data);
((Twihs *)hw)->TWIHS_SMBTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMBTR_PRESC_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR &= ~TWIHS_SMBTR_PRESC(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMBTR_PRESC_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR ^= TWIHS_SMBTR_PRESC(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_read_SMBTR_PRESC_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_PRESC_Msk) >> TWIHS_SMBTR_PRESC_Pos;
return tmp;
}
static inline void hri_twihs_set_SMBTR_TLOWS_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR |= TWIHS_SMBTR_TLOWS(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_get_SMBTR_TLOWS_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_TLOWS(mask)) >> TWIHS_SMBTR_TLOWS_Pos;
return tmp;
}
static inline void hri_twihs_write_SMBTR_TLOWS_bf(const void *const hw, hri_twihs_smbtr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp &= ~TWIHS_SMBTR_TLOWS_Msk;
tmp |= TWIHS_SMBTR_TLOWS(data);
((Twihs *)hw)->TWIHS_SMBTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMBTR_TLOWS_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR &= ~TWIHS_SMBTR_TLOWS(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMBTR_TLOWS_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR ^= TWIHS_SMBTR_TLOWS(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_read_SMBTR_TLOWS_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_TLOWS_Msk) >> TWIHS_SMBTR_TLOWS_Pos;
return tmp;
}
static inline void hri_twihs_set_SMBTR_TLOWM_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR |= TWIHS_SMBTR_TLOWM(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_get_SMBTR_TLOWM_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_TLOWM(mask)) >> TWIHS_SMBTR_TLOWM_Pos;
return tmp;
}
static inline void hri_twihs_write_SMBTR_TLOWM_bf(const void *const hw, hri_twihs_smbtr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp &= ~TWIHS_SMBTR_TLOWM_Msk;
tmp |= TWIHS_SMBTR_TLOWM(data);
((Twihs *)hw)->TWIHS_SMBTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMBTR_TLOWM_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR &= ~TWIHS_SMBTR_TLOWM(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMBTR_TLOWM_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR ^= TWIHS_SMBTR_TLOWM(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_read_SMBTR_TLOWM_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_TLOWM_Msk) >> TWIHS_SMBTR_TLOWM_Pos;
return tmp;
}
static inline void hri_twihs_set_SMBTR_THMAX_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR |= TWIHS_SMBTR_THMAX(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_get_SMBTR_THMAX_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_THMAX(mask)) >> TWIHS_SMBTR_THMAX_Pos;
return tmp;
}
static inline void hri_twihs_write_SMBTR_THMAX_bf(const void *const hw, hri_twihs_smbtr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp &= ~TWIHS_SMBTR_THMAX_Msk;
tmp |= TWIHS_SMBTR_THMAX(data);
((Twihs *)hw)->TWIHS_SMBTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMBTR_THMAX_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR &= ~TWIHS_SMBTR_THMAX(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMBTR_THMAX_bf(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR ^= TWIHS_SMBTR_THMAX(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_read_SMBTR_THMAX_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp = (tmp & TWIHS_SMBTR_THMAX_Msk) >> TWIHS_SMBTR_THMAX_Pos;
return tmp;
}
static inline void hri_twihs_set_SMBTR_reg(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_get_SMBTR_reg(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SMBTR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_SMBTR_reg(const void *const hw, hri_twihs_smbtr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SMBTR_reg(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SMBTR_reg(const void *const hw, hri_twihs_smbtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SMBTR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_smbtr_reg_t hri_twihs_read_SMBTR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_SMBTR;
}
static inline void hri_twihs_set_FILTR_FILT_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR |= TWIHS_FILTR_FILT;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_FILTR_FILT_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp = (tmp & TWIHS_FILTR_FILT) >> TWIHS_FILTR_FILT_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_FILTR_FILT_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp &= ~TWIHS_FILTR_FILT;
tmp |= value << TWIHS_FILTR_FILT_Pos;
((Twihs *)hw)->TWIHS_FILTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_FILTR_FILT_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR &= ~TWIHS_FILTR_FILT;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_FILTR_FILT_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR ^= TWIHS_FILTR_FILT;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_FILTR_PADFEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR |= TWIHS_FILTR_PADFEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_FILTR_PADFEN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp = (tmp & TWIHS_FILTR_PADFEN) >> TWIHS_FILTR_PADFEN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_FILTR_PADFEN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp &= ~TWIHS_FILTR_PADFEN;
tmp |= value << TWIHS_FILTR_PADFEN_Pos;
((Twihs *)hw)->TWIHS_FILTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_FILTR_PADFEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR &= ~TWIHS_FILTR_PADFEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_FILTR_PADFEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR ^= TWIHS_FILTR_PADFEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_FILTR_PADFCFG_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR |= TWIHS_FILTR_PADFCFG;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_FILTR_PADFCFG_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp = (tmp & TWIHS_FILTR_PADFCFG) >> TWIHS_FILTR_PADFCFG_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_FILTR_PADFCFG_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp &= ~TWIHS_FILTR_PADFCFG;
tmp |= value << TWIHS_FILTR_PADFCFG_Pos;
((Twihs *)hw)->TWIHS_FILTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_FILTR_PADFCFG_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR &= ~TWIHS_FILTR_PADFCFG;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_FILTR_PADFCFG_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR ^= TWIHS_FILTR_PADFCFG;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_FILTR_THRES_bf(const void *const hw, hri_twihs_filtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR |= TWIHS_FILTR_THRES(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_filtr_reg_t hri_twihs_get_FILTR_THRES_bf(const void *const hw, hri_twihs_filtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp = (tmp & TWIHS_FILTR_THRES(mask)) >> TWIHS_FILTR_THRES_Pos;
return tmp;
}
static inline void hri_twihs_write_FILTR_THRES_bf(const void *const hw, hri_twihs_filtr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp &= ~TWIHS_FILTR_THRES_Msk;
tmp |= TWIHS_FILTR_THRES(data);
((Twihs *)hw)->TWIHS_FILTR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_FILTR_THRES_bf(const void *const hw, hri_twihs_filtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR &= ~TWIHS_FILTR_THRES(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_FILTR_THRES_bf(const void *const hw, hri_twihs_filtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR ^= TWIHS_FILTR_THRES(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_filtr_reg_t hri_twihs_read_FILTR_THRES_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp = (tmp & TWIHS_FILTR_THRES_Msk) >> TWIHS_FILTR_THRES_Pos;
return tmp;
}
static inline void hri_twihs_set_FILTR_reg(const void *const hw, hri_twihs_filtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_filtr_reg_t hri_twihs_get_FILTR_reg(const void *const hw, hri_twihs_filtr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_FILTR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_FILTR_reg(const void *const hw, hri_twihs_filtr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_FILTR_reg(const void *const hw, hri_twihs_filtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_FILTR_reg(const void *const hw, hri_twihs_filtr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_FILTR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_filtr_reg_t hri_twihs_read_FILTR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_FILTR;
}
static inline void hri_twihs_set_SWMR_SADR1_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR |= TWIHS_SWMR_SADR1(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_get_SWMR_SADR1_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_SADR1(mask)) >> TWIHS_SWMR_SADR1_Pos;
return tmp;
}
static inline void hri_twihs_write_SWMR_SADR1_bf(const void *const hw, hri_twihs_swmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp &= ~TWIHS_SWMR_SADR1_Msk;
tmp |= TWIHS_SWMR_SADR1(data);
((Twihs *)hw)->TWIHS_SWMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SWMR_SADR1_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR &= ~TWIHS_SWMR_SADR1(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SWMR_SADR1_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR ^= TWIHS_SWMR_SADR1(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_read_SWMR_SADR1_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_SADR1_Msk) >> TWIHS_SWMR_SADR1_Pos;
return tmp;
}
static inline void hri_twihs_set_SWMR_SADR2_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR |= TWIHS_SWMR_SADR2(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_get_SWMR_SADR2_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_SADR2(mask)) >> TWIHS_SWMR_SADR2_Pos;
return tmp;
}
static inline void hri_twihs_write_SWMR_SADR2_bf(const void *const hw, hri_twihs_swmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp &= ~TWIHS_SWMR_SADR2_Msk;
tmp |= TWIHS_SWMR_SADR2(data);
((Twihs *)hw)->TWIHS_SWMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SWMR_SADR2_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR &= ~TWIHS_SWMR_SADR2(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SWMR_SADR2_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR ^= TWIHS_SWMR_SADR2(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_read_SWMR_SADR2_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_SADR2_Msk) >> TWIHS_SWMR_SADR2_Pos;
return tmp;
}
static inline void hri_twihs_set_SWMR_SADR3_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR |= TWIHS_SWMR_SADR3(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_get_SWMR_SADR3_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_SADR3(mask)) >> TWIHS_SWMR_SADR3_Pos;
return tmp;
}
static inline void hri_twihs_write_SWMR_SADR3_bf(const void *const hw, hri_twihs_swmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp &= ~TWIHS_SWMR_SADR3_Msk;
tmp |= TWIHS_SWMR_SADR3(data);
((Twihs *)hw)->TWIHS_SWMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SWMR_SADR3_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR &= ~TWIHS_SWMR_SADR3(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SWMR_SADR3_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR ^= TWIHS_SWMR_SADR3(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_read_SWMR_SADR3_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_SADR3_Msk) >> TWIHS_SWMR_SADR3_Pos;
return tmp;
}
static inline void hri_twihs_set_SWMR_DATAM_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR |= TWIHS_SWMR_DATAM(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_get_SWMR_DATAM_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_DATAM(mask)) >> TWIHS_SWMR_DATAM_Pos;
return tmp;
}
static inline void hri_twihs_write_SWMR_DATAM_bf(const void *const hw, hri_twihs_swmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp &= ~TWIHS_SWMR_DATAM_Msk;
tmp |= TWIHS_SWMR_DATAM(data);
((Twihs *)hw)->TWIHS_SWMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SWMR_DATAM_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR &= ~TWIHS_SWMR_DATAM(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SWMR_DATAM_bf(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR ^= TWIHS_SWMR_DATAM(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_read_SWMR_DATAM_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp = (tmp & TWIHS_SWMR_DATAM_Msk) >> TWIHS_SWMR_DATAM_Pos;
return tmp;
}
static inline void hri_twihs_set_SWMR_reg(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_get_SWMR_reg(const void *const hw, hri_twihs_swmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_SWMR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_SWMR_reg(const void *const hw, hri_twihs_swmr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_SWMR_reg(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_SWMR_reg(const void *const hw, hri_twihs_swmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_SWMR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_swmr_reg_t hri_twihs_read_SWMR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_SWMR;
}
static inline void hri_twihs_set_WPMR_WPEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR |= TWIHS_WPMR_WPEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_twihs_get_WPMR_WPEN_bit(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_WPMR;
tmp = (tmp & TWIHS_WPMR_WPEN) >> TWIHS_WPMR_WPEN_Pos;
return (bool)tmp;
}
static inline void hri_twihs_write_WPMR_WPEN_bit(const void *const hw, bool value)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_WPMR;
tmp &= ~TWIHS_WPMR_WPEN;
tmp |= value << TWIHS_WPMR_WPEN_Pos;
((Twihs *)hw)->TWIHS_WPMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_WPMR_WPEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR &= ~TWIHS_WPMR_WPEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_WPMR_WPEN_bit(const void *const hw)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR ^= TWIHS_WPMR_WPEN;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_set_WPMR_WPKEY_bf(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR |= TWIHS_WPMR_WPKEY(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_wpmr_reg_t hri_twihs_get_WPMR_WPKEY_bf(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_WPMR;
tmp = (tmp & TWIHS_WPMR_WPKEY(mask)) >> TWIHS_WPMR_WPKEY_Pos;
return tmp;
}
static inline void hri_twihs_write_WPMR_WPKEY_bf(const void *const hw, hri_twihs_wpmr_reg_t data)
{
uint32_t tmp;
TWIHS_CRITICAL_SECTION_ENTER();
tmp = ((Twihs *)hw)->TWIHS_WPMR;
tmp &= ~TWIHS_WPMR_WPKEY_Msk;
tmp |= TWIHS_WPMR_WPKEY(data);
((Twihs *)hw)->TWIHS_WPMR = tmp;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_WPMR_WPKEY_bf(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR &= ~TWIHS_WPMR_WPKEY(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_WPMR_WPKEY_bf(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR ^= TWIHS_WPMR_WPKEY(mask);
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_wpmr_reg_t hri_twihs_read_WPMR_WPKEY_bf(const void *const hw)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_WPMR;
tmp = (tmp & TWIHS_WPMR_WPKEY_Msk) >> TWIHS_WPMR_WPKEY_Pos;
return tmp;
}
static inline void hri_twihs_set_WPMR_reg(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR |= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_wpmr_reg_t hri_twihs_get_WPMR_reg(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
uint32_t tmp;
tmp = ((Twihs *)hw)->TWIHS_WPMR;
tmp &= mask;
return tmp;
}
static inline void hri_twihs_write_WPMR_reg(const void *const hw, hri_twihs_wpmr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_clear_WPMR_reg(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR &= ~mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_toggle_WPMR_reg(const void *const hw, hri_twihs_wpmr_reg_t mask)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_WPMR ^= mask;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline hri_twihs_wpmr_reg_t hri_twihs_read_WPMR_reg(const void *const hw)
{
return ((Twihs *)hw)->TWIHS_WPMR;
}
static inline void hri_twihs_write_CR_reg(const void *const hw, hri_twihs_cr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_CR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
static inline void hri_twihs_write_THR_reg(const void *const hw, hri_twihs_thr_reg_t data)
{
TWIHS_CRITICAL_SECTION_ENTER();
((Twihs *)hw)->TWIHS_THR = data;
TWIHS_CRITICAL_SECTION_LEAVE();
}
#ifdef __cplusplus
}
#endif
#endif /* _HRI_TWIHS_E70B_H_INCLUDED */
#endif /* _SAME70_TWIHS_COMPONENT_ */
| 27.97685 | 114 | 0.766623 |
8b06e6b003ef3c02e9078932998d2b502502ed09 | 21,359 | h | C | catboost/libs/metrics/metric.h | smokarizadeh/catboost | 81848d19d3469d9d5345120bb3c365298a4a9b38 | [
"Apache-2.0"
] | null | null | null | catboost/libs/metrics/metric.h | smokarizadeh/catboost | 81848d19d3469d9d5345120bb3c365298a4a9b38 | [
"Apache-2.0"
] | null | null | null | catboost/libs/metrics/metric.h | smokarizadeh/catboost | 81848d19d3469d9d5345120bb3c365298a4a9b38 | [
"Apache-2.0"
] | 1 | 2018-08-06T14:13:12.000Z | 2018-08-06T14:13:12.000Z | #pragma once
#include "metric_holder.h"
#include "ders_holder.h"
#include <catboost/libs/data/pair.h>
#include <library/threading/local_executor/local_executor.h>
#include <library/containers/2d_array/2d_array.h>
#include <util/generic/hash.h>
#include <catboost/libs/options/loss_description.h>
#include <catboost/libs/options/metric_options.h>
struct TCustomMetricDescriptor {
void* CustomData;
TMetricHolder (*EvalFunc)(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end, void* customData) = nullptr;
TString (*GetDescriptionFunc)(void* customData) = nullptr;
bool (*IsMaxOptimalFunc)(void* customData) = nullptr;
double (*GetFinalErrorFunc)(const TMetricHolder& error, void* customData) = nullptr;
};
struct TCustomObjectiveDescriptor {
void* CustomData;
void (*CalcDersRange)(int count, const double* approxes, const float* targets,
const float* weights, TDer1Der2* ders, void* customData) = nullptr;
void (*CalcDersMulti)(const TVector<double>& approx, float target, float weight,
TVector<double>* ders, TArray2D<double>* der2, void* customData) = nullptr;
};
struct IMetric {
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const = 0;
virtual TMetricHolder EvalPairwise(const TVector<TVector<double>>& approx,
const TVector<TPair>& pairs,
int begin, int end) const = 0;
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const = 0;
virtual TString GetDescription() const = 0;
virtual bool IsMaxOptimal() const = 0;
virtual EErrorType GetErrorType() const = 0;
virtual double GetFinalError(const TMetricHolder& error) const = 0;
virtual bool IsAdditiveMetric() const = 0;
virtual ~IMetric() {
}
};
struct TMetric: public IMetric {
virtual TMetricHolder EvalPairwise(const TVector<TVector<double>>& approx,
const TVector<TPair>& pairs,
int begin, int end) const override;
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const override;
virtual EErrorType GetErrorType() const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
};
template <class TImpl>
struct TAdditiveMetric: public TMetric {
bool IsAdditiveMetric() const final {
return true;
}
TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const final {
NPar::TLocalExecutor::TExecRangeParams blockParams(begin, end);
blockParams.SetBlockCount(executor.GetThreadCount() + 1);
const int blockSize = blockParams.GetBlockSize();
const ui32 blockCount = blockParams.GetBlockCount();
TVector<TMetricHolder> results(blockCount);
NPar::ParallelFor(executor, 0, blockCount, [&](int blockId) {
const int from = begin + blockId * blockSize;
const int to = Min<int>(begin + (blockId + 1) * blockSize, end);
Y_ASSERT(from < to);
results[blockId] = static_cast<const TImpl*>(this)->EvalSingleThread(approx, target, weight, from, to);
});
TMetricHolder result;
for (const auto& partResult : results) {
result.Add(partResult);
}
return result;
}
};
struct TNonAdditiveMetric: public TMetric {
bool IsAdditiveMetric() const final {
return false;
}
};
struct TPairwiseMetric : public IMetric {
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const override;
virtual EErrorType GetErrorType() const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
};
struct TPairwiseAdditiveMetric : public TPairwiseMetric {
bool IsAdditiveMetric() const final {
return true;
}
};
struct TQuerywiseMetric : public IMetric {
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TMetricHolder EvalPairwise(const TVector<TVector<double>>& approx,
const TVector<TPair>& pairs,
int begin, int end) const override;
virtual EErrorType GetErrorType() const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
};
struct TQuerywiseAdditiveMetric : public TQuerywiseMetric {
bool IsAdditiveMetric() const final {
return true;
}
};
struct TCrossEntropyMetric: public TAdditiveMetric<TCrossEntropyMetric> {
explicit TCrossEntropyMetric(ELossFunction lossFunction);
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
ELossFunction LossFunction;
};
struct TRMSEMetric: public TAdditiveMetric<TRMSEMetric> {
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
virtual bool IsMaxOptimal() const override;
};
class TQuantileMetric : public TAdditiveMetric<TQuantileMetric> {
public:
explicit TQuantileMetric(ELossFunction lossFunction, double alpha = 0.5);
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
ELossFunction LossFunction;
double Alpha;
};
class TLogLinQuantileMetric : public TAdditiveMetric<TLogLinQuantileMetric> {
public:
explicit TLogLinQuantileMetric(double alpha = 0.5);
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
double Alpha;
};
struct TMAPEMetric : public TAdditiveMetric<TMAPEMetric> {
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TPoissonMetric : public TAdditiveMetric<TPoissonMetric> {
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TMultiClassMetric : public TAdditiveMetric<TMultiClassMetric> {
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TMultiClassOneVsAllMetric : public TAdditiveMetric<TMultiClassOneVsAllMetric> {
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TPairLogitMetric : public TPairwiseAdditiveMetric {
virtual TMetricHolder EvalPairwise(const TVector<TVector<double>>& approx,
const TVector<TPair>& pairs,
int begin, int end) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TQueryRMSEMetric : public TQuerywiseAdditiveMetric {
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
double CalcQueryAvrg(int start, int count,
const TVector<double>& approxes,
const TVector<float>& targets,
const TVector<float>& weights) const;
};
struct TR2Metric: public TNonAdditiveMetric {
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
virtual bool IsMaxOptimal() const override;
};
struct TAUCMetric: public TNonAdditiveMetric {
TAUCMetric() = default;
explicit TAUCMetric(int positiveClass);
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
int PositiveClass = 1;
bool IsMultiClass = false;
};
struct TAccuracyMetric : public TAdditiveMetric<TAccuracyMetric> {
TMetricHolder EvalSingleThread(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end) const;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TPrecisionMetric : public TNonAdditiveMetric {
TPrecisionMetric() = default;
explicit TPrecisionMetric(int positiveClass);
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
int PositiveClass = 1;
bool IsMultiClass = false;
};
struct TRecallMetric: public TNonAdditiveMetric {
TRecallMetric() = default;
explicit TRecallMetric(int positiveClass);
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
int PositiveClass = 1;
bool IsMultiClass = false;
};
struct TF1Metric: public TNonAdditiveMetric {
TF1Metric() = default;
explicit TF1Metric(int positiveClass);
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
int PositiveClass = 1;
bool IsMultiClass = false;
};
struct TTotalF1Metric : public TNonAdditiveMetric {
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TMCCMetric : public TNonAdditiveMetric {
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
struct TPairAccuracyMetric : public TPairwiseAdditiveMetric {
virtual TMetricHolder EvalPairwise(const TVector<TVector<double>>& approx,
const TVector<TPair>& pairs,
int begin, int end) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
};
class TCustomMetric: public IMetric {
public:
explicit TCustomMetric(const TCustomMetricDescriptor& descriptor);
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
virtual TMetricHolder EvalPairwise(const TVector<TVector<double>>& approx,
const TVector<TPair>& pairs,
int begin, int end) const override;
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
virtual EErrorType GetErrorType() const override;
virtual double GetFinalError(const TMetricHolder& error) const override;
//we don't now anything about custom metrics
bool IsAdditiveMetric() const final {
return false;
}
private:
TCustomMetricDescriptor Descriptor;
};
class TUserDefinedPerObjectMetric : public TMetric {
public:
explicit TUserDefinedPerObjectMetric(const THashMap<TString, float>& params);
virtual TMetricHolder Eval(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
int begin, int end,
NPar::TLocalExecutor& executor) const override;
bool IsAdditiveMetric() const final {
return true;
}
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
double Alpha;
};
class TUserDefinedQuerywiseMetric : public TQuerywiseAdditiveMetric {
public:
explicit TUserDefinedQuerywiseMetric(const THashMap<TString, float>& params);
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
double Alpha;
};
class TQueryAverage : public TQuerywiseAdditiveMetric {
public:
explicit TQueryAverage(float topSize) : TopSize(topSize) {
CB_ENSURE(topSize > 0, "top size for QueryAverage should be greater than 0");
CB_ENSURE(topSize == (int)topSize, "top size for QueryAverage should be an integer value");
}
virtual TMetricHolder EvalQuerywise(const TVector<TVector<double>>& approx,
const TVector<float>& target,
const TVector<float>& weight,
const TVector<ui32>& queriesId,
const THashMap<ui32, ui32>& queriesSize,
int begin, int end) const override;
virtual TString GetDescription() const override;
virtual bool IsMaxOptimal() const override;
private:
int TopSize;
};
TVector<THolder<IMetric>> CreateMetricFromDescription(const NCatboostOptions::TLossDescription& description, int approxDimension);
TVector<THolder<IMetric>> CreateMetrics(
const NCatboostOptions::TOption<NCatboostOptions::TLossDescription>& lossFunctionOption,
const NCatboostOptions::TCpuOnlyOption<NCatboostOptions::TMetricOptions>& evalMetricOptions,
const TMaybe<TCustomMetricDescriptor>& evalMetricDescriptor,
int approxDimension
);
TVector<THolder<IMetric>> CreateMetricFromDescription(const TString& description, int approxDimension);
ELossFunction GetLossType(const TString& lossDescription);
THashMap<TString, float> GetLossParams(const TString& lossDescription);
TVector<TString> GetMetricsDescription(const TVector<THolder<IMetric>>& metrics);
| 43.324544 | 130 | 0.597125 |
3e4376f611bcf7078a871909ed1da3fc17703f0f | 561 | c | C | packages/PIPS/validation/Transformations/Loop-fusion.sub/loop_fusion07.c | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/validation/Transformations/Loop-fusion.sub/loop_fusion07.c | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/validation/Transformations/Loop-fusion.sub/loop_fusion07.c | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z |
int main() {
double A[1][10000];
{
int lv1, lv2;
for(lv1 = 0; lv1 <= 0; lv1 += 1)
for(lv2 = 0; lv2 <= 9999; lv2 += 1)
A[lv1][lv2] = (double) 1.0;
}
double B[1][10000];
{
int lv1, lv2;
for(lv1 = 0; lv1 <= 0; lv1 += 1)
for(lv2 = 0; lv2 <= 9999; lv2 += 1)
B[lv1][lv2] = (double) 1.0;
}
double C[1][10000];
{
int lv1, lv2;
for(lv1 = 0; lv1 <= 0; lv1 += 1)
for(lv2 = 0; lv2 <= 9999; lv2 += 1)
C[lv1][lv2] = A[lv1][lv2]+B[lv1][lv2];
}
}
| 20.035714 | 50 | 0.397504 |
e332a7a60660cce405dc09f6bfe7367694531320 | 646 | h | C | sqlite/ext/comdb2/comdb2systblInt.h | bowlofstew/comdb2 | 47fed5ab1c950508855952249985c17cb4ef23c5 | [
"Apache-2.0"
] | null | null | null | sqlite/ext/comdb2/comdb2systblInt.h | bowlofstew/comdb2 | 47fed5ab1c950508855952249985c17cb4ef23c5 | [
"Apache-2.0"
] | null | null | null | sqlite/ext/comdb2/comdb2systblInt.h | bowlofstew/comdb2 | 47fed5ab1c950508855952249985c17cb4ef23c5 | [
"Apache-2.0"
] | null | null | null | #include "sqlite3.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
const sqlite3_module systblTablesModule;
const sqlite3_module systblColumnsModule;
const sqlite3_module systblKeysModule;
const sqlite3_module systblFieldsModule;
const sqlite3_module systblConstraintsModule;
const sqlite3_module systblTblSizeModule;
const sqlite3_module systblSPsModule;
const sqlite3_module systblUsersModule;
const sqlite3_module systblTablePermissionsModule;
const sqlite3_module systblTriggersModule;
/* Simple yes/no answer for booleans */
#define YESNO(x) ((x) ? "Y" : "N")
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
| 26.916667 | 50 | 0.803406 |
e2694d7667642799f81a9a79853f474c960d2936 | 780 | c | C | Exam-Problems/Task-44/main.c | kgolov/uni-os-materials | f2dac347ac17fe330fc821d7d37d14d99be67a40 | [
"MIT"
] | null | null | null | Exam-Problems/Task-44/main.c | kgolov/uni-os-materials | f2dac347ac17fe330fc821d7d37d14d99be67a40 | [
"MIT"
] | null | null | null | Exam-Problems/Task-44/main.c | kgolov/uni-os-materials | f2dac347ac17fe330fc821d7d37d14d99be67a40 | [
"MIT"
] | null | null | null | #include <unistd.h>
#include <stdlib.h>
#include <err.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
int main() {
while (1) {
if (write(1, "Enter command> ", 15) <= 0) {
err(1, "Error writing to stdout");
}
char buff[1024];
ssize_t bytes_read = read(0, &buff, sizeof(buff));
if (bytes_read < 0) {
err(2, "Error reading from stdin!");
}
// Change newline to terminating zero
buff[bytes_read - 1] = '\0';
if (strcmp(buff, "exit") == 0) {
break;
}
pid_t pid = fork();
if (pid < 0) {
warn("Error forking process");
continue;
}
else if (pid == 0) {
if (execlp(buff, buff, (char*)NULL) < 0) {
warn("Error executing command %s", buff);
continue;
}
}
wait(NULL);
}
exit(0);
}
| 17.727273 | 52 | 0.571795 |
eb1507e165beac11bb88a4a5062ee4c289b90105 | 296 | h | C | src/physics/pmain.h | Kubic-C/spok-engine | a3400c4664c08c049f778681ffa2ccef0180cc96 | [
"Apache-2.0"
] | null | null | null | src/physics/pmain.h | Kubic-C/spok-engine | a3400c4664c08c049f778681ffa2ccef0180cc96 | [
"Apache-2.0"
] | null | null | null | src/physics/pmain.h | Kubic-C/spok-engine | a3400c4664c08c049f778681ffa2ccef0180cc96 | [
"Apache-2.0"
] | null | null | null | /** pmain.h:
* physics main
*
* declerations for (physics_) init, update, term
*/
#ifndef _SPOK_PHYSICS_PMAIN_H_INCLUDED
#define _SPOK_PHYSICS_PMAIN_H_INCLUDED
#include "spok/spok.h"
bool physics_init();
void physics_update();
void physics_term();
#endif // _SPOK_PHYSICS_PMAIN_H_INCLUDED | 18.5 | 49 | 0.766892 |
169bbc9c596c208bf9ae120ce6125d8984e40831 | 2,990 | c | C | pkscheck.c | cjac/pks | e4e8ffe97c252bee8f5e9969c074b4ec6f6529f5 | [
"BSD-4-Clause"
] | 1 | 2021-12-01T13:32:01.000Z | 2021-12-01T13:32:01.000Z | pkscheck.c | cjac/pks | e4e8ffe97c252bee8f5e9969c074b4ec6f6529f5 | [
"BSD-4-Clause"
] | null | null | null | pkscheck.c | cjac/pks | e4e8ffe97c252bee8f5e9969c074b4ec6f6529f5 | [
"BSD-4-Clause"
] | 1 | 2021-12-01T13:32:11.000Z | 2021-12-01T13:32:11.000Z | const char rcsid_dbcheck_c[] = "$Id: pkscheck.c,v 1.3 2003/02/07 01:01:21 rlaager Exp $";
/*
* Copyright (c) 1996, 1997, 1998, 1999, Marc Horowitz. All rights reserved.
* See the LICENSE file in the release for redistribution information.
*/
#include <db.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "database.h"
#include "globals.h"
#include "kd_internal.h"
void usage(char *argv0)
{
fprintf(stderr,
"%s /db/path\n",
argv0);
exit(1);
}
int main(int argc, char *argv[])
{
char *dir, *str;
DBC *cursor;
DBT ikey, idata, kkey, kdata;
int ret, i;
char buf[1024];
if (argc < 2)
usage(argv[0]);
dir = argv[1];
log_terminal = 1;
if (!kd_open(dir, KD_OPEN_READONLY, &str)) {
fprintf(stderr, "database open failed: %s\n", str);
free(str);
exit(1);
}
if ((ret = (*(worddb->cursor))(worddb, NULL, &cursor, 0))) {
sprintf(buf, "error creating worddb cursor: error = %d", ret);
log_error("main", buf);
}
memset(&ikey, 0, sizeof(ikey));
memset(&idata, 0, sizeof(idata));
memset(&kkey, 0, sizeof(kkey));
memset(&kdata, 0, sizeof(kdata));
for (ret = (*(cursor->c_get))(cursor, &ikey, &idata, DB_FIRST);
ret == 0;
ret = (*(cursor->c_get))(cursor, &ikey, &idata, DB_NEXT)) {
if (idata.size != 12) {
sprintf(buf, "worddb corrupt in entry = \"%.*s\", size = %d\n",
(int) ikey.size, (char *) ikey.data, (int) idata.size);
log_error("main", buf);
}
kkey.size = 4;
kkey.data = ((unsigned char *) idata.data)+8;
if ((*(keydb(&kkey)->get))(keydb(&kkey), NULL, &kkey, &kdata, 0)) {
sprintf(buf, "keyid %02X%02X%02X%02X in worddb but not keydb\n",
((unsigned char *) kkey.data)[0],
((unsigned char *) kkey.data)[1],
((unsigned char *) kkey.data)[2],
((unsigned char *) kkey.data)[3]);
log_error("main", buf);
}
}
(*(cursor->c_close))(cursor);
if ((ret = (*(timedb->cursor))(timedb, NULL, &cursor, 0))) {
sprintf(buf, "error creating timedb cursor: error = %d", ret);
log_error("main", buf);
}
for (ret = (*(cursor->c_get))(cursor, &ikey, &idata, DB_FIRST);
ret == 0;
ret = (*(cursor->c_get))(cursor, &ikey, &idata, DB_NEXT)) {
if (idata.size%12) {
sprintf(buf, "timedb corrupt in entry = \"%.*s\", size = %d\n",
(int) ikey.size, (char *) ikey.data, (int) idata.size);
log_error("main", buf);
}
for (KD_FIRST_ENTRY(i); KD_LAST_ENTRY(i, idata); KD_NEXT_ENTRY(i)) {
kkey.size = 4;
kkey.data = ((unsigned char *) idata.data)+i+8;
if ((*(keydb(&kkey)->get))(keydb(&kkey), NULL, &kkey, &kdata, 0)) {
sprintf(buf, "keyid %02X%02X%02X%02X in timedb but not keydb\n",
((unsigned char *) kkey.data)[0],
((unsigned char *) kkey.data)[1],
((unsigned char *) kkey.data)[2],
((unsigned char *) kkey.data)[3]);
log_error("main", buf);
}
}
}
(*(cursor->c_close))(cursor);
kd_close();
exit(0);
}
| 25.555556 | 89 | 0.571237 |
d9f5cc11cecac45eb01f6d01e0557a8e75d77cf6 | 5,429 | h | C | kernel/fs/fs.h | mosmeh/yagura | 3dcb539cdb6c7bb7eab5bba522f04058c69f0046 | [
"MIT"
] | null | null | null | kernel/fs/fs.h | mosmeh/yagura | 3dcb539cdb6c7bb7eab5bba522f04058c69f0046 | [
"MIT"
] | null | null | null | kernel/fs/fs.h | mosmeh/yagura | 3dcb539cdb6c7bb7eab5bba522f04058c69f0046 | [
"MIT"
] | null | null | null | #pragma once
#include <common/extra.h>
#include <kernel/api/sys/stat.h>
#include <kernel/api/sys/types.h>
#include <kernel/forward.h>
#include <kernel/lock.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#define PATH_SEPARATOR '/'
#define PATH_SEPARATOR_STR "/"
#define ROOT_DIR PATH_SEPARATOR_STR
#define OPEN_MAX 1024
typedef struct file_description {
mutex offset_lock;
struct inode* inode;
atomic_int flags;
off_t offset;
void* private_data;
atomic_size_t ref_count;
} file_description;
typedef struct file_descriptor_table {
file_description** entries;
} file_descriptor_table;
NODISCARD int file_descriptor_table_init(file_descriptor_table*);
void file_descriptor_table_destroy(file_descriptor_table*);
NODISCARD int
file_descriptor_table_clone_from(file_descriptor_table* to,
const file_descriptor_table* from);
typedef void (*destroy_inode_fn)(struct inode*);
typedef struct inode* (*lookup_child_fn)(struct inode*, const char* name);
typedef struct inode* (*create_child_fn)(struct inode*, const char* name,
mode_t mode);
typedef int (*link_child_fn)(struct inode*, const char* name,
struct inode* child);
typedef struct inode* (*unlink_child_fn)(struct inode*, const char* name);
typedef int (*stat_fn)(struct inode*, struct stat* buf);
typedef int (*open_fn)(file_description*, int flags, mode_t mode);
typedef int (*close_fn)(file_description*);
typedef ssize_t (*read_fn)(file_description*, void* buffer, size_t count);
typedef ssize_t (*write_fn)(file_description*, const void* buffer,
size_t count);
typedef uintptr_t (*mmap_fn)(file_description*, uintptr_t addr, size_t length,
off_t offset, uint16_t page_flags);
typedef int (*truncate_fn)(file_description*, off_t length);
typedef int (*ioctl_fn)(file_description*, int request, void* argp);
struct getdents_ctx;
typedef bool (*getdents_callback_fn)(struct getdents_ctx*, const char* name,
uint8_t type);
typedef int (*getdents_fn)(struct getdents_ctx*, file_description*,
getdents_callback_fn callback);
typedef struct file_ops {
destroy_inode_fn destroy_inode;
lookup_child_fn lookup_child;
create_child_fn create_child;
link_child_fn link_child;
unlink_child_fn unlink_child;
open_fn open;
stat_fn stat;
close_fn close;
read_fn read;
write_fn write;
mmap_fn mmap;
truncate_fn truncate;
ioctl_fn ioctl;
getdents_fn getdents;
} file_ops;
struct inode {
struct inode* fs_root_inode;
file_ops* fops;
dev_t device_id;
_Atomic(unix_socket*) bound_socket;
_Atomic(nlink_t) num_links;
atomic_size_t ref_count;
mode_t mode;
};
void inode_ref(struct inode*);
void inode_unref(struct inode*);
void inode_destroy(struct inode*);
NODISCARD struct inode* inode_lookup_child(struct inode*, const char* name);
NODISCARD struct inode* inode_create_child(struct inode*, const char* name,
mode_t mode);
NODISCARD int inode_link_child(struct inode*, const char* name,
struct inode* child);
NODISCARD int inode_unlink_child(struct inode*, const char* name);
NODISCARD file_description* inode_open(struct inode*, int flags, mode_t mode);
NODISCARD int inode_stat(struct inode*, struct stat* buf);
int file_description_close(file_description*);
NODISCARD ssize_t file_description_read(file_description*, void* buffer,
size_t count);
NODISCARD ssize_t file_description_write(file_description*, const void* buffer,
size_t count);
NODISCARD uintptr_t file_description_mmap(file_description*, uintptr_t addr,
size_t length, off_t offset,
uint16_t page_flags);
NODISCARD int file_description_truncate(file_description*, off_t length);
NODISCARD off_t file_description_lseek(file_description*, off_t offset,
int whence);
NODISCARD int file_description_ioctl(file_description*, int request,
void* argp);
NODISCARD long file_description_getdents(file_description*, void* dirp,
unsigned int count);
NODISCARD int file_description_block(file_description*,
bool (*should_unblock)(file_description*));
NODISCARD int vfs_mount(const char* path, struct inode* fs_root);
struct inode* vfs_get_root(void);
NODISCARD int vfs_register_device(struct inode* device);
NODISCARD file_description* vfs_open(const char* pathname, int flags,
mode_t mode);
NODISCARD int vfs_stat(const char* pathname, struct stat* buf);
NODISCARD struct inode* vfs_create(const char* pathname, mode_t mode);
char* vfs_canonicalize_path(const char* pathname);
struct inode* vfs_resolve_path(const char* pathname, struct inode** out_parent,
const char** out_basename);
uint8_t mode_to_dirent_type(mode_t);
struct inode* fifo_create(void);
void initrd_populate_root_fs(uintptr_t physical_addr, size_t size);
struct inode* tmpfs_create_root(void);
struct inode* procfs_create_root(void);
| 37.965035 | 80 | 0.688525 |
0d2f910598b0c685fc9de10fc4187abaae3579c9 | 784 | h | C | grayAccumulate/mainwindow.h | xiaozhuo1314/VTK-Qt | 7f04184bf9269bfebf51b8539501b241dd2ba5ca | [
"Apache-2.0"
] | 32 | 2019-01-18T15:30:20.000Z | 2022-03-18T07:38:52.000Z | grayAccumulate/mainwindow.h | xiaozhuo1314/VTK-Qt | 7f04184bf9269bfebf51b8539501b241dd2ba5ca | [
"Apache-2.0"
] | null | null | null | grayAccumulate/mainwindow.h | xiaozhuo1314/VTK-Qt | 7f04184bf9269bfebf51b8539501b241dd2ba5ca | [
"Apache-2.0"
] | 18 | 2019-02-25T09:12:23.000Z | 2022-03-10T09:04:25.000Z | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <vtkActor.h>
#include <vtkBarChartActor.h>
#include <vtkFieldData.h>
#include <vtkImageAccumulate.h>
#include <vtkImageData.h>
#include <vtkIntArray.h>
#include <vtkJPEGReader.h>
#include <vtkLegendBoxActor.h>
#include <vtkProperty2D.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkSmartPointer.h>
#include <vtkTextProperty.h>
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingFreeType);
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
public:
void grayAccumulate();
};
#endif // MAINWINDOW_H
| 21.777778 | 38 | 0.778061 |
d4bec38a73568439d1f9fc7fa629f120358da3a2 | 2,378 | c | C | src/menu.c | tobyjaffey/bus-ninja | a62cc7e94df93a7774f7960ea16efede792d8052 | [
"CC0-1.0"
] | 49 | 2015-04-28T16:37:04.000Z | 2022-03-18T01:57:09.000Z | src/menu.c | elasticsheep/bus-ninja | 882079fb03943d58fe8abe864bd00c50a8006c01 | [
"CC0-1.0"
] | 4 | 2018-01-16T11:03:55.000Z | 2019-06-26T20:57:28.000Z | src/menu.c | elasticsheep/bus-ninja | 882079fb03943d58fe8abe864bd00c50a8006c01 | [
"CC0-1.0"
] | 21 | 2015-08-29T12:50:21.000Z | 2021-10-03T17:43:36.000Z | #include "ninja.h"
#include "console.h"
#include "menu.h"
#if 1
/*****************************************************************/
// Define a menu, everything is boilerplate except for the X(SYMBOL, STRING) entries
#undef MENU
#define MENU \
X(MY_MENU_RAT, "rat") \
X(MY_MENU_CAT, "cat") \
X(MY_MENU_DOG, "dog")
#undef X
#define X(sym,str) const uint8_t sym##_str[] PROGMEM = str;
MENU
#undef X
#define X(sym,str) sym,
enum { MENU };
#undef X
#define X(sym,str) sym##_str,
const uint8_t *my_menu[] PROGMEM = { MENU NULL };
#endif
/*****************************************************************/
#if 1
/*****************************************************************/
// Define a menu, everything is boilerplate except for the X(SYMBOL, STRING) entries
#undef MY_MENU2
#define MY_MENU2 \
X(PIG, "pig") \
X(BAT, "bat") \
X(UNIVERSE, "whole universe")
#undef X
#define X(sym,str) const uint8_t sym##_str[] PROGMEM = str;
MY_MENU2
#undef X
#define X(sym,str) sym,
enum { MY_MENU2 };
#undef X
#define X(sym,str) sym##_str,
const uint8_t *my_menu2[] PROGMEM = { MY_MENU2 NULL };
/*****************************************************************/
#endif
static void menu_print_item(uint8_t index, const uint8_t *str_P)
{
console_putdec(index);
console_putc('.');
console_putc(' ');
console_puts_P((const char *)str_P);
console_newline();
}
uint8_t menu_show(const uint8_t **menu_P)
{
const uint8_t *str_P;
uint8_t index = 0;
while((str_P = (const uint8_t *)pgm_read_word(menu_P)) != NULL)
{
menu_print_item(index++, str_P);
menu_P++;
}
return index;
}
uint8_t menu_pick_key(uint8_t max)
{
uint8_t c;
console_set_mode(CONSOLE_MODE_KEY);
do
{
while(!console_key_poll(&c))
driver_tick();
}
while(c < '0' || c >= '0' + max);
console_putc(c);
console_newline();
console_set_mode(CONSOLE_MODE_LINE);
return c - '0';
}
void mymenu(void)
{
menu_pick_key(menu_show(my_menu2));
switch(menu_pick_key(menu_show(my_menu)))
{
case MY_MENU_RAT:
console_puts_P(PSTR("picked rat"));
break;
case MY_MENU_DOG:
console_puts_P(PSTR("picked dog"));
break;
case MY_MENU_CAT:
console_puts_P(PSTR("picked cat"));
break;
}
}
| 21.618182 | 84 | 0.550463 |
3346668e7a0f81df75a9fc60522721ad07db68cd | 2,414 | c | C | BatchRunGVKI/amd/automate.c | giuliojiang/LinuxCScripts | 10b1c2f75fc1c1c707988f12e95187efe0b114ec | [
"Apache-2.0"
] | null | null | null | BatchRunGVKI/amd/automate.c | giuliojiang/LinuxCScripts | 10b1c2f75fc1c1c707988f12e95187efe0b114ec | [
"Apache-2.0"
] | null | null | null | BatchRunGVKI/amd/automate.c | giuliojiang/LinuxCScripts | 10b1c2f75fc1c1c707988f12e95187efe0b114ec | [
"Apache-2.0"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_SIZE 1024
#define OPERATION_SUCCESS 0
#define OPERATION_TERMINATED 1
#define OPERATION_ERROR -1
void removeTrailingNewLine(char* s)
{
for (int i = 0; s[i] != '\0'; i++)
{
if (s[i] == '\n')
{
s[i] = '\0';
return;
}
}
}
int hasTrailingSlash(char* s)
{
return s[strlen(s)-1] == '/';
}
int runTest(char* binPath)
{
char* fileName = (char*) calloc(BUFFER_SIZE, sizeof(char));
if (fileName == NULL)
{
perror("malloc");
exit(1);
}
// read executable name from stdin
if (fgets(fileName, BUFFER_SIZE, stdin) == NULL)
{
goto exitTerminated;
}
removeTrailingNewLine(fileName);
char* command = (char*) calloc(BUFFER_SIZE, sizeof(char));
if (command == NULL)
{
perror("malloc");
exit(1);
}
// delete gvki-0
sprintf(command, "rm -rf gvki-0");
printf("Running command %s\n", command);
// generate command to be executed
if (hasTrailingSlash(binPath))
{
sprintf(command, "%s%s", binPath, fileName);
} else
{
sprintf(command, "%s/%s", binPath, fileName);
}
// run OpenCL program
// printf("Running program %s\n", fileName);
printf("Running command %s\n", command);
int systemResult = system(command);
// generate command for moving gvki
if (systemResult == 0)
{
sprintf(command, "mv gvki-0 gvki-%s", fileName);
printf("Running command %s\n", command);
system(command);
} else
{
printf("Program error\n");
}
exitSuccess:
// delete gvki-0
sprintf(command, "rm -rf gvki-0");
printf("Running command %s\n", command);
system(command);
// free
free(fileName);
free(command);
return OPERATION_SUCCESS;
exitTerminated:
// delete gvki-0
sprintf(command, "rm -rf gvki-0");
printf("Running command %s\n", command);
system(command);
// free
free(fileName);
free(command);
return OPERATION_TERMINATED;
}
int main(int argc, char** argv)
{
if (argc == 2)
{
system("rm -rf gvki-0");
while (runTest(argv[1]) == OPERATION_SUCCESS);
} else
{
printf("Usage: ./automate <binary path>\n");
}
return 0;
} | 20.457627 | 63 | 0.551367 |
0d24a0baea2b6d5e5c690bbf0450898952888113 | 748 | c | C | BreakCode/clang/BreakCode.c | Lian0123/TextArt | 26a2378a48fb1e49df067240fcb1dbd50e346a8e | [
"MIT"
] | 2 | 2018-07-29T05:02:53.000Z | 2021-08-16T10:52:59.000Z | BreakCode/js/BreakCode.js | Lian0123/TextArt | 26a2378a48fb1e49df067240fcb1dbd50e346a8e | [
"MIT"
] | null | null | null | BreakCode/js/BreakCode.js | Lian0123/TextArt | 26a2378a48fb1e49df067240fcb1dbd50e346a8e | [
"MIT"
] | null | null | null | /*
* 這是正常的分號: ;
* 這是希臘的分號: ;
* 這是SQL的引號: `
* 這是注音符號四聲: ˋ
* 這是Go語言常用的: :=
* 這是撒瑪利亞字母: ࠺
* 這是盧恩字母: ᛬
* 這是桑塔利文: ᱺ
* 這是常用的冒號: :
* 這是愛琴海數字: 𐄈
* 這是雙引號: "
* 這是古代記數系統: 𐆐
* 這是等於/assign符號:=
* ~~ 破壞代碼不分你我~~
*/
| 44 | 54 | 0.145722 |
a68a45205b12de9eda435b5288996c1b47cbad5d | 1,796 | h | C | components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | components/viz/service/display_embedder/in_process_gpu_memory_buffer_manager.h | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_
#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_
#include "base/memory/weak_ptr.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
namespace gpu {
class GpuChannelManager;
class GpuMemoryBufferSupport;
}
namespace viz {
class InProcessGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
public:
explicit InProcessGpuMemoryBufferManager(
gpu::GpuChannelManager* channel_manager);
~InProcessGpuMemoryBufferManager() override;
// gpu::GpuMemoryBufferManager:
std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
gpu::SurfaceHandle surface_handle) override;
void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
const gpu::SyncToken& sync_token) override;
private:
void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
int client_id,
const gpu::SyncToken& sync_token);
std::unique_ptr<gpu::GpuMemoryBufferSupport> gpu_memory_buffer_support_;
const int client_id_;
int next_gpu_memory_id_ = 1;
gpu::GpuChannelManager* channel_manager_;
base::WeakPtr<InProcessGpuMemoryBufferManager> weak_ptr_;
base::WeakPtrFactory<InProcessGpuMemoryBufferManager> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(InProcessGpuMemoryBufferManager);
};
} // namespace viz
#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_IN_PROCESS_GPU_MEMORY_BUFFER_MANAGER_H_
| 35.92 | 90 | 0.775056 |
54e77e267b4ecc5dc0bd37a01c579a10b8896bd2 | 1,369 | c | C | ffmpeg-3.2.5/libavcodec/vp9dsp.c | huyu0415/FFmpeg | 7a3f75791cb3255805bf17126d4074a328f46c8c | [
"Apache-2.0"
] | 3,645 | 2016-08-25T09:31:17.000Z | 2022-03-25T06:28:34.000Z | ffmpeg-3.2.5/libavcodec/vp9dsp.c | huyu0415/FFmpeg | 7a3f75791cb3255805bf17126d4074a328f46c8c | [
"Apache-2.0"
] | 389 | 2016-09-05T07:22:37.000Z | 2022-02-08T10:17:06.000Z | ffmpeg-3.2.5/libavcodec/vp9dsp.c | huyu0415/FFmpeg | 7a3f75791cb3255805bf17126d4074a328f46c8c | [
"Apache-2.0"
] | 764 | 2016-08-26T09:19:00.000Z | 2022-03-22T12:07:16.000Z | /*
* VP9 compatible video decoder
*
* Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>
* Copyright (C) 2013 Clément Bœsch <u pkh me>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "vp9dsp.h"
av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact)
{
if (bpp == 8) {
ff_vp9dsp_init_8(dsp);
} else if (bpp == 10) {
ff_vp9dsp_init_10(dsp);
} else {
av_assert0(bpp == 12);
ff_vp9dsp_init_12(dsp);
}
if (ARCH_X86) ff_vp9dsp_init_x86(dsp, bpp, bitexact);
if (ARCH_MIPS) ff_vp9dsp_init_mips(dsp, bpp);
}
| 32.595238 | 79 | 0.702703 |
da9d61c9494beaf365f5953e9113eccffa0f5f41 | 912 | h | C | src/qt/wazzleaddressvalidator.h | MonkeyD-Core/wazzle | c45a8ea2b260accd88dcfa8c4a082c2e5074df25 | [
"MIT"
] | 1 | 2020-05-04T23:21:20.000Z | 2020-05-04T23:21:20.000Z | src/qt/wazzleaddressvalidator.h | MonkeyD-Core/wazzle | c45a8ea2b260accd88dcfa8c4a082c2e5074df25 | [
"MIT"
] | null | null | null | src/qt/wazzleaddressvalidator.h | MonkeyD-Core/wazzle | c45a8ea2b260accd88dcfa8c4a082c2e5074df25 | [
"MIT"
] | null | null | null | // Copyright (c) 2011-2014 The Wazzle Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef WAZZLE_QT_WAZZLEADDRESSVALIDATOR_H
#define WAZZLE_QT_WAZZLEADDRESSVALIDATOR_H
#include <QValidator>
/** Base58 entry widget validator, checks for valid characters and
* removes some whitespace.
*/
class WazzleAddressEntryValidator : public QValidator
{
Q_OBJECT
public:
explicit WazzleAddressEntryValidator(QObject *parent);
State validate(QString &input, int &pos) const;
};
/** Wazzle address widget validator, checks for a valid wazzle address.
*/
class WazzleAddressCheckValidator : public QValidator
{
Q_OBJECT
public:
explicit WazzleAddressCheckValidator(QObject *parent);
State validate(QString &input, int &pos) const;
};
#endif // WAZZLE_QT_WAZZLEADDRESSVALIDATOR_H
| 25.333333 | 71 | 0.776316 |
fbb40630f6340c8fb2769d238675d0914344f052 | 58,741 | c | C | re2c/benchmarks/submatch_dfa_aot/pregen/re2c/03__uri_simple-stadfa.c | adesutherland/crexx | e8d17152c565e9387ee8c33c653b4910b56f5165 | [
"MIT"
] | 8 | 2020-11-08T15:36:14.000Z | 2022-03-27T13:50:07.000Z | re2c/benchmarks/submatch_dfa_aot/pregen/re2c/03__uri_simple-stadfa.c | adesutherland/crexx | e8d17152c565e9387ee8c33c653b4910b56f5165 | [
"MIT"
] | 98 | 2020-11-12T11:49:41.000Z | 2022-03-27T17:24:13.000Z | re2c/benchmarks/submatch_dfa_aot/pregen/re2c/03__uri_simple-stadfa.c | adesutherland/crexx | e8d17152c565e9387ee8c33c653b4910b56f5165 | [
"MIT"
] | 10 | 2021-03-31T13:50:52.000Z | 2021-12-02T03:34:42.000Z | /* Generated by re2c */
#line 1 "../../../benchmarks/submatch_dfa_aot/src/re2c/03__uri_simple.re"
#include <assert.h>
#include <stdlib.h>
#include "common.h"
#line 15 "../../../benchmarks/submatch_dfa_aot/src/re2c/common.re"
typedef struct taglist_t {
struct taglist_t *pred;
long dist;
} taglist_t;
typedef struct taglistpool_t {
taglist_t *head;
taglist_t *next;
taglist_t *last;
} taglistpool_t;
typedef struct {
char *buf;
char *lim;
char *cur;
char *mar;
char *tok;
char *yyt1;
char *yyt10;
char *yyt11;
char *yyt12;
char *yyt13;
char *yyt14;
char *yyt2;
char *yyt3;
char *yyt4;
char *yyt5;
char *yyt6;
char *yyt7;
char *yyt8;
char *yyt9;
taglistpool_t tlp;
int eof;
} input_t;
static inline void taglistpool_clear(taglistpool_t *tlp, input_t *in)
{
tlp->next = tlp->head;
}
static inline void taglistpool_init(taglistpool_t *tlp)
{
static const unsigned size = 1024 * 1024;
tlp->head = (taglist_t*)malloc(size * sizeof(taglist_t));
tlp->next = tlp->head;
tlp->last = tlp->head + size;
}
static inline void taglistpool_free(taglistpool_t *tlp)
{
free(tlp->head);
tlp->head = tlp->next = tlp->last = NULL;
}
static inline void taglist(taglist_t **ptl, const char *b, const char *t, taglistpool_t *tlp)
{
#ifdef GROW_MTAG_LIST
if (tlp->next >= tlp->last) {
const unsigned size = tlp->last - tlp->head;
taglist_t *head = (taglist_t*)malloc(2 * size * sizeof(taglist_t));
memcpy(head, tlp->head, size * sizeof(taglist_t));
free(tlp->head);
tlp->head = head;
tlp->next = head + size;
tlp->last = head + size * 2;
}
#else
assert(tlp->next < tlp->last);
#endif
taglist_t *tl = tlp->next++;
tl->pred = *ptl;
tl->dist = t - b;
*ptl = tl;
}
#line 4 "../../../benchmarks/submatch_dfa_aot/src/re2c/include/fill.re"
#define YYMAXFILL 18
static inline int fill(input_t *in, size_t need)
{
size_t free;
if (in->eof) return 1;
free = in->tok - in->buf;
assert(free >= need);
memmove(in->buf, in->tok, in->lim - in->tok);
in->lim -= free;
in->cur -= free;
in->mar -= free;
in->tok -= free;
if (in->yyt1) in->yyt1 -= free;
if (in->yyt10) in->yyt10 -= free;
if (in->yyt11) in->yyt11 -= free;
if (in->yyt12) in->yyt12 -= free;
if (in->yyt13) in->yyt13 -= free;
if (in->yyt14) in->yyt14 -= free;
if (in->yyt2) in->yyt2 -= free;
if (in->yyt3) in->yyt3 -= free;
if (in->yyt4) in->yyt4 -= free;
if (in->yyt5) in->yyt5 -= free;
if (in->yyt6) in->yyt6 -= free;
if (in->yyt7) in->yyt7 -= free;
if (in->yyt8) in->yyt8 -= free;
if (in->yyt9) in->yyt9 -= free;
in->lim += fread(in->lim, 1, free, stdin);
if (in->lim < in->buf + SIZE) {
in->eof = 1;
memset(in->lim, 0, YYMAXFILL);
in->lim += YYMAXFILL;
}
return 0;
}
static inline void init_input(input_t *in)
{
in->buf = (char*) malloc(SIZE + YYMAXFILL);
in->lim = in->buf + SIZE;
in->cur = in->lim;
in->mar = in->lim;
in->tok = in->lim;
in->yyt1 = 0;
in->yyt10 = 0;
in->yyt11 = 0;
in->yyt12 = 0;
in->yyt13 = 0;
in->yyt14 = 0;
in->yyt2 = 0;
in->yyt3 = 0;
in->yyt4 = 0;
in->yyt5 = 0;
in->yyt6 = 0;
in->yyt7 = 0;
in->yyt8 = 0;
in->yyt9 = 0;
taglistpool_init(&in->tlp);
in->eof = 0;
}
static inline void free_input(input_t *in)
{
free(in->buf);
taglistpool_free(&in->tlp);
}
static int lex(input_t *in, Output *out);
int main(int argc, char **argv)
{
PRE;
input_t in;
Output out;
init_input(&in);
init_output(&out);
switch (lex(&in, &out)) {
case 0: break;
case 1: fprintf(stderr, "*** %s: syntax error\n", argv[0]); break;
case 2: fprintf(stderr, "*** %s: yyfill error\n", argv[0]); break;
default: fprintf(stderr, "*** %s: panic\n", argv[0]); break;
}
flush(&out);
free_output(&out);
free_input(&in);
POST;
return 0;
}
static int lex(input_t *in, Output *out)
{
const char
*s1, *u1, *h1, *r1, *p1, *q1, *f1,
*s2, *u2, *h2, *r2, *p2, *q2, *f2;
loop:
in->tok = in->cur;
#line 205 "gen/re2c/03__uri_simple-stadfa.c"
{
char yych;
if ((in->lim - in->cur) < 18) if (fill(in, 18) != 0) return 1;
yych = *in->cur;
switch (yych) {
case 0x00: goto yy2;
case '+':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy6;
default: goto yy4;
}
yy2:
++in->cur;
#line 3 "../../../benchmarks/submatch_dfa_aot/src/re2c/include/fill.re"
{ return 0; }
#line 283 "gen/re2c/03__uri_simple-stadfa.c"
yy4:
++in->cur;
yy5:
#line 25 "../../../benchmarks/submatch_dfa_aot/src/re2c/03__uri_simple.re"
{ return 1; }
#line 289 "gen/re2c/03__uri_simple-stadfa.c"
yy6:
yych = *(in->mar = ++in->cur);
in->yyt1 = in->cur - 1;
switch (yych) {
case '+':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy7;
case ':': goto yy10;
default: goto yy5;
}
yy7:
++in->cur;
if ((in->lim - in->cur) < 17) if (fill(in, 17) != 0) return 1;
yych = *in->cur;
switch (yych) {
case '+':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z': goto yy7;
case ':': goto yy10;
default: goto yy9;
}
yy9:
in->cur = in->mar;
goto yy5;
yy10:
yych = *++in->cur;
in->yyt2 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy11;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy13;
case '#': goto yy14;
case '/': goto yy15;
case '?': goto yy16;
default: goto yy9;
}
yy11:
++in->cur;
in->yyt3 = in->yyt4 = in->yyt5 = in->yyt6 = in->yyt7 = in->yyt8 = in->yyt10 = in->yyt11 = in->yyt12 = in->yyt13 = NULL;
in->yyt9 = in->yyt14 = in->cur - 1;
yy12:
s1 = in->yyt1;
s2 = in->yyt2;
u1 = in->yyt3;
u2 = in->yyt4;
h1 = in->yyt5;
h2 = in->yyt6;
r1 = in->yyt7;
r2 = in->yyt8;
p1 = in->yyt9;
p2 = in->yyt14;
q1 = in->yyt13;
q2 = in->yyt10;
f1 = in->yyt11;
f2 = in->yyt12;
#line 26 "../../../benchmarks/submatch_dfa_aot/src/re2c/03__uri_simple.re"
{
OUT("scheme: ", s1, s2);
if (u1) OUT("user: ", u1, u2);
if (h1) OUT("host: ", h1, h2);
if (r1) OUT("port: ", r1, r2);
OUT("path: ", p1, p2);
if (q1) OUT("query: ", q1, q2);
if (f1) OUT("fragment: ", f1, f2);
outc(out, '\n');
goto loop;
}
#line 559 "gen/re2c/03__uri_simple-stadfa.c"
yy13:
yych = *++in->cur;
in->yyt3 = in->yyt4 = in->yyt5 = in->yyt6 = in->yyt7 = in->yyt8 = NULL;
in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy18;
case '#': goto yy20;
case '?': goto yy21;
default: goto yy9;
}
yy14:
yych = *++in->cur;
in->yyt3 = in->yyt4 = in->yyt5 = in->yyt6 = in->yyt7 = in->yyt8 = in->yyt10 = in->yyt13 = NULL;
in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy15:
yych = *++in->cur;
in->yyt13 = in->yyt1;
in->yyt3 = in->yyt4 = in->yyt5 = in->yyt6 = in->yyt7 = in->yyt8 = NULL;
in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy18;
case '#': goto yy20;
case '/': goto yy24;
case '?': goto yy21;
default: goto yy9;
}
yy16:
yych = *++in->cur;
in->yyt3 = in->yyt4 = in->yyt5 = in->yyt6 = in->yyt7 = in->yyt8 = NULL;
in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy25;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy26;
case '#': goto yy27;
default: goto yy9;
}
yy17:
++in->cur;
in->yyt10 = in->yyt11 = in->yyt12 = in->yyt13 = NULL;
in->yyt14 = in->cur - 1;
goto yy12;
yy18:
++in->cur;
if ((in->lim - in->cur) < 5) if (fill(in, 5) != 0) return 1;
yych = *in->cur;
yy19:
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy18;
case '#': goto yy20;
case '?': goto yy21;
default: goto yy9;
}
yy20:
yych = *++in->cur;
in->yyt10 = in->yyt13 = NULL;
in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy21:
yych = *++in->cur;
in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy25;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy26;
case '#': goto yy27;
default: goto yy9;
}
yy22:
++in->cur;
in->yyt11 = in->yyt12 = in->cur - 1;
goto yy12;
yy23:
yych = *++in->cur;
in->yyt11 = in->cur - 1;
switch (yych) {
case '\n': goto yy28;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy29;
default: goto yy9;
}
yy24:
yych = *++in->cur;
switch (yych) {
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy31;
case ':': goto yy32;
case '[': goto yy33;
default: goto yy19;
}
yy25:
++in->cur;
in->yyt11 = in->yyt12 = NULL;
in->yyt10 = in->yyt13 = in->cur - 1;
goto yy12;
yy26:
yych = *++in->cur;
in->yyt13 = in->cur - 1;
switch (yych) {
case '\n': goto yy34;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy35;
case '#': goto yy37;
default: goto yy9;
}
yy27:
yych = *++in->cur;
in->yyt10 = in->yyt13 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy28:
++in->cur;
in->yyt12 = in->cur - 1;
goto yy12;
yy29:
++in->cur;
if (in->lim <= in->cur) if (fill(in, 1) != 0) return 1;
yych = *in->cur;
switch (yych) {
case '\n': goto yy28;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy29;
default: goto yy9;
}
yy31:
yych = *++in->cur;
in->yyt2 = in->yyt14;
in->yyt1 = in->yyt13;
in->yyt3 = in->yyt4 = in->yyt10 = in->yyt11 = NULL;
in->yyt5 = in->yyt12 = in->cur - 1;
switch (yych) {
case '\n': goto yy38;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy39;
case '#': goto yy41;
case '/': goto yy42;
case ':': goto yy43;
case '?': goto yy44;
case '@': goto yy45;
case '[': goto yy46;
default: goto yy9;
}
yy32:
yych = *++in->cur;
in->yyt12 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy48;
case '#': goto yy20;
case '/': goto yy18;
case '?': goto yy21;
case '@': goto yy50;
default: goto yy9;
}
yy33:
yych = *++in->cur;
in->yyt10 = in->yyt11 = NULL;
in->yyt5 = in->cur - 1;
switch (yych) {
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy46;
case ']': goto yy51;
default: goto yy9;
}
yy34:
++in->cur;
in->yyt11 = in->yyt12 = NULL;
in->yyt10 = in->cur - 1;
goto yy12;
yy35:
++in->cur;
if ((in->lim - in->cur) < 3) if (fill(in, 3) != 0) return 1;
yych = *in->cur;
switch (yych) {
case '\n': goto yy34;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy35;
case '#': goto yy37;
default: goto yy9;
}
yy37:
yych = *++in->cur;
in->yyt10 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy38:
++in->cur;
in->yyt7 = in->yyt8 = in->yyt10 = in->yyt11 = in->yyt12 = in->yyt13 = NULL;
in->yyt6 = in->yyt9 = in->yyt14 = in->cur - 1;
goto yy12;
yy39:
++in->cur;
if ((in->lim - in->cur) < 13) if (fill(in, 13) != 0) return 1;
yych = *in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt2 = in->yyt14;
in->yyt1 = in->yyt13;
switch (yych) {
case '\n': goto yy38;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy39;
case '#': goto yy41;
case '/': goto yy42;
case ':': goto yy43;
case '?': goto yy44;
case '@': goto yy45;
case '[': goto yy46;
default: goto yy9;
}
yy41:
yych = *++in->cur;
in->yyt7 = in->yyt8 = in->yyt10 = in->yyt13 = NULL;
in->yyt6 = in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy42:
yych = *++in->cur;
in->yyt7 = in->yyt8 = NULL;
in->yyt6 = in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy18;
case '#': goto yy20;
case '?': goto yy21;
default: goto yy9;
}
yy43:
yych = *++in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt6 = in->cur - 1;
switch (yych) {
case '\n': goto yy53;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy54;
case '#': goto yy55;
case '/': goto yy56;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy57;
case '?': goto yy58;
case '@': goto yy59;
default: goto yy9;
}
yy44:
yych = *++in->cur;
in->yyt7 = in->yyt8 = NULL;
in->yyt6 = in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy25;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy26;
case '#': goto yy27;
default: goto yy9;
}
yy45:
yych = *++in->cur;
in->yyt10 = in->yyt12;
in->yyt7 = in->yyt8 = NULL;
in->yyt6 = in->yyt9 = in->yyt11 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy60;
case '#': goto yy20;
case '/':
case ':':
case '@': goto yy18;
case '?': goto yy21;
case '[': goto yy61;
default: goto yy9;
}
yy46:
++in->cur;
if (in->lim <= in->cur) if (fill(in, 1) != 0) return 1;
yych = *in->cur;
switch (yych) {
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy46;
case ']': goto yy51;
default: goto yy9;
}
yy48:
++in->cur;
if ((in->lim - in->cur) < 10) if (fill(in, 10) != 0) return 1;
yych = *in->cur;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy48;
case '#': goto yy20;
case '/': goto yy18;
case '?': goto yy21;
case '@': goto yy50;
default: goto yy9;
}
yy50:
yych = *++in->cur;
in->yyt10 = in->yyt12;
in->yyt11 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy60;
case '#': goto yy20;
case '/':
case ':':
case '@': goto yy18;
case '?': goto yy21;
case '[': goto yy61;
default: goto yy9;
}
yy51:
++in->cur;
if ((in->lim - in->cur) < 8) if (fill(in, 8) != 0) return 1;
yych = *in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt2 = in->yyt14;
in->yyt1 = in->yyt13;
switch (yych) {
case '\n': goto yy38;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy51;
case '#': goto yy41;
case '/':
case '@': goto yy42;
case ':': goto yy62;
case '?': goto yy44;
case '[': goto yy46;
default: goto yy9;
}
yy53:
++in->cur;
in->yyt10 = in->yyt11 = in->yyt12 = in->yyt13 = NULL;
in->yyt7 = in->yyt8 = in->yyt9 = in->yyt14 = in->cur - 1;
goto yy12;
yy54:
yych = *++in->cur;
in->yyt7 = in->yyt8 = in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy48;
case '#': goto yy20;
case '/': goto yy18;
case '?': goto yy21;
case '@': goto yy50;
default: goto yy9;
}
yy55:
yych = *++in->cur;
in->yyt10 = in->yyt13 = NULL;
in->yyt7 = in->yyt8 = in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy56:
yych = *++in->cur;
in->yyt7 = in->yyt8 = in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy18;
case '#': goto yy20;
case '?': goto yy21;
default: goto yy9;
}
yy57:
yych = *++in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt7 = in->cur - 1;
switch (yych) {
case '\n': goto yy63;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy64;
case '#': goto yy65;
case '/': goto yy66;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy67;
case '?': goto yy69;
case '@': goto yy70;
default: goto yy9;
}
yy58:
yych = *++in->cur;
in->yyt7 = in->yyt8 = in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy25;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy26;
case '#': goto yy27;
default: goto yy9;
}
yy59:
yych = *++in->cur;
in->yyt10 = in->yyt12;
in->yyt7 = in->yyt8 = in->yyt9 = in->yyt11 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy60;
case '#': goto yy20;
case '/':
case ':':
case '@': goto yy18;
case '?': goto yy21;
case '[': goto yy61;
default: goto yy9;
}
yy60:
yych = *++in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt2 = in->yyt14;
in->yyt1 = in->yyt13;
in->yyt5 = in->cur - 1;
switch (yych) {
case '\n': goto yy38;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy51;
case '#': goto yy41;
case '/':
case '@': goto yy42;
case ':': goto yy62;
case '?': goto yy44;
case '[': goto yy46;
default: goto yy9;
}
yy61:
yych = *++in->cur;
in->yyt5 = in->cur - 1;
switch (yych) {
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy46;
case ']': goto yy51;
default: goto yy9;
}
yy62:
yych = *++in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt6 = in->cur - 1;
switch (yych) {
case '\n': goto yy53;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy56;
case '#': goto yy55;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy71;
case '?': goto yy58;
default: goto yy9;
}
yy63:
++in->cur;
in->yyt10 = in->yyt11 = in->yyt12 = in->yyt13 = NULL;
in->yyt8 = in->yyt9 = in->yyt14 = in->cur - 1;
goto yy12;
yy64:
yych = *++in->cur;
in->yyt8 = in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy48;
case '#': goto yy20;
case '/': goto yy18;
case '?': goto yy21;
case '@': goto yy50;
default: goto yy9;
}
yy65:
yych = *++in->cur;
in->yyt10 = in->yyt13 = NULL;
in->yyt8 = in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy22;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy23;
default: goto yy9;
}
yy66:
yych = *++in->cur;
in->yyt8 = in->yyt9 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy18;
case '#': goto yy20;
case '?': goto yy21;
default: goto yy9;
}
yy67:
++in->cur;
if ((in->lim - in->cur) < 11) if (fill(in, 11) != 0) return 1;
yych = *in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
switch (yych) {
case '\n': goto yy63;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case ':':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy64;
case '#': goto yy65;
case '/': goto yy66;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy67;
case '?': goto yy69;
case '@': goto yy70;
default: goto yy9;
}
yy69:
yych = *++in->cur;
in->yyt8 = in->yyt9 = in->yyt14 = in->cur - 1;
switch (yych) {
case '\n': goto yy25;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ':':
case ';':
case '=':
case '?':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy26;
case '#': goto yy27;
default: goto yy9;
}
yy70:
yych = *++in->cur;
in->yyt10 = in->yyt12;
in->yyt8 = in->yyt9 = in->yyt11 = in->cur - 1;
switch (yych) {
case '\n': goto yy17;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case ';':
case '=':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy60;
case '#': goto yy20;
case '/':
case ':':
case '@': goto yy18;
case '?': goto yy21;
case '[': goto yy61;
default: goto yy9;
}
yy71:
yych = *++in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
in->yyt7 = in->cur - 1;
switch (yych) {
case '\n': goto yy63;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy66;
case '#': goto yy65;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy72;
case '?': goto yy69;
default: goto yy9;
}
yy72:
++in->cur;
if ((in->lim - in->cur) < 6) if (fill(in, 6) != 0) return 1;
yych = *in->cur;
in->yyt4 = in->yyt11;
in->yyt3 = in->yyt10;
switch (yych) {
case '\n': goto yy63;
case '!':
case '$':
case '%':
case '&':
case '\'':
case '(':
case ')':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case ':':
case ';':
case '=':
case '@':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '_':
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
case 'g':
case 'h':
case 'i':
case 'j':
case 'k':
case 'l':
case 'm':
case 'n':
case 'o':
case 'p':
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
case 'x':
case 'y':
case 'z':
case '~': goto yy66;
case '#': goto yy65;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9': goto yy72;
case '?': goto yy69;
default: goto yy9;
}
}
#line 37 "../../../benchmarks/submatch_dfa_aot/src/re2c/03__uri_simple.re"
}
| 12.778116 | 120 | 0.471187 |
135d90f83d221d22414112bc74281c6cc8ee68bc | 5,380 | c | C | kubernetes/model/io_k8s_api_core_v1_binding.c | zouxiaoliang/nerv-kubernetes-client-c | 07528948c643270fd757d38edc68da8c9628ee7a | [
"Apache-2.0"
] | null | null | null | kubernetes/model/io_k8s_api_core_v1_binding.c | zouxiaoliang/nerv-kubernetes-client-c | 07528948c643270fd757d38edc68da8c9628ee7a | [
"Apache-2.0"
] | null | null | null | kubernetes/model/io_k8s_api_core_v1_binding.c | zouxiaoliang/nerv-kubernetes-client-c | 07528948c643270fd757d38edc68da8c9628ee7a | [
"Apache-2.0"
] | null | null | null | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "io_k8s_api_core_v1_binding.h"
io_k8s_api_core_v1_binding_t *io_k8s_api_core_v1_binding_create(
char *api_version,
char *kind,
io_k8s_apimachinery_pkg_apis_meta_v1_object_meta_t *metadata,
io_k8s_api_core_v1_object_reference_t *target
) {
io_k8s_api_core_v1_binding_t *io_k8s_api_core_v1_binding_local_var = malloc(sizeof(io_k8s_api_core_v1_binding_t));
if (!io_k8s_api_core_v1_binding_local_var) {
return NULL;
}
io_k8s_api_core_v1_binding_local_var->api_version = api_version;
io_k8s_api_core_v1_binding_local_var->kind = kind;
io_k8s_api_core_v1_binding_local_var->metadata = metadata;
io_k8s_api_core_v1_binding_local_var->target = target;
return io_k8s_api_core_v1_binding_local_var;
}
void io_k8s_api_core_v1_binding_free(io_k8s_api_core_v1_binding_t *io_k8s_api_core_v1_binding) {
if(NULL == io_k8s_api_core_v1_binding){
return ;
}
listEntry_t *listEntry;
if (io_k8s_api_core_v1_binding->api_version) {
free(io_k8s_api_core_v1_binding->api_version);
io_k8s_api_core_v1_binding->api_version = NULL;
}
if (io_k8s_api_core_v1_binding->kind) {
free(io_k8s_api_core_v1_binding->kind);
io_k8s_api_core_v1_binding->kind = NULL;
}
if (io_k8s_api_core_v1_binding->metadata) {
io_k8s_apimachinery_pkg_apis_meta_v1_object_meta_free(io_k8s_api_core_v1_binding->metadata);
io_k8s_api_core_v1_binding->metadata = NULL;
}
if (io_k8s_api_core_v1_binding->target) {
io_k8s_api_core_v1_object_reference_free(io_k8s_api_core_v1_binding->target);
io_k8s_api_core_v1_binding->target = NULL;
}
free(io_k8s_api_core_v1_binding);
}
cJSON *io_k8s_api_core_v1_binding_convertToJSON(io_k8s_api_core_v1_binding_t *io_k8s_api_core_v1_binding) {
cJSON *item = cJSON_CreateObject();
// io_k8s_api_core_v1_binding->api_version
if(io_k8s_api_core_v1_binding->api_version) {
if(cJSON_AddStringToObject(item, "apiVersion", io_k8s_api_core_v1_binding->api_version) == NULL) {
goto fail; //String
}
}
// io_k8s_api_core_v1_binding->kind
if(io_k8s_api_core_v1_binding->kind) {
if(cJSON_AddStringToObject(item, "kind", io_k8s_api_core_v1_binding->kind) == NULL) {
goto fail; //String
}
}
// io_k8s_api_core_v1_binding->metadata
if(io_k8s_api_core_v1_binding->metadata) {
cJSON *metadata_local_JSON = io_k8s_apimachinery_pkg_apis_meta_v1_object_meta_convertToJSON(io_k8s_api_core_v1_binding->metadata);
if(metadata_local_JSON == NULL) {
goto fail; //model
}
cJSON_AddItemToObject(item, "metadata", metadata_local_JSON);
if(item->child == NULL) {
goto fail;
}
}
// io_k8s_api_core_v1_binding->target
if (!io_k8s_api_core_v1_binding->target) {
goto fail;
}
cJSON *target_local_JSON = io_k8s_api_core_v1_object_reference_convertToJSON(io_k8s_api_core_v1_binding->target);
if(target_local_JSON == NULL) {
goto fail; //model
}
cJSON_AddItemToObject(item, "target", target_local_JSON);
if(item->child == NULL) {
goto fail;
}
return item;
fail:
if (item) {
cJSON_Delete(item);
}
return NULL;
}
io_k8s_api_core_v1_binding_t *io_k8s_api_core_v1_binding_parseFromJSON(cJSON *io_k8s_api_core_v1_bindingJSON){
io_k8s_api_core_v1_binding_t *io_k8s_api_core_v1_binding_local_var = NULL;
// io_k8s_api_core_v1_binding->api_version
cJSON *api_version = cJSON_GetObjectItemCaseSensitive(io_k8s_api_core_v1_bindingJSON, "apiVersion");
if (api_version) {
if(!cJSON_IsString(api_version))
{
goto end; //String
}
}
// io_k8s_api_core_v1_binding->kind
cJSON *kind = cJSON_GetObjectItemCaseSensitive(io_k8s_api_core_v1_bindingJSON, "kind");
if (kind) {
if(!cJSON_IsString(kind))
{
goto end; //String
}
}
// io_k8s_api_core_v1_binding->metadata
cJSON *metadata = cJSON_GetObjectItemCaseSensitive(io_k8s_api_core_v1_bindingJSON, "metadata");
io_k8s_apimachinery_pkg_apis_meta_v1_object_meta_t *metadata_local_nonprim = NULL;
if (metadata) {
metadata_local_nonprim = io_k8s_apimachinery_pkg_apis_meta_v1_object_meta_parseFromJSON(metadata); //nonprimitive
}
// io_k8s_api_core_v1_binding->target
cJSON *target = cJSON_GetObjectItemCaseSensitive(io_k8s_api_core_v1_bindingJSON, "target");
if (!target) {
goto end;
}
io_k8s_api_core_v1_object_reference_t *target_local_nonprim = NULL;
target_local_nonprim = io_k8s_api_core_v1_object_reference_parseFromJSON(target); //nonprimitive
io_k8s_api_core_v1_binding_local_var = io_k8s_api_core_v1_binding_create (
api_version ? strdup(api_version->valuestring) : NULL,
kind ? strdup(kind->valuestring) : NULL,
metadata ? metadata_local_nonprim : NULL,
target_local_nonprim
);
return io_k8s_api_core_v1_binding_local_var;
end:
if (metadata_local_nonprim) {
io_k8s_apimachinery_pkg_apis_meta_v1_object_meta_free(metadata_local_nonprim);
metadata_local_nonprim = NULL;
}
if (target_local_nonprim) {
io_k8s_api_core_v1_object_reference_free(target_local_nonprim);
target_local_nonprim = NULL;
}
return NULL;
}
| 32.606061 | 134 | 0.74052 |
a179e19a8d34b1c6aeb96168626fd205617cbc8c | 1,791 | h | C | libfreerdp-core/nego.h | viralkatwad12/FreeRDP-old | 0c1e533b09aabc0c8abb1865dbfb79ebe52a7f58 | [
"Apache-2.0"
] | 7 | 2015-01-27T11:11:05.000Z | 2021-12-08T22:25:16.000Z | libfreerdp-core/nego.h | viralkatwad12/FreeRDP-old | 0c1e533b09aabc0c8abb1865dbfb79ebe52a7f58 | [
"Apache-2.0"
] | 3 | 2015-02-09T10:05:57.000Z | 2021-03-05T09:25:48.000Z | libfreerdp-core/nego.h | viralkatwad12/FreeRDP-old | 0c1e533b09aabc0c8abb1865dbfb79ebe52a7f58 | [
"Apache-2.0"
] | 572 | 2015-01-26T04:44:44.000Z | 2022-03-31T12:18:59.000Z | /*
FreeRDP: A Remote Desktop Protocol client.
RDP Protocol Security Negotiation
Copyright 2011 Marc-Andre Moreau <marcandre.moreau@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.
*/
#ifndef __NEGO_H
#define __NEGO_H
#include "frdp.h"
#include "stream.h"
#include "network.h"
enum _NEGO_STATE
{
NEGO_STATE_INITIAL,
NEGO_STATE_NLA, /* Network Level Authentication (TLS implicit) */
NEGO_STATE_TLS, /* TLS Encryption without NLA */
NEGO_STATE_RDP, /* Standard Legacy RDP Encryption */
NEGO_STATE_FAIL, /* Negotiation failure */
NEGO_STATE_FINAL
};
typedef enum _NEGO_STATE NEGO_STATE;
struct _NEGO
{
int port;
char *hostname;
NEGO_STATE state;
int tcp_connected;
struct rdp_network * net;
uint32 selected_protocol;
uint32 requested_protocols;
uint8 enabled_protocols[3];
};
typedef struct _NEGO NEGO;
int nego_connect(NEGO *nego);
void nego_attempt_nla(NEGO *nego);
void nego_attempt_tls(NEGO *nego);
void nego_attempt_rdp(NEGO *nego);
void nego_send(NEGO *nego);
void nego_recv(NEGO *nego, STREAM s);
void nego_process_negotiation_response(NEGO *nego, STREAM s);
void nego_process_negotiation_failure(NEGO *nego, STREAM s);
NEGO* nego_new(struct rdp_network * net);
void nego_init(NEGO *nego);
void nego_free(NEGO *nego);
#endif /* __NEGO_H */
| 26.338235 | 75 | 0.761586 |
a1cd3000d8277e73a157dffaa6c2e9dab44eba2b | 2,216 | c | C | decreasoner.macosx/software/relsat-dist/gmp-3.1/mpfr/tests/tset_str.c | problem-frames/openpf | 55100bd9cca61a182fc00cd3818bd59a6343ae6e | [
"BSD-3-Clause"
] | 1 | 2019-05-03T20:03:11.000Z | 2019-05-03T20:03:11.000Z | decreasoner.x86/software/relsat-dist/gmp-3.1/mpfr/tests/tset_str.c | problem-frames/openpf | 55100bd9cca61a182fc00cd3818bd59a6343ae6e | [
"BSD-3-Clause"
] | null | null | null | decreasoner.x86/software/relsat-dist/gmp-3.1/mpfr/tests/tset_str.c | problem-frames/openpf | 55100bd9cca61a182fc00cd3818bd59a6343ae6e | [
"BSD-3-Clause"
] | null | null | null | /* Test file for mpfr_set_str.
Copyright (C) 1999 PolKA project, Inria Lorraine and Loria
This file is part of the MPFR Library.
The MPFR Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
The MPFR Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with the MPFR Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include <stdio.h>
#include <stdlib.h>
#include "gmp.h"
#include "mpfr.h"
#include <time.h>
#if defined (hpux)
#define srandom srand48
#define random mrand48
#endif
int
main(int argc, char **argv)
{
mpfr_t x; unsigned long k, bd, nc; char *str, *str2;
if (argc==2) { /* tset_str <string> */
mpfr_init2(x, 53);
mpfr_set_str_raw(x, argv[1]);
printf("%1.20e\n", mpfr_get_d(x));
mpfr_clear(x);
exit (0);
}
srandom(time(NULL));
if (argc > 1) { nc = atoi(argv[1]); } else { nc = 53; }
if (nc < 24) { nc = 24; }
bd = random()&8;
str2 = str = (char *) malloc (nc*sizeof(char));
if (bd)
{
for(k = 1; k <= bd; k++)
{ *(str2++) = (random() & 1) + '0'; }
}
else { *(str2++) = '0'; }
*(str2++) = '.';
for(k = 1; k < nc - 17 - bd; k++)
{
*(str2++) = '0' + (random() & 1);
}
*(str2++) = 'e';
sprintf(str2, "%d", random() - (1 << 30));
/* printf("%s\n", str); */
mpfr_init2(x, nc + 10);
mpfr_set_str_raw(x, str);
/* mpfr_print_raw(x); printf("\n"); */
mpfr_set_prec(x, 53);
mpfr_set_str_raw(x, "+110101100.01010000101101000000100111001000101011101110E00");
mpfr_set_str_raw(x, "1.0");
if (mpfr_get_d(x) != 1.0) {
fprintf(stderr, "Error in mpfr_set_str_raw for s=1.0\n"); exit(1);
}
mpfr_clear(x); free(str);
exit (0);
}
| 25.181818 | 84 | 0.630866 |
1f5df8c03b120d02e85cca84416b72f1ea6fbf1f | 3,849 | h | C | src/script.h | 2a5A1Ghu1/DigitalNote-2 | f129cdab4b19dcd98945cfe199c49e5f72f91b8c | [
"MIT"
] | 10 | 2019-06-06T04:08:38.000Z | 2022-01-07T13:02:17.000Z | src/script.h | 2a5A1Ghu1/DigitalNote-2 | f129cdab4b19dcd98945cfe199c49e5f72f91b8c | [
"MIT"
] | 21 | 2019-07-19T18:36:34.000Z | 2022-03-06T09:59:51.000Z | src/script.h | 2a5A1Ghu1/DigitalNote-2 | f129cdab4b19dcd98945cfe199c49e5f72f91b8c | [
"MIT"
] | 24 | 2019-04-19T12:24:16.000Z | 2022-01-07T13:02:20.000Z | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef H_BITCOIN_SCRIPT
#define H_BITCOIN_SCRIPT
#include <string>
#include <vector>
#include <stdint.h>
#include "types/ctxdestination.h"
#include "types/valtype.h"
#include "enums/isminetype.h"
#include "enums/script_error.h"
#include "enums/opcodetype.h"
#include "enums/sighash.h"
#include "enums/txnouttype.h"
class CKeyStore;
class CTransaction;
class BaseSignatureChecker;
class CKeyID;
class CScript;
class uint256;
class CPubKey;
template <typename T>
std::vector<unsigned char> ToByteVector(const T& in);
const char* ScriptErrorString(const ScriptError error);
const char* GetTxnOutputType(txnouttype t);
const char* GetOpName(opcodetype opcode);
std::string ValueString(const std::vector<unsigned char>& vch);
std::string StackString(const std::vector<std::vector<unsigned char> >& vStack);
bool CheckSig(std::vector<unsigned char> vchSig, const std::vector<unsigned char> &vchPubKey, const CScript &scriptCode,
const CTransaction& txTo, unsigned int nIn, int nHashType, int flags);
bool IsDERSignature(const valtype &vchSig, bool haveHashType = true);
bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, const CTransaction& txTo,
unsigned int nIn, unsigned int flags, int nHashType);
bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags,
const BaseSignatureChecker& checker, ScriptError* error = NULL);
bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet);
int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions);
bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType);
isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest);
void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector<CKeyID> &vKeys);
bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet);
bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet);
bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL);
bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL);
bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
unsigned int flags, int nHashType);
bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker,
ScriptError* error = NULL);
// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders,
// combine them intelligently and return the result.
CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1,
const CScript& scriptSig2);
CScript GetScriptForDestination(const CTxDestination& dest);
CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys);
bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType,
CScript& scriptSigRet, txnouttype& whichTypeRet);
uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
#endif
| 51.32 | 139 | 0.794232 |
dd150ce83fd19e6d102fd3bf7bd680047c2827a6 | 1,289 | c | C | source/main.c | Cruel/DspDump | 873ba4676eae6363908ddde598fc2ebf9bba10ad | [
"MIT"
] | 56 | 2016-04-23T21:46:19.000Z | 2022-02-21T23:04:31.000Z | source/main.c | Cruel/DspDump | 873ba4676eae6363908ddde598fc2ebf9bba10ad | [
"MIT"
] | 2 | 2017-06-24T14:41:41.000Z | 2017-08-13T16:36:09.000Z | source/main.c | Cruel/DspDump | 873ba4676eae6363908ddde598fc2ebf9bba10ad | [
"MIT"
] | 9 | 2016-08-14T11:53:55.000Z | 2018-07-02T19:26:00.000Z | #include <string.h>
#include <stdio.h>
#include <3ds.h>
int main()
{
Handle rsrc;
bool failed = true;
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
printf("\x1b[10;10HFetching DSP component...\x1b[12;10H");
rsrc = envGetHandle("hb:ndsp");
if (!rsrc)
{
printf("\x1b[31;1mFailed\x1b[0m: Need to run using *hax 2.0+");
}
else do
{
Result rc;
u32 len;
void* bin;
extern u32 fake_heap_end;
char* filename = "sdmc:/3ds/dspfirm.cdc";
u32 mapAddr = (fake_heap_end+0xFFF) &~ 0xFFF;
rc = svcMapMemoryBlock(rsrc, mapAddr, 0x3, 0x3);
if (R_FAILED(rc)) break;
len = *(u32*)(mapAddr + 0x104);
bin = malloc(len);
if (bin)
memcpy(bin, (void*)mapAddr, len);
svcUnmapMemoryBlock(rsrc, mapAddr);
if (!bin) break;
FILE* file = fopen(filename, "wb");
if (!file) break;
fwrite(bin, 1, len, file);
fclose(file);
failed = false;
printf("\x1b[32;1mDone\x1b[0m: No further steps needed!\n");
free(bin);
} while (0);
if (rsrc && failed)
printf("\x1b[31;1mFailed\x1b[0m: Unknown error. Try again.");
printf("\x1b[28;15HPress START to exit.");
while (aptMainLoop())
{
hidScanInput();
u32 kDown = hidKeysDown();
if (kDown & KEY_START)
break;
gfxFlushBuffers();
gfxSwapBuffers();
gspWaitForVBlank();
}
gfxExit();
return 0;
}
| 18.414286 | 65 | 0.636928 |
1c01d9bf0c434124fab94c72f2e54cc4725922ac | 10,557 | h | C | libs/PositionBasedDynamics/Demos/Utils/IndexedTetMesh.h | joeedh/game.js | 9271efd2cbbc52ff3ceca7745a0fda114ab613d6 | [
"MIT"
] | null | null | null | libs/PositionBasedDynamics/Demos/Utils/IndexedTetMesh.h | joeedh/game.js | 9271efd2cbbc52ff3ceca7745a0fda114ab613d6 | [
"MIT"
] | null | null | null | libs/PositionBasedDynamics/Demos/Utils/IndexedTetMesh.h | joeedh/game.js | 9271efd2cbbc52ff3ceca7745a0fda114ab613d6 | [
"MIT"
] | null | null | null | #ifndef __INDEXEDTETMESH_H__
#define __INDEXEDTETMESH_H__
#include <vector>
#include <Eigen/Dense>
namespace PBD
{
template <class VertexData>
class IndexedTetMesh
{
public:
struct Edge
{
unsigned int m_vert[2];
};
struct Face
{
// edge indices
unsigned int m_edges[3];
// tet indices
unsigned int m_tets[2];
};
struct Tet
{
unsigned int m_edges[6];
unsigned int m_faces[4];
};
// Stores the indices of each tet connected to a specific vertex
struct VertexTets
{
VertexTets()
{
m_tIndices = 0;
m_numTets = 0;
}
~VertexTets()
{
delete [] m_tIndices;
}
unsigned int m_numTets;
unsigned int* m_tIndices;
};
// Stores the indices of each face connected to a specific vertex
struct VertexFaces
{
VertexFaces()
{
m_fIndices = 0;
m_numFaces = 0;
}
~VertexFaces()
{
delete [] m_fIndices;
}
unsigned int m_numFaces;
unsigned int* m_fIndices;
};
// Stores the indices of each edge connected to a specific vertex
struct VertexEdges
{
VertexEdges()
{
m_eIndices = 0;
m_numEdges = 0;
}
~VertexEdges()
{
delete [] m_eIndices;
}
unsigned int m_numEdges;
unsigned int* m_eIndices;
};
public:
typedef std::vector<unsigned int> Tets;
typedef std::vector<unsigned int> Faces;
typedef std::vector<Tet> TetData;
typedef std::vector<Face> FaceData;
typedef std::vector<Edge> Edges;
typedef std::vector<VertexTets> VerticesTets;
typedef std::vector<VertexFaces> VerticesFaces;
typedef std::vector<VertexEdges> VerticesEdges;
protected:
VertexData m_vertexData;
Tets m_tetIndices;
Faces m_faceIndices;
Edges m_edges;
FaceData m_faces;
TetData m_tets;
VerticesTets m_verticesTets;
VerticesFaces m_verticesFaces;
VerticesEdges m_verticesEdges;
public:
IndexedTetMesh();
~IndexedTetMesh();
void release();
void initMemory(const unsigned int nPoints, const unsigned int nEdges, const unsigned int nFaces, const unsigned int nTets);
void addTet(const unsigned int * const indices);
void addTet(const int * const indices);
void createVertex();
void addVertex(const Eigen::Vector3f &vertex);
const VertexData& getVertexData() const;
VertexData& getVertexData();
const Faces& getFaces() const {return m_faceIndices;}
Faces& getFaces(){return m_faceIndices;}
const Tets& getTets() const {return m_tetIndices;}
Tets& getTets(){return m_tetIndices;}
Edges& getEdges() {return m_edges;}
const Edges& getEdges() const {return m_edges;}
const FaceData& getFaceData() const {return m_faces;}
const TetData& getTetData() const {return m_tets;}
const VerticesTets& getVertexTets() const {return m_verticesTets;}
const VerticesFaces& getVertexFaces() const {return m_verticesFaces;}
const VerticesEdges& getVertexEdges() const {return m_verticesEdges;}
unsigned int numVertices() const {return m_vertexData.size();}
unsigned int numFaces() const { return (unsigned int)m_faceIndices.size() / 3; }
unsigned int numTets() const { return (unsigned int)m_tetIndices.size() / 4; }
unsigned int numEdges() const { return (unsigned int)m_edges.size(); }
void buildNeighbors();
};
template <class VertexData>
IndexedTetMesh<VertexData>::IndexedTetMesh()
{
}
template <class VertexData>
IndexedTetMesh<VertexData>::~IndexedTetMesh()
{
release();
}
template <class VertexData>
void IndexedTetMesh<VertexData>::createVertex()
{
m_vertexData.createVertex();
}
template <class VertexData>
void IndexedTetMesh<VertexData>::addVertex(const Eigen::Vector3f& vertex)
{
m_vertexData.addVertex(vertex);
}
template <class VertexData>
VertexData& IndexedTetMesh<VertexData>::getVertexData()
{
return m_vertexData;
}
template <class VertexData>
const VertexData& IndexedTetMesh<VertexData>::getVertexData() const
{
return m_vertexData;
}
template <class VertexData>
void IndexedTetMesh<VertexData>::initMemory(const unsigned int nPoints, const unsigned int nEdges, const unsigned int nFaces, const unsigned int nTets)
{
m_vertexData.reserve(nPoints);
m_faceIndices.reserve(nFaces*3);
m_tetIndices.reserve(nTets*4);
m_edges.reserve(nEdges);
m_faces.reserve(nFaces);
m_tets.reserve(nTets);
m_verticesTets.reserve(nPoints);
m_verticesFaces.reserve(nPoints);
m_verticesEdges.reserve(nPoints);
}
template <class VertexData>
void IndexedTetMesh<VertexData>::release()
{
m_vertexData.release();
m_faceIndices.clear();
m_tetIndices.clear();
m_edges.clear();
m_tets.clear();
m_faces.clear();
m_verticesTets.clear();
m_verticesFaces.clear();
m_verticesEdges.clear();
}
/** Add a new tet. Indices must be an array of size 4.
*/
template <class VertexData>
void IndexedTetMesh<VertexData>::addTet(const unsigned int * const indices)
{
for (unsigned int i=0u; i < 4; i++)
m_tetIndices.push_back(indices[i]);
}
/** Add a new tet. Indices must be an array of size 4.
*/
template <class VertexData>
void IndexedTetMesh<VertexData>::addTet(const int * const indices)
{
for (unsigned int i=0u; i < 4; i++)
m_tetIndices.push_back((unsigned int) indices[i]);
}
template <class VertexData>
void IndexedTetMesh<VertexData>::buildNeighbors()
{
typedef std::vector<unsigned int> VertexEdges;
typedef std::vector<unsigned int> VertexFaces;
typedef std::vector<unsigned int> VertexTets;
VertexEdges* vEdges = new VertexEdges[numVertices()];
VertexFaces* vFaces = new VertexFaces[numVertices()];
VertexTets* vTets = new VertexTets[numVertices()];
m_faces.clear();
m_edges.clear();
m_tets.resize(numTets());
for(unsigned int i=0; i < numTets(); i++)
{
// tet edge indices: {0,1, 0,2, 0,3, 1,2, 1,3, 2,3}
const unsigned int edges[12] = { m_tetIndices[4*i], m_tetIndices[4*i+1],
m_tetIndices[4*i], m_tetIndices[4*i+2],
m_tetIndices[4*i], m_tetIndices[4*i+3],
m_tetIndices[4*i+1], m_tetIndices[4*i+2],
m_tetIndices[4*i+1], m_tetIndices[4*i+3],
m_tetIndices[4*i+2], m_tetIndices[4*i+3]};
// tet face indices: {0,1,2, 1,3,2, 3,0,2, 1,0,3} => clock wise
/*const unsigned int faces[12] = { m_tetIndices[4*i], m_tetIndices[4*i+1], m_tetIndices[4*i+2],
m_tetIndices[4*i+1], m_tetIndices[4*i+3], m_tetIndices[4*i+2],
m_tetIndices[4*i+3], m_tetIndices[4*i], m_tetIndices[4*i+2],
m_tetIndices[4*i+1], m_tetIndices[4*i], m_tetIndices[4*i+3]};*/
// tet face indices: {1,0,2, 3,1,2, 0,3,2, 0,1,3} => counter clock wise
const unsigned int faces[12] = { m_tetIndices[4*i+1], m_tetIndices[4*i], m_tetIndices[4*i+2],
m_tetIndices[4*i+3], m_tetIndices[4*i+1], m_tetIndices[4*i+2],
m_tetIndices[4*i], m_tetIndices[4*i+3], m_tetIndices[4*i+2],
m_tetIndices[4*i], m_tetIndices[4*i+1], m_tetIndices[4*i+3]};
for(unsigned int j=0u; j < 4; j++)
{
// add vertex-tet connection
const unsigned int vIndex = m_tetIndices[4*i+j];
vTets[vIndex].push_back(i);
}
for(unsigned int j=0u; j < 4; j++)
{
// add face information
const unsigned int a = faces[j*3+0];
const unsigned int b = faces[j*3+1];
const unsigned int c = faces[j*3+2];
unsigned int face = 0xffffffff;
// find face
for(unsigned int k=0; k < vFaces[a].size(); k++)
{
// Check if we already have this face in the list
const unsigned int& faceIndex = vFaces[a][k];
if(((m_faceIndices[3*faceIndex] == a) || (m_faceIndices[3*faceIndex] == b) || (m_faceIndices[3*faceIndex] == c)) &&
((m_faceIndices[3*faceIndex+1] == a) || (m_faceIndices[3*faceIndex+1] == b) || (m_faceIndices[3*faceIndex+1] == c)) &&
((m_faceIndices[3*faceIndex+2] == a) || (m_faceIndices[3*faceIndex+2] == b) || (m_faceIndices[3*faceIndex+2] == c)))
{
face = vFaces[a][k];
break;
}
}
if(face == 0xffffffff)
{
// create new
Face f;
m_faceIndices.push_back(a);
m_faceIndices.push_back(b);
m_faceIndices.push_back(c);
face = (unsigned int) m_faceIndices.size()/3 - 1u;
f.m_tets[0] = i;
f.m_tets[1] = 0xffffffff;
m_faces.push_back(f);
// add vertex-face connection
vFaces[a].push_back(face);
vFaces[b].push_back(face);
vFaces[c].push_back(face);
}
else
{
Face &fd = m_faces[face];
fd.m_tets[1] = i;
}
// append face
m_tets[i].m_faces[j] = face;
}
for(unsigned int j=0u; j < 6; j++)
{
// add face information
const unsigned int a = edges[j*2+0];
const unsigned int b = edges[j*2+1];
unsigned int edge = 0xffffffff;
// find edge
for(unsigned int k=0; k < vEdges[a].size(); k++)
{
// Check if we already have this edge in the list
const Edge& e = m_edges[vEdges[a][k]];
if(((e.m_vert[0] == a) || (e.m_vert[0] == b)) &&
((e.m_vert[1] == a) || (e.m_vert[1] == b)))
{
edge = vEdges[a][k];
break;
}
}
if(edge == 0xffffffff)
{
// create new
Edge e;
e.m_vert[0] = a;
e.m_vert[1] = b;
m_edges.push_back(e);
edge = (unsigned int) m_edges.size() - 1u;
// add vertex-edge connection
vEdges[a].push_back(edge);
vEdges[b].push_back(edge);
}
// append edge
m_tets[i].m_edges[j] = edge;
}
}
m_verticesEdges.clear(); // to delete old pointers
m_verticesEdges.resize(numVertices());
m_verticesFaces.clear(); // to delete old pointers
m_verticesFaces.resize(numVertices());
m_verticesTets.clear(); // to delete old pointers
m_verticesTets.resize(numVertices());
for(unsigned int i=0; i < numVertices(); i++)
{
m_verticesEdges[i].m_numEdges = (unsigned int) vEdges[i].size();
m_verticesEdges[i].m_eIndices = new unsigned int[m_verticesEdges[i].m_numEdges];
memcpy(m_verticesEdges[i].m_eIndices, vEdges[i].data(), sizeof(unsigned int)*m_verticesEdges[i].m_numEdges);
m_verticesFaces[i].m_numFaces = (unsigned int) vFaces[i].size();
m_verticesFaces[i].m_fIndices = new unsigned int[m_verticesFaces[i].m_numFaces];
memcpy(m_verticesFaces[i].m_fIndices, vFaces[i].data(), sizeof(unsigned int)*m_verticesFaces[i].m_numFaces);
m_verticesTets[i].m_numTets = (unsigned int) vTets[i].size();
m_verticesTets[i].m_tIndices = new unsigned int[m_verticesTets[i].m_numTets];
memcpy(m_verticesTets[i].m_tIndices, vTets[i].data(), sizeof(unsigned int)*m_verticesTets[i].m_numTets);
}
delete [] vEdges;
delete [] vFaces;
delete [] vTets;
}
}
#endif
| 27.928571 | 152 | 0.662688 |
de34767a29da399e450e8c9f141032a78906bbb5 | 522 | h | C | src/arch/unix/x11/qnxshm.h | swingflip/C64_mini_VICE | 7a6d9d41ae60409a2bb985bb8d6324a7269a0daa | [
"Apache-2.0"
] | 2 | 2018-11-15T19:52:34.000Z | 2022-01-17T19:45:01.000Z | src/arch/unix/x11/qnxshm.h | Classicmods/C64_mini_VICE | 7a6d9d41ae60409a2bb985bb8d6324a7269a0daa | [
"Apache-2.0"
] | null | null | null | src/arch/unix/x11/qnxshm.h | Classicmods/C64_mini_VICE | 7a6d9d41ae60409a2bb985bb8d6324a7269a0daa | [
"Apache-2.0"
] | 3 | 2019-06-30T05:37:04.000Z | 2021-12-04T17:12:35.000Z | /* qnxshm.h
*
* System V Shared Memory Emulation for QNX
*
*/
#ifndef VICE_QNXSHM_H
#define VICE_QNXSHM_H
#include "qnxipc.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define SHM_R 0400
#define SHM_W 0200
struct shmid_ds {
int dummy;
int shm_nattch;
};
extern void *shmat(int shmid, const void *shmaddr, int shmflg);
extern int shmdt(const void *addr);
extern int shmctl(int shmid, int cmd, struct shmid_ds * buf);
extern int shmget(key_t key, size_t size, int flags);
#ifdef __cplusplus
}
#endif
#endif
| 14.914286 | 63 | 0.716475 |
e3c4989445493b3422b2722809a2ee3e00459430 | 379 | c | C | ITP/Atividades/ITP - Ponteiros 1 - Lista/2.c | danielhenrif/C | 0280e65b9c21d5ae7cb697a8df562373c42c3a3f | [
"MIT"
] | null | null | null | ITP/Atividades/ITP - Ponteiros 1 - Lista/2.c | danielhenrif/C | 0280e65b9c21d5ae7cb697a8df562373c42c3a3f | [
"MIT"
] | null | null | null | ITP/Atividades/ITP - Ponteiros 1 - Lista/2.c | danielhenrif/C | 0280e65b9c21d5ae7cb697a8df562373c42c3a3f | [
"MIT"
] | 1 | 2021-01-23T18:39:46.000Z | 2021-01-23T18:39:46.000Z | #include <stdio.h>
#include <string.h>
void inverte(char *num){
int aux = strlen(num)-1;
char aux2;
for(int i = 0 ; i < (strlen(num)/2 ) ; i++){
aux2 = num[i];
num[i] = num[i+aux];
num[i+aux] = aux2;
aux -= 2;
}
printf("%s",num);
}
int main(){
char numero [100];
scanf("%[^\n]", numero);
inverte(numero);
return 0;
} | 18.95 | 48 | 0.488127 |
e3d86d90c91a9a1ec10b3835c416a17733ed8b30 | 313 | c | C | book/windrop.c | wkoszek/ncurses_guide | cfaa764f77471657f07b9398a77fc392bd4b356e | [
"BSD-2-Clause"
] | 47 | 2015-08-15T04:07:39.000Z | 2022-02-04T06:22:01.000Z | book/windrop.c | wkoszek/ncurses_guide | cfaa764f77471657f07b9398a77fc392bd4b356e | [
"BSD-2-Clause"
] | null | null | null | book/windrop.c | wkoszek/ncurses_guide | cfaa764f77471657f07b9398a77fc392bd4b356e | [
"BSD-2-Clause"
] | 15 | 2017-07-20T23:11:13.000Z | 2022-02-11T10:54:50.000Z | #include <curses.h>
#define TSIZE 18
int main()
{
WINDOW *b;
int maxy,maxx,y,x;
initscr();
getmaxyx(stdscr,maxy,maxx);
x = (maxx-TSIZE) >> 1;
b = newwin(1,TSIZE,0,x);
waddstr(b,"I'm getting sick!");
for(y=1;y<maxy;y++)
{
mvwin(b,y,x);
wrefresh(b);
getch();
}
endwin();
return 0;
}
| 10.793103 | 32 | 0.5623 |
f669c4824c552a9f8a4400942e7c4a706789dc59 | 4,849 | c | C | solutions/test_csi1/app/src/csi/driver/uart/uart_asyncTransferChar_test.c | 1847123212/YoC-open | f4e20c67256472d863ea6d118e3ecbaa1e879d4a | [
"Apache-2.0"
] | 9 | 2020-05-12T03:01:55.000Z | 2021-08-12T10:22:31.000Z | solutions/test_csi1/app/src/csi/driver/uart/uart_asyncTransferChar_test.c | 1847123212/YoC-open | f4e20c67256472d863ea6d118e3ecbaa1e879d4a | [
"Apache-2.0"
] | null | null | null | solutions/test_csi1/app/src/csi/driver/uart/uart_asyncTransferChar_test.c | 1847123212/YoC-open | f4e20c67256472d863ea6d118e3ecbaa1e879d4a | [
"Apache-2.0"
] | 12 | 2020-04-15T11:37:33.000Z | 2021-09-13T13:19:04.000Z | #include <uart_test.h>
__attribute__((aligned(32))) static const char *character = "a";
volatile static uint8_t receive_block = 0;
static void uart_callback(int32_t idx, usart_event_e event)
{
if (event == USART_EVENT_RECEIVE_COMPLETE) {
receive_block = 0;
}
}
int test_uart_async_send_char(void *args)
{
usart_handle_t hd;
test_uart_args_t td;
int32_t ret;
uint8_t send_data_num;
usart_status_t ret_status;
td.uart_idx = (uint8_t)*((uint32_t *)args);
td.baudrate = *((uint32_t *)args+1);
td.data_bits = (uint8_t)*((uint32_t *)args+2);
td.parity = (uint8_t)*((uint32_t *)args+3);
td.stop_bits = (uint8_t)*((uint32_t *)args+4);
td.uart_mode = (uint8_t)*((uint32_t *)args+5);
td.uart_transfer_len = (uint8_t)*((uint32_t *)args+6);
hd = csi_usart_initialize(td.uart_idx, NULL);
TEST_CASE_ASSERT_QUIT(hd != NULL, "uart %d init fail", td.uart_idx);
ret = csi_usart_config_baudrate(hd, td.baudrate);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config baudrate fail", td.uart_idx);
ret = csi_usart_config_mode(hd, td.uart_mode);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config mode fail", td.uart_idx);
ret = csi_usart_config_parity(hd, td.parity);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config parity fail", td.uart_idx);
ret = csi_usart_config_stopbits(hd, td.stop_bits);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config stop bits fail", td.uart_idx);
ret = csi_usart_config_databits(hd, td.data_bits);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config data bits fail", td.uart_idx);
ret = csi_usart_set_interrupt(hd, USART_INTR_WRITE, 0);
TEST_CASE_ASSERT(ret == 0, "uart %d config write interrupt fail", td.uart_idx);
ret = csi_usart_set_interrupt(hd, USART_INTR_READ, 0);
TEST_CASE_ASSERT(ret == 0, "uart %d config write interrupt fail", td.uart_idx);
ret_status = csi_usart_get_status(hd);
if ((ret_status.tx_busy != 0) || (ret_status.rx_busy != 0)) {
TEST_CASE_ASSERT(1 == 0, "uart %d call get state fail", td.uart_idx);
}
ret = csi_usart_flush(hd,USART_FLUSH_WRITE);
TEST_CASE_ASSERT(ret == 0, "uart %d flush send data fail", td.uart_idx);
TEST_CASE_READY();
ret = csi_usart_send(hd, character, td.uart_transfer_len);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d call sync send fail", td.uart_idx);
do {
ret_status = csi_usart_get_status(hd);
}while(ret_status.tx_busy != 0);
csi_usart_uninitialize(hd);
return 0;
}
int test_uart_async_receive_char(void *args)
{
usart_handle_t hd;
test_uart_args_t td;
int32_t ret;
uint8_t recv_data_num;
usart_status_t ret_status;
char receive_data[2];
td.uart_idx = (uint8_t)*((uint32_t *)args);
td.baudrate = *((uint32_t *)args+1);
td.data_bits = (uint8_t)*((uint32_t *)args+2);
td.parity = (uint8_t)*((uint32_t *)args+3);
td.stop_bits = (uint8_t)*((uint32_t *)args+4);
td.uart_mode = (uint8_t)*((uint32_t *)args+5);
td.uart_transfer_len = (uint8_t)*((uint32_t *)args+6);
hd = csi_usart_initialize(td.uart_idx, uart_callback);
TEST_CASE_ASSERT_QUIT(hd != NULL, "uart %d init fail", td.uart_idx);
ret = csi_usart_config_baudrate(hd, td.baudrate);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config baudrate fail", td.uart_idx);
ret = csi_usart_config_mode(hd, td.uart_mode);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config mode fail", td.uart_idx);
ret = csi_usart_config_parity(hd, td.parity);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config parity fail", td.uart_idx);
ret = csi_usart_config_stopbits(hd, td.stop_bits);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config stop bits fail", td.uart_idx);
ret = csi_usart_config_databits(hd, td.data_bits);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d config data bits fail", td.uart_idx);
ret = csi_usart_set_interrupt(hd, USART_INTR_WRITE, 0);
TEST_CASE_ASSERT(ret == 0, "uart %d config write interrupt fail", td.uart_idx);
ret = csi_usart_set_interrupt(hd, USART_INTR_READ, 1);
TEST_CASE_ASSERT(ret == 0, "uart %d config write interrupt fail", td.uart_idx);
ret_status = csi_usart_get_status(hd);
if ((ret_status.tx_busy != 0) || (ret_status.rx_busy != 0)) {
TEST_CASE_ASSERT(1 == 0, "uart %d call get state fail", td.uart_idx);
}
TEST_CASE_READY();
receive_block = 1;
ret = csi_usart_flush(hd,USART_FLUSH_READ);
TEST_CASE_ASSERT(ret == 0, "uart %d flush send data fail", td.uart_idx);
ret = csi_usart_receive(hd, receive_data, td.uart_transfer_len);
TEST_CASE_ASSERT_QUIT(ret == 0, "uart %d call sync receive fail", td.uart_idx);
while(receive_block == 1) ;
*(receive_data+1) = '\0';
TEST_CASE_TIPS("received char: $%s$",receive_data);
if (memcmp(character, receive_data, td.uart_transfer_len)) {
TEST_CASE_ASSERT(1 == 0, "uart %d sync transfer send not equal receive", td.uart_idx);
}
csi_usart_uninitialize(hd);
return 0;
}
| 32.326667 | 88 | 0.705506 |
91cc7b1bb02c306317e4ae072b724f9c39ac8b16 | 730 | h | C | Simulator_Linux/src/util/util.h | Mrxiang/FreeRTOS-W8 | 32aedaee2034f76e38b9267bd507f0d1ceaf4adc | [
"MIT"
] | null | null | null | Simulator_Linux/src/util/util.h | Mrxiang/FreeRTOS-W8 | 32aedaee2034f76e38b9267bd507f0d1ceaf4adc | [
"MIT"
] | null | null | null | Simulator_Linux/src/util/util.h | Mrxiang/FreeRTOS-W8 | 32aedaee2034f76e38b9267bd507f0d1ceaf4adc | [
"MIT"
] | null | null | null | //
// Created by xshx on 2021/9/29.
//
#ifndef FREERTOS_W8_COMMEN_H
#define FREERTOS_W8_COMMEN_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "main.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
uint8_t StrGetUInt8( const uint8_t * i_pSrc );
uint16_t StrGetUInt16( const uint8_t * i_pSrc );
uint32_t StrGetUInt32( const uint8_t * i_pSrc );
void StrSetUInt8( uint8_t * io_pDst, const uint8_t i_u8Src );
void StrSetUInt16( uint8_t * io_pDst, const uint16_t i_u16Src );
void StrSetUInt32( uint8_t * io_pDst, const uint32_t i_u32Src );
void StrToHex(unsigned char *pbDest, char *pszSrc, int nLen);
void HexToStr(char *pszDest, unsigned char *pbSrc, int nLen);
#endif //FREERTOS_W8_COMMEN_H | 26.071429 | 64 | 0.752055 |
8c9f93aa82dd172a2e5ae98cb2dae99deedfd003 | 1,194 | h | C | src/core/src/game/player.h | Mahmuttalemdar/TicTacToe.AI | ccd7f51c5bdfdd86996790db287d2f3d1628809b | [
"MIT"
] | 1 | 2021-04-19T12:36:02.000Z | 2021-04-19T12:36:02.000Z | src/core/src/game/player.h | Mahmuttalemdar/TicTacToe.AI | ccd7f51c5bdfdd86996790db287d2f3d1628809b | [
"MIT"
] | null | null | null | src/core/src/game/player.h | Mahmuttalemdar/TicTacToe.AI | ccd7f51c5bdfdd86996790db287d2f3d1628809b | [
"MIT"
] | null | null | null | #ifndef PLAYER_H
#define PLAYER_H
#include <QString>
/**
* @brief The Player class: holds the all player
* data, type and reprensetation
*/
class Player
{
public:
// Player types
enum class Type
{
HUMAN,
AI,
NONE
};
/**
* @brief C-tor
* @param constructs an object depend on player type
*/
Player(const Type& type = Type::NONE);
/**
* @brief D-tor
*/
virtual ~Player();
/**
* @brief Setter: Modifies the player type
* @param value: player type (HUMAN or AI)
*/
void setType(const Type& type);
/**
* @brief Getter: Returns current type of type
* @return value: player type (HUMAN or AI)
*/
const Type& type() const;
/**
* @brief Setter: Modifies the player name
* @param value: Name of Human player or Default AI Name
*/
void setPlayerName(const QString& playerName);
/**
* @brief Getter: Returns current name of player
* @return value: playerName as String
*/
const QString& playerName() const;
private:
// Player type
Type m_type;
// Player name
QString m_playerName;
};
#endif // PLAYER_H
| 18.369231 | 60 | 0.583752 |
8cd34a5d3b029a0594f8f4640ce59a51540a72d3 | 537 | h | C | source/pkgsrc/databases/mysql80-client/patches/patch-include_tables__contained__in.h | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/databases/mysql80-client/patches/patch-include_tables__contained__in.h | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/databases/mysql80-client/patches/patch-include_tables__contained__in.h | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-include_tables__contained__in.h,v 1.1 2021/05/13 15:25:20 jdolecek Exp $
* some systems have ffsll in strings.h
* for systems that don't have ffsll, use the provided version
--- include/tables_contained_in.h.orig 2019-12-09 19:53:17.000000000 +0000
+++ include/tables_contained_in.h
@@ -26,6 +26,16 @@
#include <string.h>
+#include "my_config.h"
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#ifndef HAVE_FFSLL
+int ffsll(longlong);
+#endif
+
#include "my_inttypes.h"
#include "sql/sql_optimizer.h"
| 21.48 | 87 | 0.724395 |
7b6db60df3682d09b18abc0dc16450d8e666a0e3 | 1,081 | c | C | src/termcaps/ft_trmread.c | ncoden/libft-termcaps | db5d6bf65a0edaae6bae68be22e8939fd175b324 | [
"Apache-2.0"
] | 2 | 2020-01-16T16:44:13.000Z | 2020-05-24T07:32:17.000Z | src/termcaps/ft_trmread.c | ncoden/libft-termcaps | db5d6bf65a0edaae6bae68be22e8939fd175b324 | [
"Apache-2.0"
] | null | null | null | src/termcaps/ft_trmread.c | ncoden/libft-termcaps | db5d6bf65a0edaae6bae68be22e8939fd175b324 | [
"Apache-2.0"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_trmread.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ncoden <ncoden@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/05/18 16:15:32 by ncoden #+# #+# */
/* Updated: 2015/08/28 19:22:28 by ncoden ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
char *ft_trmread(void)
{
int len;
static char buffer[256];
if ((len = read(0, buffer, 255)))
{
buffer[len] = '\0';
return (buffer);
}
return (NULL);
}
| 40.037037 | 80 | 0.188714 |
f41d749b9e1e26895c4e74d8d9dd88ae7ae1a283 | 142 | h | C | include/kernel/sysapi.h | jackie8tao/linda | b2379f9341864fcb98baf985caac0dd4f92c3661 | [
"MIT"
] | 3 | 2019-03-31T14:44:20.000Z | 2021-10-12T16:58:26.000Z | include/kernel/sysapi.h | taodf/linda | b2379f9341864fcb98baf985caac0dd4f92c3661 | [
"MIT"
] | null | null | null | include/kernel/sysapi.h | taodf/linda | b2379f9341864fcb98baf985caac0dd4f92c3661 | [
"MIT"
] | null | null | null | /*
* 系统api声明和定义
*
* @author Jackie Tao <jackie8tao@gmail.com>
*/
#ifndef __LINDA_SYSAPI_H
#define __LINDA_SYSAPI_H
int print();
#endif
| 10.923077 | 44 | 0.704225 |
f0d184649451338501fd8caffef28ad153f0782a | 2,952 | h | C | sblist.h | djeysx/microsocks | 3d49850521d5a995982ad21519f773f6c5b8fd5b | [
"MIT"
] | 814 | 2017-06-09T22:51:09.000Z | 2022-03-31T06:28:37.000Z | src/sblist.h | OnceUponALoop/microsocks | 917c44960907d20309f31519a8799e873b34e87c | [
"MIT"
] | 49 | 2017-05-21T08:00:13.000Z | 2022-02-03T19:07:08.000Z | src/sblist.h | OnceUponALoop/microsocks | 917c44960907d20309f31519a8799e873b34e87c | [
"MIT"
] | 205 | 2017-05-06T13:05:49.000Z | 2022-03-13T22:44:58.000Z | #ifndef SBLIST_H
#define SBLIST_H
/* this file is part of libulz, as of commit 8ab361a27743aaf025323ee43b8b8876dc054fdd
modified for direct inclusion in microsocks. */
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
/*
* simple buffer list.
*
* this thing here is basically a generic dynamic array
* will realloc after every blockitems inserts
* can store items of any size.
*
* so think of it as a by-value list, as opposed to a typical by-ref list.
* you typically use it by having some struct on the stack, and pass a pointer
* to sblist_add, which will copy the contents into its internal memory.
*
*/
typedef struct {
size_t itemsize;
size_t blockitems;
size_t count;
size_t capa;
char* items;
} sblist;
#define sblist_getsize(X) ((X)->count)
#define sblist_get_count(X) ((X)->count)
#define sblist_empty(X) ((X)->count == 0)
// for dynamic style
sblist* sblist_new(size_t itemsize, size_t blockitems);
void sblist_free(sblist* l);
//for static style
void sblist_init(sblist* l, size_t itemsize, size_t blockitems);
void sblist_free_items(sblist* l);
// accessors
void* sblist_get(sblist* l, size_t item);
// returns 1 on success, 0 on OOM
int sblist_add(sblist* l, void* item);
int sblist_set(sblist* l, void* item, size_t pos);
void sblist_delete(sblist* l, size_t item);
char* sblist_item_from_index(sblist* l, size_t idx);
int sblist_grow_if_needed(sblist* l);
int sblist_insert(sblist* l, void* item, size_t pos);
/* same as sblist_add, but returns list index of new item, or -1 */
size_t sblist_addi(sblist* l, void* item);
void sblist_sort(sblist *l, int (*compar)(const void *, const void *));
/* insert element into presorted list, returns listindex of new entry or -1*/
size_t sblist_insert_sorted(sblist* l, void* o, int (*compar)(const void *, const void *));
#ifndef __COUNTER__
#define __COUNTER__ __LINE__
#endif
#define __sblist_concat_impl( x, y ) x##y
#define __sblist_macro_concat( x, y ) __sblist_concat_impl( x, y )
#define __sblist_iterator_name __sblist_macro_concat(sblist_iterator, __COUNTER__)
// use with custom iterator variable
#define sblist_iter_counter(LIST, ITER, PTR) \
for(size_t ITER = 0; (PTR = sblist_get(LIST, ITER)), ITER < sblist_getsize(LIST); ITER++)
// use with custom iterator variable, which is predeclared
#define sblist_iter_counter2(LIST, ITER, PTR) \
for(ITER = 0; (PTR = sblist_get(LIST, ITER)), ITER < sblist_getsize(LIST); ITER++)
// use with custom iterator variable, which is predeclared and signed
// useful for a loop which can delete items from the list, and then decrease the iterator var.
#define sblist_iter_counter2s(LIST, ITER, PTR) \
for(ITER = 0; (PTR = sblist_get(LIST, ITER)), ITER < (ssize_t) sblist_getsize(LIST); ITER++)
// uses "magic" iterator variable
#define sblist_iter(LIST, PTR) sblist_iter_counter(LIST, __sblist_iterator_name, PTR)
#ifdef __cplusplus
}
#endif
#pragma RcB2 DEP "sblist.c" "sblist_delete.c"
#endif
| 31.741935 | 94 | 0.741531 |
4ecbb68f350a4b6e2cd3df422f17ca03d2cc55d1 | 495 | h | C | arp_table.h | naoki9911/small-tcpip-stack | f035f3d69738905453f0eb33f9f2f02bb0bb805a | [
"MIT"
] | null | null | null | arp_table.h | naoki9911/small-tcpip-stack | f035f3d69738905453f0eb33f9f2f02bb0bb805a | [
"MIT"
] | null | null | null | arp_table.h | naoki9911/small-tcpip-stack | f035f3d69738905453f0eb33f9f2f02bb0bb805a | [
"MIT"
] | null | null | null | #ifndef _ARP_TABLE_H_
#define _ARP_TABLE_H_
#include <stdint.h>
#include <time.h>
struct arp_entry{
struct arp_list *list;
uint8_t hw[6];
uint8_t ip[4];
time_t update_time;
};
int arp_table_init();
void* arp_table_thread(void *arg);
struct arp_entry* arp_table_add(uint8_t *hw, uint8_t *ip);
int arp_table_delete(struct arp_entry *entry);
struct arp_entry* arp_table_get_by_hw(uint8_t *hw);
struct arp_entry* arp_table_get_by_ip(uint8_t *ip);
void arp_table_list();
#endif
| 19.8 | 58 | 0.751515 |
8e343e7fbd569dcf8eba9e654448bddc1cb42989 | 890 | h | C | PrivateFrameworks/CloudKitDaemon.framework/CKDPCommentSummary.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 36 | 2016-04-20T04:19:04.000Z | 2018-10-08T04:12:25.000Z | PrivateFrameworks/CloudKitDaemon.framework/CKDPCommentSummary.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | null | null | null | PrivateFrameworks/CloudKitDaemon.framework/CKDPCommentSummary.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 10 | 2016-06-16T02:40:44.000Z | 2019-01-15T03:31:45.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/CloudKitDaemon.framework/CloudKitDaemon
*/
@interface CKDPCommentSummary : PBCodable <NSCopying> {
CKDPCommentedOnId * _identifier;
CKDPLikeInfo * _likeInfo;
}
@property (nonatomic, readonly) bool hasIdentifier;
@property (nonatomic, readonly) bool hasLikeInfo;
@property (nonatomic, retain) CKDPCommentedOnId *identifier;
@property (nonatomic, retain) CKDPLikeInfo *likeInfo;
- (void).cxx_destruct;
- (void)copyTo:(id)arg1;
- (id)copyWithZone:(struct _NSZone { }*)arg1;
- (id)description;
- (id)dictionaryRepresentation;
- (bool)hasIdentifier;
- (bool)hasLikeInfo;
- (unsigned long long)hash;
- (id)identifier;
- (bool)isEqual:(id)arg1;
- (id)likeInfo;
- (void)mergeFrom:(id)arg1;
- (bool)readFrom:(id)arg1;
- (void)setIdentifier:(id)arg1;
- (void)setLikeInfo:(id)arg1;
- (void)writeTo:(id)arg1;
@end
| 26.969697 | 83 | 0.741573 |
617a3289a05ee97660b697c9469168d669084e82 | 824 | h | C | IPC/dslIPCMessageProcessor.h | TotteKarlsson/dsl | 3807cbe5f90a3cd495979eafa8cf5485367b634c | [
"BSD-2-Clause"
] | null | null | null | IPC/dslIPCMessageProcessor.h | TotteKarlsson/dsl | 3807cbe5f90a3cd495979eafa8cf5485367b634c | [
"BSD-2-Clause"
] | null | null | null | IPC/dslIPCMessageProcessor.h | TotteKarlsson/dsl | 3807cbe5f90a3cd495979eafa8cf5485367b634c | [
"BSD-2-Clause"
] | null | null | null | #ifndef dslIPCMessageProcessorH
#define dslIPCMessageProcessorH
#include <string>
#include "dslThread.h"
#include "dslIPCExporter.h"
//----------------------------------------------------------------
namespace dsl
{
class IPCServer;
class DSL_IPC IPCMessageProcessor : public Thread
{
public:
IPCMessageProcessor(IPCServer* parent);
~IPCMessageProcessor();
// overridden from Thread
void worker();
void shutDown();
void run();
private:
string mServerName;
IPCServer *mParent;
};
}
#endif
| 25.75 | 83 | 0.402913 |
e8aaf39bd925c7d15da41a24feca00f1fb0c42ec | 7,021 | c | C | sdk/sdk/driver/xcpu_master/file.c | doyaGu/C0501Q_HWJL01 | 07a71328bd9038453cbb1cf9c276a3dd1e416d63 | [
"MIT"
] | 1 | 2021-10-09T08:05:50.000Z | 2021-10-09T08:05:50.000Z | sdk/sdk/driver/xcpu_master/file.c | doyaGu/C0501Q_HWJL01 | 07a71328bd9038453cbb1cf9c276a3dd1e416d63 | [
"MIT"
] | null | null | null | sdk/sdk/driver/xcpu_master/file.c | doyaGu/C0501Q_HWJL01 | 07a71328bd9038453cbb1cf9c276a3dd1e416d63 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2013 ITE Technology Corp. All Rights Reserved.
*/
/** @file file.c
*
* @version 0.1
*/
#include "itx.h"
#if ITX_BOOT_TYPE == ITX_HOST_BOOT
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "file.h"
#include "xcpu_io.h"
#include "sys_msgq.h"
#include "xcpu_msgq.h"
#include "pal.h"
//=============================================================================
// Constant Definition
//=============================================================================
#define OFFSET_OFFSET 8
#define HEADER1 ((((int)'S')<<24)+(((int)'M')<<16)+(((int)'E')<<8)+(((int)'D')<<0))
#define HEADER2 ((((int)'I')<<24)+(((int)'A')<<16)+(((int)'0')<<8)+(((int)'2')<<0))
//=============================================================================
// Macro Definition
//=============================================================================
//=============================================================================
// Structure Definition
//=============================================================================
//=============================================================================
// Global Data Definition
//=============================================================================
//=============================================================================
// Private Function Declaration
//=============================================================================
static int parser_rom(unsigned int* buffer, int* startAddr, unsigned int* pBinSize);
//=============================================================================
// Public Function Definition
//=============================================================================
//=============================================================================
/**
* Used to get the information (including the file size) of a specific file
* identified by an unique id.
*
* @param id The corresponding id for a specific file.
* @param ptInfo The output file information.
* @return 0 If successful. Otherwise, return a nonzero value.
*/
//=============================================================================
MMP_RESULT
UserFileSize(
MMP_UINT32* pFileSize)
{
MMP_RESULT errCode = MMP_RESULT_SUCCESS;
MMP_UINT32 dwFileSize = 0;
FILE* file;
#if (ITX_BUS_TYPE == ITX_BUS_SPI)
mmpSpiSetControlMode(SPI_CONTROL_NOR);
#endif
file = fopen(BOOT_FILE_PATH, "rb");
if (!file)
printf("cannot open file: %s\n", BOOT_FILE_PATH);
else
printf("open file: %s\n", BOOT_FILE_PATH);
if (file)
{
/*--- get file size ---*/
errCode = fseek(file, 0L, SEEK_END);
if (errCode < 0) {
dwFileSize = 0;
}
dwFileSize = ftell(file);
errCode = fseek(file, 0L, SEEK_SET);
if (errCode < 0) {
dwFileSize = 0;
}
errCode = fclose(file);
}
else
{
errCode = MMP_RESULT_ERROR;
}
*pFileSize = dwFileSize;
#if (ITX_BUS_TYPE == ITX_BUS_SPI)
mmpSpiResetControl();
#endif
return errCode;
}
//=============================================================================
/**
* Used to load the content of the specific file into buffer.
*
* @param id The corresponding id for a specific file.
* @param pBuffer The output buffer.
* @param size Maximum size in bytes to be loaded.
* @return The number of bytes actually loaded.
*/
//=============================================================================
MMP_RESULT
UserFileLoad(
MMP_UINT32 vRamAddress,
MMP_UINT32 size)
{
MMP_RESULT errCode = MMP_RESULT_SUCCESS;
MMP_UINT32 loadSize = 0;
MMP_UINT32 totalLoadSize = 0;
MMP_UINT8* buffer = NULL;
MMP_UINT8* dstbuffer = NULL;
MMP_UINT32 binSize = 0;
MMP_UINT32 index = 0;
FILE* file;
#if (ITX_BUS_TYPE == ITX_BUS_SPI)
mmpSpiSetControlMode(SPI_CONTROL_NOR);
#endif
file = fopen(BOOT_FILE_PATH, "rb");
if (file)
{
buffer = PalMalloc(size);
if (buffer)
{
int startAddr;
unsigned char* pStartBuffer = 0;
loadSize = fread(buffer, 1, size, file);
// skip script and decompress
parser_rom((unsigned int*)buffer, &startAddr, &binSize);
if (binSize)
{
dstbuffer = PalMalloc(binSize);
PalMemset(dstbuffer, 0xFF, binSize);
}
//printf("[Get] startAddr:0x%x, bufstart: 0x%X, load:%u\n",startAddr, buffer, loadSize);
{
MMP_UINT32 inSize = loadSize - (startAddr - (unsigned int)buffer) - 4;
pStartBuffer = ((unsigned char*) startAddr) + 4;
printf("in: %u, outlen: %u\n", inSize, binSize);
// decompress
do_decompress(startAddr, dstbuffer);
}
#if (ITX_BUS_TYPE == ITX_BUS_SPI)
mmpSpiResetControl();
mmpSpiSetControlMode(SPI_CONTROL_SLAVE);
#endif
xCpuIO_WriteMemory(
vRamAddress + totalLoadSize,
(MMP_UINT32)dstbuffer,
binSize);
#if (ITX_BUS_TYPE == ITX_BUS_SPI)
mmpSpiResetControl();
mmpSpiSetControlMode(SPI_CONTROL_NOR);
#endif
//totalLoadSize += binSize;
PalFree(buffer);
PalFree(dstbuffer);
}
errCode = fclose(file);
}
#if (ITX_BUS_TYPE == ITX_BUS_SPI)
mmpSpiResetControl();
mmpSpiSetControlMode(SPI_CONTROL_SLAVE);
#endif
return errCode;
}
int parser_rom(unsigned int* buffer, int* startAddr, unsigned int* pBinSize)
{
unsigned char* pCurPos = buffer;
int scriptOffset = 0;
int scriptLen = 0;
int binSize = 0;
int header1 = 0;
int header2 = 0;
header1 = (int) (pCurPos[0] << 24 | pCurPos[1] << 16 | pCurPos[2] << 8 | pCurPos[3]);
header2 = (int) (pCurPos[4] << 24 | pCurPos[5] << 16 | pCurPos[6] << 8 | pCurPos[7]);
if (header1 != HEADER1 && header2 != HEADER2)
{
return MMP_RESULT_ERROR;
}
pCurPos += OFFSET_OFFSET;
scriptOffset = (int) (pCurPos[0] << 24 | pCurPos[1] << 16 | pCurPos[2] << 8 | pCurPos[3]);
//printf("scrip offset: 0x%X\n", scriptOffset);
pCurPos = ((unsigned char*) buffer + scriptOffset);
scriptLen = (int) (pCurPos[0] << 24 | pCurPos[1] << 16 | pCurPos[2] << 8 | pCurPos[3]);
//printf("scrip len: %u\n", scriptLen);
pCurPos += (sizeof(int) + scriptLen * sizeof(int));
// CRC 4bytes, decompress bin size 4bytes, SMAZ 4bytes
binSize = (int) (pCurPos[4] << 24 | pCurPos[5] << 16 | pCurPos[6] << 8 | pCurPos[7]);
//printf("bin Size: %u\n", binSize);
pCurPos += 12;
*startAddr = pCurPos;
*pBinSize = binSize;
return MMP_RESULT_SUCCESS;
}
#endif
| 31.626126 | 100 | 0.470303 |
c3e51f88d0b837c51b0549195aeaaa185f893c3f | 220 | h | C | Example/LZYRuntime/runtimeViewController.h | sjmlzyan/LZYRuntime | 5c1b8540f7c09e20a374a591bdf39c8f46e03b0c | [
"MIT"
] | null | null | null | Example/LZYRuntime/runtimeViewController.h | sjmlzyan/LZYRuntime | 5c1b8540f7c09e20a374a591bdf39c8f46e03b0c | [
"MIT"
] | null | null | null | Example/LZYRuntime/runtimeViewController.h | sjmlzyan/LZYRuntime | 5c1b8540f7c09e20a374a591bdf39c8f46e03b0c | [
"MIT"
] | null | null | null | //
// runtimeViewController.h
// LZYRuntime
//
// Created by sjmlzyan on 09/07/2018.
// Copyright (c) 2018 sjmlzyan. All rights reserved.
//
@import UIKit;
@interface runtimeViewController : UIViewController
@end
| 15.714286 | 53 | 0.718182 |
250d58672b3410f2a97e77271df16dd431bde6e8 | 8,095 | h | C | content/browser/memory/memory_coordinator_impl.h | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | content/browser/memory/memory_coordinator_impl.h | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | content/browser/memory/memory_coordinator_impl.h | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_
#define CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_
#include "base/callback.h"
#include "base/memory/memory_coordinator_client.h"
#include "base/memory/memory_pressure_monitor.h"
#include "base/memory/singleton.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "content/common/memory_coordinator.mojom.h"
#include "content/public/browser/memory_coordinator.h"
#include "content/public/browser/memory_coordinator_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
namespace content {
// NOTE: Memory coordinator is under development and not fully working.
class MemoryCoordinatorHandleImpl;
class MemoryCoordinatorImplTest;
class MemoryMonitor;
class MemoryStateUpdater;
class RenderProcessHost;
struct MemoryCoordinatorSingletonTraits;
// MemoryCoordinatorImpl is an implementation of MemoryCoordinator.
// The current implementation uses MemoryStateUpdater to update the global
// memory state. See comments in MemoryStateUpdater for details.
class CONTENT_EXPORT MemoryCoordinatorImpl : public MemoryCoordinator,
public NotificationObserver,
public base::NonThreadSafe {
public:
using MemoryState = base::MemoryState;
static MemoryCoordinatorImpl* GetInstance();
MemoryCoordinatorImpl(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
std::unique_ptr<MemoryMonitor> monitor);
~MemoryCoordinatorImpl() override;
MemoryMonitor* memory_monitor() { return memory_monitor_.get(); }
// Starts monitoring memory usage. After calling this method, memory
// coordinator will start dispatching state changes.
void Start();
// Creates a handle to the provided child process.
void CreateHandle(int render_process_id,
mojom::MemoryCoordinatorHandleRequest request);
// Dispatches a memory state change to the provided process. Returns true if
// the process is tracked by this coordinator and successfully dispatches,
// returns false otherwise.
bool SetChildMemoryState(int render_process_id, MemoryState memory_state);
// Returns the memory state of the specified render process. Returns UNKNOWN
// if the process is not tracked by this coordinator.
MemoryState GetChildMemoryState(int render_process_id) const;
// Records memory pressure notifications. Called by MemoryPressureMonitor.
// TODO(bashi): Remove this when MemoryPressureMonitor is retired.
void RecordMemoryPressure(
base::MemoryPressureMonitor::MemoryPressureLevel level);
// Returns the global memory state.
virtual MemoryState GetGlobalMemoryState() const;
// Returns the browser's current memory state. Note that the current state
// could be different from the global memory state as the browser won't be
// suspended.
MemoryState GetCurrentMemoryState() const;
// Sets the global memory state for testing.
void SetCurrentMemoryStateForTesting(MemoryState memory_state);
// MemoryCoordinator implementation:
MemoryState GetStateForProcess(base::ProcessHandle handle) override;
// NotificationObserver implementation:
void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) override;
// Overrides the global state to |new_state|. State update tasks won't be
// scheduled until |duration| is passed. This means that the global state
// remains the same until |duration| is passed or another call of this method.
void ForceSetGlobalState(base::MemoryState new_state,
base::TimeDelta duration);
// Changes the global state and notifies state changes to clients (lives in
// the browser) and child processes (renderers) if needed. Returns true when
// the state is actually changed.
bool ChangeStateIfNeeded(MemoryState prev_state, MemoryState next_state);
protected:
// Returns the RenderProcessHost which is correspond to the given id.
// Returns nullptr if there is no corresponding RenderProcessHost.
// This is a virtual method so that we can write tests without having
// actual RenderProcessHost.
virtual RenderProcessHost* GetRenderProcessHost(int render_process_id);
// Sets a delegate for testing.
void SetDelegateForTesting(
std::unique_ptr<MemoryCoordinatorDelegate> delegate);
// Adds the given ChildMemoryCoordinator as a child of this coordinator.
void AddChildForTesting(int dummy_render_process_id,
mojom::ChildMemoryCoordinatorPtr child);
// Callback invoked by mojo when the child connection goes down. Exposed
// for testing.
void OnConnectionError(int render_process_id);
// Returns true when a given renderer can be suspended.
bool CanSuspendRenderer(int render_process_id);
// Stores information about any known child processes.
struct ChildInfo {
// This object must be compatible with STL containers.
ChildInfo();
ChildInfo(const ChildInfo& rhs);
~ChildInfo();
MemoryState memory_state;
bool is_visible = false;
std::unique_ptr<MemoryCoordinatorHandleImpl> handle;
};
// A map from process ID (RenderProcessHost::GetID()) to child process info.
using ChildInfoMap = std::map<int, ChildInfo>;
ChildInfoMap& children() { return children_; }
private:
#if !defined(OS_MACOSX)
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplBrowserTest, HandleAdded);
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplBrowserTest,
CanSuspendRenderer);
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorWithServiceWorkerTest,
CannotSuspendRendererWithServiceWorker);
#endif
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, CalculateNextState);
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, UpdateState);
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, SetMemoryStateForTesting);
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, ForceSetGlobalState);
friend struct MemoryCoordinatorSingletonTraits;
friend class MemoryCoordinatorHandleImpl;
// Called when ChildMemoryCoordinator calls AddChild().
void OnChildAdded(int render_process_id);
// Called by SetChildMemoryState() to determine a child memory state based on
// the current status of the child process.
MemoryState OverrideGlobalState(MemoryState memroy_state,
const ChildInfo& child);
// Helper function of CreateHandle and AddChildForTesting.
void CreateChildInfoMapEntry(
int render_process_id,
std::unique_ptr<MemoryCoordinatorHandleImpl> handle);
// Notifies a state change to in-process clients.
void NotifyStateToClients();
// Notifies a state change to child processes.
void NotifyStateToChildren();
// Records metrics. This is called when the global state is changed.
void RecordStateChange(MemoryState prev_state,
MemoryState next_state,
base::TimeDelta duration);
std::unique_ptr<MemoryCoordinatorDelegate> delegate_;
std::unique_ptr<MemoryMonitor> memory_monitor_;
std::unique_ptr<MemoryStateUpdater> state_updater_;
NotificationRegistrar notification_registrar_;
// The global memory state.
MemoryState current_state_ = MemoryState::NORMAL;
// The time tick of last global state change.
base::TimeTicks last_state_change_;
// Tracks child processes. An entry is added when a renderer connects to
// MemoryCoordinator and removed automatically when an underlying binding is
// disconnected.
ChildInfoMap children_;
DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl);
};
} // namespace content
#endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_
| 40.475 | 80 | 0.763558 |
bad4e15db5a266a591be0149f3147b6ab5f5c947 | 794 | c | C | blinky/test/blinky/mocks/movement_fake.c | disroop/DisroopEmbeddedHipster | a485af1a307fb5c88a643edc9c09c0ee4d9b0336 | [
"Apache-2.0"
] | 10 | 2021-01-22T10:00:48.000Z | 2022-01-12T14:19:26.000Z | blinky/test/blinky/mocks/movement_fake.c | disroop/DisroopEmbeddedHipster | a485af1a307fb5c88a643edc9c09c0ee4d9b0336 | [
"Apache-2.0"
] | 28 | 2021-05-26T18:58:52.000Z | 2022-01-13T21:29:23.000Z | blinky/test/blinky/mocks/movement_fake.c | disroop/DisroopEmbeddedHipster | a485af1a307fb5c88a643edc9c09c0ee4d9b0336 | [
"Apache-2.0"
] | null | null | null | #include "movement_fake.h"
#include <stdlib.h>
#include "mocks_definitions.h"
typedef struct movement_struct {
bool rotated;
int counter;
} movement_struct;
movement movement_create(void (*gyro_xyz)(float*)) {
UNUSED(gyro_xyz);
movement movement = malloc(sizeof(movement_struct));
movement->rotated = false;
movement->counter = 0;
return movement;
}
void movement_delete(movement self) { free(self); }
void movement_reset(movement self) { self->rotated = false; }
bool movement_has_rotated(movement self) { return self->rotated; }
void movement_run(movement self) { self->counter++; }
void movement_set_rotated(movement self, bool rotation_detection) {
self->rotated = rotation_detection;
}
void movement_reset_run(movement self) { self->counter = 0; } | 24.8125 | 67 | 0.731738 |
451ba1763a6d2ee64039ab5fa829d8080c80d4a3 | 540 | h | C | Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/PlatformIncl_UnixLike.h | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-12T14:13:45.000Z | 2022-03-12T14:13:45.000Z | Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/PlatformIncl_UnixLike.h | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 2 | 2022-01-13T04:29:38.000Z | 2022-03-12T01:05:31.000Z | Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/PlatformIncl_UnixLike.h | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | null | null | null | /*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <unistd.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
// types like AZ::u64 require an usigned long long, but inttypes.h has it as unsigned long
#undef PRIX64
#undef PRIx64
#undef PRId64
#undef PRIu64
#define PRIX64 "llX"
#define PRIx64 "llx"
#define PRId64 "lld"
#define PRIu64 "llu"
| 21.6 | 100 | 0.740741 |
bf98e2530ffd91234e770d6b4a0487682ed1e868 | 1,432 | h | C | benchmarks/common/m5ops.h | adityaabhiram3/gem5-SALAM | d9da3ab343bcb89ff42492db59afa2b366265e0f | [
"BSD-3-Clause"
] | null | null | null | benchmarks/common/m5ops.h | adityaabhiram3/gem5-SALAM | d9da3ab343bcb89ff42492db59afa2b366265e0f | [
"BSD-3-Clause"
] | null | null | null | benchmarks/common/m5ops.h | adityaabhiram3/gem5-SALAM | d9da3ab343bcb89ff42492db59afa2b366265e0f | [
"BSD-3-Clause"
] | null | null | null | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define ENABLED 1
#if defined(__arm__)
static void m5_checkpoint(void)
{
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; mov r2, #0; mov r3, #0; .inst 0xEE000110 | (0x43 << 16);");
};
static void m5_dump_stats(void)
{
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; mov r2, #0; mov r3, #0; .inst 0xEE000110 | (0x41 << 16);");
};
static void m5_exit()
{
__asm__ __volatile__ ("mov r0, #0; .inst 0xEE000110 | (0x21 << 16);");
};
static void m5_fail_1(void)
{
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; mov r2, #1; mov r3, #0; .inst 0xEE000110 | (0x22 << 16);");
};
static void m5_reset_stats(void)
{
__asm__ __volatile__ ("mov r0, #0; mov r1, #0; mov r2, #0; mov r3, #0; .inst 0xEE000110 | (0x40 << 16);");
};
#elif defined(__aarch64__)
static void m5_checkpoint(void)
{
__asm__ __volatile__ ("mov x0, #0; mov x1, #0; .inst 0xFF000110 | (0x43 << 16);");
};
static void m5_dump_stats(void)
{
__asm__ __volatile__ ("mov x0, #0; mov x1, #0; .inst 0xFF000110 | (0x41 << 16);");
};
static void m5_exit(void)
{
__asm__ __volatile__ ("mov x0, #0; .inst 0XFF000110 | (0x21 << 16);");
};
static void m5_fail_1(void)
{
__asm__ __volatile__ ("mov x0, #0; mov x1, #1; .inst 0xFF000110 | (0x22 << 16);");
};
static void m5_reset_stats(void)
{
__asm__ __volatile__ ("mov x0, #0; mov x1, #0; .inst 0XFF000110 | (0x40 << 16);");
};
#else
#undef ENABLED
#define ENABLED 0
#endif
| 27.538462 | 107 | 0.643855 |
c7491c33947b8fe52cd643a147baef3e34156654 | 169 | c | C | cdios-tests/error-for-update.c | sgpthomas/diospyros | 27d4e5e5d4e56a6dc5860d7c7d5eefb27de24a5d | [
"MIT"
] | 27 | 2020-02-16T22:26:34.000Z | 2022-02-17T04:17:19.000Z | cdios-tests/error-for-update.c | sgpthomas/diospyros | 27d4e5e5d4e56a6dc5860d7c7d5eefb27de24a5d | [
"MIT"
] | 77 | 2020-01-21T15:37:35.000Z | 2022-03-11T19:48:43.000Z | cdios-tests/error-for-update.c | sgpthomas/diospyros | 27d4e5e5d4e56a6dc5860d7c7d5eefb27de24a5d | [
"MIT"
] | 1 | 2021-09-27T20:35:15.000Z | 2021-09-27T20:35:15.000Z | #define SIZE 8
void matrix_multiply(int a_in[SIZE], float scalar_in, float b_out[SIZE]) {
for (int i = SIZE; i < 0; i*=2) {
b_out[i] = a_in[i] * scalar_in;
}
}
| 21.125 | 74 | 0.615385 |
ba1071029b7558de345ab8d70b858f8c3be9ff1c | 11,607 | c | C | thecl/gmips.c | ManDude/gooc | 7f6738b89f66908b5f95dc89310b82e678faaaf8 | [
"BSD-2-Clause"
] | 9 | 2020-04-05T15:12:27.000Z | 2021-12-26T11:47:33.000Z | thecl/gmips.c | ManDude/thtk | 7f6738b89f66908b5f95dc89310b82e678faaaf8 | [
"BSD-2-Clause"
] | null | null | null | thecl/gmips.c | ManDude/thtk | 7f6738b89f66908b5f95dc89310b82e678faaaf8 | [
"BSD-2-Clause"
] | 2 | 2020-07-15T15:23:04.000Z | 2020-09-10T01:22:26.000Z | /*
* 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 this list
* of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce 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.
*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include "program.h"
#include "thecl.h"
#include "ecsparse.h"
#include "gmips.h"
static const char*
mips_registers[] = {
"zr",
"at",
"v0", "v1",
"a0", "a1", "a2", "a3",
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
"t8", "t9",
"k0", "k1",
"gp",
"sp",
"s8",
"ra",
"lo", "hi"
};
static const mips_ins_fmt_t
mips_instructions[] = {
{ "nop", 'R', "0", "0", "0", "0", "0", "0" },
{ "jr", 'R', "8", "0", "0", "0", "rs", "0" },
{ "jalr", 'R', "9", "0", "rd", "0", "rs", "0" },
{ "mfhi", 'R', "16", "0", "rd", "0", "0", "0" },
{ "mthi", 'R', "17", "0", "rd", "0", "0", "0" },
{ "mflo", 'R', "18", "0", "rd", "0", "0", "0" },
{ "mtlo", 'R', "19", "0", "rd", "0", "0", "0" },
{ "mult", 'R', "24", "0", "0", "rt", "rs", "0" },
{ "div", 'R', "26", "0", "0", "rt", "rs", "0" },
{ "sll", 'R', "0", "shamt", "rd", "rt", "0", "0" },
{ "sra", 'R', "3", "shamt", "rd", "rt", "0", "0" },
{ "sllv", 'R', "4", "0", "rd", "rt", "rs", "0" },
{ "srav", 'R', "7", "0", "rd", "rt", "rs", "0" },
{ "addu", 'R', "33", "0", "rd", "rt", "rs", "0" },
{ "subu", 'R', "35", "0", "rd", "rt", "rs", "0" },
{ "and", 'R', "36", "0", "rd", "rt", "rs", "0" },
{ "or", 'R', "37", "0", "rd", "rt", "rs", "0" },
{ "xor", 'R', "38", "0", "rd", "rt", "rs", "0" },
{ "nor", 'R', "39", "0", "rd", "rt", "rs", "0" },
{ "slt", 'R', "42", "0", "rd", "rt", "rs", "0" },
{ "beq", 'I', "imm", "rt", "rs", "4", NULL, NULL },
{ "bne", 'I', "imm", "rt", "rs", "5", NULL, NULL },
{ "blez", 'I', "imm", "rt", "rs", "6", NULL, NULL },
{ "bgtz", 'I', "imm", "rt", "rs", "7", NULL, NULL },
{ "addiu", 'I', "imm", "rt", "rs", "9", NULL, NULL },
{ "slti", 'I', "imm", "rt", "rs", "10", NULL, NULL },
{ "sltiu", 'I', "imm", "rt", "rs", "11", NULL, NULL },
{ "andi", 'I', "imm", "rt", "rs", "12", NULL, NULL },
{ "ori", 'I', "imm", "rt", "rs", "13", NULL, NULL },
{ "xori", 'I', "imm", "rt", "rs", "14", NULL, NULL },
{ "lui", 'I', "imm", "rt", "0", "15", NULL, NULL },
{ "lb", 'I', "imm", "rt", "rs", "32", NULL, NULL },
{ "lh", 'I', "imm", "rt", "rs", "33", NULL, NULL },
{ "lwl", 'I', "imm", "rt", "rs", "34", NULL, NULL },
{ "lw", 'I', "imm", "rt", "rs", "35", NULL, NULL },
{ "lbu", 'I', "imm", "rt", "rs", "36", NULL, NULL },
{ "lhu", 'I', "imm", "rt", "rs", "37", NULL, NULL },
{ "lwr", 'I', "imm", "rt", "rs", "38", NULL, NULL },
{ "sb", 'I', "imm", "rt", "rs", "40", NULL, NULL },
{ "sh", 'I', "imm", "rt", "rs", "41", NULL, NULL },
{ "swl", 'I', "imm", "rt", "rs", "42", NULL, NULL },
{ "sw", 'I', "imm", "rt", "rs", "43", NULL, NULL },
{ "swr", 'I', "imm", "rt", "rs", "46", NULL, NULL },
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL }
};
mips_reg_block_t*
mips_reg_block_new(void)
{
mips_reg_block_t* new_block = calloc(1, sizeof(mips_reg_block_t));
new_block->reg_index = 0;
for (int i=0; i<34; ++i) {
new_block->regs[i].index = i;
new_block->regs[i].name = mips_registers[i];
new_block->regs[i].saved_expr = NULL;
new_block->regs[i].saved_param = NULL;
new_block->regs[i].last_used = 0;
new_block->regs[i].status = MREG_STATUS_FREE;
}
new_block->regs[0].status = MREG_STATUS_RESERVED; /* zr */
new_block->regs[1].status = MREG_STATUS_RESERVED; /* at */
new_block->regs[16].status = MREG_STATUS_RESERVED; /* s0 */
new_block->regs[17].status = MREG_STATUS_RESERVED; /* s1 */
new_block->regs[18].status = MREG_STATUS_RESERVED; /* s2 */
new_block->regs[19].status = MREG_STATUS_RESERVED; /* s3 */
new_block->regs[20].status = MREG_STATUS_RESERVED; /* s4 */
new_block->regs[21].status = MREG_STATUS_RESERVED; /* s5 - actually usable but doesn't matter right now */
new_block->regs[22].status = MREG_STATUS_RESERVED; /* s6 */
new_block->regs[23].status = MREG_STATUS_RESERVED; /* s7 */
new_block->regs[26].status = MREG_STATUS_RESERVED; /* k0 */
new_block->regs[27].status = MREG_STATUS_RESERVED; /* k1 */
new_block->regs[28].status = MREG_STATUS_RESERVED; /* gp */
new_block->regs[29].status = MREG_STATUS_RESERVED; /* sp */
new_block->regs[30].status = MREG_STATUS_RESERVED; /* s8 - actually usable but doesn't matter right now */
new_block->regs[31].status = MREG_STATUS_RESERVED; /* ra */
return new_block;
}
mips_reg_t*
get_reg(mips_reg_block_t* block, const char* name)
{
for (int i=0; i<34; ++i) {
if (!strcmp(name, block->regs[i].name)) {
return &block->regs[i];
}
}
return NULL;
}
mips_reg_t*
get_usable_reg(mips_reg_block_t* block)
{
for (int i=0; i<32; block->reg_index = ++block->reg_index % 32, ++i) {
if (block->regs[block->reg_index].status == MREG_STATUS_FREE) {
return &block->regs[block->reg_index];
}
}
for (int i=0; i<32; block->reg_index = ++block->reg_index % 32, ++i) {
if (block->regs[block->reg_index].status == MREG_STATUS_USED) {
return &block->regs[block->reg_index];
}
}
return NULL;
}
void
free_reg(mips_reg_t* reg)
{
if (reg->status == MREG_STATUS_IN_USE || reg->status == MREG_STATUS_USED) {
reg->status = MREG_STATUS_FREEING;
if (reg->saved_expr) {
expression_free(reg->saved_expr);
reg->saved_expr = NULL;
}
if (reg->saved_param) {
param_free(reg->saved_param);
reg->saved_param = NULL;
}
reg->status = MREG_STATUS_FREE;
}
}
void
clean_regs(mips_reg_block_t* block)
{
for (int i = 0; i < 34; ++i) {
free_reg(&block->regs[i]);
}
block->reg_index = 0;
}
thecl_param_t*
reg_get_param(mips_reg_t* reg)
{
if (reg->status == MREG_STATUS_FREE) {
return NULL;
}
else if (reg->status == MREG_STATUS_USED) {
return reg->saved_param;
}
else return NULL;
}
expression_t*
reg_get_expr(mips_reg_t* reg)
{
if (reg->status == MREG_STATUS_FREE) {
return NULL;
}
else if (reg->status == MREG_STATUS_USED) {
return reg->saved_expr;
}
else return NULL;
}
const mips_ins_fmt_t*
mips_find_format(const char* name)
{
const mips_ins_fmt_t* format = mips_instructions;
while (format->name) {
if (!strcmp(format->name, name)) {
return format;
}
++format;
}
return NULL;
}
int
mips_instr_init(
const char* name,
int imm,
int shamt,
int rd,
int rt,
int rs,
int addr)
{
const mips_ins_fmt_t* fmt = mips_find_format(name);
if (fmt) {
mips_ins_t ins;
ins.ins = 0;
switch (fmt->fmt) {
case 'R':
ins.r.funct = atoi(fmt->ops[0]);
ins.r.shamt = !strcmp(fmt->ops[1], "shamt") ? shamt : atoi(fmt->ops[1]);
ins.r.rd = !strcmp(fmt->ops[2], "rd") ? rd : atoi(fmt->ops[2]);
ins.r.rt = !strcmp(fmt->ops[3], "rt") ? rt : atoi(fmt->ops[3]);
ins.r.rs = !strcmp(fmt->ops[4], "rs") ? rs : atoi(fmt->ops[4]);
ins.r.opcode = atoi(fmt->ops[5]);
break;
case 'I':
ins.i.imm = !strcmp(fmt->ops[0], "imm") ? imm : atoi(fmt->ops[0]);
ins.i.rt = !strcmp(fmt->ops[1], "rt") ? rt : atoi(fmt->ops[1]);
ins.i.rs = !strcmp(fmt->ops[2], "rs") ? rs : atoi(fmt->ops[2]);
ins.i.opcode = atoi(fmt->ops[3]);
break;
case 'J':
ins.j.addr = !strcmp(fmt->ops[0], "addr") ? addr : atoi(fmt->ops[0]);
ins.j.opcode = atoi(fmt->ops[1]);
break;
default:
fprintf(stdout, "%s:mips_instr_init: error: invalid mips instruction type %c", argv0, fmt->fmt);
exit(2);
}
return ins.ins;
}
else {
fprintf(stdout, "%s:mips_instr_init: mips instruction not foun: %s", argv0, name);
}
return 0;
}
uint64_t
mips_instr_getregs(const char* name, mips_ins_t *ins)
{
const mips_ins_fmt_t* fmt = mips_find_format(name);
uint64_t reg = 0;
if (fmt) {
switch (fmt->fmt) {
case 'R':
if (!strcmp(fmt->ops[2], "rd")) reg |= 1ULL << ins->r.rd;
if (!strcmp(fmt->ops[3], "rt")) reg |= 1ULL << ins->r.rt;
if (!strcmp(fmt->ops[4], "rs")) reg |= 1ULL << ins->r.rs;
break;
case 'I':
if (!strcmp(fmt->ops[1], "rt")) reg |= 1ULL << ins->i.rt;
if (!strcmp(fmt->ops[2], "rs")) reg |= 1ULL << ins->i.rs;
break;
case 'J':
break;
default:
fprintf(stdout, "%s:mips_instr_init: error: invalid mips instruction type %c", argv0, fmt->fmt);
exit(2);
}
if ((ins->i.opcode >= 32 && ins->i.opcode <= 38) || (ins->i.opcode >= 40 && ins->i.opcode <= 46)) {
if (!strcmp(fmt->ops[1], "rt")) reg |= 0x100000000 << ins->i.rt;
}
}
else {
fprintf(stdout, "%s:mips_instr_init: mips instruction not foun: %s", argv0, name);
}
return reg;
}
int
mips_instr_is_branch(mips_ins_t* ins)
{
return (ins->r.opcode == 0 && ins->r.funct == 8)
|| (ins->r.opcode == 0 && ins->r.funct == 9)
|| (ins->i.opcode == 1 && ins->i.rt == 0)
|| (ins->i.opcode == 1 && ins->i.rt == 1)
|| (ins->i.opcode == 1 && ins->i.rt == 16)
|| (ins->i.opcode == 1 && ins->i.rt == 17)
|| (ins->j.opcode == 2)
|| (ins->j.opcode == 3)
|| (ins->i.opcode == 4)
|| (ins->i.opcode == 5)
|| (ins->i.opcode == 6 && ins->i.rt == 0)
|| (ins->i.opcode == 7 && ins->i.rt == 0)
;
}
int
mips_instr_is_hilo(mips_ins_t* ins)
{
return (ins->r.opcode == 0 && ins->r.funct == 16)
|| (ins->r.opcode == 0 && ins->r.funct == 18)
;
}
int
mips_instr_is_multdiv(mips_ins_t* ins)
{
return (ins->r.opcode == 0 && ins->r.funct == 24)
|| (ins->r.opcode == 0 && ins->r.funct == 26)
;
}
int
mips_instr_is_store(mips_ins_t* ins)
{
return (ins->i.opcode >= 40 && ins->i.opcode <= 46)
;
}
| 33.546243 | 110 | 0.513483 |
0f73d9f5e593f48d87f617526cc35496c6278be0 | 3,117 | h | C | models/current/mops2.0/src/BGC_DIAGNOSTICS.h | gaia3intc/tmm_msi | 12b39dd9177ee65b4bbe5e369900c63888221c0d | [
"MIT"
] | null | null | null | models/current/mops2.0/src/BGC_DIAGNOSTICS.h | gaia3intc/tmm_msi | 12b39dd9177ee65b4bbe5e369900c63888221c0d | [
"MIT"
] | null | null | null | models/current/mops2.0/src/BGC_DIAGNOSTICS.h | gaia3intc/tmm_msi | 12b39dd9177ee65b4bbe5e369900c63888221c0d | [
"MIT"
] | null | null | null | C$Header: /Users/ikriest/CVS/mops/BGC_DIAGNOSTICS.h,v 1.2 2016/06/03 09:28:59 ikriest Exp $
C$Name: mops-2_0 $
! KM restructured for backwards campatibility with PFT (8/2021)
! MOPS arrays for diagnostics
! f8_out added by T.Tanioka (Nov 2020)
real*8 f1_out(bgc_ktotal), ! primary production
& f2_out(bgc_ktotal), ! zooplankton grazing
& f3_out(bgc_ktotal), ! detritus or POP sedimentation
& f4_out(bgc_ktotal), ! POP and DOP remineralization
& f5_out(bgc_ktotal), ! river runoff
& f6_out(bgc_ktotal), ! N fixation
& f7_out(bgc_ktotal), ! denitrification
& f8_out(bgc_ktotal) ! PAR
#ifndef PFT
#ifdef ORGCARBON
#ifndef FLEXCP
! MOPS + (CARBON assumed) + ORGCARBON
! fbgc9 = Sediment_C
real*8 f9_out(bgc_ktotal)
COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
& f8_out,f9_out
#else
! MOPS + (CARBON assumed) + ORGCARBON + FLEXCP
! TT: fbgc9 = Sediment_C, fbgc10 = Phytoplankton C:P uptake ratio, fbgc11 = Zooplankton C:P uptake ratio
real*8 f9_out(bgc_ktotal)
real*8 f10_out(bgc_ktotal),f11_out(bgc_ktotal)
COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
& f8_out,f9_out,f10_out,f11_out
#endif
#else
! MOPS
COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
& f8_out
#endif
#else
! else of ifndef PFT
#ifndef ORGCARBON
! MOPS + PFT
! fbgc9 = Photosynthesis for PFT 2
real*8 f9_out(bgc_ktotal)
COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
& f8_out,f9_out
#else
#ifndef FLEXCP
! MOPS + (CARBON assumed) + ORGCARBON + PFT
! fbgc9 = Photosynthesis for PFT 2, fbgc10 = Sediment_C
real*8 f9_out(bgc_ktotal)
real*8 f10_out(bgc_ktotal)
COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
& f8_out,f9_out,f10_out
#else
! MOPS + (CARBON assumed) + ORGCARBON + PFT + FLEXCP
! fbgc9 = Photosynthesis for PFT 2, fbgc10 = Sediment_C
! fbgc11 = PFT1 C:P uptake ratio, fbgc12 = PFT2 C:P uptake ratio, ffbgc13 = Zooplankton C:P uptake ratio
real*8 f9_out(bgc_ktotal)
real*8 f10_out(bgc_ktotal)
real*8 f11_out(bgc_ktotal),f12_out(bgc_ktotal),f13_out(bgc_ktotal)
COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
& f8_out,f9_out,f10_out,f11_out,f12_out,f13_out
#endif
#endif
! ends ORGCARBON
#endif
! ends ifndef PFT
ckm
ckm#ifndef ORGCARBON
ckm COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
ckm & f8_out
ckm#else
ckm#ifndef PFT
ckm COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
ckm & f8_out,f9_out,f10_out,f11_out
ckm#else
ckm COMMON/DIAGVARS/f1_out,f2_out,f3_out,f4_out,f5_out,f6_out,f7_out,
ckm & f8_out,f9_out,f10_out,f11_out,f12_out,f13_out
ckm#endif
ckm#endif
| 35.022472 | 110 | 0.647738 |
67f542c13e14b4516f52edd2eb24536b50d9f930 | 793 | h | C | src/rasterizator_write.h | andryblack/pcb-printer-host | 8e2980eb6584ea832720ab793b2c4454d0fe4e4e | [
"BSL-1.0",
"MIT"
] | 3 | 2020-06-18T07:24:12.000Z | 2020-10-05T18:51:41.000Z | src/rasterizator_write.h | andryblack/pcb-printer-host | 8e2980eb6584ea832720ab793b2c4454d0fe4e4e | [
"BSL-1.0",
"MIT"
] | null | null | null | src/rasterizator_write.h | andryblack/pcb-printer-host | 8e2980eb6584ea832720ab793b2c4454d0fe4e4e | [
"BSL-1.0",
"MIT"
] | 1 | 2020-01-29T10:28:38.000Z | 2020-01-29T10:28:38.000Z | #ifndef _RASTERIZATOR_WRITE_H_INCLUDED_
#define _RASTERIZATOR_WRITE_H_INCLUDED_
#include "rasterizator.h"
#include <png.h>
class RasterizatorWrite : public RefCounter {
private:
png_structp m_write;
png_infop m_info;
static void error_fn(png_structp png_ptr,
png_const_charp error_msg);
static void warning_fn(png_structp png_ptr,
png_const_charp error_msg);
FILE* m_fp;
public:
RasterizatorWrite();
~RasterizatorWrite();
static int lbind(lua_State* L);
static int lnew(lua_State* L);
void push(lua_State*L);
void open(lua_State*L,const char* path);
void set_size(lua_State*L, int64_t width,int64_t height);
void write(lua_State* L);
void close(lua_State*L);
};
typedef Ref<RasterizatorWrite> RasterizatorWriteRef;
#endif /*_RASTERIZATOR_WRITE_H_INCLUDED_*/ | 25.580645 | 58 | 0.778058 |
71c5da62ba4709863ee258345158cfea7aa5773b | 4,625 | h | C | sys/sys/cputopo.h | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | sys/sys/cputopo.h | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | sys/sys/cputopo.h | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | /*
* The 3-Clause BSD License:
* Copyright (c) 2020 Martin Kelly
* 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.
* 3. 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.
*/
/*-
* SPDX-License-Identifier: Beerware
*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
* $FreeBSD$
*/
#ifndef _SYS_CPU_H_
#define _SYS_CPU_H_
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/bitlist.h>
#include <machine/cpu.h>
/*
* Types of nodes in the topological tree.
*/
enum topo_node_type {
/* Processing unit aka computing unit aka logical CPU. */
TOPO_TYPE_PU,
/* Physical subdivision of a package. */
TOPO_TYPE_CORE,
/* CPU L1/L2/L3 cache. */
TOPO_TYPE_CACHE,
/* Package aka chip, equivalent to socket. */
TOPO_TYPE_PKG,
/* Other logical or physical grouping of PUs. */
/* E.g. PUs on the same dye, or PUs sharing an FPU. */
TOPO_TYPE_GROUP,
/* The whole system. */
TOPO_TYPE_SYSTEM
};
typedef enum topo_node_type topo_node_type;
/* Hardware indenitifier of a topology component. */
typedef unsigned int hwid_t;
/* Logical CPU idenitifier. */
typedef int cpuid_t;
struct topo_node {
struct topo_node *parent;
TAILQ_HEAD(topo_children, topo_node) children;
TAILQ_ENTRY(topo_node) siblings;
union cpu_top cpuset;
topo_node_type type;
__uintptr_t subtype;
hwid_t hwid;
cpuid_t id;
int nchildren;
int cpu_count;
};
/*
* Defines common resources for CPUs in the group. The highest level
* resource should be used when multiple are shared.
*/
#define CG_SHARE_NONE 0
#define CG_SHARE_L1 1
#define CG_SHARE_L2 2
#define CG_SHARE_L3 3
#define MAX_CACHE_LEVELS CG_SHARE_L3
/*
* Convenience routines for building and traversing topologies.
*/
#ifdef SMP
void topo_init_node(struct topo_node *node);
void topo_init_root(struct topo_node *root);
struct topo_node *topo_add_node_by_hwid(struct topo_node *parent, int hwid, topo_node_type type, uintptr_t subtype);
struct topo_node *topo_find_node_by_hwid(struct topo_node *parent, int hwid, topo_node_type type, uintptr_t subtype);
void topo_promote_child(struct topo_node *child);
struct topo_node *topo_next_node(struct topo_node *top, struct topo_node *node);
struct topo_node *topo_next_nonchild_node(struct topo_node *top, struct topo_node *node);
void topo_set_pu_id(struct topo_node *node, cpuid_t id);
enum topo_level {
TOPO_LEVEL_PKG = 0,
/*
* Some systems have useful sub-package core organizations. On these,
* a package has one or more subgroups. Each subgroup contains one or
* more cache groups (cores that share a last level cache).
*/
TOPO_LEVEL_GROUP,
TOPO_LEVEL_CACHEGROUP,
TOPO_LEVEL_CORE,
TOPO_LEVEL_THREAD,
TOPO_LEVEL_COUNT /* Must be last */
};
#define TOPO_FOREACH(i, root) \
for (i = root; i != NULL; i = topo_next_node(root, i))
#endif /* SMP */
#endif /* _SYS_CPU_H_ */
| 34.774436 | 118 | 0.712649 |
b9b5261c0deca1bd65b534f1e0123e2c22620322 | 7,428 | h | C | tttp_scancodes.h | SolraBizna/libtttp | 34842540093a3606aa08ac8f06808236a69973ea | [
"Zlib"
] | null | null | null | tttp_scancodes.h | SolraBizna/libtttp | 34842540093a3606aa08ac8f06808236a69973ea | [
"Zlib"
] | null | null | null | tttp_scancodes.h | SolraBizna/libtttp | 34842540093a3606aa08ac8f06808236a69973ea | [
"Zlib"
] | null | null | null | #ifndef TTTP_SCANCODES_H
#define TTTP_SCANCODES_H
#if __cplusplus
extern "C" {
#endif
enum tttp_scancode {
KEY_INVALID = 0x000, // "no scancode", for use in APIs only
KEY_BACKSPACE = 0x008,
KEY_TAB = 0x009,
KEY_ENTER = 0x00a,
KEY_ESCAPE = 0x01b,
KEY_SPACE = 0x020,
KEY_EXCLAMATION_MARK = 0x021,
KEY_DOUBLE_QUOTE = 0x022,
KEY_NUMBER_SIGN = 0x023,
KEY_DOLLAR = 0x024,
KEY_PERCENT = 0x025,
KEY_AMPERSAND = 0x026,
KEY_SINGLE_QUOTE = 0x027,
KEY_LEFT_PARENTHESIS = 0x028,
KEY_RIGHT_PARENTHESIS = 0x029,
KEY_ASTERISK = 0x02a,
KEY_PLUS = 0x02b,
KEY_COMMA = 0x02c,
KEY_HYPHEN = 0x02d,
KEY_PERIOD = 0x02e,
KEY_SLASH = 0x02f,
KEY_0 = 0x030,
KEY_1 = 0x031,
KEY_2 = 0x032,
KEY_3 = 0x033,
KEY_4 = 0x034,
KEY_5 = 0x035,
KEY_6 = 0x036,
KEY_7 = 0x037,
KEY_8 = 0x038,
KEY_9 = 0x039,
KEY_COLON = 0x03a,
KEY_SEMICOLON = 0x03b,
KEY_LESS_THAN = 0x03c,
KEY_EQUAL = 0x03d,
KEY_GREATER_THAN = 0x03e,
KEY_QUESTION_MARK = 0x03f,
KEY_AT = 0x040,
KEY_A = 0x041,
KEY_B = 0x042,
KEY_C = 0x043,
KEY_D = 0x044,
KEY_E = 0x045,
KEY_F = 0x046,
KEY_G = 0x047,
KEY_H = 0x048,
KEY_I = 0x049,
KEY_J = 0x04a,
KEY_K = 0x04b,
KEY_L = 0x04c,
KEY_M = 0x04d,
KEY_N = 0x04e,
KEY_O = 0x04f,
KEY_P = 0x050,
KEY_Q = 0x051,
KEY_R = 0x052,
KEY_S = 0x053,
KEY_T = 0x054,
KEY_U = 0x055,
KEY_V = 0x056,
KEY_W = 0x057,
KEY_X = 0x058,
KEY_Y = 0x059,
KEY_Z = 0x05a,
KEY_LEFT_BRACKET = 0x05b,
KEY_BACKSLASH = 0x05c,
KEY_RIGHT_BRACKET = 0x05d,
KEY_CARET = 0x05e,
KEY_UNDERSCORE = 0x05f,
KEY_GRAVE = 0x060,
KEY_LEFT_CURLY_BRACE = 0x07b,
KEY_VERTICAL_LINE = 0x07c,
KEY_RIGHT_CURLY_BRACE = 0x07d,
KEY_TILDE = 0x07e,
KEY_DELETE = 0x07f,
KEY_A_SCAN = 0x084,
KEY_B_SCAN = 0x085,
KEY_C_SCAN = 0x086,
KEY_D_SCAN = 0x087,
KEY_E_SCAN = 0x088,
KEY_F_SCAN = 0x089,
KEY_G_SCAN = 0x08a,
KEY_H_SCAN = 0x08b,
KEY_I_SCAN = 0x08c,
KEY_J_SCAN = 0x08d,
KEY_K_SCAN = 0x08e,
KEY_L_SCAN = 0x08f,
KEY_M_SCAN = 0x090,
KEY_N_SCAN = 0x091,
KEY_O_SCAN = 0x092,
KEY_P_SCAN = 0x093,
KEY_Q_SCAN = 0x094,
KEY_R_SCAN = 0x095,
KEY_S_SCAN = 0x096,
KEY_T_SCAN = 0x097,
KEY_U_SCAN = 0x098,
KEY_V_SCAN = 0x099,
KEY_W_SCAN = 0x09a,
KEY_X_SCAN = 0x09b,
KEY_Y_SCAN = 0x09c,
KEY_Z_SCAN = 0x09d,
KEY_1_SCAN = 0x09e,
KEY_2_SCAN = 0x09f,
KEY_3_SCAN = 0x0a0,
KEY_4_SCAN = 0x0a1,
KEY_5_SCAN = 0x0a2,
KEY_6_SCAN = 0x0a3,
KEY_7_SCAN = 0x0a4,
KEY_8_SCAN = 0x0a5,
KEY_9_SCAN = 0x0a6,
KEY_0_SCAN = 0x0a7,
KEY_ENTER_SCAN = 0x0a8,
KEY_ESCAPE_SCAN = 0x0a9,
KEY_BACKSPACE_SCAN = 0x0aa,
KEY_TAB_SCAN = 0x0ab,
KEY_SPACE_SCAN = 0x0ac,
KEY_HYPHEN_SCAN = 0x0ad,
KEY_EQUAL_SCAN = 0x0ae,
KEY_LEFT_BRACKET_SCAN = 0x0af,
KEY_RIGHT_BRACKET_SCAN = 0x0b0,
KEY_BACKSLASH_SCAN = 0x0b1,
KEY_NUMBER_SIGN_SCAN = 0x0b2,
KEY_SEMICOLON_SCAN = 0x0b3,
KEY_SINGLE_QUOTE_SCAN = 0x0b4,
KEY_GRAVE_SCAN = 0x0b5,
KEY_COMMA_SCAN = 0x0b6,
KEY_PERIOD_SCAN = 0x0b7,
KEY_SLASH_SCAN = 0x0b8,
KEY_F1 = 0x0ba,
KEY_F2 = 0x0bb,
KEY_F3 = 0x0bc,
KEY_F4 = 0x0bd,
KEY_F5 = 0x0be,
KEY_F6 = 0x0bf,
KEY_F7 = 0x0c0,
KEY_F8 = 0x0c1,
KEY_F9 = 0x0c2,
KEY_F10 = 0x0c3,
KEY_F11 = 0x0c4,
KEY_F12 = 0x0c5,
KEY_PRINTSCREEN = 0x0c6,
KEY_PAUSE = 0x0c8,
KEY_INSERT = 0x0c9,
KEY_HOME = 0x0ca,
KEY_PAGE_UP = 0x0cb,
KEY_DELETE_SCAN = 0x0cc,
KEY_END = 0x0cd,
KEY_PAGE_DOWN = 0x0ce,
KEY_RIGHT = 0x0cf,
KEY_LEFT = 0x0d0,
KEY_DOWN = 0x0d1,
KEY_UP = 0x0d2,
KEY_KEYPAD_CLEAR = 0x0d3,
KEY_KEYPAD_SLASH = 0x0d4,
KEY_KEYPAD_ASTERISK = 0x0d5,
KEY_KEYPAD_HYPHEN = 0x0d6,
KEY_KEYPAD_PLUS = 0x0d7,
KEY_KEYPAD_ENTER = 0x0d8,
KEY_KEYPAD_1 = 0x0d9,
KEY_KEYPAD_2 = 0x0da,
KEY_KEYPAD_3 = 0x0db,
KEY_KEYPAD_4 = 0x0dc,
KEY_KEYPAD_5 = 0x0dd,
KEY_KEYPAD_6 = 0x0de,
KEY_KEYPAD_7 = 0x0df,
KEY_KEYPAD_8 = 0x0e0,
KEY_KEYPAD_9 = 0x0e1,
KEY_KEYPAD_0 = 0x0e2,
KEY_KEYPAD_PERIOD = 0x0e3,
KEY_NONHYPHENUS_BACKSLASH = 0x0e4,
KEY_APPLICATION = 0x0e5,
KEY_KEYPAD_EQUAL = 0x0e7,
KEY_F13 = 0x0e8,
KEY_F14 = 0x0e9,
KEY_F15 = 0x0ea,
KEY_F16 = 0x0eb,
KEY_F17 = 0x0ec,
KEY_F18 = 0x0ed,
KEY_F19 = 0x0ee,
KEY_F20 = 0x0ef,
KEY_F21 = 0x0f0,
KEY_F22 = 0x0f1,
KEY_F23 = 0x0f2,
KEY_F24 = 0x0f3,
KEY_EXECUTE = 0x0f4,
KEY_HELP = 0x0f5,
KEY_MENU = 0x0f6,
KEY_SELECT = 0x0f7,
KEY_STOP = 0x0f8,
KEY_AGAIN = 0x0f9,
KEY_UNDO = 0x0fa,
KEY_CUT = 0x0fb,
KEY_COPY = 0x0fc,
KEY_PASTE = 0x0fd,
KEY_FIND = 0x0fe,
KEY_MUTE = 0x0ff,
KEY_VOLUME_UP = 0x100,
KEY_VOLUME_DOWN = 0x101,
KEY_CAPS_LOCK = 0x102,
KEY_NUM_LOCK = 0x103,
KEY_SCROLL_LOCK = 0x104,
KEY_KEYPAD_COMMA = 0x105,
KEY_KEYPAD_EQUAL_SIGN = 0x106,
KEY_INTERNATIONAL1 = 0x107,
KEY_INTERNATIONAL2 = 0x108,
KEY_INTERNATIONAL3 = 0x109,
KEY_INTERNATIONAL4 = 0x10a,
KEY_INTERNATIONAL5 = 0x10b,
KEY_INTERNATIONAL6 = 0x10c,
KEY_INTERNATIONAL7 = 0x10d,
KEY_INTERNATIONAL8 = 0x10e,
KEY_INTERNATIONAL9 = 0x10f,
KEY_LANGUAGE1 = 0x110,
KEY_LANGUAGE2 = 0x111,
KEY_LANGUAGE3 = 0x112,
KEY_LANGUAGE4 = 0x113,
KEY_LANGUAGE5 = 0x114,
KEY_LANGUAGE6 = 0x115,
KEY_LANGUAGE7 = 0x116,
KEY_LANGUAGE8 = 0x117,
KEY_LANGUAGE9 = 0x118,
KEY_ALT_ERASE = 0x119,
KEY_SYSREQ = 0x11a,
KEY_CANCEL = 0x11b,
KEY_CLEAR = 0x11c,
KEY_PRIOR = 0x11d,
KEY_RETURN = 0x11e,
KEY_SEPARATOR = 0x11f,
KEY_OUT = 0x120,
KEY_OPER = 0x121,
KEY_CLEAR_OR_AGAIN = 0x122,
KEY_CRSEL = 0x123,
KEY_EXSEL = 0x124,
KEY_KEYPAD_00 = 0x130,
KEY_KEYPAD_000 = 0x131,
KEY_THOUSANDS_SEPARATOR = 0x132,
KEY_DECIMAL_SEPARATOR = 0x133,
KEY_CURRENCY_UNIT = 0x134,
KEY_CURRENCY_SUBUNIT = 0x135,
KEY_KEYPAD_LEFT_PARENTHESIS = 0x136,
KEY_KEYPAD_RIGHT_PARENTHESIS = 0x137,
KEY_KEYPAD_LEFT_CURLY_BRACE = 0x138,
KEY_KEYPAD_RIGHT_CURLY_BRACE = 0x139,
KEY_KEYPAD_TAB = 0x13a,
KEY_KEYPAD_BACKSPACE = 0x13b,
KEY_KEYPAD_A = 0x13c,
KEY_KEYPAD_B = 0x13d,
KEY_KEYPAD_C = 0x13e,
KEY_KEYPAD_D = 0x13f,
KEY_KEYPAD_E = 0x140,
KEY_KEYPAD_F = 0x141,
KEY_KEYPAD_XOR = 0x142,
KEY_KEYPAD_CARET = 0x143,
KEY_KEYPAD_PERCENT = 0x144,
KEY_KEYPAD_LESS_THAN = 0x145,
KEY_KEYPAD_GREATER_THAN = 0x146,
KEY_KEYPAD_AMPERSAND = 0x147,
KEY_KEYPAD_AMPERSANDAMPERSAND = 0x148,
KEY_KEYPAD_VERTICAL_LINE = 0x149,
KEY_KEYPAD_VERTICAL_LINEVERTICAL_LINE = 0x14a,
KEY_KEYPAD_COLON = 0x14b,
KEY_KEYPAD_NUMBER_SIGN = 0x14c,
KEY_KEYPAD_SPACE = 0x14d,
KEY_KEYPAD_AT = 0x14e,
KEY_KEYPAD_EXCLAMATION_MARK = 0x14f,
KEY_KEYPAD_MEMORY_STORE = 0x150,
KEY_KEYPAD_MEMORY_RECALL = 0x151,
KEY_KEYPAD_MEMORY_CLEAR = 0x152,
KEY_KEYPAD_MEMORY_ADD = 0x153,
KEY_KEYPAD_MEMORY_SUBTRACT = 0x154,
KEY_KEYPAD_MEMORY_MULTIPLY = 0x155,
KEY_KEYPAD_MEMORY_DIVIDE = 0x156,
KEY_KEYPAD_PLUSSLASHHYPHEN = 0x157,
KEY_KEYPAD_CLEAR_ALT = 0x158,
KEY_KEYPAD_CLEAR_ENTRY = 0x159,
KEY_KEYPAD_BINARY = 0x15a,
KEY_KEYPAD_OCTAL = 0x15b,
KEY_KEYPAD_DECIMAL = 0x15c,
KEY_KEYPAD_HEXADECIMAL = 0x15d,
KEY_LEFT_CONTROL = 0x160,
KEY_LEFT_SHIFT = 0x161,
KEY_LEFT_ALT = 0x162,
KEY_LEFT_GUI = 0x163,
KEY_RIGHT_CONTROL = 0x164,
KEY_RIGHT_SHIFT = 0x165,
KEY_RIGHT_ALT = 0x166,
KEY_RIGHT_GUI = 0x167,
TTTP_HIGHEST_SCANCODE = 0x167
};
// Returns a (static) human-readable name for the scancode
const char* tttp_name_for_scancode(enum tttp_scancode code);
// Returns the KEY_* name for the scancode
const char* tttp_identifier_for_scancode(enum tttp_scancode code);
#if __cplusplus
}
#endif
#endif
| 24.038835 | 66 | 0.716074 |
f33caf797563e7c83ee2549cf496f16a29d93021 | 3,172 | h | C | src/General/GameTypes.h | Shimrra/alo-viewer | 16fb9ab094e6a93db55199d210b43089fb4f25a0 | [
"MIT"
] | 11 | 2017-01-18T08:58:52.000Z | 2021-11-12T16:23:28.000Z | src/General/GameTypes.h | TheSuperPlayer/alo-viewer | 616cb5a330453a50501d730d28c92059b1121651 | [
"MIT"
] | 2 | 2020-06-25T01:35:44.000Z | 2020-06-25T01:38:44.000Z | src/General/GameTypes.h | TheSuperPlayer/alo-viewer | 616cb5a330453a50501d730d28c92059b1121651 | [
"MIT"
] | 6 | 2017-02-06T18:12:09.000Z | 2021-12-24T16:38:34.000Z | #ifndef GAMETYPES_H
#define GAMETYPES_H
#include "General/3DTypes.h"
#include <string>
#include <vector>
namespace Alamo
{
typedef int ShaderDetail;
static const ShaderDetail SHADERDETAIL_FIXEDFUNCTION = 0;
static const ShaderDetail SHADERDETAIL_DX8 = 1;
static const ShaderDetail SHADERDETAIL_DX8ATI = 2;
static const ShaderDetail SHADERDETAIL_DX9 = 3;
static const ShaderDetail NUM_SHADER_DETAIL_LEVELS = 4;
struct RenderSettings
{
unsigned long m_screenWidth;
unsigned long m_screenHeight;
unsigned long m_screenRefresh;
bool m_softShadows;
bool m_antiAlias;
ShaderDetail m_shaderDetail;
bool m_bloom;
bool m_heatDistortion;
bool m_heatDebug;
bool m_shadowDebug;
};
struct Range
{
float min;
float max;
};
struct DirectionalLight
{
Color m_color;
Vector3 m_direction;
};
struct Camera
{
Vector3 m_position;
Vector3 m_target;
Vector3 m_up;
};
enum MapLightType
{
LT_SUN,
LT_FILL1,
LT_FILL2,
NUM_LIGHTS
};
struct Wind
{
float speed;
float heading;
};
struct Environment
{
DirectionalLight m_lights[3];
Color m_specular;
Color m_ambient;
Color m_shadow;
Wind m_wind;
Color m_clearColor;
Vector3 m_gravity;
};
struct BoundingBox
{
Vector3 min;
Vector3 max;
};
enum BillboardType
{
BBT_DISABLE,
BBT_PARALLEL,
BBT_FACE,
BBT_ZAXIS_VIEW,
BBT_ZAXIS_LIGHT,
BBT_ZAXIS_WIND,
BBT_SUNLIGHT_GLOW,
BBT_SUN
};
enum ShaderParameterType
{
SPT_INT,
SPT_FLOAT,
SPT_FLOAT3,
SPT_FLOAT4,
SPT_TEXTURE
};
struct ShaderParameter
{
std::string m_name;
bool m_colorize;
ShaderParameterType m_type;
int m_int;
float m_float;
Vector3 m_float3;
Vector4 m_float4;
std::string m_texture;
};
static const int MAX_NUM_SKIN_BONES = 24;
enum LightType
{
LIGHT_OMNI,
LIGHT_DIRECTIONAL,
LIGHT_SPOT
};
static const int NUM_LODS = 10;
static const int NUM_ALTS = 10;
// Master vertex type, as stored in the files
#pragma pack(1)
struct MASTER_VERTEX
{
Vector3 Position;
Vector3 Normal;
Vector2 TexCoord[4];
Vector3 Tangent;
Vector3 Binormal;
Color Color;
Vector4 Unused;
DWORD BoneIndices[4];
float BoneWeights[4];
};
#pragma pack()
enum LightFieldSourceType {
LFT_POINT = 0,
LFT_HCONE,
LFT_DUAL_HCONE,
LFT_DUAL_OPPOSED_HCONE,
LFT_LINE
};
enum LightFieldSourceFadeType {
LFFT_TIME = 0,
LFFT_PARTICLES
};
struct LightFieldSource
{
LightFieldSourceType m_type;
LightFieldSourceFadeType m_fadeType;
Vector3 m_position;
Color m_diffuse;
float m_intensity;
float m_width;
float m_length;
float m_height;
float m_autoDestructTime;
float m_autoDestructFadeTime;
float m_intensityNoiseScale;
float m_intensityNoiseTimeScale;
float m_angularVelocity;
bool m_affectedByGlobalIntensity;
unsigned long m_particles;
};
}
#endif
| 17.920904 | 57 | 0.659836 |
7e950ae6d0fa8119a7b08d319e13e062a36bb5b4 | 180 | h | C | src/problems.h | xcjs/project-euler | 48224ad3592ef7f5e74d5b214285638c8066db1f | [
"MIT"
] | null | null | null | src/problems.h | xcjs/project-euler | 48224ad3592ef7f5e74d5b214285638c8066db1f | [
"MIT"
] | null | null | null | src/problems.h | xcjs/project-euler | 48224ad3592ef7f5e74d5b214285638c8066db1f | [
"MIT"
] | null | null | null | #include "problems/IProblem.cpp"
#include "problems/Problem001.cpp"
#include "problems/Problem002.cpp"
#include "problems/Problem003.cpp"
#include "problems/Problem004.cpp"
| 25.714286 | 35 | 0.766667 |
b465c072970e3ec964c41d9f71599280fc643be6 | 381 | h | C | satlib/inc/AcisEnum.h | humkyung/app.framework | 6a709c0ccc6a78e66ad8638b2db9d560da5ee77a | [
"MIT"
] | null | null | null | satlib/inc/AcisEnum.h | humkyung/app.framework | 6a709c0ccc6a78e66ad8638b2db9d560da5ee77a | [
"MIT"
] | null | null | null | satlib/inc/AcisEnum.h | humkyung/app.framework | 6a709c0ccc6a78e66ad8638b2db9d560da5ee77a | [
"MIT"
] | null | null | null | #pragma once
enum
{
ENM_ACIS_STRAIGHT_CRV = 1,
ENM_ACIS_ELLIPSE_CRV = 2,
ENM_ACIS_INTCURVE_CRV = 3,
ENM_ACIS_PLANE_SURF = 11,
ENM_ACIS_CONE_SURF = 12,
ENM_ACIS_SPHERE_SURF = 13,
ENM_ACIS_TORUS_SURF = 14,
ENM_ACIS_SPLINE_SURF = 15
};
enum AcisSense
{
UNKNOWN = -1,
FORWARD = 0,
REVERSED= 1
};
enum AcisBsplineType
{
OPEN = 0,
PERIODIC = 1
}; | 14.653846 | 28 | 0.671916 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.