text stringlengths 4 6.14k |
|---|
/*
* (C) Copyright 2016 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "kmsrtppaytreebin.h"
#include "kmsutils.h"
#define GST_DEFAULT_NAME "rtppaytreebin"
#define GST_CAT_DEFAULT kms_rtp_pay_tree_bin_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
#define kms_rtp_pay_tree_bin_parent_class parent_class
G_DEFINE_TYPE (KmsRtpPayTreeBin, kms_rtp_pay_tree_bin, KMS_TYPE_TREE_BIN);
#define PICTURE_ID_15_BIT 2
static GstElement *
create_payloader_for_caps (const GstCaps * caps)
{
GList *payloader_list, *filtered_list, *l;
GstElementFactory *payloader_factory = NULL;
GstElement *payloader = NULL;
payloader_list =
gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_PAYLOADER,
GST_RANK_NONE);
filtered_list =
gst_element_factory_list_filter (payloader_list, caps, GST_PAD_SRC,
FALSE);
for (l = filtered_list; l != NULL && payloader_factory == NULL; l = l->next) {
payloader_factory = GST_ELEMENT_FACTORY (l->data);
if (gst_element_factory_get_num_pad_templates (payloader_factory) != 2)
payloader_factory = NULL;
}
if (payloader_factory != NULL) {
payloader = gst_element_factory_create (payloader_factory, NULL);
}
if (payloader) {
GParamSpec *pspec;
pspec =
g_object_class_find_property (G_OBJECT_GET_CLASS (payloader),
"config-interval");
if (pspec != NULL && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_UINT) {
g_object_set (payloader, "config-interval", 1, NULL);
}
pspec =
g_object_class_find_property (G_OBJECT_GET_CLASS (payloader),
"picture-id-mode");
if (pspec != NULL && G_TYPE_IS_ENUM (G_PARAM_SPEC_VALUE_TYPE (pspec))) {
/* Set picture id so that remote peer can determine continuity if */
/* there are lost FEC packets and if it has to NACK them */
g_object_set (payloader, "picture-id-mode", PICTURE_ID_15_BIT, NULL);
}
}
gst_plugin_feature_list_free (filtered_list);
gst_plugin_feature_list_free (payloader_list);
return payloader;
}
static gboolean
kms_rtp_pay_tree_bin_configure (KmsRtpPayTreeBin * self, const GstCaps * caps)
{
KmsTreeBin *tree_bin = KMS_TREE_BIN (self);
GstElement *pay, *output_tee;
GstPad *pad;
pay = create_payloader_for_caps (caps);
if (pay == NULL) {
GST_WARNING_OBJECT (self, "Cannot find payloader for caps %" GST_PTR_FORMAT,
caps);
return FALSE;
}
GST_DEBUG_OBJECT (self, "Payloader found: %" GST_PTR_FORMAT, pay);
pad = gst_element_get_static_pad (pay, "sink");
kms_utils_drop_until_keyframe (pad, TRUE);
gst_object_unref (pad);
gst_bin_add (GST_BIN (self), pay);
gst_element_sync_state_with_parent (pay);
kms_tree_bin_set_input_element (tree_bin, pay);
output_tee = kms_tree_bin_get_output_tee (tree_bin);
gst_element_link (pay, output_tee);
return TRUE;
}
KmsRtpPayTreeBin *
kms_rtp_pay_tree_bin_new (const GstCaps * caps)
{
GObject *dec;
dec = g_object_new (KMS_TYPE_RTP_PAY_TREE_BIN, NULL);
if (!kms_rtp_pay_tree_bin_configure (KMS_RTP_PAY_TREE_BIN (dec), caps)) {
g_object_unref (dec);
return NULL;
}
return KMS_RTP_PAY_TREE_BIN (dec);
}
static void
kms_rtp_pay_tree_bin_init (KmsRtpPayTreeBin * self)
{
/* Nothing to do */
}
static void
kms_rtp_pay_tree_bin_class_init (KmsRtpPayTreeBinClass * klass)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gst_element_class_set_details_simple (gstelement_class,
"RtpPayTreeBin",
"Generic",
"Bin to payload and distribute media.",
"Jose Antonio Santos <santoscadenas@gmail.com>");
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, GST_DEFAULT_NAME, 0,
GST_DEFAULT_NAME);
}
|
#pragma once
#include "Instruction.h"
namespace Hpipe {
class InstructionSave;
/**
*/
class InstructionWithCode : public Instruction {
public:
InstructionWithCode( const Context &cx, int num_active_item );
virtual bool with_code () const;
virtual bool can_be_deleted () const;
virtual void update_running_strings( std::set<std::string> &strs ) const;
virtual bool works_on_next () const;
virtual InstructionWithCode *no_works_on_next_clone( PtrPool<Instruction> &inst_pool ) const;
int num_active_item; ///< active CharItem in cx
InstructionSave *save; ///<
bool in_code_seq; ///>
};
} // namespace Hpipe
|
//
// ViewController.h
// iOSSampleAppObjC
//
// Created by Patrick McConnell on 2/9/16.
// Copyright © 2016 Odd Networks. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Collections.Generic.IEnumerable`1<System.Object>
struct IEnumerable_1_t3176762032;
// System.Collections.Generic.IEnumerator`1<System.Object>
struct IEnumerator_1_t1787714124;
// System.Object
struct Il2CppObject;
// System.Func`2<System.Object,System.Boolean>
struct Func_2_t785513668;
#include "mscorlib_System_Object4170816371.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1<System.Object>
struct U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764 : public Il2CppObject
{
public:
// System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::source
Il2CppObject* ___source_0;
// System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::<$s_120>__0
Il2CppObject* ___U3CU24s_120U3E__0_1;
// TSource System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::<element>__1
Il2CppObject * ___U3CelementU3E__1_2;
// System.Func`2<TSource,System.Boolean> System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::predicate
Func_2_t785513668 * ___predicate_3;
// System.Int32 System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::$PC
int32_t ___U24PC_4;
// TSource System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::$current
Il2CppObject * ___U24current_5;
// System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::<$>source
Il2CppObject* ___U3CU24U3Esource_6;
// System.Func`2<TSource,System.Boolean> System.Linq.Enumerable/<CreateWhereIterator>c__Iterator1D`1::<$>predicate
Func_2_t785513668 * ___U3CU24U3Epredicate_7;
public:
inline static int32_t get_offset_of_source_0() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___source_0)); }
inline Il2CppObject* get_source_0() const { return ___source_0; }
inline Il2CppObject** get_address_of_source_0() { return &___source_0; }
inline void set_source_0(Il2CppObject* value)
{
___source_0 = value;
Il2CppCodeGenWriteBarrier(&___source_0, value);
}
inline static int32_t get_offset_of_U3CU24s_120U3E__0_1() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___U3CU24s_120U3E__0_1)); }
inline Il2CppObject* get_U3CU24s_120U3E__0_1() const { return ___U3CU24s_120U3E__0_1; }
inline Il2CppObject** get_address_of_U3CU24s_120U3E__0_1() { return &___U3CU24s_120U3E__0_1; }
inline void set_U3CU24s_120U3E__0_1(Il2CppObject* value)
{
___U3CU24s_120U3E__0_1 = value;
Il2CppCodeGenWriteBarrier(&___U3CU24s_120U3E__0_1, value);
}
inline static int32_t get_offset_of_U3CelementU3E__1_2() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___U3CelementU3E__1_2)); }
inline Il2CppObject * get_U3CelementU3E__1_2() const { return ___U3CelementU3E__1_2; }
inline Il2CppObject ** get_address_of_U3CelementU3E__1_2() { return &___U3CelementU3E__1_2; }
inline void set_U3CelementU3E__1_2(Il2CppObject * value)
{
___U3CelementU3E__1_2 = value;
Il2CppCodeGenWriteBarrier(&___U3CelementU3E__1_2, value);
}
inline static int32_t get_offset_of_predicate_3() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___predicate_3)); }
inline Func_2_t785513668 * get_predicate_3() const { return ___predicate_3; }
inline Func_2_t785513668 ** get_address_of_predicate_3() { return &___predicate_3; }
inline void set_predicate_3(Func_2_t785513668 * value)
{
___predicate_3 = value;
Il2CppCodeGenWriteBarrier(&___predicate_3, value);
}
inline static int32_t get_offset_of_U24PC_4() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___U24PC_4)); }
inline int32_t get_U24PC_4() const { return ___U24PC_4; }
inline int32_t* get_address_of_U24PC_4() { return &___U24PC_4; }
inline void set_U24PC_4(int32_t value)
{
___U24PC_4 = value;
}
inline static int32_t get_offset_of_U24current_5() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___U24current_5)); }
inline Il2CppObject * get_U24current_5() const { return ___U24current_5; }
inline Il2CppObject ** get_address_of_U24current_5() { return &___U24current_5; }
inline void set_U24current_5(Il2CppObject * value)
{
___U24current_5 = value;
Il2CppCodeGenWriteBarrier(&___U24current_5, value);
}
inline static int32_t get_offset_of_U3CU24U3Esource_6() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___U3CU24U3Esource_6)); }
inline Il2CppObject* get_U3CU24U3Esource_6() const { return ___U3CU24U3Esource_6; }
inline Il2CppObject** get_address_of_U3CU24U3Esource_6() { return &___U3CU24U3Esource_6; }
inline void set_U3CU24U3Esource_6(Il2CppObject* value)
{
___U3CU24U3Esource_6 = value;
Il2CppCodeGenWriteBarrier(&___U3CU24U3Esource_6, value);
}
inline static int32_t get_offset_of_U3CU24U3Epredicate_7() { return static_cast<int32_t>(offsetof(U3CCreateWhereIteratorU3Ec__Iterator1D_1_t3981097764, ___U3CU24U3Epredicate_7)); }
inline Func_2_t785513668 * get_U3CU24U3Epredicate_7() const { return ___U3CU24U3Epredicate_7; }
inline Func_2_t785513668 ** get_address_of_U3CU24U3Epredicate_7() { return &___U3CU24U3Epredicate_7; }
inline void set_U3CU24U3Epredicate_7(Func_2_t785513668 * value)
{
___U3CU24U3Epredicate_7 = value;
Il2CppCodeGenWriteBarrier(&___U3CU24U3Epredicate_7, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
//
// STLoginRegisterViewController.h
// baisibudejie
//
// Created by 孙涛 on 2017/4/19.
// Copyright © 2017年 孙涛. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface STLoginRegisterViewController : UIViewController
@end
|
/** @file
This is the primary include file for the proxy cache system.
@section license License
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#pragma once
#include "ts/ink_platform.h"
#include "ts/ink_apidefs.h"
#include <ts/ink_defs.h>
#include "ts/Regression.h"
#include "ts/I_Version.h"
//
// Constants
//
#define ET_CACHE ET_CALL
// TODO: consolidate location of these defaults
#define DEFAULT_ROOT_DIRECTORY PREFIX
#define DEFAULT_LOCAL_STATE_DIRECTORY "var/trafficserver"
#define DEFAULT_SYSTEM_CONFIG_DIRECTORY "etc/trafficserver"
#define DEFAULT_LOG_DIRECTORY "var/log/trafficserver"
#define DEFAULT_BIND_STDOUT ""
#define DEFAULT_BIND_STDERR ""
//
// Global Data
//
// Global Configuration
extern int accept_till_done;
extern int http_accept_file_descriptor;
extern int command_flag;
extern int auto_clear_hostdb_flag;
extern int auto_clear_cache_flag;
extern int fds_limit;
extern int debug_level;
extern int remote_management_flag;
inkcoreapi extern int qt_accept_file_descriptor;
// Debugging Configuration
extern char debug_host[MAXDNAME + 1];
extern int debug_port;
// Default socket buffer limits
extern int default_sndbuf_size;
extern int default_rcvbuf_size;
//
// Functions
//
inline bool
maintainance_mode()
{
return (command_flag ? true : false);
}
extern AppVersionInfo appVersionInfo;
void crash_logger_init();
void crash_logger_invoke(int signo, siginfo_t *info, void *ctx);
|
#include "xftypedef.h"
#include "language.h"
#include "xfunit/xfunit.h"
#include "xfunit/xflayout.h"
#include "xfunit/xflabel.h"
#include "xfunit/xfbutton.h"
#include "xfview.h"
#include "layout_sys_version.h"
#define SYS_VERSION "Ver.20170630"
static XF_VIEW_Label *mLabelTopBar;
static XF_VIEW_Button *mButton;
static void onButtonClick(void *arg) {
XF_ViewQuit();
}
static void onCreate(XF_VIEW_Layout *layout) {
mLabelTopBar = XF_VIEW_LabelNew(0, 0, STRING_SYS_VERSION);
mButton = XF_VIEW_ButtonNew(0, 16, SYS_VERSION, onButtonClick);
XF_VIEW_LayoutAddUnit(layout, (XF_VIEW_Unit*)mLabelTopBar);
XF_VIEW_LayoutAddUnit(layout, (XF_VIEW_Unit*)mButton);
}
static void onShow(XF_VIEW_Layout *layout) {
XF_ViewFocusUnit((XF_VIEW_Unit*)mButton);
}
static void onHide(XF_VIEW_Layout *layout) {
}
static void onDestroy(XF_VIEW_Layout *layout) {
XF_VIEW_LabelDelete(mLabelTopBar);
XF_VIEW_ButtonDelete(mButton);
}
const XF_VIEW_Layout gLayoutSysVersion = XF_VIEW_LAYOUT_STATIC_INIT(onCreate, onShow, onHide, onDestroy, STRING_SYS_VERSION);
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// UnityEngine.Font
struct Font_t4241557075;
// System.IAsyncResult
struct IAsyncResult_t2754620036;
// System.AsyncCallback
struct AsyncCallback_t1369114871;
// System.Object
struct Il2CppObject;
#include "mscorlib_System_MulticastDelegate3389745971.h"
#include "mscorlib_System_Void2863195528.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Action`1<UnityEngine.Font>
struct Action_1_t342405915 : public MulticastDelegate_t3389745971
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
//
// AdInstlAdapterDianru.h
// AdInstlSDK_iOS
//
// Created by adview on 14-2-25.
//
//
#import "AdInstlAdNetworkAdapter.h"
#import "ZSDK.h"
@interface AdInstlAdapterDianru : AdInstlAdNetworkAdapter<ZDelegate>
+ (AdInstlAdNetworkType)networkType;
@property (nonatomic, strong) UIView * drView;
@property (nonatomic, assign) UIViewController *rootController;
@end
|
/* Copyright 2017 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _CREATE_CONTAINER_UTILS_H
#define _CREATE_CONTAINER_UTILS_H
#include <stdio.h>
#include <unistd.h>
#define die(status, msg, ...) \
{ fprintf(stderr, "error: %s.%s() line %d: " msg "\n", progname, \
__func__, __LINE__, __VA_ARGS__); exit(status); }
#define debug_msg(msg, ...) \
if (debug) fprintf(stderr, "--> %s.%s(): " msg "\n", progname, \
__func__, __VA_ARGS__);
#define verbose_msg(msg, ...) \
if (verbose) fprintf(stdout, "--> %s: " msg "\n", progname, \
__VA_ARGS__);
void hex_print(char *lead, unsigned char *buffer, size_t buflen);
void verbose_print(char *lead, unsigned char *buffer, size_t buflen);
void debug_print(char *lead, unsigned char *buffer, size_t buflen);
int isValidHex(char *input, int len);
int isValidAscii(char *input, int len);
#endif /* _CREATE_CONTAINER_UTILS_H */
|
/*
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef NDASH_SAMPLE_HOLDER_H_
#define NDASH_SAMPLE_HOLDER_H_
#include <cstdint>
#include <string>
#include "crypto_info.h"
#include "util/util.h"
namespace ndash {
class SampleHolder {
public:
// buffer_replacement_enabled determines the behavior of
// EnsureSpaceForWrite(int). See below for more details.
explicit SampleHolder(bool buffer_replacement_enabled);
~SampleHolder();
// Ensures that the buffer is large enough to accommodate a write of a
// given length at its current position.
// If the capacity of data is sufficient this method does nothing. If the
// capacity is insufficient then an attempt is made to replace data with a
// new buffer whose capacity is sufficient. Data up to the current position
// is copied to the new buffer.
// length The length of the write that must be accommodated, in bytes.
// returns false If there is insufficient capacity to accommodate the write
// and buffer_replacement_enabled is false.
bool EnsureSpaceForWrite(int length);
CryptoInfo* MutableCryptoInfo() { return &crypto_info_; }
const CryptoInfo* GetCryptoInfo() const { return &crypto_info_; }
void SetDataBuffer(std::unique_ptr<uint8_t[]> data, int data_len);
bool Write(const uint8_t* data, int len);
const uint8_t* GetBuffer() const { return buffer_.get(); }
int32_t GetWrittenSize() const { return written_size_; }
int32_t GetPeekSize() const { return peek_size_; }
void SetPeekSize(int32_t size);
int64_t GetDurationUs() const { return duration_us_; }
void SetDurationUs(int64_t duration_ms);
int32_t GetFlags() const { return flags_; }
void SetFlags(int32_t flags);
int64_t GetTimeUs() const { return time_us_; }
void SetTimeUs(int64_t time_us);
// Returns whether flags has kSampleFlagEncrypted set.
bool IsEncrypted() const {
return (flags_ & util::kSampleFlagEncrypted) != 0;
}
// Returns whether flags has kSampleFlagDecodeOnly set.
bool IsDecodeOnly() const {
return (flags_ & util::kSampleFlagDecodeOnly) != 0;
}
// Returns whether flags has kSampleFlagSync set.
bool IsSyncFrame() const { return (flags_ & util::kSampleFlagSync) != 0; }
// Sets the write position back to the beginning of the buffer.
void ClearData();
private:
CryptoInfo crypto_info_;
// A buffer holding the sample data.
std::unique_ptr<uint8_t[]> buffer_;
// The size of our data buffer.
int32_t buffer_len_;
// The number of bytes written into this sample holder. Also represents the
// next write position if this sample holder is being written to.
int32_t written_size_;
// Holds the size of a sample when this holder is used in a peek.
int32_t peek_size_;
// Flags that accompany the sample. A combination of kSampleFlagSync,
// kSampleFlagEncrypted and kSampleFlagDecodeOnly.
int32_t flags_;
// The time at which the sample should be presented.
int64_t time_us_;
// Duration of this sample in microseconds.
int64_t duration_us_;
bool buffer_replacement_enabled_;
std::unique_ptr<uint8_t[]> CreateReplacementBuffer(int32_t required_capacity,
bool* success);
};
} // namespace ndash
#endif // NDASH_SAMPLE_HOLDER_H_
|
/* Tests the ${library_name}_${type_name}_seek_offset function
* Returns 1 if successful or 0 if not
*/
int ${library_name_suffix}_test_${type_name}_seek_offset(
${library_name}_${type_name}_t *${type_name} )
{
libcerror_error_t *error = NULL;
size64_t size = 0;
off64_t offset = 0;
/* Test regular cases
*/
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
0,
SEEK_END,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_NOT_EQUAL_INT64(
"offset",
offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NULL(
"error",
error );
size = (size64_t) offset;
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
1024,
SEEK_SET,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) 1024 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NULL(
"error",
error );
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
-512,
SEEK_CUR,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) 512 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NULL(
"error",
error );
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
(off64_t) ( size + 512 ),
SEEK_SET,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) ( size + 512 ) );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NULL(
"error",
error );
/* Reset offset to 0
*/
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
0,
SEEK_SET,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) 0 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NULL(
"error",
error );
/* Test error cases
*/
offset = ${library_name}_${type_name}_seek_offset(
NULL,
0,
SEEK_SET,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NOT_NULL(
"error",
error );
libcerror_error_free(
&error );
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
-1,
SEEK_SET,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NOT_NULL(
"error",
error );
libcerror_error_free(
&error );
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
-1,
SEEK_CUR,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NOT_NULL(
"error",
error );
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
(off64_t) ( -1 * ( size + 1 ) ),
SEEK_END,
&error );
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NOT_NULL(
"error",
error );
libcerror_error_free(
&error );
#if defined( HAVE_${library_name_suffix_upper_case}_TEST_RWLOCK )
/* Test ${library_name}_${type_name}_seek_offset with pthread_rwlock_wrlock failing in libcthreads_read_write_lock_grab_for_write
*/
${library_name_suffix}_test_pthread_rwlock_wrlock_attempts_before_fail = 0;
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
0,
SEEK_SET,
&error );
if( ${library_name_suffix}_test_pthread_rwlock_wrlock_attempts_before_fail != -1 )
{
${library_name_suffix}_test_pthread_rwlock_wrlock_attempts_before_fail = -1;
}
else
{
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
(int64_t) offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NOT_NULL(
"error",
error );
libcerror_error_free(
&error );
}
/* Test ${library_name}_${type_name}_seek_offset with pthread_rwlock_unlock failing in libcthreads_read_write_lock_release_for_write
*/
${library_name_suffix}_test_pthread_rwlock_unlock_attempts_before_fail = 0;
offset = ${library_name}_${type_name}_seek_offset(
${type_name},
0,
SEEK_SET,
&error );
if( ${library_name_suffix}_test_pthread_rwlock_unlock_attempts_before_fail != -1 )
{
${library_name_suffix}_test_pthread_rwlock_unlock_attempts_before_fail = -1;
}
else
{
${library_name_suffix_upper_case}_TEST_ASSERT_EQUAL_INT64(
"offset",
(int64_t) offset,
(int64_t) -1 );
${library_name_suffix_upper_case}_TEST_ASSERT_IS_NOT_NULL(
"error",
error );
libcerror_error_free(
&error );
}
#endif /* defined( HAVE_${library_name_suffix_upper_case}_TEST_RWLOCK ) */
return( 1 );
on_error:
if( error != NULL )
{
libcerror_error_free(
&error );
}
return( 0 );
}
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by AutonomApp, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
// TODO: Migrate to GCD sockets (GCDAsyncSocket). This will resolve a number of really ugly issues:
// * Lower thread counts
// * Explicit synchronization (no more conditions, flags, or race conditons!)
// * Maybe even synchronize with the context itself (when TIMOB-6990 complete)
#ifdef USE_TI_NETWORKSOCKET
#import <Foundation/Foundation.h>
#import "TiStreamProxy.h"
#import "AsyncSocket.h"
#import "TiNetworkSocketProxy.h"
// Used to determine the type of processing
typedef enum {
TO_BUFFER = 1,
TO_STREAM,
TO_CALLBACK,
} ReadDestination;
@interface TiNetworkSocketTCPProxy : TiStreamProxy<AsyncSocketDelegate, TiStreamInternal> {
AsyncSocket* socket;
SocketState internalState;
NSCondition* listening;
NSThread* socketThread;
// We have to have an explicit "host" property because of some 'fun' undocumented KVO
// behavior - it turns out that KVO 'getters' also look for '-(type)_key' signature
// selectors. TiProxy has a '_host' function.
NSString* host;
// We offer synchronous I/O. The underlying socket implementation is asynchronous.
// So we need to ensure our own synchronicity by signaling a condition when operations
// complete.
NSCondition* ioCondition;
NSUInteger readDataLength;
NSError* socketError;
// In order to put the accepted socket on the right run loop, and make sure it's constructed
// properly, we need THESE as well...
NSMutableDictionary* acceptArgs;
NSRunLoop* acceptRunLoop;
BOOL accepting;
// And, last but not least, in order to make sure that socket run loops are configured AND ACTIVE before performing any work on them,
// we need to be able to signal that they're
NSCondition* readyCondition;
BOOL socketReady;
// Information used to hash callbacks and asynch ops to tags.
int asynchTagCount;
NSMutableDictionary* operationInfo;
KrollCallback* connected;
KrollCallback* accepted;
KrollCallback* closed;
KrollCallback* error;
}
// Properties:
// -- Stored on TiProxy dynprops --
// int port
// ----
@property (nonatomic, readwrite, retain) NSString* host;
@property (nonatomic, readonly) NSNumber* state; // Req's local processing
@property (nonatomic, readwrite, retain) KrollCallback* connected;
@property (nonatomic, readwrite, retain) KrollCallback* accepted;
@property (nonatomic, readwrite, retain) KrollCallback* closed;
@property (nonatomic, readwrite, retain) KrollCallback* error;
// Public API
-(void)connect:(id)_void;
-(void)listen:(id)arg; // arg[0]: int maxAcceptQueueSize : queue size
-(void)accept:(id)arg; // arg[0]: Object params : callbacks for created socket
-(void)close:(id)_void;
@end
#endif |
/* USB console example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include "esp_system.h"
#include "esp_log.h"
#include "esp_console.h"
#include "linenoise/linenoise.h"
#include "argtable3/argtable3.h"
#include "cmd_nvs.h"
#include "cmd_system.h"
#include "esp_vfs_cdcacm.h"
#include "nvs.h"
#include "nvs_flash.h"
static void initialize_nvs(void)
{
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK( nvs_flash_erase() );
err = nvs_flash_init();
}
ESP_ERROR_CHECK(err);
}
static void initialize_console(void)
{
/* Disable buffering on stdin */
setvbuf(stdin, NULL, _IONBF, 0);
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
esp_vfs_dev_cdcacm_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
/* Move the caret to the beginning of the next line on '\n' */
esp_vfs_dev_cdcacm_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
/* Enable non-blocking mode on stdin and stdout */
fcntl(fileno(stdout), F_SETFL, 0);
fcntl(fileno(stdin), F_SETFL, 0);
/* Initialize the console */
esp_console_config_t console_config = {
.max_cmdline_args = 8,
.max_cmdline_length = 256,
#if CONFIG_LOG_COLORS
.hint_color = atoi(LOG_COLOR_CYAN)
#endif
};
ESP_ERROR_CHECK( esp_console_init(&console_config) );
/* Configure linenoise line completion library */
/* Enable multiline editing. If not set, long commands will scroll within
* single line.
*/
linenoiseSetMultiLine(1);
/* Tell linenoise where to get command completions and hints */
linenoiseSetCompletionCallback(&esp_console_get_completion);
linenoiseSetHintsCallback((linenoiseHintsCallback*) &esp_console_get_hint);
/* Set command history size */
linenoiseHistorySetMaxLen(10);
}
void app_main(void)
{
initialize_nvs();
initialize_console();
/* Register commands */
esp_console_register_help_command();
register_system_common();
register_system_sleep();
register_nvs();
/* Prompt to be printed before each line.
* This can be customized, made dynamic, etc.
*/
const char* prompt = LOG_COLOR_I CONFIG_IDF_TARGET "> " LOG_RESET_COLOR;
printf("\n"
"This is an example of ESP-IDF console component.\n"
"Type 'help' to get the list of commands.\n"
"Use UP/DOWN arrows to navigate through command history.\n"
"Press TAB when typing command name to auto-complete.\n");
/* Figure out if the terminal supports escape sequences */
int probe_status = linenoiseProbe();
if (probe_status) { /* zero indicates success */
printf("\n"
"Your terminal application does not support escape sequences.\n"
"Line editing and history features are disabled.\n"
"On Windows, try using Putty instead.\n");
linenoiseSetDumbMode(1);
#if CONFIG_LOG_COLORS
/* Since the terminal doesn't support escape sequences,
* don't use color codes in the prompt.
*/
prompt = CONFIG_IDF_TARGET "> ";
#endif //CONFIG_LOG_COLORS
}
/* Main loop */
while(true) {
/* Get a line using linenoise.
* The line is returned when ENTER is pressed.
*/
char* line = linenoise(prompt);
if (line == NULL) { /* Ignore empty lines */
continue;
}
/* Add the command to the history */
linenoiseHistoryAdd(line);
/* Try to run the command */
int ret;
esp_err_t err = esp_console_run(line, &ret);
if (err == ESP_ERR_NOT_FOUND) {
printf("Unrecognized command\n");
} else if (err == ESP_ERR_INVALID_ARG) {
// command was empty
} else if (err == ESP_OK && ret != ESP_OK) {
printf("Command returned non-zero error code: 0x%x (%s)\n", ret, esp_err_to_name(ret));
} else if (err != ESP_OK) {
printf("Internal error: %s\n", esp_err_to_name(err));
}
/* linenoise allocates line buffer on the heap, so need to free it */
linenoiseFree(line);
}
}
|
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GraphicsTypes3D_h
#define GraphicsTypes3D_h
#include "wtf/Forward.h"
#include <stdint.h>
// GC3D types match the corresponding GL types as defined in OpenGL ES 2.0
// header file gl2.h from khronos.org.
typedef unsigned int GC3Denum;
typedef unsigned char GC3Dboolean;
typedef unsigned int GC3Dbitfield;
typedef signed char GC3Dbyte;
typedef unsigned char GC3Dubyte;
typedef short GC3Dshort;
typedef unsigned short GC3Dushort;
typedef int GC3Dint;
typedef int GC3Dsizei;
typedef unsigned int GC3Duint;
typedef float GC3Dfloat;
typedef unsigned short GC3Dhalffloat;
typedef float GC3Dclampf;
typedef intptr_t GC3Dintptr;
typedef intptr_t GC3Dsizeiptr;
typedef char GC3Dchar;
typedef GC3Duint Platform3DObject;
#endif
|
/*
* Copyright 2009-2013 Olivier WENGER
* http://www.magicspark.org/ or http://oulydev.free.fr/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Used by Ext.rc
#ifndef __MMF2EXT_ASCII_RESOURCE_H__
#define __MMF2EXT_ASCII_RESOURCE_H__
#define _APS_NO_MFC 1
// About box information
#define IDST_OBJNAME 128
#define IDST_AUTHOR 129
#define IDST_COPYRIGHT 130
#define IDST_COMMENT 131
#define IDST_HTTP 132
// Dialog Box ID
#define DB_SETUP 20003
// Help ID
#define ID_HELP 20004
// Actions
//-------------------
// Identifier of actions menu
#define MN_ACTIONS 20000
// Commands of action menu
// Action strings
// Titles of action parameters
// Conditions
//--------------------
// Identifier of conditions menu
#define MN_CONDITIONS 20001
// Commands of condition menu
// Condition strings
// Titles of condition parameters
// EXPRESSIONS
//---------------------
// Identifier of expressions menu
#define MN_EXPRESSIONS 20002
// Commands of expressions menu
#define EXP_IDMN_INT2CHAR 27000
#define EXP_IDMN_CHAR2INT 27001
// Expression strings
#define EXP_IDS_INT2CHAR 7000
#define EXP_IDS_CHAR2INT 7001
// Names of expression parameters
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
#endif /* __MMF2EXT_ASCII_RESOURCE_H__ */
/* END OF FILE */ |
#ifndef __NETWORK_SERVER_H__
#define __NETWORK_SERVER_H__
#include <map>
#include <pthread.h>
#include <time.h>
#include <sys/epoll.h>
#include <errno.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <network/sender.h>
#include <network/socket-buf.h>
#include <util/packet.h>
#include <util/queue.h>
#include <util/queue-batcher.h>
#include <network/socket.h>
#include <util/code-handler.h>
#include <util/logger.h>
class Server
{
public:
Server(const char * port, Queue<Packet> * pInQueue, std::map<int, Queue<Packet> *> * const pOutQueues, int outQueueSize);
~Server();
void publishStat(const char * msg);
int cancel();
void run();
static void * runHelper(void *);
private:
const char * mPort;
Queue<Packet> * mpInQueue;
std::map<int, Queue<Packet> *> * mpOutQueues;
int mOutQueueSize;
int mSfd;
SocketBuf ** mpBufs;
Sender * mpSender;
struct epoll_event * mEvents;
int mByteCnt;
time_t mStart;
int mPacketCnt;
int mRecvCnt;
int mFullRecv;
QueueBatcher<Packet> * mpBatcher;
pthread_t mSenderThread;
void resetStat();
friend class Validator;
friend class Storage;
};
#endif // __NETWORK_SERVER_H__
|
/* Copyright 1996-2014 Arch D. Robison
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/******************************************************************************
OS-independent game code that is called from OS specific services on the host.
*******************************************************************************/
#pragma once
#ifndef GAME_H
#define GAME_H
#include "NimbleDraw.h"
//! Must be called by host to initialize game for window of given size.
/** Initializes game-specific data structures.
Return true if successful, otherwise false. */
bool GameInitialize(int width, int height);
//! Called when user presses keyboard key.
/** See HostIsKeyDown in Host.h for key codes. */
void GameKeyDown( int key );
//! Return null-terminated string with name of game and version.
/** Defined by client. */
const char* GameTitle();
//! Called when mouse moves to new coordinate
void GameMouseMove( const NimblePoint& point );
//! Kth mouse button was pressed
void GameMouseButtonDown( const NimblePoint& point, int k );
//! Kth mouse buttom was released
void GameMouseButtonUp( const NimblePoint& point, int k );
//! Update and/or draw game state, depending on flags set in request.
void GameUpdateDraw( NimblePixMap& map, NimbleRequest request );
//! Called when main window has been resized or moved.
/** map contains the new size and position of the window. */
void GameResizeOrMove( NimblePixMap& map );
#endif /* GAME_H */ |
/* Siconos is a program dedicated to modeling, simulation and control
* of non smooth dynamical systems.
*
* Copyright 2016 INRIA.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
char *** test_collection(int, char **);
char *** test_collection(int n_data_1, char ** data_collection_1)
{
int n_test=150;
int n_entry = 50;
char *** test_nsgs = (char ***)malloc(n_test*sizeof(char **));
for (int n =0 ; n <n_test ; n++)
{
test_nsgs[n] = (char **)malloc(n_entry*sizeof(char *));
}
int n =0;
for ( int d =0; d <n_data_1; d++)
{
int e=0;
test_nsgs[n][e++] = data_collection_1[d];
test_nsgs[n][e++] = "0";
test_nsgs[n][e] = (char *)malloc(50*sizeof(char));
sprintf(test_nsgs[n][e++], "%d", SICONOS_FRICTION_2D_NSGS);
test_nsgs[n][e++] = "1e-5";
test_nsgs[n][e++] = "10000";
test_nsgs[n][e++] = "---";
n++;
}
for ( int d =0; d < 2; d++)
{
int e=0;
test_nsgs[n][e++] = data_collection_1[d];
test_nsgs[n][e++] = "0";
test_nsgs[n][e] = (char *)malloc(50*sizeof(char));
sprintf(test_nsgs[n][e++], "%d", SICONOS_FRICTION_2D_CPG);
test_nsgs[n][e++] = "1e-5";
test_nsgs[n][e++] = "10000";
test_nsgs[n][e++] = "---";
n++;
}
for ( int d =0; d <2; d++)
{
int e=0;
test_nsgs[n][e++] = data_collection_1[d];
test_nsgs[n][e++] = "0";
test_nsgs[n][e] = (char *)malloc(50*sizeof(char));
sprintf(test_nsgs[n][e++], "%d", SICONOS_FRICTION_2D_LATIN);
test_nsgs[n][e++] = "1e-5";
test_nsgs[n][e++] = "10000";
test_nsgs[n][e++] = "---";
n++;
}
for ( int d =0; d <n_data_1; d++)
{
int e=0;
test_nsgs[n][e++] = data_collection_1[d];
test_nsgs[n][e++] = "0";
test_nsgs[n][e] = (char *)malloc(50*sizeof(char));
sprintf(test_nsgs[n][e++], "%d", SICONOS_FRICTION_2D_LEMKE);
test_nsgs[n][e++] = "1e-5";
test_nsgs[n][e++] = "10000";
test_nsgs[n][e++] = "---";
n++;
}
for ( int d =6; d <n_data_1; d++)
{
int e=0;
test_nsgs[n][e++] = data_collection_1[d];
test_nsgs[n][e++] = "0";
test_nsgs[n][e] = (char *)malloc(50*sizeof(char));
sprintf(test_nsgs[n][e++], "%d", SICONOS_FRICTION_2D_ENUM);
test_nsgs[n][e++] = "1e-5";
test_nsgs[n][e++] = "10000";
test_nsgs[n][e++] = "---";
n++;
}
test_nsgs[n][0] ="---";
return test_nsgs;
}
|
//
// LQYTabBarController.h
// baisibudejie
//
// Created by shasha on 15/10/20.
// Copyright © 2015年 shasha. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LQYTabBarController : UITabBarController
@end
|
//
// JiveTypedObject.h
//
//
// Created by Orson Bushnell on 2/25/13.
//
// Copyright 2013 Jive Software Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "JiveObject.h"
extern struct JiveTypedObjectAttributes {
__unsafe_unretained NSString *type;
} const JiveTypedObjectAttributes;
//! \class JiveTypedObject
//! An iOS specific class with no REST api equivalent.
@interface JiveTypedObject : JiveObject
//! The object type of this object. This field is required when creating new content.
@property(nonatomic, readonly) NSString* type;
- (NSURL *)selfRef;
- (BOOL)canDelete;
- (BOOL)isUpdateable;
@end
|
/*
Copyright 2011 Etay Meiri
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SKYBOX_H
#define SKYBOX_H
#include "ogldev_camera.h"
#include "skybox_technique.h"
#include "ogldev_cubemap_texture.h"
#include "mesh.h"
class SkyBox
{
public:
SkyBox(const Camera* pCamera, const PersProjInfo& p);
~SkyBox();
bool Init(const string& Directory,
const string& PosXFilename,
const string& NegXFilename,
const string& PosYFilename,
const string& NegYFilename,
const string& PosZFilename,
const string& NegZFilename);
void Render();
private:
SkyboxTechnique* m_pSkyboxTechnique;
const Camera* m_pCamera;
CubemapTexture* m_pCubemapTex;
Mesh* m_pMesh;
PersProjInfo m_persProjInfo;
};
#endif /* SKYBOX_H */
|
// x3py framework: https://github.com/rhcad/x3py
#if !defined(X3_NONPLUGIN_USE_PLUGIN_H) && !defined(X3_NONPLUGIN_USE_PLUGINS_H)
#define X3_NONPLUGIN_USE_PLUGIN_H
#include <utilfunc/loadmodule.h>
#include "swigext.h"
// PLUGIN_PATH: the internal plugin (*.pln) 's relative folder.
// PLUGIN_NAME: the internal plugin name, no extension and path.
// SELF_MODULE_NAME: file name of the caller module which will load the internal plugin.
// SELF_MODULE: defined when the caller name hasn't PLUGIN_NAME.
#ifdef PLUGIN_NAME
#ifndef SELF_MODULE_NAME
#ifndef SELF_MODULE
#define SELF_MODULE_NAME SELF_PRE PLUGIN_NAME SELF_EXT
#else
#define SELF_MODULE_NAME SELF_PRE SELF_MODULE SELF_EXT
#endif
#endif // SELF_MODULE_NAME
#if defined(X3_CORE_PORTABILITY_H) && !defined(X3_EXCLUDE_CREATEOBJECT)
#include "../portability/portimpl.h"
#endif
namespace x3 {
static LoadModuleHelper loader(PLUGIN_PATH PLUGIN_NAME ".pln",
GetModuleHandleA(SELF_MODULE_NAME));
#if !defined(X3_EXCLUDE_CREATEOBJECT) && !defined(CREATEOBJECTIMPL)
#define CREATEOBJECTIMPL
HMODULE getManagerModule()
{
return loader.getModule();
}
class IObject;
bool createObject(const char* clsid, long iid, IObject** p)
{
typedef bool (*F)(const char*, long, IObject**);
F f = (F)loader.getFunc("x3CreateObject");
return f && f(clsid, iid, p);
}
#endif // CREATEOBJECTIMPL
} // x3
#endif // PLUGIN_NAME
#endif
|
navigation: total: to 1 chart Total
#PURPOSE go to time Total layout 1
#
#
#
#1 go to time layout 1
Go to Layout [ “Total01chart” (brainstate) ]
#
#2 go to user's chosen day
Set Field [ reference::day1; steward::chosenDayTotal ]
#
#3 refresh the layout so that the key fields for each record will be recalculated based on the new day selected. The date and times shown for
each record are in a table related to each brainstate record by their dates. The key date fields for all brainstate records are calculations
where the value equals the reference field date shown at the top of the screen in the green, red, or yellow box. So when the user changes
the date in the reference field (top colored box) and then this script refreshes the database, all the brainstate records including the ones not
shown recalculate their key fields, the result being they all take in the new date. This means that the related day records now change too to
show the user the day records that match the updated brainstate record keys. (These day fields are locked to their related brainstate
records by the brainstate records ID number. Using these to keys, the database is able to return the desired day fields for brainstate record
the user elects to view at any one time.)
Refresh Window
[ Flush cached join results ]
#
#4 sort records (neccessary because the week and month view usually show more active records than the day view that need to be sorted out of
top of list), and go to the first record.
Perform Script [ “DaySelectSortThenSort” ]
January 5, 平成26 19:21:45 ActionLog.fp7 - to 1 chart Total -1-
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "android/androidbroadcastreceiver_p.h"
#include <QtBluetooth/QBluetoothAddress>
#include <QtBluetooth/QBluetoothLocalDevice>
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#ifndef LOCALDEVICEBROADCASTRECEIVER_H
#define LOCALDEVICEBROADCASTRECEIVER_H
QT_BEGIN_NAMESPACE
class LocalDeviceBroadcastReceiver : public AndroidBroadcastReceiver
{
Q_OBJECT
public:
explicit LocalDeviceBroadcastReceiver(QObject *parent = 0);
virtual ~LocalDeviceBroadcastReceiver() {}
virtual void onReceive(JNIEnv *env, jobject context, jobject intent);
bool pairingConfirmation(bool accept);
signals:
void hostModeStateChanged(QBluetoothLocalDevice::HostMode state);
void pairingStateChanged(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing);
void connectDeviceChanges(const QBluetoothAddress &address, bool isConnectEvent);
void pairingDisplayConfirmation(const QBluetoothAddress &address, const QString& pin);
private:
int previousScanMode;
QAndroidJniObject pairingDevice;
int bondingModePreset[3];
int hostModePreset[3];
};
QT_END_NAMESPACE
#endif // LOCALDEVICEBROADCASTRECEIVER_H
|
/*=========================================================================
Library: TubeTK
Copyright 2010 Kitware Inc. 28 Corporate Drive,
Clifton Park, NY, 12065, USA.
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef __tubeMatrixMath_h
#define __tubeMatrixMath_h
#include "tubeMacro.h"
#include <vnl/vnl_math.h>
#include <vnl/vnl_vector_ref.h>
#define EIGEN_MAX_ITERATIONS 100
namespace tube
{
/**
* \brief This class provides useful mathematical operations
*/
/** simple function that return the orthogonal vector to one */
template< class T >
vnl_vector<T>
ComputeOrthogonalVector(vnl_vector<T> x);
/** simple function that return the cross vector from two vectors */
template< class T >
vnl_vector<T>
ComputeCrossVector(vnl_vector<T> v1, vnl_vector<T> v2);
/** return the new position following the vector direction */
template< class T >
vnl_vector<T>
ComputeLineStep(vnl_vector<T> x, double a, vnl_vector<T> dir);
/** Compute the Euclidean distance */
template< class T >
double
ComputeEuclideanDistanceVector(vnl_vector<T> x, const vnl_vector<T> y);
/** Compute the Euclidean distance for two points */
template< class TPoint >
double
ComputeEuclideanDistance(TPoint x, TPoint y);
/** Compute Ridgeness measures */
template< class T >
void
ComputeRidgeness( const vnl_matrix<T> & H,
const vnl_vector<T> & D,
double & ridgeness,
double & roundness,
double & curvature,
double & linearity,
vnl_matrix<T> & HEVect, vnl_vector<T> & HEVal );
/** Compute eigenvalues and vectors */
template< class T >
void
ComputeEigen(vnl_matrix<T> const & mat, vnl_matrix<T> &eVects,
vnl_vector<T> &eVals, bool orderByAbs, bool minToMax = true);
/** Perform trilinear diagonalization */
template< class T >
void
ComputeTriDiag(vnl_matrix<T> &mat, vnl_vector<T> &diag, vnl_vector<T> &subD);
/** Perform trilinear diagonalization in 2D */
template< class T >
void
ComputeTriDiag2D(vnl_matrix<T> &mat, vnl_vector<T> &diag, vnl_vector<T> &subD);
/** Perform trilinear diagonalization in 3D */
template< class T >
void
ComputeTriDiag3D(vnl_matrix<T> &mat, vnl_vector<T> &diag, vnl_vector<T> &subD);
/** */
template< class T >
void
ComputeTqli(vnl_vector<T> &diag, vnl_vector<T> &subD, vnl_matrix<T> &mat);
} // End namespace tube
#ifndef TUBE_MANUAL_INSTANTIATION
#include "tubeMatrixMath.hxx"
#endif
#endif // End !defined(__tubeMatrixMath_h)
|
/*
** Copyright (c) 2011-2012 The Linux Foundation. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef __QCAMERAHWI_MEM_H
#define __QCAMERAHWI_MEM_H
#include <binder/MemoryBase.h>
#include <binder/MemoryHeapBase.h>
#include <utils/threads.h>
#include <stdint.h>
#include "QCamera_Intf.h"
extern "C" {
#include <linux/android_pmem.h>
#include <linux/msm_ion.h>
}
#define VIDEO_BUFFER_COUNT 5
#define VIDEO_BUFFER_COUNT_LOW_POWER_CAMCORDER 9
#define PREVIEW_BUFFER_COUNT 5
namespace android {
// This class represents a heap which maintains several contiguous
// buffers. The heap may be backed by pmem (when pmem_pool contains
// the name of a /dev/pmem* file), or by ashmem (when pmem_pool == NULL).
struct MemPool : public RefBase {
MemPool(int buffer_size, int num_buffers,
int frame_size,
const char *name);
virtual ~MemPool() = 0;
void completeInitialization();
bool initialized() const {
return mHeap != NULL && mHeap->base() != MAP_FAILED;
}
virtual status_t dump(int fd, const Vector<String16>& args) const;
int mBufferSize;
int mAlignedBufferSize;
int mNumBuffers;
int mFrameSize;
sp<MemoryHeapBase> mHeap;
sp<MemoryBase> *mBuffers;
const char *mName;
};
class AshmemPool : public MemPool {
public:
AshmemPool(int buffer_size, int num_buffers,
int frame_size,
const char *name);
};
class PmemPool : public MemPool {
public:
PmemPool(const char *pmem_pool,
int flags, int pmem_type,
int buffer_size, int num_buffers,
int frame_size, int cbcr_offset,
int yoffset, const char *name);
virtual ~PmemPool();
int mFd;
int mPmemType;
int mCbCrOffset;
int myOffset;
int mCameraControlFd;
uint32_t mAlignedSize;
struct pmem_region mSize;
};
class IonPool : public MemPool {
public:
IonPool( int flags,
int buffer_size, int num_buffers,
int frame_size, int cbcr_offset,
int yoffset, const char *name);
virtual ~IonPool();
int mFd;
int mCbCrOffset;
int myOffset;
int mCameraControlFd;
uint32_t mAlignedSize;
private:
static const char mIonDevName[];
};
};
#endif
|
//
// Util.h
// 百宝袋
//
// Created by admin on 15/11/13.
// Copyright (c) 2015年 handsome. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UIKit/UIkit.h"
#import "MBProgressHUD.h"
@interface Util : NSObject
#pragma mark - 第一个参数为限定size 第二个为需要计算的label 第三个为label的内容 返回算出的size
+ (CGSize)boundingRectWithSize:(CGSize)size
label:(UILabel *)label;
#pragma mark - 根据内容计算高度
+ (void)setTitleWithText:(NSString *)text
cell:(UITableViewCell *)cell;
//toast
+ (void)showToastWithView:(UIView *)view
text:(NSString *)text;
//进度条
+ (id)showProgressWithView:(UIView *)view
text:(NSString *)text;
@end
|
/*
* Copyright 2008-2015 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MRCP_SOFIASIP_SERVER_AGENT_H
#define MRCP_SOFIASIP_SERVER_AGENT_H
/**
* @file mrcp_sofiasip_server_agent.h
* @brief Implementation of MRCP Signaling Interface using Sofia-SIP
*/
#include <apr_network_io.h>
#include "mrcp_sig_agent.h"
APT_BEGIN_EXTERN_C
/** Sofia-SIP config declaration */
typedef struct mrcp_sofia_server_config_t mrcp_sofia_server_config_t;
/** Sofia-SIP config */
struct mrcp_sofia_server_config_t {
/** Local IP address to bind to */
char *local_ip;
/** External (NAT) IP address */
char *ext_ip;
/** Local port to bind to */
apr_port_t local_port;
/** SIP user name */
char *user_name;
/** User agent name */
char *user_agent_name;
/** SDP origin */
char *origin;
/** SIP transport */
char *transport;
/** Force destination IP address. Should be used only in case
SDP contains incorrect connection address (local IP address behind NAT) */
apt_bool_t force_destination;
/** SIP T1 timer */
apr_size_t sip_t1;
/** SIP T2 timer */
apr_size_t sip_t2;
/** SIP T4 timer */
apr_size_t sip_t4;
/** SIP T1x64 timer */
apr_size_t sip_t1x64;
/** SIP Sessione-Expires */
apr_size_t session_expires;
/** SIP Min-SE */
apr_size_t min_session_expires;
/** Print out SIP messages to the console */
apt_bool_t tport_log;
/** Dump SIP messages to the specified file */
char *tport_dump_file;
};
/**
* Create Sofia-SIP signaling agent.
*/
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_sofiasip_server_agent_create(const char *id, mrcp_sofia_server_config_t *config, apr_pool_t *pool);
/**
* Allocate Sofia-SIP config.
*/
MRCP_DECLARE(mrcp_sofia_server_config_t*) mrcp_sofiasip_server_config_alloc(apr_pool_t *pool);
APT_END_EXTERN_C
#endif /* MRCP_SOFIASIP_SERVER_AGENT_H */
|
//
// ViewController.h
// BirthdatyManager
//
// Created by wzy on 15/7/31.
// Copyright (c) 2015年 wzy. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by Jellow, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* WARNING: This is generated code. Modify at your own risk and without support.
*/
#import <Foundation/Foundation.h>
@interface ApplicationDefaults : NSObject {
}
+ (NSMutableDictionary *) copyDefaults;
@end |
/* ****************************************************************
*
* Copyright 2014 Samsung Electronics All Rights Reserved.
*
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************/
/**
* @file
* This file contains the APIs for BT LE communications.
*/
#ifndef CA_LE_UTILS_H_
#define CA_LE_UTILS_H_
#include "cacommon.h"
#include "cathreadpool.h"
#include "cagattservice.h"
#include "uarraylist.h"
#include "jni.h"
#ifdef __cplusplus
extern "C"
{
#endif
/* Service UUID */
static const char OIC_GATT_SERVICE_UUID[] = CA_GATT_SERVICE_UUID;
static const char OIC_GATT_CHARACTERISTIC_REQUEST_UUID[] = CA_GATT_REQUEST_CHRC_UUID;
static const char OIC_GATT_CHARACTERISTIC_RESPONSE_UUID[] = CA_GATT_RESPONSE_CHRC_UUID;
static const char OIC_GATT_CHARACTERISTIC_CONFIG_UUID[] = "00002902-0000-1000-8000-00805f9b34fb";
static const char CLASSPATH_BT_PROFILE[] = "android/bluetooth/BluetoothProfile";
static const char CLASSPATH_BT_GATT[] = "android/bluetooth/BluetoothGatt";
static const char CLASSPATH_BT_ADAPTER[] = "android/bluetooth/BluetoothAdapter";
static const char CLASSPATH_BT_DEVICE[] = "android/bluetooth/BluetoothDevice";
static const char CLASSPATH_BT_UUID[] = "java/util/UUID";
static const char METHODID_OBJECTNONPARAM[] = "()Landroid/bluetooth/BluetoothAdapter;";
static const char METHODID_BT_DEVICE[] = "()Landroid/bluetooth/BluetoothDevice;";
static const char METHODID_BT_REMOTE_DEVICE[] = "(Ljava/lang/String;)Landroid/bluetooth/BluetoothDevice;";
static const jint GATT_PROFILE = 7;
static const jint GATT_SUCCESS = 0;
static const jint BOND_BONDED = 12;
static const jint BOND_BONDING = 11;
static const jint BOND_NONE = 10;
static const jint STATE_CONNECTED = 2;
static const jint STATE_DISCONNECTED = 0;
/**
* get uuid(jni object) from uuid(character).
* @param[in] env JNI interface pointer.
* @param[in] uuid uuid(character).
* @return uuid(jni object).
*/
jobject CALEGetUuidFromString(JNIEnv *env, const char* uuid);
/**
* get parcel uuid object.
* @param[in] env JNI interface pointer.
* @param[in] uuid uuid (jni object).
* @return parcel uuid object.
*/
jobject CALEGetParcelUuid(JNIEnv *env, jobject uuid);
/**
* get address from a local device.
* @param[in] env JNI interface pointer.
* @return local address.
*/
jstring CALEGetLocalDeviceAddress(JNIEnv *env);
/**
* get bonded list.
* @param[in] env JNI interface pointer.
* @return bonded list.
*/
jobjectArray CALEGetBondedDevices(JNIEnv *env);
/**
* get constants information of bluetooth state-on.
* @param[in] env JNI interface pointer.
* @return constants information of bluetooth state-on.
*/
jint CALEGetBTStateOnInfo(JNIEnv *env);
/**
* check this device can be supported as BLE client or server.
* @param[in] env JNI interface pointer.
* @param[in] level Android API Level to support.
* @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
*/
CAResult_t CALECheckPlatformVersion(JNIEnv *env, uint16_t level);
/**
* get constants information of android.os.Build.VERSION.SDK_INT.
* @param[in] env JNI interface pointer.
* @return constants information of android.os.Build.VERSION.SDK_INT.
*/
jint CALEGetBuildVersion(JNIEnv *env);
/**
* get constants information of android.os.Build.VERSION_CODES.[VersionName].
* @param[in] env JNI interface pointer.
* @param[in] versionName version name (.., KITKAT, LOLLIPOP, ..).
* @return constants information of android.os.Build.VERSION_CODES.[VersionName].
*/
jint CALEGetBuildVersionCodeForName(JNIEnv *env, const char* versionName);
/**
* get bluetooth adapter state information.
* @param[in] env JNI interface pointer.
* @return JNI_TRUE if the local adapter is turned on.
*/
jboolean CALEIsEnableBTAdapter(JNIEnv *env);
/**
* get address from remote device.
* @param[in] env JNI interface pointer.
* @param[in] bluetoothDevice bluetooth device object.
* @return remote address.
*/
jstring CALEGetAddressFromBTDevice(JNIEnv *env, jobject bluetoothDevice);
/**
* get value from selected constants.
* @param[in] env JNI interface pointer.
* @param[in] classType class type
* @param[in] name constants name to get.
* @return remote address.
*/
jint CALEGetConstantsValue(JNIEnv *env, const char* classType, const char* name);
/**
* get bluetooth device object from bluetooth adapter.
* @param[in] env JNI interface pointer.
* @param[in] address bluetooth address.
* @return bluetooth device object.
*/
jobject CALEGetRemoteDevice(JNIEnv *env, jstring address);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CA_LE_UTILS_H_ */
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/accessanalyzer/AccessAnalyzer_EXPORTS.h>
#include <aws/accessanalyzer/model/ReasonCode.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace AccessAnalyzer
{
namespace Model
{
/**
* <p>Provides more details about the current status of the analyzer. For example,
* if the creation for the analyzer fails, a <code>Failed</code> status is
* displayed. For an analyzer with organization as the type, this failure can be
* due to an issue with creating the service-linked roles required in the member
* accounts of the AWS organization.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/StatusReason">AWS
* API Reference</a></p>
*/
class AWS_ACCESSANALYZER_API StatusReason
{
public:
StatusReason();
StatusReason(Aws::Utils::Json::JsonView jsonValue);
StatusReason& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The reason code for the current status of the analyzer.</p>
*/
inline const ReasonCode& GetCode() const{ return m_code; }
/**
* <p>The reason code for the current status of the analyzer.</p>
*/
inline bool CodeHasBeenSet() const { return m_codeHasBeenSet; }
/**
* <p>The reason code for the current status of the analyzer.</p>
*/
inline void SetCode(const ReasonCode& value) { m_codeHasBeenSet = true; m_code = value; }
/**
* <p>The reason code for the current status of the analyzer.</p>
*/
inline void SetCode(ReasonCode&& value) { m_codeHasBeenSet = true; m_code = std::move(value); }
/**
* <p>The reason code for the current status of the analyzer.</p>
*/
inline StatusReason& WithCode(const ReasonCode& value) { SetCode(value); return *this;}
/**
* <p>The reason code for the current status of the analyzer.</p>
*/
inline StatusReason& WithCode(ReasonCode&& value) { SetCode(std::move(value)); return *this;}
private:
ReasonCode m_code;
bool m_codeHasBeenSet;
};
} // namespace Model
} // namespace AccessAnalyzer
} // namespace Aws
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/com/google/common/io/MoreFiles.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_ComGoogleCommonIoMoreFiles")
#ifdef RESTRICT_ComGoogleCommonIoMoreFiles
#define INCLUDE_ALL_ComGoogleCommonIoMoreFiles 0
#else
#define INCLUDE_ALL_ComGoogleCommonIoMoreFiles 1
#endif
#undef RESTRICT_ComGoogleCommonIoMoreFiles
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_ComGoogleCommonIoMoreFiles")
|
//
// Copyright (C) Posten Norge AS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@class POSRootResource;
@interface SHCBaseTableViewController : UITableViewController
@property (strong, nonatomic, readonly) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSEntityDescription *baseEntity;
@property (strong, nonatomic) NSArray *sortDescriptors;
@property (strong, nonatomic) NSPredicate *predicate;
@property (strong, nonatomic) POSRootResource *rootResource;
// Override these methods in subclass
- (void)updateContentsFromServerUserInitiatedRequest:(NSNumber *) userDidInititateRequest;
- (void)updateNavbar;
- (void)updateFetchedResultsController;
- (void)programmaticallyEndRefresh;
@end
|
/*
* Copyright (C) 2013 Near Infinity Corporation
*
* This file is part of Honeycomb Storage Engine.
*
* Honeycomb Storage Engine 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.
*
* Honeycomb Storage Engine 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 Honeycomb Storage Engine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef JAVA_H
#define JAVA_H
class JNICache;
class Serializable;
struct JNIEnv_;
typedef JNIEnv_ JNIEnv;
class _jstring;
typedef _jstring *jstring;
class _jbyteArray;
typedef _jbyteArray *jbyteArray;
#include <stdint.h>
/**
* @brief Prints a Java exception out to logs and stderr
*
* @param jni_env Java environment
*
* @return Whether there was an exception to print
*/
bool print_java_exception(JNIEnv* jni_env);
/**
* @brief Check for an exception waiting in the JVM
*
* @param env Java environment
* @param cache Cache of JNI classes
* @param location Where is this function being called from
*
* @return MySQL error code corresponding to the Java exception
*/
int check_exceptions(JNIEnv* env, JNICache* cache, const char* location);
/**
* @brief Convert a C byte array into a Java byte array
*
* @param value C byte array
* @param length Length of the byte array
* @param env Java environment
*
* @return Java byte array
*/
jbyteArray convert_value_to_java_bytes(unsigned char* value, uint32_t length, JNIEnv* env);
/**
* @brief Convert a Java byte array to a C byte array
*
* @param java_bytes Java byte array
* @param env Java environment
*
* @return C byte array
*/
char *char_array_from_java_bytes(jbyteArray java_bytes, JNIEnv* env);
/**
* @brief Convert a Java string into a C string
*
* @param env Java environment
* @param str Java string
*
* @return C string
*/
const char* java_to_string(JNIEnv* env, jstring str);
/**
* @brief Convert a C string into a Java string
*
* @param env Java environment
* @param string C string
*
* @return Java string
*/
jstring string_to_java_string(JNIEnv* env, const char *string);
/**
* @brief Convert a serializable object to a Java byte array
*
* @param env Java environment
* @param serializable Serializable object
*
* @return Java byte array
*/
jbyteArray serialize_to_java(JNIEnv* env, Serializable& serializable);
/**
* @brief Convert a Java byte array to serializable object
*
* @param env Java environment
* @param bytes Java byte array
* @param serializable Serializable object
*/
void deserialize_from_java(JNIEnv* env, jbyteArray bytes, Serializable& serializable);
#endif
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_MulticastDelegate3201952435.h"
#include "UnityEngine_UnityEngine_Vector22243707579.h"
#include "mscorlib_System_Single2076509932.h"
// System.IAsyncResult
struct IAsyncResult_t1999651008;
// System.AsyncCallback
struct AsyncCallback_t163412349;
// System.Object
struct Il2CppObject;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.Networking.NetworkTransform/ClientMoveCallback2D
struct ClientMoveCallback2D_t1738312059 : public MulticastDelegate_t3201952435
{
public:
public:
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <exception>
#include <thrift/lib/cpp/Thrift.h>
namespace folly {
class SocketAddress;
class RequestContext;
} // namespace folly
namespace apache {
namespace thrift {
namespace server {
class TConnectionContext;
/**
* Virtual interface class that can handle events from the server core. To
* use this you should subclass it and implement the methods that you care
* about. Your subclass can also store local data that you may care about,
* such as additional "arguments" to these methods (stored in the object
* instance's state).
*/
class TServerEventHandler {
public:
virtual ~TServerEventHandler() {}
/**
* Called before the onStartServing is called.
*
* @param address The address on which the server is listening.
*/
virtual void preStart(const folly::SocketAddress* /*address*/) {}
/**
* Called before the server begins.
*
* @param address The address on which the server is listening.
*/
virtual void preServe(const folly::SocketAddress* /*address*/) {}
/**
* Called if the server will not begin.
*
* @param e The exception that caused the failure, if any.
*/
virtual void handleServeError(const std::exception& x) { (void)x; }
void handleServeError() {
handleServeError(TLibraryException("serve() threw non-exception type"));
}
/**
* Called when a new client has connected and is about to begin processing.
*
* @param ctx A pointer to the connection context. The context will remain
* valid until the corresponding connectionDestroyed() call.
*/
virtual void newConnection(TConnectionContext* ctx) { (void)ctx; }
/**
* Called when a client has finished request-handling to delete server
* context.
*
* @param ctx A pointer to the connection context. The context will be
* destroyed after connectionDestroyed() returns.
*/
virtual void connectionDestroyed(TConnectionContext* ctx) { (void)ctx; }
/**
* Called after the server stops.
*/
virtual void postStop() {}
protected:
/**
* Prevent direct instantiation.
*/
TServerEventHandler() {}
};
} // namespace server
} // namespace thrift
} // namespace apache
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/codecommit/CodeCommit_EXPORTS.h>
#include <aws/codecommit/CodeCommitRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace CodeCommit
{
namespace Model
{
/**
*/
class AWS_CODECOMMIT_API UpdateCommentRequest : public CodeCommitRequest
{
public:
UpdateCommentRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "UpdateComment"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline const Aws::String& GetCommentId() const{ return m_commentId; }
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline bool CommentIdHasBeenSet() const { return m_commentIdHasBeenSet; }
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline void SetCommentId(const Aws::String& value) { m_commentIdHasBeenSet = true; m_commentId = value; }
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline void SetCommentId(Aws::String&& value) { m_commentIdHasBeenSet = true; m_commentId = std::move(value); }
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline void SetCommentId(const char* value) { m_commentIdHasBeenSet = true; m_commentId.assign(value); }
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline UpdateCommentRequest& WithCommentId(const Aws::String& value) { SetCommentId(value); return *this;}
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline UpdateCommentRequest& WithCommentId(Aws::String&& value) { SetCommentId(std::move(value)); return *this;}
/**
* <p>The system-generated ID of the comment you want to update. To get this ID,
* use <a>GetCommentsForComparedCommit</a> or <a>GetCommentsForPullRequest</a>.</p>
*/
inline UpdateCommentRequest& WithCommentId(const char* value) { SetCommentId(value); return *this;}
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline const Aws::String& GetContent() const{ return m_content; }
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline bool ContentHasBeenSet() const { return m_contentHasBeenSet; }
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline void SetContent(const Aws::String& value) { m_contentHasBeenSet = true; m_content = value; }
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline void SetContent(Aws::String&& value) { m_contentHasBeenSet = true; m_content = std::move(value); }
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline void SetContent(const char* value) { m_contentHasBeenSet = true; m_content.assign(value); }
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline UpdateCommentRequest& WithContent(const Aws::String& value) { SetContent(value); return *this;}
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline UpdateCommentRequest& WithContent(Aws::String&& value) { SetContent(std::move(value)); return *this;}
/**
* <p>The updated content to replace the existing content of the comment.</p>
*/
inline UpdateCommentRequest& WithContent(const char* value) { SetContent(value); return *this;}
private:
Aws::String m_commentId;
bool m_commentIdHasBeenSet;
Aws::String m_content;
bool m_contentHasBeenSet;
};
} // namespace Model
} // namespace CodeCommit
} // namespace Aws
|
/* $NetBSD: mail_conf_int.c,v 1.1.1.2 2011/03/02 19:32:15 tron Exp $ */
/*++
/* NAME
/* mail_conf_int 3
/* SUMMARY
/* integer-valued configuration parameter support
/* SYNOPSIS
/* #include <mail_conf.h>
/*
/* int get_mail_conf_int(name, defval, min, max);
/* const char *name;
/* int defval;
/* int min;
/* int max;
/*
/* int get_mail_conf_int_fn(name, defval, min, max);
/* const char *name;
/* int (*defval)();
/* int min;
/* int max;
/*
/* void set_mail_conf_int(name, value)
/* const char *name;
/* int value;
/*
/* void get_mail_conf_int_table(table)
/* const CONFIG_INT_TABLE *table;
/*
/* void get_mail_conf_int_fn_table(table)
/* const CONFIG_INT_TABLE *table;
/* AUXILIARY FUNCTIONS
/* int get_mail_conf_int2(name1, name2, defval, min, max);
/* const char *name1;
/* const char *name2;
/* int defval;
/* int min;
/* int max;
/* DESCRIPTION
/* This module implements configuration parameter support
/* for integer values.
/*
/* get_mail_conf_int() looks up the named entry in the global
/* configuration dictionary. The default value is returned
/* when no value was found.
/* \fImin\fR is zero or specifies a lower limit on the integer
/* value or string length; \fImax\fR is zero or specifies an
/* upper limit on the integer value or string length.
/*
/* get_mail_conf_int_fn() is similar but specifies a function that
/* provides the default value. The function is called only
/* when the default value is needed.
/*
/* set_mail_conf_int() updates the named entry in the global
/* configuration dictionary. This has no effect on values that
/* have been looked up earlier via the get_mail_conf_XXX() routines.
/*
/* get_mail_conf_int_table() and get_mail_conf_int_fn_table() initialize
/* lists of variables, as directed by their table arguments. A table
/* must be terminated by a null entry.
/*
/* get_mail_conf_int2() concatenates the two names and is otherwise
/* identical to get_mail_conf_int().
/* DIAGNOSTICS
/* Fatal errors: malformed numerical value.
/* SEE ALSO
/* config(3) general configuration
/* mail_conf_str(3) string-valued configuration parameters
/* LICENSE
/* .ad
/* .fi
/* The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
/* System library. */
#include <sys_defs.h>
#include <stdlib.h>
#include <stdio.h> /* BUFSIZ */
#include <errno.h>
/* Utility library. */
#include <msg.h>
#include <mymalloc.h>
#include <dict.h>
#include <stringops.h>
/* Global library. */
#include "mail_conf.h"
/* convert_mail_conf_int - look up and convert integer parameter value */
static int convert_mail_conf_int(const char *name, int *intval)
{
const char *strval;
char *end;
long longval;
if ((strval = mail_conf_lookup_eval(name)) != 0) {
errno = 0;
*intval = longval = strtol(strval, &end, 10);
if (*strval == 0 || *end != 0 || errno == ERANGE || longval != *intval)
msg_fatal("bad numerical configuration: %s = %s", name, strval);
return (1);
}
return (0);
}
/* check_mail_conf_int - validate integer value */
static void check_mail_conf_int(const char *name, int intval, int min, int max)
{
if (min && intval < min)
msg_fatal("invalid %s parameter value %d < %d", name, intval, min);
if (max && intval > max)
msg_fatal("invalid %s parameter value %d > %d", name, intval, max);
}
/* get_mail_conf_int - evaluate integer-valued configuration variable */
int get_mail_conf_int(const char *name, int defval, int min, int max)
{
int intval;
if (convert_mail_conf_int(name, &intval) == 0)
set_mail_conf_int(name, intval = defval);
check_mail_conf_int(name, intval, min, max);
return (intval);
}
/* get_mail_conf_int2 - evaluate integer-valued configuration variable */
int get_mail_conf_int2(const char *name1, const char *name2, int defval,
int min, int max)
{
int intval;
char *name;
name = concatenate(name1, name2, (char *) 0);
if (convert_mail_conf_int(name, &intval) == 0)
set_mail_conf_int(name, intval = defval);
check_mail_conf_int(name, intval, min, max);
myfree(name);
return (intval);
}
/* get_mail_conf_int_fn - evaluate integer-valued configuration variable */
typedef int (*stupid_indent_int) (void);
int get_mail_conf_int_fn(const char *name, stupid_indent_int defval,
int min, int max)
{
int intval;
if (convert_mail_conf_int(name, &intval) == 0)
set_mail_conf_int(name, intval = defval());
check_mail_conf_int(name, intval, min, max);
return (intval);
}
/* set_mail_conf_int - update integer-valued configuration dictionary entry */
void set_mail_conf_int(const char *name, int value)
{
char buf[BUFSIZ]; /* yeah! crappy code! */
sprintf(buf, "%d", value); /* yeah! more crappy code! */
mail_conf_update(name, buf);
}
/* get_mail_conf_int_table - look up table of integers */
void get_mail_conf_int_table(const CONFIG_INT_TABLE *table)
{
while (table->name) {
table->target[0] = get_mail_conf_int(table->name, table->defval,
table->min, table->max);
table++;
}
}
/* get_mail_conf_int_fn_table - look up integers, defaults are functions */
void get_mail_conf_int_fn_table(const CONFIG_INT_FN_TABLE *table)
{
while (table->name) {
table->target[0] = get_mail_conf_int_fn(table->name, table->defval,
table->min, table->max);
table++;
}
}
|
/**
* @file daplink_addr.h
* @brief
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef DAPLINK_ADDR_H
#define DAPLINK_ADDR_H
/* Device sizes */
#define DAPLINK_ROM_START 0x00000000
#define DAPLINK_ROM_SIZE 0x00020000
#define DAPLINK_RAM_START 0x1FFFE000
#define DAPLINK_RAM_SIZE 0x00004000
/* ROM sizes */
#define DAPLINK_ROM_BL_START 0x00000000
#define DAPLINK_ROM_BL_SIZE 0x00007C00
#define DAPLINK_ROM_CONFIG_ADMIN_START 0x00007C00
#define DAPLINK_ROM_CONFIG_ADMIN_SIZE 0x00000400
#define DAPLINK_ROM_IF_START 0x00008000
#define DAPLINK_ROM_IF_SIZE 0x00017C00
#define DAPLINK_ROM_CONFIG_USER_START 0x0001FC00
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00000400
/* RAM sizes */
#define DAPLINK_RAM_APP_START 0x1FFFE000
#define DAPLINK_RAM_APP_SIZE 0x00003F00
#define DAPLINK_RAM_SHARED_START 0x20001F00
#define DAPLINK_RAM_SHARED_SIZE 0x00000100
/* Flash Programming Info */
#define DAPLINK_SECTOR_SIZE 0x00000400
#define DAPLINK_MIN_WRITE_SIZE 0x00000100
/* Current build */
#if defined(DAPLINK_BL)
#define DAPLINK_ROM_APP_START DAPLINK_ROM_BL_START
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_BL_SIZE
#define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_IF_START
#define DAPLINK_ROM_UPDATE_SIZE DAPLINK_ROM_IF_SIZE
#elif defined(DAPLINK_IF)
#define DAPLINK_ROM_APP_START DAPLINK_ROM_IF_START
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_IF_SIZE
#define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_BL_START
#define DAPLINK_ROM_UPDATE_SIZE DAPLINK_ROM_BL_SIZE
#else
#error "Build must be either bootloader or interface"
#endif
#endif
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIViewObserver_h___
#define nsIViewObserver_h___
#include "nsISupports.h"
#include "nsEvent.h"
#include "nsColor.h"
#include "nsRect.h"
class nsRenderingContext;
class nsGUIEvent;
#define NS_IVIEWOBSERVER_IID \
{ 0xdc283a18, 0x61cb, 0x468c, \
{ 0x8d, 0xb8, 0x9b, 0x81, 0xf7, 0xc9, 0x33, 0x25 } }
class nsIViewObserver : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVIEWOBSERVER_IID)
/* called when the observer needs to paint. This paints the entire
* frame subtree rooted at aViewToPaint, including frame subtrees from
* subdocuments.
* @param aViewToPaint the view for the widget that is being painted
* @param aWidgetToPaint the widget that is being painted, the widget of
* aViewToPaint
* @param aDirtyRegion the region to be painted, in appunits of aDisplayRoot
* and relative to aDisplayRoot
* @param aIntDirtyRegion the region to be painted, in dev pixels, in the
* coordinates of aWidgetToPaint. This conveys the same information as
* aDirtyRegion but in a different format.
* @param aPaintDefaultBackground just paint the default background,
* don't try to paint any content. This is set when the observer
* needs to paint something, but the view tree is unstable, so it
* must *not* paint, or even examine, the frame subtree rooted at the
* view. (It is, however, safe to inspect the state of the view itself,
* and any associated widget.) The name illustrates the expected behavior,
* which is to paint some default background color over the dirty region.
* @return error status
*/
NS_IMETHOD Paint(nsIView* aViewToPaint,
nsIWidget* aWidgetToPaint,
const nsRegion& aDirtyRegion,
const nsIntRegion& aIntDirtyRegion,
PRBool aPaintDefaultBackground,
PRBool aWillSendDidPaint) = 0;
/* called when the observer needs to handle an event
* @param aView - where to start processing the event; the root view,
* or the view that's currently capturing this sort of event; must be a view
* for this presshell
* @param aEvent - event notification
* @param aEventStatus - out parameter for event handling
* status
* @param aHandled - whether the correct frame was found to
* handle the event
* @return error status
*/
NS_IMETHOD HandleEvent(nsIView* aView,
nsGUIEvent* aEvent,
PRBool aDontRetargetEvents,
nsEventStatus* aEventStatus) = 0;
/* called when the view has been resized and the
* content within the view needs to be reflowed.
* @param aWidth - new width of view
* @param aHeight - new height of view
* @return error status
*/
NS_IMETHOD ResizeReflow(nsIView * aView, nscoord aWidth, nscoord aHeight) = 0;
/**
* Returns true if the view observer wants to drop all invalidation right now
* because painting is suppressed. It will invalidate everything when it
* unsuppresses.
*/
NS_IMETHOD_(PRBool) ShouldIgnoreInvalidation() = 0;
/**
* Notify the observer that we're about to start painting. This
* gives the observer a chance to make some last-minute invalidates
* and geometry changes if it wants to.
*/
NS_IMETHOD_(void) WillPaint(PRBool aWillSendDidPaint) = 0;
/**
* Notify the observer that we finished painting. This
* gives the observer a chance to make some last-minute invalidates
* and geometry changes if it wants to.
*/
NS_IMETHOD_(void) DidPaint() = 0;
/**
* Dispatch the given synthesized mouse move event, and if
* aFlushOnHoverChange is true, flush layout if :hover changes cause
* any restyles.
*/
NS_IMETHOD_(void) DispatchSynthMouseMove(nsGUIEvent *aEvent,
PRBool aFlushOnHoverChange) = 0;
/**
* If something within aView is capturing the mouse, clear the capture.
* if aView is null, clear the mouse capture no matter what is capturing it.
*/
NS_IMETHOD_(void) ClearMouseCapture(nsIView* aView) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIViewObserver, NS_IVIEWOBSERVER_IID)
#endif
|
//
// AlertAccountInfoView.h
// Sfj
//
// Created by M on 2017/3/23.
// Copyright © 2017年 dabao. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AlertAccountInfoView : UIView
@property (nonatomic, strong) SFJButton *phone;
@property (nonatomic, strong) SFJButton *loginPBtn;
@property (nonatomic, strong) SFJButton *payPBtn;
@end
|
/*
* Copyright 2018 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_SET_H_
#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_SET_H_
#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h"
#include "Firestore/core/src/firebase/firestore/model/document_key.h"
namespace firebase {
namespace firestore {
namespace model {
/** Convenience type for a set of keys, since they are so common. */
using DocumentKeySet = immutable::SortedSet<DocumentKey>;
} // namespace model
} // namespace firestore
} // namespace firebase
#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_SET_H_
|
/**
\file
\date 2015.08.05. 14:49:41
\author Tóth Balázs - baltth@gmail.com
\copyright
\parblock
Copyright 2016 Tóth Balázs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
\endparblock
*/
#ifndef __ASTORAGEPROCESS_H__
#define __ASTORAGEPROCESS_H__
#include "EFpp/Process/AProcessWithDebug.h"
#include "EFpp/Utility/Storage/StorageMsg.h"
class AStorageProcess : public AProcessWithDebug {
// variables
public:
MsgEndpoint storage;
// functions
public:
AStorageProcess(const AProcessWithMsg::CreateParams ¶ms, const MsgEndpoint::EndpointConfig &storageParams);
protected:
virtual bool isSupportedOperation(const StorageMsg &msg) const = 0;
virtual bool isAddressValid(uint32_t addr, size_t len) const {
return true;
}
virtual void onReadHandler(StorageDataHandler &handler) {};
virtual void onWriteHandler(const StorageDataHandler &handler) {};
virtual void onModifyHandler(StorageDataHandler &handler) {};
virtual void onDeleteHandler(const StorageDataHandler &handler) {};
private:
void runProcess() override;
bool checkSupportedOperations(const StorageMsg &msg) const;
virtual void getProcessDebugName(StrBuffer &buff);
void addDebugInfo(StrBuffer &buff, const StorageMsg &msg);
};
#endif /* __ASTORAGEPROCESS_H__ */ |
// NSURL+WOConvenience.h
// WOPublic
//
// Copyright 2006-present Greg Hurrell. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// system header
#import <Foundation/Foundation.h>
// macro headers
#import "WOConvenienceMacros.h"
WO_DECLARE_CATEGORY_MARKER(NSURL, WOConvenience);
//! Required frameworks:
//! - AppKit (for NSWorkspace)
//! - Foundation
//!
@interface NSURL (WOConvenience)
- (BOOL)open;
//! Objective-C wrapper for CFURLCreateFromFSRef API.
//! \warn Note that this method differs from the original WOBase implementation
//! (which expected \p ref to be a pointer to an FSRef, not an FSRef)
+ (NSURL *)URLWithFSRef:(FSRef)ref;
@end
|
#include<stdio.h>
int main(void)
{
printf("Hello world!");
return 1;
}
|
// Copyright (c) Zhirnov Andrey. For more information see 'LICENSE.txt'
#pragma once
#include "Core/Physics/Dimensions/PhysicsValueVec.h"
namespace GXPhysics
{
template <typename AValueType, typename ADimensions, typename AValueScale,
typename BValueType, typename BDimensions, typename BValueScale
>
ND_ forceinline auto MiddleValue (const PhysicsValue<AValueType, ADimensions, AValueScale>& a,
const PhysicsValue<BValueType, BDimensions, BValueScale>& b)
{
return decltype(a+b)(GXMath::MiddleValue( a.ref(), b.ref() ));
}
} // GXPhysics
|
/* @LICENSE(MUSLC_MIT) */
#include <unistd.h>
#include "internal/syscall.h"
int chdir(const char *path)
{
return syscall(SYS_chdir, path);
}
|
// Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <thread>
#include "../Controls/Dialog.h"
#include "Updater.h"
#include "Version.h"
class ProgressBar;
class Button;
class ProgressWindow : public Dialog {
public:
ProgressWindow(HWND parent, Version version);
private:
Version _version;
Button *_cancel;
ProgressBar *_progress;
void Initialize();
std::thread _dlThread;
void Download();
}; |
// Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include "input/Input.h"
namespace ouzel
{
class Engine;
namespace input
{
class InputAndroid: public Input
{
friend Engine;
public:
virtual ~InputAndroid();
protected:
InputAndroid();
};
} // namespace input
} // namespace ouzel
|
#pragma once
#include <iostream>
#include <time.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/registration/icp.h>
#include <pcl/registration/ia_ransac.h>
#include <pcl/point_types.h>
#include <pcl/features/normal_3d.h>
#include <pcl/point_types.h>
#include <pcl/features/pfh.h>
#include <pcl/filters/passthrough.h>
#include <pcl/visualization/cloud_viewer.h>
#include <limits>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "pcl/point_cloud.h"
#include "pcl/kdtree/kdtree_flann.h"
#include "pcl/filters/passthrough.h"
#include "pcl/filters/voxel_grid.h"
#include "pcl/features/fpfh.h"
namespace pc{
pcl::PointCloud<pcl::FPFHSignature33>::Ptr getFeatures(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud, pcl::PointCloud<pcl::Normal>::Ptr normals, double feature_radius = 50.0);
pcl::PointCloud<pcl::Normal>::Ptr getNormals(pcl::PointCloud<pcl::PointXYZ>::Ptr incloud, double normals_radius = 20.0);
pcl::PointCloud<pcl::PointNormal>::Ptr getPointNormals(pcl::PointCloud<pcl::PointXYZ>::Ptr incloud, int k = 30);
} |
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)udp.h 8.1 (Berkeley) 6/10/93
*/
/*
* Udp protocol header.
* Per RFC 768, September, 1981.
*/
struct udphdr {
uint16_t uh_sport; /* source port */
uint16_t uh_dport; /* destination port */
uint16_t uh_ulen; /* udp length */
uint16_t uh_sum; /* udp checksum */
};
#define TFTP_PORT 69 /*XXX*/
#define KERBEROS_PORT 88 /*XXX*/
#define SUNRPC_PORT 111 /*XXX*/
#define SNMP_PORT 161 /*XXX*/
#define NTP_PORT 123 /*XXX*/
#define SNMPTRAP_PORT 162 /*XXX*/
#define ISAKMP_PORT 500 /*XXX*/
#define SYSLOG_PORT 514 /* rfc3164 */
#define TIMED_PORT 525 /*XXX*/
#define RIP_PORT 520 /*XXX*/
#define LDP_PORT 646
#define AODV_PORT 654 /*XXX*/
#define OLSR_PORT 698 /* rfc3626 */
#define KERBEROS_SEC_PORT 750 /*XXX*/
#define L2TP_PORT 1701 /*XXX*/
#define SIP_PORT 5060
#define ISAKMP_PORT_NATT 4500 /* rfc3948 */
#define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/
#define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/
#define RX_PORT_LOW 7000 /*XXX*/
#define RX_PORT_HIGH 7009 /*XXX*/
#define NETBIOS_NS_PORT 137
#define NETBIOS_DGRAM_PORT 138
#define CISCO_AUTORP_PORT 496 /*XXX*/
#define RADIUS_PORT 1645
#define RADIUS_NEW_PORT 1812
#define RADIUS_ACCOUNTING_PORT 1646
#define RADIUS_NEW_ACCOUNTING_PORT 1813
#define HSRP_PORT 1985 /*XXX*/
#define LMP_PORT 701 /* rfc4204 */
#define LWRES_PORT 921
#define VQP_PORT 1589
#define ZEPHYR_SRV_PORT 2103
#define ZEPHYR_CLT_PORT 2104
#define VAT_PORT 3456
#define MPLS_LSP_PING_PORT 3503 /* draft-ietf-mpls-lsp-ping-02.txt */
#define BFD_CONTROL_PORT 3784 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
#define BFD_ECHO_PORT 3785 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
#define WB_PORT 4567
#define SFLOW_PORT 6343 /* http://www.sflow.org/developers/specifications.php */
#define LWAPP_DATA_PORT 12222 /* draft-ohara-capwap-lwapp-04.txt */
#define LWAPP_CONTROL_PORT 12223 /* draft-ohara-capwap-lwapp-04.txt */
#define OTV_PORT 8472 /* draft-hasmit-otv-04 */
#define VXLAN_PORT 4789 /* draft-mahalingam-dutt-dcops-vxlan-04 */
#ifdef INET6
#define RIPNG_PORT 521 /*XXX*/
#define DHCP6_SERV_PORT 546 /*XXX*/
#define DHCP6_CLI_PORT 547 /*XXX*/
#define AHCP_PORT 5359 /* draft-chroboczek-ahcp-00 */
#define BABEL_PORT 6696
#define BABEL_PORT_OLD 6697
#endif
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lsm.h"
#define BUFFER_SIZE 128
#define INPUT_FILE "/usr/share/dict/words"
#ifdef USE_LSM_LZ4_COMPRESSOR
#define DATABASE_NAME "test-lz4.db"
#include "lsm-lz4.h"
#else
#define DATABASE_NAME "test.db"
#endif /* USE_LZ4_LSM_COMPRESSOR */
int main()
{
int rc;
lsm_db *db;
/* Open input file */
FILE *fp = fopen(INPUT_FILE, "r");
if (fp == NULL) exit(1);
/* Allocate a new database handle */
rc = lsm_new(0, &db);
if( rc!=LSM_OK ) exit(1);
#ifdef USE_LSM_LZ4_COMPRESSOR
rc = lsm_lz4_config(db);
if( rc!=LSM_OK ) exit(1);
#endif /* USE_LZ4_LSM_COMPRESSOR */
/* Connect the database handle to database "test.db" */
rc = lsm_open(db, DATABASE_NAME);
if( rc!=LSM_OK ) exit(1);
/* Insert all the lines from the input file */
printf("Inserting all keys/values (using %s)\n", INPUT_FILE);
char vbuf[BUFFER_SIZE] = {0,};
char kbuf[BUFFER_SIZE] = {0,};
int i = 0;
while (fgets(vbuf, BUFFER_SIZE, fp) != NULL) {
/* Remove string newlines */
int vlen = strlen(vbuf);
if (vlen <= 0) continue;
if (vbuf[vlen-1] == '\n') vbuf[vlen-1] = '\0';
/* Create bogus key value */
snprintf(kbuf, BUFFER_SIZE, "KEY INPUT 0x%x", i);
#ifndef NDEBUG
printf("insert: key = '%s', val = '%s'\n", kbuf, vbuf);
#endif /* !NDEBUG */
rc = lsm_insert(db, kbuf, strlen(kbuf), vbuf, strlen(vbuf));
if (rc != LSM_OK) {
fprintf(stderr, "ERROR WRITING KEY 0x%x: '%s' -> '%s', rc = %d\n", i, kbuf, vbuf, rc);
exit(-1);
}
i++; /* Increment index */
}
/* Get them all back to be sane */
printf("Done. Now retrieving keys...\n");
lsm_cursor *csr;
rc = lsm_csr_open(db, &csr);
if (rc != LSM_OK) exit(1);
for (int j = 0; j < i; j++)
{
snprintf(kbuf, BUFFER_SIZE, "KEY INPUT 0x%x", j);
#ifndef NDEBUG
printf("retrieve: key = '%s'\n", kbuf);
#endif /* !NDEBUG */
rc = lsm_csr_seek(csr, kbuf, strlen(kbuf), LSM_SEEK_EQ);
if (!lsm_csr_valid(csr)) {
fprintf(stderr, "ERROR READING KEY 0x%x: '%s', rc = %d\n", j, kbuf, rc);
exit(-1);
}
}
lsm_csr_close(csr);
printf("Done.\n");
fclose(fp);
rc = lsm_close(db);
return 0;
}
|
// Copyright 1999-2015 Aske Simon Christensen. See LICENSE.txt for usage terms.
/*
Find repeated strings in a data block.
Matches are reported from longest to shortest. A match is only reported
if it is closer (smaller offset, higher position) than all longer matches.
Two parameters control the speed/precision tradeoff of the matcher:
The match_patience parameter controls how many matches outside the current
reporting range (between last longer match and current position) are skipped
before the matcher gives up finding more matches.
The max_same_length parameter controls how many matches of the same length
are reported. The matches reported will be the closest ones of that length.
*/
#pragma once
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
using std::vector;
class MatchFinder {
// Inputs
unsigned char *data;
int length;
int min_length;
int match_patience;
int max_same_length;
// Suffix array
vector<int> suffix_array;
vector<int> rev_suffix_array;
vector<int> longest_common_prefix;
// Matcher parameters
int current_pos;
int min_pos;
// Matcher state
int left_index;
int left_length;
int right_index;
int right_length;
int current_length;
// Best matches seen with current length
std::priority_queue<int, vector<int>, std::greater<int> > match_buffer;
struct suffix_compare {
MatchFinder* finder;
suffix_compare(MatchFinder* finder) : finder(finder) {}
// Compare suffixes starting at positions a and b
bool operator()(int a, int b) {
vector<int>& same = finder->rev_suffix_array;
unsigned char *data = finder->data;
if (a == b) return false;
if (data[a] == data[b]) {
// Skip stretch of equal bytes
int skip = std::min(same[a], same[b]);
a += skip;
b += skip;
}
int until_end = finder->length - std::max(a,b);
for (int i = 0 ; i < until_end ; i++) {
if (data[a + i] != data[b + i]) {
return data[a + i] < data[b + i];
}
}
return a < b;
}
};
// Quick'n'dirty suffix array construction:
// plain sorting with accelleration of same-value blocks
void make_suffix_array() {
// Temporary same-value block accelleration array
rev_suffix_array.resize(length + 1);
int count = 0;
char c = 0;
rev_suffix_array[length] = 0;
for (int i = length - 1 ; i >= 0 ; i--) {
if (data[i] != c) count = 0;
rev_suffix_array[i] = ++count;
c = data[i];
}
// Compute suffix array
suffix_array.resize(length + 1);
for (int i = 0 ; i <= length ; i++) {
suffix_array[i] = i;
}
std::sort(&suffix_array[0], &suffix_array[length], suffix_compare(this));
// Compute reverse suffix array
for (int i = 0 ; i <= length ; i++) {
rev_suffix_array[suffix_array[i]] = i;
}
// Compute LCP array
longest_common_prefix.resize(length + 1);
longest_common_prefix[0] = 0;
longest_common_prefix[length] = 0;
int h = 0;
for (int i = 0 ; i < length ; i++) {
int r = rev_suffix_array[i];
if (r > 0) {
int j = suffix_array[r - 1];
while (data[i + h] == data[j + h]) {
h = h + 1;
}
longest_common_prefix[r] = h;
if (h > 0) h = h - 1;
}
}
}
void extend_left() {
int iter = 0;
while (left_length >= min_length) {
left_length = std::min(left_length, longest_common_prefix[left_index]);
int pos = suffix_array[--left_index];
if (pos < current_pos && pos >= min_pos) break;
if (++iter > match_patience) left_length = 0;
}
}
void extend_right() {
int iter = 0;
while (right_length >= min_length) {
right_length = std::min(right_length, longest_common_prefix[++right_index]);
int pos = suffix_array[right_index];
if (pos < current_pos && pos >= min_pos) break;
if (++iter > match_patience) right_length = 0;
}
}
int next_length() {
return std::max(left_length, right_length);
}
public:
MatchFinder(unsigned char *data, int length, int min_length, int match_patience, int max_same_length) :
data(data), length(length), min_length(min_length), match_patience(match_patience), max_same_length(max_same_length) {
make_suffix_array();
reset();
}
void reset() {
}
// Start finding matches between strings starting at pos and earlier strings.
void beginMatching(int pos) {
current_pos = pos;
min_pos = 0;
left_index = rev_suffix_array[pos];
left_length = length;
extend_left();
right_index = rev_suffix_array[pos];
right_length = length;
extend_right();
}
// Report next match. Returns whether a match was found.
bool nextMatch(int *match_pos_out, int *match_length_out) {
if (match_buffer.empty()) {
// Fill match buffer
current_length = next_length();
if (current_length < min_length) return false;
int new_min_pos = min_pos;
do {
int match_pos;
if (left_length > right_length) {
match_pos = suffix_array[left_index];
extend_left();
} else {
match_pos = suffix_array[right_index];
extend_right();
}
new_min_pos = std::max(new_min_pos, match_pos);
if (match_buffer.size() < max_same_length) {
match_buffer.push(match_pos);
} else {
if (match_pos > match_buffer.top()) {
match_buffer.pop();
match_buffer.push(match_pos);
}
min_pos = match_buffer.top();
}
} while (next_length() == current_length);
assert(!match_buffer.empty());
min_pos = new_min_pos;
}
*match_length_out = current_length;
*match_pos_out = match_buffer.top();
match_buffer.pop();
assert(*match_pos_out < current_pos);
return true;
}
};
|
/*
* sophia database
* sphia.org
*
* Copyright (c) Dmitry Simonenko
* BSD License
*/
#include <sophia.h>
#include <libss.h>
#include <libsf.h>
#include <libsr.h>
#include <libsv.h>
#include <libsd.h>
#include <libst.h>
static void
github_97(void)
{
void *env = sp_env();
t( env != NULL );
t( sp_setstring(env, "sophia.path", st_r.conf->sophia_dir, 0) == 0 );
t( sp_setint(env, "scheduler.threads", 0) == 0 );
t( sp_setint(env, "compaction.0.branch_wm", 1) == 0 );
t( sp_setstring(env, "log.path", st_r.conf->log_dir, 0) == 0 );
t( sp_setstring(env, "db", "test", 0) == 0 );
t( sp_setstring(env, "db.test.path", st_r.conf->db_dir, 0) == 0 );
t( sp_setstring(env, "db.test.index.key", "u32", 0) == 0 );
t( sp_setint(env, "db.test.sync", 0) == 0 );
t( sp_open(env) == 0 );
void *db = sp_getobject(env, "db.test");
t( db != NULL );
/* we must pass sizeof(uint32_t) in sp_setstring() */
uint32_t i = 0;
while ( i < 100 ) {
void *o = sp_document(db);
t( sp_setstring(o, "key", &i, sizeof(i)) == 0 ); /* < */
t( sp_setstring(o, "value", &i, sizeof(i)) == 0 ); /* < */
t( sp_set(db, o) == 0 );
i++;
}
void *cur = sp_cursor(env);
t( cur != NULL );
void *o = sp_document(db);
t( o != NULL );
uint32_t key = 99;
t( sp_setstring(o, "key", &key, sizeof(key)) == 0 ); /* < */
i = 0;
while ((o = sp_get(cur, o)))
i++;
t( i == 1 );
sp_destroy(cur);
t( sp_destroy(env) == 0 );
}
stgroup *github_group(void)
{
stgroup *group = st_group("github");
st_groupadd(group, st_test("ticket_97", github_97));
return group;
}
|
/*
Copyright (c) 2011, Ole K. Christensen
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
¥ Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
¥ Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "CView.h"
/**************************************************************************************************/
/* */
/* CLASS DEFINITIONS */
/* */
/**************************************************************************************************/
class BackView : public CView
{
public:
BackView (CViewOwner *parent, CRect frame, BOOL autoOutline = true);
virtual void HandleUpdate (CRect updateRect);
virtual BOOL HandleMouseDown (CPoint pt, INT modifiers, BOOL doubleClick);
void ExcludeRect (CRect r = CRect(0,0,0,0));
void Outline3DRect (CRect r, BOOL impress = true);
void DrawTopRound (void);
void DrawBottomRound (void);
CRect DataViewRect (void);
private:
BOOL autoOutline;
CRect exRect;
};
|
//
// FUGraphicsEngine.h
// Fuji
//
// Created by David Hart.
// Copyright (c) 2012 hart[dev]. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the Simplified BSD License.
//
#import "FUEngine.h"
@interface FUGraphicsEngine : FUEngine
@end
|
#include "netlib.h"
#include <string>
#pragma once
namespace netlib
{
namespace crypto
{
class NETLIB_API hash
{
public:
virtual ~hash();
virtual bool begin() = 0;
virtual bool update(void *_data, size_t _sz) = 0;
virtual bool update(std::string const& _str);
virtual std::string compute() = 0;
protected:
hash();
};
class NETLIB_API encoding
{
public:
virtual ~encoding();
virtual std::string encode(std::string const& _str) = 0;
virtual std::string decode(std::string const& _str) = 0;
protected:
encoding();
};
}
}
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "VisualLogger/VisualLogger.h"
class SVisualLoggerFilters;
class SVisualLoggerView;
class SVisualLoggerLogsList;
class SVisualLoggerStatusView;
class SVisualLogger : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SVisualLogger) { }
SLATE_END_ARGS()
public:
/**
* Default constructor.
*/
SVisualLogger();
virtual ~SVisualLogger();
public:
/**
* Constructs the application.
*
* @param InArgs The Slate argument list.
* @param ConstructUnderMajorTab The major tab which will contain the session front-end.
* @param ConstructUnderWindow The window in which this widget is being constructed.
* @param InStyleSet The style set to use.
*/
void Construct(const FArguments& InArgs, const TSharedRef<SDockTab>& ConstructUnderMajorTab, const TSharedPtr<SWindow>& ConstructUnderWindow);
public:
class FVisualLoggerDevice : public FVisualLogDevice
{
friend class SVisualLogger;
public:
FVisualLoggerDevice(SVisualLogger* Owner);
virtual ~FVisualLoggerDevice();
virtual void Serialize(const class UObject* LogOwner, FName OwnerName, FName OwnerClassName, const FVisualLogEntry& LogEntry) override;
protected:
void SerLastWorld(class UWorld* InWorld) { LastWorld = InWorld; }
SVisualLogger* Owner;
TWeakObjectPtr<class UWorld> LastWorld;
};
friend class FVisualLogDevice;
TSharedRef<SDockTab> HandleTabManagerSpawnTab(const FSpawnTabArgs& Args, FName TabIdentifier) const;
void FillFileMenu(FMenuBuilder& MenuBuilder, const TSharedPtr<FTabManager> TabManager);
static void FillWindowMenu(FMenuBuilder& MenuBuilder, const TSharedPtr<FTabManager> TabManager);
void FillLoadPresetMenu(FMenuBuilder& Builder);
void GetTimelines(TArray<TSharedPtr<class STimeline> >&, bool bOnlySelectedOnes = false);
/** Callback for for when the owner tab's visual state is being persisted. */
void HandleMajorTabPersistVisualState();
virtual bool SupportsKeyboardFocus() const override { return true; }
void OnNewLogEntry(const FVisualLogDevice::FVisualLogEntryItem& Entry);
void CollectNewCategories(const FVisualLogDevice::FVisualLogEntryItem& Entry);
void OnItemSelectionChanged(const FVisualLogDevice::FVisualLogEntryItem& EntryItem);
void OnFiltersChanged();
void OnObjectSelectionChanged(TSharedPtr<class STimeline> TimeLine);
void OnFiltersSearchChanged(const FText& Filter);
void OnLogLineSelectionChanged(TSharedPtr<struct FLogEntryItem> SelectedItem, int64 UserData, FName TagName);
FReply OnKeyboaedRedirection(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent);
bool HandleStartRecordingCommandCanExecute() const;
void HandleStartRecordingCommandExecute();
bool HandleStartRecordingCommandIsVisible() const;
bool HandleStopRecordingCommandCanExecute() const;
void HandleStopRecordingCommandExecute();
bool HandleStopRecordingCommandIsVisible() const;
bool HandlePauseCommandCanExecute() const;
void HandlePauseCommandExecute();
bool HandlePauseCommandIsVisible() const;
bool HandleResumeCommandCanExecute() const;
void HandleResumeCommandExecute();
bool HandleResumeCommandIsVisible() const;
bool HandleLoadCommandCanExecute() const;
void HandleLoadCommandExecute();
bool HandleSaveCommandCanExecute() const;
void HandleSaveCommandExecute();
void HandleSaveAllCommandExecute();
void HandleSaveCommand(bool bSaveAllData);
bool HandleCameraCommandCanExecute() const;
void HandleCameraCommandExecute();
bool HandleCameraCommandIsChecked() const;
TSharedPtr<SVisualLoggerFilters> GetVisualLoggerFilters() { return VisualLoggerFilters; }
void HandleTabManagerPersistLayout(const TSharedRef<FTabManager::FLayout>& LayoutToSave);
void SetFiltersPreset(const struct FFiltersPreset& Preset);
void OnNewWorld(UWorld* NewWorld);
void ResetData();
protected:
void OnMoveCursorLeftCommand();
void OnMoveCursorRightCommand();
protected:
// Holds the list of UI commands.
TSharedRef<FUICommandList> CommandList;
// Holds the tab manager that manages the front-end's tabs.
TSharedPtr<FTabManager> TabManager;
// Visual Logger device to get and collect logs.
TSharedPtr<FVisualLoggerDevice> InternalDevice;
TWeakObjectPtr<class AVisualLoggerCameraController> CameraController;
TSharedPtr<struct FVisualLoggerCanvasRenderer> VisualLoggerCanvasRenderer;
mutable TSharedPtr<SVisualLoggerFilters> VisualLoggerFilters;
mutable TSharedPtr<SVisualLoggerView> MainView;
mutable TSharedPtr<SVisualLoggerLogsList> LogsList;
mutable TSharedPtr<SVisualLoggerStatusView> StatusView;
bool bPausedLogger;
TArray<FVisualLogDevice::FVisualLogEntryItem> OnPauseCacheForEntries;
bool bGotHistogramData;
FDelegateHandle DrawOnCanvasDelegateHandle;
};
|
/*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2013-2015 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*********************************************************************************/
#ifndef IVW_METADATAOWNER_H
#define IVW_METADATAOWNER_H
#include <inviwo/core/common/inviwocoredefine.h>
#include <inviwo/core/common/inviwo.h>
#include <inviwo/core/metadata/metadata.h>
#include <inviwo/core/metadata/metadatamap.h>
namespace inviwo {
/** \brief Holds metadata and access functionality for set/get
*
* MetaDataOwner is the base class for all the objects that want to own metadata.
*
*/
class IVW_CORE_API MetaDataOwner {
public:
MetaDataOwner();
MetaDataOwner(const MetaDataOwner& rhs);
MetaDataOwner& operator=(const MetaDataOwner& rhs);
virtual MetaDataOwner* clone() const;
virtual ~MetaDataOwner();
// copy the meta data from src to *this
void copyMetaDataFrom(const MetaDataOwner& src);
// copy the meta data from *this to dst
void copyMetaDataTo(MetaDataOwner &dst);
//MetaData
template<typename T>
T* createMetaData(const std::string &key);
template<typename T, typename U>
void setMetaData(const std::string &key, U value);
//param val is required to deduce the template argument
template<typename T, typename U>
U getMetaData(const std::string &key, U val) const;
template<typename T>
T* getMetaData(const std::string &key) const;
MetaDataMap* getMetaDataMap() const { return metaData_; }
template<typename T>
bool hasMetaData(const std::string &key) const;
virtual void serialize(IvwSerializer& s) const;
virtual void deserialize(IvwDeserializer& d);
protected:
MetaDataMap* metaData_;
};
template<typename T>
T* MetaDataOwner::createMetaData(const std::string &key) {
T* metaData = dynamic_cast<T*>(metaData_->get(key));
if (!metaData) {
metaData = new T();
metaData_->add(key, metaData);
}
return metaData;
}
template<typename T, typename U>
void MetaDataOwner::setMetaData(const std::string &key, U value) {
MetaData* baseMetaData = metaData_->get(key);
T* derivedMetaData = 0;
if (baseMetaData) {
derivedMetaData = dynamic_cast<T*>(baseMetaData);
//if not an instance of valid meta data, forcefully replace with valid one
if (!derivedMetaData) {
metaData_->remove(key);
derivedMetaData = new T();
metaData_->add(key, derivedMetaData);
}
derivedMetaData->set(value);
}
else {
derivedMetaData = new T();
metaData_->add(key, derivedMetaData);
derivedMetaData->set(value);
}
}
//param val is required to deduce the template argument
template<typename T, typename U>
U MetaDataOwner::getMetaData(const std::string &key, U val) const {
const MetaData* baseMetadata = metaData_->get(key);
if (baseMetadata) {
const T* derivedMetaData = dynamic_cast<const T*>(baseMetadata);
if (derivedMetaData)
return derivedMetaData->get();
}
return val;
}
//param val is required to deduce the template argument
template<typename T>
T* MetaDataOwner::getMetaData(const std::string &key) const {
return dynamic_cast<T*>(metaData_->get(key));
}
template<typename T>
bool MetaDataOwner::hasMetaData(const std::string &key) const {
const MetaData* baseMetadata = metaData_->get(key);
if (baseMetadata) {
const T* derivedMetaData = dynamic_cast<const T*>(baseMetadata);
if (derivedMetaData)
return true;
}
return false;
}
} // namespace
#endif // IVW_METADATAOWNER_H
|
/*
* Copyright (c) 2015 Ambroz Bizjak, Armin van der Togt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef APRINTER_PT_RTD_FORMULA_H
#define APRINTER_PT_RTD_FORMULA_H
#include <aprinter/meta/ServiceUtils.h>
#include <aprinter/math/FloatTools.h>
#include <aprinter/printer/Configuration.h>
namespace APrinter {
template <typename Arg>
class PtRtdFormula {
using Context = typename Arg::Context;
using Config = typename Arg::Config;
using FpType = typename Arg::FpType;
using Params = typename Arg::Params;
using One = APRINTER_FP_CONST_EXPR(1.0);
using Two = APRINTER_FP_CONST_EXPR(2.0);
// For temperatures above zero: Rt = R0 * (1 + aT - bT^2)
template <typename Temp>
static auto ResistanceAtTemp (Temp) -> decltype(Config::e(Params::PtR0::i()) * (One() + Config::e(Params::PtA::i()) * Temp() - Config::e(Params::PtB::i()) * Temp() * Temp()));
template <typename Temp>
static auto FracRTD (Temp) -> decltype(ResistanceAtTemp(Temp()) / Config::e(Params::ResistorR::i()));
public:
static bool const NegativeSlope = false;
template <typename Temp>
static auto TempToAdc (Temp) -> decltype(FracRTD(Temp()) / (One() + FracRTD(Temp())));
static FpType adcToTemp (Context c, FpType adc)
{
if (!(adc <= APRINTER_CFG(Config, CAdcMaxTemp, c))) {
return INFINITY;
}
if (!(adc >= APRINTER_CFG(Config, CAdcMinTemp, c))) {
return -INFINITY;
}
FpType frac_rtd = (adc / (1.0f - adc));
return (
APRINTER_CFG(Config, CPtA, c) -
FloatSqrt(
FloatSquare(APRINTER_CFG(Config, CPtA, c))
+ 2.0f * APRINTER_CFG(Config, CTwoPtB, c) * (1.0f - frac_rtd * APRINTER_CFG(Config, CResistorRByR0, c))
)
) / APRINTER_CFG(Config, CTwoPtB, c);
}
private:
using CAdcMinTemp = decltype(ExprCast<FpType>(TempToAdc(Config::e(Params::MinTemp::i()))));
using CAdcMaxTemp = decltype(ExprCast<FpType>(TempToAdc(Config::e(Params::MaxTemp::i()))));
using CResistorRByR0 = decltype(ExprCast<FpType>(Config::e(Params::ResistorR::i()) / Config::e(Params::PtR0::i())));
using CPtA = decltype(ExprCast<FpType>(Config::e(Params::PtA::i())));
using CTwoPtB = decltype(ExprCast<FpType>(Two() * Config::e(Params::PtB::i())));
public:
struct Object {};
using ConfigExprs = MakeTypeList<CAdcMinTemp, CAdcMaxTemp, CResistorRByR0, CPtA, CTwoPtB>;
};
APRINTER_ALIAS_STRUCT_EXT(PtRtdFormulaService, (
APRINTER_AS_TYPE(ResistorR),
APRINTER_AS_TYPE(PtR0),
APRINTER_AS_TYPE(PtA),
APRINTER_AS_TYPE(PtB),
APRINTER_AS_TYPE(MinTemp),
APRINTER_AS_TYPE(MaxTemp)
), (
APRINTER_ALIAS_STRUCT_EXT(Formula, (
APRINTER_AS_TYPE(Context),
APRINTER_AS_TYPE(ParentObject),
APRINTER_AS_TYPE(Config),
APRINTER_AS_TYPE(FpType)
), (
using Params = PtRtdFormulaService;
APRINTER_DEF_INSTANCE(Formula, PtRtdFormula)
))
))
}
#endif
|
/*
Copyright (c) 2014, Philipp Krähenbühl
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Stanford University nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Philipp Krähenbühl ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Philipp Krähenbühl BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "util/eigen.h"
#include "segmentation/segmentation.h"
struct SaliencySettings{
SaliencySettings();
// Saliency filter radii
float sigma_p_; // Radius for the uniqueness operator [eq 1]
float sigma_c_; // Color radius for the distribution operator [eq 3]
float k_; // The sharpness parameter of the exponential in the merging operation [eq 5]
// Upsampling parameters
float min_saliency_; // Minimum number of salient pixels for final rescaling
float alpha_, beta_;
// Various algorithm settings
// Enable or disable parts of the algorithm
bool upsample_, uniqueness_, distribution_, filter_uniqueness_, filter_distribution_;
// Should we use the image color or superpixel color as a feature for upsampling
bool use_spix_color_;
};
class SuperpixelStatistic;
class Saliency {
protected:
SaliencySettings settings_;
protected:
std::vector< float > uniqueness( const std::vector< SuperpixelStatistic > & stat ) const;
std::vector< float > distribution( const std::vector< SuperpixelStatistic > & stat ) const;
public:
Saliency( SaliencySettings settings = SaliencySettings() );
VectorXf saliency( const ImageOverSegmentation & im ) const;
VectorXf saliency( const Image8u &im, const RMatrixXs &s ) const;
}; |
//
// JSTopicSongViewController.h
// JSWeibo
//
// Created by JS on 14-11-7.
// Copyright (c) 2014年 JS. All rights reserved.
// 话题歌单详情
#import <UIKit/UIKit.h>
@class JSTopicView;
@class JSTopicList;
@interface JSTopicSongViewController : UITableViewController
/**
* @brief 上一页面传来的id
*/
@property (nonatomic, strong) NSNumber *id;
/**
* @brief 上一页面传来的背景图
*/
@property (nonatomic, strong)NSString * topViewURL;
@property (nonatomic, strong)JSTopicList * topicList;
@end
|
#include "util/endian.h"
#include <stdint.h>
static uint16_t endian_test_i = 0x0001;
static char *endian_test_c = (char *) &endian_test_i;
#define IS_LITTLE_ENDIAN (*endian_test_c == 0x01)
void convert_endianness(unsigned char *data, size_t size)
{
unsigned char *s = data, *e = data + size - 1;
if (!IS_LITTLE_ENDIAN)
return;
for (; s < e; ++s, --e)
{
unsigned char t = *s;
*s = *e;
*e = t;
}
}
|
struct list_item {
struct list_item* next;
int data;
};
typedef struct list_item* _usetype;
/* list functions */
typedef void ** list_t;
extern void list_init(list_t list);
extern void * list_head(list_t list);
extern void * list_tail(list_t list);
extern void * list_pop (list_t list);
extern void list_push(list_t list, void *item);
extern void * list_chop(list_t list);
extern void list_add(list_t list, void *item);
extern void list_remove(list_t list, void *item);
extern int list_length(list_t list);
extern void list_copy(list_t dest, list_t src);
extern void list_insert(list_t list, void *previtem, void *newitem);
extern void * list_item_next(void *item);
|
/* Copyright (c) Citrix Systems Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _XENBUS_SUSPEND_H
#define _XENBUS_SUSPEND_H
#include <ntddk.h>
#include <xen.h>
#include <suspend_interface.h>
#include "fdo.h"
struct _XENBUS_SUSPEND_INTERFACE {
PXENBUS_SUSPEND_OPERATIONS Operations;
PXENBUS_SUSPEND_CONTEXT Context;
};
C_ASSERT(FIELD_OFFSET(XENBUS_SUSPEND_INTERFACE, Operations) == (ULONG_PTR)SUSPEND_OPERATIONS(NULL));
C_ASSERT(FIELD_OFFSET(XENBUS_SUSPEND_INTERFACE, Context) == (ULONG_PTR)SUSPEND_CONTEXT(NULL));
extern NTSTATUS
SuspendInitialize(
IN PXENBUS_FDO Fdo,
OUT PXENBUS_SUSPEND_INTERFACE Interface
);
extern VOID
SuspendTrigger(
IN PXENBUS_SUSPEND_INTERFACE Interface
);
extern VOID
SuspendTeardown(
IN OUT PXENBUS_SUSPEND_INTERFACE Interface
);
#endif // _XENBUS_SUSPEND_H
|
//
// KxBookFmtManifest.h
// https://github.com/kolyvan/kybookfmt
//
// Created by Konstantin Bukreev on 05.02.16.
// Copyright © 2016 Konstantin Bukreev. All rights reserved.
//
/*
Copyright (c) 2016 Konstantin Bukreev All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, KyBookFmtKindBook) {
KyBookFmtKindCommonBook,
KyBookFmtKindTextBook,
KyBookFmtKindAudioBook,
KyBookFmtKindComicsBook,
};
@interface KyBookFmtManifest : NSObject
@property (readwrite, nonatomic) NSUInteger version;
@property (readwrite, nonatomic) KyBookFmtKindBook kind;
@property (readwrite, nonatomic, strong, nullable) NSString *title;
@property (readwrite, nonatomic, strong, nullable) NSString *subtitle;
@property (readwrite, nonatomic, strong, nullable) NSArray<NSString *> *authors;
@property (readwrite, nonatomic, strong, nullable) NSArray<NSString *> *translators;
@property (readwrite, nonatomic, strong, nullable) NSArray<NSString *> *subjects;
@property (readwrite, nonatomic, strong, nullable) NSArray<NSString *> *ids;
@property (readwrite, nonatomic, strong, nullable) NSString *sequence;
@property (readwrite, nonatomic) NSUInteger sequenceNo;
@property (readwrite, nonatomic, strong, nullable) NSString *isbn;
@property (readwrite, nonatomic, strong, nullable) NSString *link; // url string
@property (readwrite, nonatomic, strong, nullable) NSString *rights;
@property (readwrite, nonatomic, strong, nullable) NSString *publisher;
@property (readwrite, nonatomic, strong, nullable) NSString *date;
@property (readwrite, nonatomic, strong, nullable) NSString *language;
@property (readwrite, nonatomic, strong, nullable) NSString *keywords;
@property (readwrite, nonatomic, strong, nullable) NSString *annotation;
@property (readwrite, nonatomic, strong, nullable) NSString *cover;
@property (readwrite, nonatomic, strong, nullable) NSString *thumbnail;
@property (readwrite, nonatomic, strong, nullable) NSString *creator;
@property (readwrite, nonatomic, strong, nullable) NSString *timestamp;
@property (readwrite, nonatomic, strong, nullable) NSDictionary *extra; // origin-lang, origin-title, etc
+ (nullable instancetype) manifestFromJsonData:(nonnull NSData *)json
error:(NSError * _Nullable * _Nullable)error;
+ (nonnull instancetype) manifestFromDictionary:(nonnull NSDictionary *)dict;
- (nullable NSData *) asJsonData:(NSError * _Nullable * _Nullable)error;
- (nonnull NSDictionary *) asDictionary;
@end
|
/************************************************************************************
Filename : VRMenuFrame.h
Content : Menu component for handling hit tests and dispatching events.
Created : June 23, 2014
Authors : Jonathan E. Wright
Copyright : Copyright 2014 Oculus VR, LLC. All Rights reserved.
*************************************************************************************/
#if !defined( OVR_VRMenuFrame_h )
#define OVR_VRMenuFrame_h
#include "VRMenuObject.h"
#include "VRMenuEvent.h"
#include "../GazeCursor.h"
#include "SoundLimiter.h"
namespace OVR {
struct VrFrame;
class App;
//==============================================================
// VRMenuEventHandler
class VRMenuEventHandler
{
public:
VRMenuEventHandler();
~VRMenuEventHandler();
void Frame( App * app, const VrFrame & vrFrame, OvrVRMenuMgr & menuMgr, BitmapFont const & font,
menuHandle_t const & rootHandle, Posef const & menuPose,
gazeCursorUserId_t const & gazeUserId, Array< VRMenuEvent > & events );
void HandleEvents( App * app, const VrFrame & vrFrame, OvrVRMenuMgr & menuMgr,
menuHandle_t const rootHandle, Array< VRMenuEvent > const & events ) const;
void InitComponents( Array< VRMenuEvent > & events );
void Opening( Array< VRMenuEvent > & events );
void Opened( Array< VRMenuEvent > & events );
void Closing( Array< VRMenuEvent > & events );
void Closed( Array< VRMenuEvent > & events );
menuHandle_t GetFocusedHandle() const { return FocusedHandle; }
private:
menuHandle_t FocusedHandle;
SoundLimiter GazeOverSoundLimiter;
SoundLimiter DownSoundLimiter;
SoundLimiter UpSoundLimiter;
private:
bool DispatchToComponents( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
VRMenuEvent const & event, VRMenuObject * receiver ) const;
bool DispatchToPath( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
VRMenuEvent const & event, Array< menuHandle_t > const & path, bool const log ) const;
bool BroadcastEvent( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
VRMenuEvent const & event, VRMenuObject * receiver ) const;
};
} // namespace OVR
#endif // OVR_VRMenuFrame_h |
/*
* Copyright 2020 Scott Vokes
*
* See LICENCE for the full copyright terms.
*/
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fsm/fsm.h>
#include <fsm/bool.h>
#include <fsm/capture.h>
#include <fsm/print.h>
#include "captest.h"
/* Combine 3 fully disjoint FSMs:
*
* - 0: "(a(b))"
* - 1: "(cd(e))"
* - 2: "(fgh(i))"
*
* Shift the captures for 1 and 2 forward and use/combine
* opaques on them to track which one(s) matched.
*
* This tracking of which DFA matched should be more directly
* supported by the API later. */
static void
check(const struct fsm *fsm, const char *string,
unsigned end_id, unsigned capture_base);
static void
det_and_min(const char *tag, struct fsm *fsm);
int main(void) {
struct fsm *f_ab = captest_fsm_of_string("ab", 0);
struct fsm *f_cde = captest_fsm_of_string("cde", 1);
struct fsm *f_fghi = captest_fsm_of_string("fghi", 2);
struct fsm *f_all = NULL;
unsigned captures;
struct fsm_combined_base_pair bases[3];
struct fsm *fsms[3];
assert(f_ab);
assert(f_cde);
assert(f_fghi);
/* set captures */
#define SET_CAPTURE(FSM, STATE, CAPTURE, TYPE) \
if (!fsm_set_capture_action(FSM, STATE, CAPTURE, TYPE)) { \
fprintf(stderr, "failed to set capture on line %d\n", \
__LINE__); \
exit(EXIT_FAILURE); \
}
/* (a(b)) */
if (!fsm_capture_set_path(f_ab, 0, 0, 2)) {
exit(EXIT_FAILURE);
}
if (!fsm_capture_set_path(f_ab, 1, 1, 2)) {
exit(EXIT_FAILURE);
}
/* (cd(e)) */
if (!fsm_capture_set_path(f_cde, 0, 0, 3)) {
exit(EXIT_FAILURE);
}
if (!fsm_capture_set_path(f_cde, 1, 2, 3)) {
exit(EXIT_FAILURE);
}
/* (fgh(i)) */
if (!fsm_capture_set_path(f_fghi, 0, 0, 4)) {
exit(EXIT_FAILURE);
}
if (!fsm_capture_set_path(f_fghi, 1, 3, 4)) {
exit(EXIT_FAILURE);
}
#if LOG_INTERMEDIATE_FSMS
fprintf(stderr, "\n=== f_ab...\n");
fsm_print_fsm(stderr, f_ab);
fsm_capture_dump(stderr, "#### f_ab", f_ab);
fprintf(stderr, "\n=== f_cde...\n");
fsm_print_fsm(stderr, f_cde);
fsm_capture_dump(stderr, "#### f_cde", f_cde);
fprintf(stderr, "\n=== f_fghi...\n");
fsm_print_fsm(stderr, f_fghi);
fsm_capture_dump(stderr, "#### f_fghi", f_fghi);
#endif
/* determinise and minimise each before unioning */
det_and_min("ab", f_ab);
det_and_min("cde", f_cde);
det_and_min("fghi", f_fghi);
/* union them */
fsms[0] = f_ab;
fsms[1] = f_cde;
fsms[2] = f_fghi;
f_all = fsm_union_array(3, fsms, bases);
assert(f_all != NULL);
#if LOG_INTERMEDIATE_FSMS
fprintf(stderr, "=== unioned f_ab with f_cde... (CB ab: %u, cde: %u)\n",
bases[0].capture, bases[1].capture);
fsm_print_fsm(stderr, f_all);
fsm_capture_dump(stderr, "#### f_all", f_all);
#endif
#if LOG_INTERMEDIATE_FSMS
fprintf(stderr, "=== unioned f_all with f_fghi... (CB fghi: %u), %u captures\n",
bases[2].capture, fsm_countcaptures(f_all));
fsm_print_fsm(stderr, f_all);
fsm_capture_dump(stderr, "#### f_all #2", f_all);
#endif
if (!fsm_determinise(f_all)) {
fprintf(stderr, "NOPE %d\n", __LINE__);
exit(EXIT_FAILURE);
}
#if LOG_INTERMEDIATE_FSMS
fprintf(stderr, "==== after determinise\n");
fsm_print_fsm(stderr, f_all);
fsm_capture_dump(stderr, "#### f_all", f_all);
#endif
captures = fsm_countcaptures(f_all);
if (captures != 6) {
fprintf(stderr, "expected 6 captures, got %u\n", captures);
exit(EXIT_FAILURE);
}
check(f_all, "ab", 0, bases[0].capture);
check(f_all, "cde", 1, bases[1].capture);
check(f_all, "fghi", 2, bases[2].capture);
fsm_free(f_all);
return 0;
}
static void
det_and_min(const char *tag, struct fsm *fsm)
{
if (!fsm_determinise(fsm)) {
fprintf(stderr, "Failed to determise '%s'\n", tag);
exit(EXIT_FAILURE);
}
if (!fsm_minimise(fsm)) {
fprintf(stderr, "Failed to minimise '%s'\n", tag);
exit(EXIT_FAILURE);
}
#if LOG_INTERMEDIATE_FSMS
fprintf(stderr, "==== after det_and_min: '%s'\n", tag);
fsm_print_fsm(stderr, fsm);
fsm_capture_dump(stderr, tag, fsm);
#endif
}
static void
check(const struct fsm *fsm, const char *string,
unsigned end_id, unsigned capture_base)
{
int exec_res;
size_t i;
struct captest_input input;
fsm_state_t end;
struct fsm_capture captures[MAX_TEST_CAPTURES];
const size_t length = strlen(string);
const unsigned cb = capture_base; /* alias */
input.string = string;
input.pos = 0;
for (i = 0; i < MAX_TEST_CAPTURES; i++) {
captures[i].pos[0] = FSM_CAPTURE_NO_POS;
captures[i].pos[1] = FSM_CAPTURE_NO_POS;
}
exec_res = fsm_exec(fsm, captest_getc, &input, &end, captures);
if (exec_res != 1) {
fprintf(stderr, "fsm_exec: %d for '%s', expected 1\n",
exec_res, string);
exit(EXIT_FAILURE);
}
/* check end ID */
{
const char *msg;
if (!captest_check_single_end_id(fsm, end, end_id, &msg)) {
fprintf(stderr, "%s\n", msg);
exit(EXIT_FAILURE);
}
}
/* check captures */
if (0) {
fprintf(stderr, "captures for '%s' (cb %u): [%ld, %ld], [%ld, %ld]\n",
string, capture_base,
captures[0 + cb].pos[0], captures[0 + cb].pos[1],
captures[1 + cb].pos[0], captures[1 + cb].pos[1]);
}
assert(captures[0 + cb].pos[0] == 0);
assert(captures[0 + cb].pos[1] == length);
assert(captures[1 + cb].pos[0] == length - 1);
assert(captures[1 + cb].pos[1] == length);
}
|
/*
* POK header
*
* The following file is a part of the POK project. Any modification should
* be made according to the POK licence. You CANNOT use this file or a part
* of a file for your own project.
*
* For more information on the POK licence, please see our LICENCE FILE
*
* Please follow the coding guidelines described in doc/CODING_GUIDELINES
*
* Copyright (c) 2007-2021 POK team
*/
/* @(#)s_rint.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#ifdef POK_NEEDS_LIBMATH
/*
* rint(x)
* Return x rounded to integral value according to the prevailing
* rounding mode.
* Method:
* Using floating addition.
* Exception:
* Inexact flag raised if x not equal to rint(x).
*/
#include "math_private.h"
#include <libm.h>
static const double TWO52[2] = {
4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
-4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */
};
double rint(double x) {
int32_t i0, jj0, sx;
uint32_t i, i1;
double w, t;
EXTRACT_WORDS(i0, i1, x);
sx = (i0 >> 31) & 1;
jj0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
if (jj0 < 20) {
if (jj0 < 0) {
if (((i0 & 0x7fffffff) | i1) == 0)
return x;
i1 |= (i0 & 0x0fffff);
i0 &= 0xfffe0000;
i0 |= ((i1 | -i1) >> 12) & 0x80000;
SET_HIGH_WORD(x, i0);
w = TWO52[sx] + x;
t = w - TWO52[sx];
GET_HIGH_WORD(i0, t);
SET_HIGH_WORD(t, (i0 & 0x7fffffff) | (sx << 31));
return t;
} else {
i = (0x000fffff) >> jj0;
if (((i0 & i) | i1) == 0)
return x; /* x is integral */
i >>= 1;
if (((i0 & i) | i1) != 0) {
if (jj0 == 19)
i1 = 0x40000000;
else
i0 = (i0 & (~i)) | ((0x20000) >> jj0);
}
}
} else if (jj0 > 51) {
if (jj0 == 0x400)
return x + x; /* inf or NaN */
else
return x; /* x is integral */
} else {
i = ((uint32_t)(0xffffffff)) >> (jj0 - 20);
if ((i1 & i) == 0)
return x; /* x is integral */
i >>= 1;
if ((i1 & i) != 0)
i1 = (i1 & (~i)) | ((0x40000000) >> (jj0 - 20));
}
INSERT_WORDS(x, i0, i1);
w = TWO52[sx] + x;
return w - TWO52[sx];
}
#endif
|
/* $OpenBSD: rf_options.c,v 1.2 1999/02/16 00:03:02 niklas Exp $ */
/* $NetBSD: rf_options.c,v 1.3 1999/02/05 00:06:13 oster Exp $ */
/*
* rf_options.c
*/
/*
* Copyright (c) 1996 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Jim Zelenka
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include "rf_threadstuff.h"
#include "rf_types.h"
#include "rf_archs.h"
#include "rf_general.h"
#include "rf_options.h"
#ifdef RF_DBG_OPTION
#undef RF_DBG_OPTION
#endif /* RF_DBG_OPTION */
#ifdef __STDC__
#define RF_DBG_OPTION(_option_,_defval_) long rf_##_option_ = _defval_;
#else /* __STDC__ */
#define RF_DBG_OPTION(_option_,_defval_) long rf_/**/_option_ = _defval_;
#endif /* __STDC__ */
#include "rf_optnames.h"
#undef RF_DBG_OPTION
#ifdef __STDC__
#define RF_DBG_OPTION(_option_,_defval_) { RF_STRING(_option_), &rf_##_option_ },
#else /* __STDC__ */
#define RF_DBG_OPTION(_option_,_defval_) { RF_STRING(_option_), &rf_/**/_option_ },
#endif /* __STDC__ */
RF_DebugName_t rf_debugNames[] = {
#include "rf_optnames.h"
{NULL, NULL}
};
#undef RF_DBG_OPTION
#ifdef __STDC__
#define RF_DBG_OPTION(_option_,_defval_) rf_##_option_ = _defval_ ;
#else /* __STDC__ */
#define RF_DBG_OPTION(_option_,_defval_) rf_/**/_option_ = _defval_ ;
#endif /* __STDC__ */
void
rf_ResetDebugOptions()
{
#include "rf_optnames.h"
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__int_rand_postdec_53c.c
Label Definition File: CWE191_Integer_Underflow__int.label.xml
Template File: sources-sinks-53c.tmpl.c
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: rand Set data to result of rand(), which may be zero
* GoodSource: Set data to a small, non-zero number (negative two)
* Sinks: decrement
* GoodSink: Ensure there will not be an underflow before decrementing data
* BadSink : Decrement data, which can cause an Underflow
* Flow Variant: 53 Data flow: data passed as an argument from one function through two others to a fourth; all four functions are in different source files
*
* */
#include "std_testcase.h"
#ifndef OMITBAD
/* bad function declaration */
void CWE191_Integer_Underflow__int_rand_postdec_53d_badSink(int data);
void CWE191_Integer_Underflow__int_rand_postdec_53c_badSink(int data)
{
CWE191_Integer_Underflow__int_rand_postdec_53d_badSink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE191_Integer_Underflow__int_rand_postdec_53d_goodG2BSink(int data);
void CWE191_Integer_Underflow__int_rand_postdec_53c_goodG2BSink(int data)
{
CWE191_Integer_Underflow__int_rand_postdec_53d_goodG2BSink(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE191_Integer_Underflow__int_rand_postdec_53d_goodB2GSink(int data);
void CWE191_Integer_Underflow__int_rand_postdec_53c_goodB2GSink(int data)
{
CWE191_Integer_Underflow__int_rand_postdec_53d_goodB2GSink(data);
}
#endif /* OMITGOOD */
|
/*
* Copyright 2012 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_
#define WEBRTC_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_
#include "webrtc/p2p/base/transportdescription.h"
namespace rtc {
class SSLIdentity;
}
namespace cricket {
struct TransportOptions {
TransportOptions() : ice_restart(false), prefer_passive_role(false) {}
bool ice_restart;
bool prefer_passive_role;
};
// Creates transport descriptions according to the supplied configuration.
// When creating answers, performs the appropriate negotiation
// of the various fields to determine the proper result.
class TransportDescriptionFactory {
public:
// Default ctor; use methods below to set configuration.
TransportDescriptionFactory();
SecurePolicy secure() const { return secure_; }
// The identity to use when setting up DTLS.
rtc::SSLIdentity* identity() const { return identity_; }
// Specifies the transport security policy to use.
void set_secure(SecurePolicy s) { secure_ = s; }
// Specifies the identity to use (only used when secure is not SEC_DISABLED).
void set_identity(rtc::SSLIdentity* identity) { identity_ = identity; }
// Creates a transport description suitable for use in an offer.
TransportDescription* CreateOffer(const TransportOptions& options,
const TransportDescription* current_description) const;
// Create a transport description that is a response to an offer.
TransportDescription* CreateAnswer(
const TransportDescription* offer,
const TransportOptions& options,
const TransportDescription* current_description) const;
private:
bool SetSecurityInfo(TransportDescription* description,
ConnectionRole role) const;
SecurePolicy secure_;
rtc::SSLIdentity* identity_;
};
} // namespace cricket
#endif // WEBRTC_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_
|
/* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for license. */
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
#ifndef _BHKBREAKABLECONSTRAINT_H_
#define _BHKBREAKABLECONSTRAINT_H_
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "bhkConstraint.h"
namespace Niflib
{
// Forward define of referenced NIF objects
class bhkEntity;
class bhkBreakableConstraint;
typedef Ref<bhkBreakableConstraint> bhkBreakableConstraintRef;
/*! Bethesda-Specific node. */
class bhkBreakableConstraint : public bhkConstraint
{
public:
/*! Constructor */
NIFLIB_API bhkBreakableConstraint();
/*! Destructor */
NIFLIB_API virtual ~bhkBreakableConstraint();
/*!
* A constant value which uniquly identifies objects of this type.
*/
NIFLIB_API static const Type TYPE;
/*!
* A factory function used during file reading to create an instance of this type of object.
* \return A pointer to a newly allocated instance of this type of object.
*/
NIFLIB_API static NiObject * Create();
/*!
* Summarizes the information contained in this object in English.
* \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out.
* \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same.
*/
NIFLIB_API virtual string asString(bool verbose = false) const;
/*!
* Used to determine the type of a particular instance of this object.
* \return The type constant for the actual type of the object.
*/
NIFLIB_API virtual const Type & GetType() const;
/***Begin Example Naive Implementation****
// The entities affected by this constraint.
// \return The current value.
vector<bhkEntity * > GetEntities2() const;
// The entities affected by this constraint.
// \param[in] value The new value.
void SetEntities2( const vector<bhkEntity * >& value );
// Usually 1. Higher values indicate higher priority of this constraint?
// \return The current value.
unsigned int GetPriority2() const;
// Usually 1. Higher values indicate higher priority of this constraint?
// \param[in] value The new value.
void SetPriority2( unsigned int value );
// Unknown
// \return The current value.
Vector3 GetPosition() const;
// Unknown
// \param[in] value The new value.
void SetPosition( const Vector3 & value );
// Unknown
// \return The current value.
Vector3 GetRotation() const;
// Unknown
// \param[in] value The new value.
void SetRotation( const Vector3 & value );
// Unknown
// \return The current value.
float GetThreshold() const;
// Unknown
// \param[in] value The new value.
void SetThreshold( float value );
// Unknown
// \return The current value.
byte GetRemoveIfBroken() const;
// Unknown
// \param[in] value The new value.
void SetRemoveIfBroken( byte value );
****End Example Naive Implementation***/
//--BEGIN MISC CUSTOM CODE--//
//--END CUSTOM CODE--//
protected:
/*! */
array<41, int > unknownInts1;
/*! Unknown */
short unknownShort1;
/*! A count or flag? */
unsigned int unknownInt1;
/*! Number of bodies affected by this constraint. */
mutable unsigned int numEntities2;
/*! The entities affected by this constraint. */
vector<bhkEntity * > entities2;
/*! Usually 1. Higher values indicate higher priority of this constraint? */
unsigned int priority2;
/*! Unknown */
unsigned int unknownInt2;
/*! Unknown */
Vector3 position;
/*! Unknown */
Vector3 rotation;
/*! Unknown */
unsigned int unknownInt3;
/*! Unknown */
float threshold;
/*! Unknown */
float unknownFloat1;
/*! Unknown */
byte removeIfBroken;
public:
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Read(istream& in, list<unsigned int> & link_stack, const NifInfo & info);
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Write(ostream& out, const map<NiObjectRef, unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info) const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void FixLinks(const map<unsigned int, NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info);
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const;
};
//--BEGIN FILE FOOT CUSTOM CODE--//
//--END CUSTOM CODE--//
} //End Niflib namespace
#endif
|
/*
* Copyright (c) 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bill Paul.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <stdlib.h>
#include <unistd.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_vlan_var.h>
#include <net/route.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <err.h>
#include <errno.h>
#include "ifconfig.h"
#ifndef lint
static const char rcsid[] =
"$FreeBSD: src/sbin/ifconfig/ifvlan.c,v 1.5 2002/04/18 17:14:09 imp Exp $";
#endif
static int __tag = 0;
static int __have_tag = 0;
void
vlan_status(int s, struct rt_addrinfo *info __unused)
{
struct vlanreq vreq;
bzero((char *)&vreq, sizeof(struct vlanreq));
ifr.ifr_data = (caddr_t)&vreq;
if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1)
return;
printf("\tvlan: %d parent interface: %s\n",
vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ?
"<none>" : vreq.vlr_parent);
return;
}
void
setvlantag(const char *val, int d, int s, const struct afswtch *afp)
{
u_int16_t tag;
struct vlanreq vreq;
__tag = tag = atoi(val);
__have_tag = 1;
bzero((char *)&vreq, sizeof(struct vlanreq));
ifr.ifr_data = (caddr_t)&vreq;
if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1)
err(1, "SIOCGETVLAN");
vreq.vlr_tag = tag;
if (ioctl(s, SIOCSETVLAN, (caddr_t)&ifr) == -1)
err(1, "SIOCSETVLAN");
return;
}
void
setvlandev(const char *val, int d, int s, const struct afswtch *afp)
{
struct vlanreq vreq;
if (!__have_tag)
errx(1, "must specify both vlan tag and device");
bzero((char *)&vreq, sizeof(struct vlanreq));
ifr.ifr_data = (caddr_t)&vreq;
if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1)
err(1, "SIOCGETVLAN");
strncpy(vreq.vlr_parent, val, sizeof(vreq.vlr_parent));
vreq.vlr_tag = __tag;
if (ioctl(s, SIOCSETVLAN, (caddr_t)&ifr) == -1)
err(1, "SIOCSETVLAN");
return;
}
void
unsetvlandev(const char *val, int d, int s, const struct afswtch *afp)
{
struct vlanreq vreq;
bzero((char *)&vreq, sizeof(struct vlanreq));
ifr.ifr_data = (caddr_t)&vreq;
if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1)
err(1, "SIOCGETVLAN");
bzero((char *)&vreq.vlr_parent, sizeof(vreq.vlr_parent));
vreq.vlr_tag = 0;
if (ioctl(s, SIOCSETVLAN, (caddr_t)&ifr) == -1)
err(1, "SIOCSETVLAN");
return;
}
|
/**
* \file ener.h
*
* \brief Header file for ener.c
*
* \authors Florent Hedin (University of Basel, Switzerland) \n
* Markus Meuwly (University of Basel, Switzerland)
*
* \copyright Copyright (c) 2011-2015, Florent Hédin, Markus Meuwly, and the University of Basel. \n
* All rights reserved. \n
* The 3-clause BSD license is applied to this software. \n
* See LICENSE.txt
*
*/
#ifndef ENER_H_INCLUDED
#define ENER_H_INCLUDED
/*
* Lennard Jones : divide by this for transforming
* R_min in sigma ( it is 2^(1/6) )
* */
#define RTOSIG 1.122462048309373
/*
* Boltzmann cst in charmm units
*/
#define KBCH 1.98719e-03
/*
* for converting energy
*/
#define JTOCAL 0.239005736 // Joules to Calories
#define CM1TOKJM 1.1963e-02 // 1 cm-1 in kJ/mol
// pointers to the desired energy and force functions
double (*get_ENER)(ATOM at[], DATA *dat, int32_t candidate);
void (*get_DV)(ATOM at[], DATA *dat, double fx[], double fy[], double fz[]);
// ener and force for lennard-jones
double get_LJ_V(ATOM at[], DATA *dat, int32_t candidate);
void get_LJ_DV(ATOM at[], DATA *dat, double fx[], double fy[], double fz[]);
// ener for aziz potential
double get_AZIZ_V(ATOM at[], DATA *dat, int32_t candidate);
// those 3 functions returns energy in cm-1 !!
double aziz_ne_ne(double r);
double aziz_ar_ne(double r);
double aziz_ar_ar(double r);
// constraint for avoiding cluster evaporation
double getExtraPot(double d2, double sig, double eps);
#endif // ENER_H_INCLUDED
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BOUND_OBJECT_H_
#define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BOUND_OBJECT_H_
#include <jni.h>
#include <map>
#include <string>
#include "base/android/scoped_java_ref.h"
#include "base/memory/linked_ptr.h"
#include "content/browser/renderer_host/java/java_method.h"
#include "third_party/npapi/bindings/npruntime.h"
// Wrapper around a Java object.
//
// Represents a Java object for use in the Java bridge. Holds a global ref to
// the Java object and provides the ability to invoke methods on it.
// Interrogation of the Java object for its methods is done lazily. This class
// is not generally threadsafe. However, it does allow for instances to be
// created and destroyed on different threads.
class JavaBoundObject {
public:
// Takes a Java object and creates a JavaBoundObject around it. Also takes
// a boolean that determines whether or not inherited methods are allowed
// to be called as well. This property propagates to all Objects that get
// implicitly exposed as return values as well. Returns an NPObject with
// a ref count of one which owns the JavaBoundObject.
static NPObject* Create(const base::android::JavaRef<jobject>& object,
bool allow_inherited_methods);
virtual ~JavaBoundObject();
// Gets a global ref to the underlying JavaObject from a JavaBoundObject
// wrapped as an NPObject. Ownership of the global ref is retained by the
// JavaBoundObject: the caller must NOT release it.
static jobject GetJavaObject(NPObject* object);
// Methods to implement the NPObject callbacks.
bool HasMethod(const std::string& name) const;
bool Invoke(const std::string& name, const NPVariant* args, size_t arg_count,
NPVariant* result);
private:
explicit JavaBoundObject(const base::android::JavaRef<jobject>& object,
bool allow_inherited_methods);
void EnsureMethodsAreSetUp() const;
// Global ref to the underlying Java object. We use a naked jobject, rather
// than a ScopedJavaGlobalRef, as the global ref will be added and dropped on
// different threads.
jobject java_object_;
// Map of public methods, from method name to Method instance. Multiple
// entries will be present for overloaded methods. Note that we can't use
// scoped_ptr in STL containers as we can't copy it.
typedef std::multimap<std::string, linked_ptr<JavaMethod> > JavaMethodMap;
mutable JavaMethodMap methods_;
mutable bool are_methods_set_up_;
bool allow_inherited_methods_;
DISALLOW_IMPLICIT_CONSTRUCTORS(JavaBoundObject);
};
#endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BOUND_OBJECT_H_
|
#ifndef TRANSPORT_SESSION_H__
#define TRANSPORT_SESSION_H__
#include <inttypes.h>
#include <iostream>
#include <memory>
#include <vector>
#include "Identity.h"
#include "Crypto.h"
#include "RouterInfo.h"
#include "I2NPProtocol.h"
#include "Timestamp.h"
namespace i2p
{
namespace transport
{
class SignedData
{
public:
SignedData () {}
SignedData (const SignedData& other)
{
m_Stream << other.m_Stream.rdbuf ();
}
void Insert (const uint8_t * buf, size_t len)
{
m_Stream.write ((char *)buf, len);
}
template<typename T>
void Insert (T t)
{
m_Stream.write ((char *)&t, sizeof (T));
}
bool Verify (std::shared_ptr<const i2p::data::IdentityEx> ident, const uint8_t * signature) const
{
return ident->Verify ((const uint8_t *)m_Stream.str ().c_str (), m_Stream.str ().size (), signature);
}
void Sign (const i2p::data::PrivateKeys& keys, uint8_t * signature) const
{
keys.Sign ((const uint8_t *)m_Stream.str ().c_str (), m_Stream.str ().size (), signature);
}
private:
std::stringstream m_Stream;
};
class TransportSession
{
public:
TransportSession (std::shared_ptr<const i2p::data::RouterInfo> router, int terminationTimeout):
m_DHKeysPair (nullptr), m_NumSentBytes (0), m_NumReceivedBytes (0), m_IsOutgoing (router), m_TerminationTimeout (terminationTimeout),
m_LastActivityTimestamp (i2p::util::GetSecondsSinceEpoch ())
{
if (router)
m_RemoteIdentity = router->GetRouterIdentity ();
}
virtual ~TransportSession () {};
virtual void Done () = 0;
std::string GetIdentHashBase64() const { return m_RemoteIdentity ? m_RemoteIdentity->GetIdentHash().ToBase64() : ""; }
std::shared_ptr<const i2p::data::IdentityEx> GetRemoteIdentity () { return m_RemoteIdentity; };
void SetRemoteIdentity (std::shared_ptr<const i2p::data::IdentityEx> ident) { m_RemoteIdentity = ident; };
size_t GetNumSentBytes () const { return m_NumSentBytes; };
size_t GetNumReceivedBytes () const { return m_NumReceivedBytes; };
bool IsOutgoing () const { return m_IsOutgoing; };
int GetTerminationTimeout () const { return m_TerminationTimeout; };
void SetTerminationTimeout (int terminationTimeout) { m_TerminationTimeout = terminationTimeout; };
bool IsTerminationTimeoutExpired (uint64_t ts) const
{ return ts >= m_LastActivityTimestamp + GetTerminationTimeout (); };
virtual void SendLocalRouterInfo () { SendI2NPMessages ({ CreateDatabaseStoreMsg () }); };
virtual void SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs) = 0;
protected:
std::shared_ptr<const i2p::data::IdentityEx> m_RemoteIdentity;
std::shared_ptr<i2p::crypto::DHKeys> m_DHKeysPair; // X - for client and Y - for server
size_t m_NumSentBytes, m_NumReceivedBytes;
bool m_IsOutgoing;
int m_TerminationTimeout;
uint64_t m_LastActivityTimestamp;
};
}
}
#endif
|
// This file is part of MOS, the MANTIS Operating System
// See http://mantis.cs.colorado.edu/
//
// Copyright (c) 2002 - 2007 University of Colorado, Boulder
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of the MANTIS Project nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
/** @file kernel/include/mem.h
* @brief Memory management system.
*
* Memory management system for allocating thread stack space in memory. We keep a linked list of free memory blocks and use a best fit match to allocate new blocks.
* @author Brian Shucker
* @author Edited: Jeff Rose (Converted generic heap to our specific memory
* manager.)
* @date Created: 11/02/1999
*/
/** @brief A node of managed memory */
typedef struct node_s {
/** @brief Size of blocks */
uint16_t size;
/** @brief Linked list of pointers */
struct node_s *prev;
/** @brief Pointer to ned node */
struct node_s *next;
} node_t;
#include <inttypes.h>
#include "msched.h"
/** @brief Initialize the heap with a single free region of memory.
* @param region Memory region to initialize
* @param size Size of the memory region
*/
void mem_init(void *region, uint16_t size);
/** @brief Try to allocate a region of memory.
* @param size Size of the region to allocate.
* @return NULL if not enough memory is available, else the allocated memory.
*/
void *mos_mem_alloc(uint16_t size);
/** @brief Free a block of memory.
* @param block Block of memory to free
*/
void mos_mem_free(void *block);
/** @brief Check the number of bytes used for a given thread's stack
*
* @param t The thread who's stack shall be checked.
* @return The number of bytes used
*/
uint16_t mos_check_stack(mos_thread_t *t);
#ifdef DEBUG_MEMORY
void print_memory(uint8_t verbose);
#endif
|
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011-2014, Willow Garage, Inc.
* Copyright (c) 2014-2016, Open Source Robotics Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Open Source Robotics Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/** @author Jia Pan */
#ifndef FCL_BV_SPLITTERBASE_H
#define FCL_BV_SPLITTERBASE_H
#include "fcl/math/triangle.h"
#include "fcl/geometry/bvh/BVH_internal.h"
#include "fcl/math/bv/kIOS.h"
#include "fcl/math/bv/OBBRSS.h"
#include <vector>
#include <iostream>
namespace fcl
{
namespace detail
{
/// @brief Base interface for BV splitting algorithm
template <typename BV>
class BVSplitterBase
{
public:
using S = typename BV::S;
/// @brief Set the geometry data needed by the split rule
virtual void set(
Vector3<S>* vertices_,
Triangle* tri_indices_,
BVHModelType type_) = 0;
/// @brief Compute the split rule according to a subset of geometry and the
/// corresponding BV node
virtual void computeRule(
const BV& bv, unsigned int* primitive_indices, int num_primitives) = 0;
/// @brief Apply the split rule on a given point
virtual bool apply(const Vector3<S>& q) const = 0;
/// @brief Clear the geometry data set before
virtual void clear() = 0;
};
} // namespace detail
} // namespace fcl
#endif
|
#pragma once
namespace despoof { namespace win32 {
class abortable {
void *event_;
bool aborting_;
public:
abortable();
void abort();
void* wait_event();
bool aborting();
};
}}
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_
#define CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "chromeos/chromeos_export.h"
namespace dbus {
class MessageWriter;
class MessageReader;
} // dbus
namespace chromeos {
// TODO(nona): Remove ibus namespace after complete libibus removal.
namespace ibus {
// The IBusText is one of IBusObjects and it contains IBusAttrList object which
// contains array of IBusAttribute object. The overview of each data strucutres
// is as follows:
//
// DATA STRUCTURE OVERVIEW:
//
// IBusAttribute: (signature is "uuuu")
// variant struct {
// string "IBusAttribute"
// array[]
// uint32 1 // Type of attribute.
// uint32 1 // The value of attribute.
// uint32 0 // The start index of the text.
// uint32 1 // The end index of the text.
// }
//
// IBusAttrList: (signature is "av")
// variant struct {
// string "IBusAttrList"
// array[]
// array[ // The array of IBusAttribute.
// variant struct{
// string "IBusAttribute"
// ...
// }
// variant struct{
// string "IBusAttribute"
// ...
// }
// variant struct{
// string "IBusAttribute"
// ...
// }
// ]
// }
//
// IBusText: (signature is "sv")
// variant struct {
// string "IBusText"
// array[]
// string "A"
// variant struct {
// string "IBusAttrList"
// array[]
// array[
// variant struct{
// string "IBusAttribute"
// ...
// }
// variant struct{
// string "IBusAttribute"
// ...
// }
// ]
// }
// }
//
class IBusText;
// Pops a IBusText from |reader|.
// Returns false if an error occures.
bool CHROMEOS_EXPORT PopIBusText(dbus::MessageReader* reader,
IBusText* ibus_text);
// Pops a IBusText from |reader| and stores it's text field into text. Use
// PopIBusText instead in the case of using any attribute entries in IBusText.
// Returns true on success.
bool CHROMEOS_EXPORT PopStringFromIBusText(dbus::MessageReader* reader,
std::string* text);
// Appends a IBusText to |writer|. Annotation and description field is not
// filled with AppendIBusText.
// TODO(nona): Support annotation/description appending if necessary.
void CHROMEOS_EXPORT AppendIBusText(const IBusText& ibus_text,
dbus::MessageWriter* writer);
// Appends a string to |writer| as IBusText without any attributes. Use
// AppendIBusText instead in the case of using any attribute entries.
// TODO(nona): Support annotation/description appending if necessary.
void CHROMEOS_EXPORT AppendStringAsIBusText(const std::string& text,
dbus::MessageWriter* writer);
// Handles IBusText object which is used in dbus communication with ibus-daemon.
// The IBusAttribute has four uint32 variables and the IBusAttributes represents
// three type of decoration based on it's values.
// 1. Underline decoration (corresponds to UnderlineAttribute structure)
// 1st value: indicates underline attribute.
// 2nd value: type of decoration. Chrome only support single and double
// underline and error line.
// 3rd value: the start index of this attribute in multibyte.
// 4th value: the end index of this attribute in multibyte.
//
// 2. Background decoration (corresponds to SelectionAttribute structure)
// NOTE: Background decoration is treated as selection in Chrome.
// 1st value: indicates background attribute.
// 2nd value: Represents color but not supported in Chrome.
// 3rd value: the start index of this attribute in multibyte.
// 4th value: the end index of this attribute in multibyte.
//
// 3. Forward decoration
// Not supported in Chrome.
class CHROMEOS_EXPORT IBusText {
public:
enum IBusTextUnderlineType {
IBUS_TEXT_UNDERLINE_SINGLE = 1,
IBUS_TEXT_UNDERLINE_DOUBLE = 2,
IBUS_TEXT_UNDERLINE_ERROR = 4,
};
struct UnderlineAttribute {
IBusTextUnderlineType type;
uint32 start_index; // The inclusive start index.
uint32 end_index; // The exclusive end index.
};
struct SelectionAttribute {
uint32 start_index; // The inclusive start index.
uint32 end_index; // The exclusive end index.
};
// Accessors
IBusText();
virtual ~IBusText();
const std::string& text() const { return text_; }
void set_text(const std::string& text) { text_ = text; }
const std::string& annotation() const { return annotation_; }
void set_annotation(const std::string& annotation) {
annotation_ = annotation;
}
const std::string& description_title() const { return description_title_; }
void set_description_title(const std::string& title) {
description_title_ = title;
}
const std::string& description_body() const { return description_body_; }
void set_description_body(const std::string& body) {
description_body_ = body;
}
const std::vector<UnderlineAttribute>& underline_attributes() const {
return underline_attributes_;
}
std::vector<UnderlineAttribute>* mutable_underline_attributes() {
return &underline_attributes_;
}
const std::vector<SelectionAttribute>& selection_attributes() const {
return selection_attributes_;
}
std::vector<SelectionAttribute>* mutable_selection_attributes() {
return &selection_attributes_;
}
private:
std::string text_;
std::string annotation_;
std::string description_title_;
std::string description_body_;
std::vector<UnderlineAttribute> underline_attributes_;
std::vector<SelectionAttribute> selection_attributes_;
DISALLOW_COPY_AND_ASSIGN(IBusText);
};
} // namespace ibus
} // namespace chromeos
#endif // CHROMEOS_DBUS_IBUS_IBUS_TEXT_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_EXPERIMENTAL_FLAGS_H_
#define IOS_CHROME_BROWSER_EXPERIMENTAL_FLAGS_H_
#include <string>
// This file can be empty. Its purpose is to contain the relatively short lived
// declarations required for experimental flags.
namespace experimental_flags {
// Whether background crash report upload should generate a local notification.
bool IsAlertOnBackgroundUploadEnabled();
// Whether the new bookmark collection experience is enabled.
bool IsBookmarkCollectionEnabled();
// Whether the lru snapshot cache experiment is enabled.
bool IsLRUSnapshotCacheEnabled();
// Whether viewing and copying passwords is enabled.
bool IsViewCopyPasswordsEnabled();
// Whether password generation is enabled.
bool IsPasswordGenerationEnabled();
// Whether password generation fields are determined using local heuristics
// only.
bool UseOnlyLocalHeuristicsForPasswordGeneration();
// Whether the Tab Switcher is enabled for iPad or not.
bool IsTabSwitcherEnabled();
// Whether the reading list is enabled.
bool IsReadingListEnabled();
// Whether the file sent by the share extension sould be deleted after being
// processed. If true, files will be reprocessed everytime the application is
// put in foreground.
bool IsReadingListKeepItemsEnabled();
} // namespace experimental_flags
#endif // IOS_CHROME_BROWSER_EXPERIMENTAL_FLAGS_H_
|
/* copyright(C) 2002 H.Kawai (under KL-01). */
#include <stdlib.h> /* strtod */
#include <stdio.h> /* NULL */
double GO_atof(const char *s)
{
return strtod(s, (char **) NULL);
}
|
// Copyright 2013 Little Joy Software. All rights reserved.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Little Joy Software nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY LITTLE JOY SOFTWARE ''AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LITTLE JOY SOFTWARE BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/Foundation.h>
#import "LjsRepeatingTimerProtocol.h"
#import "LjsStartAtLaunchManagerProtocol.h"
typedef void(^Ljs_Block_LoginItemManager_TimerEvent)(BOOL aIsLoginItem);
/**
Documentation
*/
@interface LjsLoginItemManager : NSObject
<LjsRepeatingTimerProtocol,
LjsStartAtLaunchManagerProtocol>
/** @name Properties */
@property (assign) BOOL shouldLogTimerEvent;
/** @name Initializing Objects */
- (id) initWithTimerEventBlock:(void (^)(BOOL aIsLoginItem)) aTimerEventBlock;
/** @name Handling Notifications, Requests, and Events */
/** @name Utility */
+ (BOOL) hasOnDemainLaunchHelperWithBundleId:(NSString *) aLaunchHelperBundleId;
@end
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_WEB_INTENT_REPLY_DATA_H_
#define WEBKIT_GLUE_WEB_INTENT_REPLY_DATA_H_
#include "base/files/file_path.h"
#include "base/string16.h"
#include "webkit/glue/webkit_glue_export.h"
namespace webkit_glue {
// Constant values use to indicate what type of reply the caller is getting from
// the web intents service page.
enum WebIntentReplyType {
// Invalid type. Use to initialize reply types.
WEB_INTENT_REPLY_INVALID,
// Sent for a reply message (success).
WEB_INTENT_REPLY_SUCCESS,
// Sent for a failure message.
WEB_INTENT_REPLY_FAILURE,
// Sent if the picker is cancelled without a selection being made.
WEB_INTENT_PICKER_CANCELLED,
// Sent if the service contents is closed without any response being sent.
WEB_INTENT_SERVICE_CONTENTS_CLOSED,
};
struct WEBKIT_GLUE_EXPORT WebIntentReply {
WebIntentReply();
WebIntentReply(WebIntentReplyType type, string16 data);
WebIntentReply(
WebIntentReplyType type,
base::FilePath data_file,
int64 data_file_size);
bool operator==(const WebIntentReply& other) const;
// Response type. Default value is WEB_INTENT_REPLY_INVALID.
WebIntentReplyType type;
// Serialized data. Default value is empty.
string16 data;
// FilePath to the data to be delivered. Default value is empty.
base::FilePath data_file;
// Length of data_path.
int64 data_file_size;
};
} // namespace webkit_glue
#endif // WEBKIT_GLUE_WEB_INTENT_REPLY_DATA_H_
|
/*-
* Copyright (c) 2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/bio.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <geom/geom.h>
#define G_ZERO_CLASS_NAME "ZERO"
static int g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS);
SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, zero, CTLFLAG_RW, 0,
"GEOM_ZERO stuff");
static int g_zero_clear = 1;
SYSCTL_PROC(_kern_geom_zero, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW,
&g_zero_clear, 0, g_zero_clear_sysctl, "I", "Clear read data buffer");
static int g_zero_byte = 0;
SYSCTL_INT(_kern_geom_zero, OID_AUTO, byte, CTLFLAG_RW, &g_zero_byte, 0,
"Byte (octet) value to clear the buffers with");
static struct g_provider *gpp;
static int
g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS)
{
int error;
error = sysctl_handle_int(oidp, &g_zero_clear, 0, req);
if (error != 0 || req->newptr == NULL)
return (error);
if (gpp == NULL)
return (ENXIO);
if (g_zero_clear)
gpp->flags &= ~G_PF_ACCEPT_UNMAPPED;
else
gpp->flags |= G_PF_ACCEPT_UNMAPPED;
return (0);
}
static void
g_zero_start(struct bio *bp)
{
int error = ENXIO;
switch (bp->bio_cmd) {
case BIO_READ:
if (g_zero_clear && (bp->bio_flags & BIO_UNMAPPED) == 0)
memset(bp->bio_data, g_zero_byte, bp->bio_length);
/* FALLTHROUGH */
case BIO_DELETE:
case BIO_WRITE:
bp->bio_completed = bp->bio_length;
error = 0;
break;
case BIO_GETATTR:
default:
error = EOPNOTSUPP;
break;
}
g_io_deliver(bp, error);
}
static void
g_zero_init(struct g_class *mp)
{
struct g_geom *gp;
struct g_provider *pp;
g_topology_assert();
gp = g_new_geomf(mp, "gzero");
gp->start = g_zero_start;
gp->access = g_std_access;
gpp = pp = g_new_providerf(gp, "%s", gp->name);
if (!g_zero_clear)
pp->flags |= G_PF_ACCEPT_UNMAPPED;
pp->mediasize = 1152921504606846976LLU;
pp->sectorsize = 512;
g_error_provider(pp, 0);
}
static int
g_zero_destroy_geom(struct gctl_req *req __unused, struct g_class *mp __unused,
struct g_geom *gp)
{
struct g_provider *pp;
g_topology_assert();
if (gp == NULL)
return (0);
pp = LIST_FIRST(&gp->provider);
if (pp == NULL)
return (0);
if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)
return (EBUSY);
gpp = NULL;
g_wither_geom(gp, ENXIO);
return (0);
}
static struct g_class g_zero_class = {
.name = G_ZERO_CLASS_NAME,
.version = G_VERSION,
.init = g_zero_init,
.destroy_geom = g_zero_destroy_geom
};
DECLARE_GEOM_CLASS(g_zero_class, g_zero);
|
/****************************************************************************
* Copyright (c) 2014, Christopher Karle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, AUTHOR OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
#ifndef PERF_H
#define PERF_H
#define PERF_START
#define PERF_STOP(x)
#endif
|
#ifndef IZ_PIXEL_H
#define IZ_PIXEL_H 1
#include "intmacros.h"
#include "predict.h"
namespace IZ
{
template<typename U = unsigned char>
class Pixel
{
enum Components
{
R = 0,
G = 1,
B = 2,
Count = 3,
C0 = G,
C1 = R,
C2 = B
};
public:
void readFrom(const U* p)
{
c[0] = p[C0];
c[1] = p[C1];
c[2] = p[C2];
}
void writeTo(U* p) const
{
p[C0] = c[0];
p[C1] = c[1];
p[C2] = c[2];
}
void predict(const U* p, int bpp, int bpr, int (* predictor)(int, int, int)) __attribute__((always_inline))
{
c[0] = predictor(p[C0 - bpp], p[C0 - bpr], p[C0 - bpp - bpr]);
c[1] = predictor(p[C1 - bpp], p[C1 - bpr], p[C1 - bpp - bpr]);
c[2] = predictor(p[C2 - bpp], p[C2 - bpr], p[C2 - bpp - bpr]);
}
void operator-=(const Pixel<U>& other)
{
c[0] -= other.c[0];
c[1] -= other.c[1];
c[2] -= other.c[2];
}
void operator+=(const Pixel<U>& other)
{
c[0] += other.c[0];
c[1] += other.c[1];
c[2] += other.c[2];
}
bool operator==(const Pixel<U>& other) const
{
return c[0] == other.c[0] && c[1] == other.c[1] && c[2] == other.c[2];
}
void forwardTransform()
{
c[1] -= c[0];
c[2] -= c[0];
}
void reverseTransform()
{
c[1] += c[0];
c[2] += c[0];
}
void toUnsigned()
{
if (sizeof(U) == sizeof(signed char))
{
c[0] = s2u((signed char) c[0]);
c[1] = s2u((signed char) c[1]);
c[2] = s2u((signed char) c[2]);
}
else if (sizeof(U) == sizeof(signed short))
{
c[0] = s2u((signed short) c[0]);
c[1] = s2u((signed short) c[1]);
c[2] = s2u((signed short) c[2]);
}
else
{
c[0] = s2u(c[0]);
c[1] = s2u(c[1]);
c[2] = s2u(c[2]);
}
}
void toSigned()
{
c[0] = u2s(c[0]);
c[1] = u2s(c[1]);
c[2] = u2s(c[2]);
}
unsigned int numBits() const
{
return IZ::numBits(c[0] | c[1] | c[2]);
}
void writeBits(BitEncoder<>& bc, int numBits) const
{
bc.writeBits(c[0], numBits);
bc.writeBits(c[1], numBits);
bc.writeBits(c[2], numBits);
bc.flushCache();
}
void readBits(BitDecoder<>& bc, int numBits)
{
c[0] = bc.readBits(numBits);
c[1] = bc.readBits(numBits);
c[2] = bc.readBits(numBits);
}
int c[Count];
};
} // namespace IZ
#endif
|
/*-
* Implementation of Utility functions for all SCSI device types.
*
* Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
* Copyright (c) 1997, 1998, 2003 Kenneth D. Merry.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification, immediately at the beginning of the file.
* 2. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_scsi_all.c#2 $
*/
#include <sys/param.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#ifdef _KERNEL
#include <sys/systm.h>
#include <sys/libkern.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#else
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#endif
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_queue.h>
#include <cam/cam_xpt.h>
#include <cam/scsi/scsi_all.h>
#include <cam/ctl/ctl_io.h>
#include <cam/ctl/ctl_scsi_all.h>
#include <sys/sbuf.h>
#ifndef _KERNEL
#include <camlib.h>
#endif
const char *
ctl_scsi_status_string(struct ctl_scsiio *ctsio)
{
switch(ctsio->scsi_status) {
case SCSI_STATUS_OK:
return("OK");
case SCSI_STATUS_CHECK_COND:
return("Check Condition");
case SCSI_STATUS_BUSY:
return("Busy");
case SCSI_STATUS_INTERMED:
return("Intermediate");
case SCSI_STATUS_INTERMED_COND_MET:
return("Intermediate-Condition Met");
case SCSI_STATUS_RESERV_CONFLICT:
return("Reservation Conflict");
case SCSI_STATUS_CMD_TERMINATED:
return("Command Terminated");
case SCSI_STATUS_QUEUE_FULL:
return("Queue Full");
case SCSI_STATUS_ACA_ACTIVE:
return("ACA Active");
case SCSI_STATUS_TASK_ABORTED:
return("Task Aborted");
default: {
static char unkstr[64];
snprintf(unkstr, sizeof(unkstr), "Unknown %#x",
ctsio->scsi_status);
return(unkstr);
}
}
}
/*
* scsi_command_string() returns 0 for success and -1 for failure.
*/
int
ctl_scsi_command_string(struct ctl_scsiio *ctsio,
struct scsi_inquiry_data *inq_data, struct sbuf *sb)
{
char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
sbuf_printf(sb, "%s. CDB: %s",
scsi_op_desc(ctsio->cdb[0], inq_data),
scsi_cdb_string(ctsio->cdb, cdb_str, sizeof(cdb_str)));
return(0);
}
void
ctl_scsi_path_string(union ctl_io *io, char *path_str, int len)
{
snprintf(path_str, len, "(%u:%u:%u/%u): ",
io->io_hdr.nexus.initid.id, io->io_hdr.nexus.targ_port,
io->io_hdr.nexus.targ_lun, io->io_hdr.nexus.targ_mapped_lun);
}
/*
* ctl_scsi_sense_sbuf() returns 0 for success and -1 for failure.
*/
int
ctl_scsi_sense_sbuf(struct ctl_scsiio *ctsio,
struct scsi_inquiry_data *inq_data, struct sbuf *sb,
scsi_sense_string_flags flags)
{
char path_str[64];
if ((ctsio == NULL) || (sb == NULL))
return(-1);
ctl_scsi_path_string((union ctl_io *)ctsio, path_str, sizeof(path_str));
if (flags & SSS_FLAG_PRINT_COMMAND) {
sbuf_cat(sb, path_str);
ctl_scsi_command_string(ctsio, inq_data, sb);
sbuf_printf(sb, "\n");
}
scsi_sense_only_sbuf(&ctsio->sense_data, ctsio->sense_len, sb,
path_str, inq_data, ctsio->cdb, ctsio->cdb_len);
return(0);
}
char *
ctl_scsi_sense_string(struct ctl_scsiio *ctsio,
struct scsi_inquiry_data *inq_data, char *str,
int str_len)
{
struct sbuf sb;
sbuf_new(&sb, str, str_len, 0);
ctl_scsi_sense_sbuf(ctsio, inq_data, &sb, SSS_FLAG_PRINT_COMMAND);
sbuf_finish(&sb);
return(sbuf_data(&sb));
}
#ifdef _KERNEL
void
ctl_scsi_sense_print(struct ctl_scsiio *ctsio,
struct scsi_inquiry_data *inq_data)
{
struct sbuf sb;
char str[512];
sbuf_new(&sb, str, sizeof(str), 0);
ctl_scsi_sense_sbuf(ctsio, inq_data, &sb, SSS_FLAG_PRINT_COMMAND);
sbuf_finish(&sb);
printf("%s", sbuf_data(&sb));
}
#else /* _KERNEL */
void
ctl_scsi_sense_print(struct ctl_scsiio *ctsio,
struct scsi_inquiry_data *inq_data, FILE *ofile)
{
struct sbuf sb;
char str[512];
if ((ctsio == NULL) || (ofile == NULL))
return;
sbuf_new(&sb, str, sizeof(str), 0);
ctl_scsi_sense_sbuf(ctsio, inq_data, &sb, SSS_FLAG_PRINT_COMMAND);
sbuf_finish(&sb);
fprintf(ofile, "%s", sbuf_data(&sb));
}
#endif /* _KERNEL */
|
/*
* utf8_examples.h
*
* UTF8 constants used by libsrt tests and examples
*
* Copyright (c) 2015-2019 F. Aragon. All rights reserved.
* Released under the BSD 3-Clause License (see the doc/LICENSE)
*/
#ifndef UTF8_EXAMPLES_H
#define UTF8_EXAMPLES_H
#define U8_C_N_TILDE_D1 "\xc3\x91"
#define U8_S_N_TILDE_F1 "\xc3\xb1"
#define U8_S_I_DOTLESS_131 "\xc4\xb1" /* Turkish small I without dot */
#define U8_C_I_DOTTED_130 "\xc4\xb0" /* Turkish capital I with dot */
#define U8_C_G_BREVE_11E "\xc4\x9e"
#define U8_S_G_BREVE_11F "\xc4\x9f"
#define U8_C_S_CEDILLA_15E "\xc5\x9e"
#define U8_S_S_CEDILLA_15F "\xc5\x9f"
#define U8_CENT_00A2 "\xc2\xa2"
#define U8_EURO_20AC "\xe2\x82\xac"
#define U8_HAN_24B62 "\xf0\xa4\xad\xa2"
#define U8_HAN_611B "\xe6\x84\x9b"
#define U8_MIX1 \
U8_C_N_TILDE_D1 U8_S_N_TILDE_F1 U8_S_I_DOTLESS_131 U8_C_I_DOTTED_130 \
U8_C_G_BREVE_11E U8_S_G_BREVE_11F U8_C_S_CEDILLA_15E \
U8_S_S_CEDILLA_15F U8_CENT_00A2 U8_EURO_20AC \
U8_HAN_24B62
#define U8_MIX_28_bytes U8_MIX1 U8_HAN_611B
#define U8_MANY_UNDERSCORES \
"____________________________________________________________________" \
"____________________________________________________________________" \
"____________________________________________________________________" \
"____________________________________________________________________"
#endif /* UTF8_EXAMPLES_H */
|
int main(void)
{
if (99.5 > 99.6 || 2 < 3) {
return 42;
} else {
return 0;
}
}
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012, John Haddon. All rights reserved.
// Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided with
// the distribution.
//
// * Neither the name of John Haddon nor the names of
// any other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////
#ifndef GAFFERSCENE_SHADERASSIGNMENT_H
#define GAFFERSCENE_SHADERASSIGNMENT_H
#include "GafferScene/AttributeProcessor.h"
#include "GafferScene/ShaderPlug.h"
namespace GafferScene
{
class GAFFERSCENE_API ShaderAssignment : public AttributeProcessor
{
public :
ShaderAssignment( const std::string &name=defaultName<ShaderAssignment>() );
~ShaderAssignment() override;
GAFFER_NODE_DECLARE_TYPE( GafferScene::ShaderAssignment, ShaderAssignmentTypeId, AttributeProcessor );
GafferScene::ShaderPlug *shaderPlug();
const GafferScene::ShaderPlug *shaderPlug() const;
protected :
bool affectsProcessedAttributes( const Gaffer::Plug *input ) const override;
void hashProcessedAttributes( const ScenePath &path, const Gaffer::Context *context, IECore::MurmurHash &h ) const override;
IECore::ConstCompoundObjectPtr computeProcessedAttributes( const ScenePath &path, const Gaffer::Context *context, const IECore::CompoundObject *inputAttributes ) const override;
private :
static size_t g_firstPlugIndex;
};
IE_CORE_DECLAREPTR( ShaderAssignment )
} // namespace GafferScene
#endif // GAFFERSCENE_SHADERASSIGNMENT_H
|
/*
* WARNING: do not edit!
* Generated by Makefile from include/openssl/opensslconf.h.in
*
* Copyright 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
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef OPENSSL_ALGORITHM_DEFINES
# error OPENSSL_ALGORITHM_DEFINES no longer supported
#endif
/*
* OpenSSL was configured with the following options:
*/
#ifndef OPENSSL_NO_CAMELLIA
# define OPENSSL_NO_CAMELLIA
#endif
#ifndef OPENSSL_NO_CAST
# define OPENSSL_NO_CAST
#endif
#ifndef OPENSSL_NO_COMP
# define OPENSSL_NO_COMP
#endif
#ifndef OPENSSL_NO_IDEA
# define OPENSSL_NO_IDEA
#endif
#ifndef OPENSSL_NO_MD2
# define OPENSSL_NO_MD2
#endif
#ifndef OPENSSL_NO_RC5
# define OPENSSL_NO_RC5
#endif
#ifndef OPENSSL_NO_WHIRLPOOL
# define OPENSSL_NO_WHIRLPOOL
#endif
#ifndef OPENSSL_THREADS
# define OPENSSL_THREADS
#endif
#ifndef OPENSSL_NO_AFALGENG
# define OPENSSL_NO_AFALGENG
#endif
#ifndef OPENSSL_NO_ASAN
# define OPENSSL_NO_ASAN
#endif
#ifndef OPENSSL_NO_ASM
# define OPENSSL_NO_ASM
#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
# define OPENSSL_NO_CRYPTO_MDEBUG
#endif
#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
#endif
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
#endif
#ifndef OPENSSL_NO_EGD
# define OPENSSL_NO_EGD
#endif
#ifndef OPENSSL_NO_ENGINE
# define OPENSSL_NO_ENGINE
#endif
#ifndef OPENSSL_NO_FUZZ_AFL
# define OPENSSL_NO_FUZZ_AFL
#endif
#ifndef OPENSSL_NO_FUZZ_LIBFUZZER
# define OPENSSL_NO_FUZZ_LIBFUZZER
#endif
#ifndef OPENSSL_NO_HEARTBEATS
# define OPENSSL_NO_HEARTBEATS
#endif
#ifndef OPENSSL_NO_HW
# define OPENSSL_NO_HW
#endif
#ifndef OPENSSL_NO_MSAN
# define OPENSSL_NO_MSAN
#endif
#ifndef OPENSSL_NO_SCTP
# define OPENSSL_NO_SCTP
#endif
#ifndef OPENSSL_NO_SSL_TRACE
# define OPENSSL_NO_SSL_TRACE
#endif
#ifndef OPENSSL_NO_SSL3
# define OPENSSL_NO_SSL3
#endif
#ifndef OPENSSL_NO_SSL3_METHOD
# define OPENSSL_NO_SSL3_METHOD
#endif
#ifndef OPENSSL_NO_UBSAN
# define OPENSSL_NO_UBSAN
#endif
#ifndef OPENSSL_NO_UNIT_TEST
# define OPENSSL_NO_UNIT_TEST
#endif
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
# define OPENSSL_NO_WEAK_SSL_CIPHERS
#endif
#ifndef OPENSSL_NO_AFALGENG
# define OPENSSL_NO_AFALGENG
#endif
/*
* Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
* don't like that. This will hopefully silence them.
*/
#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
/*
* Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
* declarations of functions deprecated in or before <version>. Otherwise, they
* still won't see them if the library has been built to disable deprecated
* functions.
*/
#if defined(OPENSSL_NO_DEPRECATED)
# define DECLARE_DEPRECATED(f)
#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
#else
# define DECLARE_DEPRECATED(f) f;
#endif
#ifndef OPENSSL_FILE
# ifdef OPENSSL_NO_FILENAMES
# define OPENSSL_FILE ""
# define OPENSSL_LINE 0
# else
# define OPENSSL_FILE __FILE__
# define OPENSSL_LINE __LINE__
# endif
#endif
#ifndef OPENSSL_MIN_API
# define OPENSSL_MIN_API 0
#endif
#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
# undef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT OPENSSL_MIN_API
#endif
#if OPENSSL_API_COMPAT < 0x10100000L
# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_1_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x10000000L
# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_1_0_0(f)
#endif
#if OPENSSL_API_COMPAT < 0x00908000L
# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
#else
# define DEPRECATEDIN_0_9_8(f)
#endif
/* Generate 80386 code? */
#undef I386_ONLY
#undef OPENSSL_UNISTD
#define OPENSSL_UNISTD <unistd.h>
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
/*
* The following are cipher-specific, but are part of the public API.
*/
#if !defined(OPENSSL_SYS_UEFI)
# define BN_LLONG
/* Only one for the following should be defined */
# undef SIXTY_FOUR_BIT_LONG
# undef SIXTY_FOUR_BIT
# define THIRTY_TWO_BIT
#endif
#define RC4_INT unsigned char
#ifdef __cplusplus
}
#endif
|
int qtype_indexer(const void *);
int qtype_iterator(char **label);
void qtype_reset(void);
|
//
// ApptentiveLogFileWriteTask.h
// Apptentive
//
// Created by Alex Lementuev on 2/22/18.
// Copyright © 2018 Apptentive, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ApptentiveDispatchTask.h"
NS_ASSUME_NONNULL_BEGIN
@interface ApptentiveLogFileWriteTask : ApptentiveDispatchTask
- (instancetype)initWithFile:(NSString *)file buffer:(NSMutableArray<NSString *> *)buffer;
@end
NS_ASSUME_NONNULL_END
|
/* This file is part of the YAZ toolkit.
* Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
/**
* \file cqlstrer.c
* \brief Implements CQL error code map to description string.
*/
#if HAVE_CONFIG_H
#include <config.h>
#endif
#include <yaz/cql.h>
/*
* The error-messages associated with these codes are taken from
* the SRW diagnostic specifications at
* http://www.loc.gov/standards/sru/diagnostics-list.html
*/
const char *cql_strerror(int code) {
static char buf[80];
switch (code) {
case 10: return "Illegal query";
case 11: return "Unsupported query type (XCQL vs CQL)";
case 12: return "Too many characters in query";
case 13: return "Unbalanced or illegal use of parentheses";
case 14: return "Unbalanced or illegal use of quotes";
case 15: return "Illegal or unsupported context set";
case 16: return "Illegal or unsupported index";
case 17: return "Illegal or unsupported combination of index and context set";
case 18: return "Illegal or unsupported combination of indexes";
case 19: return "Illegal or unsupported relation";
case 20: return "Illegal or unsupported relation modifier";
case 21: return "Illegal or unsupported combination of relation modifers";
case 22: return "Illegal or unsupported combination of relation and index";
case 23: return "Too many characters in term";
case 24: return "Illegal combination of relation and term";
case 25: return "Special characters not quoted in term";
case 26: return "Non special character escaped in term";
case 27: return "Empty term unsupported";
case 28: return "Masking character not supported";
case 29: return "Masked words too short";
case 30: return "Too many masking characters in term";
case 31: return "Anchoring character not supported";
case 32: return "Anchoring character in illegal or unsupported position";
case 33: return "Combination of proximity/adjacency and masking characters not supported";
case 34: return "Combination of proximity/adjacency and anchoring characters not supported";
case 35: return "Terms only exclusion (stop) words";
case 36: return "Term in invalid format for index or relation";
case 37: return "Illegal or unsupported boolean operator";
case 38: return "Too many boolean operators in query";
case 39: return "Proximity not supported";
case 40: return "Illegal or unsupported proximity relation";
case 41: return "Illegal or unsupported proximity distance";
case 42: return "Illegal or unsupported proximity unit";
case 43: return "Illegal or unsupported proximity ordering";
case 44: return "Illegal or unsupported combination of proximity modifiers";
case 45: return "Context set name (prefix) assigned to multiple identifiers";
default: break;
}
sprintf(buf, "Unknown CQL error #%d", code);
return buf;
}
/*
* Local variables:
* c-basic-offset: 4
* c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
|
/***********************************************************************************************************************
**
** Copyright (c) 2011, 2014 ETH Zurich
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
** following conditions are met:
**
** * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
** disclaimer.
** * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
** following disclaimer in the documentation and/or other materials provided with the distribution.
** * Neither the name of the ETH Zurich nor the names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
***********************************************************************************************************************/
#pragma once
#include "../modelbase_api.h"
#include "BinaryNode.h"
DECLARE_TYPED_LIST(MODELBASE_API, TestNodes, BinaryNodePersistenceUnit)
namespace TestNodes {
class MODELBASE_API BinaryNodePersistenceUnit: public Super<BinaryNode>
{
COMPOSITENODE_DECLARE_STANDARD_METHODS(BinaryNodePersistenceUnit)
public:
virtual bool isNewPersistenceUnit() const override;
};
}
|
/* Galois.h
* James S. Plank
Jerasure - A C/C++ Library for a Variety of Reed-Solomon and RAID-6 Erasure Coding Techniques
Revision 1.2A
May 24, 2011
James S. Plank
Department of Electrical Engineering and Computer Science
University of Tennessee
Knoxville, TN 37996
plank@cs.utk.edu
Copyright (c) 2011, James S. Plank
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
- Neither the name of the University of Tennessee nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _GALOIS_H
#define _GALOIS_H
#include <stdio.h>
#include <stdlib.h>
extern int galois_single_multiply(int a, int b, int w);
extern int galois_single_divide(int a, int b, int w);
extern int galois_log(int value, int w);
extern int galois_ilog(int value, int w);
extern int galois_create_log_tables(int w); /* Returns 0 on success, -1 on failure */
extern int galois_logtable_multiply(int x, int y, int w);
extern int galois_logtable_divide(int x, int y, int w);
extern int galois_create_mult_tables(int w); /* Returns 0 on success, -1 on failure */
extern int galois_multtable_multiply(int x, int y, int w);
extern int galois_multtable_divide(int x, int y, int w);
extern int galois_shift_multiply(int x, int y, int w);
extern int galois_shift_divide(int x, int y, int w);
extern int galois_create_split_w8_tables();
extern int galois_split_w8_multiply(int x, int y);
extern int galois_inverse(int x, int w);
extern int galois_shift_inverse(int y, int w);
extern int *galois_get_mult_table(int w);
extern int *galois_get_div_table(int w);
extern int *galois_get_log_table(int w);
extern int *galois_get_ilog_table(int w);
void galois_region_xor( char *r1, /* Region 1 */
char *r2, /* Region 2 */
char *r3, /* Sum region (r3 = r1 ^ r2) -- can be r1 or r2 */
int nbytes); /* Number of bytes in region */
/* These multiply regions in w=8, w=16 and w=32. They are much faster
than calling galois_single_multiply. The regions must be gdata word aligned. */
void galois_w08_region_multiply(char *region, /* Region to multiply */
int multby, /* Number to multiply by */
int nbytes, /* Number of bytes in region */
char *r2, /* If r2 != NULL, products go here.
Otherwise region is overwritten */
int add); /* If (r2 != NULL && add) the produce is XOR'd with r2 */
void galois_w16_region_multiply(char *region, /* Region to multiply */
int multby, /* Number to multiply by */
int nbytes, /* Number of bytes in region */
char *r2, /* If r2 != NULL, products go here.
Otherwise region is overwritten */
int add); /* If (r2 != NULL && add) the produce is XOR'd with r2 */
void galois_w32_region_multiply(char *region, /* Region to multiply */
int multby, /* Number to multiply by */
int nbytes, /* Number of bytes in region */
char *r2, /* If r2 != NULL, products go here.
Otherwise region is overwritten */
int add); /* If (r2 != NULL && add) the produce is XOR'd with r2 */
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.