text stringlengths 4 6.14k |
|---|
#define QC_MKID_PROP(TEST) \
QC_MKID_MOD_PROP(iter_idx, TEST)
#define QC_MKID_TEST(TEST) \
QC_MKID_MOD_TEST(iter_idx, TEST)
#define QC_MKTEST_FUNC(TEST) \
QC_MKTEST(QC_MKID_TEST(TEST), \
prop1, \
QC_MKID_PROP(TEST), \
&qc_vec_info)
#define _QC_PRE() \
do { \
size_t len = vec->length; \
if (len == 0) return THEFT_TRIAL_SKIP; \
if (vec->idx > len) vec->idx = vec->idx % len; \
} while (0)
static enum theft_trial_res QC_MKID_PROP(meta) (struct theft * t, void * arg1)
{
UNUSED(t);
struct vec * vec = arg1;
_QC_PRE();
struct vec cpy = *vec;
vec_iter_idx(vec);
bool ret = memcmp(vec, &cpy, sizeof(struct vec)) == 0;
return QC_BOOL2TRIAL(ret);
}
static enum theft_trial_res QC_MKID_PROP(content) (struct theft * t, void * arg1)
{
UNUSED(t);
struct vec * vec = arg1;
_QC_PRE();
struct vec dup = {0};
if (!qc_vec_dup_contents(vec, &dup))
return THEFT_TRIAL_SKIP;
vec_iter_idx(vec);
bool ret = memcmp(vec->ptr, dup.ptr, dup.length * sizeof(int)) == 0;
qc_vec_dup_free(&dup);
return QC_BOOL2TRIAL(ret);
}
static enum theft_trial_res QC_MKID_PROP(res) (struct theft * t, void * arg1)
{
UNUSED(t);
struct vec * vec = arg1;
_QC_PRE();
size_t idx = vec->idx;
size_t res = vec_iter_idx(vec);
bool ret = res == idx;
return QC_BOOL2TRIAL(ret);
}
QC_MKTEST_FUNC(content);
QC_MKTEST_FUNC(meta);
QC_MKTEST_FUNC(res);
QC_MKTEST_ALL(QC_MKID_MOD_ALL(iter_idx),
QC_MKID_TEST(content),
QC_MKID_TEST(meta),
QC_MKID_TEST(res),
);
#undef QC_MKID_PROP
#undef QC_MKID_TEST
#undef QC_MKTEST_FUNC
#undef _QC_PRE
|
/* wcscmp( const wchar_t *, const wchar_t * )
This file is part of the Public Domain C Library (PDCLib).
Permission is granted to use, modify, and / or redistribute at will.
*/
#include <wchar.h>
#ifndef REGTEST
#pragma function(wcscmp)
int wcscmp( const wchar_t * s1, const wchar_t * s2 )
{
while ( ( *s1 ) && ( *s1 == *s2 ) )
{
++s1;
++s2;
}
return ( *(wchar_t *)s1 - *(wchar_t *)s2 );
}
#endif
#ifdef TEST
#include "_PDCLIB_test.h"
int main( void )
{
wchar_t cmpabcde[] = L"abcde";
wchar_t cmpabcd_[] = L"abcd\xfc";
wchar_t empty[] = L"";
TESTCASE( wcscmp( wabcde, cmpabcde ) == 0 );
TESTCASE( wcscmp( wabcde, wabcdx ) < 0 );
TESTCASE( wcscmp( wabcdx, wabcde ) > 0 );
TESTCASE( wcscmp( empty, wabcde ) < 0 );
TESTCASE( wcscmp( wabcde, empty ) > 0 );
TESTCASE( wcscmp( wabcde, cmpabcd_ ) < 0 );
return TEST_RESULTS;
}
#endif
|
#include_next <fcntl.h>
|
// vi:nu:et:sts=4 ts=4 sw=4
/*
* File: AStrCArray_internal.h
* Generated 11/07/2019 08:58:19
*
* Notes:
* -- N/A
*
*/
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
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 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.
For more information, please refer to <http://unlicense.org/>
*/
#include <AStrCArray.h>
#include <JsonIn.h>
#include <ObjArray.h>
#ifndef ASTRCARRAY_INTERNAL_H
#define ASTRCARRAY_INTERNAL_H
#define PROPERTY_ARRAY_OWNED 1
#ifdef __cplusplus
extern "C" {
#endif
//---------------------------------------------------------------
// Object Data Description
//---------------------------------------------------------------
#pragma pack(push, 1)
struct AStrCArray_data_s {
/* Warning - OBJ_DATA must be first in this object!
*/
OBJ_DATA super;
OBJ_IUNKNOWN *pSuperVtbl; // Needed for Inheritance
// Common Data
OBJARRAY_DATA *pArray;
};
#pragma pack(pop)
extern
struct AStrCArray_class_data_s AStrCArray_ClassObj;
extern
const
ASTRCARRAY_VTBL AStrCArray_Vtbl;
//---------------------------------------------------------------
// Class Object Method Forward Definitions
//---------------------------------------------------------------
#ifdef ASTRCARRAY_SINGLETON
ASTRCARRAY_DATA * AStrCArray_getSingleton (
void
);
bool AStrCArray_setSingleton (
ASTRCARRAY_DATA *pValue
);
#endif
//---------------------------------------------------------------
// Internal Method Forward Definitions
//---------------------------------------------------------------
OBJ_IUNKNOWN * AStrCArray_getSuperVtbl (
ASTRCARRAY_DATA *this
);
void AStrCArray_Dealloc (
OBJ_ID objId
);
ASTRCARRAY_DATA * AStrCArray_ParseJsonObject (
JSONIN_DATA *pParser
);
void * AStrCArray_QueryInfo (
OBJ_ID objId,
uint32_t type,
void *pData
);
ASTR_DATA * AStrCArray_ToJson (
ASTRCARRAY_DATA *this
);
#ifdef NDEBUG
#else
bool AStrCArray_Validate (
ASTRCARRAY_DATA *this
);
#endif
#ifdef __cplusplus
}
#endif
#endif /* ASTRCARRAY_INTERNAL_H */
|
/**
* @Author: Calder D. Jett
* @Date: Mar 27, 2017 11:43:16
* @Email: jettcalder@gmail.com
* @Project: C Programming - KIT
* @Filename: c71.c
* @Last modified by: Calder D. Jett
* @Last modified time: Mar 27, 2017 11:43:19
* @License: cc
* @Copyright: all right reserved
*/
#include <stdio.h>
#include <string.h>
int main(void){
char str[100], tmp, cpy[100];
printf("Enter a string: ");
gets(str);
strcpy(cpy, str);
int len = strlen(str);
for (size_t i = 0,j=len-1; i < len/2; i++, j--) {
tmp = str[i];
str[i] = str[j];
str[j] = tmp;
}
if (strcmp(str, cpy)==0) {
printf("Palindrome!");
}
else printf("Not Palindrome!");
// printf("%s\n", str);
return 0;
}
|
/*
* Returns 32, 16 or 8, according to the encoding of the file: UTF-32, UTF-16 or UTF-8 respectively.
* The function assumes LE encoding and uses the BOM (or the presence of null-bytes in the first 6 bytes of the file) to determine the encoding.
* -> char QFileEncoding(HANDLE hFile)
*
* maker: Sven Verlinden
*/
#ifndef _QFILEENCODING_H
#define _QFILEENCODING_H
char QFileEncoding(HANDLE hFile);
#include "fileprocessing\wqfileencoding.c"
#endif /*_QFILEENCODING_H*/
|
#pragma once
#include <D3DX11.h>
struct Ray
{
D3DXVECTOR3 origin, direction;
}; |
gcd(a,b,c)
{
while((a%=b)&&(b%=a));
a+=b,b=c;
while((a%=b)&&(b%=a));
return (a+b)*(a+b)*(a+b);
}
value(a,b,c,d)
{
if(a!=79 && a!=47 && a!=29 && a!=82 && a!=26 && a!=22)
return -1;
if(b<=0 || c<=0 || d<=0)return -2;
if(a==79)return 30*b*c*d*gcd(b,c,d);
if(a==47)return 10*b*c*d*gcd(b,c,d);
if(a==29)return 4*b*c*d*gcd(b,c,d);
if(a==82)return 5*b*c*d*gcd(b,c,d);
if(a==26)return 3*b*c*d*gcd(b,c,d);
if(a==22)return 9*b*c*d*gcd(b,c,d);
}
|
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef __REDIS_PROCESSOR_VIZD_H__
#define __REDIS_PROCESSOR_VIZD_H__
#include <utility>
#include <string>
#include <vector>
#include <map>
#include <boost/function.hpp>
#include "hiredis/hiredis.h"
class RedisAsyncConnection;
class RedisProcessorIf;
class RedisProcessorExec {
public:
static bool
UVEUpdate(RedisAsyncConnection * rac, RedisProcessorIf *rpi,
const std::string &type, const std::string &attr,
const std::string &source, const std::string &node_type,
const std::string &module, const std::string &instance_id,
const std::string &key, const std::string &message,
int32_t seq, const std::string &agg,
const std::string &atyp, int64_t ts, unsigned int part);
static bool
UVEDelete(RedisAsyncConnection * rac, RedisProcessorIf *rpi,
const std::string &type,
const std::string &source, const std::string &node_type,
const std::string &module, const std::string &instance_id,
const std::string &key, int32_t seq);
static bool
SyncGetSeq(const std::string & redis_ip, unsigned short redis_port,
const std::string & redis_password,
const std::string &source, const std::string &node_type,
const std::string &module, const std::string &instance_id,
std::map<std::string,int32_t> & seqReply);
static bool
SyncDeleteUVEs(const std::string & redis_ip, unsigned short redis_port,
const std::string & redis_password,
const std::string &source, const std::string &node_type,
const std::string &module, const std::string &instance_id);
static bool
FlushUVEs(const std::string & redis_ip, unsigned short redis_port,
const std::string & redis_password);
};
class RedisProcessorIf {
public:
RedisProcessorIf() : replyCount_(-1) {}
virtual ~RedisProcessorIf() {}
// OpServerProxy's callback will call this
// Derived class should provide an implementation
// that returns a result to the parent, or spawns
// children.
virtual void ProcessCallback(redisReply *reply) = 0;
// Used by clients to send the async command to Redis
// Also used to send command to child nodes.
// Derived class must provide an implementation
virtual bool RedisSend() = 0;
// Derived class constructs which child node it needs,
// and this base class issues the calls to redis
void ChildSpawn(const std::vector<RedisProcessorIf *> & vch);
// Derived class calls this when it get a result from
// one of the nodes' children
void ChildResult(const std::string& key, void * childRes);
// Derived class must implement this to report final result
// to parent
virtual void FinalResult() = 0;
virtual std::string Key() = 0;
protected:
int32_t replyCount_;
std::map<std::string,void *> childMap_;
};
#endif
|
//
// XMLNode+Values.h
// XMLParser
//
// Created by Konstantin Sukharev on 02/10/14.
// Copyright (c) 2014 Konstantin Sukharev. All rights reserved.
//
#import "XMLNode.h"
@interface XMLNode (Values)
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/core/client/CoreErrors.h>
#include <aws/cloudhsm/CloudHSM_EXPORTS.h>
namespace Aws
{
namespace CloudHSM
{
enum class CloudHSMErrors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
NETWORK_CONNECTION = 99,
UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////
CLOUD_HSM_INTERNAL= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
CLOUD_HSM_SERVICE,
INVALID_REQUEST
};
namespace CloudHSMErrorMapper
{
AWS_CLOUDHSM_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace CloudHSM
} // namespace Aws
|
dsfsdfsdfsdfsdf
|
#ifndef __THIRDPUZZLE_H__
#define __THIRDPUZZLE_H__
#include "cocos2d.h"
#include "ui/CocosGUI.h"
//puzzle classes
#include "puzzle.h"
#include "partner.h"
#include "gameController.h"
#include "menuController.h"
#include "soundController.h"
#include "SimpleAudioEngine.h"
#include "DataSetting.h"
#include "gate.h"
class thirdPuzzle : public cocos2d::LayerColor
{
private:
//count puzzle
int goalCount;
//menuController
menuController* myMenuController;
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
//check ending
void checkEnding(float t);
//ending effect
void showCompleteSprite(float dt);
void showEndingPopUp(float dt);
//check language change
void checkLanguageChange(float dt);
//key event listener
void onKeyReleased(cocos2d::EventKeyboard::KeyCode keycode, cocos2d::Event* e);
// implement the "static create()" method manually
CREATE_FUNC(thirdPuzzle);
};
#endif // __THIRDPUZZLE_H__
|
#pragma once
#include "ittnotify.h"
#if (_MSC_VER > 1700 || LINUX)
#include <atomic>
typedef RefcountInt std::atomic<int>;
#else
typedef int RefcountInt;
#endif
namespace VTune {
class Profiler
{
public:
Profiler();
~Profiler();
static RefcountInt reference_count_;
public:
void Reset();
private:
void StartProfiling();
void StopProfiling();
bool is_profiling_;
};
class Task
{
public:
Task(const __itt_domain* domain, const char* task_name);
~Task();
private:
const __itt_domain* domain_;
};
}
|
//
// DGSufficientController.h
// DigGold
//
// Created by 任彦 on 2017/4/2.
// Copyright © 2017年 顺丰携程. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface DGSufficientController : UIViewController
@end
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsIPushNotificationService.idl
*/
#ifndef __gen_nsIPushNotificationService_h__
#define __gen_nsIPushNotificationService_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
#include "js/Value.h"
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIPushNotificationService */
#define NS_IPUSHNOTIFICATIONSERVICE_IID_STR "abde228b-7d14-4cab-b1f9-9f87750ede0f"
#define NS_IPUSHNOTIFICATIONSERVICE_IID \
{0xabde228b, 0x7d14, 0x4cab, \
{ 0xb1, 0xf9, 0x9f, 0x87, 0x75, 0x0e, 0xde, 0x0f }}
class NS_NO_VTABLE nsIPushNotificationService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHNOTIFICATIONSERVICE_IID)
/* jsval register (in string scope, in jsval originAttributes); */
NS_IMETHOD Register(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) = 0;
/* jsval unregister (in string scope, in jsval originAttributes); */
NS_IMETHOD Unregister(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) = 0;
/* jsval registration (in string scope, in jsval originAttributes); */
NS_IMETHOD Registration(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) = 0;
/* jsval clearAll (); */
NS_IMETHOD ClearAll(JS::MutableHandleValue _retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushNotificationService, NS_IPUSHNOTIFICATIONSERVICE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPUSHNOTIFICATIONSERVICE \
NS_IMETHOD Register(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override; \
NS_IMETHOD Unregister(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override; \
NS_IMETHOD Registration(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override; \
NS_IMETHOD ClearAll(JS::MutableHandleValue _retval) override;
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPUSHNOTIFICATIONSERVICE(_to) \
NS_IMETHOD Register(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override { return _to Register(scope, originAttributes, _retval); } \
NS_IMETHOD Unregister(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override { return _to Unregister(scope, originAttributes, _retval); } \
NS_IMETHOD Registration(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override { return _to Registration(scope, originAttributes, _retval); } \
NS_IMETHOD ClearAll(JS::MutableHandleValue _retval) override { return _to ClearAll(_retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPUSHNOTIFICATIONSERVICE(_to) \
NS_IMETHOD Register(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Register(scope, originAttributes, _retval); } \
NS_IMETHOD Unregister(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Unregister(scope, originAttributes, _retval); } \
NS_IMETHOD Registration(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Registration(scope, originAttributes, _retval); } \
NS_IMETHOD ClearAll(JS::MutableHandleValue _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearAll(_retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsPushNotificationService : public nsIPushNotificationService
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPUSHNOTIFICATIONSERVICE
nsPushNotificationService();
private:
~nsPushNotificationService();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsPushNotificationService, nsIPushNotificationService)
nsPushNotificationService::nsPushNotificationService()
{
/* member initializers and constructor code */
}
nsPushNotificationService::~nsPushNotificationService()
{
/* destructor code */
}
/* jsval register (in string scope, in jsval originAttributes); */
NS_IMETHODIMP nsPushNotificationService::Register(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* jsval unregister (in string scope, in jsval originAttributes); */
NS_IMETHODIMP nsPushNotificationService::Unregister(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* jsval registration (in string scope, in jsval originAttributes); */
NS_IMETHODIMP nsPushNotificationService::Registration(const char * scope, JS::HandleValue originAttributes, JS::MutableHandleValue _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* jsval clearAll (); */
NS_IMETHODIMP nsPushNotificationService::ClearAll(JS::MutableHandleValue _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIPushNotificationService_h__ */
|
/*
* Copyright (C) 2014 KLab Inc.
*
* 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.
*/
#import <Foundation/Foundation.h>
#import <DropboxOSX/DropboxOSX.h>
@protocol DropboxAPIDelegate
- (void)sessionStateChanged:(BOOL)isLinked;
- (void)loadRevisionsForFileDone:(BOOL)sts
revsions:(NSArray*)revsions
forFile:(NSString*)path
error:(NSError*)error;
- (void)loadFileDone:(BOOL)sts
loadedFile:(NSString *)localPath
contentType:(NSString*)contentType
metadata:(DBMetadata *)metadata
error:(NSError*)error;
- (void)uploadFileDone:(BOOL)sts
uploadedFile:(NSString *)destPath
from:(NSString *)srcPath
metadata:(DBMetadata *)metadata
error:(NSError*)error;
@end
@interface DropboxAPI : NSObject <DBRestClientDelegate, DBSessionDelegate>
@property (nonatomic, weak) id delegate;
@property (nonatomic, strong) DBRestClient *restClient;
- (NSInteger)setUp;
- (BOOL)isLinked;
- (void)startOAuth;
- (void)unLink;
//- (void)overWriteFile:(NSString*)fileName dir:(NSString *)path src:(NSString*)localFileName;
- (void)loadRevisionsForFile:(NSString*)path;
- (void)uploadFile:(NSString*)remoteFileFullPath withParentRev:(NSString*)rev localFileFullPath:(NSString*)localFileFullPath;
- (void)loadFile:(NSString*)remoteFileFullPath localFileFullPath:(NSString*)localFileFullPath;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/clouddirectory/CloudDirectory_EXPORTS.h>
#include <aws/clouddirectory/CloudDirectoryRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace CloudDirectory
{
namespace Model
{
/**
*/
class AWS_CLOUDDIRECTORY_API UpgradeAppliedSchemaRequest : public CloudDirectoryRequest
{
public:
UpgradeAppliedSchemaRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "UpgradeAppliedSchema"; }
Aws::String SerializePayload() const override;
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline const Aws::String& GetPublishedSchemaArn() const{ return m_publishedSchemaArn; }
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline void SetPublishedSchemaArn(const Aws::String& value) { m_publishedSchemaArnHasBeenSet = true; m_publishedSchemaArn = value; }
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline void SetPublishedSchemaArn(Aws::String&& value) { m_publishedSchemaArnHasBeenSet = true; m_publishedSchemaArn = std::move(value); }
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline void SetPublishedSchemaArn(const char* value) { m_publishedSchemaArnHasBeenSet = true; m_publishedSchemaArn.assign(value); }
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline UpgradeAppliedSchemaRequest& WithPublishedSchemaArn(const Aws::String& value) { SetPublishedSchemaArn(value); return *this;}
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline UpgradeAppliedSchemaRequest& WithPublishedSchemaArn(Aws::String&& value) { SetPublishedSchemaArn(std::move(value)); return *this;}
/**
* <p>The revision of the published schema to upgrade the directory to.</p>
*/
inline UpgradeAppliedSchemaRequest& WithPublishedSchemaArn(const char* value) { SetPublishedSchemaArn(value); return *this;}
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline const Aws::String& GetDirectoryArn() const{ return m_directoryArn; }
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline void SetDirectoryArn(const Aws::String& value) { m_directoryArnHasBeenSet = true; m_directoryArn = value; }
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline void SetDirectoryArn(Aws::String&& value) { m_directoryArnHasBeenSet = true; m_directoryArn = std::move(value); }
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline void SetDirectoryArn(const char* value) { m_directoryArnHasBeenSet = true; m_directoryArn.assign(value); }
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline UpgradeAppliedSchemaRequest& WithDirectoryArn(const Aws::String& value) { SetDirectoryArn(value); return *this;}
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline UpgradeAppliedSchemaRequest& WithDirectoryArn(Aws::String&& value) { SetDirectoryArn(std::move(value)); return *this;}
/**
* <p>The ARN for the directory to which the upgraded schema will be applied.</p>
*/
inline UpgradeAppliedSchemaRequest& WithDirectoryArn(const char* value) { SetDirectoryArn(value); return *this;}
/**
* <p>Used for testing whether the major version schemas are backward compatible or
* not. If schema compatibility fails, an exception would be thrown else the call
* would succeed but no changes will be saved. This parameter is optional.</p>
*/
inline bool GetDryRun() const{ return m_dryRun; }
/**
* <p>Used for testing whether the major version schemas are backward compatible or
* not. If schema compatibility fails, an exception would be thrown else the call
* would succeed but no changes will be saved. This parameter is optional.</p>
*/
inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
/**
* <p>Used for testing whether the major version schemas are backward compatible or
* not. If schema compatibility fails, an exception would be thrown else the call
* would succeed but no changes will be saved. This parameter is optional.</p>
*/
inline UpgradeAppliedSchemaRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
private:
Aws::String m_publishedSchemaArn;
bool m_publishedSchemaArnHasBeenSet;
Aws::String m_directoryArn;
bool m_directoryArnHasBeenSet;
bool m_dryRun;
bool m_dryRunHasBeenSet;
};
} // namespace Model
} // namespace CloudDirectory
} // namespace Aws
|
/* vim: set expandtab ts=4 sw=4: */
/*
* Copyright 2017 The bin2llvm Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __FIX_OVERLAPPED_BBS_H__
#define __FIX_OVERLAPPED_BBS_H__ 1
#include <llvm/Pass.h>
#include <llvm/Function.h>
#include <llvm/Module.h>
#include <llvm-c/Core.h>
#include <llvm/Transforms/Utils/ValueMapper.h>
#include <llvm/Constants.h>
#include <string>
#include <cstdint>
/*
* basic blocks can overlap.
* This pass will fix any overlapping basic blocks by splitting the
* bigger basic block, and inserting a jump, to the remainder basic
* block.
*
* This module works with the assumption that the basic blocks will pe
* overlapp at the ending instructions.
*
*/
struct FixOverlappedBBs: public llvm::ModulePass {
static char ID;
FixOverlappedBBs() : llvm::ModulePass(ID) {}
virtual bool runOnModule(llvm::Module &f);
static uint64_t getPCEndOfFunc(llvm::Function *func);
static uint64_t getPCStartOfFunc(llvm::Function *func);
static uint64_t getCurrentPCOfIns(llvm::Instruction *ins);
static uint64_t getBBStart(llvm::Instruction *ins);
static std::string hex(uint64_t val);
static uint64_t getNumberOfASMInstructions(llvm::Function *func);
static uint64_t getHexMetadataFromIns(
llvm::Instruction *ins,
std::string metadataName);
private:
static uint64_t getHexMetadataFromFunc(
llvm::Function *func,
std::string metadataName);
static void truncateFuncAndLinkWith(llvm::Function *a, llvm::Function *b);
static void linkWith(llvm::Function *srcFunc, llvm::BasicBlock *srcBB, uint64_t target);
static bool myCompareStartOfFunc(llvm::Function *a, llvm::Function *b);
};
#endif
|
#if !defined(CETTY_CHANNEL_FIXEDRECEIVEBUFFERSIZEPREDICTOR_H)
#define CETTY_CHANNEL_FIXEDRECEIVEBUFFERSIZEPREDICTOR_H
/*
* Copyright 2009 Red Hat, Inc.
*
* Red Hat 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.
*/
/*
* Copyright (c) 2010-2011 frankee zhou (frankee.zhou at gmail dot com)
* Distributed under under the Apache License, version 2.0 (the "License").
*/
#include "cetty/channel/ReceiveBufferSizePredictor.h"
#include "cetty/util/Exception.h"
namespace cetty { namespace channel {
using namespace cetty::util;
/**
* The {@link ReceiveBufferSizePredictor} that always yields the same buffer
* size prediction. This predictor ignores the feed back from the I/O thread.
*
*
* @author <a href="http://gleamynode.net/">Trustin Lee</a>
* @author <a href="mailto:frankee.zhou@gmail.com">Frankee Zhou</a>
*/
class FixedReceiveBufferSizePredictor : public ReceiveBufferSizePredictor {
public:
/**
* Creates a new predictor that always returns the same prediction of
* the specified buffer size.
*/
FixedReceiveBufferSizePredictor(int bufferSize) {
if (bufferSize <= 0) {
throw InvalidArgumentException("bufferSize must greater than 0: ");
}
this->bufferSize = bufferSize;
}
int nextReceiveBufferSize() const {
return this->bufferSize;
}
void previousReceiveBufferSize(int previousReceiveBufferSize) {
// Ignore
}
private:
int bufferSize;
};
}}
#endif //#if !defined(CETTY_CHANNEL_FIXEDRECEIVEBUFFERSIZEPREDICTOR_H)
|
/// @file zerg_stat_define.h
/// @date 2012/07/21 14:02
///
/// @author yunfeiyang
///
/// @brief 小虫监控项定义
///
#ifndef ZERG_STAT_DEFINE_H_
#define ZERG_STAT_DEFINE_H_
//监控的FEATURE_ID
enum ZERG_MONITOR_FEATURE_ID
{
ZERG_SERVICE_STAT_BEGIN = 9000,
ZERG_ACCEPT_PEER_COUNTER, //五分钟内已经Accept的PEER计数
ZERG_ACCEPT_PEER_NUMBER, //正在Accept的PEER数量,绝对值
ZERG_CONNECT_PEER_COUNTER, //五分钟内已经Connect的PEER计数
ZERG_CONNECT_PEER_NUMBER, //正在Connect的PEER数量,绝对值
ZERG_BUFFER_STORAGE_NUMBER, //BUFFER缓冲区的CHUNK个数,绝对值
ZERG_SEND_FRAME_COUNTER, //五分钟内从发送管道取出放入发送队列的帧总数,
ZERG_RECV_FRAME_COUNTER, //五分钟内成功接收放入接收管道的帧总数
ZERG_RECV_BYTES_COUNTER, //五分钟内成功收到字节数总数,非精确值,因为每个PEER都是隔一段时间统计一次
ZERG_SEND_BYTES_COUNTER, //五分钟内成功发送的字节总数,非精确值
ZERG_RECV_SUCC_COUNTER, //五分钟内接受成功帧总数,,非精确值
ZERG_SEND_SUCC_COUNTER, //五分钟内发送成功帧总数,非精确值
ZERG_RECV_FAIL_COUNTER, //五分钟内接收失败的数据帧总数
ZERG_SEND_FAIL_COUNTER, //五分钟内发送数据失败的总数
ZERG_RECV_BLOCK_COUNTER, //五分钟内接收数据发生阻塞的总数
ZERG_SEND_BLOCK_COUNTER, //五分钟内发送数据发生阻塞的总数
ZERG_UDP_RECV_COUNTER, //五分钟内收到UDP数据的次数
ZERG_UDP_SEND_COUNTER, //五分钟内发送UDP数据的次数
ZERG_UDP_RECV_BYTES_COUNTER, //五分钟内收到UDP数据字节的总数
ZERG_UDP_SEND_BYTES_COUNTER, //五分钟内内发送UDP数据字节的总数
ZERG_UDP_RECV_FAIL_COUNTER, //五分钟内收到UDP数据错误次数
ZERG_UDP_SEND_FAIL_COUNTER, //五分钟内发送UDP数据错误次数
ZERG_RECV_PIPE_FULL_COUNTER, //五分钟内内接收数据管道满错误的计数,接收丢失数据个数
ZERG_RECV_PIPE_FULL_NUMBER, //接收数据管道满错误的累计值
ZERG_SEND_LIST_FULL_COUNTER, //五分钟内 TCP的发送队列满了,发送丢失数据个数
ZERG_SEND_LIST_FULL_NUMBER, //TCP的发送队列满了的累计值
// 请不要在心跳监控中间插监控项
ZERG_HEART_BEAT_RECV_TIME_GAP, // 五分钟心跳包总收发时间间隔
ZERG_HEART_BEAT_RECV_COUNT, // 五分钟心跳包总收发次数
ZERG_HEART_BEAT_LESS_FIFTY_COUNT, // 五分钟心跳包总收发时间间隔少于50ms次数
ZERG_HEART_BEAT_LESS_HNDRD_COUNT, // 五分钟心跳包总收发时间间隔少于100ms次数
ZERG_HEART_BEAT_LESS_FIFHNDRD_COUNT, // 五分钟心跳包总收发时间间隔少于500ms次数
ZERG_HEART_BEAT_MORE_FIFHNDRD_COUNT, // 五分钟心跳包总收发时间间隔大于等于500ms次数
ZERG_HEART_BEAT_APP_RECV_TIME_GAP, // 五分钟心跳包APP收发时间间隔
ZERG_HEART_BEAT_APP_RECV_COUNT, // 五分钟心跳包APP收发次数
ZERG_HEART_BEAT_APP_LESS_FIFTY_COUNT, // 五分钟心跳包APP收发时间间隔少于50ms次数
ZERG_HEART_BEAT_APP_LESS_HNDRD_COUNT, // 五分钟心跳包APP收发时间间隔少于100ms次数
ZERG_HEART_BEAT_APP_LESS_FIFHNDRD_COUNT, // 五分钟心跳包APP收发时间间隔少于500ms次数
ZERG_HEART_BEAT_APP_MORE_FIFHNDRD_COUNT, // 五分钟心跳包APP收发时间间隔大于等于500ms次数
ZERG_SEND_FRAME_COUNTER_BY_SVR_TYPE, //五分钟内从发送管道取出放入发送队列的帧总数,分服务类型
ZERG_RECV_FRAME_COUNTER_BY_SVR_TYPE, //五分钟内成功接收放入接收管道的帧总数,分服务类型
ZERG_SEND_FRAME_COUNTER_BY_CMD, //五分钟内从发送管道取出放入发送队列的帧总数,分命令字
ZERG_RECV_FRAME_COUNTER_BY_CMD, //五分钟内成功接收放入接收管道的帧总数,分命令字
ZERG_SEND_FAIL_COUNTER_BY_SVR_TYPE,
ZERG_SEND_LIST_FULL_COUNTER_BY_SVR_TYPE, // 发送队列满导致导致丢包的数量,分服务ID
// 后面随便加
ZERG_SERVICE_STAT_END, //
};
#endif // ZERG_STAT_DEFINE_H_
|
// UIImage+RoundedCorner.h
// Created by Trevor Harmon on 9/20/09.
// Free for personal or commercial use, with or without modification.
// No warranty is expressed or implied.
// NOTE: imcooldo modified to convert from Category to
// new Class name since iPhone seems to have some issues with Categories
// of built in Classes
@interface UIImageRoundedCorner : NSObject
{
}
+ (UIImage *)roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize image:(UIImage*)image;
@end
|
/****************************************************************************
* *
* PrimeSense Sensor 5.x Alpha *
* Copyright (C) 2011 PrimeSense Ltd. *
* *
* This file is part of PrimeSense Sensor. *
* *
* PrimeSense Sensor is free software: you can redistribute it and/or modify*
* it under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* PrimeSense Sensor is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with PrimeSense Sensor. If not, see <http://www.gnu.org/licenses/>.*
* *
****************************************************************************/
#ifndef __XN_SENSOR_FIXED_PARAMS_H__
#define __XN_SENSOR_FIXED_PARAMS_H__
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "XnSensorFirmware.h"
//---------------------------------------------------------------------------
// XnSensorFixedParams class
//---------------------------------------------------------------------------
class XnSensorFixedParams
{
public:
XnSensorFixedParams(XnSensorFirmware* pFirmware, XnDevicePrivateData* pDevicePrivateData);
XnStatus Init();
inline XnDepthPixel GetZeroPlaneDistance() const { return m_nZeroPlaneDistance; }
inline XnDouble GetZeroPlanePixelSize() const { return m_dZeroPlanePixelSize; }
inline XnDouble GetEmitterDCmosDistance() const { return m_dEmitterDCmosDistance; }
inline XnDouble GetDCmosRCmosDistance() const { return m_dDCmosRCmosDistance; }
inline const XnChar* GetSensorSerial() const { return m_strSensorSerial; }
private:
XnSensorFirmware* m_pFirmware;
XnDevicePrivateData* m_pDevicePrivateData;
XnDepthPixel m_nZeroPlaneDistance;
XnDouble m_dZeroPlanePixelSize;
XnDouble m_dEmitterDCmosDistance;
XnDouble m_dDCmosRCmosDistance;
XnChar m_strSensorSerial[XN_DEVICE_MAX_STRING_LENGTH];
};
#endif //__XN_SENSOR_FIXED_PARAMS_H__ |
/*
* File: PublisherFactory.h
*
* Copyright (C) 2015, Albert Krzymowski
*
* 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 _IAS_QS_Workers_Proc_Stats_PublisherFactory_H_
#define _IAS_QS_Workers_Proc_Stats_PublisherFactory_H_
#include <org/invenireaude/qsystem/workers/stats/Publisher.h>
#include <org/invenireaude/qsystem/workers/stats/Specification.h>
#include <commonlib/commonlib.h>
namespace IAS {
namespace QS {
namespace Workers {
namespace Proc {
namespace Stats {
class Publisher;
class PublisherStore;
/*************************************************************************/
/** The PublisherFactory class.
*
*/
class PublisherFactory {
public:
virtual ~PublisherFactory() throw();
static ::org::invenireaude::qsystem::workers::stats::Ext::SpecificationPtr
SpecsToDM(const String& strSpecs);
static Publisher* CreatePublisher(const ::org::invenireaude::qsystem::workers::stats::Publisher* dmPublisher);
protected:
PublisherFactory();
friend class Factory<PublisherFactory>;
};
/*************************************************************************/
}
}
}
}
}
#endif /* _IAS_QS_Workers_Proc_Stats_PublisherFactory_H_ */
|
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Video Redirection Virtual Channel - Media Container
*
* Copyright 2010-2011 Vic Lee
* Copyright 2012 Hewlett-Packard Development Company, L.P.
* Copyright 2015 Thincast Technologies GmbH
* Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.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.
*/
/**
* The media container maintains a global list of presentations, and a list of
* streams in each presentation.
*/
#ifndef __TSMF_MEDIA_H
#define __TSMF_MEDIA_H
#include <freerdp/freerdp.h>
typedef struct _TSMF_PRESENTATION TSMF_PRESENTATION;
typedef struct _TSMF_STREAM TSMF_STREAM;
typedef struct _TSMF_SAMPLE TSMF_SAMPLE;
TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid,
IWTSVirtualChannelCallback* pChannelCallback);
TSMF_PRESENTATION* tsmf_presentation_find_by_id(const BYTE* guid);
BOOL tsmf_presentation_start(TSMF_PRESENTATION* presentation);
BOOL tsmf_presentation_stop(TSMF_PRESENTATION* presentation);
UINT tsmf_presentation_sync(TSMF_PRESENTATION* presentation);
BOOL tsmf_presentation_paused(TSMF_PRESENTATION* presentation);
BOOL tsmf_presentation_restarted(TSMF_PRESENTATION* presentation);
BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume,
UINT32 muted);
BOOL tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation,
UINT32 x, UINT32 y, UINT32 width, UINT32 height,
int num_rects, RDP_RECT* rects);
void tsmf_presentation_set_audio_device(TSMF_PRESENTATION* presentation,
const char* name, const char* device);
void tsmf_presentation_free(TSMF_PRESENTATION* presentation);
TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id,
rdpContext* rdpcontext);
TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, UINT32 stream_id);
BOOL tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, wStream* s);
void tsmf_stream_end(TSMF_STREAM* stream, UINT32 message_id,
IWTSVirtualChannelCallback* pChannelCallback);
void tsmf_stream_free(TSMF_STREAM* stream);
BOOL tsmf_stream_flush(TSMF_STREAM* stream);
BOOL tsmf_stream_push_sample(TSMF_STREAM* stream, IWTSVirtualChannelCallback* pChannelCallback,
UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, UINT32 extensions,
UINT32 data_size, BYTE* data);
BOOL tsmf_media_init(void);
void tsmf_stream_start_threads(TSMF_STREAM* stream);
#endif
|
/*
Imagine
Copyright 2016 Peter Pearson.
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 SHADER_NODE_VIEW_ITEMS_H
#define SHADER_NODE_VIEW_ITEMS_H
#include <string>
#include <set>
#include <QGraphicsItem>
#include <QGraphicsLineItem>
#include <QWidget>
namespace Imagine
{
class ShaderNode;
class ShaderConnectionUI;
// graphical wrapper of ShaderNode item for GUI purposes
class ShaderNodeUI : public QGraphicsItem
{
public:
ShaderNodeUI(const std::string& name, ShaderNode* pActualNode = nullptr);
ShaderNodeUI(ShaderNode* pActualNode);
virtual ~ShaderNodeUI();
void initStateFromShaderNode();
ShaderNode* getActualNode();
void setCustomPos(int x, int y);
void movePos(int x, int y);
virtual QRectF boundingRect() const;
virtual bool contains(const QPointF& point) const;
virtual bool containsSceneSpace(const QPointF& point) const;
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
void publicPrepareGeometryChange();
QPointF getInputPortPosition(unsigned int portIndex) const;
QPointF getOutputPortPosition(unsigned int portIndex) const;
struct SelectionInfo
{
SelectionInfo() : pNode(nullptr), selectionType(eSelectionNone), portIndex(-1)
{
}
enum Type
{
eSelectionNone,
eSelectionNode,
eSelectionInputPort,
eSelectionOutputPort,
eSelectionResize
};
ShaderNodeUI* pNode;
Type selectionType;
unsigned int portIndex;
};
bool doesContain(const QPointF& point, SelectionInfo& selInfo) const;
void setInputPortConnectionItem(unsigned int index, ShaderConnectionUI* pItem);
ShaderConnectionUI* getInputPortConnectionItem(unsigned int index);
unsigned int getOutputPortConnectionCount(unsigned int portIndex) const;
void addOutputPortConnectionItem(unsigned int portIndex, ShaderConnectionUI* pItem);
void removeOutputPortConnectionItem(unsigned int portIndex, ShaderConnectionUI* pItem);
ShaderConnectionUI* getSingleOutputPortConnectionItem(unsigned int index);
void getConnectionItems(std::set<ShaderConnectionUI*>& aConnectionItems) const;
protected:
// we don't own this
ShaderNode* m_pActualNode;
QSizeF m_nodeSize;
std::string m_name; // eventually we shouldn't need this, as it will be pulled from above...
// these are just pointers to existing connections - they're not owned by this class...
// it's up to ShaderNodeViewWidget to keep them up-to-date...
std::vector<ShaderConnectionUI*> m_aInputPortConnectionItems;
// TODO: do we even need this now?
std::vector< std::vector<ShaderConnectionUI*> > m_aOutputPortConnectionItems;
};
class ShaderConnectionUI : public QGraphicsLineItem
{
public:
// output
ShaderConnectionUI(ShaderNodeUI* pSrc);
ShaderConnectionUI(ShaderNodeUI* pSrc, ShaderNodeUI* pDst);
virtual ~ShaderConnectionUI();
void setSourceNode(ShaderNodeUI* pSrcNode) { m_pSrcNode = pSrcNode; }
void setDestinationNode(ShaderNodeUI* pDstNode) { m_pDstNode = pDstNode; }
ShaderNodeUI* getSourceNode() const { return m_pSrcNode; }
ShaderNodeUI* getDestinationNode() const { return m_pDstNode; }
void setSourceNodePortIndex(unsigned int portIndex) { m_srcNodePortIndex = portIndex; }
void setDestinationNodePortIndex(unsigned int portIndex) { m_dstNodePortIndex = portIndex; }
unsigned int getSourceNodePortIndex() const { return m_srcNodePortIndex; }
unsigned int getDestinationNodePortIndex() const { return m_dstNodePortIndex; }
void publicPrepareGeometryChange();
virtual QRectF boundingRect() const;
virtual bool contains(const QPointF& point) const;
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant& value);
void setTempMousePos(QPointF pos) { m_tempMousePos = pos; }
struct SelectionInfo
{
SelectionInfo() : pConnection(nullptr), wasSource(false)
{
}
ShaderConnectionUI* pConnection;
bool wasSource; // whether hit point was closest to source node or destination node
};
bool didHit(const QPointF& pos, SelectionInfo& selInfo, float& closestDistance) const;
// TODO: this is duplicate of stuff in FlowNodeViewItems...
float distanceFromLineEnds(const QPointF& point) const;
protected:
protected:
// we don't own these...
ShaderNodeUI* m_pSrcNode;
ShaderNodeUI* m_pDstNode;
// connections always go src -> dst left to right, so srcNode connections are output ports, dstNode connections
// are input ports...
unsigned int m_srcNodePortIndex; // output port index on source node
unsigned int m_dstNodePortIndex; // input port index on destination node
// this isn't great, but...
QPointF m_tempMousePos;
};
} // namespace Imagine
#endif // SHADER_NODE_VIEW_ITEMS_H
|
#include "nif_resources.h"
static ErlNifResourceType *NETWORK_RESOURCE;
static ErlNifResourceType *CLUSTER_RESOURCE;
static ErlNifResourceType *FUTURE_RESOURCE;
static ErlNifResourceType *DATABASE_RESOURCE;
static ErlNifResourceType *TRANSACTION_RESOURCE;
enif_network_t* wrap_network()
{
enif_network_t *ctx;
ctx = (enif_network_t*)
enif_alloc_resource(NETWORK_RESOURCE,sizeof(enif_network_t));
ctx->is_running = 0;
ctx->lock = enif_mutex_create("network");
return ctx;
}
enif_cluster_t* wrap_cluster(FDBCluster *c)
{
enif_cluster_t *ctx;
ctx =(enif_cluster_t*)
enif_alloc_resource(CLUSTER_RESOURCE,sizeof(enif_cluster_t));
ctx->handle = c;
ctx->lock = enif_mutex_create("cluster");
return ctx;
}
enif_database_t* wrap_database(FDBDatabase* d)
{
enif_database_t *ctx;
ctx =(enif_database_t*)
enif_alloc_resource(DATABASE_RESOURCE,sizeof(enif_database_t));
ctx->handle = d;
ctx->lock = enif_mutex_create("database");
return ctx;
}
enif_transaction_t* wrap_transaction(FDBTransaction *t)
{
enif_transaction_t *ctx;
ctx =(enif_transaction_t*)
enif_alloc_resource(TRANSACTION_RESOURCE,sizeof(enif_transaction_t));
ctx->handle = t;
ctx->lock = enif_mutex_create("transaction");
return ctx;
}
enif_future_t* wrap_future(FDBFuture *f)
{
enif_future_t *ctx;
ctx =(enif_future_t*)
enif_alloc_resource(FUTURE_RESOURCE,sizeof(enif_future_t));
ctx->handle = f;
ctx->callback_env = NULL;
ctx->lock = enif_mutex_create("future");
return ctx;
}
void cleanup_network(ErlNifEnv* env, void* obj)
{
enif_network_t *ctx = (enif_network_t*) obj;
if (ctx == NULL) return;
ErlNifMutex *lock = ctx->lock;
enif_mutex_lock(lock);
if (ctx->is_running) {
fdb_stop_network();
//pthread_join( ctx->thread, NULL );
enif_thread_join(ctx->tid, NULL);
ctx->is_running = 0;
}
enif_mutex_unlock(lock);
enif_mutex_destroy(lock);
}
void cleanup_cluster(ErlNifEnv* env, void* obj)
{
enif_cluster_t *ctx=(enif_cluster_t*)obj;
if (ctx == NULL || ctx->lock == NULL) return;
ErlNifMutex *lock = ctx->lock;
enif_mutex_lock(lock);
if (ctx->handle!=NULL)
{
fdb_cluster_destroy(ctx->handle);
ctx->handle = NULL;
}
ctx->lock = NULL;
enif_mutex_unlock(lock);
enif_mutex_destroy(lock);
}
void cleanup_database(ErlNifEnv* env, void* obj)
{
enif_database_t *ctx=(enif_database_t*)obj;
if (ctx == NULL) return;
ErlNifMutex *lock = ctx->lock;
enif_mutex_lock(lock);
if (ctx->handle!=NULL)
{
fdb_database_destroy(ctx->handle);
ctx->handle = NULL;
}
enif_mutex_unlock(lock);
enif_mutex_destroy(lock);
}
void cleanup_transaction(ErlNifEnv* env, void* obj)
{
enif_transaction_t *ctx=(enif_transaction_t*)obj;
if (ctx == NULL) return;
ErlNifMutex *lock = ctx->lock;
enif_mutex_lock(lock);
if (ctx->handle!=NULL)
{
fdb_transaction_destroy(ctx->handle);
ctx->handle = NULL;
}
enif_mutex_unlock(lock);
enif_mutex_destroy(lock);
}
void cleanup_future(ErlNifEnv* env, void* obj)
{
enif_future_t *ctx=(enif_future_t*)obj;
if (ctx == NULL) return;
ErlNifMutex *lock = ctx->lock;
enif_mutex_lock(lock);
if (ctx->handle!=NULL)
{
fdb_future_destroy(ctx->handle);
ctx->handle = NULL;
}
if (ctx->callback_env != NULL)
{
enif_free_env(ctx->callback_env);
ctx->handle = NULL;
}
enif_mutex_unlock(lock);
enif_mutex_destroy(lock);
}
int get_cluster(ErlNifEnv* env, ERL_NIF_TERM term,enif_cluster_t **cluster)
{
return enif_get_resource(env,term,CLUSTER_RESOURCE,(void**)cluster);
}
int get_database(ErlNifEnv* env, ERL_NIF_TERM term,enif_database_t **database)
{
return enif_get_resource(env,term,DATABASE_RESOURCE,(void**)database);
}
int get_transaction(ErlNifEnv* env, ERL_NIF_TERM term, enif_transaction_t **transaction)
{
return enif_get_resource(env,term,TRANSACTION_RESOURCE,(void**)transaction);
}
int get_future(ErlNifEnv* env, ERL_NIF_TERM term,enif_future_t **future)
{
return enif_get_resource(env,term,FUTURE_RESOURCE,(void**)future);
}
#define REGISTER_RESOURCE(handle,name,dtor) \
if ( (handle = enif_open_resource_type(env, NULL,name, dtor, \
ERL_NIF_RT_CREATE, NULL)) == NULL) \
return -1; \
int register_fdb_resources(ErlNifEnv *env)
{
REGISTER_RESOURCE(NETWORK_RESOURCE,"fdb_network_loop",cleanup_network);
REGISTER_RESOURCE(CLUSTER_RESOURCE,"fdb_cluster",cleanup_cluster);
REGISTER_RESOURCE(FUTURE_RESOURCE,"fdb_future",cleanup_future);
REGISTER_RESOURCE(DATABASE_RESOURCE,"fdb_database",cleanup_database);
REGISTER_RESOURCE(TRANSACTION_RESOURCE,"fdb_transaction",cleanup_transaction);
return 0;
}
|
// AudioPlayer.h
// Created by Caner Korkmaz on 7/7/2017.
// Copyright 2017 Caner Korkmaz
//
#ifndef SOCKETPLAY_AUDIOPLAYER_H
#define SOCKETPLAY_AUDIOPLAYER_H
#ifdef WIN32
#include "Windows/AudioPlayerWindows.h"
namespace socketplay{
using AudioPlayer = socketplay::windows::AudioPlayer;
}
#endif
#endif //SOCKETPLAY_AUDIOPLAYER_H
|
/*
* Copyright 2019-2022 Diligent Graphics LLC
* Copyright 2015-2019 Egor Yusov
*
* 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.
*
* In no event and under no legal theory, whether in tort (including negligence),
* contract, or otherwise, unless required by applicable law (such as deliberate
* and grossly negligent acts) or agreed to in writing, shall any Contributor be
* liable for any damages, including any direct, indirect, special, incidental,
* or consequential damages of any character arising as a result of this License or
* out of the use or inability to use the software (including but not limited to damages
* for loss of goodwill, work stoppage, computer failure or malfunction, or any and
* all other commercial damages or losses), even if such Contributor has been advised
* of the possibility of such damages.
*/
#pragma once
/// \file
/// Definition of the Diligent::IShaderResourceVariableD3D interface
#include "../../GraphicsEngine/interface/ShaderResourceVariable.h"
#include "ShaderD3D.h"
namespace Diligent
{
// {99BCAFBF-E7E1-420A-929B-C862265FD146}
static constexpr INTERFACE_ID IID_ShaderResourceVariableD3D =
{0x99bcafbf, 0xe7e1, 0x420a, {0x92, 0x9b, 0xc8, 0x62, 0x26, 0x5f, 0xd1, 0x46}};
/// Interface to the Direct3D ShaderResourceVariable resource variable
class IShaderResourceVariableD3D : public IShaderResourceVariable
{
public:
/// Returns HLSL ShaderResourceVariable resource description
virtual void DILIGENT_CALL_TYPE GetHLSLResourceDesc(HLSLShaderResourceDesc& HLSLResDesc) const = 0;
};
} // namespace Diligent
|
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef RSD_CPU_SCRIPT_INTRINSIC_H
#define RSD_CPU_SCRIPT_INTRINSIC_H
#include "rsCpuScript.h"
namespace android {
namespace renderscript {
class RsdCpuScriptIntrinsic : public RsdCpuScriptImpl {
public:
virtual void populateScript(Script *) = 0;
virtual void invokeFunction(uint32_t slot, const void *params, size_t paramLength);
virtual int invokeRoot();
virtual void invokeForEach(uint32_t slot,
const Allocation * ain,
Allocation * aout,
const void * usr,
uint32_t usrLen,
const RsScriptCall *sc);
virtual void forEachKernelSetup(uint32_t slot, MTLaunchStruct *mtls);
virtual void invokeInit();
virtual void invokeFreeChildren();
virtual void setGlobalVar(uint32_t slot, const void *data, size_t dataLength);
virtual void setGlobalVarWithElemDims(uint32_t slot, const void *data, size_t dataLength,
const Element *e, const size_t *dims, size_t dimLength);
virtual void setGlobalBind(uint32_t slot, Allocation *data);
virtual void setGlobalObj(uint32_t slot, ObjectBase *data);
virtual ~RsdCpuScriptIntrinsic();
RsdCpuScriptIntrinsic(RsdCpuReferenceImpl *ctx, const Script *s, const Element *,
RsScriptIntrinsicID iid);
protected:
RsScriptIntrinsicID mID;
outer_foreach_t mRootPtr;
ObjectBaseRef<const Element> mElement;
};
}
}
#endif
|
/*
Name: CompositionProcessorEngine
Copyright: Copyright (C) 2003-2017 SIL International.
Documentation:
Description:
Create Date: 31 Dec 2014
Modified Date: 31 Dec 2014
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 31 Dec 2014 - mcdurdin - I4548 - V9.0 - When Alt is down, release of Ctrl, Shift is not detectable within TIP in some languages
*/
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
#pragma once
#include "sal.h"
#include "KeyHandlerEditSession.h"
#include "SampleIMEBaseStructure.h"
#include "define.h"
class CCompositionProcessorEngine
{
public:
CCompositionProcessorEngine(void);
~CCompositionProcessorEngine(void);
BOOL SetupLanguageProfile(LANGID langid, REFGUID guidLanguageProfile, _In_ ITfThreadMgr *pThreadMgr, TfClientId tfClientId, BOOL isSecureMode, BOOL isComLessMode);
// Get language profile.
GUID GetLanguageProfile(LANGID *plangid)
{
*plangid = _langid;
return _guidProfile;
}
// Get locale
LCID GetLocale()
{
return MAKELCID(_langid, SORT_DEFAULT);
}
private:
void InitializeSampleIMECompartment(_In_ ITfThreadMgr *pThreadMgr, TfClientId tfClientId);
private:
LANGID _langid;
GUID _guidProfile;
TfClientId _tfClientId;
BOOL _isComLessMode : 1;
};
|
/*
* Copyright 2016 The Netty Project
*
* The Netty Project 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.
*/
#include <limits.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/un.h>
#include "netty_unix_limits.h"
#include "netty_unix_util.h"
// Define IOV_MAX if not found to limit the iov size on writev calls
// See https://github.com/netty/netty/issues/2647
#ifndef IOV_MAX
#define IOV_MAX 1024
#endif /* IOV_MAX */
// Define UIO_MAXIOV if not found
#ifndef UIO_MAXIOV
#define UIO_MAXIOV 1024
#endif /* UIO_MAXIOV */
// JNI Registered Methods Begin
static jlong netty_unix_limits_ssizeMax(JNIEnv* env, jclass clazz) {
return SSIZE_MAX;
}
static jint netty_unix_limits_iovMax(JNIEnv* env, jclass clazz) {
return IOV_MAX;
}
static jint netty_unix_limits_uioMaxIov(JNIEnv* env, jclass clazz) {
return UIO_MAXIOV;
}
static jint netty_unix_limits_sizeOfjlong(JNIEnv* env, jclass clazz) {
return sizeof(jlong);
}
static jint netty_unix_limits_udsSunPathSize(JNIEnv* env, jclass clazz) {
struct sockaddr_un udsAddr;
return sizeof(udsAddr.sun_path) / sizeof(udsAddr.sun_path[0]);
}
// JNI Registered Methods End
// JNI Method Registration Table Begin
static const JNINativeMethod statically_referenced_fixed_method_table[] = {
{ "ssizeMax", "()J", (void *) netty_unix_limits_ssizeMax },
{ "iovMax", "()I", (void *) netty_unix_limits_iovMax },
{ "uioMaxIov", "()I", (void *) netty_unix_limits_uioMaxIov },
{ "sizeOfjlong", "()I", (void *) netty_unix_limits_sizeOfjlong },
{ "udsSunPathSize", "()I", (void *) netty_unix_limits_udsSunPathSize }
};
static const jint statically_referenced_fixed_method_table_size = sizeof(statically_referenced_fixed_method_table) / sizeof(statically_referenced_fixed_method_table[0]);
// JNI Method Registration Table End
jint netty_unix_limits_JNI_OnLoad(JNIEnv* env, const char* packagePrefix) {
// We must register the statically referenced methods first!
if (netty_unix_util_register_natives(env,
packagePrefix,
"io/netty/channel/unix/LimitsStaticallyReferencedJniMethods",
statically_referenced_fixed_method_table,
statically_referenced_fixed_method_table_size) != 0) {
return JNI_ERR;
}
return JNI_VERSION_1_6;
}
void netty_unix_limits_JNI_OnUnLoad(JNIEnv* env) { }
|
// Licensed under the Apache License, Version 2.0.
// Author: Jin Qing (http://blog.csdn.net/jq0123)
#ifndef GRPC_CB_CLIENT_CHANNEL_SPTR_H
#define GRPC_CB_CLIENT_CHANNEL_SPTR_H
#include <grpc_cb_core/client/channel_sptr.h>
namespace grpc_cb {
using ChannelSptr = grpc_cb_core::ChannelSptr;
} // namespace grpc_cb
#endif // GRPC_CB_CLIENT_CHANNEL_SPTR_H
|
//
// RssViewController.h
// InstagramRSSTestProject
//
// Created by rost on 16.01.14.
// Copyright (c) 2014 rost. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RssViewController : RootViewController <ApiConnectorDelegate, UITableViewDataSource, UITableViewDelegate>
@property (strong, nonatomic) NSMutableArray *rssDataArr;
@end
|
//
// UIImage+Image.h
// 彩票
//
// Created by 李胜营 on 16/4/25.
// Copyright (c) 2016年 dasheng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Image)
//给UIimage添加一个返回原始图片的方法。
+ (UIImage *)imageWithOrigRendingImage:(NSString *)imageName;
@end
|
//
// Copyright (c) 2016 Google Inc.
//
// 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.
//
@import Foundation;
@import FirebaseDatabase;
#import "STXPostItem.h"
#import "FPComment.h"
@interface FPPost : NSObject <STXPostItem>
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
/**
* Initialize data model from snapshot
*/
- (instancetype)initWithSnapshot:(FIRDataSnapshot *)snapshot andComments:(NSArray<FPComment *> *)comments;
@property (nonatomic) BOOL liked;
@property (copy, nonatomic) NSDictionary *likes;
@end
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "MDMMotionCurve.h"
#import "MDMMotionRepetition.h"
#import "MDMMotionTiming.h"
#import "MotionInterchange.h"
FOUNDATION_EXPORT double MotionInterchangeVersionNumber;
FOUNDATION_EXPORT const unsigned char MotionInterchangeVersionString[];
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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.txt
*
* 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 __itkBinaryMinMaxCurvatureFlowImageFilter_h
#define __itkBinaryMinMaxCurvatureFlowImageFilter_h
#include "itkMinMaxCurvatureFlowImageFilter.h"
#include "itkBinaryMinMaxCurvatureFlowFunction.h"
namespace itk
{
/** \class BinaryMinMaxCurvatureFlowImageFilter
* \brief Denoise a binary image using min/max curvature flow.
*
* BinaryMinMaxCurvatureFlowImageFilter implements a curvature driven image
* denosing algorithm. This filter assumes that the image is essentially
* binary: consisting of two classes. Iso-brightness contours in the input
* image are viewed as a level set. The level set is then evolved using
* a curvature-based speed function:
*
* \f[ I_t = F_{\mbox{minmax}} |\nabla I| \f]
*
* where \f$ F_{\mbox{minmax}} = \min(\kappa,0) \f$ if
* \f$ \mbox{Avg}_{\mbox{stencil}}(x) \f$
* is less than or equal to \f$ T_{thresold} \f$
* and \f$ \max(\kappa,0) \f$, otherwise.
* \f$ \kappa \f$ is the mean curvature of the iso-brightness contour
* at point \f$ x \f$.
*
* In min/max curvature flow, movement is turned on or off depending
* on the scale of the noise one wants to remove. Switching depends on
* the average image value of a region of radius \f$ R \f$ around each
* point. The choice of \f$ R \f$, the stencil radius, governs the scale of
* the noise to be removed.
*
* The threshold value \f$ T_{threshold} \f$ is a user specified value which
* discriminates between the two pixel classes.
*
* This filter make use of the multi-threaded finite difference solver
* hierarchy. Updates are computed using a BinaryMinMaxCurvatureFlowFunction
* object. A zero flux Neumann boundary condition is used when computing
* derivatives near the data boundary.
*
* \warning This filter assumes that the input and output types have the
* same dimensions. This filter also requires that the output image pixels
* are of a real type. This filter works for any dimensional images.
*
* Reference:
* "Level Set Methods and Fast Marching Methods", J.A. Sethian,
* Cambridge Press, Chapter 16, Second edition, 1999.
*
* \sa BinaryMinMaxCurvatureFlowFunction
* \sa CurvatureFlowImageFilter
* \sa MinMaxCurvatureFlowImageFilter
*
* \ingroup ImageEnhancement
* \ingroup MultiThreaded
*
* \ingroup ITKCurvatureFlow
*/
template< typename TInputImage, typename TOutputImage >
class BinaryMinMaxCurvatureFlowImageFilter:
public MinMaxCurvatureFlowImageFilter< TInputImage, TOutputImage >
{
public:
/** Standard class typedefs. */
typedef BinaryMinMaxCurvatureFlowImageFilter Self;
typedef MinMaxCurvatureFlowImageFilter< TInputImage, TOutputImage > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(BinaryMinMaxCurvatureFlowImageFilter, MinMaxCurvatureFlowImageFilter);
/** Inherit typedefs from Superclass. */
typedef typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType;
typedef typename Superclass::OutputImageType OutputImageType;
/** BinaryMinMaxCurvatureFlowFunction type. */
typedef BinaryMinMaxCurvatureFlowFunction< OutputImageType > BinaryMinMaxCurvatureFlowFunctionType;
/** Dimensionality of input and output data is assumed to be the same.
* It is inherited from the superclass. */
itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
/** Set/Get the threshold value. */
itkSetMacro(Threshold, double);
itkGetConstMacro(Threshold, double);
#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro( InputConvertibleToOutputCheck,
( Concept::Convertible< typename TInputImage::PixelType,
typename TOutputImage::PixelType > ) );
// End concept checking
#endif
protected:
protected:
BinaryMinMaxCurvatureFlowImageFilter();
~BinaryMinMaxCurvatureFlowImageFilter() {}
void PrintSelf(std::ostream & os, Indent indent) const;
/** Initialize the state of filter and equation before each iteration.
* Progress feeback is implemented as part of this method. */
virtual void InitializeIteration();
private:
BinaryMinMaxCurvatureFlowImageFilter(const Self &); //purposely not
// implemented
void operator=(const Self &); //purposely not
// implemented
double m_Threshold;
};
} // end namspace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkBinaryMinMaxCurvatureFlowImageFilter.hxx"
#endif
#endif
|
// Copyright 2020 The Pigweed 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#pragma once
#include <atomic>
namespace pw::sync::backend {
using NativeInterruptSpinLock = std::atomic_flag;
using NativeInterruptSpinLockHandle = std::atomic_flag&;
} // namespace pw::sync::backend
|
//
// AppDelegate.h
// SpotLight
//
// Created by MyMac on 15/9/23.
// Copyright © 2015年 MyMac. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// UIImageView+URL.h
// Koolistov
//
// Created by Johan Kool on 28-10-10.
// Copyright 2010-2010 Koolistov. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// * Neither the name of KOOLISTOV nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface UIImageView (URL)
// Asynchronously downloads the image at the URL if needed, whilst showing a gray activity indicator.
// No image is shown during the download, and none is shown if no valid image could be loaded.
// Call -cancelImageDownload if you need to cancel the download.
- (void)setImageAtURL:(NSURL *)imageURL;
// Asynchronously downloads the image at the URL if needed, whilst showing a gray activity indicator.
// No image is shown during the download, and none is shown if no valid image could be loaded.
// Call -cancelImageDownload if you need to cancel the download.
// If cache is NO, image will be downloaded from server, not loaded from cache.
- (void)setImageAtURL:(NSURL *)imageURL cache:(BOOL)cache completionHandler:(void(^)(UIImage *image))completionHandler;
// Asynchronously downloads the image at the URL if needed.
// Call -cancelImageDownload if you need to cancel the download.
- (void)setImageAtURL:(NSURL *)imageURL showActivityIndicator:(BOOL)showActivityIndicator activityIndicatorStyle:(UIActivityIndicatorViewStyle)indicatorStyle loadingImage:(UIImage *)loadingImage notAvailableImage:(UIImage *)notAvailableImage;
// The image is loaded from imageURL, but will be cached under cacheURL. This allows coallescing
// for example in cases where the imageURL contains changing parameters which don't affect the image to load.
- (void)setImageAtURL:(NSURL *)imageURL cacheURL:(NSURL *)cacheURL showActivityIndicator:(BOOL)showActivityIndicator activityIndicatorStyle:(UIActivityIndicatorViewStyle)indicatorStyle loadingImage:(UIImage *)loadingImage notAvailableImage:(UIImage *)notAvailableImage;
// The image is loaded from imageURL, but will be cached under cacheURL. This allows coallescing
// for example in cases where the imageURL contains changing parameters which don't affect the image to load.
- (void)setImageAtURL:(NSURL *)imageURL cacheURL:(NSURL *)cacheURL showActivityIndicator:(BOOL)showActivityIndicator activityIndicatorStyle:(UIActivityIndicatorViewStyle)indicatorStyle loadingImage:(UIImage *)loadingImage notAvailableImage:(UIImage *)notAvailableImage completionHandler:(void(^)(UIImage *image))completionHandler;
// Cancel any ongoing asynchronous download for the image view. Also hides the activity indicator.
- (void)cancelImageDownload;
- (void)showActivityIndicatorWithStyle:(UIActivityIndicatorViewStyle)indicatorStyle;
- (void)hideActivityIndicator;
@end |
// Copyright 2017 Google Inc.
//
// 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 XRTL_PORT_WINDOWS_BASE_THREADING_WIN32_WAIT_HANDLE_H_
#define XRTL_PORT_WINDOWS_BASE_THREADING_WIN32_WAIT_HANDLE_H_
#include <utility>
#include "xrtl/base/threading/wait_handle.h"
#include "xrtl/port/windows/base/windows.h"
namespace xrtl {
// CRTP WaitHandle shim.
// This is used by the various waitable types on Windows to get safe HANDLE
// storage.
template <typename T>
class Win32WaitHandle : public T {
public:
template <typename... Args>
explicit Win32WaitHandle(HANDLE handle, Args&&... args)
: T(std::forward<Args>(args)...), handle_(handle) {}
~Win32WaitHandle() override {
if (handle_) {
::CloseHandle(handle_);
handle_ = nullptr;
}
}
uintptr_t native_handle() override {
return reinterpret_cast<uintptr_t>(handle_);
}
protected:
HANDLE handle_ = nullptr;
};
} // namespace xrtl
#endif // XRTL_PORT_WINDOWS_BASE_THREADING_WIN32_WAIT_HANDLE_H_
|
/*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the LICENSE file.
*
* For more information, see the LICENSE file.
*/
/*-*- Mode: C++ -*-*/
/*
*/
#ifndef _WIN_MATH_H
#define _WIN_MATH_H
#include "parmlist.h"
// Class used to create math controller
class Win_math
{
public:
Win_math(void);
~Win_math(void);
static int Exec(int argc, char **argv, int, char **);
void math_insert(char *, int isimage);
void show_window() { xv_set(popup, XV_SHOW, TRUE, NULL); }
private:
Frame frame; // Parent
Frame popup; // Popup frame (subframe)
Textsw expression_box;
int busy;
static void done_proc(Frame);
static void text_proc(Panel_item, Event *);
static Menu math_menu_load_pullright(Menu_item, Menu_generate op);
static void math_menu_load(char *dir, char *file);
static void execute(Panel_item);
static char *append_string(char *oldstring, char *newstuff);
static char *append_string(char *oldstring, char *newstuff, int nchrs);
static char *make_c_expression(char *cmd);
static char *expr2progname(char *cmd);
static char *func2progname(char *cmd);
static char *func2path(char *name);
static int sub_string_in_file(char *infile, char *outfile,
char *insub, char *outsub);
static void exec_string(char*);
static int parse_lhs(char *, ParmList *frames);
static int parse_rhs(char *, ParmList *ddls, ParmList *ddlvecs,
ParmList *strings, ParmList *constants);
static char *get_program(char *);
static int write_images(char *);
static int exec_program(char *, ParmList in, ParmList *out);
static int read_images(char *);
static void remove_files(char *);
static ParmList get_stringlist(char *name, char *cmd);
static ParmList get_constlist(char *name, char *cmd);
static ParmList get_imagevector_list(char *name, char *cmd);
static ParmList get_framevector(char *name, char **cmd);
static ParmList parse_frame_spec(char *str, ParmList pl);
};
#endif /* _WIN_MATH_H */
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Collections_Generic_EqualityCompar2781487171.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.EqualityComparer`1/DefaultComparer<UnityEngine.Networking.NetworkMigrationManager/ConnectionPendingPlayers>
struct DefaultComparer_t1534814765 : public EqualityComparer_1_t2781487171
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
// Copyright 2019 Open Source Robotics Foundation, Inc.
//
// 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 RMW__LOCALHOST_H_
#define RMW__LOCALHOST_H_
#include "rmw/visibility_control.h"
#ifdef __cplusplus
extern "C"
{
#endif
/// Used to specify if the context can only communicate through localhost.
typedef enum RMW_PUBLIC_TYPE rmw_localhost_only_e
{
/// Uses ROS_LOCALHOST_ONLY environment variable.
RMW_LOCALHOST_ONLY_DEFAULT = 0,
/// Forces using only localhost.
RMW_LOCALHOST_ONLY_ENABLED = 1,
/// Forces disabling localhost only.
RMW_LOCALHOST_ONLY_DISABLED = 2,
} rmw_localhost_only_t;
#ifdef __cplusplus
}
#endif
#endif // RMW__LOCALHOST_H_
|
// Copyright 2022 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef ONLINE_BELIEF_PROPAGATION_ESTIMATE_STSBM_PARAMETERS_H_
#define ONLINE_BELIEF_PROPAGATION_ESTIMATE_STSBM_PARAMETERS_H_
#include "graph.h"
// Parameters for generating a random graph according to the Symmetric
// Stochastic Block Model (StSBM).
struct StSBMParameters {
// Number of vertices.
int n;
// Number of communities.
int k;
// n x (probability of two vertices beloging to the same community being
// connected)
double a;
// n x (probability of two vertices beloging to different communities being
// connected)
double b;
};
// Given a graph and the ground-truth communities of its vertices, estimates the
// StSBM parameters, as described in Section 6.3 of the paper. For each index i,
// ground_truth_communities[i] indicates the community to which vertex i
// belongs. This function assumes that the set of elements of
// 'ground_truth_communities', after removing duplicates, is of the form {0, 1,
// ..., k - 1} for some value of k.
StSBMParameters EstimateStSBMParameters(
const Graph& graph, const std::vector<int> ground_truth_communities);
#endif // ONLINE_BELIEF_PROPAGATION_ESTIMATE_STSBM_PARAMETERS_H_
|
#include "StdAfx.h"
#ifndef ACL_PREPARE_COMPILE
#include "stdlib/acl_define.h"
#include <string.h>
#ifdef ACL_BCB_COMPILER
#pragma hdrstop
#endif
#include "stdlib/acl_msg.h"
#include "stdlib/acl_mymalloc.h"
#endif
#include "fdmap.h"
typedef struct FD_ENTRY {
int fd;
void *ctx;
} FD_ENTRY;
struct ACL_FD_MAP {
FD_ENTRY *table;
int size;
};
ACL_FD_MAP *acl_fdmap_create(int size)
{
const char *myname = "acl_fdmap_create";
ACL_FD_MAP *map;
if (size < 0)
acl_msg_fatal("%s(%d): maxfd(%d) invalid",
myname, __LINE__, size);
map = (ACL_FD_MAP *) acl_mycalloc(1, sizeof(ACL_FD_MAP));
if (map == NULL)
acl_msg_fatal("%s(%d): calloc error(%s)",
myname, __LINE__, acl_last_serror());
map->size = size;
map->table = (FD_ENTRY *) acl_mycalloc(map->size, sizeof(FD_ENTRY));
if (map->table == NULL)
acl_msg_fatal("%s(%d): calloc error(%s)",
myname, __LINE__, acl_last_serror());
return (map);
}
void acl_fdmap_add(ACL_FD_MAP *map, int fd, void *ctx)
{
const char *myname = "acl_fdmap_add";
if (fd >= map->size)
acl_msg_fatal("%s(%d): fd(%d) >= map's size(%d)",
myname, __LINE__, fd, map->size);
map->table[fd].fd = fd;
map->table[fd].ctx = ctx;
}
void acl_fdmap_del(ACL_FD_MAP *map, int fd)
{
const char *myname = "acl_fdmap_del";
if (fd >= map->size)
acl_msg_fatal("%s(%d): fd(%d) >= map's size(%d)",
myname, __LINE__, fd, map->size);
}
void *acl_fdmap_ctx(ACL_FD_MAP *map, int fd)
{
const char *myname = "acl_fdmap_ctx";
if (fd >= map->size)
acl_msg_fatal("%s(%d): fd(%d) >= map's size(%d)",
myname, __LINE__, fd, map->size);
return (map->table[fd].ctx);
}
void acl_fdmap_free(ACL_FD_MAP *map)
{
if (map) {
acl_myfree(map->table);
acl_myfree(map);
}
}
|
/*
* gucefCORE: GUCEF module providing O/S abstraction and generic solutions
* Copyright (C) 2002 - 2007. Dinand Vanvelzen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef GUCEF_CORE_CNOTIFIEROBSERVINGCOMPONENT_H
#define GUCEF_CORE_CNOTIFIEROBSERVINGCOMPONENT_H
/*-------------------------------------------------------------------------//
// //
// INCLUDES //
// //
//-------------------------------------------------------------------------*/
#include "CObserver.h"
/*-------------------------------------------------------------------------//
// //
// NAMESPACE //
// //
//-------------------------------------------------------------------------*/
namespace GUCEF {
namespace CORE {
/*-------------------------------------------------------------------------//
// //
// CLASSES //
// //
//-------------------------------------------------------------------------*/
class CObservingNotifier;
/*-------------------------------------------------------------------------*/
/**
* Class for internal use only.
* Implements the observer component of the CObservingNotifier class.
*/
class GUCEF_CORE_PUBLIC_CPP CNotifierObservingComponent : public CObserver
{
public:
virtual const MT::CILockable* AsLockable( void ) const GUCEF_VIRTUAL_OVERRIDE;
protected:
virtual void OnNotify( CNotifier* notifier ,
const CEvent& eventid ,
CICloneable* eventdata = GUCEF_NULL ) GUCEF_VIRTUAL_OVERRIDE;
virtual bool Lock( UInt32 lockWaitTimeoutInMs = GUCEF_MT_DEFAULT_LOCK_TIMEOUT_IN_MS ) const GUCEF_VIRTUAL_OVERRIDE;
virtual bool Unlock( void ) const GUCEF_VIRTUAL_OVERRIDE;
private:
friend class CObservingNotifier;
CNotifierObservingComponent( void );
CNotifierObservingComponent( const CNotifierObservingComponent& src );
virtual ~CNotifierObservingComponent();
CNotifierObservingComponent& operator=( const CNotifierObservingComponent& src );
void SetOwner( CObservingNotifier* owner );
virtual const CString& GetClassTypeName( void ) const GUCEF_VIRTUAL_OVERRIDE;
private:
CObservingNotifier* m_owner;
};
/*-------------------------------------------------------------------------//
// //
// NAMESPACE //
// //
//-------------------------------------------------------------------------*/
}; /* namespace CORE */
}; /* namespace GUCEF */
/*-------------------------------------------------------------------------*/
#endif /* GUCEF_CORE_CNOTIFIEROBSERVINGCOMPONENT_H ? */
|
#pragma once
#include <cassert>
#include <cstdint>
namespace Bee
{
constexpr static inline uint32_t EncodeCell(int row, int column)
{
return static_cast<uint32_t>((row << 3) | column);
}
class ChessboardCell
{
public:
enum Columns : int
{
ColumnA = 0,
ColumnB,
ColumnC,
ColumnD,
ColumnE,
ColumnF,
ColumnG,
ColumnH
};
constexpr static uint32_t A1 = EncodeCell(0, ColumnA);
private:
};
//constexpr inline uint32_t ChessboardCell::Encode(int row, int column)
//{
// return static_cast<uint32_t>((row << 3) | column);
//}
} |
/**
* Copyright 2017 Wultra s.r.o.
*
* 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.
*/
#import <Foundation/Foundation.h>
/**
The `PA2SessionStatusProvider` protocol defines an abstract interface for getting instant
information about PowerAuth session.
*/
@protocol PA2SessionStatusProvider <NSObject>
@required
/**
Check if it is possible to start an activation process
@return YES if activation process can be started, NO otherwise.
@exception NSException thrown in case configuration is not present.
*/
- (BOOL) canStartActivation;
/**
Checks if there is a pending activation (activation in progress).
@return YES if there is a pending activation, NO otherwise.
@exception NSException thrown in case configuration is not present.
*/
- (BOOL) hasPendingActivation;
/**
Checks if there is a valid activation.
@return YES if there is a valid activation, NO otherwise.
@exception NSException thrown in case configuration is not present.
*/
- (BOOL) hasValidActivation;
/**
Checks if there's a valid activation that requires a protocol upgrade. Contains NO once the upgrade
process is started. The application should fetch the activation's status to do the upgrade.
@return YES if there is available protocol upgrade.
@exception NSException thrown in case configuration is not present.
*/
- (BOOL) hasProtocolUpgradeAvailable;
/**
Checks if there is a pending protocol upgrade.
@return YES if session has a pending upgrade.
*/
- (BOOL) hasPendingProtocolUpgrade;
@end
|
#ifndef EDOSU_RENDER_H
#define EDOSU_RENDER_H
#include <stdint.h>
#include <gtk/gtk.h>
#include "osux/hitobject.h"
G_BEGIN_DECLS
typedef struct edosu_color_ {
double r, g, b, a;
} edosu_color;
void edosu_draw_object(osux_hitobject *ho, cairo_t *cr,
int64_t position, edosu_color *cl);
G_END_DECLS
#endif // EDOSU_RENDER_H
|
// Copyright 2020 The Pigweed 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#pragma once
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <type_traits>
namespace pw::containers {
// A simple, fixed-size associative array with lookup by key or value.
//
// FlatMaps are initialized with a std::array of FlatMap::Pair objects:
// FlatMap<int, int> map({{{1, 2}, {3, 4}}});
//
// The keys do not need to be sorted as the constructor will sort the items
// if need be.
template <typename Key, typename Value, size_t kArraySize>
class FlatMap {
public:
// Define and use a custom Pair object. This is because std::pair does not
// support constexpr assignment until C++20. The assignment is needed since
// the array of pairs will be sorted in the constructor (if not already).
template <typename First, typename Second>
struct Pair {
First first;
Second second;
};
using key_type = Key;
using mapped_type = Value;
using value_type = Pair<key_type, mapped_type>;
using size_type = size_t;
using difference_type = ptrdiff_t;
using container_type = typename std::array<value_type, kArraySize>;
using iterator = typename container_type::iterator;
using const_iterator = typename container_type::const_iterator;
constexpr FlatMap(const std::array<value_type, kArraySize>& items)
: items_(items) {
ConstexprSort(items_.data(), kArraySize);
}
FlatMap(FlatMap&) = delete;
FlatMap& operator=(FlatMap&) = delete;
// Capacity.
constexpr size_type size() const { return kArraySize; }
constexpr size_type empty() const { return size() == 0; }
constexpr size_type max_size() const { return kArraySize; }
// Lookup.
constexpr bool contains(const key_type& key) const {
return find(key) != end();
}
constexpr const_iterator find(const key_type& key) const {
if (end() == begin()) {
return end();
}
const_iterator it = lower_bound(key);
return key == it->first ? it : end();
}
constexpr const_iterator lower_bound(const key_type& key) const {
return std::lower_bound(
begin(), end(), key, [](const value_type& item, key_type lkey) {
return item.first < lkey;
});
}
constexpr const_iterator upper_bound(const key_type& key) const {
return std::upper_bound(
begin(), end(), key, [](key_type lkey, const value_type& item) {
return item.first > lkey;
});
}
constexpr std::pair<const_iterator, const_iterator> equal_range(
const key_type& key) const {
if (end() == begin()) {
return std::make_pair(end(), end());
}
return std::make_pair(lower_bound(key), upper_bound(key));
}
// Iterators.
constexpr const_iterator begin() const { return cbegin(); }
constexpr const_iterator cbegin() const { return items_.cbegin(); }
constexpr const_iterator end() const { return cend(); }
constexpr const_iterator cend() const { return items_.cend(); }
private:
// Simple stable insertion sort function for constexpr support.
// std::stable_sort is not constexpr. Should not be a problem with performance
// in regards to the sizes that are typically dealt with.
static constexpr void ConstexprSort(iterator data, size_type size) {
if (size < 2) {
return;
}
for (iterator it = data + 1, end = data + size; it < end; ++it) {
if (it->first < it[-1].first) {
// Rotate the value into place.
value_type temp = std::move(*it);
iterator it2 = it - 1;
while (true) {
*(it2 + 1) = std::move(*it2);
if (it2 == data || !(temp.first < it2[-1].first)) {
break;
}
--it2;
}
*it2 = std::move(temp);
}
}
}
std::array<value_type, kArraySize> items_;
};
} // namespace pw::containers
|
//
// PersonalViewController.h
// YiPinTongXing
//
// Created by dhz on 2017/2/7.
// Copyright © 2017年 pengjie_liu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PersonalViewController : UIViewController
@property(nonatomic,strong)UIImage *img;
-(void)requestDataForPhone;
-(void)requestDataForAboutOurs;
@end
|
#ifndef WORD_H
#define WORD_H
#include <string>
#include "Token.h"
using std::string;
class Word : public Token {
public:
Word(int _tag, string _lexeme);
string getLexeme() const;
private:
string lexeme;
};
#endif // WORD_H
|
#ifndef Alchemy_Common
#define Alchemy_Common
#include "cocos2d.h"
#include "cocos-ext.h"
#include "Util/PETime.h"
#include "cocostudio/CocoStudio.h"
#if defined(WIN32)
#define PRINT_LOG(...) log(__VA_ARGS__)
#elif defined(CC_TARGET_OS_MAC)
#define PRINT_LOG(...) log(__VA_ARGS__)
#else
#define PRINT_LOG(...)
#endif
#define UI_FONT "fonts/HYGothic-Extra.ttf"
class Alchemy;
using namespace std;
USING_NS_CC;
USING_NS_CC_EXT;
#define DESIGN_WIDTH 1080.0f
#define DESIGN_HEIGHT 1920.0f
#define MIX_WIDTH 1080.0f
#define MIX_HEIGHT 441.0f
#define BOARD_WIDTH 164.0f
#define BOARD_HEIGHT 148.0f
#define OBJECT_WIDTH 128.0f
#define OBJECT_HEIGHT 128.0f
#define ELEMENT_COUNT 4
#define ALCHEMY_COUNT 6
#define ITEM_COUNT 4
#define OBJECT_COUNT ELEMENT_COUNT + ALCHEMY_COUNT + ITEM_COUNT
#define ICON 1
#define ALCHEMY 2
#define MONSTER 3
#define ROW_NUM 7
#define COL_NUM 6
#define MAX_ROW_NUM 10
#define ROW 0
#define COL 1
#define TYPE_COUNT 4
#define NUM_OF_CACHED_BULLETS 3
#define BULLET_FIRE_COOLTIME 1500
#define NUM_OF_MONSTERS 6
#define MONSTER_SPAWN_COOLTIME 1000
#define TIME_START 0
#define TIME_END 1
class Common
{
};
inline long time_interval(_STRUCT_TIMEVAL start, _STRUCT_TIMEVAL end)
{
return (end.tv_sec - start.tv_sec)*1000 + (end.tv_usec - start.tv_usec)/1000;
}
#endif
|
#pragma once
#include <memory>
#include "DXUT.h"
#include "engiXDefs.h"
#include "HumanD3dGameView.h"
#include "GameApp.h"
namespace engiX
{
class WinGameApp : public GameApp
{
public:
static const int DEFAULT_SCREEN_WIDTH = 1024;
static const int DEFAULT_SCREEN_HEIGHT = 768;
static int Main(
WinGameApp* pGameInst,
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int nCmdShow);
WinGameApp();
bool Init(HINSTANCE hInstance, LPWSTR lpCmdLine);
void Deinit();
void Run();
int ExitCode() const { return DXUTGetExitCode(); }
const SIZE& ScreenSize() const { return m_screenSize; }
const Timer& GameTime() const { return m_gameTime; }
real AspectRatio() const { return (real)m_screenSize.cx / (real)m_screenSize.cy; }
protected:
virtual const wchar_t* GameAppTitle() const = 0;
HWND WindowHandle() const { return DXUTGetHWND(); }
virtual GameLogic* CreateLogicAndStartView() const = 0;
void CalcAndDisplayFrameStatistics();
private:
// DXUT General Handlers
static LRESULT CALLBACK OnMsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing, void *pUserContext );
static bool CALLBACK ModifyDeviceSettings( DXUTDeviceSettings* pDeviceSettings, void* pUserContext );
static void CALLBACK OnUpdateGame( double fTime, float fElapsedTime, void *pUserContext );
// DXUT DirectX11 Handlers
static bool CALLBACK IsD3D11DeviceAcceptable( const CD3D11EnumAdapterInfo *AdapterInfo, UINT Output, const CD3D11EnumDeviceInfo *DeviceInfo, DXGI_FORMAT BackBufferFormat, bool bWindowed, void* pUserContext ) { return true; }
static HRESULT CALLBACK OnD3D11CreateDevice( ID3D11Device* pd3dDevice, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext ) { return S_OK; }
static HRESULT CALLBACK OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext );
static void CALLBACK OnD3D11ReleasingSwapChain( void* pUserContext ) {}
static void CALLBACK OnD3D11DestroyDevice( void* pUserContext ) {}
static void CALLBACK OnD3D11FrameRender( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime, float fElapsedTime, void* pUserContext );
SIZE m_screenSize;
Timer m_gameTime;
bool m_firstUpdate;
};
} |
//
// Copyright 2014 Etrawler
//
// 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.
//
//
// SearchViewController.h
// CarTrawler
//
//
@class LocationListViewController, RentalSession, CTLocation,CTSearchDefaults, CTCountry, CTSearchDefaults;
@interface SearchViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, UITextFieldDelegate, UIPickerViewDataSource, UIPickerViewDelegate, ASIHTTPRequestDelegate>
@property (nonatomic, weak) IBOutlet UIButton *showDOMapButton;
@property (nonatomic, weak) IBOutlet UIButton *showMapButton;
@property (nonatomic, assign) BOOL setFromLocations;
@property (nonatomic, strong) UIButton *dismissLocationPopUpButton;
@property (nonatomic, strong) CTSearchDefaults *ctSearchDefaults;
@property (nonatomic, strong) CTCountry *ctCountry;
//@property (nonatomic, strong) CTCurrency *ctCurrency;
@property (nonatomic, assign) BOOL isSettingDropoffLocation;
@property (nonatomic, strong) CTLocation *selectedNearbyLocation;
@property (nonatomic, strong) RentalSession *session;
@property (nonatomic, assign) BOOL isFromNearbySearch;
@property (nonatomic, assign) BOOL isFromCitySearch;
@property (nonatomic, assign) BOOL isFromAirportSearch;
@property (nonatomic, copy) NSString *formattedPickupString;
@property (nonatomic, copy) NSString *formattedDropoffString;
@property (nonatomic, copy) NSString *pickUpLocationName;
@property (nonatomic, copy) NSString *dropOffLocationName;
@property (nonatomic, copy) NSString *pickUpDateTime;
@property (nonatomic, copy) NSString *returnDateTime;
@property (nonatomic, copy) NSString *pickUpLocationCode;
@property (nonatomic, copy) NSString *returnLocationCode;
@property (nonatomic, copy) NSString *driverAge;
@property (nonatomic, copy) NSString *passengerQty;
@property (nonatomic, copy) NSString *homeCountryCode;
@property (nonatomic, strong) UIView *footerView;
@property (nonatomic, strong) NSDate *theDateFromPicker;
@property (nonatomic, strong) NSMutableArray *preloadedCurrencyList;
@property (nonatomic, strong) NSMutableArray *preloadedLocations;
@property (nonatomic, strong) NSMutableArray *preloadedCountryList;
@property (nonatomic, weak) IBOutlet UIPickerView *countryPicker;
@property (nonatomic, weak) IBOutlet UIPickerView *currencyPicker;
@property (nonatomic, weak) IBOutlet UIView *headerView;
@property (nonatomic, strong) UIView *calendarView;
@property (nonatomic, weak) IBOutlet UIView *containerView;
@property (nonatomic, strong) IBOutlet UIView *pickerView;
@property (nonatomic, weak) IBOutlet UIView *alternateLocationFooterView;
@property (nonatomic, weak) IBOutlet UIView *selectLocationView;
@property (nonatomic, weak) IBOutlet UIView *countryPickerView;
@property (nonatomic, weak) IBOutlet UIView *currencyPickerView;
@property (nonatomic, weak) IBOutlet UIButton *alternativeBtn;
@property (nonatomic, weak) IBOutlet UILabel *dateDisplayLabel;
@property (nonatomic, weak) IBOutlet UILabel *pickerModeLabel;
@property (nonatomic, strong) UILabel *pickupDateLabel;
@property (nonatomic, strong) UILabel *dropoffDateLabel;
@property (nonatomic, weak) IBOutlet UITableView *searchTable;
@property (nonatomic, strong) UITextField *pickupTextField;
@property (nonatomic, strong) UITextField *dropoffTextField;
@property (nonatomic, strong) UITextField *ageTextField;
@property (nonatomic, strong) UITextField *numberOfPassengersTextField;
@property (assign) BOOL frontViewIsVisible;
@property (assign) BOOL alternateDrop;
@property (nonatomic, assign) BOOL showListNow;
@property (nonatomic, assign) BOOL canShowList;
@property (nonatomic, assign) BOOL pickupDateSet;
@property (nonatomic, assign) BOOL dropoffDateSet;
@property (nonatomic, assign) BOOL pickupLocationSet;
@property (nonatomic, assign) BOOL dropoffLocationSet;
@property (nonatomic, assign) BOOL isSettingPickup;
@property (nonatomic, assign) BOOL isSettingDropoff;
- (void) dismissCalendarAndPickerViews;
- (IBAction) clearData:(id)sender;
- (void)loadHomeCountryFromMemory;
- (void)processSelectedDates;
- (void)realignFieldInCell:(UIView*)field;
- (void)updateFieldColors;
- (void)saveUserPrefs;
- (void)loadUserPrefs;
- (void)updateAccessoryViewsInTableView;
- (void)showAccessoryTickForCell:(UITableViewCell*)cell withValue:(NSString*)value enabled:(BOOL)enabled;
- (void)showMapButtonPressed:(id)sender;
@end
|
/* Web Polygraph http://www.web-polygraph.org/
* Copyright 2003-2011 The Measurement Factory
* Licensed under the Apache License, Version 2.0 */
#ifndef POLYGRAPH__BASE_RNDPERMUT_H
#define POLYGRAPH__BASE_RNDPERMUT_H
#include <limits>
#include "xstd/LibInit.h"
// We often need to convert a number to some uncorrellated uniformly
// distributed random number. Using seed-and-trial approach with a r.n.g.
// does not work well if input stream of numbers is sequential and long.
// The permutator is also useful for seeding a r.n.g.
// Current permutation allows for a given [small] number of high quality
// random values. The size of the output set is a parameter.
class RndPermutator {
public:
RndPermutator(int setSize = 0);
~RndPermutator();
// changes the permutation set; expensive;
// can be called multiple times, any time
// using prime numbers for set size is recommended
void configure(int setSize, int seed = 1);
// set size remains unchanged, but contents changes
void reseed(int seed);
// use 2nd param if you need to map two numbers into one uniform var
int permut(const int64_t n, const int64_t m = 0) const;
protected:
inline void swap(int x, int y);
inline int item(const int64_t idx) const;
protected:
int *theTable; // good random numbers
int theTableCap;
};
// constant "offsets" to use as a second parameter to RndPermut
// when the first parameter is the same for a set of calls
enum { rndNone = 0, rndContentSel, rndUnused1,
rndContentPfx, rndContentExt,
rndBodyIter, rndInjTbdPos, rndInjOff, rndInjProb,
rndHotSetPos,
rndRepOlc, rndRepSize, rndRepCach, rndRepCheckNeed, rndCdbStart,
rndSharedContent, rndUniqueContent,
rndEmbedContType,
rndTwoWayPermutator,
rndMembershipRangeBeg,
rndArraySymSelector, rndPglSemxAssignment, rndPglSemxSelectItems,
rndPglSemxIsDistr, rndRobotSymReqInterArrival,
rndSslSeed, rndSslSessionCache,
rndCookieSend, rndCookieCount, rndCookieSize,
rndReqBody, rndWorldSel, rndProtocolSel, rndHttpHeaders,
rndRamFilesStart,
rndEnd
};
// generate one seeded r.n.g. per group
class RndGen;
class String;
extern RndGen *GlbRndGen(const String &group);
extern RndGen *LclRndGen(const String &group);
extern RndPermutator &LclPermut(); // each process gets its own rnd numbers
extern RndPermutator &GlbPermut(); // all processes share this set of numbers
inline
int LclPermut(const int64_t n, const int64_t m = 0) {
return LclPermut().permut(n, m);
}
inline
int GlbPermut(const int64_t n, const int64_t m = 0) {
return GlbPermut().permut(n, m);
}
/* inlined methods */
inline
void RndPermutator::swap(int x, int y) {
const int h = theTable[x];
theTable[x] = theTable[y];
theTable[y] = h;
}
inline
int RndPermutator::item(const int64_t idx) const {
return idx >= 0 ?
theTable[idx % theTableCap] :
theTable[(idx + numeric_limits<int64_t>::max()) % theTableCap];
}
LIB_INITIALIZER(RndPermutfInit)
#endif
|
//
// ViewController.h
// ServerManager
//
// Created by liangqi on 15/8/18.
// Copyright (c) 2015年 apptut. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface ViewController : NSViewController <WKScriptMessageHandler>
@end
|
/**
* @file target.c
* @brief Target information for the
*
* DAPLink Interface Firmware
* Copyright (c) 2017-2019, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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.
*/
#include "target_config.h"
#include "daplink_addr.h"
// The file flash_blob.c must only be included in target.c
#include "flash_blob.c"
/**
* List of start and size for each size of flash sector
* The size will apply to all sectors between the listed address and the next address
* in the list.
* The last pair in the list will have sectors starting at that address and ending
* at address start + size.
*/
static const sector_info_t sectors_info[] = {
{DAPLINK_ROM_IF_START, DAPLINK_SECTOR_SIZE},
};
target_cfg_t target_device = {
.sectors_info = sectors_info,
.sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)),
.flash_regions[0].start = DAPLINK_ROM_START,
.flash_regions[0].end = DAPLINK_ROM_START + DAPLINK_ROM_SIZE,
.flash_regions[0].flags = kRegionIsDefault,
.flash_regions[0].flash_algo= (program_target_t *) &flash,
.ram_regions[0].start = DAPLINK_RAM_APP_START,
.ram_regions[0].end = DAPLINK_RAM_APP_START + DAPLINK_RAM_APP_SIZE,
};
|
// NSString+Emoji.h
// XibaWeibo
//
// Created by bos on 15-6-11.
// Copyright (c) 2015年 axiba. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Emoji)
/**
* 将十六进制的编码转为emoji字符
*/
+ (NSString *)emojiWithIntCode:(int)intCode;
/**
* 将十六进制的编码转为emoji字符
*/
+ (NSString *)emojiWithStringCode:(NSString *)stringCode;
- (NSString *)emoji;
/**
* 是否为emoji字符
*/
- (BOOL)isEmoji;
@end
|
#ifndef SRC_PACKAGE_ALLABELDDATA_GPTYPE_H
#define SRC_PACKAGE_ALLABELDDATA_GPTYPE_H
class ALLabeldData_GPType:public IStatusType
{
public:
ALLabeldData_GPType():IStatusType("ALLabeldData"){}
virtual void* vLoad(GPStream* input) const
{
return NULL;
}
virtual void vSave(void* contents, GPWStream* output) const
{
}
virtual void vFree(void* contents) const
{
ALLabeldData* c = (ALLabeldData*)contents;
c->decRef();
}
virtual int vMap(void** content, double* value) const
{
int mapnumber=0;
if (NULL == value || NULL == content)
{
return mapnumber;
}
if (NULL == *content)
{
}
return mapnumber;
}
};
#endif
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2010-2011 by Omisememo, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#if defined(USE_TI_UIIPADPOPOVER) || defined(USE_TI_UIIPADSPLITWINDOW)
#import "TiViewProxy.h"
#import "TiViewController.h"
//The iPadPopoverProxy should be seen more as like a window or such, because
//The popover controller will contain the viewController, which has the view.
//If the view had the logic, you get some nasty dependency loops.
@interface TiUIiPadPopoverProxy : TiViewProxy<UIPopoverControllerDelegate,TiUIViewController> {
@private
UIPopoverController *popoverController;
UINavigationController *navigationController;
TiViewController *viewController;
//We need to hold onto this information for whenever the status bar rotates.
TiViewProxy *popoverView;
CGRect popoverRect;
BOOL animated;
UIPopoverArrowDirection directions;
BOOL isShowing;
BOOL isDismissing;
NSCondition* closingCondition;
}
//Because the Popover isn't meant to be placed in anywhere specific,
@property(nonatomic,readonly) UIPopoverController *popoverController;
@property(nonatomic,readwrite,retain) TiViewController *viewController;
@property(nonatomic,readwrite,retain) TiViewProxy *popoverView;
-(UINavigationController *)navigationController;
-(void)updatePopover:(NSNotification *)notification;
-(void)updatePopoverNow;
@end
#endif |
/**
* 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.
*/
#pragma once
#include "JSCJSValue.h"
#include "MacroAssemblerCodeRef.h"
#if ENABLE(JIT)
#if CALLING_CONVENTION_IS_STDCALL
#define HOST_CALL_RETURN_VALUE_OPTION CDECL
#else
#define HOST_CALL_RETURN_VALUE_OPTION
#endif
namespace JSC {
extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValue() REFERENCED_FROM_ASM WTF_INTERNAL;
#if COMPILER(GCC_OR_CLANG)
// This is a public declaration only to convince CLANG not to elide it.
extern "C" EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValueWithExecState(ExecState*) REFERENCED_FROM_ASM WTF_INTERNAL;
inline void initializeHostCallReturnValue()
{
getHostCallReturnValueWithExecState(0);
}
#else // COMPILER(GCC_OR_CLANG)
inline void initializeHostCallReturnValue() { }
#endif // COMPILER(GCC_OR_CLANG)
} // namespace JSC
#endif // ENABLE(JIT)
|
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "esp_err.h"
#include "esp_log.h"
#include "usb/usb_host.h"
#include "msc_host.h"
#include "msc_host_vfs.h"
#include "ffconf.h"
#include "ff.h"
#include "esp_vfs.h"
#include "errno.h"
#include "hal/usb_hal.h"
static const char* TAG = "example";
static QueueHandle_t app_queue;
static SemaphoreHandle_t ready_to_uninstall_usb;
static void msc_event_cb(const msc_host_event_t *event, void *arg)
{
if (event->event == MSC_DEVICE_CONNECTED) {
ESP_LOGI(TAG, "MSC device connected");
} else if (event->event == MSC_DEVICE_DISCONNECTED) {
ESP_LOGI(TAG, "MSC device disconnected");
}
xQueueSend(app_queue, event, 10);
}
static void print_device_info(msc_host_device_info_t *info)
{
const size_t megabyte = 1024 * 1024;
uint64_t capacity = ((uint64_t)info->sector_size * info->sector_count) / megabyte;
printf("Device info:\n");
printf("\t Capacity: %llu MB\n", capacity);
printf("\t Sector size: %u\n", info->sector_size);
printf("\t Sector count: %u\n", info->sector_count);
printf("\t PID: 0x%4X \n", info->idProduct);
printf("\t VID: 0x%4X \n", info->idVendor);
wprintf(L"\t iProduct: %S \n", info->iProduct);
wprintf(L"\t iManufacturer: %S \n", info->iManufacturer);
wprintf(L"\t iSerialNumber: %S \n", info->iSerialNumber);
}
static void file_operations(void)
{
const char *directory = "/usb/esp";
const char *file_path = "/usb/esp/test.txt";
struct stat s = {0};
bool directory_exists = stat(directory, &s) == 0;
if (!directory_exists) {
if (mkdir(directory, 0775) != 0) {
ESP_LOGE(TAG, "mkdir failed with errno: %s\n", strerror(errno));
}
}
ESP_LOGI(TAG, "Writing file");
FILE *f = fopen(file_path, "w");
if (f == NULL) {
ESP_LOGE(TAG, "Failed to open file for writing");
return;
}
fprintf(f, "Hello World!\n");
fclose(f);
ESP_LOGI(TAG, "Reading file");
f = fopen(file_path, "r");
if (f == NULL) {
ESP_LOGE(TAG, "Failed to open file for reading");
return;
}
char line[64];
fgets(line, sizeof(line), f);
fclose(f);
// strip newline
char *pos = strchr(line, '\n');
if (pos) {
*pos = '\0';
}
ESP_LOGI(TAG, "Read from file: '%s'", line);
}
// Handles common USB host library events
static void handle_usb_events(void *args)
{
while (1) {
uint32_t event_flags;
usb_host_lib_handle_events(portMAX_DELAY, &event_flags);
// Release devices once all clients has deregistered
if (event_flags & USB_HOST_LIB_EVENT_FLAGS_NO_CLIENTS) {
usb_host_device_free_all();
}
// Give ready_to_uninstall_usb semaphore to indicate that USB Host library
// can be deinitialized, and terminate this task.
if (event_flags & USB_HOST_LIB_EVENT_FLAGS_ALL_FREE) {
xSemaphoreGive(ready_to_uninstall_usb);
break;
}
}
vTaskDelete(NULL);
}
static uint8_t wait_for_msc_device(void)
{
msc_host_event_t app_event;
ESP_LOGI(TAG, "Waiting for USB stick to be connected");
xQueueReceive(app_queue, &app_event, portMAX_DELAY);
assert( app_event.event == MSC_DEVICE_CONNECTED );
return app_event.device.address;
}
void app_main(void)
{
msc_host_device_handle_t msc_device;
BaseType_t task_created;
ready_to_uninstall_usb = xSemaphoreCreateBinary();
app_queue = xQueueCreate(3, sizeof(msc_host_event_t));
assert(app_queue);
const usb_host_config_t host_config = {
.skip_phy_setup = false,
.intr_flags = ESP_INTR_FLAG_LEVEL1,
};
ESP_ERROR_CHECK( usb_host_install(&host_config) );
task_created = xTaskCreate(handle_usb_events, "usb_events", 2048, NULL, 2, NULL);
assert(task_created);
const msc_host_driver_config_t msc_config = {
.create_backround_task = true,
.task_priority = 5,
.stack_size = 2048,
.callback = msc_event_cb,
};
ESP_ERROR_CHECK( msc_host_install(&msc_config) );
uint8_t device_address = wait_for_msc_device();
ESP_ERROR_CHECK( msc_host_install_device(device_address, &msc_device) );
msc_host_print_descriptors(msc_device);
msc_host_device_info_t info;
ESP_ERROR_CHECK( msc_host_get_device_info(msc_device, &info) );
print_device_info(&info);
msc_host_vfs_handle_t vfs_handle;
const esp_vfs_fat_mount_config_t mount_config = {
.format_if_mount_failed = false,
.max_files = 3,
.allocation_unit_size = 1024,
};
ESP_ERROR_CHECK( msc_host_vfs_register(msc_device, "/usb", &mount_config, &vfs_handle) );
file_operations();
ESP_ERROR_CHECK( msc_host_vfs_unregister(vfs_handle) );
ESP_ERROR_CHECK( msc_host_uninstall_device(msc_device) );
ESP_ERROR_CHECK( msc_host_uninstall() );
xSemaphoreTake(ready_to_uninstall_usb, portMAX_DELAY);
ESP_ERROR_CHECK( usb_host_uninstall() );
ESP_LOGI(TAG, "Done");
}
|
// Copyright 2014 Intel Corporation All Rights Reserved
//
// Intel makes no representations about the suitability of this software for any purpose.
// THIS SOFTWARE IS PROVIDED ""AS IS."" INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES,
// EXPRESS OR IMPLIED, AND ALL LIABILITY, INCLUDING CONSEQUENTIAL AND OTHER INDIRECT DAMAGES,
// FOR THE USE OF THIS SOFTWARE, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PROPRIETARY
// RIGHTS, AND INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// Intel does not assume any responsibility for any errors which may appear in this software
// nor any responsibility to update it.
#pragma once
#include "simplexnoise1234.h"
// Very simple multi-octave simplex noise helper
// Returns noise in the range [0, 1] vs. the usual [-1, 1]
template <size_t N = 4>
class NoiseOctaves
{
private:
float mWeights[N];
float mWeightNorm;
public:
NoiseOctaves(float persistence = 0.5f)
{
float weightSum = 0.0f;
for (size_t i = 0; i < N; ++i) {
mWeights[i] = persistence;
weightSum += persistence;
persistence *= persistence;
}
mWeightNorm = 0.5f / weightSum; // Will normalize to [-0.5, 0.5]
}
// Returns [0, 1]
float operator()(float x, float y, float z) const
{
float r = 0.0f;
for (size_t i = 0; i < N; ++i) {
r += mWeights[i] * snoise3(x, y, z);
x *= 2.0f; y *= 2.0f; z *= 2.0f;
}
return r * mWeightNorm + 0.5f;
}
// Returns [0, 1]
float operator()(float x, float y, float z, float w) const
{
float r = 0.0f;
for (size_t i = 0; i < N; ++i) {
r += mWeights[i] * snoise4(x, y, z, w);
x *= 2.0f; y *= 2.0f; z *= 2.0f; w *= 2.0f;
}
return r * mWeightNorm + 0.5f;
}
}; |
#ifndef SHARKDB_NODE_COMMON_H
#define SHARKDB_NODE_COMMON_H
#ifndef SHARKDB_NODE_NS_BEGIN
#define SHARKDB_NODE_NS_BEGIN \
namespace sharkdb { \
namespace node {
#endif
#ifndef SHARKDB_NODE_NS_END
#define SHARKDB_NODE_NS_END \
} \
}
#endif
#include <cstdint>
#include <string>
#endif//SHARKDB_NODE_COMMON_H
|
//////////////////////////////////////////////////////////////////
//
// UIBarButtonItem+FTStyle.h
//
// Created by Dalton Cherry on 5/29/13.
// Copyright (c) 2013 basement Krew. All rights reserved.
//
//////////////////////////////////////////////////////////////////
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (FTStyle)
+(void)setFlatButtonColor:(UIColor*)color UI_APPEARANCE_SELECTOR;
+(void)setFlatButtonColor:(UIColor*)color whenContainedIn:(Class <UIAppearanceContainer>)containerClass, ... UI_APPEARANCE_SELECTOR;
-(void)setFlatColor:(UIColor*)color UI_APPEARANCE_SELECTOR;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/chime/Chime_EXPORTS.h>
#include <aws/chime/ChimeRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Chime
{
namespace Model
{
/**
*/
class AWS_CHIME_API DeleteVoiceConnectorStreamingConfigurationRequest : public ChimeRequest
{
public:
DeleteVoiceConnectorStreamingConfigurationRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DeleteVoiceConnectorStreamingConfiguration"; }
Aws::String SerializePayload() const override;
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline const Aws::String& GetVoiceConnectorId() const{ return m_voiceConnectorId; }
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline bool VoiceConnectorIdHasBeenSet() const { return m_voiceConnectorIdHasBeenSet; }
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline void SetVoiceConnectorId(const Aws::String& value) { m_voiceConnectorIdHasBeenSet = true; m_voiceConnectorId = value; }
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline void SetVoiceConnectorId(Aws::String&& value) { m_voiceConnectorIdHasBeenSet = true; m_voiceConnectorId = std::move(value); }
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline void SetVoiceConnectorId(const char* value) { m_voiceConnectorIdHasBeenSet = true; m_voiceConnectorId.assign(value); }
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline DeleteVoiceConnectorStreamingConfigurationRequest& WithVoiceConnectorId(const Aws::String& value) { SetVoiceConnectorId(value); return *this;}
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline DeleteVoiceConnectorStreamingConfigurationRequest& WithVoiceConnectorId(Aws::String&& value) { SetVoiceConnectorId(std::move(value)); return *this;}
/**
* <p>The Amazon Chime Voice Connector ID.</p>
*/
inline DeleteVoiceConnectorStreamingConfigurationRequest& WithVoiceConnectorId(const char* value) { SetVoiceConnectorId(value); return *this;}
private:
Aws::String m_voiceConnectorId;
bool m_voiceConnectorIdHasBeenSet;
};
} // namespace Model
} // namespace Chime
} // namespace Aws
|
/*
* drv.c
*
* Created on: 2016. 7. 13.
* Author: Baram, PBHP
*/
#include "drv_micros.h"
#include "variant.h"
TIM_HandleTypeDef TimHandle;
void drv_micros_init()
{
uint32_t uwPrescalerValue = 0;
__HAL_RCC_TIM5_CLK_ENABLE();
// Compute the prescaler value to have TIMx counter clock equal to 1Mh
uwPrescalerValue = (uint32_t)((SystemCoreClock / 2) / 1000000) - 1;
TimHandle.Instance = TIM5;
TimHandle.Init.Period = 0xFFFFFFFF;
TimHandle.Init.Prescaler = uwPrescalerValue;
TimHandle.Init.ClockDivision = 0;
TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
TimHandle.Init.RepetitionCounter = 0;
HAL_TIM_Base_Init(&TimHandle);
HAL_TIM_Base_Start(&TimHandle);
}
uint32_t drv_micros()
{
return TimHandle.Instance->CNT;
}
|
/* $NetBSD: dictionary.h,v 1.1.1.2 2006/02/06 18:14:03 wiz Exp $ */
// -*- C++ -*-
/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
groff is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with groff; see the file COPYING. If not, write to the Free Software
Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
// there is no distinction between name with no value and name with NULL value
// null names are not permitted (they will be ignored).
struct association {
symbol s;
void *v;
association() : v(0) {}
};
class dictionary;
class dictionary_iterator {
dictionary *dict;
int i;
public:
dictionary_iterator(dictionary &);
int get(symbol *, void **);
};
class dictionary {
int size;
int used;
double threshold;
double factor;
association *table;
void rehash(int);
public:
dictionary(int);
void *lookup(symbol s, void *v=0); // returns value associated with key
void *lookup(const char *);
// if second parameter not NULL, value will be replaced
void *remove(symbol);
friend class dictionary_iterator;
};
class object {
int rcount;
public:
object();
virtual ~object();
void add_reference();
void remove_reference();
};
class object_dictionary;
class object_dictionary_iterator {
dictionary_iterator di;
public:
object_dictionary_iterator(object_dictionary &);
int get(symbol *, object **);
};
class object_dictionary {
dictionary d;
public:
object_dictionary(int);
object *lookup(symbol nm);
void define(symbol nm, object *obj);
void rename(symbol oldnm, symbol newnm);
void remove(symbol nm);
int alias(symbol newnm, symbol oldnm);
friend class object_dictionary_iterator;
};
inline int object_dictionary_iterator::get(symbol *sp, object **op)
{
return di.get(sp, (void **)op);
}
|
/*
Copyright (c) 2010 Aldo J. Nunez
Licensed under the Apache License, Version 2.0.
See the LICENSE text file for details.
*/
#pragma once
#include "..\Exec\Types.h"
#include "..\Exec\Exec.h"
#include "..\Exec\Error.h"
#include "..\Exec\EventCallback.h"
#include "..\Exec\IProcess.h"
#include "..\Exec\IModule.h"
#include "..\Exec\Thread.h"
#include "..\Exec\Enumerator.h"
enum ExecEvent
{
ExecEvent_None,
ExecEvent_ProcessStart,
ExecEvent_ProcessExit,
ExecEvent_ThreadStart,
ExecEvent_ThreadExit,
ExecEvent_ModuleLoad,
ExecEvent_ModuleUnload,
ExecEvent_OutputString,
ExecEvent_LoadComplete,
ExecEvent_Exception,
ExecEvent_Breakpoint,
ExecEvent_StepComplete,
ExecEvent_AsyncBreakComplete,
ExecEvent_Error,
ExecEvent_Max
};
struct EventNode
{
ExecEvent Code;
uint32_t ThreadId;
EventNode()
: Code(ExecEvent_None),
ThreadId(0)
{
}
virtual ~EventNode() { }
};
struct ExceptionEventNode : public EventNode
{
bool FirstChance;
EXCEPTION_RECORD Exception;
ExceptionEventNode()
: FirstChance(false)
{
Code = ExecEvent_Exception;
memset(&Exception, 0, sizeof Exception);
}
};
struct ModuleLoadEventNode : public EventNode
{
RefPtr<IModule> Module;
ModuleLoadEventNode()
{
Code = ExecEvent_ModuleLoad;
}
};
struct ModuleUnloadEventNode : public EventNode
{
RefPtr<IModule> Module;
ModuleUnloadEventNode()
{
Code = ExecEvent_ModuleUnload;
}
};
struct OutputStringEventNode : public EventNode
{
std::wstring String;
OutputStringEventNode()
{
Code = ExecEvent_OutputString;
}
};
struct ErrorEventNode : public EventNode
{
IEventCallback::EventCode Event;
ErrorEventNode()
: Event(IEventCallback::Event_None)
{
Code = ExecEvent_Error;
}
};
struct ProcessExitEventNode : public EventNode
{
uint32_t ExitCode;
ProcessExitEventNode()
: ExitCode(0)
{
Code = ExecEvent_ProcessExit;
}
};
struct ThreadExitEventNode : public EventNode
{
uint32_t ExitCode;
ThreadExitEventNode()
: ExitCode(0)
{
Code = ExecEvent_ThreadExit;
}
};
struct BreakpointEventNode : public EventNode
{
Address Address;
BreakpointEventNode()
: Address(0)
{
Code = ExecEvent_Breakpoint;
}
};
typedef std::list< std::shared_ptr< EventNode > > EventList;
class EventCallbackBase : public IEventCallback
{
typedef std::map< Address, RefPtr<IModule> > ModuleMap;
long mRefCount;
Exec* mExec;
bool mVerbose;
bool mTrackEvents;
bool mTrackLastEvent;
EventList mEvents;
std::shared_ptr<EventNode> mLastEvent;
ModuleMap mModules;
RefPtr<IModule> mProcMod;
uint32_t mLastThreadId;
uint32_t mProcExitCode;
bool mLoadCompleted;
bool mProcExited;
bool mCanStepInFuncRetVal;
public:
EventCallbackBase();
void SetVerbose(bool value);
void SetCanStepInFunctionReturnValue(bool value);
void SetTrackEvents(bool value);
void SetTrackLastEvent(bool value);
void SetExec(Exec* exec);
Exec* GetExec();
RefPtr<IModule> GetProcessModule();
uint32_t GetLastThreadId();
const EventList& GetEvents();
void ClearEvents();
std::shared_ptr<EventNode> GetLastEvent();
bool GetLoadCompleted();
bool GetProcessExited();
uint32_t GetProcessExitCode();
virtual void AddRef();
virtual void Release();
virtual void OnProcessStart(IProcess* process);
virtual void OnProcessExit(IProcess* process, DWORD exitCode);
virtual void OnThreadStart(IProcess* process, Thread* thread);
virtual void OnThreadExit(IProcess* process, DWORD threadId, DWORD exitCode);
virtual void OnModuleLoad(IProcess* process, IModule* module);
virtual void OnModuleUnload(IProcess* process, Address baseAddr);
virtual void OnOutputString(IProcess* process, const wchar_t* outputString);
virtual void OnLoadComplete(IProcess* process, DWORD threadId);
virtual RunMode OnException(IProcess* process, DWORD threadId, bool firstChance, const EXCEPTION_RECORD* exceptRec);
virtual RunMode OnBreakpoint(IProcess* process, uint32_t threadId, Address address, bool embedded);
virtual void OnStepComplete(IProcess* process, uint32_t threadId);
virtual void OnAsyncBreakComplete(IProcess* process, uint32_t threadId);
virtual void OnError(IProcess* process, HRESULT hrErr, EventCode event);
virtual ProbeRunMode OnCallProbe(
IProcess* process, uint32_t threadId, Address address, AddressRange& thunkRange);
void PrintCallstacksX86(IProcess* process);
void PrintCallstacksX64(IProcess* process);
private:
void TrackEvent(const std::shared_ptr<EventNode>& node);
};
const char* GetEventName(ExecEvent event);
|
/*
* Support functions for Wine exception handling
*
* Copyright (c) 1999, 2010 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "winternl.h"
#include "wine/exception.h"
#if defined(__x86_64__) && defined(__ASM_GLOBAL_FUNC)
extern void __wine_unwind_trampoline(void);
/* we need an extra call to make sure the stack is correctly aligned */
__ASM_GLOBAL_FUNC( __wine_unwind_trampoline, "callq *%rax" );
#endif
/* wrapper for RtlUnwind since it clobbers registers on Windows */
void __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame, EXCEPTION_RECORD *record,
void (*target)(void) )
{
#if defined(__GNUC__) && defined(__i386__)
int dummy1, dummy2, dummy3, dummy4;
__asm__ __volatile__("pushl %%ebp\n\t"
"pushl %%ebx\n\t"
"pushl $0\n\t"
"pushl %3\n\t"
"pushl %2\n\t"
"pushl %1\n\t"
"call *%0\n\t"
"popl %%ebx\n\t"
"popl %%ebp"
: "=a" (dummy1), "=S" (dummy2), "=D" (dummy3), "=c" (dummy4)
: "0" (RtlUnwind), "1" (frame), "2" (target), "3" (record)
: "edx", "memory" );
#elif defined(__x86_64__) && defined(__ASM_GLOBAL_FUNC)
RtlUnwind( frame, __wine_unwind_trampoline, record, target );
#else
RtlUnwind( frame, target, record, 0 );
#endif
for (;;) target();
}
static void DECLSPEC_NORETURN unwind_target(void)
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)__wine_get_frame();
__wine_pop_frame( &wine_frame->frame );
siglongjmp( wine_frame->jmp, 1 );
}
static void DECLSPEC_NORETURN unwind_frame( EXCEPTION_RECORD *record,
EXCEPTION_REGISTRATION_RECORD *frame )
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
/* hack to make GetExceptionCode() work in handler */
wine_frame->ExceptionCode = record->ExceptionCode;
wine_frame->ExceptionRecord = wine_frame;
__wine_rtl_unwind( frame, record, unwind_target );
}
DWORD __wine_exception_handler( EXCEPTION_RECORD *record,
EXCEPTION_REGISTRATION_RECORD *frame,
CONTEXT *context,
EXCEPTION_REGISTRATION_RECORD **pdispatcher )
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
EXCEPTION_POINTERS ptrs;
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
return ExceptionContinueSearch;
ptrs.ExceptionRecord = record;
ptrs.ContextRecord = context;
switch(wine_frame->u.filter( &ptrs ))
{
case EXCEPTION_CONTINUE_SEARCH:
return ExceptionContinueSearch;
case EXCEPTION_CONTINUE_EXECUTION:
return ExceptionContinueExecution;
case EXCEPTION_EXECUTE_HANDLER:
break;
}
unwind_frame( record, frame );
}
DWORD __wine_exception_handler_page_fault( EXCEPTION_RECORD *record,
EXCEPTION_REGISTRATION_RECORD *frame,
CONTEXT *context,
EXCEPTION_REGISTRATION_RECORD **pdispatcher )
{
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
return ExceptionContinueSearch;
if (record->ExceptionCode != STATUS_ACCESS_VIOLATION)
return ExceptionContinueSearch;
unwind_frame( record, frame );
}
DWORD __wine_exception_handler_all( EXCEPTION_RECORD *record,
EXCEPTION_REGISTRATION_RECORD *frame,
CONTEXT *context,
EXCEPTION_REGISTRATION_RECORD **pdispatcher )
{
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
return ExceptionContinueSearch;
unwind_frame( record, frame );
}
DWORD __wine_finally_handler( EXCEPTION_RECORD *record,
EXCEPTION_REGISTRATION_RECORD *frame,
CONTEXT *context,
EXCEPTION_REGISTRATION_RECORD **pdispatcher )
{
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
wine_frame->u.finally_func( FALSE );
}
return ExceptionContinueSearch;
}
|
/*
*
* Copyright 2015 Berin Lautenbach
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// DLL Logging functions
BOOLEAN authme_open_log(PCRITICAL_SECTION pDllLogCriticalSection, PWSTR filename);
BOOLEAN authme_close_log(void);
int authme_log(const char *format, ...);
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Collections.Generic.Stack`1<System.Collections.Generic.List`1<UnityEngine.Color32>>
struct Stack_1_t770632868;
// UnityEngine.Events.UnityAction`1<System.Collections.Generic.List`1<UnityEngine.Color32>>
struct UnityAction_1_t1861219243;
#include "mscorlib_System_Object4170816371.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.UI.ObjectPool`1<System.Collections.Generic.List`1<UnityEngine.Color32>>
struct ObjectPool_1_t1766627365 : public Il2CppObject
{
public:
// System.Collections.Generic.Stack`1<T> UnityEngine.UI.ObjectPool`1::m_Stack
Stack_1_t770632868 * ___m_Stack_0;
// UnityEngine.Events.UnityAction`1<T> UnityEngine.UI.ObjectPool`1::m_ActionOnGet
UnityAction_1_t1861219243 * ___m_ActionOnGet_1;
// UnityEngine.Events.UnityAction`1<T> UnityEngine.UI.ObjectPool`1::m_ActionOnRelease
UnityAction_1_t1861219243 * ___m_ActionOnRelease_2;
// System.Int32 UnityEngine.UI.ObjectPool`1::<countAll>k__BackingField
int32_t ___U3CcountAllU3Ek__BackingField_3;
public:
inline static int32_t get_offset_of_m_Stack_0() { return static_cast<int32_t>(offsetof(ObjectPool_1_t1766627365, ___m_Stack_0)); }
inline Stack_1_t770632868 * get_m_Stack_0() const { return ___m_Stack_0; }
inline Stack_1_t770632868 ** get_address_of_m_Stack_0() { return &___m_Stack_0; }
inline void set_m_Stack_0(Stack_1_t770632868 * value)
{
___m_Stack_0 = value;
Il2CppCodeGenWriteBarrier(&___m_Stack_0, value);
}
inline static int32_t get_offset_of_m_ActionOnGet_1() { return static_cast<int32_t>(offsetof(ObjectPool_1_t1766627365, ___m_ActionOnGet_1)); }
inline UnityAction_1_t1861219243 * get_m_ActionOnGet_1() const { return ___m_ActionOnGet_1; }
inline UnityAction_1_t1861219243 ** get_address_of_m_ActionOnGet_1() { return &___m_ActionOnGet_1; }
inline void set_m_ActionOnGet_1(UnityAction_1_t1861219243 * value)
{
___m_ActionOnGet_1 = value;
Il2CppCodeGenWriteBarrier(&___m_ActionOnGet_1, value);
}
inline static int32_t get_offset_of_m_ActionOnRelease_2() { return static_cast<int32_t>(offsetof(ObjectPool_1_t1766627365, ___m_ActionOnRelease_2)); }
inline UnityAction_1_t1861219243 * get_m_ActionOnRelease_2() const { return ___m_ActionOnRelease_2; }
inline UnityAction_1_t1861219243 ** get_address_of_m_ActionOnRelease_2() { return &___m_ActionOnRelease_2; }
inline void set_m_ActionOnRelease_2(UnityAction_1_t1861219243 * value)
{
___m_ActionOnRelease_2 = value;
Il2CppCodeGenWriteBarrier(&___m_ActionOnRelease_2, value);
}
inline static int32_t get_offset_of_U3CcountAllU3Ek__BackingField_3() { return static_cast<int32_t>(offsetof(ObjectPool_1_t1766627365, ___U3CcountAllU3Ek__BackingField_3)); }
inline int32_t get_U3CcountAllU3Ek__BackingField_3() const { return ___U3CcountAllU3Ek__BackingField_3; }
inline int32_t* get_address_of_U3CcountAllU3Ek__BackingField_3() { return &___U3CcountAllU3Ek__BackingField_3; }
inline void set_U3CcountAllU3Ek__BackingField_3(int32_t value)
{
___U3CcountAllU3Ek__BackingField_3 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/**
* Copyright (c) 2016 Abhishek Chawla <abhidtu@gmail.com>
*
* 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 MAXHEAP_H
#define MAXHEAP_H
#include "../D_ary_Heap.h"
namespace altrusian {
namespace Heaps {
namespace D_Ary_Heap {
class MaxHeap : public D_ary_Heap {
protected:
bool isCapableToShiftUp(long int const &keyIndex);
bool isCapableToShiftDown(long int const &keyIndex);
long int maxChildIndex(long int const &keyIndex);
public:
MaxHeap(int d) { this->d = d; }
MaxHeap(int d, std::vector<int> &vec) {
this->d = d;
vector = vec;
heapify();
}
static Heap* mergeHeaps(Heap *heap1, Heap *heap2, int d);
};
}
}
}
#endif //MAXHEAP_H
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/dynamodb/DynamoDB_EXPORTS.h>
#include <aws/dynamodb/model/TableDescription.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace DynamoDB
{
namespace Model
{
/**
* <p>Represents the output of a <i>CreateTable</i> operation.</p>
*/
class AWS_DYNAMODB_API CreateTableResult
{
public:
CreateTableResult();
CreateTableResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
CreateTableResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
inline const TableDescription& GetTableDescription() const{ return m_tableDescription; }
inline void SetTableDescription(const TableDescription& value) { m_tableDescription = value; }
inline void SetTableDescription(TableDescription&& value) { m_tableDescription = value; }
inline CreateTableResult& WithTableDescription(const TableDescription& value) { SetTableDescription(value); return *this;}
inline CreateTableResult& WithTableDescription(TableDescription&& value) { SetTableDescription(value); return *this;}
private:
TableDescription m_tableDescription;
};
} // namespace Model
} // namespace DynamoDB
} // namespace Aws
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import "TiUIView.h"
#ifdef USE_TI_UIIOSADVIEW
#import "TiUIiOSAdViewProxy.h"
#import <iAd/iAd.h>
@interface TiUIiOSAdView : TiUIView<ADBannerViewDelegate> {
@private
ADBannerView *adview;
}
@property (nonatomic, readonly) ADBannerView* adview;
#pragma mark - Poelsevognen Internal Use
-(CGFloat)contentHeightForWidth:(CGFloat)value;
-(CGFloat)contentWidthForWidth:(CGFloat)value;
@end
#endif
|
/*
* Copyright 2018 GIG Technology NV
*
* 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.
*
* @@license_version:1.4@@
*/
@interface MCTMessageTextView : UITextView
@property (nonatomic, strong) UIView *touchDelegate;
@end
|
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
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 SHINY_NODE_POOL_H
#define SHINY_NODE_POOL_H
#include "ShinyNode.h"
#if SHINY_IS_COMPILED == TRUE
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct _ShinyNodePool {
struct _ShinyNodePool* nextPool;
ShinyNode *_nextItem;
ShinyNode *endOfItems;
ShinyNode _items[1];
} ShinyNodePool;
/*---------------------------------------------------------------------------*/
SHINY_INLINE ShinyNode* ShinyNodePool_firstItem(ShinyNodePool *self) {
return &(self->_items[0]);
}
SHINY_INLINE ShinyNode* ShinyNodePool_newItem(ShinyNodePool *self) {
return self->_nextItem++;
}
ShinyNodePool* ShinyNodePool_create(uint32_t a_items);
void ShinyNodePool_destroy(ShinyNodePool *self);
uint32_t ShinyNodePool_memoryUsageChain(ShinyNodePool *first);
#ifdef __cplusplus
} /* end of extern "C" */
#endif
#endif /* if SHINY_IS_COMPILED == TRUE */
#endif /* end of include guard */
|
//
// MONRecommendCategory.h
// 01-百思不得姐
//
// Created by DAC on 16-8-5.
// Copyright (c) 2016年 DAC. All rights reserved.
// 推荐关注左边的数据模型
#import <Foundation/Foundation.h>
@interface MONRecommendCategory : NSObject
/** id */
@property (nonatomic,assign) NSInteger id;
/** 总数 */
@property (nonatomic,assign) NSInteger count;
/** 名字 */
@property (nonatomic,copy) NSString *name;
/** 这个类别对应的用户数据 */
@property (nonatomic,strong) NSMutableArray *users;
/** 总数 */
@property (nonatomic,assign) NSInteger total;
/** 当前页码 */
@property (nonatomic,assign) NSInteger currentPage;
@end
|
// Copyright 2022 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SCANN_DATA_FORMAT_SPARSE_LOW_LEVEL_H_
#define SCANN_DATA_FORMAT_SPARSE_LOW_LEVEL_H_
#include "scann/utils/types.h"
namespace research_scann {
template <typename IndexT, typename ValueT>
struct SparseLowLevelDatapoint {
SparseLowLevelDatapoint(IndexT* indices, ValueT* values,
DimensionIndex nonzero_entries)
: indices(indices), values(values), nonzero_entries(nonzero_entries) {}
IndexT* indices = nullptr;
ValueT* values = nullptr;
DimensionIndex nonzero_entries = 0;
};
template <typename IndexT, typename ValueT, typename StartOffsetT = size_t>
class SparseDatasetLowLevel {
public:
SparseDatasetLowLevel() {}
SparseDatasetLowLevel(std::vector<IndexT> indices, std::vector<ValueT> values,
std::vector<StartOffsetT> start_offsets)
: indices_(std::move(indices)),
values_(std::move(values)),
start_offsets_(std::move(start_offsets)) {
if (!values_.empty()) {
CHECK_EQ(values_.size(), indices_.size());
}
if (!indices_.empty()) {
CHECK_GE(start_offsets_.size(), 2);
}
}
void Append(ConstSpan<IndexT> indices, ConstSpan<ValueT> values) {
if (!values.empty() || !values_.empty()) {
DCHECK_EQ(indices.size(), values.size());
}
indices_.insert(indices_.end(), indices.begin(), indices.end());
values_.insert(values_.end(), values.begin(), values.end());
CHECK_LE(indices_.size(), numeric_limits<StartOffsetT>::max());
start_offsets_.push_back(indices_.size());
}
void PopBack() {
DCHECK_GT(start_offsets_.size(), 1);
start_offsets_.pop_back();
indices_.resize(start_offsets_.back());
if (!values_.empty()) values_.resize(indices_.size());
}
SparseLowLevelDatapoint<IndexT, ValueT> Get(size_t i) {
DCHECK_LT(i + 1, start_offsets_.size());
const size_t end_offset = start_offsets_[i + 1];
const size_t start_offset = start_offsets_[i];
const DimensionIndex nonzero_entries = end_offset - start_offset;
ValueT* values_ptr =
(values_.empty()) ? nullptr : (values_.data() + start_offset);
return SparseLowLevelDatapoint<IndexT, ValueT>(
indices_.data() + start_offset, values_ptr, nonzero_entries);
}
DimensionIndex NonzeroEntriesForDatapoint(size_t i) const {
DCHECK_LT(i + 1, start_offsets_.size());
return start_offsets_[i + 1] - start_offsets_[i];
}
ConstSpan<IndexT> indices() const { return indices_; }
ConstSpan<ValueT> values() const { return values_; }
ConstSpan<StartOffsetT> start_offsets() const { return start_offsets_; }
void Reserve(size_t n_points) { start_offsets_.reserve(n_points + 1); }
void Reserve(size_t n_points, size_t n_entries) {
ReserveForBinaryData(n_points, n_entries);
values_.reserve(n_entries);
}
void ReserveForBinaryData(size_t n_points, size_t n_entries) {
Reserve(n_points);
indices_.reserve(n_entries);
}
void Clear() {
FreeBackingStorage(&indices_);
FreeBackingStorage(&values_);
FreeBackingStorage(&start_offsets_);
start_offsets_ = {0};
}
void ShrinkToFit() {
start_offsets_.shrink_to_fit();
if (indices_.size() * sizeof(indices_[0]) <
values_.size() * sizeof(values_[0])) {
indices_.shrink_to_fit();
values_.shrink_to_fit();
} else {
values_.shrink_to_fit();
indices_.shrink_to_fit();
}
}
size_t MemoryUsage() const {
return sizeof(ValueT) * values_.capacity() +
sizeof(IndexT) * indices_.capacity() +
sizeof(StartOffsetT) * start_offsets_.capacity();
}
void Prefetch(size_t i) const {
const StartOffsetT start_offset = start_offsets_[i];
::tensorflow::port::prefetch<::tensorflow::port::PREFETCH_HINT_NTA>(
reinterpret_cast<const char*>(indices_.data() + start_offset));
::tensorflow::port::prefetch<::tensorflow::port::PREFETCH_HINT_NTA>(
reinterpret_cast<const char*>(values_.data() + start_offset));
}
size_t size() const { return start_offsets_.size() - 1; }
private:
std::vector<IndexT> indices_;
std::vector<ValueT> values_;
std::vector<StartOffsetT> start_offsets_ = {0};
};
} // namespace research_scann
#endif
|
#ifndef QCEASINGCURVE_H
#define QCEASINGCURVE_H
#include <QObject>
#include <QVariant>
#include <QJSValue>
#include <QQmlEngine>
/// QML Wrapper of QEasingCurve
class QCEasingCurve : public QObject
{
Q_OBJECT
Q_ENUMS(Type)
public:
explicit QCEasingCurve(QObject *parent = 0);
enum Type {
Linear,
InQuad,
OutQuad,
InOutQuad,
OutInQuad,
InCubic,
OutCubic,
InOutCubic,
OutInCubic,
InQuart,
OutQuart,
InOutQuart,
OutInQuart,
InQuint,
OutQuint,
InOutQuint,
OutInQuint,
InSine,
OutSine,
InOutSine,
OutInSine,
InExpo,
OutExpo,
InOutExpo,
OutInExpo,
InCirc,
OutCirc,
InOutCirc,
OutInCirc,
InElastic, OutElastic, InOutElastic, OutInElastic,
InBack, OutBack, InOutBack, OutInBack,
InBounce, OutBounce, InOutBounce, OutInBounce,
InCurve, OutCurve, SineCurve, CosineCurve,
BezierSpline, TCBSpline, Custom, NCurveTypes
};
QQmlEngine *engine() const;
void setEngine(QQmlEngine *engine);
signals:
public slots:
QVariant _createValue(Type type = Linear);
QJSValue create(Type type = Linear);
qreal valueForProgress(QJSValue easingCurve, qreal progress);
private:
QQmlEngine* m_engine;
QJSValue creator;
};
#endif // QCEASINGCURVE_H
|
/*
*file name : public.h
*des :
*date : 2013-10-21
*author : liwq (286570361)
*notes :
* 2013-10-21 liwq create files
* 2013-10-29 liwq add function:getsubstr,getstrnum,strreplace
* 2013-11-04 liwq add function:strrstr
*/
/**********************************************************/
#ifndef __PUBLIC_H__
#define __PUBLIC_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#define STRLEN 1024
/*********
*ÊØ»¤½ø³Ì·½Ê½
*
***************************************/
void daemonInit(void);
/**********
*ÅжÏ×Ö·û´®ÊÇ·ñ¶¼ÎªÊý×Ö
*
***************************************/
int isNumber(char * sNumber);
/*********
*ÌÞ³ý×Ö·û´®×ó±ßµÄ¿Õ¸ñÖÆ±í·ûµÈ
*
***************************************/
char* ltrim(char *s);
/*********
*ÌÞ³ý×Ö·û´®ÓұߵĿոñÖÆ±í·ûµÈ
***************************************/
char* rtrim(char *s);
/*********
*ÌÞ³ý×Ö·û´®×óÓҵĿոñÖÆ±í·ûµÈ
***************************************/
char* trim(char *s);
/*********
*ȡϵͳʱ¼ä£¬¸ñʽ£ºYYYYMMDDHH24MISS
***************************************/
char* getSysDate(char * sysDate);
/*********
*ÊÇ·ñΪºÏ·¨ÈÕÆÚYYYYMMDD
***************************************/
int isRightfulDate(char * sDate);
//ÅжÏÊÇ·ñΪºÏ·¨Ê±¼ähh24miss
int isTime(char * sTime);
//ÅжÏÊÇ·ñΪºÏ·¨ÈÕÆÚ´®yyyymmddhh24miss
int isDatetime(const char * sDatetime);
//14λ×Ö·û´®Ê±¼ä´Ó1970Äê1ÔÂ1ÈÕ00ʱ00·Ö00ÃëËù¾¹ýµÄÃëÊý
long time2sec(const char *src);
//14λ×Ö·û´®ÃëÊý²îÖµ
long diffsec(const char *src1, const char *src2);
//×Öĸת»»Îª´óд
char* strupr(char * lwrstr);
//×Öĸת»»ÎªÐ¡Ð´
char* strlwr(char * lwrstr);
//¼òµ¥²»¶Ô³Æ¼ÓÃܽâÃÜ
char* cryptStr(char * oStr,char * sStr);
//·ÖÀëÎļþȫ·¾¶µÄ·¾¶ÃûºÍÎļþÃû
int getExePathAndName( const char *in_ptrArgv0,char *out_exename, char *out_exepath);
//»ñµÃ×Ó´®£¬spÊÇ·Ö¸ô×Ó·û£¬n ±íʾµÚn¸ö×Ó´®(´Ó1¿ªÊ¼¼ÆÊý)£¬substr´æ·Å»ñµÃµÄ×Ó´®
void getsubstr(char *str, char sp, int n, char *substr);
//·µ»ØÄ¿±ê×Ö·û´®ÖÐ×Ó´®µÄ¸öÊý
int getstrnum(char *dest ,char *searchstr);
//Ìæ»»Ä¿±ê×Ö·û´®ÖеÄ×Ó´®
int strreplace(char *dest,char *searchstr,char *replacestr);
//·µ»ØÄ¿±ê×Ö·û´®ÖÐ×îºóÒ»¸ö×Ó´®µÄÖ¸Õë
char *strrstr(const char *str1,const char *str2);
//½ØÈ¡×Ö·û´®£¬·µ»Ø×Ó´®
int substr(char *pDes, const char *pSrc, int begin, int len);
#endif /*__PUBLIC_H__*/
|
//
// TUOperationQueueSchedulerFactory.h
//
// Copyright (c) 2014 Tuenti Technologies S.L. 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.
//
#import <Foundation/Foundation.h>
#import "TUSchedulerFactory.h"
@interface TUOperationQueueSchedulerFactory : NSObject <TUSchedulerFactory>
@end
|
#ifndef UTILS_MAC_H
#define UTILS_MAC_H
#include "Converters.h"
#include <Foundation/Foundation.h>
#include <QUrl>
// This file can only be #include-d from .mm files
static inline NSString* fromQBA(const QByteArray& ba) {
const char* cData = ba.constData();
return [[NSString alloc] initWithUTF8String:cData];
}
static inline NSURL* fromQUrl(const QUrl& url) {
const QByteArray utf8 = url.toEncoded();
return [NSURL URLWithString:fromQBA(utf8)];
}
static inline QUrl toQUrl(NSURL* url) {
if (!url)
return QUrl();
return QUrl::fromEncoded(toQString([url absoluteString]).toUtf8());
}
static inline QByteArray fromNSData(NSData *data) {
if (!data) {
return QByteArray();
}
QByteArray qData;
qData.resize([data length]);
[data getBytes:qData.data() length: qData.size()];
return qData;
}
#endif
|
// 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 PARQUET_UTIL_VISIBILITY_H
#define PARQUET_UTIL_VISIBILITY_H
#if defined(_WIN32) || defined(__CYGWIN__)
#define PARQUET_EXPORT __declspec(dllexport)
#else // Not Windows
#ifndef PARQUET_EXPORT
#define PARQUET_EXPORT __attribute__((visibility("default")))
#endif
#ifndef PARQUET_NO_EXPORT
#define PARQUET_NO_EXPORT __attribute__((visibility("hidden")))
#endif
#endif // Non-Windows
#endif // PARQUET_UTIL_VISIBILITY_H
|
//
// NSFont+KDIExtensions.h
// Ditko-macOS
//
// Created by William Towe on 3/15/18.
// Copyright © 2021 Kosoku Interactive, LLC. 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.
#import <Cocoa/Cocoa.h>
@interface NSFont (KDIExtensions)
/**
Returns a character set containing all characters in the receiver.
*/
@property (readonly,nonatomic) NSCharacterSet *KDI_characterSet;
/**
Attempts to register fonts from the specified URL, returning YES if successful, otherwise NO and an error by reference.
@param URL The URL for which to register fonts
@error The error to return by reference
@return YES if the fonts were registered, otherwise NO
*/
+ (BOOL)KDI_registerFontsForURL:(NSURL *)URL error:(NSError **)error;
@end
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.IO.TextWriter
struct TextWriter_t2304124208;
// System.IO.TextReader
struct TextReader_t2148718976;
// System.Text.Encoding
struct Encoding_t2012439129;
#include "mscorlib_System_Object4170816371.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Console
struct Console_t1363597357 : public Il2CppObject
{
public:
public:
};
struct Console_t1363597357_StaticFields
{
public:
// System.IO.TextWriter System.Console::stdout
TextWriter_t2304124208 * ___stdout_0;
// System.IO.TextWriter System.Console::stderr
TextWriter_t2304124208 * ___stderr_1;
// System.IO.TextReader System.Console::stdin
TextReader_t2148718976 * ___stdin_2;
// System.Text.Encoding System.Console::inputEncoding
Encoding_t2012439129 * ___inputEncoding_3;
// System.Text.Encoding System.Console::outputEncoding
Encoding_t2012439129 * ___outputEncoding_4;
public:
inline static int32_t get_offset_of_stdout_0() { return static_cast<int32_t>(offsetof(Console_t1363597357_StaticFields, ___stdout_0)); }
inline TextWriter_t2304124208 * get_stdout_0() const { return ___stdout_0; }
inline TextWriter_t2304124208 ** get_address_of_stdout_0() { return &___stdout_0; }
inline void set_stdout_0(TextWriter_t2304124208 * value)
{
___stdout_0 = value;
Il2CppCodeGenWriteBarrier(&___stdout_0, value);
}
inline static int32_t get_offset_of_stderr_1() { return static_cast<int32_t>(offsetof(Console_t1363597357_StaticFields, ___stderr_1)); }
inline TextWriter_t2304124208 * get_stderr_1() const { return ___stderr_1; }
inline TextWriter_t2304124208 ** get_address_of_stderr_1() { return &___stderr_1; }
inline void set_stderr_1(TextWriter_t2304124208 * value)
{
___stderr_1 = value;
Il2CppCodeGenWriteBarrier(&___stderr_1, value);
}
inline static int32_t get_offset_of_stdin_2() { return static_cast<int32_t>(offsetof(Console_t1363597357_StaticFields, ___stdin_2)); }
inline TextReader_t2148718976 * get_stdin_2() const { return ___stdin_2; }
inline TextReader_t2148718976 ** get_address_of_stdin_2() { return &___stdin_2; }
inline void set_stdin_2(TextReader_t2148718976 * value)
{
___stdin_2 = value;
Il2CppCodeGenWriteBarrier(&___stdin_2, value);
}
inline static int32_t get_offset_of_inputEncoding_3() { return static_cast<int32_t>(offsetof(Console_t1363597357_StaticFields, ___inputEncoding_3)); }
inline Encoding_t2012439129 * get_inputEncoding_3() const { return ___inputEncoding_3; }
inline Encoding_t2012439129 ** get_address_of_inputEncoding_3() { return &___inputEncoding_3; }
inline void set_inputEncoding_3(Encoding_t2012439129 * value)
{
___inputEncoding_3 = value;
Il2CppCodeGenWriteBarrier(&___inputEncoding_3, value);
}
inline static int32_t get_offset_of_outputEncoding_4() { return static_cast<int32_t>(offsetof(Console_t1363597357_StaticFields, ___outputEncoding_4)); }
inline Encoding_t2012439129 * get_outputEncoding_4() const { return ___outputEncoding_4; }
inline Encoding_t2012439129 ** get_address_of_outputEncoding_4() { return &___outputEncoding_4; }
inline void set_outputEncoding_4(Encoding_t2012439129 * value)
{
___outputEncoding_4 = value;
Il2CppCodeGenWriteBarrier(&___outputEncoding_4, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
//
// BufferedStreamBuf.h
//
// Library: Foundation
// Package: Streams
// Module: StreamBuf
//
// Definition of template BasicBufferedStreamBuf and class BufferedStreamBuf.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_BufferedStreamBuf_INCLUDED
#define Foundation_BufferedStreamBuf_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/BufferAllocator.h"
#include "Poco/StreamUtil.h"
#include <streambuf>
#include <iosfwd>
#include <ios>
namespace Poco {
template <typename ch, typename tr, typename ba = BufferAllocator<ch>>
class BasicBufferedStreamBuf: public std::basic_streambuf<ch, tr>
/// This is an implementation of a buffered streambuf
/// that greatly simplifies the implementation of
/// custom streambufs of various kinds.
/// Derived classes only have to override the methods
/// readFromDevice() or writeToDevice().
///
/// This streambuf only supports unidirectional streams.
/// In other words, the BasicBufferedStreamBuf can be
/// used for the implementation of an istream or an
/// ostream, but not for an iostream.
{
protected:
typedef std::basic_streambuf<ch, tr> Base;
typedef std::basic_ios<ch, tr> IOS;
typedef ch char_type;
typedef tr char_traits;
typedef ba Allocator;
typedef typename Base::int_type int_type;
typedef typename Base::pos_type pos_type;
typedef typename Base::off_type off_type;
typedef typename IOS::openmode openmode;
public:
BasicBufferedStreamBuf(std::streamsize bufferSize, openmode mode):
_bufsize(bufferSize),
_pBuffer(Allocator::allocate(_bufsize)),
_mode(mode)
{
this->setg(_pBuffer + 4, _pBuffer + 4, _pBuffer + 4);
this->setp(_pBuffer, _pBuffer + _bufsize);
}
~BasicBufferedStreamBuf()
{
try
{
Allocator::deallocate(_pBuffer, _bufsize);
}
catch (...)
{
poco_unexpected();
}
}
virtual int_type overflow(int_type c)
{
if (!(_mode & IOS::out)) return char_traits::eof();
if (flushBuffer() == std::streamsize(-1)) return char_traits::eof();
if (c != char_traits::eof())
{
*this->pptr() = char_traits::to_char_type(c);
this->pbump(1);
}
return c;
}
virtual int_type underflow()
{
if (!(_mode & IOS::in)) return char_traits::eof();
if (this->gptr() && (this->gptr() < this->egptr()))
return char_traits::to_int_type(*this->gptr());
int putback = int(this->gptr() - this->eback());
if (putback > 4) putback = 4;
char_traits::move(_pBuffer + (4 - putback), this->gptr() - putback, putback);
int n = readFromDevice(_pBuffer + 4, _bufsize - 4);
if (n <= 0) return char_traits::eof();
this->setg(_pBuffer + (4 - putback), _pBuffer + 4, _pBuffer + 4 + n);
// return next character
return char_traits::to_int_type(*this->gptr());
}
virtual int sync()
{
if (this->pptr() && this->pptr() > this->pbase())
{
if (flushBuffer() == -1) return -1;
}
return 0;
}
protected:
void setMode(openmode mode)
{
_mode = mode;
}
openmode getMode() const
{
return _mode;
}
private:
virtual int readFromDevice(char_type* /*buffer*/, std::streamsize /*length*/)
{
return 0;
}
virtual int writeToDevice(const char_type* /*buffer*/, std::streamsize /*length*/)
{
return 0;
}
int flushBuffer()
{
int n = int(this->pptr() - this->pbase());
if (writeToDevice(this->pbase(), n) == n)
{
this->pbump(-n);
return n;
}
return -1;
}
std::streamsize _bufsize;
char_type* _pBuffer;
openmode _mode;
BasicBufferedStreamBuf(const BasicBufferedStreamBuf&);
BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&);
};
//
// We provide an instantiation for char.
//
// Visual C++ needs a workaround - explicitly importing the template
// instantiation - to avoid duplicate symbols due to multiple
// instantiations in different libraries.
//
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char>>;
#endif
typedef BasicBufferedStreamBuf<char, std::char_traits<char>> BufferedStreamBuf;
} // namespace Poco
#endif // Foundation_BufferedStreamBuf_INCLUDED
|
/*
* Copyright 2018 GIG Technology NV
*
* 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.
*
* @@license_version:1.4@@
*/
#import "KYDrawerController.h"
@interface MCTDrawerController : KYDrawerController
@end
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2014 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifndef TIUIVIEW_H_
#define TIUIVIEW_H_
#include <TiCore.h>
namespace TiUI {
class TiUIView : public Ti::TiView
{
Q_OBJECT;
public:
TiUIView(Ti::TiViewProxy*);
virtual ~TiUIView();
virtual bool ingoreWidth();
virtual bool ingoreHeight();
virtual QString defaultWidth();
virtual QString defaultHeight();
};
}
#endif /* TIUIVIEW_H_ */
|
/*
* Copyright (c) 2017 Phytec Messtechnik GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <init.h>
#include <drivers/pinmux.h>
#include <fsl_port.h>
static int usb_kw24d512_pinmux_init(const struct device *dev)
{
ARG_UNUSED(dev);
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porta), okay)
__unused const struct device *porta =
DEVICE_DT_GET(DT_NODELABEL(porta));
__ASSERT_NO_MSG(device_is_ready(porta));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portb), okay)
__unused const struct device *portb =
DEVICE_DT_GET(DT_NODELABEL(portb));
__ASSERT_NO_MSG(device_is_ready(portb));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portc), okay)
__unused const struct device *portc =
DEVICE_DT_GET(DT_NODELABEL(portc));
__ASSERT_NO_MSG(device_is_ready(portc));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portd), okay)
__unused const struct device *portd =
DEVICE_DT_GET(DT_NODELABEL(portd));
__ASSERT_NO_MSG(device_is_ready(portd));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porte), okay)
__unused const struct device *porte =
DEVICE_DT_GET(DT_NODELABEL(porte));
__ASSERT_NO_MSG(device_is_ready(porte));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI
/* SPI1 CS0, SCK, SOUT, SIN */
pinmux_pin_set(portb, 10, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(portb, 11, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAlt2));
pinmux_pin_set(portb, 17, PORT_PCR_MUX(kPORT_MuxAlt2));
#endif
return 0;
}
SYS_INIT(usb_kw24d512_pinmux_init, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY);
|
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* 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.txt
*
* 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 elxMyStandardResampler_h
#define elxMyStandardResampler_h
#include "elxIncludes.h" // include first to avoid MSVS warning
#include "itkResampleImageFilter.h"
namespace elastix
{
/**
* \class MyStandardResampler
* \brief A resampler based on the itk::ResampleImageFilter.
*
* The parameters used in this class are:
* \parameter Resampler: Select this resampler as follows:\n
* <tt>(Resampler "DefaultResampler")</tt>
*
* \ingroup Resamplers
*/
template <class TElastix>
class ITK_TEMPLATE_EXPORT MyStandardResampler
: public ResamplerBase<TElastix>::ITKBaseType
, public ResamplerBase<TElastix>
{
public:
/** Standard ITK-stuff. */
using Self = MyStandardResampler;
using Superclass1 = typename ResamplerBase<TElastix>::ITKBaseType;
using Superclass2 = ResamplerBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(MyStandardResampler, ResampleImageFilter);
/** Name of this class.
* Use this name in the parameter file to select this specific resampler. \n
* example: <tt>(Resampler "DefaultResampler")</tt>\n
*/
elxClassNameMacro("DefaultResampler");
/** Typedef's inherited from the superclass. */
using typename Superclass1::InputImageType;
using typename Superclass1::OutputImageType;
using typename Superclass1::InputImagePointer;
using typename Superclass1::OutputImagePointer;
using typename Superclass1::InputImageRegionType;
using typename Superclass1::TransformType;
using typename Superclass1::TransformPointerType;
using typename Superclass1::InterpolatorType;
using typename Superclass1::InterpolatorPointerType;
using typename Superclass1::SizeType;
using typename Superclass1::IndexType;
using typename Superclass1::PixelType;
using typename Superclass1::OutputImageRegionType;
using typename Superclass1::SpacingType;
using typename Superclass1::OriginPointType;
/** Typedef's from the ResamplerBase. */
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using ITKBaseType = typename Superclass2::ITKBaseType;
/* Nothing to add. In the baseclass already everything is done what should be done. */
protected:
/** The constructor. */
MyStandardResampler() = default;
/** The destructor. */
~MyStandardResampler() override = default;
private:
elxOverrideGetSelfMacro;
/** The deleted copy constructor. */
MyStandardResampler(const Self &) = delete;
/** The deleted assignment operator. */
void
operator=(const Self &) = delete;
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxMyStandardResampler.hxx"
#endif
#endif // end #ifndef elxMyStandardResampler_h
|
/* Functions to do quicker sound processing */
/* Copyright Alex Hornby 1997 */
#include "config.h"
#include "unistd.h"
#include <stdio.h>
#include <stdlib.h>
#include "tiasound.h"
#include <assert.h>
#include "types.h"
#include "dbg_mess.h"
#define uint8 unsigned char
#define AUDIO_CLOCK 31400.0
#define BUFFER_RATIO 2
#define BUFFER_SAMPLE AUDIO_CLOCK/2
extern int sfd;
static int BUFFER_CLOCK=0;
static int qplay_back=0;
static unsigned char *qbuffers[16][32];
void
qsound_init ( int sample_freq, int playback_freq, int bufsize)
{
/* Counter */
int i,j;
Tia_sound_init(AUDIO_CLOCK, playback_freq);
qplay_back=BUFFER_SAMPLE;
/* Keep things simple */
BUFFER_CLOCK=AUDIO_CLOCK;
/* Fill the qsound buffers with 2600 sounds at half the Audio Clock Rate */
dbg_message(DBG_NORMAL, "Setting up sound buffers\n");
/* Sets the volume of the channel to maximum. Keep this constant! */
Update_tia_sound(0x19, 0x0f);
/* Turn off the other channel! */
Update_tia_sound(0x19 + 1 , 0x00);
/* Loop through each of the waveforms */
for( i=0; i<16; i++)
{
/* Loop through each to the 32 notes*/
for ( j=0; j<32; j++)
{
/* Sets the volume of the channel to maximum. Keep this constant! */ Update_tia_sound(0x19, 0x0f);
/* Set the waveform */
Update_tia_sound(0x15, i);
/* Sets the freqency of the channel */
Update_tia_sound(0x17, j);
/* Allocate some memory for the buffer if needed. */
if( qbuffers[i][j]==0 )
qbuffers[i][j]=malloc(bufsize);
/* Store it */
Tia_process( qbuffers[i][j], bufsize);
/* Turn the channel off again */
Update_tia_sound(0x15 , 0x00);
/* Sets the volume of the channel to minimum. Keep this constant! */
Update_tia_sound(0x19, 0x00);
}
}
Update_tia_sound(0x19, 0x0F);
Update_tia_sound(0x19+1, 0x0F);
}
/* Builds the current sound buffer in memory */
void
qsound_process ( unsigned char *buffer, UINT16 n)
{
int chan;
uint8 outvol[2];
uint8 *current_buffers[2];
int offset ;
int qbuff_vol[2];
/* Link to the TIA registers */
extern uint8 AUDC[2]; /* AUDCx (15, 16) */
extern uint8 AUDF[2]; /* AUDFx (17, 18) */
extern uint8 AUDV[2]; /* AUDVx (19, 1A) */
int naudv[2];
naudv[0]=(AUDV[0]>>3);
naudv[1]=(AUDV[1]>>3);
/* loop through the channels */
for (chan = 0; chan <=1; chan++)
{
/* Sets the buffer pointer to the correct sample*/
current_buffers[chan]=qbuffers[AUDC[chan]][AUDF[chan]];
qbuff_vol[chan]=AUDV[chan];
}
offset=0;
/* loop until the buffer is filled */
while (n>0)
{
/* Set the output volume */
outvol[0]=(*(current_buffers[0]++) * naudv[0]) >> 4;
outvol[1]=(*(current_buffers[1]++) * naudv[1]) >> 4;
/* We Now have two values at the qsound frequency */
/* calculate the latest output value and place in buffer */
*(buffer++) = outvol[0] + outvol[1];
/* and indicate one less byte to process */
n--;
}
}
|
/*
* 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 T_MAIN_H
#define T_MAIN_H
#include <string>
#include "thrift/compiler/parse/t_const.h"
#include "thrift/compiler/parse/t_field.h"
/**
* Defined in the flex library
*/
int yylex(void);
int yyparse(void);
/**
* Expected to be defined by Flex/Bison
*/
void yyerror(const char* fmt, ...);
/**
* Parse debugging output, used to print helpful info
*/
void pdebug(const char* fmt, ...);
/**
* Parser warning
*/
void pwarning(int level, const char* fmt, ...);
/**
* Failure!
*/
void failure(const char* fmt, ...);
/**
* Check constant types
*/
void validate_const_type(t_const* c);
/**
* Check constant types
*/
void validate_field_value(t_field* field, t_const_value* cv);
/**
* Check members of a throws block
*/
bool validate_throws(t_struct* throws);
/**
* Converts a string filename into a thrift program name
*/
std::string program_name(std::string filename);
/**
* Gets the directory path of a filename
*/
std::string directory_name(std::string filename);
/**
* Get the absolute path for an include file
*/
std::string include_file(std::string filename);
/**
* Clears any previously stored doctext string.
*/
void clear_doctext();
/**
* Cleans up text commonly found in doxygen-like comments
*/
char* clean_up_doctext(char* doctext);
/**
* Flex utilities
*/
extern int yylineno;
extern char yytext[];
extern FILE* yyin;
// we need all the symbols defined above for common.h
#include "thrift/compiler/common.h"
#endif
|
/*
* Copyright (c) 2005-2006 Institute for System Programming
* Russian Academy of Sciences
* 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 TA_SIGNAL_SIGCTRL_AGENT_H
#define TA_SIGNAL_SIGCTRL_AGENT_H
#include "common/agent.h"
/********************************************************************/
/** Agent Initialization **/
/********************************************************************/
void register_signal_sigctrl_commands(void);
#endif
|
//
// endian.h
//
// https://gist.github.com/panzi/6856583
// https://albinoloverats.net/src/lmtpd/common/common.h
//
// I, Mathias Panzenböck, place this file hereby into the public domain. Use
// it at your own risk for whatever you like. In case there are
// jurisdictions that don't support putting things in the public domain you
// can also consider it to be "dual licensed" under the BSD, MIT and Apache
// licenses, if you want to. This code is trivial anyway. Consider it an
// example on how to get the endian conversion functions on different
// platforms.
#ifndef PORTABLE_ENDIAN_H__
#define PORTABLE_ENDIAN_H__
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
#define __WINDOWS__
#endif
#if defined(__linux__) || defined(__CYGWIN__)
#include <endian.h>
#elif defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#define __PDP_ENDIAN PDP_ENDIAN
#elif defined(__OpenBSD__)
#include <sys/endian.h>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
#define be16toh(x) betoh16(x)
#define le16toh(x) letoh16(x)
#define be32toh(x) betoh32(x)
#define le32toh(x) letoh32(x)
#define be64toh(x) betoh64(x)
#define le64toh(x) letoh64(x)
#elif defined(__MINGW32__) || defined(__MINGW64__)
#define __bswap_16(x) ((((x)&0xff00) >> 8) | (((x)&0x00ff) << 8))
#define __bswap_32(x) \
((((x)&0xff000000) >> 24) | (((x)&0x00ff0000) >> 8) | (((x)&0x0000ff00) << 8) \
| (((x)&0x000000ff) << 24))
#define __bswap_64(x) \
((((x)&0xff00000000000000ull) >> 56) | (((x)&0x00ff000000000000ull) >> 40) \
| (((x)&0x0000ff0000000000ull) >> 24) | (((x)&0x000000ff00000000ull) >> 8) \
| (((x)&0x00000000ff000000ull) << 8) | (((x)&0x0000000000ff0000ull) << 24) \
| (((x)&0x000000000000ff00ull) << 40) | (((x)&0x00000000000000ffull) << 56))
#if BYTE_ORDER == LITTLE_ENDIAN
#define htobe16(x) __bswap_16(x)
#define htole16(x) (x)
#define be16toh(x) __bswap_16(x)
#define le16toh(x) (x)
#define htobe32(x) __bswap_32(x)
#define htole32(x) (x)
#define be32toh(x) __bswap_32(x)
#define le32toh(x) (x)
#define htobe64(x) __bswap_32(x)
#define htole64(x) (x)
#define be64toh(x) __bswap_32(x)
#define le64toh(x) (x)
#elif BYTE_ORDER == BIG_ENDIAN
#define htobe16(x) (x)
#define htole16(x) __bswap_16(x)
#define be16toh(x) (x)
#define le16toh(x) __bswap_16(x)
#define htobe32(x) (x)
#define htole32(x) __bswap_32(x)
#define be32toh(x) (x)
#define le32toh(x) __bswap_32(x)
#define htobe64(x) (x)
#define htole64(x) __bswap_64(x)
#define be64toh(x) (x)
#define le64toh(x) __bswap_64(x)
#else
#error byte order not supported
#endif
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#define __PDP_ENDIAN PDP_ENDIAN
#elif defined(__WINDOWS__)
#include <sys/param.h>
#include <winsock2.h>
#if BYTE_ORDER == LITTLE_ENDIAN
#define htobe16(x) htons(x)
#define htole16(x) (x)
#define be16toh(x) ntohs(x)
#define le16toh(x) (x)
#define htobe32(x) htonl(x)
#define htole32(x) (x)
#define be32toh(x) ntohl(x)
#define le32toh(x) (x)
#define htobe64(x) htonll(x)
#define htole64(x) (x)
#define be64toh(x) ntohll(x)
#define le64toh(x) (x)
#elif BYTE_ORDER == BIG_ENDIAN
/* that would be xbox 360 */
#define htobe16(x) (x)
#define htole16(x) __builtin_bswap16(x)
#define be16toh(x) (x)
#define le16toh(x) __builtin_bswap16(x)
#define htobe32(x) (x)
#define htole32(x) __builtin_bswap32(x)
#define be32toh(x) (x)
#define le32toh(x) __builtin_bswap32(x)
#define htobe64(x) (x)
#define htole64(x) __builtin_bswap64(x)
#define be64toh(x) (x)
#define le64toh(x) __builtin_bswap64(x)
#else
#error byte order not supported
#endif
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#define __PDP_ENDIAN PDP_ENDIAN
#else
#error platform not supported
#endif
#endif
|
//
// TimeringViewController.h
// Timer
//
// Created by 莫大宝 on 16/5/7.
// Copyright © 2016年 dabao. All rights reserved.
//
#import "BaseViewController.h"
@interface TimeringViewController : BaseViewController
@end
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*/
#include "tomcrypt_private.h"
#ifdef LTC_MECC
int ecc_set_key(const unsigned char *in, unsigned long inlen, int type, ecc_key *key)
{
int err;
void *prime, *a, *b;
LTC_ARGCHK(key != NULL);
LTC_ARGCHK(in != NULL);
LTC_ARGCHK(inlen > 0);
prime = key->dp.prime;
a = key->dp.A;
b = key->dp.B;
if (type == PK_PRIVATE) {
/* load private key */
if ((err = mp_read_unsigned_bin(key->k, (unsigned char *)in, inlen)) != CRYPT_OK) {
goto error;
}
if (mp_iszero(key->k) || (mp_cmp(key->k, key->dp.order) != LTC_MP_LT)) {
err = CRYPT_INVALID_PACKET;
goto error;
}
/* compute public key */
if ((err = ltc_mp.ecc_ptmul(key->k, &key->dp.base, &key->pubkey, a, prime, 1)) != CRYPT_OK) { goto error; }
}
else if (type == PK_PUBLIC) {
/* load public key */
if ((err = ltc_ecc_import_point(in, inlen, prime, a, b, key->pubkey.x, key->pubkey.y)) != CRYPT_OK) { goto error; }
if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) { goto error; }
}
else {
err = CRYPT_INVALID_PACKET;
goto error;
}
/* point on the curve + other checks */
if ((err = ltc_ecc_verify_key(key)) != CRYPT_OK) {
goto error;
}
key->type = type;
return CRYPT_OK;
error:
ecc_free(key);
return err;
}
#endif
/* ref: HEAD -> develop */
/* git commit: 9c0d7085234bd6baba2ab8fd9eee62254599341c */
/* commit time: 2018-10-15 10:51:17 +0200 */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.