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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c5cb9a7e9e562a4da4b759f47830c394785475ef | 2,655 | h | C | Visual Mercutio/zWinUtil32/PSS_ProcessTakeOwnershipActionsDialog.h | Jeanmilost/Visual-Mercutio | f079730005b6ce93d5e184bb7c0893ccced3e3ab | [
"MIT"
] | 1 | 2022-01-31T06:24:24.000Z | 2022-01-31T06:24:24.000Z | Visual Mercutio/zWinUtil32/PSS_ProcessTakeOwnershipActionsDialog.h | Jeanmilost/Visual-Mercutio | f079730005b6ce93d5e184bb7c0893ccced3e3ab | [
"MIT"
] | 2 | 2021-04-11T15:50:42.000Z | 2021-06-05T08:23:04.000Z | Visual Mercutio/zWinUtil32/PSS_ProcessTakeOwnershipActionsDialog.h | Jeanmilost/Visual-Mercutio | f079730005b6ce93d5e184bb7c0893ccced3e3ab | [
"MIT"
] | 2 | 2021-01-08T00:55:18.000Z | 2022-01-31T06:24:18.000Z | /****************************************************************************
* ==> PSS_ProcessTakeOwnershipActionsDialog -------------------------------*
****************************************************************************
* Description : Provides a process take ownership actions dialog box *
* Developer : Processsoft *
****************************************************************************/
#ifndef PSS_TakeOwnershipActionsDialogH
#define PSS_TakeOwnershipActionsDialogH
#if _MSC_VER > 1000
#pragma once
#endif
// change the definition of AFX_EXT... to make it import
#undef AFX_EXT_CLASS
#undef AFX_EXT_API
#undef AFX_EXT_DATA
#define AFX_EXT_CLASS AFX_CLASS_IMPORT
#define AFX_EXT_API AFX_API_IMPORT
#define AFX_EXT_DATA AFX_DATA_IMPORT
// processsoft
#include "zBaseLib\PSS_Dialog.h"
#include "PSS_HoverButton.h"
// resources
#ifndef _WIN32
#include "zWinUtilRes.h"
#else
#include "zWinUtil32Res.h"
#endif
#ifdef _ZWINUTIL32EXPORT
// put the values back to make AFX_EXT_CLASS export again
#undef AFX_EXT_CLASS
#undef AFX_EXT_API
#undef AFX_EXT_DATA
#define AFX_EXT_CLASS AFX_CLASS_EXPORT
#define AFX_EXT_API AFX_API_EXPORT
#define AFX_EXT_DATA AFX_DATA_EXPORT
#endif
/**
* Take ownership actions dialog box
*@author Dominique Aigroz, Jean-Milost Reymond
*/
class AFX_EXT_CLASS PSS_ProcessTakeOwnershipActionsDialog : public PSS_Dialog
{
public:
/**
* Dialog resources
*/
enum
{
IDD = IDD_PROCESS_TAKEOWNERSHIP
};
PSS_HoverButton m_ViewCommandBtn;
PSS_HoverButton m_CancelCommandBtn;
PSS_HoverButton m_AcceptCommandBtn;
/**
* Constructor
*@param fileName - file name
*@param activityName - activity name
*@param pParent - parent window, can be NULL
*/
PSS_ProcessTakeOwnershipActionsDialog(const CString& fileName, const CString& activityName, CWnd* pParent = NULL);
protected:
/// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PSS_ProcessTakeOwnershipActionsDialog)
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
/// Generated message map functions
//{{AFX_MSG(PSS_ProcessTakeOwnershipActionsDialog)
virtual BOOL OnInitDialog();
afx_msg void OnViewCommand();
afx_msg void OnAcceptCommand();
afx_msg void OnCancelCommand();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CString m_FileName;
CString m_ActivityName;
};
#endif
| 28.858696 | 122 | 0.617326 |
65b7286eabf63906132ae6b51ae8fff281d68755 | 264 | h | C | HybridPageKit/HybridPageKit-Example/HybridPageKit-Example/Features/Gif/GifView.h | bestDew/HybridPageKit | 6b9ac5994ceb2a842e30f01408d1ff933848f936 | [
"MIT"
] | 1 | 2018-10-20T09:11:24.000Z | 2018-10-20T09:11:24.000Z | HybridPageKit/HybridPageKit-Example/HybridPageKit-Example/Features/Gif/GifView.h | bestDew/HybridPageKit | 6b9ac5994ceb2a842e30f01408d1ff933848f936 | [
"MIT"
] | null | null | null | HybridPageKit/HybridPageKit-Example/HybridPageKit-Example/Features/Gif/GifView.h | bestDew/HybridPageKit | 6b9ac5994ceb2a842e30f01408d1ff933848f936 | [
"MIT"
] | null | null | null | //
// GifView.h
// HybridPageKit
//
// Created by dequanzhu.
// Copyright © 2018 HybridPageKit. All rights reserved.
//
#import "GifModel.h"
@interface GifView : UIImageView
-(void)layoutWithData:(GifModel *)gifModel;
-(void)startPlay;
-(void)stopPlay;
@end
| 16.5 | 56 | 0.704545 |
455941ddb41bbbf08d79325c5e3572d06bb8b18f | 1,957 | c | C | utils_debugging.c | ScottAtBlankCanvas/ffmpeg-libav-tutorial | 325ab9fe5fd418418348f0d82b53daa71b30c738 | [
"BSD-3-Clause"
] | null | null | null | utils_debugging.c | ScottAtBlankCanvas/ffmpeg-libav-tutorial | 325ab9fe5fd418418348f0d82b53daa71b30c738 | [
"BSD-3-Clause"
] | null | null | null | utils_debugging.c | ScottAtBlankCanvas/ffmpeg-libav-tutorial | 325ab9fe5fd418418348f0d82b53daa71b30c738 | [
"BSD-3-Clause"
] | null | null | null | #include "utils_debugging.h"
void debug_avframe_info(char* hint, AVFrame *pFrame) {
printf("%s [%c] kf:%d fl:0x%x size:%d w:%d h:%d format:%d pts:%ld dts:%ld cpnum:%d dpnum:%d interl:%d\n",
hint?hint:"Frame",
av_get_picture_type_char(pFrame->pict_type),
pFrame->key_frame,
pFrame->flags,
pFrame->pkt_size,
pFrame->width,
pFrame->height,
pFrame->format,
pFrame->pts,
pFrame->pkt_dts,
pFrame->coded_picture_number,
pFrame->display_picture_number,
pFrame->interlaced_frame
);
}
void debug_avframe_num(int num, AVFrame *pFrame) {
char hint[1024];
sprintf(hint, "Frame #%03d", num);
debug_avframe_info(hint, pFrame);
}
void debug_avframe_audio_info(const char* hint, AVFrame *pFrame) {
printf("[%s] channels:%d ch_layout:%ld rate:%d nb_sample:%d format:%d fl:0x%x size:%d pts:%ld pkt_pts:%ld pkt_dur:%ld dec_error:%ld \n",
hint?hint:"Frame",
pFrame->channels,
pFrame->channel_layout,
pFrame->sample_rate,
pFrame->nb_samples,
pFrame->format,
pFrame->flags,
pFrame->pkt_size,
pFrame->pts,
pFrame->pkt_dts,
pFrame->pkt_duration,
pFrame->decode_error_flags
);
}
void debug_avpacket_info(char* hint, AVPacket *pPacket) {
printf("%s idx:%d flags:0x%x size:%d pts:%ld dts:%ld dur:%ld side_data:%d\n",
hint?hint:"Packet",
pPacket->stream_index,
pPacket->flags,
pPacket->size,
pPacket->pts,
pPacket->dts,
pPacket->duration,
pPacket->side_data_elems
);
}
void debug_video_avcodeccontext_info(char* hint, AVCodecContext *video_avcc) {
printf("%s w:%d h:%d pix_fmt:%d tb:%d/%d \n",
hint?hint:"VCodec",
video_avcc->width,
video_avcc->height,
video_avcc->pix_fmt,
video_avcc->time_base.num,
video_avcc->time_base.den
);
}
| 28.362319 | 141 | 0.608074 |
4568c524860852aee35c4d0165eb34a29179309f | 8,746 | h | C | src/avt/Plotter/avtActor.h | eddieTest/visit | ae7bf6f5f16b01cf6b672d34e2d293fa7170616b | [
"BSD-3-Clause"
] | null | null | null | src/avt/Plotter/avtActor.h | eddieTest/visit | ae7bf6f5f16b01cf6b672d34e2d293fa7170616b | [
"BSD-3-Clause"
] | null | null | null | src/avt/Plotter/avtActor.h | eddieTest/visit | ae7bf6f5f16b01cf6b672d34e2d293fa7170616b | [
"BSD-3-Clause"
] | null | null | null | /*****************************************************************************
*
* Copyright (c) 2000 - 2019, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* 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 disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY 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.
*
*****************************************************************************/
// ************************************************************************* //
// avtActor.h //
// ************************************************************************* //
#ifndef AVT_ACTOR_H
#define AVT_ACTOR_H
#include <plotter_exports.h>
#include <ref_ptr.h>
#include <avtBehavior.h>
#include <avtDataObject.h>
#include <avtDrawable.h>
#include <VisWindowTypes.h>
class vtkRenderer;
class avtTransparencyActor;
// ****************************************************************************
// Class: avtActor
//
// Purpose:
// This is a class that is output by an avtPlot that can be inputted to
// a VisWindow. An actor is a drawable with a behavior.
//
// Programmer: Hank Childs
// Creation: December 21, 2000
//
// Modifications:
//
// Hank Childs, Thu Mar 8 10:31:46 PST 2001
// Allows for different renderers for the decoration and the actual
// rendering.
//
// Kathleen Bonnell, Tue Apr 3 15:24:00 PDT 2001
// Add method to retrieve renderOrder.
//
// Kathleen Bonnell, Tue May 7 09:36:15 PDT 2002
// Add method GetDataExtents.
//
// Hank Childs, Sun Jul 7 12:55:05 PDT 2002
// Added support for transparency.
//
// Kathleen Bonnell, Fri Jul 12 16:20:08 PDT 2002
// Added support for decorations.
//
// Kathleen Bonnell, Fri Jul 19 08:39:04 PDT 2002
// Added UpdateScaleFactor.
//
// Kathleen Bonnell, Tue Aug 13 15:15:37 PDT 2002
// Added methods in support of lighting.
//
// Brad Whitlock, Mon Sep 23 15:50:38 PST 2002
// I added a method to set the actor's surface representation and another
// method to set its immediate mode rendering flag.
//
// Mark C. Miller, Thu Dec 19 16:19:23 PST 2002
// Added support for externally rendered images
//
// Eric Brugger, Wed Aug 20 09:49:33 PDT 2003
// Added GetWindowMode.
//
// Kathleen Bonnell, Mon Sep 29 13:44:01 PDT 2003
// Added bool arg to GetRenderOrder.
//
// Jeremy Meredith, Fri Nov 14 11:10:53 PST 2003
// Added a method to set the specular properties.
//
// Mark C. Miller, Tue May 11 20:21:24 PDT 2004
// Elminated externally rendered images actor dependence
//
// Chris Wojtan, Fri Jul 23 13:57:50 PDT 2004
// Added isVisible variable and function to check whether this actor
// is supposed to be drawn to the screen
//
// Chris Wojtan, Mon Jul 26 17:19:58 PDT 2004
// Added 4 methods to turn the opaque or tranlucent actors' visibility
// on or off.
//
// Jeremy Meredith, Thu Oct 21 12:27:38 PDT 2004
// Removed the transparency visibility settings, because it is less
// error-prone (and easier and more efficient) to turn off the entire
// avtTransparencyActor at once.
//
// Kathleen Bonnell, Mon Sep 27 10:19:11 PDT 2004
// Added MakePickable and MakeUnPickable.
//
// Kathleen Bonnell, Mon Jun 27 14:48:12 PDT 2005
// Added GetZPosition.
//
// Mark Blair, Wed Aug 30 14:09:00 PDT 2006
// Added SetTypeName and GetTypeName.
//
// Brad Whitlock, Mon Sep 18 11:19:11 PDT 2006
// Added SetColorTexturingFlag.
//
// Brad Whitlock, Mon Mar 19 17:44:19 PST 2007
// Added actorName.
//
// Hank Childs, Fri Aug 31 10:28:10 PDT 2007
// Added AdaptsToAnyWindowMode.
//
// Brad Whitlock, Thu Jan 10 14:57:03 PST 2008
// Added reduced detail mode.
//
// ****************************************************************************
class PLOTTER_API avtActor
{
public:
avtActor();
virtual ~avtActor();
void SetBehavior(avtBehavior_p);
avtBehavior_p GetBehavior(void) { return behavior; };
void SetDrawable(avtDrawable_p);
void SetDecorations(avtDrawable_p);
void SetTypeName(const char *typeName_);
const char *GetTypeName();
void Add(vtkRenderer *, vtkRenderer *);
void Remove(vtkRenderer *, vtkRenderer *);
void GetActualBounds(double [6]);
void GetOriginalBounds(double [6]);
void GetDataExtents(double &dmin, double &dmax);
int GetDimension(void);
WINDOW_MODE GetWindowMode(void);
bool AdaptsToAnyWindowMode(void);
int GetRenderOrder(bool aa);
avtLegend_p GetLegend(void);
void ShiftByVector(const double [3]);
void ScaleByVector(const double [3]);
void UpdateScaleFactor();
void VisibilityOn(void);
void VisibilityOff(void);
void SetTransparencyActor(avtTransparencyActor *);
void TurnLightingOn(void);
void TurnLightingOff(void);
void SetAmbientCoefficient(const double);
void SetSurfaceRepresentation(int rep);
void SetSpecularProperties(bool,double,double,
const ColorAttribute&);
void SetColorTexturingFlag(bool);
avtDataObject_p GetDataObject(void);
bool IsVisible();
void OpaqueVisibilityOn();
void OpaqueVisibilityOff();
void MakePickable(void);
void MakeUnPickable(void);
double GetZPosition(void);
void ReducedDetailModeOn();
bool ReducedDetailModeOff();
const char *GetActorName() const;
void SetActorName(const char *);
protected:
avtBehavior_p behavior;
avtDrawable_p drawable;
avtDrawable_p decorations;
avtTransparencyActor *transparencyActor;
int transparencyIndex;
bool isVisible;
const char *typeName;
char *actorName;
vtkRenderer *renderer;
};
typedef ref_ptr<avtActor> avtActor_p;
#endif
| 37.698276 | 79 | 0.566773 |
45966b9a5d6dcb2394c7bdce6c83fa60a7c7e108 | 6,909 | h | C | VTK/vtk_7.1.1_x64_Debug/include/vtk-7.1/vtkConvertSelection.h | jiaguobing/FastCAE | 2348ab87e83fe5c704e4c998cf391229c25ac5d5 | [
"BSD-3-Clause"
] | 4 | 2019-05-30T01:52:12.000Z | 2021-09-29T21:12:13.000Z | VTK/vtk_7.1.1_x64_Release/include/vtk-7.1/vtkConvertSelection.h | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 1 | 2020-03-06T04:49:42.000Z | 2020-03-06T04:49:42.000Z | VTK/vtk_7.1.1_x64_Release/include/vtk-7.1/vtkConvertSelection.h | Sunqia/FastCAE | cbc023fe07b6e306ceefae8b8bd7c12bc1562acb | [
"BSD-3-Clause"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | /*=========================================================================
Program: Visualization Toolkit
Module: vtkConvertSelection.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*----------------------------------------------------------------------------
Copyright (c) Sandia Corporation
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
/**
* @class vtkConvertSelection
* @brief Convert a selection from one type to another
*
*
* vtkConvertSelection converts an input selection from one type to another
* in the context of a data object being selected. The first input is the
* selection, while the second input is the data object that the selection
* relates to.
*
* @sa
* vtkSelection vtkSelectionNode vtkExtractSelection vtkExtractSelectedGraph
*/
#ifndef vtkConvertSelection_h
#define vtkConvertSelection_h
#include "vtkFiltersExtractionModule.h" // For export macro
#include "vtkSelectionAlgorithm.h"
class vtkCompositeDataSet;
class vtkGraph;
class vtkIdTypeArray;
class vtkSelection;
class vtkSelectionNode;
class vtkStringArray;
class vtkTable;
class vtkExtractSelection;
class VTKFILTERSEXTRACTION_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
{
public:
static vtkConvertSelection *New();
vtkTypeMacro(vtkConvertSelection, vtkSelectionAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
/**
* A convenience method for setting the second input (i.e. the data object).
*/
void SetDataObjectConnection(vtkAlgorithmOutput* in);
//@{
/**
* The input field type.
* If this is set to a number other than -1, ignores the input selection
* field type and instead assumes that all selection nodes have the
* field type specified.
* This should be one of the constants defined in vtkSelectionNode.h.
* Default is -1.
*/
vtkSetMacro(InputFieldType, int);
vtkGetMacro(InputFieldType, int);
//@}
//@{
/**
* The output selection content type.
* This should be one of the constants defined in vtkSelectionNode.h.
*/
vtkSetMacro(OutputType, int);
vtkGetMacro(OutputType, int);
//@}
//@{
/**
* The output array name for value or threshold selections.
*/
virtual void SetArrayName(const char*);
virtual const char* GetArrayName();
//@}
//@{
/**
* The output array names for value selection.
*/
virtual void SetArrayNames(vtkStringArray*);
vtkGetObjectMacro(ArrayNames, vtkStringArray);
//@}
//@{
/**
* Convenience methods used by UI
*/
void AddArrayName(const char*);
void ClearArrayNames();
//@}
//@{
/**
* When on, creates a separate selection node for each array.
* Defaults to OFF.
*/
vtkSetMacro(MatchAnyValues, bool);
vtkGetMacro(MatchAnyValues, bool);
vtkBooleanMacro(MatchAnyValues, bool);
//@}
//@{
/**
* Set/get a selection extractor used in some conversions to
* obtain IDs.
*/
virtual void SetSelectionExtractor(vtkExtractSelection*);
vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
//@}
//@{
/**
* Static methods for easily converting between selection types.
* NOTE: The returned selection pointer IS reference counted,
* so be sure to Delete() it when you are done with it.
*/
static vtkSelection* ToIndexSelection(
vtkSelection* input,
vtkDataObject* data);
static vtkSelection* ToGlobalIdSelection(
vtkSelection* input,
vtkDataObject* data);
static vtkSelection* ToPedigreeIdSelection(
vtkSelection* input,
vtkDataObject* data);
static vtkSelection* ToValueSelection(
vtkSelection* input,
vtkDataObject* data,
const char* arrayName);
static vtkSelection* ToValueSelection(
vtkSelection* input,
vtkDataObject* data,
vtkStringArray* arrayNames);
//@}
/**
* Static generic method for obtaining selected items from a data object.
* Other static methods (e.g. GetSelectedVertices) call this one.
*/
static void GetSelectedItems(
vtkSelection* input,
vtkDataObject* data,
int fieldType,
vtkIdTypeArray* indices);
//@{
/**
* Static methods for easily obtaining selected items from a data object.
* The array argument will be filled with the selected items.
*/
static void GetSelectedVertices(
vtkSelection* input,
vtkGraph* data,
vtkIdTypeArray* indices);
static void GetSelectedEdges(
vtkSelection* input,
vtkGraph* data,
vtkIdTypeArray* indices);
static void GetSelectedPoints(
vtkSelection* input,
vtkDataSet* data,
vtkIdTypeArray* indices);
static void GetSelectedCells(
vtkSelection* input,
vtkDataSet* data,
vtkIdTypeArray* indices);
static void GetSelectedRows(
vtkSelection* input,
vtkTable* data,
vtkIdTypeArray* indices);
//@}
/**
* A generic static method for converting selection types.
* The type should be an integer constant defined in vtkSelectionNode.h.
*/
static vtkSelection* ToSelectionType(
vtkSelection* input,
vtkDataObject* data,
int type,
vtkStringArray* arrayNames = 0,
int inputFieldType = -1);
protected:
vtkConvertSelection();
~vtkConvertSelection();
virtual int RequestData(
vtkInformation *,
vtkInformationVector **,
vtkInformationVector *);
int Convert(
vtkSelection* input,
vtkDataObject* data,
vtkSelection* output);
int ConvertCompositeDataSet(
vtkSelection* input,
vtkCompositeDataSet* data,
vtkSelection* output);
int ConvertToIndexSelection(
vtkSelectionNode* input,
vtkDataSet* data,
vtkSelectionNode* output);
int SelectTableFromTable(
vtkTable* selTable,
vtkTable* dataTable,
vtkIdTypeArray* indices);
int ConvertToBlockSelection(
vtkSelection* input, vtkCompositeDataSet* data, vtkSelection* output);
virtual int FillInputPortInformation(
int port, vtkInformation* info);
int OutputType;
int InputFieldType;
vtkStringArray* ArrayNames;
bool MatchAnyValues;
vtkExtractSelection* SelectionExtractor;
private:
vtkConvertSelection(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
void operator=(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
};
#endif
| 28.2 | 85 | 0.664496 |
ca58566b2fe1ca646c05da6c8b7f94e621a57233 | 100,423 | c | C | freeswitch/src/switch_core_session.c | gidmoth/freeswitch-image-builder | f0169671d6a4683dd4ac7226a6b38ad94640e592 | [
"BSD-2-Clause"
] | null | null | null | freeswitch/src/switch_core_session.c | gidmoth/freeswitch-image-builder | f0169671d6a4683dd4ac7226a6b38ad94640e592 | [
"BSD-2-Clause"
] | null | null | null | freeswitch/src/switch_core_session.c | gidmoth/freeswitch-image-builder | f0169671d6a4683dd4ac7226a6b38ad94640e592 | [
"BSD-2-Clause"
] | null | null | null | /*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
* Michael Jerris <mike@jerris.com>
* Paul D. Tinsley <pdt at jackhammer.org>
* Joseph Sullivan <jossulli@amazon.com>
*
*
* switch_core_session.c -- Main Core Library (session routines)
*
*/
#include "switch.h"
#include "switch_core.h"
#include "private/switch_core_pvt.h"
#define DEBUG_THREAD_POOL
struct switch_session_manager session_manager;
SWITCH_DECLARE(void) switch_core_session_set_dmachine(switch_core_session_t *session, switch_ivr_dmachine_t *dmachine, switch_digit_action_target_t target)
{
int i = (int) target;
if (i == 0 || i == 1) {
if (dmachine) {
switch_ivr_dmachine_set_target(dmachine, target);
}
session->dmachine[i] = dmachine;
}
}
SWITCH_DECLARE(switch_ivr_dmachine_t *) switch_core_session_get_dmachine(switch_core_session_t *session, switch_digit_action_target_t target)
{
int i = (int) target;
if (i == 0 || i == 1) {
return session->dmachine[i];
}
return NULL;
}
SWITCH_DECLARE(switch_jb_t *) switch_core_session_get_jb(switch_core_session_t *session, switch_media_type_t type)
{
if (session->endpoint_interface->io_routines->get_jb) {
return session->endpoint_interface->io_routines->get_jb(session, type);
}
return NULL;
}
SWITCH_DECLARE(void) switch_core_session_soft_lock(switch_core_session_t *session, uint32_t sec)
{
session->soft_lock = sec;
}
SWITCH_DECLARE(void) switch_core_session_soft_unlock(switch_core_session_t *session)
{
session->soft_lock = 0;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_set_codec_slin(switch_core_session_t *session, switch_slin_data_t *data)
{
switch_codec_implementation_t read_impl = { 0 };
int interval;
switch_core_session_get_read_impl(session, &read_impl);
interval = read_impl.microseconds_per_packet / 1000;
data->session = session;
if (switch_core_codec_init(&data->codec,
"L16",
NULL,
NULL,
read_impl.actual_samples_per_second,
interval,
read_impl.number_of_channels, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
SWITCH_LOG_DEBUG, "Codec Activated L16@%uhz %dms\n", read_impl.actual_samples_per_second, interval);
memset(&data->write_frame, 0, sizeof(data->write_frame));
data->write_frame.codec = &data->codec;
data->write_frame.data = data->frame_data;
data->write_frame.buflen = sizeof(data->frame_data);
data->write_frame.datalen = 0;
switch_core_session_set_read_codec(session, &data->codec);
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line)
{
switch_core_session_t *session = NULL;
if (uuid_str) {
switch_mutex_lock(runtime.session_hash_mutex);
if ((session = switch_core_hash_find(session_manager.session_table, uuid_str))) {
/* Acquire a read lock on the session */
#ifdef SWITCH_DEBUG_RWLOCKS
if (switch_core_session_perform_read_lock(session, file, func, line) != SWITCH_STATUS_SUCCESS) {
#if EMACS_CC_MODE_IS_BUGGY
}
#endif
#else
if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
#endif
/* not available, forget it */
session = NULL;
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
}
/* if its not NULL, now it's up to you to rwunlock this */
return session;
}
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_force_locate(const char *uuid_str, const char *file, const char *func, int line)
{
switch_core_session_t *session = NULL;
switch_status_t status;
if (uuid_str) {
switch_mutex_lock(runtime.session_hash_mutex);
if ((session = switch_core_hash_find(session_manager.session_table, uuid_str))) {
/* Acquire a read lock on the session */
if (switch_test_flag(session, SSF_DESTROYED)) {
status = SWITCH_STATUS_FALSE;
#ifdef SWITCH_DEBUG_RWLOCKS
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, uuid_str, SWITCH_LOG_ERROR, "%s %s Read lock FAIL\n",
switch_core_session_get_uuid(session), switch_channel_get_name(session->channel));
#endif
} else {
status = (switch_status_t) switch_thread_rwlock_tryrdlock(session->rwlock);
#ifdef SWITCH_DEBUG_RWLOCKS
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, uuid_str, SWITCH_LOG_ERROR, "%s %s Read lock ACQUIRED\n",
switch_core_session_get_uuid(session), switch_channel_get_name(session->channel));
#endif
}
if (status != SWITCH_STATUS_SUCCESS) {
/* not available, forget it */
session = NULL;
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
}
/* if its not NULL, now it's up to you to rwunlock this */
return session;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_get_partner(switch_core_session_t *session, switch_core_session_t **partner,
const char *file, const char *func, int line)
{
const char *uuid;
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
if ((uuid = switch_channel_get_partner_uuid_copy(session->channel, uuid_str, sizeof(uuid_str)))) {
if ((*partner = switch_core_session_perform_locate(uuid, file, func, line))) {
return SWITCH_STATUS_SUCCESS;
}
}
*partner = NULL;
return SWITCH_STATUS_FALSE;
}
struct str_node {
char *str;
struct str_node *next;
};
SWITCH_DECLARE(uint32_t) switch_core_session_hupall_matching_vars_ans(switch_event_t *vars, switch_call_cause_t cause, switch_hup_type_t type)
{
switch_hash_index_t *hi;
void *val;
switch_core_session_t *session;
switch_memory_pool_t *pool;
struct str_node *head = NULL, *np;
uint32_t r = 0;
switch_core_new_memory_pool(&pool);
if (!vars || !vars->headers)
return r;
switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first(session_manager.session_table); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val);
if (val) {
session = (switch_core_session_t *) val;
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
int ans = switch_channel_test_flag(switch_core_session_get_channel(session), CF_ANSWERED);
if ((ans && (type & SHT_ANSWERED)) || (!ans && (type & SHT_UNANSWERED))) {
np = switch_core_alloc(pool, sizeof(*np));
np->str = switch_core_strdup(pool, session->uuid_str);
np->next = head;
head = np;
}
switch_core_session_rwunlock(session);
}
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
for(np = head; np; np = np->next) {
if ((session = switch_core_session_locate(np->str))) {
const char *this_value;
if (switch_channel_up_nosig(session->channel)) {
/* check if all conditions are satisfied */
int do_hangup = 1;
switch_event_header_t *hp;
for (hp = vars->headers; hp; hp = hp->next) {
const char *var_name = hp->name;
const char *var_value = hp->value;
if (!(this_value = switch_channel_get_variable(session->channel, var_name)) || (strcmp(this_value, var_value))) {
do_hangup = 0;
break;
}
}
if (do_hangup) {
switch_channel_hangup(session->channel, cause);
r++;
}
}
switch_core_session_rwunlock(session);
}
}
switch_core_destroy_memory_pool(&pool);
return r;
}
SWITCH_DECLARE(uint32_t) switch_core_session_hupall_matching_var_ans(const char *var_name, const char *var_val, switch_call_cause_t cause,
switch_hup_type_t type)
{
switch_event_t *vars;
int r = 0;
if (!var_val || !var_name)
return r;
switch_event_create(&vars, SWITCH_EVENT_CLONE);
switch_event_add_header_string(vars, SWITCH_STACK_BOTTOM, var_name, var_val);
r = switch_core_session_hupall_matching_vars_ans(vars, cause, type);
switch_event_destroy(&vars);
return r;
}
SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall_matching_var(const char *var_name, const char *var_val)
{
switch_hash_index_t *hi;
void *val;
switch_core_session_t *session;
switch_memory_pool_t *pool;
struct str_node *head = NULL, *np;
switch_console_callback_match_t *my_matches = NULL;
const char *like = NULL;
if (var_val && *var_val == '~') {
like = var_val + 1;
}
switch_core_new_memory_pool(&pool);
switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first(session_manager.session_table); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val);
if (val) {
session = (switch_core_session_t *) val;
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
np = switch_core_alloc(pool, sizeof(*np));
np->str = switch_core_strdup(pool, session->uuid_str);
np->next = head;
head = np;
switch_core_session_rwunlock(session);
}
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
for(np = head; np; np = np->next) {
if ((session = switch_core_session_locate(np->str))) {
const char *this_val;
if (switch_channel_up_nosig(session->channel) &&
(this_val = switch_channel_get_variable_dup(session->channel, var_name, SWITCH_FALSE, -1)) &&
(!var_val || (like && switch_stristr(like, var_val)) || !strcmp(this_val, var_val))) {
switch_console_push_match(&my_matches, (const char *) np->str);
}
switch_core_session_rwunlock(session);
}
}
switch_core_destroy_memory_pool(&pool);
return my_matches;
}
SWITCH_DECLARE(void) switch_core_session_hupall_endpoint(const switch_endpoint_interface_t *endpoint_interface, switch_call_cause_t cause)
{
switch_hash_index_t *hi;
void *val;
switch_core_session_t *session;
switch_memory_pool_t *pool;
struct str_node *head = NULL, *np;
switch_core_new_memory_pool(&pool);
switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first(session_manager.session_table); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val);
if (val) {
session = (switch_core_session_t *) val;
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
if (session->endpoint_interface == endpoint_interface) {
np = switch_core_alloc(pool, sizeof(*np));
np->str = switch_core_strdup(pool, session->uuid_str);
np->next = head;
head = np;
}
switch_core_session_rwunlock(session);
}
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
for(np = head; np; np = np->next) {
if ((session = switch_core_session_locate(np->str))) {
switch_channel_hangup(session->channel, cause);
switch_core_session_rwunlock(session);
}
}
switch_core_destroy_memory_pool(&pool);
}
SWITCH_DECLARE(void) switch_core_session_hupall(switch_call_cause_t cause)
{
switch_hash_index_t *hi;
void *val;
switch_core_session_t *session;
switch_memory_pool_t *pool;
struct str_node *head = NULL, *np;
switch_core_new_memory_pool(&pool);
switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first(session_manager.session_table); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val);
if (val) {
session = (switch_core_session_t *) val;
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
np = switch_core_alloc(pool, sizeof(*np));
np->str = switch_core_strdup(pool, session->uuid_str);
np->next = head;
head = np;
switch_core_session_rwunlock(session);
}
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
for(np = head; np; np = np->next) {
if ((session = switch_core_session_locate(np->str))) {
switch_channel_hangup(session->channel, cause);
switch_core_session_rwunlock(session);
}
}
switch_core_destroy_memory_pool(&pool);
}
SWITCH_DECLARE(switch_console_callback_match_t *) switch_core_session_findall(void)
{
switch_hash_index_t *hi;
void *val;
switch_core_session_t *session;
switch_console_callback_match_t *my_matches = NULL;
switch_mutex_lock(runtime.session_hash_mutex);
for (hi = switch_core_hash_first(session_manager.session_table); hi; hi = switch_core_hash_next(&hi)) {
switch_core_hash_this(hi, NULL, NULL, &val);
if (val) {
session = (switch_core_session_t *) val;
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
switch_console_push_match(&my_matches, session->uuid_str);
switch_core_session_rwunlock(session);
}
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
return my_matches;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_message_send(const char *uuid_str, switch_core_session_message_t *message)
{
switch_core_session_t *session = NULL;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_mutex_lock(runtime.session_hash_mutex);
if ((session = switch_core_hash_find(session_manager.session_table, uuid_str)) != 0) {
/* Acquire a read lock on the session or forget it the channel is dead */
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
if (switch_channel_up_nosig(session->channel)) {
status = switch_core_session_receive_message(session, message);
}
switch_core_session_rwunlock(session);
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_event_send(const char *uuid_str, switch_event_t **event)
{
switch_core_session_t *session = NULL;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_mutex_lock(runtime.session_hash_mutex);
if ((session = switch_core_hash_find(session_manager.session_table, uuid_str)) != 0) {
/* Acquire a read lock on the session or forget it the channel is dead */
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
if (switch_channel_up_nosig(session->channel)) {
status = switch_core_session_queue_event(session, event);
}
switch_core_session_rwunlock(session);
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
return status;
}
SWITCH_DECLARE(void *) switch_core_session_get_private_class(switch_core_session_t *session, switch_pvt_class_t index)
{
if ((int)index >= SWITCH_CORE_SESSION_MAX_PRIVATES) {
return NULL;
}
switch_assert(session != NULL);
return session->private_info[index];
}
SWITCH_DECLARE(switch_status_t) switch_core_session_set_private_class(switch_core_session_t *session, void *private_info, switch_pvt_class_t index)
{
switch_assert(session != NULL);
if ((int)index >= SWITCH_CORE_SESSION_MAX_PRIVATES) {
return SWITCH_STATUS_FALSE;
}
session->private_info[index] = private_info;
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session_t *session, void *private_info)
{
session->streams[session->stream_count++] = private_info;
return session->stream_count - 1;
}
SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session_t *session, int index)
{
return session->streams[index];
}
SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session_t *session)
{
return session->stream_count;
}
SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
const char *endpoint_name,
switch_caller_profile_t *caller_profile,
switch_core_session_t **new_session,
switch_memory_pool_t **pool,
switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
{
switch_io_event_hook_outgoing_channel_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_endpoint_interface_t *endpoint_interface;
switch_channel_t *channel = NULL;
switch_caller_profile_t *outgoing_profile = caller_profile;
switch_call_cause_t cause = SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL;
const char *forwardvar;
int forwardval = 70;
if ((endpoint_interface = switch_loadable_module_get_endpoint_interface(endpoint_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Could not locate channel type %s\n", endpoint_name);
return SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED;
}
if (!endpoint_interface->io_routines->outgoing_channel) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Could not locate outgoing channel interface for %s\n", endpoint_name);
return SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED;
}
if (session) {
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
if (!zstr(forwardvar)) {
forwardval = atoi(forwardvar) - 1;
}
if (forwardval <= 0) {
return SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR;
}
if (caller_profile) {
const char *eani = NULL, *eaniii = NULL;
const char *ecaller_id_name = NULL, *ecaller_id_number = NULL;
if (!(flags & SOF_NO_EFFECTIVE_ANI)) {
eani = switch_channel_get_variable(channel, "effective_ani");
}
if (!(flags & SOF_NO_EFFECTIVE_ANIII)) {
eaniii = switch_channel_get_variable(channel, "effective_aniii");
}
if (!(flags & SOF_NO_EFFECTIVE_CID_NAME)) {
ecaller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name");
}
if (!(flags & SOF_NO_EFFECTIVE_CID_NUM)) {
ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
}
if (eani || eaniii || ecaller_id_name || ecaller_id_number) {
outgoing_profile = switch_caller_profile_clone(session, caller_profile);
if (eani) {
outgoing_profile->ani = eani;
}
if (eaniii) {
outgoing_profile->aniii = eaniii;
}
if (ecaller_id_name) {
outgoing_profile->caller_id_name = ecaller_id_name;
}
if (ecaller_id_number) {
outgoing_profile->caller_id_number = ecaller_id_number;
}
}
}
if (!outgoing_profile) {
outgoing_profile = switch_channel_get_caller_profile(channel);
}
}
if ((cause =
endpoint_interface->io_routines->outgoing_channel(session, var_event, outgoing_profile, new_session, pool, flags,
cancel_cause)) != SWITCH_CAUSE_SUCCESS) {
UNPROTECT_INTERFACE(endpoint_interface);
return cause;
}
if (session) {
for (ptr = session->event_hooks.outgoing_channel; ptr; ptr = ptr->next) {
if ((status = ptr->outgoing_channel(session, var_event, caller_profile, *new_session, flags)) != SWITCH_STATUS_SUCCESS) {
break;
}
}
}
if (!*new_session) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT,
"Outgoing method for endpoint: [%s] returned: [%s] but there is no new session!\n", endpoint_name,
switch_channel_cause2str(cause));
UNPROTECT_INTERFACE(endpoint_interface);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
} else {
switch_caller_profile_t *profile = NULL, *cloned_profile = NULL;
switch_event_t *event;
switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);
const char *use_uuid;
switch_core_session_t *other_session = NULL;
switch_assert(peer_channel);
if (channel && switch_true(switch_channel_get_variable(channel, "session_copy_loglevel"))) {
(*new_session)->loglevel = session->loglevel;
}
if ((use_uuid = switch_event_get_header(var_event, "origination_uuid"))) {
use_uuid = switch_core_session_strdup(*new_session, use_uuid);
if (switch_core_session_set_uuid(*new_session, use_uuid) == SWITCH_STATUS_SUCCESS) {
switch_event_del_header(var_event, "origination_uuid");
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_DEBUG, "%s set UUID=%s\n", switch_channel_get_name(peer_channel),
use_uuid);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(*new_session), SWITCH_LOG_CRIT, "%s set UUID=%s FAILED\n",
switch_channel_get_name(peer_channel), use_uuid);
}
}
if (!channel && var_event) {
const char *other_uuid;
if ((other_uuid = switch_event_get_header(var_event, "origination_aleg_uuid")) && (other_session = switch_core_session_locate(other_uuid))) {
channel = switch_core_session_get_channel(other_session);
session = other_session;
}
}
if (channel) {
const char *val;
switch_codec_t *vid_read_codec = NULL, *read_codec = switch_core_session_get_read_codec(session);
const char *ep = NULL, *max_forwards = switch_core_session_sprintf(session, "%d", forwardval);
switch_channel_set_variable(peer_channel, SWITCH_MAX_FORWARDS_VARIABLE, max_forwards);
profile = switch_channel_get_caller_profile(channel);
vid_read_codec = switch_core_session_get_video_read_codec(session);
ep = switch_channel_get_variable(channel, "ep_codec_string");
if (read_codec && read_codec->implementation && switch_core_codec_ready(read_codec)) {
char rc[80] = "", vrc[80] = "", tmp[160] = "";
switch_codec2str(read_codec, rc, sizeof(rc));
if (vid_read_codec && vid_read_codec->implementation && switch_core_codec_ready(vid_read_codec)) {
vrc[0] = ',';
switch_codec2str(vid_read_codec, vrc + 1, sizeof(vrc) - 1);
switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE, vrc + 1);
}
switch_snprintf(tmp, sizeof(tmp), "%s%s", rc, vrc);
switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_CODEC_VARIABLE, tmp);
} else if (ep) {
switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_CODEC_VARIABLE, ep);
}
if (switch_channel_test_flag(channel, CF_MSRPS) || switch_channel_test_flag(channel, CF_WANT_MSRPS)) {
switch_channel_set_flag(peer_channel, CF_WANT_MSRPS);
} else if (switch_channel_test_flag(channel, CF_MSRP) || switch_channel_test_flag(channel, CF_WANT_MSRP)) {
switch_channel_set_flag(peer_channel, CF_WANT_MSRP);
}
if (switch_channel_test_flag(channel, CF_RTT) || switch_channel_test_flag(channel, CF_WANT_RTT)) {
switch_channel_set_flag(peer_channel, CF_WANT_RTT);
}
switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_VARIABLE, switch_core_session_get_uuid(session));
switch_channel_set_variable(peer_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(session));
// Needed by 3PCC proxy so that aleg can find bleg to pass SDP to, when final ACK arrives.
switch_channel_set_variable(channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(*new_session));
if ((val = switch_channel_get_variable(channel, SWITCH_PROCESS_CDR_VARIABLE))) {
switch_channel_set_variable(peer_channel, SWITCH_PROCESS_CDR_VARIABLE, val);
}
if ((val = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE))) {
switch_channel_pass_sdp(channel, peer_channel, val);
}
if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
if (switch_channel_test_cap(peer_channel, CC_BYPASS_MEDIA)) {
switch_channel_set_flag(peer_channel, CF_PROXY_MODE);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"%s does not support the proxy feature, disabling.\n", switch_channel_get_name(peer_channel));
switch_channel_clear_flag(channel, CF_PROXY_MODE);
}
}
if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
if (switch_channel_test_cap(peer_channel, CC_PROXY_MEDIA)) {
switch_channel_set_flag(peer_channel, CF_PROXY_MEDIA);
if (switch_channel_test_flag(channel, CF_VIDEO)) {
switch_channel_set_flag(peer_channel, CF_VIDEO);
}
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"%s does not support the proxy feature, disabling.\n", switch_channel_get_name(peer_channel));
switch_channel_clear_flag(channel, CF_PROXY_MEDIA);
}
}
if (switch_channel_test_flag(channel, CF_ZRTP_PASSTHRU_REQ)) {
switch_channel_set_flag(peer_channel, CF_ZRTP_PASSTHRU_REQ);
}
if (profile) {
if ((cloned_profile = switch_caller_profile_clone(*new_session, profile)) != 0) {
switch_channel_set_originator_caller_profile(peer_channel, cloned_profile);
}
}
if ((profile = switch_channel_get_caller_profile(peer_channel))) {
if ((cloned_profile = switch_caller_profile_clone(session, profile)) != 0) {
switch_channel_set_origination_caller_profile(channel, cloned_profile);
}
}
}
if (other_session) {
switch_core_session_rwunlock(other_session);
channel = NULL;
session = NULL;
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(peer_channel, event);
switch_event_fire(&event);
}
}
UNPROTECT_INTERFACE(endpoint_interface);
return cause;
}
static const char *message_names[] = {
"REDIRECT_AUDIO",
"TRANSMIT_TEXT",
"ANSWER",
"ACKNOWLEDGE_CALL",
"PROGRESS",
"BRIDGE",
"UNBRIDGE",
"TRANSFER",
"RINGING",
"ALERTING",
"MEDIA",
"3P_MEDIA",
"NOMEDIA",
"3P_NOMEDIA",
"HOLD",
"UNHOLD",
"REDIRECT",
"RESPOND",
"BROADCAST",
"MEDIA_REDIRECT",
"DEFLECT",
"VIDEO_REFRESH_REQ",
"DISPLAY",
"TRANSCODING_NECESSARY",
"AUDIO_SYNC",
"VIDEO_SYNC",
"REQUEST_IMAGE_MEDIA",
"UUID_CHANGE",
"SIMPLIFY",
"DEBUG_MEDIA",
"PROXY_MEDIA",
"APPLICATION_EXEC",
"APPLICATION_EXEC_COMPLETE",
"PHONE_EVENT",
"T38_DESCRIPTION",
"UDPTL_MODE",
"CLEAR_PROGRESS",
"JITTER_BUFFER",
"RECOVERY_REFRESH",
"SIGNAL_DATA",
"MESSAGE",
"INFO",
"AUDIO_DATA",
"BLIND_TRANSFER_RESPONSE",
"STUN_ERROR",
"MEDIA_RENEG",
"KEEPALIVE",
"HARD_MUTE",
"BITRATE_REQ",
"BITRATE_ACK",
"CODEC_DEBUG_REQ",
"CODEC_SPECIFIC_REQ",
"REFER_EVENT",
"ANSWER_EVENT",
"PROGRESS_EVENT",
"RING_EVENT",
"RESAMPLE_EVENT",
"HEARTBEAT_EVENT",
"INVALID"
};
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(switch_core_session_t *session,
switch_core_session_message_t *message,
const char *file, const char *func, int line)
{
switch_io_event_hook_receive_message_t *ptr;
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_assert(session != NULL);
if (message->message_id == SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) {
if (session->endpoint_interface->io_routines->receive_message) {
status = session->endpoint_interface->io_routines->receive_message(session, message);
}
switch_core_session_free_message(&message);
return status;
}
if ((status = switch_core_session_read_lock_hangup(session)) != SWITCH_STATUS_SUCCESS) {
return status;
}
if (!message->_file) {
message->_file = file;
}
if (!message->_func) {
message->_func = func;
}
if (!message->_line) {
message->_line = line;
}
if (message->message_id > SWITCH_MESSAGE_INVALID-1) {
message->message_id = SWITCH_MESSAGE_INVALID-1;
}
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG1, "%s receive message [%s]\n",
switch_channel_get_name(session->channel), message_names[message->message_id]);
if (message->message_id == SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS) {
switch_channel_clear_flag(session->channel, CF_EARLY_MEDIA);
}
if (message->message_id == SWITCH_MESSAGE_INDICATE_MEDIA) {
switch_channel_set_flag(session->channel, CF_PROXY_OFF);
}
if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY) {
char *arg = NULL;
if (zstr(message->string_array_arg[0]) && !zstr(message->string_arg)) {
arg = switch_core_session_strdup(session, message->string_arg);
switch_separate_string(arg, '|', (char **)message->string_array_arg, 2);
}
if (!zstr(message->string_array_arg[0])) {
switch_channel_set_variable(session->channel, "last_sent_callee_id_name", message->string_array_arg[0]);
}
if (!zstr(message->string_array_arg[1])) {
switch_channel_set_variable(session->channel, "last_sent_callee_id_number", message->string_array_arg[1]);
}
if (switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG1, "Ignoring display update.\n");
status = SWITCH_STATUS_SUCCESS;
goto end;
}
}
if (switch_channel_down_nosig(session->channel)) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s skip receive message [%s] (channel is hungup already)\n",
switch_channel_get_name(session->channel), message_names[message->message_id]);
} else {
if (session->media_handle) {
status = switch_core_media_receive_message(session, message);
}
if (status == SWITCH_STATUS_SUCCESS) {
if (session->endpoint_interface->io_routines->receive_message) {
status = session->endpoint_interface->io_routines->receive_message(session, message);
}
}
}
if (status == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.receive_message; ptr; ptr = ptr->next) {
if ((status = ptr->receive_message(session, message)) != SWITCH_STATUS_SUCCESS) {
break;
}
}
if (message->message_id == SWITCH_MESSAGE_INDICATE_BRIDGE &&
switch_channel_test_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER)) {
switch_core_session_t *other_session;
const char *uuid = switch_channel_get_variable(session->channel, "blind_transfer_uuid");
switch_channel_clear_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER);
if (!zstr(uuid) && (other_session = switch_core_session_locate(uuid))) {
switch_core_session_message_t msg = { 0 };
msg.message_id = SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE;
msg.from = __FILE__;
msg.numeric_arg = 1;
switch_core_session_receive_message(other_session, &msg);
switch_core_session_rwunlock(other_session);
}
}
}
message->_file = NULL;
message->_func = NULL;
message->_line = 0;
if (switch_channel_up_nosig(session->channel)) {
if (message->message_id == SWITCH_MESSAGE_INDICATE_BRIDGE || message->message_id == SWITCH_MESSAGE_INDICATE_UNBRIDGE) {
switch_core_media_bug_flush_all(session);
switch_core_recovery_track(session);
}
switch (message->message_id) {
case SWITCH_MESSAGE_REDIRECT_AUDIO:
case SWITCH_MESSAGE_INDICATE_ANSWER:
case SWITCH_MESSAGE_INDICATE_PROGRESS:
case SWITCH_MESSAGE_INDICATE_BRIDGE:
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
case SWITCH_MESSAGE_INDICATE_TRANSFER:
case SWITCH_MESSAGE_INDICATE_RINGING:
case SWITCH_MESSAGE_INDICATE_MEDIA:
case SWITCH_MESSAGE_INDICATE_NOMEDIA:
case SWITCH_MESSAGE_INDICATE_HOLD:
case SWITCH_MESSAGE_INDICATE_UNHOLD:
case SWITCH_MESSAGE_INDICATE_REDIRECT:
case SWITCH_MESSAGE_INDICATE_RESPOND:
case SWITCH_MESSAGE_INDICATE_BROADCAST:
case SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT:
case SWITCH_MESSAGE_INDICATE_DEFLECT:
switch_channel_set_flag(session->channel, CF_VIDEO_BREAK);
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
break;
default:
break;
}
}
end:
if (message->message_id == SWITCH_MESSAGE_INDICATE_MEDIA) {
switch_channel_clear_flag(session->channel, CF_PROXY_OFF);
}
switch_core_session_free_message(&message);
switch_core_session_rwunlock(session);
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_pass_indication(switch_core_session_t *session, switch_core_session_message_types_t indication)
{
switch_core_session_message_t msg = { 0 };
switch_core_session_t *other_session;
const char *uuid;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_status_t status = SWITCH_STATUS_SUCCESS;
if (((uuid = switch_channel_get_partner_uuid(channel))) && (other_session = switch_core_session_locate(uuid))) {
msg.message_id = indication;
msg.from = __FILE__;
status = switch_core_session_receive_message(other_session, &msg);
switch_core_session_rwunlock(other_session);
} else {
status = SWITCH_STATUS_FALSE;
}
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core_session_t *session, switch_core_session_message_types_t indication)
{
switch_core_session_message_t *msg;
if ((msg = malloc(sizeof(*msg)))) {
memset(msg, 0, sizeof(*msg));
msg->message_id = indication;
msg->from = __FILE__;
switch_set_flag(msg, SCSMF_DYNAMIC);
switch_core_session_queue_message(session, msg);
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session, switch_core_session_message_t *message)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_assert(session != NULL);
if (session->message_queue) {
if (switch_queue_trypush(session->message_queue, message) == SWITCH_STATUS_SUCCESS) {
status = SWITCH_STATUS_SUCCESS;
}
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
switch_core_session_wake_session_thread(session);
}
return status;
}
SWITCH_DECLARE(void) switch_core_session_free_message(switch_core_session_message_t **message)
{
switch_core_session_message_t *to_free = *message;
int i;
char *s;
*message = NULL;
if (switch_test_flag(to_free, SCSMF_DYNAMIC)) {
s = (char *) to_free->string_arg;
switch_safe_free(s);
switch_safe_free(to_free->pointer_arg);
for (i = 0; i < MESSAGE_STRING_ARG_MAX; i++) {
s = (char *) to_free->string_array_arg[i];
switch_safe_free(s);
}
switch_safe_free(to_free);
}
}
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_session_t *session, switch_core_session_message_t **message)
{
switch_status_t status = SWITCH_STATUS_FALSE;
void *pop;
switch_assert(session != NULL);
if (session->message_queue) {
if ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
*message = (switch_core_session_message_t *) pop;
if ((*message)->delivery_time && (*message)->delivery_time > switch_epoch_time_now(NULL)) {
switch_core_session_queue_message(session, *message);
*message = NULL;
status = SWITCH_STATUS_FALSE;
}
}
}
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_flush_message(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_FALSE;
void *pop;
switch_core_session_message_t *message;
switch_assert(session != NULL);
if (session->message_queue) {
while ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
message = (switch_core_session_message_t *) pop;
switch_ivr_process_indications(session, message);
switch_core_session_free_message(&message);
}
}
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_signal_data(switch_core_session_t *session, void *signal_data)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_assert(session != NULL);
if (session->signal_data_queue) {
if (switch_queue_push(session->signal_data_queue, signal_data) == SWITCH_STATUS_SUCCESS) {
status = SWITCH_STATUS_SUCCESS;
}
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
switch_core_session_wake_session_thread(session);
}
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_signal_data(switch_core_session_t *session, void **signal_data)
{
switch_status_t status = SWITCH_STATUS_FALSE;
void *pop;
switch_assert(session != NULL);
if (session->signal_data_queue) {
if ((status = (switch_status_t) switch_queue_trypop(session->signal_data_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
*signal_data = pop;
}
}
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_receive_event(switch_core_session_t *session, switch_event_t **event)
{
switch_io_event_hook_receive_event_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_assert(session != NULL);
/* Acquire a read lock on the session or forget it the channel is dead */
if (switch_core_session_read_lock(session) == SWITCH_STATUS_SUCCESS) {
if (switch_channel_up_nosig(session->channel)) {
if (session->endpoint_interface->io_routines->receive_event) {
status = session->endpoint_interface->io_routines->receive_event(session, *event);
}
if (status == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.receive_event; ptr; ptr = ptr->next) {
if ((status = ptr->receive_event(session, *event)) != SWITCH_STATUS_SUCCESS) {
break;
}
}
}
if (status == SWITCH_STATUS_BREAK) {
status = SWITCH_STATUS_SUCCESS;
}
if (status == SWITCH_STATUS_SUCCESS) {
switch_event_destroy(event);
}
}
switch_core_session_rwunlock(session);
}
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_event(switch_core_session_t *session, switch_event_t **event)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_assert(session != NULL);
if (session->event_queue) {
if (switch_queue_trypush(session->event_queue, *event) == SWITCH_STATUS_SUCCESS) {
*event = NULL;
status = SWITCH_STATUS_SUCCESS;
switch_core_session_wake_session_thread(session);
}
}
return status;
}
SWITCH_DECLARE(uint32_t) switch_core_session_messages_waiting(switch_core_session_t *session)
{
int x = 0;
if (session->private_event_queue) {
x += switch_queue_size(session->private_event_queue);
}
if (session->message_queue) {
x += switch_queue_size(session->message_queue);
}
return x;
}
SWITCH_DECLARE(uint32_t) switch_core_session_event_count(switch_core_session_t *session)
{
if (session->event_queue) {
return switch_queue_size(session->event_queue);
}
return 0;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session, switch_event_t **event, switch_bool_t force)
{
switch_status_t status = SWITCH_STATUS_FALSE;
void *pop;
switch_assert(session != NULL);
if (session->event_queue && (force || !switch_channel_test_flag(session->channel, CF_DIVERT_EVENTS))) {
if ((status = (switch_status_t) switch_queue_trypop(session->event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
*event = (switch_event_t *) pop;
}
}
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_core_session_t *session, switch_event_t **event, switch_bool_t priority)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_queue_t *queue;
switch_assert(session != NULL);
switch_assert(event != NULL);
if (session->private_event_queue) {
queue = priority ? session->private_event_queue_pri : session->private_event_queue;
(*event)->event_id = SWITCH_EVENT_PRIVATE_COMMAND;
if (switch_queue_trypush(queue, *event) == SWITCH_STATUS_SUCCESS) {
*event = NULL;
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
status = SWITCH_STATUS_SUCCESS;
}
}
return status;
}
#define check_media(session) \
{ \
if (switch_channel_test_flag(session->channel, CF_BROADCAST_DROP_MEDIA)) { \
switch_channel_clear_flag(session->channel, CF_BROADCAST_DROP_MEDIA); \
switch_ivr_nomedia(session->uuid_str, SMF_REBRIDGE); \
} \
} \
SWITCH_DECLARE(uint32_t) switch_core_session_private_event_count(switch_core_session_t *session)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
uint32_t count = 0;
if (session->private_event_queue) {
if (!switch_channel_test_flag(channel, CF_EVENT_LOCK)) {
count = switch_queue_size(session->private_event_queue);
}
if (!switch_channel_test_flag(channel, CF_EVENT_LOCK_PRI)) {
count += switch_queue_size(session->private_event_queue_pri);
}
if (count == 0) {
check_media(session);
}
}
return count;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session, switch_event_t **event)
{
switch_status_t status = SWITCH_STATUS_FALSE;
void *pop;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_queue_t *queue;
if (session->private_event_queue) {
if (switch_queue_size(session->private_event_queue_pri)) {
queue = session->private_event_queue_pri;
if (switch_channel_test_flag(channel, CF_EVENT_LOCK_PRI)) {
return SWITCH_STATUS_FALSE;
}
} else {
queue = session->private_event_queue;
if (switch_channel_test_flag(channel, CF_EVENT_LOCK)) {
return SWITCH_STATUS_FALSE;
}
}
if ((status = (switch_status_t) switch_queue_trypop(queue, &pop)) == SWITCH_STATUS_SUCCESS) {
*event = (switch_event_t *) pop;
} else {
check_media(session);
}
}
return status;
}
SWITCH_DECLARE(uint32_t) switch_core_session_flush_private_events(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_FALSE;
int x = 0;
void *pop;
if (session->private_event_queue) {
while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue_pri, &pop)) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
x++;
}
while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
x++;
}
check_media(session);
}
return x;
}
SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, switch_bool_t flush_dtmf, switch_bool_t reset_read_codec)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_size_t has;
if (reset_read_codec) {
switch_core_session_set_read_codec(session, NULL);
if (session->sdata && switch_core_codec_ready(&session->sdata->codec)) {
switch_core_codec_destroy(&session->sdata->codec);
}
}
/* clear resamplers */
switch_mutex_lock(session->resample_mutex);
switch_resample_destroy(&session->read_resampler);
switch_resample_destroy(&session->write_resampler);
switch_mutex_unlock(session->resample_mutex);
/* clear indications */
switch_core_session_flush_message(session);
/* wipe these, they will be recreated if need be */
switch_mutex_lock(session->codec_write_mutex);
switch_buffer_destroy(&session->raw_write_buffer);
switch_mutex_unlock(session->codec_write_mutex);
switch_mutex_lock(session->codec_read_mutex);
switch_buffer_destroy(&session->raw_read_buffer);
switch_mutex_unlock(session->codec_read_mutex);
switch_mutex_lock(session->video_codec_write_mutex);
switch_buffer_destroy(&session->video_raw_write_buffer);
switch_mutex_unlock(session->video_codec_write_mutex);
switch_mutex_lock(session->video_codec_read_mutex);
switch_buffer_destroy(&session->video_raw_read_buffer);
switch_mutex_unlock(session->video_codec_read_mutex);
//video_raw_read_frame.data is dynamically allocated if necessary, so wipe this also
switch_safe_free(session->video_raw_read_frame.data);
if (flush_dtmf) {
while ((has = switch_channel_has_dtmf(channel))) {
switch_channel_flush_dtmf(channel);
}
}
switch_clear_flag(session, SSF_WARN_TRANSCODE);
switch_ivr_deactivate_unicast(session);
switch_channel_clear_flag(channel, CF_BREAK);
}
SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(switch_core_session_t *session)
{
switch_assert(session->channel);
return session->channel;
}
SWITCH_DECLARE(switch_mutex_t *) switch_core_session_get_mutex(switch_core_session_t *session)
{
return session->mutex;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_wake_session_thread(switch_core_session_t *session)
{
switch_status_t status;
int tries = 0;
/* If trylock fails the signal is already awake so we needn't bother ..... or do we????*/
top:
status = switch_mutex_trylock(session->mutex);
if (status == SWITCH_STATUS_SUCCESS) {
switch_thread_cond_signal(session->cond);
switch_mutex_unlock(session->mutex);
} else {
if (switch_channel_state_thread_trylock(session->channel) == SWITCH_STATUS_SUCCESS) {
/* We've beat them for sure, as soon as we release this lock, they will be checking their queue on the next line. */
switch_channel_set_flag(session->channel, CF_STATE_REPEAT);
switch_channel_state_thread_unlock(session->channel);
} else {
/* What luck! The channel has already started going to sleep *after* we checked if we need to wake it up.
It will miss any messages in its queue because they were inserted after *it* checked its queue. (catch-22)
So, it's not asleep yet, but it's too late for us to be sure they know we want them to stay awake and check its queue again.
Now *we* need to sleep instead but just for 1ms so we can circle back and try again.
This is so rare (yet possible) to happen that we can be fairly certian it will not happen 2x in a row but we'll try 10x just in case.
*/
if (++tries < 10) {
switch_cond_next();
goto top;
}
}
}
return status;
}
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_io_event_hook_state_change_t *ptr;
switch_core_session_wake_session_thread(session);
if (session->endpoint_interface->io_routines->state_change) {
status = session->endpoint_interface->io_routines->state_change(session);
}
if (status == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.state_change; ptr; ptr = ptr->next) {
if ((status = ptr->state_change(session)) != SWITCH_STATUS_SUCCESS) {
break;
}
}
}
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
}
SWITCH_DECLARE(unsigned int) switch_core_session_running(switch_core_session_t *session)
{
return switch_test_flag(session, SSF_THREAD_RUNNING) ? 1 : 0;
}
SWITCH_DECLARE(unsigned int) switch_core_session_started(switch_core_session_t *session)
{
return switch_test_flag(session, SSF_THREAD_STARTED) ? 1 : 0;
}
SWITCH_DECLARE(int) switch_core_session_sync_clock(void)
{
int doit = 0;
switch_mutex_lock(runtime.session_hash_mutex);
if (session_manager.session_count == 0) {
doit = 1;
} else {
switch_set_flag((&runtime), SCF_SYNC_CLOCK_REQUESTED);
}
switch_mutex_unlock(runtime.session_hash_mutex);
if (doit) {
switch_time_sync();
}
return doit;
}
SWITCH_DECLARE(void) switch_core_session_perform_destroy(switch_core_session_t **session, const char *file, const char *func, int line)
{
switch_memory_pool_t *pool;
switch_event_t *event;
switch_endpoint_interface_t *endpoint_interface = (*session)->endpoint_interface;
int i;
switch_core_session_flush_private_events(*session);
if (switch_core_session_running(*session) && !switch_test_flag((*session), SSF_DESTROYABLE)) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_core_session_get_uuid(*session), SWITCH_LOG_ERROR,
"Cowardly ignoring an attempt to call destroy on a running session.\n");
}
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_core_session_get_uuid(*session), SWITCH_LOG_NOTICE, "Close Channel %s [%s]\n",
switch_channel_get_name((*session)->channel), switch_channel_state_name(switch_channel_get_state((*session)->channel)));
if ((*session)->text_buffer) {
switch_buffer_destroy(&(*session)->text_buffer);
}
if ((*session)->text_line_buffer) {
switch_buffer_destroy(&(*session)->text_line_buffer);
}
switch_core_session_reset(*session, SWITCH_TRUE, SWITCH_TRUE);
switch_core_media_bug_remove_all(*session);
switch_ivr_deactivate_unicast(*session);
switch_scheduler_del_task_group((*session)->uuid_str);
switch_mutex_lock(runtime.session_hash_mutex);
switch_core_hash_delete(session_manager.session_table, (*session)->uuid_str);
if (session_manager.session_count) {
session_manager.session_count--;
if (session_manager.session_count == 0) {
if (switch_test_flag((&runtime), SCF_SYNC_CLOCK_REQUESTED)) {
switch_time_sync();
switch_clear_flag((&runtime), SCF_SYNC_CLOCK_REQUESTED);
}
}
}
switch_mutex_unlock(runtime.session_hash_mutex);
if ((*session)->plc) {
plc_free((*session)->plc);
(*session)->plc = NULL;
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DESTROY) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data((*session)->channel, event);
switch_event_fire(&event);
}
switch_core_session_destroy_state(*session);
switch_buffer_destroy(&(*session)->raw_read_buffer);
switch_buffer_destroy(&(*session)->raw_write_buffer);
switch_ivr_clear_speech_cache(*session);
switch_channel_uninit((*session)->channel);
for (i = 0; i < 2; i++) {
if ((*session)->dmachine[i]) {
switch_ivr_dmachine_destroy(&(*session)->dmachine[i]);
}
}
if ((*session)->event_queue) {
switch_status_t status;
void *pop;
while ((status = (switch_status_t) switch_queue_trypop((*session)->event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
}
}
pool = (*session)->pool;
//#ifndef NDEBUG
//memset(*session, 0, sizeof(switch_core_session_t));
//#endif
*session = NULL;
switch_core_destroy_memory_pool(&pool);
UNPROTECT_INTERFACE(endpoint_interface);
}
SWITCH_STANDARD_SCHED_FUNC(sch_heartbeat_callback)
{
switch_event_t *event;
switch_core_session_t *session;
char *uuid = task->cmd_arg;
switch_core_session_message_t msg = { 0 };
if ((session = switch_core_session_locate(uuid))) {
switch_event_create(&event, SWITCH_EVENT_SESSION_HEARTBEAT);
switch_channel_event_set_data(session->channel, event);
switch_event_fire(&event);
/* reschedule this task */
task->runtime = switch_epoch_time_now(NULL) + session->track_duration;
msg.message_id = SWITCH_MESSAGE_HEARTBEAT_EVENT;
msg.numeric_arg = session->track_duration;
switch_core_session_receive_message(session, &msg);
switch_core_session_rwunlock(session);
}
}
SWITCH_DECLARE(void) switch_core_session_unsched_heartbeat(switch_core_session_t *session)
{
if (session->track_id) {
switch_scheduler_del_task_id(session->track_id);
session->track_id = 0;
}
}
SWITCH_DECLARE(void) switch_core_session_sched_heartbeat(switch_core_session_t *session, uint32_t seconds)
{
time_t when;
switch_core_session_unsched_heartbeat(session);
if (switch_true(switch_channel_get_variable(session->channel, "heartbeat_fire_on_set"))) {
when = switch_epoch_time_now(NULL);
} else {
when = switch_epoch_time_now(NULL) + session->track_duration;
}
session->track_id = switch_scheduler_add_task(when, sch_heartbeat_callback, (char *) __SWITCH_FUNC__,
switch_core_session_get_uuid(session), 0, strdup(switch_core_session_get_uuid(session)), SSHF_FREE_ARG);
}
SWITCH_DECLARE(void) switch_core_session_enable_heartbeat(switch_core_session_t *session, uint32_t seconds)
{
switch_assert(session != NULL);
if (!seconds) {
seconds = 60;
}
session->track_duration = seconds;
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || !switch_channel_media_ready(session->channel) ||
switch_true(switch_channel_get_variable_dup(session->channel, "heartbeat_use_scheduler", SWITCH_FALSE, -1)) ||
switch_true(switch_channel_get_variable_dup(session->channel, "bypass_media", SWITCH_FALSE, -1)) ||
switch_true(switch_channel_get_variable_dup(session->channel, "bypass_media_after_bridge", SWITCH_FALSE, -1))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s using scheduler due to bypass media or media is not established.\n",
switch_channel_get_name(session->channel));
switch_core_session_sched_heartbeat(session, seconds);
return;
}
if (switch_true(switch_channel_get_variable(session->channel, "heartbeat_fire_on_set"))) {
session->read_frame_count = 0;
} else {
session->read_frame_count = (session->read_impl.samples_per_second / session->read_impl.samples_per_packet) * seconds;
}
switch_core_session_unsched_heartbeat(session);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s setting session heartbeat to %u second(s).\n",
switch_channel_get_name(session->channel), seconds);
}
SWITCH_DECLARE(void) switch_core_session_disable_heartbeat(switch_core_session_t *session)
{
switch_core_session_unsched_heartbeat(session);
switch_assert(session != NULL);
session->read_frame_count = 0;
session->track_duration = 0;
}
SWITCH_DECLARE(switch_bool_t) switch_core_session_in_thread(switch_core_session_t *session)
{
return switch_thread_equal(switch_thread_self(), session->thread_id) ? SWITCH_TRUE : SWITCH_FALSE;
}
static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thread, void *obj)
{
switch_core_session_t *session = obj;
switch_event_t *event;
char *event_str = NULL;
const char *val;
session->thread = thread;
session->thread_id = switch_thread_self();
switch_core_session_run(session);
switch_core_media_bug_remove_all(session);
if (session->soft_lock) {
uint32_t loops = session->soft_lock * 10;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Session %" SWITCH_SIZE_T_FMT " (%s) Soft-Locked, "
"Waiting %u for external entities\n",
session->id, switch_channel_get_name(session->channel), session->soft_lock);
while(--loops > 0) {
if (!session->soft_lock) break;
switch_yield(100000);
}
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Session %" SWITCH_SIZE_T_FMT " (%s) Locked, Waiting on external entities\n",
session->id, switch_channel_get_name(session->channel));
switch_core_session_write_lock(session);
switch_set_flag(session, SSF_DESTROYED);
if ((val = switch_channel_get_variable(session->channel, "memory_debug")) && switch_true(val)) {
if (switch_event_create(&event, SWITCH_EVENT_GENERAL) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
switch_event_serialize(event, &event_str, SWITCH_FALSE);
switch_assert(event_str);
switch_core_memory_pool_tag(switch_core_session_get_pool(session), switch_core_session_strdup(session, event_str));
free(event_str);
switch_event_destroy(&event);
}
}
switch_core_session_rwunlock(session);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Session %" SWITCH_SIZE_T_FMT " (%s) Ended\n",
session->id, switch_channel_get_name(session->channel));
switch_set_flag(session, SSF_DESTROYABLE);
switch_core_session_destroy(&session);
return NULL;
}
typedef struct switch_thread_pool_node_s {
switch_memory_pool_t *pool;
} switch_thread_pool_node_t;
static void *SWITCH_THREAD_FUNC switch_core_session_thread_pool_worker(switch_thread_t *thread, void *obj)
{
switch_thread_pool_node_t *node = (switch_thread_pool_node_t *) obj;
switch_memory_pool_t *pool = node->pool;
#ifdef DEBUG_THREAD_POOL
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Worker Thread %ld Started\n", (long) (intptr_t) thread);
#endif
for (;;) {
void *pop;
switch_status_t check_status = switch_queue_pop_timeout(session_manager.thread_queue, &pop, 5000000);
if (check_status == SWITCH_STATUS_SUCCESS) {
switch_thread_data_t *td = (switch_thread_data_t *) pop;
#ifdef DEBUG_THREAD_POOL
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Worker Thread %ld Processing\n", (long) (intptr_t) thread);
#endif
td->func(thread, td->obj);
if (td->pool) {
switch_memory_pool_t *pool = td->pool;
td = NULL;
switch_core_destroy_memory_pool(&pool);
} else if (td->alloc) {
free(td);
}
#ifdef DEBUG_THREAD_POOL
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Worker Thread %ld Done Processing\n", (long)(intptr_t) thread);
#endif
switch_mutex_lock(session_manager.mutex);
session_manager.busy--;
switch_mutex_unlock(session_manager.mutex);
} else {
switch_mutex_lock(session_manager.mutex);
if (!switch_status_is_timeup(check_status) || session_manager.running > session_manager.busy) {
if (!--session_manager.running) {
switch_thread_cond_signal(session_manager.cond);
}
switch_mutex_unlock(session_manager.mutex);
break;
}
switch_mutex_unlock(session_manager.mutex);
}
}
#ifdef DEBUG_THREAD_POOL
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Worker Thread %ld Ended\n", (long)(intptr_t) thread);
#endif
switch_core_destroy_memory_pool(&pool);
return NULL;
}
static void thread_launch_failure(void)
{
uint32_t sess_count;
switch_mutex_lock(session_manager.mutex);
sess_count = switch_core_session_count();
if (sess_count > 110) {
switch_core_session_limit(sess_count - 10);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "LUKE: I'm hit, but not bad.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT,
"LUKE'S VOICE: Artoo, see what you can do with it. Hang on back there....\n"
"Green laserfire moves past the beeping little robot as his head turns. "
"After a few beeps and a twist of his mechanical arm,\n"
"Artoo reduces the max sessions to %d thus, saving the switch from certain doom.\n", sess_count - 10);
}
switch_mutex_unlock(session_manager.mutex);
}
static switch_status_t check_queue(void)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_mutex_lock(session_manager.mutex);
if (session_manager.running >= ++session_manager.busy) {
switch_mutex_unlock(session_manager.mutex);
return SWITCH_STATUS_SUCCESS;
}
++session_manager.running;
switch_mutex_unlock(session_manager.mutex);
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr;
switch_memory_pool_t *pool;
switch_thread_pool_node_t *node;
switch_core_new_memory_pool(&pool);
node = switch_core_alloc(pool, sizeof(*node));
node->pool = pool;
switch_threadattr_create(&thd_attr, node->pool);
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_threadattr_priority_set(thd_attr, SWITCH_PRI_LOW);
if (switch_thread_create(&thread, thd_attr, switch_core_session_thread_pool_worker, node, node->pool) != SWITCH_STATUS_SUCCESS) {
switch_mutex_lock(session_manager.mutex);
if (!--session_manager.running) {
switch_thread_cond_signal(session_manager.cond);
}
switch_mutex_unlock(session_manager.mutex);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Thread Failure!\n");
switch_core_destroy_memory_pool(&pool);
status = SWITCH_STATUS_GENERR;
thread_launch_failure();
} else {
status = SWITCH_STATUS_SUCCESS;
}
}
return status;
}
SWITCH_DECLARE(switch_status_t) switch_thread_pool_launch_thread(switch_thread_data_t **tdp)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_thread_data_t *td;
switch_assert(tdp);
td = *tdp;
*tdp = NULL;
status = switch_queue_push(session_manager.thread_queue, td);
check_queue();
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_thread_pool_launch(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_INUSE;
switch_thread_data_t *td;
switch_mutex_lock(session->mutex);
if (switch_test_flag(session, SSF_THREAD_RUNNING)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Cannot double-launch thread!\n");
} else if (switch_test_flag(session, SSF_THREAD_STARTED)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Cannot launch thread again after it has already been run!\n");
} else {
switch_set_flag(session, SSF_THREAD_RUNNING);
switch_set_flag(session, SSF_THREAD_STARTED);
td = switch_core_session_alloc(session, sizeof(*td));
td->obj = session;
td->func = switch_core_session_thread;
status = switch_queue_push(session_manager.thread_queue, td);
check_queue();
}
switch_mutex_unlock(session->mutex);
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_thread_launch(switch_core_session_t *session)
{
switch_status_t status = SWITCH_STATUS_FALSE;
switch_thread_t *thread;
switch_threadattr_t *thd_attr;
if (switch_test_flag(session, SSF_THREAD_RUNNING) || switch_test_flag(session, SSF_THREAD_STARTED)) {
status = SWITCH_STATUS_INUSE;
goto end;
}
if (switch_test_flag((&runtime), SCF_SESSION_THREAD_POOL)) {
return switch_core_session_thread_pool_launch(session);
}
switch_mutex_lock(session->mutex);
if (switch_test_flag(session, SSF_THREAD_RUNNING)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Cannot double-launch thread!\n");
} else if (switch_test_flag(session, SSF_THREAD_STARTED)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Cannot launch thread again after it has already been run!\n");
} else {
switch_set_flag(session, SSF_THREAD_RUNNING);
switch_set_flag(session, SSF_THREAD_STARTED);
switch_threadattr_create(&thd_attr, session->pool);
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
if (switch_thread_create(&thread, thd_attr, switch_core_session_thread, session, session->pool) == SWITCH_STATUS_SUCCESS) {
switch_set_flag(session, SSF_THREAD_STARTED);
status = SWITCH_STATUS_SUCCESS;
} else {
switch_clear_flag(session, SSF_THREAD_RUNNING);
switch_clear_flag(session, SSF_THREAD_STARTED);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Cannot create thread!\n");
thread_launch_failure();
}
}
switch_mutex_unlock(session->mutex);
end:
return status;
}
SWITCH_DECLARE(const char *) switch_core_session_get_text_buffer(switch_core_session_t *session)
{
const char *buf = NULL;
if (session->text_buffer) {
switch_mutex_lock(session->text_mutex);
buf = (const char *)switch_core_session_strdup(session, (const char *) switch_buffer_get_head_pointer(session->text_buffer));
switch_mutex_unlock(session->text_mutex);
}
return buf;
}
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *session, switch_thread_start_t func, void *obj)
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL;
switch_threadattr_create(&thd_attr, session->pool);
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
if (switch_thread_create(&thread, thd_attr, func, obj, session->pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Cannot create thread!\n");
thread_launch_failure();
}
}
SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session_t *session, const char *use_uuid)
{
switch_event_t *event;
switch_core_session_message_t msg = { 0 };
switch_caller_profile_t *profile;
switch_assert(use_uuid);
if (!strcmp(use_uuid, session->uuid_str)) {
return SWITCH_STATUS_SUCCESS;
}
switch_mutex_lock(runtime.session_hash_mutex);
if (switch_core_hash_find(session_manager.session_table, use_uuid)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Duplicate UUID!\n");
switch_mutex_unlock(runtime.session_hash_mutex);
return SWITCH_STATUS_FALSE;
}
msg.message_id = SWITCH_MESSAGE_INDICATE_UUID_CHANGE;
msg.from = switch_channel_get_name(session->channel);
msg.string_array_arg[0] = session->uuid_str;
msg.string_array_arg[1] = use_uuid;
switch_core_session_receive_message(session, &msg);
if ((profile = switch_channel_get_caller_profile(session->channel))) {
profile->uuid = switch_core_strdup(profile->pool, use_uuid);
}
switch_channel_set_variable(session->channel, "uuid", use_uuid);
switch_channel_set_variable(session->channel, "call_uuid", use_uuid);
switch_event_create(&event, SWITCH_EVENT_CHANNEL_UUID);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Unique-ID", session->uuid_str);
switch_core_hash_delete(session_manager.session_table, session->uuid_str);
switch_set_string(session->uuid_str, use_uuid);
switch_core_hash_insert(session_manager.session_table, session->uuid_str, session);
switch_mutex_unlock(runtime.session_hash_mutex);
switch_channel_event_set_data(session->channel, event);
switch_event_fire(&event);
return SWITCH_STATUS_SUCCESS;
}
static char *xml_find_var(switch_xml_t vars, const char *name)
{
switch_xml_t var;
if ((var = switch_xml_child(vars, name)) && var->txt) {
return var->txt;
}
return NULL;
}
static void parse_array(const char *str, uint32_t *array, int32_t array_len)
{
char *p, *v, *dup, *next = NULL;
if (zstr(str)) {
return;
}
dup = strdup(str);
p = dup;
while (p) {
if ((next = strchr(p, ';'))) {
*next++ = '\0';
}
if ((v = strchr(p, '='))) {
*v++ = '\0';
}
if (p && v) {
int x = 0, y = 0;
x = atoi(p);
y = atoi(v);
if (x < array_len) {
array[x] = y;
}
}
p = next;
}
free(dup);
}
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_xml(switch_endpoint_interface_t *endpoint_interface,
switch_memory_pool_t **pool, switch_xml_t xml)
{
switch_core_session_t *session;
switch_channel_t *channel;
switch_xml_t tag, tag2, tag3, vars, callflow;
switch_call_direction_t direction = SWITCH_CALL_DIRECTION_OUTBOUND;
char *flag_str = NULL, *cap_str = NULL, *direction_s = NULL, *uuid = NULL;
uint32_t flags[CF_FLAG_MAX] = { 0 };
uint32_t caps[CC_FLAG_MAX] = { 0 };
int i;
vars = switch_xml_child(xml, "variables");
uuid = xml_find_var(vars, "uuid");
if ((tag = switch_xml_child(xml, "channel_data"))) {
direction_s = xml_find_var(tag, "direction");
direction = !strcmp(direction_s, "outbound") ? SWITCH_CALL_DIRECTION_OUTBOUND : SWITCH_CALL_DIRECTION_INBOUND;
flag_str = xml_find_var(tag, "flags");
cap_str = xml_find_var(tag, "caps");
}
parse_array(flag_str, flags, CF_FLAG_MAX);
parse_array(cap_str, caps, CC_FLAG_MAX);
flags[CF_RECOVERING] = 0;
flags[CF_RECOVERING_BRIDGE] = 0;
flags[CF_TRACKED] = 0;
flags[CF_TRANSFER] = 0;
flags[CF_ACCEPT_CNG] = 0;
flags[CF_REDIRECT] = 0;
flags[CF_BRIDGED] = 0;
flags[CF_HOLD] = 0;
flags[CF_SERVICE] = 0;
flags[CF_TAGGED] = 0;
flags[CF_WINNER] = 0;
flags[CF_EARLY_OK] = 0;
flags[CF_CONTROLLED] = 0;
flags[CF_SUSPEND] = 0;
flags[CF_EVENT_PARSE] = 0;
flags[CF_GEN_RINGBACK] = 0;
flags[CF_BREAK] = 0;
flags[CF_BROADCAST] = 0;
flags[CF_UNICAST] = 0;
flags[CF_EVENT_LOCK] = 0;
flags[CF_EVENT_LOCK_PRI] = 0;
flags[CF_RESET] = 0;
flags[CF_ORIGINATING] = 0;
flags[CF_STOP_BROADCAST] = 0;
flags[CF_INNER_BRIDGE] = 0;
flags[CF_REQ_MEDIA] = 0;
flags[CF_PAUSE_BUGS] = 0;
flags[CF_DIVERT_EVENTS] = 0;
flags[CF_BLOCK_STATE] = 0;
flags[CF_FS_RTP] = 0;
flags[CF_REPORTING] = 0;
flags[CF_PARK] = 0;
flags[CF_TIMESTAMP_SET] = 0;
flags[CF_ORIGINATOR] = 0;
flags[CF_XFER_ZOMBIE] = 0;
flags[CF_MEDIA_ACK] = 0;
flags[CF_THREAD_SLEEPING] = 0;
flags[CF_DISABLE_RINGBACK] = 0;
flags[CF_NOT_READY] = 0;
flags[CF_SIGNAL_BRIDGE_TTL] = 0;
flags[CF_MEDIA_BRIDGE_TTL] = 0;
flags[CF_BYPASS_MEDIA_AFTER_BRIDGE] = 0;
flags[CF_LEG_HOLDING] = 0;
flags[CF_BROADCAST_DROP_MEDIA] = 0;
flags[CF_EARLY_HANGUP] = 0;
flags[CF_MEDIA_SET] = 0;
flags[CF_CONSUME_ON_ORIGINATE] = 0;
flags[CF_PASSTHRU_PTIME_MISMATCH] = 0;
flags[CF_BRIDGE_NOWRITE] = 0;
flags[CF_RECOVERED] = 0;
flags[CF_JITTERBUFFER] = 0;
flags[CF_JITTERBUFFER_PLC] = 0;
flags[CF_DIALPLAN] = 0;
flags[CF_BLOCK_BROADCAST_UNTIL_MEDIA] = 0;
flags[CF_CNG_PLC] = 0;
flags[CF_ATTENDED_TRANSFER] = 0;
flags[CF_LAZY_ATTENDED_TRANSFER] = 0;
flags[CF_SIGNAL_DATA] = 0;
flags[CF_SIMPLIFY] = 0;
flags[CF_VIDEO_READY] = 0;
flags[CF_VIDEO_DECODED_READ] = 0;
if (!(session = switch_core_session_request_uuid(endpoint_interface, direction, SOF_NO_LIMITS, pool, uuid))) {
return NULL;
}
channel = switch_core_session_get_channel(session);
for (i = 0; i < CF_FLAG_MAX; i++) {
if (flags[i]) {
switch_channel_set_flag_value(channel, i, flags[i]);
}
}
for (i = 0; i < CC_FLAG_MAX; i++) {
if (caps[i]) {
switch_channel_set_cap_value(channel, i, caps[i]);
}
}
if ((tag2 = switch_xml_child(xml, "variables"))) {
for (tag = tag2->child; tag; tag = tag->sibling) {
if (tag->name && tag->txt) {
char *p = strdup(tag->txt);
char *val = p;
switch_url_decode(val);
switch_channel_set_variable(channel, tag->name, val);
if (!strcasecmp(tag->name, "channel_name")) {
switch_channel_set_name(channel, val);
}
free(p);
}
}
}
if ((callflow = switch_xml_child(xml, "callflow"))) {
if ((tag2 = switch_xml_child(callflow, "caller_profile"))) {
switch_caller_profile_t *caller_profile;
char *tmp;
caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
xml_find_var(tag2, "username"),
xml_find_var(tag2, "dialplan"),
xml_find_var(tag2, "caller_id_name"),
xml_find_var(tag2, "caller_id_number"),
xml_find_var(tag2, "network_addr"),
xml_find_var(tag2, "ani"),
xml_find_var(tag2, "aniii"),
xml_find_var(tag2, "rdnis"),
xml_find_var(tag2, "source"),
xml_find_var(tag2, "context"), xml_find_var(tag2, "destination_number"));
if ((tmp = xml_find_var(tag2, "callee_id_name"))) {
caller_profile->callee_id_name = switch_core_session_strdup(session, tmp);
}
if ((tmp = xml_find_var(tag2, "callee_id_number"))) {
caller_profile->callee_id_number = switch_core_session_strdup(session, tmp);
}
if ((tag3 = switch_xml_child(callflow, "times"))) {
caller_profile->times = (switch_channel_timetable_t *) switch_core_session_alloc(session, sizeof(*caller_profile->times));
caller_profile->times->resurrected = switch_time_now();
for (tag3 = tag3->child; tag3; tag3 = tag3->sibling) {
int64_t v;
if (tag3->name && tag3->txt) {
v = atoll(tag3->txt);
if (!strcmp(tag3->name, "created_time")) {
caller_profile->times->created = v;
} else if (!strcmp(tag3->name, "profile_created_time")) {
caller_profile->times->profile_created = v;
} else if (!strcmp(tag3->name, "progress_time")) {
caller_profile->times->progress = v;
} else if (!strcmp(tag3->name, "progress_media_time")) {
caller_profile->times->progress_media = v;
} else if (!strcmp(tag3->name, "answered_time")) {
caller_profile->times->answered = v;
} else if (!strcmp(tag3->name, "hangup_time")) {
caller_profile->times->hungup = v;
} else if (!strcmp(tag3->name, "transfer_time")) {
caller_profile->times->transferred = v;
}
}
}
}
switch_channel_set_caller_profile(channel, caller_profile);
if ((tag = switch_xml_child(tag2, "originator")) && (tag = tag->child)) {
caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
xml_find_var(tag, "username"),
xml_find_var(tag, "dialplan"),
xml_find_var(tag, "caller_id_name"),
xml_find_var(tag, "caller_id_number"),
xml_find_var(tag, "network_addr"),
xml_find_var(tag, "ani"),
xml_find_var(tag, "aniii"),
xml_find_var(tag, "rdnis"),
xml_find_var(tag, "source"),
xml_find_var(tag, "context"), xml_find_var(tag, "destination_number"));
switch_channel_set_originator_caller_profile(channel, caller_profile);
}
if ((tag = switch_xml_child(tag2, "originatee")) && (tag = tag->child)) {
caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
xml_find_var(tag, "username"),
xml_find_var(tag, "dialplan"),
xml_find_var(tag, "caller_id_name"),
xml_find_var(tag, "caller_id_number"),
xml_find_var(tag, "network_addr"),
xml_find_var(tag, "ani"),
xml_find_var(tag, "aniii"),
xml_find_var(tag, "rdnis"),
xml_find_var(tag, "source"),
xml_find_var(tag, "context"), xml_find_var(tag, "destination_number"));
switch_channel_set_originatee_caller_profile(channel, caller_profile);
}
}
switch_channel_set_flag(channel, CF_RECOVERED);
}
if (!channel || !switch_channel_get_caller_profile(channel)) {
if (session) {
switch_core_session_destroy(&session);
}
}
return session;
}
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_uuid(switch_endpoint_interface_t
*endpoint_interface,
switch_call_direction_t direction,
switch_originate_flag_t originate_flags,
switch_memory_pool_t **pool, const char *use_uuid)
{
switch_memory_pool_t *usepool;
switch_core_session_t *session;
switch_uuid_t uuid;
uint32_t count = 0;
int32_t sps = 0;
if (use_uuid && switch_core_hash_find(session_manager.session_table, use_uuid)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Duplicate UUID!\n");
return NULL;
}
if (direction == SWITCH_CALL_DIRECTION_INBOUND && !switch_core_ready_inbound()) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The system cannot create any inbound sessions at this time.\n");
return NULL;
}
if (direction == SWITCH_CALL_DIRECTION_OUTBOUND && !switch_core_ready_outbound()) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The system cannot create any outbound sessions at this time.\n");
return NULL;
}
if (!switch_core_ready() || endpoint_interface == NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The system cannot create any sessions at this time.\n");
return NULL;
}
if (runtime.min_idle_time > 0 && runtime.profile_time < runtime.min_idle_time) {
return NULL;
}
PROTECT_INTERFACE(endpoint_interface);
if (!(originate_flags & SOF_NO_LIMITS)) {
switch_mutex_lock(runtime.throttle_mutex);
count = session_manager.session_count;
sps = --runtime.sps;
switch_mutex_unlock(runtime.throttle_mutex);
if (sps <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Throttle Error! %d\n", session_manager.session_count);
UNPROTECT_INTERFACE(endpoint_interface);
return NULL;
}
if ((count + 1) > session_manager.session_limit) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Over Session Limit! %d\n", session_manager.session_limit);
UNPROTECT_INTERFACE(endpoint_interface);
return NULL;
}
}
if (pool && *pool) {
usepool = *pool;
*pool = NULL;
} else {
switch_core_new_memory_pool(&usepool);
}
session = switch_core_alloc(usepool, sizeof(*session));
session->pool = usepool;
switch_core_memory_pool_set_data(session->pool, "__session", session);
if (switch_channel_alloc(&session->channel, direction, session->pool) != SWITCH_STATUS_SUCCESS) {
abort();
}
switch_channel_init(session->channel, session, CS_NEW, 0);
if (direction == SWITCH_CALL_DIRECTION_OUTBOUND) {
switch_channel_set_flag(session->channel, CF_OUTBOUND);
}
/* The session *IS* the pool you may not alter it because you have no idea how
its all private it will be passed to the thread run function */
if (use_uuid) {
switch_set_string(session->uuid_str, use_uuid);
} else {
switch_uuid_get(&uuid);
switch_uuid_format(session->uuid_str, &uuid);
}
switch_channel_set_variable(session->channel, "uuid", session->uuid_str);
switch_channel_set_variable(session->channel, "call_uuid", session->uuid_str);
session->endpoint_interface = endpoint_interface;
session->raw_write_frame.data = session->raw_write_buf;
session->raw_write_frame.buflen = sizeof(session->raw_write_buf);
session->raw_read_frame.data = session->raw_read_buf;
session->raw_read_frame.buflen = sizeof(session->raw_read_buf);
session->enc_write_frame.data = session->enc_write_buf;
session->enc_write_frame.buflen = sizeof(session->enc_write_buf);
session->enc_read_frame.data = session->enc_read_buf;
session->enc_read_frame.buflen = sizeof(session->enc_read_buf);
switch_mutex_init(&session->mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->stack_count_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->resample_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->codec_read_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->codec_write_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->video_codec_read_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->video_codec_write_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_mutex_init(&session->frame_read_mutex, SWITCH_MUTEX_NESTED, session->pool);
switch_thread_rwlock_create(&session->bug_rwlock, session->pool);
switch_thread_cond_create(&session->cond, session->pool);
switch_thread_rwlock_create(&session->rwlock, session->pool);
switch_thread_rwlock_create(&session->io_rwlock, session->pool);
switch_queue_create(&session->message_queue, SWITCH_MESSAGE_QUEUE_LEN, session->pool);
switch_queue_create(&session->signal_data_queue, SWITCH_MESSAGE_QUEUE_LEN, session->pool);
switch_queue_create(&session->event_queue, SWITCH_EVENT_QUEUE_LEN, session->pool);
switch_queue_create(&session->private_event_queue, SWITCH_EVENT_QUEUE_LEN, session->pool);
switch_queue_create(&session->private_event_queue_pri, SWITCH_EVENT_QUEUE_LEN, session->pool);
switch_mutex_lock(runtime.session_hash_mutex);
switch_core_hash_insert(session_manager.session_table, session->uuid_str, session);
session->id = session_manager.session_id++;
session_manager.session_count++;
if (session_manager.session_count > (uint32_t)runtime.sessions_peak) {
runtime.sessions_peak = session_manager.session_count;
}
if (session_manager.session_count > (uint32_t)runtime.sessions_peak_fivemin) {
runtime.sessions_peak_fivemin = session_manager.session_count;
}
switch_mutex_unlock(runtime.session_hash_mutex);
switch_channel_set_variable_printf(session->channel, "session_id", "%u", session->id);
return session;
}
SWITCH_DECLARE(uint32_t) switch_core_session_count(void)
{
return session_manager.session_count;
}
SWITCH_DECLARE(switch_size_t) switch_core_session_get_id(switch_core_session_t *session)
{
return session->id;
}
SWITCH_DECLARE(switch_size_t) switch_core_session_id_dec(void)
{
switch_mutex_lock(runtime.session_hash_mutex);
session_manager.session_id--;
switch_mutex_unlock(runtime.session_hash_mutex);
return session_manager.session_id;
}
SWITCH_DECLARE(switch_size_t) switch_core_session_id(void)
{
return session_manager.session_id;
}
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(const char *endpoint_name,
switch_call_direction_t direction, switch_memory_pool_t **pool)
{
switch_endpoint_interface_t *endpoint_interface;
switch_core_session_t *session;
if ((endpoint_interface = switch_loadable_module_get_endpoint_interface(endpoint_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not locate channel type %s\n", endpoint_name);
return NULL;
}
session = switch_core_session_request(endpoint_interface, direction, SOF_NONE, pool);
UNPROTECT_INTERFACE(endpoint_interface);
return session;
}
#ifndef SWITCH_PREFIX_DIR
#define SWITCH_PREFIX_DIR "."
#endif
SWITCH_DECLARE(uint8_t) switch_core_session_compare(switch_core_session_t *a, switch_core_session_t *b)
{
switch_assert(a != NULL);
switch_assert(b != NULL);
return (uint8_t) (a->endpoint_interface == b->endpoint_interface);
}
SWITCH_DECLARE(uint8_t) switch_core_session_check_interface(switch_core_session_t *session, const switch_endpoint_interface_t *endpoint_interface)
{
switch_assert(session != NULL);
switch_assert(endpoint_interface != NULL);
return (uint8_t) (session->endpoint_interface == endpoint_interface);
}
SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session_t *session)
{
if (!session) return NULL;
return session->uuid_str;
}
SWITCH_DECLARE(uint32_t) switch_core_session_limit(uint32_t new_limit)
{
if (new_limit) {
session_manager.session_limit = new_limit;
}
return session_manager.session_limit;
}
SWITCH_DECLARE(double) switch_core_min_idle_cpu(double new_limit)
{
if (new_limit >= 0) {
runtime.min_idle_time = new_limit;
}
return runtime.min_idle_time;
}
SWITCH_DECLARE(double) switch_core_idle_cpu(void)
{
return runtime.profile_time;
}
SWITCH_DECLARE(uint32_t) switch_core_sessions_per_second(uint32_t new_limit)
{
if (new_limit) {
runtime.sps_total = new_limit;
}
return runtime.sps_total;
}
void switch_core_session_init(switch_memory_pool_t *pool)
{
memset(&session_manager, 0, sizeof(session_manager));
session_manager.session_limit = 1000;
session_manager.session_id = 1;
session_manager.memory_pool = pool;
switch_core_hash_init(&session_manager.session_table);
switch_mutex_init(&session_manager.mutex, SWITCH_MUTEX_DEFAULT, session_manager.memory_pool);
switch_thread_cond_create(&session_manager.cond, session_manager.memory_pool);
switch_queue_create(&session_manager.thread_queue, 100000, session_manager.memory_pool);
}
void switch_core_session_uninit(void)
{
switch_queue_term(session_manager.thread_queue);
switch_mutex_lock(session_manager.mutex);
if (session_manager.running)
switch_thread_cond_timedwait(session_manager.cond, session_manager.mutex, 10000000);
switch_mutex_unlock(session_manager.mutex);
switch_core_hash_destroy(&session_manager.session_table);
}
SWITCH_DECLARE(switch_app_log_t *) switch_core_session_get_app_log(switch_core_session_t *session)
{
return session->app_log;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *app, int32_t *flags)
{
switch_application_interface_t *application_interface;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_assert(flags);
*flags = 0;
if ((application_interface = switch_loadable_module_get_application_interface(app)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n", app);
goto end;
} else if (application_interface->flags) {
*flags = application_interface->flags;
status = SWITCH_STATUS_SUCCESS;
}
UNPROTECT_INTERFACE(application_interface);
end:
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_async(switch_core_session_t *session, const char *app, const char *arg)
{
switch_event_t *execute_event;
char *ap, *arp;
if (!arg && strstr(app, "::")) {
ap = switch_core_session_strdup(session, app);
app = ap;
if ((arp = strstr(ap, "::"))) {
*arp = '\0';
arg = arp + 2;
}
}
if (switch_event_create(&execute_event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "call-command", "execute");
switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
if (arg) {
switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "execute-app-arg", arg);
}
if (!switch_channel_test_flag(session->channel, CF_PROXY_MODE)) {
switch_channel_set_flag(session->channel, CF_BLOCK_BROADCAST_UNTIL_MEDIA);
}
switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "event-lock", "true");
switch_core_session_queue_private_event(session, &execute_event, SWITCH_FALSE);
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
SWITCH_DECLARE(void) switch_core_session_video_reset(switch_core_session_t *session)
{
switch_channel_clear_flag(session->channel, CF_VIDEO_ECHO);
switch_channel_clear_flag(session->channel, CF_VIDEO_PASSIVE);
//switch_channel_clear_flag(session->channel, CF_VIDEO_DECODED_READ);
switch_channel_clear_flag(session->channel, CF_VIDEO_DEBUG_READ);
switch_channel_clear_flag(session->channel, CF_VIDEO_DEBUG_WRITE);
switch_channel_clear_flag(session->channel, CF_VIDEO_BLANK);
switch_core_session_request_video_refresh(session);
}
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flags(switch_core_session_t *session, const char *app,
const char *arg, int32_t *flags)
{
switch_application_interface_t *application_interface;
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_core_session_request_video_refresh(session);
switch_core_media_gen_key_frame(session);
if (switch_channel_down_nosig(session->channel)) {
char *p;
if (!arg && (p = strstr(app, "::"))) {
*p++ = '0';
*p++ = '0';
arg = p;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s ASYNC CALL CONVERTED TO INLINE %s(%s)\n",
switch_channel_get_name(session->channel), app, switch_str_nil(arg));
}
if ((application_interface = switch_loadable_module_get_application_interface(app)) == 0) {
return SWITCH_STATUS_FALSE;
}
if (switch_test_flag(application_interface, SAF_ZOMBIE_EXEC)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s ZOMBIE EXEC %s(%s)\n",
switch_channel_get_name(session->channel), app, switch_str_nil(arg));
goto exec;
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"%s Channel is hungup and application '%s' does not have the zombie_exec flag.\n",
switch_channel_get_name(session->channel), app);
switch_goto_status(SWITCH_STATUS_IGNORE, done);
}
if (!arg && strstr(app, "::")) {
return switch_core_session_execute_application_async(session, app, arg);
}
if ((application_interface = switch_loadable_module_get_application_interface(app)) == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Application %s\n", app);
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_goto_status(SWITCH_STATUS_FALSE, done);
}
if (!application_interface->application_function) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Function for %s\n", app);
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_goto_status(SWITCH_STATUS_FALSE, done);
}
if (flags && application_interface->flags) {
*flags = application_interface->flags;
}
if (!switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA) && (switch_channel_test_flag(session->channel, CF_VIDEO))) {
switch_core_session_request_video_refresh(session);
}
if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
switch_ivr_media(session->uuid_str, SMF_NONE);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Application %s Requires media on channel %s!\n",
app, switch_channel_get_name(session->channel));
} else if (!switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA) && !switch_channel_media_ready(session->channel)) {
if (switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_INBOUND) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Application %s Requires media! pre_answering channel %s\n",
app, switch_channel_get_name(session->channel));
if (switch_channel_pre_answer(session->channel) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Well, that didn't work very well did it? ...\n");
switch_goto_status(SWITCH_STATUS_FALSE, done);
}
} else {
uint32_t ready = 0, sanity = 2000;
do {
sanity--;
ready = switch_channel_media_up(session->channel);
switch_cond_next();
} while(!ready && sanity);
if (!ready) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"Cannot execute app '%s' media required on an outbound channel that does not have media established\n", app);
switch_goto_status(SWITCH_STATUS_FALSE, done);
}
}
}
if (switch_channel_text_only(session->channel) &&
!switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA) &&
!switch_test_flag(application_interface, SAF_SUPPORT_TEXT_ONLY)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Application %s does not support text-only mode on channel %s!\n",
app, switch_channel_get_name(session->channel));
switch_channel_hangup(session->channel, SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED);
switch_goto_status(SWITCH_STATUS_FALSE, done);
}
exec:
switch_core_session_exec(session, application_interface, arg);
done:
UNPROTECT_INTERFACE(application_interface);
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *session,
const switch_application_interface_t *application_interface, const char *arg)
{
switch_app_log_t *log, *lp;
switch_event_t *event;
const char *var;
switch_channel_t *channel = switch_core_session_get_channel(session);
char *expanded = NULL;
const char *app, *app_uuid_var, *app_uuid_name;
switch_core_session_message_t msg = { 0 };
char delim = ',';
int scope = 0;
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
char *app_uuid = uuid_str;
if ((app_uuid_var = switch_channel_get_variable(channel, "app_uuid"))) {
app_uuid = (char *)app_uuid_var;
switch_channel_set_variable(channel, "app_uuid", NULL);
} else {
switch_uuid_str(uuid_str, sizeof(uuid_str));
}
if((app_uuid_name = switch_channel_get_variable(channel, "app_uuid_name"))) {
switch_channel_set_variable(channel, "app_uuid_name", NULL);
}
switch_assert(application_interface);
app = application_interface->interface_name;
if (arg) {
expanded = switch_channel_expand_variables(session->channel, arg);
}
if (expanded && *expanded == '%' && (*(expanded+1) == '[' || *(expanded+2) == '[')) {
char *p, *dup;
switch_event_t *ovars = NULL;
p = expanded + 1;
if (*p != '[') {
delim = *p;
p++;
}
dup = strdup(p);
if (expanded != arg) {
switch_safe_free(expanded);
}
switch_event_create_brackets(dup, '[', ']', delim, &ovars, &expanded, SWITCH_TRUE);
free(dup);
switch_channel_set_scope_variables(session->channel, &ovars);
scope = 1;
}
if ( switch_core_test_flag(SCF_DIALPLAN_TIMESTAMPS) ) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "EXECUTE [depth=%d] %s %s(%s)\n",
switch_core_session_stack_count(session, 0), switch_channel_get_name(session->channel), app, switch_str_nil(expanded));
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_INFO, "EXECUTE [depth=%d] %s %s(%s)\n",
switch_core_session_stack_count(session, 0), switch_channel_get_name(session->channel), app, switch_str_nil(expanded));
}
if ((var = switch_channel_get_variable(session->channel, "verbose_presence")) && switch_true(var)) {
char *myarg = NULL;
if (expanded) {
myarg = switch_mprintf("%s(%s)", app, expanded);
} else if (!zstr(arg)) {
myarg = switch_mprintf("%s(%s)", app, arg);
} else {
myarg = switch_mprintf("%s", app);
}
if (myarg) {
switch_channel_presence(session->channel, "unknown", myarg, NULL);
switch_safe_free(myarg);
}
}
if (!(var = switch_channel_get_variable(session->channel, SWITCH_DISABLE_APP_LOG_VARIABLE)) || (!(switch_true(var)))) {
log = switch_core_session_alloc(session, sizeof(*log));
log->app = switch_core_session_strdup(session, application_interface->interface_name);
if (expanded) {
log->arg = switch_core_session_strdup(session, expanded);
}
log->stamp = switch_time_now();
for (lp = session->app_log; lp && lp->next; lp = lp->next);
if (lp) {
lp->next = log;
} else {
session->app_log = log;
}
}
switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_VARIABLE, application_interface->interface_name);
switch_channel_set_variable_var_check(channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE, expanded, SWITCH_FALSE);
switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, NULL);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID-Name", app_uuid_name);
switch_event_fire(&event);
}
switch_channel_clear_flag(session->channel, CF_BREAK);
switch_assert(application_interface->application_function);
switch_channel_set_variable(session->channel, SWITCH_CURRENT_APPLICATION_VARIABLE, application_interface->interface_name);
msg.from = __FILE__;
msg.message_id = SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC;
msg.string_array_arg[0] = application_interface->interface_name;
msg.string_array_arg[1] = expanded;
switch_core_session_receive_message(session, &msg);
application_interface->application_function(session, expanded);
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) {
const char *resp = switch_channel_get_variable(session->channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE);
switch_channel_event_set_data(session->channel, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", expanded);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID", app_uuid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-UUID-Name", app_uuid_name);
switch_event_fire(&event);
}
msg.message_id = SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE;
switch_core_session_receive_message(session, &msg);
if (expanded != arg) {
switch_safe_free(expanded);
}
if (scope) {
switch_channel_set_scope_variables(session->channel, NULL);
}
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(uint32_t) switch_core_session_stack_count(switch_core_session_t *session, int x)
{
uint32_t stack_count = 0;
switch_mutex_lock(session->stack_count_mutex);
if (x > 0) session->stack_count++;
else if (x < 0) session->stack_count--;
stack_count = session->stack_count;
switch_mutex_unlock(session->stack_count_mutex);
return stack_count;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_session_t *session, const char *exten, const char *dialplan,
const char *context)
{
char *dp[25];
char *dpstr;
int argc, x, count = 0;
uint32_t stack_count = 0;
switch_caller_profile_t *profile, *new_profile, *pp = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_dialplan_interface_t *dialplan_interface = NULL;
switch_caller_extension_t *extension = NULL;
switch_status_t status = SWITCH_STATUS_SUCCESS;
if (!(profile = switch_channel_get_caller_profile(channel))) {
return SWITCH_STATUS_FALSE;
}
if ((stack_count = switch_core_session_stack_count(session, 0)) > SWITCH_MAX_STACKS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error %s too many stacked extensions [depth=%d]\n",
switch_channel_get_name(session->channel), stack_count);
return SWITCH_STATUS_FALSE;
}
switch_core_session_stack_count(session, 1);
new_profile = switch_caller_profile_clone(session, profile);
new_profile->destination_number = switch_core_strdup(new_profile->pool, exten);
new_profile->times = (switch_channel_timetable_t *) switch_core_session_alloc(session, sizeof(*new_profile->times));
*new_profile->times = *profile->times;
if (!zstr(dialplan)) {
new_profile->dialplan = switch_core_strdup(new_profile->pool, dialplan);
}
if (!zstr(context)) {
new_profile->context = switch_core_strdup(new_profile->pool, context);
}
dpstr = switch_core_session_strdup(session, new_profile->dialplan);
switch_channel_set_hunt_caller_profile(channel, new_profile);
argc = switch_separate_string(dpstr, ',', dp, (sizeof(dp) / sizeof(dp[0])));
for (x = 0; x < argc; x++) {
char *dpname = dp[x];
char *dparg = NULL;
if (dpname) {
if ((dparg = strchr(dpname, ':'))) {
*dparg++ = '\0';
}
} else {
continue;
}
if (!(dialplan_interface = switch_loadable_module_get_dialplan_interface(dpname))) {
continue;
}
count++;
extension = dialplan_interface->hunt_function(session, dparg, new_profile);
UNPROTECT_INTERFACE(dialplan_interface);
if (extension) {
break;
}
}
if (!extension) {
status = SWITCH_STATUS_FALSE;
goto done;
}
new_profile->caller_extension = extension;
if (profile->caller_extension) {
for (pp = profile->caller_extension->children; pp && pp->next; pp = pp->next);
if (pp) {
pp->next = new_profile;
} else {
profile->caller_extension->children = new_profile;
}
}
while (switch_channel_ready(channel) && extension->current_application) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Execute [depth=%d] %s(%s)\n",
switch_core_session_stack_count(session, 0),
extension->current_application->application_name, switch_str_nil(extension->current_application->application_data));
if (switch_core_session_execute_application(session,
extension->current_application->application_name,
extension->current_application->application_data) != SWITCH_STATUS_SUCCESS) {
goto done;
}
extension->current_application = extension->current_application->next;
}
done:
switch_channel_set_hunt_caller_profile(channel, NULL);
switch_core_session_stack_count(session, -1);
return status;
}
SWITCH_DECLARE(switch_status_t) switch_core_session_set_loglevel(switch_core_session_t *session, switch_log_level_t loglevel)
{
switch_assert(session != NULL);
session->loglevel = loglevel;
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_log_level_t) switch_core_session_get_loglevel(switch_core_session_t *session)
{
switch_assert(session != NULL);
return session->loglevel;
}
SWITCH_DECLARE(void) switch_core_session_debug_pool(switch_stream_handle_t *stream)
{
stream->write_function(stream, "Thread pool: running:%d busy:%d popping:%d\n",
session_manager.running, session_manager.busy, session_manager.running - session_manager.busy);
}
SWITCH_DECLARE(void) switch_core_session_raw_read(switch_core_session_t *session)
{
if (session->sdata) {
if (session->sdata && switch_core_codec_ready(&session->sdata->codec)) {
switch_core_codec_destroy(&session->sdata->codec);
}
memset(session->sdata, 0, sizeof(*session->sdata));
} else {
session->sdata = switch_core_session_alloc(session, sizeof(*session->sdata));
}
switch_core_session_set_codec_slin(session, session->sdata);
}
SWITCH_DECLARE(switch_status_t) switch_core_session_override_io_routines(switch_core_session_t *session, switch_io_routines_t *ior)
{
if (session->endpoint_interface && switch_channel_test_cap(session->channel, CC_IO_OVERRIDE)) {
session->io_override = ior;
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_FALSE;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/
| 32.488839 | 155 | 0.75653 |
c865da11c847e3cd1299b3522b48e1296047ec7d | 5,233 | h | C | ios/versioned-react-native/ABI32_0_0/ReactCommon/ABI32_0_0fabric/components/view/ABI32_0_0propsConversions.h | ThakurKarthik/expo | ed78ed4f07c950184a59422ebd95645253f44e3d | [
"Apache-2.0",
"MIT"
] | 2 | 2019-08-15T19:24:41.000Z | 2020-09-28T00:44:04.000Z | ios/versioned-react-native/ABI32_0_0/ReactCommon/ABI32_0_0fabric/components/view/ABI32_0_0propsConversions.h | ThakurKarthik/expo | ed78ed4f07c950184a59422ebd95645253f44e3d | [
"Apache-2.0",
"MIT"
] | 19 | 2020-04-07T07:36:24.000Z | 2022-03-26T09:32:12.000Z | ios/versioned-react-native/ABI32_0_0/ReactCommon/ABI32_0_0fabric/components/view/ABI32_0_0propsConversions.h | ThakurKarthik/expo | ed78ed4f07c950184a59422ebd95645253f44e3d | [
"Apache-2.0",
"MIT"
] | 1 | 2020-06-18T18:30:10.000Z | 2020-06-18T18:30:10.000Z | /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <ABI32_0_0fabric/ABI32_0_0components/view/conversions.h>
#include <ABI32_0_0fabric/ABI32_0_0core/propsConversions.h>
namespace facebook {
namespace ReactABI32_0_0 {
static std::array<ABI32_0_0YGValue, 2> convertRawProp(const RawProps &rawProps, const std::string &widthName, const std::string &heightName, const std::array<ABI32_0_0YGValue, 2> &defaultValue) {
std::array<ABI32_0_0YGValue, 2> dimentions;
dimentions[ABI32_0_0YGDimensionWidth] = convertRawProp(rawProps, widthName, defaultValue[ABI32_0_0YGDimensionWidth]);
dimentions[ABI32_0_0YGDimensionHeight] = convertRawProp(rawProps, heightName, defaultValue[ABI32_0_0YGDimensionHeight]);
return dimentions;
}
static std::array<ABI32_0_0YGValue, ABI32_0_0YGEdgeCount> convertRawProp(const RawProps &rawProps, const std::string &prefix, const std::array<ABI32_0_0YGValue, ABI32_0_0YGEdgeCount> &defaultValue) {
std::array<ABI32_0_0YGValue, ABI32_0_0YGEdgeCount> result = defaultValue;
result[ABI32_0_0YGEdgeLeft] = convertRawProp(rawProps, prefix + "Left", defaultValue[ABI32_0_0YGEdgeLeft]);
result[ABI32_0_0YGEdgeTop] = convertRawProp(rawProps, prefix + "Top", defaultValue[ABI32_0_0YGEdgeTop]);
result[ABI32_0_0YGEdgeRight] = convertRawProp(rawProps, prefix + "Right", defaultValue[ABI32_0_0YGEdgeRight]);
result[ABI32_0_0YGEdgeBottom] = convertRawProp(rawProps, prefix + "Bottom", defaultValue[ABI32_0_0YGEdgeBottom]);
result[ABI32_0_0YGEdgeStart] = convertRawProp(rawProps, prefix + "Start", defaultValue[ABI32_0_0YGEdgeStart]);
result[ABI32_0_0YGEdgeEnd] = convertRawProp(rawProps, prefix + "End", defaultValue[ABI32_0_0YGEdgeEnd]);
result[ABI32_0_0YGEdgeHorizontal] = convertRawProp(rawProps, prefix + "Horizontal", defaultValue[ABI32_0_0YGEdgeHorizontal]);
result[ABI32_0_0YGEdgeVertical] = convertRawProp(rawProps, prefix + "Vertical", defaultValue[ABI32_0_0YGEdgeVertical]);
result[ABI32_0_0YGEdgeAll] = convertRawProp(rawProps, prefix, defaultValue[ABI32_0_0YGEdgeAll]);
return result;
}
static std::array<ABI32_0_0YGValue, ABI32_0_0YGEdgeCount> convertRawProp(const RawProps &rawProps, const std::array<ABI32_0_0YGValue, ABI32_0_0YGEdgeCount> &defaultValue) {
std::array<ABI32_0_0YGValue, ABI32_0_0YGEdgeCount> result = defaultValue;
result[ABI32_0_0YGEdgeLeft] = convertRawProp(rawProps, "left", defaultValue[ABI32_0_0YGEdgeLeft]);
result[ABI32_0_0YGEdgeTop] = convertRawProp(rawProps, "top", defaultValue[ABI32_0_0YGEdgeTop]);
result[ABI32_0_0YGEdgeRight] = convertRawProp(rawProps, "right", defaultValue[ABI32_0_0YGEdgeRight]);
result[ABI32_0_0YGEdgeBottom] = convertRawProp(rawProps, "bottom", defaultValue[ABI32_0_0YGEdgeBottom]);
result[ABI32_0_0YGEdgeStart] = convertRawProp(rawProps, "start", defaultValue[ABI32_0_0YGEdgeStart]);
result[ABI32_0_0YGEdgeEnd] = convertRawProp(rawProps, "end", defaultValue[ABI32_0_0YGEdgeEnd]);
return result;
}
static ABI32_0_0YGStyle convertRawProp(const RawProps &rawProps, const ABI32_0_0YGStyle &defaultValue) {
ABI32_0_0YGStyle yogaStyle;
yogaStyle.direction = convertRawProp(rawProps, "direction", defaultValue.direction);
yogaStyle.flexDirection = convertRawProp(rawProps, "flexDirection", defaultValue.flexDirection);
yogaStyle.justifyContent = convertRawProp(rawProps, "justifyContent", defaultValue.justifyContent);
yogaStyle.alignContent = convertRawProp(rawProps, "alignContent", defaultValue.alignContent);
yogaStyle.alignItems = convertRawProp(rawProps, "alignItems", defaultValue.alignItems);
yogaStyle.alignSelf = convertRawProp(rawProps, "alignSelf", defaultValue.alignSelf);
yogaStyle.positionType = convertRawProp(rawProps, "position", defaultValue.positionType);
yogaStyle.flexWrap = convertRawProp(rawProps, "flexWrap", defaultValue.flexWrap);
yogaStyle.overflow = convertRawProp(rawProps, "overflow", defaultValue.overflow);
yogaStyle.display = convertRawProp(rawProps, "display", defaultValue.display);
yogaStyle.flex = convertRawProp(rawProps, "flex", defaultValue.flex);
yogaStyle.flexGrow = convertRawProp(rawProps, "flexGrow", defaultValue.flexGrow);
yogaStyle.flexShrink = convertRawProp(rawProps, "flexShrink", defaultValue.flexShrink);
yogaStyle.flexBasis = convertRawProp(rawProps, "flexBasis", defaultValue.flexBasis);
yogaStyle.margin = convertRawProp(rawProps, "margin", defaultValue.margin);
yogaStyle.position = convertRawProp(rawProps, defaultValue.position);
yogaStyle.padding = convertRawProp(rawProps, "padding", defaultValue.padding);
yogaStyle.border = convertRawProp(rawProps, "border", defaultValue.border);
yogaStyle.dimensions = convertRawProp(rawProps, "width", "height", defaultValue.dimensions);
yogaStyle.minDimensions = convertRawProp(rawProps, "minWidth", "minHeight", defaultValue.minDimensions);
yogaStyle.maxDimensions = convertRawProp(rawProps, "maxWidth", "maxHeight", defaultValue.maxDimensions);
yogaStyle.aspectRatio = convertRawProp(rawProps, "aspectRatio", defaultValue.aspectRatio);
return yogaStyle;
}
} // namespace ReactABI32_0_0
} // namespace facebook
| 67.961039 | 199 | 0.805848 |
a2faff5a250465a822ad64b8cf7116ade5852d65 | 2,344 | h | C | include/classify/classifier/one_vs_one.h | saq7/MeTA | 0392964c1cdc073ae5123f7d64affdc4105acc4f | [
"MIT"
] | null | null | null | include/classify/classifier/one_vs_one.h | saq7/MeTA | 0392964c1cdc073ae5123f7d64affdc4105acc4f | [
"MIT"
] | null | null | null | include/classify/classifier/one_vs_one.h | saq7/MeTA | 0392964c1cdc073ae5123f7d64affdc4105acc4f | [
"MIT"
] | 1 | 2021-09-06T06:08:38.000Z | 2021-09-06T06:08:38.000Z | /**
* @file one_vs_one.h
* @author Chase Geigle
*
* All files in META are released under the MIT license. For more details,
* consult the file LICENSE in the root of the project.
*/
#ifndef META_CLASSIFY_ONE_VS_ONE_H_
#define META_CLASSIFY_ONE_VS_ONE_H_
#include "classify/classifier/binary_classifier.h"
#include "classify/classifier_factory.h"
#include "meta.h"
namespace meta
{
namespace classify
{
/**
* Ensemble method adaptor for extending binary_classifiers to the
* multi-class classification case by using a one-vs-one strategy. This
* entails creating a classifier for each pair of classes, and assigning
* the label which gets the most "votes" from each individual
* binary_classifier as the label for a given document.
*/
class one_vs_one : public classifier
{
public:
/**
* Constructs a new one_vs_one classifier using the given
* forward_index to retrieve document information and using the given
* function to create individual binary_classifiers for each pair of
* classes.
*
* @param idx The forward_index to retrieve documents from
* @param create A function to create binary_classifiers: should
* return a unique_ptr to a binary_classifier when given two class
* labels as parameters
*/
template <class Function>
one_vs_one(std::shared_ptr<index::forward_index> idx, Function&& create)
: classifier{std::move(idx)}
{
auto labels = idx_->class_labels();
for (uint64_t i = 0; i < labels.size(); ++i)
{
for (uint64_t j = i + 1; j < labels.size(); ++j)
{
classifiers_.emplace_back(create(labels[i], labels[j]));
}
}
}
void train(const std::vector<doc_id>& docs) override;
class_label classify(doc_id d_id) override;
void reset() override;
/**
* The identifier for this classifier.
*/
const static std::string id;
private:
/// the set of classifiers used in the ensemble
std::vector<std::unique_ptr<binary_classifier>> classifiers_;
};
/**
* Specialization of the factory method used to create one_vs_all
* classifiers.
*/
template <>
std::unique_ptr<classifier>
make_classifier<one_vs_one>(const cpptoml::table&,
std::shared_ptr<index::forward_index>);
}
}
#endif
| 28.240964 | 76 | 0.677901 |
264403dc1924104ef79e5c5520dedbf9b4b07fa7 | 798 | h | C | src/trader/risk/common/fund_risk.h | zhuzhenping/ft | c4be308ddd9c8358b2badbe4dff9f6c7d5b256cc | [
"MIT"
] | 154 | 2020-05-14T14:34:06.000Z | 2022-03-14T04:02:17.000Z | src/trader/risk/common/fund_risk.h | zhuzhenping/ft | c4be308ddd9c8358b2badbe4dff9f6c7d5b256cc | [
"MIT"
] | 22 | 2020-05-06T12:14:33.000Z | 2021-06-02T08:50:30.000Z | src/trader/risk/common/fund_risk.h | zhuzhenping/ft | c4be308ddd9c8358b2badbe4dff9f6c7d5b256cc | [
"MIT"
] | 60 | 2020-05-18T02:49:11.000Z | 2022-03-14T04:02:19.000Z | // Copyright [2020] <Copyright Kevin, kevin.lau.gd@gmail.com>
#ifndef FT_SRC_TRADER_RISK_COMMON_FUND_RISK_H_
#define FT_SRC_TRADER_RISK_COMMON_FUND_RISK_H_
#include <map>
#include "ft/base/trade_msg.h"
#include "trader/risk/risk_rule.h"
namespace ft {
class FundRisk : public RiskRule {
public:
bool Init(RiskRuleParams* params) override;
ErrorCode CheckOrderRequest(const Order& order) override;
void OnOrderSent(const Order& order) override;
void OnOrderTraded(const Order& order, const OrderTradedRsp& trade) override;
void OnOrderCanceled(const Order& order, int canceled) override;
void OnOrderRejected(const Order& order, ErrorCode error_code) override;
private:
Account* account_{nullptr};
};
} // namespace ft
#endif // FT_SRC_TRADER_RISK_COMMON_FUND_RISK_H_
| 23.470588 | 79 | 0.778195 |
1e535bea6b6fb04c1957049bae4615cda362f68e | 5,156 | c | C | edk2-platforms/Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/VideoModes.c | TheMindVirus/pftf-rpi4 | 6070b65a02e5ab3ad774d52620c1d136f17c5df3 | [
"BSD-2-Clause-Patent",
"MIT"
] | 1 | 2021-12-03T05:07:39.000Z | 2021-12-03T05:07:39.000Z | edk2-platforms/Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/VideoModes.c | TheMindVirus/pftf-rpi4 | 6070b65a02e5ab3ad774d52620c1d136f17c5df3 | [
"BSD-2-Clause-Patent",
"MIT"
] | null | null | null | edk2-platforms/Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkGop/VideoModes.c | TheMindVirus/pftf-rpi4 | 6070b65a02e5ab3ad774d52620c1d136f17c5df3 | [
"BSD-2-Clause-Patent",
"MIT"
] | null | null | null | /**
* @file VideoModes.c
* @brief Pre-calculated video timings sent to the DisplayLink device when a video mode is selected
*
* Copyright (c) 2018-2019, DisplayLink (UK) Ltd. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
#include "UsbDisplayLink.h"
// Supported video modes - must be in order of pixel count (i.e. hres x vres)
STATIC CONST struct VideoMode ModeData[] = {
{
// 640 x 480 @ 60Hz
.Reserved2 = 2,
.PixelClock = 2517,
.HActive = 640,
.HBlanking = 160,
.HSyncOffset = 16,
.HSyncWidth = 96,
.VActive = 480,
.VBlanking = 45,
.VSyncOffset = 10,
.VSyncWidth = 2,
.Flags = 0x00000300,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 800 x 600 @ 60Hz
.Reserved2 = 2,
.PixelClock = 4000,
.HActive = 800,
.HBlanking = 256,
.HSyncOffset = 40,
.HSyncWidth = 128,
.VActive = 600,
.VBlanking = 28,
.VSyncOffset = 1,
.VSyncWidth = 3,
.Flags = 0x00000000,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1024x768 @ 60Hz
.Reserved1 = 0,
.Reserved2 = 2,
.PixelClock = 6500,
.HActive = 1024,
.HBlanking = 320,
.HSyncOffset = 24,
.HSyncWidth = 136,
.VActive = 768,
.VBlanking = 38,
.VSyncOffset = 3,
.VSyncWidth = 6,
.Flags = 0x00000300,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1360x768 @ 60Hz
.Reserved1 = 0,
.Reserved2 = 2,
.PixelClock = 8550,
.HActive = 1360,
.HBlanking = 432,
.HSyncOffset = 64,
.HSyncWidth = 112,
.VActive = 768,
.VBlanking = 27,
.VSyncOffset = 3,
.VSyncWidth = 6,
.Flags = 0x00000000,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1280x960 @ 60Hz
.Reserved1 = 0,
.Reserved2 = 2,
.PixelClock = 10800,
.HActive = 1280,
.HBlanking = 520,
.HSyncOffset = 96,
.HSyncWidth = 112,
.VActive = 960,
.VBlanking = 40,
.VSyncOffset = 1,
.VSyncWidth = 3,
.Flags = 0x00000000,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1280x1024 @ 60Hz
.Reserved1 = 0,
.Reserved2 = 2,
.PixelClock = 10800,
.HActive = 1280,
.HBlanking = 408,
.HSyncOffset = 48,
.HSyncWidth = 112,
.VActive = 1024,
.VBlanking = 42,
.VSyncOffset = 1,
.VSyncWidth = 3,
.Flags = 0x00000000,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1600x900 @ 60Hz
.Reserved2 = 2,
.PixelClock = 11825,
.HActive = 1600,
.HBlanking = 512,
.HSyncOffset = 88,
.HSyncWidth = 168,
.VActive = 900,
.VBlanking = 34,
.VSyncOffset = 3,
.VSyncWidth = 5,
.Flags = 0x00000500,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1400x1050 @ 60Hz
.Reserved1 = 0,
.Reserved2 = 2,
.PixelClock = 12175,
.HActive = 1400,
.HBlanking = 464,
.HSyncOffset = 88,
.HSyncWidth = 144,
.VActive = 1050,
.VBlanking = 39,
.VSyncOffset = 3,
.VSyncWidth = 4,
.Flags = 0x00000100,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1600x1200 @ 60Hz
.Reserved1 = 0,
.Reserved2 = 2,
.PixelClock = 16200,
.HActive = 1600,
.HBlanking = 560,
.HSyncOffset = 64,
.HSyncWidth = 192,
.VActive = 1200,
.VBlanking = 50,
.VSyncOffset = 1,
.VSyncWidth = 3,
.Flags = 0x00000000,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
},
{
// 1920 x 1080
.Reserved2 = 2,
.PixelClock = 14850,
.HActive = 1920,
.HBlanking = 280,
.HSyncOffset = 88,
.HSyncWidth = 44,
.VActive = 1080,
.VBlanking = 45,
.VSyncOffset = 4,
.VSyncWidth = 5,
.Flags = 0x00000000,
.Accumulate = 1,
.Reserved3 = 0,
.Reserved4 = 0,
.Reserved5 = 0x00000000,
.Vic = 0,
.ActiveFormat = 0,
}
};
STATIC CONST UINT32 NumSupportedVideoModes = (sizeof (ModeData) / sizeof (struct VideoMode));
/**
Find the number of pre-calculated video modes that we support.
@retval Number of modes.
**/
UINT32 DlVideoModeGetNumSupportedVideoModes ()
{
return NumSupportedVideoModes;
}
/**
Get one of the pre-calculated video modes
@param index The video mode that we want.
@retval NULL The index was out of range.
**/
CONST struct VideoMode *DlVideoModeGetSupportedVideoMode (
UINT32 Index
)
{
if (Index >= NumSupportedVideoModes) {
return NULL;
}
return &ModeData[Index];
}
| 20.219608 | 99 | 0.562645 |
1412dabb60027e0fda2cd356f3e6258c8a7e7267 | 1,696 | c | C | apps_openpiton/stereo/4_cores/org.ietr.preesm.stereo/Code/src/clock.c | Nooman-LabSTICC/preesm2openpiton | 519e28c25f6fe366b26812a0421753306f16bf71 | [
"Apache-2.0"
] | 19 | 2019-09-26T03:18:05.000Z | 2020-09-15T21:37:03.000Z | apps_openpiton/stereo/4_cores/org.ietr.preesm.stereo/Code/src/clock.c | Nooman-LabSTICC/preesm2openpiton | 519e28c25f6fe366b26812a0421753306f16bf71 | [
"Apache-2.0"
] | 9 | 2019-10-04T08:18:24.000Z | 2021-08-13T14:12:15.000Z | examples/working/apps/video/src/clock.c | jserot/hocl | 3fbe0521d6d6b6aeb1ffa277fbd74abf7e5ebe43 | [
"MIT"
] | null | null | null | /*
============================================================================
Name : clock.c
Author : mpelcat
Version : 1.0
Copyright : CECILL-C
Description : Timing primitive for Preesm Codegen.
============================================================================
*/
#include "clock.h"
#ifdef _WIN32
// clock is not precise at all
#include <windows.h> // for Windows APIs
#include <stdio.h>
#else
#include <stdio.h>
#include <sys/time.h> // for gettimeofday()
#endif
#ifdef _WIN32
LARGE_INTEGER startTimes[MAX_STAMPS];
#else
struct timeval startTimes[MAX_STAMPS];
#endif
double elapsedTimes[MAX_STAMPS];
// Starting to record time for a given stamp
void startTiming(int stamp){
#ifdef _WIN32
QueryPerformanceCounter(&startTimes[stamp]);
#else
gettimeofday(&startTimes[stamp], NULL);
#endif
}
// Stoping to record time for a given stamp. Returns the time in us
unsigned int stopTiming(int stamp){
unsigned int elapsedus = 0;
#ifdef _WIN32
LARGE_INTEGER frequency;
LARGE_INTEGER t2;
QueryPerformanceCounter(&t2);
// get ticks per second
QueryPerformanceFrequency(&frequency);
// compute and print the elapsed time in millisec
elapsedTimes[stamp] = (t2.QuadPart - startTimes[stamp].QuadPart) * 1000.0 / frequency.QuadPart;
#else
struct timeval t2;
gettimeofday(&t2, NULL);
// compute and print the elapsed time in millisec
elapsedTimes[stamp] = (t2.tv_sec - startTimes[stamp].tv_sec) * 1000.0; // sec to ms
elapsedTimes[stamp] += (t2.tv_usec - startTimes[stamp].tv_usec) / 1000.0; // us to ms
#endif
elapsedus = (int)(elapsedTimes[stamp]*1000);
return elapsedus;
}
| 25.313433 | 99 | 0.632075 |
b336326e41e2ac4246a634a6cc4094cc7a6b4581 | 828 | h | C | coordonnees.h | marcdion/donnees-gtfs-rtc | fff9775f91fcc85b06184ac211b2752e6a8a4d6d | [
"MIT"
] | null | null | null | coordonnees.h | marcdion/donnees-gtfs-rtc | fff9775f91fcc85b06184ac211b2752e6a8a4d6d | [
"MIT"
] | null | null | null | coordonnees.h | marcdion/donnees-gtfs-rtc | fff9775f91fcc85b06184ac211b2752e6a8a4d6d | [
"MIT"
] | null | null | null | //
// Created by prtos on 29/04/16.
// Modified by Mario, dec 2016
//
#ifndef RTC_COORDONNEES_H
#define RTC_COORDONNEES_H
#include <cmath>
#include <exception>
#include <stdexcept>
#include <iostream>
#include <sstream>
/*!
* \class Coordonnees
* \brief Cette classe permet de représenter les coordonnées GPS d'un endroit
*/
class Coordonnees {
public:
Coordonnees(double latitude, double longitude);
Coordonnees(const Coordonnees & rhs);
double getLatitude() const ;
double getLongitude() const ;
static bool is_valide_coord(double p_latitude, double p_longitude) ;
double operator- (const Coordonnees & other) const;
friend std::ostream & operator<<(std::ostream & flux, const Coordonnees & p_coord);
private:
double m_latitude;
double m_longitude;
};
#endif //RTC_COORDONNEES_H
| 21.789474 | 87 | 0.72343 |
8c1220ced0829eac773bf79570fee0128f6a7206 | 2,414 | c | C | libmupdf/src/main/cpp/scripts/fontdump.c | swjjxyxty/Mupdf-AndroidStudio | 96a92c2dff96722be929d56151e8e7d6182aa264 | [
"Apache-2.0"
] | 3 | 2017-11-03T06:35:51.000Z | 2018-05-25T00:57:41.000Z | libmupdf/src/main/cpp/scripts/fontdump.c | swjjxyxty/Mupdf-AndroidStudio | 96a92c2dff96722be929d56151e8e7d6182aa264 | [
"Apache-2.0"
] | 1 | 2017-02-12T03:24:04.000Z | 2019-09-03T01:24:27.000Z | libmupdf/src/main/cpp/scripts/fontdump.c | swjjxyxty/Mupdf-AndroidStudio | 96a92c2dff96722be929d56151e8e7d6182aa264 | [
"Apache-2.0"
] | 4 | 2017-01-18T03:07:48.000Z | 2019-09-02T13:02:09.000Z | /* fontdump.c -- an "xxd -i" workalike for dumping binary fonts as source code */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int
hexdump(FILE *fo, FILE *fi)
{
int c, n;
n = 0;
c = fgetc(fi);
while (c != -1)
{
n += fprintf(fo, "%d,", c);
if (n > 72) {
fprintf(fo, "\n");
n = 0;
}
c = fgetc(fi);
}
return n;
}
int
main(int argc, char **argv)
{
FILE *fo;
FILE *fi;
char fontname[256];
char origname[256];
char *basename;
char *p;
int i, len;
if (argc < 3)
{
fprintf(stderr, "usage: fontdump output.c input.dat\n");
return 1;
}
fo = fopen(argv[1], "wb");
if (!fo)
{
fprintf(stderr, "fontdump: could not open output file '%s'\n", argv[1]);
return 1;
}
fprintf(fo, "#ifndef __STRICT_ANSI__\n");
fprintf(fo, "#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)\n");
fprintf(fo, "#if !defined(__clang__) && !defined(__ICC)\n");
fprintf(fo, "#define HAVE_INCBIN\n");
fprintf(fo, "#endif\n");
fprintf(fo, "#endif\n");
fprintf(fo, "#endif\n");
for (i = 2; i < argc; i++)
{
fi = fopen(argv[i], "rb");
if (!fi)
{
fclose(fo);
fprintf(stderr, "fontdump: could not open input file '%s'\n", argv[i]);
return 1;
}
basename = strrchr(argv[i], '/');
if (!basename)
basename = strrchr(argv[i], '\\');
if (basename)
basename++;
else
basename = argv[i];
strcpy(origname, basename);
p = strrchr(origname, '.');
if (p) *p = 0;
strcpy(fontname, origname);
p = fontname;
while (*p)
{
if (*p == '/' || *p == '.' || *p == '\\' || *p == '-')
*p = '_';
p ++;
}
fseek(fi, 0, SEEK_END);
len = ftell(fi);
fseek(fi, 0, SEEK_SET);
if (getenv("verbose"))
printf("\t{\"%s\",pdf_font_%s,%d},\n", origname, fontname, len);
fprintf(fo, "\n#ifdef HAVE_INCBIN\n");
fprintf(fo, "extern const unsigned char pdf_font_%s[%d];\n", fontname, len);
fprintf(fo, "asm(\".globl pdf_font_%s\");\n", fontname);
fprintf(fo, "asm(\".balign 8\");\n");
fprintf(fo, "asm(\"pdf_font_%s:\");\n", fontname);
fprintf(fo, "asm(\".incbin \\\"%s\\\"\");\n", argv[i]);
fprintf(fo, "#else\n");
fprintf(fo, "static const unsigned char pdf_font_%s[%d] = {\n", fontname, len);
hexdump(fo, fi);
fprintf(fo, "};\n");
fprintf(fo, "#endif\n");
fclose(fi);
}
if (fclose(fo))
{
fprintf(stderr, "fontdump: could not close output file '%s'\n", argv[1]);
return 1;
}
return 0;
}
| 20.116667 | 89 | 0.564623 |
63eddbddd21c4626fe53b3df1faa3254a88d0aad | 174 | h | C | include/arp.h | hengdong/IP-Stack | 9549254527f8a3c5f1893ce93404c0537f8f23c0 | [
"MIT"
] | null | null | null | include/arp.h | hengdong/IP-Stack | 9549254527f8a3c5f1893ce93404c0537f8f23c0 | [
"MIT"
] | null | null | null | include/arp.h | hengdong/IP-Stack | 9549254527f8a3c5f1893ce93404c0537f8f23c0 | [
"MIT"
] | null | null | null | #ifndef _ARP_H_
#define _ARP_H_
#include "types.h"
#include "errno.h"
err_t arp_input(const uint8_t *pbuff, uint16_t size,struct net_card *net_card);
#endif /* _ARP_H_ */
| 17.4 | 79 | 0.741379 |
762be6c7e2c91ad14e632f2bf7962cbba57fb152 | 1,441 | c | C | applications/juma/host/app.c | li77leprince/STM32_Platform | 27fa717be8e876b168d9fa28d8c0adcda04ae4dd | [
"Apache-2.0"
] | 119 | 2016-01-13T18:25:16.000Z | 2022-03-18T19:26:55.000Z | applications/juma/host/app.c | li77leprince/STM32_Platform | 27fa717be8e876b168d9fa28d8c0adcda04ae4dd | [
"Apache-2.0"
] | 62 | 2016-01-13T06:16:53.000Z | 2020-06-09T10:05:53.000Z | applications/juma/host/app.c | li77leprince/STM32_Platform | 27fa717be8e876b168d9fa28d8c0adcda04ae4dd | [
"Apache-2.0"
] | 100 | 2016-01-13T05:57:37.000Z | 2021-05-11T20:03:27.000Z | /*
*
* JUMA.IO - JUMA SDK for STM families
*
* Copyright (C) 2013-2016 JUMA Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Apache V2 License as published by
* the Free Software Foundation.
*
* 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.
*
*/
#include "app.h"
#include "bsp_common.h"
#include "bluenrg_sdk_api.h"
#if NO_PRINTF
#define printf(...)
#endif
char name[20] = "Cannon Host";
void on_ready(void)
{
uint8_t tx_power_level = 7;
uint16_t scan_interval = 100;
uint8_t bdAddr[6] = {0x03,0x03,0x03,0x03,0x03,0x03};
ble_host_set_scan_param( tx_power_level, bdAddr, scan_interval);
ble_host_start_scan(NULL);
}
void ble_host_on_device_info(void* arg)
{
scan_device_found_info* device_info = arg;
if(device_info->RSSI > -60) {
ble_host_connect(device_info->bdaddr);
} else {
ble_host_start_scan(NULL);
}
}
void ble_host_on_message(uint8_t type, uint16_t length, uint8_t* value)
{
BSP_LED_Toggle(LED0);
/*echo*/
*value = 1;
ble_host_send(type, length, value);
printf("receive data:%x,%x,%x\n\r",type,length,value[0]);
}
void ble_host_on_connect()
{
uint8_t data = 1;
ble_host_send(0x01, 0x01, &data);
printf("send\n\r");
}
| 23.241935 | 72 | 0.687023 |
7643c45b8c7d43099dfed0bf29281ab15307c3c5 | 60 | h | C | Study/Game/main.h | jerry901/linux | ec11e7f21b407f290b1f4a7214a274030b5cbab6 | [
"MIT"
] | null | null | null | Study/Game/main.h | jerry901/linux | ec11e7f21b407f290b1f4a7214a274030b5cbab6 | [
"MIT"
] | null | null | null | Study/Game/main.h | jerry901/linux | ec11e7f21b407f290b1f4a7214a274030b5cbab6 | [
"MIT"
] | 1 | 2020-04-22T09:52:37.000Z | 2020-04-22T09:52:37.000Z |
extern int minSec;
extern int maxSec;
extern int maxCony;
| 10 | 19 | 0.766667 |
0aece18166c16feba326d0ffdbaa45cf32fcb851 | 803 | h | C | common/mathutils.h | yuhonghong66/TorchCraftAI | 895994989846be829fb0ed823a552008e807bdbe | [
"MIT"
] | 1 | 2018-11-28T01:16:12.000Z | 2018-11-28T01:16:12.000Z | common/mathutils.h | MenLonII/TorchCraftAI | 6920c6c02ee0043e6aa622fc0e5376cf97bc75e6 | [
"MIT"
] | null | null | null | common/mathutils.h | MenLonII/TorchCraftAI | 6920c6c02ee0043e6aa622fc0e5376cf97bc75e6 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <algorithm>
#include <cassert>
namespace common {
template <class T, class Compare>
constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp) {
return assert(!comp(hi, lo)), comp(v, lo) ? lo : comp(hi, v) ? hi : v;
}
template <class T>
constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
return clamp(v, lo, hi, std::less<>());
}
template <class T>
constexpr const T& safeClamp(const T& v1, const T& v2, const T& v3) {
const T& min = std::min(v2, v3);
const T& max = std::max(v2, v3);
return std::min(max, std::max(min, v1));
}
} // namespace common
| 24.333333 | 78 | 0.652553 |
c8f5fe190f3b26fc602c3cd1081b3043d15a3891 | 3,522 | h | C | include/kortex/object_cache.h | etola/kortex | 172877fde712dce2e5ecf9bc9b5ec3b86d8e085f | [
"MIT"
] | null | null | null | include/kortex/object_cache.h | etola/kortex | 172877fde712dce2e5ecf9bc9b5ec3b86d8e085f | [
"MIT"
] | null | null | null | include/kortex/object_cache.h | etola/kortex | 172877fde712dce2e5ecf9bc9b5ec3b86d8e085f | [
"MIT"
] | 4 | 2016-11-29T12:50:25.000Z | 2017-09-13T21:29:01.000Z | // ---------------------------------------------------------------------------
//
// This file is part of the <kortex> library suite
//
// Copyright (C) 2015 Engin Tola
//
// See LICENSE file for license information.
//
// author: Engin Tola
// e-mail: engintola@gmail.com
// web : http://www.engintola.com
// web : http://www.aurvis.com
//
// ---------------------------------------------------------------------------
#ifndef KORTEX_OBJECT_CACHE_H
#define KORTEX_OBJECT_CACHE_H
#include <string>
#include <vector>
using std::vector;
using std::string;
namespace kortex {
template<typename T>
struct CacheObject {
int file_index;
T obj;
};
template<typename T>
class ObjectCache {
public:
ObjectCache() {
m_max_object_number = 0;
post_load_func = NULL;
}
ObjectCache( const vector<string>& file_paths, int n_max_object_number ) {
init( file_paths, n_max_object_number );
}
void set_cache_size( int n_max_object_number );
void add_file( const string& path ) {
m_file_paths.push_back(path);
}
string get_file( const int& id ) const {
return m_file_paths[id];
}
void init( const vector<string>& file_paths, int n_max_object_number ) {
m_file_paths = file_paths;
set_cache_size( n_max_object_number );
}
int n_files() const { return (int)m_file_paths.size(); }
/// loads specified objects into cache. indices are regarding the order
/// of the m_file_paths.
void load_objects( int p, int q=-1, int r=-1, int s=-1, int t=-1, int u=-1 );
/// load objects marked with true.
void load_objects( const vector<int>& to_be_loaded );
/// returns true if file with file_id is present in cache
bool is_in_cache( int file_id ) const;
/// marks all cache slots as free. does not release memory
void clear_cache();
/// marks all cache slots as free and removes object memories
void release_cache_memory();
/// resets everything - gets rid of file paths
void reset_cache();
/// returns the number of the empty cache spots
int n_empty_cache_slots() const;
/// returns a pointer to the cached object
const T* get_object( int fidx ) const;
T * get_object( int fidx ) ;
void report_cache_state() const;
void set_post_load_function( void (*f)( T& obj ) ) {
post_load_func = f;
}
void unset_post_load_function() {
post_load_func = NULL;
}
private:
int m_max_object_number;
vector< CacheObject<T> > m_objects;
vector<string > m_file_paths;
void (*post_load_func)( T& obj );
/// preps cache for new file load - removes cache items if not enough
/// empty slots are present
void prep_cache_for_new_files( const vector<int>& to_be_loaded );
/// returns a pointer to an empty cache spot - returns null if none
/// exists
CacheObject<T>* get_empty_object();
/// returns the cache index of the file with file_index. returns -1 if
/// non-existent
int get_cache_index( int file_index ) const;
/// loads object to the cache with the file index identifier
void load_object( int fidx );
};
}
#endif
| 27.732283 | 85 | 0.570982 |
0828101727585aa8050d1d1fd2f686fc2e0cd8d0 | 1,492 | h | C | runtime/onert/core/include/ir/Layout.h | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 255 | 2020-05-22T07:45:29.000Z | 2022-03-29T23:58:22.000Z | runtime/onert/core/include/ir/Layout.h | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 5,102 | 2020-05-22T07:48:33.000Z | 2022-03-31T23:43:39.000Z | runtime/onert/core/include/ir/Layout.h | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 120 | 2020-05-22T07:51:08.000Z | 2022-02-16T19:08:05.000Z | /*
* Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __ONERT_IR_LAYOUT_H__
#define __ONERT_IR_LAYOUT_H__
#include <functional>
#include <string>
namespace onert
{
namespace ir
{
enum class Layout
{
UNKNOWN = 0,
NHWC,
NCHW
};
inline std::string to_string(Layout layout)
{
switch (layout)
{
case Layout::NHWC:
return std::string{"NHWC"};
case Layout::NCHW:
return std::string{"NCHW"};
case Layout::UNKNOWN:
return std::string{"UNKNOWN"};
default:
throw std::runtime_error("WRONG LAYOUT");
}
}
} // namespace ir
} // namespace onert
namespace std
{
template <> struct hash<onert::ir::Layout>
{
size_t operator()(onert::ir::Layout value) const noexcept
{
using type = typename std::underlying_type<onert::ir::Layout>::type;
return hash<type>()(static_cast<type>(value));
}
};
} // namespace std
#endif // __ONERT_IR_LAYOUT_H__
| 21.941176 | 75 | 0.696381 |
08b55a419aab219191c747f70b8db6decd6bbb09 | 326 | h | C | SproutedUtilities.framework/Versions/A/Headers/NSApplication_RelaunchAdditions.h | espritfollet/Journler | 686c0653775b8ca1c75c1cd110374499e255a2c7 | [
"Unlicense"
] | 46 | 2015-01-17T19:35:34.000Z | 2022-03-07T19:39:58.000Z | SproutedUtilities.framework/Versions/A/Headers/NSApplication_RelaunchAdditions.h | ProBackup-nl/Journler | ee50d9335ae80f9c25183524333581ce99f9428c | [
"Unlicense"
] | 2 | 2015-11-29T04:27:11.000Z | 2017-10-12T12:13:27.000Z | SproutedUtilities.framework/Versions/A/Headers/NSApplication_RelaunchAdditions.h | ProBackup-nl/Journler | ee50d9335ae80f9c25183524333581ce99f9428c | [
"Unlicense"
] | 20 | 2015-01-07T04:28:27.000Z | 2022-02-28T17:06:32.000Z | //
// NSNSApplicationAdditions.h
//
// Created by Cédric Luthi on 13.06.06.
// Copyright 2006 Cédric Luthi. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSApplication (RelaunchAdditions)
/* Relaunch yourself If the call returns, then the relaunch was not successful. */
- (void)relaunch:(id)sender;
@end
| 19.176471 | 82 | 0.723926 |
030fde7b68f18f73ee6650b76d6376dd68fa8f61 | 1,560 | h | C | src/Korean/morphology/kr_FeatureValueStructure.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/Korean/morphology/kr_FeatureValueStructure.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/Korean/morphology/kr_FeatureValueStructure.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | // Copyright 2008 by BBN Technologies Corp.
// All Rights Reserved.
#ifndef KR_FEATUREVALUESTRUCTURE_H
#define KR_FEATUREVALUESTRUCTURE_H
#include "theories/KoreanFeatureValueStructure.h"
#include "common/Symbol.h"
class KoreanFeatureValueStructure : public FeatureValueStructure {
private:
friend class KoreanFeatureValueStructureFactory;
public:
~KoreanFeatureValueStructure(){};
bool operator==(const FeatureValueStructure &other) const;
bool operator!=(const FeatureValueStructure &other) const;
Symbol getPartOfSpeech() { return _partOfSpeech; }
bool isAnalyzed() { return _analyzed; }
void dump(UTF8OutputStream &uos);
// For XML serialization:
void saveXML(SerifXML::XMLElement elem, const Theory *context=0) const;
explicit KoreanFeatureValueStructure(SerifXML::XMLElement fvsElem);
private:
Symbol _partOfSpeech;
bool _analyzed;
KoreanFeatureValueStructure();
KoreanFeatureValueStructure(Symbol partOfSpeech, bool analyzed = false);
};
class KoreanFeatureValueStructureFactory: public FeatureValueStructure::Factory {
virtual FeatureValueStructure *build() { return _new KoreanFeatureValueStructure(); }
virtual FeatureValueStructure *build(Symbol category, Symbol voweledString, Symbol PartOfSpeech, Symbol gloss) { return _new KoreanFeatureValueStructure(partOfSpeech); }
virtual FeatureValueStructure *build(Symbol category, Symbol voweledString, Symbol PartOfSpeech, Symbol gloss, bool analyzed) { return _new KoreanFeatureValueStructure(partOfSpeech, analyzed); }
};
#endif
| 35.454545 | 196 | 0.791026 |
6433f164ab53fd4d7d20df8a491c26b170ace4e0 | 206 | c | C | compiler/asm-inline/asm.c | lijiansong/deep-learning | 7c78061775e47785dfcc4088e93dc4368d16334f | [
"WTFPL"
] | 4 | 2018-05-19T00:55:36.000Z | 2020-08-30T23:31:26.000Z | compiler/asm-inline/asm.c | lijiansong/deep-learning | 7c78061775e47785dfcc4088e93dc4368d16334f | [
"WTFPL"
] | null | null | null | compiler/asm-inline/asm.c | lijiansong/deep-learning | 7c78061775e47785dfcc4088e93dc4368d16334f | [
"WTFPL"
] | null | null | null | int main() {
int flag, new_flag;
__asm__
(
"movl %1, %%eax \n"
"orw $2, %%ax \n"
"movl %%ax, %0 \n"
: "=r"(new_flag) /* output */
: "r"(flag) /* input */
: "%eax" /* clobbered register */
);
}
| 15.846154 | 41 | 0.475728 |
26ad11a3127356c12a0dc6d8a42e028a52ebe0d5 | 3,147 | c | C | SDK/APS_PATCH/examples/system/blewifi/src/blewifi_app.c | Opulinks-Tech/OPL1000 | 391c37a13b71027c43f01c6d91c6b67ee45a4f6b | [
"Apache-2.0"
] | 14 | 2018-06-12T07:36:27.000Z | 2019-07-22T01:18:49.000Z | SDK/APS_PATCH/examples/system/blewifi/src/blewifi_app.c | Opulinks-Tech/OPL1000 | 391c37a13b71027c43f01c6d91c6b67ee45a4f6b | [
"Apache-2.0"
] | null | null | null | SDK/APS_PATCH/examples/system/blewifi/src/blewifi_app.c | Opulinks-Tech/OPL1000 | 391c37a13b71027c43f01c6d91c6b67ee45a4f6b | [
"Apache-2.0"
] | 12 | 2018-08-02T10:16:10.000Z | 2019-07-10T12:42:21.000Z | /******************************************************************************
* Copyright 2017 - 2018, Opulinks Technology Ltd.
* ----------------------------------------------------------------------------
* Statement:
* ----------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of Opulinks Technology Ltd. (C) 2018
******************************************************************************/
/**
* @file blewifi_app.c
* @author Vincent Chen
* @date 12 Feb 2018
* @brief File creates the wifible app task architecture.
*
*/
#include "blewifi_configuration.h"
#include "blewifi_common.h"
#include "blewifi_app.h"
#include "blewifi_wifi_api.h"
#include "blewifi_ble_api.h"
#include "blewifi_ctrl.h"
#include "blewifi_ctrl_http_ota.h"
#include "iot_data.h"
#include "sys_common_api.h"
#include "ps_public.h"
#include "mw_fim_default_group03.h"
#include "mw_fim_default_group03_patch.h"
#include "mw_fim_default_group08.h"
#include "mw_fim_default_group08_project.h"
#include "app_at_cmd.h"
blewifi_ota_t *gTheOta = 0;
void BleWifiAppInit(void)
{
T_MwFim_SysMode tSysMode;
T_MwFim_GP08_PowerSaving tPowerSaving;
gTheOta = 0;
#if (SNTP_FUNCTION_EN == 1)
g_ulSntpSecondInit = SNTP_SEC_2019; // Initialize the Sntp Value
g_ulSystemSecondInit = 0; // Initialize System Clock Time
#endif
// get the settings of system mode
if (MW_FIM_OK != MwFim_FileRead(MW_FIM_IDX_GP03_PATCH_SYS_MODE, 0, MW_FIM_SYS_MODE_SIZE, (uint8_t*)&tSysMode))
{
// if fail, get the default value
memcpy(&tSysMode, &g_tMwFimDefaultSysMode, MW_FIM_SYS_MODE_SIZE);
}
// get the settings of power saving
if (MW_FIM_OK != MwFim_FileRead(MW_FIM_IDX_GP08_PROJECT_POWER_SAVING, 0, MW_FIM_GP08_POWER_SAVING_SIZE, (uint8_t*)&tPowerSaving))
{
// if fail, get the default value
memcpy(&tPowerSaving, &g_tMwFimDefaultGp08PowerSaving, MW_FIM_GP08_POWER_SAVING_SIZE);
}
// only for the user mode
if ((tSysMode.ubSysMode == MW_FIM_SYS_MODE_INIT) || (tSysMode.ubSysMode == MW_FIM_SYS_MODE_USER))
{
/* Wi-Fi Initialization */
BleWifi_Wifi_Init();
/* BLE Stack Initialization */
BleWifi_Ble_Init();
/* blewifi "control" task Initialization */
BleWifi_Ctrl_Init();
/* blewifi HTTP OTA */
#if (WIFI_OTA_FUNCTION_EN == 1)
blewifi_ctrl_http_ota_task_create();
#endif
/* IoT device Initialization */
#if (IOT_DEVICE_DATA_TX_EN == 1) || (IOT_DEVICE_DATA_RX_EN == 1)
Iot_Data_Init();
#endif
/* Power saving settings */
if (tSysMode.ubSysMode == MW_FIM_SYS_MODE_USER)
ps_smart_sleep(tPowerSaving.ubPowerSaving);
/* RF Power settings */
BleWifi_RFPowerSetting(tPowerSaving.ubRFPower);
}
// update the system mode
BleWifi_Ctrl_SysModeSet(tSysMode.ubSysMode);
// add app cmd
app_at_cmd_add();
}
| 31.47 | 130 | 0.639339 |
1429da6cc722d4a144df7dbab50a6cc07f8e7b49 | 7,766 | h | C | FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/nwc/mss_cfm.h | JVVJV/FreeRTOS | 2b956b97c76f48053e87b89df39afb2b9426eee5 | [
"MIT"
] | 2,603 | 2019-10-09T04:47:13.000Z | 2022-03-31T13:59:08.000Z | FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/nwc/mss_cfm.h | JVVJV/FreeRTOS | 2b956b97c76f48053e87b89df39afb2b9426eee5 | [
"MIT"
] | 296 | 2019-11-22T03:29:07.000Z | 2022-03-21T23:23:01.000Z | FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/nwc/mss_cfm.h | JVVJV/FreeRTOS | 2b956b97c76f48053e87b89df39afb2b9426eee5 | [
"MIT"
] | 1,040 | 2019-09-26T20:18:24.000Z | 2022-03-30T08:12:34.000Z | /*******************************************************************************
* Copyright 2019-2021 Microchip FPGA Embedded Systems Solutions.
*
*/
/*=========================================================================*//**
@mainpage PolarFire MSS Frequency Meter Bare Metal Driver.
The MSS Clock Frequency Meter (CFM) block is used to support test of the
DLL's within the MSS. All functional clocks are connected to the CFM block.
The frequency meter can be configured to measure time or frequency, time
allowing items such as PLL lock times to be tested and frequency to test
oscillator frequencies.
Upto 8 circuit counters are implemented.
@section intro_sec Introduction
*//*=========================================================================*/
#ifndef __COREPLEX_PLATFORM_CFM_H_
#define __COREPLEX_PLATFORM_CFM_H_
#ifdef __cplusplus
extern "C" {
#endif
/* CFM Register base address. */
#define CFM_REG_BASE 0x20006000
/***************************************************************************//**
The __cfm_count_id_t enumeration is used to identify the channel used.
*/
typedef enum __cfm_count_id
{
CFM_COUNT_0 = 0,
CFM_COUNT_1,
CFM_COUNT_2,
CFM_COUNT_3,
CFM_COUNT_4,
CFM_COUNT_5,
CFM_COUNT_6,
CFM_COUNT_7,
cfm_lastCH,
} cfm_count_id_t;
/***************************************************************************//**
The cfm_channel_mode enumeration is used to specify the channel mode.
*/
typedef enum __cfm_channel_mode
{
CFM_CH_DISABLED = 0,
CFM_CH_FREQUENCY_MODE,
CFM_CH_RESERVER,
CFM_CH_TIMER_MODE,
CFM_CH_lastmd
} cfm_channel_mode;
typedef enum __cfm_error_id_t
{
CFM_OK = 0,
ERROR_INVALID_CLK_SELECTION_GROUP,
ERROR_INVALID_REF_SEL0,
ERROR_INVALID_REF_SEL1,
ERROR_INVALID_CHANNEL_DRIVE_CLK_MONITOR,
ERROR_INVALID_CFM_BUSY,
ERROR_NULL_VALUE,
ERROR_CFMLAST_ID
} cfm_error_id_t;
typedef struct _cfmRegs
{
__IO uint32_t controlReg; /* CFM Control Register */
__IO uint32_t clkselReg; /* Clock Selection Register */
__IO uint32_t runtimeReg; /* Reference Count Value */
__IO uint32_t modelReg; /* Sets the measurement mode */
__I uint32_t count0; /* Count x value */
__I uint32_t count1;
__I uint32_t count2;
__I uint32_t count3;
__I uint32_t count4;
__I uint32_t count5;
__I uint32_t count6;
__I uint32_t count7;
__I uint32_t reserved[4]; /*Reserved registers, padding structure */
}CFM;
#define CFM_REG ((CFM *)CFM_REG_BASE)
typedef struct _cfmChannelMode
{
uint8_t channel0; /* Channel x mode */
uint8_t channel1; /* Channel x mode */
uint8_t channel2; /* Channel x mode */
uint8_t channel3; /* Channel x mode */
uint8_t channel4; /* Channel x mode */
uint8_t channel5; /* Channel x mode */
uint8_t channel6; /* Channel x mode */
uint8_t channel7; /* Channel x mode */
}cfmChannelMode;
#define CFM_CONTROL_REG_BUSY_MASK 0x01U
#define CFM_CONTROL_REG_START_MASK 0x01U
#define CFM_CONTROL_REG_STOP_BITS_SHIFT 0x01U
#define CFM_CLK_SEL_MASK 0x07U
#define CFM_CLK_REFSEL0_MASK 0x01U
#define CFM_CLK_REFSEL0SHIFT 0x04U
#define CFM_CLK_REFSEL1_MASK 0x01U
#define CFM_CLK_REFSEL1SHIFT 0x05U
#define CFM_CLK_MONSEL_MASK 0x07U
#define CFM_CLK_MONSEL_SHIFT 0x08U
#define CFM_CLK_MONEN_MASK 0x01
#define CFM_CLK_MONEN_SHIFT 11U
#define CFM_RUNTIME_REG_MASK 0xFFFFFFU
#define CFM_CHANNEL_MODE_MASK 0x3U
#define CFM_CH0_SHIFT_MASK 0x00U
#define CFM_CH1_SHIFT_MASK 0x02U
#define CFM_CH2_SHIFT_MASK 0x04U
#define CFM_CH3_SHIFT_MASK 0x06U
#define CFM_CH4_SHIFT_MASK 0x08U
#define CFM_CH5_SHIFT_MASK 0x0AU
#define CFM_CH6_SHIFT_MASK 0x0CU
#define CFM_CH7_SHIFT_MASK 0x0EU
/*****************************************************************************
* CFM Function Prototypes
*******************************************************************************
*/
/*-------------------------------------------------------------------------*//**
The MSS_CFM_control_start() function causes the measurement circuitry
to start. This state of 'busy' will clear which measurement is complete.
@param None
@return
Busy state
Example:
The following call will start the CFM
@code
MSS_CFM_control_start( );
@endcode
*/
uint8_t MSS_CFM_control_start(void);
/*-------------------------------------------------------------------------*//**
The MSS_CFM_control_stop() function causes the measurement circuitry
to stop.
@param None
@return uint8_t
Returns the busy flag.
Example:
The following call will stop the CFM
@code
MSS_CFM_control_stop( );
@endcode
*/
uint8_t MSS_CFM_control_stop(void);
/*-------------------------------------------------------------------------*//**
The MSS_CLF_clk_configuration() function is used to configure the clock
selection register.
@param clkSel
Selects which group of clock inputs are selected by the channels, control
the input multiplexer.
@param refsel0
Selects the reference input, 0=clkref1 / 1=clkref2
@param refsel1
When in timer mode allows ATPG (corners) / clkref3 clock input to clock
the channel counters. This clock input is expected to be sourced from an
on-chip PLL to support at-speed testing. This allows the timer to clocked
off a much higher clock frequency that the reference counter that is limited
to 100Mhz.
@param monSEL
Selects which channel drives the clock monitor output 0-7.
@param monEN
Enables the clock monitor output.
@return
cfm_error_id_t
Example:
The following call will configure clk 0, using clkref1, channel zero drives
the clock monitor and enable the clock monitor output.
@code
MSS_GPIO_config( 0, 0, 0, 0, 1 );
@endcode
*/
cfm_error_id_t MSS_CLF_clk_configuration(
uint8_t clkSel,
uint8_t refsel0,
uint8_t refsel1,
uint8_t monSEL,
uint8_t monEN
);
/*-------------------------------------------------------------------------*//**
The MSS_CFM_runtime_register() function is used to set how many reference
clock cycles the frequency and time measurement should be made.
The register does NOT change during oepration
@param refcount
The reference count value.
*/
void MSS_CFM_runtime_register(
uint32_t referenceCount
);
/*-------------------------------------------------------------------------*//**
The MSS_CFM_channel_mode() function is used to set the measurement mode for
the specified channel.
2'b00: Disabled
2'b01: Frequency Mode
2'b11: Timer Mode
2'b10: Reserved
@param cfmChannelMode
Configuration structure for each channel
@return
None
*/
void MSS_CFM_channel_mode(cfmChannelMode chMode);
/*-------------------------------------------------------------------------*//**
The MSS_CFM_get_count() function is used to get the count value.
Block must not be busy.
@param ch
The channel ID to return the count for.
@param count
The count for the channel register.
@return
cfm_error_id_t
Example:
The following call will return the value in count register. channel 0
@code
MSS_CFM_get_count();
@endcode
*/
cfm_error_id_t MSS_CFM_get_count(cfm_count_id_t ch, uint32_t *count);
#ifdef __cplusplus
}
#endif
#endif /* __COREPLEX_PLATFORM_CFM_H_ */
| 25.051613 | 82 | 0.60443 |
caddc142391a348952a679bdc07b1b428b0f7314 | 1,134 | h | C | Include/Net/CCheckCRC.h | antmuse/AntRedisClient | 2807b13d603a86c592a420b15797c09baaf1f6bf | [
"MIT"
] | 4 | 2018-01-20T11:12:58.000Z | 2021-04-20T03:32:00.000Z | Include/Net/CCheckCRC.h | antmuse/AntRedisClient | 2807b13d603a86c592a420b15797c09baaf1f6bf | [
"MIT"
] | null | null | null | Include/Net/CCheckCRC.h | antmuse/AntRedisClient | 2807b13d603a86c592a420b15797c09baaf1f6bf | [
"MIT"
] | null | null | null | #ifndef APP_CCHECKCRC_H
#define APP_CCHECKCRC_H
#include "HConfig.h"
namespace app {
/*
* @brief CRC16 implementation according to CCITT standards.
*/
class CCheckCRC16 {
public:
CCheckCRC16() : mResult(0) {
}
~CCheckCRC16() {
}
u16 add(const void* buffer, u32 size);
void clear() {
mResult = 0;
}
u16 getResult()const {
return mResult;
}
private:
u16 mResult;
};
class CCheckCRC32 {
public:
CCheckCRC32() : mResult(0xFFFFFFFF) {
}
~CCheckCRC32() {
}
void clear() {
mResult = 0xFFFFFFFF;
}
u32 getResult()const {
return mResult ^ 0xFFFFFFFF;
}
u32 add(const void* buffer, u64 iSize);
private:
u32 mResult;
};
class CCheckCRC64 {
public:
CCheckCRC64() : mResult(0) {
}
~CCheckCRC64() {
}
void clear() {
mResult = 0;
}
u64 getResult()const {
return mResult;
}
u64 add(const void* buffer, u64 iSize);
private:
u64 mResult;
};
}//namespace app
#endif //APP_CCHECKCRC_H
| 14.175 | 60 | 0.539683 |
3797e6c913c2ba3f7eec664a577d6cd3f9f70bd9 | 1,615 | h | C | S3DWrapper10/Commands/ResourceResolveSubresource.h | bo3b/iZ3D | ced8b3a4b0a152d0177f2e94008918efc76935d5 | [
"MIT"
] | 27 | 2020-11-12T19:24:54.000Z | 2022-03-27T23:10:45.000Z | S3DWrapper10/Commands/ResourceResolveSubresource.h | bo3b/iZ3D | ced8b3a4b0a152d0177f2e94008918efc76935d5 | [
"MIT"
] | 2 | 2020-11-02T06:30:39.000Z | 2022-02-23T18:39:55.000Z | S3DWrapper10/Commands/ResourceResolveSubresource.h | bo3b/iZ3D | ced8b3a4b0a152d0177f2e94008918efc76935d5 | [
"MIT"
] | 3 | 2021-08-16T00:21:08.000Z | 2022-02-23T19:19:36.000Z | #pragma once
#include "Command.h"
namespace Commands
{
class ResourceResolveSubresource : public CommandWithAllocator<ResourceResolveSubresource>
{
public:
ResourceResolveSubresource()
{
CommandId = idResourceResolveSubresource;
State_ = COMMAND_MAY_USE_STEREO_RESOURCES;
}
ResourceResolveSubresource(
D3D10DDI_HRESOURCE hDstResource,
UINT DstSubresource,
D3D10DDI_HRESOURCE hSrcResource,
UINT SrcSubresource,
DXGI_FORMAT ResolveFormat
)
{
CommandId = idResourceResolveSubresource;
State_ = COMMAND_MAY_USE_STEREO_RESOURCES;
hDstResource_ = hDstResource;
DstSubresource_ = DstSubresource;
hSrcResource_ = hSrcResource;
SrcSubresource_ = SrcSubresource;
ResolveFormat_ = ResolveFormat;
}
virtual void Execute ( D3DDeviceWrapper *pWrapper );
virtual bool WriteToFile ( D3DDeviceWrapper *pWrapper ) const;
virtual bool ReadFromFile ();
void BuildCommand(CDumpState *ds);
virtual bool IsUsedStereoResources( D3DDeviceWrapper* /*pWrapper*/ ) const;
virtual void SetDestResourceType( TextureType type );
virtual void GetDestResources(DestResourcesSet &res);
public:
D3D10DDI_HRESOURCE hDstResource_;
UINT DstSubresource_;
D3D10DDI_HRESOURCE hSrcResource_;
UINT SrcSubresource_;
DXGI_FORMAT ResolveFormat_;
DEPENDS_ON2(hDstResource_,hSrcResource_);
};
}
extern VOID ( APIENTRY ResourceResolveSubresource )(
D3D10DDI_HDEVICE hDevice,
D3D10DDI_HRESOURCE hDstResource,
UINT DstSubresource,
D3D10DDI_HRESOURCE hSrcResource,
UINT SrcSubresource,
DXGI_FORMAT ResolveFormat
);
| 24.846154 | 91 | 0.767183 |
37b7651a9a473d5768b50ae97f6a93251bb32c09 | 218 | h | C | Sandbox/src/SandBox.h | quesswho/Dodo | 75408374a73e1cceb3e41ec25493f2abbaa447ee | [
"MIT"
] | 1 | 2020-06-09T21:11:08.000Z | 2020-06-09T21:11:08.000Z | Sandbox/src/SandBox.h | quesswho/Dodo | 75408374a73e1cceb3e41ec25493f2abbaa447ee | [
"MIT"
] | 9 | 2020-11-17T07:54:06.000Z | 2021-01-05T13:13:05.000Z | Sandbox/src/SandBox.h | quesswho/Dodo | 75408374a73e1cceb3e41ec25493f2abbaa447ee | [
"MIT"
] | null | null | null | #pragma once
#include <Dodo.h>
using namespace Dodo;
class GameLayer : public Layer {
private:
public:
GameLayer();
~GameLayer();
void Update(float elapsed);
void Render();
void OnEvent(const Event& event);
}; | 13.625 | 34 | 0.706422 |
5343bde9cc536d8c67a16593139f46eea247bbb8 | 160 | h | C | include/platform/audio.h | ZopharsDomain/GAMEBOYC-3DS-GameYob | 48723b5f7c8300ff6eb6bff441cc0527c7c65671 | [
"MIT"
] | 2 | 2022-01-19T09:57:43.000Z | 2022-01-19T09:57:53.000Z | include/platform/audio.h | ZopharsDomain/GAMEBOYC-3DS-GameYob | 48723b5f7c8300ff6eb6bff441cc0527c7c65671 | [
"MIT"
] | null | null | null | include/platform/audio.h | ZopharsDomain/GAMEBOYC-3DS-GameYob | 48723b5f7c8300ff6eb6bff441cc0527c7c65671 | [
"MIT"
] | null | null | null | #pragma once
#include "types.h"
void audioInit();
void audioCleanup();
u32 audioGetSampleRate();
void audioClear();
void audioPlay(u32* buffer, long samples); | 17.777778 | 42 | 0.75 |
bb3f238427a4d4a525f728c372dc2f5dfa0c29e6 | 810 | h | C | include/clap/ext/draft/check-for-update.h | iPlug2/clap | 00cc938d85ef77cdc3938ad86032d7fbfdd219aa | [
"MIT"
] | 241 | 2015-01-15T12:31:49.000Z | 2022-03-31T07:18:54.000Z | include/clap/ext/draft/check-for-update.h | iPlug2/clap | 00cc938d85ef77cdc3938ad86032d7fbfdd219aa | [
"MIT"
] | 62 | 2015-01-14T09:51:04.000Z | 2022-03-31T16:53:12.000Z | include/clap/ext/draft/check-for-update.h | iPlug2/clap | 00cc938d85ef77cdc3938ad86032d7fbfdd219aa | [
"MIT"
] | 18 | 2015-05-14T07:23:29.000Z | 2022-03-31T07:16:12.000Z | #pragma once
#include "../../plugin.h"
static CLAP_CONSTEXPR const char CLAP_EXT_CHECK_FOR_UPDATE[] = "clap.check_for_update.draft/0";
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push, CLAP_ALIGN)
typedef struct clap_check_for_update_info {
const char *version;
const char *release_date; // YYYY-MM-DD
const char *url;
alignas(1) bool is_stable;
} clap_check_for_update_info_t;
typedef struct clap_plugin_check_for_update {
// [main-thread]
void (*check)(const clap_host_t *host, bool include_beta);
} clap_plugin_check_for_update;
typedef struct clap_host_check_for_update {
// [main-thread]
void (*on_new_version)(const clap_host_t *host, const clap_check_for_update_info_t *update_info);
} clap_host_check_for_update_t;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif | 23.142857 | 100 | 0.762963 |
9b6e67b89db3a5a091a550a49d31f5fb9bf32479 | 7,267 | h | C | src/math/IntDistribution.h | Amjadhpc/w2rap-contigger | 221f6cabedd19743046ee5dec18e6feb85130218 | [
"MIT"
] | 48 | 2016-04-26T16:52:59.000Z | 2022-01-15T09:18:17.000Z | src/math/IntDistribution.h | Amjadhpc/w2rap-contigger | 221f6cabedd19743046ee5dec18e6feb85130218 | [
"MIT"
] | 45 | 2016-04-27T08:20:56.000Z | 2022-02-14T07:47:11.000Z | src/math/IntDistribution.h | Amjadhpc/w2rap-contigger | 221f6cabedd19743046ee5dec18e6feb85130218 | [
"MIT"
] | 15 | 2016-05-11T14:35:25.000Z | 2022-01-15T09:18:45.000Z | ///////////////////////////////////////////////////////////////////////////////
// SOFTWARE COPYRIGHT NOTICE AGREEMENT //
// This software and its documentation are copyright (2011) by the //
// Broad Institute. All rights are reserved. This software is supplied //
// without any warranty or guaranteed support whatsoever. The Broad //
// Institute is not responsible for its use, misuse, or functionality. //
///////////////////////////////////////////////////////////////////////////////
// author: Filipe Ribeiro 03/2011
//
//
//
#ifndef _MATH__INT_DISTRIBUTION_H
#define _MATH__INT_DISTRIBUTION_H
#include "MainTools.h"
#include "math/IntFunction.h"
class IntDistribution
{
public:
typedef double real_t;
private:
IntFunction<real_t> _prob;
IntFunction<real_t> _prob_le;
IntFunction<real_t> _prob_le_sum;
void _normalize();
public:
IntDistribution()
: _prob(),
_prob_le(),
_prob_le_sum()
{}
IntDistribution(const IntFunction<real_t> & func)
: _prob(func),
_prob_le(func.x_min(), func.x_max(), 0.0),
_prob_le_sum(func.x_min(), func.x_max(), 0.0)
{
_normalize();
}
~IntDistribution()
{
//cout << "~int_dist(): " << _prob.x_min() << ", " << _prob.x_max()
// << " le: " << _prob_le.x_min() << ", " << _prob_le.x_max()
}
operator bool() const { return (_prob.size() > 1); }
static IntDistribution gaussian(const int mean,
const int sigma,
const real_t n_sigma = 4.0);
static IntDistribution uniform(const int a,
const int b);
template <class INT_t>
void from_hits(const vec<INT_t> & hits)
{
IntFunction<real_t> f;
for (size_t i = 0; i != hits.size(); i++)
f[hits[i]]++;
_prob = f;
_normalize();
}
int x_min() const { return _prob.x_min(); }
int x_max() const { return _prob.x_max(); }
real_t prob(const int x) const
{
if (x < x_min() || x > x_max()) return 0.0;
return _prob[x];
}
real_t prob_le(const int x) const
{
if (x < x_min()) return 0.0;
if (x > x_max()) return 1.0;
return _prob_le[x];
}
real_t prob_lt (const int x) const { return prob_le(x - 1); }
real_t prob_ge (const int x) const { return 1.0 - prob_lt(x); }
real_t prob_gt (const int x) const { return 1.0 - prob_le(x); }
real_t prob_in (const int x0, const int x1) const { return prob_le(x1) - prob_lt(x0); }
real_t prob_not_in (const int x0, const int x1) const { return 1.0 - prob_in(x0, x1); }
real_t prob_max () const { return prob(x_prob_max()); }
// x_prob_le(random01) is a simple way of getting a random sample from the distribution.
int x_prob_le (const real_t F) const { return quantile(F); }
int x_prob_max () const { return _prob.x_f_max(); }
real_t mean () const;
real_t moment (const real_t c, const unsigned order) const;
real_t variance () const { return moment(mean(), 2); }
int quantile (const real_t Fq) const;
int median () const { return quantile(0.5); }
int mode () const { return x_prob_max(); }
real_t prob_in_sum(const int x0, const int x1, const int n) const;
IntFunction<real_t> probs() const { return _prob; }
void split(IntDistribution * p_dist_left,
IntDistribution * p_dist_right,
const int x_split = 0) const;
IntDistribution reverse() const;
void to_text_file(const String & head) const;
public:
// ---- SELF_SERIALIZABLE method
void writeBinary( BinaryWriter& writer ) const
{ _prob.writeBinary(writer); }
// ---- SELF_SERIALIZABLE method
void readBinary( BinaryReader& reader )
{ _prob.readBinary(reader); _normalize(); }
// ---- SELF_SERIALIZABLE method
static size_t externalSizeof() { return 0; }
};
SELF_SERIALIZABLE(IntDistribution);
// Compute the distribution of the sum of 2 random variables
// Z = X + Y => p(Z) = p(X) * p(Y)
IntDistribution distribution_of_sum(const IntDistribution & x_dist,
const IntDistribution & y_dist);
// Compute the distribution of the sum of 2 random variables
// Z = X - Y => p(Z) = p(X) * p(Y)
IntDistribution distribution_of_difference(const IntDistribution & x_dist,
const IntDistribution & y_dist);
class IntLogDistribution : public IntFunction<double>
{
public:
typedef double real_t;
public:
IntLogDistribution(const int x0 = 0, const int x1 = 0, const real_t val = 0)
: IntFunction<real_t>(x0, x1, val)
{
this->expand_infinity();
}
IntLogDistribution(const IntDistribution & dist)
: IntFunction<real_t>(dist.x_min(), dist.x_max())
{
const int x0 = dist.x_min();
const int x1 = dist.x_max();
real_t p_min = -1; // undefined
for (int x = x0; x <= x1; x++) {
const real_t p = dist.prob(x);
ForceAssertGe(p, 0);
if (p > 0.0 && (p_min < 0 || p < p_min))
p_min = p;
}
IntLogDistribution & me = *this;
for (int x = x0; x <= x1; x++) {
const real_t p = dist.prob(x);
me[x] = (p > 0.0) ? log(p) : log(p_min);
}
me.expand_infinity();
}
IntLogDistribution(const IntFunction<real_t> & func)
: IntFunction<real_t>(func.x_min(), func.x_max())
{
const int x0 = func.x_min();
const int x1 = func.x_max();
real_t f_min = -1; // undefined
for (int x = x0; x <= x1; x++) {
const real_t f = func[x];
ForceAssertGe(f, 0);
if (f > 0.0 && (f_min < 0 || f < f_min))
f_min = f;
}
IntLogDistribution & me = *this;
for (int x = x0; x <= x1; x++) {
const real_t f = func[x];
me[x] = (f > 0.0) ? log(f) : log(f_min);
}
me.expand_infinity();
}
~IntLogDistribution()
{
// std::cout << "~int_log_dist(): " << x_min() << ", " << x_max() << std::endl;
}
IntDistribution int_distribution() const
{
const int x0 = x_min();
const int x1 = x_max();
IntFunction<real_t> func(x0, x1);
const IntLogDistribution & me = *this;
real_t f_max = me.f_max();
for (int x = x0; x <= x1; x++)
func[x] = exp(me[x] - f_max); // = 1 at me[x] = f_max
// here I rely on the IntDistribution constructor that accepts an IntFunction
return func;
}
void to_text_file(const String & fn) const
{
const real_t fmax = f_max();
const int x0 = x_min();
const int x1 = x_max();
std::ofstream os;
os.open(fn.c_str());
os << "# x_min = " << x0 << std::endl;
os << "# x_max = " << x1 << std::endl;
os << "# 1:x 2:f_x" << std::endl;
os << std::fixed;
for (int x = x0; x <= x1; x++) {
os << std::setw(10) << x << " "
<< std::setw(16) << ((*this)[x] - fmax)
<< std::endl;
}
os.close();
}
};
#endif
| 25.678445 | 95 | 0.541351 |
63860cfef6f392601803f20c29f89179187e3ccc | 239 | h | C | Backends/include/gambit/Backends/backend_types/Pythia_8_212_EM/wrapper_DecayChannel.h | aaronvincent/gambit_aaron | a38bd6fc10d781e71f2adafd401c76e1e3476b05 | [
"Unlicense"
] | 2 | 2020-09-08T20:05:27.000Z | 2021-04-26T07:57:56.000Z | Backends/include/gambit/Backends/backend_types/Pythia_8_212_EM/wrapper_DecayChannel.h | aaronvincent/gambit_aaron | a38bd6fc10d781e71f2adafd401c76e1e3476b05 | [
"Unlicense"
] | 9 | 2020-10-19T09:56:17.000Z | 2021-05-28T06:12:03.000Z | Backends/include/gambit/Backends/backend_types/Pythia_8_212_EM/wrapper_DecayChannel.h | aaronvincent/gambit_aaron | a38bd6fc10d781e71f2adafd401c76e1e3476b05 | [
"Unlicense"
] | 5 | 2020-09-08T02:23:34.000Z | 2021-03-23T08:48:04.000Z | #ifndef __wrapper_DecayChannel_Pythia_8_212_EM_h__
#define __wrapper_DecayChannel_Pythia_8_212_EM_h__
#include "wrapper_DecayChannel_decl.h"
#include "wrapper_DecayChannel_def.h"
#endif /* __wrapper_DecayChannel_Pythia_8_212_EM_h__ */
| 23.9 | 55 | 0.870293 |
5b92572a476fea0807fde84f479b4d78067d5d4e | 4,785 | c | C | src/canon-gff3.c | satta/AEGeAn | 16fe6714e3db0e3201c7b3f4e04319e795ed5001 | [
"ISC"
] | 21 | 2016-05-19T18:14:41.000Z | 2021-12-21T21:42:33.000Z | src/canon-gff3.c | satta/AEGeAn | 16fe6714e3db0e3201c7b3f4e04319e795ed5001 | [
"ISC"
] | 59 | 2016-01-27T20:46:06.000Z | 2021-01-04T14:51:16.000Z | src/canon-gff3.c | vpbrendel/AEGeAn | 4b00f0a6aab36a9ab6ea6a62f53c110053aaf96c | [
"0BSD"
] | 10 | 2016-01-27T20:41:32.000Z | 2020-01-28T22:45:42.000Z | /**
Copyright (c) 2010-2014, Daniel S. Standage and CONTRIBUTORS
The AEGeAn Toolkit is distributed under the ISC License. See
the 'LICENSE' file in the AEGeAn source code distribution or
online at https://github.com/standage/AEGeAn/blob/master/LICENSE.
**/
#include <getopt.h>
#include "genometools.h"
#include "aegean.h"
typedef struct
{
GtFile *outstream;
GtStr *source;
bool infer;
} CanonGFF3Options;
static void print_usage(FILE *outstream)
{
fputs("\nUsage: canon-gff3 [options] gff3file1 [gff3file2 ...]\n"
" Options:\n"
" -h|--help print this help message and exit\n"
" -i|--infer for transcript features lacking an explicitly\n"
" declared gene feature as a parent, create this\n"
" feature on-they-fly\n"
" -o|--outfile: STRING name of file to which GFF3 data will be\n"
" written; default is terminal (stdout)\n"
" -s|--source: STRING reset the source of each feature to the given\n"
" value\n"
" -v|--version print version number and exit\n\n",
outstream);
}
static void canon_gff3_parse_options(int argc, char * const *argv,
CanonGFF3Options *options, GtError *error)
{
int opt = 0;
int optindex = 0;
const char *optstr = "hio:s:v";
const struct option init_options[] =
{
{ "help", no_argument, NULL, 'h' },
{ "infer", no_argument, NULL, 'i' },
{ "outfile", required_argument, NULL, 'o' },
{ "source", required_argument, NULL, 's' },
{ "version", no_argument, NULL, 'v' },
{ NULL, no_argument, NULL, 0 },
};
for(opt = getopt_long(argc, argv, optstr, init_options, &optindex);
opt != -1;
opt = getopt_long(argc, argv, optstr, init_options, &optindex))
{
if(opt == 'h')
{
print_usage(stdout);
exit(0);
}
else if(opt == 'i')
options->infer = true;
else if(opt == 'o')
{
if(options->outstream != NULL)
gt_file_delete(options->outstream);
options->outstream = gt_file_new(optarg, "w", error);
}
else if(opt == 's')
{
if(options->source != NULL)
gt_str_delete(options->source);
options->source = gt_str_new_cstr(optarg);
}
else if(opt == 'v')
{
agn_print_version("CanonGFF3", stdout);
exit(0);
}
}
}
// Main method
int main(int argc, char * const *argv)
{
GtError *error;
GtLogger *logger;
GtQueue *streams;
GtNodeStream *stream, *last_stream;
CanonGFF3Options options = { NULL, NULL, false };
gt_lib_init();
error = gt_error_new();
canon_gff3_parse_options(argc, argv + 0, &options, error);
streams = gt_queue_new();
logger = gt_logger_new(true, "", stderr);
stream = gt_gff3_in_stream_new_unsorted(argc - optind, (const char **)
argv+optind);
gt_gff3_in_stream_check_id_attributes((GtGFF3InStream *)stream);
gt_gff3_in_stream_enable_tidy_mode((GtGFF3InStream *)stream);
gt_queue_add(streams, stream);
last_stream = stream;
if(options.infer)
{
GtHashmap *type_parents = gt_hashmap_new(GT_HASH_STRING, gt_free_func,
gt_free_func);
gt_hashmap_add(type_parents, gt_cstr_dup("mRNA"), gt_cstr_dup("gene"));
gt_hashmap_add(type_parents, gt_cstr_dup("tRNA"), gt_cstr_dup("gene"));
stream = agn_infer_parent_stream_new(last_stream,
type_parents);
gt_hashmap_delete(type_parents);
gt_queue_add(streams, stream);
last_stream = stream;
}
stream = agn_gene_stream_new(last_stream, logger);
gt_queue_add(streams, stream);
last_stream = stream;
if(options.source != NULL)
{
GtNodeVisitor *ssv = gt_set_source_visitor_new(options.source);
stream = gt_visitor_stream_new(last_stream, ssv);
gt_queue_add(streams, stream);
last_stream = stream;
}
stream = gt_gff3_out_stream_new(last_stream, options.outstream);
if(!options.infer)
gt_gff3_out_stream_retain_id_attributes((GtGFF3OutStream *)stream);
gt_queue_add(streams, stream);
last_stream = stream;
if(gt_node_stream_pull(last_stream, error) == -1)
{
fprintf(stderr, "[CanonGFF3] error processing node stream: %s",
gt_error_get(error));
}
while(gt_queue_size(streams) > 0)
{
stream = gt_queue_get(streams);
gt_node_stream_delete(stream);
}
gt_queue_delete(streams);
if(options.source != NULL)
gt_str_delete(options.source);
if(options.outstream != NULL)
gt_file_delete(options.outstream);
gt_error_delete(error);
gt_logger_delete(logger);
gt_lib_clean();
return 0;
}
| 29.720497 | 79 | 0.623615 |
a5c2159f20dbf564af98b6d01ed6725561a626ef | 5,085 | h | C | src/ByteEngine/Application/Application.h | Game-Tek/Byte-Engine | 5da58971da77c3c92780437f8e3ca1a143cacd5c | [
"MIT"
] | 10 | 2020-05-05T03:21:34.000Z | 2022-01-22T23:01:22.000Z | src/ByteEngine/Application/Application.h | Game-Tek/Byte-Engine | 5da58971da77c3c92780437f8e3ca1a143cacd5c | [
"MIT"
] | null | null | null | src/ByteEngine/Application/Application.h | Game-Tek/Byte-Engine | 5da58971da77c3c92780437f8e3ca1a143cacd5c | [
"MIT"
] | 1 | 2020-09-07T03:04:48.000Z | 2020-09-07T03:04:48.000Z | #pragma once
#include "ByteEngine/Core.h"
#include <GTSL/Application.h>
#include <GTSL/Allocator.h>
#include <GTSL/HashMap.hpp>
#include <GTSL/String.hpp>
#include "Clock.h"
#include "PoolAllocator.h"
#include "StackAllocator.h"
#include "SystemAllocator.h"
#include "ByteEngine/Id.h"
#include "ByteEngine/Resources/ResourceManager.h"
class ApplicationManager;
class InputManager;
class ThreadPool;
class Clock;
#undef ERROR
namespace BE
{
class Logger;
class Application : public Object
{
public:
[[nodiscard]] static const char* GetEngineName() { return "Byte Engine"; }
static const char* GetEngineVersion() { return "0.0.1"; }
static Application* Get() { return applicationInstance; }
explicit Application(GTSL::ShortString<128> applicationName);
virtual ~Application();
bool BaseInitialize(int argc, utf8* argv[]);
virtual bool Initialize() = 0;
virtual void PostInitialize() = 0;
virtual void Shutdown() = 0;
uint8 GetNumberOfThreads();
const GTSL::Application& GetApplication() const { return systemApplication; }
enum class UpdateContext : uint8
{
NORMAL, BACKGROUND
};
struct OnUpdateInfo
{
};
virtual void OnUpdate(const OnUpdateInfo& updateInfo);
int Run(int argc, char** argv);
virtual GTSL::ShortString<128> GetApplicationName() = 0;
//Fires a Delegate to signal that the application has been requested to close.
void PromptClose();
enum class CloseMode : uint8
{
OK, WARNING, ERROR
};
//Flags the application to close on the next update.
void Close(CloseMode closeMode, GTSL::Range<const utf8*> reason);
//Immediately closes the application and logs the reason
void Exit(const GTSL::Range<const utf8*> reason) {
GTSL::Lock lock(crashLogMutex);
if(!crashLog) {
crashLog.Open(GTSL::ShortString<32>(u8"crash.log"), GTSL::File::WRITE, true);
}
GTSL::Buffer<GTSL::StaticAllocator<512>> buffer;
GTSL::Insert(reason, buffer);
crashLog.Write(buffer);
//todo: open dialog box?
}
[[nodiscard]] GTSL::StaticString<260> GetPathToApplication() const
{
auto path = systemApplication.GetPathToExecutable();
path.Drop(FindLast(path, u8'/').Get()); return path;
}
[[nodiscard]] const Clock* GetClock() const { return &clockInstance; }
[[nodiscard]] InputManager* GetInputManager() const { return inputManagerInstance.GetData(); }
[[nodiscard]] Logger* GetLogger() const { return logger.GetData(); }
[[nodiscard]] const GTSL::Application* GetSystemApplication() const { return &systemApplication; }
[[nodiscard]] class ApplicationManager* GetGameInstance() const { return gameInstance; }
template<typename RM>
RM* CreateResourceManager()
{
auto resource_manager = GTSL::SmartPointer<RM, SystemAllocatorReference>(systemAllocatorReference);
auto* pointer = resource_manager.GetData();
resourceManagers.Emplace(GTSL::Id64(resource_manager->GetName()), MoveRef(resource_manager));
return pointer;
}
[[nodiscard]] uint64 GetApplicationTicks() const { return applicationTicks; }
template<class T>
T* GetResourceManager(const Id name) { return static_cast<T*>(resourceManagers.At(name).GetData()); }
[[nodiscard]] ThreadPool* GetThreadPool() const { return threadPool; }
[[nodiscard]] SystemAllocator* GetSystemAllocator() { return &systemAllocator; }
[[nodiscard]] PoolAllocator* GetPersistantAllocator() { return &poolAllocator; }
[[nodiscard]] StackAllocator* GetTransientAllocator() { return &transientAllocator; }
uint32 GetOption(const Id name) const
{
return settings.At(name);
}
protected:
inline static Application* applicationInstance{ nullptr };
SystemAllocator systemAllocator;
SystemAllocatorReference systemAllocatorReference;
GTSL::File crashLog;
GTSL::Mutex crashLogMutex;
GTSL::SmartPointer<Logger, SystemAllocatorReference> logger;
GTSL::SmartPointer<ApplicationManager, BE::SystemAllocatorReference> gameInstance;
GTSL::HashMap<Id, GTSL::SmartPointer<ResourceManager, SystemAllocatorReference>, SystemAllocatorReference> resourceManagers;
GTSL::HashMap<Id, uint32, SystemAllocatorReference> settings;
PoolAllocator poolAllocator;
StackAllocator transientAllocator;
GTSL::Application systemApplication;
bool initialized = false;
Clock clockInstance;
GTSL::SmartPointer<InputManager, BE::SystemAllocatorReference> inputManagerInstance;
GTSL::SmartPointer<ThreadPool, BE::SystemAllocatorReference> threadPool;
bool flaggedForClose = false;
CloseMode closeMode{ CloseMode::OK };
BE_DEBUG_ONLY(GTSL::StaticString<1024> closeReason);
uint64 applicationTicks{ 0 };
bool parseConfig();
/**
* \brief Checks if the platform (OS, CPU, RAM) satisfies certain requirements specified for the program.
* \return Whether the current platform supports the required features.
*/
bool checkPlatformSupport();
private:
};
Application* CreateApplication(GTSL::AllocatorReference* allocatorReference);
void DestroyApplication(Application* application, GTSL::AllocatorReference* allocatorReference);
}
| 30.449102 | 126 | 0.740413 |
8b454631adf01b97c02b8511faf8e90848184bdd | 8,228 | c | C | squeak2_2_c/src/sqOldSoundPrims.c | daitangio/jsqueak | 64bf5fc36cd5d85d8aeabed19bddfdec3a97b292 | [
"MIT"
] | 3 | 2015-05-12T16:03:23.000Z | 2021-04-01T10:31:17.000Z | squeak2_2_c/src/sqOldSoundPrims.c | daitangio/jsqueak | 64bf5fc36cd5d85d8aeabed19bddfdec3a97b292 | [
"MIT"
] | null | null | null | squeak2_2_c/src/sqOldSoundPrims.c | daitangio/jsqueak | 64bf5fc36cd5d85d8aeabed19bddfdec3a97b292 | [
"MIT"
] | 1 | 2020-12-26T18:06:30.000Z | 2020-12-26T18:06:30.000Z | /* Automatically generated from Squeak on (4 January 1998 3:05:25 am ) */
#include "sq.h"
/* Memory Access Macros */
#define byteAt(i) (*((unsigned char *) (i)))
#define byteAtput(i, val) (*((unsigned char *) (i)) = val)
#define longAt(i) (*((int *) (i)))
#define longAtput(i, val) (*((int *) (i)) = val)
/*** Imported Functions/Variables ***/
extern int stackValue(int);
extern int successFlag;
/*** Variables ***/
/*** Function Prototypes ***/
int primFMSoundmixSampleCountintostartingAtpan(void);
int primPluckedSoundmixSampleCountintostartingAtpan(void);
int primSampledSoundmixSampleCountintostartingAtpan(void);
int primWaveTableSoundmixSampleCountintostartingAtpan(void);
int primFMSoundmixSampleCountintostartingAtpan(void) {
int rcvr;
int n;
short int *aSoundBuffer;
int startIndex;
int pan;
int mySample;
int sample;
int lastIndex;
int channelIndex;
int i;
short int *waveTable;
int waveTableSize;
int count;
int amplitude;
int increment;
int index;
int modulation;
int offsetIncrement;
int offsetIndex;
rcvr = stackValue(4);
n = checkedIntegerValueOf(stackValue(3));
aSoundBuffer = arrayValueOf(stackValue(2));
startIndex = checkedIntegerValueOf(stackValue(1));
pan = checkedIntegerValueOf(stackValue(0));
waveTable = fetchArrayofObject(1, rcvr);
waveTableSize = fetchIntegerofObject(2, rcvr);
count = fetchIntegerofObject(4, rcvr);
amplitude = fetchIntegerofObject(6, rcvr);
increment = fetchIntegerofObject(8, rcvr);
index = fetchIntegerofObject(9, rcvr);
modulation = fetchIntegerofObject(11, rcvr);
offsetIncrement = fetchIntegerofObject(14, rcvr);
offsetIndex = fetchIntegerofObject(15, rcvr);
if (!(successFlag)) {
return null;
}
lastIndex = (startIndex + n) - 1;
for (i = startIndex; i <= lastIndex; i += 1) {
mySample = (amplitude * (waveTable[index - 1])) / 1000;
if (pan > 0) {
channelIndex = 2 * i;
sample = (aSoundBuffer[channelIndex - 1]) + ((mySample * pan) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
if (pan < 1000) {
channelIndex = (2 * i) - 1;
sample = (aSoundBuffer[channelIndex - 1]) + ((mySample * (1000 - pan)) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
index = (index + increment) + ((modulation * (waveTable[offsetIndex - 1])) / 1000000);
if (index > waveTableSize) {
index -= waveTableSize;
}
if (index < 1) {
index += waveTableSize;
}
offsetIndex += offsetIncrement;
if (offsetIndex > waveTableSize) {
offsetIndex -= waveTableSize;
}
}
count -= n;
storeIntegerofObjectwithValue(4, rcvr, count);
storeIntegerofObjectwithValue(9, rcvr, index);
storeIntegerofObjectwithValue(15, rcvr, offsetIndex);
pop(4);
}
int primPluckedSoundmixSampleCountintostartingAtpan(void) {
int rcvr;
int n;
short int *aSoundBuffer;
int startIndex;
int pan;
int lastIndex;
int channelIndex;
int i;
int sample;
int mySample;
int thisIndex;
int nextIndex;
int count;
short int *ring;
int ringSize;
int ringIndx;
rcvr = stackValue(4);
n = checkedIntegerValueOf(stackValue(3));
aSoundBuffer = arrayValueOf(stackValue(2));
startIndex = checkedIntegerValueOf(stackValue(1));
pan = checkedIntegerValueOf(stackValue(0));
count = fetchIntegerofObject(2, rcvr);
ring = fetchArrayofObject(4, rcvr);
ringSize = fetchIntegerofObject(5, rcvr);
ringIndx = fetchIntegerofObject(6, rcvr);
if (!(successFlag)) {
return null;
}
lastIndex = (startIndex + n) - 1;
thisIndex = ringIndx;
for (i = startIndex; i <= lastIndex; i += 1) {
nextIndex = (thisIndex % ringSize) + 1;
mySample = ((ring[thisIndex - 1]) + (ring[nextIndex - 1])) / 2;
ring[thisIndex - 1] = mySample;
thisIndex = nextIndex;
if (pan > 0) {
channelIndex = 2 * i;
sample = (aSoundBuffer[channelIndex - 1]) + ((mySample * pan) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
if (pan < 1000) {
channelIndex = (2 * i) - 1;
sample = (aSoundBuffer[channelIndex - 1]) + ((mySample * (1000 - pan)) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
}
ringIndx = nextIndex;
count -= n;
storeIntegerofObjectwithValue(2, rcvr, count);
storeIntegerofObjectwithValue(6, rcvr, ringIndx);
pop(4);
}
int primSampledSoundmixSampleCountintostartingAtpan(void) {
int rcvr;
int n;
short int *aSoundBuffer;
int startIndex;
int pan;
int lastIndex;
int i;
int channelIndex;
int sample;
int sampleIndex;
int thisSample;
short int *samples;
int samplesSize;
int incrementTimes1000;
int count;
int indexTimes1000;
rcvr = stackValue(4);
n = checkedIntegerValueOf(stackValue(3));
aSoundBuffer = arrayValueOf(stackValue(2));
startIndex = checkedIntegerValueOf(stackValue(1));
pan = checkedIntegerValueOf(stackValue(0));
samples = fetchArrayofObject(1, rcvr);
samplesSize = fetchIntegerofObject(2, rcvr);
incrementTimes1000 = fetchIntegerofObject(3, rcvr);
count = fetchIntegerofObject(5, rcvr);
indexTimes1000 = fetchIntegerofObject(6, rcvr);
if (!(successFlag)) {
return null;
}
lastIndex = (startIndex + n) - 1;
i = startIndex;
sampleIndex = indexTimes1000 / 1000;
while ((sampleIndex <= samplesSize) && (i <= lastIndex)) {
thisSample = samples[sampleIndex - 1];
if (pan > 0) {
channelIndex = 2 * i;
sample = (aSoundBuffer[channelIndex - 1]) + ((thisSample * pan) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
if (pan < 1000) {
channelIndex = (2 * i) - 1;
sample = (aSoundBuffer[channelIndex - 1]) + ((thisSample * (1000 - pan)) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
indexTimes1000 += incrementTimes1000;
sampleIndex = indexTimes1000 / 1000;
i += 1;
}
count -= n;
storeIntegerofObjectwithValue(5, rcvr, count);
storeIntegerofObjectwithValue(6, rcvr, indexTimes1000);
pop(4);
}
int primWaveTableSoundmixSampleCountintostartingAtpan(void) {
int rcvr;
int n;
short int *aSoundBuffer;
int startIndex;
int pan;
int lastIndex;
int channelIndex;
int i;
int mySample;
int sample;
short int *waveTable;
int waveTableSize;
int count;
int amplitude;
int increment;
int index;
rcvr = stackValue(4);
n = checkedIntegerValueOf(stackValue(3));
aSoundBuffer = arrayValueOf(stackValue(2));
startIndex = checkedIntegerValueOf(stackValue(1));
pan = checkedIntegerValueOf(stackValue(0));
waveTable = fetchArrayofObject(1, rcvr);
waveTableSize = fetchIntegerofObject(2, rcvr);
count = fetchIntegerofObject(4, rcvr);
amplitude = fetchIntegerofObject(6, rcvr);
increment = fetchIntegerofObject(8, rcvr);
index = fetchIntegerofObject(9, rcvr);
if (!(successFlag)) {
return null;
}
lastIndex = (startIndex + n) - 1;
for (i = startIndex; i <= lastIndex; i += 1) {
mySample = (amplitude * (waveTable[index - 1])) / 1000;
if (pan > 0) {
channelIndex = 2 * i;
sample = (aSoundBuffer[channelIndex - 1]) + ((mySample * pan) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
if (pan < 1000) {
channelIndex = (2 * i) - 1;
sample = (aSoundBuffer[channelIndex - 1]) + ((mySample * (1000 - pan)) / 1000);
if (sample > 32767) {
sample = 32767;
}
if (sample < -32767) {
sample = -32767;
}
aSoundBuffer[channelIndex - 1] = sample;
}
index += increment;
if (index > waveTableSize) {
index -= waveTableSize;
}
}
count -= n;
storeIntegerofObjectwithValue(4, rcvr, count);
storeIntegerofObjectwithValue(9, rcvr, index);
pop(4);
}
| 26.714286 | 88 | 0.655931 |
992f98a30910c320377f8fce8c19b3c815338f26 | 1,552 | h | C | LaalMathEngine/Include/MovieMaker/MovieMaker.h | vijayshankarkumar/LME | 6483d893a8902cec4959936220656fcab2b72d4f | [
"MIT"
] | 1 | 2022-02-18T10:38:42.000Z | 2022-02-18T10:38:42.000Z | LaalMathEngine/Include/MovieMaker/MovieMaker.h | vijayshankarkumar/LME | 6483d893a8902cec4959936220656fcab2b72d4f | [
"MIT"
] | 1 | 2021-09-03T21:20:38.000Z | 2021-09-03T21:20:38.000Z | LaalMathEngine/Include/MovieMaker/MovieMaker.h | vijayshankarkumar/LME | 6483d893a8902cec4959936220656fcab2b72d4f | [
"MIT"
] | null | null | null | #ifndef LAAL_MOVIE_MAKER_HPP
#define LAAL_MOVIE_MAKER_HPP
#include <stdint.h>
#include <string>
#include <vector>
#include <iostream>
extern "C"
{
//#include <x264.h>
#include <libswscale/swscale.h>
#include <libavcodec/avcodec.h>
#include <libavutil/mathematics.h>
#include <libavformat/avformat.h>
#include <libavutil/opt.h>
}
#pragma warning(disable:4996)
namespace laal
{
//! ============================================
//! [MovieMaker]
//! ============================================
class MovieWriter
{
const unsigned int m_nFrameWidth;
const unsigned int m_nFrameHeight;
unsigned int m_nFrameCount;
uint64_t m_nPtsCount;
SwsContext* m_pSWSCtx;
AVOutputFormat* m_pOutputFormat;
AVStream* m_pStream;
AVFormatContext* m_pFormatCtx;
AVCodecContext* m_pCodecCtx;
AVPacket m_Packet;
AVFrame* m_pInputFrame;
AVFrame* m_pOutputFrame;
public:
MovieWriter(const std::string& filename, const unsigned int width, const unsigned int height);
void AddFrame(const uint8_t* pixels);
~MovieWriter();
};
class MovieReader
{
const unsigned int width, height;
SwsContext* swsCtx;
AVOutputFormat* fmt;
AVStream* stream;
AVFormatContext* fc;
AVCodecContext* c;
AVFrame* pFrame;
AVFrame* pFrameRGB;
// The index of video stream.
int ivstream;
public:
MovieReader(const std::string& filename, const unsigned int width, const unsigned int height);
bool GetFrame(std::vector<uint8_t>& pixels);
~MovieReader();
};
}
#endif // !LAAL_MOVIE_MAKER_HPP
| 16.688172 | 96 | 0.675258 |
e986fe267e9a9043d13c8e7d650dbfa0cfcee89c | 388 | h | C | XVim2/XcodeHeader/IDEKit/IDEDebugGaugeReportContentDelegate-Protocol.h | haozhiyu1990/XVim2 | 3f37d905d51c22fbd86c36e42d8ee1813829b00c | [
"MIT"
] | 2,453 | 2017-09-07T00:07:49.000Z | 2022-03-29T22:32:10.000Z | XVim2/XcodeHeader/IDEKit/IDEDebugGaugeReportContentDelegate-Protocol.h | haozhiyu1990/XVim2 | 3f37d905d51c22fbd86c36e42d8ee1813829b00c | [
"MIT"
] | 373 | 2017-09-20T04:16:11.000Z | 2022-03-26T17:01:37.000Z | XVim2/XcodeHeader/IDEKit/IDEDebugGaugeReportContentDelegate-Protocol.h | haozhiyu1990/XVim2 | 3f37d905d51c22fbd86c36e42d8ee1813829b00c | [
"MIT"
] | 260 | 2017-09-16T15:31:41.000Z | 2022-02-07T02:52:29.000Z | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <IDEKit/NSObject-Protocol.h>
@class DVTStackView_AppKitAutolayout;
@protocol IDEDebugGaugeReportContentDelegate <NSObject>
- (BOOL)hasDefaultTopSection;
@optional
- (void)addSectionsToView:(DVTStackView_AppKitAutolayout *)arg1;
@end
| 21.555556 | 90 | 0.755155 |
6b3ebb979e044da232674bc2ff9231e47008263b | 510 | h | C | Other/Headers/SecondMsgNode.h | XWJACK/WeChatPlugin-MacOS | 4241ddb10ccce9484fcf6d5bd51a6afa3b446632 | [
"MIT"
] | 2 | 2019-01-11T02:02:55.000Z | 2020-04-23T02:42:01.000Z | Other/Headers/SecondMsgNode.h | XWJACK/WeChatPlugin-MacOS | 4241ddb10ccce9484fcf6d5bd51a6afa3b446632 | [
"MIT"
] | null | null | null | Other/Headers/SecondMsgNode.h | XWJACK/WeChatPlugin-MacOS | 4241ddb10ccce9484fcf6d5bd51a6afa3b446632 | [
"MIT"
] | 1 | 2021-01-09T14:54:27.000Z | 2021-01-09T14:54:27.000Z | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
#import "NSCopying-Protocol.h"
@class NSString;
@interface SecondMsgNode : NSObject <NSCopying>
{
NSString *_uuid;
}
@property(retain, nonatomic) NSString *uuid; // @synthesize uuid=_uuid;
- (void).cxx_destruct;
- (id)encodeNodeToXMLString;
- (id)copyWithZone:(struct _NSZone *)arg1;
@end
| 20.4 | 90 | 0.696078 |
271a93fd17f1ece7d97fc7a325385d0733f66228 | 821 | h | C | src_main/launcher/vcr_helpers.h | ArcadiusGFN/SourceEngine2007 | 51cd6d4f0f9ed901cb9b61456eb621a50ce44f55 | [
"bzip2-1.0.6"
] | 25 | 2018-02-28T15:04:42.000Z | 2021-08-16T03:49:00.000Z | src_main/launcher/vcr_helpers.h | ArcadiusGFN/SourceEngine2007 | 51cd6d4f0f9ed901cb9b61456eb621a50ce44f55 | [
"bzip2-1.0.6"
] | 1 | 2019-09-20T11:06:03.000Z | 2019-09-20T11:06:03.000Z | src_main/launcher/vcr_helpers.h | ArcadiusGFN/SourceEngine2007 | 51cd6d4f0f9ed901cb9b61456eb621a50ce44f55 | [
"bzip2-1.0.6"
] | 9 | 2019-07-31T11:58:20.000Z | 2021-08-31T11:18:15.000Z | // Copyright © 1996-2018, Valve Corporation, All rights reserved.
#ifndef SOURCE_LAUNCHER_VCR_HELPERS_H_
#define SOURCE_LAUNCHER_VCR_HELPERS_H_
#include <tuple>
#include "base/include/base_types.h"
#include "base/include/windows/windows_errno_info.h"
#include "base/include/windows/windows_light.h"
#include "tier0/include/icommandline.h"
#include "tier0/include/vcrmode.h"
class VCRHelpers : public IVCRHelpers {
public:
void ErrorMessage(const ch *message) override {
NOVCR(MessageBoxA(nullptr, message, "Awesome Launcher - VCR Error",
MB_OK | MB_ICONERROR));
}
void *GetMainWindow() override { return nullptr; }
};
std::tuple<VCRHelpers, source::windows::windows_errno_code> BootstrapVCRHelpers(
const ICommandLine *command_line);
#endif // !SOURCE_LAUNCHER_VCR_HELPERS_H_
| 29.321429 | 80 | 0.756395 |
075f75ef344656a670a82893c2068e44a5b842d8 | 707 | h | C | src/base/tkernel_utils.h | drhlxiao/mayo | b4f0ed040030706629f34d953c58a73de2a2e0cd | [
"BSD-2-Clause"
] | 1 | 2021-06-17T12:48:50.000Z | 2021-06-17T12:48:50.000Z | src/base/tkernel_utils.h | drhlxiao/mayo | b4f0ed040030706629f34d953c58a73de2a2e0cd | [
"BSD-2-Clause"
] | null | null | null | src/base/tkernel_utils.h | drhlxiao/mayo | b4f0ed040030706629f34d953c58a73de2a2e0cd | [
"BSD-2-Clause"
] | 1 | 2021-06-17T12:48:51.000Z | 2021-06-17T12:48:51.000Z | /****************************************************************************
** Copyright (c) 2020, Fougue Ltd. <http://www.fougue.pro>
** All rights reserved.
** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt
****************************************************************************/
#pragma once
#include <Standard_Handle.hxx>
#include <Standard_Version.hxx>
#ifndef OCC_VERSION_CHECK
# define OCC_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
#endif
namespace Mayo {
class TKernelUtils {
public:
template<typename STD_TRANSIENT>
opencascade::handle<STD_TRANSIENT> makeHandle(const STD_TRANSIENT* ptr) { return ptr; }
};
} // namespace Mayo
| 28.28 | 91 | 0.572843 |
b8786d7993bbb7dae64d184c4968f6282c13310f | 272 | h | C | TestFramework/AppDelegate.h | SurajPokkt/UploadSDKFile | a73f05ee92961bf50c36bce2fddcc11d97653301 | [
"MIT"
] | null | null | null | TestFramework/AppDelegate.h | SurajPokkt/UploadSDKFile | a73f05ee92961bf50c36bce2fddcc11d97653301 | [
"MIT"
] | null | null | null | TestFramework/AppDelegate.h | SurajPokkt/UploadSDKFile | a73f05ee92961bf50c36bce2fddcc11d97653301 | [
"MIT"
] | null | null | null | //
// AppDelegate.h
// TestFramework
//
// Created by Pokkt on 05/04/17.
// Copyright © 2017 Pokkt. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| 15.111111 | 60 | 0.702206 |
ef716a1528407eb59724e978e59c79d24ed7d5a9 | 6,437 | c | C | tmp1/c55x-sim2/foo/c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v3.3_examples/pll/csl_pll_example.c | jwestmoreland/eZdsp-DBG-sim | f6eacd75d4f928dec9c751545e9e919d052e4ade | [
"MIT"
] | 1 | 2020-08-27T11:31:13.000Z | 2020-08-27T11:31:13.000Z | tmp1/c55x-sim2/foo/c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v3.3_examples/pll/csl_pll_example.c | jwestmoreland/eZdsp-DBG-sim | f6eacd75d4f928dec9c751545e9e919d052e4ade | [
"MIT"
] | null | null | null | tmp1/c55x-sim2/foo/c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v3.3_examples/pll/csl_pll_example.c | jwestmoreland/eZdsp-DBG-sim | f6eacd75d4f928dec9c751545e9e919d052e4ade | [
"MIT"
] | null | null | null | /* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005, 2008
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ============================================================================
*/
/** @file csl_pll_example.c
*
* @brief PLL functional layer sample source file
*
*
* \page page12 CSL PLL EXAMPLE DOCUMENTATION
*
* \section PLL PLL EXAMPLE
*
* \subsection PLLx TEST DESCRIPTION:
* This test code verifies the functionality of CSL PLL module. PLL module
* on the C5505/C5515 DSP is used to generate clock for CPU and peripherals.
* A 32KHz input clock is supplied to the PLL using which different system clock
* values are generated. Different system clock values are generated by
* configuring the PLL to different divider values.
*
* During the test PLL module will be configured to the 60MHz clock frequency
* using PLL_config() API. Configured values are read back and verified using
* PLL_getConfig() APIs. All the values should match the configured values
* except the test lock mon value which will reflect on the registers only
* after the PLL is up. Values read from the PLL are displayed on the CCS
* "stdout" window. Manual inspection is required to verify the test success.
*
* C5515 DSP PLL register bit fileds are little different than that of C5505 DSP.
* Use the 'PLL_Config' values defined 12.288MHz - 120MHz to verify PLL
* configuration.
*
* NOTE: THIS TEST HAS BEEN DEVELOPED TO WORK WITH CHIP VERSIONS C5505 AND
* C5515. MAKE SURE THAT PROPER CHIP VERSION MACRO IS DEFINED IN THE FILE
* c55xx_csl\inc\csl_general.h.
*
* \subsection PLLy TEST PROCEDURE:
* @li Open the CCS and connect the target (C5505/C5515 EVM)
* @li Open the project "CSL_PLL_Example.pjt" and build it
* @li Load the program on to the target
* @li Run the program and observe the test result
* @li Repeat the test in Release mode
*
* \subsection PLLz TEST RESULT:
* @li All the CSL APIs should return success
* @li Configuration values read from the PLL should match with the actual
* configured values except the test lock mon value.
*
*/
/* ============================================================================
* Revision History
* ================
* 15-Sept-2008 Created
* ============================================================================
*/
#include<stdio.h>
#include "csl_pll.h"
#include "csl_general.h"
#include "csl_pllAux.h"
PLL_Obj pllObj;
PLL_Config pllCfg1;
PLL_Handle hPll;
#if (defined(CHIP_C5505_C5515) || defined(CHIP_C5504_C5514))
PLL_Config pllCfg_12p288MHz = {0x8173, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_40MHz = {0x8988, 0x8000, 0x0806, 0x0201};
PLL_Config pllCfg_60MHz = {0x8724, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_75MHz = {0x88ED, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_100MHz = {0x8BE8, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_120MHz = {0x8E4A, 0x8000, 0x0806, 0x0000};
#else
PLL_Config pllCfg_12p288MHz = {0x82ED, 0x8000, 0x0806, 0x0200};
PLL_Config pllCfg_40MHz = {0x8262, 0x8000, 0x0806, 0x0300};
PLL_Config pllCfg_60MHz = {0x81C8, 0xB000, 0x0806, 0x0000};
PLL_Config pllCfg_75MHz = {0x823B, 0x9000, 0x0806, 0x0000};
PLL_Config pllCfg_100MHz = {0x82FA, 0x8000, 0x0806, 0x0000};
PLL_Config pllCfg_120MHz = {0x8392, 0xA000, 0x0806, 0x0000};
#endif
PLL_Config *pConfigInfo;
#define CSL_TEST_FAILED (1)
#define CSL_TEST_PASSED (0)
CSL_Status pll_sample()
{
CSL_Status status;
status = PLL_init(&pllObj, CSL_PLL_INST_0);
if(CSL_SOK != status)
{
printf("PLL init failed \n");
return (status);
}
hPll = (PLL_Handle)(&pllObj);
PLL_reset(hPll);
/* Configure the PLL for 60MHz */
pConfigInfo = &pllCfg_60MHz;
status = PLL_config (hPll, pConfigInfo);
if(CSL_SOK != status)
{
printf("PLL config failed\n");
return(status);
}
status = PLL_getConfig(hPll, &pllCfg1);
if(status != CSL_SOK)
{
printf("TEST FAILED: PLL get config... Failed.\n");
printf ("Reason: PLL_getConfig failed. [status = 0x%x].\n", status);
return(status);
}
printf("REGISTER --- CONFIG VALUES\n");
printf("%04x --- %04x\n",pllCfg1.PLLCNTL1,hPll->pllConfig->PLLCNTL1);
printf("%04x --- %04x Test Lock Mon will get set after PLL is up\n",
pllCfg1.PLLCNTL2,hPll->pllConfig->PLLCNTL2);
printf("%04x --- %04x\n",pllCfg1.PLLINCNTL,hPll->pllConfig->PLLINCNTL);
printf("%04x --- %04x\n",pllCfg1.PLLOUTCNTL,hPll->pllConfig->PLLOUTCNTL);
status = PLL_bypass(hPll);
if(CSL_SOK != status)
{
printf("PLL bypass failed:%d\n",CSL_ESYS_BADHANDLE);
return(status);
}
status = PLL_enable(hPll);
if(CSL_SOK != status)
{
printf("PLL enable failed:%d\n",CSL_ESYS_BADHANDLE);
return(status);
}
return(CSL_TEST_PASSED);
}
/////INSTRUMENTATION FOR BATCH TESTING -- Part 1 --
///// Define PaSs_StAtE variable for catching errors as program executes.
///// Define PaSs flag for holding final pass/fail result at program completion.
volatile Int16 PaSs_StAtE = 0x0001; // Init to 1. Reset to 0 at any monitored execution error.
volatile Int16 PaSs = 0x0000; // Init to 0. Updated later with PaSs_StAtE when and if
///// program flow reaches expected exit point(s).
/////
void main(void)
{
CSL_Status status;
printf("CSL PLL TEST\n\n");
status = pll_sample();
if(status == CSL_TEST_PASSED)
{
printf("\nCSL PLL TEST PASSED\n");
}
else
{
printf("\nCSL PLL TEST FAILED\n");
/////INSTRUMENTATION FOR BATCH TESTING -- Part 2 --
///// Reseting PaSs_StAtE to 0 if error detected here.
PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
/////
}
/////INSTRUMENTATION FOR BATCH TESTING -- Part 3 --
///// At program exit, copy "PaSs_StAtE" into "PaSs".
PaSs = PaSs_StAtE; //If flow gets here, override PaSs' initial 0 with
///// // pass/fail value determined during program execution.
///// Note: Program should next exit to C$$EXIT and halt, where DSS, under
///// control of a host PC script, will read and record the PaSs' value.
/////
}
| 33.878947 | 102 | 0.643001 |
33236c497e304032b8227d0d57763cb17483ffc3 | 32,157 | h | C | third_party/virtualbox/include/iprt/cpp/list.h | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 521 | 2019-03-29T15:44:08.000Z | 2022-03-22T09:46:19.000Z | third_party/virtualbox/include/iprt/cpp/list.h | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 30 | 2019-06-04T17:00:49.000Z | 2021-09-08T20:44:19.000Z | third_party/virtualbox/include/iprt/cpp/list.h | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 99 | 2019-03-29T16:04:13.000Z | 2022-03-28T16:59:34.000Z | /** @file
* IPRT - Generic List Class.
*/
/*
* Copyright (C) 2011-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___iprt_cpp_list_h
#define ___iprt_cpp_list_h
#include <iprt/cpp/meta.h>
#include <iprt/mem.h>
#include <iprt/string.h> /* for memcpy */
#include <iprt/assert.h>
#include <new> /* For std::bad_alloc */
/** @defgroup grp_rt_cpp_list C++ List support
* @ingroup grp_rt_cpp
*
* @brief Generic C++ list class support.
*
* This list classes manage any amount of data in a fast and easy to use way.
* They have no dependencies on STL, only on generic memory management methods
* of IRPT. This allows list handling in situations where the use of STL
* container classes is forbidden.
*
* Not all of the functionality of STL container classes is implemented. There
* are no iterators or any other high level access/modifier methods (e.g.
* std::algorithms).
*
* The implementation is array based which allows fast access to the items.
* Appending items is usually also fast, cause the internal array is
* preallocated. To minimize the memory overhead, native types (that is
* everything smaller then the size of void*) are directly saved in the array.
* If bigger types are used (e.g. RTCString) the internal array is an array of
* pointers to the objects.
*
* The size of the internal array will usually not shrink, but grow
* automatically. Only certain methods, like RTCList::clear or the "=" operator
* will reset any previously allocated memory. You can call
* RTCList::setCapacity for manual adjustment. If the size of an new list will
* be known, calling the constructor with the necessary capacity will speed up
* the insertion of the new items.
*
* For the full public interface these list classes offer see RTCListBase.
*
* There are some requirements for the types used which follow:
* -# They need a default and a copy constructor.
* -# Some methods (e.g. RTCList::contains) need an equal operator.
* -# If the type is some complex class (that is, having a constructor which
* allocates members on the heap) it has to be greater than sizeof(void*) to
* be used correctly. If this is not the case you can manually overwrite the
* list behavior. Just add T* as a second parameter to the list template if
* your class is called T. Another possibility is to specialize the list for
* your target class. See below for more information.
*
* The native types like int, bool, ptr, ..., are meeting this criteria, so
* they are save to use.
*
* Please note that the return type of some of the getter methods are slightly
* different depending on the list type. Native types return the item by value,
* items with a size greater than sizeof(void*) by reference. As native types
* saved directly in the internal array, returning a reference to them (and
* saving them in a reference as well) would make them invalid (or pointing to
* a wrong item) when the list is changed in the meanwhile. Returning a
* reference for bigger types isn't problematic and makes sure we get out the
* best speed of the list. The one exception to this rule is the index
* operator[]. This operator always return a reference to make it possible to
* use it as a lvalue. Its your responsibility to make sure the list isn't
* changed when using the value as reference returned by this operator.
*
* The list class is reentrant. For a thread-safe variant see RTCMTList.
*
* Implementation details:
* It is possible to specialize any type. This might be necessary to get the
* best speed out of the list. Examples are the 64-bit types, which use the
* native (no pointers) implementation even on a 32-bit host. Consult the
* source code for more details.
*
* Current specialized implementations:
* - int64_t: RTCList<int64_t>
* - uint64_t: RTCList<uint64_t>
*
* @{
*/
/**
* The guard definition.
*/
template <bool G>
class RTCListGuard;
/**
* The default guard which does nothing.
*/
template <>
class RTCListGuard<false>
{
public:
inline void enterRead() const {}
inline void leaveRead() const {}
inline void enterWrite() {}
inline void leaveWrite() {}
/* Define our own new and delete. */
RTMEMEF_NEW_AND_DELETE_OPERATORS();
};
/**
* General helper template for managing native values in RTCListBase.
*/
template <typename T1, typename T2>
class RTCListHelper
{
public:
static inline void set(T2 *p, size_t i, const T1 &v) { p[i] = v; }
static inline T1 & at(T2 *p, size_t i) { return p[i]; }
static inline const T1 &atConst(T2 const *p, size_t i) { return p[i]; }
static inline size_t find(T2 *p, const T1 &v, size_t cElements)
{
size_t i = cElements;
while (i-- > 0)
if (p[i] == v)
return i;
return cElements;
}
static inline void copyTo(T2 *p, T2 *const p1 , size_t iTo, size_t cSize)
{
if (cSize > 0)
memcpy(&p[iTo], &p1[0], sizeof(T1) * cSize);
}
static inline void erase(T2 * /* p */, size_t /* i */) { /* Nothing to do here. */ }
static inline void eraseRange(T2 * /* p */, size_t /* cFrom */, size_t /* cSize */) { /* Nothing to do here. */ }
};
/**
* Specialized helper template for managing pointer values in RTCListBase.
*/
template <typename T1>
class RTCListHelper<T1, T1*>
{
public:
static inline void set(T1 **p, size_t i, const T1 &v) { p[i] = new T1(v); }
static inline T1 & at(T1 **p, size_t i) { return *p[i]; }
static inline const T1 &atConst(T1 * const *p, size_t i) { return *p[i]; }
static inline size_t find(T1 **p, const T1 &v, size_t cElements)
{
size_t i = cElements;
while (i-- > 0)
if (*p[i] == v)
return i;
return cElements;
}
static inline void copyTo(T1 **p, T1 **const p1 , size_t iTo, size_t cSize)
{
for (size_t i = 0; i < cSize; ++i)
p[iTo + i] = new T1(*p1[i]);
}
static inline void erase(T1 **p, size_t i) { delete p[i]; }
static inline void eraseRange(T1 **p, size_t iFrom, size_t cItems)
{
while (cItems-- > 0)
delete p[iFrom++];
}
};
/**
* This is the base class for all other list classes. It implements the
* necessary list functionality in a type independent way and offers the public
* list interface to the user.
*/
template <class T, typename ITYPE, bool MT>
class RTCListBase
{
/** @name Traits.
*
* Defines the return type of most of the getter methods. If the internal
* used type is a pointer, we return a reference. If not we return by
* value.
*
* @{
*/
typedef typename RTCIfPtr<ITYPE, T&, T>::result GET_RTYPE;
typedef typename RTCIfPtr<ITYPE, const T&, T>::result GET_CRTYPE;
/** @} */
public:
/**
* Creates a new list.
*
* This preallocates @a cCapacity elements within the list.
*
* @param cCapacity The initial capacity the list has.
* @throws std::bad_alloc
*/
RTCListBase(size_t cCapacity = kDefaultCapacity)
: m_pArray(0)
, m_cElements(0)
, m_cCapacity(0)
{
if (cCapacity > 0)
growArray(cCapacity);
}
/**
* Creates a copy of another list.
*
* The other list will be fully copied and the capacity will be the same as
* the size of the other list.
*
* @param other The list to copy.
* @throws std::bad_alloc
*/
RTCListBase(const RTCListBase<T, ITYPE, MT>& other)
: m_pArray(0)
, m_cElements(0)
, m_cCapacity(0)
{
other.m_guard.enterRead();
size_t const cElementsOther = other.m_cElements;
resizeArrayNoErase(cElementsOther);
RTCListHelper<T, ITYPE>::copyTo(m_pArray, other.m_pArray, 0, cElementsOther);
m_cElements = cElementsOther;
other.m_guard.leaveRead();
}
/**
* Destructor.
*/
~RTCListBase()
{
RTCListHelper<T, ITYPE>::eraseRange(m_pArray, 0, m_cElements);
if (m_pArray)
{
RTMemFree(m_pArray);
m_pArray = NULL;
}
m_cElements = m_cCapacity = 0;
}
/**
* Sets a new capacity within the list.
*
* If the new capacity is bigger than the old size, it will be simply
* preallocated more space for the new items. If the new capacity is
* smaller than the previous size, items at the end of the list will be
* deleted.
*
* @param cCapacity The new capacity within the list.
* @throws std::bad_alloc
*/
void setCapacity(size_t cCapacity)
{
m_guard.enterWrite();
resizeArray(cCapacity);
m_guard.leaveWrite();
}
/**
* Return the current capacity of the list.
*
* @return The actual capacity.
*/
size_t capacity() const
{
m_guard.enterRead();
size_t cRet = m_cCapacity;
m_guard.leaveRead();
return cRet;
}
/**
* Check if an list contains any items.
*
* @return True if there is more than zero items, false otherwise.
*/
bool isEmpty() const
{
m_guard.enterRead();
bool fEmpty = m_cElements == 0;
m_guard.leaveRead();
return fEmpty;
}
/**
* Return the current count of elements within the list.
*
* @return The current element count.
*/
size_t size() const
{
m_guard.enterRead();
size_t cRet = m_cElements;
m_guard.leaveRead();
return cRet;
}
/**
* Inserts an item to the list at position @a i.
*
* @param i The position of the new item. The must be within or at the
* exact end of the list. Indexes specified beyond the end of
* the list will be changed to an append() operation and strict
* builds will raise an assert.
* @param val The new item.
* @return a reference to this list.
* @throws std::bad_alloc
*/
RTCListBase<T, ITYPE, MT> &insert(size_t i, const T &val)
{
m_guard.enterWrite();
AssertMsgStmt(i <= m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements), i = m_cElements);
if (m_cElements == m_cCapacity)
growArray(m_cCapacity + kDefaultCapacity);
memmove(&m_pArray[i + 1], &m_pArray[i], (m_cElements - i) * sizeof(ITYPE));
RTCListHelper<T, ITYPE>::set(m_pArray, i, val);
++m_cElements;
m_guard.leaveWrite();
return *this;
}
/**
* Inserts a list to the list at position @a i.
*
* @param i The position of the new item. The must be within or at the
* exact end of the list. Indexes specified beyond the end of
* the list will be changed to an append() operation and strict
* builds will raise an assert.
* @param other The other list. This MUST not be the same as the destination
* list, will assert and return without doing anything if this
* happens.
* @return a reference to this list.
* @throws std::bad_alloc
*/
RTCListBase<T, ITYPE, MT> &insert(size_t i, const RTCListBase<T, ITYPE, MT> &other)
{
AssertReturn(this != &other, *this);
other.m_guard.enterRead();
m_guard.enterWrite();
AssertMsgStmt(i <= m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements), i = m_cElements);
size_t cElementsOther = other.m_cElements;
if (RT_LIKELY(cElementsOther > 0))
{
if (m_cCapacity - m_cElements < cElementsOther)
growArray(m_cCapacity + (cElementsOther - (m_cCapacity - m_cElements)));
if (i < m_cElements)
memmove(&m_pArray[i + cElementsOther], &m_pArray[i], (m_cElements - i) * sizeof(ITYPE));
RTCListHelper<T, ITYPE>::copyTo(&m_pArray[i], other.m_pArray, 0, cElementsOther);
m_cElements += cElementsOther;
}
m_guard.leaveWrite();
other.m_guard.leaveRead();
return *this;
}
/**
* Prepend an item to the list.
*
* @param val The new item.
* @return a reference to this list.
* @throws std::bad_alloc
*/
RTCListBase<T, ITYPE, MT> &prepend(const T &val)
{
return insert(0, val);
}
/**
* Prepend a list of type T to the list.
*
* @param other The list to prepend.
* @return a reference to this list.
* @throws std::bad_alloc
*/
RTCListBase<T, ITYPE, MT> &prepend(const RTCListBase<T, ITYPE, MT> &other)
{
return insert(0, other);
}
/**
* Append a default item to the list.
*
* @return a mutable reference to the item
* @throws std::bad_alloc
*/
GET_RTYPE append()
{
m_guard.enterWrite();
if (m_cElements == m_cCapacity)
growArray(m_cCapacity + kDefaultCapacity);
RTCListHelper<T, ITYPE>::set(m_pArray, m_cElements, T());
GET_RTYPE rRet = RTCListHelper<T, ITYPE>::at(m_pArray, m_cElements);
++m_cElements;
m_guard.leaveWrite();
return rRet;
}
/**
* Append an item to the list.
*
* @param val The new item.
* @return a reference to this list.
* @throws std::bad_alloc
*/
RTCListBase<T, ITYPE, MT> &append(const T &val)
{
m_guard.enterWrite();
if (m_cElements == m_cCapacity)
growArray(m_cCapacity + kDefaultCapacity);
RTCListHelper<T, ITYPE>::set(m_pArray, m_cElements, val);
++m_cElements;
m_guard.leaveWrite();
return *this;
}
/**
* Append a list of type T to the list.
*
* @param other The list to append. Must not be the same as the destination
* list, will assert and return without doing anything.
* @return a reference to this list.
* @throws std::bad_alloc
*/
RTCListBase<T, ITYPE, MT> &append(const RTCListBase<T, ITYPE, MT> &other)
{
AssertReturn(this != &other, *this);
other.m_guard.enterRead();
m_guard.enterWrite();
insert(m_cElements, other);
m_guard.leaveWrite();
other.m_guard.leaveRead();
return *this;
}
/**
* Copy the items of the other list into this list.
*
* All previous items of this list are deleted.
*
* @param other The list to copy.
* @return a reference to this list.
*/
RTCListBase<T, ITYPE, MT> &operator=(const RTCListBase<T, ITYPE, MT>& other)
{
/* Prevent self assignment */
if (RT_LIKELY(this != &other))
{
other.m_guard.enterRead();
m_guard.enterWrite();
/* Delete all items. */
RTCListHelper<T, ITYPE>::eraseRange(m_pArray, 0, m_cElements);
/* Need we to realloc memory. */
if (other.m_cElements != m_cCapacity)
resizeArrayNoErase(other.m_cElements);
m_cElements = other.m_cElements;
/* Copy new items. */
RTCListHelper<T, ITYPE>::copyTo(m_pArray, other.m_pArray, 0, other.m_cElements);
m_guard.leaveWrite();
other.m_guard.leaveRead();
}
return *this;
}
/**
* Replace an item in the list.
*
* @param i The position of the item to replace. If this is out of range,
* the request will be ignored, strict builds will assert.
* @param val The new value.
* @return a reference to this list.
*/
RTCListBase<T, ITYPE, MT> &replace(size_t i, const T &val)
{
m_guard.enterWrite();
if (i < m_cElements)
{
RTCListHelper<T, ITYPE>::erase(m_pArray, i);
RTCListHelper<T, ITYPE>::set(m_pArray, i, val);
}
else
AssertMsgFailed(("i=%zu m_cElements=%zu\n", i, m_cElements));
m_guard.leaveWrite();
return *this;
}
/**
* Return the first item as constant object.
*
* @return A reference or pointer to the first item.
*
* @note No boundary checks are done. Make sure there is at least one
* element.
*/
GET_CRTYPE first() const
{
m_guard.enterRead();
Assert(m_cElements > 0);
GET_CRTYPE res = RTCListHelper<T, ITYPE>::at(m_pArray, 0);
m_guard.leaveRead();
return res;
}
/**
* Return the first item.
*
* @return A reference or pointer to the first item.
*
* @note No boundary checks are done. Make sure there is at least one
* element.
*/
GET_RTYPE first()
{
m_guard.enterRead();
Assert(m_cElements > 0);
GET_RTYPE res = RTCListHelper<T, ITYPE>::at(m_pArray, 0);
m_guard.leaveRead();
return res;
}
/**
* Return the last item as constant object.
*
* @return A reference or pointer to the last item.
*
* @note No boundary checks are done. Make sure there is at least one
* element.
*/
GET_CRTYPE last() const
{
m_guard.enterRead();
Assert(m_cElements > 0);
GET_CRTYPE res = RTCListHelper<T, ITYPE>::at(m_pArray, m_cElements - 1);
m_guard.leaveRead();
return res;
}
/**
* Return the last item.
*
* @return A reference or pointer to the last item.
*
* @note No boundary checks are done. Make sure there is at least one
* element.
*/
GET_RTYPE last()
{
m_guard.enterRead();
Assert(m_cElements > 0);
GET_RTYPE res = RTCListHelper<T, ITYPE>::at(m_pArray, m_cElements - 1);
m_guard.leaveRead();
return res;
}
/**
* Return the item at position @a i as constant object.
*
* @param i The position of the item to return. This better not be out of
* bounds, however should it be the last element of the array
* will be return and strict builds will raise an assertion.
* Should the array be empty, a crash is very likely.
* @return The item at position @a i.
*/
GET_CRTYPE at(size_t i) const
{
m_guard.enterRead();
AssertMsgStmt(i < m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements), i = m_cElements - 1);
GET_CRTYPE res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
m_guard.leaveRead();
return res;
}
/**
* Return the item at position @a i.
*
* @param i The position of the item to return. This better not be out of
* bounds, however should it be the last element of the array
* will be return and strict builds will raise an assertion.
* Should the array be empty, a crash is very likely.
* @return The item at position @a i.
*/
GET_RTYPE at(size_t i)
{
m_guard.enterRead();
AssertMsgStmt(i < m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements), i = m_cElements - 1);
GET_RTYPE res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
m_guard.leaveRead();
return res;
}
/**
* Return the item at position @a i as mutable reference.
*
* @param i The position of the item to return. This better not be out of
* bounds, however should it be the last element of the array
* will be return and strict builds will raise an assertion.
* Should the array be empty, a crash is very likely.
* @return The item at position @a i.
*/
T &operator[](size_t i)
{
m_guard.enterRead();
AssertMsgStmt(i < m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements), i = m_cElements - 1);
T &res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
m_guard.leaveRead();
return res;
}
/**
* Return the item at position @a i as immutable reference.
*
* @param i The position of the item to return. This better not be out of
* bounds, however should it be the last element of the array
* will be return and strict builds will raise an assertion.
* Should the array be empty, a crash is very likely.
* @return The item at position @a i.
*/
const T &operator[](size_t i) const
{
m_guard.enterRead();
AssertMsgStmt(i < m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements), i = m_cElements - 1);
const T &rRet = RTCListHelper<T, ITYPE>::atConst(m_pArray, i);
m_guard.leaveRead();
return rRet;
}
/**
* Return a copy of the item at position @a i or default value if out of range.
*
* @param i The position of the item to return.
* @return Copy of the item at position @a i or default value.
*/
T value(size_t i) const
{
m_guard.enterRead();
if (RT_LIKELY(i < m_cElements))
{
T res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
m_guard.leaveRead();
return res;
}
m_guard.leaveRead();
return T();
}
/**
* Return a copy of the item at position @a i, or @a defaultVal if out of range.
*
* @param i The position of the item to return.
* @param defaultVal The value to return in case @a i is invalid.
* @return Copy of the item at position @a i or @a defaultVal.
*/
T value(size_t i, const T &defaultVal) const
{
m_guard.enterRead();
if (RT_LIKELY(i < m_cElements))
{
T res = RTCListHelper<T, ITYPE>::at(m_pArray, i);
m_guard.leaveRead();
return res;
}
m_guard.leaveRead();
return defaultVal;
}
/**
* Check if @a val is contained in the array.
*
* @param val The value to check for.
* @return true if it is found, false otherwise.
*/
bool contains(const T &val) const
{
m_guard.enterRead();
bool fRc = RTCListHelper<T, ITYPE>::find(m_pArray, val, m_cElements) < m_cElements;
m_guard.leaveRead();
return fRc;
}
/**
* Remove the first item.
*
* @note You should make sure the list isn't empty. Strict builds will assert.
* The other builds will quietly ignore the request.
*/
void removeFirst()
{
removeAt(0);
}
/**
* Remove the last item.
*
* @note You should make sure the list isn't empty. Strict builds will assert.
* The other builds will quietly ignore the request.
*/
void removeLast()
{
m_guard.enterWrite();
removeAtLocked(m_cElements - 1);
m_guard.leaveWrite();
}
/**
* Remove the item at position @a i.
*
* @param i The position of the item to remove. Out of bounds values will
* be ignored and an assertion will be raised in strict builds.
*/
void removeAt(size_t i)
{
m_guard.enterWrite();
removeAtLocked(i);
m_guard.leaveWrite();
}
/**
* Remove a range of items from the list.
*
* @param iStart The start position of the items to remove.
* @param iEnd The end position of the items to remove (excluded).
*/
void removeRange(size_t iStart, size_t iEnd)
{
AssertReturnVoid(iStart <= iEnd);
m_guard.enterWrite();
AssertMsgStmt(iEnd <= m_cElements, ("iEnd=%zu m_cElements=%zu\n", iEnd, m_cElements), iEnd = m_cElements);
AssertMsgStmt(iStart < m_cElements, ("iStart=%zu m_cElements=%zu\n", iStart, m_cElements), iStart = m_cElements);
size_t const cElements = iEnd - iStart;
if (cElements > 0)
{
Assert(iStart < m_cElements);
RTCListHelper<T, ITYPE>::eraseRange(m_pArray, iStart, cElements);
if (m_cElements > iEnd)
memmove(&m_pArray[iStart], &m_pArray[iEnd], (m_cElements - iEnd) * sizeof(ITYPE));
m_cElements -= cElements;
}
m_guard.leaveWrite();
}
/**
* Delete all items in the list.
*/
void clear()
{
m_guard.enterWrite();
/* Values cleanup */
RTCListHelper<T, ITYPE>::eraseRange(m_pArray, 0, m_cElements);
if (m_cElements != kDefaultCapacity)
resizeArrayNoErase(kDefaultCapacity);
m_cElements = 0;
m_guard.leaveWrite();
}
/**
* Return the raw array.
*
* For native types this is a pointer to continuous memory of the items. For
* pointer types this is a continuous memory of pointers to the items.
*
* @warning If you change anything in the underlaying list, this memory
* will very likely become invalid. So take care when using this
* method and better try to avoid using it.
*
* @returns the raw memory.
*/
ITYPE *raw() const
{
m_guard.enterRead();
ITYPE *pRet = m_pArray;
m_guard.leaveRead();
return pRet;
}
RTCListBase<T, ITYPE, MT> &operator<<(const T &val)
{
return append(val);
}
/* Define our own new and delete. */
RTMEMEF_NEW_AND_DELETE_OPERATORS();
/**
* The default capacity of the list. This is also used as grow factor.
*/
static const size_t kDefaultCapacity;
protected:
/**
* Generic resizes the array, surplus elements are erased.
*
* @param cElementsNew The new array size.
* @throws std::bad_alloc.
*/
void resizeArray(size_t cElementsNew)
{
/* Same size? */
if (cElementsNew == m_cCapacity)
return;
/* If we get smaller we have to delete some of the objects at the end
of the list. */
if ( cElementsNew < m_cElements
&& m_pArray)
RTCListHelper<T, ITYPE>::eraseRange(m_pArray, cElementsNew, m_cElements - cElementsNew);
resizeArrayNoErase(cElementsNew);
}
/**
* Resizes the array without doing the erase() thing on surplus elements.
*
* @param cElementsNew The new array size.
* @throws std::bad_alloc.
*/
void resizeArrayNoErase(size_t cElementsNew)
{
/* Same size? */
if (cElementsNew == m_cCapacity)
return;
/* Resize the array. */
if (cElementsNew > 0)
{
void *pvNew = RTMemRealloc(m_pArray, sizeof(ITYPE) * cElementsNew);
if (!pvNew)
{
#ifdef RT_EXCEPTIONS_ENABLED
throw std::bad_alloc();
#endif
return;
}
m_pArray = static_cast<ITYPE*>(pvNew);
}
/* If we get zero we delete the array it self. */
else if (m_pArray)
{
RTMemFree(m_pArray);
m_pArray = NULL;
}
m_cCapacity = cElementsNew;
if (m_cElements > cElementsNew)
m_cElements = cElementsNew;
}
/**
* Special realloc method which require that the array will grow.
*
* @param cElementsNew The new array size.
* @throws std::bad_alloc.
* @note No boundary checks are done!
*/
void growArray(size_t cElementsNew)
{
Assert(cElementsNew > m_cCapacity);
void *pvNew = RTMemRealloc(m_pArray, sizeof(ITYPE) * cElementsNew);
if (pvNew)
{
m_cCapacity = cElementsNew;
m_pArray = static_cast<ITYPE*>(pvNew);
}
else
{
#ifdef RT_EXCEPTIONS_ENABLED
throw std::bad_alloc();
#endif
}
}
/**
* Remove the item at position @a i.
*
* @param i The position of the item to remove. Out of bounds values will
* be ignored and an assertion will be raised in strict builds.
* @remarks
*/
void removeAtLocked(size_t i)
{
AssertMsgReturnVoid(i < m_cElements, ("i=%zu m_cElements=%zu\n", i, m_cElements));
RTCListHelper<T, ITYPE>::erase(m_pArray, i);
if (i < m_cElements - 1)
memmove(&m_pArray[i], &m_pArray[i + 1], (m_cElements - i - 1) * sizeof(ITYPE));
--m_cElements;
}
/** The internal list array. */
ITYPE *m_pArray;
/** The current count of items in use. */
size_t m_cElements;
/** The current capacity of the internal array. */
size_t m_cCapacity;
/** The guard used to serialize the access to the items. */
RTCListGuard<MT> m_guard;
};
template <class T, typename ITYPE, bool MT>
const size_t RTCListBase<T, ITYPE, MT>::kDefaultCapacity = 10;
/**
* Template class which automatically determines the type of list to use.
*
* @see RTCListBase
*/
template <class T, typename ITYPE = typename RTCIf<(sizeof(T) > sizeof(void*)), T*, T>::result>
class RTCList : public RTCListBase<T, ITYPE, false>
{
/* Traits */
typedef RTCListBase<T, ITYPE, false> BASE;
public:
/**
* Creates a new list.
*
* This preallocates @a cCapacity elements within the list.
*
* @param cCapacity The initial capacity the list has.
* @throws std::bad_alloc
*/
RTCList(size_t cCapacity = BASE::kDefaultCapacity)
: BASE(cCapacity) {}
RTCList(const BASE &other)
: BASE(other) {}
/* Define our own new and delete. */
RTMEMEF_NEW_AND_DELETE_OPERATORS();
};
/**
* Specialized class for using the native type list for unsigned 64-bit
* values even on a 32-bit host.
*
* @see RTCListBase
*/
template <>
class RTCList<uint64_t>: public RTCListBase<uint64_t, uint64_t, false>
{
/* Traits */
typedef RTCListBase<uint64_t, uint64_t, false> BASE;
public:
/**
* Creates a new list.
*
* This preallocates @a cCapacity elements within the list.
*
* @param cCapacity The initial capacity the list has.
* @throws std::bad_alloc
*/
RTCList(size_t cCapacity = BASE::kDefaultCapacity)
: BASE(cCapacity) {}
/* Define our own new and delete. */
RTMEMEF_NEW_AND_DELETE_OPERATORS();
};
/**
* Specialized class for using the native type list for signed 64-bit
* values even on a 32-bit host.
*
* @see RTCListBase
*/
template <>
class RTCList<int64_t>: public RTCListBase<int64_t, int64_t, false>
{
/* Traits */
typedef RTCListBase<int64_t, int64_t, false> BASE;
public:
/**
* Creates a new list.
*
* This preallocates @a cCapacity elements within the list.
*
* @param cCapacity The initial capacity the list has.
* @throws std::bad_alloc
*/
RTCList(size_t cCapacity = BASE::kDefaultCapacity)
: BASE(cCapacity) {}
/* Define our own new and delete. */
RTMEMEF_NEW_AND_DELETE_OPERATORS();
};
/** @} */
#endif /* !___iprt_cpp_list_h */
| 30.979769 | 122 | 0.594987 |
47110dd0119cbccd5cf2e8d94976175fd7f08713 | 46 | c | C | 04-01function.c | jaorduz/c-prgrmmng-FESAc | a94eb51179752e7185c2ed73ca5bd8d58fb9bdf3 | [
"MIT"
] | 6 | 2017-10-23T17:17:43.000Z | 2018-08-12T00:16:12.000Z | 04-01function.c | jaorduz/c-prgrmmng-FESAc | a94eb51179752e7185c2ed73ca5bd8d58fb9bdf3 | [
"MIT"
] | null | null | null | 04-01function.c | jaorduz/c-prgrmmng-FESAc | a94eb51179752e7185c2ed73ca5bd8d58fb9bdf3 | [
"MIT"
] | 4 | 2017-08-09T15:48:56.000Z | 2021-04-27T21:00:10.000Z | float suma(float x, float y){
return x+y;
}
| 7.666667 | 29 | 0.630435 |
eda1bfa414ddab82e842449760943411093aab07 | 3,358 | h | C | source/include/entities/VisualEntity.h | chromaScript/chroma.io | c484354df6f3c84a049ffadfe37c677c0ccb6390 | [
"MIT"
] | null | null | null | source/include/entities/VisualEntity.h | chromaScript/chroma.io | c484354df6f3c84a049ffadfe37c677c0ccb6390 | [
"MIT"
] | null | null | null | source/include/entities/VisualEntity.h | chromaScript/chroma.io | c484354df6f3c84a049ffadfe37c677c0ccb6390 | [
"MIT"
] | null | null | null | #ifndef VISUALENTITY_H
#define VISUALENTITY_H
#include <glm.hpp>
#include "../math/Color.h"
#include "../math/blend.h"
#include "../math/transform.h"
#include <memory>
class Shader;
class VisualEntity
{
private:
protected:
// Constructor / Destructor
VisualEntity() {}; // VisualEntity Constructor is blank. The final class in the visualEntity chain should have a specialized constructor
~VisualEntity();
// Property Variables
long UEID = 0; // Unique Entity ID
std::string name; // Object Display Name
glm::vec4 highlight = glm::vec4(0.0f, 0.0f, 0.0f, 0.0f); // Highlight color for UI
EntityTransform transform; // Position (XYZ): P2/P1 Corners (width, height, 0.0, 0.0): Roll Angle (z-axis)
glm::mat4 modelMatrix = glm::mat4(1.0f);
// Render Properties
int channelCount = 0;
BlendMode blendMode = BlendMode::normal;
std::shared_ptr<Shader> shader;
// Data variables
bool didInitializeData = false;
unsigned char* data = nullptr; // Raster data for the layer (Non-recoverable with undo/history)
unsigned char* composite = nullptr; // Preview data for the layer (Composite is made when layer is out of focus, for preview/faster rendering)
// Entity Vertex Data/Arrangement
float vertData[20] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
static const int vertData_size = sizeof(vertData);
unsigned int vertArrangement[6] =
{
0, 1, 3, // First Triangle
1, 2, 3 // Second Triangle
};
static const int vertArrangement_size = sizeof(vertArrangement);
const int attribStride = 5 * sizeof(float);
const int tAttribOffset = 3 * sizeof(float);
// Buffer IDs
unsigned int VAO = 0; // Vertex Array Object ID
unsigned int VBO = 0; // Vertex Buffer Object ID
unsigned int EBO = 0; // Elements Buffer Object ID
unsigned int TEX0 = 0; // Texture Buffer Object ID
public:
// UEID functions
void generateUEID();
long getUEID();
// Property Functions
std::string getName();
glm::vec4 getHighlightColor();
// Transform functions
void setTransform(glm::vec3 pos, Bounds rect, float angle);
void setTransform(glm::vec3 pos);
void setTransform(Bounds rect);
void setTransform(float angle);
void setTransform(int x1, int y1, int x2, int y2);
EntityTransform getTransform();
// Dimension functions
glm::ivec2 getDimensions();
float getRatio();
int getiArea();
virtual void setVertData(bool flipY);
// Data Functions
void initializeData(int area);
void fillData(int area, CColor_uc fill);
void setData_toImage(const char* texPath, int *width, int *height);
void clearData(int area);
// Blend functions
void setBlendMode(BlendMode mode);
BlendMode getBlendMode();
// Render Functions
void setShader(std::shared_ptr<Shader> program);
std::shared_ptr<Shader> getShader();
void generateBuffers(unsigned int* va, unsigned int* vb, unsigned int* eb, unsigned int* tx0);
void generateBuffers(unsigned int* va, unsigned int* vb, unsigned int* eb);
void deleteBuffers();
virtual void bindBuffers();
virtual void bindTexture(int width, int height);
virtual void render(ShaderTransform* xform, unsigned int targetBuffer) = 0;
virtual void draw(ShaderTransform* xform) = 0;
// Utilities
unsigned int bindTexture_utility(int channelCount, int width, int height, unsigned int& texID, unsigned char* data);
};
#endif | 31.679245 | 143 | 0.722454 |
54eed916ed1dc891a971c05fbc11eb22453a9749 | 14,936 | c | C | gpvdm_core/libmesh/mesh.c | roderickmackenzie/gpvdm | 914fd2ee93e7202339853acaec1d61d59b789987 | [
"BSD-3-Clause"
] | 12 | 2016-09-13T08:58:13.000Z | 2022-01-17T07:04:52.000Z | gpvdm_core/libmesh/mesh.c | roderickmackenzie/gpvdm | 914fd2ee93e7202339853acaec1d61d59b789987 | [
"BSD-3-Clause"
] | 3 | 2017-11-11T12:33:02.000Z | 2019-03-08T00:48:08.000Z | gpvdm_core/libmesh/mesh.c | roderickmackenzie/gpvdm | 914fd2ee93e7202339853acaec1d61d59b789987 | [
"BSD-3-Clause"
] | 6 | 2019-01-03T06:17:12.000Z | 2022-01-01T15:59:00.000Z | //
// General-purpose Photovoltaic Device Model gpvdm.com - a drift diffusion
// base/Shockley-Read-Hall model for 1st, 2nd and 3rd generation solarcells.
// The model can simulate OLEDs, Perovskite cells, and OFETs.
//
// Copyright 2008-2022 Roderick C. I. MacKenzie https://www.gpvdm.com
// r.c.i.mackenzie at googlemail.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
/** @file mesh.c
@brief This builds the electrical mesh
*/
#include "device.h"
#include <mesh.h>
#include "inp.h"
#include "util.h"
#include "gpvdm_const.h"
#include "hard_limit.h"
#include <log.h>
#include <cal_path.h>
#include <lang.h>
#include <shape.h>
#include <epitaxy_struct.h>
#include <epitaxy.h>
#include <device_fun.h>
#include <ray_fun.h>
#include <json.h>
void mesh_cpy(struct simulation *sim,struct mesh *out,struct mesh *in)
{
int i;
int ii;
mesh_free(out);
out->nlayers= in->nlayers;
out->remesh= in->remesh;
out->layers = malloc (out->nlayers * sizeof(struct mesh_layer));
for (i=0;i<out->nlayers;i++)
{
out->layers[i].len=in->layers[i].len;
out->layers[i].n_points=in->layers[i].n_points;
out->layers[i].mul=in->layers[i].mul;
out->layers[i].left_right=in->layers[i].left_right;
out->layers[i].dx=in->layers[i].dx;
out->layers[i].start=in->layers[i].start;
out->layers[i].end=in->layers[i].end;
}
for (i=0;i<out->nlayers;i++)
{
out->layers[i].n_points=in->layers[i].n_points;
out->layers[i].dmesh=malloc ( out->layers[i].n_points * sizeof(long double));
//printf("malloc %x\n",in->layers[0].dmesh);
for (ii=0;ii>out->layers[i].n_points;ii++)
{
out->layers[i].dmesh[ii]=in->layers[i].dmesh[ii];
}
}
out->tot_points=in->tot_points;
}
void mesh_check_y(struct simulation *sim,struct mesh *in,struct device *dev)
{
int y=0;
gdouble mesh_len=0.0;
if (dev->circuit_simulation==TRUE)
{
return;
}
for (y=0;y<in->nlayers;y++)
{
mesh_len+=in->layers[y].len;
}
if (fabs(dev->ylen-mesh_len)>1e-14)
{
printf_log(sim,"calling remesh %Le %Le\n",dev->ylen,mesh_len);
//getchar();
mesh_remesh(sim,in,dev);
printf_log(sim,"Warning: Length of epitaxy and computational mesh did not match, so I remesshed the device.\n");
}
}
void mesh_remesh(struct simulation *sim,struct mesh *in,struct device *dev)
{
//char device_file_path[1000];
//if (in->remesh==TRUE)
//{
/*in->nlayers=1;
in->layers[0].len=dev->ylen;
if (dev->my_epitaxy.electrical_layers==1)
{
in->layers[0].n_points=10;
}else
{
in->layers[0].n_points=40;
}
in->layers[0].mul=1.0;
in->layers[0].left_right=LEFT;
mesh_save(sim,"mesh_y.inp",in);
device_free(sim,dev);
mesh_obj_free(sim,&(dev->mesh_data));
//join_path(2,device_file_path,get_input_path(sim),"epitaxy.inp"); //This is not obvious
//epitaxy_free(sim,&(dev->my_epitaxy));
//epitaxy_load(sim,&(dev->my_epitaxy),device_file_path);
mesh_obj_load(sim,&(dev->mesh_data));
dev->ns.dim.zlen=dev->mesh_data.meshdata_z.tot_points;
dev->ns.dim.xlen=dev->mesh_data.meshdata_x.tot_points;
dev->ns.dim.ylen=dev->mesh_data.meshdata_y.tot_points;
device_get_memory(sim,dev);
mesh_build(sim,dev);
//printf("remesh\n");
//getchar();
//}else*/
//{
ewe(sim,"%s\n",_("The electrical mesh does not match the device length"));
//}
}
/*void mesh_save(struct simulation *sim,char *file_name,struct mesh *in)
{
int i=0;
char buffer[2000];
char temp[2000];
char full_file_name[200];
strcpy(buffer,"");
strcat(buffer,"#remesh_enable\n");
strcat(buffer,"True\n");
strcat(buffer,"#mesh_layers\n");
sprintf(temp,"%d\n",in->nlayers);
strcat(buffer,temp);
for (i=0;i<in->nlayers;i++)
{
strcat(buffer,"#mesh_layer_length0\n");
sprintf(temp,"%Le\n",in->layers[i].len);
strcat(buffer,temp);
strcat(buffer,"#mesh_layer_points0\n");
sprintf(temp,"%d\n",(int)(in->layers[i].n_points));
strcat(buffer,temp);
strcat(buffer,"#mesh_layer_mul0\n");
sprintf(temp,"%d\n",(int)(in->layers[i].mul));
strcat(buffer,temp);
strcat(buffer,"#mesh_layer_left_right0\n");
sprintf(temp,"%d\n",(int)(in->layers[i].left_right));
strcat(buffer,temp);
}
strcat(buffer,"#ver\n");
strcat(buffer,"1.0\n");
strcat(buffer,"#end\n");
join_path(2,full_file_name,get_input_path(sim),file_name);
printf_log(sim,"Write new mesh to: %s\n",full_file_name);
zip_write_buffer(sim,full_file_name,buffer, strlen(buffer));
}*/
void mesh_free(struct mesh *in)
{
int i=0;
//printf("free\n");
//getchar();
if (in->nlayers!=-1)
{
for (i=0;i<in->nlayers;i++)
{
if (in->layers[i].dmesh!=NULL)
{
free(in->layers[i].dmesh);
}
}
free(in->layers);
mesh_init(in);
}
}
void mesh_init(struct mesh *in)
{
in->layers= NULL;
in->nlayers=-1;
in->remesh=-1;
in->start=0.0;
}
void mesh_malloc_sub_mesh(struct simulation * sim, struct mesh *in)
{
int i;
long double pos;
pos=0.0;
int points=0;
long double dx=0.0;
for (i=0;i<in->nlayers;i++)
{
dx=in->layers[i].len/((long double)in->layers[i].n_points);
pos=0.0;
in->layers[i].n_points=0;
while(pos<in->layers[i].len)
{
pos+=dx/2.0;
//printf("%Le %Le\n",pos,(*meshdata)[i].len);
//getchar();
if (pos>in->layers[i].len)
{
break;
}
in->layers[i].n_points++;
points++;
pos+=dx/2.0;
dx=dx*in->layers[i].mul;
}
if (in->layers[i].n_points!=0)
{
in->layers[i].dmesh=malloc ( in->layers[i].n_points * sizeof(long double));
}
}
in->tot_points=points;
}
void mesh_gen_simple(struct simulation * sim, struct mesh *in,long double len,int points)
{
int i;
if (points<=0)
{
ewe(sim,"%s\n",_("Can't generate a mesh with zero points"));
}
in->remesh=FALSE;
in->nlayers=1;
in->layers = malloc (in->nlayers * sizeof(struct mesh_layer));
i=0;
in->layers[i].len=len;
in->layers[i].n_points=points;
in->layers[i].dx=in->layers[i].len/((long double)in->layers[i].n_points);
in->layers[i].mul=1.0;
in->layers[i].left_right=TRUE;
mesh_malloc_sub_mesh(sim, in);
}
void mesh_gen_graded(struct simulation * sim, struct mesh *in,long double len,int points)
{
int i;
in->remesh=FALSE;
in->nlayers=2;
len/=2.0;
in->layers = malloc (in->nlayers * sizeof(struct mesh_layer));
i=0;
in->layers[i].len=len;
in->layers[i].n_points=points;
in->layers[i].dx=in->layers[i].len/((long double)in->layers[i].n_points);
in->layers[i].mul=1.1;
in->layers[i].left_right=FALSE;
i++;
in->layers[i].len=len;
in->layers[i].n_points=points;
in->layers[i].dx=in->layers[i].len/((long double)in->layers[i].n_points);
in->layers[i].mul=1.1;
in->layers[i].left_right=TRUE;
mesh_malloc_sub_mesh(sim, in);
}
void mesh_layer_init(struct simulation * sim, struct mesh_layer *layer )
{
layer->dx=-1.0;
layer->len=-1.0;
layer->mul=-1.0;
layer->dmesh=NULL;
layer->n_points=0;
layer->left_right=FALSE;
layer->start_at_edge_left=FALSE;
layer->start_at_edge_right=FALSE;
}
void mesh_load_file(struct simulation * sim, struct mesh *in,struct json_obj *mesh_xyz)
{
int i;
char temp[200];
struct json_obj *json_seg;
json_get_int(sim, mesh_xyz, &in->nlayers,"segments");
in->layers = malloc (in->nlayers * sizeof(struct mesh_layer));
for (i=0;i<in->nlayers;i++)
{
sprintf(temp,"segment%d",i);
json_seg=json_obj_find(mesh_xyz, temp);
if (json_seg==NULL)
{
ewe(sim,"Object light not found\n");
}
mesh_layer_init(sim, &(in->layers[i]));
json_get_long_double(sim, json_seg, &(in->layers[i].len),"len");
json_get_int(sim, json_seg, &(in->layers[i].n_points),"points");
in->layers[i].dx=in->layers[i].len/((long double)in->layers[i].n_points);
json_get_long_double(sim, json_seg, &(in->layers[i].mul),"mul");
json_get_english(sim, json_seg, &(in->layers[i].left_right),"left_right");
in->layers[i].len=fabs(in->layers[i].len);
}
mesh_malloc_sub_mesh(sim, in);
}
long double mesh_to_lin_array(struct simulation *sim,long double *mesh, long double *dmesh, struct mesh *in)
{
int pos=0;
int i=0;
int ii=0;
long double dpos=0.0;
long double dx=0.0;
long double len=0.0;
long double ret_len=0.0;
//Build the sub meshes dmesh segments assuming left to right multiplication
len=0.0;
for (i=0;i<in->nlayers;i++)
{
pos=0;
dpos=0.0;
dx=in->layers[i].dx;
//printf("going to build %d %Le\n",in->layers[i].n_points,in->layers[i].dx);
//getchar();
for (ii=0;ii<in->layers[i].n_points;ii++)
{
dpos+=dx/2.0;
//printf("%d %d %d %x\n",i,ii,in->layers[i].n_points,in->layers[i].dmesh);
in->layers[i].dmesh[ii]=dpos;
dpos+=dx/2.0;
dx*=in->layers[i].mul;
pos++;
}
len+=in->layers[i].len;
}
ret_len=len;
//Build the mesh forwards or backwards
len=in->start;
pos=0;
for (i=0;i<in->nlayers;i++)
{
for (ii=0;ii<in->layers[i].n_points;ii++)
{
//printf("%d %d %d %Le\n",pos,in->layers[i].n_points,in->nlayers,in->layers[i].len);
if ((in->layers[i].start_at_edge_left==TRUE)&&(ii==0)) //Insert extra point
{
//printf("yes\n");
//getchar();
mesh[pos]=0.0;
pos++;
}
if (in->layers[i].left_right==LEFT)
{
mesh[pos]=len+in->layers[i].dmesh[ii];
}else
{
mesh[pos]=len+in->layers[i].len-in->layers[i].dmesh[in->layers[i].n_points-1-ii];
}
//printf("%c %ld %Le %d %d %ld\n",direction,pos,mesh[pos],i,ii,meshdata[i].n_points);
pos++;
}
in->layers[i].start=len;
len+=in->layers[i].len;
in->layers[i].end=len;
}
//rebuild dmesh from main mesh
long double last=in->start;
long double next=0.0;
int sub_mesh_pos=0;
struct mesh_layer *layer;
pos=0;
for (i=0;i<in->nlayers;i++)
{
layer=&(in->layers[i]);
for (sub_mesh_pos=0;sub_mesh_pos<layer->n_points;sub_mesh_pos++)
{
if (sub_mesh_pos==(layer->n_points-1))
{
next=layer->end;
}else
{
next=(mesh[pos]+mesh[pos+1])/2.0;
}
if (sub_mesh_pos==0)
{
last=layer->start;
}
dx=next-last;
dmesh[pos]=dx;
last=next;
pos++;
}
}
return ret_len;
}
long double mesh_to_dim(struct simulation *sim,struct dimensions *dim, struct mesh *in,char xyz)
{
long double *mesh;
long double *dmesh;
long double ret_len=0.0;
dim_free_xyz(dim,xyz);
if (xyz=='x')
{
dim->xlen=in->tot_points;
dim_alloc_xyz(dim,'x');
mesh=dim->xmesh;
dmesh=dim->dx;
}else
if (xyz=='y')
{
dim->ylen=in->tot_points;
dim_alloc_xyz(dim,'y');
mesh=dim->ymesh;
dmesh=dim->dy;
}else
if (xyz=='z')
{
dim->zlen=in->tot_points;
dim_alloc_xyz(dim,'z');
mesh=dim->zmesh;
dmesh=dim->dz;
}
ret_len=mesh_to_lin_array(sim,mesh, dmesh,in);
return ret_len;
}
long double mesh_to_dim_heat(struct simulation *sim,struct dim_heat *dim, struct mesh *in,char xyz)
{
long double *mesh;
long double *dmesh;
long double ret_len=0.0;
dim_heat_free_xyz(dim,xyz);
if (xyz=='x')
{
dim->xlen=in->tot_points;
dim_heat_malloc_xyz(dim,'x');
mesh=dim->x;
dmesh=dim->dx;
}else
if (xyz=='y')
{
dim->ylen=in->tot_points;
dim_heat_malloc_xyz(dim,'y');
mesh=dim->y;
dmesh=dim->dy;
}else
if (xyz=='z')
{
dim->zlen=in->tot_points;
dim_heat_malloc_xyz(dim,'z');
mesh=dim->z;
dmesh=dim->dz;
}
//printf("%d %d %d %c\n",dim->zlen,dim->xlen,dim->ylen,xyz);
//getchar();
ret_len=mesh_to_lin_array(sim,mesh, dmesh, in);
return ret_len;
}
long double mesh_to_dim_based_on_epitaxy(struct simulation *sim,struct dimensions *dim,struct device *in)
{
int y;
struct epitaxy *epi=&(in->my_epitaxy);
dim->ylen=epi->layers+1;
dim_alloc_xyz(dim,'y');
for (y=0;y<epi->layers;y++)
{
dim->ymesh[y]=epi->layer[y].y_start;
//printf("%Le\n",dim->ymesh[y]);
}
//getchar();
dim->ymesh[epi->layers]=epi->layer[epi->layers-1].y_stop;
return epi->layer[epi->layers-1].y_stop-epi->layer[0].y_start;
}
void mesh_dump(struct simulation *sim,struct dimensions *dim)
{
int x=0;
for (x=0;x<dim->xlen;x++)
{
printf("%Le\n",dim->xmesh[x]);
}
}
void mesh_dump_y(struct simulation *sim,struct dimensions *dim)
{
int y=0;
for (y=0;y<dim->ylen;y++)
{
printf("%d %Le %Le\n",y,dim->ymesh[y],dim->dy[y]);
}
}
void mesh_build(struct simulation *sim,struct device *in)
{
in->zlen=mesh_to_dim(sim, &(in->ns.dim), &(in->mesh_data.meshdata_z),'z');
in->xlen=mesh_to_dim(sim, &(in->ns.dim), &(in->mesh_data.meshdata_x),'x');
if (strcmp(in->newton_name,"newton_simple")!=0)
{
in->ylen=mesh_to_dim(sim, &(in->ns.dim), &(in->mesh_data.meshdata_y),'y');
}else
{
in->ylen=mesh_to_dim_based_on_epitaxy(sim, &(in->ns.dim), in);
}
//dim_cpy(&(in->dim_max),&(in->ns.dim));
//mesh_dump_y(sim,&(in->ns.dim));
//getchar();
}
void mesh_numerate_points(struct simulation *sim,struct device *in)
{
if (in->drift_diffision_simulations_enabled==FALSE)
{
return;
}
int z=0;
int x=0;
int y=0;
struct dimensions *dim=&(in->ns.dim);
gdouble dpos=0.0;
//len=0.0;
for (y=0;y<dim->ylen;y++)
{
dpos=dim->ymesh[y];
//in->imat[0][0][y]=epitaxy_get_electrical_material_layer(&(in->my_epitaxy),dpos);
in->imat_epitaxy[0][0][y]=epitaxy_get_layer(&(in->my_epitaxy),in->my_epitaxy.device_start+dpos);
//epitaxy_get_epitaxy_layer_using_electrical_pos(&(in->my_epitaxy),dpos);
for (z=0;z<dim->zlen;z++)
{
for (x=0;x<dim->xlen;x++)
{
//in->imat[z][x][y]=in->imat[0][0][y];
in->imat_epitaxy[z][x][y]=in->imat_epitaxy[0][0][y];
//shape=shape_get_index(sim,&(in->my_epitaxy),dim->xmesh[x],dim->ymesh[y],dim->zmesh[z]);
//if (shape!=-1)
//{
// in->imat[z][x][y]=shape;
//}
//printf("%d\n",shape);
}
}
}
}
void mesh_cal_layer_widths(struct device *in)
{
int i;
int cur_i=in->imat_epitaxy[0][0][0];
in->layer_start[cur_i]=0.0;
struct dimensions *dim=&in->ns.dim;
for (i=0;i<dim->ylen;i++)
{
if ((in->imat_epitaxy[0][0][i]!=cur_i)||(i==(dim->ylen-1)))
{
in->layer_stop[cur_i]=dim->ymesh[i-1];//+(dim->ymesh[i]-dim->ymesh[i-1])/2;
if (i==(dim->ylen-1))
{
break;
}
cur_i=in->imat_epitaxy[0][0][i];
in->layer_start[cur_i]=dim->ymesh[i];//-(dim->ymesh[i]-dim->ymesh[i-1])/2;
}
//printf_log("%d\n",in->imat_epitaxy[i]);
}
}
| 21.772595 | 114 | 0.651982 |
8e3db0b3a7dd4a8115d52436009fdcf01e1c8c01 | 936 | h | C | Editor/SphereCollider.h | Byterset/UltraEd | e7c1556cd0a7ea5fc713c46b72e1dd4762760eea | [
"MIT"
] | 101 | 2019-02-12T12:53:18.000Z | 2022-03-14T14:14:38.000Z | Editor/SphereCollider.h | Byterset/UltraEd | e7c1556cd0a7ea5fc713c46b72e1dd4762760eea | [
"MIT"
] | 157 | 2019-02-06T05:04:20.000Z | 2022-03-31T21:50:28.000Z | Editor/SphereCollider.h | Byterset/UltraEd | e7c1556cd0a7ea5fc713c46b72e1dd4762760eea | [
"MIT"
] | 15 | 2019-05-11T04:03:35.000Z | 2022-02-12T18:53:47.000Z | #ifndef _SPHERECOLLIDER_H_
#define _SPHERECOLLIDER_H_
#include "Collider.h"
namespace UltraEd
{
class SphereCollider : public Collider
{
public:
SphereCollider();
SphereCollider(const std::vector<Vertex> &vertices);
void Build();
FLOAT GetRadius() { return m_originalRadius; }
void Update(D3DXMATRIX &mat);
nlohmann::json Save();
void Load(const nlohmann::json &root);
private:
void SphereFromDistPoints(D3DXVECTOR3 ¢er, FLOAT &radius, const std::vector<Vertex> &vertices);
void AdjustSphere(D3DXVECTOR3 ¢er, FLOAT &radius, const Vertex &vertex);
void RitterSphere(D3DXVECTOR3 ¢er, FLOAT &radius, const std::vector<Vertex> &vertices);
void RitterIterative(D3DXVECTOR3 ¢er, FLOAT &radius, const std::vector<Vertex> &vertices);
private:
float m_radius;
float m_originalRadius;
};
}
#endif
| 29.25 | 107 | 0.672009 |
c2444ee468cefd9b720f45031d673c82d6335ad6 | 5,575 | h | C | Parts/stages/win32/include/mle/pcstage.h | magic-lantern-studio/mle-parts | 551cdb0757fcd6623cd5c7572dca681165b43a29 | [
"MIT"
] | 1 | 2021-02-04T22:44:16.000Z | 2021-02-04T22:44:16.000Z | Parts/stages/win32/include/mle/pcstage.h | magic-lantern-studio/mle-parts | 551cdb0757fcd6623cd5c7572dca681165b43a29 | [
"MIT"
] | null | null | null | Parts/stages/win32/include/mle/pcstage.h | magic-lantern-studio/mle-parts | 551cdb0757fcd6623cd5c7572dca681165b43a29 | [
"MIT"
] | null | null | null | /** @defgroup MleParts Magic Lantern Parts */
/**
* @file pcstage.h
* @ingroup MlParts
*
* @author Mark S. Millard
* @date Jan 24, 2006
*
* This file defines a BRender Stage for the Windows platform.
*/
// COPYRIGHT_BEGIN
//
// Copyright (C) 2000-2007 Wizzer Works
//
// Wizzer Works makes available all content in this file ("Content").
// Unless otherwise indicated below, the Content is provided to you
// under the terms and conditions of the Common Public License Version 1.0
// ("CPL"). A copy of the CPL is available at
//
// http://opensource.org/licenses/cpl1.0.php
//
// For purposes of the CPL, "Program" will mean the Content.
//
// For information concerning this Makefile, contact Mark S. Millard,
// of Wizzer Works at msm@wizzerworks.com.
//
// More information concerning Wizzer Works may be found at
//
// http://www.wizzerworks.com
//
// COPYRIGHT_END
#ifndef __MLE_PCSTAGE_H_
#define __MLE_PCSTAGE_H_
// Include system header files.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
// Include Magic Lantern header files.
#include "mle/MleEventDispatcher.h"
// Include PC target header files.
#include "mle/brstage.h"
#include "mle/comstg.h"
#include "mle/win32pal.h"
typedef MleWin32Palette MlPaletteType; // Win32 application GDI palette.
// This declaration is only temporary
typedef struct
{
// Spatial resolution.
int m_width;
int m_height;
// Tonal resolution.
int m_bitsPerPixel;
MlBoolean m_palettized;
int m_colorsAvailable;
// Temporal resolution.
int m_refreshRate;
} MleDesktop;
class PCBRenderStage : public BrStage
{
MLE_STAGE_HEADER(PCBRenderStage);
// Declare member functions.
public:
PCBRenderStage(void);
virtual ~PCBRenderStage(void);
// This method installs the event and scheduler callbacks.
//
virtual void init(void);
// This method registers a new Set with this stage.
virtual MleSchedulerItem *addSet(void (*render)(MleSet *),MleSet *set);
// This method is an accessor function.
virtual void getSize(int *width,int *height);
// This method is used by screenblit() and the WM_PAINT message.
// callback.
void blit(HDC newDc);
// This method changes the size of the window managed by the stage.
// It is used by the WM_SIZE callback.
void resize(int x, int y, int width, int height);
// This method screen blits and empties current dirty region.
// It is a callback to be used during the PHASE_STAGE phase
// of the execution cycle.
static void screenblit(void *stage);
// This callback is used to capture the WM_SIZE message. It is called
// via the event dispatch manager.
//
static int resizeEventCB(MleEvent event,void *callData,void *clientData);
// This callback is used to capture the WM_SIZE, WM_QUERYNEWPALETTE and
// WM_PALETTECHANGED messages. It is called via the event dispatch manager.
//
//
static int paintEventCB(MleEvent event,void *callData,void *clientData);
// This method is used to get the off-screen buffer used by
// the stage for rendering
inline char *getOffScreenBuffer(void)
{ return (char *) m_blt.m_bits; }
// This method is an accessor function.
inline const MleDesktop *getDesktop(void)
{ return &m_desktop; }
// Initialize the palette.
MlBoolean initPalette(PALETTEENTRY *palEnts);
// Set a new palette.
MlPaletteType *setPalette(MlPaletteType *newPalette);
// Update the current palette in the window dc
MlBoolean updatePalette(void);
// declare member variables.
HWND m_window; // Handle to output window
HDC m_hdcWindow; // Handle to a DC for the window
int m_showMode; // Indication of how to show window
// via the ShowWindow() function
MlPaletteType *m_palette;
private:
/*
* The desktop structure contains information relating to the
* spatial, tonal and temporal resolutions of the presentation
* surface.
*/
MleDesktop m_desktop;
HPALETTE m_hPalette;
int m_x, m_y; // Position in window of image.
int m_width, m_height; // Size of stage.
MlBoolean m_ready; // TRUE when buffer is ready for blit.
// Current off screen buffer.
MleDIBSectionBlit m_blt; // Bitblt helper class instance.
};
//
// Macros for accessing stage which is stored with window instance.
//
#define MLE_INST_STAGE_SET(hwnd,stage) SetWindowLong((hwnd),0,(LONG)(stage))
#define MLE_INST_STAGE_GET(hwnd) ((PCBRenderStage*)GetWindowLong((hwnd),0))
#if !defined(_GDK_)
//
// Macro for retrieving the window DC stored in the Win32 PC BRender stage.
//
#define MLE_GET_WINDOW_DC() ((PCBRenderStage *)MleStage::g_theStage)->m_hdcWindow
//
// Macros for event dispatching priorities. Note that this ordering is
// important. The Stage resize callback must be executed prior to the
// Set resize callback because the Set uses the new off-screen buffer
// which is reallocated by the Stage resize callback. Also, the Stage
// resize paint callback is executed after all other resize events have
// been processed. The resize paint callback redraws the world in the new
// off-screen buffer.
//
#define MLE_RESIZE_STAGE_PRIORITY 10
#define MLE_RESIZE_SET_PRIORITY 9
#define MLE_RESIZEPAINT_STAGE_PRIORITY -1
#endif /* !_GDK_ */
#endif /* __MLE_PCSTAGE_H_ */
| 28.443878 | 81 | 0.687354 |
907d5ca59264cd412ffb63a7fde63b407e2d16ed | 536 | h | C | BasicDataStructures/BasicDataStructures/StackV.h | miramirezch/BasicDataStructures | b399ce615816ebdd254b56669b84ba0445f3c790 | [
"MIT"
] | null | null | null | BasicDataStructures/BasicDataStructures/StackV.h | miramirezch/BasicDataStructures | b399ce615816ebdd254b56669b84ba0445f3c790 | [
"MIT"
] | null | null | null | BasicDataStructures/BasicDataStructures/StackV.h | miramirezch/BasicDataStructures | b399ce615816ebdd254b56669b84ba0445f3c790 | [
"MIT"
] | null | null | null | #pragma once
#include <vector>
// Miguel Ramirez Chacon
// 04/22/17
// Modern C++ Practice:
// Basic Stack - Vector Based
// Fluent Interface
template<typename T>
class StackV
{
public:
StackV& Push(T value)
{
data_.push_back(value);
count_++;
return *this;
}
StackV& Pop()
{
if (count_ > 0)
{
data_.pop_back();
count_--;
return *this;
}
else
{
return *this;
}
}
T Top()
{
return data_.back();
}
int Count()
{
return count_;
}
private:
std::vector<T> data_;
int count_;
};
| 10.509804 | 29 | 0.587687 |
908cbf70cff75e7e28bac80f8385e52614ef9ace | 6,062 | h | C | src/ofxSurfingDataRemover.h | moebiussurfing/ofxSurfingDataRemover | 5b13092ef5e69f6400b897d8a5f57550fa878f94 | [
"MIT"
] | null | null | null | src/ofxSurfingDataRemover.h | moebiussurfing/ofxSurfingDataRemover | 5b13092ef5e69f6400b897d8a5f57550fa878f94 | [
"MIT"
] | null | null | null | src/ofxSurfingDataRemover.h | moebiussurfing/ofxSurfingDataRemover | 5b13092ef5e69f6400b897d8a5f57550fa878f94 | [
"MIT"
] | null | null | null |
#pragma once
#include "ofMain.h"
// dependencies
#include "ofxGui.h"
#include "ofxSurfingHelpers.h"
#include "ofxClickable.h"
//TODO:
//adding backup mode to a set of the listed files to default states.
//#define USE_RESTORER
class ofxSurfingDataRemover
{
private:
// all params grouped
ofParameterGroup params;
// addon variables
ofParameterGroup params_Addon;;
//ofParameter<bool> Addon_Active;
//ofParameter<float> Addon_Float;
//----
public:
ofxSurfingDataRemover();
~ofxSurfingDataRemover();
private:
void setup();
void update(ofEventArgs & args);
void draw(ofEventArgs & args);
void exit();
void startup();
public:
void dragEvent(ofDragInfo dragInfo);
public:
void windowResized(int w, int h);
#pragma mark - API
void setActive(bool b);
void setGuiVisible(bool b);
void setPathGlobal(string s); // must call before setup. disabled by default
void setLogLevel(ofLogLevel level);
void setAutoSave(bool b)
{
ENABLE_AutoSave = b;
}
private:
void setKey_MODE_App(int k);
//-
private:
int key_MODE_App = OF_KEY_TAB;//default key to switch MODE_App
int screenW, screenH;
// autosave
ofParameter<bool> ENABLE_AutoSave;
uint64_t timerLast_Autosave = 0;
int timeToAutosave = 5000;
// updating some params before save will trigs also the group callbacks
// so we disable this callbacks just in case params updatings are required
// in this case we will need to update gui position param
bool DISABLE_Callbacks = false;
//-
void Changed_params_Addon(ofAbstractParameter &e);
//-
#pragma mark - ADDON TEMPLATE STUFF
#pragma mark - CONTROL PARAMS
// control params
ofParameterGroup params_Control;
ofParameter<bool> MODE_Active;
ofParameter<bool> ENABLE_keys;
ofParameter<bool> ENABLE_Debug;
ofParameter<bool> SHOW_Gui;
ofParameter<glm::vec2> Gui_Position;
ofParameter<bool> SHOW_Help;
ofParameter<int> MODE_App;
ofParameter<string> MODE_App_Name;
ofxPanel gui_Control;
#pragma mark - CALLBACKS
void Changed_params_Control(ofAbstractParameter &e);
void Changed_params(ofAbstractParameter &e);
#pragma mark - OF LISTENERS
// keys
void keyPressed(ofKeyEventArgs &eventArgs);
void keyReleased(ofKeyEventArgs &eventArgs);
void addKeysListeners();
void removeKeysListeners();
// mouse
void mouseDragged(ofMouseEventArgs &eventArgs);
void mousePressed(ofMouseEventArgs &eventArgs);
void mouseReleased(ofMouseEventArgs &eventArgs);
void addMouseListeners();
void removeMouseListeners();
#pragma mark - FILE SETTINGS
string path_GLOBAL = "ofxSurfingDataRemover/";//this is to folder all files to avoid mixing with other addons data
string path_Params_Control = "params_Control.xml";
string path_Params_AppSettings = "params_AppSettings.xml";
//-
ofxClickable butRemove;
ofxClickable butClear;
ofxClickable butSave;
ofxClickable butLoad;
#ifdef USE_RESTORER
ofxClickable butBackup;
#endif
ofxClickable butRestore;
ofTrueTypeFont font;
ofTrueTypeFont fontBox;
private:
void drawInfo();
glm::vec2 dragPt;
vector <ofImage> draggedImages;
ofParameterGroup params_AppSettings;
ofParameter<string> presetNamePath{ "presetNamePath", "ofxSurfingDataRemover_PresetName.xml" };
ofParameter<string> filesList{ "filesList", "" };
ofParameter<string> foldersList{ "foldersList", "" };
ofParameter<bool> bClear{ "Clear", false };
ofParameter<bool> bSave{ "Save", false };
ofParameter<bool> bLoad{ "bLoad", false };
ofParameter<bool> bRun{ "Run", false };
ofParameter<bool> bInitialize{ "Initialize", false };
void doRemoveDataFiles();
string msg = "";
//--------------------------------------------------------------
void onButClear() {
doClear();
};
//--------------------------------------------------------------
void onButRemove() {
doRun();
};
//--------------------------------------------------------------
void onButSave() {
doSave();
};
//--------------------------------------------------------------
void onButLoad() {
doLoad();
};
#ifdef USE_RESTORER
//--------------------------------------------------------------
void onButBackup() {
doBackup();
};
//--------------------------------------------------------------
void onButRestore() {
doRestore();
};
#endif
public:
//--------------------------------------------------------------
void doRun() {
ofLogNotice(__FUNCTION__);
bRun = false;
doRemoveDataFiles();
};
//--------------------------------------------------------------
void doClear() {
ofLogNotice(__FUNCTION__);
bClear = false;
filesList = "";
foldersList = "";
msg = "Files and folders list it's empty.";
};
//--
//TODO:
//handle multiple presets for many apps
string originalFileExtension = "xml";
//--------------------------------------------------------------
void doSave() {
ofLogNotice(__FUNCTION__);
bSave = false;
ofFileDialogResult saveFileResult = ofSystemSaveDialog(ofGetTimestampString() + "." + ofToLower(originalFileExtension), "Save your file");
if (saveFileResult.bSuccess) {
presetNamePath = saveFileResult.filePath;
ofLogNotice(__FUNCTION__) << presetNamePath;
ofxSurfingHelpers::saveGroup(params_Control, path_GLOBAL + path_Params_Control);
ofxSurfingHelpers::saveGroup(params_AppSettings, path_Params_AppSettings);
}
};
//--------------------------------------------------------------
void doLoad() {
ofLogNotice(__FUNCTION__);
bLoad = false;
{
//Open the Open File Dialog
ofFileDialogResult openFileResult = ofSystemLoadDialog("Select xml preset");
//Check if the user opened a file
if (openFileResult.bSuccess) {
ofLogVerbose("User selected a file");
presetNamePath = openFileResult.filePath;
ofxSurfingHelpers::loadGroup(params_Control, path_GLOBAL + path_Params_Control);
ofxSurfingHelpers::loadGroup(params_AppSettings, path_Params_AppSettings);
}
else {
ofLogVerbose("User hit cancel");
}
}
};
#ifdef USE_RESTORER
//TODO:
//--------------------------------------------------------------
void doBackup();
void doRestore();
#endif
};
| 21.496454 | 140 | 0.647476 |
fca07ca2aa68ebc8c613be2840ccea595713356b | 762 | h | C | vpr7_x2p/vpr/SRC/device/mux_graph_fwd.h | srtemp/OpenFPGA | dd3d5fb7da881ef71717ce049eee09ec9b91849a | [
"MIT"
] | null | null | null | vpr7_x2p/vpr/SRC/device/mux_graph_fwd.h | srtemp/OpenFPGA | dd3d5fb7da881ef71717ce049eee09ec9b91849a | [
"MIT"
] | null | null | null | vpr7_x2p/vpr/SRC/device/mux_graph_fwd.h | srtemp/OpenFPGA | dd3d5fb7da881ef71717ce049eee09ec9b91849a | [
"MIT"
] | null | null | null | /**************************************************
* This file includes only declarations for
* the data structures to describe multiplexer structures
* Please refer to mux_graph.h for more details
*************************************************/
#ifndef MUX_GRAPH_FWD_H
#define MUX_GRAPH_FWD_H
#include "vtr_strong_id.h"
/* Strong Ids for MUXes */
struct mux_node_id_tag;
struct mux_edge_id_tag;
struct mux_mem_id_tag;
struct mux_input_id_tag;
struct mux_output_id_tag;
typedef vtr::StrongId<mux_node_id_tag> MuxNodeId;
typedef vtr::StrongId<mux_edge_id_tag> MuxEdgeId;
typedef vtr::StrongId<mux_mem_id_tag> MuxMemId;
typedef vtr::StrongId<mux_input_id_tag> MuxInputId;
typedef vtr::StrongId<mux_output_id_tag> MuxOutputId;
class MuxGraph;
#endif
| 28.222222 | 57 | 0.707349 |
fbcd6e1f2ccdeee17439f3f01b59344f5858570d | 2,821 | h | C | sumo/src/activitygen/city/AGWorkPosition.h | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | null | null | null | sumo/src/activitygen/city/AGWorkPosition.h | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | null | null | null | sumo/src/activitygen/city/AGWorkPosition.h | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | 2 | 2017-12-14T16:41:59.000Z | 2020-10-16T17:51:27.000Z | /****************************************************************************/
/// @file AGWorkPosition.h
/// @author Piotr Woznica
/// @author Daniel Krajzewicz
/// @author Walter Bamberger
/// @author Michael Behrisch
/// @date July 2010
/// @version $Id$
///
// Location and schedules of a work position: linked with one adult
/****************************************************************************/
// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
// Copyright (C) 2010-2017 DLR (http://www.dlr.de/) and contributors
// activitygen module
// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
/****************************************************************************/
//
// This file is part of SUMO.
// SUMO 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 3 of the License, or
// (at your option) any later version.
//
/****************************************************************************/
#ifndef AGWORKPOSITION_H
#define AGWORKPOSITION_H
// ===========================================================================
// included modules
// ===========================================================================
#ifdef _MSC_VER
#include <windows_config.h>
#else
#include <config.h>
#endif
#include "AGPosition.h"
#include <stdexcept>
// ===========================================================================
// class declarations
// ===========================================================================
class AGStreet;
class AGAdult;
class AGDataAndStatistics;
// ===========================================================================
// class definitions
// ===========================================================================
// TODO: Change name to AGWorkPlace?
// TODO: Counter for free work positions should be in City
// TODO: Change name of openingTime to something like startHour or openingHour
class AGWorkPosition {
public:
AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet);
AGWorkPosition(AGDataAndStatistics* ds, const AGStreet& inStreet, double pos);
~AGWorkPosition();
void take(AGAdult* ad);
void let();
bool isTaken() const;
AGPosition getPosition() const;
int getOpening() const;
int getClosing() const;
void print() const;
private:
static int generateOpeningTime(const AGDataAndStatistics& ds);
static int generateClosingTime(const AGDataAndStatistics& ds);
private:
AGDataAndStatistics* myStatData;
AGPosition myLocation;
AGAdult* myAdult;
int myOpeningTime;
int myClosingTime;
};
#endif
/****************************************************************************/
| 32.425287 | 82 | 0.501595 |
dac4852985775cde2de25d8623d331dd259985db | 2,131 | h | C | PublisherApp/Source/ArticleBlockCell.h | abaikirov/PublisherApp | 1ad41c51376faba725d575cd0cddb8d688685a9e | [
"MIT"
] | null | null | null | PublisherApp/Source/ArticleBlockCell.h | abaikirov/PublisherApp | 1ad41c51376faba725d575cd0cddb8d688685a9e | [
"MIT"
] | null | null | null | PublisherApp/Source/ArticleBlockCell.h | abaikirov/PublisherApp | 1ad41c51376faba725d575cd0cddb8d688685a9e | [
"MIT"
] | 1 | 2019-03-21T12:01:18.000Z | 2019-03-21T12:01:18.000Z | //
// ArticleBlockCell.h
// Pods
//
// Created by Dmitry Zheshinsky on 5/15/17.
//
//
#import <UIKit/UIKit.h>
#import "ArticleBlock.h"
@import TTTAttributedLabel;
@import youtube_ios_player_helper;
@class Post;
#pragma mark - Base block cell
@protocol LinkTapDelegate <NSObject>
@optional
- (void) linkTapped:(NSURL*) url;
@end
@protocol ArticleBlockCell<NSObject>
+(NSString*) reuseIdentifier;
@optional
- (void) fillWithBlock:(ArticleBlock*) block;
@end
#pragma mark - Header
@interface FeaturedImageView : UIImageView
- (void) fillWithPost:(Post*) post;
@end
@interface ArticleHeaderCell : UITableViewCell<ArticleBlockCell>
@property (weak, nonatomic) IBOutlet FeaturedImageView *featuredImage;
@property (weak, nonatomic) IBOutlet UILabel *authorLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *postTitle;
- (void) fillWithPost:(Post*) post;
@end
#pragma mark - Text blocks
@interface TextDisplayingCell : UITableViewCell<ArticleBlockCell, TTTAttributedLabelDelegate>
@property (weak, nonatomic) IBOutlet TTTAttributedLabel *textContentLabel;
@property (nonatomic, weak) id<LinkTapDelegate> linkDelegate;
@end
@interface TextBlockCell : TextDisplayingCell
@end
@interface QuoteBlockCell : TextDisplayingCell
@end
@interface HeaderBlockCell : TextDisplayingCell
@end
@interface ListBlockCell : TextDisplayingCell
@end
@interface CodeBlockCell : UITableViewCell<ArticleBlockCell>
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@end
#pragma mark - Image block
@interface ImageBlockCell : UITableViewCell<ArticleBlockCell>
@property (weak, nonatomic) IBOutlet UIImageView *contentImage;
@end
#pragma mark - Webview block
@interface BlockWebView : UIWebView
@property (nonatomic) BOOL isLoaded;
@property (nonatomic) NSInteger numberOfLoads;
@end
@interface WebBlockCell : UITableViewCell<ArticleBlockCell>
@property (weak, nonatomic) IBOutlet BlockWebView *webView;
@end
#pragma mark - Video blocks
@interface YoutubeBlockCell : UITableViewCell<ArticleBlockCell>
@property (weak, nonatomic) IBOutlet YTPlayerView *playerView;
@end
| 23.94382 | 93 | 0.790709 |
25d4028c4dd75737e3b82dc215e18d0930b28e35 | 3,097 | c | C | v2/testdata/bug/8.c | mewbak/cc-1 | d673e9b70d4d716fd96e81a4d7dc9d532c6c0391 | [
"BSD-3-Clause"
] | 178 | 2016-03-03T12:31:18.000Z | 2021-11-05T22:36:55.000Z | v2/testdata/bug/8.c | mewbak/cc-1 | d673e9b70d4d716fd96e81a4d7dc9d532c6c0391 | [
"BSD-3-Clause"
] | 106 | 2016-03-03T13:11:42.000Z | 2018-09-27T13:01:51.000Z | v2/testdata/bug/8.c | mewbak/cc-1 | d673e9b70d4d716fd96e81a4d7dc9d532c6c0391 | [
"BSD-3-Clause"
] | 21 | 2016-03-03T14:21:36.000Z | 2020-04-09T01:19:17.000Z | #include <stdint.h>
int main() {
int y;
int8_t i8;
uint8_t u8;
int16_t i16;
uint16_t u16;
int32_t i32;
uint32_t u32;
int64_t i64;
uint64_t u64;
for (i8 = -4; i8 <= 4; i8++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) << %i(%x) = %i(%x)\n", i8, (uint8_t)i8, y, (unsigned)y, i8 << y, (uint8_t)(i8 << y));
}
}
for (u8 = 0; u8 <= 4; u8++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) << %i(%x) = %u(%x)\n", u8, u8, y, (unsigned)y, u8 << y, u8 << y);
}
}
for (i8 = -4; i8 <= 4; i8++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) >> %i(%x) = %i(%x)\n", i8, (uint8_t)i8, y, (unsigned)y, i8 >> y, (uint8_t)(i8 >> y));
}
}
for (u8 = 0; u8 <= 4; u8++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) >> %i(%x) = %u(%x)\n", u8, u8, y, (unsigned)y, u8 >> y, u8 >> y);
}
}
for (i16 = -4; i16 <= 4; i16++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) << %i(%x) = %i(%x)\n", i16, (uint16_t)i16, y, (unsigned)y, i16 << y, (uint16_t)(i16 << y));
}
}
for (u16 = 0; u16 <= 4; u16++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) << %i(%x) = %u(%x)\n", u16, u16, y, (unsigned)y, u16 << y, u16 << y);
}
}
for (i16 = -4; i16 <= 4; i16++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) >> %i(%x) = %i(%x)\n", i16, (uint16_t)i16, y, (unsigned)y, i16 >> y, (uint16_t)(i16 >> y));
}
}
for (u16 = 0; u16 <= 4; u16++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) >> %i(%x) = %u(%x)\n", u16, u16, y, (unsigned)y, u16 >> y, u16 >> y);
}
}
for (i32 = -4; i32 <= 4; i32++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) << %i(%x) = %i(%x)\n", i32, (uint32_t)i32, y, (unsigned)y, i32 << y, (uint32_t)(i32 << y));
}
}
for (u32 = 0; u32 <= 4; u32++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) << %i(%x) = %u(%x)\n", u32, u32, y, (unsigned)y, u32 << y, u32 << y);
}
}
for (i32 = -4; i32 <= 4; i32++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) >> %i(%x) = %i(%x)\n", i16, (uint32_t)i16, y, (unsigned)y, i16 >> y, (uint32_t)(i16 >> y));
}
}
for (u32 = 0; u32 <= 4; u32++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) >> %i(%x) = %u(%x)\n", u32, u32, y, (unsigned)y, u32 >> y, u32 >> y);
}
}
for (i64 = -4; i64 <= 4; i64++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) << %i(%x) = %i(%x)\n", i64, (uint64_t)i64, y, (unsigned)y, i64 << y, (uint64_t)(i64 << y));
}
}
for (u64 = 0; u64 <= 4; u64++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) << %i(%x) = %u(%x)\n", u64, u64, y, (unsigned)y, u64 << y, u64 << y);
}
}
for (i64 = -4; i64 <= 4; i64++) {
for (y = -128; y <= 127; y++) {
printf(" signed 8 %i(%x) >> %i(%x) = %i(%x)\n", i16, (uint64_t)i16, y, (unsigned)y, i16 >> y, (uint64_t)(i16 >> y));
}
}
for (u64 = 0; u64 <= 4; u64++) {
for (y = -128; y <= 127; y++) {
printf("unsigned 8 %u(%x) >> %i(%x) = %u(%x)\n", u64, u64, y, (unsigned)y, u64 >> y, u64 >> y);
}
}
}
| 31.602041 | 120 | 0.431708 |
dd36147c8d4ccd2ea51515687fec79432bffd887 | 1,781 | h | C | mqtt_cl/include/mqtt_sub.h | d51x/esp-iot-home-components | f2fe397efab7238177d806f523f51cd3b8bba666 | [
"MIT"
] | 1 | 2020-12-23T20:48:04.000Z | 2020-12-23T20:48:04.000Z | mqtt_cl/include/mqtt_sub.h | d51x/esp-iot-home-components | f2fe397efab7238177d806f523f51cd3b8bba666 | [
"MIT"
] | null | null | null | mqtt_cl/include/mqtt_sub.h | d51x/esp-iot-home-components | f2fe397efab7238177d806f523f51cd3b8bba666 | [
"MIT"
] | null | null | null | #pragma once
#ifndef __MQTT_SUB_H__
#define __MQTT_SUB_H__
#include <string.h>
#include "mqtt_cl.h"
#include "httpd.h"
#include "http_page.h"
#include "http_page_tpl.h"
#ifdef CONFIG_SENSOR_MQTT
#define MQTT_SUBSCRIBER_URI "/mqttsub"
#define MQTT_SUBSCRIBER_HANDLERS_COUNT 2
#define MQTT_SUBSCRIBER_MAX_BASE_TOPICS CONFIG_SENSOR_MQTT_BASE_TOPIC_COUNT //5
#define MQTT_SUBSCRIBER_MAX_END_POINTS CONFIG_SENSOR_MQTT_END_POINT_COUNT * MQTT_SUBSCRIBER_MAX_BASE_TOPICS // общее кол-во endpoints на все base topics
#define MQTT_SUBSCRIBER_BASE_TOPIC_MAX_LENGTH 36
#define MQTT_SUBSCRIBER_END_POINT_MAX_LENGTH 28
#define MQTT_SUBSCRIBER_END_POINT_VALUE_MAX_LENGTH 16
typedef struct {
char base[MQTT_SUBSCRIBER_BASE_TOPIC_MAX_LENGTH]; // [MQTT_SUBSCRIBER_BASE_TOPIC_MAX_LENGTH]
uint8_t id;
} mqtt_sub_base_topic_t;
typedef struct {
char endpoint[MQTT_SUBSCRIBER_END_POINT_MAX_LENGTH]; // [MQTT_SUBSCRIBER_END_POINT_MAX_LENGTH] max length
uint8_t base_id;
uint8_t id;
//char *name; //[12] max, param name
} mqtt_sub_endpoint_t;
typedef struct {
uint8_t id;
char value[MQTT_SUBSCRIBER_END_POINT_VALUE_MAX_LENGTH]; // значение
} mqtt_sub_endpoint_value_t;
void mqtt_subscriber_init(httpd_handle_t _server);
// endpoints - строка endpoint's через ";", например "mcpgpio0;mpgpio14;mcpgpio15"
esp_err_t mqtt_subscriber_add(const char* base_topic, const char *endpoints);
// удаляет base topic и все его endpoints
esp_err_t mqtt_subscriber_del(const char* base_topic);
void mqtt_subscriber_clear_all();
// отобразить настройки на веб странице
void mqtt_subscriber_register_http_print_data();
// get обработчик при сохранении настроек
// void mqtt_subscriber_http_get_handler();
#endif
#endif | 31.803571 | 154 | 0.789444 |
c6efb9a6621a5e543d9d7d5c319f67771db4beb1 | 305 | h | C | Main/Emulator/bkEmu.h | abelykh0/stm32f407-bkEmu | 06c62a6f26bccb09f93b8bb1097e853798257e8a | [
"MIT"
] | 7 | 2018-12-09T20:33:50.000Z | 2021-12-10T18:41:16.000Z | Main/Emulator/bkEmu.h | zxrepo/abelykh0.stm32f407-bkEmu | 06c62a6f26bccb09f93b8bb1097e853798257e8a | [
"MIT"
] | 1 | 2020-03-18T23:07:48.000Z | 2020-06-18T17:51:08.000Z | Main/Emulator/bkEmu.h | zxrepo/abelykh0.stm32f407-bkEmu | 06c62a6f26bccb09f93b8bb1097e853798257e8a | [
"MIT"
] | null | null | null | #ifndef __BKEMU_H
#define __BKEMU_H
#include "BkScreen.h"
#include "pdp/defines.h"
using namespace bk;
#define RAM_AVAILABLE 0x4000
extern uint8_t RamBuffer[RAM_AVAILABLE];
extern BkScreen* _bkScreen;
extern pdp_regs pdp;
void bk_setup(BkScreen* bkScreen);
int32_t bk_loop();
void bk_reset();
#endif
| 16.052632 | 40 | 0.783607 |
efdba90a8316d29ca2f9821eac7cf1defba6fea4 | 1,372 | h | C | uiComponent/OrbBox.h | fhfuih/COMP2012H-Project | a306c61942892dde28d9b16b97e257540c35db2f | [
"WTFPL"
] | 1 | 2019-07-26T21:24:51.000Z | 2019-07-26T21:24:51.000Z | uiComponent/OrbBox.h | fhfuih/COMP2012H-Project | a306c61942892dde28d9b16b97e257540c35db2f | [
"WTFPL"
] | null | null | null | uiComponent/OrbBox.h | fhfuih/COMP2012H-Project | a306c61942892dde28d9b16b97e257540c35db2f | [
"WTFPL"
] | null | null | null | #ifndef ORBBOX_H
#define ORBBOX_H
#include <QPushButton>
#include <QString>
#include <map>
#include "Utils.h"
class OrbBox : public QPushButton
{
Q_OBJECT
/* Wrapper of clickable orb
* provides simple interface to change its appearence
* derived from PA4 */
public:
OrbBox(int _row, int _col, Type _type, QWidget* parent = nullptr);
/* Style manipulation interface
*
* only settings of highlight and type (image) are provided
*/
void set_highlighted(bool value, std::string color="red");
bool get_highlighted() const;
Type get_type() const;
void set_type(Type type);
/* Coordinate getters */
int get_row() const;
int get_col() const;
private:
typedef std::map<std::string, std::string> StyleMap;
/* Geometry and style data */
int row, col;
StyleMap style;
bool is_highlighted;
Type type;
/* Underlying style manipulations
*
* including settings of raw stylesheet and geometries
*/
void setStyle(std::string key, std::string value);
void applyStyle();
void render();
void render_image();
/* Event Handler
*
* Translation of clicked event,
* so that the coordinates are passed along the signal */
signals:
void clicked_with_pos(int row, int col);
private slots:
void clicked_handler();
};
#endif // ORBBOX_H
| 22.129032 | 70 | 0.66035 |
a7123d14de7fff8a745ed773de656050a70bbbdd | 2,688 | h | C | src/QLExpression.h | titanous/fdb-document-layer | d7980009e7a18f8ce88300d47a41cabf5e7ce74a | [
"Apache-2.0"
] | null | null | null | src/QLExpression.h | titanous/fdb-document-layer | d7980009e7a18f8ce88300d47a41cabf5e7ce74a | [
"Apache-2.0"
] | null | null | null | src/QLExpression.h | titanous/fdb-document-layer | d7980009e7a18f8ce88300d47a41cabf5e7ce74a | [
"Apache-2.0"
] | null | null | null | /*
* QLExpression.h
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* MongoDB is a registered trademark of MongoDB, Inc.
*/
#ifndef _QL_EXPRESSION_H_
#define _QL_EXPRESSION_H_
#pragma once
#include "flow/flow.h"
#include "QLContext.h"
#include "QLTypes.h"
/**
* An expression represents a pure function from a subdocument value to zero or more subdocument values
*/
struct IExpression {
virtual void addref() = 0;
virtual void delref() = 0;
virtual GenFutureStream<Reference<IReadContext>> evaluate(Reference<IReadContext> const& document) = 0;
virtual std::string toString() const = 0;
/**
* Bounds on the number of subdocuments that evaluate() could return (for any input)
*/
virtual int min_results() const { return 0; }
virtual int max_results() const { return std::numeric_limits<int>::max(); }
/**
* Return the name of the index which, if it exists, indexes by the values of this expression
*/
virtual Standalone<StringRef> get_index_key() const { return StringRef(); }
};
/**
* This expression implements a MongoDB dot-separated path expansion (it returns all subdocuments
* patching the given path, expanding arrays as necessary).
*/
struct ExtPathExpression : IExpression, ReferenceCounted<ExtPathExpression>, FastAllocated<ExtPathExpression> {
Standalone<StringRef> path;
bool expandLastArray;
bool imputeNulls;
void addref() { ReferenceCounted<ExtPathExpression>::addref(); }
void delref() { ReferenceCounted<ExtPathExpression>::delref(); }
std::string toString() const override { return "ExtPath(" + FDB::printable(path) + ")"; }
ExtPathExpression(Standalone<StringRef> const& path, bool const& expandLastArray, bool const& imputeNulls)
: path(path), expandLastArray(expandLastArray), imputeNulls(imputeNulls) {}
GenFutureStream<Reference<IReadContext>> evaluate(Reference<IReadContext> const& document) override;
Standalone<StringRef> get_index_key() const override {
return expandLastArray ? path : Standalone<StringRef>();
} // FIXME: a.$n?.b.$n
};
#endif
| 32.780488 | 111 | 0.743676 |
092fc8a61c899cc8a53e8700598e77ffde2a1a4f | 8,634 | c | C | xdk-asf-3.51.0/thirdparty/wireless/addons/boot/bootloader/src/srecParser.c | j3270/SAMD_Experiments | 5c242aff44fc8d7092322d7baf2dda450a78a9b7 | [
"MIT"
] | null | null | null | xdk-asf-3.51.0/thirdparty/wireless/addons/boot/bootloader/src/srecParser.c | j3270/SAMD_Experiments | 5c242aff44fc8d7092322d7baf2dda450a78a9b7 | [
"MIT"
] | null | null | null | xdk-asf-3.51.0/thirdparty/wireless/addons/boot/bootloader/src/srecParser.c | j3270/SAMD_Experiments | 5c242aff44fc8d7092322d7baf2dda450a78a9b7 | [
"MIT"
] | null | null | null | /**
* \file srecParser.c
*
* \brief Implementation of real time srec parser.
*
*
* Copyright (c) 2020 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
*
*/
/*
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
*/
/******************************************************************************
Includes section
******************************************************************************/
#include <types.h>
#include <abstractSerializer.h>
#include <bootStructure.h>
#include <flashLoader.h>
#include <eepromLoader.h>
#include "asf.h"
#include "uartSerializer.h"
#include <appEntry.h>
#include "app_info.h"
/******************************************************************************
Prototypes section
******************************************************************************/
static void srecWaitForType(SrecordType_t *srecType);
static uint8_t srecWaitForAddress(uint8_t addressLength);
static bool srecParser(void);
/******************************************************************************
Global variables section
******************************************************************************/
BootBuffer_t dataBuffer;
static uint32_t srecACK = ACK;
static uint32_t srecNACK = NACK;
static uint32_t previousAddress = 0xFFFFFFFF;
static uint32_t handshakeConf = HANDSHAKE_CONF;
extern app_info_t checkapp_info;
#define EEPROM_PAGE_SIZE 256u
/******************************************************************************
Implementation section
******************************************************************************/
/**************************************************************************//**
\brief Waiting for a field of the type from the serial interface.
\param[out]
srecType - pointer to buffer;
******************************************************************************/
static void srecWaitForType(SrecordType_t *srecType)
{
do
{
bootGetChar((uint8_t *)srecType, INFINITE);
} while(S_SYMBOL != (uint8_t)*srecType);
*srecType <<= 8;
bootGetChar((uint8_t *)srecType, INFINITE);
}
void jumpToApplication(void)
{ flag=0;
uint32_t appEntryPoint;
//uint32_t appEntryPoint = *(uint32_t *)(FLASH_END_ADDRESS - sizeof(uint32_t) + 1);
if(isCrcMatched==false)
{
appEntryPoint = (uint32_t )(0x4000);
}
else
{
appEntryPoint = checkapp_info.appTable[0].app_start_addr;
}
void(* startAddress)(void) =(void(*)(void))(*(uint32_t *)(appEntryPoint + sizeof(uint32_t)));
//__set_MSP(*(uint32_t *)appEntryPoint);
#ifdef __IAR_SYSTEMS_ICC__
__set_SP(*(uint32_t *)appEntryPoint);
#elif __GNUC__
__asm__ volatile ("mov r13, %0; \n\t"
:
: "r" (*(uint32_t *)appEntryPoint)
);
#endif
// nulling extended indirect register for indirect call out memory
CLEAR_EIND();
startAddress();
}
/**************************************************************************//**
\brief Waiting for a field of the type from the internal address
\param[in]
addressLength - length of address field;
\return
checksum with address field
******************************************************************************/
static uint8_t srecWaitForAddress(uint8_t addressLength)
{
uint8_t checksum = 0;
while(addressLength)
{
addressLength--;
bootGetChar((((uint8_t *)&dataBuffer.address) + addressLength), INFINITE);
checksum += *(((uint8_t *)&dataBuffer.address) + addressLength);
}
return checksum;
}
/**************************************************************************//**
\brief Communication support between host and mcu
******************************************************************************/
void srecProtocol(void)
{
while(1)
{
if (srecParser())
{
if ((S0 == dataBuffer.recordType) || (S5 == dataBuffer.recordType))
{
bootSetChar(sizeof(srecACK), (uint8_t*)(&srecACK));
continue;
}
if ((S7 == dataBuffer.recordType) || (S19 == dataBuffer.recordType) || (S9 == dataBuffer.recordType))
{
flashFlushPage();
eepromFlushPage();
bootSetChar(sizeof(srecACK), (uint8_t*)(&srecACK));
bootUnInitSerializer();
for(uint32_t i=0; i<64; i++)
{
nvm_erase_row(EEPROM_START_ADDRESS + (256u *i));
}
//jumpToApplication();
lowLevelUnInit();
flag = RESET_FLAG;
system_reset();
}
if (previousAddress == dataBuffer.address)
{ // host did not listen ack and repeat previous packet
bootSetChar(sizeof(srecACK), (uint8_t*)(&srecACK));
continue;
}
previousAddress = dataBuffer.address;
if ((dataBuffer.address + dataBuffer.dataSize) <= (FLASH_END_ADDRESS + 1))
{ // flash section
flashPacketToPage();
}
else if (dataBuffer.address < EEPROM_START_ADDRESS)
{
bootSetChar(sizeof(srecNACK), (uint8_t*)(&srecNACK));
continue;
}
if ((dataBuffer.address >= EEPROM_START_ADDRESS) && (dataBuffer.address <= EEPROM_END_ADDRESS))
{ // eeprom section
eepromPacketToPage();
}
// send ack
bootSetChar(sizeof(srecACK), (uint8_t*)(&srecACK));
}
else
{
bootSetChar(sizeof(srecNACK), (uint8_t*)(&srecNACK));
}
}
}
/**************************************************************************//**
\brief Real time parser of srec format.
\return
false - parse error
true - parse ok
******************************************************************************/
static bool srecParser(void)
{
uint8_t addressLength;
uint8_t packetLength;
uint8_t checksum = 0;
uint8_t checksumFromSerial;
// start of packet is transmitted as ascii code.
// the others are transmitted as hex code.
// search begin of packet
srecWaitForType(&dataBuffer.recordType);
switch (dataBuffer.recordType)
{
case S0: // the address field is 2 bytes
case S1:
case S5:
case S9:
addressLength = 2;
break;
case S2: // the address field is 3 bytes
case S19:
addressLength = 3;
break;
case S3: // the address field is 4 bytes
case S7:
addressLength = 4;
break;
default: // unsupported type
return false;
}
// get packet length
bootGetChar(&packetLength, INFINITE);
if (packetLength > (SREC_DATA_LENGTH + addressLength + CHECKSUM_AREA_SIZE))
return false; // this length is not correct
checksum += packetLength;
dataBuffer.dataSize = packetLength - addressLength - CHECKSUM_AREA_SIZE;
// get internal address
checksum += srecWaitForAddress(addressLength);
packetLength -= addressLength;
// get data array
uint8_t *tempPoiner = dataBuffer.data;
while (--packetLength)
{
bootGetChar(tempPoiner, INFINITE);
checksum += *tempPoiner++;
}
// get checksum
bootGetChar(&checksumFromSerial, INFINITE);
checksum += checksumFromSerial;
if (0xFF != checksum)
return false;
return true;
}
/**************************************************************************//**
\brief Handshake procedure.
******************************************************************************/
void srecHandshake(void)
{
if (bootScanInterfaces())
{
bootSetChar(sizeof(handshakeConf), (uint8_t *)(&handshakeConf)); // ack for handshake
return;
}
bootUnInitSerializer();
//jumpToApplication();
lowLevelUnInit();
flag = RESET_FLAG;
system_reset();
}
// eof srecParser.c
| 30.188811 | 107 | 0.573431 |
093190838b02a415eebc3221a4eff2f27ab50ac6 | 1,181 | h | C | cc/layer_tree_debug_state.h | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2018-03-10T13:08:49.000Z | 2018-03-10T13:08:49.000Z | cc/layer_tree_debug_state.h | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | cc/layer_tree_debug_state.h | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:19:31.000Z | 2020-11-04T07:19:31.000Z | // Copyright 2011 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 CC_LAYER_TREE_DEBUG_STATE_H_
#define CC_LAYER_TREE_DEBUG_STATE_H_
#include "cc/cc_export.h"
namespace cc {
class CC_EXPORT LayerTreeDebugState {
public:
LayerTreeDebugState();
~LayerTreeDebugState();
bool showFPSCounter;
bool showPlatformLayerTree;
bool showDebugBorders;
bool continuousPainting;
bool showPaintRects;
bool showPropertyChangedRects;
bool showSurfaceDamageRects;
bool showScreenSpaceRects;
bool showReplicaScreenSpaceRects;
bool showOccludingRects;
bool showNonOccludingRects;
int slowDownRasterScaleFactor;
void setRecordRenderingStats(bool);
bool recordRenderingStats() const;
bool traceAllRenderedFrames;
bool showHudInfo() const;
bool showHudRects() const;
static bool equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b);
static LayerTreeDebugState unite(const LayerTreeDebugState& a, const LayerTreeDebugState& b);
private:
bool m_recordRenderingStats;
};
} // namespace cc
#endif // CC_LAYER_TREE_DEBUG_STATE_H_
| 23.62 | 95 | 0.792549 |
2147843e3f9e66ff4bae44b3bf2a646a52ff9f6e | 4,660 | h | C | PID2.h | MartinL1/PID2 | 1d4b1a66c734f41e490613c101b5d589004ffbbe | [
"MIT"
] | 4 | 2019-02-27T16:09:16.000Z | 2022-02-07T05:29:35.000Z | PID2.h | MartinL1/PID2 | 1d4b1a66c734f41e490613c101b5d589004ffbbe | [
"MIT"
] | null | null | null | PID2.h | MartinL1/PID2 | 1d4b1a66c734f41e490613c101b5d589004ffbbe | [
"MIT"
] | null | null | null | /*
PID Controller class that implements both the classic and the
"derivative on measurement" PID controllers.
Copyright (C) Martin Lindupp 2018
V1.0.0 -- Initial release
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef _PID2_h
#define _PID2_h
// PID Controller class that implements both the classic and the "derivative on measurement" PID controllers
class PID
{
public:
PID(); // Default constructor
PID(float kp, float pMinLimit, float pMaxLimit); // P controller constructors
PID(float kp, float ki, float kd, float iMinLimit, // PID controller constructors
float iMaxLimit, float pidMinLimit, float pidMaxLimit);
void begin(float kp, float pMinLimit, float pMaxLimit); // Initialise the P controller
void begin(float kp, float ki, float kd, float iMinLimit, // Initialise the PID controller
float iMaxLimit, float pidMinLimit, float pidMaxLimit);
float pCalculate(float setpoint, float input); // Calculate the classic P control loop
float pidCalculate(float setpoint, float input, float dt); // Calculate the classic PID control loop
float pidCalculateDOM(float setpoint, float input, float dt); // Calculate the "Derivative on Measurement" PID control loop
void setKp(float kp); // Set the proportional P gain
void setKi(float ki); // Set the integral I gain
void setKd(float kd); // Set the derivative D gain
void setILimits(float iMinLimit, float iMaxLimit); // Set the integral I minimum and maximum limits to prevent integral wind-up
void setPIDLimits(float pidMinLimit, float pidMaxLimit); // Set the PID controller minimum and maximum output limits
void setIMinLimit(float iMinLimit); // Set the integral I minimum limit
void setIMaxLimit(float iMaxLimit); // Set the integral I maximum limit
void setPIDMinLimit(float pidMinLimit); // Set the PID controller minimum output limit
void setPIDMaxLimit(float pidMaxLimit); // Set the PID controller maximum output limit
void setPrevError(float prevError); // Set the previous error value
void setPrevInput(float prevInput); // Set the previous input value
float getKp(); // Get the proportional P gain
float getKi(); // Get the integral I gain
float getKd(); // Get the derivative D gain
float getILimit(); // Get the integral limits
float getPIDLimit(); // Get the PID output limits
float getIMinLimit(); // Get the integral minimum limit
float getIMaxLimit(); // Get the integral maximum limit
float getPIDMinLimit(); // Get the PID output minimum limit
float getPIDMaxLimit(); // Get the PID output maximum limit
float getPrevError(); // Get the previous error
float getPrevInput(); // Get the previous input
//private:
float kp, ki, kd; // PID gain terms
float iTerm; // The summing integral I term
float prevError, prevInput; // Previous error and input used to calculate the derivative D term
float iMinLimit, iMaxLimit, pidMinLimit, pidMaxLimit; // Integral I and PID minimum and maximum output limits
};
#endif
| 63.835616 | 172 | 0.654506 |
2169b3fadd2637353a8c82f8748e7b9ad5e9b97b | 1,433 | c | C | Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformCmosAccessLib/PlatformCmosAccessLib.c | heatd/edk2-platforms | eb2d49b5a7d1403c2ea332d546c5b27e43d9ba2c | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 373 | 2016-04-18T09:22:36.000Z | 2022-03-30T14:19:06.000Z | Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformCmosAccessLib/PlatformCmosAccessLib.c | heatd/edk2-platforms | eb2d49b5a7d1403c2ea332d546c5b27e43d9ba2c | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 25 | 2020-06-24T00:44:40.000Z | 2021-08-22T09:39:33.000Z | Platform/Intel/WhitleyOpenBoardPkg/Library/PlatformCmosAccessLib/PlatformCmosAccessLib.c | heatd/edk2-platforms | eb2d49b5a7d1403c2ea332d546c5b27e43d9ba2c | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 341 | 2016-05-05T15:46:20.000Z | 2022-03-28T06:57:39.000Z | /** @file
Platform CMOS Access Library.
@copyright
Copyright 2015 - 2021 Intel Corporation. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Library/IoLib.h>
#include <Library/PlatformCmosAccessLib.h>
#include <Platform.h>
#include <Uefi.h>
#include <PiPei.h>
#include <Library/PchInfoLib.h>
#include <Register/PchRegsPcr.h>
#include <Library/PeiServicesLib.h>
#include <Ppi/DynamicSiLibraryPpi.h>
#include <Library/DebugLib.h>
/**
Return the platform CMOS entries.
@param [out] EnryCount Number of platform CMOS entries.
@return Platform CMOS entries.
**/
CMOS_ENTRY *
EFIAPI
PlatformCmosGetEntry (
OUT UINTN *EntryCount
)
{
*EntryCount = 0;
return NULL;
}
/**
Return the NMI enable status.
**/
BOOLEAN
EFIAPI
PlatformCmosGetNmiState (
VOID
)
{
volatile UINT32 Data32;
BOOLEAN Nmi;
Data32 = 0;
EFI_STATUS Status = EFI_SUCCESS;
DYNAMIC_SI_LIBARY_PPI *DynamicSiLibraryPpi = NULL;
Status = PeiServicesLocatePpi (&gDynamicSiLibraryPpiGuid, 0, NULL, &DynamicSiLibraryPpi);
if (EFI_ERROR (Status)) {
ASSERT_EFI_ERROR (Status);
return FALSE;
}
//
// Preserve NMI bit setting
//
if ((DynamicSiLibraryPpi->ReadNmiEn ())& B_PCH_IO_NMI_EN_NMI_EN) {
Nmi = TRUE;
}
else
Nmi = FALSE;
return Nmi;
}
| 19.364865 | 92 | 0.634334 |
99efec7c988592ccade71db4f2f7b16d90c35d91 | 1,132 | c | C | src/core/strtoken.c | bjnw/libft | d351310c09041377ed491628f5b24c3293cf5117 | [
"WTFPL"
] | 3 | 2020-10-13T18:55:41.000Z | 2022-02-19T03:37:11.000Z | src/core/strtoken.c | bjnw/libft | d351310c09041377ed491628f5b24c3293cf5117 | [
"WTFPL"
] | null | null | null | src/core/strtoken.c | bjnw/libft | d351310c09041377ed491628f5b24c3293cf5117 | [
"WTFPL"
] | 1 | 2021-01-10T16:14:27.000Z | 2021-01-10T16:14:27.000Z | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* strtoken.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ourgot <ourgot@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/12/24 20:30:44 by ourgot #+# #+# */
/* Updated: 2019/12/24 20:30:44 by ourgot ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *strtoken(const char *s, const char *delim, char **endptr)
{
char *p;
p = strskip(s, delim, NULL);
if (*p == '\0')
{
if (endptr)
*endptr = p;
return (NULL);
}
strfind(p, delim, endptr);
return (p);
}
| 39.034483 | 80 | 0.204064 |
e53a2a21912c7df55be1db9afd256bc2ec79d240 | 886 | c | C | lib/charbuffer/misc/replace.c | peter-mount/libarea51 | 6cdb8ed38c7cd5764e8a895cf9ab9d3189c8b117 | [
"Apache-2.0"
] | null | null | null | lib/charbuffer/misc/replace.c | peter-mount/libarea51 | 6cdb8ed38c7cd5764e8a895cf9ab9d3189c8b117 | [
"Apache-2.0"
] | null | null | null | lib/charbuffer/misc/replace.c | peter-mount/libarea51 | 6cdb8ed38c7cd5764e8a895cf9ab9d3189c8b117 | [
"Apache-2.0"
] | null | null | null |
#include <stdlib.h>
#include <memory.h>
#include <stdio.h>
#include <area51/charbuffer.h>
#include "../charbuffer-int.h"
void charbuffer_replace(CharBuffer *b, char *k, char *v) {
if (!b || !k || !v)
return;
charbuffer_lock(b);
int kl = strlen(k);
int vl = strlen(v);
int i = 0;
while (i <= (b->pos - kl)) {
if (strncmp(&b->buffer[i], k, kl) == 0) {
charbuffer_ensure_capacity(b, b->pos + vl);
memmove(&b->buffer[i + vl], &b->buffer[i + kl], b->pos - i - kl + vl);
memcpy(&b->buffer[i], v, vl);
b->pos = b->pos - kl + vl;
i += vl;
} else
i++;
}
charbuffer_unlock(b);
}
#define INT_LEN 31
void charbuffer_replace_int(CharBuffer *b, char *k, int v) {
char buf[INT_LEN + 1];
snprintf(buf, INT_LEN, "%d", v);
charbuffer_replace(b, k, buf);
}
| 22.717949 | 82 | 0.520316 |
fbdc389a1c60fe76d211f5f7f7866fda1b8d81bb | 315 | h | C | sw/logger/delay.h | tudelft/highspeedlogger | 4259c8567b3ac63c5842bd6eec6808feb44f95e9 | [
"MIT"
] | 7 | 2015-01-31T13:46:21.000Z | 2018-05-09T11:12:10.000Z | sw/logger/delay.h | tudelft/highspeedlogger | 4259c8567b3ac63c5842bd6eec6808feb44f95e9 | [
"MIT"
] | 1 | 2017-07-10T16:04:33.000Z | 2017-07-10T16:04:33.000Z | sw/logger/delay.h | tudelft/highspeedlogger | 4259c8567b3ac63c5842bd6eec6808feb44f95e9 | [
"MIT"
] | 6 | 2015-08-14T01:00:30.000Z | 2020-03-23T20:33:34.000Z | #ifndef DELAY_H
#define DELAY_H
//#include "core_cm4.h"
static __IO uint32_t TimingDelay;
//void Delay(__IO uint32_t nCount);
void Delay(uint32_t nCount) {
TimingDelay = nCount;
while(TimingDelay--) { }
}
void TimingDelay_Decrement(void) {
if (TimingDelay != 0x00) {
TimingDelay--;
}
}
#endif
| 13.125 | 35 | 0.685714 |
05ccb327da99d44bbf710385e7cba072dbccf313 | 1,758 | h | C | wwLabVIew.h | WardWitt/KleinView | c58a697caa2b972c1bd6fbf8b3e1277f50df2448 | [
"BSD-3-Clause"
] | null | null | null | wwLabVIew.h | WardWitt/KleinView | c58a697caa2b972c1bd6fbf8b3e1277f50df2448 | [
"BSD-3-Clause"
] | null | null | null | wwLabVIew.h | WardWitt/KleinView | c58a697caa2b972c1bd6fbf8b3e1277f50df2448 | [
"BSD-3-Clause"
] | null | null | null | //
// wwLabView.h
// KleinView
//
// Created by Ward Witt on 6/20/11.
// Copyright 2012 Filmworkers Club. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
// conditions are met:
// • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided with the distribution.
// • Neither the name of the Filmworkers Club nor the names of its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Cocoa/Cocoa.h>
@interface wwLabView : NSView {
float a,b;
@private
}
-(void)setA:(float)Lab_a B:(float)Lab_b;
@end
| 50.228571 | 137 | 0.763367 |
b25759f34050173b131a65a6982e9241ac85196b | 20,736 | c | C | game/src/field/crops_data.c | VerbruggenD/GBA-game | 675b15884da2a0042e8692eead7ff957df8249a8 | [
"MIT"
] | null | null | null | game/src/field/crops_data.c | VerbruggenD/GBA-game | 675b15884da2a0042e8692eead7ff957df8249a8 | [
"MIT"
] | null | null | null | game/src/field/crops_data.c | VerbruggenD/GBA-game | 675b15884da2a0042e8692eead7ff957df8249a8 | [
"MIT"
] | null | null | null |
//{{BLOCK(Crops)
//======================================================================
//
// Crops, 32x224@8,
// Transparent color : 00,00,00
// + 112 tiles not compressed
// Total size: 7168 = 7168
//
// Time-stamp: 2022-01-25, 15:41:59
// Exported by Cearn's GBA Image Transmogrifier, v0.8.16
// ( http://www.coranac.com/projects/#grit )
//
//======================================================================
const unsigned int CropsTiles[1792] __attribute__((aligned(4))) __attribute__((visibility("hidden")))=
{
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000101,0x00000000,0x00000101,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00007878,0x00000000,0x00007878,0x00000000,0x00000000,0x02020000,0x00000000,0x02020000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000101,0x00000000,0x00000101,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x03030000,0x00000000,0x03030000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x03030000,0x00000000,0x03030000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x01010000,0x00000000,0x01010000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x02020000,0x00000000,0x02020000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00007878,0x00000000,0x00007878,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x05050000,0x00000000,0x05050000,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000404,0x00000404,0x00000404,0x00000404,
0x00000606,0x07070000,0x00000606,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000404,0x00000000,0x00000404,
0x05050000,0x00000606,0x05050000,0x00000606,0x07070000,0x00000000,0x07070000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000404,0x00000000,0x00000404,0x00000000,
0x00000606,0x00000000,0x00000606,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x08080000,0x00000000,0x08080000,0x00000000,0x00000808,0x00000000,0x00000808,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x09090000,0x00000000,0x09090000,0x00000000,0x0B0B0000,0x00000C0C,0x0B0B0000,0x00000C0C,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000A0A,0x00000000,0x00000A0A,0x00000000,0x00000C0C,0x0B0B0000,0x00000C0C,0x0B0B0000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000A0A,0x00000000,0x00000A0A,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,
0x00000000,0x00000D0D,0x00000000,0x00000D0D,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000404,0x00000000,0x00000404,
0x00000000,0x00000D0D,0x00000000,0x00000D0D,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,
0x0E0E0000,0x0E0E0000,0x0E0E0000,0x0E0E0000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x0B0B0000,0x00000000,0x0B0B0000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000404,0x00000000,0x00000404,0x00000000,
0x00000000,0x07070F0F,0x00000000,0x07070F0F,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x08080000,0x00000000,0x08080000,0x00000000,0x00000000,0x00000C0C,0x00000000,0x00000C0C,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x0C0C1010,0x05050000,0x0C0C1010,0x05050000,0x00000C0C,0x07070000,0x00000C0C,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00001111,0x00000000,0x00001111,0x00000000,0x0B0B0909,0x00000000,0x0B0B0909,
0x00000000,0x0C0C0000,0x00000000,0x0C0C0000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x0B0B0000,0x00001212,0x0B0B0000,0x00001212,
0x0C0C1010,0x00000000,0x0C0C1010,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x0B0B0000,0x0B0B0000,0x0B0B0000,0x0B0B0000,
0x00000000,0x07071313,0x00000000,0x07071313,0x00000000,0x07070000,0x00000000,0x07070000,
0x12121010,0x00000000,0x12121010,0x00000000,0x00001212,0x00000000,0x00001212,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x0B0B0000,0x00000808,0x0B0B0000,0x00000808,
0x00000000,0x08081414,0x00000000,0x08081414,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000E0E,0x00000000,0x00000E0E,0x00000000,0x00000C0C,0x0B0B0000,0x00000C0C,0x0B0B0000,
0x00001515,0x0C0C1010,0x00001515,0x0C0C1010,0x0B0B0909,0x00000C0C,0x0B0B0909,0x00000C0C,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x08080000,0x00000A0A,0x08080000,0x00000A0A,0x00000000,0x0B0B0909,0x00000000,0x0B0B0909,
0x00000000,0x00000000,0x00000000,0x00000000,0x0B0B0000,0x00000000,0x0B0B0000,0x00000000,
0x0C0C1010,0x00000000,0x0C0C1010,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000D0D,0x00000000,0x00000D0D,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,
0x05051111,0x07070000,0x05051111,0x07070000,0x07070000,0x07070505,0x07070000,0x07070505,
0x00000000,0x00000000,0x00000000,0x00000000,0x0B0B0000,0x00001616,0x0B0B0000,0x00001616,
0x12121717,0x00000000,0x12121717,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00001818,0x00000000,0x00001818,0x1E1E0000,0x20201F1F,0x1E1E0000,0x20201F1F,
0x1C1C0000,0x28282727,0x1C1C0000,0x28282727,0x00000000,0x20202828,0x00000000,0x20202828,
0x00000000,0x19190000,0x00000000,0x19190000,0x1E1E1E1E,0x21211919,0x1E1E1E1E,0x21211919,
0x2A2A2929,0x20202B2B,0x2A2A2929,0x20202B2B,0x00000000,0x20200000,0x00000000,0x20200000,
0x1B1B1A1A,0x1C1C0000,0x1B1B1A1A,0x1C1C0000,0x23232222,0x00002424,0x23232222,0x00002424,
0x28280000,0x00002C2C,0x28280000,0x00002C2C,0x20200000,0x00000000,0x20200000,0x00000000,
0x00001D1D,0x00000000,0x00001D1D,0x00000000,0x1E1E2525,0x00002626,0x1E1E2525,0x00002626,
0x2E2E2D2D,0x00000000,0x2E2E2D2D,0x00000000,0x20202828,0x00000000,0x20202828,0x00000000,
0x00000000,0x22222F2F,0x00000000,0x22222F2F,0x21210000,0x23232222,0x21210000,0x23232222,
0x00000000,0x32323333,0x00000000,0x32323333,0x00000000,0x1E1E3232,0x00000000,0x1E1E3232,
0x1E1E0000,0x00000000,0x1E1E0000,0x00000000,0x1E1E0000,0x20201F1F,0x1E1E0000,0x20201F1F,
0x34340000,0x00003535,0x34340000,0x00003535,0x21210000,0x1E1E3232,0x21210000,0x1E1E3232,
0x00003030,0x25250000,0x00003030,0x25250000,0x1E1E1E1E,0x1E1E0000,0x1E1E1E1E,0x1E1E0000,
0x2E2E3636,0x37370000,0x2E2E3636,0x37370000,0x20202828,0x21210000,0x20202828,0x21210000,
0x25250000,0x00003131,0x25250000,0x00003131,0x1E1E3232,0x00002626,0x1E1E3232,0x00002626,
0x39393838,0x00000000,0x39393838,0x00000000,0x00003A3A,0x00000000,0x00003A3A,0x00000000,
0x00000000,0x00003B3B,0x00000000,0x00003B3B,0x00000000,0x1E1E0000,0x00000000,0x1E1E0000,
0x32320000,0x2E2E3636,0x32320000,0x2E2E3636,0x1E1E1E1E,0x20202828,0x1E1E1E1E,0x20202828,
0x00000000,0x00003C3C,0x00000000,0x00003C3C,0x1E1E0000,0x00003E3E,0x1E1E0000,0x00003E3E,
0x37370000,0x00003F3F,0x37370000,0x00003F3F,0x21210000,0x00001C1C,0x21210000,0x00001C1C,
0x19190000,0x3D3D0000,0x19190000,0x3D3D0000,0x21211919,0x00000000,0x21211919,0x00000000,
0x25254040,0x00004141,0x25254040,0x00004141,0x1E1E3232,0x20202E2E,0x1E1E3232,0x20202E2E,
0x22221E1E,0x00000000,0x22221E1E,0x00000000,0x23232222,0x00000000,0x23232222,0x00000000,
0x1B1B4242,0x00000000,0x1B1B4242,0x00000000,0x23232222,0x00000000,0x23232222,0x00000000,
0x43430000,0x28284444,0x43430000,0x28284444,0x00000000,0x20200000,0x00000000,0x20200000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x3A3A0000,0x39394545,0x3A3A0000,0x39394545,0x00000000,0x00003A3A,0x00000000,0x00003A3A,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x3A3A4646,0x28280000,0x3A3A4646,0x28280000,0x00003A3A,0x20200000,0x00003A3A,0x20200000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x48484747,0x00000000,0x48484747,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x49490000,0x00000000,0x49490000,0x00000000,0x02024949,0x00000000,0x02024949,
0x00000000,0x4F4F0000,0x00000000,0x4F4F0000,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00004B4B,0x4C4C0000,0x00004B4B,0x4C4C0000,
0x00000000,0x00000000,0x00000000,0x00000000,0x4C4C0000,0x00000000,0x4C4C0000,0x00000000,
0x00004A4A,0x00000000,0x00004A4A,0x00000000,0x4E4E4D4D,0x4C4C0000,0x4E4E4D4D,0x4C4C0000,
0x00005050,0x00000000,0x00005050,0x00000000,0x00000C0C,0x00005151,0x00000C0C,0x00005151,
0x00004A4A,0x00000000,0x00004A4A,0x00000000,0x4E4E4D4D,0x00000000,0x4E4E4D4D,0x00000000,
0x00005050,0x00000000,0x00005050,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x02025252,0x00005353,0x02025252,0x00005353,0x02025555,0x00005656,0x02025555,0x00005656,
0x4F4F0000,0x00000000,0x4F4F0000,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,
0x54540000,0x4E4E4D4D,0x54540000,0x4E4E4D4D,0x4E4E0000,0x4E4E4D4D,0x4E4E0000,0x4E4E4D4D,
0x00000000,0x00005757,0x00000000,0x00005757,0x00000000,0x00000C0C,0x00000000,0x00000C0C,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x49490000,0x00000000,0x49490000,0x00000000,0x02024949,0x00000000,0x02024949,
0x00000000,0x4D4D5A5A,0x00000000,0x4D4D5A5A,0x00000000,0x4E4E0000,0x00000000,0x4E4E0000,
0x0E0E0000,0x49490000,0x0E0E0000,0x49490000,0x00005959,0x02024949,0x00005959,0x02024949,
0x00005B5B,0x4D4D5A5A,0x00005B5B,0x4D4D5A5A,0x00000000,0x4E4E0000,0x00000000,0x4E4E0000,
0x00000000,0x00000606,0x00000000,0x00000606,0x00005959,0x4C4C0000,0x00005959,0x4C4C0000,
0x00005B5B,0x4B4B0000,0x00005B5B,0x4B4B0000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00005858,0x00000000,0x00005858,0x00000000,0x4E4E4D4D,0x00000000,0x4E4E4D4D,0x00000000,
0x4B4B5C5C,0x00000000,0x4B4B5C5C,0x00000000,0x00004B4B,0x00000000,0x00004B4B,0x00000000,
0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,0x00000000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000C0C,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00005D5D,0x00000000,0x00005D5D,0x07070000,0x4C4C4C4C,0x07070000,0x4C4C4C4C,
0x00000000,0x49496060,0x00000000,0x49496060,0x07070000,0x02025555,0x07070000,0x02025555,
0x00005E5E,0x00000000,0x00005E5E,0x00000000,0x00001212,0x00001212,0x00001212,0x00001212,
0x07076161,0x00001313,0x07076161,0x00001313,0x07076666,0x07070707,0x07076666,0x07070707,
0x5F5F0000,0x49494C4C,0x5F5F0000,0x49494C4C,0x4C4C5F5F,0x02024949,0x4C4C5F5F,0x02024949,
0x4D4D6262,0x64646363,0x4D4D6262,0x64646363,0x4E4E6767,0x0B0B6464,0x4E4E6767,0x0B0B6464,
0x00005E5E,0x00001313,0x00005E5E,0x00001313,0x00001212,0x00001616,0x00001212,0x00001616,
0x0C0C6565,0x00000000,0x0C0C6565,0x00000000,0x00000C0C,0x00000000,0x00000C0C,0x00000000,
0x00000000,0x4F4F6868,0x00000000,0x4F4F6868,0x07070000,0x07070707,0x07070000,0x07070707,
0x00000000,0x5F5F6E6E,0x00000000,0x5F5F6E6E,0x00000000,0x4C4C0000,0x00000000,0x4C4C0000,
0x0B0B6969,0x4C4C4949,0x0B0B6969,0x4C4C4949,0x0B0B0B0B,0x4C4C6C6C,0x0B0B0B0B,0x4C4C6C6C,
0x05056F6F,0x4D4D7070,0x05056F6F,0x4D4D7070,0x07077373,0x4E4E7474,0x07077373,0x4E4E7474,
0x0B0B6A6A,0x07076B6B,0x0B0B6A6A,0x07076B6B,0x0B0B6D6D,0x07070707,0x0B0B6D6D,0x07070707,
0x09097171,0x5F5F7272,0x09097171,0x5F5F7272,0x0B0B6464,0x4C4C5F5F,0x0B0B6464,0x4C4C5F5F,
0x0C0C6565,0x00000000,0x0C0C6565,0x00000000,0x00000C0C,0x00001616,0x00000C0C,0x00001616,
0x49494C4C,0x00001616,0x49494C4C,0x00001616,0x02024949,0x00001616,0x02024949,0x00001616,
0x12120000,0x4D4D7575,0x12120000,0x4D4D7575,0x00000000,0x4E4E7474,0x00000000,0x4E4E7474,
0x12120000,0x07071515,0x12120000,0x07071515,0x00000000,0x07070000,0x00000000,0x07070000,
0x49494949,0x07070707,0x49494949,0x07070707,0x02020202,0x07070707,0x02020202,0x07070707,
0x4F4F4F4F,0x09097777,0x4F4F4F4F,0x09097777,0x07070707,0x0B0B0B0B,0x07070707,0x0B0B0B0B,
0x07070505,0x4D4D6262,0x07070505,0x4D4D6262,0x07070505,0x4E4E6767,0x07070505,0x4E4E6767,
0x09090707,0x07070505,0x09090707,0x07070505,0x0B0B0909,0x07070505,0x0B0B0909,0x07070505,
0x4F4F6363,0x00007676,0x4F4F6363,0x00007676,0x07074F4F,0x00000000,0x07074F4F,0x00000000,
0x12126565,0x00007676,0x12126565,0x00007676,0x00001212,0x00000000,0x00001212,0x00000000,
0x00000000,0x00000606,0x00000000,0x00000606,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000606,0x0B0B1414,0x00000606,0x0B0B1414,0x07070000,0x0B0B0000,0x07070000,0x0B0B0000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x05051212,0x07071313,0x05051212,0x07071313,0x07070000,0x07070000,0x07070000,0x07070000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x0C0C0000,0x00000000,0x0C0C0000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
};
//}}BLOCK(Crops)
| 75.956044 | 102 | 0.877074 |
58e40ada0b3250ca13cf8a3e58612d92fc15ee64 | 2,865 | h | C | src/wrapper/cplusplus/openccxx.h | argolab/OpenCC | c6585a3bf5d23b2a12658afd233ddf733d36690f | [
"Apache-2.0"
] | null | null | null | src/wrapper/cplusplus/openccxx.h | argolab/OpenCC | c6585a3bf5d23b2a12658afd233ddf733d36690f | [
"Apache-2.0"
] | null | null | null | src/wrapper/cplusplus/openccxx.h | argolab/OpenCC | c6585a3bf5d23b2a12658afd233ddf733d36690f | [
"Apache-2.0"
] | null | null | null | /*
* Open Chinese Convert
*
* Copyright 2010 BYVoid <byvoid.kcp@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 __OPENCCXX_H_
#define __OPENCCXX_H_
/**
* c++ wrapper for opencc
*/
#ifdef __cplusplus
extern "C" {
#include <opencc.h>
}
#include <string>
#include <cstdlib>
namespace opencc
{
class opencc
{
public:
opencc(const char * config_file = NULL)
: od((opencc_t) -1)
{
open(config_file);
}
virtual ~opencc()
{
if (od != (opencc_t) -1)
opencc_close(od);
}
operator bool() const
{
return od != (opencc_t) -1;
}
int open(const char * config_file)
{
if (od != (opencc_t) -1)
opencc_close(od);
od = opencc_open(config_file);
return (od == (opencc_t) -1) ? (-1) : (0);
}
int set_conversion_mode(opencc_conversion_mode conversion_mode)
{
if (od == (opencc_t) -1)
return -1;
opencc_set_conversion_mode(od, conversion_mode);
return 0;
}
long convert(const std::string &in, std::string &out, long length = -1)
{
if (od == (opencc_t) -1)
return -1;
if (length == -1)
length = in.length();
char * outbuf = opencc_convert_utf8(od, in.c_str(), length);
if (outbuf == (char *) -1)
return -1;
out = outbuf;
free(outbuf);
return length;
}
/**
* Warning:
* This method can be used only if wchar_t is encoded in UCS4 on your platform.
*/
long convert(const std::wstring &in, std::wstring &out, long length = -1)
{
if (od == (opencc_t) -1)
return -1;
size_t inbuf_left = in.length ();
if (length >= 0 && length < (long)inbuf_left)
inbuf_left = length;
const ucs4_t * inbuf = (const ucs4_t *) in.c_str();
long count = 0;
while (inbuf_left != 0)
{
size_t retval;
size_t outbuf_left;
ucs4_t * outbuf;
/* occupy space */
outbuf_left = inbuf_left + 64;
out.resize (count + outbuf_left);
outbuf = (ucs4_t *)out.c_str () + count;
retval = opencc_convert (od, (ucs4_t **)&inbuf,
&inbuf_left, &outbuf, &outbuf_left);
if (retval == (size_t) -1)
return -1;
count += retval;
}
/* set the zero termination and shrink the size */
out.resize (count + 1);
out[count] = L'\0';
return count;
}
opencc_error errno() const
{
return opencc_errno();
}
void perror(const char * spec = "OpenCC") const
{
opencc_perror(spec);
}
private:
opencc_t od;
};
};
#endif
#endif /* __OPENCCXX_H_ */
| 18.483871 | 79 | 0.647818 |
71c5722b0a80a164096b3c1843f0ddb3db706443 | 2,325 | h | C | source/Math/SIMDVector.h | cepsylon/DivisionByZeroFramework | c856ab75d4c1742a6cadd1986ce6c8a17a717b2f | [
"MIT"
] | null | null | null | source/Math/SIMDVector.h | cepsylon/DivisionByZeroFramework | c856ab75d4c1742a6cadd1986ce6c8a17a717b2f | [
"MIT"
] | null | null | null | source/Math/SIMDVector.h | cepsylon/DivisionByZeroFramework | c856ab75d4c1742a6cadd1986ce6c8a17a717b2f | [
"MIT"
] | null | null | null | #pragma once
#include "GlobalDefines.h"
#if IS_WINDOWS_PLATFORM
#include <xmmintrin.h>
#include <immintrin.h>
namespace SIMD
{
using Vector = __m128;
inline Vector Load(float aX, float aY, float aZ, float aW)
{
alignas(16) float vector[] = { aX, aY, aZ, aW };
return _mm_load_ps(vector);
}
inline Vector Load(float aValue)
{
alignas(16) float vector[] = { aValue, aValue, aValue, aValue };
return _mm_load_ps(vector);
}
inline Vector Add(const Vector& aLeft, const Vector& aRight)
{
return _mm_add_ps(aLeft, aRight);
}
inline Vector Subtract(const Vector& aLeft, const Vector& aRight)
{
return _mm_sub_ps(aLeft, aRight);
}
inline Vector Multiply(const Vector& aLeft, const Vector& aRight)
{
return _mm_mul_ps(aLeft, aRight);
}
inline Vector Multiply(const Vector& aVector, float aScalar)
{
return Multiply(aVector, Load(aScalar));
}
inline Vector Divide(const Vector& aLeft, const Vector& aRight)
{
return _mm_div_ps(aLeft, aRight);
}
inline Vector Divide(const Vector& aVector, float aScalar)
{
return Divide(aVector, Load(aScalar));
}
inline Vector MultiplyAdd(const Vector& aLeftMultiply, const Vector& aRightMultiply, const Vector& anAddVector)
{
return _mm_fmadd_ps(aLeftMultiply, aRightMultiply, anAddVector);
}
// Creates vector with values (aLeft[anIndex0], aLeft[anIndex1], aRight[anIndex2], aRight[anIndex3])
template <unsigned int Index0, unsigned int Index1, unsigned int Index2, unsigned int Index3>
Vector Shuffle(const Vector& aLeft, const Vector& aRight)
{
return _mm_shuffle_ps(aLeft, aRight, _MM_SHUFFLE(Index3, Index2, Index1, Index0));
}
}
#define SIMD_VECTOR_INDEX_OPERATOR(aVector, anIndex) aVector.m128_f32[anIndex]
#else
// TODO: have this working
namespace SIMD
{
using Vector = __m128;
inline Vector Load(float aX, float aY, float aZ, float aW)
{
alignas(16) float vector[] = { aX, aY, aZ, aW };
return __mm_load_ps(vector);
}
inline Vector Load(float aValue)
{
alignas(16) float vector[] = { aValue, aValue, aValue, aValue };
return __mm_load_ps(vector);
}
inline Vector Add(const Vector& aLeft, const Vector& aRight)
{
return __mm_add_ps(aLeft, aRight);
}
inline Vector Subtract(const Vector& aLeft, const Vector& aRight)
{
return __mm_sub_ps(aLeft, aRight);
}
}
#endif // IS_WINDOWS_PLATFORM
| 22.794118 | 112 | 0.725161 |
68f08e13ce335520388db1e186563199495d546a | 370 | h | C | GoogleWifi Headers/GOOButtonBarButton.h | LemaMichael/BetterGoogleWifi | b02a0adc35d80f1fa9443874d12de483c3d63c06 | [
"MIT"
] | 1 | 2022-01-25T13:08:30.000Z | 2022-01-25T13:08:30.000Z | GoogleWifi Headers/GOOButtonBarButton.h | LemaMichael/BetterGoogleWifi | b02a0adc35d80f1fa9443874d12de483c3d63c06 | [
"MIT"
] | null | null | null | GoogleWifi Headers/GOOButtonBarButton.h | LemaMichael/BetterGoogleWifi | b02a0adc35d80f1fa9443874d12de483c3d63c06 | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import "QTMButton.h"
@interface GOOButtonBarButton : QTMButton
{
}
- (id)view;
- (double)inkRadius;
- (void)layoutSubviews;
- (struct CGSize)sizeThatFits:(struct CGSize)arg1;
@end
| 18.5 | 90 | 0.686486 |
d5ec81a1053b1c250977dfceaf14c3df120f9364 | 5,496 | h | C | Mono.System.Core/Mono.System.Core/Generated Bindings/System_Dynamic_DynamicObject.h | lemonmojo/Dubrovnik | eb741a76554f6233fc132aa7b5970ad943e91d2a | [
"MIT"
] | 9 | 2015-01-15T20:07:16.000Z | 2020-03-20T02:38:27.000Z | Mono.System.Core/Mono.System.Core/Generated Bindings/System_Dynamic_DynamicObject.h | lemonmojo/Dubrovnik | eb741a76554f6233fc132aa7b5970ad943e91d2a | [
"MIT"
] | 32 | 2015-10-01T21:32:01.000Z | 2020-09-28T12:50:58.000Z | Mono.System.Core/Mono.System.Core/Generated Bindings/System_Dynamic_DynamicObject.h | lemonmojo/Dubrovnik | eb741a76554f6233fc132aa7b5970ad943e91d2a | [
"MIT"
] | 3 | 2015-10-02T14:07:30.000Z | 2019-03-11T11:38:41.000Z | //++Dubrovnik.CodeGenerator System_Dynamic_DynamicObject.h
//
// Managed class : DynamicObject
//
//
// Frameworks
//
#import <Dubrovnik/Dubrovnik.h>
//
// Optional extra import. Not auto generated. Add manually to project only if required.
//
#if __has_include("System_Dynamic_DynamicObject.__Extra__.h")
#import "System_Dynamic_DynamicObject.__Extra__.h"
#endif
//
// Forward class and protocol declarations
//
@class System_Array;
@class System_Boolean;
@class System_Collections_Generic_IEnumerableA1;
@class System_Dynamic_BinaryOperationBinder;
@class System_Dynamic_ConvertBinder;
@class System_Dynamic_CreateInstanceBinder;
@class System_Dynamic_DeleteIndexBinder;
@class System_Dynamic_DeleteMemberBinder;
@class System_Dynamic_DynamicMetaObject;
@class System_Dynamic_DynamicObject;
@class System_Dynamic_GetIndexBinder;
@class System_Dynamic_GetMemberBinder;
@class System_Dynamic_IDynamicMetaObjectProvider;
@class System_Dynamic_InvokeBinder;
@class System_Dynamic_InvokeMemberBinder;
@class System_Dynamic_SetIndexBinder;
@class System_Dynamic_SetMemberBinder;
@class System_Dynamic_UnaryOperationBinder;
@class System_Object;
@class System_String;
@protocol System_Collections_Generic_IEnumerableA1;
@protocol System_Collections_Generic_IEnumerableA1_;
//
// Local assembly imports
//
//
// Import superclass and adopted protocols
//
#import "System_Dynamic_IDynamicMetaObjectProvider_Protocol.h"
@interface System_Dynamic_DynamicObject : System_Object <System_Dynamic_IDynamicMetaObjectProvider_>
#pragma mark -
#pragma mark Setup
+ (const char *)monoClassName;
+ (const char *)monoAssemblyName;
#pragma mark -
#pragma mark Methods
/**
Managed method.
@textblock
Name
GetDynamicMemberNames
Params
(none)
Return
System.Collections.Generic.IEnumerable`1<System.String>
@/textblock
*/
- (System_Object <System_Collections_Generic_IEnumerableA1> *)getDynamicMemberNames;
/* Skipped method : System.Dynamic.DynamicMetaObject GetMetaObject(System.Linq.Expressions.Expression parameter) */
/**
Managed method.
@textblock
Name
TryBinaryOperation
Params
System.Dynamic.BinaryOperationBinder
System.Object
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryBinaryOperation_withBinder:(System_Dynamic_BinaryOperationBinder *)p1 arg:(id <DBMonoObject>)p2 resultRef:(System_Object **)p3;
/**
Managed method.
@textblock
Name
TryConvert
Params
System.Dynamic.ConvertBinder
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryConvert_withBinder:(System_Dynamic_ConvertBinder *)p1 resultRef:(System_Object **)p2;
/**
Managed method.
@textblock
Name
TryCreateInstance
Params
System.Dynamic.CreateInstanceBinder
System.Object[]
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryCreateInstance_withBinder:(System_Dynamic_CreateInstanceBinder *)p1 args:(System_Array *)p2 resultRef:(System_Object **)p3;
/**
Managed method.
@textblock
Name
TryDeleteIndex
Params
System.Dynamic.DeleteIndexBinder
System.Object[]
Return
System.Boolean
@/textblock
*/
- (BOOL)tryDeleteIndex_withBinder:(System_Dynamic_DeleteIndexBinder *)p1 indexes:(System_Array *)p2;
/**
Managed method.
@textblock
Name
TryDeleteMember
Params
System.Dynamic.DeleteMemberBinder
Return
System.Boolean
@/textblock
*/
- (BOOL)tryDeleteMember_withBinder:(System_Dynamic_DeleteMemberBinder *)p1;
/**
Managed method.
@textblock
Name
TryGetIndex
Params
System.Dynamic.GetIndexBinder
System.Object[]
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryGetIndex_withBinder:(System_Dynamic_GetIndexBinder *)p1 indexes:(System_Array *)p2 resultRef:(System_Object **)p3;
/**
Managed method.
@textblock
Name
TryGetMember
Params
System.Dynamic.GetMemberBinder
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryGetMember_withBinder:(System_Dynamic_GetMemberBinder *)p1 resultRef:(System_Object **)p2;
/**
Managed method.
@textblock
Name
TryInvoke
Params
System.Dynamic.InvokeBinder
System.Object[]
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryInvoke_withBinder:(System_Dynamic_InvokeBinder *)p1 args:(System_Array *)p2 resultRef:(System_Object **)p3;
/**
Managed method.
@textblock
Name
TryInvokeMember
Params
System.Dynamic.InvokeMemberBinder
System.Object[]
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryInvokeMember_withBinder:(System_Dynamic_InvokeMemberBinder *)p1 args:(System_Array *)p2 resultRef:(System_Object **)p3;
/**
Managed method.
@textblock
Name
TrySetIndex
Params
System.Dynamic.SetIndexBinder
System.Object[]
System.Object
Return
System.Boolean
@/textblock
*/
- (BOOL)trySetIndex_withBinder:(System_Dynamic_SetIndexBinder *)p1 indexes:(System_Array *)p2 value:(id <DBMonoObject>)p3;
/**
Managed method.
@textblock
Name
TrySetMember
Params
System.Dynamic.SetMemberBinder
System.Object
Return
System.Boolean
@/textblock
*/
- (BOOL)trySetMember_withBinder:(System_Dynamic_SetMemberBinder *)p1 value:(id <DBMonoObject>)p2;
/**
Managed method.
@textblock
Name
TryUnaryOperation
Params
System.Dynamic.UnaryOperationBinder
ref System.Object&
Return
System.Boolean
@/textblock
*/
- (BOOL)tryUnaryOperation_withBinder:(System_Dynamic_UnaryOperationBinder *)p1 resultRef:(System_Object **)p2;
@end
//--Dubrovnik.CodeGenerator | 19.769784 | 138 | 0.77802 |
5de70a9bdf2e506635372a2edd20afe360f7b8cf | 469 | h | C | src/qnob/qnob_args.h | captainurist/qnob | 3cae9e17f5c266d9583d2e90253de65514d08a0d | [
"MIT"
] | 1 | 2021-05-16T03:55:15.000Z | 2021-05-16T03:55:15.000Z | src/qnob/qnob_args.h | captainurist/qnob | 3cae9e17f5c266d9583d2e90253de65514d08a0d | [
"MIT"
] | null | null | null | src/qnob/qnob_args.h | captainurist/qnob | 3cae9e17f5c266d9583d2e90253de65514d08a0d | [
"MIT"
] | null | null | null | #pragma once
#include <QtCore/QString>
#include <lib/serialization/serialization_fwd.h>
enum RunMode {
ServiceMode,
HelpMode,
VersionMode,
ListMode
};
enum StandardList {
EntitiesList,
KeysList,
ListCount,
NoList = -1,
};
X_DECLARE_SERIALIZATION_FUNCTIONS(StandardList)
struct QnobArgs {
RunMode mode = ServiceMode;
QString configPath;
QString logPath;
bool hideConsole = false;
StandardList list = NoList;
};
| 15.129032 | 48 | 0.695096 |
3b9c0b9a4cbac7f351a654bd62f27df82ec7b849 | 378 | h | C | src/filter/ArtistFilter.h | christian-esken/mediawarp | 0c0d2423175774421c4b78b36693e29f6146af6b | [
"Apache-2.0"
] | null | null | null | src/filter/ArtistFilter.h | christian-esken/mediawarp | 0c0d2423175774421c4b78b36693e29f6146af6b | [
"Apache-2.0"
] | null | null | null | src/filter/ArtistFilter.h | christian-esken/mediawarp | 0c0d2423175774421c4b78b36693e29f6146af6b | [
"Apache-2.0"
] | null | null | null | /*
* ArtistFilter.h
*
* Created on: 22.01.2015
* Author: chris
*/
#ifndef SRC_FILTER_ARTISTFILTER_H_
#define SRC_FILTER_ARTISTFILTER_H_
#include "TagFilter.h"
class ArtistFilter: public TagFilter
{
public:
ArtistFilter(QString tagValue);
virtual ~ArtistFilter();
virtual bool match(shared_ptr<MediaItem> mediaItem);
};
#endif /* SRC_FILTER_ARTISTFILTER_H_ */
| 16.434783 | 53 | 0.743386 |
b380785227b3ffc5a6b26bbefb0ed68f9c1beeca | 8,461 | h | C | jni/mupdf/mupdf/pdf/mupdf.h | AlixMing/iBooks | ee91ae4d07ed28995cb34c8bf3e5fd027b9dd42b | [
"MIT"
] | 112 | 2015-01-23T03:36:47.000Z | 2021-09-29T03:31:17.000Z | jni/mupdf/mupdf/pdf/mupdf.h | AlixMing/iBooks | ee91ae4d07ed28995cb34c8bf3e5fd027b9dd42b | [
"MIT"
] | null | null | null | jni/mupdf/mupdf/pdf/mupdf.h | AlixMing/iBooks | ee91ae4d07ed28995cb34c8bf3e5fd027b9dd42b | [
"MIT"
] | 66 | 2015-03-28T15:24:16.000Z | 2020-04-07T08:59:05.000Z | #ifndef MUPDF_H
#define MUPDF_H
#include "fitz.h"
typedef struct pdf_document_s pdf_document;
/*
* Dynamic objects.
* The same type of objects as found in PDF and PostScript.
* Used by the filters and the mupdf parser.
*/
typedef struct pdf_obj_s pdf_obj;
pdf_obj *pdf_new_null(fz_context *ctx);
pdf_obj *pdf_new_bool(fz_context *ctx, int b);
pdf_obj *pdf_new_int(fz_context *ctx, int i);
pdf_obj *pdf_new_real(fz_context *ctx, float f);
pdf_obj *fz_new_name(fz_context *ctx, char *str);
pdf_obj *pdf_new_string(fz_context *ctx, char *str, int len);
pdf_obj *pdf_new_indirect(fz_context *ctx, int num, int gen, void *doc);
pdf_obj *pdf_new_array(fz_context *ctx, int initialcap);
pdf_obj *pdf_new_dict(fz_context *ctx, int initialcap);
pdf_obj *pdf_new_rect(fz_context *ctx, fz_rect *rect);
pdf_obj *pdf_new_matrix(fz_context *ctx, fz_matrix *mtx);
pdf_obj *pdf_copy_array(fz_context *ctx, pdf_obj *array);
pdf_obj *pdf_copy_dict(fz_context *ctx, pdf_obj *dict);
pdf_obj *pdf_keep_obj(pdf_obj *obj);
void pdf_drop_obj(pdf_obj *obj);
/* type queries */
int pdf_is_null(pdf_obj *obj);
int pdf_is_bool(pdf_obj *obj);
int pdf_is_int(pdf_obj *obj);
int pdf_is_real(pdf_obj *obj);
int pdf_is_name(pdf_obj *obj);
int pdf_is_string(pdf_obj *obj);
int pdf_is_array(pdf_obj *obj);
int pdf_is_dict(pdf_obj *obj);
int pdf_is_indirect(pdf_obj *obj);
int pdf_is_stream(pdf_document *doc, int num, int gen);
int pdf_objcmp(pdf_obj *a, pdf_obj *b);
/* dict marking and unmarking functions - to avoid infinite recursions */
int pdf_dict_marked(pdf_obj *obj);
int pdf_dict_mark(pdf_obj *obj);
void pdf_dict_unmark(pdf_obj *obj);
/* safe, silent failure, no error reporting on type mismatches */
int pdf_to_bool(pdf_obj *obj);
int pdf_to_int(pdf_obj *obj);
float pdf_to_real(pdf_obj *obj);
char *pdf_to_name(pdf_obj *obj);
char *pdf_to_str_buf(pdf_obj *obj);
pdf_obj *pdf_to_dict(pdf_obj *obj);
int pdf_to_str_len(pdf_obj *obj);
int pdf_to_num(pdf_obj *obj);
int pdf_to_gen(pdf_obj *obj);
int pdf_array_len(pdf_obj *array);
pdf_obj *pdf_array_get(pdf_obj *array, int i);
void pdf_array_put(pdf_obj *array, int i, pdf_obj *obj);
void pdf_array_push(pdf_obj *array, pdf_obj *obj);
void pdf_array_insert(pdf_obj *array, pdf_obj *obj);
int pdf_array_contains(pdf_obj *array, pdf_obj *obj);
int pdf_dict_len(pdf_obj *dict);
pdf_obj *pdf_dict_get_key(pdf_obj *dict, int idx);
pdf_obj *pdf_dict_get_val(pdf_obj *dict, int idx);
pdf_obj *pdf_dict_get(pdf_obj *dict, pdf_obj *key);
pdf_obj *pdf_dict_gets(pdf_obj *dict, char *key);
pdf_obj *pdf_dict_getp(pdf_obj *dict, char *key);
pdf_obj *pdf_dict_getsa(pdf_obj *dict, char *key, char *abbrev);
void pdf_dict_put(pdf_obj *dict, pdf_obj *key, pdf_obj *val);
void pdf_dict_puts(pdf_obj *dict, char *key, pdf_obj *val);
void pdf_dict_putp(pdf_obj *dict, char *key, pdf_obj *val);
void pdf_dict_del(pdf_obj *dict, pdf_obj *key);
void pdf_dict_dels(pdf_obj *dict, char *key);
void pdf_sort_dict(pdf_obj *dict);
int pdf_fprint_obj(FILE *fp, pdf_obj *obj, int tight);
void pdf_print_obj(pdf_obj *obj);
void pdf_print_ref(pdf_obj *obj);
char *pdf_to_utf8(fz_context *ctx, pdf_obj *src);
unsigned short *pdf_to_ucs2(fz_context *ctx, pdf_obj *src); /* sumatrapdf */
pdf_obj *pdf_to_utf8_name(fz_context *ctx, pdf_obj *src);
char *pdf_from_ucs2(fz_context *ctx, unsigned short *str);
fz_rect pdf_to_rect(fz_context *ctx, pdf_obj *array);
fz_matrix pdf_to_matrix(fz_context *ctx, pdf_obj *array);
int pdf_count_objects(pdf_document *doc);
pdf_obj *pdf_resolve_indirect(pdf_obj *ref);
pdf_obj *pdf_load_object(pdf_document *doc, int num, int gen);
fz_buffer *pdf_load_raw_stream(pdf_document *doc, int num, int gen);
fz_buffer *pdf_load_stream(pdf_document *doc, int num, int gen);
fz_stream *pdf_open_raw_stream(pdf_document *doc, int num, int gen);
fz_stream *pdf_open_stream(pdf_document *doc, int num, int gen);
fz_image *pdf_load_image(pdf_document *doc, pdf_obj *obj);
fz_outline *pdf_load_outline(pdf_document *doc);
/*
pdf_create_object: Allocate a slot in the xref table and return a fresh unused object number.
*/
int pdf_create_object(pdf_document *xref);
/*
pdf_delete_object: Remove object from xref table, marking the slot as free.
*/
void pdf_delete_object(pdf_document *xref, int num);
/*
pdf_update_object: Replace object in xref table with the passed in object.
*/
void pdf_update_object(pdf_document *xref, int num, pdf_obj *obj);
/*
pdf_update_stream: Replace stream contents for object in xref table with the passed in buffer.
The buffer contents must match the /Filter setting.
If storing uncompressed data, make sure to delete the /Filter key from
the stream dictionary. If storing deflated data, make sure to set the
/Filter value to /FlateDecode.
*/
void pdf_update_stream(pdf_document *xref, int num, fz_buffer *buf);
/*
pdf_write_document: Write out the document to a file with all changes finalised.
*/
void pdf_write_document(pdf_document *doc, char *filename, fz_write_options *opts);
/*
pdf_open_document: Open a PDF document.
Open a PDF document by reading its cross reference table, so
MuPDF can locate PDF objects inside the file. Upon an broken
cross reference table or other parse errors MuPDF will restart
parsing the file from the beginning to try to rebuild a
(hopefully correct) cross reference table to allow further
processing of the file.
The returned pdf_document should be used when calling most
other PDF functions. Note that it wraps the context, so those
functions implicitly get access to the global state in
context.
filename: a path to a file as it would be given to open(2).
*/
pdf_document *pdf_open_document(fz_context *ctx, const char *filename);
/*
pdf_open_document_with_stream: Opens a PDF document.
Same as pdf_open_document, but takes a stream instead of a
filename to locate the PDF document to open. Increments the
reference count of the stream. See fz_open_file,
fz_open_file_w or fz_open_fd for opening a stream, and
fz_close for closing an open stream.
*/
pdf_document *pdf_open_document_with_stream(fz_stream *file);
/*
pdf_close_document: Closes and frees an opened PDF document.
The resource store in the context associated with pdf_document
is emptied.
Does not throw exceptions.
*/
void pdf_close_document(pdf_document *doc);
int pdf_needs_password(pdf_document *doc);
int pdf_authenticate_password(pdf_document *doc, char *pw);
enum
{
PDF_PERM_PRINT = 1 << 2,
PDF_PERM_CHANGE = 1 << 3,
PDF_PERM_COPY = 1 << 4,
PDF_PERM_NOTES = 1 << 5,
PDF_PERM_FILL_FORM = 1 << 8,
PDF_PERM_ACCESSIBILITY = 1 << 9,
PDF_PERM_ASSEMBLE = 1 << 10,
PDF_PERM_HIGH_RES_PRINT = 1 << 11,
PDF_DEFAULT_PERM_FLAGS = 0xfffc
};
int pdf_has_permission(pdf_document *doc, int p);
typedef struct pdf_page_s pdf_page;
int pdf_lookup_page_number(pdf_document *doc, pdf_obj *pageobj);
int pdf_count_pages(pdf_document *doc);
/*
pdf_load_page: Load a page and its resources.
Locates the page in the PDF document and loads the page and its
resources. After pdf_load_page is it possible to retrieve the size
of the page using pdf_bound_page, or to render the page using
pdf_run_page_*.
number: page number, where 0 is the first page of the document.
*/
pdf_page *pdf_load_page(pdf_document *doc, int number);
fz_link *pdf_load_links(pdf_document *doc, pdf_page *page);
/*
pdf_bound_page: Determine the size of a page.
Determine the page size in user space units, taking page rotation
into account. The page size is taken to be the crop box if it
exists (visible area after cropping), otherwise the media box will
be used (possibly including printing marks).
Does not throw exceptions.
*/
fz_rect pdf_bound_page(pdf_document *doc, pdf_page *page);
/*
pdf_free_page: Frees a page and its resources.
Does not throw exceptions.
*/
void pdf_free_page(pdf_document *doc, pdf_page *page);
/*
pdf_run_page: Interpret a loaded page and render it on a device.
page: A page loaded by pdf_load_page.
dev: Device used for rendering, obtained from fz_new_*_device.
ctm: A transformation matrix applied to the objects on the page,
e.g. to scale or rotate the page contents as desired.
*/
void pdf_run_page(pdf_document *doc, pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie);
void pdf_run_page_with_usage(pdf_document *doc, pdf_page *page, fz_device *dev, fz_matrix ctm, char *event, fz_cookie *cookie);
/*
Metadata interface.
*/
int pdf_meta(pdf_document *doc, int key, void *ptr, int size);
#endif
| 33.180392 | 127 | 0.772367 |
a45c2a6eb8e447a93bf50d7e18b1ef7e31f6dbd4 | 7,696 | c | C | cas/parse.c | dzinoviev/clown | 47f4c24a5752b713882b14ade7f6a8e68aa9e77b | [
"MIT"
] | 3 | 2015-03-13T14:13:28.000Z | 2021-01-03T14:32:14.000Z | cas/parse.c | dzinoviev/clown | 47f4c24a5752b713882b14ade7f6a8e68aa9e77b | [
"MIT"
] | null | null | null | cas/parse.c | dzinoviev/clown | 47f4c24a5752b713882b14ade7f6a8e68aa9e77b | [
"MIT"
] | 1 | 2015-03-13T14:14:20.000Z | 2015-03-13T14:14:20.000Z | #include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <setjmp.h>
#include <sys/types.h>
#include "cas.h"
#include "generate.h"
#ifdef __STRICT_ANSI__
int fileno (FILE *stream); /* for Ansi C */
#endif
Clof_Type module_type = CLOF_UNKNOWN;
jmp_buf failure;
int listing = 0;
int global_offset = 0;
struct SegmentTable segments = {0, NULL};
struct LabelTable labels = {0, NULL};
void component_error (const char *name, const char *msg, char *detail)
{
fprintf (stderr, "%s: %s: %s\n", name, msg, detail);
}
void end_segment (int segment, Dword size)
{
size -= global_offset;
}
static int search_segment (char *name)
{
int i;
for (i = 0; i < segments.size; i++)
if (! (strcmp (segments.segments[i].name, name)))
return i;
return NOT_FOUND;
}
static int create_segment (char *name)
{
int seg = segments.size;
segments.segments = safe_realloc (segments.segments,
sizeof (struct Segment)
* (segments.size + 1));
segments.segments[seg].name = safe_malloc (strlen (name) + 1);
strcpy (segments.segments[seg].name, name);
segments.segments[seg].defined = 0;
segments.segments[seg].new_index = NOT_FOUND;
/* Support for debugging */
segments.segments[seg].nfiles = 1;
segments.segments[seg].files = safe_malloc (sizeof (struct DebugFile));
segments.segments[seg].files[0].file = *source;
segments.segments[seg].files[0].nlines = 0;
segments.segments[seg].files[0].nlines_inuse = 0;
segments.segments[seg].files[0].flines = NULL;
segments.segments[seg].id = seg;
segments.segments[seg].new_index = seg;
segments.size++;
if (seg)
segments.segments[DEFAULT_SEGMENT].defined = 0;
return seg;
}
int lookup_segment (char *name)
{
int seg = search_segment (name);
if (seg == NOT_FOUND)
return create_segment (name);
else
return seg;
}
int begin_segment (int type, char *name)
{
int seg = search_segment (name);
if (NOT_FOUND != seg) {
if (segments.segments[seg].defined) {
component_error (*source, "duplicate segment definition", name);
return NOT_FOUND;
}
} else {
seg = create_segment (name);
if (NOT_FOUND == seg)
return NOT_FOUND;
}
/* define segment */
segments.segments[seg].type = type;
segments.segments[seg].defined = 1;
segments.segments[seg].image = safe_malloc (sizeof (Dword) * IMAGE_CHUNK);
segments.segments[seg].image_size = 0;
segments.segments[seg].image_extent = IMAGE_CHUNK;
segments.segments[seg].link_overhead = 0;
current_overhead = 0;
return seg;
}
static int lookup_label (char *label)
{
int i;
for (i = 0; i < labels.size; i++)
if (! (strcmp (labels.labels[i].name, label)))
return i;
return NOT_FOUND;
}
static int create_label (char *label)
{
int i = labels.size;
labels.labels = safe_realloc (labels.labels,
sizeof (struct Label) * (labels.size + 1));
labels.labels[i].name = safe_malloc (strlen (label) + 1);
strcpy (labels.labels[i].name, label);
labels.labels[i].export = 0; /* can be exported? */
labels.labels[i].defined = 0;
labels.labels[i].segment = DEFAULT_SEGMENT;
labels.labels[i].new_index = i;
labels.size++;
return i;
}
int mark_export_label (char *label)
{
int lab;
if (NOT_FOUND != (lab = lookup_label (label)))
component_error (*source, "warning: duplicate export definition", label);
else
if (NOT_FOUND != (lab = create_label (label)))
labels.labels[lab].export = 1;
return lab;
}
static void define_label (int i, int segment, Dword offset)
{
labels.labels[i].address = offset;
labels.labels[i].segment = segment;
labels.labels[i].defined = 1;
}
int add_label (char *label, int segment, Dword offset, int global, int align8)
{
int i;
if (NOT_FOUND == (i = lookup_label (label)) &&
NOT_FOUND == (i = create_label (label)))
return NOT_FOUND;
if (labels.labels[i].defined) {
component_error (*source, "duplicate symbol", label);
return NOT_FOUND;
}
if (align8) {
int boundary;
if (align8 == 1) {
boundary = 8;
} else {
boundary = CLOWN_FRAME_SIZE; /* PAGE ALIGNMENT */
}
if (offset % boundary) {
int i;
Dword offset1 = (offset / boundary + 1) * boundary;
for (i = 0; i < offset1 - offset; i++)
emit (BUILD_INSTRUCTION_A (NOP, 0, 0));
offset = offset1;
}
}
if (global)
labels.labels[i].export = 1;
define_label (i, segment, offset);
return i;
}
int use_label (char *label, int segment)
{
int i;
if (NOT_FOUND == (i = lookup_label (label))) {
i = create_label (label);
if (NOT_FOUND != i)
labels.labels[i].segment = segment;
}
return i;
}
static int find_undefined_segments ()
{
int status = 1;
int i;
for (i = 0; i < segments.size; i++) {
if (!segments.segments[i].defined && i != DEFAULT_SEGMENT && module_type != CLOF_EXE) {
component_error (*source, "undefined segment", segments.segments[i].name);
status = 0;
}
}
return status;
}
static int find_undefined_labels ()
{
int status = 1;
int i;
for (i = 0; i < labels.size; i++) {
if (labels.labels[i].defined) {
if (labels.labels[i].export && module_type != CLOF_EXE) {
component_error (*source, "warning: exported symbol ignored",
labels.labels[i].name);
}
} else {
if (module_type != CLOF_EXE) {
component_error (*source, "undefined symbol", labels.labels[i].name);
status = 0;
}
}
}
return status;
}
static void store (Dword item)
{
struct Segment *s = &segments.segments[current_segment];
if (s->image_size >= s->image_extent) {
s->image_extent += IMAGE_CHUNK;
s->image = safe_realloc (s->image, s->image_extent * sizeof (Dword));
}
s->image[s->image_size++] = item;
}
void emit (Dword instr)
{
static int prev_line_no = -100;
struct DebugFile *dbg_info = segments.segments[current_segment].files;
if (line_no != prev_line_no) {
prev_line_no = line_no;
if (dbg_info->nlines_inuse >= dbg_info->nlines) {
dbg_info->nlines += IMAGE_CHUNK;
dbg_info->flines = safe_realloc (dbg_info->flines, dbg_info->nlines * sizeof (struct DebugInfo));
}
dbg_info->flines[dbg_info->nlines_inuse].offset = offset;
dbg_info->flines[dbg_info->nlines_inuse].line = line_no;
dbg_info->nlines_inuse++;
}
if ( instr == FIX_SEGMENT
|| instr == FIX_ADISPLACEMENT
|| instr == FIX_RDISPLACEMENT
|| instr == FIX_EXPRESSION ) {
store (instr);
} else {
offset++;
}
store (instr);
}
void emit_escape (Dword escape)
{
store (escape);
}
static int generate (int outfile)
{
int status = 1, i;
/* The header */
write_header (outfile, &segments, &labels);
/* The code */
for (i = 0; i < segments.size; i++)
if (segments.segments[i].image_size && segments.segments[i].defined)
status &= save_segment (outfile, i, &segments, &labels, FIRST_FRAGMENT | LAST_FRAGMENT);
write_trailer (outfile);
return status;
}
extern int success;
int parse_and_assembly (FILE *infile, int outfile)
{
assert (infile);
assert (outfile);
yyin = infile;
link_overhead = 0;
offset = global_offset;
if (yyparse () || !success)
return EXIT_FAILURE;
if (!find_undefined_labels () || !find_undefined_segments ())
return EXIT_FAILURE;
offset -= global_offset;
if (!generate (outfile))
return EXIT_FAILURE;
if (listing) {
list_segments (segments);
list_labels (labels, segments);
}
return EXIT_SUCCESS;
}
| 22.904762 | 100 | 0.633706 |
a8a88aa3b9fe049daaedace64d9435d31fdc7ee3 | 430 | h | C | Tip Calculator/Tip Calculator/TipCalculatedCollectionViewCell.h | Mattmlm/tipcalculator | 6c4821b03c37b38da7ea325ffc518cfd953be688 | [
"MIT"
] | null | null | null | Tip Calculator/Tip Calculator/TipCalculatedCollectionViewCell.h | Mattmlm/tipcalculator | 6c4821b03c37b38da7ea325ffc518cfd953be688 | [
"MIT"
] | 1 | 2015-08-18T21:28:34.000Z | 2015-08-25T14:02:19.000Z | Tip Calculator/Tip Calculator/TipCalculatedCollectionViewCell.h | Mattmlm/tipcalculator | 6c4821b03c37b38da7ea325ffc518cfd953be688 | [
"MIT"
] | null | null | null | //
// TipCalculatedCollectionViewCell.h
// Tip Calculator
//
// Created by admin on 8/13/15.
// Copyright (c) 2015 mattmo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TipCalculatedCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong) NSNumber * tipPercentage;
+ (NSString *)nibName;
+ (NSString *)reuseIdentifier;
- (void)updateCell:(double)billTotal withSplit:(int)numberOfPeople;
@end
| 20.47619 | 67 | 0.744186 |
a8c596e6546e84b7649f5ad98a41d0ec3b1c218a | 1,385 | h | C | app/src/usbmuxdriver.h | Mck0/usbmux | 6f772561db2c32ee5d7ec105637c3c957418e65d | [
"MIT"
] | 2 | 2021-07-01T13:32:52.000Z | 2022-02-15T14:14:31.000Z | app/src/usbmuxdriver.h | Mck0/usbmux | 6f772561db2c32ee5d7ec105637c3c957418e65d | [
"MIT"
] | null | null | null | app/src/usbmuxdriver.h | Mck0/usbmux | 6f772561db2c32ee5d7ec105637c3c957418e65d | [
"MIT"
] | 2 | 2021-12-12T11:44:13.000Z | 2022-02-15T13:47:20.000Z |
#pragma once
#include <Arduino.h>
#include "ts3usb221-arduino.h"
class UsbMuxDriver
{
public:
typedef enum
{
USB_ID_HIGH = HIGH,
USB_ID_LOW = LOW,
} UsbIdState;
typedef enum
{
USB_CHANNEL_0 = 0,
USB_CHANNEL_1 = 1,
USB_CHANNEL_INVALID,
} UsbChannelNumber;
public:
/**
* @brief Ctor
*
* @param usbIdPin - USB_ID pin
*/
explicit UsbMuxDriver(int usbIdPin);
/**
* @brief Enables a given channel, setting proper state on usb_id pin
*
* @param chNumber - channel number to be enabled on the output
* @param id - usb id pin state enbaled on given channel
*/
void enableChannel(UsbChannelNumber chNumber, UsbIdState idState);
/**
* @brief Disbles all channels, not forwarding any on the output
*
* @note USB ID pin state is set to LOW
*/
void disableAll();
private:
/**
* @brief Returns if channel number is available (valid)
*
* @param chNumber - channel number to be checked
* @return Is channel number valid (true) or not (false)
*/
bool isChannelValid(UsbChannelNumber chNumber);
private:
/**
* @brief USB multiplexer dev objects
*/
ts3usb221 m_usbMuxDev;
ts3usb221_arduino m_usbMuxArduinoDev;
/**
* @brief USB_ID pin
*/
int m_usbIdPin;
};
| 19.507042 | 73 | 0.607942 |
44b44b61dad1cd7a0b95bc19d42c0e503c6a30cb | 1,108 | h | C | src/model/type/ProtoTypeModel.h | michaelstein/ProtoInfo | 67634a9ffdb4a7a685706cbdbf7e3ade270d22ed | [
"MIT"
] | null | null | null | src/model/type/ProtoTypeModel.h | michaelstein/ProtoInfo | 67634a9ffdb4a7a685706cbdbf7e3ade270d22ed | [
"MIT"
] | null | null | null | src/model/type/ProtoTypeModel.h | michaelstein/ProtoInfo | 67634a9ffdb4a7a685706cbdbf7e3ade270d22ed | [
"MIT"
] | null | null | null | #pragma once
#include "google/protobuf/compiler/importer.h"
#include <QtCore/QAbstractItemModel>
#include "ProtoTypeModelMessageItem.h"
#include <memory>
#include <vector>
class ProtoTypeModel : public QAbstractItemModel
{
Q_OBJECT
public:
ProtoTypeModel(const std::vector<const google::protobuf::FileDescriptor*>& values, QObject* parent = nullptr);
~ProtoTypeModel() override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
void updateAll();
ProtoTypeModelMessageItem* messageItemByIndex(const QModelIndex &index) const;
private:
class Private;
std::unique_ptr<Private> d;
};
| 35.741935 | 111 | 0.787004 |
7a37a86cf02407b619af3483c576ec8c03eb0270 | 481 | h | C | CSPopKit/Classes/CSCustomPopManage/Basic/CSCustomPopManagerHeader.h | dormitory219/CSPopKit | 5e04f9f74016128a65d7dce10a2b9b3b689fa0ce | [
"MIT"
] | 86 | 2018-04-06T01:33:02.000Z | 2020-07-23T03:21:18.000Z | CSPopKit/Classes/CSCustomPopManage/Basic/CSCustomPopManagerHeader.h | dormitory219/CSPopKit | 5e04f9f74016128a65d7dce10a2b9b3b689fa0ce | [
"MIT"
] | 2 | 2019-01-14T09:14:28.000Z | 2019-04-09T10:05:53.000Z | CSPopKit/Classes/CSCustomPopManage/Basic/CSCustomPopManagerHeader.h | dormitory219/CSPopKit | 5e04f9f74016128a65d7dce10a2b9b3b689fa0ce | [
"MIT"
] | 9 | 2018-04-23T08:04:36.000Z | 2021-04-14T17:21:21.000Z | //
// CSCustomPopManagerHeader.h
// CSPopKit
//
// Created by joy_yu on 2018/1/12.
// Copyright © 2018年 joy_yu. All rights reserved.
//
#ifndef CSCustomPopManagerHeader_h
#define CSCustomPopManagerHeader_h
#import "CSCustomPopManager.h"
#import "CSCustomPopHandler.h"
#import "CSCustomPopViewLoader.h"
#import "CSCustomPopControllerLoader.h"
#import "CSCustomPopReformer.h"
#import "CSCustomPopView.h"
#import "CSCustomPopModel.h"
#endif /* CSCustomPopManagerHeader_h */
| 20.041667 | 50 | 0.773389 |
7a3c248e51999a58ae379525e42758886f104ec2 | 176 | h | C | Books/SFML Game Development by Example/Chapter 12/ActionRPG/ActionRPG/include/C_Controller.h | mequint/Cpp-Samples | a5e8e08381121c10c100632ae190cc509be3293e | [
"MIT"
] | null | null | null | Books/SFML Game Development by Example/Chapter 12/ActionRPG/ActionRPG/include/C_Controller.h | mequint/Cpp-Samples | a5e8e08381121c10c100632ae190cc509be3293e | [
"MIT"
] | null | null | null | Books/SFML Game Development by Example/Chapter 12/ActionRPG/ActionRPG/include/C_Controller.h | mequint/Cpp-Samples | a5e8e08381121c10c100632ae190cc509be3293e | [
"MIT"
] | null | null | null | #pragma once
#include "C_Base.h"
class C_Controller : public C_Base {
public:
C_Controller() : C_Base(Component::Controller) {}
void ReadIn(std::stringstream& stream) {}
}; | 19.555556 | 50 | 0.721591 |
d192cf9ea81ec9a72bda5eb307e38a542c5f2ceb | 1,705 | h | C | PlugIns/IDEInterfaceBuilderCocoaTouchIntegration/IBGLKView.h | cameroncooke/XcodeHeaders | be955d30b5fc62c4312b354045b4561d164ebd9c | [
"MIT"
] | 1 | 2016-03-30T10:07:37.000Z | 2016-03-30T10:07:37.000Z | PlugIns/IDEInterfaceBuilderCocoaTouchIntegration/IBGLKView.h | cameroncooke/XcodeHeaders | be955d30b5fc62c4312b354045b4561d164ebd9c | [
"MIT"
] | null | null | null | PlugIns/IDEInterfaceBuilderCocoaTouchIntegration/IBGLKView.h | cameroncooke/XcodeHeaders | be955d30b5fc62c4312b354045b4561d164ebd9c | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <IDEInterfaceBuilderCocoaTouchIntegration/IBUIView.h>
#import "IBDocumentArchiving.h"
#import "NSCoding.h"
@class NSString;
@interface IBGLKView : IBUIView <IBDocumentArchiving, NSCoding>
{
int drawableColorFormat;
int drawableDepthFormat;
int drawableStencilFormat;
int drawableMultisample;
BOOL enableSetNeedsDisplay;
}
+ (id)ibInstantiateViewForRole:(long long)arg1 withTargetRuntime:(id)arg2 documentClass:(Class)arg3 assetIdentifier:(id)arg4;
@property BOOL enableSetNeedsDisplay; // @synthesize enableSetNeedsDisplay;
@property int drawableMultisample; // @synthesize drawableMultisample;
@property int drawableStencilFormat; // @synthesize drawableStencilFormat;
@property int drawableDepthFormat; // @synthesize drawableDepthFormat;
@property int drawableColorFormat; // @synthesize drawableColorFormat;
- (void)drawRect:(struct CGRect)arg1;
- (BOOL)shouldDrawAsPlaceholder;
- (id)initWithFrame:(struct CGRect)arg1 targetRuntime:(id)arg2;
- (void)unarchiveWithDocumentUnarchiver:(id)arg1;
- (void)archiveWithDocumentArchiver:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)ibDesignableContentView;
- (BOOL)ibSizesToFillViewControllers;
- (id)ibPasteboardTypes;
- (id)ibTypeNameForDefaultLabel;
- (void)ibWarnings:(id)arg1 forDocument:(id)arg2 withComputationContext:(id)arg3;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| 34.1 | 125 | 0.785337 |
ff054aa5c4e9533894b6135fa6b6481acf1fea5c | 866 | c | C | Chapter1/1-9/stringRotation.c | aaronshim/ctci-workspace | e4b76d93a307da81eb8a8a2ad3289f5ab3580bee | [
"MIT"
] | null | null | null | Chapter1/1-9/stringRotation.c | aaronshim/ctci-workspace | e4b76d93a307da81eb8a8a2ad3289f5ab3580bee | [
"MIT"
] | null | null | null | Chapter1/1-9/stringRotation.c | aaronshim/ctci-workspace | e4b76d93a307da81eb8a8a2ad3289f5ab3580bee | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
//Is s2 a rotation of s1?
// (this one is super simple if we know the trick)
bool stringRotation(char s1[], char s2[])
{
int len1 = strlen(s1);
//sanity check
if (len1 != strlen(s2))
{
return false;
}
char* twos1 = malloc((2*len1+1)*sizeof(char));
memcpy(twos1,s1,len1*sizeof(char));
//for null terminator
memcpy(twos1+len1*sizeof(char),s1,(len1+1)*sizeof(char));
bool result = strstr(twos1,s2) != NULL;
free(twos1);
return result;
}
int main(int argc, char* argv[])
{
if (argc != 3)
{
fprintf(stderr, "You must supply exactly two strings to evaluate!\n");
return EXIT_FAILURE;
}
printf("%s %s a rotation of %s\n", argv[2],
stringRotation(argv[1], argv[2]) ? "is" : "is NOT",
argv[1]);
return EXIT_SUCCESS;
}
| 20.619048 | 73 | 0.618938 |
9eece1daa1cc50f31f96ab125dcf586a3af54509 | 4,238 | h | C | paasprocci/src/paasclient.h | MarouenMechtri/compatibleone | 6e1be42ba023bb64421073d139dc57bb0386b180 | [
"Apache-2.0"
] | 1 | 2015-02-28T21:25:54.000Z | 2015-02-28T21:25:54.000Z | paasprocci/src/paasclient.h | MarouenMechtri/compatibleone | 6e1be42ba023bb64421073d139dc57bb0386b180 | [
"Apache-2.0"
] | null | null | null | paasprocci/src/paasclient.h | MarouenMechtri/compatibleone | 6e1be42ba023bb64421073d139dc57bb0386b180 | [
"Apache-2.0"
] | null | null | null | /* -------------------------------------------------------------------- */
/* ACCORDS PLATFORM */
/* (C) 2011 by Iain James Marshall (Prologue) <ijm667@hotmail.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 _paasclient_h
#define _paasclient_h
#include "standard.h"
#include "rest.h"
#include "url.h"
#include "urlpublic.h"
#include "restclient.h"
#include "json.h"
#include "document.h"
#define _TEXT_NONE 0
#define _TEXT_XML 1
#define _TEXT_JSON 2
struct paas_client
{
char * agent;
char * tls;
char * host;
int port;
};
struct paas_response
{
int nature;
char * content;
struct rest_response * response;
struct xml_element * xmlroot;
struct data_element * jsonroot;
};
public struct paas_response * paas_remove_response( struct paas_response * response );
public struct paas_response * paas_result( struct rest_response * response );
public struct paas_response * start_paas_application(char * application, char * version, char * instance);
public struct paas_response * get_paas_task( char * task );
public struct paas_response * stop_paas_application(char * application, char * version, char * instance);
public struct paas_response * create_paas_application(char * artifact, char * description, char * version );
public struct paas_response * create_paas_application_version(char * application, char * artifact, char * description, char * version );
public struct paas_response * create_paas_application_instance(char * application, char * version, char * topology, char * environment );
public struct paas_response * list_paas_applications();
public struct paas_response * list_paas_application_versions(char * application);
public struct paas_response * list_paas_application_version_instances(char * application,char * version);
public struct paas_response * list_paas_application_version_artefacts(char * application,char * version);
public struct paas_response * get_paas_application(char * application);
public struct paas_response * get_paas_application_version(char * application,char * version);
public struct paas_response * get_paas_application_version_instance(char * application,char * version,char * instance);
public struct paas_response * delete_paas_application(char * application);
public struct paas_response * delete_paas_application_version(char * application,char * version);
public struct paas_response * delete_paas_application_version_instance(char * application,char * version,char * instance);
public struct paas_response * start_paas_environment(char * environment);
public struct paas_response * stop_paas_environment(char * environment);
public struct paas_response * deploy_paas_application( char * environment, char * application, char * version, char * instance );
public struct paas_response * undeploy_paas_application( char * environment, char * application, char * version, char * instance );
public struct paas_response * create_paas_environment( char * environment );
public struct paas_response * delete_paas_environment( char * environment );
public struct paas_response * list_paas_environment();
public struct paas_response * get_paas_environment(char * environment);
public struct paas_response * get_paas_environment_application_instances(char * environment);
public int initialise_paas_client( char * agent, char * tls, char * host, int port );
public int terminate_paas_client();
/* ------------- */
#endif /* _paasclient_h */
/* ------------- */
| 49.27907 | 137 | 0.713308 |
fa50fbb64c72284fd7e9e18b37fa67377940cdac | 775 | h | C | copasi/UI/CQTaskBtnWidget.h | jonasfoe/COPASI | c6038d25ea984e2d189117c2548d6f9cb4ef93cd | [
"Artistic-2.0"
] | null | null | null | copasi/UI/CQTaskBtnWidget.h | jonasfoe/COPASI | c6038d25ea984e2d189117c2548d6f9cb4ef93cd | [
"Artistic-2.0"
] | null | null | null | copasi/UI/CQTaskBtnWidget.h | jonasfoe/COPASI | c6038d25ea984e2d189117c2548d6f9cb4ef93cd | [
"Artistic-2.0"
] | null | null | null | // Begin CVS Header
// $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQTaskBtnWidget.h,v $
// $Revision: 1.12 $
// $Name: $
// $Author: shoops $
// $Date: 2011/09/30 16:39:43 $
// End CVS Header
// Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
// Properties, Inc., University of Heidelberg, and The University
// of Manchester.
// All rights reserved.
#ifndef COPASI_CQTaskBtnWidget
#define COPASI_CQTaskBtnWidget
#include <QtCore/QVariant>
#include "copasi/UI/ui_CQTaskBtnWidget.h"
class CQTaskBtnWidget: public QWidget, public Ui::CQTaskBtnWidget
{
Q_OBJECT
public:
CQTaskBtnWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
virtual ~CQTaskBtnWidget();
protected slots:
};
#endif // COPASI_CQTaskBtnWidget
| 22.794118 | 87 | 0.722581 |
cfac328a6dadd7becefb4a79b59564e3cf05b61c | 29,820 | h | C | be/src/runtime/io/disk-io-mgr.h | mjacobs/impala | b5dcc031f75b2faff00d29616d83feedcb91c812 | [
"Apache-2.0"
] | null | null | null | be/src/runtime/io/disk-io-mgr.h | mjacobs/impala | b5dcc031f75b2faff00d29616d83feedcb91c812 | [
"Apache-2.0"
] | null | null | null | be/src/runtime/io/disk-io-mgr.h | mjacobs/impala | b5dcc031f75b2faff00d29616d83feedcb91c812 | [
"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 IMPALA_RUNTIME_IO_DISK_IO_MGR_H
#define IMPALA_RUNTIME_IO_DISK_IO_MGR_H
#include <deque>
#include <functional>
#include <vector>
#include <boost/scoped_ptr.hpp>
#include <boost/unordered_set.hpp>
#include <boost/thread/mutex.hpp>
#include "common/atomic.h"
#include "common/hdfs.h"
#include "common/object-pool.h"
#include "common/status.h"
#include "runtime/io/handle-cache.h"
#include "runtime/io/local-file-system.h"
#include "runtime/io/request-ranges.h"
#include "runtime/thread-resource-mgr.h"
#include "util/aligned-new.h"
#include "util/bit-util.h"
#include "util/condition-variable.h"
#include "util/error-util.h"
#include "util/runtime-profile.h"
#include "util/thread.h"
namespace impala {
class MemTracker;
namespace io {
/// Manager object that schedules IO for all queries on all disks and remote filesystems
/// (such as S3). Each query maps to one or more RequestContext objects, each of which
/// has its own queue of scan ranges and/or write ranges.
//
/// The API splits up requesting scan/write ranges (non-blocking) and reading the data
/// (blocking). The DiskIoMgr has worker threads that will read from and write to
/// disk/hdfs/remote-filesystems, allowing interleaving of IO and CPU. This allows us to
/// keep all disks and all cores as busy as possible.
//
/// All public APIs are thread-safe. It is not valid to call any of the APIs after
/// UnregisterContext() returns.
//
/// For Readers:
/// We can model this problem as a multiple producer (threads for each disk), multiple
/// consumer (scan ranges) problem. There are multiple queues that need to be
/// synchronized. Conceptually, there are two queues:
/// 1. The per disk queue: this contains a queue of readers that need reads.
/// 2. The per scan range ready-buffer queue: this contains buffers that have been
/// read and are ready for the caller.
/// The disk queue contains a queue of readers and is scheduled in a round robin fashion.
/// Readers map to scan nodes. The reader then contains a queue of scan ranges. The caller
/// asks the IoMgr for the next range to process. The IoMgr then selects the best range
/// to read based on disk activity and begins reading and queuing buffers for that range.
/// TODO: We should map readers to queries. A reader is the unit of scheduling and queries
/// that have multiple scan nodes shouldn't have more 'turns'.
//
/// For Writers:
/// Data is written via AddWriteRange(). This is non-blocking and adds a WriteRange to a
/// per-disk queue. After the write is complete, a callback in WriteRange is invoked.
/// No memory is allocated within IoMgr for writes and no copies are made. It is the
/// responsibility of the client to ensure that the data to be written is valid and that
/// the file to be written to exists until the callback is invoked.
//
/// The IoMgr provides three key APIs.
/// 1. AddScanRanges: this is non-blocking and tells the IoMgr all the ranges that
/// will eventually need to be read.
/// 2. GetNextRange: returns to the caller the next scan range it should process.
/// This is based on disk load. This also begins reading the data in this scan
/// range. This is blocking.
/// 3. ScanRange::GetNext: returns the next buffer for this range. This is blocking.
//
/// The disk threads do not synchronize with each other. The readers and writers don't
/// synchronize with each other. There is a lock and condition variable for each request
/// context queue and each disk queue.
/// IMPORTANT: whenever both locks are needed, the lock order is to grab the context lock
/// before the disk lock.
//
/// Scheduling: If there are multiple request contexts with work for a single disk, the
/// request contexts are scheduled in round-robin order. Multiple disk threads can
/// operate on the same request context. Exactly one request range is processed by a
/// disk thread at a time. If there are multiple scan ranges scheduled via
/// GetNextRange() for a single context, these are processed in round-robin order.
/// If there are multiple scan and write ranges for a disk, a read is always followed
/// by a write, and a write is followed by a read, i.e. reads and writes alternate.
/// If multiple write ranges are enqueued for a single disk, they will be processed
/// by the disk threads in order, but may complete in any order. No guarantees are made
/// on ordering of writes across disks.
//
/// Resource Management: effective resource management in the IoMgr is key to good
/// performance. The IoMgr helps coordinate two resources: CPU and disk. For CPU,
/// spinning up too many threads causes thrashing.
/// Memory usage in the IoMgr comes from queued read buffers. If we queue the minimum
/// (i.e. 1), then the disks are idle while we are processing the buffer. If we don't
/// limit the queue, then it possible we end up queueing the entire data set (i.e. CPU
/// is slower than disks) and run out of memory.
/// For both CPU and memory, we want to model the machine as having a fixed amount of
/// resources. If a single query is running, it should saturate either CPU or Disk
/// as well as using as little memory as possible. With multiple queries, each query
/// should get less CPU. In that case each query will need fewer queued buffers and
/// therefore have less memory usage.
//
/// The IoMgr defers CPU management to the caller. The IoMgr provides a GetNextRange
/// API which will return the next scan range the caller should process. The caller
/// can call this from the desired number of reading threads. Once a scan range
/// has been returned via GetNextRange, the IoMgr will start to buffer reads for
/// that range and it is expected the caller will pull those buffers promptly. For
/// example, if the caller would like to have 1 scanner thread, the read loop
/// would look like:
/// while (more_ranges)
/// range = GetNextRange()
/// while (!range.eosr)
/// buffer = range.GetNext()
/// To have multiple reading threads, the caller would simply spin up the threads
/// and each would process the loops above.
//
/// To control the number of IO buffers, each scan range has a limit of two queued
/// buffers (SCAN_RANGE_READY_BUFFER_LIMIT). If the number of buffers is at capacity,
/// the IoMgr will no longer read for that scan range until the caller has processed
/// a buffer. Assuming the client returns each buffer before requesting the next one
/// from the scan range, then this will consume up to 3 * 8MB = 24MB of I/O buffers per
/// scan range.
//
/// Buffer Management:
/// Buffers for reads are either a) allocated by the IoMgr and transferred to the caller,
/// b) cached HDFS buffers if the scan range uses HDFS caching, or c) provided by the
/// caller when constructing the scan range.
///
/// As a caller reads from a scan range, these buffers are wrapped in BufferDescriptors
/// and returned to the caller. The caller must always call ReturnBuffer() on the buffer
/// descriptor to allow recycling of the associated buffer (if there is an
/// IoMgr-allocated or HDFS cached buffer).
///
/// Caching support:
/// Scan ranges contain metadata on whether or not it is cached on the DN. In that
/// case, we use the HDFS APIs to read the cached data without doing any copies. For these
/// ranges, the reads happen on the caller thread (as opposed to the disk threads).
/// It is possible for the cached read APIs to fail, in which case the ranges are then
/// queued on the disk threads and behave identically to the case where the range
/// is not cached.
/// Resources for these ranges are also not accounted against the reader because none
/// are consumed.
/// While a cached block is being processed, the block is mlocked. We want to minimize
/// the time the mlock is held.
/// - HDFS will time us out if we hold onto the mlock for too long
/// - Holding the lock prevents uncaching this file due to a caching policy change.
/// Therefore, we only issue the cached read when the caller is ready to process the
/// range (GetNextRange()) instead of when the ranges are issued. This guarantees that
/// there will be a CPU available to process the buffer and any throttling we do with
/// the number of scanner threads properly controls the amount of files we mlock.
/// With cached scan ranges, we cannot close the scan range until the cached buffer
/// is returned (HDFS does not allow this). We therefore need to defer the close until
/// the cached buffer is returned (ReturnBuffer()).
//
/// Remote filesystem support (e.g. S3):
/// Remote filesystems are modeled as "remote disks". That is, there is a seperate disk
/// queue for each supported remote filesystem type. In order to maximize throughput,
/// multiple connections are opened in parallel by having multiple threads running per
/// queue. Also note that reading from a remote filesystem service can be more CPU
/// intensive than local disk/hdfs because of non-direct I/O and SSL processing, and can
/// be CPU bottlenecked especially if not enough I/O threads for these queues are
/// started.
//
/// TODO: IoMgr should be able to request additional scan ranges from the coordinator
/// to help deal with stragglers.
/// TODO: look into using a lock free queue
/// TODO: simplify the common path (less locking, memory allocations).
//
/// Structure of the Implementation:
/// - All client APIs are defined in this file, request-ranges.h and request-context.h.
/// Clients can include only the files that they need.
/// - Some internal classes are defined in disk-io-mgr-internal.h
/// - ScanRange APIs are implemented in scan-range.cc
/// This contains the ready buffer queue logic
/// - RequestContext APIs are implemented in request-context.cc
/// This contains the logic for picking scan ranges for a reader.
/// - Disk Thread and general APIs are implemented in disk-io-mgr.cc.
/// - The handle cache is implemented in handle-cache{.inline,}.h
// This is cache line aligned because the FileHandleCache needs cache line alignment
// for its partitions.
class DiskIoMgr : public CacheLineAligned {
public:
/// Create a DiskIoMgr object. This constructor is only used for testing.
/// - num_disks: The number of disks the IoMgr should use. This is used for testing.
/// Specify 0, to have the disk IoMgr query the os for the number of disks.
/// - threads_per_rotational_disk: number of read threads to create per rotational
/// disk. This is also the max queue depth.
/// - threads_per_solid_state_disk: number of read threads to create per solid state
/// disk. This is also the max queue depth.
/// - min_buffer_size: minimum io buffer size (in bytes)
/// - max_buffer_size: maximum io buffer size (in bytes). Also the max read size.
DiskIoMgr(int num_disks, int threads_per_rotational_disk,
int threads_per_solid_state_disk, int min_buffer_size, int max_buffer_size);
/// Create DiskIoMgr with default configs.
DiskIoMgr();
/// Clean up all threads and resources. This is mostly useful for testing since
/// for impalad, this object is never destroyed.
virtual ~DiskIoMgr();
/// Initialize the IoMgr. Must be called once before any of the other APIs.
Status Init(MemTracker* process_mem_tracker) WARN_UNUSED_RESULT;
/// Allocates tracking structure for a request context.
/// Register a new request context and return it to the caller. The caller must call
/// UnregisterContext() for each context.
/// reader_mem_tracker: Is non-null only for readers. IO buffers
/// used for this reader will be tracked by this. If the limit is exceeded
/// the reader will be cancelled and MEM_LIMIT_EXCEEDED will be returned via
/// GetNext().
std::unique_ptr<RequestContext> RegisterContext(MemTracker* reader_mem_tracker);
/// Unregisters context from the disk IoMgr by first cancelling it then blocking until
/// all references to the context are removed from I/O manager internal data structures.
/// This must be called for every RegisterContext() to ensure that the context object
/// can be safely destroyed. It is invalid to add more request ranges to 'context' after
/// after this call. This call blocks until all the disk threads have finished cleaning
/// up.
void UnregisterContext(RequestContext* context);
/// This function cancels the context asychronously. All outstanding requests
/// are aborted and tracking structures cleaned up. This does not need to be
/// called if the context finishes normally.
/// This will also fail any outstanding GetNext()/Read requests.
void CancelContext(RequestContext* context);
/// Adds the scan ranges to the queues. This call is non-blocking. The caller must
/// not deallocate the scan range pointers before UnregisterContext().
/// If schedule_immediately, the ranges are immediately put on the read queue
/// (i.e. the caller should not/cannot call GetNextRange for these ranges).
/// This can be used to do synchronous reads as well as schedule dependent ranges,
/// as in the case for columnar formats.
Status AddScanRanges(RequestContext* reader,
const std::vector<ScanRange*>& ranges,
bool schedule_immediately = false) WARN_UNUSED_RESULT;
Status AddScanRange(RequestContext* reader, ScanRange* range,
bool schedule_immediately = false) WARN_UNUSED_RESULT;
/// Add a WriteRange for the writer. This is non-blocking and schedules the context
/// on the IoMgr disk queue. Does not create any files.
Status AddWriteRange(
RequestContext* writer, WriteRange* write_range) WARN_UNUSED_RESULT;
/// Returns the next unstarted scan range for this reader. When the range is returned,
/// the disk threads in the IoMgr will already have started reading from it. The
/// caller is expected to call ScanRange::GetNext on the returned range.
/// If there are no more unstarted ranges, nullptr is returned.
/// This call is blocking.
Status GetNextRange(RequestContext* reader, ScanRange** range) WARN_UNUSED_RESULT;
/// Reads the range and returns the result in buffer.
/// This behaves like the typical synchronous read() api, blocking until the data
/// is read. This can be called while there are outstanding ScanRanges and is
/// thread safe. Multiple threads can be calling Read() per reader at a time.
/// range *cannot* have already been added via AddScanRanges.
/// This can only be used if the scan range fits in a single IO buffer (i.e. is smaller
/// than max_read_buffer_size()) or if reading into a client-provided buffer.
Status Read(RequestContext* reader, ScanRange* range,
std::unique_ptr<BufferDescriptor>* buffer) WARN_UNUSED_RESULT;
/// Returns the buffer to the IoMgr. This must be called for every buffer
/// returned by GetNext()/Read() that did not return an error. This is non-blocking.
/// After calling this, the buffer descriptor is invalid and cannot be accessed.
void ReturnBuffer(std::unique_ptr<BufferDescriptor> buffer);
/// Determine which disk queue this file should be assigned to. Returns an index into
/// disk_queues_. The disk_id is the volume ID for the local disk that holds the
/// files, or -1 if unknown. Flag expected_local is true iff this impalad is
/// co-located with the datanode for this file.
int AssignQueue(const char* file, int disk_id, bool expected_local);
/// TODO: The functions below can be moved to RequestContext.
/// Returns the current status of the context.
Status context_status(RequestContext* context) const WARN_UNUSED_RESULT;
void set_bytes_read_counter(RequestContext*, RuntimeProfile::Counter*);
void set_read_timer(RequestContext*, RuntimeProfile::Counter*);
void set_open_file_timer(RequestContext*, RuntimeProfile::Counter*);
void set_active_read_thread_counter(RequestContext*, RuntimeProfile::Counter*);
void set_disks_access_bitmap(RequestContext*, RuntimeProfile::Counter*);
int64_t queue_size(RequestContext* reader) const;
int64_t bytes_read_local(RequestContext* reader) const;
int64_t bytes_read_short_circuit(RequestContext* reader) const;
int64_t bytes_read_dn_cache(RequestContext* reader) const;
int num_remote_ranges(RequestContext* reader) const;
int64_t unexpected_remote_bytes(RequestContext* reader) const;
int cached_file_handles_hit_count(RequestContext* reader) const;
int cached_file_handles_miss_count(RequestContext* reader) const;
/// Returns the read throughput across all readers.
/// TODO: should this be a sliding window? This should report metrics for the
/// last minute, hour and since the beginning.
int64_t GetReadThroughput();
/// Returns the maximum read buffer size
int max_read_buffer_size() const { return max_buffer_size_; }
/// Returns the total number of disk queues (both local and remote).
int num_total_disks() const { return disk_queues_.size(); }
/// Returns the total number of remote "disk" queues.
int num_remote_disks() const { return REMOTE_NUM_DISKS; }
/// Returns the number of local disks attached to the system.
int num_local_disks() const { return num_total_disks() - num_remote_disks(); }
/// The disk ID (and therefore disk_queues_ index) used for DFS accesses.
int RemoteDfsDiskId() const { return num_local_disks() + REMOTE_DFS_DISK_OFFSET; }
/// The disk ID (and therefore disk_queues_ index) used for S3 accesses.
int RemoteS3DiskId() const { return num_local_disks() + REMOTE_S3_DISK_OFFSET; }
/// The disk ID (and therefore disk_queues_ index) used for ADLS accesses.
int RemoteAdlsDiskId() const { return num_local_disks() + REMOTE_ADLS_DISK_OFFSET; }
/// Dumps the disk IoMgr queues (for readers and disks)
std::string DebugString();
/// Validates the internal state is consistent. This is intended to only be used
/// for debugging.
bool Validate() const;
/// Given a FS handle, name and last modified time of the file, construct a new
/// ExclusiveHdfsFileHandle. This records the time spent opening the handle in
/// 'reader' and counts this as a cache miss. In the case of an error, returns nullptr.
ExclusiveHdfsFileHandle* GetExclusiveHdfsFileHandle(const hdfsFS& fs,
std::string* fname, int64_t mtime, RequestContext* reader);
/// Releases an exclusive file handle, destroying it
void ReleaseExclusiveHdfsFileHandle(ExclusiveHdfsFileHandle* fid);
/// Given a FS handle, name and last modified time of the file, gets a
/// CachedHdfsFileHandle from the file handle cache. Records the time spent
/// opening the handle in 'reader'. On success, records statistics
/// about whether this was a cache hit or miss in the 'reader' as well as at the
/// system level. In case of an error returns nullptr.
CachedHdfsFileHandle* GetCachedHdfsFileHandle(const hdfsFS& fs,
std::string* fname, int64_t mtime, RequestContext* reader);
/// Releases a file handle back to the file handle cache when it is no longer in use.
void ReleaseCachedHdfsFileHandle(std::string* fname, CachedHdfsFileHandle* fid);
/// Reopens a file handle by destroying the file handle and getting a fresh
/// file handle from the cache. Records the time spent reopening the handle
/// in 'reader'. Returns an error if the file could not be reopened.
Status ReopenCachedHdfsFileHandle(const hdfsFS& fs, std::string* fname, int64_t mtime,
RequestContext* reader, CachedHdfsFileHandle** fid);
/// Garbage collect unused I/O buffers up to 'bytes_to_free', or all the buffers if
/// 'bytes_to_free' is -1.
void GcIoBuffers(int64_t bytes_to_free = -1);
// Function to change the underlying LocalFileSystem object used for disk I/O.
// DiskIoMgr will also take responsibility of the received LocalFileSystem pointer.
// It is only for testing purposes to use a fault injected version of LocalFileSystem.
void SetLocalFileSystem(std::unique_ptr<LocalFileSystem> fs) {
local_file_system_ = std::move(fs);
}
/// The maximum number of ready buffers that can be queued in a scan range. Having two
/// queued buffers (plus the buffer that is returned to the client) gives good
/// performance in most scenarios:
/// 1. If the consumer is consuming data faster than we can read from disk, then the
/// queue will be empty most of the time because the buffer will be immediately
/// pulled off the queue as soon as it is added. There will always be an I/O request
/// in the disk queue to maximize I/O throughput, which is the bottleneck in this
/// case.
/// 2. If we can read from disk faster than the consumer is consuming data, the queue
/// will fill up and there will always be a buffer available for the consumer to
/// read, so the consumer will not block and we maximize consumer throughput, which
/// is the bottleneck in this case.
/// 3. If the consumer is consuming data at approximately the same rate as we are
/// reading from disk, then the steady state is that the consumer is processing one
/// buffer and one buffer is in the disk queue. The additional buffer can absorb
/// bursts where the producer runs faster than the consumer or the consumer runs
/// faster than the producer without blocking either the producer or consumer.
static const int SCAN_RANGE_READY_BUFFER_LIMIT = 2;
/// "Disk" queue offsets for remote accesses. Offset 0 corresponds to
/// disk ID (i.e. disk_queue_ index) of num_local_disks().
enum {
REMOTE_DFS_DISK_OFFSET = 0,
REMOTE_S3_DISK_OFFSET,
REMOTE_ADLS_DISK_OFFSET,
REMOTE_NUM_DISKS
};
private:
friend class BufferDescriptor;
friend class RequestContext;
// TODO: remove io:: prefix - it is required for the "using ScanRange" workaround above.
friend class io::ScanRange;
struct DiskQueue;
friend class DiskIoMgrTest_Buffers_Test;
friend class DiskIoMgrTest_VerifyNumThreadsParameter_Test;
/// Memory tracker for unused I/O buffers owned by DiskIoMgr.
boost::scoped_ptr<MemTracker> free_buffer_mem_tracker_;
/// Memory tracker for I/O buffers where the RequestContext has no MemTracker.
/// TODO: once IMPALA-3200 is fixed, there should be no more cases where readers don't
/// provide a MemTracker.
boost::scoped_ptr<MemTracker> unowned_buffer_mem_tracker_;
// Handles the low level I/O functionality.
std::unique_ptr<LocalFileSystem> local_file_system_;
/// Number of worker(read) threads per rotational disk. Also the max depth of queued
/// work to the disk.
const int num_io_threads_per_rotational_disk_;
/// Number of worker(read) threads per solid state disk. Also the max depth of queued
/// work to the disk.
const int num_io_threads_per_solid_state_disk_;
/// Maximum read size. This is also the maximum size of each allocated buffer.
const int max_buffer_size_;
/// The minimum size of each read buffer.
const int min_buffer_size_;
/// Thread group containing all the worker threads.
ThreadGroup disk_thread_group_;
/// Options object for cached hdfs reads. Set on startup and never modified.
struct hadoopRzOptions* cached_read_options_ = nullptr;
/// True if the IoMgr should be torn down. Worker threads watch for this to
/// know to terminate. This variable is read/written to by different threads.
volatile bool shut_down_;
/// Total bytes read by the IoMgr.
RuntimeProfile::Counter total_bytes_read_counter_;
/// Total time spent in hdfs reading
RuntimeProfile::Counter read_timer_;
/// Protects free_buffers_
boost::mutex free_buffers_lock_;
/// Free buffers that can be handed out to clients. There is one list for each buffer
/// size, indexed by the Log2 of the buffer size in units of min_buffer_size_. The
/// maximum buffer size is max_buffer_size_, so the maximum index is
/// Log2(max_buffer_size_ / min_buffer_size_).
//
/// E.g. if min_buffer_size_ = 1024 bytes:
/// free_buffers_[0] => list of free buffers with size 1024 B
/// free_buffers_[1] => list of free buffers with size 2048 B
/// free_buffers_[10] => list of free buffers with size 1 MB
/// free_buffers_[13] => list of free buffers with size 8 MB
/// free_buffers_[n] => list of free buffers with size 2^n * 1024 B
std::vector<std::deque<uint8_t*>> free_buffers_;
/// Total number of allocated buffers, used for debugging.
AtomicInt32 num_allocated_buffers_;
/// Total number of buffers in readers
AtomicInt32 num_buffers_in_readers_;
/// Per disk queues. This is static and created once at Init() time. One queue is
/// allocated for each local disk on the system and for each remote filesystem type.
/// It is indexed by disk id.
std::vector<DiskQueue*> disk_queues_;
/// The next disk queue to write to if the actual 'disk_id_' is unknown (i.e. the file
/// is not associated with a particular local disk or remote queue). Used to implement
/// round-robin assignment for that case.
static AtomicInt32 next_disk_id_;
// Caching structure that maps file names to cached file handles. The cache has an upper
// limit of entries defined by FLAGS_max_cached_file_handles. Evicted cached file
// handles are closed.
FileHandleCache file_handle_cache_;
/// Returns the index into free_buffers_ for a given buffer size
int free_buffers_idx(int64_t buffer_size);
/// Returns a buffer to read into with size between 'buffer_size' and
/// 'max_buffer_size_', If there is an appropriately-sized free buffer in the
/// 'free_buffers_', that is returned, otherwise a new one is allocated.
/// The returned *buffer_size must be between 0 and 'max_buffer_size_'.
/// The buffer memory is tracked against reader's mem tracker, or
/// 'unowned_buffer_mem_tracker_' if the reader does not have one.
std::unique_ptr<BufferDescriptor> GetFreeBuffer(
RequestContext* reader, ScanRange* range, int64_t buffer_size);
/// Disassociates the desc->buffer_ memory from 'desc' (which cannot be nullptr), either
/// freeing it or returning it to 'free_buffers_'. Memory tracking is updated to
/// reflect the transfer of ownership from desc->mem_tracker_ to the disk I/O mgr.
void FreeBufferMemory(BufferDescriptor* desc);
/// Disk worker thread loop. This function retrieves the next range to process on
/// the disk queue and invokes ReadRange() or Write() depending on the type of Range().
/// There can be multiple threads per disk running this loop.
void WorkLoop(DiskQueue* queue);
/// This is called from the disk thread to get the next range to process. It will
/// wait until a scan range and buffer are available, or a write range is available.
/// This functions returns the range to process.
/// Only returns false if the disk thread should be shut down.
/// No locks should be taken before this function call and none are left taken after.
bool GetNextRequestRange(DiskQueue* disk_queue, RequestRange** range,
RequestContext** request_context);
/// Updates disk queue and reader state after a read is complete. The read result
/// is captured in the buffer descriptor.
void HandleReadFinished(DiskQueue* disk_queue, RequestContext* reader,
std::unique_ptr<BufferDescriptor> buffer);
/// Invokes write_range->callback_ after the range has been written and
/// updates per-disk state and handle state. The status of the write OK/RUNTIME_ERROR
/// etc. is passed via write_status and to the callback.
/// The write_status does not affect the writer->status_. That is, an write error does
/// not cancel the writer context - that decision is left to the callback handler.
/// TODO: On the read path, consider not canceling the reader context on error.
void HandleWriteFinished(
RequestContext* writer, WriteRange* write_range, const Status& write_status);
/// Validates that range is correctly initialized
Status ValidateScanRange(ScanRange* range) WARN_UNUSED_RESULT;
/// Write the specified range to disk and calls HandleWriteFinished when done.
/// Responsible for opening and closing the file that is written.
void Write(RequestContext* writer_context, WriteRange* write_range);
/// Helper method to write a range using the specified FILE handle. Returns Status:OK
/// if the write succeeded, or a RUNTIME_ERROR with an appropriate message otherwise.
/// Does not open or close the file that is written.
Status WriteRangeHelper(FILE* file_handle, WriteRange* write_range) WARN_UNUSED_RESULT;
/// Reads the specified scan range and calls HandleReadFinished when done.
void ReadRange(DiskQueue* disk_queue, RequestContext* reader, ScanRange* range);
/// Try to allocate the next buffer for the scan range, returning the new buffer
/// if successful. If 'reader' is cancelled, cancels the range and returns nullptr.
/// If there is memory pressure and buffers are already queued, adds the range
/// to the blocked ranges and returns nullptr.
std::unique_ptr<BufferDescriptor> TryAllocateNextBufferForRange(DiskQueue* disk_queue,
RequestContext* reader, ScanRange* range, int64_t buffer_size);
};
}
}
#endif
| 52.685512 | 90 | 0.74725 |
9a59ccb6e7ef95c414665869a163b33acae62d9a | 51,778 | h | C | minitel/font.h | Marcussacapuces91/Minitel | feb8641dab1b8f93c6d101cc288d4c425eca8765 | [
"Apache-2.0"
] | null | null | null | minitel/font.h | Marcussacapuces91/Minitel | feb8641dab1b8f93c6d101cc288d4c425eca8765 | [
"Apache-2.0"
] | null | null | null | minitel/font.h | Marcussacapuces91/Minitel | feb8641dab1b8f93c6d101cc288d4c425eca8765 | [
"Apache-2.0"
] | null | null | null | // Created by http://oleddisplay.squix.ch/ Consider a donation
// In case of problems make sure that you are using the font file with the correct version!
const char Roboto_Mono_Bold_21[] PROGMEM = {
0x0D, // Width: 13
0x1A, // Height: 26
0x20, // First Char: 32
0xE0, // Numbers of Chars: 224
// Jump Table:
0xFF, 0xFF, 0x00, 0x0D, // 32:65535
0x00, 0x00, 0x1F, 0x0D, // 33:0
0x00, 0x1F, 0x22, 0x0D, // 34:31
0x00, 0x41, 0x2E, 0x0D, // 35:65
0x00, 0x6F, 0x2F, 0x0D, // 36:111
0x00, 0x9E, 0x2F, 0x0D, // 37:158
0x00, 0xCD, 0x33, 0x0D, // 38:205
0x01, 0x00, 0x1A, 0x0D, // 39:256
0x01, 0x1A, 0x24, 0x0D, // 40:282
0x01, 0x3E, 0x23, 0x0D, // 41:318
0x01, 0x61, 0x2E, 0x0D, // 42:353
0x01, 0x8F, 0x2A, 0x0D, // 43:399
0x01, 0xB9, 0x1B, 0x0D, // 44:441
0x01, 0xD4, 0x2A, 0x0D, // 45:468
0x01, 0xFE, 0x1F, 0x0D, // 46:510
0x02, 0x1D, 0x29, 0x0D, // 47:541
0x02, 0x46, 0x2B, 0x0D, // 48:582
0x02, 0x71, 0x1F, 0x0D, // 49:625
0x02, 0x90, 0x2B, 0x0D, // 50:656
0x02, 0xBB, 0x2B, 0x0D, // 51:699
0x02, 0xE6, 0x2F, 0x0D, // 52:742
0x03, 0x15, 0x2B, 0x0D, // 53:789
0x03, 0x40, 0x2B, 0x0D, // 54:832
0x03, 0x6B, 0x29, 0x0D, // 55:875
0x03, 0x94, 0x2B, 0x0D, // 56:916
0x03, 0xBF, 0x2A, 0x0D, // 57:959
0x03, 0xE9, 0x1F, 0x0D, // 58:1001
0x04, 0x08, 0x22, 0x0D, // 59:1032
0x04, 0x2A, 0x2B, 0x0D, // 60:1066
0x04, 0x55, 0x2B, 0x0D, // 61:1109
0x04, 0x80, 0x2A, 0x0D, // 62:1152
0x04, 0xAA, 0x2A, 0x0D, // 63:1194
0x04, 0xD4, 0x2E, 0x0D, // 64:1236
0x05, 0x02, 0x33, 0x0D, // 65:1282
0x05, 0x35, 0x2F, 0x0D, // 66:1333
0x05, 0x64, 0x2F, 0x0D, // 67:1380
0x05, 0x93, 0x2E, 0x0D, // 68:1427
0x05, 0xC1, 0x2F, 0x0D, // 69:1473
0x05, 0xF0, 0x2D, 0x0D, // 70:1520
0x06, 0x1D, 0x2F, 0x0D, // 71:1565
0x06, 0x4C, 0x2B, 0x0D, // 72:1612
0x06, 0x77, 0x2B, 0x0D, // 73:1655
0x06, 0xA2, 0x2B, 0x0D, // 74:1698
0x06, 0xCD, 0x33, 0x0D, // 75:1741
0x07, 0x00, 0x2B, 0x0D, // 76:1792
0x07, 0x2B, 0x2B, 0x0D, // 77:1835
0x07, 0x56, 0x2B, 0x0D, // 78:1878
0x07, 0x81, 0x2E, 0x0D, // 79:1921
0x07, 0xAF, 0x2E, 0x0D, // 80:1967
0x07, 0xDD, 0x2F, 0x0D, // 81:2013
0x08, 0x0C, 0x2F, 0x0D, // 82:2060
0x08, 0x3B, 0x2F, 0x0D, // 83:2107
0x08, 0x6A, 0x2D, 0x0D, // 84:2154
0x08, 0x97, 0x2B, 0x0D, // 85:2199
0x08, 0xC2, 0x2D, 0x0D, // 86:2242
0x08, 0xEF, 0x2E, 0x0D, // 87:2287
0x09, 0x1D, 0x33, 0x0D, // 88:2333
0x09, 0x50, 0x31, 0x0D, // 89:2384
0x09, 0x81, 0x2F, 0x0D, // 90:2433
0x09, 0xB0, 0x23, 0x0D, // 91:2480
0x09, 0xD3, 0x2B, 0x0D, // 92:2515
0x09, 0xFE, 0x23, 0x0D, // 93:2558
0x0A, 0x21, 0x2A, 0x0D, // 94:2593
0x0A, 0x4B, 0x2B, 0x0D, // 95:2635
0x0A, 0x76, 0x21, 0x0D, // 96:2678
0x0A, 0x97, 0x2B, 0x0D, // 97:2711
0x0A, 0xC2, 0x2B, 0x0D, // 98:2754
0x0A, 0xED, 0x2B, 0x0D, // 99:2797
0x0B, 0x18, 0x2B, 0x0D, // 100:2840
0x0B, 0x43, 0x2E, 0x0D, // 101:2883
0x0B, 0x71, 0x2D, 0x0D, // 102:2929
0x0B, 0x9E, 0x2B, 0x0D, // 103:2974
0x0B, 0xC9, 0x2B, 0x0D, // 104:3017
0x0B, 0xF4, 0x2B, 0x0D, // 105:3060
0x0C, 0x1F, 0x23, 0x0D, // 106:3103
0x0C, 0x42, 0x2F, 0x0D, // 107:3138
0x0C, 0x71, 0x2B, 0x0D, // 108:3185
0x0C, 0x9C, 0x2F, 0x0D, // 109:3228
0x0C, 0xCB, 0x2B, 0x0D, // 110:3275
0x0C, 0xF6, 0x2E, 0x0D, // 111:3318
0x0D, 0x24, 0x2B, 0x0D, // 112:3364
0x0D, 0x4F, 0x2B, 0x0D, // 113:3407
0x0D, 0x7A, 0x2E, 0x0D, // 114:3450
0x0D, 0xA8, 0x2B, 0x0D, // 115:3496
0x0D, 0xD3, 0x2B, 0x0D, // 116:3539
0x0D, 0xFE, 0x2B, 0x0D, // 117:3582
0x0E, 0x29, 0x2E, 0x0D, // 118:3625
0x0E, 0x57, 0x2E, 0x0D, // 119:3671
0x0E, 0x85, 0x2F, 0x0D, // 120:3717
0x0E, 0xB4, 0x32, 0x0D, // 121:3764
0x0E, 0xE6, 0x2F, 0x0D, // 122:3814
0x0F, 0x15, 0x27, 0x0D, // 123:3861
0x0F, 0x3C, 0x1B, 0x0D, // 124:3900
0x0F, 0x57, 0x26, 0x0D, // 125:3927
0x0F, 0x7D, 0x2E, 0x0D, // 126:3965
0xFF, 0xFF, 0x00, 0x0D, // 127:65535
0xFF, 0xFF, 0x00, 0x0D, // 128:65535
0xFF, 0xFF, 0x00, 0x0D, // 129:65535
0xFF, 0xFF, 0x00, 0x0D, // 130:65535
0xFF, 0xFF, 0x00, 0x0D, // 131:65535
0xFF, 0xFF, 0x00, 0x0D, // 132:65535
0xFF, 0xFF, 0x00, 0x0D, // 133:65535
0xFF, 0xFF, 0x00, 0x0D, // 134:65535
0xFF, 0xFF, 0x00, 0x0D, // 135:65535
0xFF, 0xFF, 0x00, 0x0D, // 136:65535
0xFF, 0xFF, 0x00, 0x0D, // 137:65535
0xFF, 0xFF, 0x00, 0x0D, // 138:65535
0xFF, 0xFF, 0x00, 0x0D, // 139:65535
0xFF, 0xFF, 0x00, 0x0D, // 140:65535
0xFF, 0xFF, 0x00, 0x0D, // 141:65535
0xFF, 0xFF, 0x00, 0x0D, // 142:65535
0xFF, 0xFF, 0x00, 0x0D, // 143:65535
0xFF, 0xFF, 0x00, 0x0D, // 144:65535
0xFF, 0xFF, 0x00, 0x0D, // 145:65535
0xFF, 0xFF, 0x00, 0x0D, // 146:65535
0xFF, 0xFF, 0x00, 0x0D, // 147:65535
0xFF, 0xFF, 0x00, 0x0D, // 148:65535
0xFF, 0xFF, 0x00, 0x0D, // 149:65535
0xFF, 0xFF, 0x00, 0x0D, // 150:65535
0xFF, 0xFF, 0x00, 0x0D, // 151:65535
0xFF, 0xFF, 0x00, 0x0D, // 152:65535
0xFF, 0xFF, 0x00, 0x0D, // 153:65535
0xFF, 0xFF, 0x00, 0x0D, // 154:65535
0xFF, 0xFF, 0x00, 0x0D, // 155:65535
0xFF, 0xFF, 0x00, 0x0D, // 156:65535
0xFF, 0xFF, 0x00, 0x0D, // 157:65535
0xFF, 0xFF, 0x00, 0x0D, // 158:65535
0xFF, 0xFF, 0x00, 0x0D, // 159:65535
0xFF, 0xFF, 0x00, 0x0D, // 160:65535
0x0F, 0xAB, 0x1F, 0x0D, // 161:4011
0x0F, 0xCA, 0x2B, 0x0D, // 162:4042
0x0F, 0xF5, 0x2F, 0x0D, // 163:4085
0x10, 0x24, 0x2F, 0x0D, // 164:4132
0x10, 0x53, 0x31, 0x0D, // 165:4179
0x10, 0x84, 0x1F, 0x0D, // 166:4228
0x10, 0xA3, 0x2F, 0x0D, // 167:4259
0x10, 0xD2, 0x25, 0x0D, // 168:4306
0x10, 0xF7, 0x2E, 0x0D, // 169:4343
0x11, 0x25, 0x26, 0x0D, // 170:4389
0x11, 0x4B, 0x2B, 0x0D, // 171:4427
0x11, 0x76, 0x26, 0x0D, // 172:4470
0x11, 0x9C, 0x2A, 0x0D, // 173:4508
0x11, 0xC6, 0x2E, 0x0D, // 174:4550
0x11, 0xF4, 0x25, 0x0D, // 175:4596
0x12, 0x19, 0x22, 0x0D, // 176:4633
0x12, 0x3B, 0x2B, 0x0D, // 177:4667
0x12, 0x66, 0x26, 0x0D, // 178:4710
0x12, 0x8C, 0x26, 0x0D, // 179:4748
0x12, 0xB2, 0x21, 0x0D, // 180:4786
0x12, 0xD3, 0x2F, 0x0D, // 181:4819
0x13, 0x02, 0x27, 0x0D, // 182:4866
0x13, 0x29, 0x1E, 0x0D, // 183:4905
0x13, 0x47, 0x1F, 0x0D, // 184:4935
0x13, 0x66, 0x1E, 0x0D, // 185:4966
0x13, 0x84, 0x26, 0x0D, // 186:4996
0x13, 0xAA, 0x2A, 0x0D, // 187:5034
0x13, 0xD4, 0x2F, 0x0D, // 188:5076
0x14, 0x03, 0x33, 0x0D, // 189:5123
0x14, 0x36, 0x33, 0x0D, // 190:5174
0x14, 0x69, 0x2B, 0x0D, // 191:5225
0x14, 0x94, 0x33, 0x0D, // 192:5268
0x14, 0xC7, 0x33, 0x0D, // 193:5319
0x14, 0xFA, 0x33, 0x0D, // 194:5370
0x15, 0x2D, 0x33, 0x0D, // 195:5421
0x15, 0x60, 0x33, 0x0D, // 196:5472
0x15, 0x93, 0x33, 0x0D, // 197:5523
0x15, 0xC6, 0x2F, 0x0D, // 198:5574
0x15, 0xF5, 0x2F, 0x0D, // 199:5621
0x16, 0x24, 0x2F, 0x0D, // 200:5668
0x16, 0x53, 0x2F, 0x0D, // 201:5715
0x16, 0x82, 0x2F, 0x0D, // 202:5762
0x16, 0xB1, 0x2F, 0x0D, // 203:5809
0x16, 0xE0, 0x2B, 0x0D, // 204:5856
0x17, 0x0B, 0x2B, 0x0D, // 205:5899
0x17, 0x36, 0x2B, 0x0D, // 206:5942
0x17, 0x61, 0x2B, 0x0D, // 207:5985
0x17, 0x8C, 0x2E, 0x0D, // 208:6028
0x17, 0xBA, 0x2B, 0x0D, // 209:6074
0x17, 0xE5, 0x2E, 0x0D, // 210:6117
0x18, 0x13, 0x2E, 0x0D, // 211:6163
0x18, 0x41, 0x2E, 0x0D, // 212:6209
0x18, 0x6F, 0x2E, 0x0D, // 213:6255
0x18, 0x9D, 0x2E, 0x0D, // 214:6301
0x18, 0xCB, 0x2B, 0x0D, // 215:6347
0x18, 0xF6, 0x2E, 0x0D, // 216:6390
0x19, 0x24, 0x2B, 0x0D, // 217:6436
0x19, 0x4F, 0x2B, 0x0D, // 218:6479
0x19, 0x7A, 0x2B, 0x0D, // 219:6522
0x19, 0xA5, 0x2B, 0x0D, // 220:6565
0x19, 0xD0, 0x31, 0x0D, // 221:6608
0x1A, 0x01, 0x2E, 0x0D, // 222:6657
0x1A, 0x2F, 0x2F, 0x0D, // 223:6703
0x1A, 0x5E, 0x2B, 0x0D, // 224:6750
0x1A, 0x89, 0x2B, 0x0D, // 225:6793
0x1A, 0xB4, 0x2B, 0x0D, // 226:6836
0x1A, 0xDF, 0x2B, 0x0D, // 227:6879
0x1B, 0x0A, 0x2B, 0x0D, // 228:6922
0x1B, 0x35, 0x2B, 0x0D, // 229:6965
0x1B, 0x60, 0x2F, 0x0D, // 230:7008
0x1B, 0x8F, 0x2B, 0x0D, // 231:7055
0x1B, 0xBA, 0x2E, 0x0D, // 232:7098
0x1B, 0xE8, 0x2E, 0x0D, // 233:7144
0x1C, 0x16, 0x2E, 0x0D, // 234:7190
0x1C, 0x44, 0x2E, 0x0D, // 235:7236
0x1C, 0x72, 0x2B, 0x0D, // 236:7282
0x1C, 0x9D, 0x2B, 0x0D, // 237:7325
0x1C, 0xC8, 0x2B, 0x0D, // 238:7368
0x1C, 0xF3, 0x2B, 0x0D, // 239:7411
0x1D, 0x1E, 0x2B, 0x0D, // 240:7454
0x1D, 0x49, 0x2B, 0x0D, // 241:7497
0x1D, 0x74, 0x2E, 0x0D, // 242:7540
0x1D, 0xA2, 0x2E, 0x0D, // 243:7586
0x1D, 0xD0, 0x2E, 0x0D, // 244:7632
0x1D, 0xFE, 0x2E, 0x0D, // 245:7678
0x1E, 0x2C, 0x2E, 0x0D, // 246:7724
0x1E, 0x5A, 0x2E, 0x0D, // 247:7770
0x1E, 0x88, 0x2E, 0x0D, // 248:7816
0x1E, 0xB6, 0x2B, 0x0D, // 249:7862
0x1E, 0xE1, 0x2B, 0x0D, // 250:7905
0x1F, 0x0C, 0x2B, 0x0D, // 251:7948
0x1F, 0x37, 0x2B, 0x0D, // 252:7991
0x1F, 0x62, 0x32, 0x0D, // 253:8034
0x1F, 0x94, 0x2B, 0x0D, // 254:8084
0x1F, 0xBF, 0x32, 0x0D, // 255:8127
// Font Data:
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x3F,0x0E,0x00,0xE0,0x3F,0x0E,0x00,0xE0,0x3F,0x0E, // 33
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0,0x03, // 34
0x00,0xC0,0x00,0x00,0x00,0xC6,0x00,0x00,0x00,0xC6,0x0C,0x00,0x00,0xF6,0x0F,0x00,0xC0,0xFF,0x01,0x00,0xE0,0xC7,0x00,0x00,0x20,0xC6,0x0E,0x00,0x00,0xFE,0x0F,0x00,0xE0,0xFF,0x00,0x00,0xE0,0xC7,0x00,0x00,0x00,0xC6,0x00,0x00,0x00,0x06, // 35
0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x80,0x87,0x07,0x00,0xC0,0x8F,0x07,0x00,0xE0,0x1F,0x0E,0x00,0x60,0x1C,0x0C,0x00,0x78,0x38,0x3C,0x00,0x78,0x38,0x0C,0x00,0xE0,0x70,0x0E,0x00,0xC0,0xF3,0x0F,0x00,0xC0,0xE3,0x07,0x00,0x00,0x83,0x01, // 36
0x80,0x03,0x00,0x00,0xC0,0x07,0x00,0x00,0x60,0x0C,0x00,0x00,0x60,0x0C,0x01,0x00,0xE0,0xCF,0x03,0x00,0xC0,0x77,0x00,0x00,0x00,0xB8,0x03,0x00,0x00,0xCE,0x07,0x00,0x80,0x63,0x0C,0x00,0x00,0x61,0x0C,0x00,0x00,0xE0,0x0F,0x00,0x00,0xC0,0x07, // 37
0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x80,0xE7,0x07,0x00,0xC0,0xFF,0x0F,0x00,0xE0,0x3F,0x0C,0x00,0x60,0x78,0x0C,0x00,0x60,0xFC,0x0C,0x00,0xE0,0xCF,0x0F,0x00,0xC0,0x87,0x07,0x00,0x00,0x81,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xE0,0x0C,0x00,0x00,0x00,0x08, // 38
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0,0x03, // 39
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x0F,0x00,0xC0,0xFF,0x3F,0x00,0xE0,0x03,0x78,0x00,0x70,0x00,0xE0,0x00,0x38,0x00,0xC0,0x01, // 40
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x80,0x01,0x30,0x00,0xC0,0x00,0xE0,0x00,0x70,0x00,0xC0,0xFF,0x3F,0x00,0x80,0xFF,0x1F,0x00,0x00,0xFC,0x03, // 41
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x18,0x01,0x00,0x00,0x90,0x03,0x00,0x00,0xF0,0x01,0x00,0x00,0x7F,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0xF0,0x03,0x00,0x00,0x10,0x03,0x00,0x00,0x18,0x01,0x00,0x00,0x18, // 42
0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0xFF,0x07,0x00,0x00,0xFF,0x07,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 43
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x7C, // 44
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 45
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F, // 46
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x1E,0x00,0x00,0x80,0x1F,0x00,0x00,0xF0,0x07,0x00,0x00,0xFE,0x00,0x00,0xC0,0x3F,0x00,0x00,0xE0,0x07,0x00,0x00,0xE0,0x00,0x00,0x00,0x20, // 47
0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x80,0xFF,0x03,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x61,0x0F,0x00,0x60,0x30,0x0C,0x00,0x60,0x18,0x0C,0x00,0xE0,0x18,0x0E,0x00,0xE0,0xFF,0x0F,0x00,0xC0,0xFF,0x07,0x00,0x80,0xFF,0x03, // 48
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x80,0x03,0x00,0x00,0x80,0x01,0x00,0x00,0xC0,0x01,0x00,0x00,0xC0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 49
0x00,0x00,0x00,0x00,0x80,0x03,0x0C,0x00,0xC0,0x03,0x0E,0x00,0xC0,0x83,0x0F,0x00,0xE0,0xC0,0x0F,0x00,0x60,0xE0,0x0D,0x00,0x60,0xF0,0x0C,0x00,0xE0,0x78,0x0C,0x00,0xC0,0x3F,0x0C,0x00,0xC0,0x0F,0x0C,0x00,0x00,0x07,0x0C, // 50
0x00,0x00,0x00,0x00,0x80,0x01,0x03,0x00,0xC0,0x01,0x07,0x00,0xC0,0x01,0x0F,0x00,0xE0,0x18,0x0E,0x00,0x60,0x18,0x0C,0x00,0x60,0x18,0x0C,0x00,0xE0,0x38,0x0E,0x00,0xE0,0xFF,0x0F,0x00,0xC0,0xFF,0x07,0x00,0x80,0xE7,0x03, // 51
0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0xF0,0x01,0x00,0x00,0xF8,0x01,0x00,0x00,0x9E,0x01,0x00,0x80,0x87,0x01,0x00,0xC0,0x83,0x01,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01, // 52
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xE0,0x1F,0x07,0x00,0xE0,0x1F,0x07,0x00,0xE0,0x1B,0x0E,0x00,0x60,0x0C,0x0C,0x00,0x60,0x0C,0x0C,0x00,0x60,0x1C,0x0E,0x00,0x60,0xFC,0x0F,0x00,0x60,0xF8,0x07,0x00,0x60,0xF0,0x03, // 53
0x00,0x00,0x00,0x00,0x00,0xFC,0x01,0x00,0x00,0xFF,0x03,0x00,0x80,0xFF,0x07,0x00,0xC0,0x1B,0x0E,0x00,0xC0,0x0C,0x0C,0x00,0xE0,0x0C,0x0C,0x00,0x60,0x1C,0x0E,0x00,0x60,0xFC,0x0F,0x00,0x00,0xF8,0x07,0x00,0x00,0xF0,0x03, // 54
0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x08,0x00,0x60,0x00,0x0C,0x00,0x60,0x80,0x0F,0x00,0x60,0xE0,0x0F,0x00,0x60,0xF8,0x01,0x00,0x60,0x7E,0x00,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0, // 55
0x00,0x00,0x00,0x00,0x00,0xC3,0x03,0x00,0xC0,0xE7,0x07,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x3C,0x0E,0x00,0x60,0x18,0x0C,0x00,0x60,0x18,0x0C,0x00,0xE0,0x3C,0x0E,0x00,0xE0,0xFF,0x0F,0x00,0xC0,0xEF,0x07,0x00,0x80,0xC3,0x03, // 56
0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0xC0,0x3F,0x00,0x00,0xC0,0x7F,0x0C,0x00,0xE0,0x70,0x0C,0x00,0x60,0x60,0x0E,0x00,0x60,0x60,0x0E,0x00,0xE0,0x70,0x07,0x00,0xC0,0xFF,0x03,0x00,0x80,0xFF,0x01,0x00,0x00,0x7F, // 57
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F, // 58
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xC0,0x00,0x00,0x0F,0xFC,0x00,0x00,0x0F,0x7C,0x00,0x00,0x0F, // 59
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0xD8,0x00,0x00,0x00,0xDC,0x01,0x00,0x00,0x9C,0x01,0x00,0x00,0x8C,0x03,0x00,0x00,0x8E,0x03,0x00,0x00,0x0E,0x07, // 60
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01,0x00,0x00,0x98,0x01, // 61
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8E,0x07,0x00,0x00,0x8E,0x03,0x00,0x00,0x8C,0x01,0x00,0x00,0xDC,0x01,0x00,0x00,0xD8,0x01,0x00,0x00,0xD8,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x70, // 62
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0xC0,0x01,0x00,0x00,0xE0,0x01,0x00,0x00,0x60,0x60,0x0E,0x00,0x60,0x70,0x0E,0x00,0x60,0x78,0x0E,0x00,0xE0,0x1F,0x00,0x00,0xC0,0x0F,0x00,0x00,0xC0,0x07, // 63
0x00,0x70,0x00,0x00,0x00,0xFE,0x03,0x00,0x80,0x07,0x07,0x00,0xC0,0x60,0x06,0x00,0xC0,0xFC,0x0D,0x00,0x60,0x0E,0x0D,0x00,0x60,0x06,0x0D,0x00,0x60,0xFE,0x0D,0x00,0x60,0xFE,0x05,0x00,0xC0,0x00,0x01,0x00,0x80,0xFF,0x01,0x00,0x00,0x7F, // 64
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xFC,0x07,0x00,0x80,0xFF,0x01,0x00,0xE0,0x9F,0x01,0x00,0xE0,0x81,0x01,0x00,0xE0,0x9F,0x01,0x00,0x80,0xFF,0x01,0x00,0x00,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 65
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0xE0,0x38,0x0E,0x00,0xC0,0xFF,0x0F,0x00,0xC0,0xEF,0x07,0x00,0x00,0xC7,0x03, // 66
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x03,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xC0,0x83,0x07,0x00,0x80,0x83,0x03,0x00,0x00,0x82,0x01, // 67
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xC0,0x83,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFF,0x01,0x00,0x00,0x7C, // 68
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x00,0x0C, // 69
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60, // 70
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x03,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0xE0,0x30,0x0E,0x00,0xC0,0xF1,0x07,0x00,0x80,0xF1,0x07,0x00,0x00,0xF2,0x03, // 71
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 72
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C, // 73
0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x07,0x00,0x00,0x80,0x07,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x07,0x00,0xE0,0xFF,0x03, // 74
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x70,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x7E,0x00,0x00,0x80,0xFF,0x01,0x00,0xC0,0xE7,0x03,0x00,0xE0,0x81,0x0F,0x00,0xE0,0x00,0x0F,0x00,0x60,0x00,0x0C,0x00,0x20,0x00,0x08, // 75
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C, // 76
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0x07,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0x7C,0x00,0x00,0xC0,0x1F,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 77
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xC0,0x07,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0xE0,0x03,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 78
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x07,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xE0,0x01,0x0F,0x00,0xC0,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 79
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00,0xE0,0x70,0x00,0x00,0xC0,0x3F,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0x0F, // 80
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x03,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xE0,0x01,0x0F,0x00,0xC0,0xFF,0x1F,0x00,0x80,0xFF,0x3B,0x00,0x00,0xFE,0x30, // 81
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0x30,0x00,0x00,0x60,0xF0,0x00,0x00,0xE0,0xF8,0x07,0x00,0xC0,0xDF,0x0F,0x00,0xC0,0x1F,0x0F,0x00,0x00,0x07,0x0C, // 82
0x00,0x00,0x00,0x00,0x00,0x83,0x03,0x00,0xC0,0x8F,0x07,0x00,0xC0,0x8F,0x07,0x00,0xE0,0x1C,0x0E,0x00,0x60,0x18,0x0C,0x00,0x60,0x38,0x0C,0x00,0x60,0x38,0x0C,0x00,0xE0,0x70,0x0E,0x00,0xC0,0xF3,0x07,0x00,0xC0,0xE3,0x07,0x00,0x00,0xC3,0x03, // 83
0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 84
0x00,0x00,0x00,0x00,0xE0,0xFF,0x01,0x00,0xE0,0xFF,0x03,0x00,0xE0,0xFF,0x07,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x07,0x00,0xE0,0xFF,0x03, // 85
0x20,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0xE0,0x0F,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0xE0,0x0F,0x00,0x00,0x80,0x0F,0x00,0x00,0xF8,0x0F,0x00,0x80,0xFF,0x03,0x00,0xE0,0x3F,0x00,0x00,0xE0,0x07,0x00,0x00,0xE0, // 86
0x60,0x00,0x00,0x00,0xE0,0x3F,0x00,0x00,0xE0,0xFF,0x0F,0x00,0x00,0xFC,0x0F,0x00,0x00,0xFC,0x0F,0x00,0xE0,0xFF,0x00,0x00,0xE0,0x1F,0x00,0x00,0xC0,0xFF,0x07,0x00,0x00,0xE0,0x0F,0x00,0x80,0xFF,0x0F,0x00,0xE0,0xFF,0x07,0x00,0xE0,0x07, // 87
0x20,0x00,0x08,0x00,0x60,0x00,0x0C,0x00,0xE0,0x01,0x0F,0x00,0xE0,0xC7,0x0F,0x00,0xC0,0xEF,0x03,0x00,0x00,0xFE,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0xFF,0x01,0x00,0xC0,0xEF,0x07,0x00,0xE0,0x83,0x0F,0x00,0xE0,0x00,0x0F,0x00,0x60,0x00,0x0C,0x00,0x00,0x00,0x08, // 88
0x20,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0,0x0F,0x00,0x00,0x80,0x3F,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0xF0,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x80,0x3F,0x00,0x00,0xE0,0x07,0x00,0x00,0xE0,0x01,0x00,0x00,0x60,0x00,0x00,0x00,0x20, // 89
0x00,0x00,0x00,0x00,0x60,0x00,0x0E,0x00,0x60,0x00,0x0F,0x00,0x60,0xC0,0x0F,0x00,0x60,0xE0,0x0F,0x00,0x60,0xF8,0x0C,0x00,0x60,0x7C,0x0C,0x00,0x60,0x1F,0x0C,0x00,0xE0,0x07,0x0C,0x00,0xE0,0x03,0x0C,0x00,0xE0,0x00,0x0C,0x00,0x60,0x00,0x0C, // 90
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0x7F,0x00,0xF8,0xFF,0x7F,0x00,0xF8,0xFF,0x7F,0x00,0x18,0x00,0x60,0x00,0x18,0x00,0x60, // 91
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0xE0,0x07,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0xF0,0x07,0x00,0x00,0x80,0x1F,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x10, // 92
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x60,0x00,0x18,0x00,0x60,0x00,0xF8,0xFF,0x7F,0x00,0xF8,0xFF,0x7F,0x00,0xF8,0xFF,0x7F, // 93
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x0E,0x00,0x00,0x80,0x0F,0x00,0x00,0xE0,0x03,0x00,0x00,0x60,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x08, // 94
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30, // 95
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x40, // 96
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x00,0xCC,0x07,0x00,0x00,0xEE,0x0F,0x00,0x00,0xEE,0x0E,0x00,0x00,0x66,0x0C,0x00,0x00,0x66,0x0C,0x00,0x00,0x6E,0x06,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 97
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x0C,0x06,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x1E,0x0F,0x00,0x00,0xFC,0x07,0x00,0x00,0xF8,0x03, // 98
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xF8,0x03,0x00,0x00,0xFC,0x07,0x00,0x00,0x0E,0x0E,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x1E,0x0F,0x00,0x00,0x1C,0x07,0x00,0x00,0x18,0x03, // 99
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x07,0x00,0x00,0xFE,0x0F,0x00,0x00,0x0E,0x0E,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0C,0x06,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 100
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xF8,0x03,0x00,0x00,0xFC,0x07,0x00,0x00,0x6E,0x0F,0x00,0x00,0x66,0x0E,0x00,0x00,0x66,0x0C,0x00,0x00,0x66,0x0C,0x00,0x00,0x6E,0x0E,0x00,0x00,0x7C,0x07,0x00,0x00,0x78,0x06,0x00,0x00,0x60, // 101
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x80,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x70,0x06,0x00,0x00,0x30,0x06,0x00,0x00,0x30,0x06,0x00,0x00,0x30,0x06,0x00,0x00,0x30, // 102
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x67,0x00,0x00,0xFC,0x67,0x00,0x00,0x0E,0xCE,0x00,0x00,0x06,0xCC,0x00,0x00,0x06,0xCC,0x00,0x00,0x06,0xEC,0x00,0x00,0xFC,0xFF,0x00,0x00,0xFE,0x7F,0x00,0x00,0xFE,0x3F, // 103
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x0C,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFC,0x0F, // 104
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x40,0xFE,0x0F,0x00,0xE0,0xFE,0x0F,0x00,0xE0,0xFE,0x0F,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C, // 105
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xE0,0x00,0xE0,0xFE,0xFF,0x00,0xE0,0xFE,0x7F,0x00,0xE0,0xFE,0x3F, // 106
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0xE0,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0xF8,0x01,0x00,0x00,0xFC,0x03,0x00,0x00,0x8E,0x0F,0x00,0x00,0x06,0x0F,0x00,0x00,0x02,0x0C,0x00,0x00,0x02,0x08, // 107
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C, // 108
0x00,0x00,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFC,0x0F,0x00,0x00,0x06,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xF8,0x0F, // 109
0x00,0x00,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x0C,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFC,0x0F, // 110
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x07,0x00,0x00,0xFC,0x07,0x00,0x00,0x0E,0x0E,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x1E,0x0F,0x00,0x00,0xFC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0x40, // 111
0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0x00,0x00,0xFE,0xFF,0x00,0x00,0xFE,0xFF,0x00,0x00,0x0C,0x06,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x9E,0x0F,0x00,0x00,0xFC,0x07,0x00,0x00,0xF8,0x03, // 112
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x07,0x00,0x00,0xFE,0x0F,0x00,0x00,0x0E,0x0E,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0C,0x06,0x00,0x00,0xFC,0xFF,0x00,0x00,0xFE,0xFF,0x00,0x00,0xFE,0xFF, // 113
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0A, // 114
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x3C,0x07,0x00,0x00,0x7C,0x07,0x00,0x00,0x6E,0x0E,0x00,0x00,0x66,0x0C,0x00,0x00,0x46,0x0C,0x00,0x00,0xC6,0x0C,0x00,0x00,0xDE,0x0E,0x00,0x00,0xDC,0x07,0x00,0x00,0x9C,0x07, // 115
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0xC0,0xFF,0x07,0x00,0xC0,0xFF,0x07,0x00,0xC0,0xFF,0x0F,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0E, // 116
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0xFE,0x03,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F, // 117
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xF8,0x07,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0xE0,0x0F,0x00,0x00,0xFC,0x03,0x00,0x00,0x7E,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x02, // 118
0x00,0x02,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0xC0,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xFE,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0xF8,0x07,0x00,0x00,0x00,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x03,0x00,0x00,0x0E, // 119
0x00,0x00,0x00,0x00,0x00,0x02,0x08,0x00,0x00,0x06,0x0C,0x00,0x00,0x1E,0x0F,0x00,0x00,0xBC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0xF0,0x00,0x00,0x00,0xF8,0x03,0x00,0x00,0xBC,0x07,0x00,0x00,0x1E,0x0F,0x00,0x00,0x06,0x0C,0x00,0x00,0x02,0x08, // 120
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x1E,0xC0,0x00,0x00,0x7E,0xC0,0x00,0x00,0xF8,0xF3,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0x3F,0x00,0x00,0xC0,0x0F,0x00,0x00,0xF8,0x03,0x00,0x00,0xFE,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x02, // 121
0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0E,0x00,0x00,0x06,0x0F,0x00,0x00,0x86,0x0F,0x00,0x00,0xE6,0x0D,0x00,0x00,0xF6,0x0C,0x00,0x00,0x7E,0x0C,0x00,0x00,0x3E,0x0C,0x00,0x00,0x1E,0x0C,0x00,0x00,0x0E,0x0C,0x00,0x00,0x00,0x0C, // 122
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xF0,0x00,0x00,0xC0,0xFF,0x3F,0x00,0xE0,0x9F,0x7F,0x00,0x70,0x00,0xE0,0x00,0x30,0x00,0xC0, // 123
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0xFF,0x00,0xE0,0xFF,0xFF, // 124
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x30,0x00,0xC0,0x00,0xE0,0x1F,0xFF,0x00,0xE0,0xBF,0x7F,0x00,0x80,0xFF,0x1F,0x00,0x00,0xE0,0x00,0x00,0x00,0x60, // 125
0x00,0x40,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x30, // 126
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8E,0xFF,0x00,0x00,0x8E,0xFF,0x00,0x00,0x8E,0xFF, // 161
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0xF8,0x03,0x00,0x00,0xFC,0x07,0x00,0x00,0x1E,0x0F,0x00,0x00,0x06,0x0C,0x00,0x80,0x07,0x3C,0x00,0x80,0x07,0x3C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x1C,0x07,0x00,0x00,0x18,0x03, // 162
0x00,0x00,0x00,0x00,0x00,0x30,0x0C,0x00,0x00,0x30,0x0C,0x00,0x80,0xFF,0x0F,0x00,0xC0,0xFF,0x0F,0x00,0xE0,0xFF,0x0D,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0xE0,0x30,0x0C,0x00,0xE0,0x01,0x0C,0x00,0xC0,0x01,0x0C,0x00,0x80,0x01,0x0C, // 163
0x00,0x00,0x00,0x00,0x00,0xE4,0x04,0x00,0x00,0xFE,0x0F,0x00,0x00,0x1C,0x07,0x00,0x00,0x0E,0x0E,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0C,0x06,0x00,0x00,0xFC,0x07,0x00,0x00,0xFE,0x0F,0x00,0x00,0x04,0x04, // 164
0x20,0x00,0x00,0x00,0x60,0xB0,0x01,0x00,0xE0,0xB1,0x01,0x00,0xE0,0xB7,0x01,0x00,0x80,0xBF,0x01,0x00,0x00,0xFE,0x0F,0x00,0x00,0xF8,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x80,0xBF,0x01,0x00,0xE0,0xB7,0x01,0x00,0xE0,0xB1,0x01,0x00,0x60,0x00,0x00,0x00,0x20, // 165
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x9F,0x7F,0x00,0xE0,0x9F,0x7F,0x00,0xE0,0x9F,0x7F, // 166
0x00,0x00,0x00,0x00,0x80,0xE3,0x30,0x00,0xC0,0xFF,0x71,0x00,0xC0,0xFF,0xF3,0x00,0xE0,0x9C,0xE3,0x00,0x60,0x1C,0xC3,0x00,0x60,0x18,0xC7,0x00,0x60,0x38,0xC7,0x00,0xE0,0x38,0xE7,0x00,0xC0,0xF9,0x7F,0x00,0xC0,0xF1,0x7D,0x00,0x00,0xE1,0x39, // 167
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 168
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0x08,0x02,0x00,0x00,0x04,0x04,0x00,0x00,0xF2,0x09,0x00,0x00,0x0A,0x0A,0x00,0x00,0x0A,0x0A,0x00,0x00,0x1A,0x0B,0x00,0x00,0x16,0x0D,0x00,0x00,0x04,0x04,0x00,0x00,0x18,0x03,0x00,0x00,0xE0, // 169
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x1C,0x00,0x00,0xE0,0x1E,0x00,0x00,0x20,0x12,0x00,0x00,0x20,0x12,0x00,0x00,0x60,0x0A,0x00,0x00,0xC0,0x1F,0x00,0x00,0x00,0x10, // 170
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0xF0,0x03,0x00,0x00,0x18,0x06,0x00,0x00,0xC8,0x04,0x00,0x00,0xE0,0x01,0x00,0x00,0xF0,0x03,0x00,0x00,0x18,0x06,0x00,0x00,0x08,0x04, // 171
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0xF0, // 172
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 173
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0x08,0x02,0x00,0x00,0x04,0x04,0x00,0x00,0xFA,0x09,0x00,0x00,0x4A,0x08,0x00,0x00,0x4A,0x08,0x00,0x00,0xEA,0x09,0x00,0x00,0x36,0x0E,0x00,0x00,0x04,0x04,0x00,0x00,0x18,0x03,0x00,0x00,0xE0, // 174
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 175
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x60,0x02,0x00,0x00,0x20,0x02,0x00,0x00,0x60,0x03,0x00,0x00,0xC0,0x01, // 176
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x00,0x00,0x18,0x0C,0x00,0x00,0x18,0x0C,0x00,0x80,0xFF,0x0D,0x00,0x80,0xFF,0x0D,0x00,0x80,0xFF,0x0D,0x00,0x00,0x18,0x0C,0x00,0x00,0x18,0x0C,0x00,0x00,0x18,0x0C, // 177
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x18,0x00,0x00,0xE0,0x1C,0x00,0x00,0x60,0x1C,0x00,0x00,0x60,0x1E,0x00,0x00,0xE0,0x1B,0x00,0x00,0xC0,0x19,0x00,0x00,0x00,0x18, // 178
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x18,0x00,0x00,0xE0,0x38,0x00,0x00,0x60,0x32,0x00,0x00,0x60,0x32,0x00,0x00,0xE0,0x3F,0x00,0x00,0xC0,0x1D,0x00,0x00,0x00,0x08, // 179
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20, // 180
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0x00,0x00,0xFE,0xFF,0x00,0x00,0xFE,0xFF,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F, // 181
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xC0,0x1F,0x00,0x00,0xC0,0x1F,0x00,0x00,0xE0,0x3F,0x00,0x00,0xE0,0x3F,0x00,0x00,0xE0,0x3F,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 182
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x38, // 183
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0xC8,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x70, // 184
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x1F,0x00,0x00,0xE0,0x1F, // 185
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x07,0x00,0x00,0xE0,0x0F,0x00,0x00,0x20,0x08,0x00,0x00,0x20,0x08,0x00,0x00,0x60,0x08,0x00,0x00,0xC0,0x0F,0x00,0x00,0x80,0x07, // 186
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x04,0x00,0x00,0x38,0x06,0x00,0x00,0xF0,0x03,0x00,0x00,0xE0,0x01,0x00,0x00,0x48,0x04,0x00,0x00,0x38,0x06,0x00,0x00,0xF0,0x03,0x00,0x00,0xE0,0x01,0x00,0x00,0x40, // 187
0x40,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xE0,0x0F,0x00,0x00,0xE0,0x0F,0x01,0x00,0x00,0xC0,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x1C,0x07,0x00,0x00,0x8F,0x07,0x00,0x80,0xC3,0x06,0x00,0x00,0xE0,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x06, // 188
0x40,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xE0,0x0F,0x01,0x00,0xE0,0xCF,0x03,0x00,0x00,0x70,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x0F,0x00,0x00,0x80,0x43,0x0C,0x00,0x00,0x60,0x0E,0x00,0x00,0x20,0x0E,0x00,0x00,0xE0,0x0D,0x00,0x00,0xE0,0x0D,0x00,0x00,0x00,0x0C, // 189
0x00,0x00,0x00,0x00,0x60,0x04,0x00,0x00,0x60,0x0C,0x00,0x00,0x20,0x09,0x00,0x00,0xE0,0x0D,0x01,0x00,0xE0,0xCF,0x03,0x00,0x40,0x76,0x00,0x00,0x00,0x1C,0x07,0x00,0x00,0x8F,0x07,0x00,0x80,0xC3,0x06,0x00,0x00,0xE0,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x06, // 190
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0xFF,0x00,0x00,0xC0,0xE3,0x00,0x00,0xE6,0xC1,0x00,0x00,0xE6,0xC0,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x30, // 191
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x02,0xE0,0x0F,0x00,0x02,0xFC,0x07,0x00,0x86,0xFF,0x01,0x00,0xE6,0x9F,0x01,0x00,0xE4,0x81,0x01,0x00,0xE0,0x9F,0x01,0x00,0x80,0xFF,0x01,0x00,0x00,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 192
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xFC,0x07,0x00,0x80,0xFF,0x01,0x00,0xE4,0x9F,0x01,0x00,0xE6,0x81,0x01,0x00,0xE6,0x9F,0x01,0x00,0x82,0xFF,0x01,0x00,0x02,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 193
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x08,0xE0,0x0F,0x00,0x04,0xFC,0x07,0x00,0x84,0xFF,0x01,0x00,0xE6,0x9F,0x01,0x00,0xE6,0x81,0x01,0x00,0xE6,0x9F,0x01,0x00,0x84,0xFF,0x01,0x00,0x08,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 194
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x04,0xE0,0x0F,0x00,0x06,0xFC,0x07,0x00,0x86,0xFF,0x01,0x00,0xE6,0x9F,0x01,0x00,0xE6,0x81,0x01,0x00,0xE6,0x9F,0x01,0x00,0x86,0xFF,0x01,0x00,0x02,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 195
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x06,0xFC,0x07,0x00,0x86,0xFF,0x01,0x00,0xE4,0x9F,0x01,0x00,0xE0,0x81,0x01,0x00,0xE0,0x9F,0x01,0x00,0x86,0xFF,0x01,0x00,0x06,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 196
0x00,0x00,0x08,0x00,0x00,0x00,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xFC,0x07,0x00,0x8E,0xFF,0x01,0x00,0xFB,0x9F,0x01,0x00,0xF1,0x81,0x01,0x00,0xFF,0x9F,0x01,0x00,0x80,0xFF,0x01,0x00,0x00,0xFC,0x0F,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x08, // 197
0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0xC0,0x0F,0x00,0x00,0xF8,0x0F,0x00,0x00,0xFF,0x00,0x00,0xE0,0xCF,0x00,0x00,0xE0,0xC1,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C, // 198
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x03,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0xCC,0x00,0x60,0x00,0xFC,0x00,0xE0,0x00,0x7E,0x00,0xC0,0x83,0x07,0x00,0x80,0x83,0x03,0x00,0x00,0x82,0x01, // 199
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE4,0xFF,0x0F,0x00,0x64,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x68,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x00,0x0C, // 200
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x0C,0x00,0x68,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x64,0x30,0x0C,0x00,0x64,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x00,0x0C, // 201
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF,0x0F,0x00,0xE8,0xFF,0x0F,0x00,0x68,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x68,0x30,0x0C,0x00,0x70,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x00,0x0C, // 202
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xEC,0xFF,0x0F,0x00,0x6C,0x30,0x0C,0x00,0x68,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x6C,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x00,0x0C, // 203
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x00,0x0C,0x00,0x62,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0xE6,0xFF,0x0F,0x00,0xE4,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C, // 204
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE4,0xFF,0x0F,0x00,0xE6,0xFF,0x0F,0x00,0xE6,0xFF,0x0F,0x00,0x62,0x00,0x0C,0x00,0x62,0x00,0x0C,0x00,0x60,0x00,0x0C, // 205
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x00,0x0C,0x00,0x64,0x00,0x0C,0x00,0x64,0x00,0x0C,0x00,0xE6,0xFF,0x0F,0x00,0xE6,0xFF,0x0F,0x00,0xE6,0xFF,0x0F,0x00,0x64,0x00,0x0C,0x00,0x68,0x00,0x0C,0x00,0x60,0x00,0x0C, // 206
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0xE4,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x66,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0x60,0x00,0x0C, // 207
0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0x60,0x30,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xC0,0x01,0x07,0x00,0xC0,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 208
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE4,0xFF,0x0F,0x00,0xE6,0xFF,0x0F,0x00,0xC6,0x07,0x00,0x00,0x06,0x3F,0x00,0x00,0x06,0xF8,0x00,0x00,0x06,0xE0,0x03,0x00,0xE6,0xFF,0x0F,0x00,0xE2,0xFF,0x0F,0x00,0xE0,0xFF,0x0F, // 209
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x82,0xFF,0x07,0x00,0xC2,0xFF,0x07,0x00,0xE6,0x00,0x0E,0x00,0x66,0x00,0x0C,0x00,0x64,0x00,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xE0,0x01,0x0F,0x00,0xC0,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 210
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x07,0x00,0xC0,0xFF,0x07,0x00,0xE0,0x00,0x0E,0x00,0x64,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0xE6,0x00,0x0E,0x00,0xE2,0x01,0x0F,0x00,0xC2,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 211
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x88,0xFF,0x07,0x00,0xC4,0xFF,0x07,0x00,0xE4,0x00,0x0E,0x00,0x66,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0xE6,0x00,0x0E,0x00,0xE4,0x01,0x0F,0x00,0xC8,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 212
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x84,0xFF,0x07,0x00,0xC6,0xFF,0x07,0x00,0xE6,0x00,0x0E,0x00,0x66,0x00,0x0C,0x00,0x66,0x00,0x0C,0x00,0xE6,0x00,0x0E,0x00,0xE6,0x01,0x0F,0x00,0xC2,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 213
0x00,0x00,0x00,0x00,0x00,0xFF,0x01,0x00,0x80,0xFF,0x07,0x00,0xC6,0xFF,0x07,0x00,0xE6,0x00,0x0E,0x00,0x64,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0xE0,0x00,0x0E,0x00,0xE6,0x01,0x0F,0x00,0xC6,0xFF,0x07,0x00,0x80,0xFF,0x03,0x00,0x00,0xFE, // 214
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x01,0x00,0x00,0xCF,0x03,0x00,0x00,0xFE,0x01,0x00,0x00,0xFC,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x01,0x00,0x00,0xCF,0x03,0x00,0x00,0x86,0x01, // 215
0x00,0x00,0x00,0x00,0x00,0xFF,0x09,0x00,0x80,0xFF,0x0F,0x00,0xC0,0xFF,0x07,0x00,0xE0,0xC0,0x0F,0x00,0x60,0x70,0x0C,0x00,0x60,0x3C,0x0C,0x00,0xE0,0x0E,0x0E,0x00,0xE0,0x03,0x0F,0x00,0xE0,0xFF,0x07,0x00,0xE0,0xFF,0x03,0x00,0x20,0xFE, // 216
0x00,0x00,0x00,0x00,0xE0,0xFF,0x01,0x00,0xE2,0xFF,0x03,0x00,0xE2,0xFF,0x07,0x00,0x06,0x00,0x0E,0x00,0x06,0x00,0x0C,0x00,0x04,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x07,0x00,0xE0,0xFF,0x03, // 217
0x00,0x00,0x00,0x00,0xE0,0xFF,0x01,0x00,0xE0,0xFF,0x03,0x00,0xE0,0xFF,0x07,0x00,0x00,0x00,0x0E,0x00,0x04,0x00,0x0C,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x0E,0x00,0xE2,0xFF,0x0F,0x00,0xE2,0xFF,0x07,0x00,0xE0,0xFF,0x03, // 218
0x00,0x00,0x00,0x00,0xE0,0xFF,0x01,0x00,0xE8,0xFF,0x03,0x00,0xE4,0xFF,0x07,0x00,0x04,0x00,0x0E,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x0C,0x00,0x06,0x00,0x0E,0x00,0xE4,0xFF,0x0F,0x00,0xE8,0xFF,0x07,0x00,0xE0,0xFF,0x03, // 219
0x00,0x00,0x00,0x00,0xE0,0xFF,0x01,0x00,0xE0,0xFF,0x03,0x00,0xE6,0xFF,0x07,0x00,0x06,0x00,0x0E,0x00,0x04,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0E,0x00,0xE6,0xFF,0x0F,0x00,0xE6,0xFF,0x07,0x00,0xE0,0xFF,0x03, // 220
0x20,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0xE0,0x0F,0x00,0x00,0x80,0x3F,0x00,0x00,0x04,0xFC,0x0F,0x00,0x06,0xF0,0x0F,0x00,0x06,0xFE,0x0F,0x00,0x82,0x3F,0x00,0x00,0xE2,0x07,0x00,0x00,0xE0,0x01,0x00,0x00,0x60,0x00,0x00,0x00,0x20, // 221
0x00,0x00,0x00,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x00,0x83,0x01,0x00,0x00,0x83,0x01,0x00,0x00,0x83,0x01,0x00,0x00,0x83,0x01,0x00,0x00,0xC7,0x01,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x7C, // 222
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x0F,0x00,0xC0,0xFF,0x0F,0x00,0xE0,0xFF,0x0F,0x00,0x60,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0xE0,0x3C,0x0C,0x00,0xE0,0x7F,0x0C,0x00,0xC0,0xF7,0x0F,0x00,0x00,0xC1,0x07,0x00,0x00,0x80,0x07, // 223
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x20,0xCC,0x07,0x00,0x20,0xEE,0x0F,0x00,0x60,0xEE,0x0E,0x00,0x60,0x66,0x0C,0x00,0x40,0x66,0x0C,0x00,0x00,0x6E,0x06,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 224
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x00,0xCC,0x07,0x00,0x00,0xEE,0x0F,0x00,0x00,0xEE,0x0E,0x00,0x40,0x66,0x0C,0x00,0x60,0x66,0x0C,0x00,0x60,0x6E,0x06,0x00,0x20,0xFE,0x0F,0x00,0x20,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 225
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x80,0xCC,0x07,0x00,0x40,0xEE,0x0F,0x00,0x40,0xEE,0x0E,0x00,0x60,0x66,0x0C,0x00,0x60,0x66,0x0C,0x00,0x60,0x6E,0x06,0x00,0x40,0xFE,0x0F,0x00,0x80,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 226
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x40,0xCC,0x07,0x00,0x60,0xEE,0x0F,0x00,0x60,0xEE,0x0E,0x00,0x60,0x66,0x0C,0x00,0x60,0x66,0x0C,0x00,0x60,0x6E,0x06,0x00,0x60,0xFE,0x0F,0x00,0x20,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 227
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x60,0xCC,0x07,0x00,0x60,0xEE,0x0F,0x00,0x40,0xEE,0x0E,0x00,0x00,0x66,0x0C,0x00,0x00,0x66,0x0C,0x00,0x60,0x6E,0x06,0x00,0x60,0xFE,0x0F,0x00,0x00,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 228
0x00,0x00,0x00,0x00,0x00,0x88,0x03,0x00,0x00,0xCC,0x07,0x00,0x00,0xEE,0x0F,0x00,0x70,0xEE,0x0E,0x00,0xD8,0x66,0x0C,0x00,0x88,0x66,0x0C,0x00,0xF8,0x6E,0x06,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFC,0x0F,0x00,0x00,0xF8,0x0F, // 229
0x00,0x00,0x01,0x00,0x00,0xCC,0x07,0x00,0x00,0xEE,0x0F,0x00,0x00,0xEE,0x0E,0x00,0x00,0x66,0x0C,0x00,0x00,0xFE,0x07,0x00,0x00,0xFC,0x07,0x00,0x00,0xFE,0x0F,0x00,0x00,0x66,0x0C,0x00,0x00,0x6E,0x0C,0x00,0x00,0x7E,0x0C,0x00,0x00,0x7C,0x06, // 230
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xF8,0x03,0x00,0x00,0xFC,0x07,0x00,0x00,0x0E,0x0E,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0xCC,0x00,0x00,0x0E,0xFE,0x00,0x00,0x1E,0x7F,0x00,0x00,0x1C,0x07,0x00,0x00,0x18,0x03, // 231
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x20,0xF8,0x03,0x00,0x20,0xFC,0x07,0x00,0x60,0x6E,0x0F,0x00,0x60,0x66,0x0E,0x00,0x40,0x66,0x0C,0x00,0x00,0x66,0x0C,0x00,0x00,0x6E,0x0E,0x00,0x00,0x7C,0x07,0x00,0x00,0x78,0x06,0x00,0x00,0x60, // 232
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xF8,0x03,0x00,0x00,0xFC,0x07,0x00,0x00,0x6E,0x0F,0x00,0x40,0x66,0x0E,0x00,0x60,0x66,0x0C,0x00,0x60,0x66,0x0C,0x00,0x20,0x6E,0x0E,0x00,0x20,0x7C,0x07,0x00,0x00,0x78,0x06,0x00,0x00,0x60, // 233
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x80,0xF8,0x03,0x00,0x40,0xFC,0x07,0x00,0x40,0x6E,0x0F,0x00,0x60,0x66,0x0E,0x00,0x60,0x66,0x0C,0x00,0x60,0x66,0x0C,0x00,0x40,0x6E,0x0E,0x00,0x80,0x7C,0x07,0x00,0x00,0x78,0x06,0x00,0x00,0x60, // 234
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xF8,0x03,0x00,0x60,0xFC,0x07,0x00,0x60,0x6E,0x0F,0x00,0x40,0x66,0x0E,0x00,0x00,0x66,0x0C,0x00,0x00,0x66,0x0C,0x00,0x60,0x6E,0x0E,0x00,0x60,0x7C,0x07,0x00,0x00,0x78,0x06,0x00,0x00,0x60, // 235
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x00,0x20,0x06,0x0C,0x00,0x20,0x06,0x0C,0x00,0x60,0xFE,0x0F,0x00,0x60,0xFE,0x0F,0x00,0x40,0xFE,0x0F,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C, // 236
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0xFE,0x0F,0x00,0x40,0xFE,0x0F,0x00,0x60,0xFE,0x0F,0x00,0x60,0x00,0x0C,0x00,0x20,0x00,0x0C,0x00,0x20,0x00,0x0C, // 237
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x00,0x80,0x06,0x0C,0x00,0x40,0x06,0x0C,0x00,0x40,0xFE,0x0F,0x00,0x60,0xFE,0x0F,0x00,0x60,0xFE,0x0F,0x00,0x60,0x00,0x0C,0x00,0x40,0x00,0x0C,0x00,0x80,0x00,0x0C, // 238
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0C,0x00,0x60,0x06,0x0C,0x00,0x60,0x06,0x0C,0x00,0x40,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x00,0x00,0x0C, // 239
0x00,0xC0,0x00,0x00,0x00,0xF0,0x03,0x00,0x00,0xF8,0x07,0x00,0x00,0x3D,0x0F,0x00,0x40,0x1F,0x0E,0x00,0xE0,0x0D,0x0C,0x00,0xE0,0x0C,0x0C,0x00,0xC0,0x19,0x0E,0x00,0xC0,0xFF,0x07,0x00,0xE0,0xFF,0x07,0x00,0x20,0xFE,0x01, // 240
0x00,0x00,0x00,0x00,0x00,0xFE,0x0F,0x00,0x40,0xFE,0x0F,0x00,0x60,0xFE,0x0F,0x00,0x60,0x0C,0x00,0x00,0x60,0x04,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0xFE,0x0F,0x00,0x20,0xFE,0x0F,0x00,0x00,0xFC,0x0F, // 241
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x20,0xFC,0x07,0x00,0x20,0xFC,0x07,0x00,0x60,0x0E,0x0E,0x00,0x60,0x06,0x0C,0x00,0x40,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x1E,0x0F,0x00,0x00,0xFC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0x40, // 242
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x07,0x00,0x00,0xFC,0x07,0x00,0x00,0x0E,0x0E,0x00,0x40,0x06,0x0C,0x00,0x60,0x06,0x0C,0x00,0x60,0x0E,0x0E,0x00,0x20,0x1E,0x0F,0x00,0x20,0xFC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0x40, // 243
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x80,0xFC,0x07,0x00,0x40,0xFC,0x07,0x00,0x40,0x0E,0x0E,0x00,0x60,0x06,0x0C,0x00,0x60,0x06,0x0C,0x00,0x60,0x0E,0x0E,0x00,0x40,0x1E,0x0F,0x00,0x80,0xFC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0x40, // 244
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x40,0xFC,0x07,0x00,0x60,0xFC,0x07,0x00,0x60,0x0E,0x0E,0x00,0x60,0x06,0x0C,0x00,0x60,0x06,0x0C,0x00,0x60,0x0E,0x0E,0x00,0x60,0x1E,0x0F,0x00,0x20,0xFC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0x40, // 245
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x07,0x00,0x60,0xFC,0x07,0x00,0x60,0x0E,0x0E,0x00,0x40,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x60,0x1E,0x0F,0x00,0x60,0xFC,0x07,0x00,0x00,0xF8,0x03,0x00,0x00,0x40, // 246
0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x63,0x06,0x00,0x00,0x63,0x06,0x00,0x00,0x63,0x06,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60, // 247
0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0xFC,0x17,0x00,0x00,0xFC,0x1F,0x00,0x00,0x0E,0x0E,0x00,0x00,0x86,0x0F,0x00,0x00,0xE6,0x0C,0x00,0x00,0x3E,0x0E,0x00,0x00,0x1E,0x0F,0x00,0x80,0xFF,0x07,0x00,0x80,0xF8,0x03,0x00,0x00,0x40, // 248
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFE,0x07,0x00,0x20,0xFE,0x0F,0x00,0x60,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x40,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0xFE,0x03,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F, // 249
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x0E,0x00,0x40,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x06,0x00,0x20,0xFE,0x03,0x00,0x20,0xFE,0x0F,0x00,0x00,0xFE,0x0F, // 250
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFE,0x07,0x00,0x40,0xFE,0x0F,0x00,0x40,0x00,0x0E,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x0C,0x00,0x60,0x00,0x06,0x00,0x40,0xFE,0x03,0x00,0x80,0xFE,0x0F,0x00,0x00,0xFE,0x0F, // 251
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x07,0x00,0x60,0xFE,0x0F,0x00,0x60,0x00,0x0E,0x00,0x40,0x00,0x0C,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x60,0xFE,0x03,0x00,0x60,0xFE,0x0F,0x00,0x00,0xFE,0x0F, // 252
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x1E,0xC0,0x00,0x00,0x7E,0xC0,0x00,0x00,0xF8,0xF3,0x00,0x00,0xC0,0x7F,0x00,0x40,0x00,0x3F,0x00,0x60,0xC0,0x0F,0x00,0x60,0xF8,0x03,0x00,0x20,0xFE,0x00,0x00,0x20,0x3E,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x02, // 253
0x00,0x00,0x00,0x00,0xE0,0xFF,0xFF,0x00,0xE0,0xFF,0xFF,0x00,0xE0,0xFF,0xFF,0x00,0x00,0x0C,0x06,0x00,0x00,0x06,0x0C,0x00,0x00,0x06,0x0C,0x00,0x00,0x0E,0x0E,0x00,0x00,0x9E,0x0F,0x00,0x00,0xFC,0x07,0x00,0x00,0xF8,0x03, // 254
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x1E,0xC0,0x00,0x60,0x7E,0xC0,0x00,0x60,0xF8,0xF3,0x00,0x40,0xC0,0x7F,0x00,0x00,0x00,0x3F,0x00,0x00,0xC0,0x0F,0x00,0x60,0xF8,0x03,0x00,0x60,0xFE,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x02 // 255
};
| 121.544601 | 264 | 0.7441 |
2ceb7f702b0b7e8e7a52cec46677fc9fb85833b2 | 1,695 | h | C | src/cpp/node_async_shim.h | kyledrake/node-leveldb | 7f4fda5e88120b2addb6cc7aa86441fe26b980ce | [
"BSD-2-Clause"
] | 1 | 2018-06-03T14:18:18.000Z | 2018-06-03T14:18:18.000Z | src/cpp/node_async_shim.h | kyledrake/node-leveldb | 7f4fda5e88120b2addb6cc7aa86441fe26b980ce | [
"BSD-2-Clause"
] | null | null | null | src/cpp/node_async_shim.h | kyledrake/node-leveldb | 7f4fda5e88120b2addb6cc7aa86441fe26b980ce | [
"BSD-2-Clause"
] | null | null | null | /**
* eio_custom() vs. uv_queue_work() file.
* Original gist: https://gist.github.com/1368935
*
* Copyright (c) 2011-2012, Nathan Rajlich <nathan@tootallnate.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef NODE_LEVELDB_ASYNC_SHIM_H_
#define NODE_LEVELDB_ASYNC_SHIM_H_
#include <node.h>
#include <node_version.h>
/* Node Thread Pool version compat */
#if NODE_VERSION_AT_LEAST(0, 5, 6)
#define BEGIN_ASYNC(_data, async, after) \
uv_work_t *_req = new uv_work_t; \
_req->data = _data; \
uv_queue_work(uv_default_loop(), _req, async, after);
typedef void async_rtn;
#define RETURN_ASYNC
#define RETURN_ASYNC_AFTER delete req;
#else
#define BEGIN_ASYNC(data, async, after) \
ev_ref(EV_DEFAULT_UC); \
eio_custom(async, EIO_PRI_DEFAULT, after, data);
typedef int async_rtn;
typedef eio_req uv_work_t;
#define RETURN_ASYNC return 0;
#define RETURN_ASYNC_AFTER \
ev_unref(EV_DEFAULT_UC); \
RETURN_ASYNC;
#endif
#endif // NODE_LEVELDB_ASYNC_SHIM_H_
| 35.3125 | 75 | 0.749263 |
964945e9ac426abfd49418cffc8f684970236200 | 341 | h | C | lab2/plugins/lib/csv_generator/csvGenerator.h | seexub/ODE_Solvers | 581e0ed92295c3042e5929a7e9b157bf220392f2 | [
"MIT"
] | null | null | null | lab2/plugins/lib/csv_generator/csvGenerator.h | seexub/ODE_Solvers | 581e0ed92295c3042e5929a7e9b157bf220392f2 | [
"MIT"
] | null | null | null | lab2/plugins/lib/csv_generator/csvGenerator.h | seexub/ODE_Solvers | 581e0ed92295c3042e5929a7e9b157bf220392f2 | [
"MIT"
] | null | null | null | //
// Created by Seeksub on 15.11.2019.
//
#ifndef LAB1_CSVGENERATOR_H
#define LAB1_CSVGENERATOR_H
#include <string>
#include <fstream>
#include <cstdio>
//extern "C" void csvGenerator(vector<Points>, vector<Points>, string);
//extern "C" string csvGenerator(vector<Points>, vector<Points>, vector<Points>);
#endif //LAB1_CSVGENERATOR_H
| 21.3125 | 81 | 0.744868 |
d0dcea252aa79074ee51b47f7a1640aa1a34a4d4 | 2,798 | h | C | src/flare_pp/kernels/normalized_dot_product.h | stevetorr/flare_pp | 5767bb0787dc38516b582e5134dfd39e6694e8ae | [
"MIT"
] | null | null | null | src/flare_pp/kernels/normalized_dot_product.h | stevetorr/flare_pp | 5767bb0787dc38516b582e5134dfd39e6694e8ae | [
"MIT"
] | null | null | null | src/flare_pp/kernels/normalized_dot_product.h | stevetorr/flare_pp | 5767bb0787dc38516b582e5134dfd39e6694e8ae | [
"MIT"
] | null | null | null | #ifndef NORMALIZED_DOT_PRODUCT_H
#define NORMALIZED_DOT_PRODUCT_H
#include "kernel.h"
#include <Eigen/Dense>
#include <vector>
class DescriptorValues;
class ClusterDescriptor;
class NormalizedDotProduct : public Kernel {
public:
double sigma, sig2, power;
std::string kernel_name = "NormalizedDotProduct";
NormalizedDotProduct();
NormalizedDotProduct(double sigma, double power);
Eigen::MatrixXd envs_envs(const ClusterDescriptor &envs1,
const ClusterDescriptor &envs2,
const Eigen::VectorXd &hyps);
std::vector<Eigen::MatrixXd> envs_envs_grad(const ClusterDescriptor &envs1,
const ClusterDescriptor &envs2,
const Eigen::VectorXd &hyps);
Eigen::MatrixXd envs_struc(const ClusterDescriptor &envs,
const DescriptorValues &struc,
const Eigen::VectorXd &hyps);
std::vector<Eigen::MatrixXd> envs_struc_grad(const ClusterDescriptor &envs,
const DescriptorValues &struc,
const Eigen::VectorXd &hyps);
Eigen::VectorXd self_kernel_struc(const DescriptorValues &struc,
const Eigen::VectorXd &hyps);
Eigen::MatrixXd struc_struc(const DescriptorValues &struc1,
const DescriptorValues &struc2,
const Eigen::VectorXd &hyps);
// Because of the simplicity of this kernel, Kuu_grad and Kuf_grad can
// be significantly accelerated over the default implementation, which
// reconstructs the covariance matrices from scratch.
std::vector<Eigen::MatrixXd> Kuu_grad(const ClusterDescriptor &envs,
const Eigen::MatrixXd &Kuu,
const Eigen::VectorXd &new_hyps);
std::vector<Eigen::MatrixXd> Kuf_grad(const ClusterDescriptor &envs,
const std::vector<Structure> &strucs,
int kernel_index,
const Eigen::MatrixXd &Kuf,
const Eigen::VectorXd &new_hyps);
void set_hyperparameters(Eigen::VectorXd new_hyps);
Eigen::MatrixXd compute_mapping_coefficients(const SparseGP &gp_model,
int kernel_index);
Eigen::MatrixXd compute_varmap_coefficients(const SparseGP &gp_model,
int kernel_index);
NLOHMANN_DEFINE_TYPE_INTRUSIVE(NormalizedDotProduct,
sigma, sig2, power, kernel_name, kernel_hyperparameters)
nlohmann::json return_json();
};
#endif
| 39.971429 | 77 | 0.585776 |
190e1112e65b2887dc99ee8d689df83c9f9da712 | 2,552 | c | C | src/display/openexrdrv.c | syoyo/lucille | ff81b332ae78181dbbdc1ec3c3b0f59992e7c0fa | [
"BSD-3-Clause"
] | 77 | 2015-01-29T21:02:10.000Z | 2022-03-04T11:23:12.000Z | src/display/openexrdrv.c | chiyama/lucille | 37f5e0cf7bda12b146808289053b902050553338 | [
"BSD-3-Clause"
] | 1 | 2018-11-08T02:11:24.000Z | 2018-11-08T04:31:17.000Z | src/display/openexrdrv.c | chiyama/lucille | 37f5e0cf7bda12b146808289053b902050553338 | [
"BSD-3-Clause"
] | 13 | 2015-04-20T08:17:29.000Z | 2020-06-17T18:35:06.000Z | /*
* ILM's OpenEXR image format display driver
*
* $Id: openexrdrv.c,v 1.2 2004/05/04 02:28:45 syoyo Exp $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_OPENEXR
#include <OpenEXR/OpenEXRConfig.h>
#include <OpenEXR/ImfCRgbaFile.h>
#endif
#include "memory.h"
#include "openexrdrv.h"
#include "log.h"
#ifdef HAVE_OPENEXR
static ImfRgba *gbuf; /* pixel buffer */
static ImfOutputFile *gfp;
static int gwidth, gheight;
#endif
int
openexr_dd_open(const char *name, int width, int height,
int bits, RtToken component, const char *format)
{
#if HAVE_OPENEXR
int i;
ImfHeader *header;
(void)bits;
if (strcmp(format, "float") != 0 ) {
ri_log(LOG_ERROR, "currently openexr output supports float format");
return 0;
}
if (strcmp(component, RI_RGB) != 0) {
ri_log(LOG_WARN, "currently only supports rgb component");
}
header = ImfNewHeader();
ImfHeaderSetDisplayWindow(header, 0, 0, width - 1 , height - 1);
ImfHeaderSetDataWindow(header, 0, 0, width - 1, height - 1);
ImfHeaderSetScreenWindowWidth(header, width);
ImfHeaderSetStringAttribute(header, "owner", "lucille");
gfp = ImfOpenOutputFile(name, header, IMF_WRITE_RGBA);
if (!gfp) {
printf("[error] Can't open file [ %s ] for save.\n", name);
return 0;
}
ImfDeleteHeader(header);
gbuf = (ImfRgba *)ri_mem_alloc(width * height * sizeof(ImfRgba));
for (i = 0; i < width * height; i++) {
ImfFloatToHalf(0.0f, &gbuf[i].r);
ImfFloatToHalf(0.0f, &gbuf[i].g);
ImfFloatToHalf(0.0f, &gbuf[i].b);
ImfFloatToHalf(1.0f, &gbuf[i].a);
}
ImfOutputSetFrameBuffer(gfp,
gbuf, /* pointer to pixels */
1, /* xstride */
width); /* ystride */
gwidth = width;
gheight = height;
#endif
return 1;
}
int
openexr_dd_write(int x, int y, const void *pixel)
{
#if HAVE_OPENEXR
float *col;
ImfHalf hf[3];
if (x < 0) return 0;
if (x >= gwidth) return 0;
if (y < 0) return 0;
if (y >= gheight) return 0;
col = (float *)pixel;
ImfFloatToHalf(col[0], &hf[0]);
ImfFloatToHalf(col[1], &hf[1]);
ImfFloatToHalf(col[2], &hf[2]);
gbuf[x + y * gwidth].r += hf[0];
gbuf[x + y * gwidth].g += hf[1];
gbuf[x + y * gwidth].b += hf[2];
#else
(void)x;
(void)y;
(void)pixel;
#endif
return 1;
}
int
openexr_dd_close()
{
#if HAVE_OPENEXR
ImfOutputWritePixels(gfp, gheight);
ImfCloseOutputFile(gfp); gfp = NULL;
ri_mem_free(gbuf);
#endif
return 1;
}
int
openexr_dd_progress()
{
/* progress() is currently not used. */
return 1;
}
| 18.359712 | 70 | 0.653997 |
cf201ffeaeb1b20540c05537117020c166fa146c | 2,202 | h | C | gost/gtLogerImpl.h | MrOnlineCoder/GoST | c88da91f2826b633a8e241ebeb15a33507873f95 | [
"MIT"
] | null | null | null | gost/gtLogerImpl.h | MrOnlineCoder/GoST | c88da91f2826b633a8e241ebeb15a33507873f95 | [
"MIT"
] | null | null | null | gost/gtLogerImpl.h | MrOnlineCoder/GoST | c88da91f2826b633a8e241ebeb15a33507873f95 | [
"MIT"
] | 1 | 2020-02-17T10:14:42.000Z | 2020-02-17T10:14:42.000Z | // GOST
#pragma once
#ifndef __GT_LOGER_IMPL_H__
#define __GT_LOGER_IMPL_H__
namespace gost{
class gtLogerImpl GT_FINAL : public gtLoger{
/// окно вывода
gtPtr<gtOutputWindow> m_out;
/// текущий уровень вывода информации
level m_level;
/// расшифровывает сообщение
void deformat( const char16_t* fmt, gt_va_list& args, gtString& );
public:
/// конструктор
gtLogerImpl( void );
/// деструктор
virtual ~gtLogerImpl( void );
/// напечатает форматированную строку
/// %f - float
/// %i - int
/// %u - unsigned
/// %s - char16_t*
/// %c - char16_t
void print( level, char16_t* str, ... ) GT_FINAL;
/// через указатель void передаются все аргументы
/// удобное решение. другого не придумал
void print( level, char16_t* str, void * );
/// установка окна, в которое будет выводится текст
void setOutputWindow( gtOutputWindow* ) GT_FINAL;
/// info - будут все сообщения
/// warning - warning и error
/// error - только error
void setInfoLevel( level = level::info ) GT_FINAL;
};
}
#endif
/*
Copyright (c) 2017
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.
*/ | 31.913043 | 127 | 0.703451 |
d67c266f5374a72d881150f0c23fd8ac61961019 | 140 | h | C | Example/Pods/Target Support Files/AddButton/AddButton-umbrella.h | svenbacia/AddButton | addf297e49694c916c028cdb7e18258341bfebac | [
"MIT"
] | null | null | null | Example/Pods/Target Support Files/AddButton/AddButton-umbrella.h | svenbacia/AddButton | addf297e49694c916c028cdb7e18258341bfebac | [
"MIT"
] | null | null | null | Example/Pods/Target Support Files/AddButton/AddButton-umbrella.h | svenbacia/AddButton | addf297e49694c916c028cdb7e18258341bfebac | [
"MIT"
] | null | null | null | #import <UIKit/UIKit.h>
FOUNDATION_EXPORT double AddButtonVersionNumber;
FOUNDATION_EXPORT const unsigned char AddButtonVersionString[];
| 20 | 63 | 0.842857 |
a98cadadcfd84964ec090454250fdafe6ca3bd87 | 23 | h | C | src/tests/include11.h | utokusa/c9cc | 8e66bb876535ce2d55d779c228620db6d5a01a53 | [
"MIT"
] | null | null | null | src/tests/include11.h | utokusa/c9cc | 8e66bb876535ce2d55d779c228620db6d5a01a53 | [
"MIT"
] | 1 | 2021-11-20T09:24:24.000Z | 2021-11-20T11:10:05.000Z | src/tests/include11.h | utokusa/kiwicc | 8abbc7ddec8597717e553238f621a1d12952f077 | [
"MIT"
] | null | null | null | int include11_var = 37; | 23 | 23 | 0.782609 |
4573112edc626589bcc6c4a27547753390bfe89a | 249 | h | C | firmware_release/wrbb_mruby/fonts/sFont4x8.h | ksekimoto/wrbb-v2lib-firm | 7571533ab5cb1dd870e424922133ff8738d03b7a | [
"Ruby",
"MIT"
] | null | null | null | firmware_release/wrbb_mruby/fonts/sFont4x8.h | ksekimoto/wrbb-v2lib-firm | 7571533ab5cb1dd870e424922133ff8738d03b7a | [
"Ruby",
"MIT"
] | null | null | null | firmware_release/wrbb_mruby/fonts/sFont4x8.h | ksekimoto/wrbb-v2lib-firm | 7571533ab5cb1dd870e424922133ff8738d03b7a | [
"Ruby",
"MIT"
] | null | null | null | /*
* 4x8 Ascii Font - Misaki Font
*
* Portion Copyright (c) 2017 Kentaro Sekimoto
*
* This software is released under the MIT License.
*
*/
#ifndef SFONT4X8_H_
#define SFONT4X8_H_
#include "sFont.h"
#endif /* SFONT4X8_H_ */
| 15.5625 | 52 | 0.646586 |
45a9d8f795654188f9467d09cec3094fbb8bd981 | 230 | h | C | libPatterns/STRATEGY/include/OtherInformation.h | rmyamaguchi/misC | 48fc10353dd2b63941c56473da3d02a51e5ed7cc | [
"MIT"
] | 1 | 2021-01-12T18:03:44.000Z | 2021-01-12T18:03:44.000Z | libPatterns/STRATEGY/include/OtherInformation.h | rmyamaguchi/misC | 48fc10353dd2b63941c56473da3d02a51e5ed7cc | [
"MIT"
] | null | null | null | libPatterns/STRATEGY/include/OtherInformation.h | rmyamaguchi/misC | 48fc10353dd2b63941c56473da3d02a51e5ed7cc | [
"MIT"
] | null | null | null | #ifndef OTHERINFORMATION_H
#define OTHERINFORMATION_H
typedef struct Order
{
double amount;
double shipping;
} Order;
typedef struct Address
{
unsigned int number;
char *street;
char *city;
} Address;
#endif | 13.529412 | 26 | 0.713043 |
ca10760b93be064ff2bfe710c66b0ed88f611284 | 9,178 | h | C | freebsd5/sys/sparc64/sbus/lsi64854reg.h | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 91 | 2015-01-05T15:18:31.000Z | 2022-03-11T16:43:28.000Z | freebsd5/sys/sparc64/sbus/lsi64854reg.h | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 1 | 2016-02-25T15:57:55.000Z | 2016-02-25T16:01:02.000Z | freebsd5/sys/sparc64/sbus/lsi64854reg.h | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 21 | 2015-02-07T08:23:07.000Z | 2021-12-14T06:01:49.000Z | /* $NetBSD: lsi64854reg.h,v 1.4 1998/09/21 21:26:52 pk Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Paul Kranenburg.
*
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* $FreeBSD: src/sys/sparc64/sbus/lsi64854reg.h,v 1.1 2004/06/10 05:11:39 scottl Exp $ */
/*
* LSI 64854 DMA engine. Contains three independent channels
* designed to interface with (a) a NCR539X SCSI controller,
* (b) a AM7990 Ethernet controller, (c) Parallel port hardware..
*/
/*
* Register offsets to bus handle.
*/
#define L64854_REG_CSR 0 /* Control bits */
#define L64854_REG_ADDR 4 /* DMA Address */
#define L64854_REG_CNT 8 /* DMA count */
#define L64854_REG_CNT_MASK 0x00ffffff /* only 24 bits */
#define L64854_REG_ENBAR 12 /* ENET Base register */
#define L64854_REG_TEST 12 /* SCSI Test register */
#define L64854_REG_HCR 16 /* PP Hardware Configuration */
#define L64854_REG_OCR 18 /* PP Operation Configuration */
#define L64854_REG_DR 20 /* PP Data register */
#define L64854_REG_TCR 21 /* PP Transfer Control */
#define L64854_REG_OR 22 /* PP Output register */
#define L64854_REG_IR 23 /* PP Input register */
#define L64854_REG_ICR 24 /* PP Interrupt Control */
/*
* Control bits common to all three channels.
*/
#define L64854_INT_PEND 0x00000001 /* Interrupt pending */
#define L64854_ERR_PEND 0x00000002 /* Error pending */
#define L64854_DRAINING 0x0000000c /* FIFO draining */
#define L64854_INT_EN 0x00000010 /* Interrupt enable */
#define L64854_INVALIDATE 0x00000020 /* Invalidate FIFO */
#define L64854_SLAVE_ERR 0x00000040 /* Slave access size error */
#define L64854_RESET 0x00000080 /* Reset device */
#define L64854_WRITE 0x00000100 /* 1: xfer to memory */
#define L64854_EN_DMA 0x00000200 /* enable DMA transfers */
#define L64854_BURST_SIZE 0x000c0000 /* Read/write burst size */
#define L64854_BURST_0 0x00080000 /* no bursts (SCSI-only) */
#define L64854_BURST_16 0x00000000 /* 16-byte bursts */
#define L64854_BURST_32 0x00040000 /* 32-byte bursts */
#define L64854_BURST_64 0x000c0000 /* 64-byte bursts (fas) */
#define L64854_RST_FAS366 0x08000000 /* FAS366 hardware reset */
#define L64854_DEVID 0xf0000000 /* device ID bits */
/*
* SCSI DMA control bits.
*/
#define D_INT_PEND L64854_INT_PEND /* interrupt pending */
#define D_ERR_PEND L64854_ERR_PEND /* error pending */
#define D_DRAINING L64854_DRAINING /* fifo draining */
#define D_INT_EN L64854_INT_EN /* interrupt enable */
#define D_INVALIDATE L64854_INVALIDATE/* invalidate fifo */
#define D_SLAVE_ERR L64854_SLAVE_ERR/* slave access size error */
#define D_RESET L64854_RESET /* reset scsi */
#define D_WRITE L64854_WRITE /* 1 = dev -> mem */
#define D_EN_DMA L64854_EN_DMA /* enable DMA requests */
#define D_EN_CNT 0x00002000 /* enable byte counter */
#define D_TC 0x00004000 /* terminal count */
#define D_WIDE_EN 0x00008000 /* enable wide mode SBUS DMA (fas) */
#define D_DSBL_CSR_DRN 0x00010000 /* disable fifo drain on csr */
#define D_DSBL_SCSI_DRN 0x00020000 /* disable fifo drain on reg */
#define D_DIAG 0x00100000 /* disable fifo drain on addr */
#define D_TWO_CYCLE 0x00200000 /* 2 clocks per transfer */
#define D_FASTER 0x00400000 /* 3 clocks per transfer */
#define D_TCI_DIS 0x00800000 /* disable intr on D_TC */
#define D_EN_NEXT 0x01000000 /* enable auto next address */
#define D_DMA_ON 0x02000000 /* enable dma from scsi XXX */
#define D_DSBL_PARITY_CHK \
0x02000000 /* disable checking for parity on bus (default 1:fas) */
#define D_A_LOADED 0x04000000 /* address loaded */
#define D_NA_LOADED 0x08000000 /* next address loaded */
#define D_HW_RESET_FAS366 \
0x08000000 /* hardware reset FAS366 (fas) */
#define D_DEV_ID L64854_DEVID /* device ID */
#define DMAREV_0 0x00000000 /* Sunray DMA */
#define DMAREV_ESC 0x40000000 /* DMA ESC array */
#define DMAREV_1 0x80000000 /* 'DMA' */
#define DMAREV_PLUS 0x90000000 /* 'DMA+' */
#define DMAREV_2 0xa0000000 /* 'DMA2' */
#define DMAREV_HME 0xb0000000 /* 'HME' */
/*
* revisions 0,1 and ESC have different bits.
*/
#define D_ESC_DRAIN 0x00000040 /* rev0,1,esc: drain fifo */
#define D_ESC_R_PEND 0x00000400 /* rev0,1: request pending */
#define D_ESC_BURST 0x00000800 /* DMA ESC: 16 byte bursts */
#define D_ESC_AUTODRAIN 0x00040000 /* DMA ESC: Auto-drain */
#define DDMACSR_BITS "\177\020" \
"b\00INT\0b\01ERR\0f\02\02DRAINING\0b\04IEN\0" \
"b\06SLVERR\0b\07RST\0b\10WRITE\0b\11ENDMA\0" \
"b\15ENCNT\0b\16TC\0\b\20DSBL_CSR_DRN\0" \
"b\21DSBL_SCSI_DRN\0f\22\2BURST\0b\25TWOCYCLE\0" \
"b\26FASTER\0b\27TCIDIS\0b\30ENNXT\0b\031DMAON\0" \
"b\32ALOADED\0b\33NALOADED\0"
/*
* ENET DMA control bits.
*/
#define E_INT_PEND L64854_INT_PEND /* interrupt pending */
#define E_ERR_PEND L64854_ERR_PEND /* error pending */
#define E_DRAINING L64854_DRAINING /* fifo draining */
#define E_INT_EN L64854_INT_EN /* interrupt enable */
#define E_INVALIDATE L64854_INVALIDATE/* invalidate fifo */
#define E_SLAVE_ERR L64854_SLAVE_ERR/* slave access size error */
#define E_RESET L64854_RESET /* reset ENET */
#define E_reserved1 0x00000300 /* */
#define E_DRAIN 0x00000400 /* force Ecache drain */
#define E_DSBL_WR_DRN 0x00000800 /* disable Ecache drain on .. */
#define E_DSBL_RD_DRN 0x00001000 /* disable Ecache drain on .. */
#define E_reserved2 0x00006000 /* */
#define E_ILACC 0x00008000 /* ... */
#define E_DSBL_BUF_WR 0x00010000 /* no buffering of slave writes */
#define E_DSBL_WR_INVAL 0x00020000 /* no Ecache invalidate on slave writes */
#define E_reserved3 0x00100000 /* */
#define E_LOOP_TEST 0x00200000 /* loopback mode */
#define E_TP_AUI 0x00400000 /* 1 for TP, 0 for AUI */
#define E_reserved4 0x0c800000 /* */
#define E_DEV_ID L64854_DEVID /* ID bits */
#define EDMACSR_BITS "\177\020" \
"b\00INT\0b\01ERR\0f\02\02DRAINING\0b\04IEN\0" \
"b\06SLVERR\0b\07RST\0b\10WRITE\0b\12DRAIN\0" \
"b\13DSBL_WR_DRN\0b\14DSBL_RD_DRN\0b\17ILACC\0" \
"b\20DSBL_BUF_WR\0b\21DSBL_WR_INVAL\0" \
"b\25LOOPTEST\0b\26TP\0"
/*
* PP DMA control bits.
*/
#define P_INT_PEND L64854_INT_PEND /* interrupt pending */
#define P_ERR_PEND L64854_ERR_PEND /* error pending */
#define P_DRAINING L64854_DRAINING /* fifo draining */
#define P_INT_EN L64854_INT_EN /* interrupt enable */
#define P_INVALIDATE L64854_INVALIDATE/* invalidate fifo */
#define P_SLAVE_ERR L64854_SLAVE_ERR/* slave access size error */
#define P_RESET L64854_RESET /* reset PP */
#define P_WRITE L64854_WRITE /* 1: xfer to memory */
#define P_EN_DMA L64854_EN_DMA /* enable DMA transfers */
#define P_reserved1 0x00001c00 /* */
#define P_EN_CNT 0x00002000 /* enable counter */
#define P_TC 0x00004000 /* terminal count */
#define P_reserved2 0x00038000 /* */
#define P_DIAG 0x00100000 /* ... */
#define P_reserved3 0x00600000 /* */
#define P_TCI_DIS 0x00800000 /* no interrupt on terminal count */
#define P_EN_NEXT 0x01000000 /* enable DMA chaining */
#define P_DMA_ON 0x02000000 /* DMA xfers enabled */
#define P_A_LOADED 0x04000000 /* addr and byte count valid */
#define P_NA_LOADED 0x08000000 /* next addr & count valid but not used */
#define P_DEV_ID L64854_DEVID /* ID bits */
#define PDMACSR_BITS "\177\020" \
"b\00INT\0b\01ERR\0f\02\02DRAINING\0b\04IEN\0" \
"b\06SLVERR\0b\07RST\0b\10WRITE\0b\11ENDMA\0" \
"b\15ENCNT\0b\16TC\0\b\24DIAG\0b\27TCIDIS\0" \
"b\30ENNXT\0b\031DMAON\0b\32ALOADED\0b\33NALOADED\0"
| 44.553398 | 89 | 0.739159 |
30d0d70332ba3bd518d634ad1102fafff67f28b9 | 5,340 | h | C | common/cpp/src/google_smart_card_common/requesting/requester.h | ayaNader/chromeos_smart_card_connector | 78502e328634a210e27ef897405b66844ebefe62 | [
"Apache-2.0"
] | null | null | null | common/cpp/src/google_smart_card_common/requesting/requester.h | ayaNader/chromeos_smart_card_connector | 78502e328634a210e27ef897405b66844ebefe62 | [
"Apache-2.0"
] | null | null | null | common/cpp/src/google_smart_card_common/requesting/requester.h | ayaNader/chromeos_smart_card_connector | 78502e328634a210e27ef897405b66844ebefe62 | [
"Apache-2.0"
] | null | null | null | // Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GOOGLE_SMART_CARD_COMMON_REQUESTING_REQUESTER_H_
#define GOOGLE_SMART_CARD_COMMON_REQUESTING_REQUESTER_H_
#include <string>
#include <google_smart_card_common/requesting/async_request.h>
#include <google_smart_card_common/requesting/async_requests_storage.h>
#include <google_smart_card_common/requesting/request_id.h>
#include <google_smart_card_common/requesting/request_result.h>
#include <google_smart_card_common/value.h>
namespace google_smart_card {
// An abstract requester which is an entity for sending some requests and
// receiving their results.
//
// Note that it's generally safe to keep the AsyncRequest objects returned by
// the methods of this class even after destroying of the requester (however,
// all requests that were still waiting for their responses will be anyway
// marked as failed).
class Requester {
public:
// Creates the requester with the specified name.
//
// The requester name exists for tagging the sent requests in some way so that
// the appropriate request handler can be picked on the other end (see e.g.
// the common/requesting/request_receiver.h file) and that the response can
// return back to this requester properly. So, generally, the requester names
// have to be unique.
explicit Requester(const std::string& name);
// Destroys the requester.
//
// All requests still waiting for the responses are marked as failed
// immediately.
virtual ~Requester();
std::string name() const { return name_; }
// Prevent the requester from sending new requests to the JavaScript side (new
// requests triggered through this class will immediately finish with the
// RequestResultStatus::kFailed state) and/or from receiving results of
// already sent ones.
//
// This function is safe to be called from any thread.
virtual void ShutDown() {}
// Starts an asynchronous request with the given payload and the given
// callback, which will be executed once the request finishes (either
// successfully or not).
//
// Note: the callback may be executed on a different thread than the thread
// used for sending the request.
//
// Note: It's also possible that the callback is executed synchronously during
// this method call (e.g. when a fatal error occurred that prevents the
// implementation from starting the asynchronous request).
GenericAsyncRequest StartAsyncRequest(Value payload,
GenericAsyncRequestCallback callback);
// Starts an asynchronous request with the given payload and the given
// callback, which will be executed once the request finishes (either
// successfully or not).
//
// The resulting GenericAsyncRequest object will be assigned into the
// async_request argument. This allows to provide the consumer with the
// GenericAsyncRequest object before the callback is executed (that can
// simplify the consumer's logic in some cases).
//
// Note: the callback may be executed on a different thread than the thread
// used for sending the request.
//
// Note: It's also possible that the callback is executed synchronously during
// this method call (e.g. when a fatal error occurred that prevents the
// implementation from starting the asynchronous request).
virtual void StartAsyncRequest(Value payload,
GenericAsyncRequestCallback callback,
GenericAsyncRequest* async_request) = 0;
// Performs a synchronous request, blocking current thread until the result is
// received.
//
// It's guaranteed that the returned result cannot have the
// RequestResultStatus::kCanceled state.
virtual GenericRequestResult PerformSyncRequest(Value payload);
protected:
// Creates and stores internally a new asynchronous request state, returning
// its public proxy object (GenericAsyncRequest object) and its generated
// request identifier.
GenericAsyncRequest CreateAsyncRequest(GenericAsyncRequestCallback callback,
RequestId* request_id);
// Finds the request state by the specified request identifier and sets its
// result (which, in turn, runs the callback if it has not been executed yet).
//
// After calling this function, the request state is not tracked by this
// requester anymore.
//
// Returns whether the request with the specified identifier was found.
bool SetAsyncRequestResult(RequestId request_id,
GenericRequestResult request_result);
private:
const std::string name_;
GenericAsyncRequestsStorage async_requests_storage_;
};
} // namespace google_smart_card
#endif // GOOGLE_SMART_CARD_COMMON_REQUESTING_REQUESTER_H_
| 42.380952 | 80 | 0.742884 |
a50298ff316c2be0e860c5df11862973ccac5be3 | 7,537 | h | C | PrivateFrameworks/PowerlogCore.framework/PLCoreStorage.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 36 | 2016-04-20T04:19:04.000Z | 2018-10-08T04:12:25.000Z | PrivateFrameworks/PowerlogCore.framework/PLCoreStorage.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | null | null | null | PrivateFrameworks/PowerlogCore.framework/PLCoreStorage.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/PowerlogCore.framework/PowerlogCore
*/
@interface PLCoreStorage : NSObject <UMUserSwitchStakeholder> {
PLXPCResponderOperatorComposition * _archivesResponder;
PLXPCResponderOperatorComposition * _blPathResponder;
PLSQLiteConnection * _connection;
PLNSNotificationOperatorComposition * _dailyTaskNotification;
PLTimer * _dailyTaskTimer;
PLCFNotificationOperatorComposition * _flushCachesCFNotification;
PLTimer * _flushCachesTimer;
PLCFNotificationOperatorComposition * _keybagFirstUnlockNotification;
NSMutableDictionary * _processIDCache;
PLKQueue * _profileDefaultsKQueue;
NSMutableSet * _safeCopyInProgress;
PLXPCResponderOperatorComposition * _safeFileResponder;
bool _storageLocked;
PLStorageOperator * _storageOperator;
bool _storageReady;
NSString * _uuid;
}
@property (retain) PLXPCResponderOperatorComposition *archivesResponder;
@property (retain) PLXPCResponderOperatorComposition *blPathResponder;
@property (retain) PLSQLiteConnection *connection;
@property (retain) PLNSNotificationOperatorComposition *dailyTaskNotification;
@property (retain) PLTimer *dailyTaskTimer;
@property (readonly, copy) NSString *debugDescription;
@property (readonly, copy) NSString *description;
@property (retain) PLCFNotificationOperatorComposition *flushCachesCFNotification;
@property (retain) PLTimer *flushCachesTimer;
@property (readonly) unsigned long long hash;
@property (retain) PLCFNotificationOperatorComposition *keybagFirstUnlockNotification;
@property (nonatomic, retain) NSMutableDictionary *processIDCache;
@property (retain) PLKQueue *profileDefaultsKQueue;
@property (retain) NSMutableSet *safeCopyInProgress;
@property (retain) PLXPCResponderOperatorComposition *safeFileResponder;
@property (nonatomic) bool storageLocked;
@property (retain) PLStorageOperator *storageOperator;
@property bool storageReady;
@property (readonly) Class superclass;
@property (retain) NSString *uuid;
+ (id)allOperatorTablesToTrimConditionsForTrimDate:(id)arg1;
+ (void)logMessage:(id)arg1 fromFile:(id)arg2 fromFunction:(id)arg3 fromLineNumber:(long long)arg4;
+ (id)storageQueueNameForClass:(id)arg1;
+ (id)storageQueueNameForEntryKey:(id)arg1;
- (void).cxx_destruct;
- (void)_updateEntry:(id)arg1 withBlock:(id /* block */)arg2;
- (id)aggregateEntriesForKey:(id)arg1 withBucketLength:(double)arg2 inTimeIntervalRange:(struct _PLTimeIntervalRange { double x1; double x2; })arg3;
- (id)archivesResponder;
- (id)blPathResponder;
- (void)blockingFlushCachesWithReason:(id)arg1;
- (void)blockingFlushQueues:(id)arg1 withCurrQueueLabel:(const char *)arg2;
- (void)blockingUpdateEntry:(id)arg1 withBlock:(id /* block */)arg2;
- (long long)blockingWriteEntry:(id)arg1 withCompletionBlock:(id /* block */)arg2;
- (void)cacheProcessIDEntry:(id)arg1;
- (void)checkCacheSizeForFlush;
- (void)cleanupQuarantine;
- (void)cleanupTmp;
- (id)connection;
- (long long)countOfEntriesForKey:(id)arg1;
- (id)dailyTaskNotification;
- (id)dailyTaskTimer;
- (void)dailyTasks;
- (void)dealloc;
- (void)deleteAllEntriesForKey:(id)arg1;
- (void)deleteAllEntriesForKey:(id)arg1 beforeTimestamp:(id)arg2;
- (void)deleteAllEntriesForKey:(id)arg1 beforeTimestamp:(id)arg2 withFilters:(id)arg3;
- (void)deleteAllEntriesForKey:(id)arg1 withFilters:(id)arg2;
- (void)deleteEntry:(id)arg1;
- (void)deleteEntryForKey:(id)arg1 WithRowID:(long long)arg2;
- (void)dispatchAsyncForEntryKey:(id)arg1 withBlock:(id /* block */)arg2;
- (void)dispatchSyncForEntryKey:(id)arg1 withBlock:(id /* block */)arg2;
- (id)entriesForKey:(id)arg1;
- (id)entriesForKey:(id)arg1 before:(bool)arg2 timeInterval:(double)arg3 count:(long long)arg4 withFilters:(id)arg5;
- (id)entriesForKey:(id)arg1 inTimeRange:(struct _PLTimeIntervalRange { double x1; double x2; })arg2 withCountOfEntriesBefore:(long long)arg3 withCountOfEntriesAfter:(long long)arg4 withFilters:(id)arg5;
- (id)entriesForKey:(id)arg1 inTimeRange:(struct _PLTimeIntervalRange { double x1; double x2; })arg2 withFilters:(id)arg3;
- (id)entriesForKey:(id)arg1 startingFromRowID:(long long)arg2 count:(long long)arg3 withFilters:(id)arg4;
- (id)entriesForKey:(id)arg1 withComparisons:(id)arg2;
- (id)entriesForKey:(id)arg1 withProperties:(id)arg2;
- (id)entriesForKey:(id)arg1 withQuery:(id)arg2;
- (id)entryForKey:(id)arg1 withID:(long long)arg2;
- (void)enumerateProcessIDCacheWithBlock:(id /* block */)arg1;
- (id)flushCachesCFNotification;
- (bool)flushCachesIfRequiredForEntryKey:(id)arg1;
- (id)flushCachesTimer;
- (void)flushCachesWithReason:(id)arg1;
- (long long)generalEntryCacheSizeLimit;
- (void)handleSchemaMismatchForTable:(id)arg1 expectedVersion:(double)arg2 schemaMatch:(short)arg3;
- (id)init;
- (void)initOperatorDependancies;
- (id)keybagFirstUnlockNotification;
- (id)lastEntriesForKey:(id)arg1 count:(long long)arg2 withFilters:(id)arg3;
- (id)lastEntryForKey:(id)arg1;
- (id)lastEntryForKey:(id)arg1 withComparisons:(id)arg2 isSingleton:(bool)arg3;
- (id)lastEntryForKey:(id)arg1 withFilters:(id)arg2;
- (id)lastEntryForKey:(id)arg1 withIDLessThan:(long long)arg2;
- (id)lastEntryForKey:(id)arg1 withSubEntryKey:(id)arg2;
- (void)loadDynamicValuesIntoEntry:(id)arg1;
- (void)logMessage:(id)arg1 fromFile:(id)arg2 fromFunction:(id)arg3 fromLineNumber:(long long)arg4;
- (void)processEntriesForKey:(id)arg1 withProperties:(id)arg2 withBlock:(id /* block */)arg3;
- (id)processIDCache;
- (id)processIDEntryForPid:(int)arg1;
- (id)profileDefaultsKQueue;
- (void)removeOldPowerlogFiles;
- (void)removeProcessIDCacheForPid:(int)arg1;
- (void)removeProcessIDCacheForPidNumber:(id)arg1;
- (void)removeStorageForEntryKey:(id)arg1;
- (id)safeCopyInProgress;
- (id)safeFileResponder;
- (void)setAllNullValuesForEntryKey:(id)arg1 forKey:(id)arg2 toValue:(id)arg3 withFilters:(id)arg4;
- (void)setArchivesResponder:(id)arg1;
- (void)setBlPathResponder:(id)arg1;
- (void)setConnection:(id)arg1;
- (void)setDailyTaskNotification:(id)arg1;
- (void)setDailyTaskTimer:(id)arg1;
- (bool)setFileProtectionForPath:(id)arg1 withLevel:(id)arg2;
- (void)setFlushCachesCFNotification:(id)arg1;
- (void)setFlushCachesTimer:(id)arg1;
- (void)setKeybagFirstUnlockNotification:(id)arg1;
- (void)setProcessIDCache:(id)arg1;
- (void)setProfileDefaultsKQueue:(id)arg1;
- (void)setSafeCopyInProgress:(id)arg1;
- (void)setSafeFileResponder:(id)arg1;
- (void)setStorageLocked:(bool)arg1;
- (void)setStorageOperator:(id)arg1;
- (void)setStorageReady:(bool)arg1;
- (void)setUuid:(id)arg1;
- (void)setupArrayForTableName:(id)arg1 forColumnNamed:(id)arg2 withValueType:(short)arg3 withShouldIndexFKID:(bool)arg4;
- (void)setupCoveringIndexOnTable:(id)arg1 withColumns:(id)arg2;
- (void)setupStorageForEntryKey:(id)arg1;
- (void)setupStorageForOperator:(id)arg1;
- (void)setupStorageForOperatorClass:(Class)arg1;
- (void)setupStorageForOperatorName:(id)arg1;
- (void)setupTableName:(id)arg1 withEntryKeyConfig:(id)arg2 withKeyOrder:(id)arg3 isDynamic:(bool)arg4 withShouldIndexFKID:(bool)arg5;
- (void)startStorage;
- (void)stopStorage;
- (bool)storageLocked;
- (id)storageOperator;
- (bool)storageReady;
- (void)updateEntry:(id)arg1 withBlock:(id /* block */)arg2;
- (id)uuid;
- (short)verifySchemaVersionOfTable:(id)arg1 matchesExpectedVersion:(double)arg2;
- (void)willSwitchUser;
- (void)writeAggregateEntry:(id)arg1;
- (void)writeEntries:(id)arg1 withCompletionBlock:(id /* block */)arg2;
- (long long)writeEntry:(id)arg1;
- (void)writeEntry:(id)arg1 withCompletionBlock:(id /* block */)arg2;
@end
| 48.941558 | 203 | 0.786918 |
109e2ddfb01c041b3b875230b83c14235ec3ec5a | 246 | h | C | SZKitDemo/Project/Model/SZItemModel.h | StenpZ/SZKit | 09ee639b71da853033e1544df4a9a6d3d4d9918e | [
"MIT"
] | 10 | 2018-04-04T05:44:16.000Z | 2020-07-07T10:17:25.000Z | SZKitDemo/Project/Model/SZItemModel.h | StenpZ/SZKit | 09ee639b71da853033e1544df4a9a6d3d4d9918e | [
"MIT"
] | 1 | 2018-04-18T11:56:10.000Z | 2018-11-01T01:10:55.000Z | SZKitDemo/Project/Model/SZItemModel.h | StenpZ/SZKit | 09ee639b71da853033e1544df4a9a6d3d4d9918e | [
"MIT"
] | null | null | null |
// 一套常用功能的Category以及常用的自定义控件集合。
// github地址:https://github.com/StenpZ/SZKit
// 用着顺手还望给个Star。Thank you!
#import <UIKit/UIKit.h>
/// 网络状态变化通知
UIKIT_EXTERN NSString *const SZNotificationNetStatusChanged;
@interface SZItemModel : NSObject
@end
| 16.4 | 60 | 0.776423 |
10b08676f63e4a4a540bc76d74dbf743dbd45069 | 10,071 | h | C | src/leveldbjni_stats.h | folowing/leveldbjni-native | 54564f0c046d31a74cdd2805b8702afef13d4316 | [
"BSD-3-Clause"
] | null | null | null | src/leveldbjni_stats.h | folowing/leveldbjni-native | 54564f0c046d31a74cdd2805b8702afef13d4316 | [
"BSD-3-Clause"
] | null | null | null | src/leveldbjni_stats.h | folowing/leveldbjni-native | 54564f0c046d31a74cdd2805b8702afef13d4316 | [
"BSD-3-Clause"
] | null | null | null | /*******************************************************************************
* Copyright (C) 2011, FuseSource Corp. All rights reserved.
*
* http://fusesource.com
*
* The software in this package is published under the terms of the
* CDDL license a copy of which has been included with this distribution
* in the license.txt file.
*******************************************************************************/
#ifdef NATIVE_STATS
extern int NativeBufferJNI_nativeFunctionCount;
extern int NativeBufferJNI_nativeFunctionCallCount[];
extern char* NativeBufferJNI_nativeFunctionNames[];
#define NativeBufferJNI_NATIVE_ENTER(env, that, func) NativeBufferJNI_nativeFunctionCallCount[func]++;
#define NativeBufferJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef NativeBufferJNI_NATIVE_ENTER
#define NativeBufferJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef NativeBufferJNI_NATIVE_EXIT
#define NativeBufferJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
NativeBufferJNI_buffer_1copy__JJ_3BJJ_FUNC,
NativeBufferJNI_buffer_1copy___3BJJJJ_FUNC,
NativeBufferJNI_free_FUNC,
NativeBufferJNI_malloc_FUNC,
} NativeBufferJNI_FUNCS;
#ifdef NATIVE_STATS
extern int CacheJNI_nativeFunctionCount;
extern int CacheJNI_nativeFunctionCallCount[];
extern char* CacheJNI_nativeFunctionNames[];
#define CacheJNI_NATIVE_ENTER(env, that, func) CacheJNI_nativeFunctionCallCount[func]++;
#define CacheJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef CacheJNI_NATIVE_ENTER
#define CacheJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef CacheJNI_NATIVE_EXIT
#define CacheJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
CacheJNI_NewLRUCache_FUNC,
CacheJNI_delete_FUNC,
} CacheJNI_FUNCS;
#ifdef NATIVE_STATS
extern int ComparatorJNI_nativeFunctionCount;
extern int ComparatorJNI_nativeFunctionCallCount[];
extern char* ComparatorJNI_nativeFunctionNames[];
#define ComparatorJNI_NATIVE_ENTER(env, that, func) ComparatorJNI_nativeFunctionCallCount[func]++;
#define ComparatorJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef ComparatorJNI_NATIVE_ENTER
#define ComparatorJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef ComparatorJNI_NATIVE_EXIT
#define ComparatorJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
ComparatorJNI_create_FUNC,
ComparatorJNI_delete_FUNC,
ComparatorJNI_init_FUNC,
ComparatorJNI_memmove__JLorg_fusesource_leveldbjni_internal_NativeComparator_00024ComparatorJNI_2J_FUNC,
ComparatorJNI_memmove__Lorg_fusesource_leveldbjni_internal_NativeComparator_00024ComparatorJNI_2JJ_FUNC,
} ComparatorJNI_FUNCS;
#ifdef NATIVE_STATS
extern int DBJNI_nativeFunctionCount;
extern int DBJNI_nativeFunctionCallCount[];
extern char* DBJNI_nativeFunctionNames[];
#define DBJNI_NATIVE_ENTER(env, that, func) DBJNI_nativeFunctionCallCount[func]++;
#define DBJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef DBJNI_NATIVE_ENTER
#define DBJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef DBJNI_NATIVE_EXIT
#define DBJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
DBJNI_CompactRange_FUNC,
DBJNI_Delete_FUNC,
DBJNI_DeleteGlobalRef_FUNC,
DBJNI_DestroyDB_FUNC,
DBJNI_Get_FUNC,
DBJNI_GetApproximateSizes_FUNC,
DBJNI_GetMethodID_FUNC,
DBJNI_GetProperty_FUNC,
DBJNI_GetSnapshot_FUNC,
DBJNI_NewGlobalRef_FUNC,
DBJNI_NewIterator_FUNC,
DBJNI_Open_FUNC,
DBJNI_Put_FUNC,
DBJNI_ReleaseSnapshot_FUNC,
DBJNI_RepairDB_FUNC,
// DBJNI_ResumeCompactions_FUNC,
// DBJNI_SuspendCompactions_FUNC,
DBJNI_Write_FUNC,
DBJNI_delete_FUNC,
} DBJNI_FUNCS;
#ifdef NATIVE_STATS
extern int IteratorJNI_nativeFunctionCount;
extern int IteratorJNI_nativeFunctionCallCount[];
extern char* IteratorJNI_nativeFunctionNames[];
#define IteratorJNI_NATIVE_ENTER(env, that, func) IteratorJNI_nativeFunctionCallCount[func]++;
#define IteratorJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef IteratorJNI_NATIVE_ENTER
#define IteratorJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef IteratorJNI_NATIVE_EXIT
#define IteratorJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
IteratorJNI_Next_FUNC,
IteratorJNI_Prev_FUNC,
IteratorJNI_Seek_FUNC,
IteratorJNI_SeekToFirst_FUNC,
IteratorJNI_SeekToLast_FUNC,
IteratorJNI_Valid_FUNC,
IteratorJNI_delete_FUNC,
IteratorJNI_key_FUNC,
IteratorJNI_status_FUNC,
IteratorJNI_value_FUNC,
} IteratorJNI_FUNCS;
#ifdef NATIVE_STATS
extern int LoggerJNI_nativeFunctionCount;
extern int LoggerJNI_nativeFunctionCallCount[];
extern char* LoggerJNI_nativeFunctionNames[];
#define LoggerJNI_NATIVE_ENTER(env, that, func) LoggerJNI_nativeFunctionCallCount[func]++;
#define LoggerJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef LoggerJNI_NATIVE_ENTER
#define LoggerJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef LoggerJNI_NATIVE_EXIT
#define LoggerJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
LoggerJNI_create_FUNC,
LoggerJNI_delete_FUNC,
LoggerJNI_init_FUNC,
LoggerJNI_memmove_FUNC,
} LoggerJNI_FUNCS;
#ifdef NATIVE_STATS
extern int NativeOptions_nativeFunctionCount;
extern int NativeOptions_nativeFunctionCallCount[];
extern char* NativeOptions_nativeFunctionNames[];
#define NativeOptions_NATIVE_ENTER(env, that, func) NativeOptions_nativeFunctionCallCount[func]++;
#define NativeOptions_NATIVE_EXIT(env, that, func)
#else
#ifndef NativeOptions_NATIVE_ENTER
#define NativeOptions_NATIVE_ENTER(env, that, func)
#endif
#ifndef NativeOptions_NATIVE_EXIT
#define NativeOptions_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
NativeOptions_init_FUNC,
} NativeOptions_FUNCS;
#ifdef NATIVE_STATS
extern int RangeJNI_nativeFunctionCount;
extern int RangeJNI_nativeFunctionCallCount[];
extern char* RangeJNI_nativeFunctionNames[];
#define RangeJNI_NATIVE_ENTER(env, that, func) RangeJNI_nativeFunctionCallCount[func]++;
#define RangeJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef RangeJNI_NATIVE_ENTER
#define RangeJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef RangeJNI_NATIVE_EXIT
#define RangeJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
RangeJNI_init_FUNC,
RangeJNI_memmove__JLorg_fusesource_leveldbjni_internal_NativeRange_00024RangeJNI_2J_FUNC,
RangeJNI_memmove__Lorg_fusesource_leveldbjni_internal_NativeRange_00024RangeJNI_2JJ_FUNC,
} RangeJNI_FUNCS;
#ifdef NATIVE_STATS
extern int SliceJNI_nativeFunctionCount;
extern int SliceJNI_nativeFunctionCallCount[];
extern char* SliceJNI_nativeFunctionNames[];
#define SliceJNI_NATIVE_ENTER(env, that, func) SliceJNI_nativeFunctionCallCount[func]++;
#define SliceJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef SliceJNI_NATIVE_ENTER
#define SliceJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef SliceJNI_NATIVE_EXIT
#define SliceJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
SliceJNI_delete_FUNC,
SliceJNI_init_FUNC,
SliceJNI_memmove__JLorg_fusesource_leveldbjni_internal_NativeSlice_2J_FUNC,
SliceJNI_memmove__Lorg_fusesource_leveldbjni_internal_NativeSlice_2JJ_FUNC,
} SliceJNI_FUNCS;
#ifdef NATIVE_STATS
extern int StatusJNI_nativeFunctionCount;
extern int StatusJNI_nativeFunctionCallCount[];
extern char* StatusJNI_nativeFunctionNames[];
#define StatusJNI_NATIVE_ENTER(env, that, func) StatusJNI_nativeFunctionCallCount[func]++;
#define StatusJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef StatusJNI_NATIVE_ENTER
#define StatusJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef StatusJNI_NATIVE_EXIT
#define StatusJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
StatusJNI_IsNotFound_FUNC,
StatusJNI_ToString_FUNC,
StatusJNI_delete_FUNC,
StatusJNI_ok_FUNC,
} StatusJNI_FUNCS;
#ifdef NATIVE_STATS
extern int StdStringJNI_nativeFunctionCount;
extern int StdStringJNI_nativeFunctionCallCount[];
extern char* StdStringJNI_nativeFunctionNames[];
#define StdStringJNI_NATIVE_ENTER(env, that, func) StdStringJNI_nativeFunctionCallCount[func]++;
#define StdStringJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef StdStringJNI_NATIVE_ENTER
#define StdStringJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef StdStringJNI_NATIVE_EXIT
#define StdStringJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
StdStringJNI_c_1str_1ptr_FUNC,
StdStringJNI_create___FUNC,
StdStringJNI_create__Ljava_lang_String_2_FUNC,
StdStringJNI_delete_FUNC,
StdStringJNI_length_FUNC,
} StdStringJNI_FUNCS;
#ifdef NATIVE_STATS
extern int WriteBatchJNI_nativeFunctionCount;
extern int WriteBatchJNI_nativeFunctionCallCount[];
extern char* WriteBatchJNI_nativeFunctionNames[];
#define WriteBatchJNI_NATIVE_ENTER(env, that, func) WriteBatchJNI_nativeFunctionCallCount[func]++;
#define WriteBatchJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef WriteBatchJNI_NATIVE_ENTER
#define WriteBatchJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef WriteBatchJNI_NATIVE_EXIT
#define WriteBatchJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
WriteBatchJNI_Clear_FUNC,
WriteBatchJNI_Delete_FUNC,
WriteBatchJNI_Put_FUNC,
WriteBatchJNI_create_FUNC,
WriteBatchJNI_delete_FUNC,
} WriteBatchJNI_FUNCS;
#ifdef NATIVE_STATS
extern int EnvJNI_nativeFunctionCount;
extern int EnvJNI_nativeFunctionCallCount[];
extern char* EnvJNI_nativeFunctionNames[];
#define EnvJNI_NATIVE_ENTER(env, that, func) EnvJNI_nativeFunctionCallCount[func]++;
#define EnvJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef EnvJNI_NATIVE_ENTER
#define EnvJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef EnvJNI_NATIVE_EXIT
#define EnvJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
EnvJNI_Default_FUNC,
EnvJNI_Schedule_FUNC,
} EnvJNI_FUNCS;
#ifdef NATIVE_STATS
extern int UtilJNI_nativeFunctionCount;
extern int UtilJNI_nativeFunctionCallCount[];
extern char* UtilJNI_nativeFunctionNames[];
#define UtilJNI_NATIVE_ENTER(env, that, func) UtilJNI_nativeFunctionCallCount[func]++;
#define UtilJNI_NATIVE_EXIT(env, that, func)
#else
#ifndef UtilJNI_NATIVE_ENTER
#define UtilJNI_NATIVE_ENTER(env, that, func)
#endif
#ifndef UtilJNI_NATIVE_EXIT
#define UtilJNI_NATIVE_EXIT(env, that, func)
#endif
#endif
typedef enum {
UtilJNI_CreateHardLinkW_FUNC,
UtilJNI_errno_FUNC,
UtilJNI_init_FUNC,
UtilJNI_link_FUNC,
UtilJNI_strerror_FUNC,
UtilJNI_strlen_FUNC,
} UtilJNI_FUNCS;
| 31.276398 | 105 | 0.832489 |
340a9a26289419893af8bbfdfc82d990e876f683 | 16,506 | h | C | disassembler/regs.h | jevinskie/arch-arm64 | e4a3d95a0aea1d039c3f47d2283e20bdaff16ba6 | [
"Apache-2.0"
] | 7 | 2021-07-16T17:10:44.000Z | 2021-12-10T19:01:45.000Z | disassembler/regs.h | jevinskie/arch-arm64 | e4a3d95a0aea1d039c3f47d2283e20bdaff16ba6 | [
"Apache-2.0"
] | 26 | 2021-10-17T23:53:48.000Z | 2022-03-24T08:22:53.000Z | disassembler/regs.h | jevinskie/arch-arm64 | e4a3d95a0aea1d039c3f47d2283e20bdaff16ba6 | [
"Apache-2.0"
] | 1 | 2021-07-19T01:47:37.000Z | 2021-07-19T01:47:37.000Z | #pragma once
#include <stddef.h>
#ifdef _MSC_VER
#undef REG_NONE // collides with winnt's define
#endif
//-----------------------------------------------------------------------------
// registers (non-system)
//-----------------------------------------------------------------------------
enum Register
{
REG_NONE,
REG_W0,
REG_W1,
REG_W2,
REG_W3,
REG_W4,
REG_W5,
REG_W6,
REG_W7,
REG_W8,
REG_W9,
REG_W10,
REG_W11,
REG_W12,
REG_W13,
REG_W14,
REG_W15,
REG_W16,
REG_W17,
REG_W18,
REG_W19,
REG_W20,
REG_W21,
REG_W22,
REG_W23,
REG_W24,
REG_W25,
REG_W26,
REG_W27,
REG_W28,
REG_W29,
REG_W30,
REG_WZR,
REG_WSP,
REG_X0,
REG_X1,
REG_X2,
REG_X3,
REG_X4,
REG_X5,
REG_X6,
REG_X7,
REG_X8,
REG_X9,
REG_X10,
REG_X11,
REG_X12,
REG_X13,
REG_X14,
REG_X15,
REG_X16,
REG_X17,
REG_X18,
REG_X19,
REG_X20,
REG_X21,
REG_X22,
REG_X23,
REG_X24,
REG_X25,
REG_X26,
REG_X27,
REG_X28,
REG_X29,
REG_X30,
REG_XZR,
REG_SP,
REG_V0,
REG_V1,
REG_V2,
REG_V3,
REG_V4,
REG_V5,
REG_V6,
REG_V7,
REG_V8,
REG_V9,
REG_V10,
REG_V11,
REG_V12,
REG_V13,
REG_V14,
REG_V15,
REG_V16,
REG_V17,
REG_V18,
REG_V19,
REG_V20,
REG_V21,
REG_V22,
REG_V23,
REG_V24,
REG_V25,
REG_V26,
REG_V27,
REG_V28,
REG_V29,
REG_V30,
REG_VZR,
REG_V31,
REG_B0,
REG_B1,
REG_B2,
REG_B3,
REG_B4,
REG_B5,
REG_B6,
REG_B7,
REG_B8,
REG_B9,
REG_B10,
REG_B11,
REG_B12,
REG_B13,
REG_B14,
REG_B15,
REG_B16,
REG_B17,
REG_B18,
REG_B19,
REG_B20,
REG_B21,
REG_B22,
REG_B23,
REG_B24,
REG_B25,
REG_B26,
REG_B27,
REG_B28,
REG_B29,
REG_B30,
REG_BZR,
REG_B31,
REG_H0,
REG_H1,
REG_H2,
REG_H3,
REG_H4,
REG_H5,
REG_H6,
REG_H7,
REG_H8,
REG_H9,
REG_H10,
REG_H11,
REG_H12,
REG_H13,
REG_H14,
REG_H15,
REG_H16,
REG_H17,
REG_H18,
REG_H19,
REG_H20,
REG_H21,
REG_H22,
REG_H23,
REG_H24,
REG_H25,
REG_H26,
REG_H27,
REG_H28,
REG_H29,
REG_H30,
REG_HZR,
REG_H31,
REG_S0,
REG_S1,
REG_S2,
REG_S3,
REG_S4,
REG_S5,
REG_S6,
REG_S7,
REG_S8,
REG_S9,
REG_S10,
REG_S11,
REG_S12,
REG_S13,
REG_S14,
REG_S15,
REG_S16,
REG_S17,
REG_S18,
REG_S19,
REG_S20,
REG_S21,
REG_S22,
REG_S23,
REG_S24,
REG_S25,
REG_S26,
REG_S27,
REG_S28,
REG_S29,
REG_S30,
REG_SZR,
REG_S31,
REG_D0,
REG_D1,
REG_D2,
REG_D3,
REG_D4,
REG_D5,
REG_D6,
REG_D7,
REG_D8,
REG_D9,
REG_D10,
REG_D11,
REG_D12,
REG_D13,
REG_D14,
REG_D15,
REG_D16,
REG_D17,
REG_D18,
REG_D19,
REG_D20,
REG_D21,
REG_D22,
REG_D23,
REG_D24,
REG_D25,
REG_D26,
REG_D27,
REG_D28,
REG_D29,
REG_D30,
REG_DZR,
REG_D31,
REG_Q0,
REG_Q1,
REG_Q2,
REG_Q3,
REG_Q4,
REG_Q5,
REG_Q6,
REG_Q7,
REG_Q8,
REG_Q9,
REG_Q10,
REG_Q11,
REG_Q12,
REG_Q13,
REG_Q14,
REG_Q15,
REG_Q16,
REG_Q17,
REG_Q18,
REG_Q19,
REG_Q20,
REG_Q21,
REG_Q22,
REG_Q23,
REG_Q24,
REG_Q25,
REG_Q26,
REG_Q27,
REG_Q28,
REG_Q29,
REG_Q30,
REG_QZR,
REG_Q31,
// B vector
REG_V0_B0,
REG_V0_B1,
REG_V0_B2,
REG_V0_B3,
REG_V0_B4,
REG_V0_B5,
REG_V0_B6,
REG_V0_B7,
REG_V0_B8,
REG_V0_B9,
REG_V0_B10,
REG_V0_B11,
REG_V0_B12,
REG_V0_B13,
REG_V0_B14,
REG_V0_B15,
REG_V1_B0,
REG_V1_B1,
REG_V1_B2,
REG_V1_B3,
REG_V1_B4,
REG_V1_B5,
REG_V1_B6,
REG_V1_B7,
REG_V1_B8,
REG_V1_B9,
REG_V1_B10,
REG_V1_B11,
REG_V1_B12,
REG_V1_B13,
REG_V1_B14,
REG_V1_B15,
REG_V2_B0,
REG_V2_B1,
REG_V2_B2,
REG_V2_B3,
REG_V2_B4,
REG_V2_B5,
REG_V2_B6,
REG_V2_B7,
REG_V2_B8,
REG_V2_B9,
REG_V2_B10,
REG_V2_B11,
REG_V2_B12,
REG_V2_B13,
REG_V2_B14,
REG_V2_B15,
REG_V3_B0,
REG_V3_B1,
REG_V3_B2,
REG_V3_B3,
REG_V3_B4,
REG_V3_B5,
REG_V3_B6,
REG_V3_B7,
REG_V3_B8,
REG_V3_B9,
REG_V3_B10,
REG_V3_B11,
REG_V3_B12,
REG_V3_B13,
REG_V3_B14,
REG_V3_B15,
REG_V4_B0,
REG_V4_B1,
REG_V4_B2,
REG_V4_B3,
REG_V4_B4,
REG_V4_B5,
REG_V4_B6,
REG_V4_B7,
REG_V4_B8,
REG_V4_B9,
REG_V4_B10,
REG_V4_B11,
REG_V4_B12,
REG_V4_B13,
REG_V4_B14,
REG_V4_B15,
REG_V5_B0,
REG_V5_B1,
REG_V5_B2,
REG_V5_B3,
REG_V5_B4,
REG_V5_B5,
REG_V5_B6,
REG_V5_B7,
REG_V5_B8,
REG_V5_B9,
REG_V5_B10,
REG_V5_B11,
REG_V5_B12,
REG_V5_B13,
REG_V5_B14,
REG_V5_B15,
REG_V6_B0,
REG_V6_B1,
REG_V6_B2,
REG_V6_B3,
REG_V6_B4,
REG_V6_B5,
REG_V6_B6,
REG_V6_B7,
REG_V6_B8,
REG_V6_B9,
REG_V6_B10,
REG_V6_B11,
REG_V6_B12,
REG_V6_B13,
REG_V6_B14,
REG_V6_B15,
REG_V7_B0,
REG_V7_B1,
REG_V7_B2,
REG_V7_B3,
REG_V7_B4,
REG_V7_B5,
REG_V7_B6,
REG_V7_B7,
REG_V7_B8,
REG_V7_B9,
REG_V7_B10,
REG_V7_B11,
REG_V7_B12,
REG_V7_B13,
REG_V7_B14,
REG_V7_B15,
REG_V8_B0,
REG_V8_B1,
REG_V8_B2,
REG_V8_B3,
REG_V8_B4,
REG_V8_B5,
REG_V8_B6,
REG_V8_B7,
REG_V8_B8,
REG_V8_B9,
REG_V8_B10,
REG_V8_B11,
REG_V8_B12,
REG_V8_B13,
REG_V8_B14,
REG_V8_B15,
REG_V9_B0,
REG_V9_B1,
REG_V9_B2,
REG_V9_B3,
REG_V9_B4,
REG_V9_B5,
REG_V9_B6,
REG_V9_B7,
REG_V9_B8,
REG_V9_B9,
REG_V9_B10,
REG_V9_B11,
REG_V9_B12,
REG_V9_B13,
REG_V9_B14,
REG_V9_B15,
REG_V10_B0,
REG_V10_B1,
REG_V10_B2,
REG_V10_B3,
REG_V10_B4,
REG_V10_B5,
REG_V10_B6,
REG_V10_B7,
REG_V10_B8,
REG_V10_B9,
REG_V10_B10,
REG_V10_B11,
REG_V10_B12,
REG_V10_B13,
REG_V10_B14,
REG_V10_B15,
REG_V11_B0,
REG_V11_B1,
REG_V11_B2,
REG_V11_B3,
REG_V11_B4,
REG_V11_B5,
REG_V11_B6,
REG_V11_B7,
REG_V11_B8,
REG_V11_B9,
REG_V11_B10,
REG_V11_B11,
REG_V11_B12,
REG_V11_B13,
REG_V11_B14,
REG_V11_B15,
REG_V12_B0,
REG_V12_B1,
REG_V12_B2,
REG_V12_B3,
REG_V12_B4,
REG_V12_B5,
REG_V12_B6,
REG_V12_B7,
REG_V12_B8,
REG_V12_B9,
REG_V12_B10,
REG_V12_B11,
REG_V12_B12,
REG_V12_B13,
REG_V12_B14,
REG_V12_B15,
REG_V13_B0,
REG_V13_B1,
REG_V13_B2,
REG_V13_B3,
REG_V13_B4,
REG_V13_B5,
REG_V13_B6,
REG_V13_B7,
REG_V13_B8,
REG_V13_B9,
REG_V13_B10,
REG_V13_B11,
REG_V13_B12,
REG_V13_B13,
REG_V13_B14,
REG_V13_B15,
REG_V14_B0,
REG_V14_B1,
REG_V14_B2,
REG_V14_B3,
REG_V14_B4,
REG_V14_B5,
REG_V14_B6,
REG_V14_B7,
REG_V14_B8,
REG_V14_B9,
REG_V14_B10,
REG_V14_B11,
REG_V14_B12,
REG_V14_B13,
REG_V14_B14,
REG_V14_B15,
REG_V15_B0,
REG_V15_B1,
REG_V15_B2,
REG_V15_B3,
REG_V15_B4,
REG_V15_B5,
REG_V15_B6,
REG_V15_B7,
REG_V15_B8,
REG_V15_B9,
REG_V15_B10,
REG_V15_B11,
REG_V15_B12,
REG_V15_B13,
REG_V15_B14,
REG_V15_B15,
REG_V16_B0,
REG_V16_B1,
REG_V16_B2,
REG_V16_B3,
REG_V16_B4,
REG_V16_B5,
REG_V16_B6,
REG_V16_B7,
REG_V16_B8,
REG_V16_B9,
REG_V16_B10,
REG_V16_B11,
REG_V16_B12,
REG_V16_B13,
REG_V16_B14,
REG_V16_B15,
REG_V17_B0,
REG_V17_B1,
REG_V17_B2,
REG_V17_B3,
REG_V17_B4,
REG_V17_B5,
REG_V17_B6,
REG_V17_B7,
REG_V17_B8,
REG_V17_B9,
REG_V17_B10,
REG_V17_B11,
REG_V17_B12,
REG_V17_B13,
REG_V17_B14,
REG_V17_B15,
REG_V18_B0,
REG_V18_B1,
REG_V18_B2,
REG_V18_B3,
REG_V18_B4,
REG_V18_B5,
REG_V18_B6,
REG_V18_B7,
REG_V18_B8,
REG_V18_B9,
REG_V18_B10,
REG_V18_B11,
REG_V18_B12,
REG_V18_B13,
REG_V18_B14,
REG_V18_B15,
REG_V19_B0,
REG_V19_B1,
REG_V19_B2,
REG_V19_B3,
REG_V19_B4,
REG_V19_B5,
REG_V19_B6,
REG_V19_B7,
REG_V19_B8,
REG_V19_B9,
REG_V19_B10,
REG_V19_B11,
REG_V19_B12,
REG_V19_B13,
REG_V19_B14,
REG_V19_B15,
REG_V20_B0,
REG_V20_B1,
REG_V20_B2,
REG_V20_B3,
REG_V20_B4,
REG_V20_B5,
REG_V20_B6,
REG_V20_B7,
REG_V20_B8,
REG_V20_B9,
REG_V20_B10,
REG_V20_B11,
REG_V20_B12,
REG_V20_B13,
REG_V20_B14,
REG_V20_B15,
REG_V21_B0,
REG_V21_B1,
REG_V21_B2,
REG_V21_B3,
REG_V21_B4,
REG_V21_B5,
REG_V21_B6,
REG_V21_B7,
REG_V21_B8,
REG_V21_B9,
REG_V21_B10,
REG_V21_B11,
REG_V21_B12,
REG_V21_B13,
REG_V21_B14,
REG_V21_B15,
REG_V22_B0,
REG_V22_B1,
REG_V22_B2,
REG_V22_B3,
REG_V22_B4,
REG_V22_B5,
REG_V22_B6,
REG_V22_B7,
REG_V22_B8,
REG_V22_B9,
REG_V22_B10,
REG_V22_B11,
REG_V22_B12,
REG_V22_B13,
REG_V22_B14,
REG_V22_B15,
REG_V23_B0,
REG_V23_B1,
REG_V23_B2,
REG_V23_B3,
REG_V23_B4,
REG_V23_B5,
REG_V23_B6,
REG_V23_B7,
REG_V23_B8,
REG_V23_B9,
REG_V23_B10,
REG_V23_B11,
REG_V23_B12,
REG_V23_B13,
REG_V23_B14,
REG_V23_B15,
REG_V24_B0,
REG_V24_B1,
REG_V24_B2,
REG_V24_B3,
REG_V24_B4,
REG_V24_B5,
REG_V24_B6,
REG_V24_B7,
REG_V24_B8,
REG_V24_B9,
REG_V24_B10,
REG_V24_B11,
REG_V24_B12,
REG_V24_B13,
REG_V24_B14,
REG_V24_B15,
REG_V25_B0,
REG_V25_B1,
REG_V25_B2,
REG_V25_B3,
REG_V25_B4,
REG_V25_B5,
REG_V25_B6,
REG_V25_B7,
REG_V25_B8,
REG_V25_B9,
REG_V25_B10,
REG_V25_B11,
REG_V25_B12,
REG_V25_B13,
REG_V25_B14,
REG_V25_B15,
REG_V26_B0,
REG_V26_B1,
REG_V26_B2,
REG_V26_B3,
REG_V26_B4,
REG_V26_B5,
REG_V26_B6,
REG_V26_B7,
REG_V26_B8,
REG_V26_B9,
REG_V26_B10,
REG_V26_B11,
REG_V26_B12,
REG_V26_B13,
REG_V26_B14,
REG_V26_B15,
REG_V27_B0,
REG_V27_B1,
REG_V27_B2,
REG_V27_B3,
REG_V27_B4,
REG_V27_B5,
REG_V27_B6,
REG_V27_B7,
REG_V27_B8,
REG_V27_B9,
REG_V27_B10,
REG_V27_B11,
REG_V27_B12,
REG_V27_B13,
REG_V27_B14,
REG_V27_B15,
REG_V28_B0,
REG_V28_B1,
REG_V28_B2,
REG_V28_B3,
REG_V28_B4,
REG_V28_B5,
REG_V28_B6,
REG_V28_B7,
REG_V28_B8,
REG_V28_B9,
REG_V28_B10,
REG_V28_B11,
REG_V28_B12,
REG_V28_B13,
REG_V28_B14,
REG_V28_B15,
REG_V29_B0,
REG_V29_B1,
REG_V29_B2,
REG_V29_B3,
REG_V29_B4,
REG_V29_B5,
REG_V29_B6,
REG_V29_B7,
REG_V29_B8,
REG_V29_B9,
REG_V29_B10,
REG_V29_B11,
REG_V29_B12,
REG_V29_B13,
REG_V29_B14,
REG_V29_B15,
REG_V30_B0,
REG_V30_B1,
REG_V30_B2,
REG_V30_B3,
REG_V30_B4,
REG_V30_B5,
REG_V30_B6,
REG_V30_B7,
REG_V30_B8,
REG_V30_B9,
REG_V30_B10,
REG_V30_B11,
REG_V30_B12,
REG_V30_B13,
REG_V30_B14,
REG_V30_B15,
REG_V31_B0,
REG_V31_B1,
REG_V31_B2,
REG_V31_B3,
REG_V31_B4,
REG_V31_B5,
REG_V31_B6,
REG_V31_B7,
REG_V31_B8,
REG_V31_B9,
REG_V31_B10,
REG_V31_B11,
REG_V31_B12,
REG_V31_B13,
REG_V31_B14,
REG_V31_B15,
// H vector
REG_V0_H0,
REG_V0_H1,
REG_V0_H2,
REG_V0_H3,
REG_V0_H4,
REG_V0_H5,
REG_V0_H6,
REG_V0_H7,
REG_V1_H0,
REG_V1_H1,
REG_V1_H2,
REG_V1_H3,
REG_V1_H4,
REG_V1_H5,
REG_V1_H6,
REG_V1_H7,
REG_V2_H0,
REG_V2_H1,
REG_V2_H2,
REG_V2_H3,
REG_V2_H4,
REG_V2_H5,
REG_V2_H6,
REG_V2_H7,
REG_V3_H0,
REG_V3_H1,
REG_V3_H2,
REG_V3_H3,
REG_V3_H4,
REG_V3_H5,
REG_V3_H6,
REG_V3_H7,
REG_V4_H0,
REG_V4_H1,
REG_V4_H2,
REG_V4_H3,
REG_V4_H4,
REG_V4_H5,
REG_V4_H6,
REG_V4_H7,
REG_V5_H0,
REG_V5_H1,
REG_V5_H2,
REG_V5_H3,
REG_V5_H4,
REG_V5_H5,
REG_V5_H6,
REG_V5_H7,
REG_V6_H0,
REG_V6_H1,
REG_V6_H2,
REG_V6_H3,
REG_V6_H4,
REG_V6_H5,
REG_V6_H6,
REG_V6_H7,
REG_V7_H0,
REG_V7_H1,
REG_V7_H2,
REG_V7_H3,
REG_V7_H4,
REG_V7_H5,
REG_V7_H6,
REG_V7_H7,
REG_V8_H0,
REG_V8_H1,
REG_V8_H2,
REG_V8_H3,
REG_V8_H4,
REG_V8_H5,
REG_V8_H6,
REG_V8_H7,
REG_V9_H0,
REG_V9_H1,
REG_V9_H2,
REG_V9_H3,
REG_V9_H4,
REG_V9_H5,
REG_V9_H6,
REG_V9_H7,
REG_V10_H0,
REG_V10_H1,
REG_V10_H2,
REG_V10_H3,
REG_V10_H4,
REG_V10_H5,
REG_V10_H6,
REG_V10_H7,
REG_V11_H0,
REG_V11_H1,
REG_V11_H2,
REG_V11_H3,
REG_V11_H4,
REG_V11_H5,
REG_V11_H6,
REG_V11_H7,
REG_V12_H0,
REG_V12_H1,
REG_V12_H2,
REG_V12_H3,
REG_V12_H4,
REG_V12_H5,
REG_V12_H6,
REG_V12_H7,
REG_V13_H0,
REG_V13_H1,
REG_V13_H2,
REG_V13_H3,
REG_V13_H4,
REG_V13_H5,
REG_V13_H6,
REG_V13_H7,
REG_V14_H0,
REG_V14_H1,
REG_V14_H2,
REG_V14_H3,
REG_V14_H4,
REG_V14_H5,
REG_V14_H6,
REG_V14_H7,
REG_V15_H0,
REG_V15_H1,
REG_V15_H2,
REG_V15_H3,
REG_V15_H4,
REG_V15_H5,
REG_V15_H6,
REG_V15_H7,
REG_V16_H0,
REG_V16_H1,
REG_V16_H2,
REG_V16_H3,
REG_V16_H4,
REG_V16_H5,
REG_V16_H6,
REG_V16_H7,
REG_V17_H0,
REG_V17_H1,
REG_V17_H2,
REG_V17_H3,
REG_V17_H4,
REG_V17_H5,
REG_V17_H6,
REG_V17_H7,
REG_V18_H0,
REG_V18_H1,
REG_V18_H2,
REG_V18_H3,
REG_V18_H4,
REG_V18_H5,
REG_V18_H6,
REG_V18_H7,
REG_V19_H0,
REG_V19_H1,
REG_V19_H2,
REG_V19_H3,
REG_V19_H4,
REG_V19_H5,
REG_V19_H6,
REG_V19_H7,
REG_V20_H0,
REG_V20_H1,
REG_V20_H2,
REG_V20_H3,
REG_V20_H4,
REG_V20_H5,
REG_V20_H6,
REG_V20_H7,
REG_V21_H0,
REG_V21_H1,
REG_V21_H2,
REG_V21_H3,
REG_V21_H4,
REG_V21_H5,
REG_V21_H6,
REG_V21_H7,
REG_V22_H0,
REG_V22_H1,
REG_V22_H2,
REG_V22_H3,
REG_V22_H4,
REG_V22_H5,
REG_V22_H6,
REG_V22_H7,
REG_V23_H0,
REG_V23_H1,
REG_V23_H2,
REG_V23_H3,
REG_V23_H4,
REG_V23_H5,
REG_V23_H6,
REG_V23_H7,
REG_V24_H0,
REG_V24_H1,
REG_V24_H2,
REG_V24_H3,
REG_V24_H4,
REG_V24_H5,
REG_V24_H6,
REG_V24_H7,
REG_V25_H0,
REG_V25_H1,
REG_V25_H2,
REG_V25_H3,
REG_V25_H4,
REG_V25_H5,
REG_V25_H6,
REG_V25_H7,
REG_V26_H0,
REG_V26_H1,
REG_V26_H2,
REG_V26_H3,
REG_V26_H4,
REG_V26_H5,
REG_V26_H6,
REG_V26_H7,
REG_V27_H0,
REG_V27_H1,
REG_V27_H2,
REG_V27_H3,
REG_V27_H4,
REG_V27_H5,
REG_V27_H6,
REG_V27_H7,
REG_V28_H0,
REG_V28_H1,
REG_V28_H2,
REG_V28_H3,
REG_V28_H4,
REG_V28_H5,
REG_V28_H6,
REG_V28_H7,
REG_V29_H0,
REG_V29_H1,
REG_V29_H2,
REG_V29_H3,
REG_V29_H4,
REG_V29_H5,
REG_V29_H6,
REG_V29_H7,
REG_V30_H0,
REG_V30_H1,
REG_V30_H2,
REG_V30_H3,
REG_V30_H4,
REG_V30_H5,
REG_V30_H6,
REG_V30_H7,
REG_V31_H0,
REG_V31_H1,
REG_V31_H2,
REG_V31_H3,
REG_V31_H4,
REG_V31_H5,
REG_V31_H6,
REG_V31_H7,
// S vector
REG_V0_S0,
REG_V0_S1,
REG_V0_S2,
REG_V0_S3,
REG_V1_S0,
REG_V1_S1,
REG_V1_S2,
REG_V1_S3,
REG_V2_S0,
REG_V2_S1,
REG_V2_S2,
REG_V2_S3,
REG_V3_S0,
REG_V3_S1,
REG_V3_S2,
REG_V3_S3,
REG_V4_S0,
REG_V4_S1,
REG_V4_S2,
REG_V4_S3,
REG_V5_S0,
REG_V5_S1,
REG_V5_S2,
REG_V5_S3,
REG_V6_S0,
REG_V6_S1,
REG_V6_S2,
REG_V6_S3,
REG_V7_S0,
REG_V7_S1,
REG_V7_S2,
REG_V7_S3,
REG_V8_S0,
REG_V8_S1,
REG_V8_S2,
REG_V8_S3,
REG_V9_S0,
REG_V9_S1,
REG_V9_S2,
REG_V9_S3,
REG_V10_S0,
REG_V10_S1,
REG_V10_S2,
REG_V10_S3,
REG_V11_S0,
REG_V11_S1,
REG_V11_S2,
REG_V11_S3,
REG_V12_S0,
REG_V12_S1,
REG_V12_S2,
REG_V12_S3,
REG_V13_S0,
REG_V13_S1,
REG_V13_S2,
REG_V13_S3,
REG_V14_S0,
REG_V14_S1,
REG_V14_S2,
REG_V14_S3,
REG_V15_S0,
REG_V15_S1,
REG_V15_S2,
REG_V15_S3,
REG_V16_S0,
REG_V16_S1,
REG_V16_S2,
REG_V16_S3,
REG_V17_S0,
REG_V17_S1,
REG_V17_S2,
REG_V17_S3,
REG_V18_S0,
REG_V18_S1,
REG_V18_S2,
REG_V18_S3,
REG_V19_S0,
REG_V19_S1,
REG_V19_S2,
REG_V19_S3,
REG_V20_S0,
REG_V20_S1,
REG_V20_S2,
REG_V20_S3,
REG_V21_S0,
REG_V21_S1,
REG_V21_S2,
REG_V21_S3,
REG_V22_S0,
REG_V22_S1,
REG_V22_S2,
REG_V22_S3,
REG_V23_S0,
REG_V23_S1,
REG_V23_S2,
REG_V23_S3,
REG_V24_S0,
REG_V24_S1,
REG_V24_S2,
REG_V24_S3,
REG_V25_S0,
REG_V25_S1,
REG_V25_S2,
REG_V25_S3,
REG_V26_S0,
REG_V26_S1,
REG_V26_S2,
REG_V26_S3,
REG_V27_S0,
REG_V27_S1,
REG_V27_S2,
REG_V27_S3,
REG_V28_S0,
REG_V28_S1,
REG_V28_S2,
REG_V28_S3,
REG_V29_S0,
REG_V29_S1,
REG_V29_S2,
REG_V29_S3,
REG_V30_S0,
REG_V30_S1,
REG_V30_S2,
REG_V30_S3,
REG_V31_S0,
REG_V31_S1,
REG_V31_S2,
REG_V31_S3,
// D vector
REG_V0_D0,
REG_V0_D1,
REG_V1_D0,
REG_V1_D1,
REG_V2_D0,
REG_V2_D1,
REG_V3_D0,
REG_V3_D1,
REG_V4_D0,
REG_V4_D1,
REG_V5_D0,
REG_V5_D1,
REG_V6_D0,
REG_V6_D1,
REG_V7_D0,
REG_V7_D1,
REG_V8_D0,
REG_V8_D1,
REG_V9_D0,
REG_V9_D1,
REG_V10_D0,
REG_V10_D1,
REG_V11_D0,
REG_V11_D1,
REG_V12_D0,
REG_V12_D1,
REG_V13_D0,
REG_V13_D1,
REG_V14_D0,
REG_V14_D1,
REG_V15_D0,
REG_V15_D1,
REG_V16_D0,
REG_V16_D1,
REG_V17_D0,
REG_V17_D1,
REG_V18_D0,
REG_V18_D1,
REG_V19_D0,
REG_V19_D1,
REG_V20_D0,
REG_V20_D1,
REG_V21_D0,
REG_V21_D1,
REG_V22_D0,
REG_V22_D1,
REG_V23_D0,
REG_V23_D1,
REG_V24_D0,
REG_V24_D1,
REG_V25_D0,
REG_V25_D1,
REG_V26_D0,
REG_V26_D1,
REG_V27_D0,
REG_V27_D1,
REG_V28_D0,
REG_V28_D1,
REG_V29_D0,
REG_V29_D1,
REG_V30_D0,
REG_V30_D1,
REG_V31_D0,
REG_V31_D1,
// Q vector is already defined REG_V0, REG_V1, ..., REG_V31
// SVE
REG_Z0,
REG_Z1,
REG_Z2,
REG_Z3,
REG_Z4,
REG_Z5,
REG_Z6,
REG_Z7,
REG_Z8,
REG_Z9,
REG_Z10,
REG_Z11,
REG_Z12,
REG_Z13,
REG_Z14,
REG_Z15,
REG_Z16,
REG_Z17,
REG_Z18,
REG_Z19,
REG_Z20,
REG_Z21,
REG_Z22,
REG_Z23,
REG_Z24,
REG_Z25,
REG_Z26,
REG_Z27,
REG_Z28,
REG_Z29,
REG_Z30,
REG_Z31,
REG_P0,
REG_P1,
REG_P2,
REG_P3,
REG_P4,
REG_P5,
REG_P6,
REG_P7,
REG_P8,
REG_P9,
REG_P10,
REG_P11,
REG_P12,
REG_P13,
REG_P14,
REG_P15,
REG_P16,
REG_P17,
REG_P18,
REG_P19,
REG_P20,
REG_P21,
REG_P22,
REG_P23,
REG_P24,
REG_P25,
REG_P26,
REG_P27,
REG_P28,
REG_P29,
REG_P30,
REG_P31,
REG_PF0,
REG_PF1,
REG_PF2,
REG_PF3,
REG_PF4,
REG_PF5,
REG_PF6,
REG_PF7,
REG_PF8,
REG_PF9,
REG_PF10,
REG_PF11,
REG_PF12,
REG_PF13,
REG_PF14,
REG_PF15,
REG_PF16,
REG_PF17,
REG_PF18,
REG_PF19,
REG_PF20,
REG_PF21,
REG_PF22,
REG_PF23,
REG_PF24,
REG_PF25,
REG_PF26,
REG_PF27,
REG_PF28,
REG_PF29,
REG_PF30,
REG_PF31,
REG_END
};
#ifdef __cplusplus
extern "C"
{
#endif
const char* get_register_name(enum Register);
size_t get_register_size(enum Register);
#ifdef __cplusplus
}
#endif
| 12.190547 | 79 | 0.742276 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.