text stringlengths 4 6.14k |
|---|
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
***/
#pragma once
#include "public.h"
namespace base
{
namespace script
{
//--
extern base::mem::PoolID POOL_JIT;
//--
} // script
} // base |
/*
* Copyright © 2013 Intel Corporation
*
* 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 (including the next
* paragraph) 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.
*
* Authors:
* Ville Syrjälä <ville.syrjala@linux.intel.com>
*
*/
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#ifdef __linux__
#include <sys/io.h>
#endif
#include "intel_io.h"
#include "intel_chipset.h"
static uint8_t read_reg(uint32_t reg, bool use_mmio)
{
if (use_mmio)
return *((volatile uint8_t *)mmio + reg);
#ifdef __linux__
else
return inb(reg);
#else
return -1;
#endif
}
static void usage(const char *cmdname)
{
printf("Usage: %s [-m] [addr1] [addr2] .. [addrN]\n", cmdname);
printf("\t -m : use MMIO instead of port IO\n");
printf("\t addr : in 0xXXXX format\n");
}
int main(int argc, char *argv[])
{
bool use_mmio = false;
int ret = 0;
uint32_t reg;
int i, ch;
const char *cmdname = argv[0];
while ((ch = getopt(argc, argv, "m")) != -1) {
switch(ch) {
case 'm':
use_mmio = true;
break;
default:
break;
}
}
argc -= optind;
argv += optind;
if (argc < 1) {
usage(cmdname);
return 1;
}
if (use_mmio)
intel_register_access_init(intel_get_pci_device(), 0);
#ifdef __linux__
else
assert(iopl(3) == 0);
#else
else {
fprintf(stderr, "%s: non-mmio is not supported on this OS.\n", argv[0]);
exit(127);
}
#endif
for (i = 0; i < argc; i++) {
sscanf(argv[i], "0x%x", ®);
printf("0x%X : 0x%X\n", reg, read_reg(reg, use_mmio));
}
if (use_mmio)
intel_register_access_fini();
#ifdef __linux__
else
iopl(0);
#endif
return ret;
}
|
//
// SBDynamicArcView.h
// SBLib
//
// Created by roronoa on 2017/7/27.
// Copyright © 2017年 roronoa. All rights reserved.
//
#import <UIKit/UIKit.h>
/** 加载转圈 我抄的代码 **/
@interface SBDynamicArcView : UIImageView
@property (strong, nonatomic) CAReplicatorLayer *replicatorLayer;
@property (strong, nonatomic) CAShapeLayer *indicatorCAShapeLayer;
/** 开始转圈动画 **/
- (void)addDynamicArcAnimation;
/** 停止转圈动画 **/
- (void)removeDynamicArcAnimation;
@end
|
#ifndef _HELLO_H
#define _HELLO_H
void hello(const char *str);
#endif |
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/chinthan/Framework/Logger/ConvertCode/OnePoint/Runtime/Common/AliasMap/AliasMap.java
//
// Created by chinthan on 1/15/14.
//
#import "IAliasMap.h"
#import "IGenerator.h"
@interface AliasMap : NSObject <IAliasMap> {
@public
id<IGenerator> __Generator_;
}
- (id<IGenerator>)getGenerator;
- (void)setGeneratorWithIGenerator:(id<IGenerator>)value;
- (long)aliasIndexWithNSString:(NSString *)aliasName;
- (NSMutableArray *)subAliasesWithNSString:(NSString *)fullName;
- (id)init;
@end
|
//
// LocationModel.h
// Prototype
//
// Created by Ivo Peric on 08/09/15.
// Copyright (c) 2015 Clover Studio. All rights reserved.
//
#import "CSModel.h"
@interface CSLocationModel : CSModel
@property (nonatomic) double lat;
@property (nonatomic) double lng;
@end
|
/* Copyright (C) 2017 Alexandru-Valentin Musat (contact@nexuralsoftware.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "computational_base_layer.h"
#ifndef NEXURALNET_DNN_LAYERS_SELU_DROPOUT_LAYER
#define NEXURALNET_DNN_LAYERS_SELU_DROPOUT_LAYER
namespace nexural {
class SeluDropoutLayer : public ComputationalBaseLayer {
public:
SeluDropoutLayer(const Params &layerParams);
~SeluDropoutLayer();
virtual void Setup(const LayerShape& prevLayerShape, const size_t layerIndex);
virtual void FeedForward(const Tensor& inputData, const NetworkState networkState = NetworkState::RUN);
virtual void SetupLayerForTraining();
virtual void BackPropagate(const Tensor& prevLayerErrors);
private:
Tensor _dropoutIndexes;
float_n _threshold;
float_n _alpha;
float_n _a;
float_n _b;
};
}
#endif
|
/*--------------------------------------------------*/
#import "UIView+GLBUI.h"
/*--------------------------------------------------*/
#if defined(GLB_TARGET_IOS)
/*--------------------------------------------------*/
@interface GLBSpinnerView : UIView
@property(nonatomic, nullable, strong) IBInspectable UIColor* color;
@property(nonatomic) IBInspectable CGFloat size;
@property(nonatomic) IBInspectable BOOL hidesWhenStopped;
@property(nonatomic, readonly, getter=isAnimating) BOOL animating;
- (void)setup NS_REQUIRES_SUPER;
- (void)startAnimating;
- (void)stopAnimating;
- (void)prepareAnimation NS_REQUIRES_SUPER;
@end
/*--------------------------------------------------*/
#endif
/*--------------------------------------------------*/
|
//
// ViewController.h
// Logger
//
// Created by Виктор on 02.11.14.
// Copyright (c) 2014 Victor. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ViewController : NSObject
@end
|
/**
* @file static_assert.h
* @brief 导入静态断言(STD_STATIC_ASSERT)<br />
* Licensed under the MIT licenses.
*
* @version 1.0
* @author OWenT, owt5008137@live.com
* @date 2013-12-25
*
* @history
*
*/
#ifndef _STD_STATIC_ASSERT_H_
#define _STD_STATIC_ASSERT_H_
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// ============================================================
// 公共包含部分
// 自动导入TR1库
// ============================================================
/**
* 导入静态断言(STD_STATIC_ASSERT)
* 如果是G++且GCC版本高于4.3, 使用关键字static_assert
* 否则会启用自定义简化的静态断言
*
* 如果是VC++且VC++版本高于10.0, 使用关键字static_assert
* 否则会启用自定义简化的静态断言
*
* 如果指定载入了boost库,则启用BOOST中的静态断言
*
* 自定义简化的静态断言参照BOOST_STATIC_ASSERT
*
*/
// VC10.0 SP1以上分支判断
#if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1600 && defined(_HAS_CPP0X) && _HAS_CPP0X) || (defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3 ) ) )
#define STD_STATIC_ASSERT(exp) static_assert(exp, #exp)
#define STD_STATIC_ASSERT_MSG(exp, msg) static_assert(exp, msg)
#elif defined(STD_WITH_BOOST_HPP) || defined(STD_ENABLE_BOOST_STATIC_ASSERT)
#include <boost/static_assert.hpp>
#define STD_STATIC_ASSERT(exp) BOOST_STATIC_ASSERT(exp)
#define STD_STATIC_ASSERT_MSG(exp, msg) BOOST_STATIC_ASSERT_MSG(exp, msg)
#else
//
// If the compiler issues warnings about old C style casts,
// then enable this:
//
#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)))
# define STD_STATIC_ASSERT_BOOL_CAST( x ) ((x) == 0 ? false : true)
#else
# define STD_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
#endif
//
// Helper macro STD_STATIC_ASSERT_JOIN:
// The following piece of macro magic joins the two
// arguments together, even when one of the arguments is
// itself a macro (see 16.3.1 in C++ standard). The key
// is that macro expansion of macro arguments does not
// occur in STD_STATIC_ASSERT_DO_JOIN2 but does in STD_STATIC_ASSERT_DO_JOIN.
//
#define STD_STATIC_ASSERT_JOIN( X, Y ) STD_STATIC_ASSERT_DO_JOIN( X, Y )
#define STD_STATIC_ASSERT_DO_JOIN( X, Y ) STD_STATIC_ASSERT_DO_JOIN2(X,Y)
#define STD_STATIC_ASSERT_DO_JOIN2( X, Y ) X##Y
namespace util
{
namespace std
{
// HP aCC cannot deal with missing names for template value parameters
template <bool x> struct STATIC_ASSERTION_FAILURE;
template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
// HP aCC cannot deal with missing names for template value parameters
template<int x> struct static_assert_test{};
}
}
#if defined(_MSC_VER) && (_MSC_VER < 1300)
// __LINE__ macro broken when -ZI is used see Q199057
// fortunately MSVC ignores duplicate typedef's.
#define STD_STATIC_ASSERT( B ) \
typedef ::util::std::static_assert_test<\
sizeof(::util::std::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\
> std_static_assert_typedef_
#elif defined(_MSC_VER)
#define STD_STATIC_ASSERT( B ) \
typedef ::util::std::static_assert_test<\
sizeof(::util::std::STATIC_ASSERTION_FAILURE< STD_STATIC_ASSERT_BOOL_CAST ( B ) >)>\
STD_STATIC_ASSERT_JOIN(std_static_assert_typedef_, __COUNTER__)
#else
// generic version
#define STD_STATIC_ASSERT( B ) \
typedef ::util::std::static_assert_test<\
sizeof(::util::std::STATIC_ASSERTION_FAILURE< STD_STATIC_ASSERT_BOOL_CAST( B ) >)>\
STD_STATIC_ASSERT_JOIN(std_static_assert_typedef_, __LINE__)
#endif
// 自定义静态断言忽略自定义消息
#define STD_STATIC_ASSERT_MSG(exp, msg) STD_STATIC_ASSERT(exp)
#endif
#endif /* _STD_STATIC_ASSERT_H_ */
|
//
// NGRTransformView.h
// NGRCrop
//
// Created by Marcin Piesiak on 04.05.2015.
// Copyright (c) 2015 Marcin Piesiak. All rights reserved.
//
@import UIKit;
#import "NGRScalableView.h"
@interface NGRTransformView : UIView
/**
* A crop declaring bounds for croping image.
*/
@property (strong, nonatomic, readonly) NGRScalableView *cropView;
/**
* Holds image which will be transformed and cropped.
*/
@property (strong, nonatomic, readonly) UIImageView *imageView;
/**
* Indicates whether tapped view is crop view or not.
*/
@property (assign, nonatomic) BOOL allowToUseGestures;
@end
|
/*
***********************************************************************************************************************
*
* Copyright (c) 2016-2021 Advanced Micro Devices, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
**********************************************************************************************************************/
#pragma once
#include "pal.h"
#include "core/hw/gfxip/gfx9/gfx9Chip.h"
namespace Pal
{
struct GraphicsState;
namespace Gfx9
{
class CmdStream;
class CmdUtil;
class Device;
struct Gfx9PalSettings;
class GraphicsPipeline;
class UniversalCmdBuffer;
struct UniversalCmdBufferState;
union CachedSettings;
// =====================================================================================================================
// Maintains state for hardware workarounds which need tracking of changes between draws. (NOTE - this tracking is not
// limited to things like bound objects, but can also include number of vertices per draw, etc.).
// It is intended for these objects to be owned by Universal Command Buffers.
class WorkaroundState
{
public:
WorkaroundState(
const Device* pDevice,
bool isNested,
const UniversalCmdBufferState& universalState,
const CachedSettings& cachedSettings);
~WorkaroundState() {}
template <bool PipelineDirty, bool StateDirty, bool Pm4OptImmediate>
uint32* PreDraw(
const GraphicsState& gfxState,
CmdStream* pDeCmdStream,
UniversalCmdBuffer* pCmdBuffer,
uint32* pCmdSpace);
uint32* SwitchFromNggPipelineToLegacy(
bool nextPipelineUsesGs,
uint32* pCmdSpace) const;
uint32* SwitchBetweenLegacyPipelines(
bool oldPipelineUsesGs,
uint32 oldCutMode,
const GraphicsPipeline* pNewPipeline,
uint32* pCmdSpace) const;
void HandleZeroIndexBuffer(
UniversalCmdBuffer* pCmdBuffer,
gpusize* pIndexBufferAddr,
uint32* pIndexCount);
template <bool Indirect>
bool DisableInstancePacking(
PrimitiveTopology topology,
uint32 instanceCount,
uint32 numActiveQueries) const;
private:
const Device& m_device;
const CmdUtil& m_cmdUtil;
const CachedSettings& m_cachedSettings;
const bool m_isNested;
const UniversalCmdBufferState& m_universalState;
PAL_DISALLOW_DEFAULT_CTOR(WorkaroundState);
PAL_DISALLOW_COPY_AND_ASSIGN(WorkaroundState);
};
} // Gfx9
} // Pal
|
//
// AppDelegate.h
// LeoTextFieldDemo
//
// Created by Leo.Chen on 2016/12/12.
// Copyright © 2016年 Leo.Chen. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* Created by Phil Nash on 1/2/2013.
* Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
#include <string>
#include "catch_result_type.h"
#include "catch_common.h"
#include "catch_stream.h"
namespace Catch {
struct MessageInfo {
MessageInfo( std::string const& _macroName,
SourceLineInfo const& _lineInfo,
ResultWas::OfType _type );
std::string macroName;
std::string message;
SourceLineInfo lineInfo;
ResultWas::OfType type;
unsigned int sequence;
bool operator == ( MessageInfo const& other ) const;
bool operator < ( MessageInfo const& other ) const;
private:
static unsigned int globalCount;
};
struct MessageStream {
template<typename T>
MessageStream& operator << ( T const& value ) {
m_stream << value;
return *this;
}
ReusableStringStream m_stream;
};
struct MessageBuilder : MessageStream {
MessageBuilder( std::string const& macroName,
SourceLineInfo const& lineInfo,
ResultWas::OfType type );
template<typename T>
MessageBuilder& operator << ( T const& value ) {
m_stream << value;
return *this;
}
MessageInfo m_info;
};
class ScopedMessage {
public:
explicit ScopedMessage( MessageBuilder const& builder );
~ScopedMessage();
MessageInfo m_info;
};
} // end namespace Catch
#endif // TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 10
int id[N];
int root(int i) {
while(id[i] != i) {
i = id[i];
}
return i;
}
int main(int argc, char **argv) {
const char* INPUT_FILE = "resources/input.txt";
FILE *fp;
char *line = NULL;
char *token;
size_t len = 0;
for(int i = 0; i < N; i++) {
id[i] = i;
}
fp = fopen(INPUT_FILE, "r");
if (fp == NULL) {
exit(EXIT_FAILURE);
}
while (getline(&line, &len, fp) != -1) {
token = strtok(line, " ");
int p = atoi(token);
token = strtok(NULL, " ");
int q = atoi(token);
printf("%d %d: ", p, q);
int p_root = root(p);
int q_root = root(q);
if(p_root == q_root) {
printf("\n");
continue;
}
id[p_root] = q_root;
printf("p_root = %d, q_root = %d. ", p_root, q_root);
for(int i = 0; i < N; i++) {
printf("%d ", id[i]);
}
printf("\n");
}
free(line);
exit(EXIT_SUCCESS);
} |
//
// IKTextFieldInputView.h
// HanhwaIphone
//
// Created by Rickseong on 2015. 8. 10..
//
//
#import <UIKit/UIKit.h>
#import "CMTextField.h"
typedef void (^DoneBlock) (UITextField* textField);
@interface CMCustomNumberPadView : UIView
@property UITextField *textField;
@property (nonatomic, copy) DoneBlock doneBlock;
@end
|
/**
*
* Emerald (kbi/elude @2014)
*
* Private functions only.
*/
#ifndef COLLADA_DATA_EFFECT_H
#define COLLADA_DATA_EFFECT_H
#include "collada/collada_data_image.h"
#include "collada/collada_types.h"
#include "tinyxml2.h"
enum collada_data_effect_property
{
COLLADA_DATA_EFFECT_PROPERTY_ID,
COLLADA_DATA_EFFECT_PROPERTY_UV_MAP_NAME, /* NOTE: LW-specific */
/* always last */
COLLADA_DATA_EFFECT_COUNT
};
/** TODO */
PUBLIC collada_data_effect collada_data_effect_create(tinyxml2::XMLElement* current_effect_element_ptr,
system_hash64map images_by_id_map);
/** TODO */
PUBLIC EMERALD_API void collada_data_effect_get_properties( collada_data_effect effect,
_collada_data_shading* out_shading,
int* out_shading_factor_item_bitmask);
/** TODO */
PUBLIC EMERALD_API void collada_data_effect_get_property(const collada_data_effect effect,
collada_data_effect_property property,
void* out_data_ptr);
/** TODO */
PUBLIC EMERALD_API collada_data_shading_factor_item collada_data_effect_get_shading_factor_item_by_texcoord(collada_data_effect effect,
system_hashed_ansi_string texcoord_name);
/** TODO */
PUBLIC EMERALD_API void collada_data_effect_get_shading_factor_item_properties(collada_data_effect effect,
collada_data_shading_factor_item item,
collada_data_shading_factor* out_type);
/** TODO */
PUBLIC EMERALD_API void collada_data_effect_get_shading_factor_item_float_properties(collada_data_effect effect,
collada_data_shading_factor_item item,
float* out_float4);
/** TODO */
PUBLIC EMERALD_API void collada_data_effect_get_shading_factor_item_float4_properties(collada_data_effect effect,
collada_data_shading_factor_item item,
float* out_float4);
/** TODO */
PUBLIC EMERALD_API void collada_data_effect_get_shading_factor_item_texture_properties(collada_data_effect effect,
collada_data_shading_factor_item item,
collada_data_image* out_image,
_collada_data_sampler_filter* out_mag_filter,
_collada_data_sampler_filter* out_min_filter,
system_hashed_ansi_string* out_texcoord_name);
/** TODO */
PUBLIC void collada_data_effect_release(collada_data_effect effect);
#endif /* COLLADA_DATA_EFFECT_H */
|
#pragma once
#include <Thor/Framework/FrameworkFwdInternal.h>
#include <Thor/Framework/ThiTask.h>
#include <Thor/Framework/Containers/ThVector.h>
namespace Thor
{
//----------------------------------------------------------------------------------------
//
// ThTbbTaskManager
//
//----------------------------------------------------------------------------------------
class ThTbbTaskManager:public ThiObject
{
public:
ThTbbTaskManager();
virtual ThiType* GetType()const;
void AddTask(const ThiTaskPtr& task);
void ExecuteTasks();
private:
typedef ThVector<ThiTaskPtr> TaskList;
TaskList m_Tasks;
ThSize m_PrevTaskCount;
};
} |
// This file was generated based on 'C:\ProgramData\Uno\Packages\UnoCore\0.13.2\Source\Uno\Collections\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#ifndef __APP_UNO_COLLECTIONS_I_ENUMERABLE__FUSE_ANIMATIONS_MIXER_HANDLE_FUSE_E_4DDD6C02_H__
#define __APP_UNO_COLLECTIONS_I_ENUMERABLE__FUSE_ANIMATIONS_MIXER_HANDLE_FUSE_E_4DDD6C02_H__
#include <app/Uno.Object.h>
#include <Uno.h>
namespace app {
namespace Uno {
namespace Collections {
::uInterfaceType* IEnumerable__Fuse_Animations_MixerHandle_Fuse_Elements_StretchSizing___typeof();
struct IEnumerable__Fuse_Animations_MixerHandle_Fuse_Elements_StretchSizing_
{
::uObject*(*__fp_GetEnumerator)(void*);
static ::uObject* GetEnumerator(::uObject* __this) { return ((IEnumerable__Fuse_Animations_MixerHandle_Fuse_Elements_StretchSizing_*)uGetInterfacePtr(__this, IEnumerable__Fuse_Animations_MixerHandle_Fuse_Elements_StretchSizing___typeof()))->__fp_GetEnumerator((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0)); }
};
}}}
#endif
|
//
// ViewController.h
// SDKOCDemo
//
// Created by 杨涛 on 2017/10/26.
// Copyright © 2017年 finogeeks.com. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *txtUsername;
@property (weak, nonatomic) IBOutlet UITextField *txtPassword;
@property (weak, nonatomic) IBOutlet UIButton *btnConvo;
@end
|
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef BT_GJK_CONVEX_CAST_H
#define BT_GJK_CONVEX_CAST_H
#include "btCollisionMargin.h"
#include "btVector3.h"
#include "btConvexCast.h"
class btConvexShape;
class btMinkowskiSumShape;
#include "btSimplexSolverInterface.h"
///GjkConvexCast performs a raycast on a convex object using support mapping.
class btGjkConvexCast : public btConvexCast
{
btSimplexSolverInterface* m_simplexSolver;
const btConvexShape* m_convexA;
const btConvexShape* m_convexB;
public:
btGjkConvexCast(const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver);
/// cast a convex against another convex object
virtual bool calcTimeOfImpact(
const btTransform& fromA,
const btTransform& toA,
const btTransform& fromB,
const btTransform& toB,
CastResult& result);
};
#endif //BT_GJK_CONVEX_CAST_H
|
#ifndef MOCK_LORA_SYSTEM_H
#define MOCK_LORA_SYSTEM_H
#include "lora_system.h"
struct mock_system_param {
uint8_t appEUI[8U];
uint8_t devEUI[8U];
uint8_t appKey[16U];
uint8_t battery_level;
uint16_t upCounter;
uint16_t downCounter;
};
void mock_lora_system_init(struct mock_system_param *self);
#endif
|
//
// UIBarButtonItem+GKCategory.h
// GKNavigationBarViewController
//
// Created by QuintGao on 2017/7/7.
// Copyright © 2017年 高坤. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (GKCategory)
+ (instancetype)itemWithTitle:(NSString *)title imageName:(NSString *)imageName target:(id)target action:(SEL)action;
+ (instancetype)itemWithTitle:(NSString *)title image:(UIImage *)image target:(id)target action:(SEL)action;
+ (instancetype)itemWithImageName:(NSString *)imageName target:(id)target action:(SEL)action;
+ (instancetype)itemWithImageName:(NSString *)imageName highLightImageName:(NSString *)highLightImageName target:(id)target action:(SEL)action;
+ (instancetype)itemWithTitle:(NSString *)title target:(id)target action:(SEL)action;
@end
|
//
// RAFOrderedDictionary.h
// ReactiveFormlets
//
// Created by Jon Sterling on 6/12/12.
// Copyright (c) 2012 Jon Sterling. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol RAFMutableOrderedDictionary;
/// The block which allows guarded access to the mutable interface of an
/// immutable ordered dictionary.
typedef void (^RAFOrderedDictionaryModifyBlock)(id<RAFMutableOrderedDictionary> dict);
/// The immutable interface to an ordered dictionary.
@protocol RAFOrderedDictionary <NSFastEnumeration>
/// Returns the object at the provided key.
- (id)objectForKey:(id<NSCopying>)key;
- (id)objectForKeyedSubscript:(id<NSCopying>)key;
/// Returns an array of all the keys in the ordered dictionary, in order.
- (NSArray *)allKeys;
/// Returns an array of all the values in the ordered dictionary, in order.
- (NSArray *)allValues;
/// Returns the number of entries in the ordered dictionary.
- (NSUInteger)count;
/// Non-destructive update for an ordered dictionary.
///
/// block - The destructive operations to be performed on the copy; within the
/// block's scope, access is granted statically to the mutable interface of
/// `RAFOrderedDictionary`.
///
/// Returns a modified version of the ordered dictionary.
- (instancetype)modify:(RAFOrderedDictionaryModifyBlock)block;
@end
/// The mutable interface to the ordered dictionary.
@protocol RAFMutableOrderedDictionary <RAFOrderedDictionary>
/// Destructively updates the dictionary at a certain key; if the key does not
/// yet exist in the dictionary, the key-value pair is appended to the end.
///
/// key - The key at which to update the dictionary.
/// value - The value with which to update the dictionary.
- (void)setObject:(id)object forKey:(id<NSCopying>)key;
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key;
@end
@class RACSequence;
/// RAFOrderedDictionary is an (optionally) mutable associative collection. It
/// is almost exactly like an NSMutableDictionary, except that
/// keys are always kept in the order they are inserted.
@interface RAFOrderedDictionary : NSObject <RAFOrderedDictionary, NSCopying, NSMutableCopying>
/// Initializes with an existing ordered dictionary.
- (id)initWithOrderedDictionary:(RAFOrderedDictionary *)dictionary;
/// Returns a sequence of (key,value) RACTuples.
- (RACSequence *)sequence;
@end
@interface RAFOrderedDictionary (TypeRefinement)
- (RAFOrderedDictionary<RAFMutableOrderedDictionary> *)mutableCopyWithZone:(NSZone *)zone;
- (RAFOrderedDictionary<RAFMutableOrderedDictionary> *)mutableCopy;
@end
|
/*
* Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
/* Simple S/MIME encrypt example */
#include BLIK_OPENSSL_V_openssl__pem_h //original-code:<openssl/pem.h>
#include BLIK_OPENSSL_V_openssl__pkcs7_h //original-code:<openssl/pkcs7.h>
#include BLIK_OPENSSL_V_openssl__err_h //original-code:<openssl/err.h>
int main(int argc, char **argv)
{
BIO *in = NULL, *out = NULL, *tbio = NULL;
X509 *rcert = NULL;
STACK_OF(X509) *recips = NULL;
PKCS7 *p7 = NULL;
int ret = 1;
/*
* On OpenSSL 0.9.9 only:
* for streaming set PKCS7_STREAM
*/
int flags = PKCS7_STREAM;
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
/* Read in recipient certificate */
tbio = BIO_new_file("signer.pem", "r");
if (!tbio)
goto err;
rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL);
if (!rcert)
goto err;
/* Create recipient STACK and add recipient cert to it */
recips = sk_X509_new_null();
if (!recips || !sk_X509_push(recips, rcert))
goto err;
/*
* sk_X509_pop_free will free up recipient STACK and its contents so set
* rcert to NULL so it isn't freed up twice.
*/
rcert = NULL;
/* Open content being encrypted */
in = BIO_new_file("encr.txt", "r");
if (!in)
goto err;
/* encrypt content */
p7 = PKCS7_encrypt(recips, in, EVP_des_ede3_cbc(), flags);
if (!p7)
goto err;
out = BIO_new_file("smencr.txt", "w");
if (!out)
goto err;
/* Write out S/MIME message */
if (!SMIME_write_PKCS7(out, p7, in, flags))
goto err;
ret = 0;
err:
if (ret) {
fprintf(stderr, "Error Encrypting Data\n");
ERR_print_errors_fp(stderr);
}
PKCS7_free(p7);
X509_free(rcert);
sk_X509_pop_free(recips, X509_free);
BIO_free(in);
BIO_free(out);
BIO_free(tbio);
return ret;
}
|
/*
* Copyright (c) 2015-2019 Dubalu LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
#include "../src/xapiand.h"
#include <fstream>
#include <sstream>
#include <vector>
#include "../src/manager.h"
struct Initializer {
Initializer();
void destroy();
static Initializer& create() {
static Initializer initializer;
return initializer;
}
};
#ifndef TESTING_LOGS
# define TESTING_LOGS 1
#endif
#ifndef TESTING_ENDPOINTS
# define TESTING_ENDPOINTS 1
#endif
#ifndef TESTING_DATABASE
# define TESTING_DATABASE 1
#endif
#if (TESTING_LOGS == 1)
# include "../src/log.h"
# define RETURN(x) { Logging::dump_collected(); return x; }
# define INIT_LOG if (Logging::handlers.empty()) Logging::handlers.push_back(std::make_unique<StderrLogger>());
#else
template <typename... Args>
inline void log(std::string fmt, Args&&... args) {
fmt.push_back('\n');
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"
fprintf(stderr, fmt.c_str(), std::forward<Args>(args)...);
#pragma GCC diagnostic pop
}
# define L_DEBUG(obj, args...) log(args)
# define L_INFO(obj, args...) log(args)
# define L_NOTICE(obj, args...) log(args)
# define L_WARNING(obj, args...) log(args)
# define L_ERR(obj, args...) log(args)
# define L_CRIT(obj, args...) log(args)
# define L_ALERT(obj, args...) log(args)
# define L_EMERG(obj, args...) log(args)
# define L_EXC(obj, args...) log(args)
# define RETURN(x) { return x; }
# define INIT_LOG
#endif
template<typename T, std::size_t N>
inline constexpr std::size_t arraySize(T (&)[N]) noexcept {
return N;
}
constexpr const char TEST_CLUSTER_NAME[] = "cluster_test";
constexpr const char TEST_NODE_NAME[] = "node_test";
constexpr const char TEST_LOCAL_HOST[] = "127.0.0.1";
#if (TESTING_ENDPOINTS == 1)
#include "../src/endpoint.h"
inline Endpoint create_endpoint(const std::string& database) {
Endpoint e(database, nullptr, TEST_NODE_NAME);
e.port = XAPIAND_REMOTE_SERVERPORT;
e.host.assign(TEST_LOCAL_HOST);
return e;
}
#endif
bool write_file_contents(const std::string& filename, const std::string& contents);
bool read_file_contents(const std::string& filename, std::string* contents);
#if (TESTING_DATABASE == 1) || (TESTING_ENDPOINTS == 1)
#include "../src/database_handler.h"
/*
* The database used in the test is local
* so the Endpoints and local_node are manipulated.
*/
struct DB_Test {
DatabaseHandler db_handler;
std::string name_database;
Endpoints endpoints;
DB_Test(std::string_view db_name, const std::vector<std::string>& docs, int flags, std::string_view ct_type=JSON_CONTENT_TYPE);
~DB_Test();
void destroy();
std::pair<std::string_view, MsgPack> get_body(std::string_view body, std::string_view ct_type);
};
#endif
|
/*
WeaponPsiCannonFightet.h
(c)2009 Palestar, Richard Lyle
Created by Robert Kelford, March 2009
*/
#ifndef WEAPON_PSI_CANNON_FIGHTER_H
#define WEAPON_PSI_CANNON_FIGHTER_H
#include "DarkSpace/Constants.h"
#include "DarkSpace/GadgetWeapon.h"
//----------------------------------------------------------------------------
class WeaponPsiCannonFighter : public GadgetWeapon
{
public:
DECLARE_WIDGET_CLASS();
// NounGadget interface
Type type() const
{
return WEAPON;
}
int maxDamage() const
{
return 800;
}
int addValue() const
{
return 1750;
}
int buildTechnology() const
{
return 10;
}
int buildCost() const
{
return 50;
}
dword buildFlags() const
{
return NounPlanet::FLAG_METALS;
}
int buildTime() const
{
return 260;
}
// GadgetWeapon interface
int energyCost() const
{
return 70;
}
int energyCharge() const
{
return 1;
}
int ammoCost() const
{
return 0;
}
int ammoMax() const
{
return 0;
}
int ammoReload() const
{
return 0;
}
int ammoResources() const
{
return 0;
}
bool needsTarget() const
{
return true;
}
bool needsLock() const
{
return false;
}
int lockTime() const
{
return 0;
}
dword lockType() const
{
return 0;
}
bool checkRange() const
{
return true;
}
bool inheritVelocity() const
{
return true;
}
bool turret() const
{
return true;
}
int maxProjectiles() const
{
return 20;
}
int projectileCount() const
{
return 5;
}
int projectileDelay() const
{
return 4;
}
bool projectileSmart() const
{
return false;
}
bool isMine() const
{
return false;
}
float projectileVelocity() const
{
return 400.0f;
}
float projectileLife() const
{
return 900.0f / projectileVelocity();
}
float projectileSig() const
{
return 0.0f;
}
bool projectileCollidable() const
{
return false;
}
bool projectileAutoTarget() const
{
return false;
}
float turnRate() const
{
return 0.0f;
}
int tracerRate() const
{
return 10;
}
int tracerLife() const
{
return TICKS_PER_SECOND * 2;
}
dword damageType() const
{
return DAMAGE_PSI | DAMAGE_KINETIC;
}
int damage() const
{
return 152;
}
int damageRandom() const
{
return 912;
}
bool reverseFalloff() const
{
return false;
}
float damageFalloff() const
{
return 1.0f;
}
int repairRate() const
{
return 3;
}
int areaDamage() const
{
return 0;
}
int areaDamageRandom() const
{
return 0;
}
float areaDamageRadius() const
{
return 0.0f;
}
float armTime() const
{
return 0.0f;
}
};
//----------------------------------------------------------------------------
#endif
//----------------------------------------------------------------------------
// EOF
|
#ifndef QTMACTOOLBARSTANDARDITEM_P_H
#define QTMACTOOLBARSTANDARDITEM_P_H
#import <Cocoa/Cocoa.h>
#import <AppKit/AppKit.h>
class QtMacToolbarSidebarItem;
@interface QtSidebarToggleDelegate : NSObject
{
@public
QtMacToolbarSidebarItem* button;
}
- (IBAction)buttonClicked:(id)sender;
@end
#endif // QTMACTOOLBARSTANDARDITEM_P_H
|
//
// Animations.h
// templateARC
//
// Created by Mac Owner on 3/8/13.
//
//
#import <Foundation/Foundation.h>
#import "macros.h"
@interface Animations : NSObject
@property (strong,nonatomic) NSString *nameImage;
@property (assign,nonatomic) AnimationTypes animationType;
@property (assign,nonatomic) ButtonTypes animationForButtonType;
@end
|
//
// VMCompositeTableViewDataSource.h
// Pods
//
// Created by Valerio Mazzeo on 10/09/2014.
// Copyright (c) 2014 Valerio Mazzeo. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol VMCompositeTableViewDataSource <UITableViewDataSource>
@optional
#pragma mark - Accessing Objects
- (id)objectAtIndexPath:(NSIndexPath *)indexPath;
- (NSIndexPath *)indexPathForObject:(id)object;
@end
@interface VMCompositeTableViewDataSource : NSObject <VMCompositeTableViewDataSource>
#pragma mark - Conversion Methods
- (NSInteger)sectionForDataSource:(id<UITableViewDataSource>)dataSource;
- (id<UITableViewDataSource>)dataSourceForSection:(NSInteger)section;
- (NSIndexPath *)indexPathForDataSource:(id<UITableViewDataSource>)dataSource compositeDataSourceIndexPath:(NSIndexPath *)indexPath;
- (NSIndexPath *)compositeDataSourceIndexPathForDataSource:(id<UITableViewDataSource>)dataSource withIndexPath:(NSIndexPath *)indexPath;
#pragma mark - KVO Compliance Methods
- (NSUInteger)countOfDataSources;
- (void)addDataSourcesObject:(id<UITableViewDataSource>)object;
- (id<UITableViewDataSource>)objectInDataSourcesAtIndex:(NSUInteger)index;
- (NSArray *)dataSourcesAtIndexes:(NSIndexSet *)indexes;
- (void)getDataSources:(id<UITableViewDataSource> __unsafe_unretained *)buffer range:(NSRange)inRange;
- (void)insertObject:(id<UITableViewDataSource>)object inDataSourcesAtIndex:(NSUInteger)index;
- (void)insertDataSources:(NSArray *)array atIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInDataSourcesAtIndex:(NSUInteger)index withObject:(id<UITableViewDataSource>)object;
- (void)replaceDataSourcesAtIndexes:(NSIndexSet *)indexes withDataSources:(NSArray *)array;
- (void)removeObjectFromDataSourcesAtIndex:(NSUInteger)index;
- (void)removeDataSourcesAtIndexes:(NSIndexSet *)indexes;
@end
@interface UITableView (VMCompositeTableViewDataSource)
@end
|
/*
* Copyright (c) 2014
*
* "License"
*
* Bug reports and issues: <"Email">
*
* This file is part of learn-glib.
*/
#ifndef COMMON_H_
#define COMMON_H_
#include <stdio.h>
#endif /* COMMON_H_ */
|
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* PipelineStepImpllinks.h
*
*
*/
#ifndef PipelineStepImpllinks_H_
#define PipelineStepImpllinks_H_
#include <string>
#include "Link.h"
#include <nlohmann/json.hpp>
namespace org::openapitools::server::model
{
/// <summary>
///
/// </summary>
class PipelineStepImpllinks
{
public:
PipelineStepImpllinks();
virtual ~PipelineStepImpllinks() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes an error
/// message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
/// Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const PipelineStepImpllinks& rhs) const;
bool operator!=(const PipelineStepImpllinks& rhs) const;
/////////////////////////////////////////////
/// PipelineStepImpllinks members
/// <summary>
///
/// </summary>
Link getSelf() const;
void setSelf(Link const& value);
bool selfIsSet() const;
void unsetSelf();
/// <summary>
///
/// </summary>
Link getActions() const;
void setActions(Link const& value);
bool actionsIsSet() const;
void unsetActions();
/// <summary>
///
/// </summary>
std::string getClass() const;
void setClass(std::string const& value);
bool r_classIsSet() const;
void unset_class();
friend void to_json(nlohmann::json& j, const PipelineStepImpllinks& o);
friend void from_json(const nlohmann::json& j, PipelineStepImpllinks& o);
protected:
Link m_Self;
bool m_SelfIsSet;
Link m_Actions;
bool m_ActionsIsSet;
std::string m__class;
bool m__classIsSet;
};
} // namespace org::openapitools::server::model
#endif /* PipelineStepImpllinks_H_ */
|
/*
* File: BinFile.h
* Author: slate
*
* Created on April 5, 2013, 9:03 AM
*/
#ifndef BINFILE_H
#define BINFILE_H
#include <string>
namespace util {
class BinFile {
public:
BinFile();
BinFile(const BinFile& orig);
virtual ~BinFile();
unsigned int loadFile(const char *filename);
unsigned int loadFile(const wchar_t *filename);
unsigned int loadFile(std::string &filename);
unsigned int loadFile(std::wstring &filename);
unsigned int loadFile(std::wifstream &readfile);
const wchar_t *getData() { return _data; };
unsigned int size() { return _size; };
unsigned int resizeBuf(unsigned int new_size);
private:
wchar_t *_data;
unsigned int _buf_size;
unsigned int _size;
};
} // namespace util
#endif /* BINFILE_H */
|
// class Renderer encapsulates a specific rendering algorithm, which
// renders a given geometry (specific to the sub-class) to a given
// pixel buffer, using a given voxel array as texture data. All the
// details are in sub-classes. Subclasses will generally require
// additional attributes and access functions, and some will require
// additional pointers to working storage, e.g. a Z-buffer.
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "DrawBuffer.h"
#include "VoxelArray.h"
class Renderer
{
// Attributes
public:
DrawBuffer* m_pDB;
VoxelArray* m_pVoxels;
void SetDrawBuffer (DrawBuffer* pDB) { m_pDB = pDB; }
void SetVoxelArray (VoxelArray* pV) { m_pVoxels = pV; }
// Overridables
public:
// interactive rendering algorithm (fastest)
virtual void RenderQuick () = 0;
// background algorithm (best quality): monitors *pbContinue and
// returns FALSE immediately if it ever becomes FALSE; returns
// TRUE if runs to completion.
virtual BOOL RenderBest (BOOL* pbContinue) = 0;
};
|
/*!
NSDate extension
RFKit
Copyright (c) 2012-2013 BB9z
https://github.com/bb9z/RFKit
The MIT License (MIT)
http://www.opensource.org/licenses/mit-license.php
*/
#import <Foundation/Foundation.h>
@interface NSDate (RFKit)
- (BOOL)isSameDayWithDate:(NSDate *)date;
+ (NSString *)nowDate;
+(NSDate *)NSStringDateToNSDate:(NSString *)string;
+(NSDate *)NSStringDateToNSDateWithT:(NSString *)string;
+(NSDate *)NSStringDateToNSDateWithSecond:(NSString *)string;
+ (NSDate *)localNowDate;
- (NSString *)showSelf;
- (NSString *)showSelfWithoutTime;
@end
|
//
// SEGAppDelegate.h
// MixedArcExample
//
// Created by CocoaPods on 11/13/2014.
// Copyright (c) 2014 Samuel E. Giddins. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SEGAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/**
* \file
* Runtime functions
*
* Author:
* Jonathan Pryor
*
* (C) 2010 Novell, Inc.
*/
#ifndef _MONO_METADATA_RUNTIME_H_
#define _MONO_METADATA_RUNTIME_H_
#include <glib.h>
#include <mono/metadata/metadata.h>
#include <mono/utils/mono-publib.h>
#include <mono/utils/mono-compiler.h>
gboolean mono_runtime_try_shutdown (void);
void mono_runtime_init_tls (void);
MONO_PROFILER_API char* mono_runtime_get_aotid (void);
#endif /* _MONO_METADATA_RUNTIME_H_ */
|
#ifndef _BIN_GUARD
#define _BIN_GUARD
/* builtin stuff */
typedef void(builtin_func)(int argc, char* argv[]);
typedef struct builtin {
char const* name;
builtin_func* func;
} builtin;
builtin const* builtin_get(char const* name);
#endif
|
//
// AppDelegate.h
// KIZImagePlayer
//
// Created by Eugene on 15/8/13.
// Copyright (c) 2015年 kingizz. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
//
// NSData+JXKit.h
// JXKit
//
// Created by Jérôme ALVES on 27/02/13.
// Copyright (c) 2013 Jérôme Alves. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSData (JXKit)
- (NSString *)hexRepresentationString;
@end
|
//
// UIViewController+Hint.h
// BM4Group
//
// Created by 陈宇 on 16/2/1.
// Copyright © 2016年 陈宇. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, HintType) {
HintTypeSuccessful,
HintTypeFailure,
};
@interface UIViewController (Message)
/**
* 显示HintTypeSuccessful且offset为0的message
*
* @param message 显示的文字
*/
- (void)showMessage:(NSString *)message;
/**
* 根据HintType显示Message,默认offset为0
*
* @param message 显示的文字
* @param type 显示的消息类型
*/
- (void)showMessage:(NSString *)message type:(HintType)type;
/**
* 显示HintTypeSuccessful的Message
*
* @param message 显示的文字
* @param offset 偏移量
*/
- (void)showMessage:(NSString *)message offset:(CGFloat)offset;
/**
* 显示消息
*
* @param message 显示的文字
* @param type 显示的消息类型
* @param offset 偏移量
*/
- (void)showMessage:(NSString *)message type:(HintType)type offset:(CGFloat)offset;
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <AddressBookUI/ABCardGroup.h>
@class NSArray;
@interface ABCardFaceTimeGroup : ABCardGroup
{
NSArray *_displayItems;
}
- (id)displayItems;
- (void)dealloc;
@end
|
#include "../../blocks/lua/src/ltablib.c"
#include "../../blocks/lua/src/ltm.c"
#include "../../blocks/lua/src/lua.c"
#include "../../blocks/lua/src/lundump.c"
#include "../../blocks/lua/src/lutf8lib.c"
#include "../../blocks/lua/src/lvm.c"
#include "../../blocks/lua/src/lzio.c"
#include "../../blocks/lua/src/lapi.c"
#include "../../blocks/lua/src/lauxlib.c"
#include "../../blocks/lua/src/lbaselib.c"
#include "../../blocks/lua/src/lcode.c"
#include "../../blocks/lua/src/lcorolib.c"
#include "../../blocks/lua/src/lctype.c"
#include "../../blocks/lua/src/ldblib.c"
#include "../../blocks/lua/src/ldebug.c"
#include "../../blocks/lua/src/ldo.c"
#include "../../blocks/lua/src/ldump.c"
#include "../../blocks/lua/src/lfunc.c"
#include "../../blocks/lua/src/lgc.c"
#include "../../blocks/lua/src/linit.c"
#include "../../blocks/lua/src/liolib.c"
#include "../../blocks/lua/src/llex.c"
#include "../../blocks/lua/src/lmathlib.c"
#include "../../blocks/lua/src/lmem.c"
#include "../../blocks/lua/src/loadlib.c"
#include "../../blocks/lua/src/lobject.c"
#include "../../blocks/lua/src/lopcodes.c"
#include "../../blocks/lua/src/loslib.c"
#include "../../blocks/lua/src/lparser.c"
#include "../../blocks/lua/src/lstate.c"
#include "../../blocks/lua/src/lstring.c"
#include "../../blocks/lua/src/lstrlib.c"
#include "../../blocks/lua/src/ltable.c"
//#include "../../blocks/lua/src/luac.c" |
#include <iostream>
class checkLength {
public:
checkLength(std::size_t low, std::size_t up) : lowb(low), upb(up) {}
bool operator()(const std::string& cst) {
return (cst.size() <= upb && cst.size() >= lowb);
}
private:
std::size_t lowb;
std::size_t upb;
}; |
/*
* Developing IoT Solutions with Azure IoT - Microsoft Sample Code - Copyright (c) 2017 - Licensed MIT
*
*
* ©2017 Microsoft Corporation. All rights reserved. The text in this document is available under the
* Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/legalcode),
* additional terms may apply. All other content contained in this document (including, without limitation,
* trademarks, logos, images, etc.) are not included within the Creative Commons license grant. This
* document does not provide you with any legal rights to any intellectual property in any Microsoft
* product.
*
* This document is provided "as-is." Information and views expressed in this document, including URL
* and other Internet Web site references, may change without notice. You bear the risk of using it.
* Some examples are for illustration only and are fictitious. No real association is intended or inferred.
* Microsoft makes no warranties, express or implied, with respect to the information provided here.
*
*/
#ifndef WIRING_H_
#define WIRING_H_
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#ifdef __arm__
#include <wiringPi.h>
#include <wiringPiSPI.h>
#include "bme280.h"
#define WIRINGPI_SETUP 1
#define SPI_CHANNEL 0
#define SPI_CLOCK 1000000L
#define SPI_SETUP 1 << 2
#define BME_INIT 1 << 3
static unsigned int BMEInitMark = 0;
#elif _WIN32
#include <Windows.h>
#else
#include <linux/time.h>
#include <unistd.h>
#endif
#ifndef __arm__
#define HIGH 1
#define LOW 0
#define OUTPUT 0
#define INPUT 1
static uint64_t epochMilli;
#endif
int setupWiringPi()
{
#ifdef __arm__
int result;
if (result = wiringPiSetup() == 0)
{
BMEInitMark |= WIRINGPI_SETUP;
}
return result;
#elif __linux__
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
epochMilli = (uint64_t)ts.tv_sec * (uint64_t)1000 + (uint64_t)(ts.tv_nsec / 1000000L);
return 0;
#endif
}
void setPinMode(int pinNumber, int mode)
{
#ifdef __arm__
pinMode(pinNumber, mode);
#else
return; //no-op if not on Pi
#endif
}
void writeToPin(int pinNumber, int value)
{
#ifdef __arm__
digitalWrite(pinNumber, value);
#else
return; //no-op if not on Pi
#endif
}
int readFromPin(int pinNumber)
{
#ifdef __arm__
digitalRead(pinNumber);
#else
return; //no-op if not on Pi
#endif
}
void wait(int duration)
{
fflush(stdout);
#ifdef __arm__
delay(duration);
#elif _WIN32
Sleep(duration);
#else
usleep(duration * 1000);
#endif
}
unsigned int milli(void)
{
#ifdef __arm__
return millis();
#elif __linux__
uint64_t now;
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
now = (uint64_t)ts.tv_sec * (uint64_t)1000 + (uint64_t)(ts.tv_nsec / 1000000L);
return (uint32_t)(now - epochMilli);
#endif
}
int mask_check(int check, int mask)
{
return (check & mask) == mask;
}
// check whether the BMEInitMark's corresponding mark bit is set, if not, try to invoke corresponding init()
int check_bme_init()
{
#ifdef __arm__
// wiringPiSetup == 0 is successful
if (mask_check(BMEInitMark, WIRINGPI_SETUP) != 1 && wiringPiSetup() != 0)
{
return -1;
}
BMEInitMark |= WIRINGPI_SETUP;
// wiringPiSetup < 0 means error
if (mask_check(BMEInitMark, SPI_SETUP) != 1 && wiringPiSPISetup(SPI_CHANNEL, SPI_CLOCK) < 0)
{
return -1;
}
BMEInitMark |= SPI_SETUP;
// bme280_init == 1 is successful
if (mask_check(BMEInitMark, BME_INIT) != 1 && bme280_init(SPI_CHANNEL) != 1)
{
return -1;
}
BMEInitMark |= BME_INIT;
#endif
return 1;
}
#endif // WIRING_H_
|
/*
* The sources in the "XcodeKit" directory are based on the Ruby project Xcoder.
*
* Copyright (c) 2012 cisimple
*
* MIT License
*
* 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.
*/
#import "XCResource.h"
#import "XCFileReference.h"
@interface XCGroup : XCResource
+ (XCGroup *)createLogicalGroupWithName:(NSString *)name inRegistry:(XCObjectRegistry *)registry;
@property (strong) XCGroup *parentGroup;
- (NSArray *)children;
- (NSArray *)childGroups;
- (NSArray *)childFiles;
- (void)addChildGroup:(XCGroup *)group;
- (void)addChildFileReference:(XCFileReference *)reference;
- (void)removeChild:(XCResource *)resource;
- (void)removeFromParentGroup;
@end
#pragma mark -
@interface XCVariantGroup : XCGroup
@end
|
/* -*- c-basic-offset: 3 -*-
*
* ENSICAEN
* 6 Boulevard Marechal Juin
* F-14050 Caen Cedex
*
* This file is owned by ENSICAEN students.
* No portion of this document may be reproduced, copied
* or revised without written permission of the authors.
*/
/**
* @author Hicham Benjelloun <benjelloun@ecole.ensicaen.fr>
* @version 1.0 - Fev 08, 2013
*
* @todo the list of improvements suggested for the file.
* @bug the list of known bugs.
*/
/**
* @file map.c
*
* Description of the program objectives.
* All necessary references.
*/
#include "map.h"
char **createEmptyMatrix(int w,int h)
{
int i,j;
char **m=(char **)calloc(w,sizeof(char *));
for(i=0;i<w;i++)
{
m[i]=(char *)calloc(h,sizeof(char));
}
return m;
}
void destroyMatrix(int **m,int w,int h)
{
int i;
for(i=0;i<w;i++)
{
free(m[i]);
}
free(m);
}
Map *createEmptyMap(int w,int h)
{
int i;
Map *m=(Map *)malloc(sizeof(Map));
m->searchLevel=0;
m->w=w;
m->h=h;
m->players=(Vect **)malloc(sizeof(Vect));
for(i=0;i<2;i++)
{
m->players[i]=(Vect *)malloc(sizeof(Vect));
}
m->cell=(char **)malloc(w*sizeof(char *));
for(i=0;i<w;i++)
{
m->cell[i]=(char *)malloc(h*sizeof(char));
}
return m;
}
void destroyMap(Map *m)
{
int i;
for(i=0;i<m->w;i++)
{
free(m->cell[i]);
}
free(m->cell);
free(m);
}
Map *getMapFromStream(FILE *f)
{
Map *m;
int i,j,h,w;
char c;
fscanf(f,"%d %d\n",&h,&w);
m=createEmptyMap(w,h);
for(i=0;i<w;i++)
{
for(j=0;j<h;j++)
{
m->cell[i][j]=fgetc(f);
}
fgetc(f);
}
return m;
}
void displayMap(Map *m)
{
int i,j;
FILE *f=fopen("map.txt","a+");
fprintf(f,"\033[33mAffichage de la carte\033[0m\n");
for(i=0;i<m->w;i++)
{
for(j=0;j<m->h;j++)
{
fprintf(f,"%c",m->cell[i][j]);
}
fprintf(f,"\n");
}
fclose(f);
}
|
//
// RHEmojiView.h
// RHToolkitsDemo
//
// Created by zhuruhong on 15/7/17.
// Copyright (c) 2015年 zhuruhong. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RHEmojiView : UIView
@end
|
//
// CMConnection.h
// CMSignals
//
// Created by Tiago Bastos on 26/01/2013.
// Copyright (c) 2013 Codeminer42. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CMConnection : NSObject <NSCopying>
@property (nonatomic, strong) id sender;
@property (nonatomic, strong) id receiver;
@property (assign) SEL slot;
@property (assign) SEL signal;
@property (assign) id observer;
@end
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_JKLArrayDataSource_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_JKLArrayDataSource_TestsVersionString[];
|
//
// TBAStoreManager.h
// Mussels
//
// Copyright (C) 2015 Xiao Yao. All Rights Reserved.
// See LICENSE.txt for more information.
//
@import Foundation;
@import StoreKit;
@class TBAStoreManager;
#pragma mark - TBAStoreManagerObserver
/**
* Store manager protocol.
*/
@protocol TBAStoreManagerObserver <NSObject>
@optional
/**
* Called when the store manager has attempted to fetch products.
*
* @param storeManager The store manager.
* @param products Dictionary of SKProduct objects
* @param invalidProductIDs Array of NSString objects.
*/
- (void)storeManager:(TBAStoreManager *)storeManager didFetchProducts:(NSDictionary *)products invalidProductIdentifiers:(NSArray *)invalidProductIDs;
/**
* Called when the store manager has purchased a product.
*
* @param storeManager The store manager.
* @param productID The product's identifier.
*/
- (void)storeManager:(TBAStoreManager *)storeManager didPurchaseProductWithIdentifier:(NSString *)productID;
@end
#pragma mark - TBAStoreManager
/**
* Manages interactions with StoreKit, such as loading, purchasing and restoring products.
*/
@interface TBAStoreManager : NSObject
/**
* A dictionary of products. The product identifiers are used as the keys of the dictionary.
*/
@property (nonatomic, strong, readonly) NSDictionary *availableProducts;
/**
* The invalid product identifiers.
*/
@property (nonatomic, strong, readonly) NSArray *invalidProductIdentifiers;
/**
* The shared instance of the store manager.
*
* @return The shared instance of the store manager.
*/
+ (TBAStoreManager *)sharedInstance;
/**
* Attempts to fetch the products associated with the product identifiers.
*
* @param productIDs Set of strings representing the product identifiers.
*/
- (void)fetchProductsWithIdentifiers:(NSSet *)productIDs;
/**
* Attempts to purchase the product.
*
* @param productID The product.
*/
- (void)purchaseProduct:(SKProduct *)product;
/**
* Attempts to restore any purchased products.
*/
- (void)restoreProducts;
/**
* A set of strings representing purchased product identifiers.
*
* @return NSSet or nil.
*/
- (NSSet *)purchasedProductIdentifiers;
/**
* Tracks if a product has been purchased.
*
* @param productID The product identifier.
*
* @return YES if purchased.
*/
- (BOOL)isProductAvailable:(NSString *)productID;
/**
* Add an observer. The observer begins to recieve notifications when the protocol methods are called.
*
* @param observer An object conforming to the TBAStoreManagerObserver protocol.
*/
- (void)addObserver:(id<TBAStoreManagerObserver>)observer;
/**
* Removes an observer. The observer no longer recieves notifications when the protocol methods are called.
*
* @param observer The observer.
*/
- (void)removeObserver:(id)observer;
/**
* Generates the price string for the product including the localization.
*
* @param product The product.
*
* @return Price string or nil.
*/
- (NSString *)priceStringForProduct:(SKProduct *)product;
@end
|
#include <stdio.h>
#include <assert.h>
//#include <string.h>
#define __XPG4 // itoa, strccase
#define __UU
#define __OE_8
#include <stdlib.h>
#if defined(__IBMC__) || defined(__GNUC__)
#include <strings.h>
#elif defined(_MSC_VER)
#include <string.h>
#define strcasecmp _stricmp
#else
// error : compiler not supported
#endif
#include <string.h>
#include "debug.h"
#include "Grammar.h"
#include "Lexer.h"
#include "Rexxcom.h"
#include "Helper.h"
#include "generate.h"
#include "check.h"
extern token lookahead;
int main(int argc, char** argv){
printf ("test debug lvl (%d)\n",DEBUG_LVL);
int ast_len=0;
#ifndef __IBMC__
for (int i = 0; i < argc;i++) {
debug_3("argv[%d] = %s \n",i,argv[i]);
}
__osplist = argv;
char str_argc[4] = "";
sprintf(str_argc,"%d", argc);
__osplist[0] = str_argc;
#endif
getArgsRexx();
lookahead = getNextToken();
ast* sntce = get_sentence();
if(sntce){
scr_line* screen;
screen=init_screen();
debug_1("ast Chain_length = (%d) \n",chain_length(sntce));
debug_2("Drawing (%s) \n",tagValues[sntce->tag]);
assert(sntce->tag == SENTENCE);
affich_node(sntce,screen);
debug_2("Printing (%s) \n",tagValues[sntce->tag]);
print_boxes(screen);
free_node(sntce);
}
else free_node(sntce);
ast* data=NULL;
if (balayeur_pgm()){
if(data=data_division()){
scr_line* screen;
screen=init_screen();
debug_1("Drawing (%d) (%d) \n",data,data->tag);
assert(data->tag == DATA_DIV);
// affich_node(data,screen);
affich_node(data->node.data_div.ws_sect,screen);
print_boxes(screen);
screen=init_screen();
affich_node(data->node.data_div.file_sect,screen);
print_boxes(screen);
screen=init_screen();
affich_node(data->node.data_div.link_sect,screen);
print_boxes(screen);
free_node(data);
}
}
/*
ast* data = get_data();
if(data){
scr_line* screen;
screen=init_screen();
ast_len = chain_length(data);
debug_1("ast Chain_length = (%d) \n",ast_len);
debug_1("Drawing (%d) (%d) \n",data,data->tag);
assert(data->tag == FIELD);
affich_node(data,screen);
debug_2("Printing (%s) \n",tagValues[data->tag]);
print_boxes(screen);
// gen_initialize_ran (data);
gen_display_ran (data);
free_node(data);
}
*/
debug_1(" END MAIN. \n");
return 0;
}
|
#ifndef OBSIDIAN2D_CORE_UTIL_H
#define OBSIDIAN2D_CORE_UTIL_H
#include "vulkan/vulkan.h"
#if defined(NDEBUG) && defined(__GNUC__)
#define U_ASSERT_ONLY __attribute__((unused))
#else
#define U_ASSERT_ONLY
#endif
#ifdef ASSETS_FOLDER_PATH
#define ASSETS_FOLDER_PATH_STR ASSETS_FOLDER_PATH
#else
#define ASSETS_FOLDER_PATH_STR "."
#endif
#include <vector>
#include <fstream>
#include <cstring>
#include <cassert>
#include <iostream>
#include <chrono>
namespace Engine
{
namespace Util
{
class Util
{
public:
Util() = delete;
static void initViewport(vk::CommandBuffer cmd_buffer, uint32_t width, uint32_t height);
static void initScissor(vk::CommandBuffer cmd_buffer, uint32_t width, uint32_t height);
static std::string physicalDeviceTypeString(vk::PhysicalDeviceType type);
static vk::ShaderModule loadSPIRVShader(const std::string& filename);
};
}
}
#endif //OBSIDIAN2D_CORE_UTIL_H
|
/*
** minishell.h for minishell in /Users/laxa/Documents/C/minishell
**
** Made by Julien EGLOFF
** Login <laxa>
**
** Started on Fri Nov 13 15:51:45 2015 Julien EGLOFF
** Last update Mon Nov 23 10:45:16 2015 EGLOFF Julien
*/
#ifndef __MINISHELL_H__
# define __MINISHELL_H__
# define UNUSED __attribute__ ((unused))
# define BUFFER_SIZE 1024
# define BUILTINS_NAME_SIZE 12
typedef struct s_builtins t_builtins;
typedef struct s_shell t_shell;
typedef struct s_env t_env;
struct s_builtins
{
char name[BUILTINS_NAME_SIZE];
void (*f)(char ** argv, t_shell *shell);
t_builtins *next;
};
struct s_shell
{
t_env *env;
t_builtins *builtins;
char quit;
};
struct s_env
{
t_env *next;
char *var;
};
void init_signals(void);
void reset_signals_state(void);
#endif /* !__MINISHELL_H__ */
|
#ifndef RESULTKEY_H
#define RESULTKEY_H
#include "eirRes.h"
#include <eirType/EightCC.h>
#define RESULTKEY_ENUM(NV) \
class EIRRESSHARED_EXPORT ResultCode : public EightCC
{
public:
ResultCode(void);
ResultCode(const quint64 value);
ResultCode(const char * pc);
};
Q_DECLARE_TYPEINFO(ResultCode, Q_PRIMITIVE_TYPE);
Q_DECLARE_METATYPE(ResultCode)
#endif // RESULTKEY_H
|
//
// FNRemoveKey.h
// Language
//
// Created by Todd Ditchendorf on 2/14/17.
// Copyright © 2017 Celestial Teapot. All rights reserved.
//
#import "XPFunctionBody.h"
@interface FNRemoveKey : XPFunctionBody
@end
|
/*
* Copyright (c) 2016 TAKAMORI Kaede <etheriqa@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#pragma once
#include <arpa/inet.h>
#include <assert.h>
#include <stdint.h>
#include <world.h>
static inline uintmax_t world_encode_key_size(world_key_size key_size);
static inline uintmax_t world_decode_key_size(world_key_size key_size);
static inline uintmax_t world_encode_data_size(world_data_size data_size);
static inline uintmax_t world_decode_data_size(world_data_size data_size);
static inline uintmax_t world_encode_key_size(world_key_size key_size)
{
_Static_assert(sizeof(world_key_size) == sizeof(uint16_t), "world_key_size is uint16_t");
return htons(key_size);
}
static inline uintmax_t world_decode_key_size(world_key_size key_size)
{
_Static_assert(sizeof(world_key_size) == sizeof(uint16_t), "world_key_size is uint16_t");
return ntohs(key_size);
}
static inline uintmax_t world_encode_data_size(world_data_size data_size)
{
_Static_assert(sizeof(world_data_size) == sizeof(uint16_t), "world_data_size is uint16_t");
return htons(data_size);
}
static inline uintmax_t world_decode_data_size(world_data_size data_size)
{
_Static_assert(sizeof(world_data_size) == sizeof(uint16_t), "world_data_size is uint16_t");
return ntohs(data_size);
}
|
/* misc.h
*
* Copyright (C) 2006-2016 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef WOLF_CRYPT_MISC_H
#define WOLF_CRYPT_MISC_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NO_INLINE
WOLFSSL_LOCAL
word32 rotlFixed(word32, word32);
WOLFSSL_LOCAL
word32 rotrFixed(word32, word32);
WOLFSSL_LOCAL
word32 ByteReverseWord32(word32);
WOLFSSL_LOCAL
void ByteReverseWords(word32*, const word32*, word32);
WOLFSSL_LOCAL
void XorWords(wolfssl_word*, const wolfssl_word*, word32);
WOLFSSL_LOCAL
void xorbuf(void*, const void*, word32);
WOLFSSL_LOCAL
void ForceZero(const void*, word32);
WOLFSSL_LOCAL
int ConstantCompare(const byte*, const byte*, int);
#ifdef WORD64_AVAILABLE
WOLFSSL_LOCAL
word64 rotlFixed64(word64, word64);
WOLFSSL_LOCAL
word64 rotrFixed64(word64, word64);
WOLFSSL_LOCAL
word64 ByteReverseWord64(word64);
WOLFSSL_LOCAL
void ByteReverseWords64(word64*, const word64*, word32);
#endif /* WORD64_AVAILABLE */
#ifndef WOLFSSL_HAVE_MIN
#if defined(HAVE_FIPS) && !defined(min) /* so ifdef check passes */
#define min min
#endif
WOLFSSL_LOCAL word32 min(word32 a, word32 b);
#endif
#ifndef WOLFSSL_HAVE_MAX
#if defined(HAVE_FIPS) && !defined(max) /* so ifdef check passes */
#define max max
#endif
WOLFSSL_LOCAL word32 max(word32 a, word32 b);
#endif /* WOLFSSL_HAVE_MAX */
#endif /* NO_INLINE */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WOLF_CRYPT_MISC_H */
|
//
// ZFThreeCollectionView.h
// ZF_iOS
//
// Created by 张木锋 on 2017/10/9.
// Copyright © 2017年 张木锋. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ZFThreeCollectionView : UICollectionView
@end
|
#ifndef LYNX_LEPUS_VM_CONTEXT_H_
#define LYNX_LEPUS_VM_CONTEXT_H_
#include <list>
#include <unordered_map>
#include "lepus/context.h"
#include "lepus/value.h"
#include "lepus/lepus_string.h"
#include "lepus/heap.h"
namespace lepus {
class VMContext : public Context {
public:
virtual ~VMContext();
virtual void Initialize();
virtual void Execute(const std::string& source);
virtual Value Call(const std::string& name, const std::vector<Value>& args);
virtual long GetParamsSize();
virtual Value* GetParam(long index);
virtual bool UpdateTopLevelVariable(const std::string &name, Value value);
protected:
friend class CodeGenerator;
Heap& heap() {
return heap_;
}
private:
void Run();
void RunFrame();
bool CallFunction(Value* function, size_t argc, Value* ret);
void GenerateClosure(Value* value, long index);
Heap heap_;
std::list<Frame> frames_;
protected:
friend class CodeGenerator;
std::unordered_map<String*, long> top_level_variables_;
base::ScopedPtr<Function> root_function_;
};
}
#endif
|
// 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.
//
// SidebarViewController.h
// SidebarDemo
//
// Created by Simon on 29/6/13.
// Copyright (c) 2013 Appcoda. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "APAddCarViewController.h"
@interface SidebarViewController : UITableViewController <NSFetchedResultsControllerDelegate, AddViewControllerDelegate, UITableViewDelegate>
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *addCarButton;
@end
|
//
// PLCoreDataStack.h
// PLDataSource
//
// Created by Hirad Motamed on 2015-11-15.
// Copyright © 2015 Hirad Motamed. All rights reserved.
//
#import <Foundation/Foundation.h>
@class NSManagedObjectContext;
@interface PLCoreDataStack : NSObject
@property (nonatomic, readonly) NSManagedObjectContext* managedObjectContext;
-(void)save;
@end
|
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2019 I-SYST inc.
*
* 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.
*/
#define MICROPY_HW_BOARD_NAME "BLUEIO-TAG-EVIM"
#define MICROPY_HW_MCU_NAME "NRF52832"
#define MICROPY_PY_SYS_PLATFORM "BLYST Nano"
#define MICROPY_PY_MACHINE_SOFT_PWM (1)
#define MICROPY_PY_MUSIC (1)
#define MICROPY_PY_MACHINE_UART (1)
#define MICROPY_PY_MACHINE_HW_PWM (1)
#define MICROPY_PY_MACHINE_HW_SPI (1)
#define MICROPY_PY_MACHINE_TIMER (1)
#define MICROPY_PY_MACHINE_RTCOUNTER (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_ADC (1)
#define MICROPY_PY_MACHINE_TEMP (1)
#define MICROPY_PY_RANDOM_HW_RNG (1)
#define MICROPY_HW_HAS_LED (1)
#define MICROPY_HW_LED_COUNT (4)
#define MICROPY_HW_LED_PULLUP (1)
#define MICROPY_HW_LED1 (30) // LED1
#define MICROPY_HW_LED1_PULLUP (0)
#define MICROPY_HW_LED2 (20) // LED2
#define MICROPY_HW_LED3 (19) // LED3
#define MICROPY_HW_LED4 (18) // LED4
// UART config
#define MICROPY_HW_UART1_RX (8)
#define MICROPY_HW_UART1_TX (7)
#define MICROPY_HW_UART1_CTS (12)
#define MICROPY_HW_UART1_RTS (11)
#define MICROPY_HW_UART1_HWFC (1)
// SPI0 config
#define MICROPY_HW_SPI0_NAME "SPI0"
#define MICROPY_HW_SPI0_SCK (23) //
#define MICROPY_HW_SPI0_MOSI (24) //
#define MICROPY_HW_SPI0_MISO (25) //
#define MICROPY_HW_PWM0_NAME "PWM0"
#define MICROPY_HW_PWM1_NAME "PWM1"
#define MICROPY_HW_PWM2_NAME "PWM2"
// buzzer pin
#define MICROPY_HW_MUSIC_PIN (14)
#define HELP_TEXT_BOARD_LED "1,2,3,4"
|
//
// RUPatternDetailViewController.h
// Drink.io
//
// Created by Paul Jones on 11/23/13.
// Copyright (c) 2013 Principles of Informations and Data Management. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RUPatternDetailViewController : UIViewController
@property IBOutlet UILabel * ageLabel;
@property IBOutlet UILabel * genderLable;
@property (assign, nonatomic) NSInteger ageGroup;
@property (assign, nonatomic) NSInteger gender;
@end
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
// Not exported
@interface CPLocalizedStringMessages : NSObject
{
}
+ (void)initialize;
@end
|
//
// NTAnalyticsTimedEvent.h
//
#import "NTAnalyticsEvent.h"
@interface NTAnalyticsTimedEvent : NTAnalyticsEvent
-(void)start;
-(void)start:(NSDictionary *)params;
-(void)end;
-(void)end:(NSDictionary *)params;
@end
|
//矩阵头文件
//matrix.h
//支持线性规划一章的自定义数据结构
#include <iostream>
#include <cstring>
#ifndef MAX
#define MAX 60
#endif
using std::cout;
using std::endl;
struct matrix{
double m_m[MAX][MAX];
int m_row, m_col;
matrix(int crow = 0, int ccol = 0)
: m_row(crow), m_col(ccol){
memset(m_m, 0, MAX * MAX * sizeof(double));
}
matrix(const matrix& cr)
: m_row(cr.m_row), m_col(cr.m_col){
for(int i = 0; i < MAX; ++ i)
for(int j = 0; j < MAX; ++ j)
m_m[i][j] = cr.m_m[i][j];
}
matrix operator+(matrix cr){
matrix t(*this);
for(int i = 0; i < cr.m_row; ++ i)
for(int j = 0; j < cr.m_col; ++ j)
t.m_m[i][j] += cr.m_m[i][j];
return(t);
}
matrix operator-(matrix cr){
matrix t(*this);
for(int i = 0; i < cr.m_row; ++ i)
for(int j = 0; j < cr.m_col; ++ j)
t.m_m[i][j] -= cr.m_m[i][j];
return(t);
}
matrix operator*(matrix cr){
matrix t(m_row, cr.m_col);
for(int i = 0; i < m_row; ++ i)
for(int j = 0; j < cr.m_col; ++ j)
for(int k = 0; k < m_col; ++ k)
t.m_m[i][j] += m_m[i][k] * cr.m_m[k][j];
return(t);
}
void m_print()
{
for(int i = 0; i < m_row; ++ i){
for(int j = 0; j < m_col; ++ j)
cout << m_m[i][j] << '\t';
cout << endl;
}
}
};
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "PBCodable.h"
#import "NSCopying-Protocol.h"
@class NSString;
@interface GEORPUserCredentials : PBCodable <NSCopying>
{
NSString *_iCloudUserMapsAuthToken;
NSString *_iCloudUserPersonID;
}
@property(retain, nonatomic) NSString *iCloudUserMapsAuthToken; // @synthesize iCloudUserMapsAuthToken=_iCloudUserMapsAuthToken;
@property(retain, nonatomic) NSString *iCloudUserPersonID; // @synthesize iCloudUserPersonID=_iCloudUserPersonID;
- (unsigned long long)hash;
- (_Bool)isEqual:(id)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (void)copyTo:(id)arg1;
- (void)writeTo:(id)arg1;
- (_Bool)readFrom:(id)arg1;
- (id)dictionaryRepresentation;
- (id)description;
@property(readonly, nonatomic) _Bool hasICloudUserMapsAuthToken;
@property(readonly, nonatomic) _Bool hasICloudUserPersonID;
- (void)dealloc;
@end
|
#ifndef BOARD_H_
#define BOARD_H_
#include <stdbool.h>
#include <stdint.h>
#include "misc.h"
#define BOARD_SIZE 8
#define PLAYERS 2
typedef uint_fast16_t Square;
#define SQUARE(x, y) (((x) << 8) | (y))
#define SQUARE_X(s) ((s) >> 8)
#define SQUARE_Y(s) ((s) & 0xF)
#define NULL_SQUARE ((Square)(~((Square)0)))
// Pieces are represented as shorts, with the MSB used to store the color, and
// the rest equal to one of a bunch of constants for the type of piece.
typedef unsigned short Piece;
typedef enum Player
{
BLACK = 0,
WHITE = 1,
} Player;
#define OTHER_PLAYER(p) ((p) == WHITE ? BLACK : WHITE)
// The order of these matters
typedef enum Piece_type
{
EMPTY,
PAWN,
KNIGHT,
BISHOP,
ROOK,
QUEEN,
KING,
} Piece_type;
#define PIECE_TYPES 6
#define PLAYER(x) ((Player)((x) >> (sizeof(Piece) * 8 - 1)))
#define PIECE_TYPE(x) ((Piece_type)((x) & ~(1 << (sizeof(Piece) * 8 - 1))))
#define PIECE(p, t) ((Piece)(((p) << (sizeof(Piece) * 8 - 1)) | (t)))
#define NULL_PIECE ((unsigned short)-1)
typedef struct Castling
{
bool kingside;
bool queenside;
} Castling;
// The board is an array of pieces, plus some other information:
// * Whose turn it is
// * Castling availibility
// * En passant target square (if any)
// * Halfmoves since the last capture or pawn advance
// * Move number
//
// This is similar to FEN.
// The intention behind having all this information in the board object is so
// that no other information is required to determine any necessary information
// about a board position.
//
// However, this structure does not contain information necessary to determine
// if a draw can be claimed by threefold repetition. This is unlikely to
// matter, as the most common case of threefold repetition is perpetual check,
// in which case coming in part-way through does not matter. The other cases
// are rare enough that it doesn't seem worthwhile to overly complicate the
// board representation over them.
typedef struct Board
{
Player turn;
Castling castling[PLAYERS];
Square en_passant;
uint half_move_clock;
uint move_number;
Piece pieces[BOARD_SIZE * BOARD_SIZE];
} Board;
#define PIECE_AT(b, x, y) ((b)->pieces[((y) * BOARD_SIZE) + (x)])
#define PIECE_AT_SQUARE(b, square) PIECE_AT(b, SQUARE_X(square), SQUARE_Y(square))
void copy_board(Board *dst, Board *src);
Piece piece_from_char(char c);
char char_from_piece(Piece p);
bool from_fen(Board *board, const char *fen_str);
void print_board(Board *b);
bool in_check(Board *board, Player p);
bool checkmate(Board *board, Player p);
bool can_castle_kingside(Board *board, Player p);
bool can_castle_queenside(Board *board, Player p);
extern char *start_board_fen;
#endif // include guard
|
// Copyright (c) 2005 Stanford University (USA).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Daniel Russel <drussel@alumni.princeton.edu>
#ifndef CGAL_POLYNOMIAL_INTERNAL_MACROS_H
#define CGAL_POLYNOMIAL_INTERNAL_MACROS_H
#include <CGAL/Polynomial/internal/config.h>
#ifdef CGAL_POLYNOMIAL_USE_CGAL
/*
When CGAL is present
*/
#include <CGAL/basic.h>
#define CGAL_POLYNOMIAL_NS CGAL::POLYNOMIAL
#define CGAL_Polynomial_assertion(x) CGAL_assertion(x)
#define CGAL_Polynomial_assertion_code(x) CGAL_assertion_code(x)
#define CGAL_Polynomial_precondition(x) CGAL_precondition(x)
#define CGAL_Polynomial_precondition_code(x) CGAL_precondition_code(x)
#define CGAL_Polynomial_postcondition(x) CGAL_postcondition(x)
#ifdef CGAL_POLYNOMIAL_CHECK_EXPENSIVE
#define CGAL_Polynomial_expensive_precondition(x) CGAL_expensive_precondition(x)
#define CGAL_Polynomial_expensive_assertion(x) CGAL_expensive_assertion(x)
#define CGAL_Polynomial_expensive_postcondition(x) CGAL_expensive_postcondition(x)
#else
#define CGAL_Polynomial_expensive_precondition(x)
#define CGAL_Polynomial_expensive_assertion(x)
#define CGAL_Polynomial_expensive_postcondition(x)
#endif
#define CGAL_Polynomial_exactness_assertion(x) CGAL_exactness_assertion(x)
#define CGAL_Polynomial_exactness_postcondition(x) CGAL_exactness_postcondition(x)
#define CGAL_Polynomial_exactness_precondition(x) CGAL_exactness_precondition(x)
#else
/*
When no CGAL is present
*/
#define POLYNOMIAL_NS Polynomial
#include <cassert>
#define CGAL_Polynomial_assertion(x) CGAL_assertion(x)
// This does not work
#define CGAL_Polynomial_assertion_code(x) x
#define CGAL_Polynomial_precondition(x) CGAL_assertion(x)
#define CGAL_Polynomial_postcondition(x) CGAL_assertion(x)
#define CGAL_Polynomial_expensive_precondition(x)
#define CGAL_Polynomial_expensive_assertion(x)
#define CGAL_Polynomial_expensive_postcondition(x)
#define CGAL_Polynomial_exactness_postcondition(x)
#define CGAL_Polynomial_exactness_precondition(x)
#endif
#endif
|
//
// BMDownloadAPIManager.h
// BMWash
//
// Created by fenglh on 2017/2/20.
// Copyright © 2017年 月亮小屋(中国)有限公司. All rights reserved.
//
#import <BMBaseAPIManager.h>
@interface BMDownloadAPIManager : BMBaseAPIManager
/**
* 描述:文件下载
* 参数:url 完整的url地址,例如:http://abc.com/abc/file.txt
*/
- (NSInteger )downloadDataWithUrl:(NSString *)url;
@end
|
#import "TCCategory.h"
@interface UITextField (Inspectable)
/** placeholder 颜色 */
@property (strong, nonatomic) IBInspectable UIColor *placeholderColor;
/** UITextField 的边框左侧和文字左侧的距离 */
@property (assign, nonatomic) IBInspectable CGFloat leadingSpacing;
/** UITextField 的边框右侧和文字右侧的距离 */
@property (assign, nonatomic) IBInspectable CGFloat taillingSpacing;
/** 设置该属性的时候,IB中的textFiled的borderStyle设置为默认 */
@property (assign, nonatomic) IBInspectable BOOL borderStyleNone;
@end
|
//
// GMSServices.h
// Google Maps SDK for iOS
//
// Copyright 2012 Google LLC
//
// Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
// Service: https://developers.google.com/maps/terms
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* Service class for the Google Maps SDK for iOS.
*
* This class is not thread safe. All methods should only be invoked on the main thread.
*/
@interface GMSServices : NSObject
/**
* Provides the shared instance of GMSServices for the Google Maps SDK for iOS, creating it if
* necessary. Classes such as GMSMapView and GMSPanoramaView will hold this instance to provide
* their connection to Google.
*
* This is an opaque object. If your application often creates and destroys view or service classes
* provided by the Google Maps SDK for iOS, it may be useful to hold onto this object directly, as
* otherwise your connection to Google may be restarted on a regular basis. It also may be useful to
* take this object in advance of the first map creation, to reduce initial map creation performance
* cost.
*
* This method will throw an exception if provideAPIKey: has not been called.
*/
+ (id<NSObject>)sharedServices;
/**
* Provides your API key to the Google Maps SDK for iOS. This key is generated for your application
* via the Google Cloud Platform Console, and is paired with your application's bundle ID to
* identify it. This must be called exactly once by your application before any iOS Maps SDK
* object is initialized.
*
* @return YES if the APIKey was successfully provided.
*/
+ (BOOL)provideAPIKey:(NSString *)APIKey;
/**
* Provides your API options to the Google Maps SDK for iOS. Pass an array containing an NSString
* for each option. These options apply to all maps.
*
* This may be called exactly once by your application and must be called before any iOS Maps SDK
* object is initialized.
*
* @return YES if all the APIOptions were successfully provided.
*/
+ (BOOL)provideAPIOptions:(NSArray<NSString *> *)APIOptions;
/**
* Returns the open source software license information for Google Maps SDK for iOS. This
* information must be made available within your application.
*/
+ (NSString *)openSourceLicenseInfo;
/**
* Returns the version for this release of the Google Maps SDK for iOS. For example, "1.0.0"
*/
+ (NSString *)SDKVersion;
/**
* Returns the long version for this release of the Google Maps SDK for iOS. For example, "1.0.0
* (102.1)".
*/
+ (NSString *)SDKLongVersion;
@end
NS_ASSUME_NONNULL_END
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "PBXFrameworksBuildPhase.h"
@interface PBXFrameworksBuildPhase (PBXFileBuildPhaseModuleAdditions)
- (id)displayNameForAttributeOfBuildFile:(id)arg1 forColumnAtIndex:(long long)arg2;
- (id)attributeOfBuildFile:(id)arg1 forColumnAtIndex:(long long)arg2;
@end
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: ./suggest/src/java/org/apache/lucene/search/spell/JaroWinklerDistance.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_OrgApacheLuceneSearchSpellJaroWinklerDistance")
#ifdef RESTRICT_OrgApacheLuceneSearchSpellJaroWinklerDistance
#define INCLUDE_ALL_OrgApacheLuceneSearchSpellJaroWinklerDistance 0
#else
#define INCLUDE_ALL_OrgApacheLuceneSearchSpellJaroWinklerDistance 1
#endif
#undef RESTRICT_OrgApacheLuceneSearchSpellJaroWinklerDistance
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability"
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
#if !defined (OrgApacheLuceneSearchSpellJaroWinklerDistance_) && (INCLUDE_ALL_OrgApacheLuceneSearchSpellJaroWinklerDistance || defined(INCLUDE_OrgApacheLuceneSearchSpellJaroWinklerDistance))
#define OrgApacheLuceneSearchSpellJaroWinklerDistance_
#define RESTRICT_OrgApacheLuceneSearchSpellStringDistance 1
#define INCLUDE_OrgApacheLuceneSearchSpellStringDistance 1
#include "org/apache/lucene/search/spell/StringDistance.h"
/*!
@brief Similarity measure for short strings such as person names.
<p>
- seealso: <a href="http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance">http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance</a>
*/
@interface OrgApacheLuceneSearchSpellJaroWinklerDistance : NSObject < OrgApacheLuceneSearchSpellStringDistance >
#pragma mark Public
/*!
@brief Creates a new distance metric with the default threshold
for the Jaro Winkler bonus (0.7)
- seealso: #setThreshold(float)
*/
- (instancetype __nonnull)init;
- (jboolean)isEqual:(id)obj;
- (jfloat)getDistanceWithNSString:(NSString *)s1
withNSString:(NSString *)s2;
/*!
@brief Returns the current value of the threshold used for adding the Winkler bonus.
The default value is 0.7.
@return the current value of the threshold
*/
- (jfloat)getThreshold;
- (NSUInteger)hash;
/*!
@brief Sets the threshold used to determine when Winkler bonus should be used.
Set to a negative value to get the Jaro distance.
@param threshold the new value of the threshold
*/
- (void)setThresholdWithFloat:(jfloat)threshold;
- (NSString *)description;
@end
J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchSpellJaroWinklerDistance)
FOUNDATION_EXPORT void OrgApacheLuceneSearchSpellJaroWinklerDistance_init(OrgApacheLuceneSearchSpellJaroWinklerDistance *self);
FOUNDATION_EXPORT OrgApacheLuceneSearchSpellJaroWinklerDistance *new_OrgApacheLuceneSearchSpellJaroWinklerDistance_init(void) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT OrgApacheLuceneSearchSpellJaroWinklerDistance *create_OrgApacheLuceneSearchSpellJaroWinklerDistance_init(void);
J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchSpellJaroWinklerDistance)
#endif
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneSearchSpellJaroWinklerDistance")
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64a.c
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-64a.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: console Read input from the console
* GoodSource: Fixed string
* Sinks: w32spawnl
* BadSink : execute command with wspawnl
* Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir"
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"ls"
#define COMMAND_ARG2 L"-la"
#define COMMAND_ARG3 data
#endif
#include <process.h>
#ifndef OMITBAD
/* bad function declaration */
void CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64b_badSink(void * dataVoidPtr);
void CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64_bad()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64b_badSink(&data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64b_goodG2BSink(void * dataVoidPtr);
static void goodG2B()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64b_goodG2BSink(&data);
}
void CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64_good()
{
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE78_OS_Command_Injection__wchar_t_console_w32spawnl_64_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_01.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE129.label.xml
Template File: sources-sinks-01.tmpl.c
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: large Large index value that is greater than 10-1
* GoodSource: Larger than zero but less than 10
* Sinks:
* GoodSink: Ensure the array index is valid
* BadSink : Improperly check the array index by not checking the upper bound
* Flow Variant: 01 Baseline
*
* */
#include "std_testcase.h"
#ifndef OMITBAD
void CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_01_bad()
{
int data;
/* Initialize data */
data = -1;
/* POTENTIAL FLAW: Use an invalid index */
data = 10;
{
int i;
int * buffer = (int *)malloc(10 * sizeof(int));
/* initialize buffer */
for (i = 0; i < 10; i++)
{
buffer[i] = 0;
}
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
free(buffer);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
static void goodG2B()
{
int data;
/* Initialize data */
data = -1;
/* FIX: Use a value greater than 0, but less than 10 to avoid attempting to
* access an index of the array in the sink that is out-of-bounds */
data = 7;
{
int i;
int * buffer = (int *)malloc(10 * sizeof(int));
/* initialize buffer */
for (i = 0; i < 10; i++)
{
buffer[i] = 0;
}
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
free(buffer);
}
}
/* goodB2G uses the BadSource with the GoodSink */
static void goodB2G()
{
int data;
/* Initialize data */
data = -1;
/* POTENTIAL FLAW: Use an invalid index */
data = 10;
{
int i;
int * buffer = (int *)malloc(10 * sizeof(int));
/* initialize buffer */
for (i = 0; i < 10; i++)
{
buffer[i] = 0;
}
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
free(buffer);
}
}
void CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_01_good()
{
goodG2B();
goodB2G();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_01_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE122_Heap_Based_Buffer_Overflow__c_CWE129_large_01_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
//
//
// MIT License
//
// Copyright (c) 2017 Stellacore Corporation.
//
// 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 cam_Camera_INCL_
#define cam_Camera_INCL_
/*! \file
\brief Declarations for cam::Camera
*/
#include "libcam/PinHole.h"
#include "libdat/algorithm.h"
#include "libdat/Area.h"
#include "libdat/Extents.h"
#include "libdat/Spot.h"
#include "libga/ga.h"
#include <array>
#include <string>
namespace cam
{
/*! \brief Camera system assembly (body, detector, optics)
\par Example
\dontinclude testcam/uCamera.cpp
\skip ExampleStart
\until ExampleEnd
*/
class Camera
{
public: //data
// TODO - if need copy, probably should use shared_ptr (make into baseclass)
PinHole const theOptics{};
dat::Extents const theDetSize{};
dat::Area<double> const theAreaInImg{}; // symmetric about optical axis
dat::Area<double> const theAreaInDet{}; // matches dat::Extents
public: // methods
//! default null constructor
Camera
() = default;
//! Camera with PC centered on detector
explicit
Camera
( double const & pd
, dat::Extents const & detSize
);
//! Check if instance is valid
bool
isValid
() const;
//! Directions (in camera frame) corresponding to detector corners
std::array<ga::Vector, 4u>
cornerDirections
() const;
//! Image location for detector location
inline
dat::Spot
imageSpotFor
( dat::Spot const & detspot
) const;
//! Detector location for image location
inline
dat::Spot
detectorSpotFor
( dat::Spot const & imgspot
) const;
//! Quantized detector location for image spot - or null if out of area
inline
dat::RowCol
detectorRowColFor
( dat::Spot const & imgspot
) const;
//! Projected location of objpnt (unbounded by detector)
inline
dat::Spot
imageSpotFor
( ga::Vector const & objpnt
) const;
//! Detector location for object point - or null if out of area
inline
dat::RowCol
detectorRowColFor
( ga::Vector const & objpnt
) const;
//! True if this rowcol is within detector
inline
bool
isVisible
( dat::Spot const & imgspot
) const;
//! Direction (w.r.t camera frame) associated with image spot
inline
ga::Vector
directionOf
( dat::Spot const & imgspot
) const;
/*! Primary viewing direction (i.e. along the optical axis away from cam).
* Convenience for: directionOf(dat::Spot{{0., 0.}});
*/
inline
ga::Vector
lookDir
() const;
//! True if this camera is same as other (within tol)
bool
nearlyEquals
( Camera const & other
, double const & tol = { math::eps }
) const;
//! Descriptive information about this instance.
std::string
infoString
( std::string const & title = {}
) const;
};
}
// Inline definitions
#include "libcam/Camera.inl"
#endif // cam_Camera_INCL_
|
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy, modify, and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by Facebook.
//
// As with any software that integrates with the Facebook platform, your use of
// this software is subject to the Facebook Developer Principles and Policies
// [http://developers.facebook.com/policy/]. This copyright 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.
#import "FBSDKLoginManager+Internal.h"
FOUNDATION_EXPORT NSString *const FBSDKLoginManagerLoggerAuthMethod_Native;
FOUNDATION_EXPORT NSString *const FBSDKLoginManagerLoggerAuthMethod_Browser;
FOUNDATION_EXPORT NSString *const FBSDKLoginManagerLoggerAuthMethod_SFVC;
NS_SWIFT_NAME(LoginManagerLogger)
@interface FBSDKLoginManagerLogger : NSObject
+ (FBSDKLoginManagerLogger *)loggerFromParameters:(NSDictionary *)parameters;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)new NS_UNAVAILABLE;
- (instancetype)initWithLoggingToken:(NSString *)loggingToken NS_DESIGNATED_INITIALIZER;
// this must not retain loginManager - only used to conveniently grab various properties to log.
- (void)startSessionForLoginManager:(FBSDKLoginManager *)loginManager;
- (void)endSession;
- (void)startAuthMethod:(NSString *)authMethod;
- (void)endLoginWithResult:(FBSDKLoginManagerLoginResult *)result error:(NSError *)error;
- (NSDictionary *)parametersWithTimeStampAndClientState:(NSDictionary *)loginParams forAuthMethod:(NSString *)authMethod;
- (void)willAttemptAppSwitchingBehavior;
- (void)systemAuthDidShowDialog:(BOOL)didShowDialog isUnTOSedDevice:(BOOL)isUnTOSedDevice;
- (void)logNativeAppDialogResult:(BOOL)result dialogDuration:(NSTimeInterval)dialogDuration;
@end
|
/*
* Legal Notice
*
* This document and associated source code (the "Work") is a preliminary
* version of a benchmark specification being developed by the TPC. The
* Work is being made available to the public for review and comment only.
* The TPC reserves all right, title, and interest to the Work as provided
* under U.S. and international laws, including without limitation all patent
* and trademark rights therein.
*
* No Warranty
*
* 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION
* CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE
* AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER
* WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
* INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES,
* DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
* PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF
* WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE.
* ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT,
* QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT
* WITH REGARD TO THE WORK.
* 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO
* ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE
* COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS
* OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT,
* INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY,
* OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT
* RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD
* ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
*
* Contributors
* - Doug Johnson
*/
/*
* Database loader class for HOLDING_SUMMARY table.
*/
#ifndef ODBC_HOLDING_SUMMARY_LOAD_H
#define ODBC_HOLDING_SUMMARY_LOAD_H
namespace TPCE
{
class CODBCHoldingSummaryLoad : public CDBLoader <HOLDING_SUMMARY_ROW>
{
public:
CODBCHoldingSummaryLoad(char *szServer, char *szDatabase, char *szLoaderParams, char *szTable = "HOLDING_SUMMARY")
: CDBLoader<HOLDING_SUMMARY_ROW>(szServer, szDatabase, szLoaderParams, szTable)
{
};
virtual void BindColumns()
{
//Binding function we have to implement.
int i = 0;
if ( bcp_bind(m_hdbc, (BYTE *) &m_row.HS_CA_ID, 0, SQL_VARLEN_DATA, NULL, 0, IDENT_BIND, ++i) != SUCCEED
|| bcp_bind(m_hdbc, (BYTE *) &m_row.HS_S_SYMB, 0, SQL_VARLEN_DATA, (BYTE *)"", 1, 0, ++i) != SUCCEED
|| bcp_bind(m_hdbc, (BYTE *) &m_row.HS_QTY, 0, SQL_VARLEN_DATA, NULL, 0, SQLINT4, ++i) != SUCCEED
)
ThrowError(CODBCERR::eBcpBind);
};
};
} // namespace TPCE
#endif //ODBC_HOLDING_SUMMARY_LOAD_H
|
#ifndef APACHE_UTILS_H
#define APACHE_UTILS_H
/* Include the required headers from httpd */
#include <httpd.h>
#include <http_core.h>
#include <http_protocol.h>
#include <http_request.h>
#include <http_config.h>
#include <http_log.h>
#include "mod_bio_version.h"
#ifndef MIN
#define MIN(a,b) (a<b?a:b)
#endif
#ifndef MAX
#define MAX(a,b) (a>b?a:b)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef true
#define true TRUE
#endif
#ifndef false
#define false FALSE
#endif
#ifndef null
#define null NULL
#endif
/* max number of records to be fetched */
#define DEFAULT_LIMIT_RECORDS 100
int str_ends_with(const char*,const char*);
int str_is_empty(const char* );
typedef struct http_param
{
char* key;
char* value;
struct http_param* next;
}HttpParam,*HttpParamPtr;
HttpParamPtr HttpParamFree(HttpParamPtr);
HttpParamPtr HttpParamParseQuery(const char* query,size_t query_len);
HttpParamPtr HttpParamParseGET(request_rec *r);
const char* HttpParamGet(const HttpParamPtr root,const char* key);
/* xml */
int ap_xmlPuts(const char* s,request_rec *r);
int ap_xmlNPuts(const char* s,size_t n,request_rec *r);
int ap_xmlPutc(char c,request_rec *r);
/* json */
int ap_jsonQuote(const char* s,request_rec *r);
int ap_jsonNQuote(const char* s,size_t n,request_rec *r);
int ap_jsonEscapeC(char c,request_rec *r);
/* debug */
#define TRACEINFO(r,...) \
ap_log_error(__FILE__, __LINE__, 0,0,r->server,##__VA_ARGS__)
/* apache2 stuff*/
/* mime types */
#define MIME_TYPE_JSON "application/json"
#define MIME_TYPE_XML "text/xml"
#define MIME_TYPE_TEXT "text/plain"
#define MIME_TYPE_HTML "text/html"
#define MIME_TYPE_JAVASCRIPT "application/javascript"
/* XMLNS namespaces */
#define MODBIO_XMLNS "https://github.com/lindenb/mod_bio#"
/* HTML fragments */
extern const char* html_address;
extern int printDefaulthtmlHead(request_rec *r);
/* file exist ? */
extern int fileExists(const char* filename);
/* file with extension exists */
extern int fileExtExists(const char* filename,const char* suffix);
/* file without extention exists */
extern int baseNameExists(const char* filename);
/* parse region 'chrom:start-end' */
typedef struct chrom_start_end_t
{
/* must be released with free() */
char* chromosome;
int p_beg_i0;
int p_end_i0;
} ChromStartEnd;
extern int parseRegion(const char* s,ChromStartEnd* pos);
#endif
|
#pragma once
#include <stdlib.h>
#include <stdio.h>
template <class T>
class Singleton {
public:
static T* GetInstance() {
if ( !instance ) {
printf( " Creating Singleton...\n" );
instance = new T;
}
return instance;
}
static void DestroyInstance() {
instance = nullptr;
}
private:
static T* instance;
};
template <class T>
T* Singleton<T>::instance = nullptr; |
//
// AppDelegate.h
// RotatingCollectionView
//
// Created by Cillian on 22/03/2014.
// Copyright (c) 2014 Cillian. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
// 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.
// The use and distribution terms for this software are covered by the Eclipse
// Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which
// can be found in the file epl-v10.html at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license. You must not remove this notice, or any other, from
// this software.
// Copyright (c) 2013-2016, Kenneth Leung. All rights reserved.
#pragma once
//////////////////////////////////////////////////////////////////////////////
#include "x2d/GameScene.h"
NS_BEGIN(dttower)
//////////////////////////////////////////////////////////////////////////////
//
struct CC_DLL MMenu : public f::XScene {
__decl_create_scene(MMenu)
__decl_deco_ui()
};
NS_END
|
#pragma once
// CAnalyzerOptionDlg ¶Ô»°¿ò
class CAnalyzerOptionDlg : public CDialog
{
DECLARE_DYNAMIC(CAnalyzerOptionDlg)
public:
CAnalyzerOptionDlg(LPCTSTR lpszParam,CWnd* pParent = NULL); // ±ê×¼¹¹Ô캯Êý
virtual ~CAnalyzerOptionDlg();
// ¶Ô»°¿òÊý¾Ý
enum { IDD = IDD_DIALOG_ANALYZER_OPTION };
public:
LPCTSTR getOption(){return m_strParameter;}
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedButtonStopfilebrowse();
afx_msg void OnBnClickedOk();
protected:
CString m_strParameter;
public:
CString m_strStopFile;
CString m_strStopFilter;
CString m_strStemmer;
CString m_strLanguage;
virtual BOOL OnInitDialog();
afx_msg void OnCbnSelchangeComboStopfilter();
afx_msg void OnCbnSelchangeComboStemming();
};
|
#ifndef _ENGINE_COMPONENT_PORTAL_H_
#define _ENGINE_COMPONENT_PORTAL_H_
#include "engine/component/component.h"
#include "engine/component/drawable.h"
#include "engine/component/entity.h"
#include "engine/component/player.h"
#include "engine/component/zone.h"
#include "engine/game/map.h"
namespace engine {
namespace component {
// A portal acts as a link between two maps. Portals are 1-way; you need to make
// two portals (one in each map).
class Portal : public Component {
public:
COMPONENT_KEY("PORTAL");
// Constructor + Destructor.
Portal();
virtual ~Portal();
// Update the given parameter to match the given value.
virtual void SetParameter(const std::string& key, const Json::Value& value);
// Update this component.
virtual bool Update(Game& game);
// Builder methods for a portal.
Portal* destination(const std::string& destination);
Portal* portal_zone(Component* portal_zone);
Portal* destination_position(sf::Vector2f destination_zone);
Portal* require_interaction(bool require_interaction);
// Getter methods.
const std::string& destination() const;
const Zone& portal_zone() const;
Zone& portal_zone();
const sf::Vector2f& destination_position() const;
sf::Vector2f& destination_position();
bool require_interaction() const;
private:
// Key of the destination map.
std::string destination_;
// Where to put the player once the portalling is done.
sf::Vector2f destination_position_;
// If true, then the "interact" button must be pressed while in the area.
bool require_interaction_;
};
}} // namepsace engine::component
#endif // _ENGINE_COMPONENT_PORTAL_H_
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define T_INT 1
#define T_STRING 2
#define T_NONE 3
typedef struct lista{
struct lista *pxmo;
int tipo;
char id[256];
int pos;
}Lista;
typedef struct{
int tipo;
char id[256];
Lista *listaID;
} atributo;
Lista* iniciaLista(char* id);
Lista* insereLista(Lista* l, char* id);
void tabela(int tipo, Lista *l);
void print();
|
/* $Id$ */
/* Trivial i2c driver for the maxim DS1621 temperature sensor;
* just implements reading constant conversions with 8-bit
* resolution.
* Demonstrates the implementation of a i2c high-level driver.
*/
/*
* Authorship
* ----------
* This software was created by
* Till Straumann <strauman@slac.stanford.edu>, 2005,
* Stanford Linear Accelerator Center, Stanford University.
*
* Acknowledgement of sponsorship
* ------------------------------
* This software was produced by
* the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy.
*
* Government disclaimer of liability
* ----------------------------------
* Neither the United States nor the United States Department of Energy,
* nor any of their employees, makes any warranty, express or implied, or
* assumes any legal liability or responsibility for the accuracy,
* completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned
* rights.
*
* Stanford disclaimer of liability
* --------------------------------
* Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software.
*
* Stanford disclaimer of copyright
* --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction.
*
* Maintenance of notices
* ----------------------
* In the interest of clarity regarding the origin and status of this
* SLAC software, this and all the preceding Stanford University notices
* are to remain affixed to any copy or derivative of this software made
* or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or
* derivative of this software.
*
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/
#include <rtems.h>
#include <rtems/libi2c.h>
#include <libchip/i2c-ds1621.h>
#include <rtems/libio.h>
static rtems_status_code
ds1621_init (rtems_device_major_number major, rtems_device_minor_number minor,
void *arg)
{
int sc;
unsigned char csr[2] = { DS1621_CMD_CSR_ACCESS, 0 }, cmd;
/* First start command acquires a lock for the bus */
/* Initialize; switch continuous conversion on */
sc = rtems_libi2c_start_write_bytes (minor, csr, 1);
if (sc < 0)
return -sc;
sc = rtems_libi2c_start_read_bytes (minor, csr + 1, 1);
if (sc < 0)
return -sc;
csr[1] &= ~DS1621_CSR_1SHOT;
sc = rtems_libi2c_start_write_bytes (minor, csr, 2);
if (sc < 0)
return -sc;
/* Start conversion */
cmd = DS1621_CMD_START_CONV;
sc = rtems_libi2c_start_write_bytes (minor, &cmd, 1);
if (sc < 0)
return -sc;
/* sending 'stop' relinquishes the bus mutex -- don't hold it
* across system calls!
*/
return rtems_libi2c_send_stop (minor);
}
static rtems_status_code
ds1621_read (rtems_device_major_number major, rtems_device_minor_number minor,
void *arg)
{
int sc;
rtems_libio_rw_args_t *rwargs = arg;
unsigned char cmd = DS1621_CMD_READ_TEMP;
sc = rtems_libi2c_start_write_bytes (minor, &cmd, 1);
if (sc < 0)
return -sc;
if (sc < 1)
return RTEMS_IO_ERROR;
sc = rtems_libi2c_start_read_bytes(minor, (unsigned char *)rwargs->buffer, 1);
if (sc < 0) {
rwargs->bytes_moved = 0;
return -sc;
}
rwargs->bytes_moved = 1;
return rtems_libi2c_send_stop (minor);
}
static rtems_driver_address_table myops = {
.initialization_entry = ds1621_init,
.read_entry = ds1621_read,
};
static rtems_libi2c_drv_t my_drv_tbl = {
.ops = &myops,
.size = sizeof (my_drv_tbl),
};
rtems_libi2c_drv_t *i2c_ds1621_driver_descriptor = &my_drv_tbl;
|
/*
* $Id: syscalldefs.h,v 1.2 2009/05/25 00:03:34 fna Exp $
*
* This file belongs to FreeMiNT. It's not in the original MiNT 1.12
* distribution. See the file CHANGES for a detailed log of changes.
*
*
* Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>
* All rights reserved.
*
* Please send suggestions, patches or bug reports to me or
* the MiNT mailing list.
*
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _syscalldefs_h
#define _syscalldefs_h
#define STRMAX 255
struct systab
{
struct syscall **table;
int size;
int max;
int maxused;
};
struct syscall
{
char name[STRMAX];
struct arg *ret;
struct arg *args;
int status;
#define SYSCALL_REGULAR 0
#define SYSCALL_UNIMPLEMENTED 1
#define SYSCALL_UNSUPPORTED 2
#define SYSCALL_PASSTHROUGH 3
#define SYSCALL_UNDEFINED 4
};
struct arg
{
struct arg *next;
int type;
#define TYPE_VOID 0
#define TYPE_INT 1
#define TYPE_CHAR 2
#define TYPE_SHORT 3
#define TYPE_LONG 4
#define TYPE_UNSIGNED 5
#define TYPE_UCHAR 6
#define TYPE_USHORT 7
#define TYPE_ULONG 8
#define TYPE_IDENT 9
int flags;
#define FLAG_CONST 0x01
#define FLAG_STRUCT 0x02
#define FLAG_UNION 0x04
#define FLAG_POINTER 0x08
#define FLAG_ARRAY 0x10
#define FLAG_POINTER2 0x20
int ar_size;
char types[STRMAX];
char name[STRMAX];
};
#endif /* _syscalldefs_h */
|
#ifndef FT_FONTWRAPPER_H
#define FT_FONTWRAPPER_H
#ifdef USE_TILE
#ifdef USE_FT
#include "tilefont.h"
// TODO enne - Fonts could be made better by:
//
// * handling kerning
// * using SDL_font (maybe?)
// * the possibility of streaming this class in and out so that Crawl doesn't
// have to link against FreeType2 or be forced do as much processing at
// load time.
class FTFontWrapper : public FontWrapper
{
public:
FTFontWrapper();
virtual ~FTFontWrapper();
// font loading
virtual bool load_font(const char *font_name, unsigned int font_size,
bool outline);
// render just text
virtual void render_textblock(unsigned int x, unsigned int y,
ucs_t *chars, uint8_t *colours,
unsigned int width, unsigned int height,
bool drop_shadow = false);
// render text + background box
virtual void render_string(unsigned int x, unsigned int y,
const char *text, const coord_def &min_pos,
const coord_def &max_pos,
unsigned char font_colour,
bool drop_shadow = false,
unsigned char box_alpha = 0,
unsigned char box_colour = 0,
unsigned int outline = 0,
bool tooltip = false);
// FontBuffer helper functions
virtual void store(FontBuffer &buf, float &x, float &y,
const std::string &s, const VColour &c);
virtual void store(FontBuffer &buf, float &x, float &y,
const formatted_string &fs);
virtual void store(FontBuffer &buf, float &x, float &y, ucs_t c,
const VColour &col);
virtual unsigned int char_width() const;
virtual unsigned int char_height() const;
virtual unsigned int string_width(const char *text) const;
virtual unsigned int string_width(const formatted_string &str) const;
virtual unsigned int string_height(const char *text) const;
virtual unsigned int string_height(const formatted_string &str) const;
// Try to split this string to fit in w x h pixel area.
virtual formatted_string split(const formatted_string &str,
unsigned int max_width,
unsigned int max_height);
virtual const GenericTexture *font_tex() const;
protected:
void store(FontBuffer &buf, float &x, float &y,
const std::string &s, const VColour &c, float orig_x);
void store(FontBuffer &buf, float &x, float &y, const formatted_string &fs,
float orig_x);
int find_index_before_width(const char *str, int max_width);
struct GlyphInfo
{
// offset before drawing glyph; can be negative
char offset;
// per-glyph horizontal advance
char advance;
// per-glyph width
char width;
bool renderable;
};
GlyphInfo *m_glyphs;
// cached value of the maximum advance from m_advance
coord_def m_max_advance;
// minimum offset (likely negative)
int m_min_offset;
GenericTexture m_tex;
GLShapeBuffer *m_buf;
};
#endif // USE_FT
#endif // USE_TILE
#endif // include guard
|
/*
* Copyright (c) 2015-2016 Intel Corporation, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE 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 _FI_MEM_H_
#define _FI_MEM_H_
#include <config.h>
#include <assert.h>
#include <stdlib.h>
#include <fi_list.h>
#ifdef INCLUDE_VALGRIND
# include <valgrind/memcheck.h>
# ifndef VALGRIND_MAKE_MEM_DEFINED
# warning "Valgrind requested, but VALGRIND_MAKE_MEM_DEFINED undefined"
# endif
#endif
#ifndef VALGRIND_MAKE_MEM_DEFINED
# define VALGRIND_MAKE_MEM_DEFINED(addr, len)
#endif
/* We implement memdup to avoid external library dependency */
static inline void *mem_dup(const void *src, size_t size)
{
void *dest;
if ((dest = malloc(size)))
memcpy(dest, src, size);
return dest;
}
/*
* Buffer Pool
*/
struct util_buf_pool {
size_t entry_sz;
size_t max_cnt;
size_t chunk_cnt;
size_t alignment;
size_t num_allocated;
#if ENABLE_DEBUG
size_t num_used;
#endif
struct slist buf_list;
struct slist region_list;
};
struct util_buf_region {
struct slist_entry entry;
char *mem_region;
};
union util_buf {
struct slist_entry entry;
uint8_t data[0];
};
struct util_buf_pool *util_buf_pool_create(size_t size, size_t alignment,
size_t max_cnt, size_t chunk_cnt);
void util_buf_pool_destroy(struct util_buf_pool *pool);
void *util_buf_get(struct util_buf_pool *pool);
void util_buf_release(struct util_buf_pool *pool, void *buf);
#endif /* _FI_MEM_H_ */
|
#ifndef _STATS_
#define _STATS_
#include <stdlib.h>
#include <float.h>
#include <math.h>
/**
* The code contained in this file and the stats.c file was borrowed from the
* R package and is reproduced here in accordance with the GNU General Public
* License.
*/
#define ML_POSINF INFINITY
#define ML_NEGINF -INFINITY
#define ML_NAN NAN
#define FALSE 0
#define TRUE 1
/* Do the boundaries exactly for q*() functions :
* Often _LEFT_ = ML_NEGINF , and very often _RIGHT_ = ML_POSINF;
*
* R_Q_P01_boundaries(p, _LEFT_, _RIGHT_) :<==>
*
* R_Q_P01_check(p);
* if (p == R_DT_0) return _LEFT_ ;
* if (p == R_DT_1) return _RIGHT_;
*
* the following implementation should be more efficient (less tests):
*/
#define R_Q_P01_boundaries(p, _LEFT_, _RIGHT_) \
if (log_p) { \
if(p > 0) \
return ML_NAN; \
if(p == 0) /* upper bound*/ \
return lower_tail ? _RIGHT_ : _LEFT_; \
if(p == ML_NEGINF) \
return lower_tail ? _LEFT_ : _RIGHT_; \
} \
else { /* !log_p */ \
if(p < 0 || p > 1) \
return ML_NAN; \
if(p == 0) \
return lower_tail ? _LEFT_ : _RIGHT_; \
if(p == 1) \
return lower_tail ? _RIGHT_ : _LEFT_; \
}
#define R_D_Lval(p) (lower_tail ? (p) : (0.5 - (p) + 0.5)) /* p */
#define R_D_Cval(p) (lower_tail ? (0.5 - (p) + 0.5) : (p)) /* 1 - p */
#define R_DT_qIv(p) (log_p ? (lower_tail ? exp(p) : - expm1(p)) \
: R_D_Lval(p))
#define R_DT_CIv(p) (log_p ? (lower_tail ? -expm1(p) : exp(p)) \
: R_D_Cval(p))
#define R_D__0 (log_p ? ML_NEGINF : 0.) /* 0 */
#define R_D__1 (log_p ? 0. : 1.) /* 1 */
#define R_DT_0 (lower_tail ? R_D__0 : R_D__1) /* 0 */
#define R_DT_1 (lower_tail ? R_D__1 : R_D__0) /* 1 */
//#ifndef min
//# define min(a, b) ((a) > (b) ? (b) : (a))
//#endif
#define M_SQRT_32 5.656854249492380195206754896838 /* sqrt(32) */
#define M_1_SQRT_2PI 0.398942280401432677939946059934 /* 1/sqrt(2pi) */
#define R_FINITE(x) R_finite(x)
#define SIXTEEN 16 /* Cutoff allowing exact "*" and "/" */
int R_finite(double);
double qnorm(double p, double mu, double sigma, int lower_tail, int log_p);
double pnorm(double x, double mu, double sigma, int lower_tail, int log_p);
void pnorm_both(double x, double *cum, double *ccum, int i_tail, int log_p);
double * ppoints(int n, float a);
double sign(double x);
#endif
|
#include <common.h>
#include <asm/arch/ox820/regs.h>
DECLARE_GLOBAL_DATA_PTR;
int dram_init(void)
{
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; /* convert to MBytes */
gd->bd->bi_dram[0].start = PHYS_SDRAM_1_PA;
gd->ram_size = CONFIG_MAX_RAM_BANK_SIZE;
return 0;
}
|
#include "portcontrol.h"
#include "netx_io_areas.h"
void portcontrol_apply(const unsigned short *pusIndex, const unsigned short *pusConfiguration, size_t sizConfiguration)
{
const unsigned short *pusIndexCnt;
const unsigned short *pusIndexEnd;
const unsigned short *pusConfigurationCnt;
unsigned long ulConfiguration;
unsigned long ulOffset;
volatile unsigned long *pulPortControl;
pulPortControl = (volatile unsigned long*)HOSTADDR(PORTCONTROL);
pusIndexCnt = pusIndex;
pusIndexEnd = pusIndex + sizConfiguration;
pusConfigurationCnt = pusConfiguration;
while( pusIndexCnt<pusIndexEnd )
{
/* Get the value. */
ulOffset = (unsigned long)(*(pusIndexCnt++));
ulConfiguration = (unsigned long)(*(pusConfigurationCnt++));
if( ulConfiguration!=PORTCONTROL_SKIP && ulOffset!=PORTCONTROL_SKIP )
{
/* Write the configuration. */
pulPortControl[ulOffset] = ulConfiguration;
}
}
}
|
//
// Copyright(C) 2005-2014 Simon Howard
// Copyright(C) 2016-2022 Julian Nechaevsky
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
#include <stdlib.h>
#include <string.h>
#include "doomkeys.h"
#include "txt_button.h"
#include "txt_gui.h"
#include "txt_io.h"
#include "txt_main.h"
#include "txt_window.h"
static void TXT_ButtonSizeCalc(TXT_UNCAST_ARG(button))
{
TXT_CAST_ARG(txt_button_t, button);
button->widget.w = strlen(button->label);
button->widget.h = 1;
}
static void TXT_ButtonDrawer(TXT_UNCAST_ARG(button))
{
TXT_CAST_ARG(txt_button_t, button);
int i;
int w;
w = button->widget.w;
TXT_SetWidgetBG(button);
TXT_DrawString(button->label);
for (i=strlen(button->label); i < w; ++i)
{
TXT_DrawString(" ");
}
}
static void TXT_ButtonDestructor(TXT_UNCAST_ARG(button))
{
TXT_CAST_ARG(txt_button_t, button);
free(button->label);
}
static int TXT_ButtonKeyPress(TXT_UNCAST_ARG(button), int key)
{
TXT_CAST_ARG(txt_button_t, button);
if (key == KEY_ENTER)
{
TXT_EmitSignal(button, "pressed");
return 1;
}
return 0;
}
static void TXT_ButtonMousePress(TXT_UNCAST_ARG(button), int x, int y, int b)
{
TXT_CAST_ARG(txt_button_t, button);
if (b == TXT_MOUSE_LEFT)
{
// Equivalent to pressing enter
TXT_ButtonKeyPress(button, KEY_ENTER);
}
}
txt_widget_class_t txt_button_class =
{
TXT_AlwaysSelectable,
TXT_ButtonSizeCalc,
TXT_ButtonDrawer,
TXT_ButtonKeyPress,
TXT_ButtonDestructor,
TXT_ButtonMousePress,
NULL,
};
void TXT_SetButtonLabel(txt_button_t *button, char *label)
{
free(button->label);
button->label = strdup(label);
}
txt_button_t *TXT_NewButton(char *label)
{
txt_button_t *button;
button = malloc(sizeof(txt_button_t));
TXT_InitWidget(button, &txt_button_class);
button->label = strdup(label);
return button;
}
// Button with a callback set automatically
txt_button_t *TXT_NewButton2(char *label, TxtWidgetSignalFunc func,
void *user_data)
{
txt_button_t *button;
button = TXT_NewButton(label);
TXT_SignalConnect(button, "pressed", func, user_data);
return button;
}
|
/*
* TwoLAME: an optimized MPEG Audio Layer Two encoder
*
* Copyright (C) 2001-2004 Michael Cheng
* Copyright (C) 2004-2005 The TwoLAME Project
*
* 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 _UTIL_H_
#define _UTIL_H_
// non-public prototypes
const char* twolame_mpeg_version_name (int version);
int twolame_get_bitrate_index (int bitrate, TWOLAME_MPEG_version version);
int twolame_get_samplerate_index (long sample_rate);
int twolame_get_version_for_samplerate (long sample_rate);
#endif // _UTIL_H_
|
#define _GNU_SOURCE
#include "badge_logger_common.h"
extern int qsize;
extern uint16_t *start, *current, msize;
extern char* queue;
extern int fd;
int pushData(char* param) {
int qfree;
if ((*current + elsize) % (qsize * elsize) == *start) {
return -1;
}
f_elock(fd);
sprintf(queue + *current, "%s", param);
*current = (*current + elsize) % (qsize * elsize);
msync(queue, msize, MS_SYNC);
qfree = (qsize * elsize) - abs(*start - *current);
if (qfree == qsize * elsize) {
qfree = 0;
}
f_unlock(fd);
return qfree;
}
/* Copy the last element to result and removes from queue */
int popData(char** result) {
if (abs(*current - *start) == 0) {
return 0;
}
f_elock(fd);
if (result != NULL) {
sprintf(*result, "%s", queue + *start);
}
*start = (*start + elsize) % (qsize * elsize);
msync(queue, msize, MS_SYNC);
f_unlock(fd);
return abs(*current - *start);
}
/* Copy the last element to result without removing from the queue */
int pickData(char** result) {
if (abs(*current - *start) == 0) {
return 0;
}
f_elock(fd);
sprintf(*result, "%s", queue + *start);
f_unlock(fd);
return abs(*current - *start);
}
|
#include "bbs.h"
/*
* buflen is a value-result variable. When it is passed to the function,
* its value is the buffer length (including the trailing '\0' character).
* When the function returned, its value is the number of characters
* actually copied to buf (excluding the trailing '\0' character).
*/
char *string_copy(char *buf, const char *str, size_t * buflen)
{
size_t i;
size_t len;
if (*buflen == 0)
return buf;
len = *buflen - 1;
for (i = 0; i < len; i++) {
if (str[i] == '\0') {
buf[i] = str[i];
break;
}
buf[i] = str[i];
}
*buflen = i;
buf[i] = '\0';
return buf;
}
char *encode_xml(char *buf, const char *str, size_t buflen)
{
size_t i, j, k;
size_t len;
bzero(buf, buflen);
len = strlen(str);
for (i = 0, j = 0; i < len && j < buflen; i++) {
switch (str[i]) {
case '\"':
k = buflen - j;
string_copy(&buf[j], """, &k);
j += k;
break;
case '\'':
k = buflen - j;
string_copy(&buf[j], "'", &k);
j += k;
break;
case '&':
k = buflen - j;
string_copy(&buf[j], "&", &k);
j += k;
break;
case '>':
k = buflen - j;
string_copy(&buf[j], ">", &k);
j += k;
break;
case '<':
k = buflen - j;
string_copy(&buf[j], "<", &k);
j += k;
break;
default:
buf[j] = str[i];
j++;
}
}
buf[buflen - 1] = '\0';
return buf;
}
|
#include <linux/platform_device.h>
#include <asm/mach/time.h>
static void __init shmobile_late_time_init(void)
{
/*
* Make sure all compiled-in early timers register themselves.
*
* Run probe() for two "earlytimer" devices, these will be the
* clockevents and clocksource devices respectively. In the event
* that only a clockevents device is available, we -ENODEV on the
* clocksource and the jiffies clocksource is used transparently
* instead. No error handling is necessary here.
*/
early_platform_driver_register_all("earlytimer");
early_platform_driver_probe("earlytimer", 2, 0);
}
static void __init shmobile_timer_init(void)
{
late_time_init = shmobile_late_time_init;
}
struct sys_timer shmobile_timer = {
.init = shmobile_timer_init,
};
|
#ifndef _ASM_S390_CRW_H
#define _ASM_S390_CRW_H
#include <linux/types.h>
struct crw {
__u32 res1 : 1; /* reserved zero */
__u32 slct : 1; /* solicited */
__u32 oflw : 1; /* overflow */
__u32 chn : 1; /* chained */
__u32 rsc : 4; /* reporting source code */
__u32 anc : 1; /* ancillary report */
__u32 res2 : 1; /* reserved zero */
__u32 erc : 6; /* error-recovery code */
__u32 rsid : 16; /* reporting-source ID */
} __attribute__ ((packed));
typedef void (*crw_handler_t)(struct crw *, struct crw *, int);
extern int crw_register_handler(int rsc, crw_handler_t handler);
extern void crw_unregister_handler(int rsc);
extern void crw_handle_channel_report(void);
void crw_wait_for_channel_report(void);
#define NR_RSCS 16
#define CRW_RSC_MONITOR 0x2 /* monitoring facility */
#define CRW_RSC_SCH 0x3 /* subchannel */
#define CRW_RSC_CPATH 0x4 /* channel path */
#define CRW_RSC_CONFIG 0x9 /* configuration-alert facility */
#define CRW_RSC_CSS 0xB /* channel subsystem */
#define CRW_ERC_EVENT 0x00 /* event information pending */
#define CRW_ERC_AVAIL 0x01 /* available */
#define CRW_ERC_INIT 0x02 /* initialized */
#define CRW_ERC_TERROR 0x03 /* temporary error */
#define CRW_ERC_IPARM 0x04 /* installed parm initialized */
#define CRW_ERC_TERM 0x05 /* terminal */
#define CRW_ERC_PERRN 0x06 /* perm. error, fac. not init */
#define CRW_ERC_PERRI 0x07 /* perm. error, facility init */
#define CRW_ERC_PMOD 0x08 /* installed parameters modified */
static inline int stcrw(struct crw *pcrw)
{
int ccode;
asm volatile(
" stcrw 0(%2)\n"
" ipm %0\n"
" srl %0,28\n"
: "=d" (ccode), "=m" (*pcrw)
: "a" (pcrw)
: "cc" );
return ccode;
}
#endif /* _ASM_S390_CRW_H */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.