text stringlengths 4 6.14k |
|---|
#pragma once
class TypeFind {
public:
static LRESULT Handler(NMHDR* hdr, int subItemFrom = 0, int subItemCnt = 1);
};
|
//
// ViewController.h
// 82-MapKit框架
//
// Created by yhp on 2017/8/3.
// Copyright © 2017年 YouHuaPei. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
#include "unit_tests.h"
///
Suite * check_cmdq_suite (void)
{
Suite *s = suite_create("greenev");
/* Core test case */
TCase *tc_core = tcase_create("cmdq");
tcase_add_test(tc_core, unittest_cmdq_01);
tcase_add_test(tc_core, unittest_cmdq_02);
tcase_add_test(tc_core, unittest_cmdq_03);
tcase_add_test(tc_core, unittest_cmdq_04);
suite_add_tcase(s, tc_core);
return s;
}
int main (void)
{
int number_failed;
Suite *s = check_cmdq_suite();
SRunner *sr = srunner_create(s);
srunner_run_all(sr, CK_VERBOSE);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
|
#include <stdio.h>
int main()
{
int counter = 0;
int is3 = 3;
int i = 0;
for(i = 0; i < 1000; i+=5){
if(is3 == 3){
is3 = 1;
continue;
}
counter += i;
is3++;
}
for(i = 0; i < 1000; i+=3){
counter += i;
}
printf("sum: %d\n", counter);
return 0;
}
|
#pragma once
#include "alien.h"
#include "enemy_bullet.h"
#include "player_missile.h"
#include "shield.h"
#include "spaceship.h"
#include <vector>
#include <string>
#include <istream>
class GameState
{
public:
GameState(std::istream &&mapFile);
void logState();
const std::vector<Alien>& aliens() const { return _aliens; }
const std::vector<EnemyBullet>& bullets() const { return _bullets; }
const std::vector<PlayerMissile>& missiles() const { return _missiles; }
const std::vector<Shield>& shields() const { return _shields; }
const std::vector<Spaceship>& spaceships() const { return _spaceships; }
private:
std::vector<Alien> _aliens;
std::vector<EnemyBullet> _bullets;
std::vector<PlayerMissile> _missiles;
std::vector<Shield> _shields;
std::vector<Spaceship> _spaceships;
int addEntity(int x, int y, char type);
};
|
#pragma once
#include <QLabel>
#include <QPixmap>
#include <QWidget>
class PixmapDisplay :
public QLabel
{
public:
PixmapDisplay(QWidget *parent);
public slots:
void onFrameAcquired(QPixmap pm);
void onFrameTimeReceived(quint64 t);
private:
QWidget *parent;
bool flowStarted = false;
};
|
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_DRIVERS_HMAC_H_
#define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_DRIVERS_HMAC_H_
#include <stddef.h>
#include <stdint.h>
#include "sw/device/silicon_creator/lib/error.h"
#ifdef __cplusplus
extern "C" {
#endif
#define HMAC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
enum {
/**
* Size of a SHA-256 digest in words.
*/
kHmacDigestNumWords = 8,
};
/**
* A typed representation of the HMAC digest.
*/
typedef struct hmac_digest {
uint32_t digest[kHmacDigestNumWords];
} hmac_digest_t;
/**
* Initializes the HMAC in SHA256 mode.
*
* This function resets the HMAC module to clear the digest register.
* It then configures the HMAC block in SHA256 mode with little endian
* data input and digest output.
*/
void hmac_sha256_init(void);
/**
* Sends `len` bytes from `data` to the SHA2-256 function.
*
* This function does not check for the size of the available HMAC
* FIFO. Since the this function is meant to run in blocking mode,
* polling for FIFO status is equivalent to stalling on FIFO write.
*
* @param data Buffer to copy data from.
* @param len size of the `data` buffer.
*/
void hmac_sha256_update(const void *data, size_t len);
/**
* Finalizes SHA256 operation and writes `digest` buffer.
*
* @param[out] digest Buffer to copy digest to.
*/
void hmac_sha256_final(hmac_digest_t *digest);
#ifdef __cplusplus
}
#endif
#endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_DRIVERS_HMAC_H_
|
/* $NetBSD: pcap-septel.h,v 1.1.1.4 2013/12/31 16:57:20 christos Exp $ */
/*
* pcap-septel.c: Packet capture interface for Intel Septel card
*
* The functionality of this code attempts to mimic that of pcap-linux as much
* as possible. This code is only needed when compiling in the Intel/Septel
* card code at the same time as another type of device.
*
* Authors: Gilbert HOYEK (gil_hoyek@hotmail.com), Elias M. KHOURY
* (+961 3 485343);
*
* @(#) Header: /tcpdump/master/libpcap/pcap-septel.h,v 1.2 2008-04-04 19:37:45 guy Exp
*/
pcap_t *septel_create(const char *device, char *ebuf, int *is_ours);
int septel_findalldevs(pcap_if_t **devlistp, char *errbuf);
|
/*
* Copyright 2020 Makani Technologies LLC
*
* 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 AVIONICS_FC_FIRMWARE_SELFTEST_H_
#define AVIONICS_FC_FIRMWARE_SELFTEST_H_
void SelfTest(void);
#endif // AVIONICS_FC_FIRMWARE_SELFTEST_H_
|
//
// AppDelegate.h
// MMPostcodeTextField
//
// Created by Cornelis van der Bent on 26/10/15.
// Copyright © 2015 meaning-matters. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow* window;
@end
|
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Licensed under the MIT license.
extern "C" const char* app_center_unity_crashes_error_report_incident_identifier(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_reporter_key(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_signal(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_exception_name(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_exception_reason(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_app_start_time(void* errorReport);
extern "C" const char* app_center_unity_crashes_error_report_app_error_time(void* errorReport);
extern "C" void* app_center_unity_crashes_error_report_device(void* errorReport);
extern "C" unsigned int app_center_unity_crashes_error_report_app_process_identifier(void* errorReport);
extern "C" bool app_center_unity_crashes_error_report_is_app_kill(void* errorReport);
|
//
// AppDelegate.h
// RAAGNavigationDrawer
//
// Created by Vikram Bisht on 8/22/15.
// Copyright (c) 2015 Anurag Bisht. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/*
* This file is part of the OpenKinect Project. http://www.openkinect.org
*
* Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
* for details.
*
* This code is licensed to you under the terms of the Apache License, version
* 2.0, or, at your option, the terms of the GNU General Public License,
* version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
* or the following URLs:
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.gnu.org/licenses/gpl-2.0.txt
*
* If you redistribute this file in source form, modified or unmodified, you
* may:
* 1) Leave this header intact and distribute it under the same terms,
* accompanying it with the APACHE20 and GPL20 files, or
* 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
* 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
* In all cases you must keep the copyright notice intact and include a copy
* of the CONTRIB file.
*
* Binary distributions must follow the binary distribution requirements of
* either License.
*/
#include "hiviewHeader.h"
int main(int argc, char **argv)
{
int res;
depth_mid = (uint8_t*)malloc(640*480*3);
depth_front = (uint8_t*)malloc(640*480*3);
printf("Kinect camera test\n");
int i;
for (i=0; i<2048; i++) {
float v = i/2048.0;
v = powf(v, 3)* 6;
t_gamma[i] = v*6*256;
}
g_argc = argc;
g_argv = argv;
if (freenect_init(&f_ctx, NULL) < 0) {
printf("freenect_init() failed\n");
return 1;
}
freenect_set_log_level(f_ctx, FREENECT_LOG_DEBUG);
freenect_select_subdevices(f_ctx, (freenect_device_flags)(FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA));
int nr_devices = freenect_num_devices (f_ctx);
printf ("Number of devices found: %d\n", nr_devices);
int user_device_number = 0;
if (argc > 1)
user_device_number = atoi(argv[1]);
if (nr_devices < 1) {
freenect_shutdown(f_ctx);
return 1;
}
if (freenect_open_device(f_ctx, &f_dev, user_device_number) < 0) {
printf("Could not open device\n");
freenect_shutdown(f_ctx);
return 1;
}
res = pthread_create(&freenect_thread, NULL, freenect_threadfunc, NULL);
if (res) {
printf("pthread_create failed\n");
freenect_shutdown(f_ctx);
return 1;
}
// OS X requires GLUT to run on the main thread
gl_threadfunc(NULL);
return 0;
}
|
//
// LoadingView_TypeOne.h
// CARFamily
//
// Created by imac on 2017/8/30.
// Copyright © 2017年 GuangZhouWeiControl. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LoadingView_TypeOne : UIView
@property (nonatomic , strong) UIColor *borderColor; //108 108 108
@property (nonatomic , strong) UIColor *txtColor; //108 108 108
@property (nonatomic , strong) UIColor *dotHighLightColor;//151 151 151
@property (nonatomic , strong) UIColor *dotNormalColor; //78 78 78
@property (nonatomic , strong) UIFont *txtFont;
@property (nonatomic , assign) CGFloat BorderWidth;
@property (nonatomic , assign) CGFloat BorderHeight;
@property (nonatomic , strong) NSString *txt;
- (instancetype)initWithView:(UIView *)superView;
- (instancetype)initWithWindow:(UIWindow *)win;
- (void)show:(BOOL)isShow;
- (void)hide:(BOOL)isHide;
@end
|
// Copyright 2019 Google LLC
//
// 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 FIREBASE_DATABASE_TESTS_DESKTOP_TEST_MOCK_CACHE_POLICY_H_
#define FIREBASE_DATABASE_TESTS_DESKTOP_TEST_MOCK_CACHE_POLICY_H_
#include <cstdint>
#include "database/src/desktop/core/cache_policy.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace firebase {
namespace database {
namespace internal {
class MockCachePolicy : public CachePolicy {
public:
~MockCachePolicy() override {}
MOCK_METHOD(bool, ShouldPrune,
(uint64_t current_size_bytes, uint64_t count_of_prunable_queries),
(const, override));
MOCK_METHOD(bool, ShouldCheckCacheSize,
(uint64_t server_updates_since_last_check), (const, override));
MOCK_METHOD(double, GetPercentOfQueriesToPruneAtOnce, (), (const, override));
MOCK_METHOD(uint64_t, GetMaxNumberOfQueriesToKeep, (), (const, override));
};
} // namespace internal
} // namespace database
} // namespace firebase
#endif // FIREBASE_DATABASE_TESTS_DESKTOP_TEST_MOCK_CACHE_POLICY_H_
|
/*
** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
#ifndef portesp_math_h
#define portesp_math_h
double __strtod(const char* str, char** endptr);
void __tiny_fload_to_string(char *buf, const char *fmt, float val);
#endif
|
//
// JMErrorView.h
//
// Copyright © 2016 Jumio Corporation All rights reserved.
//
#import <UIKit/UIKit.h>
#import <JumioCore/JMBaseView.h>
@class JMAlertView;
@class JMThemeableButton;
@protocol JMAlertViewDelegate <NSObject>
@optional
- (void)alertViewDidConfirm:(JMAlertView*)alertView;
- (void)alertViewDidCancel:(JMAlertView*)alertView;
@end
@interface JMAlertView : JMBaseView {
@protected
UIView *_animationView;
UIView *_contentView;
UIView *_containerView;
}
@property (nonatomic, weak) id<JMAlertViewDelegate> delegate;
@property (nonatomic, readonly) JMThemeableButton *confirmButton;
- (instancetype)initWithTitle:(NSString *)title
message:(NSString *)message
cancelButtonTitle:(NSString *)cancelButtonTitle
confirmButtonTitle:(NSString *)confirmButtonTitle;
- (instancetype)initWithMessage:(NSString *)message
cancelButtonTitle:(NSString *)cancelButtonTitle
confirmButtonTitle:(NSString *)confirmButtonTitle;
- (UILabel*)createTitleLabel;
- (UILabel*)createMessageLabel;
- (JMThemeableButton*)createCancelButton;
- (JMThemeableButton*)createConfirmButton;
- (NSArray*)createPortraitConstraints;
- (NSArray*)createLandscapeConstraints;
- (void)updateViewForOrientation:(UIInterfaceOrientation)interfaceOrientation;
- (void)showAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion;
- (void)hideAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion;
@end
|
//
// UITextField+Placeholder.h
// BSBDJ
//
// Created by Maskmale on 17/4/24.
// Copyright © 2017年 Maskmale. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITextField (Placeholder)
@property UIColor *placeholderColor;
-(void)setMBB_Placeholder:(NSString *)placeholder;
@end
|
/*
* Copyright © 2011 Michael Willekes
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
#import <Foundation/Foundation.h>
@class DatabaseConnection;
@class DatabaseOperations;
@interface DataClass : NSObject {
DatabaseConnection *connection;
DatabaseOperations *operations;
NSError *error;
}
@property (nonatomic, readonly) DatabaseConnection *connection;
@property (nonatomic, readonly) DatabaseOperations *operations;
@property (nonatomic, readonly) NSError *error;
- (id)initWithDatabase:(DatabaseConnection *)db;
@end
|
/*************************************************
* Public Constants
*************************************************/
// OCTAVE -1
#define NOTE_C_1 0
#define NOTE_D_b1 1
#define NOTE_D_1 2
#define NOTE_E_b1 3
#define NOTE_E_1 4
#define NOTE_F_1 5
#define NOTE_G_b1 6
#define NOTE_G_1 7
#define NOTE_A_b1 8
#define NOTE_A_1 9
#define NOTE_B_b1 10
#define NOTE_B_1 11
// OCTAVE 0
#define NOTE_C0 12
#define NOTE_Db0 13
#define NOTE_D0 14
#define NOTE_Eb0 15
#define NOTE_E0 16
#define NOTE_F0 17
#define NOTE_Gb0 18
#define NOTE_G0 19
#define NOTE_Ab0 20
#define NOTE_A0 21
#define NOTE_Bb0 22
#define NOTE_B0 23
// OCTAVE 1
#define NOTE_C1 24
#define NOTE_Db1 25
#define NOTE_D1 26
#define NOTE_Eb1 27
#define NOTE_E1 28
#define NOTE_F1 29
#define NOTE_Gb1 30
#define NOTE_G1 31
#define NOTE_Ab1 32
#define NOTE_A1 33
#define NOTE_Bb1 34
#define NOTE_B1 35
// OCTAVE 2
#define NOTE_C2 36
#define NOTE_Db2 37
#define NOTE_D2 38
#define NOTE_Eb2 39
#define NOTE_E2 40
#define NOTE_F2 41
#define NOTE_Gb2 42
#define NOTE_G2 43
#define NOTE_Ab2 44
#define NOTE_A2 45
#define NOTE_Bb2 46
#define NOTE_B2 47
// OCTAVE 3
#define NOTE_C3 48
#define NOTE_Db3 49
#define NOTE_D3 50
#define NOTE_Eb3 51
#define NOTE_E3 52
#define NOTE_F3 53
#define NOTE_Gb3 54
#define NOTE_G3 55
#define NOTE_Ab3 56
#define NOTE_A3 57
#define NOTE_Bb3 58
#define NOTE_B3 59
// OCTAVE 4
#define NOTE_C4 60
#define NOTE_Db4 61
#define NOTE_D4 62
#define NOTE_Eb4 63
#define NOTE_E4 64
#define NOTE_F4 65
#define NOTE_Gb4 66
#define NOTE_G4 67
#define NOTE_Ab4 68
#define NOTE_A4 69
#define NOTE_Bb4 70
#define NOTE_B4 71
// OCTAVE 5
#define NOTE_C5 72
#define NOTE_Db5 73
#define NOTE_D5 74
#define NOTE_Eb5 75
#define NOTE_E5 76
#define NOTE_F5 77
#define NOTE_Gb5 78
#define NOTE_G5 79
#define NOTE_Ab5 80
#define NOTE_A5 81
#define NOTE_Bb5 82
#define NOTE_B5 83
// OCTAVE 6
#define NOTE_C6 84
#define NOTE_Db6 85
#define NOTE_D6 86
#define NOTE_Eb6 87
#define NOTE_E6 88
#define NOTE_F6 89
#define NOTE_Gb6 90
#define NOTE_G6 91
#define NOTE_Ab6 92
#define NOTE_A6 93
#define NOTE_Bb6 94
#define NOTE_B6 95
// OCTAVE 7
#define NOTE_C7 96
#define NOTE_Db7 97
#define NOTE_D7 98
#define NOTE_Eb7 99
#define NOTE_E7 100
#define NOTE_F7 101
#define NOTE_Gb7 102
#define NOTE_G7 103
#define NOTE_Ab7 104
#define NOTE_A7 105
#define NOTE_Bb7 106
#define NOTE_B7 107
// OCTAVE 8
#define NOTE_C8 108
#define NOTE_Db8 109
#define NOTE_D8 110
#define NOTE_Eb8 111
#define NOTE_E8 112
#define NOTE_F8 113
#define NOTE_Gb8 114
#define NOTE_G8 115
#define NOTE_Ab8 116
#define NOTE_A8 117
#define NOTE_Bb8 118
#define NOTE_B8 119 |
// Copyright 2015 The Gemmlowp Authors. 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.
// map.h: a minimalist view-existing-buffer-as-a-matrix class,
// which is how gemmlowp interfaces with external matrix data.
#ifndef GEMMLOWP_PUBLIC_MAP_H_
#define GEMMLOWP_PUBLIC_MAP_H_
#include "../internal/common.h"
namespace gemmlowp {
// The two storage orders allowed to map buffers as matrices: ColMajor
// means column-major, RowMajor means row-major.
enum class MapOrder { ColMajor, RowMajor };
// A MatrixMap is a view of an existing buffer as a matrix. It does not own
// the buffer.
template <typename tScalar, MapOrder tOrder>
class MatrixMap {
public:
typedef tScalar Scalar;
static const MapOrder kOrder = tOrder;
protected:
Scalar* data_; // not owned.
int rows_, cols_, stride_;
public:
MatrixMap() : data_(nullptr), rows_(0), cols_(0), stride_(0) {}
MatrixMap(Scalar* data, int rows, int cols)
: data_(data),
rows_(rows),
cols_(cols),
stride_(kOrder == MapOrder::ColMajor ? rows : cols) {}
MatrixMap(Scalar* data, int rows, int cols, int stride)
: data_(data), rows_(rows), cols_(cols), stride_(stride) {}
MatrixMap(const MatrixMap& other)
: data_(other.data_),
rows_(other.rows_),
cols_(other.cols_),
stride_(other.stride_) {}
int rows() const { return rows_; }
int cols() const { return cols_; }
int stride() const { return stride_; }
int rows_stride() const { return kOrder == MapOrder::ColMajor ? 1 : stride_; }
int cols_stride() const { return kOrder == MapOrder::RowMajor ? 1 : stride_; }
Scalar* data() const { return data_; }
Scalar* data(int row, int col) const {
return data_ + row * rows_stride() + col * cols_stride();
}
Scalar& operator()(int row, int col) const { return *data(row, col); }
MatrixMap block(int start_row, int start_col, int block_rows,
int block_cols) const {
assert(start_row >= 0);
assert(start_row + block_rows <= rows_);
assert(start_col >= 0);
assert(start_col + block_cols <= cols_);
return MatrixMap(data(start_row, start_col), block_rows, block_cols,
stride_);
}
};
enum class VectorShape { Col, Row };
// A VectorMap is a view of an existing buffer as a vector. It does not own
// the buffer.
template <typename tScalar, VectorShape tShape>
class VectorMap {
public:
typedef tScalar Scalar;
static const VectorShape kShape = tShape;
protected:
Scalar* data_; // not owned.
int size_;
public:
VectorMap() : data_(nullptr), size_(0) {}
VectorMap(Scalar* data, int size) : data_(data), size_(size) {}
VectorMap(const VectorMap& other) : data_(other.data_), size_(other.size_) {}
int size() const { return size_; }
Scalar* data() const { return data_; }
Scalar* data(int index) const { return data_ + index; }
Scalar& operator()(int index) const { return *data(index); }
VectorMap block(int start, int len) const {
assert(start >= 0);
assert(start + len <= size_);
return VectorMap(data(start), len);
}
};
// A VectorDup is a (duplicated value) vector where all components are the same.
template <typename tScalar, VectorShape tShape>
class VectorDup {
public:
typedef tScalar Scalar;
static const VectorShape kShape = tShape;
protected:
Scalar data_;
int size_;
public:
VectorDup() : data_(0), size_(0) {}
VectorDup(Scalar data, int size) : data_(data), size_(size) {}
VectorDup(const VectorDup& other) : data_(other.data_), size_(other.size_) {}
int size() const { return size_; }
Scalar& operator()(int) const { return data_; }
VectorDup block(int start, int len) const {
assert(start >= 0);
assert(start + len <= size_);
return VectorDup(data_, len);
}
};
} // namespace gemmlowp
#endif // GEMMLOWP_PUBLIC_MAP_H_
|
/* Copyright 2020 The TensorFlow Authors. 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 TENSORFLOW_LITE_MICRO_BENCHMARKS_MICRO_BENCHMARK_H_
#define TENSORFLOW_LITE_MICRO_BENCHMARKS_MICRO_BENCHMARK_H_
#include <climits>
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_op_resolver.h"
#include "tensorflow/lite/micro/micro_profiler.h"
#include "tensorflow/lite/micro/micro_time.h"
#include "tensorflow/lite/micro/recording_micro_interpreter.h"
namespace tflite {
template <typename inputT>
class MicroBenchmarkRunner {
public:
// The lifetimes of model, op_resolver, tensor_arena, profiler must exceed
// that of the created MicroBenchmarkRunner object.
MicroBenchmarkRunner(const uint8_t* model,
const tflite::MicroOpResolver* op_resolver,
uint8_t* tensor_arena, int tensor_arena_size,
MicroProfiler* profiler)
: interpreter_(GetModel(model), *op_resolver, tensor_arena,
tensor_arena_size, GetMicroErrorReporter(), profiler) {
interpreter_.AllocateTensors();
}
void RunSingleIteration() {
// Run the model on this input and make sure it succeeds.
TfLiteStatus invoke_status = interpreter_.Invoke();
if (invoke_status == kTfLiteError) {
MicroPrintf("Invoke failed.");
}
}
void SetRandomInput(const int random_seed) {
// The pseudo-random number generator is initialized to a constant seed
std::srand(random_seed);
TfLiteTensor* input = interpreter_.input(0);
// Pre-populate input tensor with random values.
int input_length = input->bytes / sizeof(inputT);
inputT* input_values = tflite::GetTensorData<inputT>(input);
for (int i = 0; i < input_length; i++) {
// Pre-populate input tensor with a random value based on a constant seed.
input_values[i] = static_cast<inputT>(
std::rand() % (std::numeric_limits<inputT>::max() -
std::numeric_limits<inputT>::min() + 1));
}
}
void SetInput(const inputT* custom_input) {
TfLiteTensor* input = interpreter_.input(0);
inputT* input_buffer = tflite::GetTensorData<inputT>(input);
int input_length = input->bytes / sizeof(inputT);
for (int i = 0; i < input_length; i++) {
input_buffer[i] = custom_input[i];
}
}
void PrintAllocations() const {
interpreter_.GetMicroAllocator().PrintAllocations();
}
private:
tflite::RecordingMicroInterpreter interpreter_;
};
} // namespace tflite
#endif // TENSORFLOW_LITE_MICRO_BENCHMARKS_MICRO_BENCHMARK_H_
|
/*
* Copyright (c) 2016, https://github.com/nebula-im
* 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 SEQSVR_BASE_CONFIG_H_
#define SEQSVR_BASE_CONFIG_H_
// #include "nebula/base/json/json.h"
#include <string>
#include <list>
#include <folly/DynamicConverter.h>
#include "nebula/net/base/ip_addr_info.h"
#include "nebula/base/configurable.h"
#include "proto/gen-cpp2/seqsvr_types.h"
// #include "nebula/base/string_builder.h"
/*******************************************************************
// sets.json配置文件格式
[
{
"allocsvrs" : [
{
"addr" : "127.0.0.1",
"port" : 10000
},
{
"addr" : "127.0.0.1",
"port" : 10001
},
{
"addr" : "127.0.0.1",
"port" : 10002
}
],
"id" : 0,
"size" : 1048576,
"storesvrs" : [
{
"addr" : "127.0.0.1",
"port" : 11000
},
{
"addr" : "127.0.0.1",
"port" : 11001
},
{
"addr" : "127.0.0.1",
"port" : 11002
}
]
},
{
"allocsvrs" : [
{
"addr" : "127.0.0.1",
"port" : 10003
},
{
"addr" : "127.0.0.1",
"port" : 10004
},
{
"addr" : "127.0.0.1",
"port" : 10005
}
],
"id" : 1048576,
"size" : 1048576,
"storesvrs" : [
{
"addr" : "127.0.0.1",
"port" : 11003
},
{
"addr" : "127.0.0.1",
"port" : 11004
},
{
"addr" : "127.0.0.1",
"port" : 11005
}
]
}
]
*/
// 配置文件
struct SetConfig {
uint32_t id;
uint32_t size;
IpAddrInfoList allocsvrs;
IpAddrInfoList storesvrs;
};
// TODO(@benqi): 使用反射Marsh/Unmarshal
namespace folly {
template <> struct DynamicConverter<SetConfig> {
static SetConfig convert(const dynamic& d) {
SetConfig set;
set.id = convertTo<uint32_t>(d["id"]);
set.size = convertTo<uint32_t>(d["size"]);
set.allocsvrs = convertTo<IpAddrInfoList>(d["allocsvrs"]);
set.storesvrs = convertTo<IpAddrInfoList>(d["storesvrs"]);
return set;
}
};
template <> struct DynamicConstructor<SetConfig, void> {
static dynamic construct(const SetConfig& x) {
dynamic d = dynamic::object;
d.insert("id", x.id);
d.insert("size", x.size);
d.insert("allocsvrs", toDynamic(x.allocsvrs));
d.insert("storesvrs", toDynamic(x.storesvrs));
return d;
}
};
}
// struct SetsConfig {
typedef std::list<SetConfig> SetsConfig;
/////////////////////////////////////////////////////////////////////
// DEBUG_TEST
SetsConfig MakeTestSetsConfig(int set_size, int set_range_size=1<<20);
seqsvr::Router MakeTestRouter(const SetsConfig& sets);
// 测试用
//
// seqsvr集群配置信息
struct SeqSvrConfig : public nebula::Configurable {
SeqSvrConfig() {
// 默认两个set集
// name = "cluster_seqsvr_test";
}
bool SetConf(const std::string& conf_name, const folly::dynamic& conf) override;
// SetList sets;
SetsConfig sets;
};
//struct AllocEntry {
// int set_id;
// int allocsvr_id;
// std::string host;
// uint16_t port;
// int section_count; // section数
//};
//
//struct RouterTable {
// std::vector<AllocEntry> alloc_nodes_;
//};
#endif
|
//
// AttachmentPushService.h
// mage-ios-sdk
//
//
@import AFNetworking;
extern NSString * const kAttachmentBackgroundSessionIdentifier;
@interface AttachmentPushService : AFHTTPSessionManager
@property (copy) void (^backgroundSessionCompletionHandler)(void);
+ (instancetype) singleton;
- (void) start;
- (void) stop;
@end
|
// RUN: %clam -O0 --lower-unsigned-icmp --crab-inter --crab-dom=int --crab-track=mem --crab-heap-analysis=cs-sea-dsa --crab-check=assert --crab-sanity-checks "%s" 2>&1 | OutputCheck %s
// CHECK: ^1 Number of total safe checks$
// XFAIL: *
/** Same as test-arr-4.c but with --crab-track=mem **/
extern int nd ();
extern void __CRAB_assert(int);
int x = 5;
int y = 3;
void foo ()
{
x++;
}
void bar ()
{
y++;
}
int a[10];
int main ()
{
int i;
foo ();
for (i=0;i<10;i++)
{
if (nd ())
a[i] =y;
else
a[i] =x;
}
bar ();
int res = a[i-1];
__CRAB_assert(res >= 0 && res <= 6);
return res;
}
|
//
// UIButton+CLExtensions.h
// CLMediaPicker
//
// Copyright [2015] [Cromulent Labs, 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 <UIKit/UIKit.h>
@interface UIButton (CLExtensions)
@property(nonatomic, strong) NSIndexPath *indexPath;
@property(nonatomic, assign) UIEdgeInsets hitTestEdgeInsets;
@end
|
/*
* Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 ROUTER_INPUTQUEUED_OUTPUTQUEUE_H_
#define ROUTER_INPUTQUEUED_OUTPUTQUEUE_H_
#include <prim/prim.h>
#include <string>
#include <queue>
#include <vector>
#include "event/Component.h"
#include "types/Flit.h"
#include "types/FlitReceiver.h"
namespace InputQueued {
class Router;
class OutputQueue : public Component, public FlitReceiver {
public:
OutputQueue(const std::string& _name, const Component* _parent,
Router* _router, u32 _depth, u32 _port);
~OutputQueue();
// called by main router crossbar
void receiveFlit(u32 _port, Flit* _flit) override;
// event system (Component)
void processEvent(void* _event, s32 _type) override;
private:
void processPipeline();
// attributes
const u32 depth_;
const u32 port_;
// external components
Router* router_;
// single flit per clock input limit assurance
u64 lastReceivedTime_;
// state machine to represent a generic pipeline stage
enum class ePipelineFsm { kEmpty, kWaitingToRequest, kWaitingForResponse,
kReadyToAdvance };
// remembers if an event is set to process the pipeline
u64 eventTime_;
// buffer
std::queue<Flit*> buffer_; // insertion time & inserted flit
};
} // namespace InputQueued
#endif // ROUTER_INPUTQUEUED_OUTPUTQUEUE_H_
|
/** @file
*
* A brief file description
*
* @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 <vector>
#include "QUICTypes.h"
#include "QUICFrameHandler.h"
#include "QUICFrameGenerator.h"
class QUICPathValidator : public QUICFrameHandler, public QUICFrameGenerator
{
public:
QUICPathValidator() {}
bool is_validating();
bool is_validated();
void validate();
// QUICFrameHandler
std::vector<QUICFrameType> interests() override;
QUICConnectionErrorUPtr handle_frame(QUICEncryptionLevel level, const QUICFrame &frame) override;
// QUICFrameGeneratro
bool will_generate_frame(QUICEncryptionLevel level, ink_hrtime timestamp) override;
QUICFrame *generate_frame(uint8_t *buf, QUICEncryptionLevel level, uint64_t connection_credit, uint16_t maximum_frame_size,
ink_hrtime timestamp) override;
private:
enum class ValidationState : int {
NOT_VALIDATED,
VALIDATING,
VALIDATED,
};
ValidationState _state = ValidationState::NOT_VALIDATED;
int _has_outgoing_challenge = 0;
bool _has_outgoing_response = false;
ink_hrtime _last_sent_at = 0;
uint8_t _incoming_challenge[QUICPathChallengeFrame::DATA_LEN];
uint8_t _outgoing_challenge[QUICPathChallengeFrame::DATA_LEN * 3];
void _generate_challenge();
void _generate_response(const QUICPathChallengeFrame &frame);
QUICConnectionErrorUPtr _validate_response(const QUICPathResponseFrame &frame);
};
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_index_writer.h"
#include <vespa/searchcore/proton/common/feeddebugger.h>
namespace proton {
class IndexWriter : public IIndexWriter,
private FeedDebugger {
private:
IIndexManager::SP _mgr;
bool ignoreOperation(search::SerialNum serialNum) const;
public:
IndexWriter(const IIndexManager::SP &mgr);
~IndexWriter() override;
const IIndexManager::SP & getIndexManager() const override { return _mgr; }
void put(search::SerialNum serialNum, const document::Document &doc, const search::DocumentIdT lid, OnWriteDoneType on_write_done) override;
void removeDocs(search::SerialNum serialNum, LidVector lids) override;
void commit(search::SerialNum serialNum, OnWriteDoneType onWriteDone) override;
void heartBeat(search::SerialNum serialNum) override;
void compactLidSpace(search::SerialNum serialNum, const search::DocumentIdT lid) override;
};
} // namespace proton
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_OAuth1_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_OAuth1_ExampleVersionString[];
|
/*
* Copyright 2021 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FLATBUFFERS_TABLE_H_
#define FLATBUFFERS_TABLE_H_
#include "third_party/flatbuffers/include/flatbuffers/base.h"
#include "third_party/flatbuffers/include/flatbuffers/verifier.h"
namespace flatbuffers {
// "tables" use an offset table (possibly shared) that allows fields to be
// omitted and added at will, but uses an extra indirection to read.
class Table {
public:
const uint8_t *GetVTable() const {
return data_ - ReadScalar<soffset_t>(data_);
}
// This gets the field offset for any of the functions below it, or 0
// if the field was not present.
voffset_t GetOptionalFieldOffset(voffset_t field) const {
// The vtable offset is always at the start.
auto vtable = GetVTable();
// The first element is the size of the vtable (fields + type id + itself).
auto vtsize = ReadScalar<voffset_t>(vtable);
// If the field we're accessing is outside the vtable, we're reading older
// data, so it's the same as if the offset was 0 (not present).
return field < vtsize ? ReadScalar<voffset_t>(vtable + field) : 0;
}
template<typename T> T GetField(voffset_t field, T defaultval) const {
auto field_offset = GetOptionalFieldOffset(field);
return field_offset ? ReadScalar<T>(data_ + field_offset) : defaultval;
}
template<typename P> P GetPointer(voffset_t field) {
auto field_offset = GetOptionalFieldOffset(field);
auto p = data_ + field_offset;
return field_offset ? reinterpret_cast<P>(p + ReadScalar<uoffset_t>(p))
: nullptr;
}
template<typename P> P GetPointer(voffset_t field) const {
return const_cast<Table *>(this)->GetPointer<P>(field);
}
template<typename P> P GetStruct(voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
auto p = const_cast<uint8_t *>(data_ + field_offset);
return field_offset ? reinterpret_cast<P>(p) : nullptr;
}
template<typename Raw, typename Face>
flatbuffers::Optional<Face> GetOptional(voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
auto p = data_ + field_offset;
return field_offset ? Optional<Face>(static_cast<Face>(ReadScalar<Raw>(p)))
: Optional<Face>();
}
template<typename T> bool SetField(voffset_t field, T val, T def) {
auto field_offset = GetOptionalFieldOffset(field);
if (!field_offset) return IsTheSameAs(val, def);
WriteScalar(data_ + field_offset, val);
return true;
}
template<typename T> bool SetField(voffset_t field, T val) {
auto field_offset = GetOptionalFieldOffset(field);
if (!field_offset) return false;
WriteScalar(data_ + field_offset, val);
return true;
}
bool SetPointer(voffset_t field, const uint8_t *val) {
auto field_offset = GetOptionalFieldOffset(field);
if (!field_offset) return false;
WriteScalar(data_ + field_offset,
static_cast<uoffset_t>(val - (data_ + field_offset)));
return true;
}
uint8_t *GetAddressOf(voffset_t field) {
auto field_offset = GetOptionalFieldOffset(field);
return field_offset ? data_ + field_offset : nullptr;
}
const uint8_t *GetAddressOf(voffset_t field) const {
return const_cast<Table *>(this)->GetAddressOf(field);
}
bool CheckField(voffset_t field) const {
return GetOptionalFieldOffset(field) != 0;
}
// Verify the vtable of this table.
// Call this once per table, followed by VerifyField once per field.
bool VerifyTableStart(Verifier &verifier) const {
return verifier.VerifyTableStart(data_);
}
// Verify a particular field.
template<typename T>
bool VerifyField(const Verifier &verifier, voffset_t field) const {
// Calling GetOptionalFieldOffset should be safe now thanks to
// VerifyTable().
auto field_offset = GetOptionalFieldOffset(field);
// Check the actual field.
return !field_offset || verifier.Verify<T>(data_, field_offset);
}
// VerifyField for required fields.
template<typename T>
bool VerifyFieldRequired(const Verifier &verifier, voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
return verifier.Check(field_offset != 0) &&
verifier.Verify<T>(data_, field_offset);
}
// Versions for offsets.
bool VerifyOffset(const Verifier &verifier, voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
return !field_offset || verifier.VerifyOffset(data_, field_offset);
}
bool VerifyOffsetRequired(const Verifier &verifier, voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
return verifier.Check(field_offset != 0) &&
verifier.VerifyOffset(data_, field_offset);
}
private:
// private constructor & copy constructor: you obtain instances of this
// class by pointing to existing data only
Table();
Table(const Table &other);
Table &operator=(const Table &);
uint8_t data_[1];
};
// This specialization allows avoiding warnings like:
// MSVC C4800: type: forcing value to bool 'true' or 'false'.
template<>
inline flatbuffers::Optional<bool> Table::GetOptional<uint8_t, bool>(
voffset_t field) const {
auto field_offset = GetOptionalFieldOffset(field);
auto p = data_ + field_offset;
return field_offset ? Optional<bool>(ReadScalar<uint8_t>(p) != 0)
: Optional<bool>();
}
} // namespace flatbuffers
#endif // FLATBUFFERS_TABLE_H_ |
/*############################################################################
# Copyright 2017-2019 Intel Corporation
#
# 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.
############################################################################*/
/// TPM context implementation.
/*! \file */
#include <stddef.h>
#include "common/epid2params.h"
#include "epid/member/api.h"
#include "epid/member/split/tpm2/builtin/state.h"
#include "epid/member/split/tpm2/context.h"
#include "epid/member/split/tpm2/flushcontext.h"
#include "ippmath/finitefield.h"
#include "ippmath/memory.h"
/// Handle Intel(R) EPID Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
if (kEpidNoErr != (ret)) { \
break; \
}
EpidStatus Tpm2CreateContext(MemberParams const* params,
Epid2Params_ const* epid2_params,
BitSupplier* rnd_func, void** rnd_param,
Tpm2Ctx** ctx) {
Tpm2Ctx* tpm_ctx = NULL;
EpidStatus sts = kEpidNoErr;
if (!params || !epid2_params || !rnd_func || !rnd_param || !ctx) {
return kEpidBadArgErr;
}
tpm_ctx = SAFE_ALLOC(sizeof(Tpm2Ctx));
if (!tpm_ctx) {
return kEpidMemAllocErr;
}
do {
int i;
FiniteField* Fp = epid2_params->Fp;
sts = NewFfElement(Fp, &tpm_ctx->seed);
BREAK_ON_EPID_ERROR(sts);
if (params->f) {
// note: params->f == seed for built-in tpm implementation
sts = ReadFfElement(Fp, params->f, sizeof(*params->f), tpm_ctx->seed);
BREAK_ON_EPID_ERROR(sts);
} else {
// select random seed
const BigNumStr kOne = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
sts = FfGetRandom(Fp, &kOne, params->rnd_func, params->rnd_param,
tpm_ctx->seed);
BREAK_ON_EPID_ERROR(sts);
}
tpm_ctx->epid2_params = epid2_params;
tpm_ctx->rnd_func = params->rnd_func;
tpm_ctx->rnd_param = params->rnd_param;
tpm_ctx->keys = NULL;
tpm_ctx->max_keys = 0;
*rnd_func = params->rnd_func;
*rnd_param = params->rnd_param;
for (i = 0; i < MAX_NV_NUMBER; ++i) {
tpm_ctx->nv[i].nv_index = 0;
tpm_ctx->nv[i].data = NULL;
tpm_ctx->nv[i].data_size = 0;
}
EpidZeroMemory(tpm_ctx->commit_data, sizeof(tpm_ctx->commit_data));
*ctx = tpm_ctx;
sts = kEpidNoErr;
} while (0);
if (kEpidNoErr != sts) {
Tpm2DeleteContext(&tpm_ctx);
*ctx = NULL;
}
return sts;
}
void Tpm2DeleteContext(Tpm2Ctx** ctx) {
if (ctx && *ctx) {
size_t i;
(*ctx)->rnd_param = NULL;
for (i = 0; i < (*ctx)->max_keys; ++i) {
Tpm2FlushContext(*ctx, &(*ctx)->keys[i]);
(*ctx)->keys[i] = NULL;
}
SAFE_FREE((*ctx)->keys);
(*ctx)->max_keys = 0;
DeleteFfElement(&(*ctx)->seed);
for (i = 0; i < MAX_COMMIT_COUNT; ++i) {
DeleteFfElement(&(*ctx)->commit_data[i]);
}
for (i = 0; i < MAX_NV_NUMBER; ++i) {
(*ctx)->nv->nv_index = 0;
SAFE_FREE((*ctx)->nv->data);
(*ctx)->nv->data_size = 0;
}
SAFE_FREE(*ctx);
}
}
|
/*! @file AppDelegate.h
@brief GTMAppAuth SDK iOS Example
@copyright
Copyright 2016 Google Inc.
@copydetails
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>
@protocol OIDExternalUserAgentSession;
/*! @brief The example application's delegate.
*/
@interface AppDelegate : UIResponder <UIApplicationDelegate>
/*! @brief The authorization flow session which receives the return URL from
\SFSafariViewController.
@discussion We need to store this in the app delegate as it's that delegate which receives the
incoming URL on UIApplicationDelegate.application:openURL:options:. This property will be
nil, except when an authorization flow is in progress.
*/
@property(nonatomic, strong, nullable) id<OIDExternalUserAgentSession> currentAuthorizationFlow;
@end
|
/* Copyright (c) 2022 PaddlePaddle Authors. 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. */
#pragma once
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/infermeta/unary.h"
#include "paddle/phi/kernels/empty_kernel.h"
namespace phi {
template <typename Context>
void TransferLayoutKernel(const Context& dev_ctx,
const DenseTensor& x,
DataLayout dst_layout,
DenseTensor* out);
template <typename Context>
DenseTensor TransferLayout(const Context& dev_ctx,
const DenseTensor& x,
DataLayout dst_layout) {
phi::DenseTensor dense_out =
phi::Empty(dev_ctx, {x.dtype(), x.dims(), dst_layout});
TransferLayoutKernel<Context>(dev_ctx, x, dst_layout, &dense_out);
return dense_out;
}
} // namespace phi
|
//
// MMSierraTabStyle.h
// --------------------
//
// Based on MMYosemiteTabStyle.h by Ajin Man Tuladhar
// Created by Ajin Isaiah Carew on 04/16/2017
// Copyright 2017 Isaiah Carew. All rights reserved.
//
#if __has_feature(modules)
@import Cocoa;
#else
#import <Cocoa/Cocoa.h>
#endif
#import "MMTabStyle.h"
NS_ASSUME_NONNULL_BEGIN
@interface MMSierraTabStyle : NSObject <MMTabStyle>
@property (assign) CGFloat leftMarginForTabBarView;
@property (assign) BOOL hasBaseline;
@property (retain) NSColor *selectedTabColor;
@property (retain) NSColor *unselectedTabColor;
@property (assign) BOOL needsResizeTabsToFitTotalWidth;
@end
NS_ASSUME_NONNULL_END
|
//
// ZJShopClassCell1.h
// WifeButler
//
// Created by .... on 16/5/29.
// Copyright © 2016年 zjtd. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ZJShopClassCell1 : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@end
|
#ifndef B_H_INCLUDED
#define B_H_INCLUDED
namespace B{
void f(char);
void f(int);
};
#endif // B_H_INCLUDED
|
/*
* 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/servicecatalog/ServiceCatalog_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace ServiceCatalog
{
namespace Model
{
/**
* <p>The error code and description resulting from an operation.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/RecordError">AWS
* API Reference</a></p>
*/
class AWS_SERVICECATALOG_API RecordError
{
public:
RecordError();
RecordError(Aws::Utils::Json::JsonView jsonValue);
RecordError& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The numeric value of the error.</p>
*/
inline const Aws::String& GetCode() const{ return m_code; }
/**
* <p>The numeric value of the error.</p>
*/
inline void SetCode(const Aws::String& value) { m_codeHasBeenSet = true; m_code = value; }
/**
* <p>The numeric value of the error.</p>
*/
inline void SetCode(Aws::String&& value) { m_codeHasBeenSet = true; m_code = std::move(value); }
/**
* <p>The numeric value of the error.</p>
*/
inline void SetCode(const char* value) { m_codeHasBeenSet = true; m_code.assign(value); }
/**
* <p>The numeric value of the error.</p>
*/
inline RecordError& WithCode(const Aws::String& value) { SetCode(value); return *this;}
/**
* <p>The numeric value of the error.</p>
*/
inline RecordError& WithCode(Aws::String&& value) { SetCode(std::move(value)); return *this;}
/**
* <p>The numeric value of the error.</p>
*/
inline RecordError& WithCode(const char* value) { SetCode(value); return *this;}
/**
* <p>The description of the error.</p>
*/
inline const Aws::String& GetDescription() const{ return m_description; }
/**
* <p>The description of the error.</p>
*/
inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }
/**
* <p>The description of the error.</p>
*/
inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); }
/**
* <p>The description of the error.</p>
*/
inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }
/**
* <p>The description of the error.</p>
*/
inline RecordError& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}
/**
* <p>The description of the error.</p>
*/
inline RecordError& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;}
/**
* <p>The description of the error.</p>
*/
inline RecordError& WithDescription(const char* value) { SetDescription(value); return *this;}
private:
Aws::String m_code;
bool m_codeHasBeenSet;
Aws::String m_description;
bool m_descriptionHasBeenSet;
};
} // namespace Model
} // namespace ServiceCatalog
} // namespace Aws
|
//
// ViewController_C.h
// TableBarView
//
// Created by runo on 17/7/25.
// Copyright © 2017年 com.runo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController_C : UIViewController
@end
|
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice including the dates of first publication and
* either this permission notice or a reference to
* http://oss.sgi.com/projects/FreeB/
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*
* OpenGL ES CM 1.0 port of GLU by Mike Gorchak <mike@malva.ua>
*/
#ifndef __GLUES_REGISTRY_H__
#define __GLUES_REGISTRY_H__
#if defined(__USE_SDL_GLES__)
#include <SDL/SDL_opengles.h>
#ifndef GLAPI
#define GLAPI GL_API
#endif
#elif defined (__QNXNTO__)
#include <GLES/gl.h>
#elif defined(_WIN32) && (defined(_M_IX86) || defined(_M_X64))
/* mainly for PowerVR OpenGL ES 1.x win32 emulator */
#include <GLES\gl.h>
#undef APIENTRY
#define APIENTRY
#if defined(GLUES_EXPORTS)
#define GLAPI __declspec(dllexport)
#else
#define GLAPI __declspec(dllimport)
#endif
#else
#error "Platform is unsupported"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* ErrorCode */
#define GLU_INVALID_ENUM 100900
#define GLU_INVALID_VALUE 100901
#define GLU_OUT_OF_MEMORY 100902
#define GLU_INCOMPATIBLE_GL_VERSION 100903
#define GLU_INVALID_OPERATION 100904
/* TessError */
#define GLU_TESS_ERROR1 100151
#define GLU_TESS_ERROR2 100152
#define GLU_TESS_ERROR3 100153
#define GLU_TESS_ERROR4 100154
#define GLU_TESS_ERROR5 100155
#define GLU_TESS_ERROR6 100156
#define GLU_TESS_ERROR7 100157
#define GLU_TESS_ERROR8 100158
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
#define GLU_TESS_MISSING_END_POLYGON 100153
#define GLU_TESS_MISSING_END_CONTOUR 100154
#define GLU_TESS_COORD_TOO_LARGE 100155
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
/* NurbsError */
#define GLU_NURBS_ERROR1 100251
#define GLU_NURBS_ERROR2 100252
#define GLU_NURBS_ERROR3 100253
#define GLU_NURBS_ERROR4 100254
#define GLU_NURBS_ERROR5 100255
#define GLU_NURBS_ERROR6 100256
#define GLU_NURBS_ERROR7 100257
#define GLU_NURBS_ERROR8 100258
#define GLU_NURBS_ERROR9 100259
#define GLU_NURBS_ERROR10 100260
#define GLU_NURBS_ERROR11 100261
#define GLU_NURBS_ERROR12 100262
#define GLU_NURBS_ERROR13 100263
#define GLU_NURBS_ERROR14 100264
#define GLU_NURBS_ERROR15 100265
#define GLU_NURBS_ERROR16 100266
#define GLU_NURBS_ERROR17 100267
#define GLU_NURBS_ERROR18 100268
#define GLU_NURBS_ERROR19 100269
#define GLU_NURBS_ERROR20 100270
#define GLU_NURBS_ERROR21 100271
#define GLU_NURBS_ERROR22 100272
#define GLU_NURBS_ERROR23 100273
#define GLU_NURBS_ERROR24 100274
#define GLU_NURBS_ERROR25 100275
#define GLU_NURBS_ERROR26 100276
#define GLU_NURBS_ERROR27 100277
#define GLU_NURBS_ERROR28 100278
#define GLU_NURBS_ERROR29 100279
#define GLU_NURBS_ERROR30 100280
#define GLU_NURBS_ERROR31 100281
#define GLU_NURBS_ERROR32 100282
#define GLU_NURBS_ERROR33 100283
#define GLU_NURBS_ERROR34 100284
#define GLU_NURBS_ERROR35 100285
#define GLU_NURBS_ERROR36 100286
#define GLU_NURBS_ERROR37 100287
GLAPI const GLubyte* APIENTRY gluErrorString(GLenum errorCode);
#ifdef __cplusplus
}
#endif
#endif /* __GLUES_REGISTRY_H__ */
|
//
// JSMessageInputView.h
//
// Created by Jesse Squires on 2/12/13.
// Copyright (c) 2013 Hexed Bits. All rights reserved.
//
// http://www.hexedbits.com
//
//
// Largely based on work by Sam Soffes
// https://github.com/soffes
//
// SSMessagesViewController
// https://github.com/soffes/ssmessagesviewcontroller
//
//
// The MIT License
// Copyright (c) 2013 Jesse Squires
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#import <UIKit/UIKit.h>
//#import "JSMessageTextView.h"
#import <HPGrowingTextView.h>
typedef enum
{
JSInputBarStyleDefault,
JSInputBarStyleFlat
} JSInputBarStyle;
@protocol JSMessageInputViewDelegate <NSObject>
- (void)viewheightChanged:(float)height;
- (void)textViewEnterSend;
- (void)textViewChanged;
@end
@interface JSMessageInputView : UIImageView<HPGrowingTextViewDelegate>
@property (strong) HPGrowingTextView *textView;
@property (strong) UIButton *sendButton;
@property (strong) UIButton *showUtilitysbutton;
@property (strong) UIButton *voiceButton;
@property (strong) UIImageView *recordButton;
@property (strong) UIButton *emotionbutton;
@property (assign) id<JSMessageInputViewDelegate> delegate;
@property(strong)UILabel *buttonTitle;
#pragma mark - Initialization
- (id)initWithFrame:(CGRect)frame delegate:(id<JSMessageInputViewDelegate>)delegate;
#pragma mark - Message input view
- (void)adjustTextViewHeightBy:(CGFloat)changeInHeight;
+ (CGFloat)textViewLineHeight;
+ (CGFloat)maxLines;
+ (CGFloat)maxHeight;
-(void)setDefaultHeight;
+ (JSInputBarStyle)inputBarStyle;
- (void)willBeginRecord;
- (void)willBeginInput;;
@end |
//
// CIAPIGetActiveStopLimitOrderRequest.h
// CIAPI
//
// Copyright 2011 Adam Wright/CityIndex. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CIAPIObjectRequest.h"
// <p>Queries for a active stop limit order with a specified order id. It will r
// eturn a null value if the order doesn't exist, or is not an active stop limit
// order.<p> <p>This uri is intended to be used to support a grid in a UI. One
// usage pattern is to subscribe to streaming orders, call <a onclick="dojo.hash
// ('#service.ListActiveStopLimitOrders'); return false;" class="json-link" href
// ="#">ListActiveStopLimitOrders</a> for the initial data to display in the gri
// d, and call this uri when you get updates on the order stream to get the upda
// ted data in this format.</p> <p>For a more comprehensive order response, see
// <a onclick="dojo.hash('#service.GetOrder'); return false;" class="json-link"
// href="#">GetOrder</a><p>
@interface CIAPIGetActiveStopLimitOrderRequest : CIAPIObjectRequest {
// Instance variables for all fields
NSString* orderId;
}
// Properties for each field
// The requested order id.
@property (retain) NSString* orderId;
// Constructor for the object
- (CIAPIGetActiveStopLimitOrderRequest*)initWithOrderId:(NSString*)_orderId;
@end
|
#ifndef MACHINA_SOC_H
#define MACHINA_SOC_H
#include <sys/types.h>
#define CPU_FIQ_MODE (0x0011)
#define CPU_HYP_MODE (0x001A)
#define CPU_SVC_MODE (0x0013)
#define CPU_IRQ_MODE (0x0012)
#define CPU_ABORT_MODE (0x0017)
#define CPU_UNDEF_MODE (0x001B)
#define CPU_SYSTEM_MODE (0x001F)
#define CPU_FIQ_MASK (0x0040)
#define CPU_IRQ_MASK (0x0080)
#define CPU_ABORT_MASK (0x0100)
#define CPU_IO_BASE (0x3F000000U)
#define CPU_IO_END (CPU_IO_BASE + 0x01000000)
#define GPFSEL0 (CPU_IO_BASE + 0x00200000)
#define GPFSEL1 (CPU_IO_BASE + 0x00200004)
#define GPFSEL2 (CPU_IO_BASE + 0x00200008)
#define GPFSEL3 (CPU_IO_BASE + 0x0020000C)
#define GPFSEL4 (CPU_IO_BASE + 0x00200010)
#define GPFSEL5 (CPU_IO_BASE + 0x00200014)
#define GPSET0 (CPU_IO_BASE + 0x0020001C)
#define GPSET1 (CPU_IO_BASE + 0x00200020)
#define GPCLR0 (CPU_IO_BASE + 0x00200028)
#define GPLEV0 (CPU_IO_BASE + 0x00200034)
#define GPLEV1 (CPU_IO_BASE + 0x00200038)
#define GPEDS0 (CPU_IO_BASE + 0x00200040)
#define GPEDS1 (CPU_IO_BASE + 0x00200044)
#define GPHEN0 (CPU_IO_BASE + 0x00200064)
#define GPHEN1 (CPU_IO_BASE + 0x00200068)
#define GPPUD (CPU_IO_BASE + 0x00200094)
#define GPPUDCLK0 (CPU_IO_BASE + 0x00200098)
#define GPPUDCLK1 (CPU_IO_BASE + 0x0020009C)
#define UART0_BASE (CPU_IO_BASE + 0x201000)
#define UART0_DR (UART0_BASE + 0x00)
#define UART0_RSRECR (UART0_BASE + 0x04)
#define UART0_FR (UART0_BASE + 0x18)
#define UART0_ILPR (UART0_BASE + 0x20)
#define UART0_IBRD (UART0_BASE + 0x24)
#define UART0_FBRD (UART0_BASE + 0x28)
#define UART0_LCRH (UART0_BASE + 0x2C)
#define UART0_CR (UART0_BASE + 0x30)
#define UART0_IFLS (UART0_BASE + 0x34)
#define UART0_IMSC (UART0_BASE + 0x38)
#define UART0_RIS (UART0_BASE + 0x3C)
#define UART0_MIS (UART0_BASE + 0x40)
#define UART0_ICR (UART0_BASE + 0x44)
#define UART0_DMACR (UART0_BASE + 0x48)
#define UART0_ITCR (UART0_BASE + 0x80)
#define UART0_ITIP (UART0_BASE + 0x84)
#define UART0_ITOP (UART0_BASE + 0x88)
#define UART0_TDR (UART0_BASE + 0x8C)
/*
* The GPU physical address 0x7E00000 is mapped to the ARM physical address
* given by CPU_IO_BASE.
*
* For more information, consult the "BCM2835 ARM Peripherals" manual.
*/
#define CPU_GPIO_BASE (CPU_IO_BASE + 0x200000U) // GPU = 0x7E200000
//#define CPU_TIMER_BASE (/*CPU_IO_BASE +*/ 0x20003000U) // GPU = 0x7E003000
#define GPU_MEMORY_BASE 0xC0000000
#define SOC_PM_BASE (CPU_IO_BASE + 0x00100000U)
#define SOC_PM_RSTC (SOC_PM_BASE + 0x0000001CU)
#define SOC_PM_WDOG (SOC_PM_BASE + 0x00000024U)
#define SOC_PM_PASSWORD (0x5A000000U)
#define SOC_PM_RSTC_WRCFG_FULL_RESET (0x20)
#define SOC_MAILBOX_BASE (CPU_IO_BASE + 0x0000B880U) // GPU = 0x7E00B880
#define SOC_MAILBOX_READ (SOC_MAILBOX_BASE)
#define SOC_MAILBOX_POLL (SOC_MAILBOX_BASE + 0x00000018U) // GPU = 0x7E00B898
#define SOC_MAILBOX_WRITE (SOC_MAILBOX_BASE + 0x00000020U) // GPU = 0x7E00B8A0
#define SOC_MAILBOX_STATUS_EMPTY (0x40000000)
#define SOC_MAILBOX_STATUS_FULL (0x80000000)
#define SYS_MEMORY_TOTAL (1U << 30) // bytes
#define SYS_FRAME_SIZE (4096U) // bytes
#define SYS_FRAME_TOTAL (SYS_MEMORY_TOTAL / SYS_FRAME_SIZE) // frames
// TODO: remove
#define SYS_BITMAP_START (0x100) // bytes (16 bytes aligned)
// TODO: remove
#define SYS_BITMAP_SIZE (SYS_FRAME_TOTAL) // bytes
// TODO: remove
#define SYS_BITMAP_END (SYS_BITMAP_START + SYS_BITMAP_SIZE)
typedef union
{
uint32_t flags;
struct
{
uint32_t cores_total : 3;
uint32_t cores_enabled : 3;
uint32_t hard_float : 1;
uint32_t reserved : 25;
} info;
} SOC_INFO;
#endif // MACHINA_SOC_H |
class Vertex;
class Face;
class Edge
{
public:
Vertex *vertex, *midVertex;
Edge *next;
Edge *pair;
Face *face;
Edge();
~Edge();
private:
};
|
#include "json.h"
#include "network.h"
#include "screen.h"
#include "threads.h"
#include "lock.h"
#include <stdio.h>
mutex *m1;
mutex *m2;
void th1()
{
mutex_lock(m1);
printf("%i\n",1);
mutex_unlock(m1);
}
void th2()
{
mutex_lock(m2);
printf("%i\n",2);
mutex_unlock(m2);
}
int main(int argc, char ** argv)
{
m1 = mutex_create();
m2 = mutex_create();
thread * t1 = thread_create(th1);
thread * t2 = thread_create(th2);
thread_join(t1);
thread_join(t2);
printf("end.\n");
thread_release(t1);
thread_release(t2);
mutex_release(m1);
mutex_release(m2);
/*
sock s = socket_create("192.168.1.42", 8000);
packet * pkt = read_packet(s);
printf("--%s\n", pkt->boundary);
printf("Content-Type: %s\n", pkt->type);
printf("Content-Length: %ld\n", pkt->size);
printf("%s\n", pkt->payload);
write_packet(s, pkt);
free_packet(pkt);
*/
screens * screens = screens_get();
for(int i = 0; i < screens->count; i++) {
printf("screen: %s %dx%d\n",screens->list[i]->name, screens->list[i]->width, screens->list[i]->height);
}
fgetc(stdin);
return 0;
}
|
/*
* Copyright (C) 2017 Ptarmigan Project
* SPDX-License-Identifier: Apache-2.0
*
* 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.
*/
/**
* @file utl_time.h
* @brief utl_time
*/
#ifndef UTL_TIME_H__
#define UTL_TIME_H__
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
/**************************************************************************
* macros
**************************************************************************/
#define UTL_SZ_TIME_FMT_STR (20) ///< e.g. "2014-10-10T04:50:40Z"
/**************************************************************************
* prototypes
**************************************************************************/
/** get current time
*
* @return current time (unix time)
*/
time_t utl_time_time(void);
/** get current time
*
* @param[out] pStr current time (string formatted)
* @return pStr addr
*/
const char *utl_time_str_time(char pStr[UTL_SZ_TIME_FMT_STR + 1]);
/** format unix time
*
* @param[out] pStr string formatted time
* @param[in] Time unix time
* @return pStr addr
*/
const char *utl_time_fmt(char pStr[UTL_SZ_TIME_FMT_STR + 1], time_t Time);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif /* UTL_TIME_H__ */
|
#include "ch.h"
#include "hal.h"
/*
* Application entry point.
*/
int main(void) {
halInit();
chSysInit();
for (;;) {
palTogglePad(GPIOC, GPIOC_LED);
chThdSleepMilliseconds(500);
}
return CH_SUCCESS;
}
|
/* Copyright (c) 2022 PaddlePaddle Authors. 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. */
#pragma once
#include <string>
#include "paddle/phi/common/scalar.h"
#include "paddle/phi/core/dense_tensor.h"
namespace phi {
template <typename T, typename Context>
void AucKernel(const Context& dev_ctx,
const DenseTensor& input,
const DenseTensor& label,
const DenseTensor& stat_pos,
const DenseTensor& stat_neg,
const std::string& curve,
int num_thresholds,
int slide_steps,
DenseTensor* auc,
DenseTensor* stat_pos_out,
DenseTensor* stat_neg_out);
} // namespace phi
|
/*
* pluginglueAWSLAMBDARUNTIME: Library to push AWS Lambda work into the platform
*
* Copyright (C) 1998 - 2020. Dinand Vanvelzen
*
* 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 GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_MACROS_H
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_MACROS_H
/*
* Build configuration specific macros.
* Also includes the generic macros which are build config independant.
*/
/*-------------------------------------------------------------------------//
// //
// INCLUDES //
// //
//-------------------------------------------------------------------------*/
#ifndef GUCEF_CORE_MACROS_H
#include "gucefCORE_macros.h" /* CORE Module build configuration */
#define GUCEF_CORE_MACROS_H
#endif /* GUCEF_CORE_MACROS_H ? */
#ifndef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_CONFIG_H
#include "pluginglueAWSLAMBDARUNTIME_config.h"
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_CONFIG_H
#endif /* GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_CONFIG_H ? */
/*-------------------------------------------------------------------------//
// //
// GENERAL MACROS //
// //
//-------------------------------------------------------------------------*/
#undef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT
#ifdef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_BUILD_MODULE
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT GUCEF_EXPORT
#else
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT GUCEF_IMPORT
#endif /* GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_BUILD_MODULE ? */
#undef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_CPP
#ifdef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_CPP_CODE
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_CPP GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT
#else
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_CPP
#endif /* GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_CPP_CODE */
#undef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_C
#ifdef GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_C_CODE
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_C GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT
#else
#define GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_C
#endif /* GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_EXPORT_C_CODE */
/*-------------------------------------------------------------------------*/
#endif /* GUCEF_PLUGINGLUE_AWSLAMBDARUNTIME_MACROS_H ? */
/*-------------------------------------------------------------------------//
// //
// Info & Changes //
// //
//-------------------------------------------------------------------------//
- 26-03-2005 :
- Initial version of this file.
-----------------------------------------------------------------------------*/
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_ProjectWithDependenciesTestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ProjectWithDependenciesTestsVersionString[];
|
/* Web Polygraph http://www.web-polygraph.org/
* Copyright 2003-2011 The Measurement Factory
* Licensed under the Apache License, Version 2.0 */
#ifndef POLYGRAPH__CSM_GZIPENCODER_H
#define POLYGRAPH__CSM_GZIPENCODER_H
#include "csm/BodyIter.h"
namespace zlib {
class Deflator;
}
class GzipEncoder: public BodyIter {
public:
GzipEncoder(int aLevel, BodyIter *aProducer);
virtual ~GzipEncoder();
virtual GzipEncoder *clone() const;
virtual void start(WrBuf *aBuf);
virtual void stop();
virtual bool pour();
protected:
const int theLevel; // compression level: 0-9
BodyIter *theProducer; // produces unencoded content
zlib::Deflator *theEncoder; // compresses content
WrBuf theProducerBuf;
};
#endif
|
/*
* Copyright (C) 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 CORE_GET_GLES_PROC_ADDRESS_H
#define CORE_GET_GLES_PROC_ADDRESS_H
namespace core {
typedef void* (GetGlesProcAddressFunc)(const char* name, bool bypassLocal);
// GetGlesProcAddress returns the GLES function pointer to the function with
// the given name, or nullptr if the function was not found. If bypassLocal
// is true, the function resolution will bypass symbols loaded in the global
// context.
extern GetGlesProcAddressFunc* GetGlesProcAddress;
bool hasGLorGLES();
} // namespace core
#endif // CORE_GET_GLES_PROC_ADDRESS_H
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#pragma once
#cmakedefine HAVE_BACKTRACE 1
#cmakedefine HAVE_DLADDR 1
#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#else
#if !defined(__cplusplus) && !defined(linux) && !defined(__GNUC__)
typedef unsigned long long uint64_t;
typedef long long int64_t;
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS
#endif
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <sys/resource.h>
#include <sys/uio.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/mman.h>
#include <pwd.h>
#include <sys/time.h>
#include <signal.h>
#include <inttypes.h>
#endif // WIN32
/* Common section */
#include <stdlib.h>
#include <sys/types.h>
#include <platform/platform.h>
|
/* Copyright 2017 APPNEXUS INC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <Foundation/Foundation.h>
#import "ANUniversalAdFetcher.h"
#import "ANAdView.h"
#import "ANAdView+PrivateMethods.h"
#import "ANGlobal.h"
#import "ANTestGlobal.h"
@interface TestANUniversalFetcher : ANAdView<ANUniversalAdFetcherDelegate>
@property (nonatomic, strong) NSMutableSet<NSValue *> *allowedAdSizes;
@property (nonatomic, strong) NSArray<NSValue *> *adAllowedMediaTypes;
@property (nonatomic, readwrite, weak) id<ANUniversalAdFetcherDelegate> delegate;
- (instancetype)initWithPlacementId:(NSString *)placementId;
-(instancetype)initWithPlacementId:(NSString *)placementId andAllowMediaType:(NSArray<NSValue *> *)mediaType;
@end
|
// Copyright 2019 Google LLC
//
// 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 SRC_FRAME_H_
#define SRC_FRAME_H_
#include <absl/strings/string_view.h>
#include <boost/thread/mutex.hpp>
#include <dcmtk/dcmdata/dcpxitem.h>
#include <string>
#include <memory>
#include "src/enums.h"
#include "src/compressor.h"
namespace wsiToDicomConverter {
// Frame represents a single image frame from the OpenSlide library
class Frame {
public:
Frame(int64_t locationX, int64_t locationY, int64_t frameWidth,
int64_t frameHeight, DCM_Compression compression, int quality,
bool storeRawBytes);
virtual ~Frame() {}
// Gets frame by openslide library, performs scaling it and compressing
virtual void sliceFrame() = 0;
virtual bool isDone() const;
virtual uint8_t *dicomFrameBytes();
virtual size_t dicomFrameBytesSize() const;
virtual void incReadCounter();
virtual void decReadCounter();
virtual int64_t rawABGRFrameBytes(uint8_t *rawMemory, int64_t memorySize);
virtual int64_t frameWidth() const;
virtual int64_t frameHeight() const;
virtual void clearDicomMem();
virtual void clearRawABGRMem();
virtual bool hasRawABGRFrameBytes() const;
virtual void incSourceFrameReadCounter() = 0;
virtual int64_t locationX() const;
virtual int64_t locationY() const;
virtual absl::string_view photoMetrInt() const;
virtual bool hasDcmPixelItem() const;
virtual DcmPixelItem *dcmPixelItem();
virtual void setDicomFrameBytes(std::unique_ptr<uint8_t[]> dcmdata,
uint64_t size);
// Returns frame component of DCM_DerivationDescription
// describes in text how frame imaging data was saved in frame.
virtual std::string derivationDescription() const;
protected:
bool done_ = false;
// data to be written to dicom file
std::unique_ptr<uint8_t[]> data_; // raw compression
// jpeg or jpeg2000 compression data
// to be written to dicom. Pointer
// Allocated on assignment and then
// passed to DCMTK where its deleted.
// when the dicom is written.
std::unique_ptr<DcmPixelItem> dcmPixelItem_;
const int64_t locationX_;
const int64_t locationY_;
size_t size_ = 0;
const int64_t frameWidth_;
const int64_t frameHeight_;
boost::mutex readCounterMutex_;
int64_t readCounter_ = 0;
std::unique_ptr<Compressor> compressor_;
// flag indicates if raw frame bytes should be retained.
// required for to enable progressive downsampling.
const bool storeRawBytes_;
std::unique_ptr<uint8_t[]> rawCompressedBytes_;
int64_t rawCompressedBytesSize_ = 0;
};
} // namespace wsiToDicomConverter
#endif // SRC_FRAME_H_
|
/******************************************************************************
*
* Copyright (C) 2014 The Android Open Source Project
* Copyright 2002 - 2004 Open Interface North America, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
#ifndef OI_STRING_H
#define OI_STRING_H
/**
* @file
* This file contains BM3 supplied portable string.h functions
*
*/
/**********************************************************************************
$Revision: #1 $
***********************************************************************************/
#include "oi_cpu_dep.h"
#include "oi_stddefs.h"
#if defined(USE_NATIVE_MEMCPY) || defined(USE_NATIVE_MALLOC)
#include <string.h>
#endif
/** \addtogroup Misc Miscellaneous APIs */
/**@{*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* If we are using Native malloc(), we must also use
* native Ansi string.h functions for memory manipulation.
*/
#ifdef USE_NATIVE_MALLOC
#ifndef USE_NATIVE_MEMCPY
#define USE_NATIVE_MEMCPY
#endif
#endif
#ifdef USE_NATIVE_MEMCPY
#define OI_MemCopy(to, from, size) memcpy((to), (from), (size))
#define OI_MemSet(block, val, size) memset((block), (val), (size))
#define OI_MemZero(block, size) memset((block), 0, (size))
#define OI_MemCmp(s1, s2, n) memcmp((s1), (s2), (n))
#define OI_Strcpy(dest, src) strcpy((dest),(src))
#define OI_Strcat(dest, src) strcat((dest),(src))
#define OI_StrLen(str) strlen((str))
#define OI_Strcmp(s1, s2) strcmp((s1), (s2))
#define OI_Strncmp(s1, s2, n) strncmp((s1), (s2), (n))
#else
/*
* OI_MemCopy
*
* Copy an arbitrary number of bytes from one memory address to another.
* The underlying implementation is the ANSI memmove() or equivalant, so
* overlapping memory copies will work correctly.
*/
void OI_MemCopy(void *To, void const *From, OI_UINT32 Size);
/*
* OI_MemSet
*
* Sets all bytes in a block of memory to the same value
*/
void OI_MemSet(void *Block, OI_UINT8 Val, OI_UINT32 Size);
/*
* OI_MemZero
*
* Sets all bytes in a block of memory to zero
*/
void OI_MemZero(void *Block, OI_UINT32 Size);
/*
* OI_MemCmp
*
* Compare two blocks of memory
*
* Returns:
* 0, if s1 == s2
* < 0, if s1 < s2
* > 0, if s2 > s2
*/
OI_INT OI_MemCmp(void const *s1, void const *s2, OI_UINT32 n);
/*
* OI_Strcpy
*
* Copies the Null terminated string from pStr to pDest, and
* returns pDest.
*/
OI_CHAR *OI_Strcpy(OI_CHAR *pDest,
OI_CHAR const *pStr);
/*
* OI_Strcat
*
* Concatonates the pStr string to the end of pDest, and
* returns pDest.
*/
OI_CHAR *OI_Strcat(OI_CHAR *pDest,
OI_CHAR const *pStr) ;
/*
* OI_StrLen
*
* Calculates the number of OI_CHARs in pStr (not including
* the Null terminator) and returns the value.
*/
OI_UINT OI_StrLen(OI_CHAR const *pStr) ;
/*
* OI_Strcmp
*
* Compares two Null terminated strings
*
* Returns:
* 0, if s1 == s2
* < 0, if s1 < s2
* > 0, if s2 > s2
*/
OI_INT OI_Strcmp(OI_CHAR const *s1,
OI_CHAR const *s2);
/*
* OI_Strncmp
*
* Compares the first "len" OI_CHARs of strings s1 and s2.
*
* Returns:
* 0, if s1 == s2
* < 0, if s1 < s2
* > 0, if s2 > s2
*/
OI_INT OI_Strncmp(OI_CHAR const *s1,
OI_CHAR const *s2,
OI_UINT32 len);
#endif /* USE_NATIVE_MEMCPY */
/*
* OI_StrcmpInsensitive
*
* Compares two Null terminated strings, treating
* the Upper and Lower case of 'A' through 'Z' as
* equivilent.
*
* Returns:
* 0, if s1 == s2
* < 0, if s1 < s2
* > 0, if s2 > s2
*/
OI_INT OI_StrcmpInsensitive(OI_CHAR const *s1,
OI_CHAR const *s2);
/*
* OI_StrncmpInsensitive
*
* Compares the first "len" OI_CHARs of strings s1 and s2,
* treating the Upper and Lower case of 'A' through 'Z' as
* equivilent.
*
*
* Returns:
* 0, if s1 == s2
* < 0, if s1 < s2
* > 0, if s2 > s2
*/
OI_INT OI_StrncmpInsensitive(OI_CHAR const *s1,
OI_CHAR const *s2,
OI_UINT len);
#ifdef __cplusplus
}
#endif
/** @} */
/*****************************************************************************/
#endif /* OI_STRING_H */
|
/*
* Copyright (c) 2010, 2011, 2013, 2014 Nicira, 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 OPENVSWITCH_TYPES_H
#define OPENVSWITCH_TYPES_H 1
#include <sys/types.h>
#include <stdint.h>
#ifdef __CHECKER__
#define OVS_BITWISE __attribute__((bitwise))
#define OVS_FORCE __attribute__((force))
#else
#define OVS_BITWISE
#define OVS_FORCE
#endif
/* The ovs_be<N> types indicate that an object is in big-endian, not
* native-endian, byte order. They are otherwise equivalent to uint<N>_t. */
typedef uint16_t OVS_BITWISE ovs_be16;
typedef uint32_t OVS_BITWISE ovs_be32;
typedef uint64_t OVS_BITWISE ovs_be64;
#define OVS_BE16_MAX ((OVS_FORCE ovs_be16) 0xffff)
#define OVS_BE32_MAX ((OVS_FORCE ovs_be32) 0xffffffff)
#define OVS_BE64_MAX ((OVS_FORCE ovs_be64) 0xffffffffffffffffULL)
/* These types help with a few funny situations:
*
* - The Ethernet header is 14 bytes long, which misaligns everything after
* that. One can put 2 "shim" bytes before the Ethernet header, but this
* helps only if there is exactly one Ethernet header. If there are two,
* as with GRE and VXLAN (and if the inner header doesn't use this
* trick--GRE and VXLAN don't) then you have the choice of aligning the
* inner data or the outer data. So it seems better to treat 32-bit fields
* in protocol headers as aligned only on 16-bit boundaries.
*
* - ARP headers contain misaligned 32-bit fields.
*
* - Netlink and OpenFlow contain 64-bit values that are only guaranteed to
* be aligned on 32-bit boundaries.
*
* lib/unaligned.h has helper functions for accessing these. */
/* A 32-bit value, in host byte order, that is only aligned on a 16-bit
* boundary. */
typedef struct {
#ifdef WORDS_BIGENDIAN
uint16_t hi, lo;
#else
uint16_t lo, hi;
#endif
} ovs_16aligned_u32;
/* A 32-bit value, in network byte order, that is only aligned on a 16-bit
* boundary. */
typedef struct {
ovs_be16 hi, lo;
} ovs_16aligned_be32;
/* A 64-bit value, in host byte order, that is only aligned on a 32-bit
* boundary. */
typedef struct {
#ifdef WORDS_BIGENDIAN
uint32_t hi, lo;
#else
uint32_t lo, hi;
#endif
} ovs_32aligned_u64;
typedef union {
uint32_t u32[4];
struct {
uint64_t lo, hi;
} u64;
} ovs_u128;
/* A 64-bit value, in network byte order, that is only aligned on a 32-bit
* boundary. */
typedef struct {
ovs_be32 hi, lo;
} ovs_32aligned_be64;
/* ofp_port_t represents the port number of a OpenFlow switch.
* odp_port_t represents the port number on the datapath.
* ofp11_port_t represents the OpenFlow-1.1 port number. */
typedef uint16_t OVS_BITWISE ofp_port_t;
typedef uint32_t OVS_BITWISE odp_port_t;
typedef uint32_t OVS_BITWISE ofp11_port_t;
/* Macro functions that cast int types to ofp/odp/ofp11 types. */
#define OFP_PORT_C(X) ((OVS_FORCE ofp_port_t) (X))
#define ODP_PORT_C(X) ((OVS_FORCE odp_port_t) (X))
#define OFP11_PORT_C(X) ((OVS_FORCE ofp11_port_t) (X))
#endif /* openvswitch/types.h */
|
namespace simdjson {
namespace SIMDJSON_IMPLEMENTATION {
// This is a near copy of include/error.h's implementation_simdjson_result_base, except it doesn't use std::pair
// so we can avoid inlining errors
// TODO reconcile these!
/**
* The result of a simdjson operation that could fail.
*
* Gives the option of reading error codes, or throwing an exception by casting to the desired result.
*
* This is a base class for implementations that want to add functions to the result type for
* chaining.
*
* Override like:
*
* struct simdjson_result<T> : public internal::implementation_simdjson_result_base<T> {
* simdjson_result() noexcept : internal::implementation_simdjson_result_base<T>() {}
* simdjson_result(error_code error) noexcept : internal::implementation_simdjson_result_base<T>(error) {}
* simdjson_result(T &&value) noexcept : internal::implementation_simdjson_result_base<T>(std::forward(value)) {}
* simdjson_result(T &&value, error_code error) noexcept : internal::implementation_simdjson_result_base<T>(value, error) {}
* // Your extra methods here
* }
*
* Then any method returning simdjson_result<T> will be chainable with your methods.
*/
template<typename T>
struct implementation_simdjson_result_base {
/**
* Create a new empty result with error = UNINITIALIZED.
*/
simdjson_really_inline implementation_simdjson_result_base() noexcept = default;
/**
* Create a new error result.
*/
simdjson_really_inline implementation_simdjson_result_base(error_code error) noexcept;
/**
* Create a new successful result.
*/
simdjson_really_inline implementation_simdjson_result_base(T &&value) noexcept;
/**
* Create a new result with both things (use if you don't want to branch when creating the result).
*/
simdjson_really_inline implementation_simdjson_result_base(T &&value, error_code error) noexcept;
/**
* Move the value and the error to the provided variables.
*
* @param value The variable to assign the value to. May not be set if there is an error.
* @param error The variable to assign the error to. Set to SUCCESS if there is no error.
*/
simdjson_really_inline void tie(T &value, error_code &error) && noexcept;
/**
* Move the value to the provided variable.
*
* @param value The variable to assign the value to. May not be set if there is an error.
*/
simdjson_really_inline error_code get(T &value) && noexcept;
/**
* The error.
*/
simdjson_really_inline error_code error() const noexcept;
#if SIMDJSON_EXCEPTIONS
/**
* Get the result value.
*
* @throw simdjson_error if there was an error.
*/
simdjson_really_inline T& value() & noexcept(false);
/**
* Take the result value (move it).
*
* @throw simdjson_error if there was an error.
*/
simdjson_really_inline T&& value() && noexcept(false);
/**
* Take the result value (move it).
*
* @throw simdjson_error if there was an error.
*/
simdjson_really_inline T&& take_value() && noexcept(false);
/**
* Cast to the value (will throw on error).
*
* @throw simdjson_error if there was an error.
*/
simdjson_really_inline operator T&&() && noexcept(false);
#endif // SIMDJSON_EXCEPTIONS
/**
* Get the result value. This function is safe if and only
* the error() method returns a value that evaluates to false.
*/
simdjson_really_inline const T& value_unsafe() const& noexcept;
/**
* Get the result value. This function is safe if and only
* the error() method returns a value that evaluates to false.
*/
simdjson_really_inline T& value_unsafe() & noexcept;
/**
* Take the result value (move it). This function is safe if and only
* the error() method returns a value that evaluates to false.
*/
simdjson_really_inline T&& value_unsafe() && noexcept;
protected:
/** users should never directly access first and second. **/
T first{}; /** Users should never directly access 'first'. **/
error_code second{UNINITIALIZED}; /** Users should never directly access 'second'. **/
}; // struct implementation_simdjson_result_base
} // namespace SIMDJSON_IMPLEMENTATION
} // namespace simdjson |
//
// CountdownVCDemo.h
// Tools
//
// Created by 张书孟 on 2017/10/16.
// Copyright © 2017年 张书孟. All rights reserved.
//
#import "BaseViewController.h"
@interface CountdownVCDemo : BaseViewController
@end
|
//
// CDTCreateQueryIndexOperation.h
// ObjectiveCloudant
//
// Created by Rhys Short on 22/09/2015.
// Copyright (c) 2015 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.
#import <ObjectiveCloudant/ObjectiveCloudant.h>
/**
An operation to create a Query index in a database
*/
@interface CDTCreateQueryIndexOperation : CDTCouchDatabaseOperation
/**
* The name of the index.
* Optional: CouchDb will automatically generate an index name
* if its not set.
**/
@property (nullable, nonatomic, strong) NSString* indexName;
/**
* The fields to be included in the index.
*
* For JSON Indexes, the syntax for specifying fields is Sort Syntax.
*
* Example: `@[ @{ @"age": @"asc"} ]`
*
* For Text indexes, you need to specify the data type for the field,
* only `string`, `number`, or `boolean` are accepted.
*
* Example: `@[ @{ @"name": @"age", @"type", @"number"} ]"
*
*
* Required: fields are required for *JSON Indexes*
* Optional: fields are optional for *Text Indexes*
*
* @see [Creating an Index](https://docs.cloudant.com/cloudant_query.html#creating-an-index)
**/
@property (nullable, nonatomic, strong) NSArray<NSObject*>* fields;
/**
* The name of the analyzer to use for $text operator with this index.
* Optional: CouchDb will use the default analyzer if one is not specified
* Note: text indexes only
**/
@property (nullable, nonatomic, strong) NSString* defaultFieldAnalyzer;
/**
* If the default field should be enabled for this index.
*
* If default field is disabled, the `$text` operator will
* return 0 results. If you wish to use the `$text` operator
* the index being created needs this option to be set to YES.
*
* Default: NO, default field index is disabled by default
* Note: text indexes only
*/
@property (nonatomic) BOOL defaultFieldEnabled;
/**
* A selector to limit the documents in the index.
* Optional: If omitted all documents will be included in the index
* Note: text indexes only.
**/
@property (nullable, nonatomic, strong) NSDictionary* selector;
/**
* The index type to use, deafults to json.
**/
@property (nonatomic) CDTQueryIndexType indexType;
/**
* The name of the design doc this index should be included with
*
* Optional: CouchDB will automatically generate a deisgn doc
* for this index.
**/
@property (nullable, nonatomic, strong) NSString* designDocName;
/**
Completion block to run when the operation completes
- operationError - a pointer to an error object containing
information about an error executing the operation
*/
@property (nullable, nonatomic, strong) void (^createIndexCompletionBlock)
(NSError* _Nullable operationError);
@end
|
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2011 by Alloy_Custom_Fonts, 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 |
//
// NSDate+Extention.h
// 微博
//
// Created by FuYu on 15/11/4.
// Copyright © 2015年 FuYu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDate (Extention)
- (BOOL)isThisYear;
- (BOOL)isYesterday;
- (BOOL)isToday;
@end
|
/*
* Timer.h
*
* Created on: 11 Dec 2014
* Author: Ville
*/
#ifndef TIMER_H_
#define TIMER_H_
#include "Base.h"
namespace Gain {
class Timer: public Gain::Base {
private:
typedef Gain::Base super;
public:
Timer();
virtual ~Timer();
virtual void updateG(float time, float deltaTime) ;
virtual bool setupGraphics() ;
virtual bool initVariables() ;
virtual void render() const {};
virtual void enableAttributes() const {};
virtual void disableAttributes() const {};
virtual void setIntervalCount(float interval, unsigned int count, bool autoStart=true);
virtual void setInterval(float interval, bool autoStart=true);
virtual void setOneShot(float time, bool autoStart=true);
virtual void stop();
virtual void start();
protected:
float pTimerOriginal;
float pTimerLeft;
unsigned int pRunning;
unsigned int pRunningCount;
};
} /* namespace Gain */
#endif /* TIMER_H_ */
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2017 ArangoDB GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Simon Grätzer
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_REST_HANDLER_REST_CLUSTER_HANDLER_H
#define ARANGOD_REST_HANDLER_REST_CLUSTER_HANDLER_H 1
#include "RestHandler/RestBaseHandler.h"
namespace arangodb {
class RestClusterHandler : public arangodb::RestBaseHandler {
public:
RestClusterHandler(GeneralRequest*, GeneralResponse*);
public:
virtual char const* name() const override { return "RestClusterHandler"; }
bool isDirect() const override { return true; }
RestStatus execute() override;
private:
/// _api/cluster/endpoints
void handleCommandEndpoints();
/// _api/cluster/serverInfo
void handleCommandServerInfo();
};
}
#endif
|
/**
*Course: EG1302A - spring 2014
*Name: Hassan Almotairi
*Date Created: 02/13/2014
*Assignment: Assignment10
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
float total;
int quantity;
float price;
printf("how much was the item that you bought?\n");
scanf("%f", &price);
printf("what about the quantity?\n");
scanf("%d", &quantity);
total=(float)quantity*price;
printf("the total cost is $%4.2f\n", total);
return 0;
}
|
#include "UI.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <ncurses.h>
typedef struct UI {
WINDOW *console_win;
WINDOW *printer_win;
} UI;
UI *UI_create() {
UI *self = calloc(1, sizeof(UI));
initscr();
// raw();
cbreak();
noecho();
self->console_win = newwin(3, 20, 0, 0);
wrefresh(self->console_win);
self->printer_win = newwin(20, 20, 3, 0);
box(self->printer_win, 0, 0);
wrefresh(self->printer_win);
nodelay(self->console_win, TRUE);
keypad(self->console_win, TRUE);
return self;
}
void UI_destroy(UI *self) {
delwin(self->console_win);
delwin(self->printer_win);
endwin();
free(self);
}
void UI_printf(UI *self, const char* format, ...) {
va_list argptr;
va_start(argptr, format);
vwprintw(self->console_win, format, argptr);
va_end(argptr);
wrefresh(self->console_win);
}
void UI_gets(UI *self, char *str, int n) {
int pos = 0;
int c = 0;
while (c != 10) {
c = wgetch(self->console_win);
if (c != ERR) {
if (c > KEY_CODE_YES) {
continue;
}
if (c == 10) {
break;
} else if (c == 0x7f) {
if (pos > 0) {
--pos;
str[pos] = 0;
}
wmove(self->console_win, 0, pos);
waddch(self->console_win, ' ');
wmove(self->console_win, 0, pos);
continue;
}
// Invert upper and lower case
if (islower(c))
c = toupper(c);
else if (isupper(c))
c = tolower(c);
str[pos] = c;
str[pos + 1] = 0;
wmove(self->console_win, 0, pos);
waddch(self->console_win, c);
// wmove(self->console_win, 0, 0);
// wprintw(self->console_win, "%d (%c), %d", c, c, pos);
if (pos - 1 < n)
++pos;
}
usleep(100);
}
}
char UI_key(UI *self) {
char c = wgetch(self->console_win);
if (c == ERR)
return 0;
return c;
}
void UI_stop(UI *self) {
char c;
while (1) {
c = wgetch(self->console_win);
if (c != ERR)
break;
usleep(100);
}
ungetch(c);
}
void UI_csr(UI *self, int x) {
wmove(self->console_win, 0, x);
}
void UI_clear(UI *self) {
werase(self->console_win);
}
void UI_ready(UI *self, int mode, int prog_area) {
char c;
curs_set(0);
werase(self->console_win);
if (mode == 0) {
/* It is a great pleasure to output... */
wprintw(self->console_win, "READY P%d", prog_area);
while (1) {
c = wgetch(self->console_win);
if (c != ERR)
break;
usleep(100);
}
} else {
int blink = 0;
int i;
while (1) {
char buf[13] = "P ";
for (i = 0; i < 10; ++i) {
if (prog_area == i && blink)
buf[i + 2] = '_';
else
buf[i + 2] = '0' + i;
}
buf[12] = 0;
wmove(self->console_win, 0, 0);
wprintw(self->console_win, buf);
for (i = 0; i < 5000; ++i) {
c = wgetch(self->console_win);
if (c != ERR)
goto clear;
usleep(100);
}
blink = !blink;
}
}
clear:
ungetch(c);
werase(self->console_win);
curs_set(1);
}
|
// This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2017 Oslo and Akershus University College of Applied Sciences
// and Alfred Bratterud
//
// 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 POSIX_NL_TYPES_H
#define POSIX_NL_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#define NL_SETD 1
#define NL_CAT_LOCALE 1
typedef void *nl_catd;
typedef int nl_item;
int catclose(nl_catd);
char *catgets(nl_catd, int, int, const char *);
nl_catd catopen(const char *, int);
#ifdef __cplusplus
}
#endif
#endif // < POSIX_NL_TYPES_H
|
#ifndef PARSE_TEST_H
#define PARSE_TEST_H
#include <cppunit/extensions/HelperMacros.h>
class ParseTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( ParseTest );
CPPUNIT_TEST( parseTest );
CPPUNIT_TEST_SUITE_END();
public:
void parseTest();
};
#endif // SIMPLE_TEST_H
|
/*
Copyright 2014, Jernej Kovacic
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
* @author Jernej Kovacic
*
* A public header, may be directly included into applications.
*
* Declaration of the class PolynomialGeneric, representing polynomials.
*/
#ifndef _MATH_POLYNOMIAL_H_
#define _MATH_POLYNOMIAL_H_
#include "polynomial/PolynomialGeneric.hpp"
#endif /* _MATH_POLYNOMIAL_H_ */
|
/*===========================================================================
_____ _____ _____ _____
___| _|__ __|_ |__ __|__ |__ __| __ |__ ______
| \ / | || \ || | || |/ / ||___ |
| \/ | || \ || \ || \ ||___ |
|__/\__/|__|_||__|\__\ __||__|\__\ __||__|\__\ __||______|
|_____| |_____| |_____| |_____|
--[Mark3 Realtime Platform]--------------------------------------------------
Copyright (c) 2012-2016 Funkenstein Software Consulting, all rights reserved.
See license.txt for more information
===========================================================================*/
/*!
\file arena.cpp
\brief Traditional heap memory allocator.
*/
#ifndef __ARENA_H__
#define __ARENA_H__
#include <stdint.h>
#include "arenalist.h"
#include "heapblock.h"
//---------------------------------------------------------------------------
#define ARENA_EXHAUSTED (255)
#define ARENA_FULL (254)
//---------------------------------------------------------------------------
/*!
* \brief The Arena class
*
* This implements a heap composed of a blob of contiguous memory, managed
* in a series of lists, where each list corresponds to a minimum allocation
* size for blocks within the list.
*
* As a general-purpose heap, it offers basic "malloc/free" style dynamic
* memory allocation, with few bells or whistles.
*
*/
class Arena
{
public:
/*!
* \brief Init
*
* Initialize the arena prior to use.
*
* \param pvBuffer_ Pointer to the memory blob to manage as a heap
* from this object.
* \param usize_ Size of the heap memory blob in bytes
* \return
*/
void Init( void *pvBuffer_, K_ADDR u32Size_, K_ADDR *au32Sizes_, uint8_t u8NumSizes_ );
/*!
* \brief Allocate
*
* Allocate a block of dynamic memory from the heap.
*
* \param usize_ Size of object to allocate (in bytes)
* \return pointer to a chunk of dynamic memory, or 0 on exhaustion.
*/
void *Allocate( K_ADDR usize_ );
/*!
* \brief Free
*
* Free the block of memory, returning it back to the pool for use.
*
* \param pvBlock_ Pointer to the beginning of the object to be freed.
*/
void Free( void *pvBlock_ );
/*!
* \brief Print
*
* Show details about the print via standard output.
*/
void Print( void );
private:
/*!
* \brief ListForSize
*
* Determine the arena list with the smallest allocation size
* to handle an allocation of a given size.
*
* \param usize_ Size of the object to check
* \return INdex representing the arena/arena-size
*/
uint8_t ListForSize( K_ADDR usize_ );
/*!
* \brief ListToSatisfy
*
* Determine the arena list that can satisfy the size request,
* and has vacant objects available to be allocated.
*
* \param usize_ Size of data to check
* \return Index representing the arena/arena-size, or 0xF...F on invalid
*/
uint8_t ListToSatisfy( K_ADDR usize_ );
uint8_t m_u8LargestList; //!< Index of the largest arena
ArenaList *m_aclBlockList; //!< Arena linked-list data
void *m_pvData; //!< Pointer to the raw memory blob managed by this object as a heap.
};
#endif
|
//===-- namegen.h - decls for 'NameGen' class --======================//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Defines NameGen class.
//
//===----------------------------------------------------------------------===//
#ifndef LLVMGOFRONTEND_NAMEGEN_H
#define LLVMGOFRONTEND_NAMEGEN_H
class NameGen {
public:
NameGen() { }
// Tells namegen to choose its own version number for the created name
static constexpr unsigned ChooseVer = 0xffffffff;
// For creating useful type, inst and block names.
std::string namegen(const std::string &tag, unsigned expl = ChooseVer) {
auto it = nametags_.find(tag);
unsigned count = 0;
if (it != nametags_.end())
count = it->second + 1;
if (expl != ChooseVer)
count = expl;
std::stringstream ss;
ss << tag << "." << count;
if (expl == ChooseVer)
nametags_[tag] = count;
return ss.str();
}
NameGen *nameTags() {
return const_cast<NameGen*>(this);
}
private:
// Key is tag (ex: "add") and val is counter to uniquify.
std::unordered_map<std::string, unsigned> nametags_;
};
#endif // LLVMGOFRONTEND_TYPEMANAGER_H
|
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// @author raver119@gmail.com
#ifndef LIBND4J_CONSTANTDATABUFFER_H
#define LIBND4J_CONSTANTDATABUFFER_H
#include <dll.h>
#include <pointercast.h>
namespace nd4j {
class ND4J_EXPORT ConstantDataBuffer {
private:
Nd4jPointer _primaryBuffer = nullptr;
Nd4jPointer _specialBuffer = nullptr;
Nd4jLong _length = 0;
Nd4jLong _sizeOf = 0;
public:
ConstantDataBuffer(Nd4jPointer primary, Nd4jPointer special, Nd4jLong numEelements, Nd4jLong sizeOf);
ConstantDataBuffer(const ConstantDataBuffer &other);
ConstantDataBuffer() = default;
~ConstantDataBuffer() = default;
Nd4jLong sizeOf() const;
Nd4jLong length() const;
Nd4jPointer primary() const;
Nd4jPointer special() const;
ConstantDataBuffer& operator=(const ConstantDataBuffer& other) = default;
ConstantDataBuffer& operator=(ConstantDataBuffer&& other) noexcept = default;
template <typename T>
T* primaryAsT();
template <typename T>
T* specialAsT();
};
}
#endif //DEV_TESTS_CONSTANTDATABUFFER_H
|
/*
* 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/transcribe/TranscribeService_EXPORTS.h>
#include <aws/transcribe/TranscribeServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace TranscribeService
{
namespace Model
{
/**
*/
class AWS_TRANSCRIBESERVICE_API DeleteTranscriptionJobRequest : public TranscribeServiceRequest
{
public:
DeleteTranscriptionJobRequest();
// 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 "DeleteTranscriptionJob"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline const Aws::String& GetTranscriptionJobName() const{ return m_transcriptionJobName; }
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline void SetTranscriptionJobName(const Aws::String& value) { m_transcriptionJobNameHasBeenSet = true; m_transcriptionJobName = value; }
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline void SetTranscriptionJobName(Aws::String&& value) { m_transcriptionJobNameHasBeenSet = true; m_transcriptionJobName = std::move(value); }
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline void SetTranscriptionJobName(const char* value) { m_transcriptionJobNameHasBeenSet = true; m_transcriptionJobName.assign(value); }
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline DeleteTranscriptionJobRequest& WithTranscriptionJobName(const Aws::String& value) { SetTranscriptionJobName(value); return *this;}
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline DeleteTranscriptionJobRequest& WithTranscriptionJobName(Aws::String&& value) { SetTranscriptionJobName(std::move(value)); return *this;}
/**
* <p>The name of the transcription job to be deleted.</p>
*/
inline DeleteTranscriptionJobRequest& WithTranscriptionJobName(const char* value) { SetTranscriptionJobName(value); return *this;}
private:
Aws::String m_transcriptionJobName;
bool m_transcriptionJobNameHasBeenSet;
};
} // namespace Model
} // namespace TranscribeService
} // namespace Aws
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/budgets/Budgets_EXPORTS.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Budgets
{
namespace Model
{
/**
* Response of DeleteSubscriber
*/
class AWS_BUDGETS_API DeleteSubscriberResult
{
public:
DeleteSubscriberResult();
DeleteSubscriberResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
DeleteSubscriberResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
};
} // namespace Model
} // namespace Budgets
} // namespace Aws
|
/*
* 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/pinpoint/Pinpoint_EXPORTS.h>
#include <aws/pinpoint/model/GCMChannelResponse.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Pinpoint
{
namespace Model
{
class AWS_PINPOINT_API GetGcmChannelResult
{
public:
GetGcmChannelResult();
GetGcmChannelResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetGcmChannelResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
inline const GCMChannelResponse& GetGCMChannelResponse() const{ return m_gCMChannelResponse; }
inline void SetGCMChannelResponse(const GCMChannelResponse& value) { m_gCMChannelResponse = value; }
inline void SetGCMChannelResponse(GCMChannelResponse&& value) { m_gCMChannelResponse = std::move(value); }
inline GetGcmChannelResult& WithGCMChannelResponse(const GCMChannelResponse& value) { SetGCMChannelResponse(value); return *this;}
inline GetGcmChannelResult& WithGCMChannelResponse(GCMChannelResponse&& value) { SetGCMChannelResponse(std::move(value)); return *this;}
private:
GCMChannelResponse m_gCMChannelResponse;
};
} // namespace Model
} // namespace Pinpoint
} // namespace Aws
|
#import "DockManeuver.h"
@interface DockManeuver (Addons)
-(NSString*)asString;
-(NSComparisonResult)compareTo:(DockManeuver*)other;
-(BOOL)isSpin;
-(BOOL)isFlank;
-(BOOL)isComeAbout;
@end
|
/* Copyright 2017 R. Thomas
* Copyright 2017 Quarkslab
*
* 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 <stdint.h>
#include "LIEF/visibility.h"
#ifndef C_LIEF_LOGGING_H_
#define C_LIEF_LOGGING_H_
/** @defgroup logging_c_api Logging
* @brief Logging C API
*
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Disable the logging module */
DLL_PUBLIC void lief_logging_disable(void);
/** @brief Enable the logging module globally*/
DLL_PUBLIC void lief_logging_enable(void);
/** @brief Update logging level */
DLL_PUBLIC void lief_logging_set_level(uint32_t level);
/** @brief Update verbosity level */
DLL_PUBLIC void lief_logging_set_verbose_level(uint32_t level);
#ifdef __cplusplus
}
#endif
/** @} */
#endif
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <rp_issued_token.h>
struct rp_issued_token
{
axis2_char_t *inclusion;
axiom_node_t *issuer_epr;
axiom_node_t *requested_sec_token_template;
axis2_bool_t derivedkeys;
axis2_bool_t require_external_reference;
axis2_bool_t require_internal_reference;
int ref;
};
AXIS2_EXTERN rp_issued_token_t * AXIS2_CALL
rp_issued_token_create(
const axutil_env_t *env)
{
rp_issued_token_t *issued_token = NULL;
issued_token = (rp_issued_token_t*)AXIS2_MALLOC(env->allocator, sizeof(rp_issued_token_t));
if(issued_token == NULL)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
issued_token->inclusion = NULL;
issued_token->issuer_epr = NULL;
issued_token->requested_sec_token_template = NULL;
issued_token->derivedkeys = AXIS2_FALSE;
issued_token->require_external_reference = AXIS2_FALSE;
issued_token->require_internal_reference = AXIS2_FALSE;
issued_token->ref = 0;
return issued_token;
}
AXIS2_EXTERN void AXIS2_CALL
rp_issued_token_free(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
if(issued_token)
{
if(--(issued_token->ref) > 0)
{
return;
}
AXIS2_FREE(env->allocator, issued_token);
issued_token = NULL;
}
return;
}
AXIS2_EXTERN axis2_char_t * AXIS2_CALL
rp_issued_token_get_inclusion(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
return issued_token->inclusion;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_set_inclusion(
rp_issued_token_t *issued_token,
const axutil_env_t *env,
axis2_char_t *inclusion)
{
(void)env;
if(inclusion)
{
issued_token->inclusion = inclusion;
return AXIS2_SUCCESS;
}
return AXIS2_FAILURE;
}
AXIS2_EXTERN axiom_node_t * AXIS2_CALL
rp_issued_token_get_issuer_epr(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
return issued_token->issuer_epr;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_set_issuer_epr(
rp_issued_token_t *issued_token,
const axutil_env_t *env,
axiom_node_t *issuer_epr)
{
(void)env;
if(issuer_epr)
{
issued_token->issuer_epr = issuer_epr;
return AXIS2_SUCCESS;
}
return AXIS2_FAILURE;
}
AXIS2_EXTERN axiom_node_t * AXIS2_CALL
rp_issued_token_get_requested_sec_token_template(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
return issued_token->requested_sec_token_template;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_set_requested_sec_token_template(
rp_issued_token_t *issued_token,
const axutil_env_t *env,
axiom_node_t *req_sec_token_template)
{
(void)env;
if(req_sec_token_template)
{
issued_token->requested_sec_token_template = req_sec_token_template;
return AXIS2_SUCCESS;
}
return AXIS2_FAILURE;
}
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
rp_issued_token_get_derivedkeys(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
return issued_token->derivedkeys;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_set_derivedkeys(
rp_issued_token_t *issued_token,
const axutil_env_t *env,
axis2_bool_t derivedkeys)
{
AXIS2_PARAM_CHECK(env->error, derivedkeys, AXIS2_FAILURE);
issued_token->derivedkeys = derivedkeys;
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
rp_issued_token_get_require_external_reference(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
return issued_token->require_external_reference;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_set_require_exernal_reference(
rp_issued_token_t *issued_token,
const axutil_env_t *env,
axis2_bool_t require_external_reference)
{
AXIS2_PARAM_CHECK(env->error, require_external_reference, AXIS2_FAILURE);
issued_token->require_external_reference = require_external_reference;
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
rp_issued_token_get_require_internal_reference(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
return issued_token->require_internal_reference;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_set_require_internal_reference(
rp_issued_token_t *issued_token,
const axutil_env_t *env,
axis2_bool_t require_internal_reference)
{
AXIS2_PARAM_CHECK(env->error, require_internal_reference, AXIS2_FAILURE);
issued_token->require_internal_reference = require_internal_reference;
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_issued_token_increment_ref(
rp_issued_token_t *issued_token,
const axutil_env_t *env)
{
(void)env;
issued_token->ref++;
return AXIS2_SUCCESS;
}
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/content/html/content/public/nsIPhonetic.idl
*/
#ifndef __gen_nsIPhonetic_h__
#define __gen_nsIPhonetic_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIPhonetic */
#define NS_IPHONETIC_IID_STR "bc6ea726-ab56-46b6-a21a-aa7b76d6818f"
#define NS_IPHONETIC_IID \
{0xbc6ea726, 0xab56, 0x46b6, \
{ 0xa2, 0x1a, 0xaa, 0x7b, 0x76, 0xd6, 0x81, 0x8f }}
/**
* This interface is used to get the phonetic value of the input text.
* It can be used to get corresponding phonetic value for ideographic text.
* The interface can be retrieved by calling QI to the interface
* which implements the phonetic interface.
*/
class NS_NO_VTABLE NS_SCRIPTABLE nsIPhonetic : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPHONETIC_IID)
/**
* phonetic get the phonetic value of the input text
*/
/* readonly attribute DOMString phonetic; */
NS_SCRIPTABLE NS_IMETHOD GetPhonetic(nsAString & aPhonetic) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPhonetic, NS_IPHONETIC_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPHONETIC \
NS_SCRIPTABLE NS_IMETHOD GetPhonetic(nsAString & aPhonetic);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPHONETIC(_to) \
NS_SCRIPTABLE NS_IMETHOD GetPhonetic(nsAString & aPhonetic) { return _to GetPhonetic(aPhonetic); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPHONETIC(_to) \
NS_SCRIPTABLE NS_IMETHOD GetPhonetic(nsAString & aPhonetic) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPhonetic(aPhonetic); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsPhonetic : public nsIPhonetic
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPHONETIC
nsPhonetic();
private:
~nsPhonetic();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsPhonetic, nsIPhonetic)
nsPhonetic::nsPhonetic()
{
/* member initializers and constructor code */
}
nsPhonetic::~nsPhonetic()
{
/* destructor code */
}
/* readonly attribute DOMString phonetic; */
NS_IMETHODIMP nsPhonetic::GetPhonetic(nsAString & aPhonetic)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIPhonetic_h__ */
|
//
// SearchViewController.h
// banlv
//
// Created by lcy on 16/5/6.
// Copyright © 2016年 llz. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SearchViewController : UIViewController
@property (nonatomic,copy)NSString *cityId;
@property (nonatomic,copy)NSString *cityName;
@property(nonatomic,strong)NSMutableArray *selectDateArr;
@property(nonatomic,strong) NSMutableArray *tempChooseDateArr;
@end
|
/*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/http2_errors.h"
grpc_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code,
grpc_transport_one_way_stats *stats) {
static const size_t frame_size = 13;
grpc_slice slice = GRPC_SLICE_MALLOC(frame_size);
stats->framing_bytes += frame_size;
uint8_t *p = GRPC_SLICE_START_PTR(slice);
// Frame size.
*p++ = 0;
*p++ = 0;
*p++ = 4;
// Frame type.
*p++ = GRPC_CHTTP2_FRAME_RST_STREAM;
// Flags.
*p++ = 0;
// Stream ID.
*p++ = (uint8_t)(id >> 24);
*p++ = (uint8_t)(id >> 16);
*p++ = (uint8_t)(id >> 8);
*p++ = (uint8_t)(id);
// Error code.
*p++ = (uint8_t)(code >> 24);
*p++ = (uint8_t)(code >> 16);
*p++ = (uint8_t)(code >> 8);
*p++ = (uint8_t)(code);
return slice;
}
grpc_error *grpc_chttp2_rst_stream_parser_begin_frame(
grpc_chttp2_rst_stream_parser *parser, uint32_t length, uint8_t flags) {
if (length != 4) {
char *msg;
gpr_asprintf(&msg, "invalid rst_stream: length=%d, flags=%02x", length,
flags);
grpc_error *err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
gpr_free(msg);
return err;
}
parser->byte = 0;
return GRPC_ERROR_NONE;
}
grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
void *parser,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s,
grpc_slice slice, int is_last) {
uint8_t *const beg = GRPC_SLICE_START_PTR(slice);
uint8_t *const end = GRPC_SLICE_END_PTR(slice);
uint8_t *cur = beg;
grpc_chttp2_rst_stream_parser *p = parser;
while (p->byte != 4 && cur != end) {
p->reason_bytes[p->byte] = *cur;
cur++;
p->byte++;
}
s->stats.incoming.framing_bytes += (uint64_t)(end - cur);
if (p->byte == 4) {
GPR_ASSERT(is_last);
uint32_t reason = (((uint32_t)p->reason_bytes[0]) << 24) |
(((uint32_t)p->reason_bytes[1]) << 16) |
(((uint32_t)p->reason_bytes[2]) << 8) |
(((uint32_t)p->reason_bytes[3]));
grpc_error *error = GRPC_ERROR_NONE;
if (reason != GRPC_HTTP2_NO_ERROR || s->header_frames_received < 2) {
char *message;
gpr_asprintf(&message, "Received RST_STREAM with error code %d", reason);
error = grpc_error_set_int(
grpc_error_set_str(GRPC_ERROR_CREATE_FROM_STATIC_STRING("RST_STREAM"),
GRPC_ERROR_STR_GRPC_MESSAGE,
grpc_slice_from_copied_string(message)),
GRPC_ERROR_INT_HTTP2_ERROR, (intptr_t)reason);
gpr_free(message);
}
grpc_chttp2_mark_stream_closed(exec_ctx, t, s, true, true, error);
}
return GRPC_ERROR_NONE;
}
|
/*
* 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/iot/IoT_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/iot/model/AuditTaskStatus.h>
#include <aws/iot/model/AuditTaskType.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace IoT
{
namespace Model
{
/**
* <p>The audits that were performed.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AuditTaskMetadata">AWS
* API Reference</a></p>
*/
class AWS_IOT_API AuditTaskMetadata
{
public:
AuditTaskMetadata();
AuditTaskMetadata(Aws::Utils::Json::JsonView jsonValue);
AuditTaskMetadata& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The ID of this audit.</p>
*/
inline const Aws::String& GetTaskId() const{ return m_taskId; }
/**
* <p>The ID of this audit.</p>
*/
inline bool TaskIdHasBeenSet() const { return m_taskIdHasBeenSet; }
/**
* <p>The ID of this audit.</p>
*/
inline void SetTaskId(const Aws::String& value) { m_taskIdHasBeenSet = true; m_taskId = value; }
/**
* <p>The ID of this audit.</p>
*/
inline void SetTaskId(Aws::String&& value) { m_taskIdHasBeenSet = true; m_taskId = std::move(value); }
/**
* <p>The ID of this audit.</p>
*/
inline void SetTaskId(const char* value) { m_taskIdHasBeenSet = true; m_taskId.assign(value); }
/**
* <p>The ID of this audit.</p>
*/
inline AuditTaskMetadata& WithTaskId(const Aws::String& value) { SetTaskId(value); return *this;}
/**
* <p>The ID of this audit.</p>
*/
inline AuditTaskMetadata& WithTaskId(Aws::String&& value) { SetTaskId(std::move(value)); return *this;}
/**
* <p>The ID of this audit.</p>
*/
inline AuditTaskMetadata& WithTaskId(const char* value) { SetTaskId(value); return *this;}
/**
* <p>The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or
* "CANCELED".</p>
*/
inline const AuditTaskStatus& GetTaskStatus() const{ return m_taskStatus; }
/**
* <p>The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or
* "CANCELED".</p>
*/
inline bool TaskStatusHasBeenSet() const { return m_taskStatusHasBeenSet; }
/**
* <p>The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or
* "CANCELED".</p>
*/
inline void SetTaskStatus(const AuditTaskStatus& value) { m_taskStatusHasBeenSet = true; m_taskStatus = value; }
/**
* <p>The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or
* "CANCELED".</p>
*/
inline void SetTaskStatus(AuditTaskStatus&& value) { m_taskStatusHasBeenSet = true; m_taskStatus = std::move(value); }
/**
* <p>The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or
* "CANCELED".</p>
*/
inline AuditTaskMetadata& WithTaskStatus(const AuditTaskStatus& value) { SetTaskStatus(value); return *this;}
/**
* <p>The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or
* "CANCELED".</p>
*/
inline AuditTaskMetadata& WithTaskStatus(AuditTaskStatus&& value) { SetTaskStatus(std::move(value)); return *this;}
/**
* <p>The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or
* "SCHEDULED_AUDIT_TASK".</p>
*/
inline const AuditTaskType& GetTaskType() const{ return m_taskType; }
/**
* <p>The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or
* "SCHEDULED_AUDIT_TASK".</p>
*/
inline bool TaskTypeHasBeenSet() const { return m_taskTypeHasBeenSet; }
/**
* <p>The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or
* "SCHEDULED_AUDIT_TASK".</p>
*/
inline void SetTaskType(const AuditTaskType& value) { m_taskTypeHasBeenSet = true; m_taskType = value; }
/**
* <p>The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or
* "SCHEDULED_AUDIT_TASK".</p>
*/
inline void SetTaskType(AuditTaskType&& value) { m_taskTypeHasBeenSet = true; m_taskType = std::move(value); }
/**
* <p>The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or
* "SCHEDULED_AUDIT_TASK".</p>
*/
inline AuditTaskMetadata& WithTaskType(const AuditTaskType& value) { SetTaskType(value); return *this;}
/**
* <p>The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or
* "SCHEDULED_AUDIT_TASK".</p>
*/
inline AuditTaskMetadata& WithTaskType(AuditTaskType&& value) { SetTaskType(std::move(value)); return *this;}
private:
Aws::String m_taskId;
bool m_taskIdHasBeenSet;
AuditTaskStatus m_taskStatus;
bool m_taskStatusHasBeenSet;
AuditTaskType m_taskType;
bool m_taskTypeHasBeenSet;
};
} // namespace Model
} // namespace IoT
} // namespace Aws
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "queryterm.h"
#include <vespa/searchlib/fef/blueprint.h>
namespace search::features {
struct AttributeMatchParams {
AttributeMatchParams() :
attrInfo(nullptr), attribute(nullptr), weightedSet(false), maxWeight(256), fieldCompletenessImportance(0.05f) {}
const fef::FieldInfo * attrInfo;
const attribute::IAttributeVector * attribute;
bool weightedSet;
// config values
int32_t maxWeight;
feature_t fieldCompletenessImportance;
};
/**
* Implements the executor for the attribute match feature.
*/
template <typename T>
class AttributeMatchExecutor : public fef::FeatureExecutor {
private:
/**
* This class is used to compute metrics for match in an attribute vector.
*/
class Computer {
private:
// TermData pointer and significance
AttributeMatchParams _params;
mutable T _buffer; // used when fetching weights from a weighted set attribute
// per query
uint32_t _numAttrTerms;
uint32_t _totalTermWeight; // total weight of all terms
feature_t _totalTermSignificance; // total significance of all terms
uint32_t _totalAttrTermWeight; // weight of all attribute terms
QueryTermVector _queryTerms; // the terms searching this attribute
// per doc
uint32_t _matches;
uint32_t _matchedTermWeight; // term weight of matched terms
feature_t _matchedTermSignificance; // significance of matched terms
int32_t _totalWeight;
int32_t _maxWeight;
feature_t _normalizedWeightedWeight;
int32_t _weightSum; // sum of the weights for a weighted set attribute
uint32_t _valueCount; // the number of values for a non-weighted set attribute
const fef::MatchData *_md;
public:
Computer(const fef::IQueryEnvironment & env, AttributeMatchParams params);
void run(uint32_t docId);
void reset();
uint32_t getNumTerms() const { return _queryTerms.size(); }
uint32_t getMatches() const { return _matches; }
int32_t getTotalWeight() const { return _totalWeight; }
int32_t getMaxWeight() const { return _maxWeight; }
feature_t getAverageWeight() const;
feature_t getQueryCompleteness() const;
feature_t getNormalizedWeight() const;
feature_t getNormalizedWeightedWeight() const;
feature_t getFieldCompleteness() const;
feature_t getCompleteness() const;
feature_t getWeight() const;
feature_t getSignificance() const;
feature_t getImportance() const { return (getWeight() + getSignificance()) * 0.5; }
void bind_match_data(const fef::MatchData &md) { _md = &md; }
};
Computer _cmp;
void handle_bind_match_data(const fef::MatchData &md) override;
public:
/**
* Constructs an executor.
*/
AttributeMatchExecutor(const fef::IQueryEnvironment & env, AttributeMatchParams params);
void execute(uint32_t docId) override;
};
/**
* Implements the blueprint for the attribute match executor.
*/
class AttributeMatchBlueprint : public fef::Blueprint {
private:
AttributeMatchParams _params;
public:
AttributeMatchBlueprint();
void visitDumpFeatures(const fef::IIndexEnvironment & env, fef::IDumpFeatureVisitor & visitor) const override;
fef::Blueprint::UP createInstance() const override;
fef::ParameterDescriptions getDescriptions() const override {
return fef::ParameterDescriptions().desc().attributeField(fef::ParameterDataTypeSet::normalTypeSet(), fef::ParameterCollection::ANY);
}
bool setup(const fef::IIndexEnvironment & env, const fef::ParameterList & params) override;
fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override;
void prepareSharedState(const fef::IQueryEnvironment &queryEnv, fef::IObjectStore &objectStore) const override;
};
}
|
//
// $Id: Singleton.h 1211 2010-06-13 15:11:59Z boman $
//
#ifndef SINGLETON_H
#define SINGLETON_H
#include <iostream>
/**
* @brief A basic implementation of the singleton pattern
*/
template <class T> class Singleton
{
public:
static T &getInstance();
static void destroy();
private:
static T *instance;
};
//#include "Singleton.inl"
#endif // SINGLETON_H
|
#import <Cordova/CDVPlugin.h>
enum CDVDataSourceType {
DataSourceTypeComp = 0,
DataSourceTypeDraw,
DataSourceTypeFiles,
DataSourceTypeLibrary,
DataSourceTypePhotos,
DataSourceTypePSMix,
DataSourceTypeSketch,
DataSourceTypeLine,
DataSourceTypeBrush
};
typedef NSUInteger CDVDataSourceType;
@interface CDVAssetBrowser : CDVPlugin
{
NSString *callbackId;
}
@property (nonatomic, retain) NSString *callbackId;
- (void)getFileMetadata:(CDVInvokedUrlCommand*)command;
- (void)downloadFiles:(CDVInvokedUrlCommand*)command;
- (void)uploadFile:(CDVInvokedUrlCommand*)command;
@end
|
#pragma once
#include "../../include/nn/LogSoftMax.h"
namespace cpptorch
{
namespace serializer
{
template<typename T, GPUFlag F>
class LogSoftMax : public nn::LogSoftMax<T, F>
{
public:
void unserialize(const object_torch *obj, object_reader<T, F> *mb)
{
}
};
}
}
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
/*=========================================================================
*
* Portions of this file are subject to the VTK Toolkit Version 3 copyright.
*
* Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
*
* For complete copyright, license and disclaimer of warranty information
* please refer to the NOTICE file at the top of the ITK source tree.
*
*=========================================================================*/
#ifndef __itkVTKImageIOFactory_h
#define __itkVTKImageIOFactory_h
#include "ITKIOVTKExport.h"
#include "itkObjectFactoryBase.h"
#include "itkImageIOBase.h"
namespace itk
{
/** \class VTKImageIOFactory
* \brief Create instances of VTKImageIO objects using an object factory.
* \ingroup ITKIOVTK
*/
class ITKIOVTK_EXPORT VTKImageIOFactory:public ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef VTKImageIOFactory Self;
typedef ObjectFactoryBase Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Class Methods used to interface with the registered factories. */
virtual const char * GetITKSourceVersion(void) const ITK_OVERRIDE;
virtual const char * GetDescription(void) const ITK_OVERRIDE;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(VTKImageIOFactory, ObjectFactoryBase);
/** Register one factory of this type */
static void RegisterOneFactory(void)
{
VTKImageIOFactory::Pointer vtkFactory = VTKImageIOFactory::New();
ObjectFactoryBase::RegisterFactoryInternal(vtkFactory);
}
protected:
VTKImageIOFactory();
~VTKImageIOFactory();
private:
VTKImageIOFactory(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
};
} // end namespace itk
#endif
|
//
// MineViewController.h
// QuFaXian
//
// Created by licong on 16/5/6.
// Copyright © 2016年 Sugar. All rights reserved.
//
#import "QFXCustomViewController.h"
@interface MineViewController : QFXCustomViewController
@end
|
/**
* microcsp
* Copyright (c) 2015 Michael E. Goldsby
*
* 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 MEMORY_H
#define MEMORY_H
#include <stdint.h>
/*
* We use Brinch Hansen's memory allocation algorithm.
* Assume that the program is small, so that the size of every
* possible storage allocation is known beforehand, and each
* possible size can be assigned an index. Thus there
* no need for a fallback "hard" allocation scheme.
*/
// fwd decl of 'struct ChainedBlock' as type 'ChainedBlock'
typedef struct ChainedBlock ChainedBlock;
typedef struct ChainedBlock * ChainedBlock_p;
typedef struct ChainedBlock {
ChainedBlock_p next;
char data[]; // blocks can be various lengths
} ChainedBlock;
/*
* Find index of smallest allocation >= given size
*/
unsigned int find_mem_index(uint32_t size);
/*
* Allocate block of length implied by index
* input: index 1..NALLOC-1
* output: array of words of size procmemlen[index]
*/
char *allocate_mem(unsigned int index);
/*
* Release allocated block.
* input: index 1..NALLOC-1
* addr ptr to allocated block
*/
void release_mem(unsigned int index, char *addr);
/*
* Initializes the memory system.
* input: memlen length in bytes of dynamic memory allocation
*/
void memory_init(unsigned int memlen);
#endif
|
#include "global.h"
#include "robot.h"
robot_t *robot_init (int nneurons, int nsynapses, int maxfactor)
{
robot_t *r;
neuron_t *n;
synapse_t *s;
assert (nneurons > 0);
assert (nsynapses > 0);
r = calloc (1, sizeof(robot_t) + sizeof(neuron_t) * nneurons);
assert (r != 0);
r->nneurons = nneurons;
maxfactor *= 1000;
for (n=r->neuron+4; n<r->neuron+nneurons; ++n) {
n->synapse = calloc (nsynapses, sizeof(synapse_t));
assert (n->synapse != 0);
n->nsynapses = nsynapses;
for (s=n->synapse; s<n->synapse+nsynapses; ++s) {
s->factor = random() % (2*maxfactor) - maxfactor;
s->neuron = r->neuron + random() % nneurons;
}
}
return r;
}
void robot_free (robot_t *r)
{
neuron_t *n;
for (n=r->neuron; n<r->neuron+r->nneurons; ++n)
free (n->synapse);
free (r);
}
robot_t *robot_copy (robot_t *r)
{
robot_t *q;
synapse_t *s;
int n;
q = calloc (1, sizeof(robot_t) + sizeof(neuron_t) * r->nneurons);
assert (q != 0);
q->nneurons = r->nneurons;
for (n=4; n<r->nneurons; ++n) {
q->neuron[n].synapse = calloc (r->neuron[n].nsynapses,
sizeof(synapse_t));
assert (q->neuron[n].synapse != 0);
q->neuron[n].nsynapses = r->neuron[n].nsynapses;
memcpy (q->neuron[n].synapse, r->neuron[n].synapse,
sizeof(synapse_t) * r->neuron[n].nsynapses);
for (s = q->neuron[n].synapse; s < q->neuron[n].synapse +
q->neuron[n].nsynapses; ++s) {
s->neuron += q->neuron - r->neuron;
}
}
return q;
}
robot_t *robot_load (FILE *fd)
{
int nneurons, i;
robot_t *r;
neuron_t *n;
synapse_t *s;
char line [1024], *line_good;
line_good = fgets (line, sizeof (line), fd);
assert (line_good);
sscanf (line, "neurons %d", &nneurons);
assert (nneurons > 0);
r = calloc (1, sizeof(robot_t) + sizeof(neuron_t) * nneurons);
assert (r != 0);
r->nneurons = nneurons;
for (n=r->neuron+4; n<r->neuron+nneurons; ++n) {
fscanf (fd, "\n[%d] ", &n->nsynapses);
assert (n->nsynapses > 0);
n->synapse = calloc (n->nsynapses, sizeof(synapse_t));
assert (n->synapse != 0);
for (s=n->synapse; s<n->synapse+n->nsynapses; ++s) {
fscanf (fd, "%d*%d ", &i, &s->factor);
assert (i >= 0);
assert (i < nneurons);
s->neuron = r->neuron + i;
}
}
return r;
}
void robot_save (robot_t *r, FILE *fd, int rating)
{
neuron_t *n;
synapse_t *s;
fprintf (fd, "neurons %d rating %d\n", r->nneurons, rating);
for (n=r->neuron+4; n<r->neuron+r->nneurons; ++n) {
fprintf (fd, "[%d] ", n->nsynapses);
for (s=n->synapse; s<n->synapse+n->nsynapses; ++s) {
fprintf (fd, "%d*%d ", s->neuron - r->neuron,
s->factor);
}
fprintf (fd, "\n");
}
}
void robot_setup (robot_t *r, int x, int y)
{
neuron_t *n;
r->x = x;
r->y = y;
for (n=r->neuron; n<r->neuron+r->nneurons; ++n)
n->state = 0;
}
void robot_think (robot_t *r, int level)
{
neuron_t *n;
synapse_t *s;
long sum;
level *= 1000;
for (n=r->neuron+4; n<r->neuron+r->nneurons; ++n) {
sum = 0;
for (s=n->synapse; s<n->synapse+n->nsynapses; ++s) {
sum += s->neuron->state * s->factor;
}
if (sum >= level)
n->new_state = 1;
else if (sum <= -level)
n->new_state = -1;
else
n->new_state = 0;
}
for (n=r->neuron+4; n<r->neuron+r->nneurons; ++n) {
n->state = n->new_state;
}
}
|
/*
* Copyright 2017-2021 AVSystem <avsystem@avsystem.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <avs_coap_init.h>
#ifdef AVS_UNIT_TESTING
# include "src/options/avs_coap_option.h"
# define AVS_UNIT_ENABLE_SHORT_ASSERTS
# include <avsystem/commons/avs_unit_test.h>
# define MODULE_NAME test
# include <avs_coap_x_log_config.h>
AVS_UNIT_TEST(coap_option, sizeof) {
uint8_t buffer[512] = "";
const avs_coap_option_t *opt = (const avs_coap_option_t *) buffer;
buffer[0] = 0x00;
// header byte + extended delta + extended length + value
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 0 + 0);
buffer[0] = 0xC0;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 0 + 0);
buffer[0] = 0xD0;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 1 + 0 + 0);
buffer[0] = 0xE0;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 2 + 0 + 0);
buffer[0] = 0x01;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 0 + 1);
buffer[0] = 0x0C;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 0 + 12);
buffer[0] = 0x0D;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 1 + 13);
buffer[0] = 0x0E;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 2 + 269);
buffer[0] = 0x11;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 0 + 1);
buffer[0] = 0xCC;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 0 + 0 + 12);
buffer[0] = 0xDD;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 1 + 1 + 13);
buffer[0] = 0xEE;
ASSERT_EQ(_avs_coap_option_sizeof(opt), 1 + 2 + 2 + 269);
}
AVS_UNIT_TEST(coap_option_serialize, empty) {
uint8_t buffer[512] = "";
const size_t delta = 0;
size_t written =
_avs_coap_option_serialize(buffer, sizeof(buffer), delta, NULL, 0);
// 1 - option header
static const size_t SIZE = 1;
ASSERT_EQ(written, SIZE);
ASSERT_EQ_BYTES_SIZED("\x00", buffer, SIZE);
}
AVS_UNIT_TEST(coap_option_serialize, ext8_delta) {
uint8_t buffer[512] = "";
const size_t delta = _AVS_COAP_EXT_U8_BASE + 0x12;
size_t written =
_avs_coap_option_serialize(buffer, sizeof(buffer), delta, NULL, 0);
// 1 - option header
// + 1 - extended length
static const size_t SIZE = 2;
ASSERT_EQ(written, SIZE);
ASSERT_EQ_BYTES_SIZED("\xd0\x12payload", buffer, SIZE);
}
AVS_UNIT_TEST(coap_option_serialize, ext16_delta) {
uint8_t buffer[512] = "";
const size_t delta = _AVS_COAP_EXT_U16_BASE + 0x1234;
size_t written =
_avs_coap_option_serialize(buffer, sizeof(buffer), delta, NULL, 0);
// 1 - option header
// + 2 - extended length
static const size_t SIZE = 3;
ASSERT_EQ(written, SIZE);
ASSERT_EQ_BYTES_SIZED("\xe0\x12\x34payload", buffer, SIZE);
}
AVS_UNIT_TEST(coap_option_serialize, ext8_size) {
uint8_t buffer[65536] = "";
uint8_t data[_AVS_COAP_EXT_U8_BASE + 0x12];
memset(data, 'A', sizeof(data));
const size_t delta = 0;
const size_t length = _AVS_COAP_EXT_U8_BASE + 0x12;
size_t written = _avs_coap_option_serialize(buffer, sizeof(buffer), delta,
data, length);
// 1 - option header
// + 1 - extended length
static const size_t HDR_SIZE = 2;
ASSERT_EQ(written, HDR_SIZE + length);
ASSERT_EQ_BYTES_SIZED("\x0d\x12", buffer, HDR_SIZE);
ASSERT_EQ_BYTES_SIZED(data, buffer + HDR_SIZE, length);
}
AVS_UNIT_TEST(coap_option_serialize, ext16_size) {
uint8_t buffer[65536] = "";
uint8_t data[_AVS_COAP_EXT_U16_BASE + 0x1234];
memset(data, 'A', sizeof(data));
const size_t delta = 0;
const size_t length = _AVS_COAP_EXT_U16_BASE + 0x1234;
size_t written = _avs_coap_option_serialize(buffer, sizeof(buffer), delta,
data, length);
// 1 - option header
// + 2 - extended length
static const size_t HDR_SIZE = 3;
ASSERT_EQ(written, HDR_SIZE + length);
ASSERT_EQ_BYTES_SIZED("\x0e\x12\x34", buffer, HDR_SIZE);
ASSERT_EQ_BYTES_SIZED(data, buffer + HDR_SIZE, length);
}
#endif // AVS_UNIT_TESTING
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
FOUNDATION_EXPORT double Pods_programmeerprojectVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_programmeerprojectVersionString[];
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_Fetch_h
#define mozilla_dom_Fetch_h
#include "nsIInputStreamPump.h"
#include "nsIStreamLoader.h"
#include "nsCOMPtr.h"
#include "nsError.h"
#include "nsProxyRelease.h"
#include "nsString.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/RequestBinding.h"
#include "mozilla/dom/workers/bindings/WorkerFeature.h"
class nsIGlobalObject;
namespace mozilla {
namespace dom {
class ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
class InternalRequest;
class OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
class RequestOrUSVString;
namespace workers {
class WorkerPrivate;
} // namespace workers
already_AddRefed<Promise>
FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput,
const RequestInit& aInit, ErrorResult& aRv);
nsresult
UpdateRequestReferrer(nsIGlobalObject* aGlobal, InternalRequest* aRequest);
/*
* Creates an nsIInputStream based on the fetch specifications 'extract a byte
* stream algorithm' - http://fetch.spec.whatwg.org/#concept-bodyinit-extract.
* Stores content type in out param aContentType.
*/
nsresult
ExtractByteStreamFromBody(const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& aBodyInit,
nsIInputStream** aStream,
nsCString& aContentType);
/*
* Non-owning version.
*/
nsresult
ExtractByteStreamFromBody(const ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& aBodyInit,
nsIInputStream** aStream,
nsCString& aContentType);
template <class Derived> class FetchBodyFeature;
/*
* FetchBody's body consumption uses nsIInputStreamPump to read from the
* underlying stream to a block of memory, which is then adopted by
* ContinueConsumeBody() and converted to the right type based on the JS
* function called.
*
* Use of the nsIInputStreamPump complicates things on the worker thread.
* The solution used here is similar to WebSockets.
* The difference is that we are only interested in completion and not data
* events, and nsIInputStreamPump can only deliver completion on the main thread.
*
* Before starting the pump on the main thread, we addref the FetchBody to keep
* it alive. Then we add a feature, to track the status of the worker.
*
* ContinueConsumeBody() is the function that cleans things up in both success
* and error conditions and so all callers call it with the appropriate status.
*
* Once the read is initiated on the main thread there are two possibilities.
*
* 1) Pump finishes before worker has finished Running.
* In this case we adopt the data and dispatch a runnable to the worker,
* which derefs FetchBody and removes the feature and resolves the Promise.
*
* 2) Pump still working while worker has stopped Running.
* The feature is Notify()ed and ContinueConsumeBody() is called with
* NS_BINDING_ABORTED. We first Cancel() the pump using a sync runnable to
* ensure that mFetchBody remains alive (since mConsumeBodyPump is strongly
* held by it) until pump->Cancel() is called. OnStreamComplete() will not
* do anything if the error code is NS_BINDING_ABORTED, so we don't have to
* worry about keeping anything alive.
*
* The pump is always released on the main thread.
*/
template <class Derived>
class FetchBody {
public:
bool
BodyUsed() const { return mBodyUsed; }
already_AddRefed<Promise>
ArrayBuffer(ErrorResult& aRv)
{
return ConsumeBody(CONSUME_ARRAYBUFFER, aRv);
}
already_AddRefed<Promise>
Blob(ErrorResult& aRv)
{
return ConsumeBody(CONSUME_BLOB, aRv);
}
already_AddRefed<Promise>
FormData(ErrorResult& aRv)
{
return ConsumeBody(CONSUME_FORMDATA, aRv);
}
already_AddRefed<Promise>
Json(ErrorResult& aRv)
{
return ConsumeBody(CONSUME_JSON, aRv);
}
already_AddRefed<Promise>
Text(ErrorResult& aRv)
{
return ConsumeBody(CONSUME_TEXT, aRv);
}
// Utility public methods accessed by various runnables.
void
BeginConsumeBodyMainThread();
void
ContinueConsumeBody(nsresult aStatus, uint32_t aLength, uint8_t* aResult);
void
CancelPump();
void
SetBodyUsed()
{
mBodyUsed = true;
}
// Always set whenever the FetchBody is created on the worker thread.
workers::WorkerPrivate* mWorkerPrivate;
// Set when consuming the body is attempted on a worker.
// Unset when consumption is done/aborted.
nsAutoPtr<workers::WorkerFeature> mFeature;
protected:
FetchBody();
virtual ~FetchBody();
void
SetMimeType();
private:
enum ConsumeType
{
CONSUME_ARRAYBUFFER,
CONSUME_BLOB,
CONSUME_FORMDATA,
CONSUME_JSON,
CONSUME_TEXT,
};
Derived*
DerivedClass() const
{
return static_cast<Derived*>(const_cast<FetchBody*>(this));
}
nsresult
BeginConsumeBody();
already_AddRefed<Promise>
ConsumeBody(ConsumeType aType, ErrorResult& aRv);
bool
AddRefObject();
void
ReleaseObject();
bool
RegisterFeature();
void
UnregisterFeature();
bool
IsOnTargetThread()
{
return NS_IsMainThread() == !mWorkerPrivate;
}
void
AssertIsOnTargetThread()
{
MOZ_ASSERT(IsOnTargetThread());
}
// Only ever set once, always on target thread.
bool mBodyUsed;
nsCString mMimeType;
// Only touched on target thread.
ConsumeType mConsumeType;
nsRefPtr<Promise> mConsumePromise;
DebugOnly<bool> mReadDone;
nsMainThreadPtrHandle<nsIInputStreamPump> mConsumeBodyPump;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_Fetch_h
|
/***********************************************************************//**
* JsKeywordSet.h
* Enlight Script
*
* Created by Ryoutarou Kishi on 2009/10/22.
* Copyright 2009 Altoterras Corporation. All rights reserved.
*
**//***********************************************************************/
#ifndef _ES_KWSET_JS_KEYWORD_SET_H_
#define _ES_KWSET_JS_KEYWORD_SET_H_
////////////////////////////////////////////////////////////////////////////
// インクルードファイル
#include "../EsKeywordSet.h"
////////////////////////////////////////////////////////////////////////////
// クラス
ES_BEGIN_NS
/*---------------------------------------------------------------------*//**
* JavaScript キーワード セット定義
*
**//*---------------------------------------------------------------------*/
class JsKeywordSet : public EsKeywordSet
{
//======================================================================
// 定数
protected:
//======================================================================
// メソッド
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// アクセサ
public:
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 外部サービス
public:
JsKeywordSet();
};
ES_END_NS
////////////////////////////////////////////////////////////////////////////
#endif // _ES_KWSET_JS_KEYWORD_SET_H_
|
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// 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 "esp_event.h"
#include "esp_event_internal.h"
/* ------------------------- Static Variables ------------------------------- */
static esp_event_loop_handle_t s_default_loop = NULL;
/* ---------------------------- Public API ---------------------------------- */
esp_err_t esp_event_handler_register(esp_event_base_t event_base, int32_t event_id,
esp_event_handler_t event_handler, void* event_handler_arg)
{
if (s_default_loop == NULL) {
return ESP_ERR_INVALID_STATE;
}
return esp_event_handler_register_with(s_default_loop, event_base, event_id,
event_handler, event_handler_arg);
}
esp_err_t esp_event_handler_unregister(esp_event_base_t event_base, int32_t event_id,
esp_event_handler_t event_handler)
{
if (s_default_loop == NULL) {
return ESP_ERR_INVALID_STATE;
}
return esp_event_handler_unregister_with(s_default_loop, event_base, event_id,
event_handler);
}
esp_err_t esp_event_post(esp_event_base_t event_base, int32_t event_id,
void* event_data, size_t event_data_size, TickType_t ticks_to_wait)
{
if (s_default_loop == NULL) {
return ESP_ERR_INVALID_STATE;
}
return esp_event_post_to(s_default_loop, event_base, event_id,
event_data, event_data_size, ticks_to_wait);
}
esp_err_t esp_event_loop_create_default()
{
if (s_default_loop) {
return ESP_ERR_INVALID_STATE;
}
esp_event_loop_args_t loop_args = {
.queue_size = CONFIG_SYSTEM_EVENT_QUEUE_SIZE,
.task_name = "sys_evt",
.task_stack_size = ESP_TASKD_EVENT_STACK,
.task_priority = ESP_TASKD_EVENT_PRIO,
.task_core_id = 0
};
esp_err_t err;
err = esp_event_loop_create(&loop_args, &s_default_loop);
if (err != ESP_OK) {
return err;
}
return ESP_OK;
}
esp_err_t esp_event_loop_delete_default()
{
if (!s_default_loop) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t err;
err = esp_event_loop_delete(s_default_loop);
if (err != ESP_OK) {
return err;
}
s_default_loop = NULL;
return ESP_OK;
}
|
/* Copyright 2016 Codethink Ltd.
*
* 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 "ofc/parse.h"
unsigned ofc_parse_stmt_use(
const ofc_sparse_t* src, const char* ptr,
ofc_parse_debug_t* debug,
ofc_parse_stmt_t* stmt)
{
unsigned i = ofc_parse_keyword(
src, ptr, debug, OFC_PARSE_KEYWORD_USE);
if (i == 0)
return 0;
unsigned len = ofc_parse_name(
src, &ptr[i], debug,
&stmt->use.module);
if (len == 0)
return 0;
i += len;
if (ptr[i] == ',')
{
len = 0;
ofc_parse_lhs_list_t* rename
= ofc_parse_lhs_alias_list(
src, &ptr[i + 1], debug, &len);
if (len == 0)
rename = NULL;
else
i += len + 1;
stmt->use.rename = rename;
}
else
{
stmt->use.rename = NULL;
}
if (ptr[i] == ',')
{
i++;
len = ofc_parse_keyword(
src, &ptr[i], debug, OFC_PARSE_KEYWORD_ONLY);
if (len == 0)
{
ofc_sparse_error(src, ofc_str_ref(&ptr[i], i),
"Expected ONLY keyword after comma");
return 0;
}
i += len;
if (ptr[i] == ':')
{
i++;
}
else
{
ofc_sparse_error(src, ofc_str_ref(&ptr[i], i),
"Missing semi colon after ONLY statement");
return 0;
}
ofc_parse_decl_list_t* only
= ofc_parse_decl_list(
src, &ptr[i], true, debug, &len);
if (!only)
{
only = NULL;
ofc_sparse_warning(src, ofc_str_ref(&ptr[i], i),
"ONLY statement without list, ignoring");
}
else
{
i += len;
}
stmt->use.only = only;
}
else
{
stmt->use.only = NULL;
}
stmt->type = OFC_PARSE_STMT_USE;
return i;
}
bool ofc_parse_stmt_use_print(
ofc_colstr_t* cs, const ofc_parse_stmt_t* stmt)
{
if (!cs || !stmt
|| stmt->type != OFC_PARSE_STMT_USE)
return false;
if (!ofc_colstr_keyword_atomic_writez(cs, "USE")
|| !ofc_colstr_atomic_writef(cs, " ")
|| !ofc_sparse_ref_print(cs, stmt->use.module))
return false;
if (stmt->use.rename
&& (!ofc_colstr_atomic_writef(cs, ",")
|| !ofc_colstr_atomic_writef(cs, " ")
|| !ofc_parse_lhs_list_print(cs, stmt->use.rename, false)))
return false;
if (stmt->use.only
&& (!ofc_colstr_atomic_writef(cs, ",")
|| !ofc_colstr_atomic_writef(cs, " ")
|| !ofc_colstr_keyword_atomic_writez(cs, "ONLY")
|| !ofc_colstr_atomic_writef(cs, ":")
|| !ofc_colstr_atomic_writef(cs, " ")
|| !ofc_parse_decl_list_print(cs, stmt->use.only)))
return false;
return true;
}
|
/*
*
* Copyright 2020 Asylo authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef ASYLO_IDENTITY_ATTESTATION_SGX_SGX_REMOTE_ASSERTION_GENERATOR_TEST_ENCLAVE_WRAPPER_H_
#define ASYLO_IDENTITY_ATTESTATION_SGX_SGX_REMOTE_ASSERTION_GENERATOR_TEST_ENCLAVE_WRAPPER_H_
#include <memory>
#include <string>
#include "asylo/client.h"
#include "asylo/enclave_manager.h"
#include "asylo/identity/attestation/sgx/sgx_remote_assertion_generator_test_enclave.pb.h"
#include "asylo/identity/identity.pb.h"
#include "asylo/identity/platform/sgx/sgx_identity.pb.h"
#include "asylo/util/status.h"
#include "asylo/util/statusor.h"
namespace asylo {
// Wrapper class for the SgxRemoteAssertionGeneratorTestEnclave, allowing
// callers to interact with the enclave without making EnterAndRun calls.
class SgxRemoteAssertionGeneratorTestEnclaveWrapper {
public:
// Load the test enclave from |enclave_path|.
static StatusOr<
std::unique_ptr<SgxRemoteAssertionGeneratorTestEnclaveWrapper>>
Load(asylo::EnclaveManager *enclave_manager, const std::string &enclave_path,
sgx::SgxRemoteAssertionGeneratorTestEnclaveConfig test_enclave_config);
SgxRemoteAssertionGeneratorTestEnclaveWrapper(EnclaveManager *enclave_manager,
EnclaveClient *enclave_client);
~SgxRemoteAssertionGeneratorTestEnclaveWrapper();
// Reset the assertion generator object held by the test enclave.
Status ResetGenerator();
// Returns the self identity of the test enclave.
StatusOr<SgxIdentity> GetSgxSelfIdentity();
// Returns |generator->IsInitialized()| from within the test enclave.
StatusOr<bool> IsInitialized();
// Returns |generator->Initialize(config)| from within the test enclave.
Status Initialize(const std::string &config);
// Returns |generator->CreateAssertionOffer()| from within the test enclave.
StatusOr<AssertionOffer> CreateAssertionOffer();
// Returns |generator->CreateGenerate(request)| from within the test enclave.
StatusOr<bool> CanGenerate(AssertionRequest request);
// Returns the assertion produced by calling |generator->Generate(user_data,
// request)| from within the test enclave.
StatusOr<Assertion> Generate(std::string user_data, AssertionRequest request);
private:
EnclaveManager *enclave_manager_;
EnclaveClient *enclave_client_;
};
} // namespace asylo
#endif // ASYLO_IDENTITY_ATTESTATION_SGX_SGX_REMOTE_ASSERTION_GENERATOR_TEST_ENCLAVE_WRAPPER_H_
|
/*!The Treasure Box Library
*
* 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.
*
* Copyright (C) 2009-present, TBOOX Open Source Group.
*
* @author ruki
* @file dbghelp.c
*
*/
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "dbghelp.h"
#include "../../atomic.h"
#include "../../../utils/singleton.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
static tb_bool_t tb_dbghelp_instance_init(tb_handle_t instance, tb_cpointer_t priv)
{
// check
tb_dbghelp_ref_t dbghelp = (tb_dbghelp_ref_t)instance;
tb_check_return_val(dbghelp, tb_false);
// the dbghelp module
HANDLE module = GetModuleHandleA("dbghelp.dll");
if (!module) module = (HANDLE)tb_dynamic_init("dbghelp.dll");
tb_check_return_val(module, tb_false);
// init interfaces
TB_INTERFACE_LOAD(dbghelp, SymInitialize);
tb_check_return_val(dbghelp->SymInitialize, tb_false);
// init symbols
if (!dbghelp->SymInitialize(GetCurrentProcess(), tb_null, TRUE)) return tb_false;
// init interfaces
TB_INTERFACE_LOAD(dbghelp, SymFromAddr);
TB_INTERFACE_LOAD(dbghelp, SymSetOptions);
// ok
return tb_true;
}
/* //////////////////////////////////////////////////////////////////////////////////////
* interfaces
*/
tb_dbghelp_ref_t tb_dbghelp()
{
// init
static tb_atomic32_t s_binited = 0;
static tb_dbghelp_t s_dbghelp = {0};
// init the static instance
tb_singleton_static_init(&s_binited, &s_dbghelp, tb_dbghelp_instance_init, tb_null);
// ok
return &s_dbghelp;
}
|
/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */
/* Copyright (c) 2011, 2012 Open Networking Foundation */
/* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */
/* See the file LICENSE.loci which should have been included in the source distribution */
#ifdef __GNUC__
#ifdef __linux__
/* glibc */
#include <features.h>
#else
/* NetBSD etc */
#include <sys/cdefs.h>
#ifdef __GNUC_PREREQ__
#define __GNUC_PREREQ __GNUC_PREREQ__
#endif
#endif
#ifndef __GNUC_PREREQ
/* fallback */
#define __GNUC_PREREQ(maj, min) 0
#endif
#if __GNUC_PREREQ(4,6)
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#endif
#include "loci_log.h"
#include "loci_int.h"
/**
* Associate an iterator with a list
* @param list The list to iterate over
* @param obj The list entry iteration pointer
* @return OF_ERROR_RANGE if the list is empty (end of list)
*
* The obj instance is completely initialized. The caller is responsible
* for cleaning up any wire buffers associated with obj before this call
*/
int
of_list_bsn_controller_connection_first(of_list_bsn_controller_connection_t *list, of_object_t *obj)
{
int rv;
of_bsn_controller_connection_init(obj, list->version, -1, 1);
if ((rv = of_list_first(list, obj)) < 0) {
return rv;
}
return rv;
}
/**
* Advance an iterator to the next element in a list
* @param list The list being iterated
* @param obj The list entry iteration pointer
* @return OF_ERROR_RANGE if already at the last entry on the list
*
*/
int
of_list_bsn_controller_connection_next(of_list_bsn_controller_connection_t *list, of_object_t *obj)
{
int rv;
if ((rv = of_list_next(list, obj)) < 0) {
return rv;
}
return rv;
}
/**
* Set up to append an object of type of_bsn_controller_connection to an of_list_bsn_controller_connection.
* @param list The list that is prepared for append
* @param obj Pointer to object to hold data to append
*
* The obj instance is completely initialized. The caller is responsible
* for cleaning up any wire buffers associated with obj before this call.
*
* See the generic documentation for of_list_append_bind.
*/
int
of_list_bsn_controller_connection_append_bind(of_list_bsn_controller_connection_t *list, of_object_t *obj)
{
return of_list_append_bind(list, obj);
}
/**
* Append an object to a of_list_bsn_controller_connection list.
*
* This copies data from obj and leaves item untouched.
*
* See the generic documentation for of_list_append.
*/
int
of_list_bsn_controller_connection_append(of_list_bsn_controller_connection_t *list, of_object_t *obj)
{
return of_list_append(list, obj);
}
/**
* \defgroup of_list_bsn_controller_connection of_list_bsn_controller_connection
*/
/**
* Create a new of_list_bsn_controller_connection object
*
* @param version The wire version to use for the object
* @return Pointer to the newly create object or NULL on error
*
* Initializes the new object with it's default fixed length associating
* a new underlying wire buffer.
*
* \ingroup of_list_bsn_controller_connection
*/
of_object_t *
of_list_bsn_controller_connection_new(of_version_t version)
{
of_object_t *obj;
int bytes;
bytes = of_object_fixed_len[version][OF_LIST_BSN_CONTROLLER_CONNECTION];
if ((obj = of_object_new(OF_WIRE_BUFFER_MAX_LENGTH)) == NULL) {
return NULL;
}
of_list_bsn_controller_connection_init(obj, version, bytes, 0);
return obj;
}
/**
* Initialize an object of type of_list_bsn_controller_connection.
*
* @param obj Pointer to the object to initialize
* @param version The wire version to use for the object
* @param bytes How many bytes in the object
* @param clean_wire Boolean: If true, clear the wire object control struct
*
* If bytes < 0, then the default fixed length is used for the object
*
* This is a "coerce" function that sets up the pointers for the
* accessors properly.
*
* If anything other than 0 is passed in for the buffer size, the underlying
* wire buffer will have 'grow' called.
*/
void
of_list_bsn_controller_connection_init(of_object_t *obj,
of_version_t version, int bytes, int clean_wire)
{
LOCI_ASSERT(of_object_fixed_len[version][OF_LIST_BSN_CONTROLLER_CONNECTION] >= 0);
if (clean_wire) {
MEMSET(obj, 0, sizeof(*obj));
}
if (bytes < 0) {
bytes = of_object_fixed_len[version][OF_LIST_BSN_CONTROLLER_CONNECTION];
}
obj->version = version;
obj->length = bytes;
obj->object_id = OF_LIST_BSN_CONTROLLER_CONNECTION;
/* Grow the wire buffer */
if (obj->wbuf != NULL) {
int tot_bytes;
tot_bytes = bytes + obj->obj_offset;
of_wire_buffer_grow(obj->wbuf, tot_bytes);
}
}
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/rel-2.0-xr-osx64-bld/build/xpcom/base/nsIDebug2.idl
*/
#ifndef __gen_nsIDebug2_h__
#define __gen_nsIDebug2_h__
#ifndef __gen_nsIDebug_h__
#include "nsIDebug.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDebug2 */
#define NS_IDEBUG2_IID_STR "9c9307ed-480a-4f2a-8f29-21378c03bcbc"
#define NS_IDEBUG2_IID \
{0x9c9307ed, 0x480a, 0x4f2a, \
{ 0x8f, 0x29, 0x21, 0x37, 0x8c, 0x03, 0xbc, 0xbc }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIDebug2 : public nsIDebug {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDEBUG2_IID)
/**
* Whether XPCOM was compiled with DEBUG defined. This often
* correlates to whether other code (e.g., Firefox, XULRunner) was
* compiled with DEBUG defined.
*/
/* readonly attribute boolean isDebugBuild; */
NS_SCRIPTABLE NS_IMETHOD GetIsDebugBuild(PRBool *aIsDebugBuild) = 0;
/**
* The number of assertions since process start.
*/
/* readonly attribute long assertionCount; */
NS_SCRIPTABLE NS_IMETHOD GetAssertionCount(PRInt32 *aAssertionCount) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDebug2, NS_IDEBUG2_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDEBUG2 \
NS_SCRIPTABLE NS_IMETHOD GetIsDebugBuild(PRBool *aIsDebugBuild); \
NS_SCRIPTABLE NS_IMETHOD GetAssertionCount(PRInt32 *aAssertionCount);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDEBUG2(_to) \
NS_SCRIPTABLE NS_IMETHOD GetIsDebugBuild(PRBool *aIsDebugBuild) { return _to GetIsDebugBuild(aIsDebugBuild); } \
NS_SCRIPTABLE NS_IMETHOD GetAssertionCount(PRInt32 *aAssertionCount) { return _to GetAssertionCount(aAssertionCount); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDEBUG2(_to) \
NS_SCRIPTABLE NS_IMETHOD GetIsDebugBuild(PRBool *aIsDebugBuild) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDebugBuild(aIsDebugBuild); } \
NS_SCRIPTABLE NS_IMETHOD GetAssertionCount(PRInt32 *aAssertionCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAssertionCount(aAssertionCount); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDebug2 : public nsIDebug2
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDEBUG2
nsDebug2();
private:
~nsDebug2();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDebug2, nsIDebug2)
nsDebug2::nsDebug2()
{
/* member initializers and constructor code */
}
nsDebug2::~nsDebug2()
{
/* destructor code */
}
/* readonly attribute boolean isDebugBuild; */
NS_IMETHODIMP nsDebug2::GetIsDebugBuild(PRBool *aIsDebugBuild)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute long assertionCount; */
NS_IMETHODIMP nsDebug2::GetAssertionCount(PRInt32 *aAssertionCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDebug2_h__ */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.