hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 588
values | lang stringclasses 305
values | max_stars_repo_path stringlengths 3 363 | max_stars_repo_name stringlengths 5 118 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringdate 2015-01-01 00:00:35 2022-03-31 23:43:49 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 12:37:38 2022-03-31 23:59:52 ⌀ | max_issues_repo_path stringlengths 3 363 | max_issues_repo_name stringlengths 5 118 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count float64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 363 | max_forks_repo_name stringlengths 5 135 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringdate 2015-01-01 00:01:02 2022-03-31 23:27:27 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 08:55:07 2022-03-31 23:59:24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1.13 1.04M | max_line_length int64 1 1.05M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2f0d12ee9b376d20d3cc7385cbf74b38a745fc7e | 3,472 | h | C | PrivateFrameworks/TextInputCore/TIMobileAssetMediator.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 17 | 2018-11-13T04:02:58.000Z | 2022-01-20T09:27:13.000Z | PrivateFrameworks/TextInputCore/TIMobileAssetMediator.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 3 | 2018-04-06T02:02:27.000Z | 2018-10-02T01:12:10.000Z | PrivateFrameworks/TextInputCore/TIMobileAssetMediator.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 1 | 2018-09-28T13:54:23.000Z | 2018-09-28T13:54:23.000Z | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSObject.h"
#import "TIMobileAssetMediator.h"
@class NSMutableSet, NSObject<OS_dispatch_queue>, NSString, TIMobileAssetSyncState;
@interface TIMobileAssetMediator : NSObject <TIMobileAssetMediator>
{
BOOL _isWaitingForReachability;
NSObject<OS_dispatch_queue> *_dispatchQueue;
NSMutableSet *_queuedAssetMatchSet;
TIMobileAssetSyncState *_syncState;
struct __SCNetworkReachability *_reachabilityRef;
}
+ (oneway void)downloadAsset:(id)arg1 continuation:(CDUnknownBlockType)arg2;
+ (id)downloadOptionsForAsset:(id)arg1;
+ (CDUnknownBlockType)downloadProgressHandlerForAsset:(id)arg1;
+ (id)fetchAssetInformationForDownloadsInProgress;
+ (id)fetchAssetInformationMatchingAny:(id)arg1 localOnly:(BOOL)arg2 compatibleOnly:(BOOL)arg3;
+ (id)queryAssetsWithPredicate:(id)arg1 localOnly:(BOOL)arg2 error:(id *)arg3;
+ (BOOL)isDownloadOverdueForAsset:(id)arg1;
+ (void)recordDownloadEndedForAsset:(id)arg1;
+ (void)recordDownloadStartedForAssets:(id)arg1;
+ (void)saveAssetDownloadsInProgress;
+ (id)assetDownloadsInProgress;
+ (id)assetsByRemovingOldVersionsFromAssets:(id)arg1;
+ (id)uniqueIdentifierWithVersionForAsset:(id)arg1;
+ (id)uniqueIdentifierForAsset:(id)arg1;
+ (id)predicateForTIAsset:(id)arg1;
+ (id)predicateForAssetMatch:(id)arg1 compatibleVersionOnly:(BOOL)arg2;
+ (id)predicateForKey:(id)arg1 matchingAnyDictionaryIn:(id)arg2 acceptUnspecifiedValue:(BOOL)arg3 acceptUnspecifiedAttribute:(BOOL)arg4 lenientMatch:(BOOL)arg5;
+ (id)predicateForKey:(id)arg1 matchingAnyStringIn:(id)arg2 acceptUnspecifiedValue:(BOOL)arg3;
+ (id)predicateForKey:(id)arg1 matchingString:(id)arg2 acceptUnspecifiedValue:(BOOL)arg3;
+ (id)compatibilityPredicate;
+ (id)knownAssetIdentifiers;
@property(readonly, nonatomic) struct __SCNetworkReachability *reachabilityRef; // @synthesize reachabilityRef=_reachabilityRef;
@property(readonly, nonatomic) TIMobileAssetSyncState *syncState; // @synthesize syncState=_syncState;
@property(nonatomic) BOOL isWaitingForReachability; // @synthesize isWaitingForReachability=_isWaitingForReachability;
@property(readonly, nonatomic) NSMutableSet *queuedAssetMatchSet; // @synthesize queuedAssetMatchSet=_queuedAssetMatchSet;
@property(readonly, nonatomic) NSObject<OS_dispatch_queue> *dispatchQueue; // @synthesize dispatchQueue=_dispatchQueue;
- (void).cxx_destruct;
- (void)downloadUninstalledAssetsMatching:(id)arg1 continuation:(CDUnknownBlockType)arg2;
- (id)fetchLatestInstalledAssetsMatchingAny:(id)arg1;
- (id)fetchLatestAssetsMatchingAny:(id)arg1;
- (BOOL)tryToPurgeAsset:(id)arg1;
- (id)fetchInstalledAssetInformation;
- (void)reachabilityChanged;
- (void)registerReachabilityCallback;
- (void)syncToRemoteMetadataIfNecessary;
- (void)retryDownloadsWhenReachable;
- (void)downloadUninstalledAssetsMatchingQueuedAssetMatchSet;
- (BOOL)shouldDownloadUninstalledAssets;
- (void)tryDownloadUninstalledAssetsMatchingQueuedAssetMatchSet;
- (oneway void)downloadAssets:(id)arg1 continuation:(CDUnknownBlockType)arg2;
- (oneway void)fetchUninstalledAssetInformationMatchingAny:(id)arg1 continuation:(CDUnknownBlockType)arg2;
- (void)dealloc;
- (id)init;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| 46.918919 | 160 | 0.81538 |
13c2fe25957640799732b5067443078abd8c3cd7 | 4,405 | c | C | tests/test_xfiber_semaphore.c | maskedw/picox | b8ddeb022741f4ff37c07d04a8e6f87ad5366bfe | [
"MIT"
] | 15 | 2015-06-30T13:03:57.000Z | 2022-03-11T03:02:07.000Z | tests/test_xfiber_semaphore.c | maskedw/picox | b8ddeb022741f4ff37c07d04a8e6f87ad5366bfe | [
"MIT"
] | 3 | 2015-07-13T02:31:07.000Z | 2019-02-19T12:54:14.000Z | tests/test_xfiber_semaphore.c | maskedw/picox | b8ddeb022741f4ff37c07d04a8e6f87ad5366bfe | [
"MIT"
] | null | null | null | #include <picox/multitask/xfiber.h>
#include "testutils.h"
#define KERNEL_WORK_SIZE (1024 * 20)
#define STACK_SIZE (2048)
#define PRIORITY (4)
TEST_GROUP(xfiber_semaphore);
TEST_SETUP(xfiber_semaphore)
{
}
TEST_TEAR_DOWN(xfiber_semaphore)
{
}
typedef struct
{
XTicks delay;
XFiberSemaphore* semaphore;
XTicks hold_time;
XError expect_err;
} TakeArg;
static TakeArg* CreateTakeArg(XFiberSemaphore* semaphore, XTicks delay, XTicks hold_time, XError expect_err)
{
TakeArg* ret = x_malloc(sizeof(TakeArg));
X_ASSERT(ret);
ret->delay = delay;
ret->hold_time = hold_time;
ret->semaphore = semaphore;
ret->expect_err = expect_err;
return ret;
}
typedef struct
{
XTicks delay;
XFiberEvent* semaphore;
} DestroyArg;
static DestroyArg* CreateDestroyArg(XFiberSemaphore* semaphore, XTicks delay)
{
DestroyArg* ret = x_malloc(sizeof(DestroyArg));
X_ASSERT(ret);
ret->delay = delay;
ret->semaphore = semaphore;
return ret;
}
static void TakeTask(void* a)
{
TakeArg* arg = a;
if (arg->delay > 0)
xfiber_delay(arg->delay);
const XError err = xfiber_semaphore_take(arg->semaphore);
TEST_ASSERT_EQUAL(arg->expect_err, err);
xfiber_delay(arg->hold_time);
xfiber_semaphore_give(arg->semaphore);
x_free(arg);
}
static void DestroyTask(void* a)
{
DestroyArg* arg = a;
if (arg->delay > 0)
xfiber_delay(arg->delay);
XFiberSemaphore* sem = arg->semaphore;
x_free(arg);
xfiber_semaphore_destroy(sem);
}
static void TakeTaskMain(void* a)
{
X_UNUSED(a);
XError err;
TakeArg* arg;
XFiberSemaphore* semaphore;
err = xfiber_semaphore_create(&semaphore, 2);
TEST_ASSERT_EQUAL(X_ERR_NONE, err);
arg = CreateTakeArg(semaphore, 0, x_msec_to_ticks(50), X_ERR_NONE);
TEST_ASSERT_EQUAL(X_ERR_NONE, xfiber_create(NULL, PRIORITY, "task1", STACK_SIZE, TakeTask, arg));
arg = CreateTakeArg(semaphore, 0, x_msec_to_ticks(50), X_ERR_NONE);
TEST_ASSERT_EQUAL(X_ERR_NONE, xfiber_create(NULL, PRIORITY, "task2", STACK_SIZE, TakeTask, arg));
xfiber_delay(x_msec_to_ticks(20));
err = xfiber_semaphore_try_take(semaphore);
TEST_ASSERT_EQUAL(X_ERR_TIMED_OUT, err);
err = xfiber_semaphore_take(semaphore);
TEST_ASSERT_EQUAL(X_ERR_NONE, err);
xfiber_semaphore_destroy(semaphore);
xfiber_kernel_end_scheduler();
}
static void TimedTakeTaskMain(void* a)
{
X_UNUSED(a);
XError err;
XFiberSemaphore* semaphore;
err = xfiber_semaphore_create(&semaphore, 2);
TEST_ASSERT_EQUAL(X_ERR_NONE, err);
TEST_ASSERT_EQUAL(X_ERR_NONE, xfiber_semaphore_take(semaphore));
TEST_ASSERT_EQUAL(X_ERR_NONE, xfiber_semaphore_take(semaphore));
TEST_ASSERT_EQUAL(X_ERR_TIMED_OUT, xfiber_semaphore_timed_take(semaphore, x_msec_to_ticks(50)));
xfiber_semaphore_destroy(semaphore);
xfiber_kernel_end_scheduler();
}
static void DestroyTaskMain(void* a)
{
X_UNUSED(a);
XError err;
DestroyArg* arg;
XFiberSemaphore* semaphore;
err = xfiber_semaphore_create(&semaphore, 2);
TEST_ASSERT_EQUAL(X_ERR_NONE, err);
arg = CreateDestroyArg(semaphore, x_msec_to_ticks(30));
xfiber_create(NULL, PRIORITY, "task1", STACK_SIZE, DestroyTask, arg);
TEST_ASSERT_EQUAL(X_ERR_NONE, xfiber_semaphore_take(semaphore));
TEST_ASSERT_EQUAL(X_ERR_NONE, xfiber_semaphore_take(semaphore));
TEST_ASSERT_EQUAL(X_ERR_CANCELED, xfiber_semaphore_take(semaphore));
xfiber_kernel_end_scheduler();
}
TEST(xfiber_semaphore, take)
{
xfiber_kernel_init(NULL, KERNEL_WORK_SIZE, NULL);
xfiber_create(NULL, PRIORITY, "main", STACK_SIZE, TakeTaskMain, NULL);
xfiber_kernel_start_scheduler();
}
TEST(xfiber_semaphore, timed_take)
{
xfiber_kernel_init(NULL, KERNEL_WORK_SIZE, NULL);
xfiber_create(NULL, PRIORITY, "main", STACK_SIZE, TimedTakeTaskMain, NULL);
xfiber_kernel_start_scheduler();
}
TEST(xfiber_semaphore, destroy)
{
xfiber_kernel_init(NULL, KERNEL_WORK_SIZE, NULL);
xfiber_create(NULL, PRIORITY, "main", STACK_SIZE, DestroyTaskMain, NULL);
xfiber_kernel_start_scheduler();
}
TEST_GROUP_RUNNER(xfiber_semaphore)
{
RUN_TEST_CASE(xfiber_semaphore, take);
RUN_TEST_CASE(xfiber_semaphore, timed_take);
RUN_TEST_CASE(xfiber_semaphore, destroy);
}
| 22.47449 | 108 | 0.714415 |
fa9a6db18d87c8b1afbe33859e29086e1044a923 | 242 | h | C | sources/YHProxy.h | yuhechuan/YHProxyRouter | d16c28de8100f9ba8e5c79fe5bea9a9dd5ae6cd4 | [
"MIT"
] | 3 | 2017-11-04T11:45:19.000Z | 2017-11-25T13:48:39.000Z | sources/YHProxy.h | yuhechuan/YHProxyRouter | d16c28de8100f9ba8e5c79fe5bea9a9dd5ae6cd4 | [
"MIT"
] | null | null | null | sources/YHProxy.h | yuhechuan/YHProxyRouter | d16c28de8100f9ba8e5c79fe5bea9a9dd5ae6cd4 | [
"MIT"
] | null | null | null | //
// YHProxy.h
// YHProxyRouterDemo
//
// Created by apple on 2017/11/4.
// Copyright © 2017年 玉河川. All rights reserved.
//
#ifndef YHProxy_h
#define YHProxy_h
#import "YHProxyRouter.h"
#import "NSObject+Router.h"
#endif /* YHProxy_h */
| 17.285714 | 47 | 0.690083 |
faac3600a8327e097db8662248041c2127b2b735 | 288 | h | C | WatchPics/AppDelegate.h | D-32/WatchPics | cc39162e0c9d9b13e0ca3599f5cf2be9b507491c | [
"Apache-2.0"
] | 107 | 2015-01-12T22:23:28.000Z | 2022-03-28T20:24:50.000Z | WatchPics/AppDelegate.h | D-32/WatchPics | cc39162e0c9d9b13e0ca3599f5cf2be9b507491c | [
"Apache-2.0"
] | 5 | 2015-01-23T12:04:57.000Z | 2021-01-24T11:04:30.000Z | WatchPics/AppDelegate.h | D-32/WatchPics | cc39162e0c9d9b13e0ca3599f5cf2be9b507491c | [
"Apache-2.0"
] | 21 | 2015-01-19T15:30:10.000Z | 2022-02-08T12:50:42.000Z | //
// AppDelegate.h
// WatchPics
//
// Created by Dylan Marriott on 10/01/15.
// Copyright (c) 2015 Dylan Marriott. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| 16 | 60 | 0.708333 |
7a321eb6310a6db07edb153aca92526a5851d990 | 966 | h | C | catkin_ws/src/omron_cad_matching/include/omron_cad_matching/util_cam.h | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | catkin_ws/src/omron_cad_matching/include/omron_cad_matching/util_cam.h | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null | catkin_ws/src/omron_cad_matching/include/omron_cad_matching/util_cam.h | DevwratJoshi/ur-o2as | 265249c27908a79a301014168394db0c0dc2204c | [
"MIT"
] | null | null | null |
#pragma once
#include "win_type.h"
#include <opencv2/core.hpp>
#include <sensor_msgs/PointCloud2.h>
// Save and read poinc cloud data
INT32 ReadPointCloudTiff(const char *tiff_filename, INT32 *width, INT32 *height, float **point_cloud);
void SavePointCloudToTiff(float *src_pc, INT32 width, INT32 height, char *fileName);
INT32 GetPointCloudBinary(sensor_msgs::PointCloud2& cloud_msg, float *point_cloud);
INT32 ReadPointCloudBinary(const char *binary_filename, INT32 width, INT32 height, float *point_cloud);
INT32 SavePointCloudToBinary(float *src_pc, INT32 width, INT32 height, char *fileName);
// Save and read image data
INT32 GetImageData(cv::Mat const & cv_inputImg, const INT32 color_num, INT32 *width, INT32 *height, INT32 *channel, UINT8 **src_img);
INT32 ReadImageData(const char *filename, const INT32 color_num, INT32 *width, INT32 *height, INT32 *channel, UINT8 **src_img);
INT32 ReadImage(char *filename, const int color_num, cv::Mat& cv_image);
| 50.842105 | 133 | 0.783644 |
285ba576db996535e3f9f0ce77ea060644ec8ccb | 211 | h | C | Tun2Web/Configs/BrowserNativeManager/LWErrorHandler.h | maxingchuan/Tun2Web | bfed107e8bb44f98607155f046384941a7e89851 | [
"MIT"
] | 2 | 2017-02-15T03:01:05.000Z | 2017-02-15T06:29:16.000Z | Tun2Web/Configs/BrowserNativeManager/LWErrorHandler.h | maxingchuan/Tun2Web | bfed107e8bb44f98607155f046384941a7e89851 | [
"MIT"
] | null | null | null | Tun2Web/Configs/BrowserNativeManager/LWErrorHandler.h | maxingchuan/Tun2Web | bfed107e8bb44f98607155f046384941a7e89851 | [
"MIT"
] | null | null | null | //
// LWErrorHandler.h
// ToonBrowser
//
// Created by kevinma on 16/5/10.
// Copyright © 2016年 kevinma. All rights reserved.
//
#import "TNBBaseHandler.h"
@interface LWErrorHandler : TNBBaseHandler
@end
| 15.071429 | 51 | 0.701422 |
2cf81833a26114a1c60b41f84c664f642aec1e2e | 7,221 | h | C | libraries/ostrich/backend/model/rdf_operators.h | YYTVicky/marmotta | 28c9b8b0791ea1693578af302981a1358e56933d | [
"CC-BY-3.0",
"Apache-2.0"
] | 45 | 2015-01-07T08:56:24.000Z | 2021-12-23T03:06:04.000Z | libraries/ostrich/backend/model/rdf_operators.h | YYTVicky/marmotta | 28c9b8b0791ea1693578af302981a1358e56933d | [
"CC-BY-3.0",
"Apache-2.0"
] | 11 | 2015-08-20T19:15:16.000Z | 2020-04-30T01:40:03.000Z | libraries/ostrich/backend/model/rdf_operators.h | isabella232/marmotta | 28c9b8b0791ea1693578af302981a1358e56933d | [
"CC-BY-3.0",
"Apache-2.0"
] | 71 | 2015-02-03T19:59:19.000Z | 2022-01-15T17:43:49.000Z | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MARMOTTA_RDF_OPERATORS_H
#define MARMOTTA_RDF_OPERATORS_H
#include "model/rdf_model.h"
namespace marmotta {
namespace rdf {
namespace proto {
inline bool operator==(const Namespace &lhs, const Namespace &rhs) {
return lhs.uri() == rhs.uri();
}
inline bool operator!=(const Namespace &lhs, const Namespace &rhs) {
return lhs.uri() != rhs.uri();
}
inline bool operator==(const URI &lhs, const URI &rhs) {
return lhs.uri() == rhs.uri();
}
inline bool operator!=(const URI &lhs, const URI &rhs) {
return lhs.uri() != rhs.uri();
}
inline bool operator==(const BNode &lhs, const BNode &rhs) {
return lhs.id() == rhs.id();
}
inline bool operator!=(const BNode &lhs, const BNode &rhs) {
return lhs.id() != rhs.id();
}
inline bool operator==(const StringLiteral &lhs, const StringLiteral &rhs) {
return lhs.content() == rhs.content() && lhs.language() == rhs.language();
}
inline bool operator!=(const StringLiteral &lhs, const StringLiteral &rhs) {
return lhs.content() != rhs.content() || lhs.language() != rhs.language();
}
inline bool operator==(const DatatypeLiteral &lhs, const DatatypeLiteral &rhs) {
return lhs.content() == rhs.content() && lhs.datatype().uri() == rhs.datatype().uri();
}
inline bool operator!=(const DatatypeLiteral &lhs, const DatatypeLiteral &rhs) {
return lhs.content() != rhs.content() || lhs.datatype().uri() != rhs.datatype().uri();
}
bool operator==(const Value &lhs, const Value &rhs);
inline bool operator!=(const Value &lhs, const Value &rhs) {
return !operator==(lhs,rhs);
};
bool operator==(const Resource &lhs, const Resource &rhs);
inline bool operator!=(const Resource &lhs, const Resource &rhs) {
return !operator==(lhs,rhs);
};
bool operator==(const Statement &lhs, const Statement &rhs);
inline bool operator!=(const Statement &lhs, const Statement &rhs) {
return !operator==(lhs,rhs);
};
} // namespace proto
inline bool operator==(const Namespace &lhs, const Namespace &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const Namespace &lhs, const Namespace &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const URI &lhs, const URI &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const URI &lhs, const URI &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const BNode &lhs, const BNode &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const BNode &lhs, const BNode &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const StringLiteral &lhs, const StringLiteral &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const StringLiteral &lhs, const StringLiteral &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const DatatypeLiteral &lhs, const DatatypeLiteral &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const DatatypeLiteral &lhs, const DatatypeLiteral &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const Value &lhs, const Value &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const Value &lhs, const Value &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const Resource &lhs, const Resource &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const Resource &lhs, const Resource &rhs) {
return !operator==(lhs,rhs);
}
inline bool operator==(const Statement &lhs, const Statement &rhs) {
return lhs.getMessage() == rhs.getMessage();
}
inline bool operator!=(const Statement &lhs, const Statement &rhs) {
return !operator==(lhs,rhs);
}
} // namespace rdf
} // namespace marmotta
namespace std {
// Define std::hash specializations for our proto messages. Note that this generic
// computation serializes the message and is therefore expensive. Consider using
// specialised implementations instead.
template<>
struct hash<google::protobuf::Message> {
std::size_t operator()(const google::protobuf::Message &k) const {
std::string content;
k.SerializeToString(&content);
return std::hash<string>()(content);
}
};
// Hash implementation for URIs. Uses a faster implementation than the generic
// proto message version.
template<>
struct hash<marmotta::rdf::proto::URI> {
std::size_t operator()(const marmotta::rdf::proto::URI &k) const {
return std::hash<std::string>()(k.uri());
}
};
// Hash implementation for BNodes. Uses a faster implementation than the generic
// proto message version.
template<>
struct hash<marmotta::rdf::proto::BNode> {
std::size_t operator()(const marmotta::rdf::proto::BNode &k) const {
return std::hash<std::string>()(k.id());
}
};
// Hash implementation for Resources. Uses a faster implementation than the generic
// proto message version.
template<>
struct hash<marmotta::rdf::proto::Resource> {
std::size_t operator()(const marmotta::rdf::proto::Resource &k) const {
if (k.has_uri()) {
return std::hash<marmotta::rdf::proto::URI>()(k.uri());
} else if (k.has_bnode()) {
return std::hash<marmotta::rdf::proto::BNode>()(k.bnode());
}
return std::hash<google::protobuf::Message>()(k);
}
};
template<>
struct hash<marmotta::rdf::proto::Value> {
std::size_t operator()(const marmotta::rdf::proto::Value &k) const {
return std::hash<google::protobuf::Message>()(k);
}
};
template<>
struct hash<marmotta::rdf::proto::StringLiteral> {
std::size_t operator()(const marmotta::rdf::proto::StringLiteral &k) const {
return std::hash<google::protobuf::Message>()(k);
}
};
template<>
struct hash<marmotta::rdf::proto::DatatypeLiteral> {
std::size_t operator()(const marmotta::rdf::proto::DatatypeLiteral &k) const {
return std::hash<google::protobuf::Message>()(k);
}
};
template<>
struct hash<marmotta::rdf::proto::Statement> {
std::size_t operator()(const marmotta::rdf::proto::Statement &k) const {
return std::hash<google::protobuf::Message>()(k);
}
};
template<>
struct hash<marmotta::rdf::proto::Namespace> {
std::size_t operator()(const marmotta::rdf::proto::Namespace &k) const {
return std::hash<google::protobuf::Message>()(k);
}
};
} // namespace std
#endif //MARMOTTA_RDF_OPERATORS_H
| 29.962656 | 90 | 0.680792 |
2cc3fc060c1914892452c329c98494ace409fb20 | 5,185 | c | C | src/Event.c | armdevvel/ClassiCube | 436f5b1c9b8eeaa1c844dc0c62fa5fbfbb5532fa | [
"BSD-3-Clause"
] | 2 | 2021-09-08T11:26:56.000Z | 2021-11-10T12:13:45.000Z | src/Event.c | armdevvel/ClassiCube | 436f5b1c9b8eeaa1c844dc0c62fa5fbfbb5532fa | [
"BSD-3-Clause"
] | null | null | null | src/Event.c | armdevvel/ClassiCube | 436f5b1c9b8eeaa1c844dc0c62fa5fbfbb5532fa | [
"BSD-3-Clause"
] | 1 | 2016-03-02T19:18:31.000Z | 2016-03-02T19:18:31.000Z | #include "Event.h"
#include "Logger.h"
struct _EntityEventsList EntityEvents;
struct _TabListEventsList TabListEvents;
struct _TextureEventsList TextureEvents;
struct _GfxEventsList GfxEvents;
struct _UserEventsList UserEvents;
struct _BlockEventsList BlockEvents;
struct _WorldEventsList WorldEvents;
struct _ChatEventsList ChatEvents;
struct _WindowEventsList WindowEvents;
struct _InputEventsList InputEvents;
struct _PointerEventsList PointerEvents;
struct _NetEventsList NetEvents;
void Event_Register(struct Event_Void* handlers, void* obj, Event_Void_Callback handler) {
int i;
for (i = 0; i < handlers->Count; i++) {
if (handlers->Handlers[i] == handler && handlers->Objs[i] == obj) {
Logger_Abort("Attempt to register event handler that was already registered");
}
}
if (handlers->Count == EVENT_MAX_CALLBACKS) {
Logger_Abort("Unable to register another event handler");
} else {
handlers->Handlers[handlers->Count] = handler;
handlers->Objs[handlers->Count] = obj;
handlers->Count++;
}
}
void Event_Unregister(struct Event_Void* handlers, void* obj, Event_Void_Callback handler) {
int i, j;
for (i = 0; i < handlers->Count; i++) {
if (handlers->Handlers[i] != handler || handlers->Objs[i] != obj) continue;
/* Remove this handler from the list, by shifting all following handlers left */
for (j = i; j < handlers->Count - 1; j++) {
handlers->Handlers[j] = handlers->Handlers[j + 1];
handlers->Objs[j] = handlers->Objs[j + 1];
}
handlers->Count--;
handlers->Handlers[handlers->Count] = NULL;
handlers->Objs[handlers->Count] = NULL;
return;
}
}
void Event_UnregisterAll(void) {
/* NOTE: This must be kept in sync with Event.h list of events */
EntityEvents.Added.Count = 0;
EntityEvents.Removed.Count = 0;
TabListEvents.Added.Count = 0;
TabListEvents.Changed.Count = 0;
TabListEvents.Removed.Count = 0;
TextureEvents.AtlasChanged.Count = 0;
TextureEvents.PackChanged.Count = 0;
TextureEvents.FileChanged.Count = 0;
GfxEvents.ViewDistanceChanged.Count = 0;
GfxEvents.LowVRAMDetected.Count = 0;
GfxEvents.ProjectionChanged.Count = 0;
GfxEvents.ContextLost.Count = 0;
GfxEvents.ContextRecreated.Count = 0;
UserEvents.BlockChanged.Count = 0;
UserEvents.HackPermsChanged.Count = 0;
UserEvents.HeldBlockChanged.Count = 0;
BlockEvents.PermissionsChanged.Count = 0;
BlockEvents.BlockDefChanged.Count = 0;
WorldEvents.NewMap.Count = 0;
WorldEvents.Loading.Count = 0;
WorldEvents.MapLoaded.Count = 0;
WorldEvents.EnvVarChanged.Count = 0;
ChatEvents.FontChanged.Count = 0;
ChatEvents.ChatReceived.Count = 0;
ChatEvents.ChatSending.Count = 0;
ChatEvents.ColCodeChanged.Count = 0;
WindowEvents.Redraw.Count = 0;
WindowEvents.Resized.Count = 0;
WindowEvents.Closing.Count = 0;
WindowEvents.FocusChanged.Count = 0;
WindowEvents.StateChanged.Count = 0;
WindowEvents.Created.Count = 0;
InputEvents.Press.Count = 0;
InputEvents.Down.Count = 0;
InputEvents.Up.Count = 0;
InputEvents.Wheel.Count = 0;
InputEvents.TextChanged.Count = 0;
PointerEvents.Moved.Count = 0;
PointerEvents.Down.Count = 0;
PointerEvents.Up.Count = 0;
PointerEvents.RawMoved.Count = 0;
NetEvents.Connected.Count = 0;
NetEvents.Disconnected.Count = 0;
}
void Event_RaiseVoid(struct Event_Void* handlers) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i]);
}
}
void Event_RaiseInt(struct Event_Int* handlers, int arg) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], arg);
}
}
void Event_RaiseFloat(struct Event_Float* handlers, float arg) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], arg);
}
}
void Event_RaiseEntry(struct Event_Entry* handlers, struct Stream* stream, const cc_string* name) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], stream, name);
}
}
void Event_RaiseBlock(struct Event_Block* handlers, IVec3 coords, BlockID oldBlock, BlockID block) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], coords, oldBlock, block);
}
}
void Event_RaiseChat(struct Event_Chat* handlers, const cc_string* msg, int msgType) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], msg, msgType);
}
}
void Event_RaiseInput(struct Event_Input* handlers, int key, cc_bool repeating) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], key, repeating);
}
}
void Event_RaiseString(struct Event_String* handlers, const cc_string* str) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], str);
}
}
void Event_RaiseRawMove(struct Event_RawMove* handlers, float xDelta, float yDelta) {
int i;
for (i = 0; i < handlers->Count; i++) {
handlers->Handlers[i](handlers->Objs[i], xDelta, yDelta);
}
}
| 30.145349 | 101 | 0.683124 |
89efd65b1f7137d9f22221e18cd1b04395f29a4f | 1,920 | h | C | Project/Temp/StagingArea/Data/il2cppOutput/UnityEngine_UI_UnityEngine_EventSystems_PointerInp3709210170.h | Yuunagi-Yu/NumberDisk | f1cf414dbfe8d0094d3ef11b37839f6caf58ae9f | [
"MIT"
] | null | null | null | Project/Temp/StagingArea/Data/il2cppOutput/UnityEngine_UI_UnityEngine_EventSystems_PointerInp3709210170.h | Yuunagi-Yu/NumberDisk | f1cf414dbfe8d0094d3ef11b37839f6caf58ae9f | [
"MIT"
] | null | null | null | Project/Temp/StagingArea/Data/il2cppOutput/UnityEngine_UI_UnityEngine_EventSystems_PointerInp3709210170.h | Yuunagi-Yu/NumberDisk | f1cf414dbfe8d0094d3ef11b37839f6caf58ae9f | [
"MIT"
] | null | null | null | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// UnityEngine.EventSystems.PointerEventData
struct PointerEventData_t1599784723;
#include "mscorlib_System_Object2689449295.h"
#include "UnityEngine_UI_UnityEngine_EventSystems_PointerEve1414739712.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.EventSystems.PointerInputModule/MouseButtonEventData
struct MouseButtonEventData_t3709210170 : public Il2CppObject
{
public:
// UnityEngine.EventSystems.PointerEventData/FramePressState UnityEngine.EventSystems.PointerInputModule/MouseButtonEventData::buttonState
int32_t ___buttonState_0;
// UnityEngine.EventSystems.PointerEventData UnityEngine.EventSystems.PointerInputModule/MouseButtonEventData::buttonData
PointerEventData_t1599784723 * ___buttonData_1;
public:
inline static int32_t get_offset_of_buttonState_0() { return static_cast<int32_t>(offsetof(MouseButtonEventData_t3709210170, ___buttonState_0)); }
inline int32_t get_buttonState_0() const { return ___buttonState_0; }
inline int32_t* get_address_of_buttonState_0() { return &___buttonState_0; }
inline void set_buttonState_0(int32_t value)
{
___buttonState_0 = value;
}
inline static int32_t get_offset_of_buttonData_1() { return static_cast<int32_t>(offsetof(MouseButtonEventData_t3709210170, ___buttonData_1)); }
inline PointerEventData_t1599784723 * get_buttonData_1() const { return ___buttonData_1; }
inline PointerEventData_t1599784723 ** get_address_of_buttonData_1() { return &___buttonData_1; }
inline void set_buttonData_1(PointerEventData_t1599784723 * value)
{
___buttonData_1 = value;
Il2CppCodeGenWriteBarrier(&___buttonData_1, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| 34.285714 | 147 | 0.829688 |
d631f58aab7473eb13bde4007a1fed9afa1c5ac9 | 5,755 | h | C | llvm/include/llvm/Target/TargetLoweringObjectFile.h | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 3 | 2019-02-12T04:14:39.000Z | 2020-11-05T08:46:20.000Z | llvm/include/llvm/Target/TargetLoweringObjectFile.h | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 1 | 2020-02-22T09:59:21.000Z | 2020-02-22T09:59:21.000Z | llvm/include/llvm/Target/TargetLoweringObjectFile.h | clairechingching/ScaffCC | 737ae90f85d9fe79819d66219747d27efa4fa5b9 | [
"BSD-2-Clause"
] | 1 | 2022-02-05T23:42:06.000Z | 2022-02-05T23:42:06.000Z | //===-- llvm/Target/TargetLoweringObjectFile.h - Object Info ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements classes used to handle lowerings specific to common
// object file formats.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H
#define LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H
#include "llvm/Module.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/SectionKind.h"
#include "llvm/ADT/ArrayRef.h"
namespace llvm {
class MachineModuleInfo;
class Mangler;
class MCContext;
class MCExpr;
class MCSection;
class MCSymbol;
class MCStreamer;
class GlobalValue;
class TargetMachine;
class TargetLoweringObjectFile : public MCObjectFileInfo {
MCContext *Ctx;
TargetLoweringObjectFile(const TargetLoweringObjectFile&); // DO NOT IMPLEMENT
void operator=(const TargetLoweringObjectFile&); // DO NOT IMPLEMENT
public:
MCContext &getContext() const { return *Ctx; }
TargetLoweringObjectFile() : MCObjectFileInfo(), Ctx(0) {}
virtual ~TargetLoweringObjectFile();
/// Initialize - this method must be called before any actual lowering is
/// done. This specifies the current context for codegen, and gives the
/// lowering implementations a chance to set up their default sections.
virtual void Initialize(MCContext &ctx, const TargetMachine &TM);
virtual void emitPersonalityValue(MCStreamer &Streamer,
const TargetMachine &TM,
const MCSymbol *Sym) const;
/// emitModuleFlags - Emit the module flags that the platform cares about.
virtual void emitModuleFlags(MCStreamer &,
ArrayRef<Module::ModuleFlagEntry>,
Mangler *, const TargetMachine &) const {
}
/// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
/// decide not to emit the UsedDirective for some symbols in llvm.used.
/// FIXME: REMOVE this (rdar://7071300)
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
Mangler *) const {
return GV != 0;
}
/// getSectionForConstant - Given a constant with the SectionKind, return a
/// section that it should be placed in.
virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
/// getKindForGlobal - Classify the specified global variable into a set of
/// target independent categories embodied in SectionKind.
static SectionKind getKindForGlobal(const GlobalValue *GV,
const TargetMachine &TM);
/// SectionForGlobal - This method computes the appropriate section to emit
/// the specified global variable or function definition. This should not
/// be passed external (or available externally) globals.
const MCSection *SectionForGlobal(const GlobalValue *GV,
SectionKind Kind, Mangler *Mang,
const TargetMachine &TM) const;
/// SectionForGlobal - This method computes the appropriate section to emit
/// the specified global variable or function definition. This should not
/// be passed external (or available externally) globals.
const MCSection *SectionForGlobal(const GlobalValue *GV,
Mangler *Mang,
const TargetMachine &TM) const {
return SectionForGlobal(GV, getKindForGlobal(GV, TM), Mang, TM);
}
/// getExplicitSectionGlobal - Targets should implement this method to assign
/// a section to globals with an explicit section specfied. The
/// implementation of this method can assume that GV->hasSection() is true.
virtual const MCSection *
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const = 0;
/// getSpecialCasedSectionGlobals - Allow the target to completely override
/// section assignment of a global.
virtual const MCSection *
getSpecialCasedSectionGlobals(const GlobalValue *GV, Mangler *Mang,
SectionKind Kind) const {
return 0;
}
/// getExprForDwarfGlobalReference - Return an MCExpr to use for a reference
/// to the specified global variable from exception handling information.
///
virtual const MCExpr *
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const;
// getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
virtual MCSymbol *
getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
MachineModuleInfo *MMI) const;
///
const MCExpr *
getExprForDwarfReference(const MCSymbol *Sym, unsigned Encoding,
MCStreamer &Streamer) const;
virtual const MCSection *
getStaticCtorSection(unsigned Priority = 65535) const {
(void)Priority;
return StaticCtorSection;
}
virtual const MCSection *
getStaticDtorSection(unsigned Priority = 65535) const {
(void)Priority;
return StaticDtorSection;
}
protected:
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const;
};
} // end namespace llvm
#endif
| 38.885135 | 80 | 0.656125 |
d63ce70c13e51855c58c2a272791daceaf59a5f6 | 890 | h | C | src/xenia/app/discord/discord_presence.h | Blaise170/xenia | 70b9672fed0466a32f3bfd6f181ec5cdbbe0b07f | [
"BSD-3-Clause"
] | 6 | 2019-05-12T17:34:21.000Z | 2019-09-08T17:47:29.000Z | src/xenia/app/discord/discord_presence.h | Blaise170/xenia | 70b9672fed0466a32f3bfd6f181ec5cdbbe0b07f | [
"BSD-3-Clause"
] | null | null | null | src/xenia/app/discord/discord_presence.h | Blaise170/xenia | 70b9672fed0466a32f3bfd6f181ec5cdbbe0b07f | [
"BSD-3-Clause"
] | 2 | 2019-09-02T23:21:47.000Z | 2022-01-18T21:22:16.000Z | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_DISCORD_DISCORD_PRESENCE_H_
#define XENIA_DISCORD_DISCORD_PRESENCE_H_
#include <string>
namespace xe {
namespace discord {
class DiscordPresence {
public:
static void Initialize();
static void NotPlaying();
static void PlayingTitle(const std::wstring& game_title);
static void Shutdown();
};
} // namespace discord
} // namespace xe
#endif // XENIA_DISCORD_DISCORD_PRESENCE_H_
| 29.666667 | 78 | 0.501124 |
65a45f0a63037b13204cdd8c8380f8b811fb2af4 | 6,918 | c | C | tester/dtmf_tester.c | garronej/linphone | f61a337f5363b991d6e866a6aa7d303658c04073 | [
"BSD-2-Clause"
] | null | null | null | tester/dtmf_tester.c | garronej/linphone | f61a337f5363b991d6e866a6aa7d303658c04073 | [
"BSD-2-Clause"
] | null | null | null | tester/dtmf_tester.c | garronej/linphone | f61a337f5363b991d6e866a6aa7d303658c04073 | [
"BSD-2-Clause"
] | 1 | 2021-03-17T10:04:06.000Z | 2021-03-17T10:04:06.000Z | /*
liblinphone_tester - liblinphone test suite
Copyright (C) 2013 Belledonne Communications SARL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "liblinphone_tester.h"
#include "private.h"
void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
stats* counters = get_stats(lc);
char** dst = &counters->dtmf_list_received;
*dst = *dst ?
ms_strcat_printf(*dst, "%c", dtmf)
: ms_strdup_printf("%c", dtmf);
counters->dtmf_count++;
}
void send_dtmf_base(LinphoneCoreManager **pmarie, LinphoneCoreManager **ppauline, bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq, bool_t use_opus) {
char* expected = NULL;
int dtmf_count_prev;
LinphoneCoreManager *marie = *pmarie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager *pauline = *ppauline = linphone_core_manager_new( "pauline_tcp_rc");
LinphoneCall *marie_call = NULL;
if (use_opus) {
//if (!ms_filter_codec_supported("opus")) {
if(!ms_factory_codec_supported(marie->lc->factory, "opus") && !ms_factory_codec_supported(pauline->lc->factory, "opus")){
ms_warning("Opus not supported, skipping test.");
return;
}
disable_all_audio_codecs_except_one(marie->lc, "opus", 48000);
disable_all_audio_codecs_except_one(pauline->lc, "opus", 48000);
}
linphone_core_set_use_rfc2833_for_dtmf(marie->lc, use_rfc2833);
linphone_core_set_use_info_for_dtmf(marie->lc, use_sipinfo);
linphone_core_set_use_rfc2833_for_dtmf(pauline->lc, use_rfc2833);
linphone_core_set_use_info_for_dtmf(pauline->lc, use_sipinfo);
BC_ASSERT_TRUE(call(pauline,marie));
marie_call = linphone_core_get_current_call(marie->lc);
BC_ASSERT_PTR_NOT_NULL(marie_call);
if (!marie_call) return;
if (dtmf != '\0') {
dtmf_count_prev = pauline->stat.dtmf_count;
linphone_call_send_dtmf(marie_call, dtmf);
/*wait for the DTMF to be received from pauline*/
BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &pauline->stat.dtmf_count, dtmf_count_prev+1, 10000));
expected = ms_strdup_printf("%c", dtmf);
}
if (dtmf_seq != NULL) {
int dtmf_delay_ms = lp_config_get_int(marie_call->core->config,"net","dtmf_delay_ms",200);
dtmf_count_prev = pauline->stat.dtmf_count;
linphone_call_send_dtmfs(marie_call, dtmf_seq);
/*wait for the DTMF sequence to be received from pauline*/
BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &pauline->stat.dtmf_count, (int)(dtmf_count_prev + strlen(dtmf_seq)), (int)(10000 + dtmf_delay_ms * strlen(dtmf_seq))));
expected = (dtmf!='\0')?ms_strdup_printf("%c%s",dtmf,dtmf_seq):ms_strdup(dtmf_seq);
}
if (expected != NULL) {
BC_ASSERT_PTR_NOT_NULL(pauline->stat.dtmf_list_received);
if (pauline->stat.dtmf_list_received) {
BC_ASSERT_STRING_EQUAL(pauline->stat.dtmf_list_received, expected);
}
ms_free(expected);
} else {
BC_ASSERT_PTR_NULL(pauline->stat.dtmf_list_received);
}
}
void send_dtmf_cleanup(LinphoneCoreManager *marie, LinphoneCoreManager *pauline) {
LinphoneCall *marie_call = linphone_core_get_current_call(marie->lc);
if (marie_call) {
BC_ASSERT_PTR_NULL(marie_call->dtmfs_timer);
BC_ASSERT_PTR_NULL(marie_call->dtmf_sequence);
/*just to sleep*/
linphone_core_terminate_all_calls(pauline->lc);
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1));
BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1));
}
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
static void send_dtmf_rfc2833(void) {
LinphoneCoreManager *marie, *pauline;
send_dtmf_base(&marie, &pauline, TRUE,FALSE,'1',NULL,FALSE);
send_dtmf_cleanup(marie, pauline);
}
static void send_dtmf_sip_info(void) {
LinphoneCoreManager *marie, *pauline;
send_dtmf_base(&marie, &pauline, FALSE,TRUE,'#',NULL,FALSE);
send_dtmf_cleanup(marie, pauline);
}
static void send_dtmfs_sequence_rfc2833(void) {
LinphoneCoreManager *marie, *pauline;
send_dtmf_base(&marie, &pauline, TRUE,FALSE,'\0',"1230#",FALSE);
send_dtmf_cleanup(marie, pauline);
}
static void send_dtmfs_sequence_sip_info(void) {
LinphoneCoreManager *marie, *pauline;
send_dtmf_base(&marie, &pauline, FALSE,TRUE,'\0',"1230#",FALSE);
send_dtmf_cleanup(marie, pauline);
}
static void send_dtmfs_sequence_not_ready(void) {
LinphoneCoreManager *marie;
marie = linphone_core_manager_new( "marie_rc");
BC_ASSERT_EQUAL(linphone_call_send_dtmfs(linphone_core_get_current_call(marie->lc), "123"), -1, int, "%d");
linphone_core_manager_destroy(marie);
}
static void send_dtmfs_sequence_call_state_changed(void) {
LinphoneCoreManager *marie, *pauline;
LinphoneCall *marie_call = NULL;
send_dtmf_base(&marie, &pauline, FALSE,TRUE,'\0',NULL,FALSE);
marie_call = linphone_core_get_current_call(marie->lc);
if (marie_call) {
/*very long DTMF(around 4 sec to be sent)*/
linphone_call_send_dtmfs(marie_call, "123456789123456789");
/*just after, change call state, and expect DTMF to be canceled*/
linphone_call_pause(marie_call);
BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallPausing,1));
BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&marie->stat.number_of_LinphoneCallPaused,1));
/*wait a few time to ensure that no DTMF are received*/
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000);
BC_ASSERT_PTR_NULL(pauline->stat.dtmf_list_received);
}
end_call(marie, pauline);
send_dtmf_cleanup(marie, pauline);
}
static void send_dtmf_rfc2833_opus(void) {
LinphoneCoreManager *marie, *pauline;
send_dtmf_base(&marie, &pauline, TRUE,FALSE,'1',NULL,TRUE);
send_dtmf_cleanup(marie, pauline);
}
test_t dtmf_tests[] = {
TEST_NO_TAG("Send DTMF using RFC2833",send_dtmf_rfc2833),
TEST_NO_TAG("Send DTMF using SIP INFO",send_dtmf_sip_info),
TEST_NO_TAG("Send DTMF sequence using RFC2833",send_dtmfs_sequence_rfc2833),
TEST_NO_TAG("Send DTMF sequence using SIP INFO",send_dtmfs_sequence_sip_info),
TEST_NO_TAG("DTMF sequence not sent if invalid call",send_dtmfs_sequence_not_ready),
TEST_NO_TAG("DTMF sequence canceled if call state changed",send_dtmfs_sequence_call_state_changed),
TEST_NO_TAG("Send DTMF using RFC2833 using Opus",send_dtmf_rfc2833_opus)
};
test_suite_t dtmf_test_suite = {"DTMF", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
sizeof(dtmf_tests) / sizeof(dtmf_tests[0]), dtmf_tests};
| 38.648045 | 176 | 0.771321 |
d68fc85005bde6e3788fd2948b954519eaba880d | 5,461 | h | C | aws-cpp-sdk-apigatewayv2/include/aws/apigatewayv2/model/GetApiMappingResult.h | curiousjgeorge/aws-sdk-cpp | 09b65deba03cfbef9a1e5d5986aa4de71bc03cd8 | [
"Apache-2.0"
] | 2 | 2019-03-11T15:50:55.000Z | 2020-02-27T11:40:27.000Z | aws-cpp-sdk-apigatewayv2/include/aws/apigatewayv2/model/GetApiMappingResult.h | curiousjgeorge/aws-sdk-cpp | 09b65deba03cfbef9a1e5d5986aa4de71bc03cd8 | [
"Apache-2.0"
] | null | null | null | aws-cpp-sdk-apigatewayv2/include/aws/apigatewayv2/model/GetApiMappingResult.h | curiousjgeorge/aws-sdk-cpp | 09b65deba03cfbef9a1e5d5986aa4de71bc03cd8 | [
"Apache-2.0"
] | null | null | null | /*
* 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/apigatewayv2/ApiGatewayV2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace ApiGatewayV2
{
namespace Model
{
class AWS_APIGATEWAYV2_API GetApiMappingResult
{
public:
GetApiMappingResult();
GetApiMappingResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetApiMappingResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The API identifier.</p>
*/
inline const Aws::String& GetApiId() const{ return m_apiId; }
/**
* <p>The API identifier.</p>
*/
inline void SetApiId(const Aws::String& value) { m_apiId = value; }
/**
* <p>The API identifier.</p>
*/
inline void SetApiId(Aws::String&& value) { m_apiId = std::move(value); }
/**
* <p>The API identifier.</p>
*/
inline void SetApiId(const char* value) { m_apiId.assign(value); }
/**
* <p>The API identifier.</p>
*/
inline GetApiMappingResult& WithApiId(const Aws::String& value) { SetApiId(value); return *this;}
/**
* <p>The API identifier.</p>
*/
inline GetApiMappingResult& WithApiId(Aws::String&& value) { SetApiId(std::move(value)); return *this;}
/**
* <p>The API identifier.</p>
*/
inline GetApiMappingResult& WithApiId(const char* value) { SetApiId(value); return *this;}
/**
* <p>The API mapping identifier.</p>
*/
inline const Aws::String& GetApiMappingId() const{ return m_apiMappingId; }
/**
* <p>The API mapping identifier.</p>
*/
inline void SetApiMappingId(const Aws::String& value) { m_apiMappingId = value; }
/**
* <p>The API mapping identifier.</p>
*/
inline void SetApiMappingId(Aws::String&& value) { m_apiMappingId = std::move(value); }
/**
* <p>The API mapping identifier.</p>
*/
inline void SetApiMappingId(const char* value) { m_apiMappingId.assign(value); }
/**
* <p>The API mapping identifier.</p>
*/
inline GetApiMappingResult& WithApiMappingId(const Aws::String& value) { SetApiMappingId(value); return *this;}
/**
* <p>The API mapping identifier.</p>
*/
inline GetApiMappingResult& WithApiMappingId(Aws::String&& value) { SetApiMappingId(std::move(value)); return *this;}
/**
* <p>The API mapping identifier.</p>
*/
inline GetApiMappingResult& WithApiMappingId(const char* value) { SetApiMappingId(value); return *this;}
/**
* <p>The API mapping key.</p>
*/
inline const Aws::String& GetApiMappingKey() const{ return m_apiMappingKey; }
/**
* <p>The API mapping key.</p>
*/
inline void SetApiMappingKey(const Aws::String& value) { m_apiMappingKey = value; }
/**
* <p>The API mapping key.</p>
*/
inline void SetApiMappingKey(Aws::String&& value) { m_apiMappingKey = std::move(value); }
/**
* <p>The API mapping key.</p>
*/
inline void SetApiMappingKey(const char* value) { m_apiMappingKey.assign(value); }
/**
* <p>The API mapping key.</p>
*/
inline GetApiMappingResult& WithApiMappingKey(const Aws::String& value) { SetApiMappingKey(value); return *this;}
/**
* <p>The API mapping key.</p>
*/
inline GetApiMappingResult& WithApiMappingKey(Aws::String&& value) { SetApiMappingKey(std::move(value)); return *this;}
/**
* <p>The API mapping key.</p>
*/
inline GetApiMappingResult& WithApiMappingKey(const char* value) { SetApiMappingKey(value); return *this;}
/**
* <p>The API stage.</p>
*/
inline const Aws::String& GetStage() const{ return m_stage; }
/**
* <p>The API stage.</p>
*/
inline void SetStage(const Aws::String& value) { m_stage = value; }
/**
* <p>The API stage.</p>
*/
inline void SetStage(Aws::String&& value) { m_stage = std::move(value); }
/**
* <p>The API stage.</p>
*/
inline void SetStage(const char* value) { m_stage.assign(value); }
/**
* <p>The API stage.</p>
*/
inline GetApiMappingResult& WithStage(const Aws::String& value) { SetStage(value); return *this;}
/**
* <p>The API stage.</p>
*/
inline GetApiMappingResult& WithStage(Aws::String&& value) { SetStage(std::move(value)); return *this;}
/**
* <p>The API stage.</p>
*/
inline GetApiMappingResult& WithStage(const char* value) { SetStage(value); return *this;}
private:
Aws::String m_apiId;
Aws::String m_apiMappingId;
Aws::String m_apiMappingKey;
Aws::String m_stage;
};
} // namespace Model
} // namespace ApiGatewayV2
} // namespace Aws
| 27.034653 | 123 | 0.636697 |
04b0e128cbc052defcc685c8fe0fa80bed613369 | 6,541 | c | C | Ejemplo4/src/main.c | OscarinValdez/SegaMDsample | 7c2e49fc29d0b355eb5145489e3c68bcbc793a8a | [
"MIT"
] | 1 | 2022-01-02T19:07:02.000Z | 2022-01-02T19:07:02.000Z | Ejemplo4/src/main.c | OscarinValdez/SegaMDsample | 7c2e49fc29d0b355eb5145489e3c68bcbc793a8a | [
"MIT"
] | null | null | null | Ejemplo4/src/main.c | OscarinValdez/SegaMDsample | 7c2e49fc29d0b355eb5145489e3c68bcbc793a8a | [
"MIT"
] | null | null | null | #include <genesis.h>
#include <resources.h>
//Datos del nivel en cuadricula de 16x16 pixeles
//1=Bloque solido 0=Nada
const short nivel1_map[14][40] = {
{ 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 1, 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, 0, 0, 0, 0,
0, 0, 0, 1, 1, 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, 0, 0, 0, 0,
0, 0, 0, 1, 1, 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, 0, 0, 0, 0,
0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1 }
};
//Declarar las orillas de la pantalla
const int ORILLA_IZQ = 0;
const int ORILLA_DER = 640;//320
const int ORILLA_ARR = 0;
const int ORILLA_ABJ = 224;
//Constantes para revisar si el personaje avanza hasta la mitad de la pantalla
const int MITAD_1RA_PANT = 160;
const int MITAD_ULTIMA_PANT = 640 - 160;
//Dimensiones del personaje
const int pl_altura = 16;
const int pl_anchura = 16;
const int gravedad = 1;
//Mas variables para el personaje
Sprite* jugador;
int plx=16;
int ply=16;
int showx,movx,movy;
const int max_movy=5;
bool saltando = FALSE;
bool en_piso = FALSE;
//Fondos
Map *bga, *bgb;
u16 ind, bgBaseTileIndex[2];
//Controlar al personaje
void prepararControles(u16 control,u16 suelto, u16 boton)
{
if (control == JOY_1)
{
if (boton & BUTTON_RIGHT)//Derecha
{
movx=3;
SPR_setAnim(jugador,1);
SPR_setHFlip(jugador, FALSE);//Voltear
}
else if (boton & BUTTON_LEFT)//Izquierda
{
movx=-3;
SPR_setAnim(jugador,1);
SPR_setHFlip(jugador, TRUE);//Voltear
}
else if( (suelto & BUTTON_RIGHT) | (suelto & BUTTON_LEFT) )//Si ninguno de los dos es pulsado entonces que se detenga
{
movx = 0;
SPR_setAnim(jugador,0);
}
if (boton & BUTTON_C)//Si el boton C es pulsado
{
if(saltando == FALSE && en_piso)
{
saltando = TRUE;//Indicar que ya esta saltando
movy=-13;//Hacia arriba
}
} else if (suelto & BUTTON_C) saltando = FALSE;
}
}
//Actualizar las ubicaciones del jugador
void moverJugador()
{
if (movy>max_movy) movy=max_movy;//Que no caiga tan rapido
plx+=movx;
ply+=movy;
movy+=gravedad;
/*Mantener al personaje dentro de la pantalla*/
if(plx < ORILLA_IZQ) plx = ORILLA_IZQ;
if(plx + pl_anchura > ORILLA_DER) plx = ORILLA_DER - pl_anchura;
//Colisiones
//Pisando el suelo?
if (nivel1_map[(ply>>4)+2][plx>>4]==1 || nivel1_map[(ply>>4)+2][(plx>>4)+1]==1)
{
ply=(ply>>4)<<4;
en_piso = TRUE;
} else en_piso=FALSE;
//Chocando contra las paredes?
if (nivel1_map[ply>>4][(plx>>4)+1]==1) plx=(plx>>4)<<4;
if (nivel1_map[ply>>4][(plx>>4)]==1) plx=((plx>>4)+1)<<4;
SPR_setPosition(jugador,showx-8,ply);//Visualizar en pantalla con las posiciones indicadas
}
//Si el jugador avanza y ya va a la mitad de la pantalla
void desplazarPantalla()
{
if (plx>=MITAD_1RA_PANT && plx <=MITAD_ULTIMA_PANT)
{
showx=160;
MAP_scrollTo(bga, plx-160, 0);//Mover primer fondo
MAP_scrollTo(bgb, (plx-160)/2, 0);//Mover el fondo de mero atras (segundo)
}
else if (plx >MITAD_ULTIMA_PANT)
showx=plx+160+(pl_anchura*2);//Si va al final del nivel, que ya se mueva hasta el tope de la pantalla
else showx=plx;
}
//Cuerpo principal del programa
int main(u16 hard)
{
JOY_init();//Iniciar controles
JOY_setEventHandler( &prepararControles );//Llamar al procedimiento de preparar controles
ind = TILE_USERINDEX;//Cargar los fondos
bgBaseTileIndex[0] = ind;
VDP_loadTileSet(&bga_tileset, ind, DMA);//Primero
ind += bga_tileset.numTile;
bgBaseTileIndex[1] = ind;
VDP_loadTileSet(&bgb_tileset, ind, DMA);//Segundo
ind += bgb_tileset.numTile;
VDP_setPalette(PAL0, background1.palette->data);//Colorear primer fondo
VDP_setPalette(PAL0, background2.palette->data);//Colorear segundo fondo
VDP_drawText("HOLA MUNDO",1,1);//Escribir texto en las posiciones indicadas
VDP_setPaletteColor(PAL0,RGB24_TO_VDPCOLOR(0x6dc2ca));//Cargar color de fondo
VDP_setPalette(PAL1, sprJugador.palette->data);
SPR_init();//Iniciar sprite del personaje
jugador = SPR_addSprite(&sprJugador,plx-8,ply,TILE_ATTR(PAL1,0, FALSE, FALSE));//Agregar sprite del personaje
bga = MAP_create(&bga_map, BG_A, TILE_ATTR_FULL(0, FALSE, FALSE, FALSE, bgBaseTileIndex[0]));//Agregar primer fondo
bgb = MAP_create(&bgb_map, BG_B, TILE_ATTR_FULL(0, FALSE, FALSE, FALSE, bgBaseTileIndex[1]));//Agregar segundo fondo
MAP_scrollTo(bga, 0, 0);//Colocar primer fondo en las posiciones indicadas
MAP_scrollTo(bgb, 0, 0);//Colocar segundo fondo en las posiciones indicadas
//Esto ya es lo que se va a ejecutar todo el tiempo
while (1)
{
//Llamar a los procediientos
moverJugador();
desplazarPantalla();
SPR_update();
SYS_doVBlankProcess();//Limpiar graficos no necesarios para el siguiente fotograma
}
MEM_free(bga);
MEM_free(bgb);
return 0;
}
| 32.063725 | 121 | 0.564134 |
a9c65eae1a12f0bd7dcade4b139413e3853b332a | 77,698 | c | C | openair2/RRC/LTE/rrc_eNB_M2AP.c | manishksingh89/openairinterface5g | 699b44f2201b17d3e5ecafde16d6f0c9dc76b7c7 | [
"Apache-2.0"
] | 6 | 2019-12-27T00:55:47.000Z | 2021-11-16T11:36:20.000Z | openair2/RRC/LTE/rrc_eNB_M2AP.c | manishksingh89/openairinterface5g | 699b44f2201b17d3e5ecafde16d6f0c9dc76b7c7 | [
"Apache-2.0"
] | 2 | 2021-06-17T05:01:55.000Z | 2021-11-24T14:23:54.000Z | openair2/RRC/LTE/rrc_eNB_M2AP.c | manishksingh89/openairinterface5g | 699b44f2201b17d3e5ecafde16d6f0c9dc76b7c7 | [
"Apache-2.0"
] | 15 | 2019-12-27T00:55:51.000Z | 2022-03-28T02:13:45.000Z | /*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* 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.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file rrc_eNB_M2AP.c
* \brief rrc M2AP procedures for eNB
* \author Javier Morgade
* \version 0.1
* \company Vicomtech Spain
* \email: javier.morgade@ieee.org
*/
# include "rrc_defs.h"
# include "rrc_extern.h"
# include "RRC/LTE/MESSAGES/asn1_msg.h"
# include "rrc_eNB_M2AP.h"
//# include "rrc_eNB_UE_context.h"
# include "msc.h"
# include "asn1_conversions.h"
# include "intertask_interface.h"
# include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
static m2ap_setup_resp_t * m2ap_setup_resp_g=NULL;
static m2ap_mbms_scheduling_information_t *m2ap_mbms_scheduling_information_g=NULL;
static void
rrc_M2AP_openair_rrc_top_init_MBMS(int eMBMS_active){
module_id_t module_id;
int CC_id;
(void)CC_id;
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_eNB_INST=%d\n", RC.nb_inst);
if (RC.nb_inst > 0) {
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.rrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
}
}
}
}
static uint8_t rrc_M2AP_do_MBSFNCountingRequest(
uint8_t Mod_id,
uint8_t sync_area,
uint8_t *buffer,
LTE_MCCH_Message_t *mcch_message,
LTE_MBMSCountingRequest_r10_t **mbsfnCoutingRequest,
const m2ap_mbms_service_counting_req_t *const m2ap_mbms_service_counting_req
) {
//int i,j,k;
asn_enc_rval_t enc_rval;
//LTE_MBSFN_SubframeConfig_t *mbsfn_SubframeConfig1;
//LTE_PMCH_Info_r9_t *pmch_Info_1;
//LTE_MBMS_SessionInfo_r9_t *mbms_Session_1;
// MBMS_SessionInfo_r9_t *mbms_Session_2;
//eNB_RRC_INST *rrc = RC.rrc[Mod_id];
//rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0];
memset(mcch_message,0,sizeof(LTE_MCCH_Message_t));
//mcch_message->message.present = LTE_MCCH_MessageType_PR_c1;
mcch_message->message.present = LTE_MCCH_MessageType_PR_later;
//mcch_message->message.choice.c1.present = LTE_MCCH_MessageType__c1_PR_mbsfnAreaConfiguration_r9;
mcch_message->message.choice.later.present = LTE_MCCH_MessageType__later_PR_c2;
mcch_message->message.choice.later.choice.c2.present = LTE_MCCH_MessageType__later__c2_PR_mbmsCountingRequest_r10;
*mbsfnCoutingRequest = &mcch_message->message.choice.later.choice.c2.choice.mbmsCountingRequest_r10;
//LTE_CountingRequestList_r10_t countingRequestList_r10; // A_SEQUENCE_OF(struct LTE_CountingRequestInfo_r10) list;
struct LTE_CountingRequestInfo_r10 *lte_counting_request_info; //LTE_TMGI_r9_t tmgi_r10;
lte_counting_request_info = CALLOC(1,sizeof(struct LTE_CountingRequestInfo_r10));
uint8_t TMGI[5] = {4,3,2,1,0};
lte_counting_request_info->tmgi_r10.plmn_Id_r9.present = LTE_TMGI_r9__plmn_Id_r9_PR_plmn_Index_r9;
lte_counting_request_info->tmgi_r10.plmn_Id_r9.choice.plmn_Index_r9= 1;
memset(<e_counting_request_info->tmgi_r10.serviceId_r9,0,sizeof(OCTET_STRING_t));
OCTET_STRING_fromBuf(<e_counting_request_info->tmgi_r10.serviceId_r9,(const char*)&TMGI[2],3);
ASN_SEQUENCE_ADD(&(*mbsfnCoutingRequest)->countingRequestList_r10.list,lte_counting_request_info);
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout,&asn_DEF_LTE_MCCH_Message,(void *)mcch_message);
}
xer_fprint(stdout,&asn_DEF_LTE_MCCH_Message,(void *)mcch_message);
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_MCCH_Message,
NULL,
(void *)mcch_message,
buffer,
100);
if(enc_rval.encoded == -1) {
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return -1;
}
LOG_I(RRC,"[eNB] MCCH Message Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : MCCH encoding failed for MBSFNAreaConfiguration\n");
return(-1);
}
return((enc_rval.encoded+7)/8);
}
static uint8_t rrc_M2AP_do_MBSFNAreaConfig(
uint8_t Mod_id,
uint8_t sync_area,
uint8_t *buffer,
LTE_MCCH_Message_t *mcch_message,
LTE_MBSFNAreaConfiguration_r9_t **mbsfnAreaConfiguration,
const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
) {
int i,j,k;
asn_enc_rval_t enc_rval;
LTE_MBSFN_SubframeConfig_t *mbsfn_SubframeConfig1;
LTE_PMCH_Info_r9_t *pmch_Info_1;
LTE_MBMS_SessionInfo_r9_t *mbms_Session_1;
// MBMS_SessionInfo_r9_t *mbms_Session_2;
//eNB_RRC_INST *rrc = RC.rrc[Mod_id];
//rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0];
memset(mcch_message,0,sizeof(LTE_MCCH_Message_t));
mcch_message->message.present = LTE_MCCH_MessageType_PR_c1;
mcch_message->message.choice.c1.present = LTE_MCCH_MessageType__c1_PR_mbsfnAreaConfiguration_r9;
*mbsfnAreaConfiguration = &mcch_message->message.choice.c1.choice.mbsfnAreaConfiguration_r9;
// Common Subframe Allocation (CommonSF-Alloc-r9)
for(i=0; i<m2ap_mbms_scheduling_information->num_mbms_area_config_list; i++){
for(j=0;j < m2ap_mbms_scheduling_information->mbms_area_config_list[i].num_mbms_sf_config_list; j++){
mbsfn_SubframeConfig1= CALLOC(1,sizeof(*mbsfn_SubframeConfig1));
memset((void *)mbsfn_SubframeConfig1,0,sizeof(*mbsfn_SubframeConfig1));
//
mbsfn_SubframeConfig1->radioframeAllocationPeriod= m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].radioframe_allocation_period;//LTE_MBSFN_SubframeConfig__radioframeAllocationPeriod_n4;
mbsfn_SubframeConfig1->radioframeAllocationOffset= m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].radioframe_allocation_offset;
if(m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].is_four_sf){
LOG_I(RRC,"is_four_sf\n");
mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames;
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(3);
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[2] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].subframe_allocation) & 0xFF);
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[1] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].subframe_allocation>>8) & 0xFF);
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].subframe_allocation>>16) & 0xFF);
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 3;
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 0;
}else {
LOG_I(RRC,"is_one_sf\n");
mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = (m2ap_mbms_scheduling_information->mbms_area_config_list[i].mbms_sf_config_list[j].subframe_allocation & 0x3F)<<2;
}
ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->commonSF_Alloc_r9.list,mbsfn_SubframeConfig1);
}
// commonSF-AllocPeriod-r9
(*mbsfnAreaConfiguration)->commonSF_AllocPeriod_r9= m2ap_mbms_scheduling_information->mbms_area_config_list[i].common_sf_allocation_period;//LTE_MBSFNAreaConfiguration_r9__commonSF_AllocPeriod_r9_rf16;
// PMCHs Information List (PMCH-InfoList-r9)
for(j=0; j < m2ap_mbms_scheduling_information->mbms_area_config_list[i].num_pmch_config_list; j++){
// PMCH_1 Config
pmch_Info_1 = CALLOC(1,sizeof(LTE_PMCH_Info_r9_t));
memset((void *)pmch_Info_1,0,sizeof(LTE_PMCH_Info_r9_t));
/*
* take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area
* Note: this has to be set based on the subframeAllocation and CSA
*/
pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].allocated_sf_end;
pmch_Info_1->pmch_Config_r9.dataMCS_r9= m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].data_mcs;
//pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9= LTE_PMCH_Config_r9__mch_SchedulingPeriod_r9_rf16;
pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9 = m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mch_scheduling_period;
// MBMSs-SessionInfoList-r9
for(k=0; k < m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].num_mbms_session_list; k++){
// pmch_Info_1->mbms_SessionInfoList_r9 = CALLOC(1,sizeof(struct MBMS_SessionInfoList_r9));
// Session 1
mbms_Session_1 = CALLOC(1,sizeof(LTE_MBMS_SessionInfo_r9_t));
memset(mbms_Session_1,0,sizeof(LTE_MBMS_SessionInfo_r9_t));
// TMGI value
mbms_Session_1->tmgi_r9.plmn_Id_r9.present= LTE_TMGI_r9__plmn_Id_r9_PR_plmn_Index_r9;
mbms_Session_1->tmgi_r9.plmn_Id_r9.choice.plmn_Index_r9= 1;
// Service ID
//uint8_t TMGI[5] = {4,3,2,1,0};//TMGI is a string of octet, ref. TS 24.008 fig. 10.5.4a
char buf[4];
buf[0] = m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id << 24;
buf[1] = m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id << 16;
buf[2] = m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id << 8;
buf[3] = m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id << 0;
//INT32_TO_BUFFER(m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id,buf);
memset(&mbms_Session_1->tmgi_r9.serviceId_r9,0,sizeof(OCTET_STRING_t));// need to check
OCTET_STRING_fromBuf(&mbms_Session_1->tmgi_r9.serviceId_r9,(const char *)&buf[1],3);
// Session ID is still missing here, it can be used as an rab id or mrb id
mbms_Session_1->sessionId_r9 = CALLOC(1,sizeof(OCTET_STRING_t));
mbms_Session_1->sessionId_r9->buf= MALLOC(1);
mbms_Session_1->sessionId_r9->size= 1;
mbms_Session_1->sessionId_r9->buf[0]= m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id; //1;
// Logical Channel ID
mbms_Session_1->logicalChannelIdentity_r9=m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].lcid; //1;
LOG_D(RRC,"lcid %lu %d\n",mbms_Session_1->logicalChannelIdentity_r9,m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].lcid);
LOG_D(RRC,"service_id %d\n",m2ap_mbms_scheduling_information->mbms_area_config_list[i].pmch_config_list[j].mbms_session_list[k].service_id);
ASN_SEQUENCE_ADD(&pmch_Info_1->mbms_SessionInfoList_r9.list,mbms_Session_1);
}
ASN_SEQUENCE_ADD(&(*mbsfnAreaConfiguration)->pmch_InfoList_r9.list,pmch_Info_1);
}
}
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout,&asn_DEF_LTE_MCCH_Message,(void *)mcch_message);
}
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_MCCH_Message,
NULL,
(void *)mcch_message,
buffer,
100);
if(enc_rval.encoded == -1) {
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return -1;
}
LOG_I(RRC,"[eNB] MCCH Message Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : MCCH encoding failed for MBSFNAreaConfiguration\n");
return(-1);
}
return((enc_rval.encoded+7)/8);
}
static void rrc_M2AP_init_MBMS(
module_id_t enb_mod_idP,
int CC_id,
frame_t frameP
){
// init the configuration for MTCH
protocol_ctxt_t ctxt;
if (RC.rrc[enb_mod_idP]->carrier[CC_id].MBMS_flag > 0) {
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, 0,enb_mod_idP);
LOG_I(RRC, "[eNB %d] Frame %d : Radio Bearer config request for MBMS\n", enb_mod_idP, frameP); //check the lcid
// Configuring PDCP and RLC for MBMS Radio Bearer
rrc_pdcp_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *)NULL, // LTE_SRB_ToAddModList
(LTE_DRB_ToAddModList_t *)NULL, // LTE_DRB_ToAddModList
(LTE_DRB_ToReleaseList_t *)NULL,
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
, &(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,NULL);
if (!NODE_IS_CU(RC.rrc[enb_mod_idP]->node_type)) {
rrc_rlc_config_asn1_req(&ctxt,
NULL, // LTE_SRB_ToAddModList
NULL, // LTE_DRB_ToAddModList
NULL, // DRB_ToReleaseList
&(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,0, 0
);
}
//rrc_mac_config_req();
}
}
static void rrc_M2AP_init_MCCH(
const protocol_ctxt_t *const ctxt_pP,
uint8_t enb_mod_idP,
int CC_id,
const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
){
int sync_area = 0;
// initialize RRC_eNB_INST MCCH entry
eNB_RRC_INST *rrc = RC.rrc[enb_mod_idP];
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE =
malloc(RC.rrc[enb_mod_idP]->carrier[CC_id].num_mbsfn_sync_area * sizeof(uint8_t *));
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE_COUNTING =
malloc(RC.rrc[enb_mod_idP]->carrier[CC_id].num_mbsfn_sync_area * sizeof(uint8_t *));
for (sync_area = 0; sync_area < RC.rrc[enb_mod_idP]->carrier[CC_id].num_mbsfn_sync_area; sync_area++) {
RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[sync_area] = 0;
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE[sync_area] = (uint8_t *) malloc16(32);
AssertFatal(RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE[sync_area] != NULL,
"[eNB %d]init_MCCH: FATAL, no memory for MCCH MESSAGE allocated \n", enb_mod_idP);
RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[sync_area] = rrc_M2AP_do_MBSFNAreaConfig(enb_mod_idP,
sync_area,
(uint8_t *)RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE[sync_area],
&RC.rrc[enb_mod_idP]->carrier[CC_id].mcch,
&RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message,
m2ap_mbms_scheduling_information
);
RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE_COUNTING[sync_area] = 0;
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE_COUNTING[sync_area] = (uint8_t *) malloc16(32);
AssertFatal(RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE_COUNTING[sync_area] != NULL,
"[eNB %d]init_MCCH: FATAL, no memory for MCCH MESSAGE allocated \n", enb_mod_idP);
RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE_COUNTING[sync_area] = rrc_M2AP_do_MBSFNCountingRequest(enb_mod_idP,
sync_area,
(uint8_t *)RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE_COUNTING[sync_area],
&RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_counting,
&RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message_counting,
NULL//m2ap_mbms_scheduling_information
);
LOG_I(RRC, "mcch message pointer %p for sync area %d \n",
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESSAGE[sync_area],
sync_area);
LOG_D(RRC, "[eNB %d] MCCH_MESSAGE contents for Sync Area %d (partial)\n", enb_mod_idP, sync_area);
LOG_D(RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %ld\n", enb_mod_idP,
RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->commonSF_AllocPeriod_r9);
LOG_D(RRC,
"[eNB %d] CommonSF_Alloc_r9.list.count (number of MBSFN Subframe Pattern) %d\n",
enb_mod_idP, RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->commonSF_Alloc_r9.list.count);
LOG_D(RRC, "[eNB %d] MBSFN Subframe Pattern: %02x (in hex)\n",
enb_mod_idP,
RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->commonSF_Alloc_r9.list.array[0]->subframeAllocation.
choice.oneFrame.buf[0]);
AssertFatal(RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[sync_area] != 255,
"RC.rrc[enb_mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[sync_area] == 255");
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESS[sync_area].Active = 1;
RC.rrc[enb_mod_idP]->carrier[CC_id].MCCH_MESS_COUNTING[sync_area].Active = 1;
}
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB(enb_mod_idP, CC_id,
0,0,0,0,0,
0,
0,//rnti
(LTE_BCCH_BCH_Message_t *)NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
(LTE_MAC_MainConfig_t *) NULL,
0,
(struct LTE_LogicalChannelConfig *)NULL,
(LTE_MeasGapConfig_t *) NULL,
(LTE_TDD_Config_t *) NULL,
(LTE_MobilityControlInfo_t *)NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
,
0,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_PMCH_InfoList_r9_t *) & (RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9),
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t*)(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message)
);
}
return;
}
static uint8_t rrc_M2AP_do_SIB1_MBMS_SIB13(
const protocol_ctxt_t *const ctxt_pP,
uint8_t Mod_id,
int CC_id,
const m2ap_setup_resp_t *const m2ap_setup_resp,
const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
){
int i,j,l;
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id];
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part=NULL;
LTE_MBSFN_SubframeConfigList_t *MBSFNSubframeConfigList/*,*MBSFNSubframeConfigList_copy*/;
asn_enc_rval_t enc_rval;
LTE_BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
LTE_BCCH_DL_SCH_Message_MBMS_t *bcch_message_fembms = &RC.rrc[Mod_id]->carrier[CC_id].siblock1_MBMS;
uint8_t *buffer;
uint8_t *buffer_fembms;
LTE_SystemInformationBlockType2_t **sib2;
LTE_MBSFN_AreaInfoList_r9_t *MBSFNArea_list/*,*MBSFNArea_list_copy*/;
LTE_SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
struct LTE_MBSFN_AreaInfo_r9 *MBSFN_Area1;
LTE_SystemInformationBlockType1_MBMS_r14_t **sib1_MBMS = &RC.rrc[Mod_id]->carrier[CC_id].sib1_MBMS;
if(ctxt_pP->brOption){
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23_BR;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2_BR;
LOG_I(RRC,"Running SIB2/3 Encoding for eMTC\n");
}else
{
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
}
buffer_fembms = RC.rrc[Mod_id]->carrier[CC_id].SIB1_MBMS;
if (bcch_message) {
//memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
} else {
LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id);
exit(-1);
}
if (!sib2) {
LOG_E(RRC,"[eNB %d] sib2 is null, exiting\n", Mod_id);
exit(-1);
}
if(!sib13){
LOG_I(RRC,"[eNB %d] sib13 is null, it should get created\n",Mod_id);
}
if(!sib1_MBMS){
LOG_I(RRC,"[eNB %d] sib1_MBMS is null, it should get created\n",Mod_id);
}
//if (!sib3) {
// LOG_E(RRC,"[eNB %d] sib3 is null, exiting\n", Mod_id);
// exit(-1);
//}
for (i=0; i < bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
typeandinfo = bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.array[i];
switch(typeandinfo->present) {
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_NOTHING:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920:
*sib13=&typeandinfo->choice.sib13_v920;
(*sib13)->notificationConfig_r9.notificationRepetitionCoeff_r9=LTE_MBMS_NotificationConfig_r9__notificationRepetitionCoeff_r9_n2;
(*sib13)->notificationConfig_r9.notificationOffset_r9=0;
(*sib13)->notificationConfig_r9.notificationSF_Index_r9=1;
// MBSFN-AreaInfoList
MBSFNArea_list= &(*sib13)->mbsfn_AreaInfoList_r9;//CALLOC(1,sizeof(*MBSFNArea_list));
memset(MBSFNArea_list,0,sizeof(*MBSFNArea_list));
for( j=0; j < m2ap_setup_resp->num_mcch_config_per_mbsfn; j++){
// MBSFN Area 1
MBSFN_Area1= CALLOC(1, sizeof(*MBSFN_Area1));
MBSFN_Area1->mbsfn_AreaId_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].mbsfn_area;
MBSFN_Area1->non_MBSFNregionLength= m2ap_setup_resp->mcch_config_per_mbsfn[j].pdcch_length;
MBSFN_Area1->notificationIndicator_r9= 0;
MBSFN_Area1->mcch_Config_r9.mcch_RepetitionPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].repetition_period;//LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32;
MBSFN_Area1->mcch_Config_r9.mcch_Offset_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].offset; // in accordance with mbsfn subframe configuration in sib2
MBSFN_Area1->mcch_Config_r9.mcch_ModificationPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].modification_period;
// Subframe Allocation Info
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[j].subframe_allocation_info<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].mcs;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1);
}
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib14_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib15_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib16_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib17_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib18_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib19_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib20_v1310:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib21_v1430:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib24_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib25_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib26_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2:
LOG_I(RRC,"Adding MBSFN subframe Configuration 1 to SIB2, %p %p\n",&typeandinfo->choice.sib2,*sib2);
for(j=0; j < m2ap_mbms_scheduling_information->num_mbms_area_config_list ; j++) {
(&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct LTE_MBSFN_SubframeConfigList));
MBSFNSubframeConfigList = (&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList;
for(l=0; l < m2ap_mbms_scheduling_information->mbms_area_config_list[j].num_mbms_sf_config_list; l++){
LTE_MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1;
sib2_mbsfn_SubframeConfig1= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig1));
memset((void *)sib2_mbsfn_SubframeConfig1,0,sizeof(*sib2_mbsfn_SubframeConfig1));
sib2_mbsfn_SubframeConfig1->radioframeAllocationPeriod = m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].radioframe_allocation_period;
sib2_mbsfn_SubframeConfig1->radioframeAllocationOffset = m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].radioframe_allocation_offset;
if(m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].is_four_sf){
LOG_I(RRC,"is_four_sf\n");
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(3);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 3;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 0;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[2] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation) & 0xFF);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[1] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation>>8) & 0xFF);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation>>16) & 0xFF);
}else{
LOG_I(RRC,"is_one_sf\n");
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=(m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation<<2);
}
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
}
}
break;
}
}
if(*sib13==NULL){
sib13_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib13_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
sib13_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920;
*sib13 = &sib13_part->choice.sib13_v920;
(*sib13)->notificationConfig_r9.notificationRepetitionCoeff_r9=LTE_MBMS_NotificationConfig_r9__notificationRepetitionCoeff_r9_n2;
(*sib13)->notificationConfig_r9.notificationOffset_r9=0;
(*sib13)->notificationConfig_r9.notificationSF_Index_r9=1;
// MBSFN-AreaInfoList
MBSFNArea_list= &(*sib13)->mbsfn_AreaInfoList_r9;//CALLOC(1,sizeof(*MBSFNArea_list));
memset(MBSFNArea_list,0,sizeof(*MBSFNArea_list));
for( i=0; i < m2ap_setup_resp->num_mcch_config_per_mbsfn; i++){
// MBSFN Area 1
MBSFN_Area1= CALLOC(1, sizeof(*MBSFN_Area1));
MBSFN_Area1->mbsfn_AreaId_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mbsfn_area;
MBSFN_Area1->non_MBSFNregionLength= m2ap_setup_resp->mcch_config_per_mbsfn[i].pdcch_length;
MBSFN_Area1->notificationIndicator_r9= 0;
MBSFN_Area1->mcch_Config_r9.mcch_RepetitionPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].repetition_period;//LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32;
MBSFN_Area1->mcch_Config_r9.mcch_Offset_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].offset; // in accordance with mbsfn subframe configuration in sib2
MBSFN_Area1->mcch_Config_r9.mcch_ModificationPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].modification_period;
// Subframe Allocation Info
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[i].subframe_allocation_info<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1);
}
ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part);
}
*sib1_MBMS = &bcch_message_fembms->message.choice.c1.choice.systemInformationBlockType1_MBMS_r14;
if((*sib1_MBMS)->systemInformationBlockType13_r14==NULL){
(*sib1_MBMS)->systemInformationBlockType13_r14 = CALLOC(1,sizeof(struct LTE_SystemInformationBlockType13_r9));
memset((*sib1_MBMS)->systemInformationBlockType13_r14,0,sizeof(struct LTE_SystemInformationBlockType13_r9));
}
memcpy((*sib1_MBMS)->systemInformationBlockType13_r14,*sib13,sizeof(struct LTE_SystemInformationBlockType13_r9));
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message_MBMS,
NULL,
(void *)bcch_message_fembms,
buffer_fembms,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC,"[eNB] MBMS SIB1_MBMS SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
return(-1);
}
//xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message);
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message,
NULL,
(void *)bcch_message,
buffer,
900);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC,"[eNB] MBMS SIB2 SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
return(-1);
}
carrier->MBMS_flag =1;
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
0,0,0,0,0,
0,
0xfffd,//rnti
(LTE_BCCH_BCH_Message_t *)NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
(LTE_MAC_MainConfig_t *) NULL,
0,
(struct LTE_LogicalChannelConfig *)NULL,
(LTE_MeasGapConfig_t *) NULL,
(LTE_TDD_Config_t *) NULL,
(LTE_MobilityControlInfo_t *)NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL,
(LTE_AdditionalSpectrumEmission_t *)NULL,
(LTE_MBSFN_SubframeConfigList_t *) carrier->sib2->mbsfn_SubframeConfigList,
carrier->MBMS_flag,
(LTE_MBSFN_AreaInfoList_r9_t *) & carrier->sib13->mbsfn_AreaInfoList_r9,
(LTE_PMCH_InfoList_r9_t *) NULL
,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
,
carrier->FeMBMS_flag,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
);
}
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
return 0;
}
//static uint8_t rrc_M2AP_do_SIB1(
// const protocol_ctxt_t *const ctxt_pP,
// uint8_t Mod_id,
// int CC_id,
// const m2ap_setup_resp_t *const m2ap_setup_resp,
// const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
//){
// int i/*,j,l*/;
//
// //eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
// //rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id];
//
// asn_enc_rval_t enc_rval;
//
// uint8_t *buffer;
//
// LTE_SystemInformationBlockType1_t **sib1;
//
// LTE_BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
//
// if (ctxt_pP->brOption) {
// buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB1_BR;
// bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].siblock1_BR;
// sib1 = &RC.rrc[Mod_id]->carrier[CC_id].sib1_BR;
// }
// else
// {
// buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB1;
// bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].siblock1;
// sib1 = &RC.rrc[Mod_id]->carrier[CC_id].sib1;
// }
//
// *sib1 = &bcch_message->message.choice.c1.choice.systemInformationBlockType1;
//
// uint8_t find_sib13=0;
// for(i=0; i<(*sib1)->schedulingInfoList.list.count; i++){
// //for(j=0; j<(*sib1)->schedulingInfoList.list.array[i]->sib_MappingInfo.list.count;j++)
// // if((*sib1)->schedulingInfoList.list.array[i]->sib_MappingInfo.list.array[j] == LTE_SIB_Type_sibType13_v920)
// // find_sib13=1;
// }
// if(!find_sib13){
// LTE_SchedulingInfo_t schedulingInfo;
// LTE_SIB_Type_t sib_type;
// memset(&schedulingInfo,0,sizeof(LTE_SchedulingInfo_t));
// memset(&sib_type,0,sizeof(LTE_SIB_Type_t));
//
// schedulingInfo.si_Periodicity=LTE_SchedulingInfo__si_Periodicity_rf8;
// sib_type=LTE_SIB_Type_sibType13_v920;
// ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo);
// }
//
// enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message,
// NULL,
// (void *)bcch_message,
// buffer,
// 900);
// AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
// enc_rval.failed_type->name, enc_rval.encoded);
// LOG_W(RRC,"[eNB] SystemInformationBlockType1 Encoded %zd bits (%zd bytes) with new SIB13(%d) \n",enc_rval.encoded,(enc_rval.encoded+7)/8,find_sib13);
//
//
// RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = ((enc_rval.encoded+7)/8);
//
//
//
//
// return 0;
//}
static uint8_t rrc_M2AP_do_SIB23_SIB2(
const protocol_ctxt_t *const ctxt_pP,
uint8_t Mod_id,
int CC_id,
const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
){
int i,j,l;
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id];
//struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part=NULL;
LTE_MBSFN_SubframeConfigList_t *MBSFNSubframeConfigList/*,*MBSFNSubframeConfigList_copy*/;
//LTE_MBSFN_AreaInfoList_r9_t *MBSFNArea_list/*,*MBSFNArea_list_copy*/;
asn_enc_rval_t enc_rval;
LTE_BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
uint8_t *buffer;
LTE_SystemInformationBlockType2_t **sib2;
if(ctxt_pP->brOption){
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23_BR;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2_BR;
LOG_I(RRC,"Running SIB2/3 Encoding for eMTC\n");
} else {
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
}
if (bcch_message) {
//memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
} else {
LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id);
exit(-1);
}
if (!sib2) {
LOG_E(RRC,"[eNB %d] sib2 is null, exiting\n", Mod_id);
exit(-1);
}
//if (!sib3) {
// LOG_E(RRC,"[eNB %d] sib3 is null, exiting\n", Mod_id);
// exit(-1);
//}
for (i=0; i < bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
typeandinfo = bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.array[i];
switch(typeandinfo->present) {
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_NOTHING:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib14_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib15_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib16_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib17_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib18_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib19_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib20_v1310:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib21_v1430:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib24_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib25_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib26_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2:
LOG_I(RRC,"Adding MBSFN subframe Configuration 1 to SIB2, %p %p\n",&typeandinfo->choice.sib2,*sib2);
for(j=0; j < m2ap_mbms_scheduling_information->num_mbms_area_config_list ; j++) {
(&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct LTE_MBSFN_SubframeConfigList));
MBSFNSubframeConfigList = (&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList;
for(l=0; l < m2ap_mbms_scheduling_information->mbms_area_config_list[j].num_mbms_sf_config_list; l++){
LTE_MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1;
sib2_mbsfn_SubframeConfig1= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig1));
memset((void *)sib2_mbsfn_SubframeConfig1,0,sizeof(*sib2_mbsfn_SubframeConfig1));
sib2_mbsfn_SubframeConfig1->radioframeAllocationPeriod = m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].radioframe_allocation_period;
sib2_mbsfn_SubframeConfig1->radioframeAllocationOffset = m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].radioframe_allocation_offset;
if(m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].is_four_sf){
LOG_I(RRC,"is_four_sf\n");
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(3);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 3;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 0;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[2] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation) & 0xFF);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[1] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation>>8) & 0xFF);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation>>16) & 0xFF);
}else{
LOG_I(RRC,"is_one_sf\n");
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=(m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation<<2);
}
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
}
}
break;
}
}
//xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message);
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message,
NULL,
(void *)bcch_message,
buffer,
900);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC,"[eNB] MBMS SIB2 SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
return(-1);
}
carrier->MBMS_flag =1;
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
0,0,0,0,0,
0,
0,//rnti
(LTE_BCCH_BCH_Message_t *)NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
(LTE_MAC_MainConfig_t *) NULL,
0,
(struct LTE_LogicalChannelConfig *)NULL,
(LTE_MeasGapConfig_t *) NULL,
(LTE_TDD_Config_t *) NULL,
(LTE_MobilityControlInfo_t *)NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL,
(LTE_AdditionalSpectrumEmission_t *)NULL,
(LTE_MBSFN_SubframeConfigList_t *) carrier->sib2->mbsfn_SubframeConfigList,
carrier->MBMS_flag,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_PMCH_InfoList_r9_t *) NULL,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
);
}
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
return 0;
}
static uint8_t rrc_M2AP_do_SIB23_SIB13(
const protocol_ctxt_t *const ctxt_pP,
uint8_t Mod_id,
int CC_id,
const m2ap_setup_resp_t *const m2ap_setup_resp
){
int i;
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id];
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part=NULL;
//LTE_MBSFN_SubframeConfigList_t *MBSFNSubframeConfigList;
LTE_MBSFN_AreaInfoList_r9_t *MBSFNArea_list;
asn_enc_rval_t enc_rval;
LTE_BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
uint8_t *buffer;
LTE_SystemInformationBlockType2_t **sib2;
if(ctxt_pP->brOption){
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23_BR;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2_BR;
LOG_I(RRC,"Running SIB2/3 Encoding for eMTC\n");
} else {
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
}
if (bcch_message) {
//memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
} else {
LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id);
exit(-1);
}
if (!sib2) {
LOG_E(RRC,"[eNB %d] sib2 is null, exiting\n", Mod_id);
exit(-1);
}
//if (!sib3) {
// LOG_E(RRC,"[eNB %d] sib3 is null, exiting\n", Mod_id);
// exit(-1);
//}
/*for (int i=0; i<(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
typeandinfo = (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.array[i];
switch(typeandinfo->present) {
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2:
LTE_SystemInformationBlockType2_t *sib2 = &typeandinfo->choice.sib2
LOG_I(RRC,"Adding MBSFN subframe Configuration 1 to SIB2\n");
LTE_MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1;
(*sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct LTE_MBSFN_SubframeConfigList));
MBSFNSubframeConfigList = (*sib2)->mbsfn_SubframeConfigList;
sib2_mbsfn_SubframeConfig1= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig1));
memset((void *)sib2_mbsfn_SubframeConfig1,0,sizeof(*sib2_mbsfn_SubframeConfig1));
sib2_mbsfn_SubframeConfig1->radioframeAllocationPeriod= LTE_MBSFN_SubframeConfig__radioframeAllocationPeriod_n4;
sib2_mbsfn_SubframeConfig1->radioframeAllocationOffset= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
break;
}
}*/
LTE_SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
struct LTE_MBSFN_AreaInfo_r9 *MBSFN_Area1/*, *MBSFN_Area2*/;
sib13_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib13_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
sib13_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920;
*sib13 = &sib13_part->choice.sib13_v920;
(*sib13)->notificationConfig_r9.notificationRepetitionCoeff_r9=LTE_MBMS_NotificationConfig_r9__notificationRepetitionCoeff_r9_n2;
(*sib13)->notificationConfig_r9.notificationOffset_r9=0;
(*sib13)->notificationConfig_r9.notificationSF_Index_r9=1;
// MBSFN-AreaInfoList
MBSFNArea_list= &(*sib13)->mbsfn_AreaInfoList_r9;//CALLOC(1,sizeof(*MBSFNArea_list));
memset(MBSFNArea_list,0,sizeof(*MBSFNArea_list));
for( i=0; i < m2ap_setup_resp->num_mcch_config_per_mbsfn; i++){
// MBSFN Area 1
MBSFN_Area1= CALLOC(1, sizeof(*MBSFN_Area1));
MBSFN_Area1->mbsfn_AreaId_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mbsfn_area;
MBSFN_Area1->non_MBSFNregionLength= m2ap_setup_resp->mcch_config_per_mbsfn[i].pdcch_length;
MBSFN_Area1->notificationIndicator_r9= 0;
MBSFN_Area1->mcch_Config_r9.mcch_RepetitionPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].repetition_period;//LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32;
MBSFN_Area1->mcch_Config_r9.mcch_Offset_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].offset; // in accordance with mbsfn subframe configuration in sib2
MBSFN_Area1->mcch_Config_r9.mcch_ModificationPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].modification_period;
// Subframe Allocation Info
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[i].subframe_allocation_info<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1);
}
ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part);
//xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message);
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message,
NULL,
(void *)bcch_message,
buffer,
900);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC,"[eNB] MBMS SIB13 SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
return(-1);
}
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
0,0,0,0,0,
0,
0,//rnti
(LTE_BCCH_BCH_Message_t *)NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
(LTE_MAC_MainConfig_t *) NULL,
0,
(struct LTE_LogicalChannelConfig *)NULL,
(LTE_MeasGapConfig_t *) NULL,
(LTE_TDD_Config_t *) NULL,
(LTE_MobilityControlInfo_t *)NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
,
0,
(LTE_MBSFN_AreaInfoList_r9_t *) & carrier->sib13->mbsfn_AreaInfoList_r9,
(LTE_PMCH_InfoList_r9_t *) NULL,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
);
}
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
return 0;
}
static uint8_t rrc_M2AP_do_SIB23_SIB2_SIB13(
const protocol_ctxt_t *const ctxt_pP,
uint8_t Mod_id,
int CC_id,
const m2ap_setup_resp_t *const m2ap_setup_resp,
const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
){
int i,j,l;
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id];
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib13_part=NULL;
LTE_MBSFN_SubframeConfigList_t *MBSFNSubframeConfigList/*,*MBSFNSubframeConfigList_copy*/;
asn_enc_rval_t enc_rval;
LTE_BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
uint8_t *buffer;
LTE_SystemInformationBlockType2_t **sib2;
LTE_MBSFN_AreaInfoList_r9_t *MBSFNArea_list/*,*MBSFNArea_list_copy*/;
LTE_SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
struct LTE_MBSFN_AreaInfo_r9 *MBSFN_Area1;
if(ctxt_pP->brOption){
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23_BR;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2_BR;
LOG_I(RRC,"Running SIB2/3 Encoding for eMTC\n");
} else {
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
}
if (bcch_message) {
//memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
} else {
LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id);
exit(-1);
}
if (!sib2) {
LOG_E(RRC,"[eNB %d] sib2 is null, exiting\n", Mod_id);
exit(-1);
}
if(!sib13){
LOG_I(RRC,"[eNB %d] sib13 is null, it should get created\n",Mod_id);
}
//if (!sib3) {
// LOG_E(RRC,"[eNB %d] sib3 is null, exiting\n", Mod_id);
// exit(-1);
//}
for (i=0; i < bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
typeandinfo = bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.array[i];
switch(typeandinfo->present) {
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_NOTHING:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920:
*sib13=&typeandinfo->choice.sib13_v920;
(*sib13)->notificationConfig_r9.notificationRepetitionCoeff_r9=LTE_MBMS_NotificationConfig_r9__notificationRepetitionCoeff_r9_n2;
(*sib13)->notificationConfig_r9.notificationOffset_r9=0;
(*sib13)->notificationConfig_r9.notificationSF_Index_r9=1;
// MBSFN-AreaInfoList
MBSFNArea_list= &(*sib13)->mbsfn_AreaInfoList_r9;//CALLOC(1,sizeof(*MBSFNArea_list));
memset(MBSFNArea_list,0,sizeof(*MBSFNArea_list));
for( j=0; j < m2ap_setup_resp->num_mcch_config_per_mbsfn; j++){
// MBSFN Area 1
MBSFN_Area1= CALLOC(1, sizeof(*MBSFN_Area1));
MBSFN_Area1->mbsfn_AreaId_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].mbsfn_area;
MBSFN_Area1->non_MBSFNregionLength= m2ap_setup_resp->mcch_config_per_mbsfn[j].pdcch_length;
MBSFN_Area1->notificationIndicator_r9= 0;
MBSFN_Area1->mcch_Config_r9.mcch_RepetitionPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].repetition_period;//LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32;
MBSFN_Area1->mcch_Config_r9.mcch_Offset_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].offset; // in accordance with mbsfn subframe configuration in sib2
MBSFN_Area1->mcch_Config_r9.mcch_ModificationPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].modification_period;
// Subframe Allocation Info
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[j].subframe_allocation_info<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[j].mcs;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1);
}
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib14_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib15_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib16_v1130:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib17_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib18_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib19_v1250:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib20_v1310:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib21_v1430:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib24_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib25_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib26_v1530:
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2:
LOG_I(RRC,"Adding MBSFN subframe Configuration 1 to SIB2, %p %p\n",&typeandinfo->choice.sib2,*sib2);
for(j=0; j < m2ap_mbms_scheduling_information->num_mbms_area_config_list ; j++) {
(&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList = CALLOC(1,sizeof(struct LTE_MBSFN_SubframeConfigList));
MBSFNSubframeConfigList = (&typeandinfo->choice.sib2)->mbsfn_SubframeConfigList;
for(l=0; l < m2ap_mbms_scheduling_information->mbms_area_config_list[j].num_mbms_sf_config_list; l++){
LTE_MBSFN_SubframeConfig_t *sib2_mbsfn_SubframeConfig1;
sib2_mbsfn_SubframeConfig1= CALLOC(1,sizeof(*sib2_mbsfn_SubframeConfig1));
memset((void *)sib2_mbsfn_SubframeConfig1,0,sizeof(*sib2_mbsfn_SubframeConfig1));
sib2_mbsfn_SubframeConfig1->radioframeAllocationPeriod = m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].radioframe_allocation_period;
sib2_mbsfn_SubframeConfig1->radioframeAllocationOffset = m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].radioframe_allocation_offset;
if(m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].is_four_sf){
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames;
LOG_I(RRC,"rrc_M2AP_do_SIB23_SIB2_SIB13 is_four_sf\n");
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(3);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 3;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 0;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[2] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation) & 0xFF);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[1] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation>>8) & 0xFF);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0] = ((m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation>>16) & 0xFF);
}else{
LOG_I(RRC,"rrc_M2AP_do_SIB23_SIB2_SIB13 rs_one_sf\n");
sib2_mbsfn_SubframeConfig1->subframeAllocation.present= LTE_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf= MALLOC(1);
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=(m2ap_mbms_scheduling_information->mbms_area_config_list[j].mbms_sf_config_list[l].subframe_allocation<<2);
}
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
}
}
break;
}
}
if(*sib13==NULL){
sib13_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib13_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
sib13_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920;
*sib13 = &sib13_part->choice.sib13_v920;
(*sib13)->notificationConfig_r9.notificationRepetitionCoeff_r9=LTE_MBMS_NotificationConfig_r9__notificationRepetitionCoeff_r9_n2;
(*sib13)->notificationConfig_r9.notificationOffset_r9=0;
(*sib13)->notificationConfig_r9.notificationSF_Index_r9=1;
// MBSFN-AreaInfoList
MBSFNArea_list= &(*sib13)->mbsfn_AreaInfoList_r9;//CALLOC(1,sizeof(*MBSFNArea_list));
memset(MBSFNArea_list,0,sizeof(*MBSFNArea_list));
for( i=0; i < m2ap_setup_resp->num_mcch_config_per_mbsfn; i++){
// MBSFN Area 1
MBSFN_Area1= CALLOC(1, sizeof(*MBSFN_Area1));
MBSFN_Area1->mbsfn_AreaId_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mbsfn_area;
MBSFN_Area1->non_MBSFNregionLength= m2ap_setup_resp->mcch_config_per_mbsfn[i].pdcch_length;
MBSFN_Area1->notificationIndicator_r9= 0;
MBSFN_Area1->mcch_Config_r9.mcch_RepetitionPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].repetition_period;//LTE_MBSFN_AreaInfo_r9__mcch_Config_r9__mcch_RepetitionPeriod_r9_rf32;
MBSFN_Area1->mcch_Config_r9.mcch_Offset_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].offset; // in accordance with mbsfn subframe configuration in sib2
MBSFN_Area1->mcch_Config_r9.mcch_ModificationPeriod_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].modification_period;
// Subframe Allocation Info
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=m2ap_setup_resp->mcch_config_per_mbsfn[i].subframe_allocation_info<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
MBSFN_Area1->mcch_Config_r9.signallingMCS_r9= m2ap_setup_resp->mcch_config_per_mbsfn[i].mcs;
ASN_SEQUENCE_ADD(&MBSFNArea_list->list,MBSFN_Area1);
}
ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part);
}
//xer_fprint(stdout, &asn_DEF_LTE_BCCH_DL_SCH_Message, (void *)bcch_message);
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_DL_SCH_Message,
NULL,
(void *)bcch_message,
buffer,
900);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC,"[eNB] MBMS SIB2 SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
return(-1);
}
carrier->MBMS_flag =1;
if (NODE_IS_MONOLITHIC(rrc->node_type)) {
rrc_mac_config_req_eNB(ctxt_pP->module_id, CC_id,
0,0,0,0,0,
0,
0,//rnti
(LTE_BCCH_BCH_Message_t *)NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(LTE_RadioResourceConfigCommonSIB_t *) NULL,
(struct LTE_PhysicalConfigDedicated *)NULL,
(LTE_SCellToAddMod_r10_t *)NULL,
//(struct LTE_PhysicalConfigDedicatedSCell_r10 *)NULL,
(LTE_MeasObjectToAddMod_t **) NULL,
(LTE_MAC_MainConfig_t *) NULL,
0,
(struct LTE_LogicalChannelConfig *)NULL,
(LTE_MeasGapConfig_t *) NULL,
(LTE_TDD_Config_t *) NULL,
(LTE_MobilityControlInfo_t *)NULL,
(LTE_SchedulingInfoList_t *) NULL,
0, NULL,
(LTE_AdditionalSpectrumEmission_t *)NULL,
(LTE_MBSFN_SubframeConfigList_t *) carrier->sib2->mbsfn_SubframeConfigList,
carrier->MBMS_flag,
(LTE_MBSFN_AreaInfoList_r9_t *) & carrier->sib13->mbsfn_AreaInfoList_r9,
(LTE_PMCH_InfoList_r9_t *) NULL,
(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
0,
(LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
(LTE_SchedulingInfo_MBMS_r14_t *) NULL,
(struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
(LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
(LTE_MBSFN_AreaInfoList_r9_t *) NULL,
(LTE_MBSFNAreaConfiguration_r9_t*) NULL
);
}
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB23 = ((enc_rval.encoded+7)/8);
return 0;
}
int
rrc_eNB_process_M2AP_SETUP_RESP(
const protocol_ctxt_t *const ctxt_pP,
int CC_id,
instance_t instance,
const m2ap_setup_resp_t *const m2ap_setup_resp
)
{
//protocol_ctxt_t ctxt;
//LOG_W(RRC,"instance %d\n",instance);
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[0].SIB23 != NULL,"Memory fo SIB23 not allocated");
AssertFatal(m2ap_setup_resp != NULL, "m2ap_setup_resp memory not allocated");
pthread_mutex_lock(&RC.rrc[ctxt_pP->module_id]->cell_info_mutex);
//RC.rrc[ctxt_pP->module_id]->carrier[CC_id].num_mbsfn_sync_area = m2ap_setup_resp->num_mcch_config_per_mbsfn;
//rrc_M2AP_do_SIB23_SIB13(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_setup_resp);
m2ap_setup_resp_g = (m2ap_setup_resp_t*)calloc(1,sizeof(m2ap_setup_resp_t));
memcpy(m2ap_setup_resp_g,m2ap_setup_resp,sizeof(m2ap_setup_resp_t));
pthread_mutex_unlock(&RC.rrc[ctxt_pP->module_id]->cell_info_mutex);
return 0;
}
int
rrc_eNB_process_M2AP_MBMS_SCHEDULING_INFORMATION(
const protocol_ctxt_t *const ctxt_pP,
int CC_id,
instance_t instance,
const m2ap_mbms_scheduling_information_t *const m2ap_mbms_scheduling_information
)
{
//protocol_ctxt_t ctxt;
//LOG_W(RRC,"instance %d\n",instance);
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[0].SIB23 != NULL,"Memory fo SIB23 not allocated");
AssertFatal(m2ap_mbms_scheduling_information != NULL, "m2ap_mbms_scheduling_information memory not allocated");
//RC.rrc[ctxt_pP->module_id]->carrier[CC_id].num_mbsfn_sync_area = m2ap_setup_resp->num_mcch_config_per_mbsfn;
pthread_mutex_lock(&RC.rrc[ctxt_pP->module_id]->cell_info_mutex);
m2ap_mbms_scheduling_information_g = (m2ap_mbms_scheduling_information_t*)calloc(1,sizeof(m2ap_mbms_scheduling_information_t));
memcpy(m2ap_mbms_scheduling_information_g,m2ap_mbms_scheduling_information,sizeof(m2ap_mbms_scheduling_information_t));
/*if(m2ap_setup_resp_g != NULL){
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].num_mbsfn_sync_area = m2ap_setup_resp_g->num_mcch_config_per_mbsfn;
rrc_M2AP_do_SIB23_SIB2(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_mbms_scheduling_information);
rrc_M2AP_do_SIB23_SIB13(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_setup_resp_g);
rrc_M2AP_init_MCCH(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_mbms_scheduling_information);
rrc_M2AP_init_MBMS(ctxt_pP->module_id, CC_id, 0);
rrc_M2AP_openair_rrc_top_init_MBMS(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].MBMS_flag);
}*/
MessageDef *msg_p;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, 0, M2AP_MBMS_SCHEDULING_INFORMATION_RESP);
itti_send_msg_to_task (TASK_M2AP_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
pthread_mutex_unlock(&RC.rrc[ctxt_pP->module_id]->cell_info_mutex);
return 0;
}
int
rrc_eNB_process_M2AP_MBMS_SESSION_START_REQ(
const protocol_ctxt_t *const ctxt_pP,
int CC_id,
instance_t instance,
const m2ap_session_start_req_t *const m2ap_mbms_session_start_req
)
{
int split_cfg=0;
pthread_mutex_lock(&RC.rrc[ctxt_pP->module_id]->cell_info_mutex);
if(m2ap_setup_resp_g != NULL && m2ap_mbms_scheduling_information_g !=NULL ){
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].num_mbsfn_sync_area = m2ap_setup_resp_g->num_mcch_config_per_mbsfn;
//rrc_M2AP_do_SIB1(ctxt_pP,ctxt_pP->module_id,CC_id,NULL,NULL);
if(split_cfg){
rrc_M2AP_do_SIB23_SIB2(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_mbms_scheduling_information_g);
rrc_M2AP_do_SIB23_SIB13(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_setup_resp_g);
}else{
if(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].FeMBMS_flag){
rrc_M2AP_do_SIB1_MBMS_SIB13(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_setup_resp_g,m2ap_mbms_scheduling_information_g);
}else{
rrc_M2AP_do_SIB23_SIB2_SIB13(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_setup_resp_g,m2ap_mbms_scheduling_information_g);
}
}
rrc_M2AP_init_MCCH(ctxt_pP,ctxt_pP->module_id,CC_id,m2ap_mbms_scheduling_information_g);
rrc_M2AP_init_MBMS(ctxt_pP->module_id, CC_id, 0);
rrc_M2AP_openair_rrc_top_init_MBMS(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].MBMS_flag);
}
pthread_mutex_unlock(&RC.rrc[ctxt_pP->module_id]->cell_info_mutex);
MessageDef *msg_p;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, 0, M2AP_MBMS_SESSION_START_RESP);
itti_send_msg_to_task (TASK_M2AP_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), msg_p);
return 0;
}
int
rrc_eNB_process_M2AP_MBMS_SESSION_STOP_REQ(
const protocol_ctxt_t *const ctxt_pP,
const m2ap_session_stop_req_t *const m2ap_session_stop_req
)
{
return 0;
}
int
rrc_eNB_process_M2AP_RESET(
const protocol_ctxt_t *const ctxt_pP,
const m2ap_reset_t *const m2ap_reset
)
{
return 0;
}
int
rrc_eNB_process_M2AP_ENB_CONFIGURATION_UPDATE_ACK(
const protocol_ctxt_t *const ctxt_pP,
const m2ap_enb_configuration_update_ack_t *const m2ap_enb_configuration_update_ack
)
{
return 0;
}
int
rrc_eNB_process_M2AP_ERROR_INDICATION(
const protocol_ctxt_t *const ctxt_pP,
const m2ap_error_indication_t *const m2ap_error_indication
)
{
return 0;
}
int
rrc_eNB_process_M2AP_MBMS_SERVICE_COUNTING_REQ(
const protocol_ctxt_t *const ctxt_pP,
const m2ap_mbms_service_counting_req_t *const m2ap_mbms_service_counting_req
)
{
return 0;
}
int
rrc_eNB_process_M2AP_MCE_CONFIGURATION_UPDATE(
const protocol_ctxt_t *const ctxt_pP,
const m2ap_mce_configuration_update_t *const m2ap_mce_configuration_update
)
{
return 0;
}
void rrc_eNB_send_M2AP_MBMS_SCHEDULING_INFORMATION_RESP(
const protocol_ctxt_t *const ctxt_pP
//,const rrc_eNB_mbms_context_t *const rrc_eNB_mbms_context
)
{
MessageDef *msg_p;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, 0, M2AP_MBMS_SCHEDULING_INFORMATION_RESP);
itti_send_msg_to_task (TASK_M2AP_ENB, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->instance), msg_p);
}
void rrc_eNB_send_M2AP_MBMS_SESSION_START_RESP(
const protocol_ctxt_t *const ctxt_pP
//,const rrc_eNB_mbms_context_t *const rrc_eNB_mbms_context
)
{
MessageDef *msg_p;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, 0, M2AP_MBMS_SESSION_START_RESP);
itti_send_msg_to_task (TASK_M2AP_ENB, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->instance), msg_p);
}
void rrc_eNB_send_M2AP_MBMS_SESSION_STOP_RESP(
const protocol_ctxt_t *const ctxt_pP
//,const rrc_eNB_mbms_context_t *const rrc_eNB_mbms_context
)
{
MessageDef *msg_p;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, 0, M2AP_MBMS_SESSION_STOP_RESP);
itti_send_msg_to_task (TASK_M2AP_ENB, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->instance), msg_p);
}
void rrc_eNB_send_M2AP_MBMS_SESSION_UPDATE_RESP(
const protocol_ctxt_t *const ctxt_pP
//,const rrc_eNB_mbms_context_t *const rrc_eNB_mbms_context
)
{
MessageDef *msg_p;
msg_p = itti_alloc_new_message (TASK_RRC_ENB, 0, M2AP_MBMS_SESSION_UPDATE_RESP);
itti_send_msg_to_task (TASK_M2AP_ENB, ENB_MODULE_ID_TO_INSTANCE(ctxt_pP->instance), msg_p);
}
| 46.69351 | 224 | 0.720263 |
30dfc7a66d64030421825fd30ecb3d24b79b8d0a | 17,529 | h | C | Engine/ImportScript.h | elliotjb/CulverinEngine-Project3 | cc386713dd786e2a52cc9b219a0d701a9398f202 | [
"MIT"
] | 2 | 2018-01-20T18:17:22.000Z | 2018-01-20T18:17:28.000Z | Engine/ImportScript.h | TempName0/TempMotor3D_P3 | cc386713dd786e2a52cc9b219a0d701a9398f202 | [
"MIT"
] | null | null | null | Engine/ImportScript.h | TempName0/TempMotor3D_P3 | cc386713dd786e2a52cc9b219a0d701a9398f202 | [
"MIT"
] | 1 | 2018-06-16T16:12:11.000Z | 2018-06-16T16:12:11.000Z | #ifndef _IMPORTSCRIPT_
#define _IMPORTSCRIPT_
// Info-> http://docs.go-mono.com/?link=root:/embed
#include "Globals.h"
#include <string>
#include <mono/jit/jit.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/mono-gc.h>
#include <list>
#include <map>
#include "MathGeoLib.h"
class CSharpScript;
class ResourceScript;
class GameObject;
class Component;
class Material;
class ImportScript
{
public:
ImportScript();
~ImportScript();
void Clear();
bool InitScriptingSystem();
void ShutdownMono();
bool Import(const char* file, uint uuid = 0, bool isAutoImport = false);
bool LoadResource(const char* file, ResourceScript* resourceScript);
bool ReImportScript(std::string fileAssets, std::string uid_script, ResourceScript * resourceScript, bool auto_reimport = false);
MonoDomain* Load_domain();
void Unload_domain();
bool CreateNewScript(bool & active);
int CompileScript(const char* file, std::string& libraryScript, const char* uid);
CSharpScript* LoadScript_CSharp(std::string, std::string name = NULL);
CSharpScript* CreateCSharp(MonoImage* image, std::string nameClass = NULL);
MonoClass* GetMonoClassFromImage(MonoImage* image, std::string& name_space, std::string& classname);
MonoDomain* GetMainDomain() const;
MonoDomain* GetDomain() const;
MonoImage* GetCulverinImage() const;
std::string GetMonoPath() const;
void SetCurrentScript(CSharpScript* current);
// Map <MonoObject, GameObject>
void SetMonoMap(GameObject* root, bool is_root = false); // Only used in "Play"
void ClearLinkVariables();
void ClearMonoMap();
void UpdateMonoMap(GameObject* modificate, bool do_delete = false);
void UpdateMonoMap(GameObject* modificate, MonoObject* object);
MonoObject* GetMonoObject(GameObject* gameobject);
GameObject* GetGameObject(MonoObject* monoobject);
void UpdateMonoComp(Component* modificate, uint csreference);
MonoObject* GetMonoObject(Component* component);
Component* GetComponentMono(MonoObject* monoobject);
void UpdateMonoPos(float3* pos, uint csreference);
MonoObject* GetMonoObject(float3* pos);
float3& GetPosMono(MonoObject* monoobject);
void UpdateMonoScript(CSharpScript* script, uint csreference);
MonoObject* GetMonoObject(CSharpScript* script);
CSharpScript* GetScriptMono(MonoObject* monoobject);
void UpdateMonoMaterial(Material* modificate, uint csreference);
MonoObject* GetMonoObject(Material* script);
Material* GetMaterialMono(MonoObject* monoobject);
//Delete Functions -----------------------
void RemoveGObjectVarFromScripting(GameObject* object);
void RemoveGObjectFromMonoMap(GameObject*object);
void RemoveComponentFromMonoList(Component* comp);
void RemoveTransformPosPointerFromMap(float3* pospointer);
void RemoveCSharpScriptFromMonoScript(CSharpScript* script);
void RemoveGObjectReferencesFromMonoScript(GameObject* object);
bool IsNameUnique(std::string name) const;
private:
void LinkFunctions();
// FUNCTIONS ---------
/* Debug - Console */
static void ConsoleLog(MonoObject* string);
/* Scene Management */
static void LoadScene(MonoString* scene_name);
static void LoadSceneNoDestroy(MonoString* scene_name);
static void LoadMultisceneNoDestroy(MonoString* main_scene_name, MonoString* secondary_scene_name);
static bool CheckSceneReady();
static bool CheckMultiSceneReady();
static void RemoveNoDestroy();
static void RemoveSecondaryScene();
static void ChangeToSecondaryScene();
static void BlockGUIinput();
static void QuitScene();
static void LoadNewWalkableMap(MonoString* walkable_map);
static void LoadNewOclusionMap(MonoString* oclusion_map);
static void PushSaveInfoV2(MonoObject* info);
static void PushSaveInfo(float hp);
static float PopLoadInfo();
static MonoString* GetNameActualScene();
static MonoString* GetNameActualOclusionMap();
/* Scene Management */
static void SendInteractiveSelected(MonoObject* interactive);
static bool GetInteractiveSelectedActive();
/* Input */
static mono_bool GetPressAnyKey();
static mono_bool GetKeyDown(int key);
static mono_bool GetKeyUp(int key);
static mono_bool GetKeyRepeat(int key);
static mono_bool GetMouseButtonDown(int buttonmouse);
static mono_bool GetMouseButtonUp(int buttonmouse);
static mono_bool GetMouseButtonRepeat(int buttonmouse);
static MonoObject* GetMousePosition();
static int GetMouseXAxis();
static int GetMouseYAxis();
static int GetMouseMoutionX();
static int GetMouseMoutionY();
static void SetInputManagerActive(MonoString* str, mono_bool active);
static void SetInputManagerBlock(MonoString* str, mono_bool active);
static mono_bool GetInputManagerActive(MonoString* str, mono_bool active);
static mono_bool GetInputManagerBlock(MonoString* str, mono_bool active);
static mono_bool GetInput_KeyDown(MonoString* name, MonoString* input);
static mono_bool GetInput_KeyUp(MonoString* name, MonoString* input);
static mono_bool GetInput_KeyRepeat(MonoString* name, MonoString* input);
static mono_bool GetInput_MouseButtonDown(MonoString* name, MonoString* input);
static mono_bool GetInput_MouseButtonUp(MonoString* name, MonoString* input);
static float GetInput_ControllerAxis(MonoString* name, MonoString* input);
static MonoString* GetInput_ControllerActionName(MonoString* name, MonoString* input, int device, bool negative_key);
static MonoString* GetInput_ControllerKeyBindingName(MonoString* name, MonoString* input, int device, bool negative_key);
static void SetInputActionToChange(MonoString* name, MonoString* input, int device, bool negative_key);
static bool GetChangeInputActive();
static int GetChangeInputState();
static int GetActualDeviceCombo();
static void SavePlayerAction();
static void LoadDefaultPlayerAction();
static void RumblePlay(float intensity, int milliseconds);
/* Time */
static float GetDeltaTime();
static float GetDeltaTimeSpecial();
static float RealtimeSinceStartup();
static float TimeScale();
static void TimeScaleSet(float time);
static void StartTimePlay(float time);
static float TimePlay();
/* CulverinBehaciour */
static MonoObject* GetLinkedObject(MonoObject* object, MonoString* name);
static bool GetEnabled(MonoObject* object);
static void SetEnabled(MonoObject* object, mono_bool active);
/* GameObject */
static mono_bool IsStatic(MonoObject* object);
static mono_bool IsActive(MonoObject* object);
static void SetActive(MonoObject* object, mono_bool active);
static MonoObject* Find(MonoObject* object, MonoString* name);
static MonoObject* GetOwnGameObject();
static int ChildCount(MonoObject* object);
static MonoObject* GetChildByIndex(MonoObject* object, int index);
static MonoObject* GetChildByName(MonoObject* object, MonoString* name);
static MonoObject* GetChildByTagIndex(MonoObject* object, MonoString* tag, int index);
static void SetName(MonoObject* object, MonoString* name);
static MonoString* GetName(MonoObject* object);
static MonoString* GetTag(MonoObject* object);
static void SetTag(MonoObject* object, MonoString* name);
static mono_bool CompareTag(MonoObject* object, MonoString* tag);
static MonoObject* FindGameObjectWithTag(MonoObject* object, MonoString* tag);
static void CreateGameObject(MonoObject* object);
static MonoObject* GetComponent(MonoObject* object, MonoReflectionType* type);
/* Object */
static MonoObject* Instantiate(MonoObject* object, MonoString* prefab);
static MonoObject* SpawnPrefabFromPos(MonoObject* object, MonoString* prefab_name, MonoObject* realposition, MonoObject* realrotation, MonoObject* prefabpos);
static MonoObject* Instantiate_respawn(MonoObject* object, MonoString* prefab, float time);
static void Destroy(MonoObject* object, MonoObject* gameobject, float time);
/*Transform*/
static MonoObject* GetForwardVector(MonoObject* object);
static MonoObject* GetBackwardVector(MonoObject* object);
static MonoObject* GetUpVector(MonoObject* object);
static MonoObject* GetDownVector(MonoObject* object);
static MonoObject* GetRightVector(MonoObject* object);
static MonoObject* GetLeftVector(MonoObject* object);
static void SetForwardVector(MonoObject* object, MonoObject* vector3);
static void SetBackwardVector(MonoObject* object, MonoObject* vector3);
static void SetUpVector(MonoObject* object, MonoObject* vector3);
static void SetDownVector(MonoObject* object, MonoObject* vector3);
static void SetRightVector(MonoObject* object, MonoObject* vector3);
static void SetLeftVector(MonoObject* object, MonoObject* vector3);
static MonoObject* GetPosition(MonoObject* object);
static MonoObject* GetGlobalPosition(MonoObject* object);
static void SetPosition(MonoObject* object, MonoObject* vector3);
static void SetGlobalPosition(MonoObject* object, MonoObject* vector3);
static void Translate(MonoObject* object, MonoObject* vector3);
static MonoObject* GetRotation(MonoObject* object);
static MonoObject* GetGlobalRotation(MonoObject* object);
static void SetRotation(MonoObject* object, MonoObject* vector3);
static void SetGlobalRotation(MonoObject* object, MonoObject* vector3);
static void IncrementRotation(MonoObject* object, MonoObject* vector3);
static void RotateAroundAxis(MonoObject* object, MonoObject* vector3, float angle);
static void SetScale(MonoObject* object, MonoObject* vector3);
static MonoObject* GetScale(MonoObject* object);
static void LookAt(MonoObject* object, MonoObject* vector3);
static void LookAtTrans(MonoObject* object, MonoObject* trans);
static MonoObject* GetLocalTransform(MonoObject* object);
static MonoObject* GetGlobalTransform(MonoObject* object);
/* Component */
static MonoObject* GetParentGameObject(MonoObject* object);
/* Map */
static MonoString* GetMapString(MonoObject* object);
static int GetHeightMap();
static int GetWidthMap();
static float GetSeparation();
/*Audio*/
static void StopAllSounds();
static void PauseAllSounds();
static void ResumeAllSounds();
static void ChangeRTPC(MonoString* var_name, float value);
static void ChangeState(MonoString* group_name, MonoString* state_name);
static float GetVolume();
static void ChangeVolume(float volume);
static void Mute(bool m);
static bool IsMuted();
/*Component Particle*/
static void ActivateEmission(MonoObject* obj, bool active);
static bool IsEmitterActive(MonoObject* obj);
/*Component Audio*/
static void PlayAudioEvent(MonoObject* object, MonoString* name);
static void StopAudioEvent(MonoObject* object, MonoString* name);
static void SetAuxiliarySends(MonoObject* object, MonoString* bus, float value);
/*Component Interactive*/
static void Activate(MonoObject* object, int uid);
static void Deactivate(MonoObject* object, int uid);
static void SetInteractivity(MonoObject* object, mono_bool enable);
static bool IsNormal(MonoObject * object);
static bool IsHighlighted(MonoObject * object);
static bool IsPressed(MonoObject * object);
static bool IsDisabled(MonoObject * object);
/*Component Interactive Button*/
static void Clicked(MonoObject * object);
/*Component Graphic*/
static void SetRaycastTarget(MonoObject * object, mono_bool flag);
static void SetRender(MonoObject * object, mono_bool flag);
static void ActivateRender(MonoObject * object);
static void DeactivateRender(MonoObject * object);
static void SetAlpha(MonoObject* object, float alpha);
static int GetHeight(MonoObject * object);
static int GetWidth(MonoObject * object);
/*Component CheckBox*/
static void HideTick(MonoObject * object);
/*Component Slider*/
static float GetFill(MonoObject * object);
static void SetFill(MonoObject * object, float value);
/*Component Slider*/
/*Component Text*/
static void SetText(MonoObject* object, MonoString* alpha);
/*Component Canvas*/
static void SetCanvasAlpha(MonoObject* object, float alpha);
/*Component Graphic Image*/
static void FillAmount(MonoObject* object, float value);
static void SetColor(MonoObject* object, MonoObject* color, float alpha);
/*Screen*/
static void SetFullScreen(MonoObject * object);
static bool GetFullScreen(MonoObject * object);
static void SetWindowed(MonoObject * object);
static bool GetWindowed(MonoObject * object);
static void SetBordeless(MonoObject * object);
static bool GetBordeless(MonoObject * object);
static void SetVSync(MonoObject * object);
static bool GetVSync(MonoObject * object);
static void ShowFPS(MonoObject * object);
static bool GetFPS(MonoObject * object);
static void SwapControllerVibration(MonoObject * object);
static bool GetControllerVibration(MonoObject * object);
/*Component Collier*/
static MonoObject* GetCollidedObject(MonoObject * object);
static MonoObject* GetContactPoint(MonoObject* object);
static MonoObject* GetContactNormal(MonoObject* object);
static void MoveStaticColliderTo(MonoObject* object, MonoObject* position);
static void CallOnContact(MonoObject* object);
static void CallOnTriggerEnter(MonoObject* object);
static void CollisionActive(MonoObject* object, bool active);
/*Component RigidBody*/
static MonoObject* GetColliderPosition(MonoObject* object);
static MonoObject* GetColliderQuaternion(MonoObject* object);
static void RemoveJoint(MonoObject* object);
static void MoveKinematic(MonoObject* object, MonoObject* position, MonoObject* rotation);
static void ApplyForce(MonoObject* object, MonoObject* force);
static void ApplyImpulse(MonoObject* object, MonoObject* impulse);
static void ApplyTorqueForce(MonoObject* object, MonoObject* force);
static void ApplyTorqueImpulse(MonoObject* object, MonoObject* impulse);
static void LockMotion(MonoObject* object);
static void LockRotation(MonoObject* object);
static void LockTransform(MonoObject* object);
static void UnLockMotion(MonoObject* object);
static void UnLockRotation(MonoObject* object);
static void UnLockTransform(MonoObject* object);
static void ResetForce(MonoObject* object);
static void WakeUp(MonoObject* object);
static void SetAtMaxJointPose(MonoObject* object);
/*Component Joint*/
static void DeleteJoint(MonoObject* object);
/*Component Animation*/
static void PlayAnimation(MonoObject* object, MonoString* string, mono_bool blending);
static void SetTransition(MonoObject* object, MonoString* string, mono_bool condition);
static mono_bool IsAnimationStopped(MonoObject* object, MonoString* string);
static mono_bool IsAnimationRunning(MonoObject* object, MonoString* string);
static mono_bool IsAnimOverXTime(MonoObject* object, float num_between_0_1);
static void SetClipSpeed(MonoObject* object, MonoString* string, float speed_value);
static float GetClipDuration(MonoObject* object, MonoString* string);
static void SetClipDuration(MonoObject* object, MonoString* string, float duration);
static void SetFirstActiveBlendingClip(MonoObject* object, MonoString* string);
static void SetFirstActiveBlendingClipWeight(MonoObject* object, float weight);
static void SetSecondActiveBlendingClip(MonoObject* object, MonoString* string);
static void SetSecondctiveBlendingClipWeight(MonoObject* object, float weight);
static void SetBlendInTime(MonoObject* object, MonoString* string, float weight);
static void PlayAnimationNode(MonoObject* object, MonoString* string);
/*Component Material*/
static void SetAlbedo(MonoObject* object, MonoString* string);
static void SetNormals(MonoObject* object, MonoString* string);
static void SetAmbientOcclusion(MonoObject* object, MonoString* string);
/*Component Light*/
static float GetIntensity(MonoObject* object);
static void SetIntensity(MonoObject* object, float value);
static float GetConstant(MonoObject* object);
static void SetConstant(MonoObject* object, float value);
static float GetLinear(MonoObject* object);
static void SetLinear(MonoObject* object, float value);
static float GetQuadratic(MonoObject* object);
static void SetQuadratic(MonoObject* object, float value);
/*Component Rect_Transform*/
static void SetUIPosition(MonoObject* object, MonoObject* vector3);
static MonoObject* GetUIPosition(MonoObject* object);
static void SetWidth(MonoObject * object, int value);
static void SetHeight(MonoObject * object, int value);
/*Module Physics*/
static MonoObject* RayCast(MonoObject* origin, MonoObject* direction, float distance);
/*Material*/
static void SetBool(MonoObject* object, MonoString* name, bool value);
static void SetFloat(MonoObject* object, MonoString* name, float value);
static MonoObject* GetMaterialByName(MonoObject* object, MonoString* name);
/*Random*/
// min [inclusive] - max [inclusive]
static int RangeInt(int min, int max);
// min [inclusive] - max [exclusive]
static float RangeFloat(float min, float max);
// min [inclusive] - max [inclusive] - norepeat[exclusive]
static int RangeIntNoRepeat(int min, int max, int norepeat);
public:
std::multimap<std::string, GameObject*> map_link_variables;
private:
std::string nameNewScript;
std::string mono_path;
MonoDomain* domain = nullptr;
MonoDomain* childDomain = nullptr;
MonoImage* culverin_mono_image = nullptr;
std::list<std::string> nameScripts;
static CSharpScript* current;
std::multimap<uint, GameObject*> mono_map;
std::multimap<uint, Component*> mono_comp;
std::multimap<uint, float3*> mono_pos;
std::multimap<uint, CSharpScript*> mono_script;
std::map<uint, Quat*> mono_quat;
std::multimap<uint, Material*> mono_material;
};
#endif | 43.068796 | 160 | 0.787096 |
e738947973fdde8d1764a393b6f2829132c7ac36 | 1,455 | h | C | 3rdparty/onvifc/include/ptz_management/preset.h | jjzhang166/zzilla_opencvr | b8914d59908fbb449c1d0359ebcb4788ab1d7c8e | [
"MIT"
] | 2 | 2017-09-16T13:59:15.000Z | 2019-04-24T03:25:36.000Z | 3rdparty/onvifc/include/ptz_management/preset.h | jjzhang166/opencvr | b8914d59908fbb449c1d0359ebcb4788ab1d7c8e | [
"MIT"
] | null | null | null | 3rdparty/onvifc/include/ptz_management/preset.h | jjzhang166/opencvr | b8914d59908fbb449c1d0359ebcb4788ab1d7c8e | [
"MIT"
] | 1 | 2019-04-24T03:25:40.000Z | 2019-04-24T03:25:40.000Z | #ifndef PRESET_H
#define PRESET_H
#include <QObject>
#include <QDomElement>
namespace ONVIF {
class Preset : public QObject
{
Q_OBJECT
Q_PROPERTY(QString profileToken READ profileToken WRITE setProfileToken)
Q_PROPERTY(QString presetName READ presetName WRITE setPresetName)
Q_PROPERTY(QString presetToken READ presetToken WRITE setPresetToken)
Q_PROPERTY(bool result READ result WRITE setResult)
public:
explicit Preset(QObject *parent = NULL);
virtual ~Preset();
QDomElement toxml();
QString profileToken() const
{
return m_profileToken;
}
QString presetName() const
{
return m_presetName;
}
QString presetToken() const
{
return m_presetToken;
}
bool result() const
{
return m_result;
}
public slots:
void setProfileToken(QString arg)
{
m_profileToken = arg;
}
void setPresetName(QString arg)
{
m_presetName = arg;
}
void setPresetToken(QString arg)
{
m_presetToken = arg;
}
void setResult(bool arg)
{
m_result = arg;
}
private:
QString m_profileToken;
QString m_presetName;
QString m_presetToken;
bool m_result;
};
}
#endif // PRESET_H
| 22.045455 | 80 | 0.565636 |
b74958fdafa3df66a6fcc952d44cf2a7f3a0bad4 | 274 | h | C | components/hmi/gdrivers/include/lvgl_disp_config.h | lask/esp-iot-solution | 40cec135eace36cf11ab72988e27546a2c0d025b | [
"Apache-2.0"
] | 45 | 2018-03-15T07:03:50.000Z | 2020-05-11T18:41:02.000Z | components/hmi/gdrivers/include/lvgl_disp_config.h | Conanzhou/esp-iot-solution | f2e0a8ee2448b26171fe361add1b6786b7cf43a0 | [
"Apache-2.0"
] | 27 | 2019-03-12T10:13:29.000Z | 2019-06-07T20:40:56.000Z | components/hmi/gdrivers/include/lvgl_disp_config.h | Conanzhou/esp-iot-solution | f2e0a8ee2448b26171fe361add1b6786b7cf43a0 | [
"Apache-2.0"
] | 12 | 2018-02-28T14:40:59.000Z | 2019-12-26T19:06:09.000Z | #ifndef _LVGL_LCD_CONFIG_H
#define _LVGL_LCD_CONFIG_H
/* lvgl include */
#include "iot_lvgl.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
* @brief Initialize display
*/
lv_disp_drv_t lvgl_lcd_display_init();
#ifdef __cplusplus
}
#endif
#endif /* _LVGL_LCD_CONFIG_H */ | 13.047619 | 38 | 0.740876 |
b7b5f9e449a9411ce9ce767ee6413ab86e4ba944 | 622 | h | C | FTSE/entities/SkillConsumable.h | melindil/FTSE | c0b54194900ac45ce1ecc778d838a72d09278bab | [
"MIT"
] | 3 | 2019-10-05T15:51:12.000Z | 2021-01-08T21:58:48.000Z | FTSE/entities/SkillConsumable.h | melindil/FTSE | c0b54194900ac45ce1ecc778d838a72d09278bab | [
"MIT"
] | 2 | 2021-06-04T13:42:16.000Z | 2021-07-27T10:38:38.000Z | FTSE/entities/SkillConsumable.h | melindil/FTSE | c0b54194900ac45ce1ecc778d838a72d09278bab | [
"MIT"
] | 2 | 2018-07-03T11:31:11.000Z | 2021-06-16T21:05:38.000Z | #pragma once
#include "Collectable.h"
class SkillConsumable :
public Collectable
{
public:
SkillConsumable(EntityID id);
SkillConsumable(void* ptr);
virtual ~SkillConsumable();
virtual void MakeLuaObject(lua_State* l);
static void RegisterLua(lua_State* l, Logger* tmp);
static const uint32_t VTABLE = 0x82089c;
int32_t GetTotalUses();
int32_t GetRemainingUses();
private:
#pragma pack (push,1)
typedef struct
{
int32_t totaluses;
int32_t remaining;
} SkillConsumableStructType;
#pragma pack(pop)
SkillConsumableStructType* GetStruct();
static const uint32_t OFFSET_SKILLCONSUMABLE_STRUCT = 0x830;
};
| 21.448276 | 61 | 0.77492 |
a2c9b50b0d6f3fcee9d114fcfe5c037fa53da25d | 11,565 | h | C | chromiumos-wide-profiling/perf_serializer.h | tcwanggoogle/autofdo | 153c17801358fb9692ed1ec7d0065057d0541eb8 | [
"Apache-2.0"
] | null | null | null | chromiumos-wide-profiling/perf_serializer.h | tcwanggoogle/autofdo | 153c17801358fb9692ed1ec7d0065057d0541eb8 | [
"Apache-2.0"
] | 1 | 2018-06-12T19:47:39.000Z | 2018-06-12T19:47:39.000Z | chromiumos-wide-profiling/perf_serializer.h | tcwanggoogle/autofdo | 153c17801358fb9692ed1ec7d0065057d0541eb8 | [
"Apache-2.0"
] | 1 | 2018-06-12T15:13:47.000Z | 2018-06-12T15:13:47.000Z | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMIUMOS_WIDE_PROFILING_PERF_SERIALIZER_H_
#define CHROMIUMOS_WIDE_PROFILING_PERF_SERIALIZER_H_
#include <string>
#include <vector>
#include "base/macros.h"
#include "chromiumos-wide-profiling/compat/proto.h"
#include "chromiumos-wide-profiling/perf_parser.h"
namespace quipper {
class PerfSerializer;
// Functor to serialize a vector of perf structs to a Proto repeated field,
// using a method serializes one such item.
// Overriding RefT allows serializing a vector of pointers to struct with
// a serialize member fuction that takes const T* (instead of T*const&).
template <typename Proto, typename T, typename RefT = const T&>
struct VectorSerializer {
bool operator()(const std::vector<T>& from,
RepeatedPtrField<Proto>* to) const {
to->Reserve(from.size());
for (size_t i = 0; i != from.size(); ++i) {
Proto* to_element = to->Add();
if (to_element == NULL) {
return false;
}
if (!(p->*serialize)(from[i], to_element)) {
return false;
}
}
return true;
}
const PerfSerializer* p;
bool (PerfSerializer::*serialize)(RefT, Proto*) const;
};
// Functor to deserialize a Proto repeated field to a vector of perf structs,
// using a method that deserializes one Proto.
template <typename Proto, typename T>
struct VectorDeserializer {
bool operator()(const RepeatedPtrField<Proto>& from,
std::vector<T>* to) const {
to->resize(from.size());
for (int i = 0; i != from.size(); ++i) {
if (!(p->*deserialize)(from.Get(i), &(*to)[i])) {
return false;
}
}
return true;
}
const PerfSerializer* p;
bool (PerfSerializer::*deserialize)(const Proto&, T*) const;
};
class PerfSerializer : public PerfParser {
public:
PerfSerializer();
~PerfSerializer();
// Converts raw perf file to protobuf.
bool SerializeFromFile(const string& filename,
quipper::PerfDataProto* perf_data_proto);
// Converts data inside PerfSerializer to protobuf.
bool Serialize(quipper::PerfDataProto* perf_data_proto);
// Converts perf data protobuf to perf data file.
bool DeserializeToFile(const quipper::PerfDataProto& perf_data_proto,
const string& filename);
// Reads in contents of protobuf to store locally. Does not write to any
// output files.
bool Deserialize(const quipper::PerfDataProto& perf_data_proto);
void set_serialize_sorted_events(bool sorted) {
serialize_sorted_events_ = sorted;
}
private:
bool SerializePerfFileAttr(
const PerfFileAttr& perf_file_attr,
quipper::PerfDataProto_PerfFileAttr* perf_file_attr_proto) const;
bool DeserializePerfFileAttr(
const quipper::PerfDataProto_PerfFileAttr& perf_file_attr_proto,
PerfFileAttr* perf_file_attr) const;
bool SerializePerfEventAttr(
const perf_event_attr& perf_event_attr,
quipper::PerfDataProto_PerfEventAttr* perf_event_attr_proto) const;
bool DeserializePerfEventAttr(
const quipper::PerfDataProto_PerfEventAttr& perf_event_attr_proto,
perf_event_attr* perf_event_attr) const;
bool SerializePerfEventType(
const PerfFileAttr& event_attr,
quipper::PerfDataProto_PerfEventType* event_type_proto) const;
bool DeserializePerfEventType(
const quipper::PerfDataProto_PerfEventType& event_type_proto,
PerfFileAttr* event_attr) const;
bool SerializeEvent(const ParsedEvent& event,
quipper::PerfDataProto_PerfEvent* event_proto) const;
bool SerializeEventPointer(
const ParsedEvent* event,
quipper::PerfDataProto_PerfEvent* event_proto) const;
bool DeserializeEvent(
const quipper::PerfDataProto_PerfEvent& event_proto,
malloced_unique_ptr<event_t>* event) const;
bool SerializeEventHeader(
const perf_event_header& header,
quipper::PerfDataProto_EventHeader* header_proto) const;
bool DeserializeEventHeader(
const quipper::PerfDataProto_EventHeader& header_proto,
perf_event_header* header) const;
bool SerializeRecordSample(const event_t& event,
quipper::PerfDataProto_SampleEvent* sample) const;
bool DeserializeRecordSample(
const quipper::PerfDataProto_SampleEvent& sample,
event_t* event) const;
bool SerializeMMapSample(const event_t& event,
quipper::PerfDataProto_MMapEvent* sample) const;
bool DeserializeMMapSample(
const quipper::PerfDataProto_MMapEvent& sample,
event_t* event) const;
bool SerializeMMap2Sample(const event_t& event,
quipper::PerfDataProto_MMapEvent* sample) const;
bool DeserializeMMap2Sample(
const quipper::PerfDataProto_MMapEvent& sample,
event_t* event) const;
bool SerializeCommSample(
const event_t& event,
quipper::PerfDataProto_CommEvent* sample) const;
bool DeserializeCommSample(
const quipper::PerfDataProto_CommEvent& sample,
event_t* event) const;
bool SerializeForkSample(const event_t& event,
quipper::PerfDataProto_ForkEvent* sample) const;
bool DeserializeForkSample(
const quipper::PerfDataProto_ForkEvent& sample,
event_t* event) const;
bool SerializeLostSample(const event_t& event,
quipper::PerfDataProto_LostEvent* sample) const;
bool DeserializeLostSample(
const quipper::PerfDataProto_LostEvent& sample,
event_t* event) const;
bool SerializeThrottleSample(const event_t& event,
quipper::PerfDataProto_ThrottleEvent* sample) const;
bool DeserializeThrottleSample(
const quipper::PerfDataProto_ThrottleEvent& sample,
event_t* event) const;
bool SerializeReadSample(const event_t& event,
quipper::PerfDataProto_ReadEvent* sample) const;
bool DeserializeReadSample(
const quipper::PerfDataProto_ReadEvent& sample,
event_t* event) const;
bool SerializeSampleInfo(
const event_t& event,
quipper::PerfDataProto_SampleInfo* sample_info) const;
bool DeserializeSampleInfo(
const quipper::PerfDataProto_SampleInfo& info,
event_t* event) const;
bool SerializeTracingMetadata(const std::vector<char>& from,
PerfDataProto* to) const;
bool DeserializeTracingMetadata(const PerfDataProto& from,
std::vector<char>* to) const;
bool SerializeBuildIDs(
const std::vector<build_id_event*>& from,
RepeatedPtrField<PerfDataProto_PerfBuildID>* to)
const;
bool DeserializeBuildIDs(
const RepeatedPtrField<PerfDataProto_PerfBuildID>& from,
std::vector<build_id_event*>* to) const;
bool SerializeMetadata(PerfDataProto* to) const;
bool DeserializeMetadata(const PerfDataProto& from);
bool SerializeBuildIDEvent(const build_id_event* from,
PerfDataProto_PerfBuildID* to) const;
bool DeserializeBuildIDEvent(const PerfDataProto_PerfBuildID& from,
build_id_event** to) const;
bool SerializeSingleUint32Metadata(
const PerfUint32Metadata& metadata,
PerfDataProto_PerfUint32Metadata* proto_metadata) const;
bool DeserializeSingleUint32Metadata(
const PerfDataProto_PerfUint32Metadata& proto_metadata,
PerfUint32Metadata* metadata) const;
bool SerializeSingleUint64Metadata(
const PerfUint64Metadata& metadata,
PerfDataProto_PerfUint64Metadata* proto_metadata) const;
bool DeserializeSingleUint64Metadata(
const PerfDataProto_PerfUint64Metadata& proto_metadata,
PerfUint64Metadata* metadata) const;
bool SerializeCPUTopologyMetadata(
const PerfCPUTopologyMetadata& metadata,
PerfDataProto_PerfCPUTopologyMetadata* proto_metadata) const;
bool DeserializeCPUTopologyMetadata(
const PerfDataProto_PerfCPUTopologyMetadata& proto_metadata,
PerfCPUTopologyMetadata* metadata) const;
bool SerializeNodeTopologyMetadata(
const PerfNodeTopologyMetadata& metadata,
PerfDataProto_PerfNodeTopologyMetadata* proto_metadata) const;
bool DeserializeNodeTopologyMetadata(
const PerfDataProto_PerfNodeTopologyMetadata& proto_metadata,
PerfNodeTopologyMetadata* metadata) const;
const VectorSerializer<PerfDataProto_PerfFileAttr, PerfFileAttr>
SerializePerfFileAttrs = {this, &PerfSerializer::SerializePerfFileAttr};
const VectorDeserializer<PerfDataProto_PerfFileAttr, PerfFileAttr>
DeserializePerfFileAttrs = {
this, &PerfSerializer::DeserializePerfFileAttr};
const VectorSerializer<PerfDataProto_PerfEventType, PerfFileAttr>
SerializePerfEventTypes = {this, &PerfSerializer::SerializePerfEventType};
const VectorDeserializer<PerfDataProto_PerfEventType, PerfFileAttr>
DeserializePerfEventTypes = {
this, &PerfSerializer::DeserializePerfEventType};
const VectorSerializer<PerfDataProto_PerfEvent, ParsedEvent>
SerializeEvents = {this, &PerfSerializer::SerializeEvent};
const VectorSerializer<PerfDataProto_PerfEvent,
ParsedEvent*, const ParsedEvent*>
SerializeEventPointers = {this, &PerfSerializer::SerializeEventPointer};
const VectorDeserializer<PerfDataProto_PerfEvent,
malloced_unique_ptr<event_t>>
DeserializeEvents = {this, &PerfSerializer::DeserializeEvent};
const VectorSerializer<PerfDataProto_PerfBuildID,
build_id_event*, const build_id_event*>
SerializeBuildIDEvents = {this, &PerfSerializer::SerializeBuildIDEvent};
const VectorDeserializer<PerfDataProto_PerfBuildID, build_id_event*>
DeserializeBuildIDEvents = {
this, &PerfSerializer::DeserializeBuildIDEvent};
const VectorSerializer<PerfDataProto_PerfUint32Metadata, PerfUint32Metadata>
SerializeUint32Metadata = {
this, &PerfSerializer::SerializeSingleUint32Metadata};
const VectorDeserializer<PerfDataProto_PerfUint32Metadata, PerfUint32Metadata>
DeserializeUint32Metadata = {
this, &PerfSerializer::DeserializeSingleUint32Metadata};
const VectorSerializer<PerfDataProto_PerfUint64Metadata, PerfUint64Metadata>
SerializeUint64Metadata = {
this, &PerfSerializer::SerializeSingleUint64Metadata};
const VectorDeserializer<PerfDataProto_PerfUint64Metadata, PerfUint64Metadata>
DeserializeUint64Metadata = {
this, &PerfSerializer::DeserializeSingleUint64Metadata};
const VectorSerializer<PerfDataProto_PerfNodeTopologyMetadata,
PerfNodeTopologyMetadata>
SerializeNUMATopologyMetadata = {
this, &PerfSerializer::SerializeNodeTopologyMetadata};
const VectorDeserializer<PerfDataProto_PerfNodeTopologyMetadata,
PerfNodeTopologyMetadata>
DeserializeNUMATopologyMetadata = {
this, &PerfSerializer::DeserializeNodeTopologyMetadata};
// Transitional: Start referring to base-class fields using this reference.
// Then replace inheritance with composition.
PerfParser& parser_ = *this;
// Set this flag to serialize perf events in chronological order, rather than
// the order in which they appear in the raw data.
bool serialize_sorted_events_;
DISALLOW_COPY_AND_ASSIGN(PerfSerializer);
};
} // namespace quipper
#endif // CHROMIUMOS_WIDE_PROFILING_PERF_SERIALIZER_H_
| 39.070946 | 80 | 0.732555 |
4e2fa55f0068133bd357733f881249470eda4245 | 966 | h | C | core/views/note_book.h | jeffpanici75/ryu | 5a6ce78918932bbd236bfa29112f11907d782655 | [
"MIT"
] | 35 | 2018-02-01T20:53:13.000Z | 2022-02-28T18:41:05.000Z | core/views/note_book.h | jeffpanici75/ryu | 5a6ce78918932bbd236bfa29112f11907d782655 | [
"MIT"
] | 7 | 2018-09-18T22:09:25.000Z | 2018-09-18T22:21:14.000Z | core/views/note_book.h | jeffpanici75/ryu | 5a6ce78918932bbd236bfa29112f11907d782655 | [
"MIT"
] | 5 | 2021-05-14T10:27:47.000Z | 2021-12-01T13:28:07.000Z | //
// Ryu
//
// Copyright (C) 2017 Jeff Panici
// All Rights Reserved.
//
// See the LICENSE file for details about the license covering
// this source code file.
//
#pragma once
#include <core/view.h>
namespace ryu::core {
class note_book : public core::view {
public:
note_book(
const std::string& name,
core::view_host* host);
~note_book() override;
size_t active_tab() const;
void remove_tab(size_t index);
void active_tab(size_t index);
void add_tab(const std::string& title, core::view* content);
protected:
void on_initialize() override;
void on_font_family_changed() override;
void on_draw(core::renderer& surface) override;
private:
void bind_events();
void define_actions();
void calculate_tab_and_page_sizes();
private:
size_t _index = 0;
std::vector<std::string> _tabs;
};
};
| 17.888889 | 68 | 0.606625 |
ec4fc948ef7c4649b3a7877e93bc216a40a3c0ed | 28,329 | c | C | src/cts-contact-read.c | tizenorg/platform.core.pim.contacts-service | b1cf31bca0b13e51a27f7cb3e431e847618308b9 | [
"Apache-2.0"
] | null | null | null | src/cts-contact-read.c | tizenorg/platform.core.pim.contacts-service | b1cf31bca0b13e51a27f7cb3e431e847618308b9 | [
"Apache-2.0"
] | null | null | null | src/cts-contact-read.c | tizenorg/platform.core.pim.contacts-service | b1cf31bca0b13e51a27f7cb3e431e847618308b9 | [
"Apache-2.0"
] | null | null | null | /*
* Contacts Service
*
* Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact: Youngjae Shin <yj99.shin@samsung.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 <time.h>
#include "cts-internal.h"
#include "cts-schema.h"
#include "cts-sqlite.h"
#include "cts-utils.h"
#include "cts-normalize.h"
#include "cts-restriction.h"
#include "cts-im.h"
#include "cts-contact.h"
#define CTS_MAIN_CTS_GET_UID (1<<0)
#define CTS_MAIN_CTS_GET_RINGTON (1<<1)
#define CTS_MAIN_CTS_GET_NOTE (1<<2)
#define CTS_MAIN_CTS_GET_DEFAULT_NUM (1<<3)
#define CTS_MAIN_CTS_GET_DEFAULT_EMAIL (1<<4)
#define CTS_MAIN_CTS_GET_FAVOR (1<<5)
#define CTS_MAIN_CTS_GET_IMG (1<<6)
#define CTS_MAIN_CTS_GET_ALL (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6)
static int cts_get_main_contacts_info(int op_code, int index, contact_t *contact)
{
int ret, len;
cts_stmt stmt = NULL;
char query[CTS_SQL_MAX_LEN] = {0};
char *temp;
len = snprintf(query, sizeof(query), "SELECT ");
len += snprintf(query+len, sizeof(query)-len,
"contact_id, person_id, addrbook_id, changed_time");
if(op_code & CTS_MAIN_CTS_GET_UID)
len += snprintf(query+len, sizeof(query)-len, ", uid");
if (op_code & CTS_MAIN_CTS_GET_RINGTON)
len += snprintf(query+len, sizeof(query)-len, ", ringtone");
if (op_code & CTS_MAIN_CTS_GET_NOTE)
len += snprintf(query+len, sizeof(query)-len, ", note");
if (op_code & CTS_MAIN_CTS_GET_DEFAULT_NUM)
len += snprintf(query+len, sizeof(query)-len, ", default_num");
if (op_code & CTS_MAIN_CTS_GET_DEFAULT_EMAIL)
len += snprintf(query+len, sizeof(query)-len, ", default_email");
if (op_code & CTS_MAIN_CTS_GET_FAVOR)
len += snprintf(query+len, sizeof(query)-len, ", is_favorite");
if (op_code & CTS_MAIN_CTS_GET_IMG) {
len += snprintf(query+len, sizeof(query)-len, ", image0");
len += snprintf(query+len, sizeof(query)-len, ", image1");
}
snprintf(query+len, sizeof(query)-len,
" FROM %s WHERE contact_id = %d", CTS_TABLE_CONTACTS, index);
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
ret = cts_stmt_step(stmt);
if (CTS_TRUE != ret)
{
ERR("cts_stmt_step() Failed(%d)", ret);
cts_stmt_finalize(stmt);
return CTS_ERR_DB_RECORD_NOT_FOUND;
}
int count=0;
contact->base = (cts_ct_base *)contacts_svc_value_new(CTS_VALUE_CONTACT_BASE_INFO);
if (NULL == contact->base) {
cts_stmt_finalize(stmt);
ERR("contacts_svc_value_new(CTS_VALUE_CONTACT_BASE_INFO) Failed");
return CTS_ERR_OUT_OF_MEMORY;
}
contact->base->id = cts_stmt_get_int(stmt, count++);
contact->base->person_id = cts_stmt_get_int(stmt, count++);
contact->base->addrbook_id = cts_stmt_get_int(stmt, count++);
contact->base->changed_time = cts_stmt_get_int(stmt, count++);
if (op_code & CTS_MAIN_CTS_GET_UID)
{
contact->base->embedded = true;
temp = cts_stmt_get_text(stmt, count++);
contact->base->uid = SAFE_STRDUP(temp);
}
if (op_code & CTS_MAIN_CTS_GET_RINGTON)
{
contact->base->embedded = true;
temp = cts_stmt_get_text(stmt, count++);
if (temp && CTS_SUCCESS == cts_exist_file(temp))
contact->base->ringtone_path = strdup(temp);
else
contact->base->ringtone_path = NULL;
}
if (op_code & CTS_MAIN_CTS_GET_NOTE)
{
contact->base->embedded = true;
temp = cts_stmt_get_text(stmt, count++);
contact->base->note = SAFE_STRDUP(temp);
}
if (op_code & CTS_MAIN_CTS_GET_DEFAULT_NUM)
contact->default_num = cts_stmt_get_int(stmt, count++);
if (op_code & CTS_MAIN_CTS_GET_DEFAULT_EMAIL)
contact->default_email = cts_stmt_get_int(stmt, count++);
if (op_code & CTS_MAIN_CTS_GET_FAVOR)
contact->base->is_favorite = cts_stmt_get_int(stmt, count++);
if (op_code & CTS_MAIN_CTS_GET_IMG) {
char tmp_path[CTS_IMG_PATH_SIZE_MAX];
contact->base->embedded = true;
temp = cts_stmt_get_text(stmt, count++);
if (temp) {
snprintf(tmp_path, sizeof(tmp_path), "%s/%s", CTS_IMAGE_LOCATION, temp);
contact->base->img_path = strdup(tmp_path);
}
temp = cts_stmt_get_text(stmt, count++);
if (temp) {
snprintf(tmp_path, sizeof(tmp_path), "%s/%s", CTS_IMAGE_LOCATION, temp);
contact->base->full_img_path = strdup(tmp_path);
}
}
cts_stmt_finalize(stmt);
return CTS_SUCCESS;
}
static inline int cts_get_data_info_number(cts_stmt stmt, contact_t *contact)
{
cts_number *result;
result = (cts_number *)contacts_svc_value_new(CTS_VALUE_NUMBER);
if (result) {
int cnt = 1;
result->embedded = true;
cnt = cts_stmt_get_number(stmt, result, cnt);
if (result->id == contact->default_num)
result->is_default = true;
result->is_favorite = cts_stmt_get_int(stmt, cnt);
contact->numbers = g_slist_append(contact->numbers, result);
}
return CTS_SUCCESS;
}
static inline int cts_get_data_info_email(cts_stmt stmt, contact_t *contact)
{
cts_email *result;
result = (cts_email *)contacts_svc_value_new(CTS_VALUE_EMAIL);
if (result) {
result->embedded = true;
cts_stmt_get_email(stmt, result, 1);
if (result->id == contact->default_email)
result->is_default = true;
contact->emails = g_slist_append(contact->emails, result);
}
return CTS_SUCCESS;
}
static inline cts_name* cts_get_data_info_name(cts_stmt stmt)
{
cts_name *result;
result = (cts_name *)contacts_svc_value_new(CTS_VALUE_NAME);
if (result) {
result->embedded = true;
cts_stmt_get_name(stmt, result, 1);
}
return result;
}
static inline int cts_get_data_info_event(cts_stmt stmt, contact_t *contact)
{
int cnt=1;
cts_event *result;
result = (cts_event *)contacts_svc_value_new(CTS_VALUE_EVENT);
if (result) {
result->embedded = true;
result->id = cts_stmt_get_int(stmt, cnt++);
result->type = cts_stmt_get_int(stmt, cnt++);
result->date = cts_stmt_get_int(stmt, cnt++);
contact->events = g_slist_append(contact->events, result);
}
return CTS_SUCCESS;
}
static inline int cts_get_data_info_messenger(cts_stmt stmt, contact_t *contact)
{
int cnt=1;
cts_messenger *result;
result = (cts_messenger *)contacts_svc_value_new(CTS_VALUE_MESSENGER);
if (result) {
char *temp;
result->embedded = true;
result->id = cts_stmt_get_int(stmt, cnt++);
result->type = cts_stmt_get_int(stmt, cnt++);
temp = cts_stmt_get_text(stmt, cnt++);
result->im_id = SAFE_STRDUP(temp);
if (CTS_IM_TYPE_NONE == result->type) {
temp = cts_stmt_get_text(stmt, cnt++);
result->svc_name = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->svc_op = SAFE_STRDUP(temp);
}
contact->messengers = g_slist_append(contact->messengers, result);
}
return CTS_SUCCESS;
}
static inline int cts_get_data_info_postal(cts_stmt stmt, contact_t *contact)
{
int cnt=1;
cts_postal *result;
result = (cts_postal *)contacts_svc_value_new(CTS_VALUE_POSTAL);
if (result) {
char *temp;
result->embedded = true;
result->id = cts_stmt_get_int(stmt, cnt++);
result->type = cts_stmt_get_int(stmt, cnt++);
temp = cts_stmt_get_text(stmt, cnt++);
result->pobox= SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->postalcode = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->region= SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->locality = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->street = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->extended = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->country = SAFE_STRDUP(temp);
contact->postal_addrs = g_slist_append(contact->postal_addrs, result);
}
return CTS_SUCCESS;
}
static inline int cts_get_data_info_web(cts_stmt stmt, contact_t *contact)
{
int cnt=1;
cts_web *result;
result = (cts_web *)contacts_svc_value_new(CTS_VALUE_WEB);
if (result) {
char *temp;
result->embedded = true;
result->id = cts_stmt_get_int(stmt, cnt++);
result->type = cts_stmt_get_int(stmt, cnt++);
temp = cts_stmt_get_text(stmt, cnt++);
result->url = SAFE_STRDUP(temp);
contact->web_addrs = g_slist_append(contact->web_addrs, result);
}
return CTS_SUCCESS;
}
static inline int cts_get_data_info_nick(cts_stmt stmt, contact_t *contact)
{
int cnt=1;
cts_nickname *result;
result = (cts_nickname *)contacts_svc_value_new(CTS_VALUE_NICKNAME);
if (result) {
char *temp;
result->embedded = true;
result->id = cts_stmt_get_int(stmt, cnt++);
temp = cts_stmt_get_text(stmt, cnt+1);
result->nick = SAFE_STRDUP(temp);
contact->nicknames = g_slist_append(contact->nicknames, result);
}
return CTS_SUCCESS;
}
static inline cts_company* cts_get_data_info_company(cts_stmt stmt)
{
int cnt=1;
cts_company *result;
result = (cts_company *)contacts_svc_value_new(CTS_VALUE_COMPANY);
retvm_if(NULL == result, NULL, "contacts_svc_value_new() Failed");
char *temp;
result->embedded = true;
result->id = cts_stmt_get_int(stmt, cnt++);
cnt++;
temp = cts_stmt_get_text(stmt, cnt++);
result->name = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->department = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->jot_title = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->role = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->assistant_name = SAFE_STRDUP(temp);
if (result->name || result->department || result->jot_title || result->role || result->assistant_name)
return result;
else {
contacts_svc_value_free((CTSvalue *)result);
return NULL;
}
}
static cts_extend* cts_make_extend_data(cts_stmt stmt, int type, int cnt)
{
cts_extend *result;
result = (cts_extend *)contacts_svc_value_new(CTS_VALUE_EXTEND);
if (result)
{
char *temp;
result->type = type;
result->id = cts_stmt_get_int(stmt, cnt++);
result->data1 = cts_stmt_get_int(stmt, cnt++);
temp = cts_stmt_get_text(stmt, cnt++);
result->data2= SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data3 = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data4= SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data5 = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data6 = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data7 = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data8 = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data9 = SAFE_STRDUP(temp);
temp = cts_stmt_get_text(stmt, cnt++);
result->data10 = SAFE_STRDUP(temp);
}
return result;
}
static inline int cts_get_data_info_extend(cts_stmt stmt, int type,
contact_t *contact)
{
cts_extend *result;
result = cts_make_extend_data(stmt, type, 1);
if (result) {
result->embedded = true;
contact->extended_values = g_slist_append(contact->extended_values, result);
}
else
return CTS_ERR_OUT_OF_MEMORY;
return CTS_SUCCESS;
}
int cts_get_data_info(int op_code, int field, int index, contact_t *contact)
{
int ret, datatype, len;
const char *data;
cts_stmt stmt = NULL;
char query[CTS_SQL_MAX_LEN] = {0};
if (cts_restriction_get_permit())
data = CTS_TABLE_DATA;
else
data = CTS_TABLE_RESTRICTED_DATA_VIEW;
switch (op_code)
{
case CTS_GET_DATA_BY_CONTACT_ID:
len = snprintf(query, sizeof(query), "SELECT datatype, id, data1, data2,"
"data3, data4, data5, data6, data7, data8, data9, data10 "
"FROM %s WHERE contact_id = %d", data, index);
break;
case CTS_GET_DATA_BY_ID:
default:
ERR("Invalid parameter : The op_code(%d) is not supported", op_code);
return CTS_ERR_ARG_INVALID;
}
if (CTS_DATA_FIELD_ALL != field && CTS_DATA_FIELD_EXTEND_ALL != field)
{
bool first= true;
len += snprintf(query+len, sizeof(query)-len, " AND datatype IN (");
if (field & CTS_DATA_FIELD_NAME) {
first=false;
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_NAME);
}
if (field & CTS_DATA_FIELD_EVENT) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_EVENT);
}
if (field & CTS_DATA_FIELD_MESSENGER) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_MESSENGER);
}
if (field & CTS_DATA_FIELD_POSTAL) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_POSTAL);
}
if (field & CTS_DATA_FIELD_WEB) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_WEB);
}
if (field & CTS_DATA_FIELD_NICKNAME) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_NICKNAME);
}
if (field & CTS_DATA_FIELD_COMPANY) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_COMPANY);
}
if (field & CTS_DATA_FIELD_NUMBER) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_NUMBER);
}
if (field & CTS_DATA_FIELD_EMAIL) {
if (first)
first=false;
else
len += snprintf(query+len, sizeof(query)-len, ", ");
len += snprintf(query+len, sizeof(query)-len, "%d", CTS_DATA_EMAIL);
}
len += snprintf(query+len, sizeof(query)-len, ")");
}
if (CTS_DATA_FIELD_ALL != field && field & CTS_DATA_FIELD_EXTEND_ALL) {
len += snprintf(query+len, sizeof(query)-len, " AND datatype>=%d",
CTS_DATA_EXTEND_START);
}
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
ret = cts_stmt_step(stmt);
if (CTS_TRUE != ret)
{
ERR("cts_stmt_step() Failed(%d)", ret);
cts_stmt_finalize(stmt);
return CTS_ERR_DB_RECORD_NOT_FOUND;
}
do {
datatype = cts_stmt_get_int(stmt, 0);
switch (datatype)
{
case CTS_DATA_NAME:
if (contact->name)
ERR("name already Exist");
else
contact->name = cts_get_data_info_name(stmt);
break;
case CTS_DATA_EVENT:
cts_get_data_info_event(stmt, contact);
break;
case CTS_DATA_MESSENGER:
cts_get_data_info_messenger(stmt, contact);
break;
case CTS_DATA_POSTAL:
cts_get_data_info_postal(stmt, contact);
break;
case CTS_DATA_WEB:
cts_get_data_info_web(stmt, contact);
break;
case CTS_DATA_NICKNAME:
cts_get_data_info_nick(stmt, contact);
break;
case CTS_DATA_NUMBER:
cts_get_data_info_number(stmt, contact);
break;
case CTS_DATA_EMAIL:
cts_get_data_info_email(stmt, contact);
break;
case CTS_DATA_COMPANY:
if (contact->company)
ERR("company already Exist");
else
contact->company = cts_get_data_info_company(stmt);
break;
default:
if (CTS_DATA_EXTEND_START <= datatype) {
cts_get_data_info_extend(stmt, datatype, contact);
break;
}
ERR("Unknown data type(%d)", datatype);
continue;
}
}while(CTS_TRUE == cts_stmt_step(stmt));
cts_stmt_finalize(stmt);
return CTS_SUCCESS;
}
static inline int cts_get_groups_info(int index, contact_t *contact)
{
cts_stmt stmt = NULL;
char query[CTS_SQL_MAX_LEN] = {0};
GSList *result_list=NULL;
snprintf(query, sizeof(query), "SELECT group_id, addrbook_id,"
" group_name"
" FROM %s WHERE group_id IN (SELECT group_id"
" FROM %s WHERE contact_id = %d)"
" ORDER BY group_name COLLATE NOCASE",
CTS_TABLE_GROUPS, CTS_TABLE_GROUPING_INFO, index);
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
while (CTS_TRUE == cts_stmt_step(stmt))
{
cts_group *group_info;
group_info = (cts_group *)contacts_svc_value_new(CTS_VALUE_GROUP_RELATION);
if (group_info)
{
group_info->id = cts_stmt_get_int(stmt, 0);
group_info->addrbook_id = cts_stmt_get_int(stmt, 1);
group_info->embedded = true;
group_info->name = SAFE_STRDUP(cts_stmt_get_text(stmt, 2));
group_info->img_loaded = false; //It will load at cts_value_get_str_group()
result_list = g_slist_append(result_list, group_info);
}
}
cts_stmt_finalize(stmt);
contact->grouprelations = result_list;
return CTS_SUCCESS;
}
static inline int cts_get_number_value(int op_code, int id, CTSvalue **value)
{
int ret;
cts_stmt stmt;
const char *data;
cts_number *number;
char query[CTS_SQL_MAX_LEN] = {0};
if (cts_restriction_get_permit())
data = CTS_TABLE_DATA;
else
data = CTS_TABLE_RESTRICTED_DATA_VIEW;
if (CTS_GET_DEFAULT_NUMBER_VALUE == op_code) {
snprintf(query, sizeof(query),
"SELECT B.id, B.data1, B.data2 FROM %s A, %s B "
"WHERE A.contact_id = %d AND B.id=A.default_num AND B.datatype = %d",
CTS_TABLE_CONTACTS, data, id, CTS_DATA_NUMBER);
}
else if (CTS_GET_NUMBER_VALUE == op_code) {
snprintf(query, sizeof(query),
"SELECT id, data1, data2, contact_id FROM %s "
"WHERE id = %d AND datatype = %d",
data, id, CTS_DATA_NUMBER);
}
else {
ERR("Invalid op_code(%d)", op_code);
return CTS_ERR_ARG_INVALID;
}
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
ret = cts_stmt_step(stmt);
if (CTS_TRUE != ret)
{
ERR("cts_stmt_step() Failed(%d)", ret);
cts_stmt_finalize(stmt);
return CTS_ERR_DB_RECORD_NOT_FOUND;
}
number = (cts_number *)contacts_svc_value_new(CTS_VALUE_NUMBER);
if (number) {
ret = CTS_SUCCESS;
number->v_type = CTS_VALUE_RDONLY_NUMBER;
number->embedded = true;
cts_stmt_get_number(stmt, number, 0);
if (CTS_GET_DEFAULT_NUMBER_VALUE == op_code)
number->is_default = true;
else
ret = cts_stmt_get_int(stmt, 3);
*value = (CTSvalue*) number;
cts_stmt_finalize(stmt);
return ret;
}
else {
ERR("contacts_svc_value_new() Failed");
cts_stmt_finalize(stmt);
return CTS_ERR_OUT_OF_MEMORY;
}
}
static inline int cts_get_email_value(int op_code, int id, CTSvalue **value)
{
int ret;
cts_stmt stmt;
const char *data;
cts_email *email;
char query[CTS_SQL_MAX_LEN] = {0};
if (cts_restriction_get_permit())
data = CTS_TABLE_DATA;
else
data = CTS_TABLE_RESTRICTED_DATA_VIEW;
if (CTS_GET_DEFAULT_EMAIL_VALUE == op_code) {
snprintf(query, sizeof(query),
"SELECT B.id, B.data1, B.data2 FROM %s A, %s B "
"WHERE A.contact_id = %d AND B.id=A.default_email AND B.datatype = %d",
CTS_TABLE_CONTACTS, data, id, CTS_DATA_EMAIL);
}
else if (CTS_GET_EMAIL_VALUE == op_code) {
snprintf(query, sizeof(query),
"SELECT id, data1, data2, contact_id FROM %s "
"WHERE id = %d AND datatype = %d",
data, id, CTS_DATA_EMAIL);
}
else {
ERR("Invalid op_code(%d)", op_code);
return CTS_ERR_ARG_INVALID;
}
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
ret = cts_stmt_step(stmt);
if (CTS_TRUE != ret)
{
ERR("cts_stmt_step() Failed(%d)", ret);
cts_stmt_finalize(stmt);
return CTS_ERR_DB_RECORD_NOT_FOUND;
}
email = (cts_email *)contacts_svc_value_new(CTS_VALUE_EMAIL);
if (email)
{
ret = CTS_SUCCESS;
email->v_type = CTS_VALUE_RDONLY_EMAIL;
email->embedded = true;
cts_stmt_get_email(stmt, email, 0);
if (CTS_GET_DEFAULT_EMAIL_VALUE == op_code)
email->is_default = true;
else
ret = cts_stmt_get_int(stmt, 3);
*value = (CTSvalue*) email;
cts_stmt_finalize(stmt);
return ret;
}
else
{
ERR("contacts_svc_value_new() Failed");
cts_stmt_finalize(stmt);
return CTS_ERR_OUT_OF_MEMORY;
}
}
static inline int cts_get_extend_data(int type, int id, CTSvalue **value)
{
int ret;
cts_stmt stmt;
char query[CTS_SQL_MAX_LEN] = {0};
snprintf(query, sizeof(query), "SELECT id, data1, data2,"
"data3, data4, data5, data6, data7, data8, data9, data10 "
"FROM %s WHERE datatype = %d AND contact_id = %d", CTS_TABLE_DATA, type, id);
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
ret = cts_stmt_step(stmt);
if (CTS_TRUE != ret)
{
ERR("cts_stmt_step() Failed(%d)", ret);
cts_stmt_finalize(stmt);
return CTS_ERR_DB_RECORD_NOT_FOUND;
}
*value = (CTSvalue *)cts_make_extend_data(stmt, type, 0);
cts_stmt_finalize(stmt);
retvm_if(NULL == *value, CTS_ERR_OUT_OF_MEMORY, "cts_make_extend_data() return NULL");
return CTS_SUCCESS;
}
API int contacts_svc_get_contact_value(cts_get_contact_val_op op_code,
int id, CTSvalue **value)
{
int ret;
contact_t temp={0};
retv_if(NULL == value, CTS_ERR_ARG_NULL);
CTS_START_TIME_CHECK;
if ((int)CTS_DATA_EXTEND_START <= op_code) {
ret = cts_get_extend_data(op_code, id, value);
retvm_if(CTS_SUCCESS != ret, ret, "cts_get_extend_data() Failed(%d)", ret);
}
else {
switch (op_code)
{
case CTS_GET_NAME_VALUE:
ret = cts_get_data_info(CTS_GET_DATA_BY_CONTACT_ID,
CTS_DATA_FIELD_NAME, id, &temp);
retvm_if(CTS_SUCCESS != ret, ret,
"cts_get_data_info(CTS_GET_DATA_BY_CONTACT_ID) Failed(%d)", ret);
if (temp.name) {
temp.name->v_type = CTS_VALUE_RDONLY_NAME;
*value = (CTSvalue *)temp.name;
}else
*value = NULL;
break;
case CTS_GET_DEFAULT_NUMBER_VALUE:
case CTS_GET_NUMBER_VALUE:
ret = cts_get_number_value(op_code, id, value);
retvm_if(ret < CTS_SUCCESS, ret,
"cts_get_number_value() Failed(%d)", ret);
break;
case CTS_GET_DEFAULT_EMAIL_VALUE:
case CTS_GET_EMAIL_VALUE:
ret = cts_get_email_value(op_code, id, value);
retvm_if(ret < CTS_SUCCESS, ret, "cts_get_email_value() Failed(%d)", ret);
break;
case CTS_GET_COMPANY_VALUE:
ret = cts_get_data_info(CTS_GET_DATA_BY_CONTACT_ID,
CTS_DATA_FIELD_COMPANY, id, &temp);
retvm_if(CTS_SUCCESS != ret, ret,
"cts_get_data_info(CTS_DATA_FIELD_COMPANY) Failed(%d)", ret);
if (temp.company) {
temp.company->v_type = CTS_VALUE_RDONLY_COMPANY;
*value = (CTSvalue *)temp.company;
}else
*value = NULL;
break;
default:
ERR("Invalid parameter : The op_code(%d) is not supported", op_code);
return CTS_ERR_ARG_INVALID;
}
}
if (NULL == *value) return CTS_ERR_NO_DATA;
CTS_END_TIME_CHECK();
return ret;
}
static inline cts_ct_base* cts_get_myprofile_base(cts_stmt stmt)
{
cts_ct_base *result;
result = (cts_ct_base *)contacts_svc_value_new(CTS_VALUE_CONTACT_BASE_INFO);
if (result) {
char *temp;
result->embedded = true;
temp = cts_stmt_get_text(stmt, 2);
result->note = SAFE_STRDUP(temp);
result->img_path = cts_get_img(CTS_MY_IMAGE_LOCATION, 0, NULL, 0);
}
return result;
}
int cts_get_myprofile_data(contact_t *contact)
{
int ret, datatype, len;
cts_stmt stmt = NULL;
char query[CTS_SQL_MAX_LEN];
len = snprintf(query, sizeof(query), "SELECT datatype, id, data1, data2,"
"data3, data4, data5, data6, data7, data8, data9, data10 "
"FROM %s ", CTS_TABLE_MY_PROFILES);
stmt = cts_query_prepare(query);
retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed");
ret = cts_stmt_step(stmt);
if (CTS_TRUE != ret) {
ERR("cts_stmt_step() Failed(%d)", ret);
cts_stmt_finalize(stmt);
return CTS_ERR_DB_RECORD_NOT_FOUND;
}
do {
datatype = cts_stmt_get_int(stmt, 0);
switch (datatype)
{
case 0:
contact->base = cts_get_myprofile_base(stmt);
break;
case CTS_DATA_NAME:
if (contact->name)
ERR("name already Exist");
else
contact->name = cts_get_data_info_name(stmt);
break;
case CTS_DATA_EVENT:
cts_get_data_info_event(stmt, contact);
break;
case CTS_DATA_MESSENGER:
cts_get_data_info_messenger(stmt, contact);
break;
case CTS_DATA_POSTAL:
cts_get_data_info_postal(stmt, contact);
break;
case CTS_DATA_WEB:
cts_get_data_info_web(stmt, contact);
break;
case CTS_DATA_NICKNAME:
cts_get_data_info_nick(stmt, contact);
break;
case CTS_DATA_NUMBER:
cts_get_data_info_number(stmt, contact);
break;
case CTS_DATA_EMAIL:
cts_get_data_info_email(stmt, contact);
break;
case CTS_DATA_COMPANY:
if (contact->company)
ERR("company already Exist");
else
contact->company = cts_get_data_info_company(stmt);
break;
default:
if (CTS_DATA_EXTEND_START <= datatype) {
cts_get_data_info_extend(stmt, datatype, contact);
break;
}
ERR("Unknown data type(%d)", datatype);
continue;
}
}while(CTS_TRUE == cts_stmt_step(stmt));
cts_stmt_finalize(stmt);
return CTS_SUCCESS;
}
int cts_get_myprofile(CTSstruct **contact)
{
int ret;
contact_t *record;
retv_if(NULL == contact, CTS_ERR_ARG_NULL);
record = (contact_t *)contacts_svc_struct_new(CTS_STRUCT_CONTACT);
ret = cts_get_myprofile_data(record);
if (CTS_SUCCESS != ret) {
ERR("cts_get_myprofile_data() Failed(%d)", ret);
contacts_svc_struct_free((CTSstruct *)record);
return ret;
}
*contact = (CTSstruct *)record;
return CTS_SUCCESS;
}
API int contacts_svc_get_contact(int index, CTSstruct **contact)
{
int ret;
contact_t *record;
retv_if(NULL == contact, CTS_ERR_ARG_NULL);
if (0 == index)
return cts_get_myprofile(contact);
CTS_START_TIME_CHECK;
record = (contact_t *)contacts_svc_struct_new(CTS_STRUCT_CONTACT);
ret = cts_get_main_contacts_info(CTS_MAIN_CTS_GET_ALL, index, record);
if (CTS_SUCCESS != ret) {
ERR("cts_get_main_contacts_info(ALL) Failed(%d)", ret);
goto CTS_RETURN_ERROR;
}
ret = cts_get_data_info(CTS_GET_DATA_BY_CONTACT_ID,
CTS_DATA_FIELD_ALL, index, record);
if (CTS_SUCCESS != ret) {
ERR("cts_get_data_info(CTS_GET_DATA_BY_CONTACT_ID) Failed(%d)", ret);
goto CTS_RETURN_ERROR;
}
ret = cts_get_groups_info(index, record);
if (CTS_SUCCESS != ret) {
ERR("cts_get_group_info(CTS_GET_DATA_BY_CONTACT_ID) Failed(%d)", ret);
goto CTS_RETURN_ERROR;
}
*contact = (CTSstruct *)record;
CTS_END_TIME_CHECK();
return CTS_SUCCESS;
CTS_RETURN_ERROR:
contacts_svc_struct_free((CTSstruct *)record);
return ret;
}
API int contacts_svc_find_contact_by(cts_find_op op_code,
const char *user_data)
{
int ret;
const char *temp, *data;
char query[CTS_SQL_MAX_LEN] = {0};
char normalized_val[CTS_SQL_MIN_LEN];
CTS_START_TIME_CHECK;
retv_if(NULL == user_data, CTS_ERR_ARG_NULL);
if (cts_restriction_get_permit())
data = CTS_TABLE_DATA;
else
data = CTS_TABLE_RESTRICTED_DATA_VIEW;
switch (op_code)
{
case CTS_FIND_BY_NUMBER:
ret = cts_clean_number(user_data, normalized_val, sizeof(normalized_val));
retvm_if(ret <= 0, CTS_ERR_ARG_INVALID, "Number(%s) is invalid", user_data);
temp = cts_normalize_number(normalized_val);
snprintf(query, sizeof(query), "SELECT contact_id "
"FROM %s WHERE datatype = %d AND data3 = '%s' LIMIT 1",
data, CTS_DATA_NUMBER, temp);
ret = cts_query_get_first_int_result(query);
break;
case CTS_FIND_BY_EMAIL:
snprintf(query, sizeof(query), "SELECT contact_id "
"FROM %s WHERE datatype = %d AND data2 = '%s' LIMIT 1",
data, CTS_DATA_EMAIL, user_data);
ret = cts_query_get_first_int_result(query);
break;
case CTS_FIND_BY_NAME:
ret = cts_normalize_str(user_data, normalized_val, sizeof(normalized_val));
retvm_if(ret < CTS_SUCCESS, ret, "cts_normalize_str() Failed(%d)", ret);
if (CTS_ORDER_NAME_LASTFIRST == contacts_svc_get_order(CTS_ORDER_OF_DISPLAY))
temp = CTS_SCHEMA_DATA_NAME_REVERSE_LOOKUP;
else
temp = CTS_SCHEMA_DATA_NAME_LOOKUP;
snprintf(query, sizeof(query), "SELECT contact_id FROM %s "
"WHERE %s LIKE '%%%s%%' LIMIT 1",
data, temp, normalized_val);
ret = cts_query_get_first_int_result(query);
break;
case CTS_FIND_BY_UID:
snprintf(query, sizeof(query), "SELECT contact_id "
"FROM %s WHERE uid = '%s' LIMIT 1", CTS_TABLE_CONTACTS, user_data);
ret = cts_query_get_first_int_result(query);
break;
default:
ERR("Invalid parameter : The op_code(%d) is not supported", op_code);
return CTS_ERR_ARG_INVALID;
}
CTS_END_TIME_CHECK();
return ret;
}
| 27.746327 | 104 | 0.712874 |
ae6eeb5cd1c9c867f8034df8708ea14a21708ca6 | 5,068 | c | C | Utilities/IpFunc/Median.c | danielknorr/MITK | b1b9780b2a6671d8118313c5ef71e9aa128362be | [
"BSD-3-Clause"
] | 5 | 2015-05-27T06:57:53.000Z | 2020-03-12T21:08:23.000Z | Utilities/IpFunc/Median.c | danielknorr/MITK | b1b9780b2a6671d8118313c5ef71e9aa128362be | [
"BSD-3-Clause"
] | 141 | 2015-03-03T06:52:01.000Z | 2020-12-10T07:28:14.000Z | Utilities/IpFunc/Median.c | danielknorr/MITK | b1b9780b2a6671d8118313c5ef71e9aa128362be | [
"BSD-3-Clause"
] | 4 | 2015-02-19T06:48:13.000Z | 2020-06-19T16:20:25.000Z | /*****************************************************************************
Copyright (c) 1993-2000, Div. Medical and Biological Informatics,
Deutsches Krebsforschungszentrum, Heidelberg, Germany
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- All advertising materials mentioning features or use of this software must
display the following acknowledgement:
"This product includes software developed by the Div. Medical and
Biological Informatics, Deutsches Krebsforschungszentrum, Heidelberg,
Germany."
- Neither the name of the Deutsches Krebsforschungszentrum nor the names of
its contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE DIVISION MEDICAL AND BIOLOGICAL
INFORMATICS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE DIVISION MEDICAL AND BIOLOGICAL INFORMATICS,
THE DEUTSCHES KREBSFORSCHUNGSZENTRUM OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Send comments and/or bug reports to:
mbi-software@dkfz-heidelberg.de
*****************************************************************************/
/**@file
* this function calculates the median of the image data
*/
/** @brief calculates the median of the image data
*
* @param pic_old pointer to the image
*
* @return median of the image data
*
* AUTHOR & DATE
*/
/* include files */
#include "mitkIpFuncP.h"
mitkIpFloat8_t mitkIpFuncMedI ( mitkIpPicDescriptor *pic_old );
#ifndef DOXYGEN_IGNORE
#ifndef lint
static char *what = { "@(#)mitkIpFuncMedI\t\tDKFZ (Dept. MBI)\t"__DATE__ };
#endif
/* ------------------------------------------------------------------- */
/*
** function mitkIpFuncMedI:
*/
/* ------------------------------------------------------------------- */
mitkIpFloat8_t mitkIpFuncMedI ( mitkIpPicDescriptor *pic_old )
{
mitkIpFloat8_t max_gv; /* max. possible greyvalue */
mitkIpFloat8_t min_gv; /* min. possible greyvalue */
mitkIpUInt4_t *hist; /* greylevel histogram */
mitkIpUInt4_t size_hist; /* no. of elements in histogram */
mitkIpUInt4_t i; /* loop index */
mitkIpUInt4_t sum; /* sum of histogram elements */
mitkIpUInt4_t limit; /* */
mitkIpFloat4_t factor;
mitkIpFloat8_t median; /* median of image data */
/* check whether image data are ok */
if ( _mitkIpFuncError ( pic_old ) != mitkIpFuncOK ) return ( mitkIpFuncERROR );
/* calculate max. and min. possible greyvalues */
if ( _mitkIpFuncExtT ( pic_old->type, pic_old->bpe, &min_gv, &max_gv ) == mitkIpFuncERROR )
{
return ( mitkIpFuncERROR );
}
/* calculate greylevel histogram */
mitkIpFuncHist ( pic_old, min_gv, max_gv, &hist, &size_hist );
if ( hist == 0 )
{
return ( mitkIpFuncERROR );
}
/* factor to calculate the greyvalue belonging to an histogram index */
if ( pic_old->type == mitkIpPicFloat )
factor = 0.001;
else if ( pic_old->type == mitkIpPicInt || pic_old->type == mitkIpPicUInt )
factor = 1.;
else
{
free ( hist );
_mitkIpFuncSetErrno ( mitkIpFuncTYPE_ERROR );
return ( mitkIpFuncERROR );
}
/* find median */
limit = _mitkIpPicElements ( pic_old ) / 2;
for ( i = 0, sum = 0; sum < limit; i++ )
sum = sum + hist [i];
median = i * factor - fabs ( min_gv );
free ( hist );
return ( median );
}
#endif
| 36.460432 | 94 | 0.592344 |
2362171aa06da9a8c04eb23f410362f45345e3c5 | 9,717 | h | C | examples/tv-casting-app/tv-casting-common/commands/clusters/CustomArgument.h | mrninhvn/matter | c577b233db9d2f3a6f87108a062b1699a40c5169 | [
"Apache-2.0"
] | 2 | 2021-12-29T21:46:00.000Z | 2021-12-31T16:12:12.000Z | examples/tv-casting-app/tv-casting-common/commands/clusters/CustomArgument.h | mrninhvn/matter | c577b233db9d2f3a6f87108a062b1699a40c5169 | [
"Apache-2.0"
] | 2 | 2022-02-21T11:04:41.000Z | 2022-03-17T11:44:48.000Z | examples/tv-casting-app/tv-casting-common/commands/clusters/CustomArgument.h | mrninhvn/matter | c577b233db9d2f3a6f87108a062b1699a40c5169 | [
"Apache-2.0"
] | 2 | 2021-12-02T09:08:00.000Z | 2021-12-03T07:31:44.000Z | /*
* Copyright (c) 2022 Project CHIP 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 <app-common/zap-generated/cluster-objects.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/SafeInt.h>
namespace {
static constexpr char kPayloadHexPrefix[] = "hex:";
static constexpr char kPayloadSignedPrefix[] = "s:";
static constexpr char kPayloadUnsignedPrefix[] = "u:";
static constexpr char kPayloadFloatPrefix[] = "f:";
static constexpr char kPayloadDoublePrefix[] = "d:";
static constexpr size_t kPayloadHexPrefixLen = ArraySize(kPayloadHexPrefix) - 1; // ignore null character
static constexpr size_t kPayloadSignedPrefixLen = ArraySize(kPayloadSignedPrefix) - 1; // ignore null character
static constexpr size_t kPayloadUnsignedPrefixLen = ArraySize(kPayloadUnsignedPrefix) - 1; // ignore null character
static constexpr size_t kPayloadFloatPrefixLen = ArraySize(kPayloadFloatPrefix) - 1; // ignore null character
static constexpr size_t kPayloadDoublePrefixLen = ArraySize(kPayloadDoublePrefix) - 1; // ignore null character
} // namespace
class CustomArgumentParser
{
public:
static CHIP_ERROR Put(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
if (value.isObject())
{
return CustomArgumentParser::PutObject(writer, tag, value);
}
if (value.isArray())
{
return CustomArgumentParser::PutArray(writer, tag, value);
}
if (value.isString())
{
if (IsOctetString(value))
{
return CustomArgumentParser::PutOctetString(writer, tag, value);
}
if (IsUnsignedNumberPrefix(value))
{
return CustomArgumentParser::PutUnsignedFromString(writer, tag, value);
}
if (IsSignedNumberPrefix(value))
{
return CustomArgumentParser::PutSignedFromString(writer, tag, value);
}
if (IsFloatNumberPrefix(value))
{
return CustomArgumentParser::PutFloatFromString(writer, tag, value);
}
if (IsDoubleNumberPrefix(value))
{
return CustomArgumentParser::PutDoubleFromString(writer, tag, value);
}
return CustomArgumentParser::PutCharString(writer, tag, value);
}
if (value.isNull())
{
return chip::app::DataModel::Encode(*writer, tag, chip::app::DataModel::Nullable<uint8_t>());
}
if (value.isBool())
{
return chip::app::DataModel::Encode(*writer, tag, value.asBool());
}
if (value.isUInt())
{
return chip::app::DataModel::Encode(*writer, tag, value.asLargestUInt());
}
if (value.isInt())
{
return chip::app::DataModel::Encode(*writer, tag, value.asLargestInt());
}
if (value.isNumeric())
{
return chip::app::DataModel::Encode(*writer, tag, value.asDouble());
}
return CHIP_ERROR_NOT_IMPLEMENTED;
}
private:
static CHIP_ERROR PutArray(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
chip::TLV::TLVType outer;
ReturnErrorOnFailure(writer->StartContainer(tag, chip::TLV::kTLVType_Array, outer));
Json::ArrayIndex size = value.size();
for (Json::ArrayIndex i = 0; i < size; i++)
{
ReturnErrorOnFailure(CustomArgumentParser::Put(writer, chip::TLV::AnonymousTag(), value[i]));
}
return writer->EndContainer(outer);
}
static CHIP_ERROR PutObject(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
chip::TLV::TLVType outer;
ReturnErrorOnFailure(writer->StartContainer(tag, chip::TLV::kTLVType_Structure, outer));
for (auto const & id : value.getMemberNames())
{
auto index = std::stoul(id, nullptr, 0);
VerifyOrReturnError(chip::CanCastTo<uint8_t>(index), CHIP_ERROR_INVALID_ARGUMENT);
ReturnErrorOnFailure(CustomArgumentParser::Put(writer, chip::TLV::ContextTag(static_cast<uint8_t>(index)), value[id]));
}
return writer->EndContainer(outer);
}
static CHIP_ERROR PutOctetString(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
size_t size = strlen(value.asCString());
VerifyOrReturnError(size % 2 == 0, CHIP_ERROR_INVALID_STRING_LENGTH);
chip::Platform::ScopedMemoryBuffer<uint8_t> buffer;
VerifyOrReturnError(buffer.Calloc(size / 2), CHIP_ERROR_NO_MEMORY);
size_t octetCount = chip::Encoding::HexToBytes(value.asCString() + kPayloadHexPrefixLen, size - kPayloadHexPrefixLen,
buffer.Get(), (size - kPayloadHexPrefixLen) / 2);
VerifyOrReturnError(octetCount != 0, CHIP_ERROR_NO_MEMORY);
return chip::app::DataModel::Encode(*writer, tag, chip::ByteSpan(buffer.Get(), octetCount));
}
static CHIP_ERROR PutCharString(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
size_t size = strlen(value.asCString());
return chip::app::DataModel::Encode(*writer, tag, chip::CharSpan(value.asCString(), size));
}
static CHIP_ERROR PutUnsignedFromString(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
char numberAsString[21];
chip::Platform::CopyString(numberAsString, value.asCString() + kPayloadUnsignedPrefixLen);
auto number = std::stoull(numberAsString, nullptr, 0);
return chip::app::DataModel::Encode(*writer, tag, static_cast<uint64_t>(number));
}
static CHIP_ERROR PutSignedFromString(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
char numberAsString[21];
chip::Platform::CopyString(numberAsString, value.asCString() + kPayloadSignedPrefixLen);
auto number = std::stoll(numberAsString, nullptr, 0);
return chip::app::DataModel::Encode(*writer, tag, static_cast<int64_t>(number));
}
static CHIP_ERROR PutFloatFromString(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
char numberAsString[21];
chip::Platform::CopyString(numberAsString, value.asCString() + kPayloadFloatPrefixLen);
auto number = std::stof(numberAsString);
return chip::app::DataModel::Encode(*writer, tag, number);
}
static CHIP_ERROR PutDoubleFromString(chip::TLV::TLVWriter * writer, chip::TLV::Tag tag, Json::Value & value)
{
char numberAsString[21];
chip::Platform::CopyString(numberAsString, value.asCString() + kPayloadDoublePrefixLen);
auto number = std::stod(numberAsString);
return chip::app::DataModel::Encode(*writer, tag, number);
}
static bool IsOctetString(Json::Value & value)
{
return (strncmp(value.asCString(), kPayloadHexPrefix, kPayloadHexPrefixLen) == 0);
}
static bool IsUnsignedNumberPrefix(Json::Value & value)
{
return (strncmp(value.asCString(), kPayloadUnsignedPrefix, kPayloadUnsignedPrefixLen) == 0);
}
static bool IsSignedNumberPrefix(Json::Value & value)
{
return (strncmp(value.asCString(), kPayloadSignedPrefix, kPayloadSignedPrefixLen) == 0);
}
static bool IsFloatNumberPrefix(Json::Value & value)
{
return (strncmp(value.asCString(), kPayloadFloatPrefix, kPayloadFloatPrefixLen) == 0);
}
static bool IsDoubleNumberPrefix(Json::Value & value)
{
return (strncmp(value.asCString(), kPayloadDoublePrefix, kPayloadDoublePrefixLen) == 0);
}
};
class CustomArgument
{
public:
~CustomArgument()
{
if (mData != nullptr)
{
chip::Platform::MemoryFree(mData);
}
}
CHIP_ERROR Parse(const char * label, const char * json)
{
Json::Reader reader;
Json::Value value;
reader.parse(json, value);
mData = static_cast<uint8_t *>(chip::Platform::MemoryCalloc(sizeof(uint8_t), mDataMaxLen));
VerifyOrReturnError(mData != nullptr, CHIP_ERROR_NO_MEMORY);
chip::TLV::TLVWriter writer;
writer.Init(mData, mDataMaxLen);
ReturnErrorOnFailure(CustomArgumentParser::Put(&writer, chip::TLV::AnonymousTag(), value));
mDataLen = writer.GetLengthWritten();
return writer.Finalize();
}
CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const
{
chip::TLV::TLVReader reader;
reader.Init(mData, mDataLen);
reader.Next();
return writer.CopyElement(tag, reader);
}
// We trust our consumers to do the encoding of our data correctly, so don't
// need to know whether we are being encoded for a write.
static constexpr bool kIsFabricScoped = false;
private:
uint8_t * mData = nullptr;
uint32_t mDataLen = 0;
static constexpr uint32_t mDataMaxLen = 4096;
};
| 36.393258 | 131 | 0.641041 |
d9305c803c66c165d2b7a2205ab0f51d20b0186a | 3,832 | h | C | include/m2m/lib/security/acl/M2MACLGroup.h | mtsmys/cep | 2d4873f957e7e612f68915eaea29f0fe85e7e83b | [
"BSD-2-Clause"
] | 6 | 2015-09-06T07:33:13.000Z | 2021-09-02T05:58:50.000Z | include/m2m/lib/security/acl/M2MACLGroup.h | mtsmys/cep | 2d4873f957e7e612f68915eaea29f0fe85e7e83b | [
"BSD-2-Clause"
] | null | null | null | include/m2m/lib/security/acl/M2MACLGroup.h | mtsmys/cep | 2d4873f957e7e612f68915eaea29f0fe85e7e83b | [
"BSD-2-Clause"
] | 2 | 2016-04-23T10:46:07.000Z | 2017-12-05T13:10:51.000Z | /*******************************************************************************
* M2MACLGroup.h
*
* Copyright (c) 2019, Akihisa Yasuda
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
#pragma once
#ifndef M2M_LIB_SECURITY_ACL_M2MACLGROUP_H_
#define M2M_LIB_SECURITY_ACL_M2MACLGROUP_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "m2m/lib/lang/M2MString.h"
#include "m2m/lib/security/acl/M2MACLPermission.h"
#include <sys/types.h>
#include <unistd.h>
#include <grp.h>
/*******************************************************************************
* Class variable
******************************************************************************/
/**
* @param id
* @param name
* @param permission
*/
#ifndef M2MACLGroup
typedef struct
{
uint64_t id;
M2MString *name;
M2MACLPermission *permission;
} M2MACLGroup;
#endif /* M2MACLGroup */
/*******************************************************************************
* Public method
******************************************************************************/
/**
* Destructor.<br>
* This method releases allocated memory for ACL group object.<br>
*
* @param[in,out] self ACL group object for releasing allocated memory
*/
void M2MACLGroup_delete (M2MACLGroup **self);
/**
* This method detects group name string with group ID(=number).<br>
*
* @param[in] id ACL group ID(number of 12[bit])
* @param[out] buffer pointer of buffer(allocation is executed in this method)
* @return pointer of group name string or NULL(means error)
*/
M2MString *M2MACLGroup_detectName (const gid_t id, M2MString **buffer);
/**
* This method returns group ID number owned by ACLGroup.<br>
*
* @param[in] self ACL group object
* @return group ID number which handles access control or 0(means error)
*/
uint64_t M2MACLGroup_getID (const M2MACLGroup *self);
/**
*
* @param[in] self ACL group object
* @return ALC group name string or NULL(means error)
*/
M2MString *M2MACLGroup_getName (const M2MACLGroup *self);
/**
* Constructor.<br>
* This method creates new ACL group object.<br>
*
* @return new allocated ACL group object
*/
M2MACLGroup *M2MACLGroup_new ();
/**
*
* @param[in,out] self ACL group object
* @param[in] id ACL group ID(number of 12[bit])
* @return
*/
M2MACLGroup *M2MACLGroup_setID (M2MACLGroup *self, const uint64_t id);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* M2M_SECURITY_ACL_M2MACLGROUP_H_ */
| 28.385185 | 80 | 0.641962 |
2fde5bc27b1d345f575e1255383f2bd8f6f87123 | 977 | h | C | BIND/Protocols/BNDView.h | natefortuna/BIND | cca4cd8757a1759b3beb22769827aa4b0456e21d | [
"MIT"
] | 407 | 2015-01-27T00:49:56.000Z | 2021-11-02T11:28:05.000Z | BIND/Protocols/BNDView.h | Dhruv8015/BIND | 4a70591a4f7c7829bec1213cb1e9400f4514d797 | [
"MIT"
] | 21 | 2015-03-29T09:14:21.000Z | 2017-09-17T04:04:23.000Z | BIND/Protocols/BNDView.h | Dhruv8015/BIND | 4a70591a4f7c7829bec1213cb1e9400f4514d797 | [
"MIT"
] | 57 | 2015-03-09T08:59:54.000Z | 2020-09-16T12:46:17.000Z | //
// BNDView.h
// BIND
//
// Created by Marko Hlebar on 27/10/2014.
// Copyright (c) 2014 Marko Hlebar. All rights reserved.
//
#import <Foundation/Foundation.h>
@class BNDBinding;
@protocol BNDViewModel;
@protocol BNDView <NSObject>
/**
* This is an a bindings collection used to add bindings from XIB
*/
@property (nonatomic, strong) IBOutletCollection(BNDBinding) NSArray *bindings;
/**
* View keeps a strong reference to the view model.
*/
@property (nonatomic, strong) IBOutlet id <BNDViewModel> viewModel;
@optional
/**
* Callback method that is called after the view model has been updated.
*
* @param viewModel a view model.
*/
- (void)viewDidUpdateViewModel:(id <BNDViewModel> )viewModel;
@end
@protocol BNDDataController;
@protocol BNDViewController <BNDView>
@optional
/**
* The data controller instance should be used to populate your view models.
*/
@property (nonatomic, strong) IBOutlet id <BNDDataController> dataController;
@end
| 20.787234 | 79 | 0.729785 |
8adb7ed0c12db56fe01e4b2ed782e65be3d8c145 | 8,100 | h | C | drivers/net/ethernet/qlogic/qed/qed_cxt.h | SunOS-Linux/kernel | 2557890ec8bf1bcba83dc337f91c0854e7184fcc | [
"MIT"
] | null | null | null | drivers/net/ethernet/qlogic/qed/qed_cxt.h | SunOS-Linux/kernel | 2557890ec8bf1bcba83dc337f91c0854e7184fcc | [
"MIT"
] | 1 | 2021-01-27T01:29:47.000Z | 2021-01-27T01:29:47.000Z | drivers/net/ethernet/qlogic/qed/qed_cxt.h | SunOS-Linux/kernel | 2557890ec8bf1bcba83dc337f91c0854e7184fcc | [
"MIT"
] | null | null | null | /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/* QLogic qed NIC Driver
* Copyright (c) 2015-2017 QLogic Corporation
* Copyright (c) 2019-2020 Marvell International Ltd.
*/
#ifndef _QED_CXT_H
#define _QED_CXT_H
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/qed/qed_if.h>
#include "qed_hsi.h"
#include "qed.h"
struct qed_cxt_info {
void *p_cxt;
u32 iid;
enum protocol_type type;
};
#define MAX_TID_BLOCKS 512
struct qed_tid_mem {
u32 tid_size;
u32 num_tids_per_block;
u32 waste;
u8 *blocks[MAX_TID_BLOCKS]; /* 4K */
};
/**
* @brief qedo_cid_get_cxt_info - Returns the context info for a specific cid
*
*
* @param p_hwfn
* @param p_info in/out
*
* @return int
*/
int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn,
struct qed_cxt_info *p_info);
/**
* @brief qed_cxt_get_tid_mem_info
*
* @param p_hwfn
* @param p_info
*
* @return int
*/
int qed_cxt_get_tid_mem_info(struct qed_hwfn *p_hwfn,
struct qed_tid_mem *p_info);
#define QED_CXT_TCP_ULP_TID_SEG PROTOCOLID_TCP_ULP
#define QED_CXT_ROCE_TID_SEG PROTOCOLID_ROCE
#define QED_CXT_FCOE_TID_SEG PROTOCOLID_FCOE
enum qed_cxt_elem_type {
QED_ELEM_CXT,
QED_ELEM_SRQ,
QED_ELEM_TASK,
QED_ELEM_XRC_SRQ,
};
u32 qed_cxt_get_proto_cid_count(struct qed_hwfn *p_hwfn,
enum protocol_type type, u32 *vf_cid);
/**
* @brief qed_cxt_set_pf_params - Set the PF params for cxt init
*
* @param p_hwfn
* @param rdma_tasks - requested maximum
* @return int
*/
int qed_cxt_set_pf_params(struct qed_hwfn *p_hwfn, u32 rdma_tasks);
/**
* @brief qed_cxt_cfg_ilt_compute - compute ILT init parameters
*
* @param p_hwfn
* @param last_line
*
* @return int
*/
int qed_cxt_cfg_ilt_compute(struct qed_hwfn *p_hwfn, u32 *last_line);
/**
* @brief qed_cxt_cfg_ilt_compute_excess - how many lines can be decreased
*
* @param p_hwfn
* @param used_lines
*/
u32 qed_cxt_cfg_ilt_compute_excess(struct qed_hwfn *p_hwfn, u32 used_lines);
/**
* @brief qed_cxt_mngr_alloc - Allocate and init the context manager struct
*
* @param p_hwfn
*
* @return int
*/
int qed_cxt_mngr_alloc(struct qed_hwfn *p_hwfn);
/**
* @brief qed_cxt_mngr_free
*
* @param p_hwfn
*/
void qed_cxt_mngr_free(struct qed_hwfn *p_hwfn);
/**
* @brief qed_cxt_tables_alloc - Allocate ILT shadow, Searcher T2, acquired map
*
* @param p_hwfn
*
* @return int
*/
int qed_cxt_tables_alloc(struct qed_hwfn *p_hwfn);
/**
* @brief qed_cxt_mngr_setup - Reset the acquired CIDs
*
* @param p_hwfn
*/
void qed_cxt_mngr_setup(struct qed_hwfn *p_hwfn);
/**
* @brief qed_cxt_hw_init_common - Initailze ILT and DQ, common phase, per path.
*
*
*
* @param p_hwfn
*/
void qed_cxt_hw_init_common(struct qed_hwfn *p_hwfn);
/**
* @brief qed_cxt_hw_init_pf - Initailze ILT and DQ, PF phase, per path.
*
* @param p_hwfn
* @param p_ptt
*/
void qed_cxt_hw_init_pf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
/**
* @brief qed_qm_init_pf - Initailze the QM PF phase, per path
*
* @param p_hwfn
* @param p_ptt
* @param is_pf_loading
*/
void qed_qm_init_pf(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, bool is_pf_loading);
/**
* @brief Reconfigures QM pf on the fly
*
* @param p_hwfn
* @param p_ptt
*
* @return int
*/
int qed_qm_reconf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
#define QED_CXT_PF_CID (0xff)
/**
* @brief qed_cxt_release - Release a cid
*
* @param p_hwfn
* @param cid
*/
void qed_cxt_release_cid(struct qed_hwfn *p_hwfn, u32 cid);
/**
* @brief qed_cxt_release - Release a cid belonging to a vf-queue
*
* @param p_hwfn
* @param cid
* @param vfid - engine relative index. QED_CXT_PF_CID if belongs to PF
*/
void _qed_cxt_release_cid(struct qed_hwfn *p_hwfn, u32 cid, u8 vfid);
/**
* @brief qed_cxt_acquire - Acquire a new cid of a specific protocol type
*
* @param p_hwfn
* @param type
* @param p_cid
*
* @return int
*/
int qed_cxt_acquire_cid(struct qed_hwfn *p_hwfn,
enum protocol_type type, u32 *p_cid);
/**
* @brief _qed_cxt_acquire - Acquire a new cid of a specific protocol type
* for a vf-queue
*
* @param p_hwfn
* @param type
* @param p_cid
* @param vfid - engine relative index. QED_CXT_PF_CID if belongs to PF
*
* @return int
*/
int _qed_cxt_acquire_cid(struct qed_hwfn *p_hwfn,
enum protocol_type type, u32 *p_cid, u8 vfid);
int qed_cxt_dynamic_ilt_alloc(struct qed_hwfn *p_hwfn,
enum qed_cxt_elem_type elem_type, u32 iid);
u32 qed_cxt_get_proto_tid_count(struct qed_hwfn *p_hwfn,
enum protocol_type type);
u32 qed_cxt_get_proto_cid_start(struct qed_hwfn *p_hwfn,
enum protocol_type type);
int qed_cxt_free_proto_ilt(struct qed_hwfn *p_hwfn, enum protocol_type proto);
#define QED_CTX_WORKING_MEM 0
#define QED_CTX_FL_MEM 1
int qed_cxt_get_task_ctx(struct qed_hwfn *p_hwfn,
u32 tid, u8 ctx_type, void **task_ctx);
/* Max number of connection types in HW (DQ/CDU etc.) */
#define MAX_CONN_TYPES PROTOCOLID_COMMON
#define NUM_TASK_TYPES 2
#define NUM_TASK_PF_SEGMENTS 4
#define NUM_TASK_VF_SEGMENTS 1
/* PF per protocl configuration object */
#define TASK_SEGMENTS (NUM_TASK_PF_SEGMENTS + NUM_TASK_VF_SEGMENTS)
#define TASK_SEGMENT_VF (NUM_TASK_PF_SEGMENTS)
struct qed_tid_seg {
u32 count;
u8 type;
bool has_fl_mem;
};
struct qed_conn_type_cfg {
u32 cid_count;
u32 cids_per_vf;
struct qed_tid_seg tid_seg[TASK_SEGMENTS];
};
/* ILT Client configuration,
* Per connection type (protocol) resources (cids, tis, vf cids etc.)
* 1 - for connection context (CDUC) and for each task context we need two
* values, for regular task context and for force load memory
*/
#define ILT_CLI_PF_BLOCKS (1 + NUM_TASK_PF_SEGMENTS * 2)
#define ILT_CLI_VF_BLOCKS (1 + NUM_TASK_VF_SEGMENTS * 2)
#define CDUC_BLK (0)
#define SRQ_BLK (0)
#define CDUT_SEG_BLK(n) (1 + (u8)(n))
#define CDUT_FL_SEG_BLK(n, X) (1 + (n) + NUM_TASK_ ## X ## _SEGMENTS)
struct ilt_cfg_pair {
u32 reg;
u32 val;
};
struct qed_ilt_cli_blk {
u32 total_size; /* 0 means not active */
u32 real_size_in_page;
u32 start_line;
u32 dynamic_line_offset;
u32 dynamic_line_cnt;
};
struct qed_ilt_client_cfg {
bool active;
/* ILT boundaries */
struct ilt_cfg_pair first;
struct ilt_cfg_pair last;
struct ilt_cfg_pair p_size;
/* ILT client blocks for PF */
struct qed_ilt_cli_blk pf_blks[ILT_CLI_PF_BLOCKS];
u32 pf_total_lines;
/* ILT client blocks for VFs */
struct qed_ilt_cli_blk vf_blks[ILT_CLI_VF_BLOCKS];
u32 vf_total_lines;
};
struct qed_cid_acquired_map {
u32 start_cid;
u32 max_count;
unsigned long *cid_map;
};
struct qed_src_t2 {
struct phys_mem_desc *dma_mem;
u32 num_pages;
u64 first_free;
u64 last_free;
};
struct qed_cxt_mngr {
/* Per protocl configuration */
struct qed_conn_type_cfg conn_cfg[MAX_CONN_TYPES];
/* computed ILT structure */
struct qed_ilt_client_cfg clients[MAX_ILT_CLIENTS];
/* Task type sizes */
u32 task_type_size[NUM_TASK_TYPES];
/* total number of VFs for this hwfn -
* ALL VFs are symmetric in terms of HW resources
*/
u32 vf_count;
u32 first_vf_in_pf;
/* Acquired CIDs */
struct qed_cid_acquired_map acquired[MAX_CONN_TYPES];
struct qed_cid_acquired_map
acquired_vf[MAX_CONN_TYPES][MAX_NUM_VFS];
/* ILT shadow table */
struct phys_mem_desc *ilt_shadow;
u32 ilt_shadow_size;
u32 pf_start_line;
/* Mutex for a dynamic ILT allocation */
struct mutex mutex;
/* SRC T2 */
struct qed_src_t2 src_t2;
/* total number of SRQ's for this hwfn */
u32 srq_count;
u32 xrc_srq_count;
/* Maximal number of L2 steering filters */
u32 arfs_count;
u8 task_type_id;
u16 task_ctx_size;
u16 conn_ctx_size;
};
u16 qed_get_cdut_num_pf_init_pages(struct qed_hwfn *p_hwfn);
u16 qed_get_cdut_num_vf_init_pages(struct qed_hwfn *p_hwfn);
u16 qed_get_cdut_num_pf_work_pages(struct qed_hwfn *p_hwfn);
u16 qed_get_cdut_num_vf_work_pages(struct qed_hwfn *p_hwfn);
u32 qed_cxt_get_ilt_page_size(struct qed_hwfn *p_hwfn,
enum ilt_clients ilt_client);
u32 qed_cxt_get_total_srq_count(struct qed_hwfn *p_hwfn);
#endif
| 22.946176 | 80 | 0.72963 |
f005a3a38a76f46d2f3cf1194dd2612f608938d0 | 3,394 | h | C | libav-12.3/libavutil/x86/asm.h | aldarons-tech/aci | 0fc09bea7274737a2aa7a3422d65e2630af64b58 | [
"MIT"
] | null | null | null | libav-12.3/libavutil/x86/asm.h | aldarons-tech/aci | 0fc09bea7274737a2aa7a3422d65e2630af64b58 | [
"MIT"
] | 3 | 2020-07-02T01:33:51.000Z | 2020-08-11T14:40:29.000Z | libav-12.3/libavutil/x86/asm.h | aldarons-tech/aci | 0fc09bea7274737a2aa7a3422d65e2630af64b58 | [
"MIT"
] | null | null | null | /*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_X86_ASM_H
#define AVUTIL_X86_ASM_H
#include <stdint.h>
#include "config.h"
typedef struct xmm_reg { uint64_t a, b; } xmm_reg;
typedef struct ymm_reg { uint64_t a, b, c, d; } ymm_reg;
#if ARCH_X86_64
# define FF_OPSIZE "q"
# define FF_REG_a "rax"
# define FF_REG_b "rbx"
# define FF_REG_c "rcx"
# define FF_REG_d "rdx"
# define FF_REG_D "rdi"
# define FF_REG_S "rsi"
# define FF_PTR_SIZE "8"
typedef int64_t x86_reg;
# define FF_REG_SP "rsp"
# define FF_REG_BP "rbp"
# define FF_REGBP rbp
# define FF_REGa rax
# define FF_REGb rbx
# define FF_REGc rcx
# define FF_REGd rdx
# define FF_REGSP rsp
#elif ARCH_X86_32
# define FF_OPSIZE "l"
# define FF_REG_a "eax"
# define FF_REG_b "ebx"
# define FF_REG_c "ecx"
# define FF_REG_d "edx"
# define FF_REG_D "edi"
# define FF_REG_S "esi"
# define FF_PTR_SIZE "4"
typedef int32_t x86_reg;
# define FF_REG_SP "esp"
# define FF_REG_BP "ebp"
# define FF_REGBP ebp
# define FF_REGa eax
# define FF_REGb ebx
# define FF_REGc ecx
# define FF_REGd edx
# define FF_REGSP esp
#else
typedef int x86_reg;
#endif
#define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE))
#define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE))
#if ARCH_X86_64 && defined(PIC)
# define BROKEN_RELOCATIONS 1
#endif
/*
* If gcc is not set to support sse (-msse) it will not accept xmm registers
* in the clobber list for inline asm. XMM_CLOBBERS takes a list of xmm
* registers to be marked as clobbered and evaluates to nothing if they are
* not supported, or to the list itself if they are supported. Since a clobber
* list may not be empty, XMM_CLOBBERS_ONLY should be used if the xmm
* registers are the only in the clobber list.
* For example a list with "eax" and "xmm0" as clobbers should become:
* : XMM_CLOBBERS("xmm0",) "eax"
* and a list with only "xmm0" should become:
* XMM_CLOBBERS_ONLY("xmm0")
*/
#if HAVE_XMM_CLOBBERS
# define XMM_CLOBBERS(...) __VA_ARGS__
# define XMM_CLOBBERS_ONLY(...) : __VA_ARGS__
#else
# define XMM_CLOBBERS(...)
# define XMM_CLOBBERS_ONLY(...)
#endif
/* Use to export labels from asm. */
#define LABEL_MANGLE(a) EXTERN_PREFIX #a
// Use rip-relative addressing if compiling PIC code on x86-64.
#if ARCH_X86_64 && defined(PIC)
# define LOCAL_MANGLE(a) #a "(%%rip)"
#else
# define LOCAL_MANGLE(a) #a
#endif
#define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
#endif /* AVUTIL_X86_ASM_H */
| 29.77193 | 79 | 0.704184 |
002f705f25a431a1802b0b4bae0fa0ea9e881b4a | 1,064 | h | C | iPhone/Classes/NNWWebPageViewController.h | brentsimmons/NetNewsWireLite4 | c4ed724144969afd9da7679edc4e128d16c66599 | [
"MIT"
] | 22 | 2018-08-31T20:33:27.000Z | 2018-11-21T05:42:24.000Z | iPhone/Classes/NNWWebPageViewController.h | brentsimmons/NetNewsWireLite4 | c4ed724144969afd9da7679edc4e128d16c66599 | [
"MIT"
] | 1 | 2018-09-03T11:45:06.000Z | 2018-09-07T06:10:55.000Z | iPhone/Classes/NNWWebPageViewController.h | brentsimmons/NetNewsWireLite4 | c4ed724144969afd9da7679edc4e128d16c66599 | [
"MIT"
] | 6 | 2018-08-31T20:12:38.000Z | 2020-08-04T21:46:27.000Z | //
// NNWWebPageViewController.h
// nnwiphone
//
// Created by Brent Simmons on 8/12/09.
// Copyright 2009 NewsGator Technologies, Inc.. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
@class BCNavTitleView, BCCenteredActivityTitleView;
@interface NNWWebPageViewController : UIViewController <UIActionSheetDelegate, UIWebViewDelegate, MFMailComposeViewControllerDelegate> {
@private
NSURLRequest *_initialRequest;
UIWebView *_webView;
BOOL _loadingWebPage;
NSInteger _emailMenuItemIndex;
NSInteger _postToTwitterMenuItemIndex;
NSInteger _openInSafariMenuItemIndex;
NSInteger _sendToInstapaperMenuItemIndex;
BOOL _actionSheetShowing;
UIBarButtonItem *_goBackToolbarItem;
UIBarButtonItem *_goForwardToolbarItem;
UIBarButtonItem *_actionMenuToolbarItem;
UILabel *_titleLabel;
BCNavTitleView *_titleViewContainer;
UIActivityIndicatorView *_activityIndicator;
}
- (id)initWithURLRequest:(NSURLRequest *)request;
- (void)loadHTML;
+ (NNWWebPageViewController *)viewControllerWithState:(NSDictionary *)state;
@end
| 27.282051 | 136 | 0.820489 |
158928fbc50e9556dc7b772ae42fdcb063dafa31 | 147 | c | C | C/Iniciantes/Basicos/Uri1001_ExtremamenteBasico.c | bragabriel/Beecrowd | a71dd9926b422b5e82ae84bb5ccd76cf3ebd292b | [
"MIT"
] | null | null | null | C/Iniciantes/Basicos/Uri1001_ExtremamenteBasico.c | bragabriel/Beecrowd | a71dd9926b422b5e82ae84bb5ccd76cf3ebd292b | [
"MIT"
] | null | null | null | C/Iniciantes/Basicos/Uri1001_ExtremamenteBasico.c | bragabriel/Beecrowd | a71dd9926b422b5e82ae84bb5ccd76cf3ebd292b | [
"MIT"
] | null | null | null | #include <stdio.h>
int main() {
int a, b, soma;
scanf("%i", &a);
scanf("%d", &b);
soma = a + b;
printf("X = %d\n", soma);
return 0;
}
| 9.1875 | 25 | 0.469388 |
0afe233a864deaa23d6344813071bbbbb8d320fc | 1,801 | h | C | GRMFixes/ZenGin/Gothic_II_Addon/API/zBinkPlayer.h | ThielHater/GRMFixes_Union | 839745fbc009db532bb51de8baa0a19c45143ff2 | [
"MIT"
] | null | null | null | GRMFixes/ZenGin/Gothic_II_Addon/API/zBinkPlayer.h | ThielHater/GRMFixes_Union | 839745fbc009db532bb51de8baa0a19c45143ff2 | [
"MIT"
] | null | null | null | GRMFixes/ZenGin/Gothic_II_Addon/API/zBinkPlayer.h | ThielHater/GRMFixes_Union | 839745fbc009db532bb51de8baa0a19c45143ff2 | [
"MIT"
] | 1 | 2021-08-29T11:06:08.000Z | 2021-08-29T11:06:08.000Z | // Supported with union (c) 2018 Union team
#ifndef __ZBINK_PLAYER_H__VER3__
#define __ZBINK_PLAYER_H__VER3__
#include "zVideoPlayer.h"
#include "zRenderer.h"
namespace Gothic_II_Addon {
class zCBinkPlayer : public zCVideoPlayer {
public:
void* mVideoHandle;
long mCopyMode;
short mXpos;
short mYpos;
int mDoBlit;
int mDoHandleEvents;
int mDoFullscreen;
zSTRING mBackTexture;
zCView* mBackView;
RECT mSourceRect;
RECT mTargetRect;
void zCBinkPlayer_OnInit() zCall( 0x0043DE30 );
zCBinkPlayer() zInit( zCBinkPlayer_OnInit() );
long GetPixelFormat( zTRndSurfaceDesc& ) zCall( 0x00440790 );
void SetFullscreen( int, zSTRING ) zCall( 0x00440960 );
virtual ~zCBinkPlayer() zCall( 0x0043DF80 );
virtual int OpenVideo( zSTRING ) zCall( 0x0043E0F0 );
virtual int CloseVideo() zCall( 0x0043EDF0 );
virtual int PlayInit( int ) zCall( 0x0043F080 );
virtual int PlayFrame() zCall( 0x00440560 );
virtual int PlayDeinit() zCall( 0x0043FD20 );
virtual int Pause() zCall( 0x00440710 );
virtual int Unpause() zCall( 0x00440730 );
virtual int IsPlaying() zCall( 0x00440760 );
virtual int ToggleSound() zCall( 0x004408E0 );
virtual float SetSoundVolume( float ) zCall( 0x00440930 );
virtual int PlayGotoNextFrame() zCall( 0x00440510 );
virtual int PlayWaitNextFrame() zCall( 0x00440520 );
virtual int PlayHandleEvents() zCall( 0x00440750 );
};
} // namespace Gothic_II_Addon
#endif // __ZBINK_PLAYER_H__VER3__ | 38.319149 | 77 | 0.604109 |
177e91756eb51013f9d7ab49c4ac8de3df1949e3 | 21,575 | h | C | 02_Library/Include/XMCocos2D-v3/2d/particle_nodes/CCParticleSystem.h | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | 2 | 2017-08-03T07:15:00.000Z | 2018-06-18T10:32:53.000Z | 02_Library/Include/XMCocos2D-v3/2d/particle_nodes/CCParticleSystem.h | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | null | null | null | 02_Library/Include/XMCocos2D-v3/2d/particle_nodes/CCParticleSystem.h | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | 2 | 2019-03-04T22:57:42.000Z | 2020-03-06T01:32:26.000Z | /* -----------------------------------------------------------------------------------
*
* File CCParticleSystem.h
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* -----------------------------------------------------------------------------------
*
* Copyright (c) 2010-2014 XMSoft
* Copyright (c) 2010-2013 cocos2d-x.org
* Copyright (c) 2008-2010 Ricardo Quesada
* Copyright (c) 2011 Zynga Inc.
*
* http://www.cocos2d-x.org
*
* -----------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* --------------------------------------------------------------------------------- */
#ifndef __CCParticleSystem_h__
#define __CCParticleSystem_h__
#include "../base_nodes/CCNode.h"
#include "../../base/CCDictionary.h"
#include "../../base/CCString.h"
NS_CC_BEGIN
/**
* @addtogroup particle_nodes
* @{
*/
class ParticleBatchNode;
/**
* Structure that contains the values of each particle
*/
typedef struct sParticle
{
Point pos;
Point startPos;
Color4F color;
Color4F deltaColor;
KDfloat size;
KDfloat deltaSize;
KDfloat rotation;
KDfloat deltaRotation;
KDfloat timeToLive;
KDuint atlasIndex;
//! Mode A: gravity, direction, radial accel, tangential accel
struct
{
Point dir;
KDfloat radialAccel;
KDfloat tangentialAccel;
} modeA;
//! Mode B: radius mode
struct
{
KDfloat angle;
KDfloat degreesPerSecond;
KDfloat radius;
KDfloat deltaRadius;
} modeB;
}tParticle;
//typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Point);
class Texture2D;
/**
* @brief Particle System base class.
* Attributes of a Particle System:
* - emission rate of the particles
* - Gravity Mode (Mode A):
* - gravity
* - direction
* - speed +- variance
* - tangential acceleration +- variance
* - radial acceleration +- variance
* - Radius Mode (Mode B):
* - startRadius +- variance
* - endRadius +- variance
* - rotate +- variance
* - Properties common to all modes:
* - life +- life variance
* - start spin +- variance
* - end spin +- variance
* - start size +- variance
* - end size +- variance
* - start color +- variance
* - end color +- variance
* - life +- variance
* - blending function
* - texture
*
* cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
* 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,
* cocos2d uses a another approach, but the results are almost identical.
*
* cocos2d supports all the variables used by Particle Designer plus a bit more:
* - spinning particles (supported when using ParticleSystemQuad)
* - tangential acceleration (Gravity mode)
* - radial acceleration (Gravity mode)
* - radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)
*
* It is possible to customize any of the above mentioned properties in runtime. Example:
*
* @code
* emitter.radialAccel = 15;
* emitter.startSpin = 0;
* @endcode
*
*/
class CC_DLL ParticleSystem : public Node, public TextureProtocol
{
public :
enum class Mode
{
GRAVITY,
RADIUS,
};
/**
* @typedef PositionType
* possible types of particle positions
*/
enum class PositionType
{
/** Living particles are attached to the world and are unaffected by emitter repositioning. */
FREE,
/** Living particles are attached to the world but will follow the emitter repositioning.
Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.
*/
RELATIVE,
/** Living particles are attached to the emitter and are translated along with it. */
GROUPED,
};
//* @enum
enum
{
/** The Particle emitter lives forever */
DURATION_INFINITY = -1,
/** The starting size of the particle is equal to the ending size */
START_SIZE_EQUAL_TO_END_SIZE = -1,
/** The starting radius of the particle is equal to the ending radius */
START_RADIUS_EQUAL_TO_END_RADIUS = -1,
};
/**
* creates an initializes a ParticleSystem from a plist file.
* This plist files can be created manually or with Particle Designer:
* http://particledesigner.71squared.com/
* @since v2.0
*/
static ParticleSystem* create ( const std::string& sPlistFile );
//! create a system with a fixed number of particles
static ParticleSystem* createWithTotalParticles ( KDuint uNumberOfParticles );
/**
* @js ctor
*/
ParticleSystem ( KDvoid );
/**
* @js NA
* @lua NA
*/
virtual ~ParticleSystem ( KDvoid );
/** initializes a ParticleSystem*/
KDbool init ( KDvoid );
/**
* initializes a ParticleSystem from a plist file.
* This plist files can be created manually or with Particle Designer:
* http://particledesigner.71squared.com/
* @since v0.99.3
*/
KDbool initWithFile ( const std::string& sPlistFile );
/**
* initializes a QuadParticleSystem from a Dictionary.
* @since v0.99.3
*/
KDbool initWithDictionary ( Dictionary* pDictionary );
/**
* initializes a particle system from a NSDictionary and the path from where to load the png
* @since v2.1
*/
KDbool initWithDictionary ( Dictionary* pDictionary, const std::string& sDirname );
//! Initializes a system with a fixed number of particles
virtual KDbool initWithTotalParticles ( KDuint uNumberOfParticles );
//! Add a particle to the emitter
KDbool addParticle ( KDvoid );
//! Initializes a particle
KDvoid initParticle ( tParticle* pParticle );
//! stop emitting particles. Running particles will continue to run until they die
KDvoid stopSystem ( KDvoid );
//! Kill all living particles.
KDvoid resetSystem ( KDvoid );
//! whether or not the system is full
KDbool isFull ( KDvoid );
//! should be overridden by subclasses
virtual KDvoid updateQuadWithParticle ( tParticle* pParticle, const Point& tNewPosition );
//! should be overridden by subclasses
virtual KDvoid postStep ( KDvoid );
virtual KDvoid updateWithNoTime ( KDvoid );
virtual KDbool isAutoRemoveOnFinish ( KDvoid ) const;
virtual KDvoid setAutoRemoveOnFinish ( KDbool bVar );
// mode A
virtual const Point& getGravity ( KDvoid );
virtual KDvoid setGravity ( const Point& g );
virtual KDfloat getSpeed ( KDvoid ) const;
virtual KDvoid setSpeed ( KDfloat fSpeed );
virtual KDfloat getSpeedVar ( KDvoid ) const;
virtual KDvoid setSpeedVar ( KDfloat fSpeed );
virtual KDfloat getTangentialAccel ( KDvoid ) const;
virtual KDvoid setTangentialAccel ( KDfloat t );
virtual KDfloat getTangentialAccelVar ( KDvoid ) const;
virtual KDvoid setTangentialAccelVar ( KDfloat t );
virtual KDfloat getRadialAccel ( KDvoid ) const;
virtual KDvoid setRadialAccel ( KDfloat t );
virtual KDfloat getRadialAccelVar ( KDvoid ) const;
virtual KDvoid setRadialAccelVar ( KDfloat t );
virtual KDbool getRotationIsDir ( KDvoid ) const;
virtual KDvoid setRotationIsDir ( KDbool t );
// mode B
virtual KDfloat getStartRadius ( KDvoid ) const;
virtual KDvoid setStartRadius ( KDfloat fStartRadius );
virtual KDfloat getStartRadiusVar ( KDvoid ) const;
virtual KDvoid setStartRadiusVar ( KDfloat fStartRadiusVar );
virtual KDfloat getEndRadius ( KDvoid ) const;
virtual KDvoid setEndRadius ( KDfloat fEndRadius );
virtual KDfloat getEndRadiusVar ( KDvoid ) const;
virtual KDvoid setEndRadiusVar ( KDfloat fEndRadiusVar );
virtual KDfloat getRotatePerSecond ( KDvoid ) const;
virtual KDvoid setRotatePerSecond ( KDfloat fDegrees );
virtual KDfloat getRotatePerSecondVar ( KDvoid ) const;
virtual KDvoid setRotatePerSecondVar ( KDfloat fDegrees );
virtual KDvoid setScale ( KDfloat s );
virtual KDvoid setRotation ( KDfloat fNewRotation );
virtual KDvoid setScaleX ( KDfloat fNewScaleX );
virtual KDvoid setScaleY ( KDfloat fNewScaleY );
virtual KDbool isActive ( KDvoid ) const;
virtual KDbool isBlendAdditive ( KDvoid ) const;
virtual KDvoid setBlendAdditive ( KDbool bValue );
virtual ParticleBatchNode* getBatchNode ( KDvoid ) const;
virtual KDvoid setBatchNode ( ParticleBatchNode* pBatchNode );
// index of system in batch node array
inline KDint getAtlasIndex ( KDvoid ) const { return m_nAtlasIndex; }
inline KDvoid setAtlasIndex ( KDint nIndex ) { m_nAtlasIndex = nIndex; }
/** Quantity of particles that are being simulated at the moment */
inline KDuint getParticleCount ( KDvoid ) const { return m_nParticleCount; }
/** How many seconds the emitter will run. -1 means 'forever' */
inline KDfloat getDuration ( KDvoid ) const { return m_fDuration; }
inline KDvoid setDuration ( KDfloat fDuration ) { m_fDuration = fDuration; }
/** sourcePosition of the emitter */
inline const Point& getSourcePosition ( KDvoid ) const { return m_tSourcePosition; }
inline KDvoid setSourcePosition ( const Point& tPos ) { m_tSourcePosition = tPos; }
/** Position variance of the emitter */
inline const Point& getPosVar ( KDvoid ) const { return m_tPosVar; }
inline KDvoid setPosVar ( const Point& tPos ) { m_tPosVar = tPos; }
/** life, and life variation of each particle */
inline KDfloat getLife ( KDvoid ) const { return m_fLife; }
inline KDvoid setLife ( KDfloat fLife ) { m_fLife = fLife; }
/** life variance of each particle */
inline KDfloat getLifeVar ( KDvoid ) const { return m_fLifeVar; }
inline KDvoid setLifeVar ( KDfloat fLifeVar ) { m_fLifeVar = fLifeVar; }
/** angle and angle variation of each particle */
inline KDfloat getAngle ( KDvoid ) const { return m_fAngle; }
inline KDvoid setAngle ( KDfloat fAngle ) { m_fAngle = fAngle; }
/** angle variance of each particle */
inline KDfloat getAngleVar ( KDvoid ) const { return m_fAngleVar; }
inline KDvoid setAngleVar ( KDfloat fAngleVar ) { m_fAngleVar = fAngleVar; }
/**
* Switch between different kind of emitter modes:
* - kParticleModeGravity: uses gravity, speed, radial and tangential acceleration
* - kParticleModeRadius: uses radius movement + rotation
*/
inline Mode getEmitterMode ( KDvoid ) const { return m_eEmitterMode; }
inline KDvoid setEmitterMode ( Mode eMode ) { m_eEmitterMode = eMode; }
/** start size in pixels of each particle */
inline KDfloat getStartSize ( KDvoid ) const { return m_fStartSize; }
inline KDvoid setStartSize ( KDfloat fStartSize ) { m_fStartSize = fStartSize; }
/** size variance in pixels of each particle */
inline KDfloat getStartSizeVar ( KDvoid ) const { return m_fStartSizeVar; }
inline KDvoid setStartSizeVar ( KDfloat fSizeVar ) { m_fStartSizeVar = fSizeVar; }
/** end size in pixels of each particle */
inline KDfloat getEndSize ( KDvoid ) const { return m_fEndSize; }
inline KDvoid setEndSize ( KDfloat fEndSize ) { m_fEndSize = fEndSize; }
/** end size variance in pixels of each particle */
inline KDfloat getEndSizeVar ( KDvoid ) const { return m_fEndSizeVar; }
inline KDvoid setEndSizeVar ( KDfloat fSizeVar ) { m_fEndSizeVar = fSizeVar; }
/** start color of each particle */
inline const Color4F& getStartColor ( KDvoid ) const { return m_tStartColor; }
inline KDvoid setStartColor ( const Color4F& tColor ) { m_tStartColor = tColor; }
/** start color variance of each particle */
inline const Color4F& getStartColorVar ( KDvoid ) const { return m_tStartColorVar; }
inline KDvoid setStartColorVar ( const Color4F& tColor ) { m_tStartColorVar = tColor; }
/** end color and end color variation of each particle */
inline const Color4F& getEndColor ( KDvoid ) const { return m_tEndColor; }
inline KDvoid setEndColor ( const Color4F& tColor ) { m_tEndColor = tColor; }
/** end color variance of each particle */
inline const Color4F& getEndColorVar ( KDvoid ) const { return m_tEndColorVar; }
inline KDvoid setEndColorVar ( const Color4F& tColor ) { m_tEndColorVar = tColor; }
//* initial angle of each particle
inline KDfloat getStartSpin ( KDvoid ) const { return m_fStartSpin; }
inline KDvoid setStartSpin ( KDfloat fSpin ) { m_fStartSpin = fSpin; }
//* initial angle of each particle
inline KDfloat getStartSpinVar ( KDvoid ) const { return m_fStartSpinVar; }
inline KDvoid setStartSpinVar ( KDfloat fPinVar ) { m_fStartSpinVar = fPinVar; }
//* initial angle of each particle
inline KDfloat getEndSpin ( KDvoid ) const { return m_fEndSpin; }
inline KDvoid setEndSpin ( KDfloat fEndSpin ) { m_fEndSpin = fEndSpin; }
//* initial angle of each particle
inline KDfloat getEndSpinVar ( KDvoid ) const { return m_fEndSpinVar; }
inline KDvoid setEndSpinVar ( KDfloat fEndSpinVar ) { m_fEndSpinVar = fEndSpinVar; }
/** emission rate of the particles */
inline KDfloat getEmissionRate ( KDvoid ) const { return m_fEmissionRate; }
inline KDvoid setEmissionRate ( KDfloat fRate ) { m_fEmissionRate = fRate; }
/** maximum particles of the system */
virtual KDint getTotalParticles ( KDvoid ) const;
virtual KDvoid setTotalParticles ( KDint nTotalParticles );
/** does the alpha value modify color */
inline KDvoid setOpacityModifyRGB ( KDbool bOpacityModifyRGB ) { m_bOpacityModifyRGB = bOpacityModifyRGB; }
inline KDbool isOpacityModifyRGB ( KDvoid ) const { return m_bOpacityModifyRGB; }
/**
* particles movement type: Free or Grouped
* @since v0.8
*/
inline PositionType getPositionType ( KDvoid ) const { return m_ePositionType; }
inline KDvoid setPositionType ( PositionType eType ) { m_ePositionType = eType; }
// Overrides
virtual KDvoid update ( KDfloat dt ) override;
virtual Texture2D* getTexture ( KDvoid ) const override;
virtual KDvoid setTexture ( Texture2D* pTexture ) override;
/**
* @code
* When this function bound into js or lua,the parameter will be changed
* In js: var setBlendFunc(var src, var dst)
* In lua: local setBlendFunc(local src, local dst)
* @endcode
*/
virtual KDvoid setBlendFunc ( const BlendFunc& tBlendFunc ) override;
/**
* @js NA
* @lua NA
*/
virtual const BlendFunc& getBlendFunc ( KDvoid ) const override;
protected :
virtual KDvoid updateBlendFunc ( KDvoid );
protected :
/**
* whether or not the particles are using blend additive.
* If enabled, the following blending function will be used.
* @code
* source blend function = GL_SRC_ALPHA;
* dest blend function = GL_ONE;
* @endcode
*/
KDbool m_bIsBlendAdditive;
/**
* whether or not the node will be auto-removed when it has no particles left.
* By default it is false.
* @since v0.8
*/
KDbool m_bIsAutoRemoveOnFinish;
std::string m_sPlistFile;
//! time elapsed since the start of the system (in seconds)
KDfloat m_fElapsed;
// Different modes
//! Mode A:Gravity + Tangential Accel + Radial Accel
struct
{
/** Gravity value. Only available in 'Gravity' mode. */
Point tGravity;
/** speed of each particle. Only available in 'Gravity' mode. */
KDfloat fSpeed;
/** speed variance of each particle. Only available in 'Gravity' mode. */
KDfloat fSpeedVar;
/** tangential acceleration of each particle. Only available in 'Gravity' mode. */
KDfloat fTangentialAccel;
/** tangential acceleration variance of each particle. Only available in 'Gravity' mode. */
KDfloat fTangentialAccelVar;
/** radial acceleration of each particle. Only available in 'Gravity' mode. */
KDfloat fRadialAccel;
/** radial acceleration variance of each particle. Only available in 'Gravity' mode. */
KDfloat fRadialAccelVar;
/** set the rotation of each particle to its direction Only available in 'Gravity' mode. */
KDbool bRotationIsDir;
} m_tModeA;
//! Mode B: circular movement (gravity, radial accel and tangential accel don't are not used in this mode)
struct
{
/** The starting radius of the particles. Only available in 'Radius' mode. */
KDfloat fStartRadius;
/** The starting radius variance of the particles. Only available in 'Radius' mode. */
KDfloat fStartRadiusVar;
/** The ending radius of the particles. Only available in 'Radius' mode. */
KDfloat fEndRadius;
/** The ending radius variance of the particles. Only available in 'Radius' mode. */
KDfloat fEndRadiusVar;
/** Number of degrees to rotate a particle around the source pos per second. Only available in 'Radius' mode. */
KDfloat fRotatePerSecond;
/** Variance in degrees for rotatePerSecond. Only available in 'Radius' mode. */
KDfloat fRotatePerSecondVar;
} m_tModeB;
//! Array of particles
tParticle* m_pParticles;
// Emitter name
std::string m_sConfigName;
// color modulate
// BOOL colorModulate;
//! How many particles can be emitted per second
KDfloat m_fEmitCounter;
//! particle idx
KDint m_nParticleIdx;
// Optimization
//CC_UPDATE_PARTICLE_IMP updateParticleImp;
//SEL updateParticleSel;
/** weak reference to the SpriteBatchNode that renders the Sprite */
ParticleBatchNode* m_pBatchNode;
// index of system in batch node array
KDint m_nAtlasIndex;
//true if scaled or rotated
KDbool m_bTransformSystemDirty;
// Number of allocated particles
KDint m_nAllocatedParticles;
/** Is the emitter active */
KDbool m_bIsActive;
/** Quantity of particles that are being simulated at the moment */
KDint m_nParticleCount;
/** How many seconds the emitter will run. -1 means 'forever' */
KDfloat m_fDuration;
/** sourcePosition of the emitter */
Point m_tSourcePosition;
/** Position variance of the emitter */
Point m_tPosVar;
/** life, and life variation of each particle */
KDfloat m_fLife;
/** life variance of each particle */
KDfloat m_fLifeVar;
/** angle and angle variation of each particle */
KDfloat m_fAngle;
/** angle variance of each particle */
KDfloat m_fAngleVar;
/**
* Switch between different kind of emitter modes:
* - kParticleModeGravity: uses gravity, speed, radial and tangential acceleration
* - kParticleModeRadius: uses radius movement + rotation
*/
Mode m_eEmitterMode;
/** start size in pixels of each particle */
KDfloat m_fStartSize;
/** size variance in pixels of each particle */
KDfloat m_fStartSizeVar;
/** end size in pixels of each particle */
KDfloat m_fEndSize;
/** end size variance in pixels of each particle */
KDfloat m_fEndSizeVar;
/** start color of each particle */
Color4F m_tStartColor;
/** start color variance of each particle */
Color4F m_tStartColorVar;
/** end color and end color variation of each particle */
Color4F m_tEndColor;
/** end color variance of each particle */
Color4F m_tEndColorVar;
//* initial angle of each particle
KDfloat m_fStartSpin;
//* initial angle of each particle
KDfloat m_fStartSpinVar;
//* initial angle of each particle
KDfloat m_fEndSpin;
//* initial angle of each particle
KDfloat m_fEndSpinVar;
/** emission rate of the particles */
KDfloat m_fEmissionRate;
/** maximum particles of the system */
KDint m_nTotalParticles;
/** conforms to CocosNodeTexture protocol */
Texture2D* m_pTexture;
/** conforms to CocosNodeTexture protocol */
BlendFunc m_tBlendFunc;
/** does the alpha value modify color */
KDbool m_bOpacityModifyRGB;
/** does FlippedY variance of each particle */
KDint m_nCoordFlippedY;
/**
* particles movement type: Free or Grouped
* @since v0.8
*/
PositionType m_ePositionType;
};
// end of particle_nodes group
/// @}
NS_CC_END
#endif //__CCPARTICLE_SYSTEM_H__
| 35.310966 | 115 | 0.673557 |
8d3d4b469e90de0dae18224d2eff566056d39214 | 2,387 | c | C | philo/srcs/philo/phi_philo_state_msg.c | JonathanDUFOUR/philosophers | f0117c5835b18bdedb4adf3648248f862051d22d | [
"MIT"
] | null | null | null | philo/srcs/philo/phi_philo_state_msg.c | JonathanDUFOUR/philosophers | f0117c5835b18bdedb4adf3648248f862051d22d | [
"MIT"
] | null | null | null | philo/srcs/philo/phi_philo_state_msg.c | JonathanDUFOUR/philosophers | f0117c5835b18bdedb4adf3648248f862051d22d | [
"MIT"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* phi_philo_state_msg.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jodufour <jodufour@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/12 11:53:51 by jodufour #+# #+# */
/* Updated: 2022/01/03 15:18:50 by jodufour ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <pthread.h>
#include "philosophers.h"
#include "type/t_ctx.h"
#include "type/t_philo.h"
#include "lookup_state_msg.h"
#include "enum/e_ret.h"
static char const *state_msg_get(t_hhuint const state)
{
int i;
i = 0;
while (g_state_msg[i].msg && state != g_state_msg[i].state)
++i;
return (g_state_msg[i].msg);
}
static int state_msg_print(char const *msg, t_lint const idx, int *const ret)
{
t_ctx *const ctx = phi_ctx_get();
t_lint start;
t_lint now;
if (phi_now(&now))
return (*ret = GET_TIME_OF_DAY_ERR);
if (pthread_mutex_lock(&ctx->access))
return (*ret = MUTEX_LOCK_ERR);
start = ctx->start;
if (pthread_mutex_unlock(&ctx->access))
return (*ret = MUTEX_UNLOCK_ERR);
if (printf("%6li\t%3li %s\n", now - start, idx, msg) == -1)
return (*ret = PRINTF_ERR);
return (*ret = SUCCESS);
}
int phi_philo_state_msg(t_philo *const philo, int *const ret)
{
t_mutex *const voice = phi_voice_get();
char const *msg;
t_hhuint state;
t_lint idx;
if (pthread_mutex_lock(voice))
return (*ret = MUTEX_LOCK_ERR);
if (pthread_mutex_lock(&philo->access))
return (*ret = MUTEX_LOCK_ERR);
idx = philo->idx;
state = philo->state;
if (state == DEAD)
philo->state = STOP;
if (pthread_mutex_unlock(&philo->access))
return (*ret = MUTEX_UNLOCK_ERR);
msg = state_msg_get(state);
if (msg && state_msg_print(msg, idx, ret))
return (*ret);
if (pthread_mutex_unlock(voice))
return (*ret = MUTEX_UNLOCK_ERR);
return (*ret = SUCCESS);
}
| 32.69863 | 80 | 0.477168 |
4ffd78de613530e19e4a50229298969c7d9ad63b | 1,864 | h | C | Source/RSSTSManager.h | kaneshin/RSSTS-iOS | 7f044f610dcbf8859886b878c1300bb3e5cd7120 | [
"MIT"
] | 1 | 2015-04-27T01:39:48.000Z | 2015-04-27T01:39:48.000Z | Source/RSSTSManager.h | kaneshin/RSSTS | 7f044f610dcbf8859886b878c1300bb3e5cd7120 | [
"MIT"
] | null | null | null | Source/RSSTSManager.h | kaneshin/RSSTS | 7f044f610dcbf8859886b878c1300bb3e5cd7120 | [
"MIT"
] | null | null | null | // RSSTSManager.h
//
// Copyright (c) 2015 Shintaro Kaneko
//
// 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 <Foundation/Foundation.h>
#if TARGET_OS_IPHONE == 1
#import <UIKit/UIKit.h>
#endif
#import "RSSTSProvider.h"
#if TARGET_OS_IPHONE == 1
typedef void (^RSSTSImageBlock)(UIImage *__nonnull);
#endif
typedef void (^RSSTSErrorBlock)(NSError *__nullable);
extern NSString *const __nonnull RSSTSManagerConfigurationTokenKey;
@interface RSSTSManager : NSObject
+ (RSSTSManager *__nullable)defaultManager;
- (void)setConfiguration:(NSDictionary *__nonnull)configuration;
- (RSSTSProvider *__nullable)addProviderByChannel:(NSString *__nonnull)channel;
- (RSSTSProvider *__nullable)providerByChannel:(NSString *__nonnull)channel;
- (void)removeProviderByChannel:(NSString *__nonnull)channel;
- (void)start;
- (void)stop;
@end
| 38.040816 | 80 | 0.775751 |
3ebaff6d89e37d10de24c3249a0fd6a1aabb123d | 3,484 | h | C | cpp/iedriver/CommandHandlers/GetSessionCapabilitiesCommandHandler.h | sergeychipiga/selenium | d834b32b04055cfee803932ff68836addecc5301 | [
"Apache-2.0"
] | 1 | 2016-06-23T03:10:00.000Z | 2016-06-23T03:10:00.000Z | cpp/iedriver/CommandHandlers/GetSessionCapabilitiesCommandHandler.h | sergeychipiga/selenium | d834b32b04055cfee803932ff68836addecc5301 | [
"Apache-2.0"
] | 3 | 2017-02-13T11:30:32.000Z | 2022-02-13T15:14:07.000Z | cpp/iedriver/CommandHandlers/GetSessionCapabilitiesCommandHandler.h | sergeychipiga/selenium | d834b32b04055cfee803932ff68836addecc5301 | [
"Apache-2.0"
] | 5 | 2018-03-29T09:35:12.000Z | 2020-11-18T14:01:03.000Z | // Copyright 2011 Software Freedom Conservancy
// 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 WEBDRIVER_IE_GETSESSIONCAPABILITIESCOMMANDHANDLER_H_
#define WEBDRIVER_IE_GETSESSIONCAPABILITIESCOMMANDHANDLER_H_
#include "../Browser.h"
#include "../IECommandHandler.h"
#include "../IECommandExecutor.h"
namespace webdriver {
class GetSessionCapabilitiesCommandHandler : public IECommandHandler {
public:
GetSessionCapabilitiesCommandHandler(void) {
}
virtual ~GetSessionCapabilitiesCommandHandler(void) {
}
protected:
void ExecuteInternal(const IECommandExecutor& executor,
const LocatorMap& locator_parameters,
const ParametersMap& command_parameters,
Response* response) {
Json::Value capabilities;
capabilities[BROWSER_NAME_CAPABILITY] = "internet explorer";
capabilities[BROWSER_VERSION_CAPABILITY] = std::to_string(static_cast<long long>(executor.browser_version()));
capabilities[JAVASCRIPT_ENABLED_CAPABILITY] = true;
capabilities[PLATFORM_CAPABILITY] = "WINDOWS";
capabilities[NATIVE_EVENTS_CAPABILITY] = executor.input_manager()->enable_native_events();
capabilities[CSS_SELECTOR_ENABLED_CAPABILITY] = true;
capabilities[TAKES_SCREENSHOT_CAPABILITY] = true;
capabilities[HANDLES_ALERTS_CAPABILITY] = true;
if (executor.proxy_manager()->is_proxy_set()) {
capabilities[PROXY_CAPABILITY] = executor.proxy_manager()->GetProxyAsJson();
}
capabilities[ENABLE_PERSISTENT_HOVER_CAPABILITY] = executor.enable_persistent_hover();
capabilities[UNEXPECTED_ALERT_BEHAVIOR_CAPABILITY] = executor.unexpected_alert_behavior();
capabilities[ELEMENT_SCROLL_BEHAVIOR_CAPABILITY] = executor.input_manager()->scroll_behavior();
capabilities[IGNORE_PROTECTED_MODE_CAPABILITY] = executor.browser_factory()->ignore_protected_mode_settings();
capabilities[IGNORE_ZOOM_SETTING_CAPABILITY] = executor.browser_factory()->ignore_zoom_setting();
capabilities[INITIAL_BROWSER_URL_CAPABILITY] = executor.browser_factory()->initial_browser_url();
capabilities[ENABLE_ELEMENT_CACHE_CLEANUP_CAPABILITY] = executor.enable_element_cache_cleanup();
capabilities[REQUIRE_WINDOW_FOCUS_CAPABILITY] = executor.input_manager()->require_window_focus();
capabilities[BROWSER_ATTACH_TIMEOUT_CAPABILITY] = executor.browser_factory()->browser_attach_timeout();
capabilities[BROWSER_COMMAND_LINE_SWITCHES_CAPABILITY] = executor.browser_factory()->browser_command_line_switches();
capabilities[FORCE_CREATE_PROCESS_API_CAPABILITY] = executor.browser_factory()->force_createprocess_api();
capabilities[ENSURE_CLEAN_SESSION_CAPABILITY] = executor.browser_factory()->clear_cache();
capabilities[USE_PER_PROCESS_PROXY_CAPABILITY] = executor.proxy_manager()->use_per_process_proxy();
response->SetSuccessResponse(capabilities);
}
};
} // namespace webdriver
#endif // WEBDRIVER_IE_GETSESSIONCAPABILITIESCOMMANDHANDLER_H_
| 51.235294 | 121 | 0.7876 |
12824ad91e6cff997e2ccfcec6e130432272482e | 4,375 | c | C | ForthTutorial/forth.c | patsch/forth-tutorial | 6f1ab30252dccbcb237da13626edf271cddbeb40 | [
"MIT"
] | null | null | null | ForthTutorial/forth.c | patsch/forth-tutorial | 6f1ab30252dccbcb237da13626edf271cddbeb40 | [
"MIT"
] | null | null | null | ForthTutorial/forth.c | patsch/forth-tutorial | 6f1ab30252dccbcb237da13626edf271cddbeb40 | [
"MIT"
] | null | null | null | //
// forth.c
//
//
// Created by Patrick Dockhorn on 26/12/20.
//
// this is the code for the commands provided by this tiny forth implementation
// as defined by our 'command dictionary' (see dictionary.c)
#include "stack.h"
#include "forth.h"
#include "dictionary.h"
// the code for the functions our forth interpreter offers
// execute the 'add' function on the top two stack entries
Retcode add() {
Retcode ret = OK;
StackValue val1;
StackValue val2;
// pop the first value
ret = stackPop(&val1);
if (ret == OK)
{
// if ok, pop the 2nd value
ret = stackPop(&val2);
if (ret == OK)
{
// if still ok, add the two values, then push the result
StackValue result = val1 + val2;
stackPushValue(result);
}
}
return ret;
}
// execute the 'subtract' function on the top two stack entries
Retcode subtract() {
Retcode ret = OK;
StackValue val1;
StackValue val2;
// pop the first value
ret = stackPop(&val1);
if (ret == OK)
{
// if ok, pop the 2nd value
ret = stackPop(&val2);
if (ret == OK)
{
// if still ok, subtract the two values, then push the result
StackValue result = val2 - val1;
stackPushValue(result);
}
}
return ret;
}
// execute the 'multiplication' function on the top two stack entries
Retcode mult() {
Retcode ret = OK;
StackValue val1;
StackValue val2;
// pop the first value
ret = stackPop(&val1);
if (ret == OK)
{
// if ok, pop the 2nd value
ret = stackPop(&val2);
if (ret == OK)
{
// if still ok, multiply the two values, then push the result
StackValue result = val1 * val2;
stackPushValue(result);
}
}
return ret;
}
// execute the 'division' function on the top two stack entries
Retcode divide() {
return ERR_NOT_YET_IMPLEMENTED;
}
// execute the 'modulo' function on the top two stack entries
Retcode modulo() {
return ERR_NOT_YET_IMPLEMENTED;
}
// execute the 'duplication' function (duplicate the topmost element)
Retcode duplicate() {
return ERR_NOT_YET_IMPLEMENTED;
}
// execute the 'pop' function (remove the topmost element)
Retcode pop() {
return ERR_NOT_YET_IMPLEMENTED;
}
Retcode print_pop() {
StackValue val;
Retcode ret = stackPop(&val);
if (ret == OK)
{
printf("<<<%ld>>>\n",val);
}
return ret;
}
Retcode print_all() {
Retcode ret = OK;
StackElement *top = stack;
if (!top)
{
printf("\nStack is empty.\n");
}
else
{
printf("\nStack Contents:\n");
int pos = 0;
while (top)
{
printf("[%d] <<< %ld >>>\n",pos,top->value);
top = top->next;
pos++;
}
}
return ret;
}
// implement a simple help function which can be called on the command line or interactively
Retcode forth_help() {
printf("\n\n---------------------------------------------------------\n");
printf("BEGIN HELP\n\n");
printf("\n\nYou can use this program in two ways - either provide all stack elements on the command line - or work interactively.\n");
printf("If you provide the stack elements on the command line they will be processed first and the Forth interpreter will then\n");
printf("enter interactive mode. In interactive mode, you can simply enter values / commands one by one; hit ENTER/RETURN after each\n");
printf("value/command to push the value/command onto the stack and, if you push a command, perform the requested operation.\n\n");
printf("Usage: mini_forth word1 word2 word3 word4 ...\n");
printf("Example: mini_forth 1 2 +\n");
printf("\n\nHere is a list of all the operators this mini forth implementation understands:\n\n");
Entry *entry = commandDictionary;
while (entry)
{
printf("%s : %s\n",entry->word,entry->description);
entry = entry->next_entry;
}
printf("\n\nEND HELP\n\n");
printf("---------------------------------------------------------\n\n");
return OK;
}
Retcode forth_bye() {
// bye command simple returns a special Return code to indicate to the caller that we should quit
return BYEBYE;
}
| 26.197605 | 140 | 0.587657 |
3e4f60a547609216ae1547404dc8d8586094f0bf | 6,462 | c | C | classlib/modules/portlib/src/main/native/port/unix/stubs/hyvmem.c | sirinath/Harmony | 724deb045a85b722c961d8b5a83ac7a697319441 | [
"Apache-2.0"
] | 5 | 2017-03-08T20:32:39.000Z | 2021-07-10T10:12:38.000Z | classlib/modules/portlib/src/main/native/port/unix/stubs/hyvmem.c | sirinath/Harmony | 724deb045a85b722c961d8b5a83ac7a697319441 | [
"Apache-2.0"
] | 1 | 2021-10-17T13:03:49.000Z | 2021-10-17T13:03:49.000Z | modules/portlib/src/main/native/port/unix/stubs/hyvmem.c | isabella232/harmony-classlib | ee663b95e84093405985d9557a925b651a0f69b3 | [
"Apache-2.0"
] | 4 | 2015-07-07T07:06:59.000Z | 2018-06-19T22:38:04.000Z | /*
* 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.
*/
#define CDEV_CURRENT_FUNCTION _comment_
/**
* @file
* @ingroup Port
* @brief Virtual memory
*/
#undef CDEV_CURRENT_FUNCTION
#include "hyport.h"
#include "portpriv.h"
#include "hyportpg.h"
#include "ut_hyprt.h"
#define CDEV_CURRENT_FUNCTION hyvmem_shutdown
/**
* PortLibrary shutdown.
*
* This function is called during shutdown of the portLibrary. Any resources that were created by @ref hyvmem_startup
* should be destroyed here.
*
* @param[in] portLibrary The port library.
*
* @note Most implementations will be empty.
*/
void VMCALL
hyvmem_shutdown (struct HyPortLibrary *portLibrary)
{
}
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION hyvmem_startup
/**
* PortLibrary startup.
*
* This function is called during startup of the portLibrary. Any
* resources that are required for the virtual memory operations may
* be created here. All resources created here should be destroyed in
* @ref hyvmem_shutdown.
*
* @param[in] portLibrary The port library.
*
* @return 0 on success, negative error code on failure. Error code
* values returned are \arg HYPORT_ERROR_STARTUP_VMEM
*
* @note Most implementations will simply return success.
*/
I_32 VMCALL
hyvmem_startup (struct HyPortLibrary *portLibrary)
{
return 0;
}
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION hyvmem_commit_memory
/**
* Commit memory in virtual address space.
*
* @param[in] portLibrary The port library.
* @param[in] address The page aligned starting address of the memory to commit.
* @param[in] byteAmount The number of bytes to commit.
* @param[in] identifier Descriptor for virtual memory block.
*
* @return pointer to the allocated memory on success, NULL on failure.
*/
void *VMCALL
hyvmem_commit_memory (struct HyPortLibrary *portLibrary, void *address,
UDATA byteAmount,
struct HyPortVmemIdentifier *identifier)
{
return NULL;
}
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION hyvmem_decommit_memory
/**
* Decommit memory in virtual address space.
*
* Decommits physical storage of the size specified starting at the
* address specified.
*
* @param[in] portLibrary The port library.
* @param[in] address The starting address of the memory to be decommitted.
* @param[in] byteAmount The number of bytes to be decommitted.
* @param[in] identifier Descriptor for virtual memory block.
*
* @return 0 on success, non zero on failure.
*/
IDATA VMCALL
hyvmem_decommit_memory (struct HyPortLibrary * portLibrary, void *address,
UDATA byteAmount,
struct HyPortVmemIdentifier * identifier)
{
return (IDATA) 0;
}
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION hyvmem_free_memory
/**
* Free memory in virtual address space.
*
* Frees physical storage of the size specified starting at the
* address specified.
*
* @param[in] portLibrary The port library.
* @param[in] address The starting address of the memory to be de-allocated.
* @param[in] byteAmount The number of bytes to be allocated.
* @param[in] identifier Descriptor for virtual memory block.
*
* @return 0 on success, non zero on failure.
*/
I_32 VMCALL
hyvmem_free_memory (struct HyPortLibrary * portLibrary, void *address,
UDATA byteAmount,
struct HyPortVmemIdentifier * identifier)
{
return -1;
}
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION hyvmem_reserve_memory
/**
* Reserve memory in virtual address space.
*
* Reserves a range of virtual address space without allocating any
* actual physical storage.
* The memory is not available for use until committed @ref
* hyvmem_commit_memory.
* The memory may not be used by other memory allocation routines
* until it is explicitly released.
*
* @param[in] portLibrary The port library.
* @param[in] address The starting address of the memory to be reserved.
* @param[in] byteAmount The number of bytes to be reserved.
* @param[in] identifier Descriptor for virtual memory block.
* @param[in] mode Bitmap indicating how memory is to be reserved.
* Expected values combination of:
* \arg HYPORT_VMEM_MEMORY_MODE_READ memory is readable
* \arg HYPORT_VMEM_MEMORY_MODE_WRITE memory is writable
* \arg HYPORT_VMEM_MEMORY_MODE_EXECUTE memory is executable
* \arg HYPORT_VMEM_MEMORY_MODE_COMMIT commits memory as part of the reserve
* @param[in] pageSize Size of the page requested, a value returned by
* @ref hyvmem_supported_page_sizes, or the constant
* HYPORT_VMEM_PAGE_SIZE_DEFAULT for the system default page size.
*
* @return pointer to the reserved memory on success, NULL on failure.
*
* @internal @warning Do not call error handling code @ref hyerror
* upon error as the error handling code uses per thread buffers to
* store the last error. If memory can not be allocated the result
* would be an infinite loop.
*/
void *VMCALL
hyvmem_reserve_memory (struct HyPortLibrary *portLibrary, void *address,
UDATA byteAmount,
struct HyPortVmemIdentifier *identifier, UDATA mode,
UDATA pageSize)
{
return NULL;
}
#undef CDEV_CURRENT_FUNCTION
#define CDEV_CURRENT_FUNCTION hyvmem_supported_page_sizes
/**
* Determine the page sizes supported.
*
* @param[in] portLibrary The port library.
*
* @return A 0 terminated array of supported page sizes. The first entry is the default page size, other entries
* are the large page sizes supported.
*/
UDATA *VMCALL
hyvmem_supported_page_sizes (struct HyPortLibrary * portLibrary)
{
return PPG_vmem_pageSize;
}
#undef CDEV_CURRENT_FUNCTION
| 32.149254 | 118 | 0.742495 |
3ff551611ac1001fb8ee78c0f149cf85cfb9ea16 | 2,423 | h | C | net/warpcopydisk.h | Pokefinder-org/DiskImagery64 | 10557fed083834455f8ace70a1d740a9b007d853 | [
"X11"
] | 8 | 2020-04-24T00:23:53.000Z | 2022-03-22T22:38:24.000Z | net/warpcopydisk.h | Pokefinder-org/DiskImagery64 | 10557fed083834455f8ace70a1d740a9b007d853 | [
"X11"
] | 4 | 2020-01-24T04:27:09.000Z | 2022-01-13T15:08:33.000Z | net/warpcopydisk.h | ProbablyNotArtyom/DiskImagery64 | 32ee2eec3bd31961ff3a6760a3d4f702100474ab | [
"X11"
] | 1 | 2021-05-07T18:58:42.000Z | 2021-05-07T18:58:42.000Z | #ifndef WARPCOPYDISK_H
#define WARPCOPYDISK_H
#include "dimage.h"
#include "warpcopy.h"
#include <QObject>
//! a tool class to copy a whole disk via warp copy service
class WarpCopyDisk : public QThread
{
Q_OBJECT
public:
enum Mode {
READ_DISK_SLOW,
WRITE_DISK_SLOW,
READ_DISK_WARP,
WRITE_DISK_WARP
};
WarpCopyDisk();
~WarpCopyDisk();
//! start copy disk thread
void startCopy(int drive,WarpCopyService *service,Mode mode,
const BlockMap &m_blockMap,QByteArray *m_rawImage);
//! abort copy operation
void abortCopy();
//! is still copying?
bool isCopying();
//! after copying query errors and result
bool finishCopy(int &numErrorBlocks);
//! check for abort
bool isAborted();
signals:
//! report block
void procBlock(int track,int sector,int status,const QString &statusString);
//! prepare block
void prepareBlock(int track,int sector);
protected slots:
//! got a block
void gotBlock(int drive,int track,int sector,int status,const QString &str,
const QByteArray &block);
//! put a block
void putBlock(int drive,int track,int sector,int status,const QString &str);
//! expect block
void expectBlock(int drive,int track,int sector);
//! finished warp operation
void finishedWarpOp(bool ok);
protected:
//! drive number
int m_drive;
//! warp copy service
WarpCopyService *m_service;
//! copy mode
Mode m_mode;
//! block map
BlockMap m_blockMap;
//! offset map
OffsetMap m_offsetMap;
//! image raw array
QByteArray *m_rawImage;
//! flags for block
QVector<int> m_blockFlags;
//! mutex for stop
QMutex m_flagMutex;
//! copier was aborted
bool m_aborted;
//! copier is running
bool m_running;
//! mutex for signal
QMutex m_signalMutex;
//! wait condidition for signal
QWaitCondition m_signalWaitCond;
//! block flag
bool m_gotSignalFlag;
//! signal per block?
bool m_signalPerBlock;
//! thread execution
void run();
// ----- copy modes -----
//! read disk slow
void readDiskSlow();
//! write disk slow
void writeDiskSlow();
//! read disk warp
void readDiskWarp();
//! write disk warp
void writeDiskWarp();
//! get blocks for retry read - returns true if there are any
bool getRetryBlocks(BlockPosVector &bpv);
// ----- threading -----
void resetSignal();
void waitSignal();
void wakeUpSignal();
};
#endif
| 22.435185 | 78 | 0.680561 |
e21ea472d1b8129f4ff14555334b835641d64bee | 30,607 | c | C | cores/nRF5/external/lora/LoRaMac-node-4.4.7/src/system/delay.c | RAKWireless/RAK-nRF52-RUI | 35940d558436a3f6e654972cfcc627a6c5e51f1b | [
"BSD-3-Clause"
] | null | null | null | cores/nRF5/external/lora/LoRaMac-node-4.4.7/src/system/delay.c | RAKWireless/RAK-nRF52-RUI | 35940d558436a3f6e654972cfcc627a6c5e51f1b | [
"BSD-3-Clause"
] | null | null | null | cores/nRF5/external/lora/LoRaMac-node-4.4.7/src/system/delay.c | RAKWireless/RAK-nRF52-RUI | 35940d558436a3f6e654972cfcc627a6c5e51f1b | [
"BSD-3-Clause"
] | null | null | null | # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.c"
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3//"
# 1 "<built-in>"
#define __STDC__ 1
#define __STDC_VERSION__ 199901L
#define __STDC_HOSTED__ 1
#define __GNUC__ 10
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __VERSION__ "10.2.1 20201103 (release)"
#define __ATOMIC_RELAXED 0
#define __ATOMIC_SEQ_CST 5
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_RELEASE 3
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_CONSUME 1
#define __OPTIMIZE_SIZE__ 1
#define __OPTIMIZE__ 1
#define __FINITE_MATH_ONLY__ 0
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG__ 4
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_DOUBLE__ 8
#define __SIZEOF_LONG_DOUBLE__ 8
#define __SIZEOF_SIZE_T__ 4
#define __CHAR_BIT__ 8
#define __BIGGEST_ALIGNMENT__ 8
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_PDP_ENDIAN__ 3412
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __SIZEOF_POINTER__ 4
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ unsigned int
#define __WINT_TYPE__ unsigned int
#define __INTMAX_TYPE__ long long int
#define __UINTMAX_TYPE__ long long unsigned int
#define __CHAR16_TYPE__ short unsigned int
#define __CHAR32_TYPE__ long unsigned int
#define __SIG_ATOMIC_TYPE__ int
#define __INT8_TYPE__ signed char
#define __INT16_TYPE__ short int
#define __INT32_TYPE__ long int
#define __INT64_TYPE__ long long int
#define __UINT8_TYPE__ unsigned char
#define __UINT16_TYPE__ short unsigned int
#define __UINT32_TYPE__ long unsigned int
#define __UINT64_TYPE__ long long unsigned int
#define __INT_LEAST8_TYPE__ signed char
#define __INT_LEAST16_TYPE__ short int
#define __INT_LEAST32_TYPE__ long int
#define __INT_LEAST64_TYPE__ long long int
#define __UINT_LEAST8_TYPE__ unsigned char
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __UINT_LEAST32_TYPE__ long unsigned int
#define __UINT_LEAST64_TYPE__ long long unsigned int
#define __INT_FAST8_TYPE__ int
#define __INT_FAST16_TYPE__ int
#define __INT_FAST32_TYPE__ int
#define __INT_FAST64_TYPE__ long long int
#define __UINT_FAST8_TYPE__ unsigned int
#define __UINT_FAST16_TYPE__ unsigned int
#define __UINT_FAST32_TYPE__ unsigned int
#define __UINT_FAST64_TYPE__ long long unsigned int
#define __INTPTR_TYPE__ int
#define __UINTPTR_TYPE__ unsigned int
#define __GXX_ABI_VERSION 1014
#define __SCHAR_MAX__ 0x7f
#define __SHRT_MAX__ 0x7fff
#define __INT_MAX__ 0x7fffffff
#define __LONG_MAX__ 0x7fffffffL
#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
#define __WCHAR_MAX__ 0xffffffffU
#define __WCHAR_MIN__ 0U
#define __WINT_MAX__ 0xffffffffU
#define __WINT_MIN__ 0U
#define __PTRDIFF_MAX__ 0x7fffffff
#define __SIZE_MAX__ 0xffffffffU
#define __SCHAR_WIDTH__ 8
#define __SHRT_WIDTH__ 16
#define __INT_WIDTH__ 32
#define __LONG_WIDTH__ 32
#define __LONG_LONG_WIDTH__ 64
#define __WCHAR_WIDTH__ 32
#define __WINT_WIDTH__ 32
#define __PTRDIFF_WIDTH__ 32
#define __SIZE_WIDTH__ 32
#define __INTMAX_MAX__ 0x7fffffffffffffffLL
#define __INTMAX_C(c) c ## LL
#define __UINTMAX_MAX__ 0xffffffffffffffffULL
#define __UINTMAX_C(c) c ## ULL
#define __INTMAX_WIDTH__ 64
#define __SIG_ATOMIC_MAX__ 0x7fffffff
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __SIG_ATOMIC_WIDTH__ 32
#define __INT8_MAX__ 0x7f
#define __INT16_MAX__ 0x7fff
#define __INT32_MAX__ 0x7fffffffL
#define __INT64_MAX__ 0x7fffffffffffffffLL
#define __UINT8_MAX__ 0xff
#define __UINT16_MAX__ 0xffff
#define __UINT32_MAX__ 0xffffffffUL
#define __UINT64_MAX__ 0xffffffffffffffffULL
#define __INT_LEAST8_MAX__ 0x7f
#define __INT8_C(c) c
#define __INT_LEAST8_WIDTH__ 8
#define __INT_LEAST16_MAX__ 0x7fff
#define __INT16_C(c) c
#define __INT_LEAST16_WIDTH__ 16
#define __INT_LEAST32_MAX__ 0x7fffffffL
#define __INT32_C(c) c ## L
#define __INT_LEAST32_WIDTH__ 32
#define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL
#define __INT64_C(c) c ## LL
#define __INT_LEAST64_WIDTH__ 64
#define __UINT_LEAST8_MAX__ 0xff
#define __UINT8_C(c) c
#define __UINT_LEAST16_MAX__ 0xffff
#define __UINT16_C(c) c
#define __UINT_LEAST32_MAX__ 0xffffffffUL
#define __UINT32_C(c) c ## UL
#define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL
#define __UINT64_C(c) c ## ULL
#define __INT_FAST8_MAX__ 0x7fffffff
#define __INT_FAST8_WIDTH__ 32
#define __INT_FAST16_MAX__ 0x7fffffff
#define __INT_FAST16_WIDTH__ 32
#define __INT_FAST32_MAX__ 0x7fffffff
#define __INT_FAST32_WIDTH__ 32
#define __INT_FAST64_MAX__ 0x7fffffffffffffffLL
#define __INT_FAST64_WIDTH__ 64
#define __UINT_FAST8_MAX__ 0xffffffffU
#define __UINT_FAST16_MAX__ 0xffffffffU
#define __UINT_FAST32_MAX__ 0xffffffffU
#define __UINT_FAST64_MAX__ 0xffffffffffffffffULL
#define __INTPTR_MAX__ 0x7fffffff
#define __INTPTR_WIDTH__ 32
#define __UINTPTR_MAX__ 0xffffffffU
#define __GCC_IEC_559 0
#define __GCC_IEC_559_COMPLEX 0
#define __FLT_EVAL_METHOD__ 0
#define __FLT_EVAL_METHOD_TS_18661_3__ 0
#define __DEC_EVAL_METHOD__ 2
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_MAX__ 3.4028234663852886e+38F
#define __FLT_NORM_MAX__ 3.4028234663852886e+38F
#define __FLT_MIN__ 1.1754943508222875e-38F
#define __FLT_EPSILON__ 1.1920928955078125e-7F
#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FP_FAST_FMAF 1
#define __DBL_MANT_DIG__ 53
#define __DBL_DIG__ 15
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX_10_EXP__ 308
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_MAX__ ((double)1.7976931348623157e+308L)
#define __DBL_NORM_MAX__ ((double)1.7976931348623157e+308L)
#define __DBL_MIN__ ((double)2.2250738585072014e-308L)
#define __DBL_EPSILON__ ((double)2.2204460492503131e-16L)
#define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L)
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 53
#define __LDBL_DIG__ 15
#define __LDBL_MIN_EXP__ (-1021)
#define __LDBL_MIN_10_EXP__ (-307)
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX_10_EXP__ 308
#define __DECIMAL_DIG__ 17
#define __LDBL_DECIMAL_DIG__ 17
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __LDBL_NORM_MAX__ 1.7976931348623157e+308L
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __FLT32_MANT_DIG__ 24
#define __FLT32_DIG__ 6
#define __FLT32_MIN_EXP__ (-125)
#define __FLT32_MIN_10_EXP__ (-37)
#define __FLT32_MAX_EXP__ 128
#define __FLT32_MAX_10_EXP__ 38
#define __FLT32_DECIMAL_DIG__ 9
#define __FLT32_MAX__ 3.4028234663852886e+38F32
#define __FLT32_NORM_MAX__ 3.4028234663852886e+38F32
#define __FLT32_MIN__ 1.1754943508222875e-38F32
#define __FLT32_EPSILON__ 1.1920928955078125e-7F32
#define __FLT32_DENORM_MIN__ 1.4012984643248171e-45F32
#define __FLT32_HAS_DENORM__ 1
#define __FLT32_HAS_INFINITY__ 1
#define __FLT32_HAS_QUIET_NAN__ 1
#define __FP_FAST_FMAF32 1
#define __FLT64_MANT_DIG__ 53
#define __FLT64_DIG__ 15
#define __FLT64_MIN_EXP__ (-1021)
#define __FLT64_MIN_10_EXP__ (-307)
#define __FLT64_MAX_EXP__ 1024
#define __FLT64_MAX_10_EXP__ 308
#define __FLT64_DECIMAL_DIG__ 17
#define __FLT64_MAX__ 1.7976931348623157e+308F64
#define __FLT64_NORM_MAX__ 1.7976931348623157e+308F64
#define __FLT64_MIN__ 2.2250738585072014e-308F64
#define __FLT64_EPSILON__ 2.2204460492503131e-16F64
#define __FLT64_DENORM_MIN__ 4.9406564584124654e-324F64
#define __FLT64_HAS_DENORM__ 1
#define __FLT64_HAS_INFINITY__ 1
#define __FLT64_HAS_QUIET_NAN__ 1
#define __FLT32X_MANT_DIG__ 53
#define __FLT32X_DIG__ 15
#define __FLT32X_MIN_EXP__ (-1021)
#define __FLT32X_MIN_10_EXP__ (-307)
#define __FLT32X_MAX_EXP__ 1024
#define __FLT32X_MAX_10_EXP__ 308
#define __FLT32X_DECIMAL_DIG__ 17
#define __FLT32X_MAX__ 1.7976931348623157e+308F32x
#define __FLT32X_NORM_MAX__ 1.7976931348623157e+308F32x
#define __FLT32X_MIN__ 2.2250738585072014e-308F32x
#define __FLT32X_EPSILON__ 2.2204460492503131e-16F32x
#define __FLT32X_DENORM_MIN__ 4.9406564584124654e-324F32x
#define __FLT32X_HAS_DENORM__ 1
#define __FLT32X_HAS_INFINITY__ 1
#define __FLT32X_HAS_QUIET_NAN__ 1
#define __SFRACT_FBIT__ 7
#define __SFRACT_IBIT__ 0
#define __SFRACT_MIN__ (-0.5HR-0.5HR)
#define __SFRACT_MAX__ 0X7FP-7HR
#define __SFRACT_EPSILON__ 0x1P-7HR
#define __USFRACT_FBIT__ 8
#define __USFRACT_IBIT__ 0
#define __USFRACT_MIN__ 0.0UHR
#define __USFRACT_MAX__ 0XFFP-8UHR
#define __USFRACT_EPSILON__ 0x1P-8UHR
#define __FRACT_FBIT__ 15
#define __FRACT_IBIT__ 0
#define __FRACT_MIN__ (-0.5R-0.5R)
#define __FRACT_MAX__ 0X7FFFP-15R
#define __FRACT_EPSILON__ 0x1P-15R
#define __UFRACT_FBIT__ 16
#define __UFRACT_IBIT__ 0
#define __UFRACT_MIN__ 0.0UR
#define __UFRACT_MAX__ 0XFFFFP-16UR
#define __UFRACT_EPSILON__ 0x1P-16UR
#define __LFRACT_FBIT__ 31
#define __LFRACT_IBIT__ 0
#define __LFRACT_MIN__ (-0.5LR-0.5LR)
#define __LFRACT_MAX__ 0X7FFFFFFFP-31LR
#define __LFRACT_EPSILON__ 0x1P-31LR
#define __ULFRACT_FBIT__ 32
#define __ULFRACT_IBIT__ 0
#define __ULFRACT_MIN__ 0.0ULR
#define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR
#define __ULFRACT_EPSILON__ 0x1P-32ULR
#define __LLFRACT_FBIT__ 63
#define __LLFRACT_IBIT__ 0
#define __LLFRACT_MIN__ (-0.5LLR-0.5LLR)
#define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR
#define __LLFRACT_EPSILON__ 0x1P-63LLR
#define __ULLFRACT_FBIT__ 64
#define __ULLFRACT_IBIT__ 0
#define __ULLFRACT_MIN__ 0.0ULLR
#define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR
#define __ULLFRACT_EPSILON__ 0x1P-64ULLR
#define __SACCUM_FBIT__ 7
#define __SACCUM_IBIT__ 8
#define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK)
#define __SACCUM_MAX__ 0X7FFFP-7HK
#define __SACCUM_EPSILON__ 0x1P-7HK
#define __USACCUM_FBIT__ 8
#define __USACCUM_IBIT__ 8
#define __USACCUM_MIN__ 0.0UHK
#define __USACCUM_MAX__ 0XFFFFP-8UHK
#define __USACCUM_EPSILON__ 0x1P-8UHK
#define __ACCUM_FBIT__ 15
#define __ACCUM_IBIT__ 16
#define __ACCUM_MIN__ (-0X1P15K-0X1P15K)
#define __ACCUM_MAX__ 0X7FFFFFFFP-15K
#define __ACCUM_EPSILON__ 0x1P-15K
#define __UACCUM_FBIT__ 16
#define __UACCUM_IBIT__ 16
#define __UACCUM_MIN__ 0.0UK
#define __UACCUM_MAX__ 0XFFFFFFFFP-16UK
#define __UACCUM_EPSILON__ 0x1P-16UK
#define __LACCUM_FBIT__ 31
#define __LACCUM_IBIT__ 32
#define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK)
#define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK
#define __LACCUM_EPSILON__ 0x1P-31LK
#define __ULACCUM_FBIT__ 32
#define __ULACCUM_IBIT__ 32
#define __ULACCUM_MIN__ 0.0ULK
#define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK
#define __ULACCUM_EPSILON__ 0x1P-32ULK
#define __LLACCUM_FBIT__ 31
#define __LLACCUM_IBIT__ 32
#define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK)
#define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK
#define __LLACCUM_EPSILON__ 0x1P-31LLK
#define __ULLACCUM_FBIT__ 32
#define __ULLACCUM_IBIT__ 32
#define __ULLACCUM_MIN__ 0.0ULLK
#define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK
#define __ULLACCUM_EPSILON__ 0x1P-32ULLK
#define __QQ_FBIT__ 7
#define __QQ_IBIT__ 0
#define __HQ_FBIT__ 15
#define __HQ_IBIT__ 0
#define __SQ_FBIT__ 31
#define __SQ_IBIT__ 0
#define __DQ_FBIT__ 63
#define __DQ_IBIT__ 0
#define __TQ_FBIT__ 127
#define __TQ_IBIT__ 0
#define __UQQ_FBIT__ 8
#define __UQQ_IBIT__ 0
#define __UHQ_FBIT__ 16
#define __UHQ_IBIT__ 0
#define __USQ_FBIT__ 32
#define __USQ_IBIT__ 0
#define __UDQ_FBIT__ 64
#define __UDQ_IBIT__ 0
#define __UTQ_FBIT__ 128
#define __UTQ_IBIT__ 0
#define __HA_FBIT__ 7
#define __HA_IBIT__ 8
#define __SA_FBIT__ 15
#define __SA_IBIT__ 16
#define __DA_FBIT__ 31
#define __DA_IBIT__ 32
#define __TA_FBIT__ 63
#define __TA_IBIT__ 64
#define __UHA_FBIT__ 8
#define __UHA_IBIT__ 8
#define __USA_FBIT__ 16
#define __USA_IBIT__ 16
#define __UDA_FBIT__ 32
#define __UDA_IBIT__ 32
#define __UTA_FBIT__ 64
#define __UTA_IBIT__ 64
#define __REGISTER_PREFIX__
#define __USER_LABEL_PREFIX__
#define __GNUC_STDC_INLINE__ 1
#define __STRICT_ANSI__ 1
#define __CHAR_UNSIGNED__ 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __HAVE_SPECULATION_SAFE_VALUE 1
#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __SIZEOF_WCHAR_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __SIZEOF_PTRDIFF_T__ 4
#define __ARM_FEATURE_DSP 1
#define __ARM_FEATURE_QBIT 1
#define __ARM_FEATURE_SAT 1
#undef __ARM_FEATURE_CRYPTO
# 1 "<built-in>"
#define __ARM_FEATURE_UNALIGNED 1
#undef __ARM_FEATURE_QRDMX
# 1 "<built-in>"
#undef __ARM_FEATURE_CRC32
# 1 "<built-in>"
#undef __ARM_FEATURE_DOTPROD
# 1 "<built-in>"
#undef __ARM_FEATURE_COMPLEX
# 1 "<built-in>"
#define __ARM_32BIT_STATE 1
#undef __ARM_FEATURE_MVE
# 1 "<built-in>"
#undef __ARM_FEATURE_CMSE
# 1 "<built-in>"
#undef __ARM_FEATURE_LDREX
# 1 "<built-in>"
#define __ARM_FEATURE_LDREX 7
#define __ARM_FEATURE_CLZ 1
#undef __ARM_FEATURE_NUMERIC_MAXMIN
# 1 "<built-in>"
#define __ARM_FEATURE_SIMD32 1
#define __ARM_SIZEOF_MINIMAL_ENUM 1
#define __ARM_SIZEOF_WCHAR_T 4
#undef __ARM_ARCH_PROFILE
# 1 "<built-in>"
#define __ARM_ARCH_PROFILE 77
#define __arm__ 1
#undef __ARM_ARCH
# 1 "<built-in>"
#define __ARM_ARCH 7
#define __APCS_32__ 1
#define __GCC_ASM_FLAG_OUTPUTS__ 1
#define __thumb__ 1
#define __thumb2__ 1
#define __THUMBEL__ 1
#undef __ARM_ARCH_ISA_THUMB
# 1 "<built-in>"
#define __ARM_ARCH_ISA_THUMB 2
#define __ARMEL__ 1
#define __VFP_FP__ 1
#undef __ARM_FP
# 1 "<built-in>"
#define __ARM_FP 4
#undef __ARM_FP16_FORMAT_IEEE
# 1 "<built-in>"
#undef __ARM_FP16_FORMAT_ALTERNATIVE
# 1 "<built-in>"
#undef __ARM_FP16_ARGS
# 1 "<built-in>"
#undef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC
# 1 "<built-in>"
#undef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
# 1 "<built-in>"
#undef __ARM_FEATURE_FP16_FML
# 1 "<built-in>"
#define __ARM_FEATURE_FMA 1
#undef __ARM_NEON__
# 1 "<built-in>"
#undef __ARM_NEON
# 1 "<built-in>"
#undef __ARM_NEON_FP
# 1 "<built-in>"
#define __THUMB_INTERWORK__ 1
#define __ARM_ARCH_7EM__ 1
#define __ARM_PCS_VFP 1
#define __ARM_EABI__ 1
#undef __FDPIC__
# 1 "<built-in>"
#define __ARM_ARCH_EXT_IDIV__ 1
#define __ARM_FEATURE_IDIV 1
#define __ARM_ASM_SYNTAX_UNIFIED__ 1
#undef __ARM_FEATURE_COPROC
# 1 "<built-in>"
#define __ARM_FEATURE_COPROC 15
#undef __ARM_FEATURE_CDE
# 1 "<built-in>"
#undef __ARM_FEATURE_CDE_COPROC
# 1 "<built-in>"
#undef __ARM_FEATURE_MATMUL_INT8
# 1 "<built-in>"
#undef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC
# 1 "<built-in>"
#undef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC
# 1 "<built-in>"
#undef __ARM_BF16_FORMAT_ALTERNATIVE
# 1 "<built-in>"
#define __GXX_TYPEINFO_EQUALITY_INLINE 0
#define __ELF__ 1
# 1 "<command-line>"
#define __USES_INITFINI__ 1
#define nrf52840 1
#define SUPPORT_LORA 1
#define LORA_IO_SPI_PORT 2
#define SYS_RTC_COUNTER_PORT 2
#define ATCMD_CUST_TABLE_SIZE 64
#define WAN_TYPE 0
#define LORA_STACK_VER 0x040407
#define RAK4631_V2 .0+RAK5005-O_V1.0 1
#define rak4630 1
#define BATTERY_LEVEL_SUPPORT 1
#define BLE_CENTRAL_SUPPORT 1
#define WDT_SUPPORT 1
#define APP_TIMER_V2 1
#define APP_TIMER_V2_RTC1_ENABLED 1
#define BOARD_PCA10056 1
#define S140 1
#define CONFIG_GPIO_AS_PINRESET 1
#define FLOAT_ABI_HARD 1
#define NRF52840_XXAA 1
#define NRF_SD_BLE_API_VERSION 6
#define USER_UART 1
#define USBD_CDC 1
#define BLE_SUPPORT 1
#define DFU_SUPPORT 1
#define BL_SETTINGS_ACCESS_ONLY 1
#define NRF_DFU_SVCI_ENABLED 1
#define NRF_DFU_TRANSPORT_BLE 1
#define REGION_AS923 1
#define REGION_AU915 1
#define REGION_CN470 1
#define REGION_CN779 1
#define REGION_EU433 1
#define REGION_EU868 1
#define REGION_KR920 1
#define REGION_IN865 1
#define REGION_US915 1
#define REGION_RU864 1
#define SOFT_SE 1
#define SECURE_ELEMENT_PRE_PROVISIONED 1
#define LORAMAC_CLASSB_ENABLED 1
#define SOFTDEVICE_PRESENT 1
#define SWI_DISABLE0 1
#define __HEAP_SIZE 7168
#define __STACK_SIZE 7168
#define DEBUG 1
#define WISBLOCK_BASE_5005_O 1
#define SUPPORT_USB 1
#define SUPPORT_BLE 1
#define CONFIG_NFCT_PINS_AS_GPIOS 1
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.c"
# 23 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.c"
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/delay-board.h" 1
# 26 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/delay-board.h"
#define __DELAY_BOARD_H__
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 1 3 4
# 9 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 3 4
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 1 3 4
# 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define _STDINT_H
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 1 3 4
#define _MACHINE__DEFAULT_TYPES_H
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 1 3 4
# 22 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4
#define _SYS_FEATURES_H
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/_newlib_version.h" 1 3 4
#define _NEWLIB_VERSION_H__ 1
#define _NEWLIB_VERSION "3.3.0"
#define __NEWLIB__ 3
#define __NEWLIB_MINOR__ 3
#define __NEWLIB_PATCHLEVEL__ 0
# 29 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 2 3 4
#define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#define __GNUC_PREREQ__(ma,mi) __GNUC_PREREQ(ma, mi)
# 249 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4
#define __ATFILE_VISIBLE 0
#define __BSD_VISIBLE 0
#define __GNU_VISIBLE 0
#define __ISO_C_VISIBLE 1999
#define __LARGEFILE_VISIBLE 0
#define __MISC_VISIBLE 0
# 299 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4
#define __POSIX_VISIBLE 0
#define __SVID_VISIBLE 0
# 319 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4
#define __XSI_VISIBLE 0
# 330 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/features.h" 3 4
#define __SSP_FORTIFY_LEVEL 0
# 9 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 2 3 4
#define __EXP(x) __ ##x ##__
# 26 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
#define __have_longlong64 1
#define __have_long32 1
# 41 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
#define ___int8_t_defined 1
typedef short int __int16_t;
typedef short unsigned int __uint16_t;
#define ___int16_t_defined 1
# 77 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef long int __int32_t;
typedef long unsigned int __uint32_t;
#define ___int32_t_defined 1
# 103 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef long long int __int64_t;
typedef long long unsigned int __uint64_t;
#define ___int64_t_defined 1
# 134 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef signed char __int_least8_t;
typedef unsigned char __uint_least8_t;
#define ___int_least8_t_defined 1
# 160 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef short int __int_least16_t;
typedef short unsigned int __uint_least16_t;
#define ___int_least16_t_defined 1
# 182 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef long int __int_least32_t;
typedef long unsigned int __uint_least32_t;
#define ___int_least32_t_defined 1
# 200 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
typedef long long int __int_least64_t;
typedef long long unsigned int __uint_least64_t;
#define ___int_least64_t_defined 1
typedef long long int __intmax_t;
typedef long long unsigned int __uintmax_t;
typedef int __intptr_t;
typedef unsigned int __uintptr_t;
# 244 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/machine/_default_types.h" 3 4
#undef __EXP
# 13 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 1 3 4
# 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define _SYS__INTSUP_H
#define __STDINT_EXP(x) __ ##x ##__
# 35 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#undef signed
#undef unsigned
#undef char
#undef short
#undef int
#undef __int20
#undef __int20__
#undef long
#define signed +0
#define unsigned +0
#define char +0
#define short +1
#define __int20 +2
#define __int20__ +2
#define int +2
#define long +4
# 67 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define _INTPTR_EQ_INT
#define _INT32_EQ_LONG
#define __INT8 "hh"
# 93 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __INT16 "h"
# 104 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __INT32 "l"
# 113 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __INT64 "ll"
#define __FAST8
# 129 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __FAST16
#define __FAST32
# 147 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __FAST64 "ll"
#define __LEAST8 "hh"
# 162 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __LEAST16 "h"
# 173 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __LEAST32 "l"
# 182 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#define __LEAST64 "ll"
#undef signed
#undef unsigned
#undef char
#undef short
#undef int
#undef long
# 194 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#undef __int20
# 195 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_intsup.h" 3 4
#undef __int20__
# 14 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4
# 1 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 1 3 4
# 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 3 4
#define _SYS__STDINT_H
# 20 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/sys/_stdint.h" 3 4
typedef __int8_t int8_t ;
#define _INT8_T_DECLARED
typedef __uint8_t uint8_t ;
#define _UINT8_T_DECLARED
#define __int8_t_defined 1
typedef __int16_t int16_t ;
#define _INT16_T_DECLARED
typedef __uint16_t uint16_t ;
#define _UINT16_T_DECLARED
#define __int16_t_defined 1
typedef __int32_t int32_t ;
#define _INT32_T_DECLARED
typedef __uint32_t uint32_t ;
#define _UINT32_T_DECLARED
#define __int32_t_defined 1
typedef __int64_t int64_t ;
#define _INT64_T_DECLARED
typedef __uint64_t uint64_t ;
#define _UINT64_T_DECLARED
#define __int64_t_defined 1
typedef __intmax_t intmax_t;
#define _INTMAX_T_DECLARED
typedef __uintmax_t uintmax_t;
#define _UINTMAX_T_DECLARED
typedef __intptr_t intptr_t;
#define _INTPTR_T_DECLARED
typedef __uintptr_t uintptr_t;
#define _UINTPTR_T_DECLARED
# 15 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 2 3 4
typedef __int_least8_t int_least8_t;
typedef __uint_least8_t uint_least8_t;
#define __int_least8_t_defined 1
typedef __int_least16_t int_least16_t;
typedef __uint_least16_t uint_least16_t;
#define __int_least16_t_defined 1
typedef __int_least32_t int_least32_t;
typedef __uint_least32_t uint_least32_t;
#define __int_least32_t_defined 1
typedef __int_least64_t int_least64_t;
typedef __uint_least64_t uint_least64_t;
#define __int_least64_t_defined 1
# 51 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
typedef int int_fast8_t;
typedef unsigned int uint_fast8_t;
#define __int_fast8_t_defined 1
typedef int int_fast16_t;
typedef unsigned int uint_fast16_t;
#define __int_fast16_t_defined 1
typedef int int_fast32_t;
typedef unsigned int uint_fast32_t;
#define __int_fast32_t_defined 1
typedef long long int int_fast64_t;
typedef long long unsigned int uint_fast64_t;
#define __int_fast64_t_defined 1
# 128 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INTPTR_MIN (-__INTPTR_MAX__ - 1)
#define INTPTR_MAX (__INTPTR_MAX__)
#define UINTPTR_MAX (__UINTPTR_MAX__)
# 152 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT8_MIN (-__INT8_MAX__ - 1)
#define INT8_MAX (__INT8_MAX__)
#define UINT8_MAX (__UINT8_MAX__)
#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1)
#define INT_LEAST8_MAX (__INT_LEAST8_MAX__)
#define UINT_LEAST8_MAX (__UINT_LEAST8_MAX__)
# 174 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT16_MIN (-__INT16_MAX__ - 1)
#define INT16_MAX (__INT16_MAX__)
#define UINT16_MAX (__UINT16_MAX__)
#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1)
#define INT_LEAST16_MAX (__INT_LEAST16_MAX__)
#define UINT_LEAST16_MAX (__UINT_LEAST16_MAX__)
# 196 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT32_MIN (-__INT32_MAX__ - 1)
#define INT32_MAX (__INT32_MAX__)
#define UINT32_MAX (__UINT32_MAX__)
# 212 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1)
#define INT_LEAST32_MAX (__INT_LEAST32_MAX__)
#define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__)
# 230 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT64_MIN (-__INT64_MAX__ - 1)
#define INT64_MAX (__INT64_MAX__)
#define UINT64_MAX (__UINT64_MAX__)
# 246 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1)
#define INT_LEAST64_MAX (__INT_LEAST64_MAX__)
#define UINT_LEAST64_MAX (__UINT_LEAST64_MAX__)
# 262 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1)
#define INT_FAST8_MAX (__INT_FAST8_MAX__)
#define UINT_FAST8_MAX (__UINT_FAST8_MAX__)
# 278 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1)
#define INT_FAST16_MAX (__INT_FAST16_MAX__)
#define UINT_FAST16_MAX (__UINT_FAST16_MAX__)
# 294 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1)
#define INT_FAST32_MAX (__INT_FAST32_MAX__)
#define UINT_FAST32_MAX (__UINT_FAST32_MAX__)
# 310 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1)
#define INT_FAST64_MAX (__INT_FAST64_MAX__)
#define UINT_FAST64_MAX (__UINT_FAST64_MAX__)
# 326 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INTMAX_MAX (__INTMAX_MAX__)
#define INTMAX_MIN (-INTMAX_MAX - 1)
#define UINTMAX_MAX (__UINTMAX_MAX__)
#define SIZE_MAX (__SIZE_MAX__)
#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1)
#define SIG_ATOMIC_MAX (__STDINT_EXP(INT_MAX))
#define PTRDIFF_MAX (__PTRDIFF_MAX__)
#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
#define WCHAR_MIN (__WCHAR_MIN__)
# 374 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define WCHAR_MAX (__WCHAR_MAX__)
# 384 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define WINT_MAX (__WINT_MAX__)
#define WINT_MIN (__WINT_MIN__)
#define INT8_C(x) __INT8_C(x)
#define UINT8_C(x) __UINT8_C(x)
# 408 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT16_C(x) __INT16_C(x)
#define UINT16_C(x) __UINT16_C(x)
# 420 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT32_C(x) __INT32_C(x)
#define UINT32_C(x) __UINT32_C(x)
# 433 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INT64_C(x) __INT64_C(x)
#define UINT64_C(x) __UINT64_C(x)
# 449 "/opt/gcc-arm-none-eabi-10-2020-q4-major/arm-none-eabi/include/stdint.h" 3 4
#define INTMAX_C(x) __INTMAX_C(x)
#define UINTMAX_C(x) __UINTMAX_C(x)
# 10 "/opt/gcc-arm-none-eabi-10-2020-q4-major/lib/gcc/arm-none-eabi/10.2.1/include/stdint.h" 2 3 4
#define _GCC_WRAP_STDINT_H
# 34 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/delay-board.h" 2
# 40 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/delay-board.h"
void DelayMsMcu( uint32_t ms );
# 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.c" 2
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.h" 1
# 24 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.h"
#define __DELAY_H__
# 36 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.h"
void Delay( float s );
void DelayMs( uint32_t ms );
# 25 "/home/jenkins/workspace/RUI_Release/rui-v3/external/lora/LoRaMac-node-4.4.7/src/system/delay.c" 2
void Delay( float s )
{
DelayMs( s * 1000.0f );
}
void DelayMs( uint32_t ms )
{
DelayMsMcu( ms );
}
| 26.40811 | 103 | 0.803313 |
3f2042300dea13ad052d1559256355e9b2c6b056 | 27,316 | h | C | src/api/java/com_firstworks_sqlrelay_SQLRCursor.h | laigor/sqlrelay-non-english-fixes- | 7803f862ddbf88bca078c50d621c64c22fc0a405 | [
"PHP-3.01",
"CC-BY-3.0"
] | 16 | 2018-04-23T09:58:33.000Z | 2022-01-31T13:40:20.000Z | src/api/java/com_firstworks_sqlrelay_SQLRCursor.h | laigor/sqlrelay-non-english-fixes- | 7803f862ddbf88bca078c50d621c64c22fc0a405 | [
"PHP-3.01",
"CC-BY-3.0"
] | null | null | null | src/api/java/com_firstworks_sqlrelay_SQLRCursor.h | laigor/sqlrelay-non-english-fixes- | 7803f862ddbf88bca078c50d621c64c22fc0a405 | [
"PHP-3.01",
"CC-BY-3.0"
] | 4 | 2020-12-23T12:17:54.000Z | 2022-01-04T20:46:34.000Z | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_firstworks_sqlrelay_SQLRCursor */
#ifndef _Included_com_firstworks_sqlrelay_SQLRCursor
#define _Included_com_firstworks_sqlrelay_SQLRCursor
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: delete
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_delete
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: setResultSetBufferSize
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_setResultSetBufferSize
(JNIEnv *, jobject, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getResultSetBufferSize
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getResultSetBufferSize
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: dontGetColumnInfo
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_dontGetColumnInfo
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnInfo
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnInfo
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: mixedCaseColumnNames
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_mixedCaseColumnNames
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: upperCaseColumnNames
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_upperCaseColumnNames
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: lowerCaseColumnNames
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_lowerCaseColumnNames
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: cacheToFile
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_cacheToFile
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: setCacheTtl
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_setCacheTtl
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getCacheFileName
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getCacheFileName
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: cacheOff
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_cacheOff
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getDatabaseList
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getDatabaseList
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getTableList
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getTableList
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnList
* Signature: (Ljava/lang/String;Ljava/lang/String)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnList
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: sendQuery
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_sendQuery__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: sendQuery
* Signature: (Ljava/lang/String;I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_sendQuery__Ljava_lang_String_2I
(JNIEnv *, jobject, jstring, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: sendFileQuery
* Signature: (Ljava/lang/String;Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_sendFileQuery
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: prepareQuery
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_prepareQuery__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: prepareQuery
* Signature: (Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_prepareQuery__Ljava_lang_String_2I
(JNIEnv *, jobject, jstring, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: prepareFileQuery
* Signature: (Ljava/lang/String;Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_prepareFileQuery
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: clearBinds
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_clearBinds
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: substitution
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_substitution__Ljava_lang_String_2Ljava_lang_String_2
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: substitution
* Signature: (Ljava/lang/String;J)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_substitution__Ljava_lang_String_2J
(JNIEnv *, jobject, jstring, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: substitution
* Signature: (Ljava/lang/String;DII)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_substitution__Ljava_lang_String_2DII
(JNIEnv *, jobject, jstring, jdouble, jint, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: countBindVariables
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_countBindVariables
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBind
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBind__Ljava_lang_String_2Ljava_lang_String_2
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBind
* Signature: (Ljava/lang/String;Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBind__Ljava_lang_String_2Ljava_lang_String_2I
(JNIEnv *, jobject, jstring, jstring, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBind
* Signature: (Ljava/lang/String;J)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBind__Ljava_lang_String_2J
(JNIEnv *, jobject, jstring, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBind
* Signature: (Ljava/lang/String;DII)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBind__Ljava_lang_String_2DII
(JNIEnv *, jobject, jstring, jdouble, jint, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBindBlob
* Signature: (Ljava/lang/String;[BJ)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBindBlob
(JNIEnv *, jobject, jstring, jbyteArray, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBindClob
* Signature: (Ljava/lang/String;Ljava/lang/String;J)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBindClob
(JNIEnv *, jobject, jstring, jstring, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: defineOutputBindString
* Signature: (Ljava/lang/String;I)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_defineOutputBindString
(JNIEnv *, jobject, jstring, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: defineOutputBindInteger
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_defineOutputBindInteger
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: defineOutputBindDouble
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_defineOutputBindDouble
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: defineOutputBindBlob
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_defineOutputBindBlob
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: defineOutputBindClob
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_defineOutputBindClob
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: defineOutputBindCursor
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_defineOutputBindCursor
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: substitutions
* Signature: ([Ljava/lang/String;[Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_substitutions___3Ljava_lang_String_2_3Ljava_lang_String_2
(JNIEnv *, jobject, jobjectArray, jobjectArray);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: substitutions
* Signature: ([Ljava/lang/String;[J)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_substitutions___3Ljava_lang_String_2_3J
(JNIEnv *, jobject, jobjectArray, jlongArray);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: substitutions
* Signature: ([Ljava/lang/String;[D[I[I)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_substitutions___3Ljava_lang_String_2_3D_3I_3I
(JNIEnv *, jobject, jobjectArray, jdoubleArray, jintArray, jintArray);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBinds
* Signature: ([Ljava/lang/String;[Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBinds___3Ljava_lang_String_2_3Ljava_lang_String_2
(JNIEnv *, jobject, jobjectArray, jobjectArray);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBinds
* Signature: ([Ljava/lang/String;[J)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBinds___3Ljava_lang_String_2_3J
(JNIEnv *, jobject, jobjectArray, jlongArray);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: inputBinds
* Signature: ([Ljava/lang/String;[D[I[I)V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_inputBinds___3Ljava_lang_String_2_3D_3I_3I
(JNIEnv *, jobject, jobjectArray, jdoubleArray, jintArray, jintArray);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: validateBinds
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_validateBinds
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: validBind
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_validBind
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: executeQuery
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_executeQuery
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: fetchFromBindCursor
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_fetchFromBindCursor
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindString
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindString
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindBlob
* Signature: (Ljava/lang/String;)LB
*/
JNIEXPORT jbyteArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindBlob
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindClob
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindClob
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindAsByteArray
* Signature: (Ljava/lang/String;)[B
*/
JNIEXPORT jbyteArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindAsByteArray
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindInteger
* Signature: (Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindInteger
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindDouble
* Signature: (Ljava/lang/String;)D
*/
JNIEXPORT jdouble JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindDouble
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindLength
* Signature: (Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindLength
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: openCachedResultSet
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_openCachedResultSet
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: colCount
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_colCount
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: rowCount
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_rowCount
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: totalRows
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_totalRows
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: affectedRows
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_affectedRows
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: firstRowIndex
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_firstRowIndex
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: endOfResultSet
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_endOfResultSet
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: errorMessage
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_errorMessage
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getNullsAsEmptyStrings
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getNullsAsEmptyStrings
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getNullsAsNulls
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getNullsAsNulls
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getField
* Signature: (JI)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getField__JI
(JNIEnv *, jobject, jlong, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getField
* Signature: (JLjava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getField__JLjava_lang_String_2
(JNIEnv *, jobject, jlong, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldAsInteger
* Signature: (JI)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldAsInteger__JI
(JNIEnv *, jobject, jlong, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldAsInteger
* Signature: (JLjava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldAsInteger__JLjava_lang_String_2
(JNIEnv *, jobject, jlong, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldAsDouble
* Signature: (JI)D
*/
JNIEXPORT jdouble JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldAsDouble__JI
(JNIEnv *, jobject, jlong, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldAsDouble
* Signature: (JLjava/lang/String;)D
*/
JNIEXPORT jdouble JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldAsDouble__JLjava_lang_String_2
(JNIEnv *, jobject, jlong, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldAsByteArray
* Signature: (JI)[B
*/
JNIEXPORT jbyteArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldAsByteArray__JI
(JNIEnv *, jobject, jlong, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldAsByteArray
* Signature: (JLjava/lang/String;)[B
*/
JNIEXPORT jbyteArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldAsByteArray__JLjava_lang_String_2
(JNIEnv *, jobject, jlong, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldLength
* Signature: (JI)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldLength__JI
(JNIEnv *, jobject, jlong, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getFieldLength
* Signature: (JLjava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getFieldLength__JLjava_lang_String_2
(JNIEnv *, jobject, jlong, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getRow
* Signature: (J)[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getRow
(JNIEnv *, jobject, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getRowLengths
* Signature: (J)[J
*/
JNIEXPORT jlongArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getRowLengths
(JNIEnv *, jobject, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnNames
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnNames
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnName
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnType
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnType__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnType
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnType__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnPrecision
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnPrecision__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnPrecision
* Signature: (Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnPrecision__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnScale
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnScale__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnScale
* Signature: (Ljava/lang/String;)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnScale__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsNullable
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsNullable__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsNullable
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsNullable__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsPrimaryKey
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsPrimaryKey__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsPrimaryKey
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsPrimaryKey__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsUnique
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsUnique__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsUnique
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsUnique__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsPartOfKey
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsPartOfKey__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsPartOfKey
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsPartOfKey__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsUnsigned
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsUnsigned__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsUnsigned
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsUnsigned__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsZeroFilled
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsZeroFilled__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsZeroFilled
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsZeroFilled__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsBinary
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsBinary__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsBinary
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsBinary__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsAutoIncrement
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsAutoIncrement__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnIsAutoIncrement
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnIsAutoIncrement__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnLength
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnLength__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getColumnLength
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getColumnLength__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getLongest
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getLongest__I
(JNIEnv *, jobject, jint);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getLongest
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getLongest__Ljava_lang_String_2
(JNIEnv *, jobject, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: suspendResultSet
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_suspendResultSet
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getResultSetId
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getResultSetId
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: resumeResultSet
* Signature: (S)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_resumeResultSet
(JNIEnv *, jobject, jshort);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: resumeCachedResultSet
* Signature: (SLjava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_resumeCachedResultSet
(JNIEnv *, jobject, jshort, jstring);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: closeResultSet
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_closeResultSet
(JNIEnv *, jobject);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: alloc
* Signature: (J)J
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_alloc
(JNIEnv *, jobject, jlong);
/*
* Class: com_firstworks_sqlrelay_SQLRCursor
* Method: getOutputBindCursorInternal
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jlong JNICALL Java_com_firstworks_sqlrelay_SQLRCursor_getOutputBindCursorInternal
(JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
#endif
| 30.017582 | 120 | 0.777932 |
e98756c1e3de72a20546bfd39b17871d3a80090a | 277 | c | C | Prajjwal/day8/s3.c | kinston18/Coding | 3829f7fce6e25345933da598cd149a459a2c99fc | [
"MIT"
] | 2 | 2021-05-09T13:32:02.000Z | 2021-06-08T09:06:56.000Z | Prajjwal/day8/s3.c | prajjwal18/Coding | 599cb703a7c67056393fe08c082cfdd4b71bd7bd | [
"MIT"
] | 2 | 2021-05-12T16:03:32.000Z | 2021-05-13T13:00:54.000Z | Prajjwal/day8/s3.c | prajjwal18/Coding | 599cb703a7c67056393fe08c082cfdd4b71bd7bd | [
"MIT"
] | 2 | 2021-05-09T12:37:09.000Z | 2021-05-09T12:37:16.000Z | //write a program to print the table of n(take n from user)//
#include<stdio.h>
int main(int argc, char const *argv[])
{
int n;
printf("Enter the the interger ");
scanf("%d", &n);
for (int i = 1; i <=10; ++i)
{
printf("%d * %d = %d\n", n,i,n*i);
}
return 0;
}
| 14.578947 | 61 | 0.552347 |
aceaea8ea42c2de7c59a45e1a2b94e5941e520c5 | 3,230 | h | C | src/utils/boosting.h | anuranbaka/Vulcan | 56339f77f6cf64b5fda876445a33e72cd15ce028 | [
"MIT"
] | 3 | 2020-03-05T23:56:14.000Z | 2021-02-17T19:06:50.000Z | src/utils/boosting.h | anuranbaka/Vulcan | 56339f77f6cf64b5fda876445a33e72cd15ce028 | [
"MIT"
] | 1 | 2021-03-07T01:23:47.000Z | 2021-03-07T01:23:47.000Z | src/utils/boosting.h | anuranbaka/Vulcan | 56339f77f6cf64b5fda876445a33e72cd15ce028 | [
"MIT"
] | 1 | 2021-03-03T07:54:16.000Z | 2021-03-03T07:54:16.000Z | /* Copyright (C) 2010-2019, The Regents of The University of Michigan.
All rights reserved.
This software was developed as part of the The Vulcan project in the Intelligent Robotics Lab
under the direction of Benjamin Kuipers, kuipers@umich.edu. Use of this code is governed by an
MIT-style License that can be found at "https://github.com/h2ssh/Vulcan".
*/
/**
* \file boosting.h
* \author Collin Johnson
*
* Declaration of AdaBoostClassifier, which can be learned via the LearnClassifier method.
*/
#ifndef UTILS_BOOSTING_H
#define UTILS_BOOSTING_H
#include "core/matrix.h"
#include "core/vector.h"
#include "utils/decision_stump.h"
#include <memory>
#include <vector>
namespace vulcan
{
namespace utils
{
class AdaBoostClassifier;
using AdaBoostModelPtr = std::shared_ptr<AdaBoostClassifier>;
/**
* AdaBoostClassifier is a simple AdaBoost classifier using decision stumps.
*/
class AdaBoostClassifier
{
public:
/**
* LearnClassifier learns a classifier for the provided data. The data is a feature vector and a binary label.
*
* \param labels Binary labels for the data
* \param features Feature vectors for each example
* \param maxClassifiers Maximum number of classifiers to learns
* \return A learned AdaBoostClassifier.
*/
static std::unique_ptr<AdaBoostClassifier>
LearnClassifier(const IntVector& labels, const Matrix& features, int maxClassifiers = 200);
// Allow default construction
AdaBoostClassifier(void) = default;
/**
* Constructor for AdaBoostClassifier.
*
* Load a classifier from a file.
*
* \param filename Filename with the saved boosting classifier
*/
explicit AdaBoostClassifier(const std::string& filename);
/**
* classify classifies an example. The learned classifier is applied to the feature vector and the probability of
* the feature being a positive classificaton is returned.
*
* \param features Feature vector to classify
* \return Value in range [0, 1] indicating how likely it is to be a good example.
*/
double classify(const Vector& features) const;
/**
* load loads a classifier from the given file.
*
* \param filename Classifier to load
* \return True if the classifier was loaded successfully.
*/
bool load(const std::string& filename);
/**
* save saves a classifier to a file.
*
* \param filename Name to save classifier in
* \return True if saved successfully.
*/
bool save(const std::string& filename) const;
// Iteration over the boosted decision stump classifiers
std::size_t size(void) const { return stumps_.size(); }
std::vector<DecisionStump>::const_iterator begin(void) const { return stumps_.begin(); }
std::vector<DecisionStump>::const_iterator end(void) const { return stumps_.end(); }
private:
AdaBoostClassifier(std::vector<DecisionStump> stumps);
std::vector<DecisionStump> stumps_;
double weightNormalizer_; // normalizer to apply to all weights
};
} // namespace utils
} // namespace vulcan
#endif // UTILS_BOOSTING_H
| 31.057692 | 117 | 0.688854 |
ac7c512048e5e0ea90665aef510a63aaf628e38e | 19,142 | h | C | buildbox-common/buildboxcommon/buildboxcommon_client.h | sdclarke/buildbox-common | f77bf556176625b083dd45e2a6575a1301c6276a | [
"Apache-2.0"
] | null | null | null | buildbox-common/buildboxcommon/buildboxcommon_client.h | sdclarke/buildbox-common | f77bf556176625b083dd45e2a6575a1301c6276a | [
"Apache-2.0"
] | null | null | null | buildbox-common/buildboxcommon/buildboxcommon_client.h | sdclarke/buildbox-common | f77bf556176625b083dd45e2a6575a1301c6276a | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2018 Bloomberg Finance 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 INCLUDED_BUILDBOXCOMMON_CLIENT
#define INCLUDED_BUILDBOXCOMMON_CLIENT
#include <functional>
#include <memory>
#include <unordered_map>
#include <buildboxcommon_cashash.h>
#include <buildboxcommon_connectionoptions.h>
#include <buildboxcommon_grpcretrier.h>
#include <buildboxcommon_merklize.h>
#include <buildboxcommon_protos.h>
#include <buildboxcommon_requestmetadata.h>
namespace buildboxcommon {
/**
* Implements a mechanism to communicate with remote CAS servers, and includes
* data members to keep track of an ongoing batch upload or batch download
* request.
*/
class Client {
public:
Client(){};
Client(std::shared_ptr<ByteStream::StubInterface> bytestreamClient,
std::shared_ptr<ContentAddressableStorage::StubInterface> casClient,
std::shared_ptr<LocalContentAddressableStorage::StubInterface>
localCasClient,
std::shared_ptr<Capabilities::StubInterface> capabilitiesClient,
size_t maxBatchTotalSizeBytes = s_bytestreamChunkSizeBytes)
: d_bytestreamClient(bytestreamClient), d_casClient(casClient),
d_localCasClient(localCasClient),
d_capabilitiesClient(capabilitiesClient),
d_maxBatchTotalSizeBytes(maxBatchTotalSizeBytes)
{
}
/**
* Connect to the CAS server with the given connection options.
*/
void init(const ConnectionOptions &options);
/**
* Connect to the CAS server with the given clients.
*/
void
init(std::shared_ptr<ByteStream::StubInterface> bytestreamClient,
std::shared_ptr<ContentAddressableStorage::StubInterface> casClient,
std::shared_ptr<LocalContentAddressableStorage::StubInterface>
d_localCasClient,
std::shared_ptr<Capabilities::StubInterface> capabilitiesClient);
void set_tool_details(const std::string &tool_name,
const std::string &tool_version);
/**
* Set the optional ID values to be attached to requests.
*/
void set_request_metadata(const std::string &action_id,
const std::string &tool_invocation_id,
const std::string &correlated_invocations_id);
/**
* Download the blob with the given digest and return it.
*
* If the server returned an error, or the size of the received blob does
* not match the digest, throw an `std::runtime_error` exception.
*/
std::string fetchString(const Digest &digest);
/**
* Download the blob with the given digest to the given file descriptor.
*
* If the file descriptor cannot be written to, the size of the
* received blob does not match the digest, or the server
* returned an error, throw an `std::runtime_error` exception.
*/
void download(int fd, const Digest &digest);
void downloadDirectory(const Digest &digest, const std::string &path);
/**
* Upload the given string. If it can't be uploaded successfully, throw
* an exception.
*/
void upload(const std::string &data, const Digest &digest);
/**
* Upload a blob from the given file descriptor. If it can't be uploaded
* successfully, throw an exception.
*/
void upload(int fd, const Digest &digest);
struct UploadRequest {
Digest digest;
std::string data;
std::string path;
UploadRequest(const Digest &_digest, const std::string _data)
: digest(_digest), data(_data){};
static UploadRequest from_path(const Digest &_digest,
const std::string _path)
{
auto request = UploadRequest(_digest);
request.path = _path;
return request;
}
private:
UploadRequest(const Digest &_digest) : digest(_digest){};
};
struct UploadResult {
Digest digest;
grpc::Status status;
UploadResult(const Digest &_digest, const grpc::Status &_status)
: digest(_digest), status(_status){};
};
/* Upload multiple digests in an efficient way, allowing each digest to
* potentially fail separately.
*
* Return a list containing the Digests that failed to be uploaded and the
* errors they received. (An empty result indicates that all digests were
* uploaded.)
*/
std::vector<UploadResult>
uploadBlobs(const std::vector<UploadRequest> &requests);
typedef std::unordered_map<std::string,
std::pair<google::rpc::Status, std::string>>
DownloadBlobsResult;
/* Given a list of digests, download the data and return it in a map
* indexed by hash. Allow each digest to potentially fail separately.
*
* The returned map's values are pairs of (status, data) where the second
* component will be empty if the status contains an non-OK code.
*
* When downloading many and/or large blobs it is strongly recommended to
* use `downloadBlobsToDirectory()` instead to avoid excessive memory
* usage.
*/
DownloadBlobsResult downloadBlobs(const std::vector<Digest> &digests);
/* Given a list of digests, download the data to a temporary directory
* and return the file paths in a map indexed by hash. Allow each digest to
* potentially fail separately. The specified directory must be empty.
*
* The returned map's values are pairs of (status, path) where the second
* component will be empty if the status contains an non-OK code.
*
* This is suitable for downloading many and/or large blobs.
*/
DownloadBlobsResult
downloadBlobsToDirectory(const std::vector<Digest> &digests,
const std::string &temp_directory);
/* Given a list of digests, download the data and store each blob in the
* path specified by the entry's first member in the `outputs` map. If the
* second member of the tuple is true, mark the file as executable.
*
* If any errors are encountered in the process of fetching the blobs, it
* aborts and throws an `std::runtime_error` exception. (It might leave
* directories in an inconsistent state, i.e. with missing files.)
*/
typedef std::unordered_multimap<std::string, std::pair<std::string, bool>>
OutputMap;
void downloadBlobs(const std::vector<Digest> &digests,
const OutputMap &outputs);
/**
* Given a list of digests, creates and sends a `FindMissingBlobsRequest`
* to the server.
*
* Returns a list of Digests that the remote server reports not having,
* or throws a runtime_exception if the request failed.
*/
std::vector<Digest> findMissingBlobs(const std::vector<Digest> &digests);
/**
* Uploads the contents of the given path.
*
* Returns a list of Digests that the remote server reports not having,
* or throws a runtime_exception if the request failed.
*
* If the optional `directory_digest` pointer is provided, the Digest of
* the uploaded directory is copied to it. Likewise for the `tree`
* pointer and the `Tree` object that is generated for the directory.
*/
std::vector<UploadResult>
uploadDirectory(const std::string &path,
Digest *directory_digest = nullptr, Tree *tree = nullptr);
/*
* Send a LocalCas protocol `CaptureTree()` request containing the given
* paths and the given property names. If successful, returns a
* `CaptureTreeResponse` object (it contains a Status for each path).
*
* If the request fails, throws an `std::runtime_exception`.
*/
CaptureTreeResponse captureTree(const std::vector<std::string> &paths,
const std::vector<std::string> &properties,
bool bypass_local_cache) const;
/*
* Send a LocalCas protocol `CaptureFiles()` request containing the given
* paths and the given property names. If successful, returns a
* `CaptureFilesResponse` object (it contains a Status for each path).
*
* If the request fails, throws an `std::runtime_exception`.
*/
CaptureFilesResponse
captureFiles(const std::vector<std::string> &paths,
const std::vector<std::string> &properties,
bool bypass_local_cache) const;
class StagedDirectory {
/*
* Represents a staged directory. It encapsulates the gRPC stream's
* status, keeping it open (and preventing the server from cleaning
* up).
*
* On destruction it sends an empty message to the server to clean up
* the directory.
*/
public:
explicit StagedDirectory(
std::shared_ptr<grpc::ClientContext> context,
std::shared_ptr<grpc::ClientReaderWriterInterface<
StageTreeRequest, StageTreeResponse>>
reader_writer,
const std::string &path);
~StagedDirectory();
// Do now allow making copies:
StagedDirectory(const StagedDirectory &) = delete;
StagedDirectory &operator=(const StagedDirectory &) = delete;
inline std::string path() const { return d_path; }
private:
const std::shared_ptr<grpc::ClientContext> d_context;
const std::shared_ptr<grpc::ClientReaderWriterInterface<
StageTreeRequest, StageTreeResponse>>
d_reader_writer;
const std::string d_path;
};
/**
* Stage a directory using the LocalCAS `Stage()` call.
*
* The `path` parameter is optional. If not provided, the server will
* assign a temporary directory.
*
* On success return a `unique_ptr` to a `StagedDirectory` object that when
* destructed will request the server to clean up.
*
* On error throw an `std::runtime_error` exception.
*/
std::unique_ptr<StagedDirectory> stage(const Digest &root_digest,
const std::string &path = "") const;
/**
* Get the Directory tree whose root digest is 'digest', using the CAS
* GetTree() call.
*
* On success, return a vector of protobuf Directory structures
*
* On error throw an 'std::runtime_error' exception
*/
std::vector<Directory> getTree(const Digest &digest);
/**
* Issue a LocalCAS `FetchTree()` call and return the response.
*
* That call will fetch the entire directory tree rooted at a node from a
* remote CAS to a local cache.
*
* The request is equivalent to `GetTree`, storing the `Directory`
* objects in the local cache. If `fetch_file_blobs` is set, it will also
* fetch all blobs referenced by the `Directory` objects (equivalent to
* `FetchMissingBlobs`).
*
* If no remote CAS is configured in the LocalCAS server, it will check
* presence of the entire directory tree (and optionally also file blobs)
* in its local cache.
*
* On errors throws `GrpcError`.
*/
FetchTreeResponse fetchTree(const Digest &digest,
const bool fetch_file_blobs);
/**
* Fetch the Protocol Buffer message of the given type and digest and
* deserialize it.
*/
template <typename Msg> inline Msg fetchMessage(const Digest &digest)
{
Msg result;
if (!result.ParseFromString(this->fetchString(digest))) {
throw std::runtime_error("Could not deserialize fetched message");
}
return result;
}
/**
* Upload the given Protocol Buffer message to CAS and return its
* Digest.
*/
template <typename Msg> inline Digest uploadMessage(const Msg &msg)
{
const std::string str = msg.SerializeAsString();
const Digest digest = CASHash::hash(str);
this->upload(str, digest);
return digest;
}
std::string instanceName() const;
void setInstanceName(const std::string &instance_name);
static size_t bytestreamChunkSizeBytes();
protected:
typedef std::function<void(const std::string &hash,
const std::string &data)>
WriteBlobCallback;
typedef std::pair<Digest, google::rpc::Status> DownloadResult;
typedef std::vector<DownloadResult> DownloadResults;
/* Download the digests in the specified list and invoke the
* `write_blob_callback` function after each blob is downloaded.
*
* If `temp_directory` is specified, each blob is written into
* a file in that directory and the filename is passed to
* `write_blob_callback` instead of the blob data. The specified
* directory must be empty.
*
* `throw_on_error` determines whether an `std::runtime_error`
* exception is to be raised on encountering an error during a
* download.
*
* Note: marked as `protected` to unit-test.
*/
DownloadResults downloadBlobs(const std::vector<Digest> &digests,
const WriteBlobCallback &write_blob_callback,
const std::string *temp_directory,
bool throw_on_error);
typedef std::function<void(const std::vector<Digest> &digest,
const OutputMap &outputs)>
download_callback_t;
typedef std::function<Directory(const Digest &digest)>
return_directory_callback_t;
void downloadDirectory(
const Digest &digest, const std::string &path,
const download_callback_t &download_callback,
const return_directory_callback_t &return_directory_callback);
/* Upload multiple digests in an efficient way, allowing each digest to
* potentially fail separately.
*
* Return a list containing the Digests that failed to be uploaded and the
* errors they received. (An empty result indicates that all digests were
* uploaded.)
*
* `throw_on_error` determines whether an `std::runtime_error`
* exception is to be raised on encountering an error during a
* download.
*
* Note: marked as `protected` to unit-test.
*/
std::vector<UploadResult>
uploadBlobs(const std::vector<UploadRequest> &requests,
const bool throw_on_error);
protected:
// initialized here to prevent errors, in case options are not passed into
// init; protected to allow setting by unit tests.
int d_grpcRetryLimit = 0;
int d_grpcRetryDelay = 100;
private:
std::shared_ptr<grpc::Channel> d_channel;
std::shared_ptr<ByteStream::StubInterface> d_bytestreamClient;
std::shared_ptr<ContentAddressableStorage::StubInterface> d_casClient;
std::shared_ptr<LocalContentAddressableStorage::StubInterface>
d_localCasClient;
std::shared_ptr<Capabilities::StubInterface> d_capabilitiesClient;
size_t d_maxBatchTotalSizeBytes;
std::string d_uuid;
std::string d_instanceName;
DigestGenerator d_digestGenerator;
RequestMetadataGenerator d_metadata_generator;
const std::function<void(grpc::ClientContext *)>
d_metadata_attach_function = [&](grpc::ClientContext *context) {
d_metadata_generator.attach_request_metadata(context);
};
// Maximum number of bytes that can be sent in a single gRPC message.
static const size_t s_bytestreamChunkSizeBytes;
std::string makeResourceName(const Digest &digest, bool is_upload);
/* Given a list of digests, download the data and return it in a map
* indexed by hash. Allow each digest to potentially fail separately.
*
* The returned map's values are pairs of (status, data) where the second
* component will be empty if the status contains an non-OK code.
*
* If `temp_directory` is specified, blobs are written to files in that
* directory and the second component of the returned map's values will be
* the path to the file. The specified directory must be empty.
*/
DownloadBlobsResult downloadBlobs(const std::vector<Digest> &digests,
const std::string *temp_directory);
/* Uploads the requests contained in the range [start_index,
* end_index).
*
* The sum of bytes of the data in this range MUST NOT exceed the
* maximum batch size request allowed.
*/
std::vector<UploadResult>
batchUpload(const std::vector<UploadRequest> &requests,
const size_t start_index, const size_t end_index);
/* Downloads the data for the Digests stored in the range
* [start_index, end_index) of the given vector.
*
* The sum of sizes inside the range MUST NOT exceed the maximum batch
* size request allowed.
*
* The `write_blob_function` callback will be invoked for each blob that is
* successfully fetched.
*
* Returns a map with the status code received for each Digest.
*/
DownloadResults batchDownload(const std::vector<Digest> &digests,
const size_t start_index,
const size_t end_index,
const WriteBlobCallback &write_blob_function,
const std::string *temp_directory = nullptr);
/* Given a list of digests sorted by increasing size, forms batches
* according to the value of `d_maxBatchTotalSizeBytes`.
*/
std::vector<std::pair<size_t, size_t>>
makeBatches(const std::vector<Digest> &digests);
/* Given a directory map, invoke `findMissingBlobs()` and return a map
* with the subset of protos that need to be uploaded.
*/
digest_string_map missingDigests(const digest_string_map &directory_map);
/* Upload a single request. */
void uploadRequest(const UploadRequest &request);
/*
* RequestMetadata values. They will be attached to requests sent by this
* client.
*/
ToolDetails d_tool_details;
std::string d_action_id;
std::string d_tool_invocation_id;
std::string d_correlated_invocations_id;
void issueRequestAndThrowOnErrors(
const buildboxcommon::GrpcRetrier::GrpcInvocation &invocation,
const std::string &invocationName) const;
GrpcRetrier makeRetrier(const GrpcRetrier::GrpcInvocation &invocation,
const std::string &name) const;
};
} // namespace buildboxcommon
#endif
| 37.90495 | 79 | 0.659753 |
583db99c7d8823d5d0ffa0644436468021a6adc7 | 772 | h | C | ios/OnTheWay/OnTheWay/Pages/AR/Model/OTWBusinessFetchModel.h | 1259416448/android | d95421e563a91b19fe8f499d46c613ecb89663f8 | [
"Unlicense"
] | null | null | null | ios/OnTheWay/OnTheWay/Pages/AR/Model/OTWBusinessFetchModel.h | 1259416448/android | d95421e563a91b19fe8f499d46c613ecb89663f8 | [
"Unlicense"
] | null | null | null | ios/OnTheWay/OnTheWay/Pages/AR/Model/OTWBusinessFetchModel.h | 1259416448/android | d95421e563a91b19fe8f499d46c613ecb89663f8 | [
"Unlicense"
] | 1 | 2019-09-28T02:01:12.000Z | 2019-09-28T02:01:12.000Z | //
// OTWBusinessFetchModel.h
// OnTheWay
//
// Created by 周扬扬 on 2017/8/25.
// Copyright © 2017年 WeiHuan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface OTWBusinessFetchModel : NSObject
@property (nonatomic,strong) NSString *name;
@property (nonatomic,strong) NSString *address;
@property (nonatomic,assign) double latitude;
@property (nonatomic,assign) double longitude;
//联系方式
@property (nonatomic,strong) NSString *contactInfo;
@property (nonatomic,strong) NSArray *typeIds;
@property (nonatomic,strong) NSString *poiDetailUrl;
@property (nonatomic,strong) NSString *poiUid;
//商家颜色值
@property (nonatomic,strong) NSString *colorCode;
//距离
@property (nonatomic,assign) double distance;
+ (id) initWithDict:(NSDictionary *)dict;
@end
| 21.444444 | 52 | 0.753886 |
180e027b1c8ad7b0d45b5c94293ca5e4996db095 | 11,978 | c | C | linux-socfpga/drivers/ssb/driver_gpio.c | AlbandeCrevoisier/ldd-athens | 93112a15ceac601c93e577ec16369ba7d3b6949e | [
"BSD-3-Clause"
] | null | null | null | linux-socfpga/drivers/ssb/driver_gpio.c | AlbandeCrevoisier/ldd-athens | 93112a15ceac601c93e577ec16369ba7d3b6949e | [
"BSD-3-Clause"
] | null | null | null | linux-socfpga/drivers/ssb/driver_gpio.c | AlbandeCrevoisier/ldd-athens | 93112a15ceac601c93e577ec16369ba7d3b6949e | [
"BSD-3-Clause"
] | null | null | null | /*
* Sonics Silicon Backplane
* GPIO driver
*
* Copyright 2011, Broadcom Corporation
* Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
*
* Licensed under the GNU/GPL. See COPYING for details.
*/
#include <linux/gpio/driver.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/irqdomain.h>
#include <linux/export.h>
#include <linux/ssb/ssb.h>
#include "ssb_private.h"
/**************************************************
* Shared
**************************************************/
#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
static int ssb_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
if (bus->bustype == SSB_BUSTYPE_SSB)
return irq_find_mapping(bus->irq_domain, gpio);
else
return -EINVAL;
}
#endif
/**************************************************
* ChipCommon
**************************************************/
static int ssb_gpio_chipco_get_value(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
return !!ssb_chipco_gpio_in(&bus->chipco, 1 << gpio);
}
static void ssb_gpio_chipco_set_value(struct gpio_chip *chip, unsigned gpio,
int value)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_chipco_gpio_out(&bus->chipco, 1 << gpio, value ? 1 << gpio : 0);
}
static int ssb_gpio_chipco_direction_input(struct gpio_chip *chip,
unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_chipco_gpio_outen(&bus->chipco, 1 << gpio, 0);
return 0;
}
static int ssb_gpio_chipco_direction_output(struct gpio_chip *chip,
unsigned gpio, int value)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_chipco_gpio_outen(&bus->chipco, 1 << gpio, 1 << gpio);
ssb_chipco_gpio_out(&bus->chipco, 1 << gpio, value ? 1 << gpio : 0);
return 0;
}
static int ssb_gpio_chipco_request(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_chipco_gpio_control(&bus->chipco, 1 << gpio, 0);
/* clear pulldown */
ssb_chipco_gpio_pulldown(&bus->chipco, 1 << gpio, 0);
/* Set pullup */
ssb_chipco_gpio_pullup(&bus->chipco, 1 << gpio, 1 << gpio);
return 0;
}
static void ssb_gpio_chipco_free(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
/* clear pullup */
ssb_chipco_gpio_pullup(&bus->chipco, 1 << gpio, 0);
}
#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
static void ssb_gpio_irq_chipco_mask(struct irq_data *d)
{
struct ssb_bus *bus = irq_data_get_irq_chip_data(d);
int gpio = irqd_to_hwirq(d);
ssb_chipco_gpio_intmask(&bus->chipco, BIT(gpio), 0);
}
static void ssb_gpio_irq_chipco_unmask(struct irq_data *d)
{
struct ssb_bus *bus = irq_data_get_irq_chip_data(d);
int gpio = irqd_to_hwirq(d);
u32 val = ssb_chipco_gpio_in(&bus->chipco, BIT(gpio));
ssb_chipco_gpio_polarity(&bus->chipco, BIT(gpio), val);
ssb_chipco_gpio_intmask(&bus->chipco, BIT(gpio), BIT(gpio));
}
static struct irq_chip ssb_gpio_irq_chipco_chip = {
.name = "SSB-GPIO-CC",
.irq_mask = ssb_gpio_irq_chipco_mask,
.irq_unmask = ssb_gpio_irq_chipco_unmask,
};
static irqreturn_t ssb_gpio_irq_chipco_handler(int irq, void *dev_id)
{
struct ssb_bus *bus = dev_id;
struct ssb_chipcommon *chipco = &bus->chipco;
u32 val = chipco_read32(chipco, SSB_CHIPCO_GPIOIN);
u32 mask = chipco_read32(chipco, SSB_CHIPCO_GPIOIRQ);
u32 pol = chipco_read32(chipco, SSB_CHIPCO_GPIOPOL);
unsigned long irqs = (val ^ pol) & mask;
int gpio;
if (!irqs)
return IRQ_NONE;
for_each_set_bit(gpio, &irqs, bus->gpio.ngpio)
generic_handle_irq(ssb_gpio_to_irq(&bus->gpio, gpio));
ssb_chipco_gpio_polarity(chipco, irqs, val & irqs);
return IRQ_HANDLED;
}
static int ssb_gpio_irq_chipco_domain_init(struct ssb_bus *bus)
{
struct ssb_chipcommon *chipco = &bus->chipco;
struct gpio_chip *chip = &bus->gpio;
int gpio, hwirq, err;
if (bus->bustype != SSB_BUSTYPE_SSB)
return 0;
bus->irq_domain = irq_domain_add_linear(NULL, chip->ngpio,
&irq_domain_simple_ops, chipco);
if (!bus->irq_domain) {
err = -ENODEV;
goto err_irq_domain;
}
for (gpio = 0; gpio < chip->ngpio; gpio++) {
int irq = irq_create_mapping(bus->irq_domain, gpio);
irq_set_chip_data(irq, bus);
irq_set_chip_and_handler(irq, &ssb_gpio_irq_chipco_chip,
handle_simple_irq);
}
hwirq = ssb_mips_irq(bus->chipco.dev) + 2;
err = request_irq(hwirq, ssb_gpio_irq_chipco_handler, IRQF_SHARED,
"gpio", bus);
if (err)
goto err_req_irq;
ssb_chipco_gpio_intmask(&bus->chipco, ~0, 0);
chipco_set32(chipco, SSB_CHIPCO_IRQMASK, SSB_CHIPCO_IRQ_GPIO);
return 0;
err_req_irq:
for (gpio = 0; gpio < chip->ngpio; gpio++) {
int irq = irq_find_mapping(bus->irq_domain, gpio);
irq_dispose_mapping(irq);
}
irq_domain_remove(bus->irq_domain);
err_irq_domain:
return err;
}
static void ssb_gpio_irq_chipco_domain_exit(struct ssb_bus *bus)
{
struct ssb_chipcommon *chipco = &bus->chipco;
struct gpio_chip *chip = &bus->gpio;
int gpio;
if (bus->bustype != SSB_BUSTYPE_SSB)
return;
chipco_mask32(chipco, SSB_CHIPCO_IRQMASK, ~SSB_CHIPCO_IRQ_GPIO);
free_irq(ssb_mips_irq(bus->chipco.dev) + 2, chipco);
for (gpio = 0; gpio < chip->ngpio; gpio++) {
int irq = irq_find_mapping(bus->irq_domain, gpio);
irq_dispose_mapping(irq);
}
irq_domain_remove(bus->irq_domain);
}
#else
static int ssb_gpio_irq_chipco_domain_init(struct ssb_bus *bus)
{
return 0;
}
static void ssb_gpio_irq_chipco_domain_exit(struct ssb_bus *bus)
{
}
#endif
static int ssb_gpio_chipco_init(struct ssb_bus *bus)
{
struct gpio_chip *chip = &bus->gpio;
int err;
chip->label = "ssb_chipco_gpio";
chip->owner = THIS_MODULE;
chip->request = ssb_gpio_chipco_request;
chip->free = ssb_gpio_chipco_free;
chip->get = ssb_gpio_chipco_get_value;
chip->set = ssb_gpio_chipco_set_value;
chip->direction_input = ssb_gpio_chipco_direction_input;
chip->direction_output = ssb_gpio_chipco_direction_output;
#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
chip->to_irq = ssb_gpio_to_irq;
#endif
chip->ngpio = 16;
/* There is just one SoC in one device and its GPIO addresses should be
* deterministic to address them more easily. The other buses could get
* a random base number. */
if (bus->bustype == SSB_BUSTYPE_SSB)
chip->base = 0;
else
chip->base = -1;
err = ssb_gpio_irq_chipco_domain_init(bus);
if (err)
return err;
err = gpiochip_add_data(chip, bus);
if (err) {
ssb_gpio_irq_chipco_domain_exit(bus);
return err;
}
return 0;
}
/**************************************************
* EXTIF
**************************************************/
#ifdef CONFIG_SSB_DRIVER_EXTIF
static int ssb_gpio_extif_get_value(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
return !!ssb_extif_gpio_in(&bus->extif, 1 << gpio);
}
static void ssb_gpio_extif_set_value(struct gpio_chip *chip, unsigned gpio,
int value)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_extif_gpio_out(&bus->extif, 1 << gpio, value ? 1 << gpio : 0);
}
static int ssb_gpio_extif_direction_input(struct gpio_chip *chip,
unsigned gpio)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_extif_gpio_outen(&bus->extif, 1 << gpio, 0);
return 0;
}
static int ssb_gpio_extif_direction_output(struct gpio_chip *chip,
unsigned gpio, int value)
{
struct ssb_bus *bus = gpiochip_get_data(chip);
ssb_extif_gpio_outen(&bus->extif, 1 << gpio, 1 << gpio);
ssb_extif_gpio_out(&bus->extif, 1 << gpio, value ? 1 << gpio : 0);
return 0;
}
#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
static void ssb_gpio_irq_extif_mask(struct irq_data *d)
{
struct ssb_bus *bus = irq_data_get_irq_chip_data(d);
int gpio = irqd_to_hwirq(d);
ssb_extif_gpio_intmask(&bus->extif, BIT(gpio), 0);
}
static void ssb_gpio_irq_extif_unmask(struct irq_data *d)
{
struct ssb_bus *bus = irq_data_get_irq_chip_data(d);
int gpio = irqd_to_hwirq(d);
u32 val = ssb_extif_gpio_in(&bus->extif, BIT(gpio));
ssb_extif_gpio_polarity(&bus->extif, BIT(gpio), val);
ssb_extif_gpio_intmask(&bus->extif, BIT(gpio), BIT(gpio));
}
static struct irq_chip ssb_gpio_irq_extif_chip = {
.name = "SSB-GPIO-EXTIF",
.irq_mask = ssb_gpio_irq_extif_mask,
.irq_unmask = ssb_gpio_irq_extif_unmask,
};
static irqreturn_t ssb_gpio_irq_extif_handler(int irq, void *dev_id)
{
struct ssb_bus *bus = dev_id;
struct ssb_extif *extif = &bus->extif;
u32 val = ssb_read32(extif->dev, SSB_EXTIF_GPIO_IN);
u32 mask = ssb_read32(extif->dev, SSB_EXTIF_GPIO_INTMASK);
u32 pol = ssb_read32(extif->dev, SSB_EXTIF_GPIO_INTPOL);
unsigned long irqs = (val ^ pol) & mask;
int gpio;
if (!irqs)
return IRQ_NONE;
for_each_set_bit(gpio, &irqs, bus->gpio.ngpio)
generic_handle_irq(ssb_gpio_to_irq(&bus->gpio, gpio));
ssb_extif_gpio_polarity(extif, irqs, val & irqs);
return IRQ_HANDLED;
}
static int ssb_gpio_irq_extif_domain_init(struct ssb_bus *bus)
{
struct ssb_extif *extif = &bus->extif;
struct gpio_chip *chip = &bus->gpio;
int gpio, hwirq, err;
if (bus->bustype != SSB_BUSTYPE_SSB)
return 0;
bus->irq_domain = irq_domain_add_linear(NULL, chip->ngpio,
&irq_domain_simple_ops, extif);
if (!bus->irq_domain) {
err = -ENODEV;
goto err_irq_domain;
}
for (gpio = 0; gpio < chip->ngpio; gpio++) {
int irq = irq_create_mapping(bus->irq_domain, gpio);
irq_set_chip_data(irq, bus);
irq_set_chip_and_handler(irq, &ssb_gpio_irq_extif_chip,
handle_simple_irq);
}
hwirq = ssb_mips_irq(bus->extif.dev) + 2;
err = request_irq(hwirq, ssb_gpio_irq_extif_handler, IRQF_SHARED,
"gpio", bus);
if (err)
goto err_req_irq;
ssb_extif_gpio_intmask(&bus->extif, ~0, 0);
return 0;
err_req_irq:
for (gpio = 0; gpio < chip->ngpio; gpio++) {
int irq = irq_find_mapping(bus->irq_domain, gpio);
irq_dispose_mapping(irq);
}
irq_domain_remove(bus->irq_domain);
err_irq_domain:
return err;
}
static void ssb_gpio_irq_extif_domain_exit(struct ssb_bus *bus)
{
struct ssb_extif *extif = &bus->extif;
struct gpio_chip *chip = &bus->gpio;
int gpio;
if (bus->bustype != SSB_BUSTYPE_SSB)
return;
free_irq(ssb_mips_irq(bus->extif.dev) + 2, extif);
for (gpio = 0; gpio < chip->ngpio; gpio++) {
int irq = irq_find_mapping(bus->irq_domain, gpio);
irq_dispose_mapping(irq);
}
irq_domain_remove(bus->irq_domain);
}
#else
static int ssb_gpio_irq_extif_domain_init(struct ssb_bus *bus)
{
return 0;
}
static void ssb_gpio_irq_extif_domain_exit(struct ssb_bus *bus)
{
}
#endif
static int ssb_gpio_extif_init(struct ssb_bus *bus)
{
struct gpio_chip *chip = &bus->gpio;
int err;
chip->label = "ssb_extif_gpio";
chip->owner = THIS_MODULE;
chip->get = ssb_gpio_extif_get_value;
chip->set = ssb_gpio_extif_set_value;
chip->direction_input = ssb_gpio_extif_direction_input;
chip->direction_output = ssb_gpio_extif_direction_output;
#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
chip->to_irq = ssb_gpio_to_irq;
#endif
chip->ngpio = 5;
/* There is just one SoC in one device and its GPIO addresses should be
* deterministic to address them more easily. The other buses could get
* a random base number. */
if (bus->bustype == SSB_BUSTYPE_SSB)
chip->base = 0;
else
chip->base = -1;
err = ssb_gpio_irq_extif_domain_init(bus);
if (err)
return err;
err = gpiochip_add_data(chip, bus);
if (err) {
ssb_gpio_irq_extif_domain_exit(bus);
return err;
}
return 0;
}
#else
static int ssb_gpio_extif_init(struct ssb_bus *bus)
{
return -ENOTSUPP;
}
#endif
/**************************************************
* Init
**************************************************/
int ssb_gpio_init(struct ssb_bus *bus)
{
if (ssb_chipco_available(&bus->chipco))
return ssb_gpio_chipco_init(bus);
else if (ssb_extif_available(&bus->extif))
return ssb_gpio_extif_init(bus);
else
SSB_WARN_ON(1);
return -1;
}
int ssb_gpio_unregister(struct ssb_bus *bus)
{
if (ssb_chipco_available(&bus->chipco) ||
ssb_extif_available(&bus->extif)) {
gpiochip_remove(&bus->gpio);
return 0;
} else {
SSB_WARN_ON(1);
}
return -1;
}
| 24.902287 | 76 | 0.704625 |
1207b9892d576fe71b4eb0161ee7b4a59975331e | 159 | h | C | project860/src/component1078/headers/component1078/lib142.h | gradle/perf-native-large | af00fd258fbe9c7d274f386e46847fe12062cc71 | [
"Apache-2.0"
] | 2 | 2016-11-23T17:25:24.000Z | 2016-11-23T17:25:27.000Z | project860/src/component1078/headers/component1078/lib142.h | gradle/perf-native-large | af00fd258fbe9c7d274f386e46847fe12062cc71 | [
"Apache-2.0"
] | 15 | 2016-09-15T03:19:32.000Z | 2016-09-17T09:15:32.000Z | project860/src/component1078/headers/component1078/lib142.h | gradle/perf-native-large | af00fd258fbe9c7d274f386e46847fe12062cc71 | [
"Apache-2.0"
] | 2 | 2019-11-09T16:26:55.000Z | 2021-01-13T10:51:09.000Z | #ifndef PROJECT_HEADER_component1078_142_H
#define PROJECT_HEADER_component1078_142_H
int component1078_142();
#endif // PROJECT_HEADER_component1078_142_H | 19.875 | 44 | 0.874214 |
4b396c92c703c38b06b4bfe513ace99d058a6e8f | 36,050 | c | C | engine/source/fileio/shd.c | pixeljetstream/luxinia1 | 5d69b2d47d5ed4501dc155cfef999475f2fdfe2a | [
"Unlicense",
"MIT"
] | 31 | 2015-01-05T18:22:15.000Z | 2020-12-07T03:21:50.000Z | engine/source/fileio/shd.c | pixeljetstream/luxinia1 | 5d69b2d47d5ed4501dc155cfef999475f2fdfe2a | [
"Unlicense",
"MIT"
] | null | null | null | engine/source/fileio/shd.c | pixeljetstream/luxinia1 | 5d69b2d47d5ed4501dc155cfef999475f2fdfe2a | [
"Unlicense",
"MIT"
] | 12 | 2015-01-05T19:17:44.000Z | 2021-01-15T08:56:06.000Z | // Copyright (C) 2004-2011 Christoph Kubisch & Eike Decker
// This file is part of the "Luxinia Engine".
// For conditions of distribution and use, see luxinia.h
#include "../common/vid.h"
#include "shd.h"
#include "../common/3dmath.h"
#include "../render/gl_render.h"
#include "../render/gl_list3d.h"
#include "../resource/resmanager.h"
#include "../fileio/filesystem.h"
void fileLoadSHDRFlag();
void fileLoadSHDNPass();
void fileLoadSHDColor();
void fileLoadSHDTex();
void fileLoadSHDGPU();
void ShaderBuildFromBuffer(Shader_t *shader);
#define BUFFERSTAGES (128)
static struct SHDData_s{
Shader_t *shader;
ShaderStage_t *stage;
ShaderStage_t *stagesColor;
ShaderStage_t *stagesTex[BUFFERSTAGES];
VID_Technique_t tech;
int stagesColorInBuffer;
int stagesTexInBuffer;
int stagesTexGpuInBuffer;
int lastVColorStage;
int stagesGpuInBuffer;
int bumpStage;
int colorStage;
int version;
int cgmode;
lxFSFile_t *file;
} l_SHDData;
static int SHD_technique(char* buf)
{
char src[256];
int tex4 = LUX_FALSE;
sscanf(buf,"Technique:%s",&src);
if (src[strlen(src)-1] == '{')
src[strlen(src)-1] = 0;
// already defined before, we are done
if (l_SHDData.tech)
return LUX_FALSE;
if (strcmp(src,"VID_DEFAULT")== 0)
l_SHDData.tech = VID_T_DEFAULT;
else if (strcmp(src,"VID_LOWDETAIL")== 0)
l_SHDData.tech = VID_T_LOWDETAIL;
else if (strcmp(src,"VID_ARB_TEXCOMB_TEX4")== 0){
l_SHDData.tech = VID_T_ARB_TEXCOMB; tex4 = LUX_TRUE;}
else if (strcmp(src,"VID_ARB_V_TEX4")== 0){
l_SHDData.tech = VID_T_ARB_V; tex4 = LUX_TRUE;}
else if (strcmp(src,"VID_ARB_VF_TEX4")== 0){
l_SHDData.tech = VID_T_ARB_VF; tex4 = LUX_TRUE;}
else if (strcmp(src,"VID_ARB_VF_TEX8")== 0)
l_SHDData.tech = VID_T_ARB_VF_TEX8;
else if (strcmp(src,"VID_CG_SM3_TEX8")== 0)
l_SHDData.tech = VID_T_CG_SM3;
else if (strcmp(src,"VID_CG_SM3")== 0)
l_SHDData.tech = VID_T_CG_SM3;
else if (strcmp(src,"VID_CG_SM4")== 0)
l_SHDData.tech = VID_T_CG_SM4;
else if (strcmp(src,"VID_CG_SM4")== 0)
l_SHDData.tech = VID_T_CG_SM4_GS;
else if (strcmp(src,"VID_ARB_VF")== 0)
l_SHDData.tech = VID_T_ARB_VF;
else if (strcmp(src,"VID_ARB_V")== 0)
l_SHDData.tech = VID_T_ARB_V;
else if (strcmp(src,"VID_ARB_TEXCOMB")== 0)
l_SHDData.tech = VID_T_ARB_TEXCOMB;
if (l_SHDData.tech > g_VID.capTech || (tex4 && g_VID.capTexUnits < 4)){
l_SHDData.tech = VID_T_UNSET;
return LUX_FALSE;
}
else{
return LUX_TRUE;
}
}
static int SHD_texture(char *name)
{
if(l_SHDData.stagesTexInBuffer < VID_MAX_SHADER_STAGES && l_SHDData.stagesTexGpuInBuffer < BUFFERSTAGES){
fileLoadSHDTex();
l_SHDData.shader->numStages++;
l_SHDData.stagesTexGpuInBuffer++;
l_SHDData.stagesTexInBuffer++;
}
else lprintf("WARNING shdload: too many tex/gpu stages\n");
return LUX_FALSE;
}
static int SHD_gpu(char *name)
{
if (l_SHDData.tech <= VID_T_DEFAULT || l_SHDData.tech == VID_T_LOWDETAIL)
return LUX_FALSE;
if(l_SHDData.stagesTexGpuInBuffer < BUFFERSTAGES){
int error = LUX_FALSE;
fileLoadSHDGPU();
switch (l_SHDData.stage->srcType){
case GPUPROG_F_CG:
case GPUPROG_F_ARB:
if (l_SHDData.tech < VID_T_ARB_VF)
error = LUX_TRUE;
break;
case GPUPROG_G_CG:
if (l_SHDData.tech < VID_T_CG_SM4_GS)
error = LUX_TRUE;
break;
default:
break;
}
// must not mix ARB and CG
if ( GPUPROG_IS_CG(l_SHDData.stage->srcType) && l_SHDData.cgmode == SHADER_PASSMODE_FIXEDARB){
lprintf("ERROR shdload: Must not mix ARB/FIXED and Cg GpuPrograms\n");
error = LUX_TRUE;
}
else if ( !GPUPROG_IS_CG(l_SHDData.stage->srcType) && l_SHDData.cgmode == SHADER_PASSMODE_CG){
lprintf("ERROR shdload: Must not mix ARB/FIXED and Cg GpuPrograms\n");
error = LUX_TRUE;
}
// set cg mode if unset
if (l_SHDData.cgmode == -1)
l_SHDData.cgmode = GPUPROG_IS_CG(l_SHDData.stage->srcType) ? SHADER_PASSMODE_CG : SHADER_PASSMODE_FIXEDARB;
if ( GPUPROG_IS_CG(l_SHDData.stage->srcType) && l_SHDData.version < SHD_VER_CGLOADER)
{
lprintf("ERROR shdload: SHD version too old for Cg, required: %d\n",SHD_VER_CGLOADER);
error = LUX_TRUE;
}
if (error){
lprintf("ERROR shdload: wrong gpu program for picked technique/version \n");
}
else {
l_SHDData.shader->numStages++;
l_SHDData.stagesTexGpuInBuffer++;
l_SHDData.stagesGpuInBuffer++;
}
}
return LUX_FALSE;
}
static int SHD_color(char *name)
{
if(l_SHDData.stagesColorInBuffer < 1){
fileLoadSHDColor();
l_SHDData.shader->numStages++;
l_SHDData.stagesColorInBuffer++;
}
else lprintf("WARNING shdload: too many color stages\n");
return LUX_FALSE;
}
static int SHD_rflag(char *name)
{
fileLoadSHDRFlag();
return LUX_FALSE;
}
static int SHD_newpass(char *name)
{
if(l_SHDData.stagesTexGpuInBuffer < BUFFERSTAGES){
fileLoadSHDNPass();
l_SHDData.shader->numStages++;
l_SHDData.stagesTexGpuInBuffer++;
}
else lprintf("WARNING shdload: too many tex/gpu stages\n");
return LUX_FALSE;
}
static FileParseDef_t l_defSHD[]=
{
{"IF:", LUX_FALSE,LUX_FALSE,LUX_FALSE, NULL},
{"ELSEIF:", LUX_FALSE,LUX_FALSE,LUX_FALSE, NULL},
{"ELSE", LUX_FALSE,LUX_FALSE,LUX_FALSE, NULL},
{"<<_", LUX_FALSE,LUX_FALSE,LUX_FALSE, NULL},
{"Technique:", LUX_TRUE,LUX_FALSE,LUX_FALSE, SHD_technique},
{"RenderFlag", LUX_FALSE,LUX_TRUE,LUX_FALSE, SHD_rflag},
{"NewPass", LUX_FALSE,LUX_TRUE,LUX_FALSE, SHD_newpass},
{"DrawPass", LUX_FALSE,LUX_TRUE,LUX_FALSE, SHD_newpass},
{"Color", LUX_FALSE,LUX_TRUE,LUX_TRUE, SHD_color},
{"Texture", LUX_FALSE,LUX_TRUE,LUX_TRUE, SHD_texture},
{"GpuProgram", LUX_FALSE,LUX_TRUE,LUX_FALSE, SHD_gpu},
{NULL, LUX_FALSE,LUX_FALSE,LUX_FALSE,NULL},
};
int fileLoadSHD(const char *filename,Shader_t *shader,void *unused)
{
lxFSFile_t * fSHD;
char buf[1024];
fSHD = FS_open(filename);
l_SHDData.file = fSHD;
l_SHDData.shader = shader;
lprintf("Shader: \t%s\n",filename);
if(fSHD == NULL)
{
lprintf("ERROR shdload: ");
lnofile(filename);
return LUX_FALSE;
}
lxFS_gets(buf, 255, fSHD);
if (!sscanf(buf,SHD_HEADER,&l_SHDData.version) || l_SHDData.version < SHD_VER_MINIMUM)
{
// wrong header
lprintf("ERROR shdload: invalid file format or version\n");
FS_close(fSHD);
return LUX_FALSE;
}
l_SHDData.cgmode = -1;
shader->numStages = 0;
l_SHDData.stagesColorInBuffer = 0;
l_SHDData.stagesTexInBuffer = 0;
l_SHDData.stagesTexGpuInBuffer = 0;
l_SHDData.lastVColorStage = 0;
l_SHDData.stagesGpuInBuffer = 0;
l_SHDData.bumpStage = -1;
l_SHDData.tech = VID_T_UNSET;
clearArray(l_SHDData.stagesTex,BUFFERSTAGES);
l_SHDData.stagesColor = NULL;
FileParse_setAnnotationList(&l_SHDData.shader->annotationListHead);
FileParse_start(fSHD,l_defSHD);
if (!l_SHDData.stagesTexGpuInBuffer && !l_SHDData.stagesColorInBuffer){
lprintf("WARNING shdload: no stages defined\n");
FS_close (fSHD);
return LUX_FALSE;
}
shader->tech = l_SHDData.tech;
ShaderBuildFromBuffer(shader);
dlprintf("\tColors: %d Textures: %d\n",l_SHDData.stagesColorInBuffer,l_SHDData.stagesTexGpuInBuffer);
FS_close (fSHD);
return LUX_TRUE;
}
// RFlag
// -----
void loadRFlag(void * target,char * command, char* rest)
{
char buffer[1000];
int bufferpos=0,restpos=0;
Shader_t *shader = (Shader_t*)target;
if (strcmp(command,"nocolorarray")==0) {
shader->renderflag |= RENDER_NOVERTEXCOLOR;
return;
}
if (strcmp(command,"normals")==0) {
shader->shaderflag |= SHADER_NORMALS;
return;
}
if (strcmp(command,"nocull")==0) {
shader->renderflag |= RENDER_NOCULL;
return;
}
if (strcmp(command,"sunlit")==0) {
shader->renderflag |= RENDER_SUNLIT;
return;
}
if (strcmp(command,"unlit")==0) {
shader->renderflag |= RENDER_UNLIT;
return;
}
if (strcmp(command,"nodepthmask")==0) {
shader->renderflag |= RENDER_NODEPTHMASK;
return;
}
if (strcmp(command,"nodepthtest")==0) {
shader->renderflag |= RENDER_NODEPTHTEST;
return;
}
if (strcmp(command,"alphamask")==0) {
shader->renderflag |= RENDER_ALPHATEST;
if (shader->alpha == NULL){
shader->alpha = reszalloc(sizeof(VIDAlpha_t));
shader->alpha->alphafunc = GL_GREATER;
shader->alpha->alphaval = 0;
}
return;
}
if (strcmp(command,"alphaTEX")==0){
char name[256];
const char *next = lxStrReadInQuotes(rest, name, 255);
shader->alphatex = reszalloc(sizeof(ShaderAlphaTex_t));
shader->alphatex->srcType = TEX_COLOR;
shader->alphatex->srcAttributes = TEX_ATTR_MIPMAP;
if (strstr(name,".")==NULL){
if (sscanf(name,"Texture:%i",&shader->alphatex->id)){
shader->alphatex->id += MATERIAL_TEX0;
}
}
else{
resnewstrcpy(shader->alphatex->srcName,name);
}
sscanf(next,"%d",&shader->alphatex->texchannel);
return;
}
if (strcmp(command,"layer")==0) {
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
shader->layer = 0;
if(sscanf(buffer,"%d",&shader->layer))
shader->layer++;
return;
}
if (strcmp(command,"alphafunc")==0) {
char src[100];
float alphaval;
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
if (sscanf(buffer,"%s (%f)",&src,&alphaval) == 2){
GLenum alphafunc = 0;
if (strcmp(src,"GL_NEVER")==0)
alphafunc = GL_NEVER;
else if (strcmp(src,"GL_ALWAYS")==0)
alphafunc = GL_ALWAYS;
else if (strcmp(src,"GL_LESS")==0)
alphafunc = GL_LESS;
else if (strcmp(src,"GL_LEQUAL")==0)
alphafunc = GL_LEQUAL;
else if (strcmp(src,"GL_GEQUAL")==0)
alphafunc = GL_GEQUAL;
else if (strcmp(src,"GL_GREATER")==0)
alphafunc = GL_GREATER;
else if (strcmp(src,"GL_EQUAL")==0)
alphafunc = GL_EQUAL;
else if (strcmp(src,"GL_NOTEQUAL")==0)
alphafunc = GL_NOTEQUAL;
if (alphafunc){
if (shader->alpha== NULL){
shader->alpha = reszalloc(sizeof(VIDAlpha_t));
}
shader->alpha->alphafunc = alphafunc;
shader->alpha->alphaval = alphaval;
shader->renderflag |= RENDER_ALPHATEST;
}
}
return;
}
if (strcmp(command,"blendmode")==0) {
char src[100];
char dst[100];
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
shader->renderflag |= RENDER_BLEND;
if (sscanf(buffer,"%s",&src,&dst)){
VIDBlendColor_t blendmode = VID_UNSET;
if (strcmp(src,"VID_MODULATE")==0)
blendmode = VID_MODULATE;
else if (strcmp(src,"VID_MODULATE2")==0)
blendmode = VID_MODULATE2;
else if (strcmp(src,"VID_DECAL")==0)
blendmode = VID_DECAL;
else if (strcmp(src,"VID_ADD")==0)
blendmode = VID_ADD;
else if (strcmp(src,"VID_AMODADD")==0)
blendmode = VID_AMODADD;
if (blendmode){
if (shader->blend== NULL){
shader->blend = reszalloc(sizeof(VIDBlend_t));
}
shader->blend->blendmode = GL_GREATER;
}
}
return;
}
if (strcmp(command,"blendinvertalpha")== 0){
if (shader->blend)
shader->blend->blendinvert = LUX_TRUE;
return;
}
}
void fileLoadSHDRFlag()
{
static char *words[100]={ "sunlit","unlit","nocull","nodepthmask","nodepthtest","lookat","layer",
"alphamask","alphafunc","nocolorarray","alphaTEX","normals","blendmode","blendinvertalpha","\0"};
FileParse_stage(l_SHDData.file,words,loadRFlag,l_SHDData.shader);
}
// Blend
// -----
void loadBlend(void *target,char * command, char* rest){
char buffer[1024];
int bufferpos=0,restpos=0;
ShaderStage_t *stage = l_SHDData.stage;
if (strcmp(command,"blendmode")==0) {
char src[256] = {0};
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
sscanf(buffer,"%s",&src);
if (strstr(src,VID_TEXCOMBSTRING))
stage->blendmode = VIDTexCombiner_genFromString(LUX_FALSE,src);
else
stage->blendmode = VIDBlendColor_fromString(src);
// default/correct
if (!stage->blendmode)
stage->blendmode = VID_MODULATE;
else if (stage->blendmode == VID_AMODADD_CONSTMOD && !GLEW_NV_texture_env_combine4 && !GLEW_ARB_texture_env_crossbar){
bprintf("WARNING: Blendmode %s not supported, reverting to %s\n",VIDBlendColor_toString(VID_AMODADD_CONSTMOD),VIDBlendColor_toString(VID_AMODADD));
stage->blendmode = VID_AMODADD;
}
else if (stage->blendmode == VID_DECAL_CONSTMOD && !GLEW_NV_texture_env_combine4 && !GLEW_ARB_texture_env_crossbar){
bprintf("WARNING: Blendmode %s not supported, reverting to %s\n",VIDBlendColor_toString(VID_DECAL_CONSTMOD),VIDBlendColor_toString(VID_DECAL));
stage->blendmode = VID_DECAL;
}
return;
}
if (strcmp(command,"alphamode")==0) {
char src[100];
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
sscanf(buffer,"%s",&src);
if (strstr(src,VID_TEXCOMBSTRING))
stage->alphamode = VIDTexCombiner_genFromString(LUX_TRUE,src);
else
stage->alphamode = VIDBlendAlpha_fromString(src);
return;
}
if (strcmp(command,"blendinvertalpha")== 0){
stage->stageflag |= SHADER_INVALPHA;
}
}
//////////////////////////////////////////////////////////////////////////
// NEW PASS
void loadNPass(void * target,char * command, char* rest)
{
char buffer[1000] = {0};
int bufferpos=0,restpos=0;
if (strcmp(command,"blendmode")==0 || strcmp(command,"blendinvertalpha")==0){
loadBlend(target,command,rest);
return;
}
if (strcmp(command,"colorpass")==0){
l_SHDData.stage->stagetype = SHADER_STAGE_COLORPASS;
return;
}
if (strcmp(command,"stateflag")==0) {
char src[100] = {0};
booln state = 0;
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
if(sscanf(buffer,"%s %d",&src,&state)==2){
enum32 rf = 0;
if (strcmp(src,"RENDER_BLEND")==0)
rf = RENDER_BLEND;
else if (strcmp(src,"RENDER_NOVERTEXCOLOR")==0)
rf = RENDER_NOVERTEXCOLOR;
else if (strcmp(src,"RENDER_ALPHATEST")==0)
rf = RENDER_ALPHATEST;
else if (strcmp(src,"RENDER_STENCILTEST")==0)
rf = RENDER_STENCILTEST;
else if (strcmp(src,"RENDER_NODEPTHTEST")==0)
rf = RENDER_NODEPTHTEST;
else if (strcmp(src,"RENDER_NOCULL")==0)
rf = RENDER_NOCULL;
else if (strcmp(src,"RENDER_FRONTCULL")==0)
rf = RENDER_FRONTCULL;
else if (strcmp(src,"RENDER_NOCOLORMASK")==0)
rf = RENDER_NOCOLORMASK;
else if (strcmp(src,"RENDER_NODEPTHMASK")==0)
rf = RENDER_NODEPTHMASK;
else if (strcmp(src,"RENDER_STENCILMASK")==0)
rf = RENDER_STENCILMASK;
else if (strcmp(src,"RENDER_LIT")==0)
rf = RENDER_LIT;
if (state)
l_SHDData.stage->rflagson |= rf;
else
l_SHDData.stage->rflagsoff |= rf;
}
return;
}
}
void fileLoadSHDNPass()
{
static char *words[100]={ "colorpass",
"blendmode","blendinvertalpha",
"stateflag",
"\0"};
ShaderStage_t *stage;
if (!l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer])
l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer] =reszalloc(sizeof(ShaderStage_t));
stage = l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer];
l_SHDData.shader->shaderflag |= SHADER_NOCOMPILE;
ShaderStage_clear(stage);
stage->stagetype = SHADER_STAGE_NEWPASS;
stage->blendmode = VID_UNSET;
l_SHDData.stage = stage;
FileParse_stage(l_SHDData.file,words,loadNPass,NULL);
if (stage->blendmode == VID_UNSET){
lprintf("WARNING shdload: stageblend UNSET after first stage, MODULATE instead\n");
stage->blendmode = VID_MODULATE;
}
}
// Color
// -----
void loadColor(void * target,char * command, char* rest)
{
ShaderStage_t *stage = l_SHDData.stage;
if (strcmp(command,"blendmode")==0 || strcmp(command,"blendinvertalpha")==0){
loadBlend(target,command,rest);
return;
}
// Generic
if (strcmp(command,"RGBA")==0) {
char name[256];
lxStrReadInQuotes(rest, name, 255);
if (sscanf(name,"Color:%i",&stage->id)){
stage->id += MATERIAL_COLOR0;
stage->colorid = stage->id;
}
return;
}
}
void fileLoadSHDColor()
{
static char *words[100]={ "RGBA","blendmode","blendinvertalpha","\0"};
ShaderStage_t *stage;
if (!l_SHDData.stagesColor)
l_SHDData.stagesColor =reszalloc(sizeof(ShaderStage_t));
stage = l_SHDData.stagesColor;
ShaderStage_clear(stage);
stage->stagetype = SHADER_STAGE_COLOR;
l_SHDData.colorStage = l_SHDData.stagesTexGpuInBuffer;
stage->blendmode = VID_UNSET;
stage->stageflag |= SHADER_VCOLOR | SHADER_VCOLOR_KEEP;
l_SHDData.stage = stage;
FileParse_stage(l_SHDData.file,words,loadColor,NULL);
switch (stage->blendmode){
case VID_UNSET:
if (l_SHDData.stagesTexGpuInBuffer > 0)
stage->blendmode = VID_MODULATE;
else
stage->blendmode = VID_REPLACE;
break;
}
}
// Texture
// -------
void parseShaderParam(char *buffer, char *rest)
{
char name[256];
char name2[256];
ShaderParam_t *param;
ShaderStage_t *stage = l_SHDData.stage;
int bufferpos=0,restpos=0;
if (l_SHDData.shader->numTotalParams == VID_MAX_SHADERPARAMS){
bprintf("ERROR shdload: too many shader parameters, maximum is %d\n",VID_MAX_SHADERPARAMS);
return;
}
param = reszalloc(sizeof(ShaderParam_t));
memset(param,0,sizeof(ShaderParam_t));
lxListNode_init(param);
param->vector[3] = 1.0f;
param->vectorp = param->vector;
param->totalid = l_SHDData.shader->numTotalParams;
l_SHDData.shader->numTotalParams++;
lxStrReadInQuotes(rest, name, 255);
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
resnewstrcpy(param->name,name);
name[0] = 0;
sscanf(buffer,"%s %d %s (%f,%f,%f,%f) %d %d",name2,¶m->id,name,¶m->vector[0],¶m->vector[1],¶m->vector[2],¶m->vector[3],¶m->upvalue,¶m->upvalue2);
#define SETPARAM(str,value) \
if (strcmp(name,str)==0) \
param->type = value;
SETPARAM("VID_VALUE",SHADER_PARAM_VALUE);
SETPARAM("VID_ARRAY",SHADER_PARAM_ARRAY);
SETPARAM("VID_CAMPOS",SHADER_PARAM_CAMPOS);
SETPARAM("VID_CAMDIR",SHADER_PARAM_CAMDIR);
SETPARAM("VID_CAMUP",SHADER_PARAM_CAMUP);
SETPARAM("VID_TIME",SHADER_PARAM_TIME);
SETPARAM("VID_RANDOM",SHADER_PARAM_RANDOM);
SETPARAM("VID_TEXCONST",SHADER_PARAM_TEXCONST);
SETPARAM("VID_LIGHTCOLOR",SHADER_PARAM_LIGHTCOLOR);
SETPARAM("VID_LIGHTAMBIENT",SHADER_PARAM_LIGHTAMBIENT);
SETPARAM("VID_LIGHTPOS",SHADER_PARAM_LIGHTPOS);
SETPARAM("VID_LIGHTRANGE",SHADER_PARAM_LIGHTRANGE);
SETPARAM("VID_LIGHTDIR",SHADER_PARAM_LIGHTDIR);
SETPARAM("VID_TEXSIZEINV",SHADER_PARAM_TEXSIZEINV);
SETPARAM("VID_TEXSIZE",SHADER_PARAM_TEXSIZE);
SETPARAM("VID_TEXLMSCALE",SHADER_PARAM_TEXLMSCALE);
SETPARAM("VID_TEXGEN0",SHADER_PARAM_TEXGEN0);
SETPARAM("VID_TEXGEN1",SHADER_PARAM_TEXGEN1);
SETPARAM("VID_TEXGEN2",SHADER_PARAM_TEXGEN2);
SETPARAM("VID_TEXGEN3",SHADER_PARAM_TEXGEN3);
SETPARAM("VID_TEXMAT0",SHADER_PARAM_TEXMAT0);
SETPARAM("VID_TEXMAT1",SHADER_PARAM_TEXMAT1);
SETPARAM("VID_TEXMAT2",SHADER_PARAM_TEXMAT2);
SETPARAM("VID_TEXMAT3",SHADER_PARAM_TEXMAT3);
#undef SETPARAM
lxListNode_addLast(stage->paramListHead,param);
if (param->type == SHADER_PARAM_ARRAY){
param->upvalue = LUX_MAX(param->upvalue,1);
if (param->upvalue > 1){
int i;
param->vectorp = reszalloc(sizeof(lxVector4)*param->upvalue);
for(i=0; i < param->upvalue; i++)
memcpy(¶m->vectorp[i*4],param->vector,sizeof(lxVector4));
}
else{
param->vectorp = param->vector;
}
stage->numArrayParams++;
}
else
stage->numVectorParams++;
}
void loadTex(void * target,char * command, char* rest)
{
char buffer[1024];
int bufferpos=0,restpos=0;
ShaderStage_t *stage = l_SHDData.stage;
int tex = 0;
int attribute = 0;
if (strcmp(command,"alphamode")==0 || strcmp(command,"blendmode")==0 || strcmp(command,"blendinvertalpha")==0){
loadBlend(target,command,rest);
return;
}
if (strcmp(command,"TEXALPHA")==0 || strcmp(command,"VTEXALPHA")==0)
tex = TEX_ALPHA;
else if (strcmp(command,"TEXCUBE")==0 || strcmp(command,"VTEXCUBE")==0){
tex = TEX_COLOR;
attribute |= TEX_ATTR_CUBE;
}
else if (strcmp(command,"TEXPROJ")==0 || strcmp(command,"VTEXPROJ")==0){
tex = TEX_COLOR;
attribute |= TEX_ATTR_PROJ;
}
else if (strcmp(command,"TEXDOTZ")==0 || strcmp(command,"VTEXDOTZ")==0){
tex = TEX_COLOR;
attribute |= TEX_ATTR_DOTZ;
}
else if (strcmp(command,"TEX")==0 || strcmp(command,"VTEX")==0)
tex = TEX_COLOR;
if (tex) {
char name[256];
lxStrReadInQuotes(rest, name, 255);
stage->srcType = tex;
stage->srcAttributes |= attribute;
if (strstr(name,"Texture:")){
if (sscanf(name,"Texture:%i",&stage->id)){
stage->id += MATERIAL_TEX0;
stage->colorid = stage->id;
}
}
else{
resnewstrcpy(stage->srcName,name);
}
if (strcmp(command,"VTEX")==0 || strcmp(command,"VTEXALPHA")==0 || strcmp(command,"VTEXPROJ")==0 || strcmp(command,"VTEXCUBE")==0 || strcmp(command,"VTEXDOTZ")==0)
stage->stageflag |= SHADER_VCOLOR | SHADER_VCOLOR_KEEP;
return;
}
if (strcmp(command,"ATTENUATE3D")==0){
stage->srcType = TEX_3D_ATTENUATE;
stage->stageflag |= SHADER_SPECIAL;
return;
}
if (strcmp(command,"NORMALIZE")==0){
stage->srcType = TEX_CUBE_NORMALIZE;
stage->stageflag |= SHADER_SPECIAL;
return;
}
if (strcmp(command,"SKYBOX")==0){
stage->srcType = TEX_CUBE_SKYBOX;
stage->stageflag |= SHADER_SPECIAL;
return;
}
if (strcmp(command,"DUMMY")==0){
stage->srcType = TEX_DUMMY;
stage->stageflag |= SHADER_SPECIAL;
return;
}
if (strcmp(command,"SPECULAR")==0){
stage->srcType = TEX_CUBE_SPECULAR;
stage->stageflag |= SHADER_SPECIAL;
return;
}
if (strcmp(command,"DIFFUSE")==0){
stage->srcType = TEX_CUBE_DIFFUSE;
stage->stageflag |= SHADER_SPECIAL;
return;
}
if (strcmp(command,"LIGHTMAP")==0){
stage->srcType = TEX_2D_LIGHTMAP;
stage->stageflag |= SHADER_SPECIAL;
stage->texchannel = VID_TEXCOORD_LIGHTMAP;
return;
}
if (strcmp(command,"vertexcolored")==0) {
stage->stageflag |= SHADER_VCOLOR | SHADER_VCOLOR_KEEP;
return;
}
if (strcmp(command,"spheremap")==0) {
stage->stageflag |= SHADER_SPHEREMAP;
stage->stageflag |= SHADER_TEXGEN;
return;
}
if (strcmp(command,"screenmap")==0) {
stage->stageflag |= SHADER_SCREENMAP;
stage->stageflag |= SHADER_TEXGEN;
return;
}
if (strcmp(command,"reflectmap")==0) {
stage->stageflag |= SHADER_REFLECTMAP;
stage->stageflag |= SHADER_TEXGEN;
return;
}
if (strcmp(command,"skyreflectmap")==0) {
stage->stageflag |= SHADER_SKYMAP;
stage->stageflag |= SHADER_TEXGEN;
return;
}
if (strstr(command,"lightnormalmap")){
stage->stageflag |= SHADER_SUNREFMAP;
stage->stageflag |= SHADER_TEXGEN;
stage->stageparam = command[14]-'0';
stage->stageparam %= 4;
return;
}
if (strstr(command,"lightreflectmap")){
stage->stageflag |= SHADER_SUNREFMAP;
stage->stageflag |= SHADER_TEXGEN;
stage->stageparam = command[15]-'0';
stage->stageparam %= 4;
return;
}
if (strcmp(command,"sunreflectmap")==0) {
stage->stageflag |= SHADER_SUNREFMAP;
stage->stageflag |= SHADER_TEXGEN;
//l_SHDData.shader->shaderflag |= SHADER_NEEDINVMATRIX;
stage->stageparam = 0;
return;
}
if (strcmp(command,"sunnormalmap")==0) {
stage->stageflag |= SHADER_SUNNORMALMAP;
stage->stageflag |= SHADER_TEXGEN;
//l_SHDData.shader->shaderflag |= SHADER_NEEDINVMATRIX;
stage->stageparam = 0;
return;
}
if (strcmp(command,"worldlinmap")==0 || strcmp(command,"eyelinmap")==0) { // backwards compatibility
stage->stageflag |= SHADER_EYELINMAP;
stage->stageflag |= SHADER_TEXGEN;
return;
}
if (strcmp(command,"normalmap")==0) {
stage->stageflag |= SHADER_NORMALMAP;
stage->stageflag |= SHADER_TEXGEN;
return;
}
if (strcmp(command,"depthcompare")==0) {
stage->stageflag |= SHADER_DEPTHCOMPARE;
return;
}
if (strcmp(command,"depthvalue")==0) {
stage->stageflag |= SHADER_DEPTHNOCOMPARE;
return;
}
if (strcmp(command,"texcoord")==0) {
sscanf(rest,"%i",&stage->texchannel);
if (stage->texchannel >= VID_TEXCOORD_CHANNELS){
lprintf("WARNING shdload: illegal texcoord channel\n");
stage->texchannel = 0;
}
return;
}
if (strcmp(command,"texclamp")==0) {
int states[3];
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
if (3==sscanf(buffer,"(%d,%d,%d)",&states[0],&states[1],&states[2])){
int i;
for (i = 0; i < 3; i++)
if (states[i])
stage->texclamp |= 1<<i;
}
return;
}
if (strcmp(command,"texgenplane")==0){
int axis;
lxVector4 plane;
float *vec4;
while (rest[restpos]!=0 && rest[restpos]!=';')
buffer[bufferpos++]=rest[restpos++];
buffer[bufferpos]=0;
if (stage->stagetype == SHADER_STAGE_TEX && 5==sscanf(buffer,"%d (%f,%f,%f,%f)",&axis,&plane[0],&plane[1],&plane[2],&plane[3])){
if (!stage->texgen)
stage->texgen = reszalloc(sizeof(ShaderTexGen_t));
axis = LUX_MAX(axis,0);
axis %= 4;
stage->texgen->enabledaxis[axis] = LUX_TRUE;
vec4 = &stage->texgen->texgenmatrix[4*axis];
lxVector4Copy(vec4,plane);
}
}
if (strcmp(command,"rgbscale2")==0) {
stage->rgbscale = 1;
return;
}
if (strcmp(command,"rgbscale4")==0) {
stage->rgbscale = 2;
return;
}
if (strcmp(command,"alphascale2")==0) {
stage->alphascale = 1;
return;
}
if (strcmp(command,"alphascale4")==0) {
stage->alphascale = 2;
return;
}
if (strcmp(command,"lightmapscale")==0) {
stage->stageflag |= SHADER_LMRGBSCALE;
return;
}
if (strcmp(command,"nomipmap")==0) {
stage->srcAttributes &= ~TEX_ATTR_MIPMAP;
return;
}
if (strcmp(command,"param")==0) {
parseShaderParam(buffer,rest);
return;
}
}
void fileLoadSHDTex()
{
static char *words[100]={ "TEX","TEXALPHA","VTEX","VTEXALPHA","TEXCUBE","TEXPROJ","VTEXCUBE","VTEXPROJ","TEXDOTZ",
"VTEXDOTZ","param",
"spheremap","screenmap","reflectmap","worldlinmap","eyelinmap","skyreflectmap","normalmap",
"alphamode","blendmode","blendinvertalpha","vertexcolored","texcoord","sunnormalmap","sunreflectmap",
"texclamp","texgenplane","alphascale4","alphascale2","rgbscale2","rgbscale4","lightmapscale",
"lightnormalmap0","lightnormalmap1","lightnormalmap2","lightnormalmap3","lightreflectmap0","lightreflectmap1","lightreflectmap2","lightreflectmap3",
"depthcompare","depthvalue","nomipmap",
"ATTENUATE3D","LIGHTMAP","NORMALIZE","SKYBOX","SPECULAR","DIFFUSE","DUMMY",
"\0"};
ShaderStage_t *stage;
if (!l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer])
l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer] =reszalloc(sizeof(ShaderStage_t));
stage = l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer];
ShaderStage_clear(stage);
stage->stagetype = SHADER_STAGE_TEX;
stage->srcAttributes = TEX_ATTR_MIPMAP;
stage->blendmode = VID_UNSET;
l_SHDData.stage = stage;
FileParse_stage(l_SHDData.file,words,loadTex,NULL);
switch (stage->blendmode){
case VID_UNSET:
if (!l_SHDData.stagesTexInBuffer && l_SHDData.stagesColorInBuffer > 0 && !(stage->stageflag & SHADER_VCOLOR)){
stage->blendmode = VID_MODULATE;
}
else if (l_SHDData.stagesTexInBuffer > 0)
stage->blendmode = VID_MODULATE;
else
stage->blendmode = VID_REPLACE;
break;
}
}
// GPU Program
// -----------
void GPUnameset(char *rest, int isskin, char **srcname, char**entryname) {
char name[1024];
char namebuf[40] = {0};
int num = 0;
const char *next = lxStrReadInQuotes(rest, name, 1023);
sscanf(rest,"%i",&num);
num%=(VID_MAX_LIGHTS+1);
resnewstrcpy(srcname[num], name);
if (next){
lxStrReadInQuotes(next, name, 1023);
if (isskin){
if (strstr(name,RES_CGC_SEPARATOR)==NULL)
strcat(name,RES_CGC_SEPARATOR);
sprintf(namebuf,"-DVID_BONES=%d;",g_VID.gensetup.hwbones);
strcat(name,namebuf);
}
resnewstrcpy(entryname[num], name);
}
else if (isskin){
sprintf(namebuf,"%s-DVID_BONES=%d;",RES_CGC_SEPARATOR,g_VID.gensetup.hwbones);
resnewstrcpy(entryname[num], namebuf);
}
}
void loadGPU(void * target,char * command, char* rest)
{
char buffer[1000];
int bufferpos=0,restpos=0;
int isskin = LUX_FALSE;
ShaderStage_t *stage = l_SHDData.stage;
//"VPROG","FPROG","VCg","FCg","VFixed","FFixed"
// Generic
if (strcmp(command,"VPROG")==0) {
stage->srcType = GPUPROG_V_ARB;
return;
}
if (strcmp(command,"FPROG")==0) {
stage->srcType = GPUPROG_F_ARB;
return;
}
if (strcmp(command,"VGLSL")==0) {
stage->srcType = GPUPROG_V_GLSL;
return;
}
if (strcmp(command,"FGLSL")==0) {
stage->srcType = GPUPROG_F_GLSL;
return;
}
if (strcmp(command,"GGLSL")==0) {
stage->srcType = GPUPROG_G_GLSL;
return;
}
if (strcmp(command,"VCG")==0) {
stage->srcType = GPUPROG_V_CG;
return;
}
if (strcmp(command,"FCG")==0) {
stage->srcType = GPUPROG_F_CG;
return;
}
if (strcmp(command,"GCG")==0) {
stage->srcType = GPUPROG_G_CG;
return;
}
if (strcmp(command,"VFIXED")==0) {
stage->srcType = GPUPROG_V_FIXED;
return;
}
if (strcmp(command,"FFIXED")==0) {
stage->srcType = GPUPROG_F_FIXED;
return;
}
if (strcmp(command,"GFIXED")==0) {
stage->srcType = GPUPROG_G_FIXED;
return;
}
if (strcmp(command,"lowCgProfile")==0){
stage->stageflag |= SHADER_CG_LOWPROFILE;
return;
}
if (strcmp(command,"BASE")==0) {
GPUnameset(rest,LUX_FALSE,stage->gpuinfo->srcNames,stage->gpuinfo->srcEntryNames);
return;
}
if ((isskin=strcmp(command,"SKIN"))==0 || strcmp(command,"FOGGED")==0) {
GPUnameset(rest,isskin,stage->gpuinfo->srcSkinNames,stage->gpuinfo->srcSkinEntryNames);
return;
}
if (strcmp(command,"tangents")==0) {
l_SHDData.shader->shaderflag |= SHADER_TANGENTS;
stage->stageflag |= SHADER_TANGENTS;
return;
}
if (strcmp(command,"normals")==0) {
l_SHDData.shader->shaderflag |= SHADER_NORMALS;
stage->stageflag |= SHADER_NORMALS;
return;
}
if (strcmp(command,"texbarrier")==0 && GLEW_NV_texture_barrier) {
stage->stageflag |= SHADER_TEXBARRIER;
return;
}
if (strcmp(command,"param")==0) {
parseShaderParam(buffer,rest);
return;
}
}
#undef GPUNAMESET
void fileLoadSHDGPU()
{
static char *words[100]={ "VPROG","FPROG","VCG","FCG","GCG","FFIXED","VFIXED","GFIXED",
"BASE",
"SKIN",
"FOGGED",
"lowCgProfile",
"param","tangents","normals","texbarrier","\0"};
ShaderStage_t *stage;
if (!l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer])
l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer] =reszalloc(sizeof(ShaderStage_t));
l_SHDData.shader->shaderflag |= SHADER_NOCOMPILE;
stage = l_SHDData.stagesTex[l_SHDData.stagesTexGpuInBuffer];
ShaderStage_clear(stage);
stage->stagetype = SHADER_STAGE_GPU;
stage->gpuinfo = reszalloc(sizeof(ShaderGpuInfo_t));
stage->blendmode = VID_UNSET;
stage->stageflag |= SHADER_VCOLOR | SHADER_VCOLOR_KEEP;
l_SHDData.stage = stage;
FileParse_stage(l_SHDData.file,words,loadGPU,NULL);
}
void ShaderBuildFromBuffer(Shader_t *shader)
{
int i,n;
int offset;
int needsworldinv = LUX_FALSE;
ShaderParam_t *parambrowse;
// copy stages
offset = 0;
shader->numStages = l_SHDData.stagesColorInBuffer + l_SHDData.stagesTexGpuInBuffer;
shader->stages = reszalloc(sizeof(ShaderStage_t*)*shader->numStages);
shader->totalParams = reszalloc(sizeof(ShaderParam_t*)*shader->numTotalParams);
// we will need manual matrix paramters
shader->cgMode = l_SHDData.cgmode == -1 ? SHADER_PASSMODE_FIXEDARB : l_SHDData.cgmode;
if (!(shader->shaderflag & SHADER_NOCOMPILE))
l_SHDData.colorStage = 0;
n = 0;
for (i = 0; i < l_SHDData.stagesColorInBuffer + l_SHDData.stagesTexGpuInBuffer; i++){
if (i == l_SHDData.colorStage && l_SHDData.stagesColorInBuffer)
shader->stages[i]=l_SHDData.stagesColor;
else{
ShaderStage_t *stage = l_SHDData.stagesTex[n];
shader->stages[i]=stage;
if (stage->paramListHead){
lxListNode_forEach(stage->paramListHead,parambrowse)
shader->totalParams[parambrowse->totalid] = parambrowse;
needsworldinv |= ShaderParam_needsWorldInv(parambrowse);
lxListNode_forEachEnd(stage->paramListHead,parambrowse);
}
if (stage->stagetype == SHADER_STAGE_TEX){
if (stage->stageflag & (SHADER_EYELINMAP | SHADER_OBJLINMAP) && !stage->texgen){
stage->stageflag &= ~(SHADER_EYELINMAP | SHADER_OBJLINMAP);
stage->texgen = NULL;
lprintf("WARNING shdload: no texgenplanes defined,%s\n",shader->resinfo.name);
}
if (stage->texgen){
uchar legalcombos[] = { LUX_TRUE,LUX_TRUE,LUX_FALSE,LUX_FALSE, // XY
LUX_TRUE,LUX_TRUE,LUX_TRUE,LUX_FALSE, // XYZ
LUX_TRUE,LUX_TRUE,LUX_FALSE,LUX_TRUE, // XYW
LUX_TRUE,LUX_TRUE,LUX_TRUE,LUX_TRUE}; // XYZW
enum32 legalmodes[] = { VID_TEXCOORD_TEXGEN_ST,
VID_TEXCOORD_TEXGEN_STR,
VID_TEXCOORD_TEXGEN_STQ,
VID_TEXCOORD_TEXGEN_STRQ};
uint *pIn = (uint*)legalcombos;
uint *pCur = (uint*)stage->texgen->enabledaxis;
int c;
for (c = 0; c < 4; c++,pIn++){
if (*pIn == *pCur){
stage->texgen->texgenmode = legalmodes[c];
break;
}
}
if (!stage->texgen){
stage->texgen = NULL;
stage->stageflag &= ~(SHADER_EYELINMAP | SHADER_OBJLINMAP);
lprintf("WARNING shdload: illegal combination of texgenplanes defined,%s\n",shader->resinfo.name);
}
}
}
n++;
}
}
if (needsworldinv)
shader->shaderflag |= SHADER_NEEDINVMATRIX;
// check if textured
if (l_SHDData.stagesTexInBuffer)
shader->shaderflag |= SHADER_TEXTURED;
// nicer to work with, if first stage = color replace & second stage = tex modulate, we "encode" the modulate via vcolor flag
if ( l_SHDData.stagesColorInBuffer && l_SHDData.stagesColor->blendmode == VID_REPLACE
&& l_SHDData.stagesTexInBuffer)
for (i = 0; i < shader->numStages; i++){
if (shader->stages[i]->stagetype == SHADER_STAGE_TEX ){
if (shader->stages[i]->blendmode == VID_MODULATE && !(isFlagSet(shader->stages[i]->stageflag,SHADER_VCOLOR))){
shader->stages[i]->blendmode = VID_REPLACE;
shader->stages[i]->stageflag |= SHADER_VCOLOR | SHADER_VCOLOR_KEEP;
}
break;
}
}
// if there is a bumpstage, we will remove lighting info from all other stages
if (l_SHDData.bumpStage != -1){
shader->shaderflag |= SHADER_TANGENTS;
for (i= 0; i < shader->numStages; i++)
shader->stages[i]->stageflag &= ~(SHADER_VCOLOR | SHADER_VCOLOR_KEEP);
}
}
#undef BUFFERSTAGES
| 29.356678 | 175 | 0.651512 |
15ef67f639c3da1259599009c57c4efaaa2c8028 | 6,173 | h | C | Source/Engine/Script/Addons.h | ThunderBeastGames/Urho3D | 0102081686cd747c3d1d40bf476a72217a000873 | [
"Apache-2.0"
] | 5 | 2017-11-23T16:07:25.000Z | 2021-11-16T18:22:46.000Z | Source/Engine/Script/Addons.h | JoshEngebretson/UrhoQuake2 | 0102081686cd747c3d1d40bf476a72217a000873 | [
"Apache-2.0"
] | null | null | null | Source/Engine/Script/Addons.h | JoshEngebretson/UrhoQuake2 | 0102081686cd747c3d1d40bf476a72217a000873 | [
"Apache-2.0"
] | null | null | null | //
// Copyright (c) 2008-2014 the Urho3D project.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#pragma once
#include "Urho3D.h"
#include "HashMap.h"
#include "Str.h"
#include <angelscript.h>
// Adapted from Angelscript's scriptarray, scriptdictionary & scriptstdstring add-ons, but with garbage collection disabled
namespace Urho3D
{
struct SArrayBuffer;
struct SArrayCache;
/// %Script array class.
class URHO3D_API CScriptArray
{
public:
CScriptArray(asIObjectType *ot, void *buf);
CScriptArray(asUINT length, asIObjectType *ot);
CScriptArray(asUINT length, void *defVal, asIObjectType *ot);
CScriptArray(const CScriptArray &other);
virtual ~CScriptArray();
void AddRef() const;
void Release() const;
// Type information
asIObjectType *GetArrayObjectType() const;
int GetArrayTypeId() const;
int GetElementTypeId() const;
void Reserve(asUINT maxElements);
void Resize(asUINT numElements);
asUINT GetSize() const;
bool IsEmpty() const;
// Get a pointer to an element. Returns 0 if out of bounds
void *At(asUINT index);
const void *At(asUINT index) const;
// Set value of an element
void SetValue(asUINT index, void *value);
CScriptArray &operator=(const CScriptArray&);
bool operator==(const CScriptArray &) const;
void InsertAt(asUINT index, void *value);
void RemoveAt(asUINT index);
void InsertLast(void *value);
void RemoveLast();
void SortAsc();
void SortDesc();
void SortAsc(asUINT index, asUINT count);
void SortDesc(asUINT index, asUINT count);
void Sort(asUINT index, asUINT count, bool asc);
void Reverse();
int Find(void *value) const;
int Find(asUINT index, void *value) const;
// GC methods
int GetRefCount();
void SetFlag();
bool GetFlag();
void EnumReferences(asIScriptEngine *engine);
void ReleaseAllHandles(asIScriptEngine *engine);
protected:
mutable int refCount;
mutable bool gcFlag;
asIObjectType *objType;
SArrayBuffer *buffer;
int elementSize;
int subTypeId;
bool Less(const void *a, const void *b, bool asc, asIScriptContext *ctx, SArrayCache *cache);
void *GetArrayItemPointer(int index);
void *GetDataPointer(void *buffer);
void Copy(void *dst, void *src);
void Precache();
bool CheckMaxSize(asUINT numElements);
void Resize(int delta, asUINT at);
void CreateBuffer(SArrayBuffer **buf, asUINT numElements);
void DeleteBuffer(SArrayBuffer *buf);
void CopyBuffer(SArrayBuffer *dst, SArrayBuffer *src);
void Construct(SArrayBuffer *buf, asUINT start, asUINT end);
void Destruct(SArrayBuffer *buf, asUINT start, asUINT end);
bool Equals(const void *a, const void *b, asIScriptContext *ctx, SArrayCache *cache) const;
};
/// Script dictionary class
class CScriptDictionary
{
public:
// Memory management
CScriptDictionary(asIScriptEngine *engine);
CScriptDictionary(asBYTE *buffer);
void AddRef() const;
void Release() const;
CScriptDictionary &operator =(const CScriptDictionary &other);
// Sets/Gets a variable type value for a key
void Set(const String &key, void *value, int typeId);
bool Get(const String &key, void *value, int typeId) const;
// Sets/Gets an integer number value for a key
void Set(const String &key, asINT64 &value);
bool Get(const String &key, asINT64 &value) const;
// Sets/Gets a real number value for a key
void Set(const String &key, double &value);
bool Get(const String &key, double &value) const;
// Returns true if the key is set
bool Exists(const String &key) const;
bool IsEmpty() const;
asUINT GetSize() const;
// Deletes the key
void Delete(const String &key);
// Deletes all keys
void DeleteAll();
// Get an array of all keys
CScriptArray *GetKeys() const;
// Garbage collections behaviours
int GetRefCount();
void SetGCFlag();
bool GetGCFlag();
void EnumReferences(asIScriptEngine *engine);
void ReleaseAllReferences(asIScriptEngine *engine);
protected:
// The structure for holding the values
struct valueStruct
{
union
{
asINT64 valueInt;
double valueFlt;
void *valueObj;
};
int typeId;
};
// We don't want anyone to call the destructor directly, it should be called through the Release method
virtual ~CScriptDictionary();
// Helper methods
void FreeValue(valueStruct &value);
// Our properties
asIScriptEngine *engine;
mutable int refCount;
mutable bool gcFlag;
HashMap<String, valueStruct> dict;
};
/// Register the array type to script.
void RegisterArray(asIScriptEngine* engine);
/// Register the dictionary type to script.
void RegisterDictionary(asIScriptEngine* engine);
/// Register String to script.
void RegisterString(asIScriptEngine* engine);
}
| 31.494898 | 124 | 0.680706 |
c62b868c0bd18e8496158a6f4d759ee484b72506 | 306 | c | C | src/tools.c | jessemillar/Gimbatul | 04cc54d88687a4731171e603e571a32873daa803 | [
"MIT"
] | 2 | 2015-11-08T07:05:26.000Z | 2021-02-09T14:18:07.000Z | src/tools.c | jessemillar/Gimbatul | 04cc54d88687a4731171e603e571a32873daa803 | [
"MIT"
] | null | null | null | src/tools.c | jessemillar/Gimbatul | 04cc54d88687a4731171e603e571a32873daa803 | [
"MIT"
] | null | null | null | #include <pebble.h>
#include "tools.h"
void log_int(int num)
{
static char log_buffer[100]; // We need "static" so the buffer persists...?
snprintf(log_buffer, sizeof(log_buffer), "%d", num);
APP_LOG(APP_LOG_LEVEL_INFO, log_buffer);
}
int random(int cap)
{
int temp = rand() % cap;
return temp;
} | 17 | 76 | 0.686275 |
18c6fe4db48b79f139e78dcf62dfcec4f2fd5de8 | 11,933 | c | C | targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/qspi_api.c | spiio/mbed-os | fde315a0ac8b87ba5986bc92b566980e6536cf37 | [
"Apache-2.0"
] | 1 | 2019-02-17T16:43:21.000Z | 2019-02-17T16:43:21.000Z | targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/qspi_api.c | spiio/mbed-os | fde315a0ac8b87ba5986bc92b566980e6536cf37 | [
"Apache-2.0"
] | 2 | 2018-07-11T13:42:22.000Z | 2018-12-27T15:03:50.000Z | targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/qspi_api.c | spiio/mbed-os | fde315a0ac8b87ba5986bc92b566980e6536cf37 | [
"Apache-2.0"
] | 3 | 2020-04-24T15:54:43.000Z | 2022-03-31T06:55:16.000Z | /* mbed Microcontroller Library
* Copyright (c) 2018, ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if DEVICE_QSPI
#include "qspi_api.h"
#include "mbed_error.h"
#include "cmsis.h"
#include "pinmap.h"
#include "PeripheralPins.h"
#include "qspi_device.h"
/* Command table indices */
#define COMMAND_READ_INDEX (0)
#define COMMAND_WRITE_INDEX (1)
#define LUT1_SEQ_INDEX 0 // Pre-defined read sequence
#define LUT2_SEQ_INDEX 4 // Pre-defined write sequence
#define LUT3_SEQ_INDEX 8 // User-define sequence
/* Minimum write size */
#define MIN_SIZE 16 // At least four words of data must be written into the TX Buffer
/* Array of QSPI peripheral base address. */
static SPIFI_Type *const qspi_addrs[] = SPIFI_BASE_PTRS;
extern uint32_t qspi_get_freq(void);
qspi_status_t qspi_init(qspi_t *obj, PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, PinName ssel, uint32_t hz, uint8_t mode)
{
spifi_config_t config = {0};
uint32_t qspiio0name = pinmap_peripheral(io0, PinMap_QSPI_DATA);
uint32_t qspiio1name = pinmap_peripheral(io1, PinMap_QSPI_DATA);
uint32_t qspiio2name = pinmap_peripheral(io2, PinMap_QSPI_DATA);
uint32_t qspiio3name = pinmap_peripheral(io3, PinMap_QSPI_DATA);
uint32_t qspiclkname = pinmap_peripheral(sclk, PinMap_QSPI_SCLK);
uint32_t qspisselname = pinmap_peripheral(ssel, PinMap_QSPI_SSEL);
uint32_t qspi_data_first = pinmap_merge(qspiio0name, qspiio1name);
uint32_t qspi_data_second = pinmap_merge(qspiio2name, qspiio3name);
uint32_t qspi_data_third = pinmap_merge(qspiclkname, qspisselname);
if (qspi_data_first != qspi_data_second || qspi_data_second != qspi_data_third ||
qspi_data_first != qspi_data_third) {
return QSPI_STATUS_INVALID_PARAMETER;
}
if (qspi_frequency(obj, hz) != QSPI_STATUS_OK) {
return QSPI_STATUS_INVALID_PARAMETER;
}
/* Initialize SPIFI */
SPIFI_GetDefaultConfig(&config);
SPIFI_Init(SPIFI0, &config);
// tested all combinations, take first
obj->instance = qspi_data_first;
pinmap_pinout(io0, PinMap_QSPI_DATA);
pinmap_pinout(io1, PinMap_QSPI_DATA);
pinmap_pinout(io2, PinMap_QSPI_DATA);
pinmap_pinout(io3, PinMap_QSPI_DATA);
pinmap_pinout(sclk, PinMap_QSPI_SCLK);
pinmap_pinout(ssel, PinMap_QSPI_SSEL);
return QSPI_STATUS_OK;
}
qspi_status_t qspi_free(qspi_t *obj)
{
SPIFI_Deinit(qspi_addrs[obj->instance]);
return QSPI_STATUS_OK;
}
qspi_status_t qspi_frequency(qspi_t *obj, int hz)
{
qspi_status_t status = QSPI_STATUS_OK;
int div = qspi_get_freq() / hz;
if ((qspi_get_freq() % hz) != 0) {
/* Incase the exact requested baud rate can be derived then set right div,
* else set baudrate to the closest lower value
*/
div++;
}
if (div > 256 || div < 1) {
status = QSPI_STATUS_INVALID_PARAMETER;
return status;
}
/* Set the clock divider */
CLOCK_SetClkDiv(kCLOCK_DivSpifiClk, div, false);
return status;
}
static void qspi_prepare_command(qspi_t *obj, const qspi_command_t *command, const void *tx_data, size_t tx_size, void *rx_data, size_t rx_size)
{
spifi_command_t spifi_command = {0};
SPIFI_Type *base = qspi_addrs[obj->instance];
bool use_memory_command = false;
/* Set the opcode & poll mode */
spifi_command.opcode = command->instruction.value;
spifi_command.isPollMode = false;
/* Check if this is a data transmit */
if (tx_data != NULL && tx_size) {
spifi_command.dataLen = tx_size;
spifi_command.direction = kSPIFI_DataOutput;
}
/* Check if this is a data receive */
if (rx_data != NULL && rx_size) {
spifi_command.dataLen = rx_size;
spifi_command.direction = kSPIFI_DataInput;
}
/* Check if we need to set dual bit */
if ((command->instruction.bus_width == QSPI_CFG_BUS_DUAL) ||
(command->address.bus_width == QSPI_CFG_BUS_DUAL) ||
(command->data.bus_width == QSPI_CFG_BUS_DUAL)) {
base->CTRL |= SPIFI_CTRL_DUAL_MASK;
} else {
base->CTRL &= ~SPIFI_CTRL_DUAL_MASK;
}
if (command->address.disabled == true) {
/* No flash address specified */
spifi_command.type = kSPIFI_CommandOpcodeOnly;
spifi_command.format = kSPIFI_CommandAllSerial;
if ((command->instruction.bus_width == QSPI_CFG_BUS_DUAL) ||
(command->instruction.bus_width == QSPI_CFG_BUS_QUAD)) {
spifi_command.format = kSPIFI_CommandAllQuad;
}
} else {
/* Set the address size */
spifi_command.type = (spifi_command_type_t)(command->address.size + 2);
/* Default to 1-1-1 mode */
spifi_command.format = kSPIFI_CommandAllSerial;
/* Check if it is 2-2-2 or 4-4-4 mode */
if (((command->instruction.bus_width == QSPI_CFG_BUS_DUAL) &&
(command->address.bus_width == QSPI_CFG_BUS_DUAL) &&
(command->data.bus_width == QSPI_CFG_BUS_DUAL)) ||
((command->instruction.bus_width == QSPI_CFG_BUS_QUAD) &&
(command->address.bus_width == QSPI_CFG_BUS_QUAD) &&
(command->data.bus_width == QSPI_CFG_BUS_QUAD))) {
/* All quad/dual. All fields of the command are in quad/dual format. */
spifi_command.format = kSPIFI_CommandAllQuad;
}
/* Check if it is 1-2-2 or 1-4-4 mode */
if (((command->instruction.bus_width == QSPI_CFG_BUS_SINGLE) &&
(command->address.bus_width == QSPI_CFG_BUS_DUAL) &&
(command->data.bus_width == QSPI_CFG_BUS_DUAL)) ||
((command->instruction.bus_width == QSPI_CFG_BUS_SINGLE) &&
(command->address.bus_width == QSPI_CFG_BUS_QUAD) &&
(command->data.bus_width == QSPI_CFG_BUS_QUAD))) {
/* Serial opcode. Opcode field is serial. Other fields are quad/dual. */
spifi_command.format = kSPIFI_CommandOpcodeSerial;
}
/* Check if it is 1-1-2 or 1-1-4 mode */
if (((command->instruction.bus_width == QSPI_CFG_BUS_SINGLE) &&
(command->address.bus_width == QSPI_CFG_BUS_SINGLE) &&
(command->data.bus_width == QSPI_CFG_BUS_DUAL)) ||
((command->instruction.bus_width == QSPI_CFG_BUS_SINGLE) &&
(command->address.bus_width == QSPI_CFG_BUS_SINGLE) &&
(command->data.bus_width == QSPI_CFG_BUS_QUAD))) {
/* Quad/dual data. Data field is quad/dual, other fields are serial. */
spifi_command.format = kSPIFI_CommandDataQuad;
}
/* Check if this is a data receive */
if (rx_data != NULL && rx_size) {
uint32_t cycles_per_byte = 8;
if ((command->address.bus_width == QSPI_CFG_BUS_DUAL) &&
(command->data.bus_width == QSPI_CFG_BUS_DUAL)) {
cycles_per_byte = 4;
}
if ((command->address.bus_width == QSPI_CFG_BUS_QUAD) &&
(command->data.bus_width == QSPI_CFG_BUS_QUAD)) {
cycles_per_byte = 2;
}
/* Set dummy bytes */
spifi_command.intermediateBytes = command->dummy_count / cycles_per_byte;
use_memory_command = true;
}
/* Set the flash address */
SPIFI_SetCommandAddress(base, command->address.value);
}
if (use_memory_command) {
/* Setup command */
SPIFI_SetMemoryCommand(base, &spifi_command);
} else {
/* Setup memory command */
SPIFI_SetCommand(base, &spifi_command);
}
}
qspi_status_t qspi_write(qspi_t *obj, const qspi_command_t *command, const void *data, size_t *length)
{
uint32_t to_write = *length;
uint32_t *data_send = (uint32_t *)data;
SPIFI_Type *base = qspi_addrs[obj->instance];
uint32_t i = 0;
/* Enforce word-sized access */
if ((to_write & 0x3) != 0) {
return QSPI_STATUS_INVALID_PARAMETER;
}
/* Use a pre-defined command is no write instruction is provided */
if (command->instruction.disabled) {
/* Set the flash address */
SPIFI_SetCommandAddress(base, command->address.value);
/* If no instruction provided then use the pre-defined read sequence */
preset_spifi_command[COMMAND_WRITE_INDEX].dataLen = to_write;
SPIFI_SetCommand(base, &preset_spifi_command[COMMAND_WRITE_INDEX]);
} else {
/* Prepare the write command */
qspi_prepare_command(obj, command, data, to_write, NULL, 0);
}
/* Write the data */
for (i = 0; i < to_write; i += 4, data_send++) {
SPIFI_WriteData(base, *data_send);
}
/* Wait for deasseration of CS */
while (SPIFI_GetStatusFlag(base) & kSPIFI_CommandWriteFinished) {
}
return QSPI_STATUS_OK;
}
qspi_status_t qspi_read(qspi_t *obj, const qspi_command_t *command, void *data, size_t *length)
{
uint32_t dest_addr = FSL_FEATURE_SPIFI_START_ADDR + command->address.value;
uint32_t to_read = *length;
SPIFI_Type *base = qspi_addrs[obj->instance];
/* Enforce word-sized access */
if ((to_read & 0x3) != 0) {
return QSPI_STATUS_INVALID_PARAMETER;
}
/* Use a pre-defined command is no read instruction is provided */
if (command->instruction.disabled) {
/* If no instruction provided then use the pre-defined read sequence */
preset_spifi_command[COMMAND_READ_INDEX].dataLen = to_read;
SPIFI_SetMemoryCommand(base, &preset_spifi_command[COMMAND_READ_INDEX]);
} else {
/* Prepare for read command */
qspi_prepare_command(obj, command, NULL, 0, data, to_read);
}
for (uint32_t i = 0; i < to_read / 4; i++) {
((uint32_t*)data)[i] = *((uint32_t *)(dest_addr) + i);
}
return QSPI_STATUS_OK;
}
qspi_status_t qspi_command_transfer(qspi_t *obj, const qspi_command_t *command, const void *tx_data, size_t tx_size, void *rx_data, size_t rx_size)
{
SPIFI_Type *base = qspi_addrs[obj->instance];
if (tx_size > MIN_SIZE || rx_size > MIN_SIZE) {
return QSPI_STATUS_INVALID_PARAMETER;
}
if ((tx_data == NULL || tx_size == 0) && (rx_data == NULL || rx_size == 0)) {
/* Setup the command */
qspi_prepare_command(obj, command, tx_data, tx_size, rx_data, rx_size);
} else {
if (tx_data != NULL && tx_size) {
/* Transmit data to QSPI */
uint8_t val[MIN_SIZE];
memset(val, 0, sizeof(val));
memcpy(val, tx_data, tx_size);
/* Setup the command */
qspi_prepare_command(obj, command, tx_data, tx_size, rx_data, rx_size);
for (uint32_t i = 0; i < tx_size; i++) {
SPIFI_WriteDataByte(base, val[i]);
}
}
if (rx_data != NULL && rx_size) {
/* Receive data from QSPI */
uint8_t val[MIN_SIZE];
memset(val, 0, sizeof(val));
/* Setup the command */
qspi_prepare_command(obj, command, tx_data, tx_size, rx_data, rx_size);
for (uint32_t i = 0; i < rx_size; i++) {
val[i] = SPIFI_ReadDataByte(base);
}
memcpy(rx_data, val, rx_size);
}
}
/* Wait for deasseration of CS */
while (SPIFI_GetStatusFlag(base) & kSPIFI_CommandWriteFinished) {
}
return QSPI_STATUS_OK;
}
#endif
| 34.790087 | 147 | 0.64594 |
49db83eea252d86a82e1c61e32b9cde4f5a31bd3 | 16,564 | c | C | src/cmd/ld/macho.c | glycerine/jeaten-go-arrayof-structof | 2ea04ce522c8f4b66ec64e98ae6533e65cb13090 | [
"BSD-3-Clause"
] | null | null | null | src/cmd/ld/macho.c | glycerine/jeaten-go-arrayof-structof | 2ea04ce522c8f4b66ec64e98ae6533e65cb13090 | [
"BSD-3-Clause"
] | null | null | null | src/cmd/ld/macho.c | glycerine/jeaten-go-arrayof-structof | 2ea04ce522c8f4b66ec64e98ae6533e65cb13090 | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Mach-O file writing
// http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html
#include "l.h"
#include "../ld/dwarf.h"
#include "../ld/lib.h"
#include "../ld/macho.h"
static int macho64;
static MachoHdr hdr;
static MachoLoad *load;
static MachoSeg seg[16];
static int nload, mload, nseg, ndebug, nsect;
enum
{
SymKindLocal = 0,
SymKindExtdef,
SymKindUndef,
NumSymKind
};
static int nkind[NumSymKind];
static LSym** sortsym;
static int nsortsym;
// Amount of space left for adding load commands
// that refer to dynamic libraries. Because these have
// to go in the Mach-O header, we can't just pick a
// "big enough" header size. The initial header is
// one page, the non-dynamic library stuff takes
// up about 1300 bytes; we overestimate that as 2k.
static int load_budget = INITIAL_MACHO_HEADR - 2*1024;
static void machodysymtab(void);
void
machoinit(void)
{
switch(thechar) {
// 64-bit architectures
case '6':
macho64 = 1;
break;
// 32-bit architectures
default:
break;
}
}
MachoHdr*
getMachoHdr(void)
{
return &hdr;
}
MachoLoad*
newMachoLoad(uint32 type, uint32 ndata)
{
MachoLoad *l;
if(nload >= mload) {
if(mload == 0)
mload = 1;
else
mload *= 2;
load = erealloc(load, mload*sizeof load[0]);
}
if(macho64 && (ndata & 1))
ndata++;
l = &load[nload++];
l->type = type;
l->ndata = ndata;
l->data = mal(ndata*4);
return l;
}
MachoSeg*
newMachoSeg(char *name, int msect)
{
MachoSeg *s;
if(nseg >= nelem(seg)) {
diag("too many segs");
errorexit();
}
s = &seg[nseg++];
s->name = name;
s->msect = msect;
s->sect = mal(msect*sizeof s->sect[0]);
return s;
}
MachoSect*
newMachoSect(MachoSeg *seg, char *name, char *segname)
{
MachoSect *s;
if(seg->nsect >= seg->msect) {
diag("too many sects in segment %s", seg->name);
errorexit();
}
s = &seg->sect[seg->nsect++];
s->name = name;
s->segname = segname;
nsect++;
return s;
}
// Generic linking code.
static char **dylib;
static int ndylib;
static vlong linkoff;
int
machowrite(void)
{
vlong o1;
int loadsize;
int i, j;
MachoSeg *s;
MachoSect *t;
MachoLoad *l;
o1 = cpos();
loadsize = 4*4*ndebug;
for(i=0; i<nload; i++)
loadsize += 4*(load[i].ndata+2);
if(macho64) {
loadsize += 18*4*nseg;
loadsize += 20*4*nsect;
} else {
loadsize += 14*4*nseg;
loadsize += 17*4*nsect;
}
if(macho64)
LPUT(0xfeedfacf);
else
LPUT(0xfeedface);
LPUT(hdr.cpu);
LPUT(hdr.subcpu);
if(linkmode == LinkExternal)
LPUT(1); /* file type - mach object */
else
LPUT(2); /* file type - mach executable */
LPUT(nload+nseg+ndebug);
LPUT(loadsize);
LPUT(1); /* flags - no undefines */
if(macho64)
LPUT(0); /* reserved */
for(i=0; i<nseg; i++) {
s = &seg[i];
if(macho64) {
LPUT(25); /* segment 64 */
LPUT(72+80*s->nsect);
strnput(s->name, 16);
VPUT(s->vaddr);
VPUT(s->vsize);
VPUT(s->fileoffset);
VPUT(s->filesize);
LPUT(s->prot1);
LPUT(s->prot2);
LPUT(s->nsect);
LPUT(s->flag);
} else {
LPUT(1); /* segment 32 */
LPUT(56+68*s->nsect);
strnput(s->name, 16);
LPUT(s->vaddr);
LPUT(s->vsize);
LPUT(s->fileoffset);
LPUT(s->filesize);
LPUT(s->prot1);
LPUT(s->prot2);
LPUT(s->nsect);
LPUT(s->flag);
}
for(j=0; j<s->nsect; j++) {
t = &s->sect[j];
if(macho64) {
strnput(t->name, 16);
strnput(t->segname, 16);
VPUT(t->addr);
VPUT(t->size);
LPUT(t->off);
LPUT(t->align);
LPUT(t->reloc);
LPUT(t->nreloc);
LPUT(t->flag);
LPUT(t->res1); /* reserved */
LPUT(t->res2); /* reserved */
LPUT(0); /* reserved */
} else {
strnput(t->name, 16);
strnput(t->segname, 16);
LPUT(t->addr);
LPUT(t->size);
LPUT(t->off);
LPUT(t->align);
LPUT(t->reloc);
LPUT(t->nreloc);
LPUT(t->flag);
LPUT(t->res1); /* reserved */
LPUT(t->res2); /* reserved */
}
}
}
for(i=0; i<nload; i++) {
l = &load[i];
LPUT(l->type);
LPUT(4*(l->ndata+2));
for(j=0; j<l->ndata; j++)
LPUT(l->data[j]);
}
return cpos() - o1;
}
void
domacho(void)
{
LSym *s;
if(debug['d'])
return;
// empirically, string table must begin with " \x00".
s = linklookup(ctxt, ".machosymstr", 0);
s->type = SMACHOSYMSTR;
s->reachable = 1;
adduint8(ctxt, s, ' ');
adduint8(ctxt, s, '\0');
s = linklookup(ctxt, ".machosymtab", 0);
s->type = SMACHOSYMTAB;
s->reachable = 1;
if(linkmode != LinkExternal) {
s = linklookup(ctxt, ".plt", 0); // will be __symbol_stub
s->type = SMACHOPLT;
s->reachable = 1;
s = linklookup(ctxt, ".got", 0); // will be __nl_symbol_ptr
s->type = SMACHOGOT;
s->reachable = 1;
s->align = 4;
s = linklookup(ctxt, ".linkedit.plt", 0); // indirect table for .plt
s->type = SMACHOINDIRECTPLT;
s->reachable = 1;
s = linklookup(ctxt, ".linkedit.got", 0); // indirect table for .got
s->type = SMACHOINDIRECTGOT;
s->reachable = 1;
}
}
void
machoadddynlib(char *lib)
{
// Will need to store the library name rounded up
// and 24 bytes of header metadata. If not enough
// space, grab another page of initial space at the
// beginning of the output file.
load_budget -= (strlen(lib)+7)/8*8 + 24;
if(load_budget < 0) {
HEADR += 4096;
INITTEXT += 4096;
load_budget += 4096;
}
if(ndylib%32 == 0)
dylib = erealloc(dylib, (ndylib+32)*sizeof dylib[0]);
dylib[ndylib++] = lib;
}
static void
machoshbits(MachoSeg *mseg, Section *sect, char *segname)
{
MachoSect *msect;
char buf[40];
char *p;
snprint(buf, sizeof buf, "__%s", sect->name+1);
for(p=buf; *p; p++)
if(*p == '.')
*p = '_';
msect = newMachoSect(mseg, estrdup(buf), segname);
if(sect->rellen > 0) {
msect->reloc = sect->reloff;
msect->nreloc = sect->rellen / 8;
}
while(1<<msect->align < sect->align)
msect->align++;
msect->addr = sect->vaddr;
msect->size = sect->len;
if(sect->vaddr < sect->seg->vaddr + sect->seg->filelen) {
// data in file
if(sect->len > sect->seg->vaddr + sect->seg->filelen - sect->vaddr)
diag("macho cannot represent section %s crossing data and bss", sect->name);
msect->off = sect->seg->fileoff + sect->vaddr - sect->seg->vaddr;
} else {
// zero fill
msect->off = 0;
msect->flag |= 1;
}
if(sect->rwx & 1)
msect->flag |= 0x400; /* has instructions */
if(strcmp(sect->name, ".plt") == 0) {
msect->name = "__symbol_stub1";
msect->flag = 0x80000408; /* only instructions, code, symbol stubs */
msect->res1 = 0;//nkind[SymKindLocal];
msect->res2 = 6;
}
if(strcmp(sect->name, ".got") == 0) {
msect->name = "__nl_symbol_ptr";
msect->flag = 6; /* section with nonlazy symbol pointers */
msect->res1 = linklookup(ctxt, ".linkedit.plt", 0)->size / 4; /* offset into indirect symbol table */
}
}
void
asmbmacho(void)
{
vlong v, w;
vlong va;
int a, i;
MachoHdr *mh;
MachoSeg *ms;
MachoLoad *ml;
Section *sect;
/* apple MACH */
va = INITTEXT - HEADR;
mh = getMachoHdr();
switch(thechar){
default:
diag("unknown mach architecture");
errorexit();
case '6':
mh->cpu = MACHO_CPU_AMD64;
mh->subcpu = MACHO_SUBCPU_X86;
break;
case '8':
mh->cpu = MACHO_CPU_386;
mh->subcpu = MACHO_SUBCPU_X86;
break;
}
ms = nil;
if(linkmode == LinkExternal) {
/* segment for entire file */
ms = newMachoSeg("", 40);
ms->fileoffset = segtext.fileoff;
ms->filesize = segdata.fileoff + segdata.filelen - segtext.fileoff;
}
/* segment for zero page */
if(linkmode != LinkExternal) {
ms = newMachoSeg("__PAGEZERO", 0);
ms->vsize = va;
}
/* text */
v = rnd(HEADR+segtext.len, INITRND);
if(linkmode != LinkExternal) {
ms = newMachoSeg("__TEXT", 20);
ms->vaddr = va;
ms->vsize = v;
ms->fileoffset = 0;
ms->filesize = v;
ms->prot1 = 7;
ms->prot2 = 5;
}
for(sect=segtext.sect; sect!=nil; sect=sect->next)
machoshbits(ms, sect, "__TEXT");
/* data */
if(linkmode != LinkExternal) {
w = segdata.len;
ms = newMachoSeg("__DATA", 20);
ms->vaddr = va+v;
ms->vsize = w;
ms->fileoffset = v;
ms->filesize = segdata.filelen;
ms->prot1 = 3;
ms->prot2 = 3;
}
for(sect=segdata.sect; sect!=nil; sect=sect->next)
machoshbits(ms, sect, "__DATA");
if(linkmode != LinkExternal) {
switch(thechar) {
default:
diag("unknown macho architecture");
errorexit();
case '6':
ml = newMachoLoad(5, 42+2); /* unix thread */
ml->data[0] = 4; /* thread type */
ml->data[1] = 42; /* word count */
ml->data[2+32] = entryvalue(); /* start pc */
ml->data[2+32+1] = entryvalue()>>16>>16; // hide >>32 for 8l
break;
case '8':
ml = newMachoLoad(5, 16+2); /* unix thread */
ml->data[0] = 1; /* thread type */
ml->data[1] = 16; /* word count */
ml->data[2+10] = entryvalue(); /* start pc */
break;
}
}
if(!debug['d']) {
LSym *s1, *s2, *s3, *s4;
// must match domacholink below
s1 = linklookup(ctxt, ".machosymtab", 0);
s2 = linklookup(ctxt, ".linkedit.plt", 0);
s3 = linklookup(ctxt, ".linkedit.got", 0);
s4 = linklookup(ctxt, ".machosymstr", 0);
if(linkmode != LinkExternal) {
ms = newMachoSeg("__LINKEDIT", 0);
ms->vaddr = va+v+rnd(segdata.len, INITRND);
ms->vsize = s1->size + s2->size + s3->size + s4->size;
ms->fileoffset = linkoff;
ms->filesize = ms->vsize;
ms->prot1 = 7;
ms->prot2 = 3;
}
ml = newMachoLoad(2, 4); /* LC_SYMTAB */
ml->data[0] = linkoff; /* symoff */
ml->data[1] = nsortsym; /* nsyms */
ml->data[2] = linkoff + s1->size + s2->size + s3->size; /* stroff */
ml->data[3] = s4->size; /* strsize */
machodysymtab();
if(linkmode != LinkExternal) {
ml = newMachoLoad(14, 6); /* LC_LOAD_DYLINKER */
ml->data[0] = 12; /* offset to string */
strcpy((char*)&ml->data[1], "/usr/lib/dyld");
for(i=0; i<ndylib; i++) {
ml = newMachoLoad(12, 4+(strlen(dylib[i])+1+7)/8*2); /* LC_LOAD_DYLIB */
ml->data[0] = 24; /* offset of string from beginning of load */
ml->data[1] = 0; /* time stamp */
ml->data[2] = 0; /* version */
ml->data[3] = 0; /* compatibility version */
strcpy((char*)&ml->data[4], dylib[i]);
}
}
}
// TODO: dwarf headers go in ms too
if(!debug['s'] && linkmode != LinkExternal)
dwarfaddmachoheaders();
a = machowrite();
if(a > HEADR)
diag("HEADR too small: %d > %d", a, HEADR);
}
static int
symkind(LSym *s)
{
if(s->type == SDYNIMPORT)
return SymKindUndef;
if(s->cgoexport)
return SymKindExtdef;
return SymKindLocal;
}
static void
addsym(LSym *s, char *name, int type, vlong addr, vlong size, int ver, LSym *gotype)
{
USED(name);
USED(addr);
USED(size);
USED(ver);
USED(gotype);
if(s == nil)
return;
switch(type) {
default:
return;
case 'D':
case 'B':
case 'T':
break;
}
if(sortsym) {
sortsym[nsortsym] = s;
nkind[symkind(s)]++;
}
nsortsym++;
}
static int
scmp(const void *p1, const void *p2)
{
LSym *s1, *s2;
int k1, k2;
s1 = *(LSym**)p1;
s2 = *(LSym**)p2;
k1 = symkind(s1);
k2 = symkind(s2);
if(k1 != k2)
return k1 - k2;
return strcmp(s1->extname, s2->extname);
}
static void
machogenasmsym(void (*put)(LSym*, char*, int, vlong, vlong, int, LSym*))
{
LSym *s;
genasmsym(put);
for(s=ctxt->allsym; s; s=s->allsym)
if(s->type == SDYNIMPORT || s->type == SHOSTOBJ)
if(s->reachable)
put(s, nil, 'D', 0, 0, 0, nil);
}
void
machosymorder(void)
{
int i;
// On Mac OS X Mountain Lion, we must sort exported symbols
// So we sort them here and pre-allocate dynid for them
// See http://golang.org/issue/4029
for(i=0; i<ndynexp; i++)
dynexp[i]->reachable = 1;
machogenasmsym(addsym);
sortsym = mal(nsortsym * sizeof sortsym[0]);
nsortsym = 0;
machogenasmsym(addsym);
qsort(sortsym, nsortsym, sizeof sortsym[0], scmp);
for(i=0; i<nsortsym; i++)
sortsym[i]->dynid = i;
}
static void
machosymtab(void)
{
int i;
LSym *symtab, *symstr, *s, *o;
symtab = linklookup(ctxt, ".machosymtab", 0);
symstr = linklookup(ctxt, ".machosymstr", 0);
for(i=0; i<nsortsym; i++) {
s = sortsym[i];
adduint32(ctxt, symtab, symstr->size);
// Only add _ to C symbols. Go symbols have dot in the name.
if(strstr(s->extname, ".") == nil)
adduint8(ctxt, symstr, '_');
addstring(symstr, s->extname);
if(s->type == SDYNIMPORT || s->type == SHOSTOBJ) {
adduint8(ctxt, symtab, 0x01); // type N_EXT, external symbol
adduint8(ctxt, symtab, 0); // no section
adduint16(ctxt, symtab, 0); // desc
adduintxx(ctxt, symtab, 0, PtrSize); // no value
} else {
if(s->cgoexport)
adduint8(ctxt, symtab, 0x0f);
else
adduint8(ctxt, symtab, 0x0e);
o = s;
while(o->outer != nil)
o = o->outer;
if(o->sect == nil) {
diag("missing section for %s", s->name);
adduint8(ctxt, symtab, 0);
} else
adduint8(ctxt, symtab, o->sect->extnum);
adduint16(ctxt, symtab, 0); // desc
adduintxx(ctxt, symtab, symaddr(s), PtrSize);
}
}
}
static void
machodysymtab(void)
{
int n;
MachoLoad *ml;
LSym *s1, *s2, *s3;
ml = newMachoLoad(11, 18); /* LC_DYSYMTAB */
n = 0;
ml->data[0] = n; /* ilocalsym */
ml->data[1] = nkind[SymKindLocal]; /* nlocalsym */
n += nkind[SymKindLocal];
ml->data[2] = n; /* iextdefsym */
ml->data[3] = nkind[SymKindExtdef]; /* nextdefsym */
n += nkind[SymKindExtdef];
ml->data[4] = n; /* iundefsym */
ml->data[5] = nkind[SymKindUndef]; /* nundefsym */
ml->data[6] = 0; /* tocoffset */
ml->data[7] = 0; /* ntoc */
ml->data[8] = 0; /* modtaboff */
ml->data[9] = 0; /* nmodtab */
ml->data[10] = 0; /* extrefsymoff */
ml->data[11] = 0; /* nextrefsyms */
// must match domacholink below
s1 = linklookup(ctxt, ".machosymtab", 0);
s2 = linklookup(ctxt, ".linkedit.plt", 0);
s3 = linklookup(ctxt, ".linkedit.got", 0);
ml->data[12] = linkoff + s1->size; /* indirectsymoff */
ml->data[13] = (s2->size + s3->size) / 4; /* nindirectsyms */
ml->data[14] = 0; /* extreloff */
ml->data[15] = 0; /* nextrel */
ml->data[16] = 0; /* locreloff */
ml->data[17] = 0; /* nlocrel */
}
vlong
domacholink(void)
{
int size;
LSym *s1, *s2, *s3, *s4;
machosymtab();
// write data that will be linkedit section
s1 = linklookup(ctxt, ".machosymtab", 0);
s2 = linklookup(ctxt, ".linkedit.plt", 0);
s3 = linklookup(ctxt, ".linkedit.got", 0);
s4 = linklookup(ctxt, ".machosymstr", 0);
// Force the linkedit section to end on a 16-byte
// boundary. This allows pure (non-cgo) Go binaries
// to be code signed correctly.
//
// Apple's codesign_allocate (a helper utility for
// the codesign utility) can do this fine itself if
// it is run on a dynamic Mach-O binary. However,
// when it is run on a pure (non-cgo) Go binary, where
// the linkedit section is mostly empty, it fails to
// account for the extra padding that it itself adds
// when adding the LC_CODE_SIGNATURE load command
// (which must be aligned on a 16-byte boundary).
//
// By forcing the linkedit section to end on a 16-byte
// boundary, codesign_allocate will not need to apply
// any alignment padding itself, working around the
// issue.
while(s4->size%16)
adduint8(ctxt, s4, 0);
size = s1->size + s2->size + s3->size + s4->size;
if(size > 0) {
linkoff = rnd(HEADR+segtext.len, INITRND) + rnd(segdata.filelen, INITRND) + rnd(segdwarf.filelen, INITRND);
cseek(linkoff);
cwrite(s1->p, s1->size);
cwrite(s2->p, s2->size);
cwrite(s3->p, s3->size);
cwrite(s4->p, s4->size);
}
return rnd(size, INITRND);
}
void
machorelocsect(Section *sect, LSym *first)
{
LSym *sym;
int32 eaddr;
Reloc *r;
// If main section has no bits, nothing to relocate.
if(sect->vaddr >= sect->seg->vaddr + sect->seg->filelen)
return;
sect->reloff = cpos();
for(sym = first; sym != nil; sym = sym->next) {
if(!sym->reachable)
continue;
if(sym->value >= sect->vaddr)
break;
}
eaddr = sect->vaddr + sect->len;
for(; sym != nil; sym = sym->next) {
if(!sym->reachable)
continue;
if(sym->value >= eaddr)
break;
ctxt->cursym = sym;
for(r = sym->r; r < sym->r+sym->nr; r++) {
if(r->done)
continue;
if(machoreloc1(r, sym->value+r->off - sect->vaddr) < 0)
diag("unsupported obj reloc %d/%d to %s", r->type, r->siz, r->sym->name);
}
}
sect->rellen = cpos() - sect->reloff;
}
void
machoemitreloc(void)
{
Section *sect;
while(cpos()&7)
cput(0);
machorelocsect(segtext.sect, ctxt->textp);
for(sect=segtext.sect->next; sect!=nil; sect=sect->next)
machorelocsect(sect, datap);
for(sect=segdata.sect; sect!=nil; sect=sect->next)
machorelocsect(sect, datap);
}
| 21.910053 | 119 | 0.611688 |
6346785ccd6f11648da9506cac1c0c49ba8c164e | 9,421 | h | C | Code/Engine/Core/World/Declarations.h | alinoctavian/ezEngine | 0312c8d777c05ac58911f3fa879e4fd7efcfcb66 | [
"MIT"
] | null | null | null | Code/Engine/Core/World/Declarations.h | alinoctavian/ezEngine | 0312c8d777c05ac58911f3fa879e4fd7efcfcb66 | [
"MIT"
] | null | null | null | Code/Engine/Core/World/Declarations.h | alinoctavian/ezEngine | 0312c8d777c05ac58911f3fa879e4fd7efcfcb66 | [
"MIT"
] | 1 | 2022-03-28T15:57:46.000Z | 2022-03-28T15:57:46.000Z | #pragma once
#include <Foundation/Memory/BlockStorage.h>
#include <Foundation/Memory/LargeBlockAllocator.h>
#include <Foundation/Reflection/Reflection.h>
#include <Foundation/Types/Bitflags.h>
#include <Foundation/Types/Id.h>
#include <Core/CoreDLL.h>
class ezWorld;
class ezSpatialSystem;
class ezCoordinateSystemProvider;
namespace ezInternal
{
class WorldData;
enum
{
DEFAULT_BLOCK_SIZE = 1024 * 4
};
typedef ezLargeBlockAllocator<DEFAULT_BLOCK_SIZE> WorldLargeBlockAllocator;
} // namespace ezInternal
class ezGameObject;
struct ezGameObjectDesc;
class ezComponentManagerBase;
class ezComponent;
struct ezMsgDeleteGameObject;
/// \brief Internal game object id used by ezGameObjectHandle.
struct ezGameObjectId
{
typedef ezUInt64 StorageType;
EZ_DECLARE_ID_TYPE(ezGameObjectId, 32, 8);
EZ_FORCE_INLINE ezGameObjectId(StorageType instanceIndex, ezUInt8 generation, ezUInt8 worldIndex = 0)
{
m_Data = 0;
m_InstanceIndex = static_cast<ezUInt32>(instanceIndex);
m_Generation = generation;
m_WorldIndex = worldIndex;
}
union
{
StorageType m_Data;
struct
{
ezUInt32 m_InstanceIndex;
ezUInt8 m_Generation;
ezUInt8 m_WorldIndex;
ezUInt16 m_Padding;
};
};
};
/// \brief A handle to a game object.
///
/// Never store a direct pointer to a game object. Always store a handle instead. A pointer to a game object can
/// be received by calling ezWorld::TryGetObject with the handle.
/// Note that the object might have been deleted so always check the return value of TryGetObject.
struct ezGameObjectHandle
{
EZ_DECLARE_HANDLE_TYPE(ezGameObjectHandle, ezGameObjectId);
friend class ezWorld;
friend class ezGameObject;
};
/// \brief HashHelper implementation so game object handles can be used as key in a hash table.
template <>
struct ezHashHelper<ezGameObjectHandle>
{
EZ_ALWAYS_INLINE static ezUInt32 Hash(ezGameObjectHandle value) { return ezHashHelper<ezUInt64>::Hash(value.GetInternalID().m_Data); }
EZ_ALWAYS_INLINE static bool Equal(ezGameObjectHandle a, ezGameObjectHandle b) { return a == b; }
};
/// \brief Internal component id used by ezComponentHandle.
struct ezComponentId
{
typedef ezUInt64 StorageType;
EZ_DECLARE_ID_TYPE(ezComponentId, 32, 8);
EZ_ALWAYS_INLINE ezComponentId(StorageType instanceIndex, ezUInt8 generation, ezUInt16 typeId = 0, ezUInt8 worldIndex = 0)
{
m_Data = 0;
m_InstanceIndex = static_cast<ezUInt32>(instanceIndex);
m_Generation = generation;
m_TypeId = typeId;
m_WorldIndex = worldIndex;
}
union
{
StorageType m_Data;
struct
{
ezUInt32 m_InstanceIndex;
ezUInt8 m_Generation;
ezUInt8 m_WorldIndex;
ezUInt16 m_TypeId;
};
};
};
/// \brief A handle to a component.
///
/// Never store a direct pointer to a component. Always store a handle instead. A pointer to a component can
/// be received by calling ezWorld::TryGetComponent or TryGetComponent on the corresponding component manager.
/// Note that the component might have been deleted so always check the return value of TryGetComponent.
struct ezComponentHandle
{
EZ_DECLARE_HANDLE_TYPE(ezComponentHandle, ezComponentId);
friend class ezWorld;
friend class ezComponentManagerBase;
friend class ezComponent;
};
/// \brief HashHelper implementation so component handles can be used as key in a hashtable.
template <>
struct ezHashHelper<ezComponentHandle>
{
EZ_ALWAYS_INLINE static ezUInt32 Hash(ezComponentHandle value)
{
ezComponentId id = value.GetInternalID();
ezUInt64 data = *reinterpret_cast<ezUInt64*>(&id);
return ezHashHelper<ezUInt64>::Hash(data);
}
EZ_ALWAYS_INLINE static bool Equal(ezComponentHandle a, ezComponentHandle b) { return a == b; }
};
/// \brief Internal flags of game objects or components.
struct ezObjectFlags
{
typedef ezUInt32 StorageType;
enum Enum
{
None = 0,
Dynamic = EZ_BIT(0), ///< Usually detected automatically. A dynamic object will not cache render data across frames.
ForceDynamic = EZ_BIT(1), ///< Set by the user to enforce the 'Dynamic' mode. Necessary when user code (or scripts) should change
///< objects, and the automatic detection cannot know that.
ActiveFlag = EZ_BIT(2), ///< The object/component has the 'active flag' set
ActiveState = EZ_BIT(3), ///< The object/component and all its parents have the active flag
Initialized = EZ_BIT(4), ///< The object/component has been initialized
Initializing = EZ_BIT(5), ///< The object/component is currently initializing. Used to prevent recursions during initialization.
SimulationStarted = EZ_BIT(6), ///< OnSimulationStarted() has been called on the component
SimulationStarting = EZ_BIT(7), ///< Used to prevent recursion during OnSimulationStarted()
UnhandledMessageHandler = EZ_BIT(8), ///< For components, when a message is not handled, a virtual function is called
ChildChangesNotifications = EZ_BIT(9), ///< The object should send a notification message when children are added or removed.
ComponentChangesNotifications = EZ_BIT(10), ///< The object should send a notification message when components are added or removed.
StaticTransformChangesNotifications = EZ_BIT(11), ///< The object should send a notification message if it is static and its transform changes.
UserFlag0 = EZ_BIT(24),
UserFlag1 = EZ_BIT(25),
UserFlag2 = EZ_BIT(26),
UserFlag3 = EZ_BIT(27),
UserFlag4 = EZ_BIT(28),
UserFlag5 = EZ_BIT(29),
UserFlag6 = EZ_BIT(30),
UserFlag7 = EZ_BIT(31),
Default = None
};
struct Bits
{
StorageType Dynamic : 1;
StorageType ForceDynamic : 1;
StorageType ActiveFlag : 1;
StorageType ActiveState : 1;
StorageType Initialized : 1;
StorageType Initializing : 1;
StorageType SimulationStarted : 1;
StorageType SimulationStarting : 1;
StorageType UnhandledMessageHandler : 1;
StorageType ChildChangesNotifications : 1;
StorageType ComponentChangesNotifications : 1;
StorageType Padding : 13;
StorageType UserFlag0 : 1;
StorageType UserFlag1 : 1;
StorageType UserFlag2 : 1;
StorageType UserFlag3 : 1;
StorageType UserFlag4 : 1;
StorageType UserFlag5 : 1;
StorageType UserFlag6 : 1;
StorageType UserFlag7 : 1;
};
};
EZ_DECLARE_FLAGS_OPERATORS(ezObjectFlags);
/// \brief Specifies the mode of an object. This enum is only used in the editor.
///
/// \sa ezObjectFlags
struct ezObjectMode
{
typedef ezUInt8 StorageType;
enum Enum : ezUInt8
{
Automatic,
ForceDynamic,
Default = Automatic
};
};
EZ_DECLARE_REFLECTABLE_TYPE(EZ_CORE_DLL, ezObjectMode);
/// \brief Specifies the mode of a component. Dynamic components may change an object's transform, static components must not.
///
/// \sa ezObjectFlags
struct ezComponentMode
{
enum Enum
{
Static,
Dynamic
};
};
/// \brief Specifies at which phase the queued message should be processed.
struct ezObjectMsgQueueType
{
enum Enum
{
PostAsync, ///< Process the message in the PostAsync phase.
PostTransform, ///< Process the message in the PostTransform phase.
NextFrame, ///< Process the message in the PreAsync phase of the next frame.
AfterInitialized, ///< Process the message after new components have been initialized.
COUNT
};
};
/// \brief Certain components may delete themselves or their owner when they are finished with their main purpose
struct EZ_CORE_DLL ezOnComponentFinishedAction
{
typedef ezUInt8 StorageType;
enum Enum
{
None,
DeleteComponent,
DeleteGameObject,
Default = None
};
// helper function
static void HandleFinishedAction(ezComponent* pComponent, ezOnComponentFinishedAction::Enum action);
static void HandleDeleteObjectMsg(ezMsgDeleteGameObject& msg, ezEnum<ezOnComponentFinishedAction>& action);
};
EZ_DECLARE_REFLECTABLE_TYPE(EZ_CORE_DLL, ezOnComponentFinishedAction);
/// \brief Same as ezOnComponentFinishedAction, but additionally includes 'Restart'
struct EZ_CORE_DLL ezOnComponentFinishedAction2
{
typedef ezUInt8 StorageType;
enum Enum
{
None,
DeleteComponent,
DeleteGameObject,
Restart,
Default = None
};
// helper function
static void HandleFinishedAction(ezComponent* pComponent, ezOnComponentFinishedAction2::Enum action);
static void HandleDeleteObjectMsg(ezMsgDeleteGameObject& msg, ezEnum<ezOnComponentFinishedAction2>& action);
};
EZ_DECLARE_REFLECTABLE_TYPE(EZ_CORE_DLL, ezOnComponentFinishedAction2);
/// \brief Used as return value of visitor functions to define whether calling function should stop or continue visiting.
struct ezVisitorExecution
{
enum Enum
{
Continue, ///< Continue regular iteration
Skip, ///< In a depth-first iteration mode this will skip the entire sub-tree below the current object
Stop ///< Stop the entire iteration
};
};
typedef ezGenericId<24, 8> ezSpatialDataId;
class ezSpatialDataHandle
{
EZ_DECLARE_HANDLE_TYPE(ezSpatialDataHandle, ezSpatialDataId);
};
typedef ezUInt16 ezWorldModuleTypeId;
typedef ezGenericId<24, 8> ezComponentInitBatchId;
class ezComponentInitBatchHandle
{
EZ_DECLARE_HANDLE_TYPE(ezComponentInitBatchHandle, ezComponentInitBatchId);
};
| 29.719243 | 147 | 0.732406 |
e42913897b04af9af062bf00574423a4ceaa47eb | 983 | h | C | include/so3g_numpy.h | tskisner/so3g | 75c1d8dea84f862bdd2c9fa2c2f9d1c5b8da5eec | [
"MIT"
] | 5 | 2019-09-02T14:17:31.000Z | 2022-01-21T16:43:14.000Z | include/so3g_numpy.h | tskisner/so3g | 75c1d8dea84f862bdd2c9fa2c2f9d1c5b8da5eec | [
"MIT"
] | 70 | 2019-05-16T23:42:40.000Z | 2022-03-23T14:35:35.000Z | include/so3g_numpy.h | tskisner/so3g | 75c1d8dea84f862bdd2c9fa2c2f9d1c5b8da5eec | [
"MIT"
] | 2 | 2020-05-17T18:20:33.000Z | 2020-10-22T20:35:44.000Z | #pragma once
// Source files, except for main.cxx, need to define NO_IMPORT_ARRAY
// before importing this file.
//
// Some macro defines are necessary when working with numpy C api
// across multiple translation units (i.e. source files):
//
// - https://sourceforge.net/p/numpy/mailman/message/5700519/
// - https://stackoverflow.com/questions/38003707/trouble-with-numpy-c-api
//
// As a result, independently of the boost numpy stuff, we need to
// tell numpy to drop in a single copy of the initialized API function
// pointers. All files using the API should define the
// PY_ARRAY_UNIQUE_SYMBOL variable to the same value (by including
// this header file). Then we call import_array() in one of those
// source files (main.cxx), and define NO_IMPORT_ARRAY in the others.
// Then, from this header file, it is safe to include arrayobject.h.
#define PY_ARRAY_UNIQUE_SYMBOL Py_Array_API_SO3G
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>
| 40.958333 | 74 | 0.768057 |
ebc0cc3b7507cb4215398ae563ae0c42e2804391 | 667 | h | C | unsorted_include_todo/JPAFieldGravity.h | projectPiki/pikmin2 | a431d992acde856d092889a515ecca0e07a3ea7c | [
"Unlicense"
] | 33 | 2021-12-08T11:10:59.000Z | 2022-03-26T19:59:37.000Z | unsorted_include_todo/JPAFieldGravity.h | projectPiki/pikmin2 | a431d992acde856d092889a515ecca0e07a3ea7c | [
"Unlicense"
] | 6 | 2021-12-22T17:54:31.000Z | 2022-01-07T21:43:18.000Z | unsorted_include_todo/JPAFieldGravity.h | projectPiki/pikmin2 | a431d992acde856d092889a515ecca0e07a3ea7c | [
"Unlicense"
] | 2 | 2022-01-04T06:00:49.000Z | 2022-01-26T07:27:28.000Z | #ifndef _JPAFIELDGRAVITY_H
#define _JPAFIELDGRAVITY_H
/*
__vt__15JPAFieldGravity:
.4byte 0
.4byte 0
.4byte __dt__15JPAFieldGravityFv
.4byte prepare__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlock
.4byte
calc__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle
.4byte 0
*/
struct JPAFieldGravity {
virtual ~JPAFieldGravity(); // _00
virtual void prepare(JPAEmitterWorkData*, JPAFieldBlock*); // _04
virtual void calc(JPAEmitterWorkData*, JPAFieldBlock*,
JPABaseParticle*); // _08
virtual void _0C() = 0; // _0C
// _00 VTBL
};
#endif
| 25.653846 | 82 | 0.695652 |
173cd4ea27e31fad03e3d0c964dca4d991a85e04 | 2,228 | c | C | eclipse-mosquitto/test/unit/persist_write_stubs.c | HenriqueBuzin/mosquitto-eclipse-mqtt | 00468923fcf70eefdf2c707b6ba9bdd4f859faf2 | [
"Unlicense"
] | 2 | 2021-04-20T14:28:59.000Z | 2021-05-06T07:46:53.000Z | eclipse-mosquitto/test/unit/persist_write_stubs.c | HenriqueBuzin/mosquitto-eclipse-mqtt | 00468923fcf70eefdf2c707b6ba9bdd4f859faf2 | [
"Unlicense"
] | null | null | null | eclipse-mosquitto/test/unit/persist_write_stubs.c | HenriqueBuzin/mosquitto-eclipse-mqtt | 00468923fcf70eefdf2c707b6ba9bdd4f859faf2 | [
"Unlicense"
] | null | null | null | #include <time.h>
#define WITH_BROKER
#include <logging_mosq.h>
#include <memory_mosq.h>
#include <mosquitto_broker_internal.h>
#include <net_mosq.h>
#include <send_mosq.h>
#include <time_mosq.h>
extern uint64_t last_retained;
extern char *last_sub;
extern int last_qos;
struct mosquitto *context__init(mosq_sock_t sock)
{
UNUSED(sock);
return mosquitto__calloc(1, sizeof(struct mosquitto));
}
int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt, ...)
{
UNUSED(mosq);
UNUSED(priority);
UNUSED(fmt);
return 0;
}
time_t mosquitto_time(void)
{
return 123;
}
int net__socket_close(struct mosquitto *mosq)
{
UNUSED(mosq);
return MOSQ_ERR_SUCCESS;
}
int send__pingreq(struct mosquitto *mosq)
{
UNUSED(mosq);
return MOSQ_ERR_SUCCESS;
}
int mosquitto_acl_check(struct mosquitto *context, const char *topic, uint32_t payloadlen, void* payload, uint8_t qos, bool retain, int access)
{
UNUSED(context);
UNUSED(topic);
UNUSED(payloadlen);
UNUSED(payload);
UNUSED(qos);
UNUSED(retain);
UNUSED(access);
return MOSQ_ERR_SUCCESS;
}
int acl__find_acls(struct mosquitto *context)
{
UNUSED(context);
return MOSQ_ERR_SUCCESS;
}
int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, uint8_t qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval)
{
UNUSED(mosq);
UNUSED(mid);
UNUSED(topic);
UNUSED(payloadlen);
UNUSED(payload);
UNUSED(qos);
UNUSED(retain);
UNUSED(dup);
UNUSED(cmsg_props);
UNUSED(store_props);
UNUSED(expiry_interval);
return MOSQ_ERR_SUCCESS;
}
int send__pubcomp(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties)
{
UNUSED(mosq);
UNUSED(mid);
UNUSED(properties);
return MOSQ_ERR_SUCCESS;
}
int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, const mosquitto_property *properties)
{
UNUSED(mosq);
UNUSED(mid);
UNUSED(reason_code);
UNUSED(properties);
return MOSQ_ERR_SUCCESS;
}
int send__pubrel(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties)
{
UNUSED(mosq);
UNUSED(mid);
UNUSED(properties);
return MOSQ_ERR_SUCCESS;
}
| 19.206897 | 255 | 0.763465 |
0245221ff5dc98f4f585570421b1a3a843778064 | 7,811 | h | C | src/CX_Logger.h | hardmanko/ofxCX | 0d1276e4ba8c25a0803da7b03088da24d8871f38 | [
"MIT"
] | 7 | 2015-02-19T21:21:34.000Z | 2022-03-18T13:38:20.000Z | src/CX_Logger.h | hardmanko/ofxCX | 0d1276e4ba8c25a0803da7b03088da24d8871f38 | [
"MIT"
] | null | null | null | src/CX_Logger.h | hardmanko/ofxCX | 0d1276e4ba8c25a0803da7b03088da24d8871f38 | [
"MIT"
] | 4 | 2018-02-16T12:56:13.000Z | 2022-03-23T01:27:33.000Z | #pragma once
#include <sstream>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <stdio.h> //vsnprintf
#include <stdarg.h> //va_args
#include "Poco/Mutex.h"
#include "ofUtils.h"
#include "ofFileUtils.h"
#include "ofEvents.h"
#include "ofLog.h"
#include "CX_Clock.h"
/*! \defgroup errorLogging Message Logging
This module is designed for logging error, warnings, and other messages. The primary interface is the CX_Logger class,
in particular the preinstantiated CX::Instances::Log.
*/
namespace CX {
namespace Private {
//Forward declarations of internally used structs and classes
struct CX_LogMessage;
struct CX_LoggerTargetInfo;
class CX_LoggerChannel;
struct CX_ofLogMessageEventData_t;
class CX_LogMessageSink;
}
/*! This class is used for logging messages throughout the CX backend code. It can also be used
in user code to log messages. Rather than instantiating your own copy of CX_Logger, it is much
better to use the preinstantiated \ref CX::Instances::Log.
example-logging shows a number of the features of CX_Logger.
CX_Logger is designed to help prevent timing errors. Messages can be logged at any time during
program execution. If these messages were immediately outputted to the console or to files,
it could disrupt a timing-critical section of code. For this reason, logged messages are stored
by the CX_Logger until the user requests that all stored messages be outputted to the logging
targets with CX_Logger::flush(). The user can choose an appropriate, non-timing-critical time
at which to call flush().
By default, messages are logged to the console window that opens with CX programs. Optionally,
messages can also be logged to any number of files using CX_Logger::levelForFile(). For each
logging target (i.e. the console and the logfiles), you can filter out less severe messages.
For example, you could have two log files, one of which contains all messages and the other
of which only contains errors and fatal errors. By default, no logfiles are created and
all messages (with only a few exceptions) are logged to the console. There are a few openFrameworks
classes that are extremely verbose, like ofFbo, and less severe messages from those classes
are suppressed by default. You can undo this behavior by simply calling CX_Logger::levelForAllModules()
with CX_Logger::Level::LOG_ALL as the argument.
This class is designed to be partially thread safe. It is safe to use any of the message logging
functions (log(), verbose(), notice(), warning(), error(), and fatalError()) in multiple threads
at once. Other than those functions, the other functions should be called only from one thread
(the main thread).
\ingroup errorLogging */
class CX_Logger {
public:
/*! \enum Level
Log levels for log messages. Depending on the log level chosen, the name of the level will be printed before the message.
Depending on the settings set using level(), levelForConsole(), or levelForFile(), if the log level of a message is below
the level set for the module or logging target it will not be printed. For example, if LOG_ERROR is the level for the console
and LOG_NOTICE is the level for the module "test", then messages logged to the "test" module will be completely ignored if
at verbose level (because of the module setting) and will not be printed to the console if they are below the level of an
error (because of the console setting).
\ingroup errorLogging
*/
enum class Level : int {
//These rely on numeric values being ordered: Do not change the values.
LOG_ALL = 0, //This is functionally identical to LOG_VERBOSE, but it is more clear about what it does.
LOG_VERBOSE = 1,
LOG_NOTICE = 2,
LOG_WARNING = 3,
LOG_ERROR = 4,
LOG_FATAL_ERROR = 5,
LOG_NONE = 6
};
/*! If a user function is listening for flush callbacks by using setMessageFlushCallback(), each time the user
function is called, it gets a reference to an instance of this struct with all the information filled in. */
struct MessageFlushData {
MessageFlushData(void) :
message(""),
level(CX_Logger::Level::LOG_FATAL_ERROR),
module("")
{}
/*! Convenience constructor which constructs an instance of the struct with the provided values. */
MessageFlushData(std::string message_, CX_Logger::Level level_, std::string module_) :
message(message_),
level(level_),
module(module_)
{}
std::string message; //!< A string containing the logged message.
Level level; //!< The log level of the message.
std::string module; //!< The module associated with the message, usually which created the message.
};
CX_Logger(void);
~CX_Logger(void);
CX::Private::CX_LogMessageSink log(Level level, std::string module = "");
CX::Private::CX_LogMessageSink verbose(std::string module = "");
CX::Private::CX_LogMessageSink notice(std::string module = "");
CX::Private::CX_LogMessageSink warning(std::string module = "");
CX::Private::CX_LogMessageSink error(std::string module = "");
CX::Private::CX_LogMessageSink fatalError(std::string module = "");
CX::Private::CX_LogMessageSink operator()(std::string module = "");
void flush(void);
void clear(void);
void levelForModule(Level level, std::string module);
void levelForAllModules(Level level);
void levelForConsole (Level level);
void levelForFile(Level level, std::string filename = "CX_LOGGER_DEFAULT");
void levelForAllExceptions(Level level);
void levelForExceptions(Level level, std::string module);
Level getModuleLevel(std::string module);
void timestamps(bool logTimestamps, std::string format = "%H:%M:%S.%i");
/*! When flush() is called, listeners to `flushEvent` will be passed a `MessageFlushData` struct
for each message in the queue. No filtering is performed: All messages regardless of the module
log level will be sent to listeners. */
ofEvent<const MessageFlushData&> flushEvent;
void captureOFLogMessages(bool capture);
private:
std::vector<CX::Private::CX_LoggerTargetInfo> _targetInfo;
Poco::Mutex _messageQueueMutex;
std::vector<CX::Private::CX_LogMessage> _messageQueue;
Poco::Mutex _moduleLogLevelsMutex;
std::map<std::string, Level> _moduleLogLevels;
CX::Private::CX_LogMessageSink _log(Level level, std::string module);
friend class CX::Private::CX_LogMessageSink;
void _storeLogMessage(CX::Private::CX_LogMessageSink& msg);
bool _logTimestamps;
std::string _timestampFormat;
Level _defaultLogLevel;
Poco::Mutex _exceptionLevelsMutex;
std::map<std::string, Level> _exceptionLevels;
Level _defaultExceptionLevel;
std::shared_ptr<CX::Private::CX_LoggerChannel> _ofLoggerChannel;
void _loggerChannelEventHandler(CX::Private::CX_ofLogMessageEventData_t& md);
static std::string _getLogLevelString(Level level);
std::string _formatMessage(const CX::Private::CX_LogMessage& message);
};
namespace Instances {
extern CX_Logger Log;
}
namespace Private {
//This class is based very directly on ofLog, except that it has a private constructor
//so that it can only be made by a CX_Logger.
class CX_LogMessageSink {
public:
~CX_LogMessageSink(void) noexcept(false);
CX_LogMessageSink& operator<<(std::ostream& (*func)(std::ostream&));
template <class T>
CX_LogMessageSink& operator<<(const T& value) {
*_message << value;
return *this;
}
private:
friend class CX::CX_Logger;
CX_LogMessageSink(void);
CX_LogMessageSink(CX_LogMessageSink&& ms);
CX_LogMessageSink(CX::CX_Logger* logger, CX::CX_Logger::Level level, std::string module);
CX_Logger* _logger;
std::shared_ptr<std::ostringstream> _message;
CX::CX_Logger::Level _level;
std::string _module;
};
}
}
| 36.671362 | 127 | 0.747151 |
77be4e7957fe5cb5222179a4d942f8c8fa17251b | 10,902 | c | C | xen-4.6.0/tools/libvchan/init.c | StanPlatinum/VMI-as-a-Service | 5828a9c73815ad7e043428e7e56dc0715aaa60a1 | [
"MIT"
] | 3 | 2019-08-31T19:58:24.000Z | 2020-10-02T06:50:22.000Z | xen-4.6.0/tools/libvchan/init.c | StanPlatinum/VMI-as-a-Service | 5828a9c73815ad7e043428e7e56dc0715aaa60a1 | [
"MIT"
] | 1 | 2020-10-16T19:13:49.000Z | 2020-10-16T19:13:49.000Z | xen-4.6.0/tools/libvchan/init.c | StanPlatinum/ROP-detection-inside-VMs | 7b39298dd0791711cbd78fd0730b819b755cc995 | [
"MIT"
] | 1 | 2018-10-04T18:29:18.000Z | 2018-10-04T18:29:18.000Z | /**
* @file
* @section AUTHORS
*
* Copyright (C) 2010 Rafal Wojtczuk <rafal@invisiblethingslab.com>
*
* Authors:
* Rafal Wojtczuk <rafal@invisiblethingslab.com>
* Daniel De Graaf <dgdegra@tycho.nsa.gov>
*
* @section LICENSE
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; If not, see <http://www.gnu.org/licenses/>.
*
* @section DESCRIPTION
*
* This file contains the setup code used to establish the ring buffer.
*/
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/user.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <xenstore.h>
#include <xen/sys/evtchn.h>
#include <xen/sys/gntalloc.h>
#include <xen/sys/gntdev.h>
#include <libxenvchan.h>
#ifndef PAGE_SHIFT
#define PAGE_SHIFT 12
#endif
#ifndef PAGE_SIZE
#define PAGE_SIZE 4096
#endif
#define SMALL_RING_SHIFT 10
#define LARGE_RING_SHIFT 11
#define MAX_SMALL_RING (1 << SMALL_RING_SHIFT)
#define SMALL_RING_OFFSET 1024
#define MAX_LARGE_RING (1 << LARGE_RING_SHIFT)
#define LARGE_RING_OFFSET 2048
// if you go over this size, you'll have too many grants to fit in the shared page.
#define MAX_RING_SHIFT 20
#define MAX_RING_SIZE (1 << MAX_RING_SHIFT)
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
#define max(a,b) ((a > b) ? a : b)
static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
{
int pages_left = ctrl->read.order >= PAGE_SHIFT ? 1 << (ctrl->read.order - PAGE_SHIFT) : 0;
int pages_right = ctrl->write.order >= PAGE_SHIFT ? 1 << (ctrl->write.order - PAGE_SHIFT) : 0;
uint32_t ring_ref = -1;
void *ring;
ring = xc_gntshr_share_page_notify(ctrl->gntshr, domain,
&ring_ref, 1, offsetof(struct vchan_interface, srv_live),
ctrl->event_port);
if (!ring)
goto out;
memset(ring, 0, PAGE_SIZE);
ctrl->ring = ring;
ctrl->read.shr = &ctrl->ring->left;
ctrl->write.shr = &ctrl->ring->right;
ctrl->ring->left_order = ctrl->read.order;
ctrl->ring->right_order = ctrl->write.order;
ctrl->ring->cli_live = 2;
ctrl->ring->srv_live = 1;
ctrl->ring->cli_notify = VCHAN_NOTIFY_WRITE;
switch (ctrl->read.order) {
case SMALL_RING_SHIFT:
ctrl->read.buffer = ((void*)ctrl->ring) + SMALL_RING_OFFSET;
break;
case LARGE_RING_SHIFT:
ctrl->read.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
break;
default:
ctrl->read.buffer = xc_gntshr_share_pages(ctrl->gntshr, domain,
pages_left, ctrl->ring->grants, 1);
if (!ctrl->read.buffer)
goto out_ring;
}
switch (ctrl->write.order) {
case SMALL_RING_SHIFT:
ctrl->write.buffer = ((void*)ctrl->ring) + SMALL_RING_OFFSET;
break;
case LARGE_RING_SHIFT:
ctrl->write.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
break;
default:
ctrl->write.buffer = xc_gntshr_share_pages(ctrl->gntshr, domain,
pages_right, ctrl->ring->grants + pages_left, 1);
if (!ctrl->write.buffer)
goto out_unmap_left;
}
out:
return ring_ref;
out_unmap_left:
if (pages_left)
xc_gntshr_munmap(ctrl->gntshr, ctrl->read.buffer, pages_left);
out_ring:
xc_gntshr_munmap(ctrl->gntshr, ring, 1);
ring_ref = -1;
ctrl->ring = NULL;
ctrl->write.order = ctrl->read.order = 0;
goto out;
}
static int init_gnt_cli(struct libxenvchan *ctrl, int domain, uint32_t ring_ref)
{
int rv = -1;
uint32_t *grants;
ctrl->ring = xc_gnttab_map_grant_ref_notify(ctrl->gnttab,
domain, ring_ref, PROT_READ|PROT_WRITE,
offsetof(struct vchan_interface, cli_live), ctrl->event_port);
if (!ctrl->ring)
goto out;
ctrl->write.order = ctrl->ring->left_order;
ctrl->read.order = ctrl->ring->right_order;
ctrl->write.shr = &ctrl->ring->left;
ctrl->read.shr = &ctrl->ring->right;
if (ctrl->write.order < SMALL_RING_SHIFT || ctrl->write.order > MAX_RING_SHIFT)
goto out_unmap_ring;
if (ctrl->read.order < SMALL_RING_SHIFT || ctrl->read.order > MAX_RING_SHIFT)
goto out_unmap_ring;
if (ctrl->read.order == ctrl->write.order && ctrl->read.order < PAGE_SHIFT)
goto out_unmap_ring;
grants = ctrl->ring->grants;
switch (ctrl->write.order) {
case SMALL_RING_SHIFT:
ctrl->write.buffer = ((void*)ctrl->ring) + SMALL_RING_OFFSET;
break;
case LARGE_RING_SHIFT:
ctrl->write.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
break;
default:
{
int pages_left = 1 << (ctrl->write.order - PAGE_SHIFT);
ctrl->write.buffer = xc_gnttab_map_domain_grant_refs(ctrl->gnttab,
pages_left, domain, grants, PROT_READ|PROT_WRITE);
if (!ctrl->write.buffer)
goto out_unmap_ring;
grants += pages_left;
}
}
switch (ctrl->read.order) {
case SMALL_RING_SHIFT:
ctrl->read.buffer = ((void*)ctrl->ring) + SMALL_RING_OFFSET;
break;
case LARGE_RING_SHIFT:
ctrl->read.buffer = ((void*)ctrl->ring) + LARGE_RING_OFFSET;
break;
default:
{
int pages_right = 1 << (ctrl->read.order - PAGE_SHIFT);
ctrl->read.buffer = xc_gnttab_map_domain_grant_refs(ctrl->gnttab,
pages_right, domain, grants, PROT_READ);
if (!ctrl->read.buffer)
goto out_unmap_left;
}
}
rv = 0;
out:
return rv;
out_unmap_left:
if (ctrl->write.order >= PAGE_SHIFT)
xc_gnttab_munmap(ctrl->gnttab, ctrl->write.buffer,
1 << (ctrl->write.order - PAGE_SHIFT));
out_unmap_ring:
xc_gnttab_munmap(ctrl->gnttab, ctrl->ring, 1);
ctrl->ring = 0;
ctrl->write.order = ctrl->read.order = 0;
rv = -1;
goto out;
}
static int init_evt_srv(struct libxenvchan *ctrl, int domain, xentoollog_logger *logger)
{
evtchn_port_or_error_t port;
ctrl->event = xc_evtchn_open(logger, 0);
if (!ctrl->event)
return -1;
port = xc_evtchn_bind_unbound_port(ctrl->event, domain);
if (port < 0)
goto fail;
ctrl->event_port = port;
if (xc_evtchn_unmask(ctrl->event, ctrl->event_port))
goto fail;
return 0;
fail:
if (port >= 0)
xc_evtchn_unbind(ctrl->event, port);
xc_evtchn_close(ctrl->event);
ctrl->event = NULL;
return -1;
}
static int init_xs_srv(struct libxenvchan *ctrl, int domain, const char* xs_base, int ring_ref)
{
int ret = -1;
struct xs_handle *xs;
struct xs_permissions perms[2];
char buf[64];
char ref[16];
char* domid_str = NULL;
xs = xs_domain_open();
if (!xs)
goto fail;
domid_str = xs_read(xs, 0, "domid", NULL);
if (!domid_str)
goto fail_xs_open;
// owner domain is us
perms[0].id = atoi(domid_str);
// permissions for domains not listed = none
perms[0].perms = XS_PERM_NONE;
// other domains
perms[1].id = domain;
perms[1].perms = XS_PERM_READ;
snprintf(ref, sizeof ref, "%d", ring_ref);
snprintf(buf, sizeof buf, "%s/ring-ref", xs_base);
if (!xs_write(xs, 0, buf, ref, strlen(ref)))
goto fail_xs_open;
if (!xs_set_permissions(xs, 0, buf, perms, 2))
goto fail_xs_open;
snprintf(ref, sizeof ref, "%d", ctrl->event_port);
snprintf(buf, sizeof buf, "%s/event-channel", xs_base);
if (!xs_write(xs, 0, buf, ref, strlen(ref)))
goto fail_xs_open;
if (!xs_set_permissions(xs, 0, buf, perms, 2))
goto fail_xs_open;
ret = 0;
fail_xs_open:
free(domid_str);
xs_daemon_close(xs);
fail:
return ret;
}
static int min_order(size_t siz)
{
int rv = PAGE_SHIFT;
while (siz > (1 << rv))
rv++;
return rv;
}
struct libxenvchan *libxenvchan_server_init(xentoollog_logger *logger, int domain, const char* xs_path, size_t left_min, size_t right_min)
{
struct libxenvchan *ctrl;
int ring_ref;
if (left_min > MAX_RING_SIZE || right_min > MAX_RING_SIZE)
return 0;
ctrl = malloc(sizeof(*ctrl));
if (!ctrl)
return 0;
ctrl->ring = NULL;
ctrl->event = NULL;
ctrl->is_server = 1;
ctrl->server_persist = 0;
ctrl->read.order = min_order(left_min);
ctrl->write.order = min_order(right_min);
// if we can avoid allocating extra pages by using in-page rings, do so
if (left_min <= MAX_SMALL_RING && right_min <= MAX_LARGE_RING) {
ctrl->read.order = SMALL_RING_SHIFT;
ctrl->write.order = LARGE_RING_SHIFT;
} else if (left_min <= MAX_LARGE_RING && right_min <= MAX_SMALL_RING) {
ctrl->read.order = LARGE_RING_SHIFT;
ctrl->write.order = SMALL_RING_SHIFT;
} else if (left_min <= MAX_LARGE_RING) {
ctrl->read.order = LARGE_RING_SHIFT;
} else if (right_min <= MAX_LARGE_RING) {
ctrl->write.order = LARGE_RING_SHIFT;
}
ctrl->gntshr = xc_gntshr_open(logger, 0);
if (!ctrl->gntshr)
goto out;
if (init_evt_srv(ctrl, domain, logger))
goto out;
ring_ref = init_gnt_srv(ctrl, domain);
if (ring_ref < 0)
goto out;
if (init_xs_srv(ctrl, domain, xs_path, ring_ref))
goto out;
return ctrl;
out:
libxenvchan_close(ctrl);
return 0;
}
static int init_evt_cli(struct libxenvchan *ctrl, int domain, xentoollog_logger *logger)
{
evtchn_port_or_error_t port;
ctrl->event = xc_evtchn_open(logger, 0);
if (!ctrl->event)
return -1;
port = xc_evtchn_bind_interdomain(ctrl->event,
domain, ctrl->event_port);
if (port < 0)
goto fail;
ctrl->event_port = port;
if (xc_evtchn_unmask(ctrl->event, ctrl->event_port))
goto fail;
return 0;
fail:
if (port >= 0)
xc_evtchn_unbind(ctrl->event, port);
xc_evtchn_close(ctrl->event);
ctrl->event = NULL;
return -1;
}
struct libxenvchan *libxenvchan_client_init(xentoollog_logger *logger, int domain, const char* xs_path)
{
struct libxenvchan *ctrl = malloc(sizeof(struct libxenvchan));
struct xs_handle *xs = NULL;
char buf[64];
char *ref;
int ring_ref;
unsigned int len;
if (!ctrl)
return 0;
ctrl->ring = NULL;
ctrl->event = NULL;
ctrl->gnttab = NULL;
ctrl->write.order = ctrl->read.order = 0;
ctrl->is_server = 0;
xs = xs_daemon_open();
if (!xs)
xs = xs_domain_open();
if (!xs)
goto fail;
// find xenstore entry
snprintf(buf, sizeof buf, "%s/ring-ref", xs_path);
ref = xs_read(xs, 0, buf, &len);
if (!ref)
goto fail;
ring_ref = atoi(ref);
free(ref);
if (!ring_ref)
goto fail;
snprintf(buf, sizeof buf, "%s/event-channel", xs_path);
ref = xs_read(xs, 0, buf, &len);
if (!ref)
goto fail;
ctrl->event_port = atoi(ref);
free(ref);
if (!ctrl->event_port)
goto fail;
ctrl->gnttab = xc_gnttab_open(logger, 0);
if (!ctrl->gnttab)
goto fail;
// set up event channel
if (init_evt_cli(ctrl, domain, logger))
goto fail;
// set up shared page(s)
if (init_gnt_cli(ctrl, domain, ring_ref))
goto fail;
ctrl->ring->cli_live = 1;
ctrl->ring->srv_notify = VCHAN_NOTIFY_WRITE;
out:
if (xs)
xs_daemon_close(xs);
return ctrl;
fail:
libxenvchan_close(ctrl);
ctrl = NULL;
goto out;
}
| 24.777273 | 138 | 0.697487 |
4f70052e4fadb0e87b4714bc92272bcc02d7aea0 | 28,044 | c | C | libxmlet/src/document.c | cubieb/wive-ng-mt_netcwmp | 7a9f5db32a900a7f4907de431ea467d0cc2b85e9 | [
"Apache-1.1"
] | 2 | 2017-09-14T18:53:08.000Z | 2020-05-20T16:55:04.000Z | libxmlet/src/document.c | noktoborus/wive-ng-mt_netcwmp | 7a9f5db32a900a7f4907de431ea467d0cc2b85e9 | [
"Apache-1.1"
] | null | null | null | libxmlet/src/document.c | noktoborus/wive-ng-mt_netcwmp | 7a9f5db32a900a7f4907de431ea467d0cc2b85e9 | [
"Apache-1.1"
] | 5 | 2017-02-23T03:27:53.000Z | 2020-07-10T12:49:22.000Z | ///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2003 Intel Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include "xmlparser.h"
/*================================================================
* XmlDocumentInit
* It initialize the document structure.
* External function.
*
*=================================================================*/
void
XmlDocumentInit( XmlDocument * doc )
{
memset( doc, 0, sizeof( XmlDocument ) );
}
/*================================================================
* XmlDocumentFree
* It XFREEs the whole document tree.
* External function.
*
*=================================================================*/
void
XmlDocumentFree(
Pool * pool,
XmlDocument * doc )
{
if ( doc != NULL )
{
XmlNodeFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
( XmlNode * ) doc );
}
}
/*================================================================
* XmlDocSetOwnerDocument
*
* When this function is called first time, nodeptr is the root
* of the subtree, so it is not necessay to do two steps
* recursion.
*
* Internal function called by XmlDocImportNode
*
*=================================================================*/
void
XmlDocSetOwnerDocument( XmlDocument * doc,
XmlNode * nodeptr )
{
if ( nodeptr != NULL )
{
nodeptr->ownerDocument = doc;
XmlDocSetOwnerDocument( doc,
XmlNodeGetFirstChild( nodeptr ) );
XmlDocSetOwnerDocument( doc,
XmlNodeGetNextSibling
( nodeptr ) );
}
}
/*================================================================
* XmlDocImportNode
* Imports a node from another document to this document. The
* returned node has no parent; (parentNode is null). The source
* node is not altered or removed from the original document;
* this method creates a new copy of the source node.
* For all nodes, importing a node creates a node object owned
* by the importing document, with attribute values identical to
* the source node's nodeName and nodeType, plus the attributes
* related to namespaces (prefix, localName, and namespaceURI).
* As in the cloneNode operation on a node, the source node is
* not altered.
*
* External function.
*
*=================================================================*/
int
XmlDocImportNode(
Pool * pool,
XmlDocument * doc,
XmlNode * importNode,
IN BOOL deep,
OUT XmlNode ** rtNode )
{
unsigned short nodeType;
XmlNode * newNode;
*rtNode = NULL;
if ( ( doc == NULL ) || ( importNode == NULL ) )
{
return XML_INVALID_PARAMETER;
}
nodeType = XmlNodeGetNodeType( importNode );
if ( nodeType == XML_DOCUMENT_NODE )
{
return XML_NOT_SUPPORTED_ERR;
}
newNode = XmlNodeCloneNode(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
importNode, deep );
if ( newNode == NULL )
{
return XML_FAILED;
}
XmlDocSetOwnerDocument( doc, newNode );
*rtNode = newNode;
return XML_OK;
}
/*================================================================
* XmlDocCreateElementEx
* Creates an element of the type specified.
* External function.
* Parameters:
* doc: pointer to document
* tagName: The name of the element, it is case-sensitive.
* Return Value:
* XML_OK
* XML_INVALID_PARAMETER: if either doc or tagName is NULL
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
*=================================================================*/
int
#ifdef USE_CWMP_MEMORY_POOL
XmlDocCreateElementEx(Pool * pool, XmlDocument * doc,
#else
XmlDocCreateElementEx( XmlDocument * doc,
#endif
IN char * tagName,
OUT XmlElement ** rtElement )
{
int errCode = XML_OK;
XmlElement *newElement = NULL;
if ( ( doc == NULL ) || ( tagName == NULL ) )
{
errCode = XML_INVALID_PARAMETER;
goto ErrorHandler;
}
newElement = ( XmlElement * ) PMALLOC( sizeof( XmlElement ) );
if ( newElement == NULL )
{
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
XmlElementInit( newElement );
newElement->tagName = PSTRDUP( tagName );
if ( newElement->tagName == NULL )
{
XmlElementFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
newElement );
newElement = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
// set the node fields
newElement->node.nodeType = XML_ELEMENT_NODE;
newElement->node.nodeName = PSTRDUP( tagName );
if ( newElement->node.nodeName == NULL )
{
XmlElementFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
newElement );
newElement = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
newElement->node.ownerDocument = doc;
ErrorHandler:
*rtElement = newElement;
return errCode;
}
/*================================================================
* XmlDocCreateElement
* Creates an element of the type specified.
* External function.
* Parameters:
* doc: pointer to document
* tagName: The name of the element, it is case-sensitive.
* Return Value:
* A new element object with the nodeName set to tagName, and
* localName, prefix and namespaceURI set to null.
*
*=================================================================*/
XmlElement *
XmlDocCreateElement(
Pool * pool,
XmlDocument * doc,
IN char * tagName )
{
XmlElement *newElement = NULL;
XmlDocCreateElementEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, tagName, &newElement );
return newElement;
}
/*================================================================
* XmlDocCreateDocumentEx
* Creates an document object
* Internal function.
* Parameters:
* rtDoc: the document created or NULL on failure
* Return Value:
* XML_OK
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
*=================================================================*/
int
XmlDocCreateDocumentEx(
Pool * pool,
OUT XmlDocument ** rtDoc )
{
XmlDocument *doc;
int errCode = XML_OK;
doc = NULL;
doc = ( XmlDocument * ) PMALLOC( sizeof( XmlDocument ) );
if ( doc == NULL )
{
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
XmlDocumentInit( doc );
doc->node.nodeName = PSTRDUP( DOCUMENTNODENAME );
if ( doc->node.nodeName == NULL )
{
XmlDocumentFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc );
doc = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
doc->node.nodeType = XML_DOCUMENT_NODE;
doc->node.ownerDocument = doc;
ErrorHandler:
*rtDoc = doc;
return errCode;
}
/*================================================================
* XmlDocCreateDocument
* Creates an document object
* Internal function.
* Parameters:
* none
* Return Value:
* A new document object with the nodeName set to "#document".
*
*=================================================================*/
XmlDocument *
XmlDocCreateDocument(
#ifdef USE_CWMP_MEMORY_POOL
Pool * pool
#endif
)
{
XmlDocument *doc = NULL;
XmlDocCreateDocumentEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
&doc );
return doc;
}
/*================================================================
* XmlDocCreateTextNodeEx
* Creates an text node.
* External function.
* Parameters:
* data: text data for the text node. It is stored in nodeValue field.
* Return Value:
* XML_OK
* XML_INVALID_PARAMETER: if either doc or data is NULL
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
*=================================================================*/
int
#ifdef USE_CWMP_MEMORY_POOL
XmlDocCreateTextNodeEx(Pool * pool, XmlDocument * doc,
#else
XmlDocCreateTextNodeEx( XmlDocument * doc,
#endif
IN char *data,
OUT XmlNode ** textNode )
{
XmlNode * returnNode;
int rc = XML_OK;
returnNode = NULL;
if ( ( doc == NULL ) || ( data == NULL ) )
{
rc = XML_INVALID_PARAMETER;
goto ErrorHandler;
}
returnNode = ( XmlNode * ) PMALLOC( sizeof( XmlNode ) );
if ( returnNode == NULL )
{
rc = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
// initialize the node
XmlNodeInit( returnNode );
returnNode->nodeName = PSTRDUP( TEXTNODENAME );
if ( returnNode->nodeName == NULL )
{
XmlNodeFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
returnNode );
returnNode = NULL;
rc = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
// add in node value
if ( data != NULL )
{
returnNode->nodeValue = XmlStrduptrim(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
data );
if ( returnNode->nodeValue == NULL )
{
XmlNodeFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
returnNode );
returnNode = NULL;
rc = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
}
returnNode->nodeType = XML_TEXT_NODE;
returnNode->ownerDocument = doc;
ErrorHandler:
*textNode = returnNode;
return rc;
}
/*================================================================
* XmlDocCreateTextNode
* Creates an text node.
* External function.
* Parameters:
* data: text data for the text node. It is stored in nodeValue field.
* Return Value:
* The new text node.
*
*=================================================================*/
XmlNode *
XmlDocCreateTextNode(
Pool * pool,
XmlDocument * doc,
IN char *data )
{
XmlNode * returnNode = NULL;
XmlDocCreateTextNodeEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, data, &returnNode );
return returnNode;
}
/*================================================================
* XmlDocCreateAttributeEx
* Creates an attribute of the given name.
* External function.
* Parameters:
* name: The name of the Attribute node.
* Return Value:
* XML_OK
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
================================================================*/
int
#ifdef USE_CWMP_MEMORY_POOL
XmlDocCreateAttributeEx(Pool * pool, XmlDocument * doc,
#else
XmlDocCreateAttributeEx( XmlDocument * doc,
#endif
const char *name,
XmlAttribute ** rtAttr )
{
XmlAttribute *attrNode = NULL;
int errCode = XML_OK;
attrNode = ( XmlAttribute * ) PMALLOC( sizeof( XmlAttribute ) );
if ( attrNode == NULL )
{
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
if ( ( doc == NULL ) || ( name == NULL ) )
{
XmlAttrFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
attrNode );
attrNode = NULL;
errCode = XML_INVALID_PARAMETER;
goto ErrorHandler;
}
XmlAttrInit( attrNode );
attrNode->node.nodeType = XML_ATTRIBUTE_NODE;
// set the node fields
attrNode->node.nodeName = PSTRDUP( name );
if ( attrNode->node.nodeName == NULL )
{
XmlAttrFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
attrNode );
attrNode = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
attrNode->node.ownerDocument = doc;
ErrorHandler:
*rtAttr = attrNode;
return errCode;
}
/*================================================================
* XmlDocCreateAttribute
* Creates an attribute of the given name.
* External function.
* Parameters:
* name: The name of the Attribute node.
* Return Value:
* A new attr object with the nodeName attribute set to the
* given name, and the localName, prefix and namespaceURI set to NULL.
* The value of the attribute is the empty string.
*
================================================================*/
XmlAttribute *
XmlDocCreateAttribute(
Pool * pool,
XmlDocument * doc,
IN char *name )
{
XmlAttribute *attrNode = NULL;
XmlDocCreateAttributeEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, name, &attrNode );
return attrNode;
}
/*================================================================
* XmlDocCreateAttributeNSEx
* Creates an attrbute of the given name and namespace URI
* External function.
* Parameters:
* namespaceURI: the namespace fo the attribute to create
* qualifiedName: qualifiedName of the attribute to instantiate
* Return Value:
* XML_OK
* XML_INVALID_PARAMETER: if either doc,namespaceURI or qualifiedName is NULL
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
*=================================================================*/
int
XmlDocCreateAttributeNSEx(
Pool * pool,
XmlDocument * doc,
const char * namespaceURI,
const char * qualifiedName,
OUT XmlAttribute ** rtAttr )
{
XmlAttribute *attrNode = NULL;
int errCode = XML_OK;
if ( ( doc == NULL ) || ( namespaceURI == NULL )
|| ( qualifiedName == NULL ) )
{
errCode = XML_INVALID_PARAMETER;
goto ErrorHandler;
}
errCode =
XmlDocCreateAttributeEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, qualifiedName, &attrNode );
if ( errCode != XML_OK )
{
goto ErrorHandler;
}
// set the namespaceURI field
attrNode->node.namespaceURI = PSTRDUP( namespaceURI );
if ( attrNode->node.namespaceURI == NULL )
{
XmlAttrFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
attrNode );
attrNode = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
// set the localName and prefix
errCode =
XmlNodeSetNodeName(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
( XmlNode * ) attrNode, qualifiedName );
if ( errCode != XML_OK )
{
XmlAttrFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
attrNode );
attrNode = NULL;
goto ErrorHandler;
}
ErrorHandler:
*rtAttr = attrNode;
return errCode;
}
/*================================================================
* XmlDocCreateAttributeNS
* Creates an attrbute of the given name and namespace URI
* External function.
* Parameters:
* namespaceURI: the namespace fo the attribute to create
* qualifiedName: qualifiedName of the attribute to instantiate
* Return Value:
* Creates an attribute node with the given namespaceURI and
* qualifiedName. The prefix and localname are extracted from
* the qualifiedName. The node value is empty.
*
*=================================================================*/
XmlAttribute *
XmlDocCreateAttributeNS(
Pool * pool,
XmlDocument * doc,
IN char * namespaceURI,
IN char * qualifiedName )
{
XmlAttribute *attrNode = NULL;
XmlDocCreateAttributeNSEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, namespaceURI, qualifiedName,
&attrNode );
return attrNode;
}
/*================================================================
* XmlDocCreateCDATASectionEx
* Creates an CDATASection node whose value is the specified string
* External function.
* Parameters:
* data: the data for the CDATASection contents.
* Return Value:
* XML_OK
* XML_INVALID_PARAMETER: if either doc or data is NULL
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
*=================================================================*/
int
#ifdef USE_CWMP_MEMORY_POOL
XmlDocCreateCDATASectionEx(Pool * pool, XmlDocument * doc,
#else
XmlDocCreateCDATASectionEx( XmlDocument * doc,
#endif
IN char * data,
OUT XmlCDATASection ** rtCD )
{
int errCode = XML_OK;
XmlCDATASection *cDSectionNode = NULL;
if ( ( doc == NULL ) || ( data == NULL ) )
{
errCode = XML_INVALID_PARAMETER;
goto ErrorHandler;
}
cDSectionNode =
( XmlCDATASection * ) PMALLOC( sizeof( XmlCDATASection ) );
if ( cDSectionNode == NULL )
{
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
XmlCDATASectionInit( cDSectionNode );
cDSectionNode->node.nodeType = XML_CDATA_SECTION_NODE;
cDSectionNode->node.nodeName = PSTRDUP( CDATANODENAME );
if ( cDSectionNode->node.nodeName == NULL )
{
XmlCDATASectionFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
cDSectionNode );
cDSectionNode = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
cDSectionNode->node.nodeValue = XmlStrduptrim(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
data );
if ( cDSectionNode->node.nodeValue == NULL )
{
XmlCDATASectionFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
cDSectionNode );
cDSectionNode = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
cDSectionNode->node.ownerDocument = doc;
ErrorHandler:
*rtCD = cDSectionNode;
return errCode;
}
/*================================================================
* XmlDocCreateCDATASection
* Creates an CDATASection node whose value is the specified string
* External function.
* Parameters:
* data: the data for the CDATASection contents.
* Return Value:
* The new CDATASection object.
*
*=================================================================*/
XmlCDATASection *
XmlDocCreateCDATASection(
Pool * pool,
XmlDocument * doc,
IN char * data )
{
XmlCDATASection *cDSectionNode = NULL;
XmlDocCreateCDATASectionEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, data, &cDSectionNode );
return cDSectionNode;
}
/*================================================================
* XmlDocCreateElementNSEx
* Creates an element of the given qualified name and namespace URI.
* External function.
* Parameters:
* namespaceURI: the namespace URI of the element to create.
* qualifiedName: the qualified name of the element to instantiate.
* Return Value:
* Return Value:
* XML_OK
* XML_INVALID_PARAMETER: if either doc,namespaceURI or qualifiedName is NULL
* XML_INSUFFICIENT_MEMORY: if not enough memory to finish this operations.
*
*=================================================================*/
int
XmlDocCreateElementNSEx(
Pool * pool,
XmlDocument * doc,
IN char * namespaceURI,
IN char * qualifiedName,
OUT XmlElement ** rtElement )
{
XmlElement *newElement = NULL;
int errCode = XML_OK;
if ( ( doc == NULL ) || ( namespaceURI == NULL )
|| ( qualifiedName == NULL ) )
{
errCode = XML_INVALID_PARAMETER;
goto ErrorHandler;
}
errCode =
XmlDocCreateElementEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, qualifiedName, &newElement );
if ( errCode != XML_OK )
{
goto ErrorHandler;
}
// set the namespaceURI field
newElement->node.namespaceURI = PSTRDUP( namespaceURI );
if ( newElement->node.namespaceURI == NULL )
{
XmlElementFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
newElement );
newElement = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
// set the localName and prefix
errCode =
XmlNodeSetNodeName(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
( XmlNode * ) newElement, qualifiedName );
if ( errCode != XML_OK )
{
XmlElementFree(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
newElement );
newElement = NULL;
errCode = XML_INSUFFICIENT_MEMORY;
goto ErrorHandler;
}
newElement->node.nodeValue = NULL;
ErrorHandler:
*rtElement = newElement;
return errCode;
}
/*================================================================
* XmlDocCreateElementNS
* Creates an element of the given qualified name and namespace URI.
* External function.
* Parameters:
* namespaceURI: the namespace URI of the element to create.
* qualifiedName: the qualified name of the element to instantiate.
* Return Value:
* The new element object with tagName qualifiedName, prefix and
* localName extraced from qualfiedName, nodeName of qualfiedName,
* namespaceURI of namespaceURI.
*
*=================================================================*/
XmlElement *
XmlDocCreateElementNS(
Pool * pool,
XmlDocument * doc,
IN char * namespaceURI,
IN char * qualifiedName )
{
XmlElement *newElement = NULL;
XmlDocCreateElementNSEx(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
doc, namespaceURI, qualifiedName,
&newElement );
return newElement;
}
/*================================================================
* XmlDocGetElementsByTagName
* Returns a nodeList of all the Elements with a given tag name
* in the order in which they are encountered in a preorder traversal
* of the document tree.
* External function.
* Parameters:
* tagName: the name of the tag to match on. The special value "*"
* matches all tags.
* Return Value:
* A new nodeList object containing all the matched Elements.
*
*=================================================================*/
XmlNodeList *
XmlDocGetElementsByTagName(
Pool * pool,
XmlDocument * doc,
IN char *tagName )
{
XmlNodeList *returnNodeList = NULL;
if ( ( doc == NULL ) || ( tagName == NULL ) )
{
return NULL;
}
XmlNodeGetElementsByTagName(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
( XmlNode * ) doc, tagName,
&returnNodeList );
return returnNodeList;
}
/*================================================================
* XmlDocGetElementsByTagNameNS
* Returns a nodeList of all the Elements with a given local name and
* namespace URI in the order in which they are encountered in a
* preorder traversal of the document tree.
* External function.
* Parameters:
* namespaceURI: the namespace of the elements to match on. The special
* value "*" matches all namespaces.
* localName: the local name of the elements to match on. The special
* value "*" matches all local names.
* Return Value:
* A new nodeList object containing all the matched Elements.
*
*=================================================================*/
XmlNodeList *
XmlDocGetElementsByTagNameNS(
Pool * pool,
XmlDocument * doc,
IN char * namespaceURI,
IN char * localName )
{
XmlNodeList *returnNodeList = NULL;
if ( ( doc == NULL ) || ( namespaceURI == NULL )
|| ( localName == NULL ) )
{
return NULL;
}
XmlNodeGetElementsByTagNameNS(
#ifdef USE_CWMP_MEMORY_POOL
pool ,
#endif
( XmlNode * ) doc, namespaceURI,
localName, &returnNodeList );
return returnNodeList;
}
/*================================================================
* XmlDocGetElementById
* Returns the element whose ID is given by tagName. If no such
* element exists, returns null.
* External function.
* Parameter:
* tagName: the tag name for an element.
* Return Values:
* The matching element.
*
*=================================================================*/
XmlElement *
XmlDocGetElementById( XmlDocument * doc,
IN char * tagName )
{
XmlElement *rtElement = NULL;
XmlNode * nodeptr = ( XmlNode * ) doc;
const char *name;
if ( ( nodeptr == NULL ) || ( tagName == NULL ) )
{
return rtElement;
}
if ( XmlNodeGetNodeType( nodeptr ) == XML_ELEMENT_NODE )
{
name = XmlNodeGetNodeName( nodeptr );
if ( name == NULL )
{
return rtElement;
}
if ( strcmp( tagName, name ) == 0 )
{
rtElement = ( XmlElement * ) nodeptr;
return rtElement;
}
else
{
rtElement = XmlDocGetElementById( ( XmlDocument * )
XmlNodeGetFirstChild
( nodeptr ),
tagName );
if ( rtElement == NULL )
{
rtElement = XmlDocGetElementById( ( XmlDocument
* )
XmlNodeGetNextSibling
( nodeptr ),
tagName );
}
}
}
else
{
rtElement = XmlDocGetElementById( ( XmlDocument * )
XmlNodeGetFirstChild
( nodeptr ), tagName );
if ( rtElement == NULL )
{
rtElement = XmlDocGetElementById( ( XmlDocument * )
XmlNodeGetNextSibling
( nodeptr ),
tagName );
}
}
return rtElement;
}
| 27.121857 | 86 | 0.545001 |
e2c0d7bc25c462dd967401170b54c283f5d3d5ce | 313 | h | C | src/num2words.h | de239/sliding-text-extra | 781a1a93c337ae282c515aabd98e3080af45bb81 | [
"MIT"
] | 11 | 2015-07-07T17:48:52.000Z | 2019-09-03T01:19:25.000Z | src/num2words.h | de239/sliding-text-extra | 781a1a93c337ae282c515aabd98e3080af45bb81 | [
"MIT"
] | 2 | 2015-11-03T23:16:11.000Z | 2015-11-25T00:42:19.000Z | src/num2words.h | de239/sliding-text-extra | 781a1a93c337ae282c515aabd98e3080af45bb81 | [
"MIT"
] | 27 | 2015-06-22T18:48:35.000Z | 2020-01-02T19:06:45.000Z | #pragma once
void time_to_common_words(int hours, int minutes, char *words);
void fuzzy_time_to_words(int hours, int minutes, char* words);
void minute_to_formal_words(int minutes, char *first_word, char *second_word);
void hour_to_12h_word(int hours, char *word);
void hour_to_24h_word(int hours, char *words);
| 39.125 | 78 | 0.795527 |
859058e40fa1a3121873039a408f51f7e1058826 | 1,597 | h | C | bootstrap/include/panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT.h | ethannicholas/panda-old | 75576bcf5c4e5a34e964547d623a5de874e6e47c | [
"MIT"
] | null | null | null | bootstrap/include/panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT.h | ethannicholas/panda-old | 75576bcf5c4e5a34e964547d623a5de874e6e47c | [
"MIT"
] | null | null | null | bootstrap/include/panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT.h | ethannicholas/panda-old | 75576bcf5c4e5a34e964547d623a5de874e6e47c | [
"MIT"
] | null | null | null | // This file was automatically generated by the Panda compiler
#ifndef panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT_H
#define panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT_H
extern panda$core$Class panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT_class;
#ifndef CLASS_panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT
#define CLASS_panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT
struct panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT {
panda$core$Class* cl;
UInt8 end;
Int8 step;
UInt8 current;
Bit endInclusive;
Bit isDone;
};
#define panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT$get_done_$Rpanda$core$Bit_INDEX 4
typedef Bit(panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT$get_done_$Rpanda$core$Bit_TYPE)(panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT* self);
#define panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT$next_$Rpanda$core$UInt8_INDEX 8
typedef UInt8(panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT$next_$Rpanda$core$UInt8_TYPE)(panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT* self);
void panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT$init_UInt8_UInt8_Int8_Bit(panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT* self, UInt8, UInt8, Int8, Bit);
panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT* new_panda$core$UIntIterator$LTpanda$core$UInt8$Cpanda$core$Int8$GT$init_UInt8_UInt8_Int8_Bit(UInt8, UInt8, Int8, Bit);
#endif
#endif
| 66.541667 | 189 | 0.810895 |
2746ce6055c9e92be740d06cf9bd54a5f991f41e | 1,410 | c | C | src/clu/clu.c | dressupgeekout/lunapurpura | 8171b52a6443924d7e6c06e25e5d105e92b5f67f | [
"BSD-2-Clause"
] | 10 | 2018-06-09T03:05:24.000Z | 2022-01-22T20:53:54.000Z | src/clu/clu.c | dressupgeekout/lunapurpura | 8171b52a6443924d7e6c06e25e5d105e92b5f67f | [
"BSD-2-Clause"
] | 56 | 2018-06-09T03:08:29.000Z | 2022-03-31T22:40:15.000Z | src/clu/clu.c | dressupgeekout/lunapurpura | 8171b52a6443924d7e6c06e25e5d105e92b5f67f | [
"BSD-2-Clause"
] | null | null | null | /*
* clu/clu.c
*
* This file is part of Luna Purpura.
*/
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <lputil.h>
#include "clu.h"
uint8_t CLU_MAGIC[CLU_MAGIC_LEN] = {0, 0, 0, 0, 128, 0, 0, 255};
/*
* The FILE pointer is expected to have already been advanced to the
* appropriate position.
*
* Don't forget to free the result with CLU_Free() you're done.
*/
CLU *
CLU_NewFromFile(FILE *fp, LPStatus *status)
{
CLU *clu = malloc(sizeof(CLU));
if (!clu) {
*status = LUNAPURPURA_ERROR;
return NULL;
}
uint8_t *cluptr = NULL;
if (!ValidateMagicF(fp, CLU_MAGIC, CLU_MAGIC_LEN)) {
*status = LUNAPURPURA_BADMAGIC;
return NULL;
}
for (int i = 0; i < CLU_NELEMENTS; i++) {
memset(clu->array[i], 0, sizeof(clu->array[i]));
cluptr = clu->array[i];
fseek(fp, 2L, SEEK_CUR); /* skip marker */
ReadUint8(fp, 1, cluptr); /* R */
cluptr++;
fseek(fp, 1L, SEEK_CUR);
ReadUint8(fp, 1, cluptr); /* G */
cluptr++;
fseek(fp, 1L, SEEK_CUR);
ReadUint8(fp, 1, cluptr); /* B */
fseek(fp, 1L, SEEK_CUR); /* go to next marker */
}
*status = LUNAPURPURA_OK;
return clu;
}
void
CLU_Free(CLU *clu)
{
free(clu);
}
/*
* The caller doesn't need to free the result, it's statically allocated.
*/
const uint8_t *
CLU_ColorAtIndex(const CLU *clu, const int index)
{
return clu->array[index];
}
| 17.407407 | 73 | 0.639716 |
5c3b89008dc3821006986bb56bf735b5ba2aed8b | 2,582 | h | C | spine/LpfButter1.h | semio-ai/quori_embedded | fdc5d2aba3c5926c92f8cecbed2c1cadce7ae9fb | [
"MIT"
] | null | null | null | spine/LpfButter1.h | semio-ai/quori_embedded | fdc5d2aba3c5926c92f8cecbed2c1cadce7ae9fb | [
"MIT"
] | null | null | null | spine/LpfButter1.h | semio-ai/quori_embedded | fdc5d2aba3c5926c92f8cecbed2c1cadce7ae9fb | [
"MIT"
] | null | null | null | // Implements a discrete IIR first order butterworth low pass filter with corner
// frequency fc and sampling frequency fs. The digital filter is of the form:
//
// b0 + b1*z^-1
// G(z) = ---------------
// 1 + a1*z^-1
//
// b0 = b1 = (1-alpha)/2
// a1 = -alpha
//
// alpha = (1-wac)/(1+wac) // filter constant
// wac = tan(wc/2); // pre-warped analog design frequency
// wc = 2*pi*fc/fs; // normalized frequency
//
// This filter achieves -Inf db gain and -90 deg phase at the Nyquist
// frequency and accurately places the -3 db corner frequency at fc with
// phase -45 deg. (The discrete single pole "alpha filter" has none of these
// properties.)
//
// Setting corner_hz > sample_hz or NaN puts the filter into a pass-through
// mode. Corner frequencies above 1/4 the sampling frequency achieve a bounded
// corner frequency of 1/4 the sampling frequency.
#ifndef LPFBUTTER1_HPP
#define LPFBUTTER1_HPP
//#include "arm_math.h"
//#include "angle_math.h"
class LpfButter1 {
public:
LpfButter1(float corner_hz, uint32_t sample_hz):
y1_(0.0f),
u1_(0.0f),
corner_hz_(corner_hz),
sample_hz_(sample_hz)
{
update_alpha();
};
virtual ~LpfButter1(){};
void set_corner_hz(float hz) {
if(hz != corner_hz_) {
corner_hz_ = hz;
update_alpha();
}
};
void set_sample_hz(uint32_t hz) {
if(hz != sample_hz_) {
sample_hz_ = hz;
update_alpha();
}
};
float get_corner_hz() const {return corner_hz_;};
uint32_t get_sample_hz() const {return sample_hz_;};
virtual float sample(float u) {
y1_ = neg_a1_*y1_ + b0_*u + b1_*u1_;
u1_ = u;
return y1_;
}
float value() const {return y1_;};
void set_value(float val) {y1_ = val; u1_ = val;};
float get_prev_sample() const {return u1_;}
protected:
float neg_a1_;
float b0_;
float b1_;
float y1_;
float u1_;
private:
float corner_hz_;
uint32_t sample_hz_;
void update_alpha() {
// enforce upper bound on realized corner frequency as 1/4 sample_hz
if(corner_hz_ <= 0.25f*sample_hz_) {
float arg = PI*static_cast<float>(corner_hz_)/sample_hz_;
float wac = sin(arg)/cos(arg); //replaced arm_cos_f32 with cos and arm_sin_f32 with sin
float alpha = (1-wac)/(1+wac);
neg_a1_ = alpha;
b0_ = 0.5*(1-alpha);
b1_ = b0_;
}
else {
neg_a1_ = 0;
b0_ = 1;
b1_ = 0;
}
};
};
#endif // LPFBUTTER1_HPP
| 24.826923 | 95 | 0.60031 |
5849dc594f5c7bb0d0714c7caaf6a018f632d05d | 847 | h | C | Example/ONOChat/OtherResources/Util/UIView+Extension.h | lhs168/ONOChat | a476f31196c4e48362f8dd350eef7bd6c970f399 | [
"MIT"
] | 1 | 2018-05-25T02:32:40.000Z | 2018-05-25T02:32:40.000Z | Example/ONOChat/OtherResources/Util/UIView+Extension.h | lhs168/ONOChat | a476f31196c4e48362f8dd350eef7bd6c970f399 | [
"MIT"
] | null | null | null | Example/ONOChat/OtherResources/Util/UIView+Extension.h | lhs168/ONOChat | a476f31196c4e48362f8dd350eef7bd6c970f399 | [
"MIT"
] | null | null | null | //
// UIView+Extension.h
// MJRefreshExample
//
// Created by MJ Lee on 14-5-28.
// Copyright (c) 2014年 itcast. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (Extension)
@property (nonatomic) CGFloat im_left;
@property (nonatomic) CGFloat im_top;
@property (nonatomic) CGFloat im_right;
@property (nonatomic) CGFloat im_bottom;
@property (nonatomic) CGFloat im_width;
@property (nonatomic) CGFloat im_height;
@property (nonatomic) CGFloat im_centerX;
@property (nonatomic) CGFloat im_centerY;
@property (nonatomic) CGPoint im_origin;
@property (nonatomic) CGSize im_size;
@property (nonatomic) CGPoint im_center;
+ (id)im_loadFromXIB;
+ (id)im_loadFromXIBName:(NSString *)xibName;
- (void)im_createBordersWithColor:(UIColor * _Nonnull)color withCornerRadius:(CGFloat)radius andWidth:(CGFloat)width;
@end
| 19.25 | 117 | 0.754427 |
5bc4698098f69c8c2ac17c627e87412c02165287 | 3,685 | h | C | vtkSurface/include/vtkQuadricTools.h | csparker247/ACVD | 74742dda4d4f74b1b776281f10bab05279ff9305 | [
"CECILL-B"
] | null | null | null | vtkSurface/include/vtkQuadricTools.h | csparker247/ACVD | 74742dda4d4f74b1b776281f10bab05279ff9305 | [
"CECILL-B"
] | 1 | 2020-07-15T15:10:49.000Z | 2020-07-15T15:10:49.000Z | vtkSurface/include/vtkQuadricTools.h | csparker247/ACVD | 74742dda4d4f74b1b776281f10bab05279ff9305 | [
"CECILL-B"
] | null | null | null | /*=========================================================================
Program: Tools for QEM processing
Module: vtkSurface
Language: C++
Date: 2007/10
Auteur: Sebastien VALETTE
=========================================================================*/
/* ---------------------------------------------------------------------
* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
* Author : Sebastien Valette
*
* This software is governed by the CeCILL-B license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-B
* license as circulated by CEA, CNRS and INRIA at the following URL
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* or in the file LICENSE.txt.
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
#ifndef _VTKQUADRICTOOLS_H_
#define _VTKQUADRICTOOLS_H_
#define DEFAULT_SV_THRESHOLD 0.001
#include <vtkMath.h>
#include <vtkObjectFactory.h>
#include <vtkTriangle.h>
#include "vtkSurface.h"
class VTK_EXPORT vtkQuadricTools : public vtkObject
{
public:
// Create an instance of vtkQuadricTools
static vtkQuadricTools* New();
// Adds to Quadric the quadric equivalent to a plane passing by the given
// Point with the Given Normal If FullQuadric=true then the whole quadric
// will be created (10 coefficients). Otherwise, only the 9 first
// coefficients will be given
static void AddPointWithNormalQuadric(
double* Quadric,
double* Point,
double* Normal,
double Factor = 1.0,
bool FullQuadric = true);
// Adds the quadric computed from Face to Quadric, weighted by Factor
// If FullQuadric=true then the whole quadric will be created (10
// coefficients). Otherwise, only the 9 first coefficients will be given
static void AddTriangleQuadric(
double* Quadric, vtkSurface* Mesh, int Face, bool FullQuadric = true);
// Computes the displacement needed to reach the best position according to
// the quadric MaxNumberOfUsedSingularValues defines the number of singular
// values used (generally 3)
static int ComputeDisplacement(
double* Quadric,
double* Point,
double* Displacement,
int MaxNumberOfUsedSingularValues = 3,
double SVThreshold = DEFAULT_SV_THRESHOLD);
// Projects the point on the position giving the minimum quadric error
// returns the rank deficiency of the quadric.
// MaxNumberOfUsedSingularValues defines the number of singular values used
// (generally 3)
static int ComputeRepresentativePoint(
double* Quadric,
double* Point,
int MaxNumberOfUsedSingularValues = 3,
double SVThreshold = DEFAULT_SV_THRESHOLD);
static double Evaluate(
double* Quadric, double* Point, bool FullQuadric = true);
void GetPointQuadric(
vtkSurface* Mesh,
vtkIdType Vertex,
double* Quadric,
bool FullQuadric = true);
protected:
// List used to get faces around a specific vertex
vtkIdList* List;
vtkQuadricTools();
~vtkQuadricTools();
};
#endif
| 35.432692 | 79 | 0.657259 |
1d053a56ed251830430726975176d866c60979f4 | 120 | h | C | src/vx/_backends/qtkit/qtkit_backend.h | motobhakta/libvx | d3e8ef60487f4b02f38f547730cb1bef78f58d67 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/vx/_backends/qtkit/qtkit_backend.h | motobhakta/libvx | d3e8ef60487f4b02f38f547730cb1bef78f58d67 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/vx/_backends/qtkit/qtkit_backend.h | motobhakta/libvx | d3e8ef60487f4b02f38f547730cb1bef78f58d67 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #ifndef _LIBVX_VX_QTKIT_BACKEND_H_
#define _LIBVX_VX_QTKIT_BACKEND_H_ 1
extern void* vx_source_qtkit_create();
#endif
| 17.142857 | 38 | 0.85 |
d4f46c29315f3b05269a5e3385a37a41a6bb646e | 629 | h | C | net/LolaCommsNative/LolaCommsNative/Logging.h | am-lola/HoLola | 487a3cb2342a22fa18c5e28484bc6371cda8d9ce | [
"MIT"
] | 2 | 2017-11-14T12:56:03.000Z | 2018-01-17T01:24:16.000Z | net/LolaCommsNative/LolaCommsNative/Logging.h | am-lola/HoLola | 487a3cb2342a22fa18c5e28484bc6371cda8d9ce | [
"MIT"
] | null | null | null | net/LolaCommsNative/LolaCommsNative/Logging.h | am-lola/HoLola | 487a3cb2342a22fa18c5e28484bc6371cda8d9ce | [
"MIT"
] | 2 | 2020-06-05T14:27:09.000Z | 2021-02-08T05:26:07.000Z | #pragma once
#include <functional>
#include <comutil.h>
#include "LolaCommsNativeETW.h"
///
// Some simple utils to make passing log data back up
// to managed land a little easier so it can be displayed
// to users in Unity or logged with Unity's logger.
///
typedef void(__stdcall *INFOCALLBACK)(BSTR txt);
typedef std::function<void(std::wstring)> LogInfoFn;
static LogInfoFn LogInfo_cb = [](std::wstring txt) { OutputDebugString(txt.c_str()); };
static void LogInfo(std::wstring text)
{
if (LogInfo_cb)
LogInfo_cb(text);
}
static void SetInfoCB(std::function<void(std::wstring)> cb)
{
LogInfo_cb = cb;
}
| 24.192308 | 87 | 0.713831 |
ce5f8618942d576447134ff547e9ee38bee125e0 | 12,114 | c | C | extern/gtk/gdk/x11/gdkcursor-x11.c | PableteProgramming/download | 013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8 | [
"MIT"
] | null | null | null | extern/gtk/gdk/x11/gdkcursor-x11.c | PableteProgramming/download | 013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8 | [
"MIT"
] | null | null | null | extern/gtk/gdk/x11/gdkcursor-x11.c | PableteProgramming/download | 013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8 | [
"MIT"
] | null | null | null | /* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
/* needs to be first because any header might include gdk-pixbuf.h otherwise */
#define GDK_PIXBUF_ENABLE_BACKEND
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "gdkcursor.h"
#include "gdkcursorprivate.h"
#include "gdkprivate-x11.h"
#include "gdkdisplay-x11.h"
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#ifdef HAVE_XCURSOR
#include <X11/Xcursor/Xcursor.h>
#endif
#ifdef HAVE_XFIXES
#include <X11/extensions/Xfixes.h>
#endif
#include <string.h>
static void
gdk_x11_cursor_remove_from_cache (gpointer data, GObject *cursor)
{
GdkDisplay *display = data;
Cursor xcursor;
xcursor = GDK_POINTER_TO_XID (g_hash_table_lookup (GDK_X11_DISPLAY (display)->cursors, cursor));
XFreeCursor (GDK_DISPLAY_XDISPLAY (display), xcursor);
g_hash_table_remove (GDK_X11_DISPLAY (display)->cursors, cursor);
}
void
_gdk_x11_cursor_display_finalize (GdkDisplay *display)
{
GHashTableIter iter;
gpointer cursor;
if (GDK_X11_DISPLAY (display)->cursors)
{
g_hash_table_iter_init (&iter, GDK_X11_DISPLAY (display)->cursors);
while (g_hash_table_iter_next (&iter, &cursor, NULL))
g_object_weak_unref (G_OBJECT (cursor), gdk_x11_cursor_remove_from_cache, display);
g_hash_table_unref (GDK_X11_DISPLAY (display)->cursors);
}
}
static Cursor
get_blank_cursor (GdkDisplay *display)
{
Pixmap pixmap;
XColor color;
Cursor cursor;
cairo_surface_t *surface;
cairo_t *cr;
surface = _gdk_x11_display_create_bitmap_surface (display, 1, 1);
/* Clear surface */
cr = cairo_create (surface);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
cairo_destroy (cr);
pixmap = cairo_xlib_surface_get_drawable (surface);
color.pixel = 0;
color.red = color.blue = color.green = 0;
if (gdk_display_is_closed (display))
cursor = None;
else
cursor = XCreatePixmapCursor (GDK_DISPLAY_XDISPLAY (display),
pixmap, pixmap,
&color, &color, 1, 1);
cairo_surface_destroy (surface);
return cursor;
}
static const struct {
const char *css_name;
const char *traditional_name;
int cursor_glyph;
} name_map[] = {
{ "default", "left_ptr", XC_left_ptr, },
{ "help", "question_arrow", XC_question_arrow },
{ "context-menu", "left_ptr", XC_left_ptr },
{ "pointer", "hand", XC_hand1 },
{ "progress", "left_ptr_watch", XC_watch },
{ "wait", "watch", XC_watch },
{ "cell", "crosshair", XC_plus },
{ "crosshair", "cross", XC_crosshair },
{ "text", "xterm", XC_xterm },
{ "vertical-text","xterm", XC_xterm },
{ "alias", "dnd-link", XC_target },
{ "copy", "dnd-copy", XC_target },
{ "move", "dnd-move", XC_target },
{ "no-drop", "dnd-none", XC_pirate },
{ "dnd-ask", "dnd-copy", XC_target }, /* not CSS, but we want to guarantee it anyway */
{ "not-allowed", "crossed_circle", XC_pirate },
{ "grab", "hand2", XC_hand2 },
{ "grabbing", "hand2", XC_hand2 },
{ "all-scroll", "left_ptr", XC_left_ptr },
{ "col-resize", "h_double_arrow", XC_sb_h_double_arrow },
{ "row-resize", "v_double_arrow", XC_sb_v_double_arrow },
{ "n-resize", "top_side", XC_top_side },
{ "e-resize", "right_side", XC_right_side },
{ "s-resize", "bottom_side", XC_bottom_side },
{ "w-resize", "left_side", XC_left_side },
{ "ne-resize", "top_right_corner", XC_top_right_corner },
{ "nw-resize", "top_left_corner", XC_top_left_corner },
{ "se-resize", "bottom_right_corner", XC_bottom_right_corner },
{ "sw-resize", "bottom_left_corner", XC_bottom_left_corner },
{ "ew-resize", "h_double_arrow", XC_sb_h_double_arrow },
{ "ns-resize", "v_double_arrow", XC_sb_v_double_arrow },
{ "nesw-resize", "fd_double_arrow", XC_X_cursor },
{ "nwse-resize", "bd_double_arrow", XC_X_cursor },
{ "zoom-in", "left_ptr", XC_draped_box },
{ "zoom-out", "left_ptr", XC_draped_box }
};
#ifdef HAVE_XCURSOR
static XcursorImage*
create_cursor_image (GdkTexture *texture,
int x,
int y,
int scale)
{
XcursorImage *xcimage;
xcimage = XcursorImageCreate (gdk_texture_get_width (texture), gdk_texture_get_height (texture));
xcimage->xhot = x;
xcimage->yhot = y;
gdk_texture_download (texture,
(guchar *) xcimage->pixels,
gdk_texture_get_width (texture) * 4);
return xcimage;
}
static Cursor
gdk_x11_cursor_create_for_texture (GdkDisplay *display,
GdkTexture *texture,
int x,
int y)
{
XcursorImage *xcimage;
Cursor xcursor;
int target_scale;
target_scale =
gdk_monitor_get_scale_factor (gdk_x11_display_get_primary_monitor (display));
xcimage = create_cursor_image (texture, x, y, target_scale);
xcursor = XcursorImageLoadCursor (GDK_DISPLAY_XDISPLAY (display), xcimage);
XcursorImageDestroy (xcimage);
return xcursor;
}
static const char *
name_fallback (const char *name)
{
int i;
for (i = 0; i < G_N_ELEMENTS (name_map); i++)
{
if (g_str_equal (name_map[i].css_name, name))
return name_map[i].traditional_name;
}
return NULL;
}
static Cursor
gdk_x11_cursor_create_for_name (GdkDisplay *display,
const char *name)
{
Cursor xcursor;
Display *xdisplay;
if (strcmp (name, "none") == 0)
{
xcursor = get_blank_cursor (display);
}
else
{
xdisplay = GDK_DISPLAY_XDISPLAY (display);
xcursor = XcursorLibraryLoadCursor (xdisplay, name);
if (xcursor == None)
{
const char *fallback;
fallback = name_fallback (name);
if (fallback)
xcursor = XcursorLibraryLoadCursor (xdisplay, fallback);
}
}
return xcursor;
}
#else
static Cursor
gdk_x11_cursor_create_for_texture (GdkDisplay *display,
GdkTexture *texture,
int x,
int y)
{
return None;
}
static Cursor
gdk_x11_cursor_create_for_name (GdkDisplay *display,
const char *name)
{
int i;
if (g_str_equal (name, "none"))
return get_blank_cursor (display);
for (i = 0; i < G_N_ELEMENTS (name_map); i++)
{
if (g_str_equal (name_map[i].css_name, name) ||
g_str_equal (name_map[i].traditional_name, name))
return XCreateFontCursor (GDK_DISPLAY_XDISPLAY (display), name_map[i].cursor_glyph);
}
return None;
}
#endif
/**
* gdk_x11_display_set_cursor_theme:
* @display: (type GdkX11Display): a `GdkDisplay`
* @theme: (nullable): the name of the cursor theme to use, or %NULL
* to unset a previously set value
* @size: the cursor size to use, or 0 to keep the previous size
*
* Sets the cursor theme from which the images for cursor
* should be taken.
*
* If the windowing system supports it, existing cursors created
* with [ctor@Gdk.Cursor.new_from_name] are updated to reflect the theme
* change. Custom cursors constructed with [ctor@Gdk.Cursor.new_from_texture]
* will have to be handled by the application (GTK applications can learn
* about cursor theme changes by listening for change notification
* for the corresponding `GtkSetting`).
*/
void
gdk_x11_display_set_cursor_theme (GdkDisplay *display,
const char *theme,
const int size)
{
#if defined(HAVE_XCURSOR) && defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2
Display *xdisplay;
char *old_theme;
int old_size;
gpointer cursor, xcursor;
GHashTableIter iter;
g_return_if_fail (GDK_IS_DISPLAY (display));
xdisplay = GDK_DISPLAY_XDISPLAY (display);
old_theme = XcursorGetTheme (xdisplay);
old_size = XcursorGetDefaultSize (xdisplay);
if (old_size == size &&
(old_theme == theme ||
(old_theme && theme && strcmp (old_theme, theme) == 0)))
return;
XcursorSetTheme (xdisplay, theme);
if (size > 0)
XcursorSetDefaultSize (xdisplay, size);
if (GDK_X11_DISPLAY (display)->cursors == NULL)
return;
g_hash_table_iter_init (&iter, GDK_X11_DISPLAY (display)->cursors);
while (g_hash_table_iter_next (&iter, &cursor, &xcursor))
{
const char *name = gdk_cursor_get_name (cursor);
if (name)
{
Cursor new_cursor = gdk_x11_cursor_create_for_name (display, name);
if (new_cursor != None)
{
XFixesChangeCursor (xdisplay, new_cursor, GDK_POINTER_TO_XID (xcursor));
g_hash_table_iter_replace (&iter, GDK_XID_TO_POINTER (new_cursor));
}
else
{
g_hash_table_iter_remove (&iter);
}
}
}
#endif
}
/**
* gdk_x11_display_get_xcursor:
* @display: (type GdkX11Display): a `GdkDisplay`
* @cursor: a `GdkCursor`
*
* Returns the X cursor belonging to a `GdkCursor`, potentially
* creating the cursor.
*
* Be aware that the returned cursor may not be unique to @cursor.
* It may for example be shared with its fallback cursor. On old
* X servers that don't support the XCursor extension, all cursors
* may even fall back to a few default cursors.
*
* Returns: an Xlib Cursor.
*/
Cursor
gdk_x11_display_get_xcursor (GdkDisplay *display,
GdkCursor *cursor)
{
GdkX11Display *x11_display = GDK_X11_DISPLAY (display);
Cursor xcursor;
g_return_val_if_fail (cursor != NULL, None);
if (gdk_display_is_closed (display))
return None;
if (x11_display->cursors == NULL)
x11_display->cursors = g_hash_table_new (gdk_cursor_hash, gdk_cursor_equal);
xcursor = GDK_POINTER_TO_XID (g_hash_table_lookup (x11_display->cursors, cursor));
if (xcursor)
return xcursor;
if (gdk_cursor_get_name (cursor))
xcursor = gdk_x11_cursor_create_for_name (display, gdk_cursor_get_name (cursor));
else
xcursor = gdk_x11_cursor_create_for_texture (display,
gdk_cursor_get_texture (cursor),
gdk_cursor_get_hotspot_x (cursor),
gdk_cursor_get_hotspot_y (cursor));
if (xcursor != None)
{
g_object_weak_ref (G_OBJECT (cursor), gdk_x11_cursor_remove_from_cache, display);
g_hash_table_insert (x11_display->cursors, cursor, GDK_XID_TO_POINTER (xcursor));
return xcursor;
}
if (gdk_cursor_get_fallback (cursor))
return gdk_x11_display_get_xcursor (display, gdk_cursor_get_fallback (cursor));
return None;
}
| 31.302326 | 105 | 0.632491 |
cec8df0967815ced404a7c6492d17e42faacdeb7 | 502 | c | C | src/log.c | chronopoulos/prometheus-node | 477d040f83e0ac149701b843d77880d869dcd26f | [
"MIT"
] | null | null | null | src/log.c | chronopoulos/prometheus-node | 477d040f83e0ac149701b843d77880d869dcd26f | [
"MIT"
] | null | null | null | src/log.c | chronopoulos/prometheus-node | 477d040f83e0ac149701b843d77880d869dcd26f | [
"MIT"
] | null | null | null | #include "read_out.h"
#include "i2c.h"
#include <stdlib.h>
/// \addtogroup output
/// @{
/*!
Gets a dump of all registers
@param deviceAddress i2c address of the chip (default 0x20)
@returns data read from the chip
*/
void dumpAllRegisters(const int deviceAddress, int16_t *values) {
unsigned char *i2cData = malloc(256 * sizeof(unsigned char));
i2c(deviceAddress, 'r', 0x00, 256, &i2cData);
int i;
for (i = 0; i < 256; i++){
values[i] = (int16_t) i2cData[i];
}
free(i2cData);
}
/// @}
| 20.08 | 65 | 0.661355 |
07669b52c171eece5e0a6ef7db47c46b996db5d7 | 403 | h | C | common/network/socket.h | zgtz/CppNet | 86cceb77bfd3a9b0c0efb38108477aaf477ec058 | [
"BSD-3-Clause"
] | 676 | 2018-07-06T04:31:11.000Z | 2022-03-29T22:05:55.000Z | common/network/socket.h | JiaquanLi/CppNet | 86cceb77bfd3a9b0c0efb38108477aaf477ec058 | [
"BSD-3-Clause"
] | 16 | 2019-06-19T07:20:14.000Z | 2022-01-09T10:41:50.000Z | common/network/socket.h | JiaquanLi/CppNet | 86cceb77bfd3a9b0c0efb38108477aaf477ec058 | [
"BSD-3-Clause"
] | 196 | 2019-08-27T20:01:26.000Z | 2022-03-27T13:15:16.000Z | // Use of this source code is governed by a BSD 3-Clause License
// that can be found in the LICENSE file.
// Author: caozhiyi (caozhiyi5@gmail.com)
#ifndef COMMON_NETWORK_SOCKET
#define COMMON_NETWORK_SOCKET
#include <cstdint>
namespace cppnet {
int32_t SocketNoblocking(uint64_t sock);
int32_t ReusePort(uint64_t sock);
// check socket connect
bool CheckConnect(const uint64_t sock);
}
#endif
| 18.318182 | 64 | 0.774194 |
e063af4ac061e8c6376dec4e7b2f4a2d0fcb214e | 367 | h | C | Urho3D/src/instructionsStatements.h | OrganisedAFID/our-project-name | dfcae2e634c339d31ba066f8525fb961ed455661 | [
"MIT"
] | 1 | 2021-01-31T17:50:03.000Z | 2021-01-31T17:50:03.000Z | Urho3D/src/instructionsStatements.h | OrganisedAFID/sound-pirates | dfcae2e634c339d31ba066f8525fb961ed455661 | [
"MIT"
] | 51 | 2021-02-04T18:14:25.000Z | 2021-04-19T22:51:51.000Z | Urho3D/src/instructionsStatements.h | OrganisedAFID/sound-pirates | dfcae2e634c339d31ba066f8525fb961ed455661 | [
"MIT"
] | null | null | null | /**
* \headerfile instructionsStatements.h "instructionsStatements.h"
* header file for instructionsStatements function
*/
#ifndef INSTRUCTIONSSTATEMENT_H
#define INSTRUCTIONSSTATEMENT_H
/**
* displays the player instructions when example note is being played and
* when the player is expected to play their response
*/
void instructionsStatements();
#endif
| 24.466667 | 74 | 0.790191 |
a35fe666ced49a2bef968798219dc9c4805704d8 | 3,742 | c | C | src/net/test/nr_socket_test.c | MashMeTV/nICEr | fa8ecf1e4efa12a72de932c1a37acfc0cccb26c9 | [
"BSD-3-Clause"
] | 10 | 2016-02-25T23:06:28.000Z | 2021-04-30T01:25:55.000Z | src/net/test/nr_socket_test.c | MashMeTV/nICEr | fa8ecf1e4efa12a72de932c1a37acfc0cccb26c9 | [
"BSD-3-Clause"
] | 1 | 2021-06-25T14:25:09.000Z | 2021-06-25T14:25:09.000Z | src/net/test/nr_socket_test.c | MashMeTV/nICEr | fa8ecf1e4efa12a72de932c1a37acfc0cccb26c9 | [
"BSD-3-Clause"
] | 12 | 2017-12-22T10:11:10.000Z | 2021-12-16T13:39:02.000Z | /*
Copyright (c) 2007, Adobe Systems, Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems, Network Resonance nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
static char *RCSSTRING __UNUSED__="$Id: nr_socket_test.c,v 1.2 2008/04/28 17:59:03 ekr Exp $";
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <nr_api.h>
#include <nr_startup.h>
#include "nr_socket.h"
#include "nr_socket_local.h"
int ctr=0;
nr_transport_addr addr;
void recv_cb(int s, int how, void *cb_arg)
{
nr_socket *sock=cb_arg;
char buf2[4096];
char ctrbuf[10];
size_t len;
nr_transport_addr addr2;
int r;
if(r=nr_socket_recvfrom(sock,buf2,sizeof(buf2),&len,0,&addr2)){
fprintf(stderr,"Error in recvfrom\n");
exit(1);
}
/* Force a terminator */
buf2[len]=0;
printf("Received %s\n",buf2);
if(len<10)
abort();
sprintf(ctrbuf,"%.4d",ctr);
memcpy(buf2,ctrbuf,strlen(ctrbuf));
ctr++;
if(ctr>=50)
return;
/* Re-arm the callback */
NR_ASYNC_WAIT(s,NR_ASYNC_WAIT_READ,recv_cb,sock);
/* Send and receive something to ourselves */
if(r=nr_socket_sendto(sock,buf2,len,0,&addr)){
fprintf(stderr,"Error in sendto\n");
exit(1);
}
}
int main(int argc, char **argv)
{
int r;
nr_socket *sock;
char buf1[]="This is a test";
int log_facility;
NR_SOCKET fd;
nr_app_startup("nr_socket_test",0,&log_facility,0,0);
/* Fake up an address */
nr_ip4_port_to_transport_addr(ntohl(inet_addr("127.0.0.1")),
9999,IPPROTO_UDP,&addr);
/* sockaddr to send to */
if(r=nr_socket_local_create(&addr,&sock)){
fprintf(stderr,"Couldn't create socket\n");
exit(1);
}
/* Send and receive something to ourselves */
if(r=nr_socket_sendto(sock,buf1,sizeof(buf1),0,&addr)){
fprintf(stderr,"Error in sendto\n");
exit(1);
}
/* Now set an async cb */
nr_socket_getfd(sock,&fd);
NR_ASYNC_WAIT(fd,NR_ASYNC_WAIT_READ,recv_cb,sock);
while(1){
int events;
if(r=NR_async_event_wait(&events)){
if(r=R_EOD)
break;
fprintf(stderr,"Error in event wait\n");
exit(1);
}
}
printf("Success!\n");
exit(0);
}
| 27.115942 | 94 | 0.690807 |
0d72356f92c84efd094c4f1f3c22257a6063b6b7 | 302 | h | C | ComponentKit/HostingView/CKComponentHostingViewWithLifecycle.h | priteshrnandgaonkar/componentkit | c5509f8f371a6af599bf9e7644cc2e2e4497edaa | [
"BSD-3-Clause"
] | 6,156 | 2015-03-25T22:01:06.000Z | 2022-03-31T16:35:10.000Z | ComponentKit/HostingView/CKComponentHostingViewWithLifecycle.h | priteshrnandgaonkar/componentkit | c5509f8f371a6af599bf9e7644cc2e2e4497edaa | [
"BSD-3-Clause"
] | 806 | 2015-03-25T22:33:44.000Z | 2022-03-21T12:19:21.000Z | ComponentKit/HostingView/CKComponentHostingViewWithLifecycle.h | priteshrnandgaonkar/componentkit | c5509f8f371a6af599bf9e7644cc2e2e4497edaa | [
"BSD-3-Clause"
] | 733 | 2015-03-25T22:26:55.000Z | 2022-03-24T15:46:47.000Z | // (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
#import <ComponentKit/CKComponentHostingView.h>
@protocol CKComponentHostingViewWithLifecycle
/** Appearance events to be funneled to the component tree. */
- (void)hostingViewWillAppear;
- (void)hostingViewDidDisappear;
@end
| 25.166667 | 71 | 0.791391 |
ed21fe8b57933db616f017965a1376abcd044d5d | 417 | h | C | Panoramic&Sequence/Panoramic&Sequence/Custom/Base/ZWBaseViewController.h | 90candy/Panoramic-Sequence | 78cff0cbe0a33ce03137db6e098360d7f9704d73 | [
"Apache-2.0"
] | 175 | 2017-06-26T09:02:31.000Z | 2021-12-27T07:18:01.000Z | Panoramic&Sequence/Panoramic&Sequence/Custom/Base/ZWBaseViewController.h | AAWayne/Panoramic-Sequence | 78cff0cbe0a33ce03137db6e098360d7f9704d73 | [
"Apache-2.0"
] | null | null | null | Panoramic&Sequence/Panoramic&Sequence/Custom/Base/ZWBaseViewController.h | AAWayne/Panoramic-Sequence | 78cff0cbe0a33ce03137db6e098360d7f9704d73 | [
"Apache-2.0"
] | 6 | 2018-02-15T09:46:12.000Z | 2020-08-05T03:58:20.000Z | //
// ZWBaseViewController.h
// Panoramic&Sequence
//
// Created by Candy on 2017/6/26.
// Copyright © 2017年 90candy. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZWAlertView.h"
#import "ZWImageButton.h"
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
@interface ZWBaseViewController : UIViewController
@end
| 21.947368 | 68 | 0.733813 |
d482f431f9f1acf5e2c66e29f9c20714be314208 | 400 | c | C | rubbish/book/7-12.c | unnamed42/code_learning | 1e64c29869903ca7f3cf7c682461766d702866c8 | [
"MIT"
] | null | null | null | rubbish/book/7-12.c | unnamed42/code_learning | 1e64c29869903ca7f3cf7c682461766d702866c8 | [
"MIT"
] | 3 | 2016-03-11T12:00:34.000Z | 2016-03-27T15:31:00.000Z | rubbish/book/7-12.c | unnamed42/code_learning | 1e64c29869903ca7f3cf7c682461766d702866c8 | [
"MIT"
] | null | null | null | #include <stdio.h>
int encrypt(int number){
int a[4],i,temp;
for(i=0;i<4;i++){
a[i]=(number%10+5)%10;
number/=10;
}
temp=a[0];a[0]=a[3];a[3]=temp;
temp=a[1];a[1]=a[2];a[2]=temp;
return a[3]*1000+a[2]*100+a[1]*10+a[0];
}
int main(){
int integer;
printf("Please input a number between 1000 and 9999:\n");
scanf("%d",&integer);
printf("Encryption is %d\n",encrypt(integer));
return 0;
}
| 20 | 58 | 0.6 |
c292097b5112e71e56ec657e3429cf488048a8a6 | 265 | c | C | board.c | apemangr/Patzer-Killer | 05ffc98e3be45a3936e03c3927603979d9684bb5 | [
"MIT"
] | null | null | null | board.c | apemangr/Patzer-Killer | 05ffc98e3be45a3936e03c3927603979d9684bb5 | [
"MIT"
] | null | null | null | board.c | apemangr/Patzer-Killer | 05ffc98e3be45a3936e03c3927603979d9684bb5 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include "defs.h"
void resetBoard(S_BOARD *pos) {
int index =0;
for (index=0; index< BRD_SQ_NUM; index++) {
pos->pieces[index]= OFFBOARD;
}
for (index=0; index<64; index++) {
pos->pieces[SQ120(index)]= EMPTY;
}
}
| 16.5625 | 45 | 0.581132 |
11a2678ac77139370ae3625255c1a1a8f7f66d9a | 198 | h | C | include/main.h | YeungShaoFeng/badway | 936b9cb3b5784e7d3fc1a351a760f23b75ea3cbf | [
"MIT"
] | null | null | null | include/main.h | YeungShaoFeng/badway | 936b9cb3b5784e7d3fc1a351a760f23b75ea3cbf | [
"MIT"
] | null | null | null | include/main.h | YeungShaoFeng/badway | 936b9cb3b5784e7d3fc1a351a760f23b75ea3cbf | [
"MIT"
] | null | null | null | #ifndef main_h
#define main_h
#pragma once
#include "mylib.h"
#include "typos.h"
#include <stdio.h>
#ifndef _WIN32
#include <unistd.h>
/*
* chdir
*/
#else
#endif /* _WIN32*/
#endif // !main_h | 10.421053 | 19 | 0.656566 |
504c74e92e95e10fde756fc301ca98b123443f79 | 22,355 | c | C | Backups/Backup2 - Core Mechanics/map2.c | majesityreal/CheeseburgerKing | 1b74f20901a76694efc08b08f5e406ac520449e6 | [
"MIT"
] | null | null | null | Backups/Backup2 - Core Mechanics/map2.c | majesityreal/CheeseburgerKing | 1b74f20901a76694efc08b08f5e406ac520449e6 | [
"MIT"
] | null | null | null | Backups/Backup2 - Core Mechanics/map2.c | majesityreal/CheeseburgerKing | 1b74f20901a76694efc08b08f5e406ac520449e6 | [
"MIT"
] | null | null | null |
//{{BLOCK(map2)
//======================================================================
//
// map2, 512x256@4,
// + palette 256 entries, not compressed
// + 42 tiles (t|f|p reduced) not compressed
// + regular map (in SBBs), not compressed, 64x32
// Total size: 512 + 1344 + 4096 = 5952
//
// Time-stamp: 2021-11-17, 01:45:18
// Exported by Cearn's GBA Image Transmogrifier, v0.8.3
// ( http://www.coranac.com/projects/#grit )
//
//======================================================================
const unsigned short map2Tiles[672] __attribute__((aligned(4)))=
{
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x8888,0x8888,0x8888,0x0000,0x0888,0x9999,0x9088,0x9999,
0x9088,0x9999,0x9088,0x9999,0x0088,0x0000,0x8808,0x8888,
0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
0x8888,0x8888,0x8888,0x8888,0x8888,0x1111,0x8888,0x3321,
0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
0x8888,0x8888,0x8888,0x8888,0x1111,0x8881,0x3333,0x8881,
0x0008,0x0000,0x7708,0x7777,0x0008,0x0000,0x4408,0x4444,
0x9088,0x4494,0x9088,0x9999,0x0888,0x0000,0x8888,0x8888,
0x0000,0x8000,0x7777,0x8077,0x0000,0x8000,0x4444,0x8044,
0x9499,0x8804,0x9999,0x8809,0x0000,0x8880,0x8888,0x8888,
0x8888,0x3321,0x8888,0x1321,0x8888,0x1321,0x8888,0x2921,
0x8888,0x9921,0x8888,0x1221,0x8888,0x1211,0x8888,0x1118,
0x3333,0x8881,0x1331,0x8881,0x1331,0x8811,0x2332,0x8819,
0x9333,0x8819,0x2211,0x8881,0x2118,0x8881,0x1188,0x8881,
0x9999,0x9999,0x6699,0x6666,0x6669,0x6666,0x6669,0x9633,
0x9669,0x3311,0x3369,0x1111,0x1169,0xB111,0x9669,0xBB11,
0x9999,0x9999,0x6666,0x6666,0x9633,0x3663,0x3311,0x1961,
0x1111,0x1331,0x1111,0x1111,0x11BB,0x1BB1,0x1B22,0xB2BB,
0x9999,0x9999,0x6666,0x6666,0x3663,0x6396,0x1961,0x6133,
0x1331,0x3111,0xBB11,0x1111,0x2BB1,0xBB1B,0xBBB1,0x2BBB,
0x9999,0x9999,0x6666,0x6666,0x3366,0x3966,0x1196,0x1333,
0x1133,0x1111,0xB111,0x11BB,0xBB11,0x1B22,0xBB1B,0x1B22,
0x9999,0x9999,0x6666,0x6666,0x3663,0x3396,0x1961,0x1133,
0x1331,0x1111,0x1111,0x1111,0x1BB1,0xBB11,0xB2BB,0x2BB1,
0x9999,0x9999,0x6666,0x9966,0x6666,0x9666,0x3396,0x9666,
0x1133,0x9669,0x1111,0x9633,0x111B,0x9611,0x11B2,0x9669,
0x6669,0xBB11,0x3369,0xBB11,0x6669,0xB119,0x6669,0xB116,
0x3369,0xBB13,0x1169,0xBB11,0x9669,0xB111,0x6669,0x1111,
0x1B22,0xBBBB,0x1BBB,0x1BB1,0x11BB,0x1111,0x111B,0x1111,
0x11B2,0x1111,0x11BB,0x1111,0x111B,0x1111,0x1111,0x1111,
0xBB11,0xBBB1,0x1111,0xBB11,0x1111,0x1111,0x1111,0x1111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0xBB1B,0x1BBB,0xB111,0x11BB,0x1111,0x1111,0x1111,0x1111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0xBBBB,0x2BB1,0x1BB1,0xBBB1,0x1111,0xBB11,0x1111,0xB111,
0x1111,0xBB11,0x1111,0xBB11,0x1111,0xB111,0x1111,0x1111,
0x11B2,0x9666,0x11BB,0x9633,0x911B,0x9666,0x611B,0x9666,
0x31B2,0x9633,0x11BB,0x9611,0x111B,0x9669,0x1111,0x9666,
0x3369,0x1111,0x6669,0xB119,0x6669,0xB116,0x3369,0x1113,
0x9669,0x1111,0x6669,0xBB11,0x3369,0x2BB1,0x1169,0x2BB1,
0x11BB,0x1111,0x1B2B,0x1111,0x1BBB,0x1111,0x11BB,0x1111,
0x1111,0x1111,0x111B,0x1111,0x11B2,0x1111,0x11B2,0x1111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0x1111,0xBB11,0x1111,0x2BB1,0x1111,0xBBB1,0x1111,0xBB11,
0x1111,0x1111,0x1111,0xB111,0x1111,0xBB11,0x1111,0xBB11,
0x1111,0x9633,0x911B,0x9666,0x611B,0x9666,0x3111,0x9633,
0x1111,0x9669,0x11BB,0x9666,0x1B22,0x9633,0x1B22,0x9611,
0x9669,0xBBB1,0x6669,0xBB11,0x3369,0x1111,0x6669,0xB119,
0x6669,0xBB16,0x6669,0xBB16,0x3369,0xB113,0x1169,0x1111,
0x11BB,0x1111,0x111B,0x1111,0x1111,0x1111,0x111B,0x1111,
0x11B2,0x1111,0x11BB,0x1111,0x111B,0x1111,0x1111,0x1111,
0x1111,0xBB11,0x1111,0xB111,0x1111,0x1111,0x1111,0xB111,
0x1111,0xBB11,0x1111,0xBB11,0x1111,0xB111,0x1111,0x1111,
0x1BBB,0x9669,0x11BB,0x9666,0x1111,0x9633,0x911B,0x9666,
0x61B2,0x9666,0x61BB,0x9666,0x311B,0x9633,0x1111,0x9611,
0x9999,0x9999,0x6666,0x6666,0x3663,0x6396,0x1961,0x6133,
0x1331,0x3111,0x1111,0x1111,0x1BBB,0x1BB1,0xB22B,0xB2BB,
0x9999,0x9999,0x6666,0x6666,0x3366,0x3966,0x1196,0x1333,
0x1133,0x1111,0x1111,0x1111,0xBB11,0x111B,0x2BB1,0x11B2,
0x6669,0xBB11,0x3369,0xBB11,0x1169,0xBBB1,0x1133,0xB22B,
0xBB15,0x122B,0x2BBB,0xBBBB,0xBBBB,0xBBBB,0xBB2A,0x1111,
0x1B22,0xBBBB,0x1BBB,0x1BB1,0x11BB,0x1111,0x1111,0x1111,
0x11BB,0x11BB,0xBB2B,0xBB2B,0xBBBB,0xBBBB,0x11BB,0x11BB,
0xB22B,0xBBBB,0xBBBB,0x1BB1,0x1BB1,0x1111,0x1111,0x1111,
0x1BBB,0x11BB,0xBB2B,0xBB2B,0xBBBB,0xBBBB,0x1BBB,0x11BB,
0x2BB1,0x11B2,0xBBB1,0x11BB,0xBB11,0x111B,0x1111,0x1111,
0x11BB,0x11BB,0xBB2B,0xBB2B,0xBBBB,0xBBBB,0x11BB,0x11BB,
0xBBBB,0x2BB1,0x1BB1,0xBBB1,0x1111,0xBB11,0x1111,0x1111,
0x11BB,0x11BB,0xBB2B,0xBB2B,0xBBBB,0xBBBB,0x11BB,0x11BB,
0x11B2,0x9666,0x11BB,0x9633,0xBB1B,0x9611,0x22B1,0x331B,
0x22BB,0x51BB,0xBB2B,0x5B2B,0xBBBB,0xBBBB,0x11BB,0xAABB,
0x1166,0xB111,0x1666,0xBB11,0x1963,0xBB11,0x1331,0xB111,
0x1111,0x1111,0xBB11,0x111B,0x2BB1,0x11B2,0x2BB1,0x11B2,
0x111B,0x1111,0x11B2,0x1111,0x11BB,0x1111,0x111B,0x1111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0xBBB1,0x11BB,0xBB11,0x111B,0x1111,0x1111,0x1111,0x1111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0x1111,0xB111,0x1111,0xBB11,0x1111,0xBB11,0x1111,0xB111,
0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,0x1111,
0x111B,0x6611,0x11B2,0x6661,0x11BB,0x3961,0x111B,0x1331,
0x1111,0x1111,0xB111,0x11BB,0xBB11,0x1B22,0xBB11,0x1B22,
};
const unsigned short map2Map[2048] __attribute__((aligned(4)))=
{
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0001,0x0401,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0002,0x0003,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0004,0x0005,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0006,0x0007,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0008,0x0009,
0x000A,0x000B,0x000C,0x000D,0x0000,0x0000,0x0001,0x0401,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0000,0x0000,0x0004,0x0005,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0002,0x0003,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0006,0x0007,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0008,0x0009,0x001D,0x001E,0x000C,0x000D,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x001F,0x0020,0x0021,0x0022,0x0023,0x0024,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,0x0000,0x0000,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0008,0x0009,
0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,0x0025,0x0026,
0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,0x0000,0x0000,
0x000E,0x000F,0x0010,0x0011,0x0012,0x0013,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x000E,0x000F,
0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,0x0027,0x0016,
0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,0x0000,0x0000,
0x0014,0x0015,0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0028,0x0029,0x000A,0x000B,0x000A,0x000B,
0x0019,0x001A,0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0427,0x0010,0x0011,0x0010,0x0011,
0x0014,0x0015,0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0019,0x001A,0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0014,0x0015,0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0019,0x001A,0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0014,0x0015,0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0019,0x001A,0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0014,0x0015,0x0016,0x0016,0x0017,0x0018,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0019,0x001A,0x0016,0x0016,0x001B,0x001C,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0008,0x0009,0x001D,0x001E,0x000C,0x000D,
0x0000,0x0000,0x0001,0x0401,0x0000,0x0000,0x0008,0x0009,
0x001D,0x001E,0x000C,0x000D,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0008,0x0009,0x000A,0x000B,
0x0000,0x0000,0x001F,0x0020,0x0021,0x0022,0x0023,0x0024,
0x0000,0x0000,0x0004,0x0005,0x0000,0x0000,0x001F,0x0020,
0x0021,0x0022,0x0023,0x0024,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x000E,0x000F,0x0010,0x0011,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0001,0x0401,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0001,0x0401,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0004,0x0005,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0004,0x0005,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0008,0x0009,
0x000C,0x000D,0x0000,0x0000,0x0014,0x0015,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x001F,0x0020,
0x0023,0x0024,0x0000,0x0000,0x0019,0x001A,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0002,0x0003,
0x0000,0x0000,0x0000,0x0000,0x0002,0x0003,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0002,0x0003,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0014,0x0015,0x0016,0x0016,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0006,0x0007,
0x0000,0x0000,0x0000,0x0000,0x0006,0x0007,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0006,0x0007,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0019,0x001A,0x0016,0x0016,
0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,
0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,
0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,0x000A,0x000B,
0x000A,0x000B,0x000A,0x000B,0x0025,0x0026,0x0016,0x0016,
0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,
0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,
0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,0x0010,0x0011,
0x0010,0x0011,0x0010,0x0011,0x0027,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,0x0016,
};
const unsigned short map2Pal[256] __attribute__((aligned(4)))=
{
0x0000,0x1864,0x2529,0x1586,0x166E,0x18C6,0x0DEB,0x290E,
0x3151,0x16B0,0x354A,0x1888,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
};
//}}BLOCK(map2)
| 50.011186 | 72 | 0.816283 |
da5fb971b0a9c102a92e92a43969cc1e5db42372 | 10,974 | h | C | lib/am335x_sdk/ti/csl/soc/tda3xx/hw_dss_cm_core.h | brandonbraun653/Apollo | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | [
"MIT"
] | 2 | 2021-12-27T10:19:01.000Z | 2022-03-15T07:09:06.000Z | lib/am335x_sdk/ti/csl/soc/tda3xx/hw_dss_cm_core.h | brandonbraun653/Apollo | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | [
"MIT"
] | null | null | null | lib/am335x_sdk/ti/csl/soc/tda3xx/hw_dss_cm_core.h | brandonbraun653/Apollo | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | [
"MIT"
] | null | null | null | /*
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* \file hw_dss_cm_core.h
*
* \brief Register-level header file for PRCM
*
**/
#ifndef HW_DSS_CM_CORE_H_
#define HW_DSS_CM_CORE_H_
#ifdef __cplusplus
extern "C"
{
#endif
/****************************************************************************************************
* Register Definitions
****************************************************************************************************/
#define CM_DSS_CLKSTCTRL (0x0U)
#define CM_DSS_STATICDEP (0x4U)
#define CM_DSS_DYNAMICDEP (0x8U)
#define CM_DSS_DSS_CLKCTRL (0x20U)
#define CM_DSS_SDVENC_CLKCTRL (0x3cU)
/****************************************************************************************************
* Field Definition Macros
****************************************************************************************************/
#define CM_DSS_CLKSTCTRL_CLKTRCTRL_SHIFT (0U)
#define CM_DSS_CLKSTCTRL_CLKTRCTRL_MASK (0x00000003U)
#define CM_DSS_CLKSTCTRL_CLKTRCTRL_NO_SLEEP (0U)
#define CM_DSS_CLKSTCTRL_CLKTRCTRL_SW_SLEEP (1U)
#define CM_DSS_CLKSTCTRL_CLKTRCTRL_SW_WKUP (2U)
#define CM_DSS_CLKSTCTRL_CLKTRCTRL_HW_AUTO (3U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L3_GICLK_SHIFT (8U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L3_GICLK_MASK (0x00000100U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L3_GICLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L3_GICLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_RESERVED_SHIFT (2U)
#define CM_DSS_CLKSTCTRL_RESERVED_MASK (0x000000fcU)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_GFCLK_SHIFT (9U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_GFCLK_MASK (0x00000200U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_GFCLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_GFCLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO1_DPLL_CLK_SHIFT (10U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO1_DPLL_CLK_MASK (0x00000400U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO1_DPLL_CLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO1_DPLL_CLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_DPLL_CLK_SHIFT (11U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_DPLL_CLK_MASK (0x00000800U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_DPLL_CLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_DPLL_CLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO2_DPLL_CLK_SHIFT (12U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO2_DPLL_CLK_MASK (0x00001000U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO2_DPLL_CLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_VIDEO2_DPLL_CLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_BB2D_GFCLK_SHIFT (13U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_BB2D_GFCLK_MASK (0x00002000U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_BB2D_GFCLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_BB2D_GFCLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L4_GICLK_SHIFT (15U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L4_GICLK_MASK (0x00008000U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L4_GICLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_L4_GICLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_SYS_GFCLK_SHIFT (16U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_SYS_GFCLK_MASK (0x00010000U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_SYS_GFCLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_DSS_SYS_GFCLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_CEC_GFCLK_SHIFT (17U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_CEC_GFCLK_MASK (0x00020000U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_CEC_GFCLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_CEC_GFCLK_ACT (1U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_PHY_GFCLK_SHIFT (18U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_PHY_GFCLK_MASK (0x00040000U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_PHY_GFCLK_INACT (0U)
#define CM_DSS_CLKSTCTRL_CLKACTIVITY_HDMI_PHY_GFCLK_ACT (1U)
#define CM_DSS_STATICDEP_EMIF_STATDEP_SHIFT (4U)
#define CM_DSS_STATICDEP_EMIF_STATDEP_MASK (0x00000010U)
#define CM_DSS_STATICDEP_EMIF_STATDEP_ENABLED (1U)
#define CM_DSS_STATICDEP_EMIF_STATDEP_DISABLED (0U)
#define CM_DSS_STATICDEP_L3MAIN1_STATDEP_SHIFT (5U)
#define CM_DSS_STATICDEP_L3MAIN1_STATDEP_MASK (0x00000020U)
#define CM_DSS_STATICDEP_L3MAIN1_STATDEP_ENABLED (1U)
#define CM_DSS_DYNAMICDEP_L3MAIN1_DYNDEP_SHIFT (5U)
#define CM_DSS_DYNAMICDEP_L3MAIN1_DYNDEP_MASK (0x00000020U)
#define CM_DSS_DYNAMICDEP_L3MAIN1_DYNDEP_DISABLED (0U)
#define CM_DSS_DSS_CLKCTRL_IDLEST_SHIFT (16U)
#define CM_DSS_DSS_CLKCTRL_IDLEST_MASK (0x00030000U)
#define CM_DSS_DSS_CLKCTRL_IDLEST_DISABLE (3U)
#define CM_DSS_DSS_CLKCTRL_IDLEST_IDLE (2U)
#define CM_DSS_DSS_CLKCTRL_IDLEST_FUNC (0U)
#define CM_DSS_DSS_CLKCTRL_IDLEST_TRANS (1U)
#define CM_DSS_DSS_CLKCTRL_STBYST_SHIFT (18U)
#define CM_DSS_DSS_CLKCTRL_STBYST_MASK (0x00040000U)
#define CM_DSS_DSS_CLKCTRL_STBYST_FUNC (0U)
#define CM_DSS_DSS_CLKCTRL_STBYST_STANDBY (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_DSSCLK_SHIFT (8U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_DSSCLK_MASK (0x00000100U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_DSSCLK_FCLK_EN (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_DSSCLK_FCLK_DIS (0U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_48MHZ_CLK_SHIFT (9U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_48MHZ_CLK_MASK (0x00000200U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_48MHZ_CLK_FCLK_EN (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_48MHZ_CLK_FCLK_DIS (0U)
#define CM_DSS_DSS_CLKCTRL_MODULEMODE_SHIFT (0U)
#define CM_DSS_DSS_CLKCTRL_MODULEMODE_MASK (0x00000003U)
#define CM_DSS_DSS_CLKCTRL_MODULEMODE_DISABLED (0U)
#define CM_DSS_DSS_CLKCTRL_MODULEMODE_RESERVED_1 (1U)
#define CM_DSS_DSS_CLKCTRL_MODULEMODE_ENABLED (2U)
#define CM_DSS_DSS_CLKCTRL_MODULEMODE_RESERVED (3U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_HDMI_CLK_SHIFT (10U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_HDMI_CLK_MASK (0x00000400U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_HDMI_CLK_FCLK_EN (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_HDMI_CLK_FCLK_DIS (0U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_32KHZ_CLK_SHIFT (11U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_32KHZ_CLK_MASK (0x00000800U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_32KHZ_CLK_FCLK_EN (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_32KHZ_CLK_FCLK_DIS (0U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO1_CLK_SHIFT (12U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO1_CLK_MASK (0x00001000U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO1_CLK_FCLK_EN (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO1_CLK_FCLK_DIS (0U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO2_CLK_SHIFT (13U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO2_CLK_MASK (0x00002000U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO2_CLK_FCLK_EN (1U)
#define CM_DSS_DSS_CLKCTRL_OPTFCLKEN_VIDEO2_CLK_FCLK_DIS (0U)
#define CM_DSS_SDVENC_CLKCTRL_IDLEST_SHIFT (16U)
#define CM_DSS_SDVENC_CLKCTRL_IDLEST_MASK (0x00030000U)
#define CM_DSS_SDVENC_CLKCTRL_IDLEST_DISABLE (3U)
#define CM_DSS_SDVENC_CLKCTRL_IDLEST_IDLE (2U)
#define CM_DSS_SDVENC_CLKCTRL_IDLEST_FUNC (0U)
#define CM_DSS_SDVENC_CLKCTRL_IDLEST_TRANS (1U)
#define CM_DSS_SDVENC_CLKCTRL_MODULEMODE_SHIFT (0U)
#define CM_DSS_SDVENC_CLKCTRL_MODULEMODE_MASK (0x00000003U)
#define CM_DSS_SDVENC_CLKCTRL_MODULEMODE_DISABLED (0U)
#define CM_DSS_SDVENC_CLKCTRL_MODULEMODE_RESERVED_1 (1U)
#define CM_DSS_SDVENC_CLKCTRL_MODULEMODE_ENABLE (2U)
#define CM_DSS_SDVENC_CLKCTRL_MODULEMODE_RESERVED (3U)
#ifdef __cplusplus
}
#endif
#endif /* HW_DSS_CM_CORE_H_ */
| 53.794118 | 102 | 0.662475 |
5990bfc5cb7d0ca75d336384c319caf3cc3f7d5b | 475 | h | C | five/include/five.h | mutouyun/Monte-Carlo | 35afccdd6bc201fd3f398361c2f23b452a9fb752 | [
"MIT"
] | null | null | null | five/include/five.h | mutouyun/Monte-Carlo | 35afccdd6bc201fd3f398361c2f23b452a9fb752 | [
"MIT"
] | null | null | null | five/include/five.h | mutouyun/Monte-Carlo | 35afccdd6bc201fd3f398361c2f23b452a9fb752 | [
"MIT"
] | null | null | null | #pragma once
#include <cstddef>
#include "five_global.h"
struct FIVESHARED_EXPORT st_info {
int x_, y_;
double rate_, score_;
int win_, visits_;
};
using call_t = void(*)(void* p, std::size_t t, st_info* l, std::size_t s);
FIVESHARED_EXPORT void five_prepare(call_t call, std::size_t limit = -1, std::size_t timeout = -1, void* p = nullptr);
FIVESHARED_EXPORT void five_start_game();
FIVESHARED_EXPORT std::size_t five_calc_next(unsigned* px, unsigned* py);
| 26.388889 | 118 | 0.72 |
20ccdbb657aa80c52308321352eb0b79f9352c93 | 242 | h | C | src/2photo/views/table_view_cells/TPBasicTableViewCell.h | petropavel13/2photo-iOS | ad8e4b7b97c632d930a87057e209e56df99da680 | [
"MIT"
] | null | null | null | src/2photo/views/table_view_cells/TPBasicTableViewCell.h | petropavel13/2photo-iOS | ad8e4b7b97c632d930a87057e209e56df99da680 | [
"MIT"
] | null | null | null | src/2photo/views/table_view_cells/TPBasicTableViewCell.h | petropavel13/2photo-iOS | ad8e4b7b97c632d930a87057e209e56df99da680 | [
"MIT"
] | null | null | null | //
// TPBasicTableViewCell.h
// 2photo
//
// Created by smolin_in on 03/05/14.
// Copyright (c) 2014 null inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TPBasicTableViewCell : UITableViewCell
- (void)applyStyle;
@end
| 15.125 | 53 | 0.698347 |
1f2c051e6f5b9abf81a6dac3eda7fa2c4a17b797 | 1,714 | c | C | interactive/input.c | AmeerHajAli/code2vec_c | 0b6d945dd9a7861b80588619befd0866c5c2b592 | [
"Apache-2.0"
] | 6 | 2020-10-26T08:43:24.000Z | 2022-03-02T15:32:20.000Z | interactive/input.c | beniz/code2vec-c | 02ffa2392e502109fc72217b097576d7cc9401c7 | [
"Apache-2.0"
] | 1 | 2021-01-09T17:53:32.000Z | 2021-01-09T17:53:32.000Z | interactive/input.c | beniz/code2vec-c | 02ffa2392e502109fc72217b097576d7cc9401c7 | [
"Apache-2.0"
] | 4 | 2021-01-07T17:45:52.000Z | 2021-05-28T04:08:12.000Z | /*
// C extractor for code2vec
// Copyright 2019 Carnegie Mellon University. All Rights Reserved.
//
// NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
// Released under a MIT (SEI)-style license, please see license.txt or contact permission@sei.cmu.edu for full terms.
// [DISTRIBUTION STATEMENT A] This material has been approved for public release and unlimited distribution. Please see Copyright notice for non-US Government use and distribution.
// Carnegie Mellon® and CERT® are registered in the U.S. Patent and Trademark Office by Carnegie Mellon University.
// This Software includes and/or makes use of the following Third-Party Software subject to its own license:
// 1. code2vec (https://github.com/tech-srl/code2vec/blob/master/LICENSE) Copyright 2018 Technion.
// 2. LLVM / CLANG (https://github.com/llvm-mirror/clang/blob/master/LICENSE.TXT) Copyright 2019 LLVM.
// DM19-0540
*/
int sum_square(int v1, int v2) {
return (v1+v2)*(v1+v2);
}
int foo(int n) {
if (n < 0) {
return -n;
}
return n;
}
int f(int n) {
if (n == 0) {
return 1;
} else {
return n * f(n-1);
}
}
abs2(int *v)
{
if((*v) < 0) { (*v) = -(*v); }
}
| 45.105263 | 514 | 0.691949 |
3e009b3bdfa4175fa1e3264305aed34b1bfab2dc | 20 | c | C | qmk_firmware/keyboards/xelus/dawn60/dawn60.c | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/keyboards/xelus/dawn60/dawn60.c | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/keyboards/xelus/dawn60/dawn60.c | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | #include "dawn60.h"
| 10 | 19 | 0.7 |
31cf10c251e60d66a73d2d784636bd3ff2516d02 | 308 | c | C | test/programs/simple/modulo.c | melkishengue/cpachecker | a7dc3c9f747fa9139a9760bca22ab1a8b6a4a846 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/programs/simple/modulo.c | melkishengue/cpachecker | a7dc3c9f747fa9139a9760bca22ab1a8b6a4a846 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-11-11T14:23:56.000Z | 2019-11-11T14:23:56.000Z | test/programs/simple/modulo.c | melkishengue/cpachecker | a7dc3c9f747fa9139a9760bca22ab1a8b6a4a846 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | extern int __VERIFIER_assume(int);
void __VERIFIER_assert(int cond) {
if (!cond) {
ERROR:
return;
}
}
int main(void) {
int i;
__VERIFIER_assume(i == 5);
__VERIFIER_assert(i % 2 == 1);
__VERIFIER_assert(-i % 2 == -1);
__VERIFIER_assert(i % -2 == 1);
__VERIFIER_assert(-i % -2 == -1);
}
| 16.210526 | 35 | 0.61039 |
0c5083e75c25c086f2757808d7bdcd7e02b99803 | 1,969 | h | C | vm/external_libs/llvm/lib/Target/IA64/IA64RegisterInfo.h | marnen/rubinius | 05b3f9789d01bada0604a7f09921c956bc9487e7 | [
"BSD-3-Clause"
] | 1 | 2016-05-08T16:58:14.000Z | 2016-05-08T16:58:14.000Z | vm/external_libs/llvm/lib/Target/IA64/IA64RegisterInfo.h | taf2/rubinius | 493bfa2351fc509ca33d3bb03991c2e9c2b6dafa | [
"BSD-3-Clause"
] | null | null | null | vm/external_libs/llvm/lib/Target/IA64/IA64RegisterInfo.h | taf2/rubinius | 493bfa2351fc509ca33d3bb03991c2e9c2b6dafa | [
"BSD-3-Clause"
] | null | null | null | //===- IA64RegisterInfo.h - IA64 Register Information Impl ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the IA64 implementation of the TargetRegisterInfo class.
//
//===----------------------------------------------------------------------===//
#ifndef IA64REGISTERINFO_H
#define IA64REGISTERINFO_H
#include "llvm/Target/TargetRegisterInfo.h"
#include "IA64GenRegisterInfo.h.inc"
namespace llvm {
class TargetInstrInfo;
struct IA64RegisterInfo : public IA64GenRegisterInfo {
const TargetInstrInfo &TII;
IA64RegisterInfo(const TargetInstrInfo &tii);
/// Code Generation virtual methods...
const unsigned *getCalleeSavedRegs(const MachineFunction *MF = 0) const;
const TargetRegisterClass* const* getCalleeSavedRegClasses(
const MachineFunction *MF = 0) const;
BitVector getReservedRegs(const MachineFunction &MF) const;
bool hasFP(const MachineFunction &MF) const;
void eliminateCallFramePseudoInstr(MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI) const;
void eliminateFrameIndex(MachineBasicBlock::iterator MI,
int SPAdj, RegScavenger *RS = NULL) const;
void emitPrologue(MachineFunction &MF) const;
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
// Debug information queries.
unsigned getRARegister() const;
unsigned getFrameRegister(MachineFunction &MF) const;
// Exception handling queries.
unsigned getEHExceptionRegister() const;
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
};
} // End llvm namespace
#endif
| 30.765625 | 80 | 0.644997 |
91bbf1169ceb1322b16174c486ab1fb33891744f | 1,626 | h | C | gv_framework/network/gv_network_manager.h | dragonsn/gv_game_engine | dca6c1fb1f8d96e9a244f157a63f8a69da084b0f | [
"MIT"
] | 2 | 2018-12-03T13:17:31.000Z | 2020-04-08T07:00:02.000Z | gv_framework/network/gv_network_manager.h | dragonsn/gv_game_engine | dca6c1fb1f8d96e9a244f157a63f8a69da084b0f | [
"MIT"
] | null | null | null | gv_framework/network/gv_network_manager.h | dragonsn/gv_game_engine | dca6c1fb1f8d96e9a244f157a63f8a69da084b0f | [
"MIT"
] | null | null | null | #pragma once
namespace gv
{
class gv_network_mgr_imp;
class gv_network_mgr : public gv_event_processor
{
friend class gv_com_net_host;
public:
GVM_DCL_CLASS(gv_network_mgr, gv_event_processor)
gv_network_mgr();
~gv_network_mgr();
//-------------------------events---------------------
virtual void register_events();
virtual void unregister_events();
virtual bool tick(gv_float dt);
virtual bool do_synchronization();
//--
virtual gv_int connect_host(gv_com_net_host* remote);
virtual gv_int disconnect_host(gv_com_net_host* remote);
virtual gv_com_net_host* create_remote_host();
virtual void send_packet(gv_com_net_host* remote, gv_packet*,
bool need_reliable);
virtual gv_packet* create_packet(bool need_reliable = true);
protected:
virtual gv_int on_event_add_host(class gv_object_event_net_add_host* pevent);
virtual gv_int
on_event_remove_host(class gv_object_event_net_remove_host* pevent);
virtual gv_int
on_event_add_net_replica(class gv_object_event_net_add_net_replica* pevent);
virtual gv_int on_event_remove_net_replica(
class gv_object_event_net_remove_net_replica* pevent);
virtual void create_connection(gvt_ref_ptr< gv_session_event >& event);
virtual void cancel_connection(gvt_ref_ptr< gv_session_event >& event);
virtual void remove_connection(gvt_ref_ptr< gv_session_event >& event);
gv_network_mgr_imp* get_impl();
protected:
gvt_ref_ptr< gv_network_mgr_imp > m_pimpl;
gvt_ref_ptr< gv_com_net_host > m_local_host;
gvt_array< gvt_ref_ptr< gv_com_net_host > > m_remote_hosts;
gvt_hash_map< gv_socket_address, gvt_ptr< gv_com_net_host >, 1024 > m_address_map;
};
} | 35.347826 | 83 | 0.793973 |
09aacd00a6884a7bf385a06d6b775b5af2e9a8e5 | 2,770 | h | C | source/interface/cWorldMap.h | MausGames/project-one | 157c93e8b4a926528ce5e77efacfcd950ea361f9 | [
"Zlib"
] | 3 | 2015-06-30T00:10:29.000Z | 2021-03-09T21:05:11.000Z | source/interface/cWorldMap.h | MausGames/project-one | 157c93e8b4a926528ce5e77efacfcd950ea361f9 | [
"Zlib"
] | null | null | null | source/interface/cWorldMap.h | MausGames/project-one | 157c93e8b4a926528ce5e77efacfcd950ea361f9 | [
"Zlib"
] | null | null | null | ///////////////////////////////////////////////////////
//*-------------------------------------------------*//
//| Part of Project One (https://www.maus-games.at) |//
//*-------------------------------------------------*//
//| Released under the zlib License |//
//| More information available in the readme file |//
//*-------------------------------------------------*//
///////////////////////////////////////////////////////
#pragma once
#ifndef _P1_GUARD_WORLDMAP_H_
#define _P1_GUARD_WORLDMAP_H_
// TODO 1: design gamepad navigation (free movement?, fixed direction? (arbritrary, left-right), improve pin-order)
// TODO 1: 2 blinking arrow cursors, to highlight navigation (blinking, not moving, for contrast with rotating pin)
// ****************************************************************
// world map definitions
#define WORLDMAP_PINS (9u) //
#define WORLDMAP_LINES (WORLDMAP_PINS - 1u) //
#define WORLDMAP_PIN_SIZE (coreVector2(0.05f,0.05f)) //
#define WORLDMAP_LINE_SIZE (0.005f) //
// ****************************************************************
// world map class
class cWorldMap final : public cGuiObject
{
private:
//
struct sData final
{
coreInt32 iID; //
const coreChar* pcName; //
coreVector3 vColor; //
coreVector2 vPosition; //
};
private:
cGuiObject m_aPin [WORLDMAP_PINS]; //
cGuiObject m_aPinDot[WORLDMAP_PINS]; //
cGuiObject m_aLine [WORLDMAP_LINES]; //
cGuiObject m_Cursor; //
cTooltip m_Tooltip; //
sData m_aData[WORLDMAP_PINS]; //
coreFlow m_fMove; //
coreUint8 m_iOldPin; //
coreUint8 m_iNewPin; //
coreFlow m_fPinAngle; //
coreFlow m_fCursorAngle; //
coreUint16 m_iEnabled; //
public:
cWorldMap()noexcept;
DISABLE_COPY(cWorldMap)
// render and move the world map
void Render()final;
void Move ()final;
//
void Arrange();
//
void EnablePin(const coreUintW iIndex, const coreBool bEnable, const coreBool bShow);
void SelectPin(const coreUintW iIndex);
//
inline cGuiObject* GetPin(const coreUintW iIndex) {ASSERT(iIndex < WORLDMAP_PINS) return &m_aPin[iIndex];}
//
inline coreBool GetSelectionState()const {return m_aPin[m_iNewPin].IsClicked();}
inline const coreUint8& GetSelectionIndex()const {return m_iNewPin;}
inline const coreInt32& GetSelectionID ()const {return m_aData[m_iNewPin].iID;}
};
#endif // _P1_GUARD_WORLDMAP_H_ | 32.209302 | 115 | 0.508303 |
e59096a8d7e7c50cfed025657e879d5ae44a5407 | 54,134 | c | C | testsuite/EXP_3/test127.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 34 | 2017-07-04T14:16:12.000Z | 2021-04-22T21:04:43.000Z | testsuite/EXP_3/test127.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 1 | 2017-07-06T03:43:44.000Z | 2017-07-06T03:43:44.000Z | testsuite/EXP_3/test127.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 6 | 2017-07-04T16:30:42.000Z | 2019-10-16T05:37:29.000Z |
/*
CF3
Copyright (c) 2015 ishiura-lab.
Released under the MIT license.
https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md
*/
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#include"test1.h"
int16_t x3 = 1442;
uint32_t t0 = 5U;
static int64_t x20 = -278704990068812141LL;
uint32_t x25 = UINT32_MAX;
int64_t x28 = -51119LL;
int64_t t2 = 253278LL;
uint32_t x29 = UINT32_MAX;
int8_t x32 = -44;
static int8_t x40 = INT8_MIN;
int8_t x41 = INT8_MIN;
int32_t x44 = -14299;
static volatile int64_t t7 = 2159742767863231LL;
static int32_t x51 = -1;
volatile uint32_t x55 = 1323902709U;
static int16_t x58 = -1;
static volatile int8_t x59 = -1;
uint32_t x62 = UINT32_MAX;
uint16_t x63 = 0U;
uint32_t x66 = 207240776U;
volatile int32_t x67 = -8379;
int8_t x79 = 2;
static int32_t x80 = -1;
static uint8_t x86 = UINT8_MAX;
static uint8_t x87 = 49U;
volatile int32_t x90 = -461;
int16_t x92 = -183;
int64_t x93 = INT64_MAX;
static int16_t x97 = INT16_MIN;
int16_t x99 = 1;
uint8_t x102 = UINT8_MAX;
volatile int16_t x103 = -10077;
int16_t x110 = -637;
static int8_t x112 = INT8_MAX;
int8_t x131 = -1;
static uint16_t x135 = 76U;
static volatile uint8_t x137 = UINT8_MAX;
uint64_t x152 = UINT64_MAX;
uint16_t x153 = 320U;
int32_t x155 = INT32_MIN;
static int16_t x163 = INT16_MAX;
int16_t x166 = INT16_MAX;
int16_t x171 = INT16_MIN;
volatile int32_t t35 = -6933354;
int64_t t36 = -17446686825903610LL;
static uint64_t x202 = 2227155LLU;
static volatile int8_t x204 = INT8_MAX;
static int64_t t40 = 1377663451283LL;
uint16_t x212 = UINT16_MAX;
static int32_t t42 = 6297058;
uint16_t x220 = UINT16_MAX;
int32_t t43 = -206406;
int8_t x232 = INT8_MIN;
static int32_t t47 = 3616357;
int16_t x250 = -1;
int32_t t50 = 127;
uint32_t t52 = 9063U;
uint32_t t54 = 44U;
int8_t x276 = INT8_MIN;
volatile int8_t x281 = -1;
uint64_t x286 = 13239784202819LLU;
int32_t x287 = -1;
int32_t x290 = INT32_MIN;
static int16_t x295 = -1;
volatile int32_t t61 = -1;
int16_t x302 = -1;
int16_t x304 = -1;
int16_t x306 = INT16_MIN;
volatile uint16_t x308 = UINT16_MAX;
uint8_t x317 = 58U;
uint64_t x320 = 2089713912388672349LLU;
uint16_t x322 = UINT16_MAX;
static int16_t x324 = INT16_MIN;
volatile int32_t x339 = -229879969;
static volatile int32_t t68 = -121;
static uint64_t x342 = UINT64_MAX;
int32_t t69 = -153;
volatile int64_t t70 = 105492276002079LL;
int16_t x349 = 24;
uint32_t x350 = UINT32_MAX;
int32_t x353 = INT32_MAX;
int16_t x358 = -1;
static uint64_t x362 = UINT64_MAX;
int32_t t76 = 1;
int16_t x374 = 52;
volatile int32_t x375 = 6901468;
uint16_t x378 = 32U;
volatile uint64_t x388 = 50650649202LLU;
volatile uint64_t t79 = 60939096093156LLU;
static uint32_t x392 = 381805U;
uint16_t x397 = UINT16_MAX;
int8_t x408 = -1;
int16_t x420 = 7544;
volatile int32_t x421 = INT32_MAX;
uint8_t x428 = UINT8_MAX;
int32_t x438 = INT32_MIN;
int64_t x439 = -1LL;
int16_t x440 = INT16_MIN;
volatile int32_t t92 = -12973970;
int32_t x457 = INT32_MAX;
int8_t x458 = -1;
int8_t x464 = INT8_MIN;
int64_t x465 = INT64_MIN;
int16_t x466 = INT16_MAX;
int8_t x467 = -1;
int16_t x485 = -1;
int16_t x488 = -1;
int64_t x489 = -1LL;
uint16_t x491 = 15164U;
int16_t x494 = -831;
static uint8_t x496 = UINT8_MAX;
static uint32_t x497 = 70754U;
volatile uint64_t x513 = 2LLU;
volatile int32_t t105 = 5201125;
static int16_t x520 = INT16_MIN;
volatile int32_t t109 = -13873793;
int8_t x538 = INT8_MIN;
int32_t x550 = 10;
uint32_t x555 = UINT32_MAX;
volatile uint32_t t115 = 143630104U;
int64_t x563 = INT64_MIN;
int32_t x567 = INT32_MIN;
int16_t x581 = INT16_MIN;
uint16_t x587 = UINT16_MAX;
uint16_t x588 = UINT16_MAX;
int32_t t124 = -1725;
uint8_t x596 = 114U;
int8_t x598 = INT8_MIN;
int16_t x602 = INT16_MIN;
volatile int32_t x606 = INT32_MIN;
uint8_t x607 = UINT8_MAX;
int32_t t130 = -740433;
int8_t x628 = 15;
volatile int16_t x636 = INT16_MAX;
int16_t x637 = INT16_MIN;
uint8_t x638 = 0U;
int64_t x639 = -1LL;
uint64_t x640 = 21049506LLU;
static volatile uint64_t t134 = 1704LLU;
volatile int8_t x644 = INT8_MAX;
static uint8_t x648 = 13U;
uint16_t x652 = UINT16_MAX;
int32_t x653 = -2;
int32_t x656 = INT32_MAX;
static volatile int32_t t139 = -23644;
static volatile int32_t t141 = INT32_MAX;
int16_t x673 = INT16_MAX;
volatile int32_t t142 = -64342;
static uint8_t x677 = 22U;
int16_t x684 = -1;
int32_t t147 = -92;
uint8_t x697 = 37U;
uint32_t x700 = 684U;
volatile int8_t x705 = INT8_MIN;
volatile uint8_t x706 = 39U;
int64_t t151 = 301448337365845LL;
static uint8_t x717 = 23U;
uint64_t x720 = 311676LLU;
int64_t x729 = INT64_MAX;
int64_t t154 = 561595LL;
volatile int32_t t157 = 12716;
uint64_t x762 = 6LLU;
volatile uint32_t t161 = 14285985U;
int16_t x783 = INT16_MIN;
int32_t x788 = -1;
static volatile uint64_t t165 = 158471860161125LLU;
volatile int64_t t166 = 33904LL;
uint16_t x798 = 12746U;
int32_t x800 = -31672;
int64_t x807 = 242239LL;
static uint8_t x809 = 18U;
int32_t t170 = 38;
volatile int64_t x823 = -59LL;
static volatile int16_t x829 = 7;
int8_t x831 = 1;
uint64_t x832 = 804764LLU;
int8_t x841 = -1;
int16_t x847 = INT16_MIN;
int32_t t179 = 418;
volatile int16_t x857 = -1;
static volatile uint8_t x865 = 0U;
uint16_t x866 = 15649U;
int32_t x869 = INT32_MIN;
int64_t x877 = INT64_MIN;
uint16_t x880 = 1U;
int16_t x882 = INT16_MIN;
volatile int64_t x887 = -1LL;
static uint32_t x898 = 7479U;
static int64_t x900 = INT64_MIN;
uint64_t t189 = 9584227606964LLU;
volatile int8_t x901 = 0;
int8_t x906 = INT8_MIN;
int8_t x910 = INT8_MAX;
volatile int64_t x914 = INT64_MAX;
uint32_t x917 = 507U;
static uint16_t x919 = 12U;
static uint64_t x924 = 1LLU;
uint32_t x929 = 279U;
volatile int16_t x933 = INT16_MIN;
uint8_t x934 = 14U;
static uint64_t x940 = UINT64_MAX;
static uint64_t t198 = 664231746485LLU;
uint64_t x944 = UINT64_MAX;
void f0(void) {
uint64_t x1 = 98414281980819212LLU;
int64_t x2 = -1LL;
static uint32_t x4 = 38900728U;
t0 = ((x1<=x2)+(x3+x4));
if (t0 != 38902171U) { NG(); } else { ; }
}
void f1(void) {
static uint32_t x17 = 1618299U;
int16_t x18 = INT16_MIN;
int32_t x19 = INT32_MIN;
static int64_t t1 = 7175278309LL;
t1 = ((x17<=x18)+(x19+x20));
if (t1 != -278704992216295788LL) { NG(); } else { ; }
}
void f2(void) {
uint16_t x26 = 973U;
volatile uint32_t x27 = UINT32_MAX;
t2 = ((x25<=x26)+(x27+x28));
if (t2 != 4294916176LL) { NG(); } else { ; }
}
void f3(void) {
int64_t x30 = -1LL;
volatile int32_t x31 = 413;
int32_t t3 = 1553199;
t3 = ((x29<=x30)+(x31+x32));
if (t3 != 369) { NG(); } else { ; }
}
void f4(void) {
int8_t x33 = 51;
int16_t x34 = -2;
int32_t x35 = -630515;
uint32_t x36 = 386U;
volatile uint32_t t4 = 246995U;
t4 = ((x33<=x34)+(x35+x36));
if (t4 != 4294337167U) { NG(); } else { ; }
}
void f5(void) {
int8_t x37 = INT8_MIN;
volatile int32_t x38 = INT32_MAX;
int32_t x39 = -1;
static int32_t t5 = -11994;
t5 = ((x37<=x38)+(x39+x40));
if (t5 != -128) { NG(); } else { ; }
}
void f6(void) {
uint32_t x42 = 11359465U;
int8_t x43 = INT8_MIN;
int32_t t6 = -717031229;
t6 = ((x41<=x42)+(x43+x44));
if (t6 != -14427) { NG(); } else { ; }
}
void f7(void) {
static int8_t x45 = INT8_MIN;
int16_t x46 = 1715;
int16_t x47 = -2862;
int64_t x48 = -13523508LL;
t7 = ((x45<=x46)+(x47+x48));
if (t7 != -13526369LL) { NG(); } else { ; }
}
void f8(void) {
volatile int16_t x49 = 1886;
int8_t x50 = INT8_MIN;
uint16_t x52 = 249U;
volatile int32_t t8 = 21616;
t8 = ((x49<=x50)+(x51+x52));
if (t8 != 248) { NG(); } else { ; }
}
void f9(void) {
static int8_t x53 = -1;
uint32_t x54 = UINT32_MAX;
static volatile int16_t x56 = -418;
uint32_t t9 = 1611U;
t9 = ((x53<=x54)+(x55+x56));
if (t9 != 1323902292U) { NG(); } else { ; }
}
void f10(void) {
int16_t x57 = -5263;
int64_t x60 = INT64_MAX;
int64_t t10 = INT64_MAX;
t10 = ((x57<=x58)+(x59+x60));
if (t10 != INT64_MAX) { NG(); } else { ; }
}
void f11(void) {
uint8_t x61 = UINT8_MAX;
static int16_t x64 = 0;
volatile int32_t t11 = -10306070;
t11 = ((x61<=x62)+(x63+x64));
if (t11 != 1) { NG(); } else { ; }
}
void f12(void) {
int32_t x65 = 188846;
static int32_t x68 = 224729020;
volatile int32_t t12 = 3565156;
t12 = ((x65<=x66)+(x67+x68));
if (t12 != 224720642) { NG(); } else { ; }
}
void f13(void) {
int64_t x69 = INT64_MAX;
volatile uint16_t x70 = 864U;
static uint64_t x71 = 462534LLU;
static int8_t x72 = INT8_MIN;
uint64_t t13 = 19012LLU;
t13 = ((x69<=x70)+(x71+x72));
if (t13 != 462406LLU) { NG(); } else { ; }
}
void f14(void) {
static int64_t x73 = INT64_MIN;
uint16_t x74 = UINT16_MAX;
uint16_t x75 = 3U;
static int32_t x76 = INT32_MIN;
int32_t t14 = -74;
t14 = ((x73<=x74)+(x75+x76));
if (t14 != -2147483644) { NG(); } else { ; }
}
void f15(void) {
int32_t x77 = INT32_MIN;
uint32_t x78 = 2030934357U;
int32_t t15 = -317568013;
t15 = ((x77<=x78)+(x79+x80));
if (t15 != 1) { NG(); } else { ; }
}
void f16(void) {
static int8_t x85 = INT8_MIN;
volatile uint16_t x88 = UINT16_MAX;
int32_t t16 = 17618;
t16 = ((x85<=x86)+(x87+x88));
if (t16 != 65585) { NG(); } else { ; }
}
void f17(void) {
int16_t x89 = INT16_MIN;
static int16_t x91 = INT16_MIN;
volatile int32_t t17 = -11338;
t17 = ((x89<=x90)+(x91+x92));
if (t17 != -32950) { NG(); } else { ; }
}
void f18(void) {
int16_t x94 = INT16_MAX;
uint16_t x95 = UINT16_MAX;
uint16_t x96 = 8916U;
volatile int32_t t18 = -16743828;
t18 = ((x93<=x94)+(x95+x96));
if (t18 != 74451) { NG(); } else { ; }
}
void f19(void) {
static int16_t x98 = -1716;
int8_t x100 = INT8_MIN;
volatile int32_t t19 = -350;
t19 = ((x97<=x98)+(x99+x100));
if (t19 != -126) { NG(); } else { ; }
}
void f20(void) {
int32_t x101 = -1;
volatile int8_t x104 = -62;
int32_t t20 = 315356754;
t20 = ((x101<=x102)+(x103+x104));
if (t20 != -10138) { NG(); } else { ; }
}
void f21(void) {
volatile int32_t x105 = 272;
uint32_t x106 = 33U;
int64_t x107 = INT64_MIN;
static uint64_t x108 = 952161191LLU;
uint64_t t21 = 7023357463475LLU;
t21 = ((x105<=x106)+(x107+x108));
if (t21 != 9223372037806936999LLU) { NG(); } else { ; }
}
void f22(void) {
uint8_t x109 = 15U;
static volatile int8_t x111 = INT8_MIN;
static volatile int32_t t22 = 388406029;
t22 = ((x109<=x110)+(x111+x112));
if (t22 != -1) { NG(); } else { ; }
}
void f23(void) {
int8_t x113 = INT8_MIN;
uint8_t x114 = 0U;
int16_t x115 = -373;
uint32_t x116 = 846454U;
uint32_t t23 = 285U;
t23 = ((x113<=x114)+(x115+x116));
if (t23 != 846082U) { NG(); } else { ; }
}
void f24(void) {
int32_t x117 = INT32_MIN;
int32_t x118 = -7193079;
int64_t x119 = -12291604532LL;
uint32_t x120 = 2U;
int64_t t24 = 2762189LL;
t24 = ((x117<=x118)+(x119+x120));
if (t24 != -12291604529LL) { NG(); } else { ; }
}
void f25(void) {
uint32_t x121 = 1894863209U;
int8_t x122 = INT8_MIN;
uint16_t x123 = 2U;
int8_t x124 = -1;
int32_t t25 = -320404941;
t25 = ((x121<=x122)+(x123+x124));
if (t25 != 2) { NG(); } else { ; }
}
void f26(void) {
static volatile uint64_t x125 = 5LLU;
static volatile uint64_t x126 = 33009LLU;
int32_t x127 = -290;
int16_t x128 = -1;
volatile int32_t t26 = 36;
t26 = ((x125<=x126)+(x127+x128));
if (t26 != -290) { NG(); } else { ; }
}
void f27(void) {
volatile uint64_t x129 = UINT64_MAX;
uint32_t x130 = UINT32_MAX;
int16_t x132 = 1800;
volatile int32_t t27 = -39613861;
t27 = ((x129<=x130)+(x131+x132));
if (t27 != 1799) { NG(); } else { ; }
}
void f28(void) {
int8_t x133 = INT8_MIN;
static volatile int8_t x134 = -1;
uint64_t x136 = 226LLU;
volatile uint64_t t28 = 11699LLU;
t28 = ((x133<=x134)+(x135+x136));
if (t28 != 303LLU) { NG(); } else { ; }
}
void f29(void) {
int8_t x138 = -1;
volatile int16_t x139 = INT16_MAX;
int8_t x140 = 3;
volatile int32_t t29 = -673616;
t29 = ((x137<=x138)+(x139+x140));
if (t29 != 32770) { NG(); } else { ; }
}
void f30(void) {
volatile int32_t x145 = INT32_MIN;
volatile uint64_t x146 = UINT64_MAX;
static int32_t x147 = INT32_MIN;
int16_t x148 = 0;
static volatile int32_t t30 = -1973;
t30 = ((x145<=x146)+(x147+x148));
if (t30 != -2147483647) { NG(); } else { ; }
}
void f31(void) {
uint32_t x149 = 134349259U;
volatile int32_t x150 = INT32_MIN;
int16_t x151 = -1;
volatile uint64_t t31 = UINT64_MAX;
t31 = ((x149<=x150)+(x151+x152));
if (t31 != UINT64_MAX) { NG(); } else { ; }
}
void f32(void) {
static int16_t x154 = INT16_MIN;
static uint64_t x156 = UINT64_MAX;
volatile uint64_t t32 = 1263374227027LLU;
t32 = ((x153<=x154)+(x155+x156));
if (t32 != 18446744071562067967LLU) { NG(); } else { ; }
}
void f33(void) {
static volatile int8_t x161 = INT8_MAX;
uint64_t x162 = 33485311LLU;
volatile int8_t x164 = INT8_MAX;
int32_t t33 = 9737;
t33 = ((x161<=x162)+(x163+x164));
if (t33 != 32895) { NG(); } else { ; }
}
void f34(void) {
int8_t x165 = 2;
uint16_t x167 = 1U;
static int64_t x168 = INT64_MIN;
int64_t t34 = -10920956LL;
t34 = ((x165<=x166)+(x167+x168));
if (t34 != -9223372036854775806LL) { NG(); } else { ; }
}
void f35(void) {
uint8_t x169 = 1U;
uint64_t x170 = UINT64_MAX;
static uint16_t x172 = 3U;
t35 = ((x169<=x170)+(x171+x172));
if (t35 != -32764) { NG(); } else { ; }
}
void f36(void) {
volatile int64_t x173 = INT64_MIN;
static int16_t x174 = INT16_MIN;
uint32_t x175 = UINT32_MAX;
int64_t x176 = INT64_MIN;
t36 = ((x173<=x174)+(x175+x176));
if (t36 != -9223372032559808512LL) { NG(); } else { ; }
}
void f37(void) {
static uint32_t x177 = UINT32_MAX;
int64_t x178 = INT64_MIN;
int8_t x179 = INT8_MAX;
int8_t x180 = INT8_MAX;
int32_t t37 = 1;
t37 = ((x177<=x178)+(x179+x180));
if (t37 != 254) { NG(); } else { ; }
}
void f38(void) {
static uint8_t x181 = 99U;
volatile uint8_t x182 = 1U;
static uint32_t x183 = UINT32_MAX;
int16_t x184 = -1;
static volatile uint32_t t38 = 243U;
t38 = ((x181<=x182)+(x183+x184));
if (t38 != 4294967294U) { NG(); } else { ; }
}
void f39(void) {
static volatile int8_t x201 = INT8_MIN;
int8_t x203 = -2;
volatile int32_t t39 = -40778564;
t39 = ((x201<=x202)+(x203+x204));
if (t39 != 125) { NG(); } else { ; }
}
void f40(void) {
uint64_t x205 = 14685005LLU;
static volatile uint64_t x206 = 8433109109947914LLU;
int64_t x207 = -4136719457825732LL;
int8_t x208 = INT8_MAX;
t40 = ((x205<=x206)+(x207+x208));
if (t40 != -4136719457825604LL) { NG(); } else { ; }
}
void f41(void) {
int16_t x209 = INT16_MAX;
static int32_t x210 = -1;
uint32_t x211 = 91622U;
static volatile uint32_t t41 = 44U;
t41 = ((x209<=x210)+(x211+x212));
if (t41 != 157157U) { NG(); } else { ; }
}
void f42(void) {
uint64_t x213 = 22303LLU;
int16_t x214 = INT16_MAX;
uint16_t x215 = UINT16_MAX;
uint8_t x216 = 1U;
t42 = ((x213<=x214)+(x215+x216));
if (t42 != 65537) { NG(); } else { ; }
}
void f43(void) {
uint64_t x217 = 968406602LLU;
uint16_t x218 = 2825U;
volatile int16_t x219 = -132;
t43 = ((x217<=x218)+(x219+x220));
if (t43 != 65403) { NG(); } else { ; }
}
void f44(void) {
int32_t x221 = INT32_MIN;
static uint16_t x222 = 352U;
uint8_t x223 = 89U;
uint8_t x224 = 1U;
int32_t t44 = 62134731;
t44 = ((x221<=x222)+(x223+x224));
if (t44 != 91) { NG(); } else { ; }
}
void f45(void) {
static int64_t x229 = INT64_MIN;
volatile uint64_t x230 = UINT64_MAX;
int8_t x231 = INT8_MAX;
int32_t t45 = -100;
t45 = ((x229<=x230)+(x231+x232));
if (t45 != 0) { NG(); } else { ; }
}
void f46(void) {
volatile int8_t x233 = 38;
volatile uint8_t x234 = 119U;
static int32_t x235 = INT32_MIN;
volatile uint64_t x236 = 343045641043301840LLU;
volatile uint64_t t46 = 89158207252LLU;
t46 = ((x233<=x234)+(x235+x236));
if (t46 != 343045638895818193LLU) { NG(); } else { ; }
}
void f47(void) {
volatile uint8_t x237 = 0U;
volatile int64_t x238 = INT64_MAX;
int8_t x239 = INT8_MAX;
int32_t x240 = 28106395;
t47 = ((x237<=x238)+(x239+x240));
if (t47 != 28106523) { NG(); } else { ; }
}
void f48(void) {
static int8_t x241 = -1;
static int32_t x242 = INT32_MIN;
volatile uint32_t x243 = 181U;
static int8_t x244 = -1;
uint32_t t48 = 43524U;
t48 = ((x241<=x242)+(x243+x244));
if (t48 != 180U) { NG(); } else { ; }
}
void f49(void) {
int64_t x245 = INT64_MAX;
uint8_t x246 = 1U;
uint8_t x247 = 10U;
int16_t x248 = INT16_MIN;
volatile int32_t t49 = -314;
t49 = ((x245<=x246)+(x247+x248));
if (t49 != -32758) { NG(); } else { ; }
}
void f50(void) {
static uint32_t x249 = 221037U;
static uint8_t x251 = 108U;
int32_t x252 = 84275;
t50 = ((x249<=x250)+(x251+x252));
if (t50 != 84384) { NG(); } else { ; }
}
void f51(void) {
volatile int8_t x253 = -2;
int32_t x254 = -41;
volatile uint64_t x255 = 8214024016826LLU;
int8_t x256 = -1;
static volatile uint64_t t51 = 41LLU;
t51 = ((x253<=x254)+(x255+x256));
if (t51 != 8214024016825LLU) { NG(); } else { ; }
}
void f52(void) {
volatile uint64_t x257 = 1590289994335360306LLU;
static volatile int8_t x258 = -1;
static uint32_t x259 = 6601879U;
volatile uint16_t x260 = 51U;
t52 = ((x257<=x258)+(x259+x260));
if (t52 != 6601931U) { NG(); } else { ; }
}
void f53(void) {
int8_t x261 = INT8_MIN;
int64_t x262 = -1LL;
uint16_t x263 = 88U;
uint16_t x264 = UINT16_MAX;
int32_t t53 = -12867;
t53 = ((x261<=x262)+(x263+x264));
if (t53 != 65624) { NG(); } else { ; }
}
void f54(void) {
uint32_t x265 = UINT32_MAX;
static int64_t x266 = INT64_MIN;
uint32_t x267 = UINT32_MAX;
int16_t x268 = -1;
t54 = ((x265<=x266)+(x267+x268));
if (t54 != 4294967294U) { NG(); } else { ; }
}
void f55(void) {
uint16_t x269 = 0U;
int32_t x270 = INT32_MIN;
uint32_t x271 = UINT32_MAX;
int8_t x272 = 39;
uint32_t t55 = 5314U;
t55 = ((x269<=x270)+(x271+x272));
if (t55 != 38U) { NG(); } else { ; }
}
void f56(void) {
int64_t x273 = INT64_MAX;
volatile uint16_t x274 = UINT16_MAX;
int32_t x275 = INT32_MAX;
int32_t t56 = -42;
t56 = ((x273<=x274)+(x275+x276));
if (t56 != 2147483519) { NG(); } else { ; }
}
void f57(void) {
uint16_t x282 = UINT16_MAX;
volatile int16_t x283 = -1;
volatile int64_t x284 = -1LL;
int64_t t57 = -18046LL;
t57 = ((x281<=x282)+(x283+x284));
if (t57 != -1LL) { NG(); } else { ; }
}
void f58(void) {
int32_t x285 = -16047406;
uint16_t x288 = 428U;
static int32_t t58 = 1011;
t58 = ((x285<=x286)+(x287+x288));
if (t58 != 427) { NG(); } else { ; }
}
void f59(void) {
volatile int8_t x289 = -2;
int16_t x291 = INT16_MIN;
uint64_t x292 = 8219280086467272LLU;
uint64_t t59 = 65945LLU;
t59 = ((x289<=x290)+(x291+x292));
if (t59 != 8219280086434504LLU) { NG(); } else { ; }
}
void f60(void) {
int64_t x293 = -3239LL;
volatile uint16_t x294 = UINT16_MAX;
uint64_t x296 = 8016188138135256LLU;
uint64_t t60 = 550753677670730050LLU;
t60 = ((x293<=x294)+(x295+x296));
if (t60 != 8016188138135256LLU) { NG(); } else { ; }
}
void f61(void) {
int16_t x297 = INT16_MIN;
volatile uint32_t x298 = 1797824617U;
int8_t x299 = INT8_MIN;
uint16_t x300 = UINT16_MAX;
t61 = ((x297<=x298)+(x299+x300));
if (t61 != 65407) { NG(); } else { ; }
}
void f62(void) {
static int64_t x301 = INT64_MIN;
static volatile uint8_t x303 = 1U;
volatile int32_t t62 = 246356914;
t62 = ((x301<=x302)+(x303+x304));
if (t62 != 1) { NG(); } else { ; }
}
void f63(void) {
int8_t x305 = -19;
volatile int64_t x307 = -1LL;
int64_t t63 = 707467519LL;
t63 = ((x305<=x306)+(x307+x308));
if (t63 != 65534LL) { NG(); } else { ; }
}
void f64(void) {
uint8_t x318 = UINT8_MAX;
int16_t x319 = -1;
volatile uint64_t t64 = 0LLU;
t64 = ((x317<=x318)+(x319+x320));
if (t64 != 2089713912388672349LLU) { NG(); } else { ; }
}
void f65(void) {
int32_t x321 = -26902684;
volatile uint8_t x323 = 0U;
int32_t t65 = 1232118;
t65 = ((x321<=x322)+(x323+x324));
if (t65 != -32767) { NG(); } else { ; }
}
void f66(void) {
static int64_t x329 = INT64_MIN;
int64_t x330 = -1LL;
volatile int16_t x331 = INT16_MIN;
volatile int8_t x332 = INT8_MIN;
volatile int32_t t66 = 3505;
t66 = ((x329<=x330)+(x331+x332));
if (t66 != -32895) { NG(); } else { ; }
}
void f67(void) {
uint64_t x333 = UINT64_MAX;
int64_t x334 = -6313626595700LL;
int8_t x335 = -1;
int16_t x336 = -1;
volatile int32_t t67 = -415591503;
t67 = ((x333<=x334)+(x335+x336));
if (t67 != -2) { NG(); } else { ; }
}
void f68(void) {
int64_t x337 = INT64_MIN;
int64_t x338 = -1LL;
int16_t x340 = 10414;
t68 = ((x337<=x338)+(x339+x340));
if (t68 != -229869554) { NG(); } else { ; }
}
void f69(void) {
volatile uint32_t x341 = 1484339U;
int16_t x343 = -1;
static int8_t x344 = INT8_MAX;
t69 = ((x341<=x342)+(x343+x344));
if (t69 != 127) { NG(); } else { ; }
}
void f70(void) {
int64_t x345 = -1LL;
int8_t x346 = 1;
volatile int64_t x347 = INT64_MIN;
uint32_t x348 = 1U;
t70 = ((x345<=x346)+(x347+x348));
if (t70 != -9223372036854775806LL) { NG(); } else { ; }
}
void f71(void) {
int16_t x351 = 5;
static uint32_t x352 = 32401U;
static uint32_t t71 = 3677399U;
t71 = ((x349<=x350)+(x351+x352));
if (t71 != 32407U) { NG(); } else { ; }
}
void f72(void) {
int16_t x354 = -1;
uint8_t x355 = 3U;
static volatile int16_t x356 = -1;
volatile int32_t t72 = 535;
t72 = ((x353<=x354)+(x355+x356));
if (t72 != 2) { NG(); } else { ; }
}
void f73(void) {
int8_t x357 = -29;
int32_t x359 = INT32_MIN;
uint8_t x360 = 1U;
volatile int32_t t73 = 632090642;
t73 = ((x357<=x358)+(x359+x360));
if (t73 != -2147483646) { NG(); } else { ; }
}
void f74(void) {
int32_t x361 = INT32_MIN;
uint64_t x363 = 766823602984000884LLU;
int64_t x364 = -1657932876LL;
uint64_t t74 = 10043LLU;
t74 = ((x361<=x362)+(x363+x364));
if (t74 != 766823601326068009LLU) { NG(); } else { ; }
}
void f75(void) {
static uint8_t x365 = UINT8_MAX;
volatile int32_t x366 = -1;
int16_t x367 = INT16_MAX;
uint64_t x368 = 107047913149294LLU;
static volatile uint64_t t75 = 1420629LLU;
t75 = ((x365<=x366)+(x367+x368));
if (t75 != 107047913182061LLU) { NG(); } else { ; }
}
void f76(void) {
static volatile int64_t x369 = INT64_MIN;
int64_t x370 = -431260264969LL;
int16_t x371 = 1;
uint16_t x372 = 1U;
t76 = ((x369<=x370)+(x371+x372));
if (t76 != 3) { NG(); } else { ; }
}
void f77(void) {
int64_t x373 = -1LL;
volatile int32_t x376 = -181344151;
static volatile int32_t t77 = -7;
t77 = ((x373<=x374)+(x375+x376));
if (t77 != -174442682) { NG(); } else { ; }
}
void f78(void) {
int64_t x377 = INT64_MIN;
volatile int32_t x379 = INT32_MIN;
uint64_t x380 = UINT64_MAX;
volatile uint64_t t78 = 86285397LLU;
t78 = ((x377<=x378)+(x379+x380));
if (t78 != 18446744071562067968LLU) { NG(); } else { ; }
}
void f79(void) {
uint8_t x385 = 2U;
volatile int8_t x386 = INT8_MAX;
volatile int16_t x387 = -1;
t79 = ((x385<=x386)+(x387+x388));
if (t79 != 50650649202LLU) { NG(); } else { ; }
}
void f80(void) {
int8_t x389 = INT8_MAX;
volatile uint64_t x390 = UINT64_MAX;
int8_t x391 = 4;
volatile uint32_t t80 = 16341950U;
t80 = ((x389<=x390)+(x391+x392));
if (t80 != 381810U) { NG(); } else { ; }
}
void f81(void) {
uint64_t x393 = UINT64_MAX;
volatile uint16_t x394 = 560U;
int16_t x395 = -7;
static uint32_t x396 = 899U;
uint32_t t81 = 3225027U;
t81 = ((x393<=x394)+(x395+x396));
if (t81 != 892U) { NG(); } else { ; }
}
void f82(void) {
static volatile uint8_t x398 = UINT8_MAX;
uint32_t x399 = 33324996U;
volatile int16_t x400 = INT16_MAX;
uint32_t t82 = 15U;
t82 = ((x397<=x398)+(x399+x400));
if (t82 != 33357763U) { NG(); } else { ; }
}
void f83(void) {
static int8_t x401 = -2;
int32_t x402 = 31;
uint64_t x403 = 45185LLU;
int16_t x404 = -1;
volatile uint64_t t83 = 1789030495153934LLU;
t83 = ((x401<=x402)+(x403+x404));
if (t83 != 45185LLU) { NG(); } else { ; }
}
void f84(void) {
uint64_t x405 = 16226348LLU;
uint64_t x406 = UINT64_MAX;
volatile uint32_t x407 = 31894U;
uint32_t t84 = 135068U;
t84 = ((x405<=x406)+(x407+x408));
if (t84 != 31894U) { NG(); } else { ; }
}
void f85(void) {
volatile uint16_t x413 = 1061U;
volatile int8_t x414 = INT8_MAX;
static int64_t x415 = INT64_MIN;
uint8_t x416 = UINT8_MAX;
int64_t t85 = 109LL;
t85 = ((x413<=x414)+(x415+x416));
if (t85 != -9223372036854775553LL) { NG(); } else { ; }
}
void f86(void) {
volatile int64_t x417 = 10158404050720LL;
int64_t x418 = -1LL;
uint8_t x419 = 59U;
volatile int32_t t86 = -418950;
t86 = ((x417<=x418)+(x419+x420));
if (t86 != 7603) { NG(); } else { ; }
}
void f87(void) {
uint64_t x422 = 72982LLU;
int8_t x423 = -1;
int64_t x424 = -1LL;
int64_t t87 = -89LL;
t87 = ((x421<=x422)+(x423+x424));
if (t87 != -2LL) { NG(); } else { ; }
}
void f88(void) {
volatile uint16_t x425 = UINT16_MAX;
static uint64_t x426 = 124964831459471737LLU;
int8_t x427 = 23;
static int32_t t88 = 93;
t88 = ((x425<=x426)+(x427+x428));
if (t88 != 279) { NG(); } else { ; }
}
void f89(void) {
int32_t x429 = INT32_MIN;
volatile uint16_t x430 = 2557U;
static int32_t x431 = -1;
static uint32_t x432 = 59U;
static volatile uint32_t t89 = 1U;
t89 = ((x429<=x430)+(x431+x432));
if (t89 != 59U) { NG(); } else { ; }
}
void f90(void) {
static uint8_t x437 = 1U;
static int64_t t90 = 1539125LL;
t90 = ((x437<=x438)+(x439+x440));
if (t90 != -32769LL) { NG(); } else { ; }
}
void f91(void) {
static volatile int16_t x441 = 85;
int8_t x442 = INT8_MIN;
static int64_t x443 = 896LL;
int32_t x444 = -2075;
volatile int64_t t91 = 221046088198824793LL;
t91 = ((x441<=x442)+(x443+x444));
if (t91 != -1179LL) { NG(); } else { ; }
}
void f92(void) {
static volatile int16_t x453 = -1;
int64_t x454 = INT64_MIN;
static int16_t x455 = INT16_MAX;
int16_t x456 = -1;
t92 = ((x453<=x454)+(x455+x456));
if (t92 != 32766) { NG(); } else { ; }
}
void f93(void) {
uint8_t x459 = UINT8_MAX;
uint64_t x460 = 65340006LLU;
uint64_t t93 = 68190LLU;
t93 = ((x457<=x458)+(x459+x460));
if (t93 != 65340261LLU) { NG(); } else { ; }
}
void f94(void) {
static int64_t x461 = -2078255882001LL;
volatile int16_t x462 = -10;
uint64_t x463 = UINT64_MAX;
uint64_t t94 = 73LLU;
t94 = ((x461<=x462)+(x463+x464));
if (t94 != 18446744073709551488LLU) { NG(); } else { ; }
}
void f95(void) {
static int8_t x468 = INT8_MIN;
volatile int32_t t95 = 239;
t95 = ((x465<=x466)+(x467+x468));
if (t95 != -128) { NG(); } else { ; }
}
void f96(void) {
uint8_t x469 = 11U;
int8_t x470 = -1;
int32_t x471 = 652375012;
volatile uint8_t x472 = 0U;
static int32_t t96 = -3572547;
t96 = ((x469<=x470)+(x471+x472));
if (t96 != 652375012) { NG(); } else { ; }
}
void f97(void) {
volatile int16_t x473 = 233;
volatile uint32_t x474 = UINT32_MAX;
int16_t x475 = INT16_MAX;
uint16_t x476 = 2567U;
int32_t t97 = 340391142;
t97 = ((x473<=x474)+(x475+x476));
if (t97 != 35335) { NG(); } else { ; }
}
void f98(void) {
int32_t x481 = -1;
int64_t x482 = INT64_MIN;
uint64_t x483 = 1907064622676937970LLU;
static uint8_t x484 = 7U;
uint64_t t98 = 274096452270LLU;
t98 = ((x481<=x482)+(x483+x484));
if (t98 != 1907064622676937977LLU) { NG(); } else { ; }
}
void f99(void) {
static int32_t x486 = INT32_MIN;
int8_t x487 = INT8_MIN;
volatile int32_t t99 = 231996;
t99 = ((x485<=x486)+(x487+x488));
if (t99 != -129) { NG(); } else { ; }
}
void f100(void) {
static int8_t x490 = -44;
static volatile int32_t x492 = -476;
int32_t t100 = 254107290;
t100 = ((x489<=x490)+(x491+x492));
if (t100 != 14688) { NG(); } else { ; }
}
void f101(void) {
int64_t x493 = INT64_MIN;
int64_t x495 = INT64_MIN;
static int64_t t101 = 6792848LL;
t101 = ((x493<=x494)+(x495+x496));
if (t101 != -9223372036854775552LL) { NG(); } else { ; }
}
void f102(void) {
int8_t x498 = 14;
volatile uint16_t x499 = UINT16_MAX;
int64_t x500 = 64145LL;
int64_t t102 = 759707006235092781LL;
t102 = ((x497<=x498)+(x499+x500));
if (t102 != 129680LL) { NG(); } else { ; }
}
void f103(void) {
static int64_t x505 = INT64_MIN;
int64_t x506 = INT64_MIN;
int16_t x507 = INT16_MIN;
volatile uint8_t x508 = UINT8_MAX;
volatile int32_t t103 = -38073956;
t103 = ((x505<=x506)+(x507+x508));
if (t103 != -32512) { NG(); } else { ; }
}
void f104(void) {
int64_t x509 = INT64_MIN;
uint32_t x510 = 3U;
int64_t x511 = INT64_MAX;
volatile int8_t x512 = INT8_MIN;
volatile int64_t t104 = 81590911043LL;
t104 = ((x509<=x510)+(x511+x512));
if (t104 != 9223372036854775680LL) { NG(); } else { ; }
}
void f105(void) {
volatile int32_t x514 = 37560;
int32_t x515 = -1;
uint8_t x516 = 31U;
t105 = ((x513<=x514)+(x515+x516));
if (t105 != 31) { NG(); } else { ; }
}
void f106(void) {
int16_t x517 = INT16_MAX;
volatile int8_t x518 = 1;
static int32_t x519 = -1;
int32_t t106 = 3680;
t106 = ((x517<=x518)+(x519+x520));
if (t106 != -32769) { NG(); } else { ; }
}
void f107(void) {
static int8_t x521 = -46;
int16_t x522 = -242;
int8_t x523 = INT8_MIN;
uint8_t x524 = 15U;
int32_t t107 = -9196399;
t107 = ((x521<=x522)+(x523+x524));
if (t107 != -113) { NG(); } else { ; }
}
void f108(void) {
volatile int8_t x525 = INT8_MIN;
int32_t x526 = INT32_MIN;
static volatile int64_t x527 = -160302447025108414LL;
int16_t x528 = INT16_MIN;
volatile int64_t t108 = 0LL;
t108 = ((x525<=x526)+(x527+x528));
if (t108 != -160302447025141182LL) { NG(); } else { ; }
}
void f109(void) {
volatile int16_t x529 = INT16_MAX;
static uint16_t x530 = 141U;
int32_t x531 = INT32_MIN;
uint16_t x532 = UINT16_MAX;
t109 = ((x529<=x530)+(x531+x532));
if (t109 != -2147418113) { NG(); } else { ; }
}
void f110(void) {
volatile uint32_t x533 = 512528U;
uint64_t x534 = 46LLU;
uint64_t x535 = 5LLU;
int32_t x536 = INT32_MIN;
volatile uint64_t t110 = 1LLU;
t110 = ((x533<=x534)+(x535+x536));
if (t110 != 18446744071562067973LLU) { NG(); } else { ; }
}
void f111(void) {
uint16_t x537 = 788U;
uint8_t x539 = UINT8_MAX;
uint32_t x540 = 1761U;
static uint32_t t111 = 10U;
t111 = ((x537<=x538)+(x539+x540));
if (t111 != 2016U) { NG(); } else { ; }
}
void f112(void) {
volatile int16_t x541 = 957;
int8_t x542 = INT8_MAX;
uint64_t x543 = UINT64_MAX;
volatile int8_t x544 = INT8_MIN;
volatile uint64_t t112 = 629366895324763144LLU;
t112 = ((x541<=x542)+(x543+x544));
if (t112 != 18446744073709551487LLU) { NG(); } else { ; }
}
void f113(void) {
static volatile uint64_t x545 = 1308257717817907869LLU;
volatile int8_t x546 = 6;
int16_t x547 = INT16_MIN;
static uint16_t x548 = 337U;
volatile int32_t t113 = -49781;
t113 = ((x545<=x546)+(x547+x548));
if (t113 != -32431) { NG(); } else { ; }
}
void f114(void) {
volatile int8_t x549 = INT8_MIN;
static volatile int64_t x551 = 218722474969117238LL;
uint8_t x552 = UINT8_MAX;
int64_t t114 = -37264721408LL;
t114 = ((x549<=x550)+(x551+x552));
if (t114 != 218722474969117494LL) { NG(); } else { ; }
}
void f115(void) {
static volatile uint16_t x553 = UINT16_MAX;
int64_t x554 = INT64_MIN;
int8_t x556 = -1;
t115 = ((x553<=x554)+(x555+x556));
if (t115 != 4294967294U) { NG(); } else { ; }
}
void f116(void) {
volatile uint64_t x557 = 23788LLU;
int16_t x558 = 13204;
int16_t x559 = INT16_MIN;
int32_t x560 = INT32_MAX;
static int32_t t116 = 171436;
t116 = ((x557<=x558)+(x559+x560));
if (t116 != 2147450879) { NG(); } else { ; }
}
void f117(void) {
static int64_t x561 = -11968037902767661LL;
int64_t x562 = 1LL;
int32_t x564 = INT32_MAX;
static volatile int64_t t117 = 30LL;
t117 = ((x561<=x562)+(x563+x564));
if (t117 != -9223372034707292160LL) { NG(); } else { ; }
}
void f118(void) {
int32_t x565 = -6843876;
static int8_t x566 = INT8_MAX;
uint32_t x568 = 12990073U;
volatile uint32_t t118 = 628790U;
t118 = ((x565<=x566)+(x567+x568));
if (t118 != 2160473722U) { NG(); } else { ; }
}
void f119(void) {
uint64_t x569 = 85251495478LLU;
uint64_t x570 = UINT64_MAX;
int32_t x571 = 110;
int32_t x572 = INT32_MIN;
int32_t t119 = 13;
t119 = ((x569<=x570)+(x571+x572));
if (t119 != -2147483537) { NG(); } else { ; }
}
void f120(void) {
uint32_t x573 = 22U;
int16_t x574 = INT16_MIN;
uint64_t x575 = UINT64_MAX;
int8_t x576 = INT8_MAX;
uint64_t t120 = 136945965168852514LLU;
t120 = ((x573<=x574)+(x575+x576));
if (t120 != 127LLU) { NG(); } else { ; }
}
void f121(void) {
int8_t x577 = INT8_MAX;
int32_t x578 = -1;
uint32_t x579 = 2010U;
static int16_t x580 = 0;
uint32_t t121 = 25046U;
t121 = ((x577<=x578)+(x579+x580));
if (t121 != 2010U) { NG(); } else { ; }
}
void f122(void) {
int64_t x582 = -1LL;
volatile int8_t x583 = 61;
int16_t x584 = -663;
int32_t t122 = 2545;
t122 = ((x581<=x582)+(x583+x584));
if (t122 != -601) { NG(); } else { ; }
}
void f123(void) {
uint16_t x585 = 1U;
uint64_t x586 = 3753550LLU;
volatile int32_t t123 = -414;
t123 = ((x585<=x586)+(x587+x588));
if (t123 != 131071) { NG(); } else { ; }
}
void f124(void) {
static int32_t x589 = INT32_MIN;
uint8_t x590 = UINT8_MAX;
int32_t x591 = -6067;
volatile int8_t x592 = INT8_MAX;
t124 = ((x589<=x590)+(x591+x592));
if (t124 != -5939) { NG(); } else { ; }
}
void f125(void) {
int16_t x593 = INT16_MIN;
volatile uint16_t x594 = UINT16_MAX;
int16_t x595 = -1;
int32_t t125 = 86333;
t125 = ((x593<=x594)+(x595+x596));
if (t125 != 114) { NG(); } else { ; }
}
void f126(void) {
uint32_t x597 = 27147U;
volatile uint32_t x599 = 3453197U;
uint32_t x600 = UINT32_MAX;
uint32_t t126 = 7643U;
t126 = ((x597<=x598)+(x599+x600));
if (t126 != 3453197U) { NG(); } else { ; }
}
void f127(void) {
static int8_t x601 = 33;
uint16_t x603 = 2U;
int8_t x604 = INT8_MIN;
volatile int32_t t127 = -545294;
t127 = ((x601<=x602)+(x603+x604));
if (t127 != -126) { NG(); } else { ; }
}
void f128(void) {
int8_t x605 = -54;
uint64_t x608 = UINT64_MAX;
volatile uint64_t t128 = 8532027223LLU;
t128 = ((x605<=x606)+(x607+x608));
if (t128 != 254LLU) { NG(); } else { ; }
}
void f129(void) {
int16_t x613 = -23;
int64_t x614 = INT64_MAX;
int16_t x615 = INT16_MIN;
uint16_t x616 = UINT16_MAX;
volatile int32_t t129 = -937;
t129 = ((x613<=x614)+(x615+x616));
if (t129 != 32768) { NG(); } else { ; }
}
void f130(void) {
int64_t x617 = 96936LL;
int8_t x618 = -3;
uint16_t x619 = 23U;
static int32_t x620 = -1;
t130 = ((x617<=x618)+(x619+x620));
if (t130 != 22) { NG(); } else { ; }
}
void f131(void) {
static volatile int32_t x621 = -43712;
uint64_t x622 = 90LLU;
int32_t x623 = -1;
uint32_t x624 = 722U;
uint32_t t131 = 179346957U;
t131 = ((x621<=x622)+(x623+x624));
if (t131 != 721U) { NG(); } else { ; }
}
void f132(void) {
static int32_t x625 = -1;
int64_t x626 = INT64_MAX;
uint8_t x627 = 3U;
static volatile int32_t t132 = 3214;
t132 = ((x625<=x626)+(x627+x628));
if (t132 != 19) { NG(); } else { ; }
}
void f133(void) {
int16_t x633 = INT16_MAX;
volatile int8_t x634 = 0;
volatile int32_t x635 = -772500;
static int32_t t133 = 785991;
t133 = ((x633<=x634)+(x635+x636));
if (t133 != -739733) { NG(); } else { ; }
}
void f134(void) {
t134 = ((x637<=x638)+(x639+x640));
if (t134 != 21049506LLU) { NG(); } else { ; }
}
void f135(void) {
static uint16_t x641 = UINT16_MAX;
uint32_t x642 = UINT32_MAX;
uint16_t x643 = 28U;
volatile int32_t t135 = 45399082;
t135 = ((x641<=x642)+(x643+x644));
if (t135 != 156) { NG(); } else { ; }
}
void f136(void) {
uint32_t x645 = 200U;
int32_t x646 = 905;
int64_t x647 = -44320LL;
static int64_t t136 = 49524682254LL;
t136 = ((x645<=x646)+(x647+x648));
if (t136 != -44306LL) { NG(); } else { ; }
}
void f137(void) {
static volatile int16_t x649 = INT16_MAX;
int8_t x650 = INT8_MIN;
int64_t x651 = -1LL;
volatile int64_t t137 = -1002683LL;
t137 = ((x649<=x650)+(x651+x652));
if (t137 != 65534LL) { NG(); } else { ; }
}
void f138(void) {
static int16_t x654 = 14;
int64_t x655 = INT64_MIN;
volatile int64_t t138 = -78481LL;
t138 = ((x653<=x654)+(x655+x656));
if (t138 != -9223372034707292160LL) { NG(); } else { ; }
}
void f139(void) {
static int8_t x657 = -1;
static int8_t x658 = -6;
int16_t x659 = INT16_MIN;
int8_t x660 = -6;
t139 = ((x657<=x658)+(x659+x660));
if (t139 != -32774) { NG(); } else { ; }
}
void f140(void) {
int64_t x661 = -267443LL;
static int8_t x662 = -1;
int16_t x663 = -1711;
int64_t x664 = -1LL;
int64_t t140 = 5764679LL;
t140 = ((x661<=x662)+(x663+x664));
if (t140 != -1711LL) { NG(); } else { ; }
}
void f141(void) {
int32_t x669 = INT32_MIN;
static uint16_t x670 = 18225U;
int32_t x671 = INT32_MAX;
int32_t x672 = -1;
t141 = ((x669<=x670)+(x671+x672));
if (t141 != INT32_MAX) { NG(); } else { ; }
}
void f142(void) {
uint32_t x674 = 50U;
int16_t x675 = INT16_MAX;
uint8_t x676 = 0U;
t142 = ((x673<=x674)+(x675+x676));
if (t142 != 32767) { NG(); } else { ; }
}
void f143(void) {
int16_t x678 = INT16_MAX;
int8_t x679 = INT8_MAX;
int64_t x680 = -22503128977757LL;
volatile int64_t t143 = -5235LL;
t143 = ((x677<=x678)+(x679+x680));
if (t143 != -22503128977629LL) { NG(); } else { ; }
}
void f144(void) {
int16_t x681 = INT16_MAX;
static uint8_t x682 = 1U;
int32_t x683 = INT32_MAX;
volatile int32_t t144 = 7678416;
t144 = ((x681<=x682)+(x683+x684));
if (t144 != 2147483646) { NG(); } else { ; }
}
void f145(void) {
int64_t x685 = -3119302LL;
static uint64_t x686 = UINT64_MAX;
static volatile uint8_t x687 = UINT8_MAX;
static volatile uint8_t x688 = UINT8_MAX;
int32_t t145 = 439649195;
t145 = ((x685<=x686)+(x687+x688));
if (t145 != 511) { NG(); } else { ; }
}
void f146(void) {
int16_t x689 = INT16_MAX;
static int64_t x690 = -957013679706303LL;
uint16_t x691 = 3066U;
volatile uint64_t x692 = UINT64_MAX;
uint64_t t146 = 7710LLU;
t146 = ((x689<=x690)+(x691+x692));
if (t146 != 3065LLU) { NG(); } else { ; }
}
void f147(void) {
volatile uint32_t x693 = UINT32_MAX;
static int16_t x694 = INT16_MAX;
int8_t x695 = INT8_MIN;
int8_t x696 = 44;
t147 = ((x693<=x694)+(x695+x696));
if (t147 != -84) { NG(); } else { ; }
}
void f148(void) {
int64_t x698 = INT64_MIN;
int32_t x699 = -17306463;
static uint32_t t148 = 1447522U;
t148 = ((x697<=x698)+(x699+x700));
if (t148 != 4277661517U) { NG(); } else { ; }
}
void f149(void) {
int16_t x707 = INT16_MIN;
int16_t x708 = -196;
volatile int32_t t149 = -1;
t149 = ((x705<=x706)+(x707+x708));
if (t149 != -32963) { NG(); } else { ; }
}
void f150(void) {
int8_t x709 = INT8_MIN;
static int64_t x710 = -1LL;
static uint64_t x711 = 263598LLU;
volatile int64_t x712 = -319LL;
uint64_t t150 = 1574980787934600LLU;
t150 = ((x709<=x710)+(x711+x712));
if (t150 != 263280LLU) { NG(); } else { ; }
}
void f151(void) {
volatile uint16_t x713 = UINT16_MAX;
int64_t x714 = INT64_MAX;
int64_t x715 = -25523172730058LL;
int8_t x716 = -1;
t151 = ((x713<=x714)+(x715+x716));
if (t151 != -25523172730058LL) { NG(); } else { ; }
}
void f152(void) {
int8_t x718 = INT8_MIN;
int16_t x719 = -1;
volatile uint64_t t152 = 883191367036581443LLU;
t152 = ((x717<=x718)+(x719+x720));
if (t152 != 311675LLU) { NG(); } else { ; }
}
void f153(void) {
static uint32_t x725 = 364U;
int16_t x726 = INT16_MIN;
int32_t x727 = -743;
int16_t x728 = -1;
volatile int32_t t153 = -11848;
t153 = ((x725<=x726)+(x727+x728));
if (t153 != -743) { NG(); } else { ; }
}
void f154(void) {
int16_t x730 = INT16_MIN;
uint16_t x731 = 1325U;
int64_t x732 = INT64_MIN;
t154 = ((x729<=x730)+(x731+x732));
if (t154 != -9223372036854774483LL) { NG(); } else { ; }
}
void f155(void) {
int16_t x733 = -1;
static int8_t x734 = 1;
volatile int64_t x735 = INT64_MIN;
uint8_t x736 = UINT8_MAX;
int64_t t155 = -1173047050793LL;
t155 = ((x733<=x734)+(x735+x736));
if (t155 != -9223372036854775552LL) { NG(); } else { ; }
}
void f156(void) {
static int64_t x737 = -68700357LL;
volatile int8_t x738 = -1;
static volatile uint64_t x739 = 6135374853LLU;
int32_t x740 = -50581578;
static volatile uint64_t t156 = 837449246374LLU;
t156 = ((x737<=x738)+(x739+x740));
if (t156 != 6084793276LLU) { NG(); } else { ; }
}
void f157(void) {
int8_t x741 = 0;
static volatile uint64_t x742 = UINT64_MAX;
int8_t x743 = 5;
static int8_t x744 = -1;
t157 = ((x741<=x742)+(x743+x744));
if (t157 != 5) { NG(); } else { ; }
}
void f158(void) {
static int8_t x745 = -1;
volatile int16_t x746 = INT16_MIN;
static uint16_t x747 = UINT16_MAX;
static int32_t x748 = INT32_MIN;
int32_t t158 = -1255378;
t158 = ((x745<=x746)+(x747+x748));
if (t158 != -2147418113) { NG(); } else { ; }
}
void f159(void) {
uint64_t x749 = 34563523477976959LLU;
volatile int8_t x750 = -15;
int8_t x751 = -1;
uint16_t x752 = 643U;
int32_t t159 = -51;
t159 = ((x749<=x750)+(x751+x752));
if (t159 != 643) { NG(); } else { ; }
}
void f160(void) {
int64_t x757 = -1LL;
int64_t x758 = -1LL;
volatile uint64_t x759 = UINT64_MAX;
uint32_t x760 = UINT32_MAX;
volatile uint64_t t160 = 187508834204537357LLU;
t160 = ((x757<=x758)+(x759+x760));
if (t160 != 4294967295LLU) { NG(); } else { ; }
}
void f161(void) {
volatile uint64_t x761 = UINT64_MAX;
uint32_t x763 = 116224U;
volatile int16_t x764 = INT16_MIN;
t161 = ((x761<=x762)+(x763+x764));
if (t161 != 83456U) { NG(); } else { ; }
}
void f162(void) {
volatile int32_t x765 = -1;
static volatile uint64_t x766 = UINT64_MAX;
int16_t x767 = -1;
uint64_t x768 = 0LLU;
volatile uint64_t t162 = 8680490172LLU;
t162 = ((x765<=x766)+(x767+x768));
if (t162 != 0LLU) { NG(); } else { ; }
}
void f163(void) {
volatile uint32_t x773 = UINT32_MAX;
int16_t x774 = INT16_MIN;
static uint32_t x775 = UINT32_MAX;
static uint16_t x776 = UINT16_MAX;
uint32_t t163 = 3614U;
t163 = ((x773<=x774)+(x775+x776));
if (t163 != 65534U) { NG(); } else { ; }
}
void f164(void) {
int8_t x781 = -1;
int64_t x782 = INT64_MIN;
static uint32_t x784 = 273468U;
uint32_t t164 = 1U;
t164 = ((x781<=x782)+(x783+x784));
if (t164 != 240700U) { NG(); } else { ; }
}
void f165(void) {
static volatile int8_t x785 = -1;
static int16_t x786 = 8054;
uint64_t x787 = 2051432123955LLU;
t165 = ((x785<=x786)+(x787+x788));
if (t165 != 2051432123955LLU) { NG(); } else { ; }
}
void f166(void) {
volatile uint8_t x793 = 35U;
static int32_t x794 = INT32_MIN;
volatile int64_t x795 = -1LL;
uint16_t x796 = 798U;
t166 = ((x793<=x794)+(x795+x796));
if (t166 != 797LL) { NG(); } else { ; }
}
void f167(void) {
int64_t x797 = INT64_MIN;
volatile int16_t x799 = -1;
int32_t t167 = 90;
t167 = ((x797<=x798)+(x799+x800));
if (t167 != -31672) { NG(); } else { ; }
}
void f168(void) {
static volatile int64_t x801 = INT64_MAX;
uint16_t x802 = 1041U;
uint64_t x803 = 1363269LLU;
uint8_t x804 = 1U;
static volatile uint64_t t168 = 37751065878198441LLU;
t168 = ((x801<=x802)+(x803+x804));
if (t168 != 1363270LLU) { NG(); } else { ; }
}
void f169(void) {
int32_t x805 = -45877780;
int32_t x806 = INT32_MIN;
static int64_t x808 = INT64_MIN;
int64_t t169 = -16663809LL;
t169 = ((x805<=x806)+(x807+x808));
if (t169 != -9223372036854533569LL) { NG(); } else { ; }
}
void f170(void) {
int16_t x810 = INT16_MAX;
uint8_t x811 = UINT8_MAX;
int16_t x812 = -1;
t170 = ((x809<=x810)+(x811+x812));
if (t170 != 255) { NG(); } else { ; }
}
void f171(void) {
int8_t x813 = -1;
volatile int64_t x814 = INT64_MAX;
int8_t x815 = INT8_MAX;
static int8_t x816 = -1;
volatile int32_t t171 = 1072541552;
t171 = ((x813<=x814)+(x815+x816));
if (t171 != 127) { NG(); } else { ; }
}
void f172(void) {
static uint8_t x817 = 63U;
int8_t x818 = -9;
volatile uint64_t x819 = UINT64_MAX;
uint16_t x820 = 11U;
uint64_t t172 = 123566LLU;
t172 = ((x817<=x818)+(x819+x820));
if (t172 != 10LLU) { NG(); } else { ; }
}
void f173(void) {
int8_t x821 = INT8_MIN;
int8_t x822 = 31;
static int16_t x824 = 336;
int64_t t173 = 385933711217LL;
t173 = ((x821<=x822)+(x823+x824));
if (t173 != 278LL) { NG(); } else { ; }
}
void f174(void) {
int64_t x825 = INT64_MIN;
uint16_t x826 = UINT16_MAX;
static volatile uint64_t x827 = 12038695255LLU;
int16_t x828 = INT16_MAX;
volatile uint64_t t174 = 2140224480199543213LLU;
t174 = ((x825<=x826)+(x827+x828));
if (t174 != 12038728023LLU) { NG(); } else { ; }
}
void f175(void) {
int16_t x830 = -1;
volatile uint64_t t175 = 3024558LLU;
t175 = ((x829<=x830)+(x831+x832));
if (t175 != 804765LLU) { NG(); } else { ; }
}
void f176(void) {
int16_t x833 = INT16_MIN;
uint16_t x834 = 55U;
volatile int64_t x835 = -1LL;
volatile uint32_t x836 = UINT32_MAX;
static int64_t t176 = 4416LL;
t176 = ((x833<=x834)+(x835+x836));
if (t176 != 4294967295LL) { NG(); } else { ; }
}
void f177(void) {
int8_t x837 = -19;
uint16_t x838 = 20905U;
uint32_t x839 = 64849U;
volatile int8_t x840 = INT8_MIN;
volatile uint32_t t177 = 6847U;
t177 = ((x837<=x838)+(x839+x840));
if (t177 != 64722U) { NG(); } else { ; }
}
void f178(void) {
volatile uint8_t x842 = UINT8_MAX;
uint32_t x843 = 1538144U;
uint32_t x844 = 73139U;
static uint32_t t178 = 23519U;
t178 = ((x841<=x842)+(x843+x844));
if (t178 != 1611284U) { NG(); } else { ; }
}
void f179(void) {
uint32_t x845 = UINT32_MAX;
uint64_t x846 = UINT64_MAX;
int16_t x848 = -4308;
t179 = ((x845<=x846)+(x847+x848));
if (t179 != -37075) { NG(); } else { ; }
}
void f180(void) {
int16_t x853 = INT16_MAX;
static int32_t x854 = -1;
volatile int64_t x855 = -1909152911LL;
int32_t x856 = 54119;
volatile int64_t t180 = -269177118852282262LL;
t180 = ((x853<=x854)+(x855+x856));
if (t180 != -1909098792LL) { NG(); } else { ; }
}
void f181(void) {
int16_t x858 = -12;
int64_t x859 = INT64_MAX;
static volatile int32_t x860 = -1;
static volatile int64_t t181 = 0LL;
t181 = ((x857<=x858)+(x859+x860));
if (t181 != 9223372036854775806LL) { NG(); } else { ; }
}
void f182(void) {
int64_t x867 = 714787210536442LL;
int32_t x868 = -1;
int64_t t182 = -110109099411LL;
t182 = ((x865<=x866)+(x867+x868));
if (t182 != 714787210536442LL) { NG(); } else { ; }
}
void f183(void) {
int64_t x870 = 6047587005699LL;
int32_t x871 = INT32_MAX;
int8_t x872 = INT8_MIN;
volatile int32_t t183 = -6203945;
t183 = ((x869<=x870)+(x871+x872));
if (t183 != 2147483520) { NG(); } else { ; }
}
void f184(void) {
static volatile int32_t x873 = -5247463;
static int64_t x874 = INT64_MAX;
uint8_t x875 = UINT8_MAX;
static uint8_t x876 = 0U;
static volatile int32_t t184 = -4287;
t184 = ((x873<=x874)+(x875+x876));
if (t184 != 256) { NG(); } else { ; }
}
void f185(void) {
uint8_t x878 = 42U;
uint8_t x879 = UINT8_MAX;
int32_t t185 = -24;
t185 = ((x877<=x878)+(x879+x880));
if (t185 != 257) { NG(); } else { ; }
}
void f186(void) {
static int32_t x881 = INT32_MAX;
int32_t x883 = 776296236;
static int32_t x884 = INT32_MIN;
volatile int32_t t186 = -2;
t186 = ((x881<=x882)+(x883+x884));
if (t186 != -1371187412) { NG(); } else { ; }
}
void f187(void) {
uint64_t x885 = 44661437087LLU;
uint32_t x886 = UINT32_MAX;
static uint32_t x888 = UINT32_MAX;
volatile int64_t t187 = 1333877500466LL;
t187 = ((x885<=x886)+(x887+x888));
if (t187 != 4294967294LL) { NG(); } else { ; }
}
void f188(void) {
int32_t x893 = INT32_MIN;
int8_t x894 = INT8_MIN;
volatile int32_t x895 = -1;
uint32_t x896 = 1030U;
static uint32_t t188 = 2411U;
t188 = ((x893<=x894)+(x895+x896));
if (t188 != 1030U) { NG(); } else { ; }
}
void f189(void) {
volatile int16_t x897 = INT16_MIN;
uint64_t x899 = 108600LLU;
t189 = ((x897<=x898)+(x899+x900));
if (t189 != 9223372036854884408LLU) { NG(); } else { ; }
}
void f190(void) {
int16_t x902 = INT16_MIN;
int64_t x903 = INT64_MIN;
uint8_t x904 = 24U;
volatile int64_t t190 = -1252812196LL;
t190 = ((x901<=x902)+(x903+x904));
if (t190 != -9223372036854775784LL) { NG(); } else { ; }
}
void f191(void) {
uint64_t x905 = UINT64_MAX;
uint16_t x907 = 2322U;
uint64_t x908 = 1614508813503142LLU;
volatile uint64_t t191 = 726LLU;
t191 = ((x905<=x906)+(x907+x908));
if (t191 != 1614508813505464LLU) { NG(); } else { ; }
}
void f192(void) {
uint16_t x909 = 4U;
int16_t x911 = INT16_MIN;
uint64_t x912 = 14948172LLU;
static uint64_t t192 = 11LLU;
t192 = ((x909<=x910)+(x911+x912));
if (t192 != 14915405LLU) { NG(); } else { ; }
}
void f193(void) {
static volatile int8_t x913 = INT8_MAX;
static int64_t x915 = 0LL;
volatile uint32_t x916 = 1221328U;
volatile int64_t t193 = 39593193077149LL;
t193 = ((x913<=x914)+(x915+x916));
if (t193 != 1221329LL) { NG(); } else { ; }
}
void f194(void) {
int64_t x918 = -1LL;
static uint64_t x920 = UINT64_MAX;
uint64_t t194 = 5609LLU;
t194 = ((x917<=x918)+(x919+x920));
if (t194 != 11LLU) { NG(); } else { ; }
}
void f195(void) {
static int32_t x921 = -101654665;
static uint16_t x922 = 24U;
uint8_t x923 = UINT8_MAX;
volatile uint64_t t195 = 40561881336LLU;
t195 = ((x921<=x922)+(x923+x924));
if (t195 != 257LLU) { NG(); } else { ; }
}
void f196(void) {
int8_t x930 = -1;
int64_t x931 = INT64_MIN;
uint8_t x932 = 36U;
int64_t t196 = 59561LL;
t196 = ((x929<=x930)+(x931+x932));
if (t196 != -9223372036854775771LL) { NG(); } else { ; }
}
void f197(void) {
static int64_t x935 = INT64_MIN;
uint64_t x936 = 3814119LLU;
volatile uint64_t t197 = 941469LLU;
t197 = ((x933<=x934)+(x935+x936));
if (t197 != 9223372036858589928LLU) { NG(); } else { ; }
}
void f198(void) {
int32_t x937 = 473596;
volatile uint32_t x938 = 2938U;
int64_t x939 = INT64_MIN;
t198 = ((x937<=x938)+(x939+x940));
if (t198 != 9223372036854775807LLU) { NG(); } else { ; }
}
void f199(void) {
uint8_t x941 = 105U;
static volatile int64_t x942 = -1LL;
uint64_t x943 = 12088LLU;
static uint64_t t199 = 8151329460642938LLU;
t199 = ((x941<=x942)+(x943+x944));
if (t199 != 12087LLU) { NG(); } else { ; }
}
int main(void) {
f0();
f1();
f2();
f3();
f4();
f5();
f6();
f7();
f8();
f9();
f10();
f11();
f12();
f13();
f14();
f15();
f16();
f17();
f18();
f19();
f20();
f21();
f22();
f23();
f24();
f25();
f26();
f27();
f28();
f29();
f30();
f31();
f32();
f33();
f34();
f35();
f36();
f37();
f38();
f39();
f40();
f41();
f42();
f43();
f44();
f45();
f46();
f47();
f48();
f49();
f50();
f51();
f52();
f53();
f54();
f55();
f56();
f57();
f58();
f59();
f60();
f61();
f62();
f63();
f64();
f65();
f66();
f67();
f68();
f69();
f70();
f71();
f72();
f73();
f74();
f75();
f76();
f77();
f78();
f79();
f80();
f81();
f82();
f83();
f84();
f85();
f86();
f87();
f88();
f89();
f90();
f91();
f92();
f93();
f94();
f95();
f96();
f97();
f98();
f99();
f100();
f101();
f102();
f103();
f104();
f105();
f106();
f107();
f108();
f109();
f110();
f111();
f112();
f113();
f114();
f115();
f116();
f117();
f118();
f119();
f120();
f121();
f122();
f123();
f124();
f125();
f126();
f127();
f128();
f129();
f130();
f131();
f132();
f133();
f134();
f135();
f136();
f137();
f138();
f139();
f140();
f141();
f142();
f143();
f144();
f145();
f146();
f147();
f148();
f149();
f150();
f151();
f152();
f153();
f154();
f155();
f156();
f157();
f158();
f159();
f160();
f161();
f162();
f163();
f164();
f165();
f166();
f167();
f168();
f169();
f170();
f171();
f172();
f173();
f174();
f175();
f176();
f177();
f178();
f179();
f180();
f181();
f182();
f183();
f184();
f185();
f186();
f187();
f188();
f189();
f190();
f191();
f192();
f193();
f194();
f195();
f196();
f197();
f198();
f199();
return 0;
}
| 19.162478 | 61 | 0.595947 |
1bbe57322e6b1589914c60e21151ec0b4a3b0224 | 63 | h | C | sun3_sub_word.h | nineties-retro/sun3 | 22672580429b54f05946774908d62b794e171e06 | [
"BSD-3-Clause"
] | 1 | 2019-06-13T18:17:04.000Z | 2019-06-13T18:17:04.000Z | sun3_sub_word.h | nineties-retro/sun3 | 22672580429b54f05946774908d62b794e171e06 | [
"BSD-3-Clause"
] | null | null | null | sun3_sub_word.h | nineties-retro/sun3 | 22672580429b54f05946774908d62b794e171e06 | [
"BSD-3-Clause"
] | 2 | 2020-04-03T09:23:27.000Z | 2022-03-21T18:56:44.000Z | void sun3_sub_reg_word(sun3 *);
void sun3_sub_ea_word(sun3 *);
| 21 | 31 | 0.777778 |
bc24ac32314032fdb3727ed2fd377588811da44d | 245 | h | C | Category/WPhoto/UIImage+fixOrientation.h | lianwentao/huachengshequhuishenghuo | 76b42ad11e90892af0e8ba308a0ec84226faea74 | [
"Apache-2.0"
] | 81 | 2017-04-01T11:09:31.000Z | 2022-01-19T05:58:27.000Z | Category/WPhoto/UIImage+fixOrientation.h | lianwentao/huachengshequhuishenghuo | 76b42ad11e90892af0e8ba308a0ec84226faea74 | [
"Apache-2.0"
] | 2 | 2019-05-11T11:51:13.000Z | 2021-02-03T03:59:32.000Z | Category/WPhoto/UIImage+fixOrientation.h | lianwentao/huachengshequhuishenghuo | 76b42ad11e90892af0e8ba308a0ec84226faea74 | [
"Apache-2.0"
] | 77 | 2017-04-17T15:02:48.000Z | 2022-03-18T02:56:36.000Z | //
// UIImage+fixOrientation.h
// OfficeTools
//
// Created by wangxinxu on 2016/10/9.
// Copyright © 2016年 wangxinxu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end
| 15.3125 | 53 | 0.697959 |
214aeae2f0747c586c9d0776dd9f942b38813d39 | 171 | h | C | world/entity.h | eikrt/world-generator | 31c707cc7767584b98881e7f4e0b9a7fa90c76c5 | [
"MIT"
] | null | null | null | world/entity.h | eikrt/world-generator | 31c707cc7767584b98881e7f4e0b9a7fa90c76c5 | [
"MIT"
] | null | null | null | world/entity.h | eikrt/world-generator | 31c707cc7767584b98881e7f4e0b9a7fa90c76c5 | [
"MIT"
] | null | null | null | #ifndef ENTITY_H
#define ENTITY_H
#include "SDL2/SDL.h"
struct Entity{
char height;
unsigned int type;
int x;
int y;
SDL_Texture* texture;
SDL_Rect rect;
};
#endif
| 13.153846 | 22 | 0.719298 |
34aeb7980a2281bddcbe4e25e7b2ebb780cc1bdc | 14,743 | h | C | plugboard_dialog.h | rmsk2/rmsk2 | 812b2e495c9a15c16075d4358ca9b7b950b7a26c | [
"Apache-2.0"
] | 4 | 2020-06-16T03:52:50.000Z | 2021-12-25T13:12:02.000Z | plugboard_dialog.h | rmsk2/rmsk2 | 812b2e495c9a15c16075d4358ca9b7b950b7a26c | [
"Apache-2.0"
] | null | null | null | plugboard_dialog.h | rmsk2/rmsk2 | 812b2e495c9a15c16075d4358ca9b7b950b7a26c | [
"Apache-2.0"
] | null | null | null | /***************************************************************************
* Copyright 2015 Martin Grap
*
* 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 __plugboard_dialog_h__
#define __plugboard_dialog_h__
/*! \file plugboard_dialog.h
* \brief Header file for the application classes that are used to implement a dialog that lets the user select an involution.
* On top of that it contains the header for a class that implements a dialog which allows to configure an Enigma's
* plugboard.
*/
#include<set>
#include<vector>
#include<utility>
#include<gtkmm.h>
#include<glibmm.h>
using namespace std;
/*! \brief An application class that is needed by a TreeView which displays the pairs of characters that have already been
* selected to build an involution.
*
* It simply describes the data types of the two columns which are used in the TreeView. Yes TreeView. In gtkmm the kind of control
* that displays its data in a table with headers is an appropriately configured TreeView.
*/
class plug_cols : public Gtk::TreeModel::ColumnRecord {
public:
/*! \brief First column is of type ustring. */
Gtk::TreeModelColumn<Glib::ustring> first;
/*! \brief Second columns is of type ustring. */
Gtk::TreeModelColumn<Glib::ustring> second;
/*! \brief Constructor.
*/
plug_cols() { add(first); add(second); }
};
/*! \brief An application class that knows how to manage a set of controls which together allow the user to construct an involution
* by specifiying a variable number of character pairs.
*
* This class is the base class for two different dialogs: The dialog to configure an Enigma plugboard and the dialog for speicifying
* a wiring for the UKW D.
*
* The controls which are managed by objects of this class have been specified in a glade file, where each control has a name. During
* object construction the necessary controls are extracted by their name from the managed dialog. As names have to be unique in a
* glade file controls in different dialogs (Plugboard, UKW D wiring) that have the same purpose still have to have different names.
*
* The names of equivalent controls in different dialogs can be distinguished by their postfix. For instance the checkbox representing
* the character Z is called checkbutton_Z_ukw in the UKW wiring dialog and checkbutton_Z in the plugboard dialog. In the first case the
* prefix is "_ukw" in the second it is "".
*
* The controls which are managed consist of a list of previuosly added character pairs, a button to delete a pair, a button to delete
* all pairs, a label which specifies the current number of pairs (the plug count), 26 checkboxes (one for each character) and an OK
* button.
*/
class select_involution_dialog {
public:
/*! \brief Constructor.
*
* \param d [in] The dialog that contains the controls this class has to manage.
* \param r [in] A Gtk::Builder object that can be used to retrieve pointers to controls inside d.
* \param steckers [inout] Data structure which has to specifiy the pairs which are to be used to initialize
* the selection process. When the dialog has been completed by pressing OK, the object
* which steckers references contains the character pairs selected by the user.
*
* The default prefix is the empty string.
*/
select_involution_dialog(Gtk::Dialog *d, Glib::RefPtr<Gtk::Builder> r, vector<pair<char, char> >& steckers);
/*! \brief Constructor.
*
* \param d [in] The dialog that contains the controls this class has to manage.
* \param r [in] A Gtk::Builder object that can be used to retrieve pointers to controls inside d.
* \param steckers [inout] Data structure which has to specifiy the pairs which are to be used to initialize
* the selection process. When the dialog has been completed by pressing OK, the object
* which steckers references contains the character pairs selected by the user.
* \param name_postfix [in] Specifies a postfix which is appended to the names of the controls which are retrieved
* through the parameter r.
*/
select_involution_dialog(Gtk::Dialog *d, Glib::RefPtr<Gtk::Builder> r, vector<pair<char, char> >& steckers, Glib::ustring& name_postfix);
/*! \brief Pure virtual method that children of this class have to implement in order to execute the dialog. Has to return zero
* to inidicate that the user left the dialog by clikcking OK.
*/
virtual int run() = 0;
/*! \brief Pure virtual method that children of this class have to implement. It is used as a callback when the user opted to delete
* a previously added character pair by selecting the pair in the list of character pairs and pressing the delete button.
*/
virtual void on_delete_clicked() = 0;
/*! \brief Callback that is called when the user clicks on the "Remove all plugs" or "Remove all connections" button. This clears
* the list of current character pairs.
*/
virtual void on_delete_all_clicked();
/*! \brief Callback that is called when the user selects one of the checkboxes that represent single characters. The parameter plug_name
* contains the name of the checkbox that was clicked. Possible names are 'A', 'B', .... 'Z'.
*/
virtual void on_plug_changed(Glib::ustring plug_name);
/*! \brief The plug count label text is the prefix that is printed before the value that specifies how many character pairs have already
* been selected. In the plugboard dialog this is for instance "Number of plugs: ". This method can be used to change this prefix to
* value specified in parameter plug_count_prefix.
*/
virtual void set_plug_count_label_text(Glib::ustring& plug_count_prefix) { plug_count_label_prefix = plug_count_prefix; }
/*! \brief Destructor.
*/
virtual ~select_involution_dialog();
protected:
/*! \brief Helper method that transofrms a character specified as a char through parameter in into a ustring of length one.
*/
virtual Glib::ustring to_ustr(char in) { Glib::ustring temp; temp += (char)(toupper(in)); return temp; }
/*! \brief Helper method that inserts the character pair (first, second) into the list of already selected characters. Also
* updates elements like the plug count.
*/
virtual void insert_stecker_in_model(Glib::ustring first, Glib::ustring second);
/*! \brief Helper method that updates the state of the two checkboxes that make up a character pair after the pair has been selected or
* deselected.
*
* \param first [in] First character of new pair.
* \param second [in] Second character of new pair.
* \param is_sensitive [in] New state of the checkboxes. If False the checkboxes are "grayed".
* \param is_active [in] Specifies of the boxes should appear checked or not. If False the checkboxes are not checked.
*/
virtual void set_plug_state(Glib::ustring first, Glib::ustring second, bool is_sensitive, bool is_active);
/*! \brief Helper method that updates the state of the two checkboxes that make up a character pair after the pair has been
* deselected.
*
* \param first [in] First character of new pair.
* \param second [in] Second character of new pair.
*
* Simply ungrays the checkboxes and unchecks them.
*/
virtual void remove_plug(Glib::ustring first, Glib::ustring second) { set_plug_state(first, second, true, false); }
/*! \brief Helper method that fills the List of already selected pairs based on the value of current_steckers.
*/
virtual void fill_stecker_model();
/*! \brief Helper method that sets the text of the plug counter label by combining the number of the currently
* selected pairs with select_involution_dialog::plug_count_label_prefix.
*/
virtual void update_plug_counter();
/*! \brief Helper method that initializes most the member variables. Non virtual so that ot can be called safely by the
* construdtors.
*/
void setup(Gtk::Dialog *d, Glib::RefPtr<Gtk::Builder> r, Glib::ustring& name_postfix);
/*! \brief Holds the number of currently selected character pairs. */
unsigned int num_plugs;
/*! \brief Points to the plug count label. */
Gtk::Label *plugcount_label;
/*! \brief Holds the name ('A', ..., 'Z') of the last checkbox that was checked or "" when the last checking completed a pair. */
Glib::ustring last_button_toggled;
/*! \brief Points to the dialog which contains the controls managed by objects of this class. */
Gtk::Dialog *dialog;
/*! \brief Data structure that maps the name ('A', ..., 'Z') of a checkbox to a pointer to the checkbox of that name. */
map<char, Gtk::CheckButton *> buttons;
/*! \brief Data structure that maps a pointer to a checkbox to the connection object that is used to receive the signal_clicked()
* signal from that checkbox.
*/
map<Gtk::CheckButton *, sigc::connection> check_button_connections;
/*! \brief Connection object that resulted from connecting to the signal_clicked() signal of the delete button. */
sigc::connection delete_connection;
/*! \brief Connection object that resulted from connecting to the signal_clicked() signal of the delete all button. */
sigc::connection delete_all_connection;
/*! \brief Holds a reference to the Gtk::Builder object that is used to retreive controls from select_involution_dialog::dialog. */
Glib::RefPtr<Gtk::Builder> ref_xml;
/*! \brief Holds the vector of plugs which are used to initialize the dialogs and is filled with the vector of plugs the
* user has selected.
*/
vector<pair<char, char> >& current_steckers;
/*! \brief Specified the columns in the list of selected pairs and their types. */
plug_cols plugboard_cols;
/*! \brief Holds the prefix which is appended to the name of controls in order to retrive them through
* select_involution_dialog::ref_xml.
*/
Glib::ustring name_post_fix;
/*! \brief Holds prefix for the plug count label. */
Glib::ustring plug_count_label_prefix;
};
/*! \brief An application class that knows how to manage a set of controls which together allow the user to configure all parameters of
* an Enigma plubgoard including a possible Enigma Uhr.
*
* Character pairs are called plugs in the context of this dialog.
*/
class plugboard_dialog : public select_involution_dialog {
public:
/*! \brief Constructor.
*
* \param d [in] The dialog that contains the controls this class has to manage.
* \param r [in] A Gtk::Builder object that can be used to retrieve pointers to controls inside d.
* \param steckers [inout] Data structure which has to specifiy the plugs which are to be used to initialize
* the selection process. When the dialog has been completed by pressing OK, the object
* which the parameter steckers references contains the plugs selected by the user.
* \param use_uhr [inout] References a bool that specifies if the Uhr is currently in use in the plugboard that is
* to be configured. When the dialog is completed by clicking OK it is set to reflect the users
* choice with respect to usage of the Uhr.
* \param uhr_dial_pos [inout] References an unsigned int that contains the dial pos of the Uhr. If use_uhr is False
* this value is effectively ignored. After completing the dialog by clicking OK this
* variable is set to the new dial position or to zero if use_uhr is set to False.
* \param uhr_capable [in] If True then the controls to configure the Enigma Uhr are enabled in the plugbaord dialog.
*/
plugboard_dialog(Gtk::Dialog *d, Glib::RefPtr<Gtk::Builder> r, vector<pair<char, char> >& steckers, bool& use_uhr, unsigned int& uhr_dial_pos, bool uhr_capable);
/*! \brief Execute the dialog. Returns zero to indicate that the user left the dialog by clikcking OK.
*/
virtual int run();
/*! \brief Callback that is called when the user opted to delete a previously added plug by selecting it in the list of plugs
* and pressing the delete button.
*/
virtual void on_delete_clicked();
/*! \brief Callback that is called when the user turns the Uhr on or off by clicking on the corresponding checkbox.
*/
virtual void on_uhr_change();
/*! \brief Destructor.
*/
virtual ~plugboard_dialog();
protected:
/*! \brief Turns Uhr controls on or off depending on the parameter current_state.
*/
virtual void update_uhr_state(bool current_state);
/*! \brief Holds the connection object which resulted from subscribing to the signal_clicked() of the Uhr checkbutton. */
sigc::connection uhr_connection;
/*! \brief Set to new value after dialog has been closed by clicking on OK.
*/
bool& uhr_state;
/*! \brief Set to new value after dialog has been closed by clicking on OK.
*/
unsigned int& uhr_pos;
/*! \brief Holds the current value of uhr_state while the dialog is running. Is used to set the variable which
* plugboard_dialog::uhr_state references to a new value after user has clicked on OK button.
*/
bool uhr_state_temp;
};
#endif /* __plugboard_dialog_h__ */
| 51.911972 | 165 | 0.672116 |
f6532943c8c92ceb6ae673a4b3a39029e268b0d1 | 8,129 | h | C | src/qrtone.h | Ifsttar/qrtone | 936305047f84074e86c5277232e88a7e9b3a2f4f | [
"BSD-3-Clause"
] | 29 | 2020-04-10T07:35:06.000Z | 2022-03-27T07:21:31.000Z | src/qrtone.h | Ifsttar/qrtone | 936305047f84074e86c5277232e88a7e9b3a2f4f | [
"BSD-3-Clause"
] | 6 | 2020-04-04T15:56:24.000Z | 2022-03-22T13:44:04.000Z | src/qrtone.h | Ifsttar/qrtone | 936305047f84074e86c5277232e88a7e9b3a2f4f | [
"BSD-3-Clause"
] | 5 | 2020-04-13T07:40:02.000Z | 2022-02-04T20:29:40.000Z | /*
* BSD 3-Clause License
*
* Copyright (c) Unité Mixte de Recherche en Acoustique Environnementale (univ-gustave-eiffel)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* @file qrtone.h
* @author Nicolas Fortin @NicolasCumu
* @date 24/03/2020
* @brief Api of QRTone library
* Usage
* Audio to Message:
* 1. Declare instance of qrtone_t with qrtone_new
* 2. Init with qrtone_init
* 3. Get maximal expected window length with qrtone_get_maximum_length
* 4. Push window samples with qrtone_push_samples
* 5. When qrtone_push_samples return 1 then retrieve payload with qrtone_get_payload and qrtone_get_payload_length
* Message to Audio
* 1. Declare instance of qrtone_t with qrtone_new
* 2. Init with qrtone_init
* 3. Set message with qrtone_set_payload or qrtone_set_payload_ext
* 4. Retrieve audio samples to send with qrtone_get_samples
*/
#ifndef QRTONE_H
#define QRTONE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* Error correction level parameter
* L ecc level 7% error correction level
* M ecc level 15% error correction level
* Q ecc level 25% error correction level
* H ecc level 30% error correction level
*/
enum QRTONE_ECC_LEVEL { QRTONE_ECC_L = 0, QRTONE_ECC_M = 1, QRTONE_ECC_Q = 2, QRTONE_ECC_H = 3};
/**
* @brief Main QRTone structure
*/
typedef struct _qrtone_t qrtone_t;
///////////////////////
// INITIALIZATION
///////////////////////
/**
* Allocation memory for a qrtone_t instance.
* @return A pointer to the qrtone structure.
*/
qrtone_t* qrtone_new(void);
/**
* Initialization of the internal attributes of a qrtone_t instance. Must only be called once.
* @param qrtone A pointer to the qrtone structure.
* @param sample_rate Sample rate in Hz.
*/
void qrtone_init(qrtone_t* qrtone, float sample_rate);
/**
* Free allocated memory for a qrtone_t instance.
* @param qrtone A pointer to the initialized qrtone structure.
*/
void qrtone_free(qrtone_t* qrtone);
////////////////////////
// Receive payload
////////////////////////
/**
* Compute the maximum samples_length to feed with the method `qrtone_push_samples`
* @param qrtone A pointer to the initialized qrtone structure.
* @return The maximum samples_length to feed with the method `qrtone_push_samples`
*/
int32_t qrtone_get_maximum_length(qrtone_t* qrtone);
/**
* Process audio samples in order to find payload in tones.
* @param qrtone A pointer to the initialized qrtone structure.
* @param samples Audio samples array in float. All tests have been done with values between -1 and 1.
* @param samples_length Size Audio samples array. The size should be inferior or equal to `qrtone_get_maximum_length`.
* @return 1 if a payload has been received, 0 otherwise.
*/
int8_t qrtone_push_samples(qrtone_t* qrtone, float* samples, int32_t samples_length);
/**
* Fetch stored payload. Call this function only when `qrtone_push_samples` return 1.
* @param qrtone A pointer to the initialized qrtone structure.
* @return int8_t array of the size provided by `qrtone_get_payload_length`. QRTone is responsible for freeing this array.
*/
int8_t* qrtone_get_payload(qrtone_t* qrtone);
/**
* Get stored payload length. Call this function only when `qrtone_push_samples` return 1.
* @param qrtone A pointer to the initialized qrtone structure.
* @return int8_t stored payload length.
*/
int32_t qrtone_get_payload_length(qrtone_t* qrtone);
/**
* Gives the exact index of the audio sample corresponding to the beginning of the last received message.
* This information can be used for synchronization purposes.
* @param self A pointer to the initialized qrtone structure.
* @return int64_t Audio sample index
*/
int64_t qrtone_get_payload_sample_index(qrtone_t* self);
/**
* When there is not enough signal/noise ratio, some bytes could be error corrected by Reed-Solomon code.
* @param qrtone A pointer to the initialized qrtone structure.
* @return Number of fixed
*/
int32_t qrtone_get_fixed_errors(qrtone_t* qrtone);
/**
* Function callback called while awaiting a message. It can be usefull in order to display if the microphone is working.
* @ptr Pointer provided when calling qrtone_tone_set_level_callback.
* @processed_samples Number of processed samples
* @global_level Leq of signal. Expressed in dBFS (https://en.wikipedia.org/wiki/DBFS)
* @first_tone_level Level of first tone frequency. Expressed in dBFS.
* @second_tone_level Level of second tone frequency. Expressed in dBFS.
*/
typedef void (*qrtone_level_callback_t)(void *ptr, int64_t processed_samples, float first_tone_level, float second_tone_level, int32_t triggered);
/**
* @brief Set callback method called while awaiting a message.
*
* @param qrtone A pointer to the initialized qrtone structure.
* @param data ptr to use when calling the callback method
* @param lvl_callback Pointer to the method to call
*/
void qrtone_set_level_callback(qrtone_t* self, void* data, qrtone_level_callback_t lvl_callback);
///////////////////////////
// Send payload
///////////////////////////
/**
* Set the message to send. With QRTONE_ECC_Q ECC level and with a CRC code.
* @param qrtone A pointer to the initialized qrtone structure.
* @param payload Byte array to send.
* @param payload Byte array length. Should be less than 255 bytes.
* @return The number of audio samples to send.
*/
int32_t qrtone_set_payload(qrtone_t* qrtone, int8_t* payload, uint8_t payload_length);
/**
* Set the message to send, with additional parameters.
* @param qrtone A pointer to the initialized qrtone structure.
* @param payload Byte array to send.
* @param payload Byte array length. Should be less than 255 bytes.
* @param ecc_level Error correction level `QRTONE_ECC_LEVEL`. Error correction level add robustness at the cost of tone length.
* @param add_crc If 1 ,add a crc16 code in order to check if the message has not been altered on the receiver side.
* @return The number of audio samples to send.
*/
int32_t qrtone_set_payload_ext(qrtone_t* qrtone, int8_t* payload, uint8_t payload_length, int8_t ecc_level, int8_t add_crc);
/**
* Populate the provided array with audio samples. You must call qrtone_set_payload function before.
* @param qrtone A pointer to the initialized qrtone structure.
* @param samples Pre-allocated array of samples_length length
* @param samples_length array length. samples_length + offset should be equal or inferior than the total number of audio samples.
* @param power Amplitude of the audio tones.
*/
void qrtone_get_samples(qrtone_t* qrtone, float* samples, int32_t samples_length, float power);
#ifdef __cplusplus
}
#endif
#endif | 39.848039 | 146 | 0.753352 |
56eb3b8a5ebd07ab6567a8015cd620c457d42b16 | 2,434 | h | C | Algorithms and Data Structures/Homework 9/BinarySearchTree.h | Tewodros00/CS-Jacobs | 5876decf6aa6f612dc5569e50e6e5a9eb768d78b | [
"MIT"
] | 4 | 2021-04-09T08:14:58.000Z | 2021-05-17T10:42:11.000Z | Algorithms and Data Structures/Homework 9/BinarySearchTree.h | Tewodros00/Jacobs-Coursework | 5876decf6aa6f612dc5569e50e6e5a9eb768d78b | [
"MIT"
] | null | null | null | Algorithms and Data Structures/Homework 9/BinarySearchTree.h | Tewodros00/Jacobs-Coursework | 5876decf6aa6f612dc5569e50e6e5a9eb768d78b | [
"MIT"
] | null | null | null | #pragma once
#include <stdexcept>
#include "LinkedList.h"
template<class T>
class LinkedList;
template<class T>
class BinarySearchTree
{
private:
struct BSTnode
{
T data;
BSTnode* left;
BSTnode* right;
};
BSTnode* root;
void convertToLinkedList_helper
(LinkedList<T>* linked_list, BSTnode* node);
void deleteTree(BSTnode* node);
public:
BinarySearchTree();
~BinarySearchTree();
void insert(T new_data);
LinkedList<T>* convertToLinkedList();
};
template<class T>
BinarySearchTree<T>::BinarySearchTree()
{
root = nullptr;
}
template<class T>
BinarySearchTree<T>::~BinarySearchTree()
{
deleteTree(root);
}
template<class T>
void BinarySearchTree<T>::deleteTree(BSTnode* node) {
if (node == nullptr)
return
deleteTree(node->left);
deleteTree(node->right);
delete node;
}
template<class T>
void BinarySearchTree<T>::insert(T new_data)
{
if (root == nullptr) {
root = new BSTnode();
root->data = new_data;
root->left = nullptr;
root->right = nullptr;
} else {
BSTnode* prev;
BSTnode* temp = root;
while(temp != nullptr) {
if (new_data < temp->data) {
prev = temp;
temp = temp->left;
} else if (new_data > temp->data) {
prev = temp;
temp = temp->right;
} else {
throw std::invalid_argument
("Error: duplicate items not allowed in BST");
}
}
temp = new BSTnode();
temp->data = new_data;
temp->left = nullptr;
temp->right = nullptr;
if (temp->data < prev->data)
prev->left = temp;
else
prev->right = temp;
}
}
template<class T>
LinkedList<T>* BinarySearchTree<T>::convertToLinkedList()
{
LinkedList<T>* linked_list = new LinkedList<T>();
convertToLinkedList_helper(linked_list, root);
return linked_list;
}
template<class T>
void BinarySearchTree<T>::convertToLinkedList_helper
(LinkedList<T>* linked_list, BSTnode* node)
{
if (node == nullptr)
return;
convertToLinkedList_helper(linked_list, node->right);
linked_list->insert_front(node->data);
convertToLinkedList_helper(linked_list, node->left);
} | 22.330275 | 66 | 0.57272 |
8670ab1145d83d1bcfd59ece039464bf12805e3a | 1,031 | h | C | inetsrv/iis/svcs/smtp/aqueue/cat/inc/catconfig.h | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | inetsrv/iis/svcs/smtp/aqueue/cat/inc/catconfig.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | inetsrv/iis/svcs/smtp/aqueue/cat/inc/catconfig.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /************************************************************
* FILE: catconfig.h
* PURPOSE: Store categorization config options
* HISTORY:
* // jstamerj 980211 15:55:01: Created
************************************************************/
#ifndef _CATCONFIG_H
#define _CATCONFIG_H
#include "aqueue.h"
#define CAT_AQ_CONFIG_INFO_CAT_FLAGS ( \
AQ_CONFIG_INFO_MSGCAT_DOMAIN | \
AQ_CONFIG_INFO_MSGCAT_USER | \
AQ_CONFIG_INFO_MSGCAT_PASSWORD | \
AQ_CONFIG_INFO_MSGCAT_BINDTYPE | \
AQ_CONFIG_INFO_MSGCAT_SCHEMATYPE | \
AQ_CONFIG_INFO_MSGCAT_HOST | \
AQ_CONFIG_INFO_MSGCAT_FLAGS | \
AQ_CONFIG_INFO_MSGCAT_NAMING_CONTEXT | \
AQ_CONFIG_INFO_MSGCAT_TYPE | \
AQ_CONFIG_INFO_DEFAULT_DOMAIN | \
AQ_CONFIG_INFO_MSGCAT_PORT | \
AQ_CONFIG_INFO_MSGCAT_ENABLE \
)
#define RP_ERROR_STRING_UNKNOWN_USER "The user does not exist."
#define RP_ERROR_STRING_UNKNOWN_USER_W L"The user does not exist."
#endif //_CATCONFIG_H
| 31.242424 | 67 | 0.621726 |
99fafb0a79c3e3574d37fbbbb541017ecabff0e6 | 688 | h | C | Example/Pods/SJMediaCacheServer/SJMediaCacheServer/Core/Resource/HLS/MCSHLSPrefetcher.h | msdgwzhy6/SJMediaCacheServer | abf3d2582ed9577268b6a4a45e15359d9c6160ae | [
"MIT"
] | 1 | 2020-06-18T07:21:34.000Z | 2020-06-18T07:21:34.000Z | Example/Pods/SJMediaCacheServer/SJMediaCacheServer/Core/Resource/HLS/MCSHLSPrefetcher.h | msdgwzhy6/SJMediaCacheServer | abf3d2582ed9577268b6a4a45e15359d9c6160ae | [
"MIT"
] | null | null | null | Example/Pods/SJMediaCacheServer/SJMediaCacheServer/Core/Resource/HLS/MCSHLSPrefetcher.h | msdgwzhy6/SJMediaCacheServer | abf3d2582ed9577268b6a4a45e15359d9c6160ae | [
"MIT"
] | null | null | null | //
// MCSHLSPrefetcher.h
// SJMediaCacheServer_Example
//
// Created by 畅三江 on 2020/6/10.
// Copyright © 2020 changsanjiang@gmail.com. All rights reserved.
//
#import "MCSDefines.h"
@class MCSHLSResource;
NS_ASSUME_NONNULL_BEGIN
@interface MCSHLSPrefetcher : NSObject<MCSResourcePrefetcher>
- (instancetype)initWithResource:(__weak MCSHLSResource *)resource request:(NSURLRequest *)request;
@property (nonatomic, weak, nullable) id<MCSResourcePrefetcherDelegate> delegate;
@property (nonatomic, readonly) BOOL isPrepared;
@property (nonatomic, readonly) BOOL isFinished;
@property (nonatomic, readonly) BOOL isClosed;
- (void)prepare;
- (void)close;
@end
NS_ASSUME_NONNULL_END
| 24.571429 | 99 | 0.780523 |
791a90ebca59e85ba1b4cb034be238f786940234 | 43,486 | h | C | cocos2d/cocos/cornell/CUCubicSpline.h | Mshnik/Pineapple | 378917353d22d8497769ed8e45d9a73b40d2717e | [
"MIT"
] | null | null | null | cocos2d/cocos/cornell/CUCubicSpline.h | Mshnik/Pineapple | 378917353d22d8497769ed8e45d9a73b40d2717e | [
"MIT"
] | null | null | null | cocos2d/cocos/cornell/CUCubicSpline.h | Mshnik/Pineapple | 378917353d22d8497769ed8e45d9a73b40d2717e | [
"MIT"
] | 1 | 2019-12-25T02:32:13.000Z | 2019-12-25T02:32:13.000Z | //
// CUCubicSpline.h
// Cornell Extensions to Cocos2D
//
// This module provides a class that represents a spline of cubic beziers. A
// bezier spline is just a sequence of beziers joined together, so that the end
// of one is the beginning of the other. Cubic beziers have four control points,
// two for the vertex anchors and two for their tangents.
//
// Cocos2d does have a lot of spline support. In addition to cubic beziers, it
// also has quadratic beziers, cardinal splines, and Catmull-Rom splines. However,
// in true Cocos2d fashion, these are all tightly coupled with drawing code. We do
// not want splines embedded with drawing code. We want a mathematics object that
// we can adjust and compute with. Hence the purpose of this class. We chose
// cubic splines because they are the most natural for editting (as seen in
// Adobe Illustrator).
//
// If you want to draw a CubicSpline, use the allocPath() method to allocate a Poly2
// value for the spline. We have to turn shapes into polygons to draw them anyway,
// and this allows us to do all of the cool things we can already do with paths,
// like extrude them or create wireframes.
//
// Math data types are much lighter-weight than other objects, and are intended to
// be copied. That is why we do not use reference counting for these objects.
//
// Author: Walker White
// Version: 11/24/15
//
#ifndef __CU_CUBIC_SPLINE_H__
#define __CU_CUBIC_SPLINE_H__
#include "CUPoly2.h"
NS_CC_BEGIN
class Polynomial;
/** The default tolerance for the polygon approximation functions */
#define DEFAULT_TOLERANCE 0.25
#pragma mark -
#pragma mark CubicSpline
/**
* Class to represent a spline of quadratic beziers.
*
* A bezier spline is a sequence of beziers, where the start of one is the begining of
* the other. A bezier spline may be open or closed. In a closed spline, the end of
* the last bezier is the beginning of the first (or in the case of a degenerate
* bezier, a bezier with the same beginning and end).
*
* A single cubic bezier is represented by the four points. There are the two anchor
* points P1 and P2. These represent the start and end of the curve. In addition, each
* of these points has a tangent: T1 and T2. The curve is defined so that P1 has a right
* tangent of T1, and P2 has a left tangent of T2. The tangents themselves are given
* as points, not vectors (so the tangent vector is Tn-Pn). These four points are known
* as the control points. When we represent a bezier, we typically represent it as a list
* of four points in this order: P1, T1, T2, and P2.
*
* In a bezier spline, the first anchor point of the next curve is the same as the last
* anchor point of the previous one. There is no need to duplicate this information.
* However, the tanget is not a duplicate, since anchor points on the interior of the
* spline have both a left and right tangent. Therefore, the control point list always
* has two tangents between any two anchors. Thus bezier spline of n beziers will
* contain 3n+1 control points.
*
* This class does not contain any drawing functionality at all. If you wish to
* draw a bezier, create a Poly2 approximation with the allocPath() method. This
* method creates a line-segment approximation of the bezier, in much the same way
* that we approximate circles or ellipses when drawing them. You can then use the
* many features for drawing a Poly2 object, such as extrusion or wireframes.
*
* This class has a lot of advanced methods to detect the nearest anchor, tanget,
* or curve location to a point. These are designed so that you can edit a bezier
* in a level editor for you game. These methods determine the part of the bezier
* closest to you mouse location, so that you can select and edit them.
*/
class CC_DLL CubicSpline {
protected:
/** The number of segments in this spline */
int _size;
/**
* The defining control points of this spline (both anchor points and tangents).
*
* The number of elements in this array is 6*size+2. Each point is an adjacent pair in
* the array, and each segment has four points (anchor, tangent, tangent, anchor). The
* first and last anchor of each segment is shared and not repeated.
*/
std::vector<Vec2> _points;
/** For each anchor point in the spline, whether it is a smooth point or a hinge point. */
std::vector<bool> _smooth;
/** Whether or not the spline is closed. This effects editting and polygon approximation */
bool _closed;
public:
/**
* Termination criteria for de Castlejau's recursive subdivision
*
* This is used by the polygon approximation functions. To convert a bezier
* into a polygon, we recursively subdivide the bezier until we reach the
* terminal condition. We then use the anchor points of the subdivided
* bezier to define our polygon.
*/
enum Criterion {
/**
* The FLAT termination criterion.
*
* It guarantees a limit on the flatness (which in this context means the
* distance from the curve to the polygon divided by point spacing).
*/
FLAT,
/**
* The DISTANCE termination criterion.
*
* It guarantees that the curve lies within a certain distance from the
* polygon defined by the points.
*/
DISTANCE,
/**
* The SPACING termination criterion .
*
* It guarantees that the points will be less than a certain distance apart.
*/
SPACING
};
#pragma mark Constructors
/**
* Creates an empty spline.
*
* The minimum spline possible has 4 points: two anchors and two tangents.
* This sets them all to (0,0). As a degenerate spline, it is closed.
*/
CubicSpline() : CubicSpline(Vec2::ZERO,Vec2::ZERO) { }
/**
* Creates a degenerate spline of one point
*
* The minimum spline possible has 4 points: two anchors and two tangents.
* This sets them all to (x,y). As a degenerate spline, it is closed.
*
* @param point The bezier anchor point
* @param y The y-coordinate of the point
*/
CubicSpline(const Vec2& point) : CubicSpline(point,point) { }
/**
* Creates a spline of two points
*
* The minimum spline possible has 4 points: two anchors and two tangents.
* This sets the start to be the first anchor point, and end to be the
* second. The tangents, are the same as the anchor points, which means
* that the tangents are degenerate. This has the effect of making the
* bezier a straight line from start to end. The spline is open, unless
* start and end are the same.
*
* @param start The first bezier anchor point
* @param end The second bezier anchor point
*/
CubicSpline(const Vec2& start, const Vec2& end);
/**
* Creates a spline from the given control points.
*
* The control points must be specified in the form
*
* anchor, tangent, tangent, anchor, tangent ... anchor
*
* That is, starts and ends with anchors, and every two anchors have two
* tangents (right of the first, left of the second) in between. As each
* point is two floats, the value size must be equal to 2 mod 6.
*
* The created spline is open.
*
* @param points The array of control points as floats
* @param offset The starting offset in the control point array
* @param size The number of floats to use in the array
*/
CubicSpline(const float* points, int size, int offset=0);
/**
* Creates a spline from the given control points.
*
* The control points must be specified in the form
*
* anchor, tangent, tangent, anchor, tangent ... anchor
*
* That is, starts and ends with anchors, and every two anchors have two
* tangents (right of the first, left of the second) in between. As each
* point is two floats, the size of the vector must be equal to 2 mod 6.
*
* The created spline is open.
*
* @param points The vector of control points as floats
*/
CubicSpline(const std::vector<float>& points);
/**
* Creates a spline from the given control points.
*
* The control points must be specified in the form
*
* anchor, tangent, tangent, anchor, tangent ... anchor
*
* That is, starts and ends with anchors, and every two anchors have two
* tangents (right of the first, left of the second) in between. The
* size of this vector must be equal to 1 mod 3.
*
* The created spline is open.
*
* @param points The vector of control points
*/
CubicSpline(const std::vector<Vec2>& points);
/**
* Creates a copy of the given spline.
*
* @param spline The spline to copy
*/
CubicSpline(const CubicSpline& spline);
/**
* Deletes this spline releasing all memory
*
* This spline does not retain ownership of any Poly2 allocated by
* an alloc method. It is the callers responsibility to release
* this memory when done with it.
*/
~CubicSpline() { }
#pragma mark Attribute Accessors
/**
* Returns the number of segments in this spline
*
* Each segment is a bezier. To use the bezier methods associated with this
* class, you will need to know the correct segment.
*
* @return the number of segments in this spline
*/
int getSize() const { return _size; }
/**
* Returns true if the spline is closed.
*
* A closed spline is one where the first and last anchor are the same.
* Hence the first and last tangents are tangents (right, and left,
* respectively) of the same point. This is relevant for the setTangent()
* method, particularly if the change is meant to be symmetric.
*
* A closed spline has no end. Therefore, anchors cannot be added to
* a closed spline. They may only be inserted between two other
* anchors.
*
* @return true if the spline is closed
*/
bool getClosed() const { return _closed; }
/**
* Sets whether the spline is closed.
*
* A closed spline is one where the first and last anchor are the same.
* Hence the first and last tangents are tangents (right, and left,
* respectively) of the same point. This is relevant for the setTangent()
* method, particularly if the change is meant to be symmetric.
*
* A closed spline has no end. Therefore, anchors cannot be added to
* a closed spline. They may only be inserted between two other
* anchors.
*
* @param flag whether the spline is closed
*/
void setClosed(bool flag);
/**
* Returns the spline point for parameter tp.
*
* A bezier spline is a parameterized curve. For a single bezier, it is
* parameterized with tp in 0..1, with tp = 0 representing the first
* anchor and tp = 1 representing the second. In the spline, we generalize
* this idea, where tp is an anchor if it is an int, and is inbetween
* the anchors floor(tp) and ceil(tp) otherwise.
*
* @param tp the parameterization value
*
* @return the spline point for parameter tp
*/
Vec2 getPoint(float tp) const { return getPoint((int)tp,tp-(int)tp); }
/**
* Sets the spline point at parameter tp.
*
* A bezier spline is a parameterized curve. For a single bezier, it is
* parameterized with tp in 0..1, with tp = 0 representing the first
* anchor and tp = 1 representing the second. In the spline, we generalize
* this idea, where tp is an anchor if it is an int, and is inbetween
* the anchors floor(tp) and ceil(tp) otherwise.
*
* In this method, if tp is an int, it will just reassign the associated
* anchor value. Otherwise, this will insert a new anchor point at
* that parameter. This has a side-effect of changing the parameterization
* values for the curve, as the number of beziers has increased.
*
* @param tp the parameterization value
* @param point the new value to assign
*/
void setPoint(float tp, const Vec2& point);
/**
* Returns the anchor point at the given index.
*
* If an open spline has n segments, then it has n+1 anchors. Similiarly,
* a closed spline had n anchors. The value index should be in the
* appropriate range.
*
* @param index the anchor index (0..n+1 or 0..n)
*
* @return the anchor point at the given index.
*/
Vec2 getAnchor(int index) const;
/**
* Sets the anchor point at the given index.
*
* This method will change both the anchor and its associated tangets.
* The new tangents will have the same relative change in position.
* As a result, the bezier will still have the same shape locally.
* This is the natural behavior for changing an anchor, as seen in
* Adobe Illustrator.
*
* If an open spline has n segments, then it has n+1 anchors. Similiarly,
* a closed spline had n anchors. The value index should be in the
* appropriate range.
*
* @param index the anchor index (0..n+1 or 0..n)
* @param point the new value to assign
*/
void setAnchor(int index, const Vec2& point);
/**
* Returns the smoothness for the anchor point at the given index.
*
* A smooth anchor is one in which the derivative of the curve at the
* anchor is continuous. Practically, this means that the left and
* right tangents are always parallel. Only a non-smooth anchor may
* form a "hinge".
*
* If an open spline has n segments, then it has n+1 anchors. Similiarly,
* a closed spline had n anchors. The value index should be in the
* appropriate range.
*
* @param index the anchor index (0..n+1 or 0..n)
*
* @return the smoothness for the anchor point at the given index.
*/
bool getSmooth(int index) const;
/**
* Sets the smoothness for the anchor point at the given index.
*
* A smooth anchor is one in which the derivative of the curve at the
* anchor is continuous. Practically, this means that the left and
* right tangents are always parallel. Only a non-smooth anchor may
* form a "hinge".
*
* If you set a non-smooth anchor to smooth, it will adjust the
* tangents accordingly. In particular, it will average the two
* tangents, making them parallel. This is the natural behavior for
* changing an smoothness, as seen in Adobe Illustrator.
*
* If an open spline has n segments, then it has n+1 anchors. Similiarly,
* a closed spline had n anchors. The value index should be in the
* appropriate range.
*
* @param index the anchor index (0..n+1 or 0..n)
* @param flag the anchor smoothness
*
* @return the smoothness for the anchor point at the given index.
*/
void setSmooth(int index, bool flag);
/**
* Returns the tangent at the given index.
*
* Tangents are specified as points, not vectors. To get the tangent
* vector for an anchor, you must subtract the anchor from its tangent
* point. Hence a curve is degenerate when the tangent and the
* anchor are the same.
*
* If a spline has n segments, then it has 2n tangents. This is true
* regardless of whether it is open or closed. The value index should
* be in the appropriate range. An even index is a right tangent,
* while an odd index is a left tangent. If the spline is closed, then
* 2n-1 is the left tangent of the first point.
*
* @param index the tangent index (0..2n)
*
* @return the tangent at the given index.
*/
Vec2 getTangent(int index) const;
/**
* Sets the tangent at the given index.
*
* Tangents are specified as points, not vectors. To get the tangent
* vector for an anchor, you must subtract the anchor from its tangent
* point. Hence a curve is degenerate when the tangent and the
* anchor are the same.
*
* If the associated anchor point is smooth, changing the direction
* of the tangent vector will also change the direction of the other
* tangent vector (so that they remain parallel). However, changing
* only the magnitude will have no effect, unless symmetric is true.
* In that case, it will modify the other tangent so that it has the
* same magnitude and parallel direction. This is the natural behavior
* for changing a tangent, as seen in Adobe Illustrator.
*
* If a spline has n segments, then it has 2n tangents. This is true
* regardless of whether it is open or closed. The value index should
* be in the appropriate range. An even index is a right tangent,
* while an odd index is a left tangent. If the spline is closed, then
* 2n-1 is the left tangent of the first point.
*
* @param index the tangent index (0..2n)
* @param tang the new value to assign
* @param symmetric whether to make the other tangent symmetric
*/
void setTangent(int index, const Vec2& tang, bool symmetric=false);
/**
* Returns the x-axis bezier polynomial for the given segment.
*
* Bezier polynomials define the curve parameterization. They are
* two dimension polynomials that give a point. Rather than
* extend polynomial to support multidimensional data, we extract
* each axis separately.
*
* We also cannot define a single polynomial for the entire spline,
* but we can do it for each segment. The result is a cubic poly,
* hence the name CubicSpline.
*
* @return the x-axis bezier polynomial for the given segment.
*/
Polynomial getPolynomialX(int segment) const;
/**
* Returns the y-axis bezier polynomial for the given segment.
*
* Bezier polynomials define the curve parameterization. They are
* two dimension polynomials that give a point. Rather than
* extend polynomial to support multidimensional data, we extract
* each axis separately.
*
* We also cannot define a single polynomial for the entire spline,
* but we can do it for each segment. The result is a cubic poly,
* hence the name CubicSpline.
*
* @return the y-axis bezier polynomial for the given segment.
*/
Polynomial getPolynomialY(int segment) const;
/**
* Returns the spline control points.
*
* If the spline has n segments, then the list will have 6n+2 elements
* in it, representing the n+1 anchor points and the 2n tangents.
* The values will alternate
*
* anchor, tangent, tangent, anchor, tangent ... anchor
*
* This is true even if the curve is closed. In that case, the
* first and last anchor points will be the same.
*
* @return the spline control points.
*/
const std::vector<Vec2> getControlPoints() const { return _points; }
#pragma mark Anchor Editting Methods
/**
* Adds the given point to the end of the spline, creating a new segment.
*
* The new segment will start at the previous end of the last spline and
* extend to the given point. As closed splines have no end, this method
* will fail on closed beziers. You should use insertAnchor instead for
* closed beziers.
*
* This version of the method adds a degenerate tangent point for the
* new anchor.
*
* @param point the new anchor point to add to the end
*
* @return the new number of segments in this spline
*/
int addAnchor(const Vec2& point) { return addAnchor(point,point); }
/**
* Adds the given point to the end of the spline, creating a new segment.
*
* The new segment will start at the previous end of the last spline and
* extend to the given point. As closed splines have no end, this method
* will fail on closed beziers. You should use insertAnchor instead for
* closed beziers.
*
* This value tang is the left tangent of the new anchor point.
*
* @param point the new anchor point to add to the end
* @param tang the left tangent of the new anchor point
*
* @return the new number of segments in this spline
*/
int addAnchor(const Vec2& point, const Vec2& tang);
/**
* Deletes the anchor point at the given index.
*
* The point is deleted as well as both of its tangents (left and right).
* All remaining anchors after the deleted one will shift their indices
* down by one. Deletion is allowed on closed splines; the spline will
* remain closed after deletion.
*
* If an open spline has n segments, then it has n+1 anchors. Similiarly,
* a closed spline had n anchors. The value index should be in the
* appropriate range.
*
* @param index the anchor index to delete
*/
void deleteAnchor(int index);
/**
* Inserts a new anchor point at parameter tp.
*
* Inserting an anchor point does not change the curve. It just makes
* an existing point that was not an anchor, now an anchor. This is the
* natural behavior for inserting an index, as seen in Adobe Illustrator.
*
* A bezier spline is a parameterized curve. For a single bezier, it is
* parameterized with tp in 0..1, with tp = 0 representing the first
* anchor and tp = 1 representing the second. In the spline, we generalize
* this idea, where tp is an anchor if it is an int, and is inbetween
* the anchors floor(tp) and ceil(tp) otherwise.
*
* The tangents of the new anchor point will be determined by de Castlejau's.
* This is the natural behavior for inserting an anchor mid bezier, as seen
* in Adobe Illustrator.
*
* @param tp the parameterization value
*/
void insertAnchor(float param) { insertAnchor((int)param,param-(int)param); }
#pragma mark Nearest Point Methods
/**
* Returns the nearest point on the spline to the given point.
*
* The value is effectively the projection of the point onto the curve. We
* compute this point using the projection polynomial, described at
*
* http://jazzros.blogspot.com/2011/03/projecting-point-on-bezier-curve.html
*
* The point returned does not need to be an anchor point. It can be anywhere
* on the curve. This allows us a way to select a non-anchor point with the
* mouse (such as to add a new anchor point) in a level editor or other
* program.
*
* @param point the point to project
*
* @return the nearest point on the spline to the given point.
*/
Vec2 nearestPoint(const Vec2& point) const { return getPoint(nearestParameter(point)); }
/**
* Returns the parameterization of the nearest point on the spline.
*
* The value is effectively the projection of the point onto the parametrized
* curve. See getPoint() for an explanation of how the parameterization work. We
* compute this value using the projection polynomial, described at
*
* http://jazzros.blogspot.com/2011/03/projecting-point-on-bezier-curve.html
*
* @param point the point to project
*
* @return the parameterization of the nearest point on the spline.
*/
float nearestParameter(const Vec2& point) const;
/**
* Returns the index of the anchor nearest the given point.
*
* If there is no anchor whose distance to point is less than the square root
* of threshold (we use lengthSquared for speed), then this method returns -1.
*
* @param point the point to compare
* @param threshold the distance threshold for picking an anchor
*
* @return the index of the anchor nearest the given point.
*/
int nearestAnchor(const Vec2& point, float threshold) const;
/**
* Returns the index of the tangent nearest the given point.
*
* If there is no tangent whose distance to point is less than the square root
* of threshold (we use lengthSquared for speed), then this method returns -1.
*
* @param point the point to compare
* @param threshold the distance threshold for picking a tangent
*
* @return the index of the tangent nearest the given point.
*/
int nearestTangent(const Vec2& point, float threshold) const;
#pragma mark Polygon Approximation
/**
* Returns a list of vertices approximating this spline
*
* A polygon approximation is creating by recursively calling de Castlejau's
* until we reach a stopping condition. The stopping condition is determined
* by the Criterion. See that enum for a description of how the various
* stopping conditions work. The tolerance is the value associated with
* the condition. For example, for condition DISTANCE, tolerance is how
* far the point can be away from the true curve.
*
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
*
* @return a list of vertices approximating this spline
*/
std::vector<Vec2> approximate(float tolerance=DEFAULT_TOLERANCE,
Criterion criterion=Criterion::DISTANCE) const;
/**
* Returns a list of parameters for a polygon approximation
*
* A polygon approximation is creating by recursively calling de Castlejau's
* until we reach a stopping condition. The stopping condition is determined
* by the Criterion. See that enum for a description of how the various
* stopping conditions work. The tolerance is the value associated with
* the condition. For example, for condition DISTANCE, tolerance is how
* far the point can be away from the true curve.
*
* Note that de Castlejau's changes the number of segments, hence changing
* the way parameterization works. This parameter list is with respect to
* the original spline. These parameters can be plugged into the method
* getPoint() to retrieve the associated point.
*
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
*
* @return a list of parameters for a polygon approximation
*/
std::vector<float> approximateParameters(float tolerance=DEFAULT_TOLERANCE,
Criterion criterion=Criterion::DISTANCE) const;
/**
* Returns a list of tangent points for a polygon approximation
*
* A polygon approximation is creating by recursively calling de Castlejau's
* until we reach a stopping condition. The stopping condition is determined
* by the Criterion. See that enum for a description of how the various
* stopping conditions work. The tolerance is the value associated with
* the condition. For example, for condition DISTANCE, tolerance is how
* far the point can be away from the true curve.
*
* These tangents are presented in control point order. First, we have
* the right tangent of the first point, then the left tangent of the
* second point, then the right, and so on. If approximate() returned
* n points, this method will return 2(n-1) tangents.
*
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
*
* @return a list of tangent points for a polygon approximation
*/
std::vector<Vec2> approximateTangents(float tolerance=DEFAULT_TOLERANCE,
Criterion criterion=Criterion::DISTANCE) const;
/**
* Returns a list of normals for a polygon approximation
*
* A polygon approximation is creating by recursively calling de Castlejau's
* until we reach a stopping condition. The stopping condition is determined
* by the Criterion. See that enum for a description of how the various
* stopping conditions work. The tolerance is the value associated with
* the condition. For example, for condition DISTANCE, tolerance is how
* far the point can be away from the true curve.
*
* There is one normal per point. If approximate() returned n points, this
* method will also return n normals. The normals are determined by the
* right tangents. If the spline is open, then the normal of the last point
* is determined by its left tangent.
*
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
*
* @return a list of normals for a polygon approximation
*/
std::vector<Vec2> approximateNormals(float tolerance=DEFAULT_TOLERANCE,
Criterion criterion=Criterion::DISTANCE) const;
/**
* Returns an expanded version of this spline
*
* When we use de Castlejau's to approximate the spline, it produces a list
* of control points that are geometrically equal to this spline (e.g. ignoring
* parameterization). Instead of flattening this information to a polygon,
* this method presents this data as a new spline.
*
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
*
* @return an expanded version of this spline
*/
CubicSpline refine(float tolerance=DEFAULT_TOLERANCE,
Criterion criterion=Criterion::DISTANCE) const;
#pragma mark Rendering Data
/**
* Allocates a new polygon approximating this spline
*
* A polygon approximation is creating by recursively calling de Caslejau's
* until we reach a stopping condition. The stopping condition is determined
* by the Criterion. See that enum for a description of how the various
* stopping conditions work. The tolerance is the value associated with
* the condition. For example, for condition DISTANCE, tolerance is how
* far the point can be away from the true curve.
*
* The polygon will have either an OPEN or CLOSED traversal, depending on
* whether the polygon is open or closed.
*
* This method allocates memory and releases ownership to the caller. This
* decision was made because copying Poly2 is expensive (it needs exclusive
* ownership of its data in order to be safe for the rendering pipline). It
* is the responsibility of the caller to delete the polygon when done. As
* TexturedNode and its subclasses copy the polygon before drawing, it is
* safe to delete the polygon immediately after assigning it to a node.
*
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
*
* @return a newly allocated polygon approximating this spline
*/
Poly2* allocPath(float tolerance=DEFAULT_TOLERANCE,
Criterion criterion=Criterion::DISTANCE) const;
/**
* Allocates lines for the anchor tangent vectors
*
* This method returns a vertex information for the tangent lines to this
* spline. These are only the tangent lines for the anchors, not all of
* the points on an approximated path. This information may be passed
* to a WireNode to provide a visual representation of the tangents (as
* seen in Adobe Illustrator).
*
* This method allocates memory and releases ownership to the caller. This
* decision was made because copying Poly2 is expensive (it needs exclusive
* ownership of its data in order to be safe for the rendering pipline). It
* is the responsibility of the caller to delete the polygon when done. As
* TexturedNode and its subclasses copy the polygon before drawing, it is
* safe to delete the polygon immediately after assigning it to a node.
*
* @return a newly set of lines for the anchor tangent vectors
*/
Poly2* allocTangents() const;
/**
* Allocates handles for the anchor points
*
* This method returns a vertex information for handles at the anchor
* points. Handles are circular shapes of a given radius. This information
* may be passed to a PolygonNode to provide a visual representation of the
* anchor points (as seen in Adobe Illustrator).
*
* This method allocates memory and releases ownership to the caller. This
* decision was made because copying Poly2 is expensive (it needs exclusive
* ownership of its data in order to be safe for the rendering pipline). It
* is the responsibility of the caller to delete the polygon when done. As
* TexturedNode and its subclasses copy the polygon before drawing, it is
* safe to delete the polygon immediately after assigning it to a node.
*
* @param radius the radius of each handle
* @param segments the number of segments in the handle "circle"
*
* @return a newly set of lines for the anchor tangent vectors
*/
Poly2* allocAnchors(float radius, int segments=4) const;
/**
* Allocates handles for the tangent points
*
* This method returns a vertex information for handles at the tangent
* points. Handles are circular shapes of a given radius. This information
* may be passed to a PolygonNode to provide a visual representation of the
* tangent points (as seen in Adobe Illustrator).
*
* This method allocates memory and releases ownership to the caller. This
* decision was made because copying Poly2 is expensive (it needs exclusive
* ownership of its data in order to be safe for the rendering pipline). It
* is the responsibility of the caller to delete the polygon when done. As
* TexturedNode and its subclasses copy the polygon before drawing, it is
* safe to delete the polygon immediately after assigning it to a node.
*
* @param radius the radius of each handle
* @param segments the number of segments in the handle "circle"
*
* @return a newly set of lines for the anchor tangent vectors
*/
Poly2* allocHandles(float radius, int segments=4) const;
#pragma mark Internal Helpers
protected:
/**
* Returns the spline point for parameter tp.
*
* This method is like the public getPoint(), except that it is restricted
* to a single bezier segment. A bezier is parameterized with tp in 0..1,
* with tp = 0 representing the first anchor and tp = 1 representing the
* second. This method is used by the public getPoint() to compute its value.
*
* @param segment the bezier segment to select from
* @param tp the parameterization value
*
* @return the spline point for parameter tp
*/
Vec2 getPoint(int segment, float tp) const;
/**
* Inserts a new anchor point at parameter tp.
*
* Inserting an anchor point does not change the curve. It just makes
* an existing point that was not an anchor, now an anchor. This is the
* natural behavior for inserting an index, as seen in Adobe Illustrator.
*
* This version of insertAnchor() specifies the segment for insertion,
* simplifying the parameterization. For a single bezier, it is
* parameterized with tp in 0..1, with tp = 0 representing the first
* anchor and tp = 1 representing the second.
*
* The tangents of the new anchor point will be determined by de Castlejau's.
* This is the natural behavior for inserting an anchor mid bezier, as seen
* in Adobe Illustrator.
*
* @param segment the bezier segment to insert into
* @param tp the parameterization value
*/
void insertAnchor(int segment, float param);
/**
* Applies de Castlejau's to the given segment, putting the result in left & right
*
* de Castlejau's takes a parameter tp in (0,1) and splits the bezier into two,
* preserving the geometric information, but not the parameterization. The control
* points for the resulting two beziers are stored in left and right.
*
* @param segment the bezier segment of this spine
* @param tp the parameter to split at
* @param left vector to store the left bezier
* @param right vector to store the right bezier
*/
void subdivide(int segment, float tp, std::vector<Vec2>& left, std::vector<Vec2>& rght) const {
subdivide(_points,6*segment,tp,left,rght);
}
/**
* Applies de Castlejau's to a bezier, putting the result in left & right
*
* de Castlejau's takes a parameter tp in (0,1) and splits the bezier into two,
* preserving the geometric information, but not the parameterization. The control
* points for the resulting two beziers are stored in left and right.
*
* This static method is not restricted to the current spline. It can work
* from any list of control points (and offset into those control points).
* This is useful for recursive subdivision.
*
* @param src the control point list for the bezier
* @param soff the offset into the control point list
* @param tp the parameter to split at
* @param left vector to store the left bezier
* @param right vector to store the right bezier
*/
static void subdivide(const std::vector<Vec2>& src, int soff, float tp,
std::vector<Vec2>& left, std::vector<Vec2>& rght);
/**
* Returns the projection polynomial for the given point.
*
* The projection polynomial is used to find the nearest value to point
* on the spline, as described at
*
* http://jazzros.blogspot.com/2011/03/projecting-point-on-bezier-curve.html
*
* There is no one projection polynomial for the entire spline. Each
* segment bezier has its own polynomial.
*
* @param point the point to project
* @param segment the bezier segment to project upon
*/
Polynomial getProjectionPolynomial(const Vec2& point, int segment) const;
/**
* Returns the parameterization of the nearest point on the bezier segment.
*
* The value is effectively the projection of the point onto the parametrized
* curve. See getPoint() for an explanation of how the parameterization work.
*
* This version does not use the projection polynomial. Instead, it picks
* a parameter resolution and walks the entire length of the curve. The
* result is both slow and inexact (as the actual point may be in-between
* chose parameters). This version is only picked when getProjectionFast
* fails because of an error with root finding.
*
* The value returned is a pair of the parameter, and its distance value.
* This allows us to compare this result to other segments, picking the
* best value for the entire spline.
*
* @param point the point to project
* @param segment the bezier segment to project upon
*
* @return the parameterization of the nearest point on the spline.
*/
Vec2 getProjectionSlow(const Vec2& point, int segment) const;
/**
* Returns the parameterization of the nearest point on the bezier segment.
*
* The value is effectively the projection of the point onto the parametrized
* curve. See getPoint() for an explanation of how the parameterization work.
*
* The value is effectively the projection of the point onto the parametrized
* curve. See getPoint() for an explanation of how the parameterization work. We
* compute this value using the projection polynomial, described at
*
* http://jazzros.blogspot.com/2011/03/projecting-point-on-bezier-curve.html
*
* The value returned is a pair of the parameter, and its distance value.
* This allows us to compare this result to other segments, picking the
* best value for the entire spline.
*
* This algorithm uses the projection polynomial, and searches for roots to
* find the best (max of 5) candidates. However, root finding may fail,
* do to singularities in Bairstow's Method. If the root finder fails, then
* the first element of the pair will be -1 (an invalid parameter).
*
* @param point the point to project
* @param segment the bezier segment to project upon
*
* @return the parameterization of the nearest point on the spline.
*/
Vec2 getProjectionFast(const Vec2& point, int segment) const;
#pragma mark Recursive Data Generation
private:
/** The type of data to generate into a list of Vec2 */
enum Buffer {
/* No data, just count amounts */
EMPTY,
/* Put curve points into the list */
POINTS,
/* Put curve parameters into the list */
PARAMETERS,
/* Put tangent points into the list */
TANGENTS,
/* Put normals vectors into the list */
NORMALS,
/* Put all control points into the list */
ALL
};
/**
* Generates data via recursive use of de Castlejau's
*
* This function is a one-stop method for all of the polygon approximation
* methods. Instead of writing the same code over and over, we write a
* single method that takes a reference to a data buffer and a Buffer
* parameter (definining the type of data needed).
*
* The value int returned is the number of elements stored in buffer,
* EXCEPT when bufferType is None. In that case, it just returns the
* number that would have been returned if POINTS were the type.
*
* This static method is not restricted to the current spline. It can work
* from any list of control points (and offset into those control points).
* This is useful for recursive subdivision.
* @param src the control point list for the bezier
* @param soff the offset into the control point list
* @param tp the parameter to split at
* @param tolerance the error tolerance of the stopping condition
* @param criterion the stopping condition criterion
* @param buffer the buffer to store the generated data
* @param bufferType the data type of the buffer
* @param depth the current depth of the recursive call
*/
static int generate_data(const std::vector<Vec2>& src, int soff, float tp,
float tolerance, Criterion criterion,
void* buffer, Buffer bufferType, int depth);
};
NS_CC_END
#endif /* defined(__CU_CUBIC_SPLINE_H__) */
| 42.885602 | 99 | 0.668192 |
254f0a61e1772c2a2bcf8850dd775eef1b843a2d | 388 | h | C | src/utils/tests.h | Softmotions/iwnet | ed76f69c7b22ba02d01ea6b9dd7c5dfe396146f4 | [
"MIT"
] | 4 | 2022-01-29T21:58:17.000Z | 2022-03-17T13:47:52.000Z | src/utils/tests.h | Softmotions/iwnet | ed76f69c7b22ba02d01ea6b9dd7c5dfe396146f4 | [
"MIT"
] | 1 | 2022-03-03T10:18:27.000Z | 2022-03-04T11:07:33.000Z | src/utils/tests.h | Softmotions/iwnet | ed76f69c7b22ba02d01ea6b9dd7c5dfe396146f4 | [
"MIT"
] | null | null | null | #pragma once
#include <stdlib.h>
#include <stdbool.h>
#include <stdatomic.h>
#include <iowow/iwlog.h>
static atomic_int iwn_assertions_failed;
#define IWN_ASSERT_FATAL(v__) \
if (!(v__)) { \
iwlog_error2("Assertion failed: "#v__); \
exit(1); \
}
#define IWN_ASSERT(v__) \
if (!(v__)) { \
++iwn_assertions_failed; \
iwlog_error2("Assertion failed: "#v__); \
}
| 17.636364 | 45 | 0.646907 |
5ec2b616052231f79b0fd6c7fad8533fd59c481d | 278 | h | C | LogKitSDK/HZQLogKit.framework/Headers/DebugLogger.h | Hcount/PublicKitOne | b6a569830259e0101bed6fd088c50b421841a268 | [
"MIT"
] | null | null | null | LogKitSDK/HZQLogKit.framework/Headers/DebugLogger.h | Hcount/PublicKitOne | b6a569830259e0101bed6fd088c50b421841a268 | [
"MIT"
] | null | null | null | LogKitSDK/HZQLogKit.framework/Headers/DebugLogger.h | Hcount/PublicKitOne | b6a569830259e0101bed6fd088c50b421841a268 | [
"MIT"
] | null | null | null | //
/**
* Created by ChingHan on 2019/11/8.
*
* DebugLogger.h
*
* INFORMATION SECURITY DEPARTMENT
*
*/
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DebugLogger : NSObject
+ (void)printLog:(NSString *)logInfo;
@end
NS_ASSUME_NONNULL_END
| 12.086957 | 37 | 0.705036 |
01e79697f4d74529c279c9d62718282d285da420 | 205 | c | C | week1/d04/ex06/main.c | atamraka101/Piscine-42 | 77f4f2fec039720e70ea12e32904b9791e948ff4 | [
"Apache-2.0"
] | null | null | null | week1/d04/ex06/main.c | atamraka101/Piscine-42 | 77f4f2fec039720e70ea12e32904b9791e948ff4 | [
"Apache-2.0"
] | null | null | null | week1/d04/ex06/main.c | atamraka101/Piscine-42 | 77f4f2fec039720e70ea12e32904b9791e948ff4 | [
"Apache-2.0"
] | null | null | null | #include <stdio.h>
int ft_is_prime(int nb);
int main(void)
{
int a;
a = ft_is_prime(29);
printf("%d", a);
a = ft_is_prime(9);
printf("%d", a);
a = ft_is_prime(11);
printf("%d", a);
return (0);
} | 12.8125 | 24 | 0.580488 |
b5b172a25a073e5aaecf37b309c578aaf51d0a73 | 53,852 | c | C | testsuite/EXP_5/test1514.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 34 | 2017-07-04T14:16:12.000Z | 2021-04-22T21:04:43.000Z | testsuite/EXP_5/test1514.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 1 | 2017-07-06T03:43:44.000Z | 2017-07-06T03:43:44.000Z | testsuite/EXP_5/test1514.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 6 | 2017-07-04T16:30:42.000Z | 2019-10-16T05:37:29.000Z |
/*
CF3
Copyright (c) 2015 ishiura-lab.
Released under the MIT license.
https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md
*/
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#include"test1.h"
int32_t x8 = 3;
volatile uint8_t x29 = 57U;
int64_t x32 = 9LL;
uint32_t x34 = UINT32_MAX;
int32_t x35 = INT32_MIN;
static int32_t t3 = INT32_MIN;
int32_t x147 = INT32_MIN;
uint64_t x148 = 4LLU;
static volatile int32_t t6 = 2;
volatile int64_t x312 = 10LL;
int32_t t7 = 25612746;
volatile int8_t x403 = 23;
volatile int64_t t13 = 359156039982146752LL;
uint8_t x426 = 63U;
int32_t t14 = -2129123;
int16_t x467 = INT16_MIN;
uint8_t x468 = 1U;
static volatile int32_t x490 = INT32_MAX;
volatile int32_t t17 = INT32_MAX;
static int32_t x513 = INT32_MIN;
int32_t t18 = INT32_MIN;
static uint32_t x525 = 623451U;
uint32_t x527 = UINT32_MAX;
volatile uint32_t t19 = 57960U;
static uint16_t x547 = 41U;
uint8_t x617 = 0U;
static int64_t x622 = -1LL;
uint8_t x623 = UINT8_MAX;
int32_t x659 = 103;
static int32_t t25 = -60792975;
int32_t x693 = INT32_MAX;
volatile int64_t x778 = INT64_MIN;
uint8_t x859 = UINT8_MAX;
int16_t x860 = 0;
int32_t x977 = -1;
int8_t x978 = 2;
static int16_t x980 = 2;
volatile int32_t t33 = 2682;
volatile int16_t x991 = INT16_MIN;
volatile int32_t t34 = 0;
uint64_t x1002 = 2575LLU;
volatile int32_t x1070 = INT32_MIN;
uint16_t x1071 = UINT16_MAX;
int64_t t37 = INT64_MAX;
uint32_t x1106 = 25U;
volatile int16_t x1121 = 189;
static int64_t x1123 = -14LL;
int32_t t40 = INT32_MIN;
int8_t x1226 = INT8_MAX;
int8_t x1293 = -1;
volatile int64_t x1295 = -1879505466836LL;
int32_t t42 = -1869548;
uint32_t x1374 = 496928U;
int16_t x1451 = -1;
int64_t x1453 = -1LL;
int32_t x1454 = -1;
static volatile uint8_t x1456 = 0U;
volatile int32_t t50 = 0;
volatile int64_t x1510 = -1LL;
uint32_t x1512 = 4U;
volatile int32_t t51 = -719688;
volatile int64_t x1549 = -20758891422906165LL;
static int8_t x1550 = -1;
int32_t x1575 = INT32_MAX;
static uint8_t x1576 = 2U;
static int8_t x1598 = 0;
static int64_t x1599 = 4LL;
uint8_t x1600 = 9U;
int8_t x1610 = INT8_MAX;
uint64_t x1625 = 3LLU;
volatile uint64_t t58 = 17160566574396LLU;
static int64_t x1670 = INT64_MIN;
uint8_t x1672 = 17U;
int64_t x1689 = 3713LL;
int8_t x1705 = INT8_MIN;
static volatile int32_t t61 = -2;
static volatile uint32_t t62 = 122U;
int64_t x1835 = 2341809363977LL;
volatile int8_t x1907 = -1;
volatile int64_t x1937 = INT64_MIN;
uint8_t x1938 = 66U;
int16_t x1939 = -10;
static uint32_t x1940 = 5U;
volatile uint8_t x2022 = 10U;
volatile int16_t x2046 = 3860;
int64_t x2065 = -1LL;
volatile int64_t t71 = INT64_MIN;
int16_t x2117 = -16337;
static int64_t x2118 = -14372144380417LL;
volatile int32_t t72 = -102;
volatile int64_t t73 = 97LL;
uint8_t x2139 = 0U;
volatile int32_t t76 = -1483477;
static int8_t x2400 = 10;
uint16_t x2416 = 0U;
uint8_t x2553 = UINT8_MAX;
uint16_t x2556 = 0U;
uint8_t x2558 = 0U;
uint32_t x2565 = UINT32_MAX;
int64_t x2573 = -1LL;
uint16_t x2576 = 10U;
int64_t x2577 = 8370439247881245LL;
uint8_t x2580 = 25U;
int64_t t84 = -2027512LL;
int16_t x2601 = -1;
int32_t x2665 = -1;
int32_t t87 = -39896;
int8_t x2721 = -1;
volatile int32_t t89 = 6479653;
static int16_t x2802 = -1;
int8_t x2818 = INT8_MIN;
int16_t x2821 = 4;
volatile int32_t x2823 = 1008;
uint8_t x2824 = 0U;
volatile int16_t x2827 = INT16_MIN;
int64_t t94 = INT64_MIN;
uint64_t t95 = UINT64_MAX;
static volatile int32_t x2882 = -100228203;
int8_t x2911 = INT8_MIN;
int8_t x2913 = INT8_MIN;
int32_t x2914 = -9732867;
int32_t t98 = -57;
int16_t x3076 = 0;
int8_t x3085 = -57;
static int64_t x3155 = -24104168LL;
volatile uint32_t t105 = 1806784022U;
static int64_t x3177 = INT64_MAX;
int32_t x3179 = -1;
int64_t x3206 = INT64_MIN;
int64_t x3225 = INT64_MIN;
static int8_t x3370 = -1;
int16_t x3410 = -1;
int8_t x3412 = 8;
int32_t t114 = 0;
int64_t x3450 = INT64_MIN;
int32_t x3465 = INT32_MAX;
static volatile int32_t t116 = INT32_MAX;
int8_t x3633 = INT8_MIN;
uint32_t x3635 = UINT32_MAX;
int16_t x3651 = -1;
uint32_t x3652 = 3U;
int32_t t121 = 46276666;
int8_t x3723 = INT8_MIN;
int64_t t122 = 943584044301568536LL;
int16_t x3753 = INT16_MIN;
uint32_t x3754 = UINT32_MAX;
uint16_t x3756 = 1U;
int64_t x3765 = INT64_MIN;
int64_t x3766 = -1327613907005614428LL;
uint32_t x3793 = 3569U;
static int32_t t128 = 350;
uint8_t x3888 = 0U;
static volatile int8_t x3906 = INT8_MAX;
volatile int16_t x3926 = INT16_MIN;
uint64_t x3927 = UINT64_MAX;
int32_t t131 = -1954;
uint8_t x3984 = 3U;
static uint64_t x4031 = 32538LLU;
int32_t t133 = 6;
int64_t x4041 = INT64_MIN;
int64_t x4110 = INT64_MIN;
int32_t t138 = 122957;
static uint32_t x4251 = 563705U;
uint32_t x4351 = 860843199U;
uint16_t x4362 = 3U;
static uint16_t x4363 = UINT16_MAX;
int32_t x4415 = INT32_MIN;
static volatile int32_t t146 = INT32_MIN;
static int8_t x4465 = INT8_MIN;
uint8_t x4468 = 0U;
volatile int32_t t147 = 16267;
volatile uint16_t x4565 = UINT16_MAX;
int32_t x4567 = 623795;
int64_t x4582 = INT64_MAX;
int16_t x4584 = 0;
volatile uint64_t t150 = 509188268613904520LLU;
int16_t x4767 = -4;
int8_t x4768 = 0;
int8_t x4786 = INT8_MIN;
int8_t x4788 = 1;
int32_t t155 = -10748;
uint64_t x4865 = 5244LLU;
volatile uint8_t x4898 = 21U;
static int16_t x4899 = INT16_MAX;
uint16_t x4900 = 0U;
volatile int16_t x4958 = -180;
static int8_t x5106 = INT8_MIN;
uint64_t x5137 = 235LLU;
int8_t x5166 = 2;
int8_t x5167 = INT8_MAX;
volatile int32_t t166 = 856;
int32_t x5218 = INT32_MAX;
int32_t x5219 = 113015211;
int8_t x5262 = 50;
uint32_t x5299 = 110U;
static int8_t x5453 = INT8_MAX;
int32_t x5455 = 284;
static int32_t x5456 = 16;
int32_t x5557 = 60240218;
uint16_t x5558 = 3433U;
int16_t x5559 = INT16_MAX;
uint32_t x5628 = 16U;
static uint16_t x5650 = 1625U;
int8_t x5651 = 1;
volatile uint16_t x5700 = 0U;
int32_t x5714 = -462789410;
int8_t x5715 = INT8_MIN;
volatile int64_t x5716 = 1LL;
static int32_t x5721 = -171834;
volatile int32_t x5727 = -1;
uint8_t x5760 = 4U;
volatile uint8_t x5768 = 1U;
int64_t t184 = INT64_MIN;
static int16_t x5781 = INT16_MAX;
static volatile int32_t x5814 = 138989758;
volatile uint16_t x5831 = 10476U;
uint64_t x5845 = UINT64_MAX;
static volatile int32_t x5880 = 5;
volatile int8_t x5885 = INT8_MAX;
int32_t x5886 = INT32_MIN;
volatile int32_t t191 = -113761772;
volatile int32_t x5913 = 615876290;
int8_t x5943 = -1;
volatile int32_t t194 = INT32_MIN;
static uint32_t x5967 = 418965U;
int32_t t196 = -1211064;
volatile int32_t t197 = -172770;
static volatile uint16_t x6054 = UINT16_MAX;
uint16_t x6056 = 21U;
uint8_t x6094 = 60U;
void f0(void) {
int16_t x5 = -1;
uint64_t x6 = 1012569071302LLU;
int64_t x7 = INT64_MAX;
int32_t t0 = -244929652;
t0 = (x5-((x6==x7)>>x8));
if (t0 != -1) { NG(); } else { ; }
}
void f1(void) {
uint8_t x30 = 36U;
int64_t x31 = INT64_MIN;
int32_t t1 = -8;
t1 = (x29-((x30==x31)>>x32));
if (t1 != 57) { NG(); } else { ; }
}
void f2(void) {
int8_t x33 = -1;
int8_t x36 = 6;
int32_t t2 = 75793;
t2 = (x33-((x34==x35)>>x36));
if (t2 != -1) { NG(); } else { ; }
}
void f3(void) {
int32_t x53 = INT32_MIN;
uint8_t x54 = 0U;
int8_t x55 = 0;
uint8_t x56 = 23U;
t3 = (x53-((x54==x55)>>x56));
if (t3 != INT32_MIN) { NG(); } else { ; }
}
void f4(void) {
uint16_t x65 = 6U;
int16_t x66 = INT16_MAX;
int8_t x67 = INT8_MAX;
uint8_t x68 = 3U;
int32_t t4 = -3695;
t4 = (x65-((x66==x67)>>x68));
if (t4 != 6) { NG(); } else { ; }
}
void f5(void) {
int8_t x109 = INT8_MIN;
static volatile uint64_t x110 = 518113793LLU;
int8_t x111 = -15;
volatile int8_t x112 = 0;
static int32_t t5 = 48589900;
t5 = (x109-((x110==x111)>>x112));
if (t5 != -128) { NG(); } else { ; }
}
void f6(void) {
static int32_t x145 = 3563;
int64_t x146 = -279LL;
t6 = (x145-((x146==x147)>>x148));
if (t6 != 3563) { NG(); } else { ; }
}
void f7(void) {
int8_t x309 = INT8_MIN;
static uint32_t x310 = UINT32_MAX;
int32_t x311 = -1;
t7 = (x309-((x310==x311)>>x312));
if (t7 != -128) { NG(); } else { ; }
}
void f8(void) {
static int16_t x329 = 9900;
int64_t x330 = -1LL;
int64_t x331 = INT64_MAX;
static uint16_t x332 = 6U;
int32_t t8 = 853546598;
t8 = (x329-((x330==x331)>>x332));
if (t8 != 9900) { NG(); } else { ; }
}
void f9(void) {
uint8_t x333 = 5U;
uint16_t x334 = 3U;
volatile uint8_t x335 = 72U;
uint32_t x336 = 24U;
volatile int32_t t9 = -152940;
t9 = (x333-((x334==x335)>>x336));
if (t9 != 5) { NG(); } else { ; }
}
void f10(void) {
int64_t x337 = INT64_MAX;
int64_t x338 = INT64_MIN;
uint16_t x339 = 6U;
static uint8_t x340 = 3U;
volatile int64_t t10 = INT64_MAX;
t10 = (x337-((x338==x339)>>x340));
if (t10 != INT64_MAX) { NG(); } else { ; }
}
void f11(void) {
int16_t x349 = 56;
uint8_t x350 = 3U;
int32_t x351 = INT32_MIN;
int8_t x352 = 4;
volatile int32_t t11 = 691;
t11 = (x349-((x350==x351)>>x352));
if (t11 != 56) { NG(); } else { ; }
}
void f12(void) {
int32_t x361 = INT32_MAX;
uint16_t x362 = 598U;
volatile uint32_t x363 = 391390731U;
volatile int64_t x364 = 0LL;
static volatile int32_t t12 = INT32_MAX;
t12 = (x361-((x362==x363)>>x364));
if (t12 != INT32_MAX) { NG(); } else { ; }
}
void f13(void) {
int64_t x401 = -524548476LL;
volatile int64_t x402 = INT64_MIN;
uint16_t x404 = 3U;
t13 = (x401-((x402==x403)>>x404));
if (t13 != -524548476LL) { NG(); } else { ; }
}
void f14(void) {
static int16_t x425 = -32;
static uint32_t x427 = UINT32_MAX;
static uint16_t x428 = 1U;
t14 = (x425-((x426==x427)>>x428));
if (t14 != -32) { NG(); } else { ; }
}
void f15(void) {
uint8_t x461 = 29U;
int8_t x462 = -1;
int64_t x463 = 12692871514216LL;
static uint16_t x464 = 28U;
volatile int32_t t15 = 10;
t15 = (x461-((x462==x463)>>x464));
if (t15 != 29) { NG(); } else { ; }
}
void f16(void) {
static volatile int32_t x465 = INT32_MIN;
static uint16_t x466 = UINT16_MAX;
volatile int32_t t16 = INT32_MIN;
t16 = (x465-((x466==x467)>>x468));
if (t16 != INT32_MIN) { NG(); } else { ; }
}
void f17(void) {
int32_t x489 = INT32_MAX;
int16_t x491 = -352;
int16_t x492 = 0;
t17 = (x489-((x490==x491)>>x492));
if (t17 != INT32_MAX) { NG(); } else { ; }
}
void f18(void) {
static int8_t x514 = -1;
int16_t x515 = 90;
volatile uint32_t x516 = 2U;
t18 = (x513-((x514==x515)>>x516));
if (t18 != INT32_MIN) { NG(); } else { ; }
}
void f19(void) {
uint8_t x526 = 5U;
int16_t x528 = 0;
t19 = (x525-((x526==x527)>>x528));
if (t19 != 623451U) { NG(); } else { ; }
}
void f20(void) {
uint16_t x545 = 2U;
static int16_t x546 = INT16_MIN;
volatile int16_t x548 = 4;
static int32_t t20 = 26738;
t20 = (x545-((x546==x547)>>x548));
if (t20 != 2) { NG(); } else { ; }
}
void f21(void) {
uint16_t x605 = UINT16_MAX;
int16_t x606 = INT16_MIN;
int64_t x607 = INT64_MAX;
uint8_t x608 = 22U;
int32_t t21 = -10;
t21 = (x605-((x606==x607)>>x608));
if (t21 != 65535) { NG(); } else { ; }
}
void f22(void) {
static int32_t x618 = INT32_MIN;
volatile int64_t x619 = INT64_MIN;
int8_t x620 = 1;
volatile int32_t t22 = -7364500;
t22 = (x617-((x618==x619)>>x620));
if (t22 != 0) { NG(); } else { ; }
}
void f23(void) {
int8_t x621 = 0;
static int64_t x624 = 18LL;
int32_t t23 = -77726623;
t23 = (x621-((x622==x623)>>x624));
if (t23 != 0) { NG(); } else { ; }
}
void f24(void) {
static uint8_t x633 = 106U;
int8_t x634 = INT8_MIN;
uint8_t x635 = 18U;
volatile uint16_t x636 = 12U;
volatile int32_t t24 = -9766;
t24 = (x633-((x634==x635)>>x636));
if (t24 != 106) { NG(); } else { ; }
}
void f25(void) {
static volatile uint8_t x657 = 5U;
static int8_t x658 = INT8_MAX;
volatile uint32_t x660 = 10U;
t25 = (x657-((x658==x659)>>x660));
if (t25 != 5) { NG(); } else { ; }
}
void f26(void) {
uint64_t x689 = 11LLU;
static int64_t x690 = -14994461607732LL;
volatile int64_t x691 = INT64_MAX;
int8_t x692 = 15;
uint64_t t26 = 2266951864743479163LLU;
t26 = (x689-((x690==x691)>>x692));
if (t26 != 11LLU) { NG(); } else { ; }
}
void f27(void) {
uint8_t x694 = 15U;
int64_t x695 = -3797163LL;
static volatile uint16_t x696 = 1U;
int32_t t27 = INT32_MAX;
t27 = (x693-((x694==x695)>>x696));
if (t27 != INT32_MAX) { NG(); } else { ; }
}
void f28(void) {
int8_t x717 = INT8_MAX;
volatile int16_t x718 = INT16_MAX;
static int64_t x719 = INT64_MIN;
static int32_t x720 = 1;
volatile int32_t t28 = 1645106;
t28 = (x717-((x718==x719)>>x720));
if (t28 != 127) { NG(); } else { ; }
}
void f29(void) {
uint8_t x777 = 61U;
int64_t x779 = -1LL;
uint64_t x780 = 11LLU;
volatile int32_t t29 = 188;
t29 = (x777-((x778==x779)>>x780));
if (t29 != 61) { NG(); } else { ; }
}
void f30(void) {
volatile int8_t x857 = -1;
uint32_t x858 = 6828963U;
volatile int32_t t30 = 4042191;
t30 = (x857-((x858==x859)>>x860));
if (t30 != -1) { NG(); } else { ; }
}
void f31(void) {
int64_t x921 = 25816LL;
int64_t x922 = INT64_MIN;
int64_t x923 = INT64_MAX;
uint8_t x924 = 1U;
volatile int64_t t31 = 11679LL;
t31 = (x921-((x922==x923)>>x924));
if (t31 != 25816LL) { NG(); } else { ; }
}
void f32(void) {
uint32_t x925 = 7U;
uint64_t x926 = UINT64_MAX;
int32_t x927 = INT32_MAX;
static uint8_t x928 = 5U;
volatile uint32_t t32 = 20418828U;
t32 = (x925-((x926==x927)>>x928));
if (t32 != 7U) { NG(); } else { ; }
}
void f33(void) {
int32_t x979 = -1566;
t33 = (x977-((x978==x979)>>x980));
if (t33 != -1) { NG(); } else { ; }
}
void f34(void) {
int16_t x989 = INT16_MAX;
int64_t x990 = -6128064157779958LL;
uint8_t x992 = 8U;
t34 = (x989-((x990==x991)>>x992));
if (t34 != 32767) { NG(); } else { ; }
}
void f35(void) {
int64_t x1001 = -1LL;
int16_t x1003 = -1;
uint8_t x1004 = 1U;
int64_t t35 = -29706781704LL;
t35 = (x1001-((x1002==x1003)>>x1004));
if (t35 != -1LL) { NG(); } else { ; }
}
void f36(void) {
int16_t x1033 = 8;
int32_t x1034 = INT32_MAX;
int32_t x1035 = INT32_MAX;
static uint32_t x1036 = 15U;
int32_t t36 = 270;
t36 = (x1033-((x1034==x1035)>>x1036));
if (t36 != 8) { NG(); } else { ; }
}
void f37(void) {
int64_t x1069 = INT64_MAX;
uint16_t x1072 = 8U;
t37 = (x1069-((x1070==x1071)>>x1072));
if (t37 != INT64_MAX) { NG(); } else { ; }
}
void f38(void) {
int64_t x1105 = INT64_MIN;
int64_t x1107 = 415567954775577LL;
uint8_t x1108 = 2U;
volatile int64_t t38 = INT64_MIN;
t38 = (x1105-((x1106==x1107)>>x1108));
if (t38 != INT64_MIN) { NG(); } else { ; }
}
void f39(void) {
static int64_t x1122 = -1LL;
static volatile uint16_t x1124 = 0U;
int32_t t39 = -21;
t39 = (x1121-((x1122==x1123)>>x1124));
if (t39 != 189) { NG(); } else { ; }
}
void f40(void) {
int32_t x1209 = INT32_MIN;
static int32_t x1210 = INT32_MAX;
uint32_t x1211 = 1323301U;
uint16_t x1212 = 1U;
t40 = (x1209-((x1210==x1211)>>x1212));
if (t40 != INT32_MIN) { NG(); } else { ; }
}
void f41(void) {
int16_t x1225 = INT16_MAX;
int32_t x1227 = INT32_MIN;
int8_t x1228 = 1;
static volatile int32_t t41 = 383656;
t41 = (x1225-((x1226==x1227)>>x1228));
if (t41 != 32767) { NG(); } else { ; }
}
void f42(void) {
int32_t x1294 = INT32_MIN;
uint16_t x1296 = 6U;
t42 = (x1293-((x1294==x1295)>>x1296));
if (t42 != -1) { NG(); } else { ; }
}
void f43(void) {
static int16_t x1341 = -1;
int8_t x1342 = INT8_MIN;
uint64_t x1343 = UINT64_MAX;
uint8_t x1344 = 11U;
int32_t t43 = -15358229;
t43 = (x1341-((x1342==x1343)>>x1344));
if (t43 != -1) { NG(); } else { ; }
}
void f44(void) {
int64_t x1373 = 1338LL;
int64_t x1375 = -60960475246LL;
uint16_t x1376 = 24U;
int64_t t44 = -30615414LL;
t44 = (x1373-((x1374==x1375)>>x1376));
if (t44 != 1338LL) { NG(); } else { ; }
}
void f45(void) {
uint64_t x1417 = 53858723701LLU;
int32_t x1418 = INT32_MIN;
uint64_t x1419 = 6798811092227LLU;
static uint16_t x1420 = 8U;
static uint64_t t45 = 469264329956218LLU;
t45 = (x1417-((x1418==x1419)>>x1420));
if (t45 != 53858723701LLU) { NG(); } else { ; }
}
void f46(void) {
int8_t x1433 = -1;
int32_t x1434 = INT32_MIN;
volatile int64_t x1435 = INT64_MIN;
static int8_t x1436 = 15;
volatile int32_t t46 = 19032442;
t46 = (x1433-((x1434==x1435)>>x1436));
if (t46 != -1) { NG(); } else { ; }
}
void f47(void) {
int32_t x1449 = INT32_MAX;
int16_t x1450 = INT16_MIN;
static volatile uint16_t x1452 = 28U;
static int32_t t47 = INT32_MAX;
t47 = (x1449-((x1450==x1451)>>x1452));
if (t47 != INT32_MAX) { NG(); } else { ; }
}
void f48(void) {
int8_t x1455 = INT8_MIN;
volatile int64_t t48 = -890535LL;
t48 = (x1453-((x1454==x1455)>>x1456));
if (t48 != -1LL) { NG(); } else { ; }
}
void f49(void) {
uint8_t x1485 = UINT8_MAX;
static uint64_t x1486 = 12913874975366195LLU;
int32_t x1487 = -1;
static int8_t x1488 = 1;
volatile int32_t t49 = 35451800;
t49 = (x1485-((x1486==x1487)>>x1488));
if (t49 != 255) { NG(); } else { ; }
}
void f50(void) {
static int16_t x1493 = INT16_MIN;
int64_t x1494 = INT64_MIN;
static int8_t x1495 = -1;
static volatile int8_t x1496 = 22;
t50 = (x1493-((x1494==x1495)>>x1496));
if (t50 != -32768) { NG(); } else { ; }
}
void f51(void) {
static int32_t x1509 = -1;
int16_t x1511 = INT16_MAX;
t51 = (x1509-((x1510==x1511)>>x1512));
if (t51 != -1) { NG(); } else { ; }
}
void f52(void) {
uint32_t x1551 = 11383393U;
uint16_t x1552 = 28U;
volatile int64_t t52 = -132LL;
t52 = (x1549-((x1550==x1551)>>x1552));
if (t52 != -20758891422906165LL) { NG(); } else { ; }
}
void f53(void) {
static int64_t x1573 = -15608652LL;
volatile int32_t x1574 = 8189901;
static volatile int64_t t53 = 1605216LL;
t53 = (x1573-((x1574==x1575)>>x1576));
if (t53 != -15608652LL) { NG(); } else { ; }
}
void f54(void) {
int16_t x1597 = -1;
static int32_t t54 = -120;
t54 = (x1597-((x1598==x1599)>>x1600));
if (t54 != -1) { NG(); } else { ; }
}
void f55(void) {
volatile int16_t x1601 = 12237;
int32_t x1602 = INT32_MAX;
volatile int8_t x1603 = 0;
int16_t x1604 = 0;
volatile int32_t t55 = -844155802;
t55 = (x1601-((x1602==x1603)>>x1604));
if (t55 != 12237) { NG(); } else { ; }
}
void f56(void) {
uint8_t x1609 = 12U;
int32_t x1611 = 0;
uint8_t x1612 = 3U;
volatile int32_t t56 = 924999;
t56 = (x1609-((x1610==x1611)>>x1612));
if (t56 != 12) { NG(); } else { ; }
}
void f57(void) {
static uint8_t x1613 = UINT8_MAX;
uint64_t x1614 = 14047113397473661LLU;
volatile uint64_t x1615 = 1927LLU;
uint16_t x1616 = 3U;
static volatile int32_t t57 = -21920;
t57 = (x1613-((x1614==x1615)>>x1616));
if (t57 != 255) { NG(); } else { ; }
}
void f58(void) {
int8_t x1626 = -5;
int64_t x1627 = 13093LL;
uint8_t x1628 = 2U;
t58 = (x1625-((x1626==x1627)>>x1628));
if (t58 != 3LLU) { NG(); } else { ; }
}
void f59(void) {
uint16_t x1669 = UINT16_MAX;
static int8_t x1671 = INT8_MIN;
int32_t t59 = 14194;
t59 = (x1669-((x1670==x1671)>>x1672));
if (t59 != 65535) { NG(); } else { ; }
}
void f60(void) {
static uint8_t x1690 = UINT8_MAX;
int32_t x1691 = INT32_MAX;
uint8_t x1692 = 0U;
volatile int64_t t60 = 10701712012900LL;
t60 = (x1689-((x1690==x1691)>>x1692));
if (t60 != 3713LL) { NG(); } else { ; }
}
void f61(void) {
uint8_t x1706 = UINT8_MAX;
int8_t x1707 = -7;
int8_t x1708 = 2;
t61 = (x1705-((x1706==x1707)>>x1708));
if (t61 != -128) { NG(); } else { ; }
}
void f62(void) {
uint32_t x1725 = 386227272U;
uint64_t x1726 = 0LLU;
int64_t x1727 = INT64_MAX;
volatile int16_t x1728 = 0;
t62 = (x1725-((x1726==x1727)>>x1728));
if (t62 != 386227272U) { NG(); } else { ; }
}
void f63(void) {
volatile int32_t x1753 = 15825;
int64_t x1754 = -1LL;
uint8_t x1755 = 27U;
volatile int8_t x1756 = 1;
volatile int32_t t63 = -25415;
t63 = (x1753-((x1754==x1755)>>x1756));
if (t63 != 15825) { NG(); } else { ; }
}
void f64(void) {
int32_t x1833 = -1;
int64_t x1834 = 4031LL;
volatile int8_t x1836 = 28;
volatile int32_t t64 = -4073;
t64 = (x1833-((x1834==x1835)>>x1836));
if (t64 != -1) { NG(); } else { ; }
}
void f65(void) {
static volatile int16_t x1905 = INT16_MIN;
uint16_t x1906 = 30U;
int64_t x1908 = 11LL;
static int32_t t65 = -90667074;
t65 = (x1905-((x1906==x1907)>>x1908));
if (t65 != -32768) { NG(); } else { ; }
}
void f66(void) {
int64_t t66 = INT64_MIN;
t66 = (x1937-((x1938==x1939)>>x1940));
if (t66 != INT64_MIN) { NG(); } else { ; }
}
void f67(void) {
int32_t x2021 = INT32_MAX;
volatile uint16_t x2023 = 869U;
uint8_t x2024 = 0U;
volatile int32_t t67 = INT32_MAX;
t67 = (x2021-((x2022==x2023)>>x2024));
if (t67 != INT32_MAX) { NG(); } else { ; }
}
void f68(void) {
int32_t x2045 = 51;
int32_t x2047 = -1;
volatile int8_t x2048 = 0;
volatile int32_t t68 = 189572;
t68 = (x2045-((x2046==x2047)>>x2048));
if (t68 != 51) { NG(); } else { ; }
}
void f69(void) {
int32_t x2066 = -1;
int64_t x2067 = INT64_MIN;
static uint8_t x2068 = 0U;
static int64_t t69 = -24058791118LL;
t69 = (x2065-((x2066==x2067)>>x2068));
if (t69 != -1LL) { NG(); } else { ; }
}
void f70(void) {
volatile uint32_t x2069 = UINT32_MAX;
int32_t x2070 = INT32_MIN;
volatile int32_t x2071 = -4172970;
uint32_t x2072 = 3U;
volatile uint32_t t70 = UINT32_MAX;
t70 = (x2069-((x2070==x2071)>>x2072));
if (t70 != UINT32_MAX) { NG(); } else { ; }
}
void f71(void) {
int64_t x2113 = INT64_MIN;
static int32_t x2114 = 7732;
int64_t x2115 = INT64_MIN;
volatile uint8_t x2116 = 0U;
t71 = (x2113-((x2114==x2115)>>x2116));
if (t71 != INT64_MIN) { NG(); } else { ; }
}
void f72(void) {
volatile int64_t x2119 = -1LL;
static int32_t x2120 = 4;
t72 = (x2117-((x2118==x2119)>>x2120));
if (t72 != -16337) { NG(); } else { ; }
}
void f73(void) {
volatile int64_t x2133 = -1LL;
uint8_t x2134 = 4U;
static uint32_t x2135 = UINT32_MAX;
uint64_t x2136 = 10LLU;
t73 = (x2133-((x2134==x2135)>>x2136));
if (t73 != -1LL) { NG(); } else { ; }
}
void f74(void) {
volatile int8_t x2137 = -1;
int8_t x2138 = INT8_MAX;
uint16_t x2140 = 5U;
volatile int32_t t74 = -2;
t74 = (x2137-((x2138==x2139)>>x2140));
if (t74 != -1) { NG(); } else { ; }
}
void f75(void) {
static int16_t x2309 = INT16_MIN;
int32_t x2310 = INT32_MAX;
static int16_t x2311 = -1;
int8_t x2312 = 16;
int32_t t75 = -270;
t75 = (x2309-((x2310==x2311)>>x2312));
if (t75 != -32768) { NG(); } else { ; }
}
void f76(void) {
int32_t x2349 = 18874;
static int8_t x2350 = INT8_MAX;
int16_t x2351 = INT16_MIN;
int8_t x2352 = 0;
t76 = (x2349-((x2350==x2351)>>x2352));
if (t76 != 18874) { NG(); } else { ; }
}
void f77(void) {
uint8_t x2385 = UINT8_MAX;
uint16_t x2386 = 25U;
uint32_t x2387 = 121U;
static volatile int16_t x2388 = 0;
static int32_t t77 = -120583239;
t77 = (x2385-((x2386==x2387)>>x2388));
if (t77 != 255) { NG(); } else { ; }
}
void f78(void) {
int8_t x2397 = INT8_MAX;
int8_t x2398 = INT8_MIN;
static int32_t x2399 = INT32_MAX;
volatile int32_t t78 = 0;
t78 = (x2397-((x2398==x2399)>>x2400));
if (t78 != 127) { NG(); } else { ; }
}
void f79(void) {
uint8_t x2413 = 90U;
volatile int16_t x2414 = INT16_MIN;
int32_t x2415 = INT32_MIN;
int32_t t79 = 36738328;
t79 = (x2413-((x2414==x2415)>>x2416));
if (t79 != 90) { NG(); } else { ; }
}
void f80(void) {
int64_t x2554 = -1LL;
int64_t x2555 = INT64_MIN;
volatile int32_t t80 = -97168857;
t80 = (x2553-((x2554==x2555)>>x2556));
if (t80 != 255) { NG(); } else { ; }
}
void f81(void) {
volatile int8_t x2557 = -1;
static uint8_t x2559 = 31U;
uint16_t x2560 = 1U;
int32_t t81 = -5708;
t81 = (x2557-((x2558==x2559)>>x2560));
if (t81 != -1) { NG(); } else { ; }
}
void f82(void) {
volatile int64_t x2566 = -1910LL;
volatile uint8_t x2567 = 40U;
int8_t x2568 = 1;
volatile uint32_t t82 = UINT32_MAX;
t82 = (x2565-((x2566==x2567)>>x2568));
if (t82 != UINT32_MAX) { NG(); } else { ; }
}
void f83(void) {
static int32_t x2574 = INT32_MIN;
volatile int64_t x2575 = INT64_MIN;
int64_t t83 = -31633LL;
t83 = (x2573-((x2574==x2575)>>x2576));
if (t83 != -1LL) { NG(); } else { ; }
}
void f84(void) {
uint16_t x2578 = 7U;
int8_t x2579 = 19;
t84 = (x2577-((x2578==x2579)>>x2580));
if (t84 != 8370439247881245LL) { NG(); } else { ; }
}
void f85(void) {
uint16_t x2602 = UINT16_MAX;
uint64_t x2603 = 0LLU;
volatile uint8_t x2604 = 6U;
volatile int32_t t85 = -7;
t85 = (x2601-((x2602==x2603)>>x2604));
if (t85 != -1) { NG(); } else { ; }
}
void f86(void) {
int8_t x2649 = INT8_MIN;
volatile uint8_t x2650 = 23U;
int32_t x2651 = -1781230;
int8_t x2652 = 2;
volatile int32_t t86 = 279502;
t86 = (x2649-((x2650==x2651)>>x2652));
if (t86 != -128) { NG(); } else { ; }
}
void f87(void) {
int16_t x2666 = INT16_MAX;
static int32_t x2667 = INT32_MIN;
uint32_t x2668 = 14U;
t87 = (x2665-((x2666==x2667)>>x2668));
if (t87 != -1) { NG(); } else { ; }
}
void f88(void) {
int32_t x2722 = INT32_MIN;
static uint8_t x2723 = 13U;
uint8_t x2724 = 7U;
int32_t t88 = -7;
t88 = (x2721-((x2722==x2723)>>x2724));
if (t88 != -1) { NG(); } else { ; }
}
void f89(void) {
int32_t x2773 = -396182493;
volatile uint16_t x2774 = UINT16_MAX;
int64_t x2775 = INT64_MAX;
int8_t x2776 = 0;
t89 = (x2773-((x2774==x2775)>>x2776));
if (t89 != -396182493) { NG(); } else { ; }
}
void f90(void) {
int8_t x2801 = INT8_MAX;
volatile uint64_t x2803 = UINT64_MAX;
static uint8_t x2804 = 1U;
volatile int32_t t90 = 475650844;
t90 = (x2801-((x2802==x2803)>>x2804));
if (t90 != 127) { NG(); } else { ; }
}
void f91(void) {
int32_t x2817 = -2014295;
int64_t x2819 = INT64_MIN;
int8_t x2820 = 2;
volatile int32_t t91 = 8132878;
t91 = (x2817-((x2818==x2819)>>x2820));
if (t91 != -2014295) { NG(); } else { ; }
}
void f92(void) {
int32_t x2822 = INT32_MIN;
static int32_t t92 = -328089116;
t92 = (x2821-((x2822==x2823)>>x2824));
if (t92 != 4) { NG(); } else { ; }
}
void f93(void) {
int32_t x2825 = INT32_MIN;
uint8_t x2826 = 7U;
static volatile uint8_t x2828 = 0U;
volatile int32_t t93 = INT32_MIN;
t93 = (x2825-((x2826==x2827)>>x2828));
if (t93 != INT32_MIN) { NG(); } else { ; }
}
void f94(void) {
int64_t x2829 = INT64_MIN;
int16_t x2830 = INT16_MIN;
int32_t x2831 = -1;
static volatile uint8_t x2832 = 1U;
t94 = (x2829-((x2830==x2831)>>x2832));
if (t94 != INT64_MIN) { NG(); } else { ; }
}
void f95(void) {
uint64_t x2873 = UINT64_MAX;
int32_t x2874 = -1;
int32_t x2875 = INT32_MIN;
static int8_t x2876 = 8;
t95 = (x2873-((x2874==x2875)>>x2876));
if (t95 != UINT64_MAX) { NG(); } else { ; }
}
void f96(void) {
int16_t x2881 = 4;
static int64_t x2883 = -1LL;
volatile uint8_t x2884 = 11U;
int32_t t96 = -133164148;
t96 = (x2881-((x2882==x2883)>>x2884));
if (t96 != 4) { NG(); } else { ; }
}
void f97(void) {
static int8_t x2909 = INT8_MIN;
uint64_t x2910 = UINT64_MAX;
static uint32_t x2912 = 8U;
volatile int32_t t97 = 17;
t97 = (x2909-((x2910==x2911)>>x2912));
if (t97 != -128) { NG(); } else { ; }
}
void f98(void) {
static int64_t x2915 = -3102757334810567798LL;
int8_t x2916 = 0;
t98 = (x2913-((x2914==x2915)>>x2916));
if (t98 != -128) { NG(); } else { ; }
}
void f99(void) {
int32_t x3009 = -1;
int32_t x3010 = INT32_MIN;
uint8_t x3011 = 2U;
static uint8_t x3012 = 1U;
volatile int32_t t99 = 962890;
t99 = (x3009-((x3010==x3011)>>x3012));
if (t99 != -1) { NG(); } else { ; }
}
void f100(void) {
int64_t x3013 = 103757619787LL;
int32_t x3014 = 631179510;
uint32_t x3015 = 5464142U;
static int32_t x3016 = 0;
static int64_t t100 = -5LL;
t100 = (x3013-((x3014==x3015)>>x3016));
if (t100 != 103757619787LL) { NG(); } else { ; }
}
void f101(void) {
uint64_t x3073 = 41324397768989410LLU;
int64_t x3074 = 223154428064107LL;
int8_t x3075 = INT8_MIN;
static volatile uint64_t t101 = 2157675333236338LLU;
t101 = (x3073-((x3074==x3075)>>x3076));
if (t101 != 41324397768989410LLU) { NG(); } else { ; }
}
void f102(void) {
int32_t x3086 = INT32_MIN;
int32_t x3087 = INT32_MAX;
static uint16_t x3088 = 3U;
int32_t t102 = 28;
t102 = (x3085-((x3086==x3087)>>x3088));
if (t102 != -57) { NG(); } else { ; }
}
void f103(void) {
uint32_t x3133 = 3U;
int32_t x3134 = -1;
volatile int64_t x3135 = -58960LL;
static int8_t x3136 = 9;
uint32_t t103 = 420066495U;
t103 = (x3133-((x3134==x3135)>>x3136));
if (t103 != 3U) { NG(); } else { ; }
}
void f104(void) {
int64_t x3141 = -1657083690LL;
volatile uint64_t x3142 = UINT64_MAX;
volatile int8_t x3143 = INT8_MAX;
int8_t x3144 = 1;
int64_t t104 = 2142591707LL;
t104 = (x3141-((x3142==x3143)>>x3144));
if (t104 != -1657083690LL) { NG(); } else { ; }
}
void f105(void) {
volatile uint32_t x3153 = 692441849U;
static volatile uint16_t x3154 = UINT16_MAX;
uint8_t x3156 = 1U;
t105 = (x3153-((x3154==x3155)>>x3156));
if (t105 != 692441849U) { NG(); } else { ; }
}
void f106(void) {
static uint8_t x3169 = UINT8_MAX;
static uint8_t x3170 = 33U;
volatile uint8_t x3171 = UINT8_MAX;
volatile uint8_t x3172 = 4U;
volatile int32_t t106 = 16121551;
t106 = (x3169-((x3170==x3171)>>x3172));
if (t106 != 255) { NG(); } else { ; }
}
void f107(void) {
volatile int64_t x3178 = INT64_MIN;
int8_t x3180 = 1;
volatile int64_t t107 = INT64_MAX;
t107 = (x3177-((x3178==x3179)>>x3180));
if (t107 != INT64_MAX) { NG(); } else { ; }
}
void f108(void) {
int8_t x3205 = 1;
static volatile int8_t x3207 = -1;
volatile uint8_t x3208 = 3U;
int32_t t108 = 1885;
t108 = (x3205-((x3206==x3207)>>x3208));
if (t108 != 1) { NG(); } else { ; }
}
void f109(void) {
volatile uint32_t x3226 = 265655262U;
int64_t x3227 = 1805756LL;
uint16_t x3228 = 30U;
static int64_t t109 = INT64_MIN;
t109 = (x3225-((x3226==x3227)>>x3228));
if (t109 != INT64_MIN) { NG(); } else { ; }
}
void f110(void) {
uint8_t x3325 = 0U;
volatile int8_t x3326 = INT8_MIN;
int32_t x3327 = 14560339;
volatile int8_t x3328 = 0;
int32_t t110 = -12475310;
t110 = (x3325-((x3326==x3327)>>x3328));
if (t110 != 0) { NG(); } else { ; }
}
void f111(void) {
volatile int64_t x3337 = INT64_MIN;
int64_t x3338 = INT64_MAX;
int16_t x3339 = INT16_MIN;
uint16_t x3340 = 7U;
int64_t t111 = INT64_MIN;
t111 = (x3337-((x3338==x3339)>>x3340));
if (t111 != INT64_MIN) { NG(); } else { ; }
}
void f112(void) {
volatile int64_t x3369 = -3254177862891804628LL;
int32_t x3371 = INT32_MIN;
int16_t x3372 = 1;
volatile int64_t t112 = -40690LL;
t112 = (x3369-((x3370==x3371)>>x3372));
if (t112 != -3254177862891804628LL) { NG(); } else { ; }
}
void f113(void) {
static int32_t x3409 = 454160278;
static int8_t x3411 = -10;
volatile int32_t t113 = -2654245;
t113 = (x3409-((x3410==x3411)>>x3412));
if (t113 != 454160278) { NG(); } else { ; }
}
void f114(void) {
uint16_t x3417 = 1480U;
uint8_t x3418 = 99U;
uint32_t x3419 = 6188579U;
uint32_t x3420 = 1U;
t114 = (x3417-((x3418==x3419)>>x3420));
if (t114 != 1480) { NG(); } else { ; }
}
void f115(void) {
static uint32_t x3449 = UINT32_MAX;
volatile int16_t x3451 = INT16_MAX;
static uint64_t x3452 = 1LLU;
uint32_t t115 = UINT32_MAX;
t115 = (x3449-((x3450==x3451)>>x3452));
if (t115 != UINT32_MAX) { NG(); } else { ; }
}
void f116(void) {
uint8_t x3466 = UINT8_MAX;
int64_t x3467 = -1111LL;
int64_t x3468 = 13LL;
t116 = (x3465-((x3466==x3467)>>x3468));
if (t116 != INT32_MAX) { NG(); } else { ; }
}
void f117(void) {
int16_t x3485 = INT16_MIN;
int32_t x3486 = -1;
static int16_t x3487 = -1;
uint8_t x3488 = 30U;
int32_t t117 = -3241;
t117 = (x3485-((x3486==x3487)>>x3488));
if (t117 != -32768) { NG(); } else { ; }
}
void f118(void) {
static volatile uint8_t x3565 = 11U;
volatile uint16_t x3566 = 35U;
static volatile int16_t x3567 = INT16_MIN;
int64_t x3568 = 0LL;
static volatile int32_t t118 = 12;
t118 = (x3565-((x3566==x3567)>>x3568));
if (t118 != 11) { NG(); } else { ; }
}
void f119(void) {
int16_t x3634 = INT16_MIN;
uint8_t x3636 = 17U;
int32_t t119 = -254943383;
t119 = (x3633-((x3634==x3635)>>x3636));
if (t119 != -128) { NG(); } else { ; }
}
void f120(void) {
int64_t x3641 = INT64_MIN;
static int64_t x3642 = 4038LL;
uint64_t x3643 = 7219LLU;
volatile int64_t x3644 = 30LL;
volatile int64_t t120 = INT64_MIN;
t120 = (x3641-((x3642==x3643)>>x3644));
if (t120 != INT64_MIN) { NG(); } else { ; }
}
void f121(void) {
int8_t x3649 = -1;
uint16_t x3650 = UINT16_MAX;
t121 = (x3649-((x3650==x3651)>>x3652));
if (t121 != -1) { NG(); } else { ; }
}
void f122(void) {
volatile int64_t x3721 = -24LL;
uint16_t x3722 = 58U;
static volatile uint8_t x3724 = 13U;
t122 = (x3721-((x3722==x3723)>>x3724));
if (t122 != -24LL) { NG(); } else { ; }
}
void f123(void) {
volatile uint8_t x3755 = UINT8_MAX;
volatile int32_t t123 = 46;
t123 = (x3753-((x3754==x3755)>>x3756));
if (t123 != -32768) { NG(); } else { ; }
}
void f124(void) {
int8_t x3767 = INT8_MIN;
uint8_t x3768 = 3U;
static int64_t t124 = INT64_MIN;
t124 = (x3765-((x3766==x3767)>>x3768));
if (t124 != INT64_MIN) { NG(); } else { ; }
}
void f125(void) {
int8_t x3794 = 1;
int64_t x3795 = 2393LL;
volatile uint32_t x3796 = 14U;
uint32_t t125 = 105650807U;
t125 = (x3793-((x3794==x3795)>>x3796));
if (t125 != 3569U) { NG(); } else { ; }
}
void f126(void) {
static int32_t x3797 = INT32_MIN;
static volatile int16_t x3798 = INT16_MAX;
volatile uint8_t x3799 = 0U;
static volatile uint8_t x3800 = 1U;
volatile int32_t t126 = INT32_MIN;
t126 = (x3797-((x3798==x3799)>>x3800));
if (t126 != INT32_MIN) { NG(); } else { ; }
}
void f127(void) {
static uint32_t x3805 = 32254153U;
uint32_t x3806 = 96U;
static int32_t x3807 = -3;
static uint64_t x3808 = 7LLU;
volatile uint32_t t127 = 41U;
t127 = (x3805-((x3806==x3807)>>x3808));
if (t127 != 32254153U) { NG(); } else { ; }
}
void f128(void) {
int8_t x3809 = 0;
static volatile int8_t x3810 = 5;
uint64_t x3811 = 5323LLU;
static int8_t x3812 = 1;
t128 = (x3809-((x3810==x3811)>>x3812));
if (t128 != 0) { NG(); } else { ; }
}
void f129(void) {
volatile int64_t x3885 = INT64_MIN;
uint64_t x3886 = 100024567LLU;
static volatile int8_t x3887 = 36;
volatile int64_t t129 = INT64_MIN;
t129 = (x3885-((x3886==x3887)>>x3888));
if (t129 != INT64_MIN) { NG(); } else { ; }
}
void f130(void) {
int32_t x3905 = INT32_MIN;
uint16_t x3907 = 0U;
uint8_t x3908 = 4U;
int32_t t130 = INT32_MIN;
t130 = (x3905-((x3906==x3907)>>x3908));
if (t130 != INT32_MIN) { NG(); } else { ; }
}
void f131(void) {
static int8_t x3925 = INT8_MIN;
uint8_t x3928 = 9U;
t131 = (x3925-((x3926==x3927)>>x3928));
if (t131 != -128) { NG(); } else { ; }
}
void f132(void) {
int32_t x3981 = INT32_MIN;
uint64_t x3982 = 48100469267LLU;
uint8_t x3983 = UINT8_MAX;
volatile int32_t t132 = INT32_MIN;
t132 = (x3981-((x3982==x3983)>>x3984));
if (t132 != INT32_MIN) { NG(); } else { ; }
}
void f133(void) {
uint16_t x4029 = 680U;
uint8_t x4030 = UINT8_MAX;
static uint8_t x4032 = 5U;
t133 = (x4029-((x4030==x4031)>>x4032));
if (t133 != 680) { NG(); } else { ; }
}
void f134(void) {
int64_t x4042 = -7919071179940046LL;
uint16_t x4043 = UINT16_MAX;
uint16_t x4044 = 1U;
static volatile int64_t t134 = INT64_MIN;
t134 = (x4041-((x4042==x4043)>>x4044));
if (t134 != INT64_MIN) { NG(); } else { ; }
}
void f135(void) {
int16_t x4057 = -1;
uint16_t x4058 = UINT16_MAX;
int32_t x4059 = INT32_MIN;
uint16_t x4060 = 2U;
volatile int32_t t135 = 1134327;
t135 = (x4057-((x4058==x4059)>>x4060));
if (t135 != -1) { NG(); } else { ; }
}
void f136(void) {
uint64_t x4109 = 3544932258416618LLU;
static int8_t x4111 = 0;
int16_t x4112 = 0;
uint64_t t136 = 5317803834756421LLU;
t136 = (x4109-((x4110==x4111)>>x4112));
if (t136 != 3544932258416618LLU) { NG(); } else { ; }
}
void f137(void) {
int64_t x4165 = INT64_MAX;
int16_t x4166 = -1;
int32_t x4167 = -8147004;
static int8_t x4168 = 2;
volatile int64_t t137 = INT64_MAX;
t137 = (x4165-((x4166==x4167)>>x4168));
if (t137 != INT64_MAX) { NG(); } else { ; }
}
void f138(void) {
volatile uint16_t x4201 = 9U;
uint64_t x4202 = UINT64_MAX;
int64_t x4203 = INT64_MAX;
uint32_t x4204 = 0U;
t138 = (x4201-((x4202==x4203)>>x4204));
if (t138 != 9) { NG(); } else { ; }
}
void f139(void) {
static int64_t x4249 = -1408003663210881LL;
static int64_t x4250 = INT64_MIN;
uint8_t x4252 = 1U;
volatile int64_t t139 = 6342580785409LL;
t139 = (x4249-((x4250==x4251)>>x4252));
if (t139 != -1408003663210881LL) { NG(); } else { ; }
}
void f140(void) {
static uint32_t x4265 = 245266U;
int16_t x4266 = INT16_MIN;
int64_t x4267 = INT64_MIN;
uint8_t x4268 = 1U;
volatile uint32_t t140 = 40507438U;
t140 = (x4265-((x4266==x4267)>>x4268));
if (t140 != 245266U) { NG(); } else { ; }
}
void f141(void) {
uint8_t x4325 = 31U;
uint32_t x4326 = 21464U;
uint8_t x4327 = 2U;
uint16_t x4328 = 28U;
int32_t t141 = -27;
t141 = (x4325-((x4326==x4327)>>x4328));
if (t141 != 31) { NG(); } else { ; }
}
void f142(void) {
volatile int64_t x4349 = -1025994547LL;
volatile int32_t x4350 = INT32_MIN;
volatile uint8_t x4352 = 2U;
int64_t t142 = 301217LL;
t142 = (x4349-((x4350==x4351)>>x4352));
if (t142 != -1025994547LL) { NG(); } else { ; }
}
void f143(void) {
int8_t x4361 = -1;
static uint64_t x4364 = 13LLU;
static volatile int32_t t143 = -785483;
t143 = (x4361-((x4362==x4363)>>x4364));
if (t143 != -1) { NG(); } else { ; }
}
void f144(void) {
volatile uint64_t x4409 = 29576202LLU;
uint64_t x4410 = UINT64_MAX;
int64_t x4411 = 15046185LL;
volatile int8_t x4412 = 11;
uint64_t t144 = 2112949102LLU;
t144 = (x4409-((x4410==x4411)>>x4412));
if (t144 != 29576202LLU) { NG(); } else { ; }
}
void f145(void) {
int64_t x4413 = INT64_MAX;
int64_t x4414 = -2019LL;
uint8_t x4416 = 31U;
int64_t t145 = INT64_MAX;
t145 = (x4413-((x4414==x4415)>>x4416));
if (t145 != INT64_MAX) { NG(); } else { ; }
}
void f146(void) {
volatile int32_t x4421 = INT32_MIN;
int32_t x4422 = INT32_MIN;
int8_t x4423 = INT8_MIN;
static uint64_t x4424 = 1LLU;
t146 = (x4421-((x4422==x4423)>>x4424));
if (t146 != INT32_MIN) { NG(); } else { ; }
}
void f147(void) {
static uint16_t x4466 = 26U;
static uint64_t x4467 = 2LLU;
t147 = (x4465-((x4466==x4467)>>x4468));
if (t147 != -128) { NG(); } else { ; }
}
void f148(void) {
volatile int64_t x4566 = INT64_MAX;
volatile uint32_t x4568 = 1U;
static int32_t t148 = -2134215;
t148 = (x4565-((x4566==x4567)>>x4568));
if (t148 != 65535) { NG(); } else { ; }
}
void f149(void) {
volatile int8_t x4581 = INT8_MAX;
uint64_t x4583 = UINT64_MAX;
static int32_t t149 = -4322059;
t149 = (x4581-((x4582==x4583)>>x4584));
if (t149 != 127) { NG(); } else { ; }
}
void f150(void) {
uint64_t x4621 = 631487339LLU;
static int8_t x4622 = 1;
int8_t x4623 = INT8_MIN;
int16_t x4624 = 5;
t150 = (x4621-((x4622==x4623)>>x4624));
if (t150 != 631487339LLU) { NG(); } else { ; }
}
void f151(void) {
uint64_t x4701 = 3324271482323LLU;
uint64_t x4702 = UINT64_MAX;
int16_t x4703 = 1;
int8_t x4704 = 0;
uint64_t t151 = 2137238084222LLU;
t151 = (x4701-((x4702==x4703)>>x4704));
if (t151 != 3324271482323LLU) { NG(); } else { ; }
}
void f152(void) {
int32_t x4725 = -1;
uint16_t x4726 = 9U;
uint32_t x4727 = 25169U;
int16_t x4728 = 1;
static int32_t t152 = 255570273;
t152 = (x4725-((x4726==x4727)>>x4728));
if (t152 != -1) { NG(); } else { ; }
}
void f153(void) {
int64_t x4729 = INT64_MIN;
uint32_t x4730 = 82591060U;
volatile uint32_t x4731 = 8005290U;
int8_t x4732 = 11;
int64_t t153 = INT64_MIN;
t153 = (x4729-((x4730==x4731)>>x4732));
if (t153 != INT64_MIN) { NG(); } else { ; }
}
void f154(void) {
int32_t x4765 = INT32_MIN;
int16_t x4766 = INT16_MIN;
int32_t t154 = INT32_MIN;
t154 = (x4765-((x4766==x4767)>>x4768));
if (t154 != INT32_MIN) { NG(); } else { ; }
}
void f155(void) {
int8_t x4785 = -10;
int8_t x4787 = INT8_MIN;
t155 = (x4785-((x4786==x4787)>>x4788));
if (t155 != -10) { NG(); } else { ; }
}
void f156(void) {
int8_t x4797 = -1;
int32_t x4798 = INT32_MIN;
volatile uint16_t x4799 = UINT16_MAX;
uint8_t x4800 = 4U;
volatile int32_t t156 = 9896;
t156 = (x4797-((x4798==x4799)>>x4800));
if (t156 != -1) { NG(); } else { ; }
}
void f157(void) {
int8_t x4821 = -1;
int8_t x4822 = INT8_MIN;
uint32_t x4823 = UINT32_MAX;
int32_t x4824 = 7;
volatile int32_t t157 = 313619092;
t157 = (x4821-((x4822==x4823)>>x4824));
if (t157 != -1) { NG(); } else { ; }
}
void f158(void) {
uint32_t x4866 = 0U;
int32_t x4867 = INT32_MIN;
int8_t x4868 = 1;
static uint64_t t158 = 3876366032422474LLU;
t158 = (x4865-((x4866==x4867)>>x4868));
if (t158 != 5244LLU) { NG(); } else { ; }
}
void f159(void) {
int32_t x4897 = INT32_MIN;
volatile int32_t t159 = INT32_MIN;
t159 = (x4897-((x4898==x4899)>>x4900));
if (t159 != INT32_MIN) { NG(); } else { ; }
}
void f160(void) {
volatile int32_t x4957 = 217;
int8_t x4959 = 0;
uint8_t x4960 = 1U;
volatile int32_t t160 = 0;
t160 = (x4957-((x4958==x4959)>>x4960));
if (t160 != 217) { NG(); } else { ; }
}
void f161(void) {
static int16_t x4965 = INT16_MIN;
int16_t x4966 = -1;
int16_t x4967 = INT16_MIN;
uint8_t x4968 = 25U;
static volatile int32_t t161 = -1;
t161 = (x4965-((x4966==x4967)>>x4968));
if (t161 != -32768) { NG(); } else { ; }
}
void f162(void) {
static int32_t x5105 = -1;
uint64_t x5107 = 69717362363LLU;
static volatile uint8_t x5108 = 10U;
volatile int32_t t162 = 118330235;
t162 = (x5105-((x5106==x5107)>>x5108));
if (t162 != -1) { NG(); } else { ; }
}
void f163(void) {
volatile uint16_t x5125 = UINT16_MAX;
uint16_t x5126 = 172U;
int8_t x5127 = INT8_MIN;
int8_t x5128 = 29;
int32_t t163 = 1;
t163 = (x5125-((x5126==x5127)>>x5128));
if (t163 != 65535) { NG(); } else { ; }
}
void f164(void) {
uint8_t x5138 = 41U;
int16_t x5139 = INT16_MAX;
int8_t x5140 = 9;
uint64_t t164 = 1505LLU;
t164 = (x5137-((x5138==x5139)>>x5140));
if (t164 != 235LLU) { NG(); } else { ; }
}
void f165(void) {
int32_t x5165 = INT32_MIN;
volatile uint8_t x5168 = 0U;
static volatile int32_t t165 = INT32_MIN;
t165 = (x5165-((x5166==x5167)>>x5168));
if (t165 != INT32_MIN) { NG(); } else { ; }
}
void f166(void) {
uint16_t x5213 = 0U;
static uint8_t x5214 = 4U;
volatile uint16_t x5215 = 14U;
uint8_t x5216 = 1U;
t166 = (x5213-((x5214==x5215)>>x5216));
if (t166 != 0) { NG(); } else { ; }
}
void f167(void) {
uint32_t x5217 = 765464U;
volatile int64_t x5220 = 26LL;
volatile uint32_t t167 = 16850U;
t167 = (x5217-((x5218==x5219)>>x5220));
if (t167 != 765464U) { NG(); } else { ; }
}
void f168(void) {
int16_t x5261 = 152;
int64_t x5263 = INT64_MIN;
volatile uint16_t x5264 = 13U;
int32_t t168 = -384;
t168 = (x5261-((x5262==x5263)>>x5264));
if (t168 != 152) { NG(); } else { ; }
}
void f169(void) {
int32_t x5281 = INT32_MIN;
volatile int16_t x5282 = 1476;
int32_t x5283 = INT32_MAX;
int32_t x5284 = 13;
volatile int32_t t169 = INT32_MIN;
t169 = (x5281-((x5282==x5283)>>x5284));
if (t169 != INT32_MIN) { NG(); } else { ; }
}
void f170(void) {
static int8_t x5297 = INT8_MIN;
int8_t x5298 = INT8_MAX;
uint16_t x5300 = 1U;
int32_t t170 = 11223957;
t170 = (x5297-((x5298==x5299)>>x5300));
if (t170 != -128) { NG(); } else { ; }
}
void f171(void) {
static volatile int8_t x5313 = INT8_MIN;
int8_t x5314 = 6;
int32_t x5315 = 1;
volatile int32_t x5316 = 11;
volatile int32_t t171 = -27963;
t171 = (x5313-((x5314==x5315)>>x5316));
if (t171 != -128) { NG(); } else { ; }
}
void f172(void) {
static uint8_t x5341 = UINT8_MAX;
int8_t x5342 = INT8_MIN;
volatile int8_t x5343 = INT8_MAX;
static int32_t x5344 = 2;
static volatile int32_t t172 = 110958110;
t172 = (x5341-((x5342==x5343)>>x5344));
if (t172 != 255) { NG(); } else { ; }
}
void f173(void) {
int16_t x5454 = -1;
volatile int32_t t173 = -4;
t173 = (x5453-((x5454==x5455)>>x5456));
if (t173 != 127) { NG(); } else { ; }
}
void f174(void) {
static int8_t x5560 = 0;
volatile int32_t t174 = -179712;
t174 = (x5557-((x5558==x5559)>>x5560));
if (t174 != 60240218) { NG(); } else { ; }
}
void f175(void) {
volatile int64_t x5625 = INT64_MIN;
int8_t x5626 = INT8_MAX;
int16_t x5627 = INT16_MIN;
static int64_t t175 = INT64_MIN;
t175 = (x5625-((x5626==x5627)>>x5628));
if (t175 != INT64_MIN) { NG(); } else { ; }
}
void f176(void) {
static uint32_t x5649 = 749349U;
uint8_t x5652 = 0U;
volatile uint32_t t176 = 79U;
t176 = (x5649-((x5650==x5651)>>x5652));
if (t176 != 749349U) { NG(); } else { ; }
}
void f177(void) {
int32_t x5653 = -2295;
uint32_t x5654 = 23694620U;
int16_t x5655 = 147;
uint8_t x5656 = 0U;
static volatile int32_t t177 = 4;
t177 = (x5653-((x5654==x5655)>>x5656));
if (t177 != -2295) { NG(); } else { ; }
}
void f178(void) {
static int16_t x5697 = -116;
static volatile uint8_t x5698 = UINT8_MAX;
volatile int16_t x5699 = -12;
volatile int32_t t178 = 2716007;
t178 = (x5697-((x5698==x5699)>>x5700));
if (t178 != -116) { NG(); } else { ; }
}
void f179(void) {
int8_t x5709 = INT8_MIN;
uint32_t x5710 = 1316070925U;
volatile uint32_t x5711 = 50U;
uint8_t x5712 = 21U;
static int32_t t179 = 6;
t179 = (x5709-((x5710==x5711)>>x5712));
if (t179 != -128) { NG(); } else { ; }
}
void f180(void) {
int8_t x5713 = INT8_MAX;
static volatile int32_t t180 = -35;
t180 = (x5713-((x5714==x5715)>>x5716));
if (t180 != 127) { NG(); } else { ; }
}
void f181(void) {
int8_t x5722 = INT8_MIN;
int8_t x5723 = -24;
uint8_t x5724 = 7U;
static volatile int32_t t181 = -297067125;
t181 = (x5721-((x5722==x5723)>>x5724));
if (t181 != -171834) { NG(); } else { ; }
}
void f182(void) {
volatile int64_t x5725 = INT64_MAX;
volatile int32_t x5726 = INT32_MIN;
int32_t x5728 = 3;
int64_t t182 = INT64_MAX;
t182 = (x5725-((x5726==x5727)>>x5728));
if (t182 != INT64_MAX) { NG(); } else { ; }
}
void f183(void) {
volatile int8_t x5757 = -61;
int64_t x5758 = INT64_MIN;
volatile uint16_t x5759 = UINT16_MAX;
volatile int32_t t183 = -64494;
t183 = (x5757-((x5758==x5759)>>x5760));
if (t183 != -61) { NG(); } else { ; }
}
void f184(void) {
volatile int64_t x5765 = INT64_MIN;
int64_t x5766 = -3LL;
int8_t x5767 = INT8_MIN;
t184 = (x5765-((x5766==x5767)>>x5768));
if (t184 != INT64_MIN) { NG(); } else { ; }
}
void f185(void) {
int16_t x5782 = -4959;
uint64_t x5783 = 3681LLU;
int16_t x5784 = 2;
static volatile int32_t t185 = -3;
t185 = (x5781-((x5782==x5783)>>x5784));
if (t185 != 32767) { NG(); } else { ; }
}
void f186(void) {
volatile int32_t x5813 = INT32_MIN;
int32_t x5815 = -1;
static int16_t x5816 = 1;
int32_t t186 = INT32_MIN;
t186 = (x5813-((x5814==x5815)>>x5816));
if (t186 != INT32_MIN) { NG(); } else { ; }
}
void f187(void) {
uint64_t x5829 = 50LLU;
volatile uint16_t x5830 = 3031U;
uint32_t x5832 = 29U;
volatile uint64_t t187 = 322976605917607038LLU;
t187 = (x5829-((x5830==x5831)>>x5832));
if (t187 != 50LLU) { NG(); } else { ; }
}
void f188(void) {
static int16_t x5837 = 519;
uint8_t x5838 = UINT8_MAX;
volatile uint16_t x5839 = 26U;
uint8_t x5840 = 0U;
volatile int32_t t188 = 0;
t188 = (x5837-((x5838==x5839)>>x5840));
if (t188 != 519) { NG(); } else { ; }
}
void f189(void) {
int64_t x5846 = -534592968898LL;
int32_t x5847 = -3;
static int8_t x5848 = 0;
static volatile uint64_t t189 = UINT64_MAX;
t189 = (x5845-((x5846==x5847)>>x5848));
if (t189 != UINT64_MAX) { NG(); } else { ; }
}
void f190(void) {
int16_t x5877 = 479;
int32_t x5878 = INT32_MIN;
int16_t x5879 = INT16_MAX;
volatile int32_t t190 = 90;
t190 = (x5877-((x5878==x5879)>>x5880));
if (t190 != 479) { NG(); } else { ; }
}
void f191(void) {
uint64_t x5887 = UINT64_MAX;
static uint8_t x5888 = 10U;
t191 = (x5885-((x5886==x5887)>>x5888));
if (t191 != 127) { NG(); } else { ; }
}
void f192(void) {
int16_t x5914 = INT16_MIN;
uint16_t x5915 = UINT16_MAX;
uint8_t x5916 = 4U;
volatile int32_t t192 = 70772;
t192 = (x5913-((x5914==x5915)>>x5916));
if (t192 != 615876290) { NG(); } else { ; }
}
void f193(void) {
uint16_t x5941 = 2218U;
int64_t x5942 = INT64_MIN;
static int32_t x5944 = 0;
volatile int32_t t193 = -820011070;
t193 = (x5941-((x5942==x5943)>>x5944));
if (t193 != 2218) { NG(); } else { ; }
}
void f194(void) {
int32_t x5949 = INT32_MIN;
uint64_t x5950 = 5989110342285LLU;
int8_t x5951 = INT8_MIN;
static uint32_t x5952 = 1U;
t194 = (x5949-((x5950==x5951)>>x5952));
if (t194 != INT32_MIN) { NG(); } else { ; }
}
void f195(void) {
uint32_t x5957 = UINT32_MAX;
static int32_t x5958 = INT32_MIN;
int8_t x5959 = INT8_MAX;
uint8_t x5960 = 5U;
uint32_t t195 = UINT32_MAX;
t195 = (x5957-((x5958==x5959)>>x5960));
if (t195 != UINT32_MAX) { NG(); } else { ; }
}
void f196(void) {
int16_t x5965 = INT16_MIN;
int64_t x5966 = -1LL;
uint32_t x5968 = 3U;
t196 = (x5965-((x5966==x5967)>>x5968));
if (t196 != -32768) { NG(); } else { ; }
}
void f197(void) {
int8_t x5973 = INT8_MIN;
int16_t x5974 = INT16_MIN;
uint16_t x5975 = 23U;
static int8_t x5976 = 10;
t197 = (x5973-((x5974==x5975)>>x5976));
if (t197 != -128) { NG(); } else { ; }
}
void f198(void) {
int16_t x6053 = 4093;
int64_t x6055 = -5LL;
volatile int32_t t198 = -3;
t198 = (x6053-((x6054==x6055)>>x6056));
if (t198 != 4093) { NG(); } else { ; }
}
void f199(void) {
volatile int32_t x6093 = INT32_MAX;
uint8_t x6095 = 2U;
int16_t x6096 = 0;
int32_t t199 = INT32_MAX;
t199 = (x6093-((x6094==x6095)>>x6096));
if (t199 != INT32_MAX) { NG(); } else { ; }
}
int main(void) {
f0();
f1();
f2();
f3();
f4();
f5();
f6();
f7();
f8();
f9();
f10();
f11();
f12();
f13();
f14();
f15();
f16();
f17();
f18();
f19();
f20();
f21();
f22();
f23();
f24();
f25();
f26();
f27();
f28();
f29();
f30();
f31();
f32();
f33();
f34();
f35();
f36();
f37();
f38();
f39();
f40();
f41();
f42();
f43();
f44();
f45();
f46();
f47();
f48();
f49();
f50();
f51();
f52();
f53();
f54();
f55();
f56();
f57();
f58();
f59();
f60();
f61();
f62();
f63();
f64();
f65();
f66();
f67();
f68();
f69();
f70();
f71();
f72();
f73();
f74();
f75();
f76();
f77();
f78();
f79();
f80();
f81();
f82();
f83();
f84();
f85();
f86();
f87();
f88();
f89();
f90();
f91();
f92();
f93();
f94();
f95();
f96();
f97();
f98();
f99();
f100();
f101();
f102();
f103();
f104();
f105();
f106();
f107();
f108();
f109();
f110();
f111();
f112();
f113();
f114();
f115();
f116();
f117();
f118();
f119();
f120();
f121();
f122();
f123();
f124();
f125();
f126();
f127();
f128();
f129();
f130();
f131();
f132();
f133();
f134();
f135();
f136();
f137();
f138();
f139();
f140();
f141();
f142();
f143();
f144();
f145();
f146();
f147();
f148();
f149();
f150();
f151();
f152();
f153();
f154();
f155();
f156();
f157();
f158();
f159();
f160();
f161();
f162();
f163();
f164();
f165();
f166();
f167();
f168();
f169();
f170();
f171();
f172();
f173();
f174();
f175();
f176();
f177();
f178();
f179();
f180();
f181();
f182();
f183();
f184();
f185();
f186();
f187();
f188();
f189();
f190();
f191();
f192();
f193();
f194();
f195();
f196();
f197();
f198();
f199();
return 0;
}
| 19.069405 | 60 | 0.591974 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.