hexsha stringlengths 40 40 | size int64 22 2.4M | ext stringclasses 5
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 260 | max_stars_repo_name stringlengths 5 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 9 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 260 | max_issues_repo_name stringlengths 5 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 9 | max_issues_count float64 1 67k ⌀ | 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 260 | max_forks_repo_name stringlengths 5 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 9 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 22 2.4M | avg_line_length float64 5 169k | max_line_length int64 5 786k | alphanum_fraction float64 0.06 0.95 | matches listlengths 1 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36888cd73cc5de11f7add852e841729ff5aa9f20 | 8,508 | h | C | HealthVault/Classes/Xml/XSerializer.h | Bhaskers-Blu-Org2/healthvault-ios-sdk | 37d3e97b5a246cc76858c85d460f672cdc90399c | [
"Apache-2.0"
] | 7 | 2017-05-01T14:57:38.000Z | 2019-01-19T01:17:15.000Z | HealthVault/Classes/Xml/XSerializer.h | microsoft/healthvault-ios-sdk | 37d3e97b5a246cc76858c85d460f672cdc90399c | [
"Apache-2.0"
] | 137 | 2017-04-28T18:25:10.000Z | 2017-09-21T17:20:36.000Z | HealthVault/Classes/Xml/XSerializer.h | microsoft/healthvault-ios-sdk | 37d3e97b5a246cc76858c85d460f672cdc90399c | [
"Apache-2.0"
] | 8 | 2019-07-30T03:08:53.000Z | 2021-11-10T01:56:41.000Z | //
// XSerializable.h
// MHVLib
//
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import "XReader.h"
#import "XWriter.h"
@protocol XSerializable <NSObject>
- (void)deserialize:(XReader *)reader;
- (void)deserializeAttributes:(XReader *)reader;
- (void)serialize:(XWriter *)writer;
- (void)serializeAttributes:(XWriter *)writer;
@end
@interface XSerializer : NSObject
+ (NSString *)serializeToString:(id)obj withRoot:(NSString *)root;
+ (BOOL)serialize:(id)obj withRoot:(NSString *)root toWriter:(XWriter *)writer;
+ (BOOL)serialize:(id)obj withRoot:(NSString *)root toFilePath:(NSString *)filePath;
+ (BOOL)secureSerialize:(id)obj withRoot:(NSString *)root toFilePath:(NSString *)filePath;
+ (BOOL)secureSerialize:(id)obj withRoot:(NSString *)root toFilePath:(NSString *)filePath withConverter:(XConverter *)converter;
+ (BOOL)deserialize:(XReader *)reader withRoot:(NSString *)root into:(id)obj;
@end
@interface NSObject (XSerializer)
- (NSString *)toXmlStringWithRoot:(NSString *)root;
+ (id)newFromString:(NSString *)xml withRoot:(NSString *)root asClass:(Class)classObj;
+ (id)newFromString:(NSString *)xml withRoot:(NSString *)root andElementName:(NSString *)name asClass:(Class)classObj andArrayClass:(Class)arrayClassObj;
+ (id)newFromReader:(XReader *)reader withRoot:(NSString *)root asClass:(Class)classObj;
+ (id)newFromFilePath:(NSString *)filePath withRoot:(NSString *)root asClass:(Class)classObj;
+ (id)newFromSecureFilePath:(NSString *)filePath withRoot:(NSString *)root asClass:(Class)classObj;
+ (id)newFromSecureFilePath:(NSString *)filePath withRoot:(NSString *)root asClass:(Class)classObj withConverter:(XConverter *)converter;
+ (id)newFromFileUrl:(NSURL *)url withRoot:(NSString *)root asClass:(Class)classObj;
+ (id)newFromResource:(NSString *)name withRoot:(NSString *)root asClass:(Class)classObj;
@end
//
// Deserialization methods for XmlReader
//
@interface XReader (XSerializer)
- (NSString *)readValue;
- (NSString *)readValueEnsure;
- (NSUUID *)readUuid;
- (int)readInt;
- (double)readDouble;
- (float)readFloat;
- (BOOL)readBool;
- (NSDate *)readDate;
- (NSString *)readNextElement;
- (NSString *)readStringElementRequired:(NSString *)name;
- (NSString *)readStringElement:(NSString *)name;
- (NSDate *)readNextDate;
- (NSDate *)readDateElement:(NSString *)name;
- (int)readNextInt;
- (int)readIntElement:(NSString *)name;
- (BOOL)readIntElement:(NSString *)name into:(NSInteger *)value;
- (double)readNextDouble;
- (double)readDoubleElement:(NSString *)name;
- (BOOL)readDoubleElement:(NSString *)name into:(double *)value;
- (BOOL)readNextBool;
- (BOOL)readBoolElement:(NSString *)name;
- (BOOL)readBoolElement:(NSString *)name into:(BOOL *)value;
- (void)readElementContentIntoObject:(id<XSerializable>)content;
- (id)readElementRequired:(NSString *)name asClass:(Class)classObj;
- (void)readElementRequired:(NSString *)name intoObject:(id<XSerializable>)content;
- (id)readElement:(NSString *)name asClass:(Class)classObj;
- (NSString *)readElementRaw:(NSString *)name;
- (NSMutableArray *)readElementArray:(NSString *)name asClass:(Class)classObj;
- (NSMutableArray *)readElementArray:(NSString *)name asClass:(Class)classObj andArrayClass:(Class)arrayClassObj;
- (NSMutableArray *)readElementArray:(NSString *)name thingName:(NSString *)thingName asClass:(Class)classObj andArrayClass:(Class)arrayClassObj;
- (NSArray<NSString *> *)readStringElementArray:(NSString *)name;
- (NSMutableArray<NSUUID *> *)readUUIDElementArray:(NSString *)name;
- (NSMutableArray *)readRawElementArray:(NSString *)name;
- (NSString *)readAttribute:(NSString *)name;
- (BOOL)readIntAttribute:(NSString *)name intValue:(int *)value;
- (BOOL)readBoolAttribute:(NSString *)name boolValue:(BOOL *)value;
- (BOOL)readDoubleAttribute:(NSString *)name doubleValue:(double *)value;
- (BOOL)readFloatAttribute:(NSString *)name floatValue:(float *)value;
- (BOOL)readUntilNodeType:(XNodeType)type;
- (BOOL)skipElement:(NSString *)name;
- (BOOL)skipSingleElement;
- (BOOL)skipSingleElement:(NSString *)name;
- (BOOL)skipToElement:(NSString *)name;
//
// These are noticeably faster for lots of things in a lop, as they do fewer string allocations
// There are now xmlChar* equivalents of most useful methods from above
//
- (id)readElementRequiredWithXmlName:(const xmlChar *)xName asClass:(Class)classObj;
- (void)readElementRequiredWithXmlName:(const xmlChar *)xName intoObject:(id<XSerializable>)content;
- (id)readElementWithXmlName:(const xmlChar *)xmlName asClass:(Class)classObj;
- (NSString *)readStringElementWithXmlName:(const xmlChar *)xmlName;
- (NSDate *)readDateElementXmlName:(const xmlChar *)xmlName;
- (double)readDoubleElementXmlName:(const xmlChar *)xmlName;
- (BOOL)readDoubleElementXmlName:(const xmlChar *)xmlName into:(double *)value;
- (int)readIntElementXmlName:(const xmlChar *)xmlName;
- (BOOL)readIntElementXmlName:(const xmlChar *)xmlName into:(int *)value;
- (BOOL)readBoolElementXmlName:(const xmlChar *)xmlName;
- (BOOL)readBoolElementXmlName:(const xmlChar *)xmlName into:(BOOL *)value;
- (NSMutableArray *)readElementArrayWithXmlName:(const xmlChar *)xName asClass:(Class)classObj;
- (NSMutableArray *)readElementArrayWithXmlName:(const xmlChar *)xName asClass:(Class)classObj andArrayClass:(Class)arrayClassObj;
- (NSMutableArray *)readElementArrayWithXmlName:(const xmlChar *)xName thingName:(const xmlChar *)thingName asClass:(Class)classObj andArrayClass:(Class)arrayClassObj;
- (NSString *)readAttributeWithXmlName:(const xmlChar *)xmlName;
- (NSString *)readElementRawWithXmlName:(const xmlChar *)xmlName;
- (BOOL)skipElementWithXmlName:(const xmlChar *)xmlName;
- (BOOL)skipSingleElementWithXmlName:(const xmlChar *)xmlName;
@end
//
// Serialization methods for XWriter
//
@interface XWriter (XSerializer)
- (void)writeUuid:(NSUUID *)uuid;
- (void)writeInt:(int)value;
- (void)writeDouble:(double)value;
- (void)writeFloat:(float)value;
- (void)writeBool:(BOOL)value;
- (void)writeDate:(NSDate *)value;
- (void)writeEmptyElement:(NSString *)name;
- (void)writeElementRequired:(NSString *)name content:(id<XSerializable>)content;
- (void)writeElementArrayRequired:(NSString *)name elements:(NSArray *)array;
- (void)writeElementRequired:(NSString *)name value:(NSString *)value;
- (void)writeElement:(NSString *)name value:(NSString *)value;
- (void)writeElement:(NSString *)name content:(id<XSerializable>)content;
- (void)writeElement:(NSString *)name intValue:(int)value;
- (void)writeElement:(NSString *)name doubleValue:(double)value;
- (void)writeElement:(NSString *)name dateValue:(NSDate *)value;
- (void)writeElement:(NSString *)name boolValue:(BOOL)value;
//
// If value conforms to XSerializable, calls writeElementRequired:content
// If NSString, writes out raw string as element content
// Else calls value.description and writes that
//
- (void)writeElement:(NSString *)name object:(id)value;
- (void)writeElementArray:(NSString *)name elements:(NSArray *)array;
- (void)writeElementArray:(NSString *)name thingName:(NSString *)thingName elements:(NSArray *)array;
- (void)writeRawElementArray:(NSString *)name elements:(NSArray *)array;
- (void)writeAttribute:(NSString *)name intValue:(int)value;
- (void)writeText:(NSString *)value;
- (void)writeElementXmlName:(const xmlChar *)xmlName content:(id<XSerializable>)content;
- (void)writeElementXmlName:(const xmlChar *)xmlName value:(NSString *)value;
- (void)writeElementXmlName:(const xmlChar *)xmlName intValue:(int)value;
- (void)writeElementXmlName:(const xmlChar *)xmlName doubleValue:(double)value;
- (void)writeElementXmlName:(const xmlChar *)xmlName dateValue:(NSDate *)value;
- (void)writeElementXmlName:(const xmlChar *)xmlName boolValue:(BOOL)value;
@end
void logWriterError(void);
#define MHVCHECK_XWRITE(condition) \
if (!(condition)) \
{ \
logWriterError(); \
}
| 40.708134 | 167 | 0.759873 | [
"object"
] |
368c2070ad9d89a964a9ecc34eb58cf12429cf41 | 3,052 | h | C | Common_3/Tools/FileSystem/IToolFileSystem.h | peterk2019/The-Forge | 77cba86e076e42e58c2fd9fefba9f602df030aed | [
"Apache-2.0"
] | null | null | null | Common_3/Tools/FileSystem/IToolFileSystem.h | peterk2019/The-Forge | 77cba86e076e42e58c2fd9fefba9f602df030aed | [
"Apache-2.0"
] | null | null | null | Common_3/Tools/FileSystem/IToolFileSystem.h | peterk2019/The-Forge | 77cba86e076e42e58c2fd9fefba9f602df030aed | [
"Apache-2.0"
] | null | null | null | /*
* Copyright (c) 2018-2020 The Forge Interactive Inc.
*
* This file is part of The-Forge
* (see https://github.com/ConfettiFX/The-Forge).
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#pragma once
#include "../../OS/Interfaces/IOperatingSystem.h"
#include "../../OS/Interfaces/IFileSystem.h"
#include "../../ThirdParty/OpenSource/EASTL/vector.h"
#include "../../ThirdParty/OpenSource/EASTL/string.h"
/************************************************************************/
// MARK: - File Watcher
/************************************************************************/
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
typedef struct FileWatcher FileWatcher;
typedef void (*FileWatcherCallback)(const char* fileName, uint32_t action);
typedef enum FileWatcherEventMask
{
FWE_MODIFIED = 1 << 0,
FWE_ACCESSED = 1 << 1,
FWE_CREATED = 1 << 2,
FWE_DELETED = 1 << 3,
} FileWatcherEventMask;
/// Creates a new FileWatcher that watches for changes specified by `eventMask` at `path` and calls `callback` when changes occur.
/// The return value must have `fsFreeFileWatcher` called to free it.
FileWatcher* fsCreateFileWatcher(const char* path, FileWatcherEventMask eventMask, FileWatcherCallback callback);
/// Invalidates and frees `fileWatcher.
void fsFreeFileWatcher(FileWatcher* fileWatcher);
#endif
/************************************************************************/
// MARK: - File iteration
/************************************************************************/
#ifdef TARGET_IOS
void fsRegisterUTIForExtension(const char* uti, const char* extension);
#endif
/// Returns array of all directories inside input resourceDir + directory. String also contains subDirectory
void fsGetSubDirectories(ResourceDirectory resourceDir, const char* subDirectory, eastl::vector<eastl::string>& out);
/// Returns array of all files inside input resourceDir + subDirectory. String also contains subDirectory
/// Specifying empty extension will collect all files
void fsGetFilesWithExtension(ResourceDirectory resourceDir, const char* subDirectory, const char* extension, eastl::vector<eastl::string>& out);
/************************************************************************/
/************************************************************************/
| 42.985915 | 144 | 0.650393 | [
"vector"
] |
368f807d7a77a3a64b086304f445c12c8f6881a9 | 2,001 | h | C | src/processPointClouds.h | nutmas/SFND_LidarObstacleDetection | 37eccae68e5b449aff402207f878f4f49c590f10 | [
"MIT"
] | null | null | null | src/processPointClouds.h | nutmas/SFND_LidarObstacleDetection | 37eccae68e5b449aff402207f878f4f49c590f10 | [
"MIT"
] | null | null | null | src/processPointClouds.h | nutmas/SFND_LidarObstacleDetection | 37eccae68e5b449aff402207f878f4f49c590f10 | [
"MIT"
] | null | null | null | // PCL lib Functions for processing point clouds
#ifndef PROCESSPOINTCLOUDS_H_
#define PROCESSPOINTCLOUDS_H_
#include <pcl/io/pcd_io.h>
#include <pcl/common/common.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/crop_box.h>
#include <pcl/kdtree/kdtree.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/segmentation/extract_clusters.h>
#include <pcl/common/transforms.h>
#include <iostream>
#include <string>
#include <vector>
#include <ctime>
#include <chrono>
#include "render/box.h"
#include "kdtree.h"
template<typename PointT>
class ProcessPointClouds {
private:
std::vector<std::vector<int>> euclideanCluster(const std::vector<std::vector<float>>& points, KdTree* tree, float distanceTol, int minSize, int maxSize);
void clusterHelper(int indice, const std::vector<std::vector<float>> &points, std::vector<int>& cluster, std::vector<bool> &processed, KdTree* tree, float distanceTol);
public:
//constructor
ProcessPointClouds();
//deconstructor
~ProcessPointClouds();
void numPoints(typename pcl::PointCloud<PointT>::Ptr cloud);
typename pcl::PointCloud<PointT>::Ptr FilterCloud(typename pcl::PointCloud<PointT>::Ptr cloud, float filterRes, Eigen::Vector4f minPoint, Eigen::Vector4f maxPoint);
std::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> SegmentPlane(typename pcl::PointCloud<PointT>::Ptr cloud, int maxIterations, float distanceThreshold);
std::vector<typename pcl::PointCloud<PointT>::Ptr> Clustering(typename pcl::PointCloud<PointT>::Ptr cloud, float clusterTolerance, int minSize, int maxSize);
Box BoundingBox(typename pcl::PointCloud<PointT>::Ptr cluster);
void savePcd(typename pcl::PointCloud<PointT>::Ptr cloud, std::string file);
typename pcl::PointCloud<PointT>::Ptr loadPcd(std::string file);
std::vector<boost::filesystem::path> streamPcd(std::string dataPath);
};
#endif /* PROCESSPOINTCLOUDS_H_ */
| 36.381818 | 194 | 0.752624 | [
"render",
"vector"
] |
3695fd292b1cb66c5f45c710ec34d933c7ab7246 | 4,620 | h | C | utilities/lp_solve/bfp/lp_BFP.h | agravgaard/RTK | 419f71cdaf0600fcb54e4faca643121b7832ea96 | [
"Apache-2.0",
"BSD-3-Clause"
] | 167 | 2015-02-26T08:39:33.000Z | 2022-03-31T04:40:35.000Z | utilities/lp_solve/bfp/lp_BFP.h | agravgaard/RTK | 419f71cdaf0600fcb54e4faca643121b7832ea96 | [
"Apache-2.0",
"BSD-3-Clause"
] | 270 | 2015-02-26T15:34:32.000Z | 2022-03-22T09:49:24.000Z | utilities/lp_solve/bfp/lp_BFP.h | agravgaard/RTK | 419f71cdaf0600fcb54e4faca643121b7832ea96 | [
"Apache-2.0",
"BSD-3-Clause"
] | 117 | 2015-05-01T14:56:49.000Z | 2022-03-11T03:18:26.000Z |
/* ---------------------------------------------------------------------------------- */
/* lp_solve v5+ headers for basis inversion / factorization libraries */
/* ---------------------------------------------------------------------------------- */
#define BFP_STATUS_RANKLOSS -1
#define BFP_STATUS_SUCCESS 0
#define BFP_STATUS_SINGULAR 1
#define BFP_STATUS_UNSTABLE 2
#define BFP_STATUS_NOPIVOT 3
#define BFP_STATUS_DIMERROR 4
#define BFP_STATUS_DUPLICATE 5
#define BFP_STATUS_NOMEMORY 6
#define BFP_STATUS_ERROR 7 /* Unspecified, command-related error */
#define BFP_STATUS_FATAL 8
#define BFP_STAT_ERROR -1
#define BFP_STAT_REFACT_TOTAL 0
#define BFP_STAT_REFACT_TIMED 1
#define BFP_STAT_REFACT_DENSE 2
#ifndef BFP_CALLMODEL
#ifdef WIN32
#define BFP_CALLMODEL __stdcall /* "Standard" call model */
#else
#define BFP_CALLMODEL
#endif
#endif
#ifdef RoleIsExternalInvEngine
#define __BFP_EXPORT_TYPE __EXPORT_TYPE
#else
#define __BFP_EXPORT_TYPE
#endif
/* Routines with UNIQUE implementations for each inversion engine */
/* ---------------------------------------------------------------------------------- */
const char __BFP_EXPORT_TYPE *(BFP_CALLMODEL bfp_name)(void);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_free)(lprec *lp);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_resize)(lprec *lp, int newsize);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_nonzeros)(lprec *lp, MYBOOL maximum);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_memallocated)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_preparefactorization)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_factorize)(lprec *lp, int uservars, int Bsize, MYBOOL *usedpos, MYBOOL final);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_finishupdate)(lprec *lp, MYBOOL changesign);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_ftran_normal)(lprec *lp, REAL *pcol, int *nzidx);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_ftran_prepare)(lprec *lp, REAL *pcol, int *nzidx);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_btran_normal)(lprec *lp, REAL *prow, int *nzidx);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_status)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_findredundant)(lprec *lp, int items, getcolumnex_func cb, int *maprow, int*mapcol);
/* Routines SHARED for all inverse implementations; located in lp_BFP1.c */
/* ---------------------------------------------------------------------------------- */
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_compatible)(lprec *lp, int bfpversion, int lpversion, int sizeofvar);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_indexbase)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_rowoffset)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotmax)(lprec *lp);
REAL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_efficiency)(lprec *lp);
REAL __BFP_EXPORT_TYPE *(BFP_CALLMODEL bfp_pivotvector)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotcount)(lprec *lp);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_mustrefactorize)(lprec *lp);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_refactcount)(lprec *lp, int kind);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_isSetI)(lprec *lp);
int *bfp_createMDO(lprec *lp, MYBOOL *usedpos, int count, MYBOOL doMDO);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_updaterefactstats)(lprec *lp);
int BFP_CALLMODEL bfp_rowextra(lprec *lp);
/* Routines with OPTIONAL SHARED code; template routines suitable for canned */
/* inverse engines are located in lp_BFP2.c */
/* ---------------------------------------------------------------------------------- */
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_init)(lprec *lp, int size, int deltasize, const char *options);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_restart)(lprec *lp);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_implicitslack)(lprec *lp);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotalloc)(lprec *lp, int newsize);
int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_colcount)(lprec *lp);
MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_canresetbasis)(lprec *lp);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_finishfactorization)(lprec *lp);
LREAL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_prepareupdate)(lprec *lp, int row_nr, int col_nr, REAL *pcol);
REAL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotRHS)(lprec *lp, LREAL theta, REAL *pcol);
void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_btran_double)(lprec *lp, REAL *prow, int *pnzidx, REAL *drow, int *dnzidx);
| 55.662651 | 127 | 0.689177 | [
"model"
] |
36989206b68fb5933913cfe6bec7d9f40b549555 | 13,562 | h | C | src/core/qgsvectorlayerutils.h | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | src/core/qgsvectorlayerutils.h | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | src/core/qgsvectorlayerutils.h | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | 1 | 2021-12-25T08:40:30.000Z | 2021-12-25T08:40:30.000Z | /***************************************************************************
qgsvectorlayerutils.h
---------------------
Date : October 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef QGSVECTORLAYERUTILS_H
#define QGSVECTORLAYERUTILS_H
#include "qgis_core.h"
#include "qgsgeometry.h"
#include "qgsvectorlayerfeatureiterator.h"
/**
* \ingroup core
* \class QgsVectorLayerUtils
* \brief Contains utility methods for working with QgsVectorLayers.
*
* \since QGIS 3.0
*/
class CORE_EXPORT QgsVectorLayerUtils
{
public:
/**
* \ingroup core
* \class QgsDuplicateFeatureContext
* \brief Contains mainly the QMap with QgsVectorLayer and QgsFeatureIds do list all the duplicated features
*
* \since QGIS 3.0
*/
class CORE_EXPORT QgsDuplicateFeatureContext
{
public:
//! Constructor for QgsDuplicateFeatureContext
QgsDuplicateFeatureContext() = default;
/**
* Returns all the layers on which features have been duplicated
* \since QGIS 3.0
*/
QList<QgsVectorLayer *> layers() const;
/**
* Returns the duplicated features in the given layer
* \since QGIS 3.0
*/
QgsFeatureIds duplicatedFeatures( QgsVectorLayer *layer ) const;
private:
QMap<QgsVectorLayer *, QgsFeatureIds> mDuplicatedFeatures;
friend class QgsVectorLayerUtils;
/**
* To set info about duplicated features to the function feedback (layout and ids)
* \since QGIS 3.0
*/
void setDuplicatedFeatures( QgsVectorLayer *layer, const QgsFeatureIds &ids );
};
/**
* \ingroup core
* \class QgsFeatureData
* \brief Encapsulate geometry and attributes for new features, to be passed to createFeatures
* \see createFeatures()
* \since QGIS 3.6
*/
class CORE_EXPORT QgsFeatureData
{
public:
/**
* Constructs a new QgsFeatureData with given \a geometry and \a attributes
*/
QgsFeatureData( const QgsGeometry &geometry = QgsGeometry(), const QgsAttributeMap &attributes = QgsAttributeMap() );
//! Returns geometry
QgsGeometry geometry() const;
//! Returns attributes
QgsAttributeMap attributes() const;
private:
QgsGeometry mGeometry;
QgsAttributeMap mAttributes;
};
// SIP does not like "using", use legacy typedef
//! Alias for list of QgsFeatureData
typedef QList<QgsVectorLayerUtils::QgsFeatureData> QgsFeaturesDataList;
/**
* Create a feature iterator for a specified field name or expression.
* \param layer vector layer to retrieve values from
* \param fieldOrExpression field name or an expression string
* \param ok will be set to FALSE if field or expression is invalid, otherwise TRUE
* \param selectedOnly set to TRUE to get values from selected features only
* \returns feature iterator
* \since QGIS 3.0
*/
static QgsFeatureIterator getValuesIterator( const QgsVectorLayer *layer, const QString &fieldOrExpression, bool &ok, bool selectedOnly );
/**
* Fetches all values from a specified field name or expression.
* \param layer vector layer to retrieve values from
* \param fieldOrExpression field name or an expression string
* \param ok will be set to FALSE if field or expression is invalid, otherwise TRUE
* \param selectedOnly set to TRUE to get values from selected features only
* \param feedback optional feedback object to allow cancellation
* \returns list of fetched values
* \see getDoubleValues
* \since QGIS 3.0
*/
static QList< QVariant > getValues( const QgsVectorLayer *layer, const QString &fieldOrExpression, bool &ok, bool selectedOnly = false, QgsFeedback *feedback = nullptr );
/**
* Fetches all double values from a specified field name or expression. Null values or
* invalid expression results are skipped.
* \param layer vector layer to retrieve values from
* \param fieldOrExpression field name or an expression string evaluating to a double value
* \param ok will be set to FALSE if field or expression is invalid, otherwise TRUE
* \param selectedOnly set to TRUE to get values from selected features only
* \param nullCount optional pointer to integer to store number of null values encountered in
* \param feedback optional feedback object to allow cancellation
* \returns list of fetched values
* \see getValues
* \since QGIS 3.0
*/
static QList< double > getDoubleValues( const QgsVectorLayer *layer, const QString &fieldOrExpression, bool &ok, bool selectedOnly = false, int *nullCount = nullptr, QgsFeedback *feedback = nullptr );
/**
* Returns TRUE if the specified value already exists within a field. This method can be used to test for uniqueness
* of values inside a layer's attributes. An optional list of ignored feature IDs can be provided, if so, any features
* with IDs within this list are ignored when testing for existence of the value.
* \see createUniqueValue()
*/
static bool valueExists( const QgsVectorLayer *layer, int fieldIndex, const QVariant &value, const QgsFeatureIds &ignoreIds = QgsFeatureIds() );
/**
* Returns a new attribute value for the specified field index which is guaranteed to be unique. The optional seed
* value can be used as a basis for generated values.
* \see valueExists()
*/
static QVariant createUniqueValue( const QgsVectorLayer *layer, int fieldIndex, const QVariant &seed = QVariant() );
/**
* Returns a new attribute value for the specified field index which is guaranteed to
* be unique within regard to \a existingValues.
* The optional seed value can be used as a basis for generated values.
* \since QGIS 3.6
*/
static QVariant createUniqueValueFromCache( const QgsVectorLayer *layer, int fieldIndex, const QSet<QVariant> &existingValues, const QVariant &seed = QVariant() );
/**
* Tests an attribute value to check whether it passes all constraints which are present on the corresponding field.
* Returns TRUE if the attribute value is valid for the field. Any constraint failures will be reported in the errors argument.
* If the strength or origin parameter is set then only constraints with a matching strength/origin will be checked.
*/
static bool validateAttribute( const QgsVectorLayer *layer, const QgsFeature &feature, int attributeIndex, QStringList &errors SIP_OUT,
QgsFieldConstraints::ConstraintStrength strength = QgsFieldConstraints::ConstraintStrengthNotSet,
QgsFieldConstraints::ConstraintOrigin origin = QgsFieldConstraints::ConstraintOriginNotSet );
/**
* Creates a new feature ready for insertion into a layer. Default values and constraints
* (e.g., unique constraints) will automatically be handled. An optional attribute map can be
* passed for the new feature to copy as many attribute values as possible from the map,
* assuming that they respect the layer's constraints. Note that the created feature is not
* automatically inserted into the layer.
* \see createFeatures()
*/
static QgsFeature createFeature( const QgsVectorLayer *layer,
const QgsGeometry &geometry = QgsGeometry(),
const QgsAttributeMap &attributes = QgsAttributeMap(),
QgsExpressionContext *context = nullptr );
/**
* Creates a set of new features ready for insertion into a layer. Default values and constraints
* (e.g., unique constraints) will automatically be handled. Note that the created features are not
* automatically inserted into the layer.
* \see createFeature()
* \since QGIS 3.6
*/
static QgsFeatureList createFeatures( const QgsVectorLayer *layer,
const QgsFeaturesDataList &featuresData,
QgsExpressionContext *context = nullptr );
/**
* Duplicates a feature and it's children (one level deep). It calls CreateFeature, so
* default values and constraints (e.g., unique constraints) will automatically be handled.
* The duplicated feature will be automatically inserted into the layer.
* \a depth the higher this number the deeper the level - With depth > 0 the children of the feature are not duplicated
* \a duplicateFeatureContext stores all the layers and the featureids of the duplicated features (incl. children)
* \since QGIS 3.0
*/
static QgsFeature duplicateFeature( QgsVectorLayer *layer, const QgsFeature &feature, QgsProject *project, int depth, QgsDuplicateFeatureContext &duplicateFeatureContext SIP_OUT );
/**
* Gets the feature source from a QgsVectorLayer pointer.
* This method is thread-safe but will block the main thread for execution. Executing it from the main
* thread is safe too.
* This should be used in scenarios, where a ``QWeakPointer<QgsVectorLayer>`` is kept in a thread
* and features should be fetched from this layer. Using the layer directly is not safe to do.
* The result will be ``NULLPTR`` if the layer has been deleted.
* If \a feedback is specified, the call will return if the feedback is canceled.
* Returns a new feature source for the \a layer. The source may be NULLPTR if the layer no longer
* exists or if the feedback is canceled.
*
* \note Requires Qt >= 5.10 to make use of the thread-safe implementation
* \since QGIS 3.4
*/
static std::unique_ptr<QgsVectorLayerFeatureSource> getFeatureSource( QPointer<QgsVectorLayer> layer, QgsFeedback *feedback = nullptr ) SIP_SKIP;
/**
* Matches the attributes in \a feature to the specified \a fields.
*
* This causes the attributes contained within the given \a feature to be rearranged (or in
* some cases dropped) in order to match the fields and order indicated by \a fields.
*
* The exact behavior depends on whether or not \a feature has a valid fields container
* set (see QgsFeature::fields()). If a fields container is set, then the names of the
* feature's fields are matched to \a fields. In this case attributes from \a feature
* will be rearranged or dropped in order to match the field names from \a fields.
*
* If the \a feature does not have a valid fields container set, then the feature's attributes
* are simply truncated to match the number of fields present in \a fields (or if
* less attributes are present in \a feature than in \a fields, the feature's attributes
* are padded with NULL values to match the required length).
* Finally, the feature's fields are set to \a fields.
*
* \since QGIS 3.4
*/
static void matchAttributesToFields( QgsFeature &feature, const QgsFields &fields );
/**
* Converts input \a feature to be compatible with the given \a layer.
*
* This function returns a new list of transformed features compatible with the input
* layer, note that the number of features returned might be greater than one when
* converting a multi part geometry to single part
*
* The following operations will be performed to convert the input features:
* - convert single geometries to multi part
* - drop additional attributes
* - drop geometry if layer is geometry-less
* - add missing attribute fields
* - add back M/Z values (initialized to 0)
* - drop Z/M
* - convert multi part geometries to single part
*
* \since QGIS 3.4
*/
static QgsFeatureList makeFeatureCompatible( const QgsFeature &feature, const QgsVectorLayer *layer );
/**
* Converts input \a features to be compatible with the given \a layer.
*
* This function returns a new list of transformed features compatible with the input
* layer, note that the number of features returned might be greater than the number
* of input features.
*
* The following operations will be performed to convert the input features:
* - convert single geometries to multi part
* - drop additional attributes
* - drop geometry if layer is geometry-less
* - add missing attribute fields
* - add back M/Z values (initialized to 0)
* - drop Z/M
* - convert multi part geometries to single part
*
* \since QGIS 3.4
*/
static QgsFeatureList makeFeaturesCompatible( const QgsFeatureList &features, const QgsVectorLayer *layer );
};
#endif // QGSVECTORLAYERUTILS_H
| 46.765517 | 204 | 0.665315 | [
"geometry",
"object",
"vector"
] |
369d1a6ce89db99080294f0e7c74775b0943e732 | 22,501 | h | C | include/estimators.h | ishipachev/magsac | 4d0e02b784af513fa4fc50c2f785b05eff94c753 | [
"BSD-3-Clause"
] | null | null | null | include/estimators.h | ishipachev/magsac | 4d0e02b784af513fa4fc50c2f785b05eff94c753 | [
"BSD-3-Clause"
] | null | null | null | include/estimators.h | ishipachev/magsac | 4d0e02b784af513fa4fc50c2f785b05eff94c753 | [
"BSD-3-Clause"
] | null | null | null | #pragma once
#include "essential_estimator.h"
#include "fundamental_estimator.h"
#include "homography_estimator.h"
#include "model.h"
namespace magsac
{
namespace estimator
{// This is the estimator class for estimating a fundamental matrix between two images.
template<class _MinimalSolverEngine, // The solver used for estimating the model from a minimal sample
class _NonMinimalSolverEngine> // The solver used for estimating the model from a non-minimal sample
class HomographyEstimator :
public gcransac::estimator::RobustHomographyEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>
{
public:
using gcransac::estimator::RobustHomographyEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::residual;
HomographyEstimator() :
gcransac::estimator::RobustHomographyEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>()
{}
// Calculating the residual which is used for the MAGSAC score calculation.
// Since symmetric epipolar distance is usually more robust than Sampson-error.
// we are using it for the score calculation.
inline double residualForScoring(const cv::Mat& point_,
const gcransac::Model& model_) const
{
return residual(point_, model_.descriptor);
}
// Helper function to be consistent by having the same
inline double residualOtherForScoring(const cv::Mat& point_,
const gcransac::Model& model_) const
{
return residual(point_, model_.descriptor);
}
static constexpr double getSigmaQuantile()
{
return 3.64;
}
static constexpr size_t getDegreesOfFreedom()
{
return 4;
}
static constexpr double getC()
{
return 0.25;
}
// Calculating the upper incomplete gamma value of (DoF - 1) / 2 with k^2 / 2.
static constexpr double getGammaFunction()
{
return 1.0;
}
static constexpr double getUpperIncompleteGammaOfK()
{
return 0.0036572608340910764;
}
// Calculating the lower incomplete gamma value of (DoF + 1) / 2 with k^2 / 2.
static constexpr double getLowerIncompleteGammaOfK()
{
return 1.3012265540498875;
}
static constexpr double getChiSquareParamCp()
{
return 1.0 / (4.0 * getGammaFunction());
}
};
// This is the estimator class for estimating a fundamental matrix between two images.
template<class _MinimalSolverEngine, // The solver used for estimating the model from a minimal sample
class _NonMinimalSolverEngine> // The solver used for estimating the model from a non-minimal sample
class FundamentalMatrixEstimator :
public gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>
{
protected:
using gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::use_degensac;
using gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::minimum_inlier_ratio_in_validity_check;
using gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::squared_homography_threshold;
const double maximum_threshold;
public:
using gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::squaredSymmetricEpipolarDistance;
using gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::sampleSize;
FundamentalMatrixEstimator(
const double maximum_threshold_,
const double minimum_inlier_ratio_in_validity_check_ = 0.1,
const bool apply_degensac_ = true,
const double degensac_homography_threshold_ = 3.0) :
maximum_threshold(maximum_threshold_),
gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>(minimum_inlier_ratio_in_validity_check_,
apply_degensac_,
degensac_homography_threshold_)
{}
// Calculating the residual which is used for the MAGSAC score calculation.
// Since symmetric epipolar distance is usually more robust than Sampson-error.
// we are using it for the score calculation.
inline double residualForScoring(const cv::Mat& point_,
const gcransac::Model& model_) const
{
return std::sqrt(gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::squaredSymmetricEpipolarDistance(point_, model_.descriptor));
}
// IS: Additional scoring which can be used further to compare resulting model with
// other models
inline double residualOtherForScoring(const cv::Mat& point_,
const gcransac::Model& model_) const
{
return std::sqrt(gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::squaredSampsonDistance(point_, model_.descriptor));
}
static constexpr double getSigmaQuantile()
{
return 3.64;
}
static constexpr size_t getDegreesOfFreedom()
{
return 4;
}
static constexpr double getGammaFunction()
{
return 1.0;
}
static constexpr double getC()
{
return 0.25;
}
// Calculating the upper incomplete gamma value of (DoF - 1) / 2 with k^2 / 2.
static constexpr double getUpperIncompleteGammaOfK()
{
return 0.0036572608340910764;
}
// Calculating the lower incomplete gamma value of (DoF + 1) / 2 with k^2 / 2.
static constexpr double getLowerIncompleteGammaOfK()
{
return 1.3012265540498875;
}
static constexpr double getChiSquareParamCp()
{
return 1.0 / (4.0 * getGammaFunction());
}
// Validate the model by checking the number of inlier with symmetric epipolar distance
// instead of Sampson distance. In general, Sampson distance is more accurate but less
// robust to degenerate solutions than the symmetric epipolar distance. Therefore,
// every so-far-the-best model is checked if it has enough inlier with symmetric
// epipolar distance as well.
bool isValidModel(gcransac::Model& model_,
const cv::Mat& data_,
const std::vector<size_t> &inliers_,
const size_t *minimal_sample_,
const double threshold_,
bool &model_updated_) const
{
// Validate the model by checking the number of inlier with symmetric epipolar distance
// instead of Sampson distance. In general, Sampson distance is more accurate but less
// robust to degenerate solutions than the symmetric epipolar distance. Therefore,
// every so-far-the-best model is checked if it has enough inlier with symmetric
bool passed = false;
size_t inlier_number = 0; // Number of inlier if using symmetric epipolar distance
const Eigen::Matrix3d &descriptor = model_.descriptor; // The decriptor of the current model
constexpr size_t sample_size = gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::sampleSize(); // Size of a minimal sample
// Minimum number of inliers which should be inlier as well when using symmetric epipolar distance instead of Sampson distance
const size_t inliers_to_pass = inliers_.size() * gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::minimum_inlier_ratio_in_validity_check;
const size_t minimum_inlier_number =
MAX(sample_size, inliers_to_pass);
// Squared inlier-outlier threshold
const double squared_threshold = threshold_ * threshold_;
// Iterate through the inliers_ determined by Sampson distance
for (const auto &idx : inliers_)
// Calculate the residual using symmetric epipolar distance and check if
// it is smaller than the threshold_.
if (gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::squaredSymmetricEpipolarDistance(data_.row(idx), descriptor) < squared_threshold)
// Increase the inlier number and terminate if enough inliers_ have been found.
if (++inlier_number >= minimum_inlier_number)
{
passed = true;
break;
}
// If the fundamental matrix has not passed the symmetric epipolar tests,
// terminate.
if (!passed)
return false;
// Validate the model by checking if the scene is dominated by a single plane.
if (gcransac::estimator::FundamentalMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::use_degensac)
return applyDegensac(model_,
data_,
inliers_,
minimal_sample_,
threshold_,
model_updated_);
// If DEGENSAC is not applied and the model passed the previous tests,
// assume that it is a valid model.
return true;
}
// Evaluate the H-degenerate sample test and apply DEGENSAC if needed
inline bool applyDegensac(gcransac::Model& model_, // The input model to be tested
const cv::Mat& data_, // All data points
const std::vector<size_t> &inliers_, // The inliers of the input model
const size_t *minimal_sample_, // The minimal sample used for estimating the model
const double threshold_, // The inlier-outlier threshold
bool &model_updated_) const // A flag saying if the model has been updated here
{
// Set the flag initially to false since the model has not been yet updated.
model_updated_ = false;
// The possible triplets of points
constexpr size_t triplets[] = {
0, 1, 2,
3, 4, 5,
0, 1, 6,
3, 4, 6,
2, 5, 6 };
constexpr size_t number_of_triplets = 5; // The number of triplets to be tested
const size_t columns = data_.cols; // The number of columns in the data matrix
// The fundamental matrix coming from the minimal sample
const Eigen::Matrix3d &fundamental_matrix =
model_.descriptor.block<3, 3>(0, 0);
// Applying SVD decomposition to the estimated fundamental matrix
Eigen::JacobiSVD<Eigen::Matrix3d> svd(
fundamental_matrix,
Eigen::ComputeFullU | Eigen::ComputeFullV);
// Calculate the epipole in the second image
const Eigen::Vector3d epipole =
svd.matrixU().rightCols<1>().head<3>() / svd.matrixU()(2, 2);
// The calculate the cross-produced matrix of the epipole
Eigen::Matrix3d epipolar_cross;
epipolar_cross << 0, -epipole(2), epipole(1),
epipole(2), 0, -epipole(0),
-epipole(1), epipole(0), 0;
const Eigen::Matrix3d A =
epipolar_cross * model_.descriptor;
// A flag deciding if the sample is H-degenerate
bool h_degenerate_sample = false;
// The homography which the H-degenerate part of the sample implies
Eigen::Matrix3d best_homography;
// Iterate through the triplets of points in the sample
for (size_t triplet_idx = 0; triplet_idx < number_of_triplets; ++triplet_idx)
{
// The index of the first point of the triplet
const size_t triplet_offset = triplet_idx * 3;
// The indices of the other points
const size_t point_1_idx = minimal_sample_[triplets[triplet_offset]],
point_2_idx = minimal_sample_[triplets[triplet_offset + 1]],
point_3_idx = minimal_sample_[triplets[triplet_offset + 2]];
// A pointer to the first point's first coordinate
const double *point_1_ptr =
reinterpret_cast<double *>(data_.data) + point_1_idx * columns;
// A pointer to the second point's first coordinate
const double *point_2_ptr =
reinterpret_cast<double *>(data_.data) + point_2_idx * columns;
// A pointer to the third point's first coordinate
const double *point_3_ptr =
reinterpret_cast<double *>(data_.data) + point_3_idx * columns;
// Copy the point coordinates into Eigen vectors
Eigen::Vector3d point_1_1, point_1_2, point_1_3,
point_2_1, point_2_2, point_2_3;
point_1_1 << point_1_ptr[0], point_1_ptr[1], 1;
point_2_1 << point_1_ptr[2], point_1_ptr[3], 1;
point_1_2 << point_2_ptr[0], point_2_ptr[1], 1;
point_2_2 << point_2_ptr[2], point_2_ptr[3], 1;
point_1_3 << point_3_ptr[0], point_3_ptr[1], 1;
point_2_3 << point_3_ptr[2], point_3_ptr[3], 1;
// Calculate the cross-product of the epipole end each point
Eigen::Vector3d point_1_cross_epipole = point_2_1.cross(epipole);
Eigen::Vector3d point_2_cross_epipole = point_2_2.cross(epipole);
Eigen::Vector3d point_3_cross_epipole = point_2_3.cross(epipole);
Eigen::Vector3d b;
b << point_2_1.cross(A * point_1_1).transpose() * point_1_cross_epipole / point_1_cross_epipole.squaredNorm(),
point_2_2.cross(A * point_1_2).transpose() * point_2_cross_epipole / point_2_cross_epipole.squaredNorm(),
point_2_3.cross(A * point_1_3).transpose() * point_3_cross_epipole / point_3_cross_epipole.squaredNorm();
Eigen::Matrix3d M;
M << point_1_1(0), point_1_1(1), point_1_1(2),
point_1_2(0), point_1_2(1), point_1_2(2),
point_1_3(0), point_1_3(1), point_1_3(2);
Eigen::Matrix3d homography =
A - epipole * (M.inverse() * b).transpose();
// The number of point consistent with the implied homography
size_t inlier_number = 3;
// Count the inliers of the homography
for (size_t i = 0; i < sampleSize(); ++i)
{
// Get the point's index from the minimal sample
size_t idx = minimal_sample_[i];
// Check if the point is not included in the current triplet
if (idx == point_1_idx ||
idx == point_2_idx ||
idx == point_3_idx)
continue; // If yes, the error does not have to be calculated
// Calculate the re-projection error
const double *point_ptr =
reinterpret_cast<double *>(data_.data) + idx * columns;
const double &x1 = point_ptr[0], // The x coordinate in the first image
&y1 = point_ptr[1], // The y coordinate in the first image
&x2 = point_ptr[2], // The x coordinate in the second image
&y2 = point_ptr[3]; // The y coordinate in the second image
// Calculating H * p
const double t1 = homography(0, 0) * x1 + homography(0, 1) * y1 + homography(0, 2),
t2 = homography(1, 0) * x1 + homography(1, 1) * y1 + homography(1, 2),
t3 = homography(2, 0) * x1 + homography(2, 1) * y1 + homography(2, 2);
// Calculating the difference of the projected and original points
const double d1 = x2 - (t1 / t3),
d2 = y2 - (t2 / t3);
// Calculating the squared re-projection error
const double squared_residual = d1 * d1 + d2 * d2;
// If the squared re-projection error is smaller than the threshold,
// consider the point inlier.
if (squared_residual < squared_homography_threshold)
++inlier_number;
}
// If at least 5 points are correspondences are consistent with the homography,
// consider the sample as H-degenerate.
if (inlier_number >= 5)
{
// Saving the parameters of the homography
best_homography = homography;
// Setting the flag of being a h-degenerate sample
h_degenerate_sample = true;
break;
}
}
// If the sample is H-degenerate
if (h_degenerate_sample)
{
// Declare a homography estimator to be able to calculate the residual and the homography from a non-minimal sample
static const magsac::estimator::HomographyEstimator<
gcransac::estimator::solver::HomographyFourPointSolver, // The solver used for fitting a model to a minimal sample
gcransac::estimator::solver::HomographyFourPointSolver> homography_estimator;
// The inliers of the homography
std::vector<size_t> homography_inliers;
homography_inliers.reserve(inliers_.size());
// Iterate through the inliers of the fundamental matrix
// and select those which are inliers of the homography as well.
//for (size_t inlier_idx = 0; inlier_idx < data_.rows; ++inlier_idx)
for (const size_t &inlier_idx : inliers_)
if (homography_estimator.squaredResidual(data_.row(inlier_idx), best_homography) < squared_homography_threshold)
homography_inliers.emplace_back(inlier_idx);
// If the homography does not have enough inliers to be estimated, terminate.
if (homography_inliers.size() < homography_estimator.nonMinimalSampleSize())
return false;
// The set of estimated homographies. For all implemented solvers,
// this should be of size 1.
std::vector<gcransac::Model> homographies;
// Estimate the homography parameters from the provided inliers.
homography_estimator.estimateModelNonminimal(data_, // All data points
&homography_inliers[0], // The inliers of the homography
homography_inliers.size(), // The number of inliers
&homographies); // The estimated homographies
// If the number of estimated homographies is not 1, there is some problem
// and, thus, terminate.
if (homographies.size() != 1)
return false;
// Get the reference of the homography fit to the non-minimal sample
const Eigen::Matrix3d &nonminimal_homography =
homographies[0].descriptor;
// Do a local GC-RANSAC to determine the parameters of the fundamental matrix by
// the plane-and-parallax algorithm using the determined homography.
magsac::estimator::FundamentalMatrixEstimator<
gcransac::estimator::solver::FundamentalMatrixPlaneParallaxSolver, // The solver used for fitting a model to a minimal sample
gcransac::estimator::solver::FundamentalMatrixEightPointSolver> estimator(maximum_threshold, 0.0, false);
estimator.getMinimalSolver()->setHomography(&nonminimal_homography);
std::vector<int> inliers;
gcransac::Model model;
MAGSAC<cv::Mat, magsac::estimator::FundamentalMatrixEstimator<
gcransac::estimator::solver::FundamentalMatrixPlaneParallaxSolver, // The solver used for fitting a model to a minimal sample
gcransac::estimator::solver::FundamentalMatrixEightPointSolver>> magsac;
magsac.setMaximumThreshold(maximum_threshold); // The maximum noise scale sigma allowed
magsac.setReferenceThreshold(threshold_);
magsac.setIterationLimit(1e4); // Iteration limit to interrupt the cases when the algorithm run too long.
gcransac::sampler::UniformSampler sampler(&data_); // The local optimization sampler is used inside the local optimization
int iteration_number = 0; // Number of iterations required
ModelScore score;
const bool success = magsac.run(data_, // The data points
0.99, // The required confidence in the results
estimator, // The used estimator
sampler, // The sampler used for selecting minimal samples in each iteration
model, // The estimated model
iteration_number, // The number of iterations
score);
// If more inliers are found the what initially was given,
// update the model parameters.
if (score.inlier_number >= inliers_.size())
{
// Consider the model to be updated
model_updated_ = true;
// Update the parameters
model_ = model;
}
}
// If we get to this point, the procedure was successfull
return true;
}
};
// This is the estimator class for estimating a fundamental matrix between two images.
template<class _MinimalSolverEngine, // The solver used for estimating the model from a minimal sample
class _NonMinimalSolverEngine> // The solver used for estimating the model from a non-minimal sample
class EssentialMatrixEstimator :
public gcransac::estimator::EssentialMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>
{
public:
using gcransac::estimator::EssentialMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>::squaredSymmetricEpipolarDistance;
EssentialMatrixEstimator(Eigen::Matrix3d intrinsics_src_, // The intrinsic parameters of the source camera
Eigen::Matrix3d intrinsics_dst_, // The intrinsic parameters of the destination camera
const double minimum_inlier_ratio_in_validity_check_ = 0.5,
const double point_ratio_for_selecting_from_multiple_models_ = 0.05) :
gcransac::estimator::EssentialMatrixEstimator<_MinimalSolverEngine, _NonMinimalSolverEngine>(
intrinsics_src_,
intrinsics_dst_,
minimum_inlier_ratio_in_validity_check_,
point_ratio_for_selecting_from_multiple_models_)
{}
// Calculating the residual which is used for the MAGSAC score calculation.
// Since symmetric epipolar distance is usually more robust than Sampson-error.
// we are using it for the score calculation.
inline double residualForScoring(const cv::Mat& point_,
const gcransac::Model& model_) const
{
return squaredSymmetricEpipolarDistance(point_, model_.descriptor);
}
static constexpr double getSigmaQuantile()
{
return 3.64;
}
static constexpr size_t getDegreesOfFreedom()
{
return 4;
}
static constexpr double getC()
{
return 0.25;
}
static constexpr double getGammaFunction()
{
return 1.0;
}
// Calculating the upper incomplete gamma value of (DoF - 1) / 2 with k^2 / 2.
static constexpr double getUpperIncompleteGammaOfK()
{
return 0.0036572608340910764;
}
// Calculating the lower incomplete gamma value of (DoF + 1) / 2 with k^2 / 2.
static constexpr double getLowerIncompleteGammaOfK()
{
return 1.3012265540498875;
}
static constexpr double getChiSquareParamCp()
{
return 1.0 / (4.0 * getGammaFunction());
}
};
}
namespace utils
{
// The default estimator for essential matrix fitting
typedef estimator::EssentialMatrixEstimator<gcransac::estimator::solver::EssentialMatrixFivePointSteweniusSolver, // The solver used for fitting a model to a minimal sample
gcransac::estimator::solver::FundamentalMatrixEightPointSolver> // The solver used for fitting a model to a non-minimal sample
DefaultEssentialMatrixEstimator;
// The default estimator for fundamental matrix fitting
typedef estimator::FundamentalMatrixEstimator<gcransac::estimator::solver::FundamentalMatrixSevenPointSolver, // The solver used for fitting a model to a minimal sample
gcransac::estimator::solver::FundamentalMatrixEightPointSolver> // The solver used for fitting a model to a non-minimal sample
DefaultFundamentalMatrixEstimator;
// The default estimator for homography fitting
typedef estimator::HomographyEstimator<gcransac::estimator::solver::HomographyFourPointSolver, // The solver used for fitting a model to a minimal sample
gcransac::estimator::solver::HomographyFourPointSolver> // The solver used for fitting a model to a non-minimal sample
DefaultHomographyEstimator;
}
}
| 41.591497 | 188 | 0.723479 | [
"vector",
"model"
] |
369da0d5b0cf4fd890a62334e58415d680bdf5c5 | 20,333 | h | C | chrome/browser/browsing_data/cookies_tree_model.h | mghgroup/Glide-Browser | 6a4c1eaa6632ec55014fee87781c6bbbb92a2af5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/browser/browsing_data/cookies_tree_model.h | mghgroup/Glide-Browser | 6a4c1eaa6632ec55014fee87781c6bbbb92a2af5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/browser/browsing_data/cookies_tree_model.h | mghgroup/Glide-Browser | 6a4c1eaa6632ec55014fee87781c6bbbb92a2af5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-01-05T23:43:46.000Z | 2021-01-07T23:36:34.000Z | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_
#define CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_
#include <list>
#include <memory>
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "chrome/browser/browsing_data/local_data_container.h"
#include "components/content_settings/core/common/content_settings.h"
#include "extensions/buildflags/buildflags.h"
#include "ui/base/models/tree_node_model.h"
class CookiesTreeModel;
class CookieTreeAppCacheNode;
class CookieTreeAppCachesNode;
class CookieTreeCacheStorageNode;
class CookieTreeCacheStoragesNode;
class CookieTreeCookieNode;
class CookieTreeCookiesNode;
class CookieTreeDatabaseNode;
class CookieTreeDatabasesNode;
class CookieTreeFileSystemNode;
class CookieTreeFileSystemsNode;
class CookieTreeFlashLSONode;
class CookieTreeHostNode;
class CookieTreeIndexedDBNode;
class CookieTreeIndexedDBsNode;
class CookieTreeLocalStorageNode;
class CookieTreeLocalStoragesNode;
class CookieTreeMediaLicenseNode;
class CookieTreeMediaLicensesNode;
class CookieTreeQuotaNode;
class CookieTreeServiceWorkerNode;
class CookieTreeServiceWorkersNode;
class CookieTreeSharedWorkerNode;
class CookieTreeSharedWorkersNode;
class CookieTreeSessionStorageNode;
class CookieTreeSessionStoragesNode;
class ExtensionSpecialStoragePolicy;
namespace content_settings {
class CookieSettings;
}
namespace extensions {
class ExtensionSet;
}
namespace net {
class CanonicalCookie;
}
// CookieTreeNode -------------------------------------------------------------
// The base node type in the Cookies, Databases, and Local Storage options
// view, from which all other types are derived. Specialized from TreeNode in
// that it has a notion of deleting objects stored in the profile, and being
// able to have its children do the same.
class CookieTreeNode : public ui::TreeNode<CookieTreeNode> {
public:
// Used to pull out information for the InfoView (the details display below
// the tree control.)
struct DetailedInfo {
// NodeType corresponds to the various CookieTreeNode types.
enum NodeType {
TYPE_NONE,
TYPE_ROOT, // This is used for CookieTreeRootNode nodes.
TYPE_HOST, // This is used for CookieTreeHostNode nodes.
TYPE_COOKIES, // This is used for CookieTreeCookiesNode nodes.
TYPE_COOKIE, // This is used for CookieTreeCookieNode nodes.
TYPE_DATABASES, // This is used for CookieTreeDatabasesNode.
TYPE_DATABASE, // This is used for CookieTreeDatabaseNode.
TYPE_LOCAL_STORAGES, // This is used for CookieTreeLocalStoragesNode.
TYPE_LOCAL_STORAGE, // This is used for CookieTreeLocalStorageNode.
TYPE_SESSION_STORAGES, // This is used for CookieTreeSessionStoragesNode.
TYPE_SESSION_STORAGE, // This is used for CookieTreeSessionStorageNode.
TYPE_APPCACHES, // This is used for CookieTreeAppCachesNode.
TYPE_APPCACHE, // This is used for CookieTreeAppCacheNode.
TYPE_INDEXED_DBS, // This is used for CookieTreeIndexedDBsNode.
TYPE_INDEXED_DB, // This is used for CookieTreeIndexedDBNode.
TYPE_FILE_SYSTEMS, // This is used for CookieTreeFileSystemsNode.
TYPE_FILE_SYSTEM, // This is used for CookieTreeFileSystemNode.
TYPE_QUOTA, // This is used for CookieTreeQuotaNode.
TYPE_SERVICE_WORKERS, // This is used for CookieTreeServiceWorkersNode.
TYPE_SERVICE_WORKER, // This is used for CookieTreeServiceWorkerNode.
TYPE_SHARED_WORKERS, // This is used for CookieTreeSharedWorkersNode.
TYPE_SHARED_WORKER, // This is used for CookieTreeSharedWorkerNode.
TYPE_CACHE_STORAGES, // This is used for CookieTreeCacheStoragesNode.
TYPE_CACHE_STORAGE, // This is used for CookieTreeCacheStorageNode.
TYPE_FLASH_LSO, // This is used for CookieTreeFlashLSONode.
TYPE_MEDIA_LICENSES, // This is used for CookieTreeMediaLicensesNode.
TYPE_MEDIA_LICENSE, // This is used for CookieTreeMediaLicenseNode.
};
DetailedInfo();
DetailedInfo(const DetailedInfo& other);
~DetailedInfo();
DetailedInfo& Init(NodeType type);
DetailedInfo& InitHost(const GURL& origin);
DetailedInfo& InitCookie(const net::CanonicalCookie* cookie);
DetailedInfo& InitDatabase(const content::StorageUsageInfo* usage_info);
DetailedInfo& InitLocalStorage(
const content::StorageUsageInfo* local_storage_info);
DetailedInfo& InitSessionStorage(
const content::StorageUsageInfo* session_storage_info);
DetailedInfo& InitAppCache(const content::StorageUsageInfo* usage_info);
DetailedInfo& InitIndexedDB(const content::StorageUsageInfo* usage_info);
DetailedInfo& InitFileSystem(
const browsing_data::FileSystemHelper::FileSystemInfo*
file_system_info);
DetailedInfo& InitQuota(
const BrowsingDataQuotaHelper::QuotaInfo* quota_info);
DetailedInfo& InitServiceWorker(
const content::StorageUsageInfo* usage_info);
DetailedInfo& InitSharedWorker(
const browsing_data::SharedWorkerHelper::SharedWorkerInfo*
shared_worker_info);
DetailedInfo& InitCacheStorage(const content::StorageUsageInfo* usage_info);
DetailedInfo& InitFlashLSO(const std::string& flash_lso_domain);
DetailedInfo& InitMediaLicense(
const BrowsingDataMediaLicenseHelper::MediaLicenseInfo*
media_license_info);
NodeType node_type;
url::Origin origin;
const net::CanonicalCookie* cookie = nullptr;
// Used for AppCache, Database (WebSQL), IndexedDB, Service Worker, and
// Cache Storage node types.
const content::StorageUsageInfo* usage_info = nullptr;
const browsing_data::FileSystemHelper::FileSystemInfo* file_system_info =
nullptr;
const BrowsingDataQuotaHelper::QuotaInfo* quota_info = nullptr;
const browsing_data::SharedWorkerHelper::SharedWorkerInfo*
shared_worker_info = nullptr;
std::string flash_lso_domain;
const BrowsingDataMediaLicenseHelper::MediaLicenseInfo* media_license_info =
nullptr;
};
CookieTreeNode() {}
explicit CookieTreeNode(const base::string16& title)
: ui::TreeNode<CookieTreeNode>(title) {}
~CookieTreeNode() override {}
// Recursively traverse the child nodes of this node and collect the storage
// size data.
virtual int64_t InclusiveSize() const;
// Recursively traverse the child nodes and calculate the number of nodes of
// type CookieTreeCookieNode.
virtual int NumberOfCookies() const;
// Delete backend storage for this node, and any children nodes. (E.g. delete
// the cookie from CookieMonster, clear the database, and so forth.)
virtual void DeleteStoredObjects();
// Gets a pointer back to the associated model for the tree we are in.
virtual CookiesTreeModel* GetModel() const;
// Returns a struct with detailed information used to populate the details
// part of the view.
virtual DetailedInfo GetDetailedInfo() const = 0;
protected:
void AddChildSortedByTitle(std::unique_ptr<CookieTreeNode> new_child);
private:
DISALLOW_COPY_AND_ASSIGN(CookieTreeNode);
};
// CookieTreeRootNode ---------------------------------------------------------
// The node at the root of the CookieTree that gets inserted into the view.
class CookieTreeRootNode : public CookieTreeNode {
public:
explicit CookieTreeRootNode(CookiesTreeModel* model);
~CookieTreeRootNode() override;
CookieTreeHostNode* GetOrCreateHostNode(const GURL& url);
// CookieTreeNode methods:
CookiesTreeModel* GetModel() const override;
DetailedInfo GetDetailedInfo() const override;
private:
CookiesTreeModel* model_;
DISALLOW_COPY_AND_ASSIGN(CookieTreeRootNode);
};
// CookieTreeHostNode -------------------------------------------------------
class CookieTreeHostNode : public CookieTreeNode {
public:
// Returns the host node's title to use for a given URL.
static base::string16 TitleForUrl(const GURL& url);
explicit CookieTreeHostNode(const GURL& url);
~CookieTreeHostNode() override;
// CookieTreeNode methods:
DetailedInfo GetDetailedInfo() const override;
int64_t InclusiveSize() const override;
// CookieTreeHostNode methods:
CookieTreeCookiesNode* GetOrCreateCookiesNode();
CookieTreeDatabasesNode* GetOrCreateDatabasesNode();
CookieTreeLocalStoragesNode* GetOrCreateLocalStoragesNode();
CookieTreeSessionStoragesNode* GetOrCreateSessionStoragesNode();
CookieTreeAppCachesNode* GetOrCreateAppCachesNode();
CookieTreeIndexedDBsNode* GetOrCreateIndexedDBsNode();
CookieTreeFileSystemsNode* GetOrCreateFileSystemsNode();
CookieTreeServiceWorkersNode* GetOrCreateServiceWorkersNode();
CookieTreeSharedWorkersNode* GetOrCreateSharedWorkersNode();
CookieTreeCacheStoragesNode* GetOrCreateCacheStoragesNode();
CookieTreeQuotaNode* UpdateOrCreateQuotaNode(
std::list<BrowsingDataQuotaHelper::QuotaInfo>::iterator quota_info);
CookieTreeFlashLSONode* GetOrCreateFlashLSONode(const std::string& domain);
CookieTreeMediaLicensesNode* GetOrCreateMediaLicensesNode();
std::string canonicalized_host() const { return canonicalized_host_; }
// Creates an content exception for this origin of type
// ContentSettingsType::COOKIES.
void CreateContentException(content_settings::CookieSettings* cookie_settings,
ContentSetting setting) const;
// True if a content exception can be created for this origin.
bool CanCreateContentException() const;
std::string GetHost() const;
void UpdateHostUrl(const GURL& url);
private:
// Pointers to the cookies, databases, local and session storage and appcache
// nodes. When we build up the tree we need to quickly get a reference to
// the COOKIES node to add children. Checking each child and interrogating
// them to see if they are a COOKIES, APPCACHES, DATABASES etc node seems
// less preferable than storing an extra pointer per origin.
CookieTreeCookiesNode* cookies_child_ = nullptr;
CookieTreeDatabasesNode* databases_child_ = nullptr;
CookieTreeLocalStoragesNode* local_storages_child_ = nullptr;
CookieTreeSessionStoragesNode* session_storages_child_ = nullptr;
CookieTreeAppCachesNode* appcaches_child_ = nullptr;
CookieTreeIndexedDBsNode* indexed_dbs_child_ = nullptr;
CookieTreeFileSystemsNode* file_systems_child_ = nullptr;
CookieTreeQuotaNode* quota_child_ = nullptr;
CookieTreeServiceWorkersNode* service_workers_child_ = nullptr;
CookieTreeSharedWorkersNode* shared_workers_child_ = nullptr;
CookieTreeCacheStoragesNode* cache_storages_child_ = nullptr;
CookieTreeFlashLSONode* flash_lso_child_ = nullptr;
CookieTreeMediaLicensesNode* media_licenses_child_ = nullptr;
// The URL for which this node was initially created.
GURL url_;
std::string canonicalized_host_;
DISALLOW_COPY_AND_ASSIGN(CookieTreeHostNode);
};
// CookiesTreeModel -----------------------------------------------------------
class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> {
public:
CookiesTreeModel(std::unique_ptr<LocalDataContainer> data_container,
ExtensionSpecialStoragePolicy* special_storage_policy);
~CookiesTreeModel() override;
// Given a CanonicalCookie, return the ID of the message which should be
// displayed in various ports' "Send for:" UI.
static int GetSendForMessageID(const net::CanonicalCookie& cookie);
// Because non-cookie nodes are fetched in a background thread, they are not
// present at the time the Model is created. The Model then notifies its
// observers for every item added from databases, local storage, and
// appcache. We extend the Observer interface to add notifications before and
// after these batch inserts.
class Observer : public ui::TreeModelObserver {
public:
virtual void TreeModelBeginBatch(CookiesTreeModel* model) {}
virtual void TreeModelEndBatch(CookiesTreeModel* model) {}
};
// This class defines the scope for batch updates. It can be created as a
// local variable and the destructor will terminate the batch update, if one
// has been started.
class ScopedBatchUpdateNotifier {
public:
ScopedBatchUpdateNotifier(CookiesTreeModel* model,
CookieTreeNode* node);
~ScopedBatchUpdateNotifier();
void StartBatchUpdate();
private:
CookiesTreeModel* model_;
CookieTreeNode* node_;
bool batch_in_progress_ = false;
};
// ui::TreeModel methods:
// Returns the set of icons for the nodes in the tree. You only need override
// this if you don't want to use the default folder icons.
void GetIcons(std::vector<gfx::ImageSkia>* icons) override;
// Returns the index of the icon to use for |node|. Return -1 to use the
// default icon. The index is relative to the list of icons returned from
// GetIcons.
int GetIconIndex(ui::TreeModelNode* node) override;
// CookiesTreeModel methods:
void DeleteAllStoredObjects();
// Deletes a specific node in the tree, identified by |cookie_node|, and its
// subtree.
void DeleteCookieNode(CookieTreeNode* cookie_node);
// Filter the origins to only display matched results.
void UpdateSearchResults(const base::string16& filter);
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Returns the set of extensions which protect the data item represented by
// this node from deletion.
// Returns nullptr if the node doesn't represent a protected data item or the
// special storage policy is nullptr.
const extensions::ExtensionSet* ExtensionsProtectingNode(
const CookieTreeNode& cookie_node);
#endif
// Manages CookiesTreeModel::Observers. This will also call
// TreeNodeModel::AddObserver so that it gets all the proper notifications.
// Note that the converse is not true: simply adding a TreeModelObserver will
// not get CookiesTreeModel::Observer notifications.
virtual void AddCookiesTreeObserver(Observer* observer);
virtual void RemoveCookiesTreeObserver(Observer* observer);
// Methods that update the model based on the data retrieved by the browsing
// data helpers.
void PopulateAppCacheInfo(LocalDataContainer* container);
void PopulateCookieInfo(LocalDataContainer* container);
void PopulateDatabaseInfo(LocalDataContainer* container);
void PopulateLocalStorageInfo(LocalDataContainer* container);
void PopulateSessionStorageInfo(LocalDataContainer* container);
void PopulateIndexedDBInfo(LocalDataContainer* container);
void PopulateFileSystemInfo(LocalDataContainer* container);
void PopulateQuotaInfo(LocalDataContainer* container);
void PopulateServiceWorkerUsageInfo(LocalDataContainer* container);
void PopulateSharedWorkerInfo(LocalDataContainer* container);
void PopulateCacheStorageUsageInfo(LocalDataContainer* container);
void PopulateFlashLSOInfo(LocalDataContainer* container);
void PopulateMediaLicenseInfo(LocalDataContainer* container);
LocalDataContainer* data_container() {
return data_container_.get();
}
// Set the number of |batches_expected| this class should expect to receive.
// If |reset| is true, then this is a new set of batches, but if false, then
// this is a revised number (batches originally counted should no longer be
// expected).
void SetBatchExpectation(int batches_expected, bool reset);
// Create CookiesTreeModel by profile info.
static std::unique_ptr<CookiesTreeModel> CreateForProfile(Profile* profile);
static browsing_data::CookieHelper::IsDeletionDisabledCallback
GetCookieDeletionDisabledCallback(Profile* profile);
private:
enum CookieIconIndex { COOKIE = 0, DATABASE = 1 };
// Record that one batch has been delivered.
void RecordBatchSeen();
// Record that one batch has begun processing. If this is the first batch then
// observers will be notified that batch processing has started.
void NotifyObserverBeginBatch();
// Record that one batch has finished processing. If this is the last batch
// then observers will be notified that batch processing has ended.
void NotifyObserverEndBatch();
// Notifies observers if expected batch count has been delievered and all
// batches have finished processing.
void MaybeNotifyBatchesEnded();
void PopulateAppCacheInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateCookieInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateDatabaseInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateLocalStorageInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateSessionStorageInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateIndexedDBInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateFileSystemInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateQuotaInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateServiceWorkerUsageInfoWithFilter(
LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateSharedWorkerInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateCacheStorageUsageInfoWithFilter(
LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
void PopulateMediaLicenseInfoWithFilter(LocalDataContainer* container,
ScopedBatchUpdateNotifier* notifier,
const base::string16& filter);
#if BUILDFLAG(ENABLE_EXTENSIONS)
// The extension special storage policy; see ExtensionsProtectingNode() above.
scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_;
#endif
// Map of app ids to LocalDataContainer objects to use when retrieving
// locally stored data.
std::unique_ptr<LocalDataContainer> data_container_;
// The CookiesTreeModel maintains a separate list of observers that are
// specifically of the type CookiesTreeModel::Observer.
base::ObserverList<Observer>::Unchecked cookies_observer_list_;
// Keeps track of how many batches the consumer of this class says it is going
// to send.
int batches_expected_ = 0;
// Keeps track of how many batches we've seen.
int batches_seen_ = 0;
// Counts how many batches have started already. If this is non-zero and lower
// than batches_ended_, then this model is still batching updates.
int batches_started_ = 0;
// Counts how many batches have finished.
int batches_ended_ = 0;
};
#endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_
| 43.726882 | 80 | 0.733881 | [
"vector",
"model"
] |
36a076526c53139f123e49bb2c76492ea9418cc7 | 2,705 | h | C | Modules/Segmentation/Interactions/mitkPickingTool.h | liu3xing3long/MITK-2016.11 | 385c506f9792414f40337e106e13d5fd61aa3ccc | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Modules/Segmentation/Interactions/mitkPickingTool.h | liu3xing3long/MITK-2016.11 | 385c506f9792414f40337e106e13d5fd61aa3ccc | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Modules/Segmentation/Interactions/mitkPickingTool.h | liu3xing3long/MITK-2016.11 | 385c506f9792414f40337e106e13d5fd61aa3ccc | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | /*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef mitkPickingTool_h_Included
#define mitkPickingTool_h_Included
#include "itkImage.h"
#include "mitkAutoSegmentationTool.h"
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkPointSet.h"
#include "mitkSinglePointDataInteractor.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Extracts a single region from a segmentation image and creates a new image with same geometry of the input
image.
The region is extracted in 3D space. This is done by performing region growing within the desired region.
Use shift click to add the seed point.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
*/
class MITKSEGMENTATION_EXPORT PickingTool : public AutoSegmentationTool
{
public:
mitkClassMacro(PickingTool, AutoSegmentationTool);
itkFactorylessNewMacro(Self) itkCloneMacro(Self)
virtual const char **GetXPM() const override;
virtual const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
virtual void Activated() override;
virtual void Deactivated() override;
virtual DataNode::Pointer GetPointSetNode();
mitk::DataNode *GetReferenceData();
mitk::DataNode *GetWorkingData();
mitk::DataStorage *GetDataStorage();
void ConfirmSegmentation();
protected:
PickingTool(); // purposely hidden
virtual ~PickingTool();
// Callback for point add event of PointSet
void OnPointAdded();
// Observer id
long m_PointSetAddObserverTag;
mitk::DataNode::Pointer m_ResultNode;
// itk regrowing
template <typename TPixel, unsigned int VImageDimension>
void StartRegionGrowing(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::BaseGeometry *imageGeometry,
mitk::PointSet::PointType seedPoint);
// seed point
PointSet::Pointer m_PointSet;
SinglePointDataInteractor::Pointer m_SeedPointInteractor;
DataNode::Pointer m_PointSetNode;
DataNode *m_WorkingData;
};
} // namespace
#endif
| 27.886598 | 116 | 0.675416 | [
"geometry",
"3d"
] |
36a6895b70c5ef3a5f4d433d8a1b4523f5e1e51e | 15,986 | h | C | src/mpdc.h | jprjr/lua-music-visualizer | bdfe77c642e8924a8f2a9be04199c667e23a4635 | [
"MIT"
] | 4 | 2019-11-18T17:28:36.000Z | 2021-11-20T21:07:08.000Z | src/mpdc.h | jprjr/lua-music-visualizer | bdfe77c642e8924a8f2a9be04199c667e23a4635 | [
"MIT"
] | 2 | 2020-09-08T12:32:12.000Z | 2021-08-13T20:11:42.000Z | src/mpdc.h | jprjr/lua-music-visualizer | bdfe77c642e8924a8f2a9be04199c667e23a4635 | [
"MIT"
] | null | null | null | #ifndef MPDC_HEADER
#define MPDC_HEADER
#include <stdarg.h>
#include "int.h"
#ifndef MPDC_BUFFER_SIZE
#define MPDC_BUFFER_SIZE 4096
#endif
#ifndef MPDC_OP_QUEUE_SIZE
#define MPDC_OP_QUEUE_SIZE 100
#endif
#ifndef MPDC_ALL_STATIC
#define MPDC_ALL_STATIC 0
#endif
#if MPDC_ALL_STATIC
#define STATIC static
#else
#define STATIC
#endif
typedef struct mpdc_connection_s mpdc_connection;
typedef struct mpdc_ringbuf_s mpdc_ringbuf;
enum MPDC_COMMAND {
MPDC_COMMAND_CLEARERROR, MPDC_COMMAND_CURRENTSONG, MPDC_COMMAND_IDLE,
MPDC_COMMAND_STATUS, MPDC_COMMAND_STATS, MPDC_COMMAND_CONSUME,
MPDC_COMMAND_CROSSFADE, MPDC_COMMAND_MIXRAMPDB, MPDC_COMMAND_MIXRAMPDELAY,
MPDC_COMMAND_RANDOM, MPDC_COMMAND_REPEAT, MPDC_COMMAND_SETVOL,
MPDC_COMMAND_SINGLE, MPDC_COMMAND_REPLAY_GAIN_MODE, MPDC_COMMAND_REPLAY_GAIN_STATUS,
MPDC_COMMAND_VOLUME, MPDC_COMMAND_NEXT, MPDC_COMMAND_PAUSE, MPDC_COMMAND_PLAY,
MPDC_COMMAND_PLAYID, MPDC_COMMAND_PREVIOUS, MPDC_COMMAND_SEEK, MPDC_COMMAND_SEEKID,
MPDC_COMMAND_SEEKCUR, MPDC_COMMAND_STOP, MPDC_COMMAND_ADD, MPDC_COMMAND_ADDID,
MPDC_COMMAND_CLEAR, MPDC_COMMAND_DELETE, MPDC_COMMAND_DELETEID, MPDC_COMMAND_MOVE,
MPDC_COMMAND_MOVEID, MPDC_COMMAND_PLAYLIST, MPDC_COMMAND_PLAYLISTFIND, MPDC_COMMAND_PLAYLISTID,
MPDC_COMMAND_PLAYLISTINFO, MPDC_COMMAND_PLAYLISTSEARCH, MPDC_COMMAND_PLCHANGES, MPDC_COMMAND_PLCHANGESPOSID,
MPDC_COMMAND_PRIO, MPDC_COMMAND_PRIOID, MPDC_COMMAND_RANGEID, MPDC_COMMAND_SHUFFLE,
MPDC_COMMAND_SWAP, MPDC_COMMAND_SWAPID, MPDC_COMMAND_ADDTAGID, MPDC_COMMAND_CLEARTAGID,
MPDC_COMMAND_LISTPLAYLIST, MPDC_COMMAND_LISTPLAYLISTINFO, MPDC_COMMAND_LISTPLAYLISTS, MPDC_COMMAND_LOAD,
MPDC_COMMAND_PLAYLISTADD, MPDC_COMMAND_PLAYLISTCLEAR, MPDC_COMMAND_PLAYLISTDELETE, MPDC_COMMAND_PLAYLISTMOVE,
MPDC_COMMAND_RENAME, MPDC_COMMAND_RM, MPDC_COMMAND_SAVE, MPDC_COMMAND_ALBUMART, MPDC_COMMAND_COUNT,
MPDC_COMMAND_GETFINGERPRINT, MPDC_COMMAND_FIND, MPDC_COMMAND_FINDADD, MPDC_COMMAND_LIST, MPDC_COMMAND_LISTALL,
MPDC_COMMAND_LISTALLINFO, MPDC_COMMAND_LISTFILES, MPDC_COMMAND_LSINFO, MPDC_COMMAND_READCOMMENTS,
MPDC_COMMAND_SEARCH, MPDC_COMMAND_SEARCHADD, MPDC_COMMAND_SEARCHADDPL, MPDC_COMMAND_UPDATE,
MPDC_COMMAND_RESCAN, MPDC_COMMAND_MOUNT, MPDC_COMMAND_UNMOUNT, MPDC_COMMAND_LISTMOUNTS,
MPDC_COMMAND_LISTNEIGHBORS, MPDC_COMMAND_STICKER, MPDC_COMMAND_CLOSE, MPDC_COMMAND_KILL,
MPDC_COMMAND_PASSWORD, MPDC_COMMAND_PING, MPDC_COMMAND_TAGTYPES, MPDC_COMMAND_PARTITION,
MPDC_COMMAND_LISTPARTITIONS, MPDC_COMMAND_NEWPARTITION, MPDC_COMMAND_DISABLEOUTPUT, MPDC_COMMAND_ENABLEOUTPUT,
MPDC_COMMAND_OUTPUTS, MPDC_COMMAND_OUTPUTSET, MPDC_COMMAND_CONFIG, MPDC_COMMAND_COMMANDS,
MPDC_COMMAND_NOTCOMMANDS, MPDC_COMMAND_URLHANDLERS, MPDC_COMMAND_DECODERS, MPDC_COMMAND_SUBSCRIBE,
MPDC_COMMAND_UNSUBSCRIBE, MPDC_COMMAND_CHANNELS, MPDC_COMMAND_READMESSAGES, MPDC_COMMAND_SENDMESSAGE,
MPDC_COMMAND_READPICTURE, MPDC_COMMAND_MOVEOUTPUT, MPDC_COMMAND_DELPARTITION, MPDC_COMMAND_BINARYLIMIT,
};
enum MPDC_EVENT {
MPDC_EVENT_DATABASE = 1,
MPDC_EVENT_UPDATE = 2,
MPDC_EVENT_STORED_PLAYLIST = 4,
MPDC_EVENT_PLAYLIST = 8,
MPDC_EVENT_PLAYER = 16,
MPDC_EVENT_MIXER = 32,
MPDC_EVENT_OUTPUT = 64,
MPDC_EVENT_OPTIONS = 128,
MPDC_EVENT_PARTITION = 256,
MPDC_EVENT_STICKER = 512,
MPDC_EVENT_SUBSCRIPTION = 1024,
MPDC_EVENT_MESSAGE = 2048
};
/* all functions:
* return 1+ on success
* 0 on nothing (ie, if a file call would block)
* -1 on error/EOF */
/* read/write are responsible for getting data in/out */
/* required */
/* should return -1 on error or eof, 0 if no data available, 1+ for data read/written */
typedef int (*mpdc_write_func)(void *ctx, const jpr_uint8 *buf, size_t);
typedef int (*mpdc_read_func)(void *ctx, jpr_uint8 *buf, size_t);
/* function called to trigger that the client is ready to read */
/* if client is blocking, set this to NULL */
/* returns <= 0 on errors, 1+ on success */
typedef int (*mpdc_read_notify_func)(mpdc_connection *);
/* function called to trigger that the client is ready to write */
/* if client is blocking, set this to NULL */
/* returns <= 0 on errors, 1+ on success */
typedef int (*mpdc_write_notify_func)(mpdc_connection *);
/* resolve is called at the end of mpdc_setup */
/* optional */
/* return <=0 on errors, 1+ on success */
typedef int (*mpdc_resolve_func)(mpdc_connection *, const char *hostname);
/* connect is called at the end of mpdc_connect */
/* required */
/* return <=0 on errors, 1+ on success */
typedef int (*mpdc_connect_func)(mpdc_connection *, const char *hostname, jpr_uint16 port);
/* called when disconnected from MPD */
typedef void (*mpdc_disconnect_func)(mpdc_connection *);
/* called when MPD starts reading a response from a command */
typedef void (*mpdc_response_begin_func)(mpdc_connection *, const char *cmd);
/* called when MPD finishes reading a response from a command */
/* `ok` indicates if the command finished in OK or error */
typedef void (*mpdc_response_end_func)(mpdc_connection *, const char *cmd, int ok, const char *err);
/* called when receiving a response from a command */
/* key will always be null-terminated, value may not (ie,
* in the case of the albumart command */
typedef void (*mpdc_response_func)(mpdc_connection *,const char *cmd, const char *key, const jpr_uint8 *value, size_t length);
/* "private" method for receiving data */
typedef int (*_mpdc_receive_func)(mpdc_connection *);
struct mpdc_ringbuf_s {
jpr_uint8 autofill;
jpr_uint8 autoflush;
jpr_uint8 *buf;
jpr_uint8 *head;
jpr_uint8 *tail;
size_t size;
void *read_ctx;
void *write_ctx;
mpdc_read_func read;
mpdc_write_func write;
};
struct mpdc_connection_s {
void *ctx;
jpr_uint8 op_buf[MPDC_OP_QUEUE_SIZE];
jpr_uint8 out_buf[MPDC_BUFFER_SIZE];
jpr_uint8 in_buf[MPDC_BUFFER_SIZE];
jpr_uint8 scratch[MPDC_BUFFER_SIZE];
mpdc_ringbuf op;
mpdc_ringbuf out;
mpdc_ringbuf in;
char *host;
char *password;
jpr_uint8 cb_level;
jpr_uint8 state;
jpr_uint16 port;
jpr_uint16 major;
jpr_uint16 minor;
jpr_uint16 patch;
int _mode;
size_t _bytes;
mpdc_write_func write;
mpdc_read_func read;
mpdc_resolve_func resolve;
mpdc_response_begin_func response_begin;
mpdc_response_func response;
mpdc_response_end_func response_end;
mpdc_connect_func connect;
mpdc_disconnect_func disconnect;
mpdc_write_notify_func write_notify;
mpdc_read_notify_func read_notify;
_mpdc_receive_func _receive;
};
/* returns 0 on success, anything else on failure */
STATIC
int mpdc_init(mpdc_connection *);
/* calls the resolve callback */
/* setup looks in host/port strings to find MPD password, if needed */
/* if you already have the port in an integer format, set "port" to
* NULL and use uport instead.
* Setting host to NULL will use the default host "127.0.0.1" */
/* returns 1 on success, anything else on failure */
STATIC
int mpdc_setup(mpdc_connection *, char *host, char *port, jpr_uint16 uport);
/* switch between the block/noblock modes, usually auto-detected */
STATIC
void mpdc_block(mpdc_connection *, int status);
/* calls the connect callback */
STATIC
int mpdc_connect(mpdc_connection *connection);
/* should be called to send the next queued command */
/* returns 1 on succesfully sending the whole line, 0
* on a partial send, -1 on error */
/* automatically calls read_notify if all data was sent */
STATIC
int mpdc_send(mpdc_connection *connection);
/* should be called to read and process data */
/* returns 1 on finishing a command, 0 on partial data, -1 on error */
STATIC
int mpdc_receive(mpdc_connection *connection);
STATIC
void mpdc_disconnect(mpdc_connection *connection);
/* mpdc commands return 1 on success */
STATIC
int mpdc_password(mpdc_connection *connection, const char *password);
STATIC
int mpdc_idle(mpdc_connection *connection, jpr_uint16 events);
STATIC
int mpdc__put(mpdc_connection *connection, jpr_uint8 cmd, const char *fmt, ...);
#define mpdc__zero_arg(conn,cmd) mpdc__put((conn),cmd,"")
/* the following commands take no arguments, besides the
* connection object.
* they all have a function signature like:
* int mpdc_clearerror(mpdc_connection *connection) */
#define mpdc_clearerror(conn) mpdc__zero_arg((conn),MPDC_COMMAND_CLEARERROR)
#define mpdc_currentsong(conn) mpdc__zero_arg((conn),MPDC_COMMAND_CURRENTSONG)
#define mpdc_status(conn) mpdc__zero_arg((conn), MPDC_COMMAND_STATUS)
#define mpdc_stats(conn) mpdc__zero_arg((conn), MPDC_COMMAND_STATS)
#define mpdc_replay_gain_status(conn) mpdc__zero_arg((conn), MPDC_COMMAND_REPLAY_GAIN_STATUS)
#define mpdc_next(conn) mpdc__zero_arg((conn), MPDC_COMMAND_NEXT)
#define mpdc_previous(conn) mpdc__zero_arg((conn), MPDC_COMMAND_PREVIOUS)
#define mpdc_stop(conn) mpdc__zero_arg((conn), MPDC_COMMAND_STOP)
#define mpdc_clear(conn) mpdc__zero_arg((conn), MPDC_COMMAND_CLEAR)
#define mpdc_playlist(conn) mpdc__zero_arg((conn), MPDC_COMMAND_PLAYLIST)
#define mpdc_listplaylists(conn) mpdc__zero_arg((conn), MPDC_COMMAND_LISTPLAYLISTS)
#define mpdc_listmounts(conn) mpdc__zero_arg((conn), MPDC_COMMAND_LISTMOUNTS)
#define mpdc_listneighbors(conn) mpdc__zero_arg((conn), MPDC_COMMAND_LISTNEIGHBORS)
#define mpdc_close(conn) mpdc__zero_arg((conn), MPDC_COMMAND_CLOSE)
#define mpdc_kill(conn) mpdc__zero_arg((conn), MPDC_COMMAND_KILL)
#define mpdc_ping(conn) mpdc__zero_arg((conn), MPDC_COMMAND_PING)
#define mpdc_tagtypes(conn) mpdc__zero_arg((conn), MPDC_COMMAND_TAGTYPES)
#define mpdc_listpartitions(conn) mpdc__zero_arg((conn), MPDC_COMMAND_LISTPARTITIONS)
#define mpdc_outputs(conn) mpdc__zero_arg((conn),MPDC_COMMAND_OUTPUTS)
#define mpdc_config(conn) mpdc__zero_arg((conn), MPDC_COMMAND_CONFIG)
#define mpdc_commands(conn) mpdc__zero_arg((conn),MPDC_COMMAND_COMMANDS)
#define mpdc_notcommands(conn) mpdc__zero_arg((conn),MPDC_COMMAND_NOTCOMMANDS)
#define mpdc_urlhandlers(conn) mpdc__zero_arg((conn), MPDC_COMMAND_URLHANDLERS)
#define mpdc_decoders(conn) mpdc__zero_arg((conn), MPDC_COMMAND_DECODERS)
#define mpdc_channels(conn) mpdc__zero_arg((conn), MPDC_COMMAND_CHANNELS)
#define mpdc_readmessages(conn) mpdc__zero_arg((conn), MPDC_COMMAND_READMESSAGES)
/* used to provide "overloading" */
#if __STDC_VERSION__ >= 199901L
#define GET_MACRO(_1,_2,_3,_4,NAME,...) NAME
#endif
#define mpdc_albumart(conn,path,offset) mpdc__put((conn), MPDC_COMMAND_ALBUMART,"su",path,offset)
#define mpdc_subscribe(conn,chan) mpdc__put((conn), MPDC_COMMAND_SUBSCRIBE,"s",chan)
#define mpdc_consume(conn,state) mpdc__put((conn),MPDC_COMMAND_CONSUME,"u",( state == 0 ? 0 : 1 ))
#define mpdc_crossfade(conn,seconds) mpdc__put((conn),MPDC_COMMAND_CONSUME,"u",seconds)
#define mpdc_mixrampdb(conn,thresh) mpdc__put((conn),MPDC_COMMAND_MIXRAMPDB,"d",thresh)
#define mpdc_mixrampdelay(conn,seconds) mpdc__put((conn),MPDC_COMMAND_MIXRAMPDELAY,"d",seconds)
#define mpdc_random(conn,state) mpdc__put((conn),MPDC_COMMAND_RANDOM,"u",( state == 0 ? 0 : 1 ))
#define mpdc_repeat(conn,state) mpdc__put((conn),MPDC_COMMAND_REPEAT,"u",( state == 0 ? 0 : 1 ))
#define mpdc_setvol(conn,volume) mpdc__put((conn),MPDC_COMMAND_SETVOL,"u",( volume >= 0 && volume <= 100 ? volume : 0))
#define mpdc_single(conn,state) mpdc__put((conn),MPDC_COMMAND_SINGLE,"u",( state == 0 ? 0 : 1 ))
#define mpdc_replay_gain_mode(conn,mode) mpdc__put((conn),MPDC_COMMAND_REPLAY_GAIN_MODE,"s",mode)
#define mpdc_volume(conn,change) mpdc__put((conn),MPDC_COMMAND_VOLUME,"d",change)
#define mpdc_pause(conn,state) mpdc__put((conn),MPDC_COMMAND_PAUSE,"u",( state == 0 ? 0 : 1 ))
#define mpdc_play1(conn) mpdc__zero_arg((conn), MPDC_COMMAND_PLAY)
#define mpdc_play2(conn,songpos) mpdc__put((conn),MPDC_COMMAND_PLAY,"u",songpos)
#if __STDC_VERSION__ >= 199901L
#define mpdc_play(...) GET_MACRO(__VA_ARGS__,void,void,mpdc_play2,mpdc_play1)(__VA_ARGS__)
#endif
#define mpdc_playid1(conn) mpdc__zero_arg((conn), MPDC_COMMAND_PLAYID)
#define mpdc_playid2(conn,songpos) mpdc__put((conn),MPDC_COMMAND_PLAYID,"u",songpos)
#if __STDC_VERSION__ >= 199901L
#define mpdc_playid(...) GET_MACRO(__VA_ARGS__,void,void,mpdc_playid2,mpdc_playid1)(__VA_ARGS__)
#endif
#define mpdc_seek(conn,songpos,time) mpdc__put((conn),MPDC_COMMAND_SEEK,"uu",songpos,time)
#define mpdc_seekid(conn,songid,time) mpdc__put((conn),MPDC_COMMAND_SEEKID,"uu",seekid,time)
#define mpdc_seekcur(conn,time) mpdc__put((conn),MPDC_COMMAND_SEEKCUR,"u",seekcur)
#define mpdc_add(conn,uri) mpdc__put((conn),MPDC_COMMAND_ADD,"s",uri)
#define mpdc_addid2(conn,uri) mpdc__put((conn),MPDC_COMMAND_ADDID,"s",uri)
#define mpdc_addid3(conn,uri,pos) mpdc__put((conn),MPDC_COMMAND_ADDID,"su",uri,pos)
#if __STDC_VERSION__ >= 199901L
#define mpdc_addid(...) GET_MACRO(__VA_ARGS__,void,mpdc_addid3,mpdc_addid2,void)(__VA_ARGS__)
#endif
#define mpdc_delete2(conn,pos) mpdc__put((conn),MPDC_COMMAND_DELETE,"u",pos)
#define mpdc_delete3(conn,start,end) mpdc__put((conn),MPDC_COMMAND_DELETE,"u:U",start,end)
#if __STDC_VERSION__ >= 199901L
#define mpdc_delete(...) GET_MACRO(__VA_ARGS__,void,mpdc_delete3,mpdc_delete2,void)(__VA_ARGS__)
#endif
#define mpdc_deleteid(conn,id) mpdc__put((conn),MPDC_COMMAND_DELETEID,"u",id)
#define mpdc_move4(conn,start,end,to) mpdc__put((conn),MPDC_COMMAND_MOVE,"u:Uu",start,end,to)
#define mpdc_move3(conn,from,to) mpdc__put((conn),MPDC_COMMAND_MOVE,"uu", from, to)
#if __STDC_VERSION__ >= 199901L
#define mpdc_move(...) GET_MACRO(__VA_ARGS__,mpdc_move4,mpdc_move3,void,void)(__VA_ARGS__)
#endif
#define mpdc_moveid(conn,from,to) mpdc__put((conn),MPDC_COMMAND_MOVEID,"uu",from,to)
#define mpdc_playlistfind(conn,tag,needle) mpdc__put((conn),MPDC_COMMANDPLAYLISTFIND,"ss",tag,needle)
#define mpdc_playlistid1(conn) mpdc__zero_arg((conn),MPDC_COMMAND_PLAYLISTID)
#define mpdc_playlistid2(conn,id) mpdc__put((conn),MPDC_COMMAND_PLAYLISTID,"u",id)
#if __STDC_VERSION__ >= 199901L
#define mpdc_playlistid(...) GET_MACRO(__VA_ARGS__,void,void,mpdc_playlistid2,mpdc_playlistid1)(__VA_ARGS__)
#endif
#define mpdc_playlistinfo1(conn) mpdc__zero_arg((conn),MPDC_COMMAND_PLAYLISTINFO)
#define mpdc_playlistinfo2(conn,pos) mpdc__put((conn),MPDC_COMMAND_PLAYLISTINFO,"u",pos)
#define mpdc_playlistinfo3(conn,start,end) mpdc__put((conn),MPDC_COMMAND_PLAYLISTINFO,"u:U",start,end)
#if __STDC_VERSION__ >= 199901L
#define mpdc_playlistinfo(...) GET_MACRO(__VA_ARGS__,void,mpdc_playlistinfo3,mpdc_playlistinfo2,mpdc_playlistinfo1)(__VA_ARGS__)
#endif
#define mpdc_playlistsearch(conn,tag,needle) mpdc__put((conn),MPDC_COMMAND_PLAYLISTSEARCH,"ss",tag,needle)
#define mpdc_plchanges2(conn,version) mpdc__put((conn),MPDC_COMMAND_PLCHANGES,"u",version)
#define mpdc_plchanges4(conn,version,start,end) mpdc__put((conn),MPDC_COMMAND_PLCHANGES,"uu:U",version,start,end)
#if __STDC_VERSION__ >= 199901L
#define mpdc_plchanges(...) GET_MACRO(__VA_ARGS__,mpdc_plchanges4,void,void,mpdc_plchanges1)(__VA_ARGS__)
#endif
#define mpdc_plchangesposid2(conn,version) mpdc__put((conn),MPDC_COMMAND_PLCHANGESPOSID,"u",version)
#define mpdc_plchangesposid4(conn,version,start,end) mpdc__put((conn),MPDC_COMMAND_PLCHANGESPOSID,"uu:U",version,start,end)
#if __STDC_VERSION__ >= 199901L
#define mpdc_plchangesposid(...) GET_MACRO(__VA_ARGS__,mpdc_plchangesposid4,void,void,mpdc_plchangesposid1)(__VA_ARGS__)
#endif
#define mpdc_prio(conn,prio,start,end) mpdc__put((conn),MPDC_COMMAND_PRIO,"uu:U",prio,start,end)
#define mpdc_priod(conn,prio,id) mpdc__put((conn),MPDC_COMMAND_PRIOD,"uu",prio,id)
#define mpdc_sendmessage(conn,channel,text) mpdc__put((conn),MPDC_COMMAND_SENDMESSAGE,"ss",channel,text)
#if 0
#define mpdc_consume1(conn) mpdc__zero_arg((conn),MPDC_COMMAND_CONSUME)
#define mpdc_consume2(conn,state) mpdc__put((conn),MPDC_COMMAND_CONSUME,"u",state)
#define mpdc_consume(...) GET_MACRO(__VA_ARGS__,void,void,mpdc_consume2,mpdc_consume1)(__VA_ARGS__)
#endif
#endif
| 43.79726 | 128 | 0.786376 | [
"object"
] |
36a6e0914b095e3ca2242982931f735b9444c0c8 | 4,666 | h | C | be/src/kudu/security/token_verifier.h | uk0/impala | 256f37f17f62c21927e3aebee57d512758a42f81 | [
"Apache-2.0"
] | null | null | null | be/src/kudu/security/token_verifier.h | uk0/impala | 256f37f17f62c21927e3aebee57d512758a42f81 | [
"Apache-2.0"
] | 1 | 2022-03-04T03:06:56.000Z | 2022-03-04T03:06:56.000Z | be/src/kudu/security/token_verifier.h | uk0/impala | 256f37f17f62c21927e3aebee57d512758a42f81 | [
"Apache-2.0"
] | null | null | null | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#pragma once
#include <cstdint>
#include <map>
#include <memory>
#include <vector>
#include "kudu/gutil/macros.h"
#include "kudu/gutil/port.h"
#include "kudu/util/rw_mutex.h"
namespace kudu {
class Status;
namespace security {
class SignedTokenPB;
class TokenPB;
class TokenSigningPublicKey;
class TokenSigningPublicKeyPB;
enum class TokenVerificationResult;
// Class responsible for verifying tokens provided to a server.
//
// This class manages a set of public keys, each identified by a sequence
// number. It exposes the latest known sequence number, which can be sent
// to a 'TokenSigner' running on another node. That node can then
// export public keys, which are transferred back to this node and imported
// into the 'TokenVerifier'.
//
// Each signed token also includes the key sequence number that signed it,
// so this class can look up the correct key and verify the token's
// validity and expiration.
//
// Note that this class does not perform any "business logic" around the
// content of a token. It only verifies that the token has a valid signature
// and is not yet expired. Any business rules around authorization or
// authentication are left up to callers.
//
// NOTE: old tokens are never removed from the underlying storage of this
// class. The assumption is that tokens rotate so infreqeuently that this
// slow leak is not worrisome. If this class is adopted for any use cases
// with frequent rotation, GC of expired tokens will need to be added.
//
// This class is thread-safe.
class TokenVerifier {
public:
TokenVerifier();
~TokenVerifier();
// Return the highest key sequence number known by this instance.
//
// If no keys are known, return -1.
int64_t GetMaxKnownKeySequenceNumber() const;
// Import a set of public keys provided by a TokenSigner instance
// (which might be running on a remote node). If any public keys already
// exist with matching key sequence numbers, they are replaced by
// the new keys.
Status ImportKeys(const std::vector<TokenSigningPublicKeyPB>& keys) WARN_UNUSED_RESULT;
// Export token signing public keys. Specifying the 'after_sequence_number'
// allows to get public keys with sequence numbers greater than
// 'after_sequence_number'. If the 'after_sequence_number' parameter is
// omitted, all known public keys are exported.
std::vector<TokenSigningPublicKeyPB> ExportKeys(
int64_t after_sequence_number = -1) const;
// Verify the signature on the given signed token, and deserialize the
// contents into 'token'.
TokenVerificationResult VerifyTokenSignature(
const SignedTokenPB& signed_token, TokenPB* token) const;
private:
typedef std::map<int64_t, std::unique_ptr<TokenSigningPublicKey>> KeysMap;
// Lock protecting keys_by_seq_
mutable RWMutex lock_;
KeysMap keys_by_seq_;
DISALLOW_COPY_AND_ASSIGN(TokenVerifier);
};
// Result of a token verification.
// Values added to this enum must also be added to VerificationResultToString().
enum class TokenVerificationResult {
// The signature is valid and the token is not expired.
VALID,
// The token itself is invalid (e.g. missing its signature or data,
// can't be deserialized, etc).
INVALID_TOKEN,
// The signature is invalid (i.e. cryptographically incorrect).
INVALID_SIGNATURE,
// The signature is valid, but the token has already expired.
EXPIRED_TOKEN,
// The signature is valid, but the signing key is no longer valid.
EXPIRED_SIGNING_KEY,
// The signing key used to sign this token is not available.
UNKNOWN_SIGNING_KEY,
// The token uses an incompatible feature which isn't supported by this
// version of the server. We reject the token to give a "default deny"
// policy.
INCOMPATIBLE_FEATURE
};
const char* TokenVerificationResultToString(TokenVerificationResult r);
} // namespace security
} // namespace kudu
| 36.740157 | 89 | 0.756965 | [
"vector"
] |
36a7a5f249aaf9991dafa3b07529a190ff4848a0 | 76,841 | c | C | src/backend/jit/llvm/llvmjit_expr.c | bradfordb-vmware/gpdb | 5cc23bd1df4133aaa7a80174f5b0950933a83cc2 | [
"PostgreSQL",
"Apache-2.0"
] | 5,535 | 2015-10-28T01:05:40.000Z | 2022-03-30T13:46:53.000Z | src/backend/jit/llvm/llvmjit_expr.c | bradfordb-vmware/gpdb | 5cc23bd1df4133aaa7a80174f5b0950933a83cc2 | [
"PostgreSQL",
"Apache-2.0"
] | 9,369 | 2015-10-28T07:48:01.000Z | 2022-03-31T23:56:42.000Z | src/backend/jit/llvm/llvmjit_expr.c | bradfordb-vmware/gpdb | 5cc23bd1df4133aaa7a80174f5b0950933a83cc2 | [
"PostgreSQL",
"Apache-2.0"
] | 1,800 | 2015-10-28T01:08:25.000Z | 2022-03-29T13:29:36.000Z | /*-------------------------------------------------------------------------
*
* llvmjit_expr.c
* JIT compile expressions.
*
* Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backend/jit/llvm/llvmjit_expr.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <llvm-c/Core.h>
#include <llvm-c/Target.h>
#include "access/htup_details.h"
#include "access/nbtree.h"
#include "access/tupconvert.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_type.h"
#include "executor/execdebug.h"
#include "executor/nodeAgg.h"
#include "executor/nodeSubplan.h"
#include "executor/execExpr.h"
#include "funcapi.h"
#include "jit/llvmjit.h"
#include "jit/llvmjit_emit.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "parser/parse_coerce.h"
#include "parser/parsetree.h"
#include "pgstat.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/date.h"
#include "utils/fmgrtab.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/timestamp.h"
#include "utils/typcache.h"
#include "utils/xml.h"
typedef struct CompiledExprState
{
LLVMJitContext *context;
const char *funcname;
} CompiledExprState;
static Datum ExecRunCompiledExpr(ExprState *state, ExprContext *econtext, bool *isNull);
static LLVMValueRef BuildV1Call(LLVMJitContext *context, LLVMBuilderRef b,
LLVMModuleRef mod, FunctionCallInfo fcinfo,
LLVMValueRef *v_fcinfo_isnull);
static void build_EvalXFunc(LLVMBuilderRef b, LLVMModuleRef mod,
const char *funcname,
LLVMValueRef v_state, LLVMValueRef v_econtext,
ExprEvalStep *op);
static LLVMValueRef create_LifetimeEnd(LLVMModuleRef mod);
/*
* JIT compile expression.
*/
bool
llvm_compile_expr(ExprState *state)
{
PlanState *parent = state->parent;
int i;
char *funcname;
LLVMJitContext *context = NULL;
LLVMBuilderRef b;
LLVMModuleRef mod;
LLVMTypeRef eval_sig;
LLVMValueRef eval_fn;
LLVMBasicBlockRef entry;
LLVMBasicBlockRef *opblocks;
/* state itself */
LLVMValueRef v_state;
LLVMValueRef v_econtext;
LLVMValueRef v_parent;
/* returnvalue */
LLVMValueRef v_isnullp;
/* tmp vars in state */
LLVMValueRef v_tmpvaluep;
LLVMValueRef v_tmpisnullp;
/* slots */
LLVMValueRef v_innerslot;
LLVMValueRef v_outerslot;
LLVMValueRef v_scanslot;
LLVMValueRef v_resultslot;
/* nulls/values of slots */
LLVMValueRef v_innervalues;
LLVMValueRef v_innernulls;
LLVMValueRef v_outervalues;
LLVMValueRef v_outernulls;
LLVMValueRef v_scanvalues;
LLVMValueRef v_scannulls;
LLVMValueRef v_resultvalues;
LLVMValueRef v_resultnulls;
/* stuff in econtext */
LLVMValueRef v_aggvalues;
LLVMValueRef v_aggnulls;
instr_time starttime;
instr_time endtime;
llvm_enter_fatal_on_oom();
/* get or create JIT context */
if (parent && parent->state->es_jit)
{
context = (LLVMJitContext *) parent->state->es_jit;
}
else
{
context = llvm_create_context(parent->state->es_jit_flags);
if (parent)
{
parent->state->es_jit = &context->base;
}
}
INSTR_TIME_SET_CURRENT(starttime);
mod = llvm_mutable_module(context);
b = LLVMCreateBuilder();
funcname = llvm_expand_funcname(context, "evalexpr");
/* Create the signature and function */
{
LLVMTypeRef param_types[3];
param_types[0] = l_ptr(StructExprState); /* state */
param_types[1] = l_ptr(StructExprContext); /* econtext */
param_types[2] = l_ptr(TypeParamBool); /* isnull */
eval_sig = LLVMFunctionType(TypeSizeT,
param_types, lengthof(param_types),
false);
}
eval_fn = LLVMAddFunction(mod, funcname, eval_sig);
LLVMSetLinkage(eval_fn, LLVMExternalLinkage);
LLVMSetVisibility(eval_fn, LLVMDefaultVisibility);
llvm_copy_attributes(AttributeTemplate, eval_fn);
entry = LLVMAppendBasicBlock(eval_fn, "entry");
/* build state */
v_state = LLVMGetParam(eval_fn, 0);
v_econtext = LLVMGetParam(eval_fn, 1);
v_isnullp = LLVMGetParam(eval_fn, 2);
LLVMPositionBuilderAtEnd(b, entry);
v_tmpvaluep = LLVMBuildStructGEP(b, v_state,
FIELDNO_EXPRSTATE_RESVALUE,
"v.state.resvalue");
v_tmpisnullp = LLVMBuildStructGEP(b, v_state,
FIELDNO_EXPRSTATE_RESNULL,
"v.state.resnull");
v_parent = l_load_struct_gep(b, v_state,
FIELDNO_EXPRSTATE_PARENT,
"v.state.parent");
/* build global slots */
v_scanslot = l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_SCANTUPLE,
"v_scanslot");
v_innerslot = l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_INNERTUPLE,
"v_innerslot");
v_outerslot = l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_OUTERTUPLE,
"v_outerslot");
v_resultslot = l_load_struct_gep(b, v_state,
FIELDNO_EXPRSTATE_RESULTSLOT,
"v_resultslot");
/* build global values/isnull pointers */
v_scanvalues = l_load_struct_gep(b, v_scanslot,
FIELDNO_TUPLETABLESLOT_VALUES,
"v_scanvalues");
v_scannulls = l_load_struct_gep(b, v_scanslot,
FIELDNO_TUPLETABLESLOT_ISNULL,
"v_scannulls");
v_innervalues = l_load_struct_gep(b, v_innerslot,
FIELDNO_TUPLETABLESLOT_VALUES,
"v_innervalues");
v_innernulls = l_load_struct_gep(b, v_innerslot,
FIELDNO_TUPLETABLESLOT_ISNULL,
"v_innernulls");
v_outervalues = l_load_struct_gep(b, v_outerslot,
FIELDNO_TUPLETABLESLOT_VALUES,
"v_outervalues");
v_outernulls = l_load_struct_gep(b, v_outerslot,
FIELDNO_TUPLETABLESLOT_ISNULL,
"v_outernulls");
v_resultvalues = l_load_struct_gep(b, v_resultslot,
FIELDNO_TUPLETABLESLOT_VALUES,
"v_resultvalues");
v_resultnulls = l_load_struct_gep(b, v_resultslot,
FIELDNO_TUPLETABLESLOT_ISNULL,
"v_resultnulls");
/* aggvalues/aggnulls */
v_aggvalues = l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_AGGVALUES,
"v.econtext.aggvalues");
v_aggnulls = l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_AGGNULLS,
"v.econtext.aggnulls");
/* allocate blocks for each op upfront, so we can do jumps easily */
opblocks = palloc(sizeof(LLVMBasicBlockRef) * state->steps_len);
for (i = 0; i < state->steps_len; i++)
opblocks[i] = l_bb_append_v(eval_fn, "b.op.%d.start", i);
/* jump from entry to first block */
LLVMBuildBr(b, opblocks[0]);
for (i = 0; i < state->steps_len; i++)
{
ExprEvalStep *op;
ExprEvalOp opcode;
LLVMValueRef v_resvaluep;
LLVMValueRef v_resnullp;
LLVMPositionBuilderAtEnd(b, opblocks[i]);
op = &state->steps[i];
opcode = ExecEvalStepOp(state, op);
v_resvaluep = l_ptr_const(op->resvalue, l_ptr(TypeSizeT));
v_resnullp = l_ptr_const(op->resnull, l_ptr(TypeStorageBool));
switch (opcode)
{
case EEOP_DONE:
{
LLVMValueRef v_tmpisnull,
v_tmpvalue;
v_tmpvalue = LLVMBuildLoad(b, v_tmpvaluep, "");
v_tmpisnull = LLVMBuildLoad(b, v_tmpisnullp, "");
v_tmpisnull =
LLVMBuildTrunc(b, v_tmpisnull, TypeParamBool, "");
LLVMBuildStore(b, v_tmpisnull, v_isnullp);
LLVMBuildRet(b, v_tmpvalue);
break;
}
case EEOP_INNER_FETCHSOME:
case EEOP_OUTER_FETCHSOME:
case EEOP_SCAN_FETCHSOME:
{
TupleDesc desc = NULL;
LLVMValueRef v_slot;
LLVMBasicBlockRef b_fetch;
LLVMValueRef v_nvalid;
LLVMValueRef l_jit_deform = NULL;
const TupleTableSlotOps *tts_ops = NULL;
b_fetch = l_bb_before_v(opblocks[i + 1],
"op.%d.fetch", i);
if (op->d.fetch.known_desc)
desc = op->d.fetch.known_desc;
if (op->d.fetch.fixed)
tts_ops = op->d.fetch.kind;
if (opcode == EEOP_INNER_FETCHSOME)
v_slot = v_innerslot;
else if (opcode == EEOP_OUTER_FETCHSOME)
v_slot = v_outerslot;
else
v_slot = v_scanslot;
/*
* Check if all required attributes are available, or
* whether deforming is required.
*
* TODO: skip nvalid check if slot is fixed and known to
* be a virtual slot.
*/
v_nvalid =
l_load_struct_gep(b, v_slot,
FIELDNO_TUPLETABLESLOT_NVALID,
"");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntUGE, v_nvalid,
l_int16_const(op->d.fetch.last_var),
""),
opblocks[i + 1], b_fetch);
LLVMPositionBuilderAtEnd(b, b_fetch);
/*
* If the tupledesc of the to-be-deformed tuple is known,
* and JITing of deforming is enabled, build deform
* function specific to tupledesc and the exact number of
* to-be-extracted attributes.
*/
if (tts_ops && desc && (context->base.flags & PGJIT_DEFORM))
{
l_jit_deform =
slot_compile_deform(context, desc,
tts_ops,
op->d.fetch.last_var);
}
if (l_jit_deform)
{
LLVMValueRef params[1];
params[0] = v_slot;
LLVMBuildCall(b, l_jit_deform,
params, lengthof(params), "");
}
else
{
LLVMValueRef params[2];
params[0] = v_slot;
params[1] = l_int32_const(op->d.fetch.last_var);
LLVMBuildCall(b,
llvm_get_decl(mod, FuncSlotGetsomeattrsInt),
params, lengthof(params), "");
}
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_INNER_VAR:
case EEOP_OUTER_VAR:
case EEOP_SCAN_VAR:
{
LLVMValueRef value,
isnull;
LLVMValueRef v_attnum;
LLVMValueRef v_values;
LLVMValueRef v_nulls;
if (opcode == EEOP_INNER_VAR)
{
v_values = v_innervalues;
v_nulls = v_innernulls;
}
else if (opcode == EEOP_OUTER_VAR)
{
v_values = v_outervalues;
v_nulls = v_outernulls;
}
else
{
v_values = v_scanvalues;
v_nulls = v_scannulls;
}
v_attnum = l_int32_const(op->d.var.attnum);
value = l_load_gep1(b, v_values, v_attnum, "");
isnull = l_load_gep1(b, v_nulls, v_attnum, "");
LLVMBuildStore(b, value, v_resvaluep);
LLVMBuildStore(b, isnull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_INNER_SYSVAR:
case EEOP_OUTER_SYSVAR:
case EEOP_SCAN_SYSVAR:
{
LLVMValueRef v_slot;
LLVMValueRef v_params[4];
if (opcode == EEOP_INNER_SYSVAR)
v_slot = v_innerslot;
else if (opcode == EEOP_OUTER_SYSVAR)
v_slot = v_outerslot;
else
v_slot = v_scanslot;
v_params[0] = v_state;
v_params[1] = l_ptr_const(op, l_ptr(StructExprEvalStep));
v_params[2] = v_econtext;
v_params[3] = v_slot;
LLVMBuildCall(b,
llvm_get_decl(mod, FuncExecEvalSysVar),
v_params, lengthof(v_params), "");
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_WHOLEROW:
build_EvalXFunc(b, mod, "ExecEvalWholeRowVar",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_ASSIGN_INNER_VAR:
case EEOP_ASSIGN_OUTER_VAR:
case EEOP_ASSIGN_SCAN_VAR:
{
LLVMValueRef v_value,
v_isnull;
LLVMValueRef v_rvaluep,
v_risnullp;
LLVMValueRef v_attnum,
v_resultnum;
LLVMValueRef v_values;
LLVMValueRef v_nulls;
if (opcode == EEOP_ASSIGN_INNER_VAR)
{
v_values = v_innervalues;
v_nulls = v_innernulls;
}
else if (opcode == EEOP_ASSIGN_OUTER_VAR)
{
v_values = v_outervalues;
v_nulls = v_outernulls;
}
else
{
v_values = v_scanvalues;
v_nulls = v_scannulls;
}
/* load data */
v_attnum = l_int32_const(op->d.assign_var.attnum);
v_value = l_load_gep1(b, v_values, v_attnum, "");
v_isnull = l_load_gep1(b, v_nulls, v_attnum, "");
/* compute addresses of targets */
v_resultnum = l_int32_const(op->d.assign_var.resultnum);
v_rvaluep = LLVMBuildGEP(b, v_resultvalues,
&v_resultnum, 1, "");
v_risnullp = LLVMBuildGEP(b, v_resultnulls,
&v_resultnum, 1, "");
/* and store */
LLVMBuildStore(b, v_value, v_rvaluep);
LLVMBuildStore(b, v_isnull, v_risnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_ASSIGN_TMP:
{
LLVMValueRef v_value,
v_isnull;
LLVMValueRef v_rvaluep,
v_risnullp;
LLVMValueRef v_resultnum;
size_t resultnum = op->d.assign_tmp.resultnum;
/* load data */
v_value = LLVMBuildLoad(b, v_tmpvaluep, "");
v_isnull = LLVMBuildLoad(b, v_tmpisnullp, "");
/* compute addresses of targets */
v_resultnum = l_int32_const(resultnum);
v_rvaluep =
LLVMBuildGEP(b, v_resultvalues, &v_resultnum, 1, "");
v_risnullp =
LLVMBuildGEP(b, v_resultnulls, &v_resultnum, 1, "");
/* and store */
LLVMBuildStore(b, v_value, v_rvaluep);
LLVMBuildStore(b, v_isnull, v_risnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_ASSIGN_TMP_MAKE_RO:
{
LLVMBasicBlockRef b_notnull;
LLVMValueRef v_params[1];
LLVMValueRef v_ret;
LLVMValueRef v_value,
v_isnull;
LLVMValueRef v_rvaluep,
v_risnullp;
LLVMValueRef v_resultnum;
size_t resultnum = op->d.assign_tmp.resultnum;
b_notnull = l_bb_before_v(opblocks[i + 1],
"op.%d.assign_tmp.notnull", i);
/* load data */
v_value = LLVMBuildLoad(b, v_tmpvaluep, "");
v_isnull = LLVMBuildLoad(b, v_tmpisnullp, "");
/* compute addresses of targets */
v_resultnum = l_int32_const(resultnum);
v_rvaluep = LLVMBuildGEP(b, v_resultvalues,
&v_resultnum, 1, "");
v_risnullp = LLVMBuildGEP(b, v_resultnulls,
&v_resultnum, 1, "");
/* store nullness */
LLVMBuildStore(b, v_isnull, v_risnullp);
/* check if value is NULL */
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_isnull,
l_sbool_const(0), ""),
b_notnull, opblocks[i + 1]);
/* if value is not null, convert to RO datum */
LLVMPositionBuilderAtEnd(b, b_notnull);
v_params[0] = v_value;
v_ret =
LLVMBuildCall(b,
llvm_get_decl(mod, FuncMakeExpandedObjectReadOnlyInternal),
v_params, lengthof(v_params), "");
/* store value */
LLVMBuildStore(b, v_ret, v_rvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_CONST:
{
LLVMValueRef v_constvalue,
v_constnull;
v_constvalue = l_sizet_const(op->d.constval.value);
v_constnull = l_sbool_const(op->d.constval.isnull);
LLVMBuildStore(b, v_constvalue, v_resvaluep);
LLVMBuildStore(b, v_constnull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_FUNCEXPR_STRICT:
{
FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
LLVMBasicBlockRef b_nonull;
int argno;
LLVMValueRef v_fcinfo;
LLVMBasicBlockRef *b_checkargnulls;
/*
* Block for the actual function call, if args are
* non-NULL.
*/
b_nonull = l_bb_before_v(opblocks[i + 1],
"b.%d.no-null-args", i);
/* should make sure they're optimized beforehand */
if (op->d.func.nargs == 0)
elog(ERROR, "argumentless strict functions are pointless");
v_fcinfo =
l_ptr_const(fcinfo, l_ptr(StructFunctionCallInfoData));
/*
* set resnull to true, if the function is actually
* called, it'll be reset
*/
LLVMBuildStore(b, l_sbool_const(1), v_resnullp);
/* create blocks for checking args, one for each */
b_checkargnulls =
palloc(sizeof(LLVMBasicBlockRef *) * op->d.func.nargs);
for (argno = 0; argno < op->d.func.nargs; argno++)
b_checkargnulls[argno] =
l_bb_before_v(b_nonull, "b.%d.isnull.%d", i, argno);
/* jump to check of first argument */
LLVMBuildBr(b, b_checkargnulls[0]);
/* check each arg for NULLness */
for (argno = 0; argno < op->d.func.nargs; argno++)
{
LLVMValueRef v_argisnull;
LLVMBasicBlockRef b_argnotnull;
LLVMPositionBuilderAtEnd(b, b_checkargnulls[argno]);
/* compute block to jump to if argument is not null */
if (argno + 1 == op->d.func.nargs)
b_argnotnull = b_nonull;
else
b_argnotnull = b_checkargnulls[argno + 1];
/* and finally load & check NULLness of arg */
v_argisnull = l_funcnull(b, v_fcinfo, argno);
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ,
v_argisnull,
l_sbool_const(1),
""),
opblocks[i + 1],
b_argnotnull);
}
LLVMPositionBuilderAtEnd(b, b_nonull);
}
/* FALLTHROUGH */
case EEOP_FUNCEXPR:
{
FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
LLVMValueRef v_fcinfo_isnull;
LLVMValueRef v_retval;
v_retval = BuildV1Call(context, b, mod, fcinfo,
&v_fcinfo_isnull);
LLVMBuildStore(b, v_retval, v_resvaluep);
LLVMBuildStore(b, v_fcinfo_isnull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_FUNCEXPR_FUSAGE:
build_EvalXFunc(b, mod, "ExecEvalFuncExprFusage",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_FUNCEXPR_STRICT_FUSAGE:
build_EvalXFunc(b, mod, "ExecEvalFuncExprStrictFusage",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_BOOL_AND_STEP_FIRST:
{
LLVMValueRef v_boolanynullp;
v_boolanynullp = l_ptr_const(op->d.boolexpr.anynull,
l_ptr(TypeStorageBool));
LLVMBuildStore(b, l_sbool_const(0), v_boolanynullp);
}
/* FALLTHROUGH */
/*
* Treat them the same for now, optimizer can remove
* redundancy. Could be worthwhile to optimize during emission
* though.
*/
case EEOP_BOOL_AND_STEP_LAST:
case EEOP_BOOL_AND_STEP:
{
LLVMValueRef v_boolvalue;
LLVMValueRef v_boolnull;
LLVMValueRef v_boolanynullp,
v_boolanynull;
LLVMBasicBlockRef b_boolisnull;
LLVMBasicBlockRef b_boolcheckfalse;
LLVMBasicBlockRef b_boolisfalse;
LLVMBasicBlockRef b_boolcont;
LLVMBasicBlockRef b_boolisanynull;
b_boolisnull = l_bb_before_v(opblocks[i + 1],
"b.%d.boolisnull", i);
b_boolcheckfalse = l_bb_before_v(opblocks[i + 1],
"b.%d.boolcheckfalse", i);
b_boolisfalse = l_bb_before_v(opblocks[i + 1],
"b.%d.boolisfalse", i);
b_boolisanynull = l_bb_before_v(opblocks[i + 1],
"b.%d.boolisanynull", i);
b_boolcont = l_bb_before_v(opblocks[i + 1],
"b.%d.boolcont", i);
v_boolanynullp = l_ptr_const(op->d.boolexpr.anynull,
l_ptr(TypeStorageBool));
v_boolnull = LLVMBuildLoad(b, v_resnullp, "");
v_boolvalue = LLVMBuildLoad(b, v_resvaluep, "");
/* set resnull to boolnull */
LLVMBuildStore(b, v_boolnull, v_resnullp);
/* set revalue to boolvalue */
LLVMBuildStore(b, v_boolvalue, v_resvaluep);
/* check if current input is NULL */
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_boolnull,
l_sbool_const(1), ""),
b_boolisnull,
b_boolcheckfalse);
/* build block that sets anynull */
LLVMPositionBuilderAtEnd(b, b_boolisnull);
/* set boolanynull to true */
LLVMBuildStore(b, l_sbool_const(1), v_boolanynullp);
/* and jump to next block */
LLVMBuildBr(b, b_boolcont);
/* build block checking for false */
LLVMPositionBuilderAtEnd(b, b_boolcheckfalse);
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_boolvalue,
l_sizet_const(0), ""),
b_boolisfalse,
b_boolcont);
/*
* Build block handling FALSE. Value is false, so short
* circuit.
*/
LLVMPositionBuilderAtEnd(b, b_boolisfalse);
/* result is already set to FALSE, need not change it */
/* and jump to the end of the AND expression */
LLVMBuildBr(b, opblocks[op->d.boolexpr.jumpdone]);
/* Build block that continues if bool is TRUE. */
LLVMPositionBuilderAtEnd(b, b_boolcont);
v_boolanynull = LLVMBuildLoad(b, v_boolanynullp, "");
/* set value to NULL if any previous values were NULL */
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_boolanynull,
l_sbool_const(0), ""),
opblocks[i + 1], b_boolisanynull);
LLVMPositionBuilderAtEnd(b, b_boolisanynull);
/* set resnull to true */
LLVMBuildStore(b, l_sbool_const(1), v_resnullp);
/* reset resvalue */
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_BOOL_OR_STEP_FIRST:
{
LLVMValueRef v_boolanynullp;
v_boolanynullp = l_ptr_const(op->d.boolexpr.anynull,
l_ptr(TypeStorageBool));
LLVMBuildStore(b, l_sbool_const(0), v_boolanynullp);
}
/* FALLTHROUGH */
/*
* Treat them the same for now, optimizer can remove
* redundancy. Could be worthwhile to optimize during emission
* though.
*/
case EEOP_BOOL_OR_STEP_LAST:
case EEOP_BOOL_OR_STEP:
{
LLVMValueRef v_boolvalue;
LLVMValueRef v_boolnull;
LLVMValueRef v_boolanynullp,
v_boolanynull;
LLVMBasicBlockRef b_boolisnull;
LLVMBasicBlockRef b_boolchecktrue;
LLVMBasicBlockRef b_boolistrue;
LLVMBasicBlockRef b_boolcont;
LLVMBasicBlockRef b_boolisanynull;
b_boolisnull = l_bb_before_v(opblocks[i + 1],
"b.%d.boolisnull", i);
b_boolchecktrue = l_bb_before_v(opblocks[i + 1],
"b.%d.boolchecktrue", i);
b_boolistrue = l_bb_before_v(opblocks[i + 1],
"b.%d.boolistrue", i);
b_boolisanynull = l_bb_before_v(opblocks[i + 1],
"b.%d.boolisanynull", i);
b_boolcont = l_bb_before_v(opblocks[i + 1],
"b.%d.boolcont", i);
v_boolanynullp = l_ptr_const(op->d.boolexpr.anynull,
l_ptr(TypeStorageBool));
v_boolnull = LLVMBuildLoad(b, v_resnullp, "");
v_boolvalue = LLVMBuildLoad(b, v_resvaluep, "");
/* set resnull to boolnull */
LLVMBuildStore(b, v_boolnull, v_resnullp);
/* set revalue to boolvalue */
LLVMBuildStore(b, v_boolvalue, v_resvaluep);
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_boolnull,
l_sbool_const(1), ""),
b_boolisnull,
b_boolchecktrue);
/* build block that sets anynull */
LLVMPositionBuilderAtEnd(b, b_boolisnull);
/* set boolanynull to true */
LLVMBuildStore(b, l_sbool_const(1), v_boolanynullp);
/* and jump to next block */
LLVMBuildBr(b, b_boolcont);
/* build block checking for true */
LLVMPositionBuilderAtEnd(b, b_boolchecktrue);
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_boolvalue,
l_sizet_const(1), ""),
b_boolistrue,
b_boolcont);
/*
* Build block handling True. Value is true, so short
* circuit.
*/
LLVMPositionBuilderAtEnd(b, b_boolistrue);
/* result is already set to TRUE, need not change it */
/* and jump to the end of the OR expression */
LLVMBuildBr(b, opblocks[op->d.boolexpr.jumpdone]);
/* build block that continues if bool is FALSE */
LLVMPositionBuilderAtEnd(b, b_boolcont);
v_boolanynull = LLVMBuildLoad(b, v_boolanynullp, "");
/* set value to NULL if any previous values were NULL */
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_boolanynull,
l_sbool_const(0), ""),
opblocks[i + 1], b_boolisanynull);
LLVMPositionBuilderAtEnd(b, b_boolisanynull);
/* set resnull to true */
LLVMBuildStore(b, l_sbool_const(1), v_resnullp);
/* reset resvalue */
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_BOOL_NOT_STEP:
{
LLVMValueRef v_boolvalue;
LLVMValueRef v_boolnull;
LLVMValueRef v_negbool;
v_boolnull = LLVMBuildLoad(b, v_resnullp, "");
v_boolvalue = LLVMBuildLoad(b, v_resvaluep, "");
v_negbool = LLVMBuildZExt(b,
LLVMBuildICmp(b, LLVMIntEQ,
v_boolvalue,
l_sizet_const(0),
""),
TypeSizeT, "");
/* set resnull to boolnull */
LLVMBuildStore(b, v_boolnull, v_resnullp);
/* set revalue to !boolvalue */
LLVMBuildStore(b, v_negbool, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_QUAL:
{
LLVMValueRef v_resnull;
LLVMValueRef v_resvalue;
LLVMValueRef v_nullorfalse;
LLVMBasicBlockRef b_qualfail;
b_qualfail = l_bb_before_v(opblocks[i + 1],
"op.%d.qualfail", i);
v_resvalue = LLVMBuildLoad(b, v_resvaluep, "");
v_resnull = LLVMBuildLoad(b, v_resnullp, "");
v_nullorfalse =
LLVMBuildOr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
LLVMBuildICmp(b, LLVMIntEQ, v_resvalue,
l_sizet_const(0), ""),
"");
LLVMBuildCondBr(b,
v_nullorfalse,
b_qualfail,
opblocks[i + 1]);
/* build block handling NULL or false */
LLVMPositionBuilderAtEnd(b, b_qualfail);
/* set resnull to false */
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
/* set resvalue to false */
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
/* and jump out */
LLVMBuildBr(b, opblocks[op->d.qualexpr.jumpdone]);
break;
}
case EEOP_JUMP:
{
LLVMBuildBr(b, opblocks[op->d.jump.jumpdone]);
break;
}
case EEOP_JUMP_IF_NULL:
{
LLVMValueRef v_resnull;
/* Transfer control if current result is null */
v_resnull = LLVMBuildLoad(b, v_resnullp, "");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
opblocks[op->d.jump.jumpdone],
opblocks[i + 1]);
break;
}
case EEOP_JUMP_IF_NOT_NULL:
{
LLVMValueRef v_resnull;
/* Transfer control if current result is non-null */
v_resnull = LLVMBuildLoad(b, v_resnullp, "");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(0), ""),
opblocks[op->d.jump.jumpdone],
opblocks[i + 1]);
break;
}
case EEOP_JUMP_IF_NOT_TRUE:
{
LLVMValueRef v_resnull;
LLVMValueRef v_resvalue;
LLVMValueRef v_nullorfalse;
/* Transfer control if current result is null or false */
v_resvalue = LLVMBuildLoad(b, v_resvaluep, "");
v_resnull = LLVMBuildLoad(b, v_resnullp, "");
v_nullorfalse =
LLVMBuildOr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
LLVMBuildICmp(b, LLVMIntEQ, v_resvalue,
l_sizet_const(0), ""),
"");
LLVMBuildCondBr(b,
v_nullorfalse,
opblocks[op->d.jump.jumpdone],
opblocks[i + 1]);
break;
}
case EEOP_NULLTEST_ISNULL:
{
LLVMValueRef v_resnull = LLVMBuildLoad(b, v_resnullp, "");
LLVMValueRef v_resvalue;
v_resvalue =
LLVMBuildSelect(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
l_sizet_const(1),
l_sizet_const(0),
"");
LLVMBuildStore(b, v_resvalue, v_resvaluep);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_NULLTEST_ISNOTNULL:
{
LLVMValueRef v_resnull = LLVMBuildLoad(b, v_resnullp, "");
LLVMValueRef v_resvalue;
v_resvalue =
LLVMBuildSelect(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
l_sizet_const(0),
l_sizet_const(1),
"");
LLVMBuildStore(b, v_resvalue, v_resvaluep);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_NULLTEST_ROWISNULL:
build_EvalXFunc(b, mod, "ExecEvalRowNull",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_NULLTEST_ROWISNOTNULL:
build_EvalXFunc(b, mod, "ExecEvalRowNotNull",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_BOOLTEST_IS_TRUE:
case EEOP_BOOLTEST_IS_NOT_FALSE:
case EEOP_BOOLTEST_IS_FALSE:
case EEOP_BOOLTEST_IS_NOT_TRUE:
{
LLVMBasicBlockRef b_isnull,
b_notnull;
LLVMValueRef v_resnull = LLVMBuildLoad(b, v_resnullp, "");
b_isnull = l_bb_before_v(opblocks[i + 1],
"op.%d.isnull", i);
b_notnull = l_bb_before_v(opblocks[i + 1],
"op.%d.isnotnull", i);
/* check if value is NULL */
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
b_isnull, b_notnull);
/* if value is NULL, return false */
LLVMPositionBuilderAtEnd(b, b_isnull);
/* result is not null */
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
if (opcode == EEOP_BOOLTEST_IS_TRUE ||
opcode == EEOP_BOOLTEST_IS_FALSE)
{
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
}
else
{
LLVMBuildStore(b, l_sizet_const(1), v_resvaluep);
}
LLVMBuildBr(b, opblocks[i + 1]);
LLVMPositionBuilderAtEnd(b, b_notnull);
if (opcode == EEOP_BOOLTEST_IS_TRUE ||
opcode == EEOP_BOOLTEST_IS_NOT_FALSE)
{
/*
* if value is not null NULL, return value (already
* set)
*/
}
else
{
LLVMValueRef v_value =
LLVMBuildLoad(b, v_resvaluep, "");
v_value = LLVMBuildZExt(b,
LLVMBuildICmp(b, LLVMIntEQ,
v_value,
l_sizet_const(0),
""),
TypeSizeT, "");
LLVMBuildStore(b, v_value, v_resvaluep);
}
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_PARAM_EXEC:
build_EvalXFunc(b, mod, "ExecEvalParamExec",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_PARAM_EXTERN:
build_EvalXFunc(b, mod, "ExecEvalParamExtern",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_PARAM_CALLBACK:
{
LLVMTypeRef param_types[3];
LLVMValueRef v_params[3];
LLVMTypeRef v_functype;
LLVMValueRef v_func;
param_types[0] = l_ptr(StructExprState);
param_types[1] = l_ptr(TypeSizeT);
param_types[2] = l_ptr(StructExprContext);
v_functype = LLVMFunctionType(LLVMVoidType(),
param_types,
lengthof(param_types),
false);
v_func = l_ptr_const(op->d.cparam.paramfunc,
l_ptr(v_functype));
v_params[0] = v_state;
v_params[1] = l_ptr_const(op, l_ptr(TypeSizeT));
v_params[2] = v_econtext;
LLVMBuildCall(b,
v_func,
v_params, lengthof(v_params), "");
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_SBSREF_OLD:
build_EvalXFunc(b, mod, "ExecEvalSubscriptingRefOld",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_SBSREF_ASSIGN:
build_EvalXFunc(b, mod, "ExecEvalSubscriptingRefAssign",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_SBSREF_FETCH:
build_EvalXFunc(b, mod, "ExecEvalSubscriptingRefFetch",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_CASE_TESTVAL:
{
LLVMBasicBlockRef b_avail,
b_notavail;
LLVMValueRef v_casevaluep,
v_casevalue;
LLVMValueRef v_casenullp,
v_casenull;
LLVMValueRef v_casevaluenull;
b_avail = l_bb_before_v(opblocks[i + 1],
"op.%d.avail", i);
b_notavail = l_bb_before_v(opblocks[i + 1],
"op.%d.notavail", i);
v_casevaluep = l_ptr_const(op->d.casetest.value,
l_ptr(TypeSizeT));
v_casenullp = l_ptr_const(op->d.casetest.isnull,
l_ptr(TypeStorageBool));
v_casevaluenull =
LLVMBuildICmp(b, LLVMIntEQ,
LLVMBuildPtrToInt(b, v_casevaluep,
TypeSizeT, ""),
l_sizet_const(0), "");
LLVMBuildCondBr(b, v_casevaluenull, b_notavail, b_avail);
/* if casetest != NULL */
LLVMPositionBuilderAtEnd(b, b_avail);
v_casevalue = LLVMBuildLoad(b, v_casevaluep, "");
v_casenull = LLVMBuildLoad(b, v_casenullp, "");
LLVMBuildStore(b, v_casevalue, v_resvaluep);
LLVMBuildStore(b, v_casenull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
/* if casetest == NULL */
LLVMPositionBuilderAtEnd(b, b_notavail);
v_casevalue =
l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_CASEDATUM, "");
v_casenull =
l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_CASENULL, "");
LLVMBuildStore(b, v_casevalue, v_resvaluep);
LLVMBuildStore(b, v_casenull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_MAKE_READONLY:
{
LLVMBasicBlockRef b_notnull;
LLVMValueRef v_params[1];
LLVMValueRef v_ret;
LLVMValueRef v_nullp;
LLVMValueRef v_valuep;
LLVMValueRef v_null;
LLVMValueRef v_value;
b_notnull = l_bb_before_v(opblocks[i + 1],
"op.%d.readonly.notnull", i);
v_nullp = l_ptr_const(op->d.make_readonly.isnull,
l_ptr(TypeStorageBool));
v_null = LLVMBuildLoad(b, v_nullp, "");
/* store null isnull value in result */
LLVMBuildStore(b, v_null, v_resnullp);
/* check if value is NULL */
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_null,
l_sbool_const(1), ""),
opblocks[i + 1], b_notnull);
/* if value is not null, convert to RO datum */
LLVMPositionBuilderAtEnd(b, b_notnull);
v_valuep = l_ptr_const(op->d.make_readonly.value,
l_ptr(TypeSizeT));
v_value = LLVMBuildLoad(b, v_valuep, "");
v_params[0] = v_value;
v_ret =
LLVMBuildCall(b,
llvm_get_decl(mod, FuncMakeExpandedObjectReadOnlyInternal),
v_params, lengthof(v_params), "");
LLVMBuildStore(b, v_ret, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_IOCOERCE:
{
FunctionCallInfo fcinfo_out,
fcinfo_in;
LLVMValueRef v_fcinfo_out,
v_fcinfo_in;
LLVMValueRef v_fn_addr_out,
v_fn_addr_in;
LLVMValueRef v_fcinfo_in_isnullp;
LLVMValueRef v_retval;
LLVMValueRef v_resvalue;
LLVMValueRef v_resnull;
LLVMValueRef v_output_skip;
LLVMValueRef v_output;
LLVMBasicBlockRef b_skipoutput;
LLVMBasicBlockRef b_calloutput;
LLVMBasicBlockRef b_input;
LLVMBasicBlockRef b_inputcall;
fcinfo_out = op->d.iocoerce.fcinfo_data_out;
fcinfo_in = op->d.iocoerce.fcinfo_data_in;
b_skipoutput = l_bb_before_v(opblocks[i + 1],
"op.%d.skipoutputnull", i);
b_calloutput = l_bb_before_v(opblocks[i + 1],
"op.%d.calloutput", i);
b_input = l_bb_before_v(opblocks[i + 1],
"op.%d.input", i);
b_inputcall = l_bb_before_v(opblocks[i + 1],
"op.%d.inputcall", i);
v_fcinfo_out = l_ptr_const(fcinfo_out, l_ptr(StructFunctionCallInfoData));
v_fcinfo_in = l_ptr_const(fcinfo_in, l_ptr(StructFunctionCallInfoData));
v_fn_addr_out = l_ptr_const(fcinfo_out->flinfo->fn_addr, TypePGFunction);
v_fn_addr_in = l_ptr_const(fcinfo_in->flinfo->fn_addr, TypePGFunction);
v_fcinfo_in_isnullp =
LLVMBuildStructGEP(b, v_fcinfo_in,
FIELDNO_FUNCTIONCALLINFODATA_ISNULL,
"v_fcinfo_in_isnull");
/* output functions are not called on nulls */
v_resnull = LLVMBuildLoad(b, v_resnullp, "");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_resnull,
l_sbool_const(1), ""),
b_skipoutput,
b_calloutput);
LLVMPositionBuilderAtEnd(b, b_skipoutput);
v_output_skip = l_sizet_const(0);
LLVMBuildBr(b, b_input);
LLVMPositionBuilderAtEnd(b, b_calloutput);
v_resvalue = LLVMBuildLoad(b, v_resvaluep, "");
/* set arg[0] */
LLVMBuildStore(b,
v_resvalue,
l_funcvaluep(b, v_fcinfo_out, 0));
LLVMBuildStore(b,
l_sbool_const(0),
l_funcnullp(b, v_fcinfo_out, 0));
/* and call output function (can never return NULL) */
v_output = LLVMBuildCall(b, v_fn_addr_out, &v_fcinfo_out,
1, "funccall_coerce_out");
LLVMBuildBr(b, b_input);
/* build block handling input function call */
LLVMPositionBuilderAtEnd(b, b_input);
/* phi between resnull and output function call branches */
{
LLVMValueRef incoming_values[2];
LLVMBasicBlockRef incoming_blocks[2];
incoming_values[0] = v_output_skip;
incoming_blocks[0] = b_skipoutput;
incoming_values[1] = v_output;
incoming_blocks[1] = b_calloutput;
v_output = LLVMBuildPhi(b, TypeSizeT, "output");
LLVMAddIncoming(v_output,
incoming_values, incoming_blocks,
lengthof(incoming_blocks));
}
/*
* If input function is strict, skip if input string is
* NULL.
*/
if (op->d.iocoerce.finfo_in->fn_strict)
{
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_output,
l_sizet_const(0), ""),
opblocks[i + 1],
b_inputcall);
}
else
{
LLVMBuildBr(b, b_inputcall);
}
LLVMPositionBuilderAtEnd(b, b_inputcall);
/* set arguments */
/* arg0: output */
LLVMBuildStore(b, v_output,
l_funcvaluep(b, v_fcinfo_in, 0));
LLVMBuildStore(b, v_resnull,
l_funcnullp(b, v_fcinfo_in, 0));
/* arg1: ioparam: preset in execExpr.c */
/* arg2: typmod: preset in execExpr.c */
/* reset fcinfo_in->isnull */
LLVMBuildStore(b, l_sbool_const(0), v_fcinfo_in_isnullp);
/* and call function */
v_retval = LLVMBuildCall(b, v_fn_addr_in, &v_fcinfo_in, 1,
"funccall_iocoerce_in");
LLVMBuildStore(b, v_retval, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_DISTINCT:
case EEOP_NOT_DISTINCT:
{
FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
LLVMValueRef v_fcinfo;
LLVMValueRef v_fcinfo_isnull;
LLVMValueRef v_argnull0,
v_argisnull0;
LLVMValueRef v_argnull1,
v_argisnull1;
LLVMValueRef v_anyargisnull;
LLVMValueRef v_bothargisnull;
LLVMValueRef v_result;
LLVMBasicBlockRef b_noargnull;
LLVMBasicBlockRef b_checkbothargnull;
LLVMBasicBlockRef b_bothargnull;
LLVMBasicBlockRef b_anyargnull;
b_noargnull = l_bb_before_v(opblocks[i + 1], "op.%d.noargnull", i);
b_checkbothargnull = l_bb_before_v(opblocks[i + 1], "op.%d.checkbothargnull", i);
b_bothargnull = l_bb_before_v(opblocks[i + 1], "op.%d.bothargnull", i);
b_anyargnull = l_bb_before_v(opblocks[i + 1], "op.%d.anyargnull", i);
v_fcinfo = l_ptr_const(fcinfo, l_ptr(StructFunctionCallInfoData));
/* load args[0|1].isnull for both arguments */
v_argnull0 = l_funcnull(b, v_fcinfo, 0);
v_argisnull0 = LLVMBuildICmp(b, LLVMIntEQ, v_argnull0,
l_sbool_const(1), "");
v_argnull1 = l_funcnull(b, v_fcinfo, 1);
v_argisnull1 = LLVMBuildICmp(b, LLVMIntEQ, v_argnull1,
l_sbool_const(1), "");
v_anyargisnull = LLVMBuildOr(b, v_argisnull0, v_argisnull1, "");
v_bothargisnull = LLVMBuildAnd(b, v_argisnull0, v_argisnull1, "");
/*
* Check function arguments for NULLness: If either is
* NULL, we check if both args are NULL. Otherwise call
* comparator.
*/
LLVMBuildCondBr(b, v_anyargisnull, b_checkbothargnull,
b_noargnull);
/*
* build block checking if any arg is null
*/
LLVMPositionBuilderAtEnd(b, b_checkbothargnull);
LLVMBuildCondBr(b, v_bothargisnull, b_bothargnull,
b_anyargnull);
/* Both NULL? Then is not distinct... */
LLVMPositionBuilderAtEnd(b, b_bothargnull);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
if (opcode == EEOP_NOT_DISTINCT)
LLVMBuildStore(b, l_sizet_const(1), v_resvaluep);
else
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
/* Only one is NULL? Then is distinct... */
LLVMPositionBuilderAtEnd(b, b_anyargnull);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
if (opcode == EEOP_NOT_DISTINCT)
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
else
LLVMBuildStore(b, l_sizet_const(1), v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
/* neither argument is null: compare */
LLVMPositionBuilderAtEnd(b, b_noargnull);
v_result = BuildV1Call(context, b, mod, fcinfo,
&v_fcinfo_isnull);
if (opcode == EEOP_DISTINCT)
{
/* Must invert result of "=" */
v_result =
LLVMBuildZExt(b,
LLVMBuildICmp(b, LLVMIntEQ,
v_result,
l_sizet_const(0), ""),
TypeSizeT, "");
}
LLVMBuildStore(b, v_fcinfo_isnull, v_resnullp);
LLVMBuildStore(b, v_result, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_NULLIF:
{
FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
LLVMValueRef v_fcinfo;
LLVMValueRef v_fcinfo_isnull;
LLVMValueRef v_argnull0;
LLVMValueRef v_argnull1;
LLVMValueRef v_anyargisnull;
LLVMValueRef v_arg0;
LLVMBasicBlockRef b_hasnull;
LLVMBasicBlockRef b_nonull;
LLVMBasicBlockRef b_argsequal;
LLVMValueRef v_retval;
LLVMValueRef v_argsequal;
b_hasnull = l_bb_before_v(opblocks[i + 1],
"b.%d.null-args", i);
b_nonull = l_bb_before_v(opblocks[i + 1],
"b.%d.no-null-args", i);
b_argsequal = l_bb_before_v(opblocks[i + 1],
"b.%d.argsequal", i);
v_fcinfo = l_ptr_const(fcinfo, l_ptr(StructFunctionCallInfoData));
/* if either argument is NULL they can't be equal */
v_argnull0 = l_funcnull(b, v_fcinfo, 0);
v_argnull1 = l_funcnull(b, v_fcinfo, 1);
v_anyargisnull =
LLVMBuildOr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_argnull0,
l_sbool_const(1), ""),
LLVMBuildICmp(b, LLVMIntEQ, v_argnull1,
l_sbool_const(1), ""),
"");
LLVMBuildCondBr(b, v_anyargisnull, b_hasnull, b_nonull);
/* one (or both) of the arguments are null, return arg[0] */
LLVMPositionBuilderAtEnd(b, b_hasnull);
v_arg0 = l_funcvalue(b, v_fcinfo, 0);
LLVMBuildStore(b, v_argnull0, v_resnullp);
LLVMBuildStore(b, v_arg0, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
/* build block to invoke function and check result */
LLVMPositionBuilderAtEnd(b, b_nonull);
v_retval = BuildV1Call(context, b, mod, fcinfo, &v_fcinfo_isnull);
/*
* If result not null, and arguments are equal return null
* (same result as if there'd been NULLs, hence reuse
* b_hasnull).
*/
v_argsequal = LLVMBuildAnd(b,
LLVMBuildICmp(b, LLVMIntEQ,
v_fcinfo_isnull,
l_sbool_const(0),
""),
LLVMBuildICmp(b, LLVMIntEQ,
v_retval,
l_sizet_const(1),
""),
"");
LLVMBuildCondBr(b, v_argsequal, b_argsequal, b_hasnull);
/* build block setting result to NULL, if args are equal */
LLVMPositionBuilderAtEnd(b, b_argsequal);
LLVMBuildStore(b, l_sbool_const(1), v_resnullp);
LLVMBuildStore(b, l_sizet_const(0), v_resvaluep);
LLVMBuildStore(b, v_retval, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_SQLVALUEFUNCTION:
build_EvalXFunc(b, mod, "ExecEvalSQLValueFunction",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_CURRENTOFEXPR:
build_EvalXFunc(b, mod, "ExecEvalCurrentOfExpr",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_NEXTVALUEEXPR:
build_EvalXFunc(b, mod, "ExecEvalNextValueExpr",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_ARRAYEXPR:
build_EvalXFunc(b, mod, "ExecEvalArrayExpr",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_ARRAYCOERCE:
build_EvalXFunc(b, mod, "ExecEvalArrayCoerce",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_ROW:
build_EvalXFunc(b, mod, "ExecEvalRow",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_ROWCOMPARE_STEP:
{
FunctionCallInfo fcinfo = op->d.rowcompare_step.fcinfo_data;
LLVMValueRef v_fcinfo_isnull;
LLVMBasicBlockRef b_null;
LLVMBasicBlockRef b_compare;
LLVMBasicBlockRef b_compare_result;
LLVMValueRef v_retval;
b_null = l_bb_before_v(opblocks[i + 1],
"op.%d.row-null", i);
b_compare = l_bb_before_v(opblocks[i + 1],
"op.%d.row-compare", i);
b_compare_result =
l_bb_before_v(opblocks[i + 1],
"op.%d.row-compare-result",
i);
/*
* If function is strict, and either arg is null, we're
* done.
*/
if (op->d.rowcompare_step.finfo->fn_strict)
{
LLVMValueRef v_fcinfo;
LLVMValueRef v_argnull0;
LLVMValueRef v_argnull1;
LLVMValueRef v_anyargisnull;
v_fcinfo = l_ptr_const(fcinfo,
l_ptr(StructFunctionCallInfoData));
v_argnull0 = l_funcnull(b, v_fcinfo, 0);
v_argnull1 = l_funcnull(b, v_fcinfo, 1);
v_anyargisnull =
LLVMBuildOr(b,
LLVMBuildICmp(b,
LLVMIntEQ,
v_argnull0,
l_sbool_const(1),
""),
LLVMBuildICmp(b, LLVMIntEQ,
v_argnull1,
l_sbool_const(1), ""),
"");
LLVMBuildCondBr(b, v_anyargisnull, b_null, b_compare);
}
else
{
LLVMBuildBr(b, b_compare);
}
/* build block invoking comparison function */
LLVMPositionBuilderAtEnd(b, b_compare);
/* call function */
v_retval = BuildV1Call(context, b, mod, fcinfo,
&v_fcinfo_isnull);
LLVMBuildStore(b, v_retval, v_resvaluep);
/* if result of function is NULL, force NULL result */
LLVMBuildCondBr(b,
LLVMBuildICmp(b,
LLVMIntEQ,
v_fcinfo_isnull,
l_sbool_const(0),
""),
b_compare_result,
b_null);
/* build block analyzing the !NULL comparator result */
LLVMPositionBuilderAtEnd(b, b_compare_result);
/* if results equal, compare next, otherwise done */
LLVMBuildCondBr(b,
LLVMBuildICmp(b,
LLVMIntEQ,
v_retval,
l_sizet_const(0), ""),
opblocks[i + 1],
opblocks[op->d.rowcompare_step.jumpdone]);
/*
* Build block handling NULL input or NULL comparator
* result.
*/
LLVMPositionBuilderAtEnd(b, b_null);
LLVMBuildStore(b, l_sbool_const(1), v_resnullp);
LLVMBuildBr(b, opblocks[op->d.rowcompare_step.jumpnull]);
break;
}
case EEOP_ROWCOMPARE_FINAL:
{
RowCompareType rctype = op->d.rowcompare_final.rctype;
LLVMValueRef v_cmpresult;
LLVMValueRef v_result;
LLVMIntPredicate predicate;
/*
* Btree comparators return 32 bit results, need to be
* careful about sign (used as a 64 bit value it's
* otherwise wrong).
*/
v_cmpresult =
LLVMBuildTrunc(b,
LLVMBuildLoad(b, v_resvaluep, ""),
LLVMInt32Type(), "");
switch (rctype)
{
case ROWCOMPARE_LT:
predicate = LLVMIntSLT;
break;
case ROWCOMPARE_LE:
predicate = LLVMIntSLE;
break;
case ROWCOMPARE_GT:
predicate = LLVMIntSGT;
break;
case ROWCOMPARE_GE:
predicate = LLVMIntSGE;
break;
default:
/* EQ and NE cases aren't allowed here */
Assert(false);
predicate = 0; /* prevent compiler warning */
break;
}
v_result = LLVMBuildICmp(b,
predicate,
v_cmpresult,
l_int32_const(0),
"");
v_result = LLVMBuildZExt(b, v_result, TypeSizeT, "");
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildStore(b, v_result, v_resvaluep);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_MINMAX:
build_EvalXFunc(b, mod, "ExecEvalMinMax",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_FIELDSELECT:
build_EvalXFunc(b, mod, "ExecEvalFieldSelect",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_FIELDSTORE_DEFORM:
build_EvalXFunc(b, mod, "ExecEvalFieldStoreDeForm",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_FIELDSTORE_FORM:
build_EvalXFunc(b, mod, "ExecEvalFieldStoreForm",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_SBSREF_SUBSCRIPT:
{
LLVMValueRef v_fn;
int jumpdone = op->d.sbsref_subscript.jumpdone;
LLVMValueRef v_params[2];
LLVMValueRef v_ret;
v_fn = llvm_get_decl(mod, FuncExecEvalSubscriptingRef);
v_params[0] = v_state;
v_params[1] = l_ptr_const(op, l_ptr(StructExprEvalStep));
v_ret = LLVMBuildCall(b, v_fn,
v_params, lengthof(v_params), "");
v_ret = LLVMBuildZExt(b, v_ret, TypeStorageBool, "");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_ret,
l_sbool_const(1), ""),
opblocks[i + 1],
opblocks[jumpdone]);
break;
}
case EEOP_DOMAIN_TESTVAL:
{
LLVMBasicBlockRef b_avail,
b_notavail;
LLVMValueRef v_casevaluep,
v_casevalue;
LLVMValueRef v_casenullp,
v_casenull;
LLVMValueRef v_casevaluenull;
b_avail = l_bb_before_v(opblocks[i + 1],
"op.%d.avail", i);
b_notavail = l_bb_before_v(opblocks[i + 1],
"op.%d.notavail", i);
v_casevaluep = l_ptr_const(op->d.casetest.value,
l_ptr(TypeSizeT));
v_casenullp = l_ptr_const(op->d.casetest.isnull,
l_ptr(TypeStorageBool));
v_casevaluenull =
LLVMBuildICmp(b, LLVMIntEQ,
LLVMBuildPtrToInt(b, v_casevaluep,
TypeSizeT, ""),
l_sizet_const(0), "");
LLVMBuildCondBr(b,
v_casevaluenull,
b_notavail, b_avail);
/* if casetest != NULL */
LLVMPositionBuilderAtEnd(b, b_avail);
v_casevalue = LLVMBuildLoad(b, v_casevaluep, "");
v_casenull = LLVMBuildLoad(b, v_casenullp, "");
LLVMBuildStore(b, v_casevalue, v_resvaluep);
LLVMBuildStore(b, v_casenull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
/* if casetest == NULL */
LLVMPositionBuilderAtEnd(b, b_notavail);
v_casevalue =
l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_DOMAINDATUM,
"");
v_casenull =
l_load_struct_gep(b, v_econtext,
FIELDNO_EXPRCONTEXT_DOMAINNULL,
"");
LLVMBuildStore(b, v_casevalue, v_resvaluep);
LLVMBuildStore(b, v_casenull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_DOMAIN_NOTNULL:
build_EvalXFunc(b, mod, "ExecEvalConstraintNotNull",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_DOMAIN_CHECK:
build_EvalXFunc(b, mod, "ExecEvalConstraintCheck",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_CONVERT_ROWTYPE:
build_EvalXFunc(b, mod, "ExecEvalConvertRowtype",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_SCALARARRAYOP:
build_EvalXFunc(b, mod, "ExecEvalScalarArrayOp",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_SCALARARRAYOP_FAST_INT:
build_EvalXFunc(b, mod, "ExecEvalScalarArrayOpFastInt",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_SCALARARRAYOP_FAST_STR:
build_EvalXFunc(b, mod, "ExecEvalScalarArrayOpFastStr",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_XMLEXPR:
build_EvalXFunc(b, mod, "ExecEvalXmlExpr",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_AGGREF:
{
AggrefExprState *aggref = op->d.aggref.astate;
LLVMValueRef v_aggnop;
LLVMValueRef v_aggno;
LLVMValueRef value,
isnull;
/*
* At this point aggref->aggno is not yet set (it's set up
* in ExecInitAgg() after initializing the expression). So
* load it from memory each time round.
*/
v_aggnop = l_ptr_const(&aggref->aggno,
l_ptr(LLVMInt32Type()));
v_aggno = LLVMBuildLoad(b, v_aggnop, "v_aggno");
/* load agg value / null */
value = l_load_gep1(b, v_aggvalues, v_aggno, "aggvalue");
isnull = l_load_gep1(b, v_aggnulls, v_aggno, "aggnull");
/* and store result */
LLVMBuildStore(b, value, v_resvaluep);
LLVMBuildStore(b, isnull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_GROUPING_FUNC:
build_EvalXFunc(b, mod, "ExecEvalGroupingFunc",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_GROUP_ID:
{
AggState *aggstate = op->d.group_id.parent;
LLVMValueRef v_group_id_p;
LLVMValueRef v_group_id;
/* Copy aggstate->group_id to the result */
v_group_id_p = l_ptr_const(&aggstate->group_id,
l_ptr(LLVMInt32Type()));
v_group_id = LLVMBuildLoad(b, v_group_id_p, "v_group_id");
/* and store result */
LLVMBuildStore(b, v_group_id, v_resvaluep);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_GROUPING_SET_ID:
{
AggState *aggstate = op->d.grouping_set_id.parent;
LLVMValueRef v_gset_id_p;
LLVMValueRef v_gset_id;
/* Copy aggstate->gset_id to the result */
v_gset_id_p = l_ptr_const(&aggstate->gset_id,
l_ptr(LLVMInt32Type()));
v_gset_id = LLVMBuildLoad(b, v_gset_id_p, "v_gset_id");
/* and store result */
LLVMBuildStore(b, v_gset_id, v_resvaluep);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_AGGEXPR_ID:
{
TupleSplitState *tsstate = op->d.agg_expr_id.parent;
LLVMValueRef v_currentExprId_p;
LLVMValueRef v_currentExprId;
/* Copy tsstate->currentExprId to the result */
v_currentExprId_p = l_ptr_const(&tsstate->currentExprId,
l_ptr(LLVMInt32Type()));
v_currentExprId = LLVMBuildLoad(b, v_currentExprId_p, "v_currentExprId");
/* and store result */
LLVMBuildStore(b, v_currentExprId, v_resvaluep);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_ROWIDEXPR:
{
int64 *rowcounter_p = &op->d.rowidexpr.rowcounter;
LLVMValueRef v_rowcounter_p;
LLVMValueRef v_rowcounter;
LLVMValueRef v_rowcounter_new;
/* Fetch and increment rowcounter */
v_rowcounter_p = l_ptr_const(rowcounter_p,
l_ptr(LLVMInt64Type()));
v_rowcounter = LLVMBuildLoad(b, v_rowcounter_p, "v_rowcounter");
v_rowcounter_new = LLVMBuildAdd(b, v_rowcounter, l_int64_const(1), "v_rowcounter_new");
/* Store the new value back */
LLVMBuildStore(b, v_rowcounter_new, v_rowcounter_p);
/* and store result */
LLVMBuildStore(b, v_rowcounter_new, v_resvaluep);
LLVMBuildStore(b, l_sbool_const(0), v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_WINDOW_FUNC:
{
WindowFuncExprState *wfunc = op->d.window_func.wfstate;
LLVMValueRef v_wfuncnop;
LLVMValueRef v_wfuncno;
LLVMValueRef value,
isnull;
/*
* At this point aggref->wfuncno is not yet set (it's set
* up in ExecInitWindowAgg() after initializing the
* expression). So load it from memory each time round.
*/
v_wfuncnop = l_ptr_const(&wfunc->wfuncno,
l_ptr(LLVMInt32Type()));
v_wfuncno = LLVMBuildLoad(b, v_wfuncnop, "v_wfuncno");
/* load window func value / null */
value = l_load_gep1(b, v_aggvalues, v_wfuncno,
"windowvalue");
isnull = l_load_gep1(b, v_aggnulls, v_wfuncno,
"windownull");
LLVMBuildStore(b, value, v_resvaluep);
LLVMBuildStore(b, isnull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_SUBPLAN:
build_EvalXFunc(b, mod, "ExecEvalSubPlan",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_ALTERNATIVE_SUBPLAN:
build_EvalXFunc(b, mod, "ExecEvalAlternativeSubPlan",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_AGG_STRICT_DESERIALIZE:
{
FunctionCallInfo fcinfo = op->d.agg_deserialize.fcinfo_data;
LLVMValueRef v_fcinfo;
LLVMValueRef v_argnull0;
LLVMBasicBlockRef b_deserialize;
b_deserialize = l_bb_before_v(opblocks[i + 1],
"op.%d.deserialize", i);
v_fcinfo = l_ptr_const(fcinfo,
l_ptr(StructFunctionCallInfoData));
v_argnull0 = l_funcnull(b, v_fcinfo, 0);
LLVMBuildCondBr(b,
LLVMBuildICmp(b,
LLVMIntEQ,
v_argnull0,
l_sbool_const(1),
""),
opblocks[op->d.agg_deserialize.jumpnull],
b_deserialize);
LLVMPositionBuilderAtEnd(b, b_deserialize);
}
/* FALLTHROUGH */
case EEOP_AGG_DESERIALIZE:
{
AggState *aggstate;
FunctionCallInfo fcinfo;
LLVMValueRef v_retval;
LLVMValueRef v_fcinfo_isnull;
LLVMValueRef v_tmpcontext;
LLVMValueRef v_oldcontext;
aggstate = op->d.agg_deserialize.aggstate;
fcinfo = op->d.agg_deserialize.fcinfo_data;
v_tmpcontext =
l_ptr_const(aggstate->tmpcontext->ecxt_per_tuple_memory,
l_ptr(StructMemoryContextData));
v_oldcontext = l_mcxt_switch(mod, b, v_tmpcontext);
v_retval = BuildV1Call(context, b, mod, fcinfo,
&v_fcinfo_isnull);
l_mcxt_switch(mod, b, v_oldcontext);
LLVMBuildStore(b, v_retval, v_resvaluep);
LLVMBuildStore(b, v_fcinfo_isnull, v_resnullp);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_AGG_STRICT_INPUT_CHECK_NULLS:
case EEOP_AGG_STRICT_INPUT_CHECK_ARGS:
{
int nargs = op->d.agg_strict_input_check.nargs;
NullableDatum *args = op->d.agg_strict_input_check.args;
bool *nulls = op->d.agg_strict_input_check.nulls;
int jumpnull;
int argno;
LLVMValueRef v_argsp;
LLVMValueRef v_nullsp;
LLVMBasicBlockRef *b_checknulls;
Assert(nargs > 0);
jumpnull = op->d.agg_strict_input_check.jumpnull;
v_argsp = l_ptr_const(args, l_ptr(StructNullableDatum));
v_nullsp = l_ptr_const(nulls, l_ptr(TypeStorageBool));
/* create blocks for checking args */
b_checknulls = palloc(sizeof(LLVMBasicBlockRef *) * nargs);
for (argno = 0; argno < nargs; argno++)
{
b_checknulls[argno] =
l_bb_before_v(opblocks[i + 1],
"op.%d.check-null.%d",
i, argno);
}
LLVMBuildBr(b, b_checknulls[0]);
/* strict function, check for NULL args */
for (argno = 0; argno < nargs; argno++)
{
LLVMValueRef v_argno = l_int32_const(argno);
LLVMValueRef v_argisnull;
LLVMBasicBlockRef b_argnotnull;
LLVMPositionBuilderAtEnd(b, b_checknulls[argno]);
if (argno + 1 == nargs)
b_argnotnull = opblocks[i + 1];
else
b_argnotnull = b_checknulls[argno + 1];
if (opcode == EEOP_AGG_STRICT_INPUT_CHECK_NULLS)
v_argisnull = l_load_gep1(b, v_nullsp, v_argno, "");
else
{
LLVMValueRef v_argn;
v_argn = LLVMBuildGEP(b, v_argsp, &v_argno, 1, "");
v_argisnull =
l_load_struct_gep(b, v_argn,
FIELDNO_NULLABLE_DATUM_ISNULL,
"");
}
LLVMBuildCondBr(b,
LLVMBuildICmp(b,
LLVMIntEQ,
v_argisnull,
l_sbool_const(1), ""),
opblocks[jumpnull],
b_argnotnull);
}
break;
}
case EEOP_AGG_INIT_TRANS:
{
AggState *aggstate;
AggStatePerTrans pertrans;
LLVMValueRef v_aggstatep;
LLVMValueRef v_pertransp;
LLVMValueRef v_allpergroupsp;
LLVMValueRef v_pergroupp;
LLVMValueRef v_setoff,
v_transno;
LLVMValueRef v_notransvalue;
LLVMBasicBlockRef b_init;
aggstate = op->d.agg_init_trans.aggstate;
pertrans = op->d.agg_init_trans.pertrans;
v_aggstatep = l_ptr_const(aggstate,
l_ptr(StructAggState));
v_pertransp = l_ptr_const(pertrans,
l_ptr(StructAggStatePerTransData));
/*
* pergroup = &aggstate->all_pergroups
* [op->d.agg_init_trans_check.setoff]
* [op->d.agg_init_trans_check.transno];
*/
v_allpergroupsp =
l_load_struct_gep(b, v_aggstatep,
FIELDNO_AGGSTATE_ALL_PERGROUPS,
"aggstate.all_pergroups");
v_setoff = l_int32_const(op->d.agg_init_trans.setoff);
v_transno = l_int32_const(op->d.agg_init_trans.transno);
v_pergroupp =
LLVMBuildGEP(b,
l_load_gep1(b, v_allpergroupsp, v_setoff, ""),
&v_transno, 1, "");
v_notransvalue =
l_load_struct_gep(b, v_pergroupp,
FIELDNO_AGGSTATEPERGROUPDATA_NOTRANSVALUE,
"notransvalue");
b_init = l_bb_before_v(opblocks[i + 1],
"op.%d.inittrans", i);
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_notransvalue,
l_sbool_const(1), ""),
b_init,
opblocks[i + 1]);
LLVMPositionBuilderAtEnd(b, b_init);
{
LLVMValueRef params[3];
LLVMValueRef v_curaggcontext;
LLVMValueRef v_current_set;
LLVMValueRef v_aggcontext;
v_aggcontext = l_ptr_const(op->d.agg_init_trans.aggcontext,
l_ptr(StructExprContext));
v_current_set =
LLVMBuildStructGEP(b,
v_aggstatep,
FIELDNO_AGGSTATE_CURRENT_SET,
"aggstate.current_set");
v_curaggcontext =
LLVMBuildStructGEP(b,
v_aggstatep,
FIELDNO_AGGSTATE_CURAGGCONTEXT,
"aggstate.curaggcontext");
LLVMBuildStore(b, l_int32_const(op->d.agg_init_trans.setno),
v_current_set);
LLVMBuildStore(b, v_aggcontext,
v_curaggcontext);
params[0] = v_aggstatep;
params[1] = v_pertransp;
params[2] = v_pergroupp;
LLVMBuildCall(b,
llvm_get_decl(mod, FuncExecAggInitGroup),
params, lengthof(params),
"");
}
LLVMBuildBr(b, opblocks[op->d.agg_init_trans.jumpnull]);
break;
}
case EEOP_AGG_STRICT_TRANS_CHECK:
{
AggState *aggstate;
LLVMValueRef v_setoff,
v_transno;
LLVMValueRef v_aggstatep;
LLVMValueRef v_allpergroupsp;
LLVMValueRef v_transnull;
LLVMValueRef v_pergroupp;
int jumpnull = op->d.agg_strict_trans_check.jumpnull;
aggstate = op->d.agg_strict_trans_check.aggstate;
v_aggstatep = l_ptr_const(aggstate, l_ptr(StructAggState));
/*
* pergroup = &aggstate->all_pergroups
* [op->d.agg_strict_trans_check.setoff]
* [op->d.agg_init_trans_check.transno];
*/
v_allpergroupsp =
l_load_struct_gep(b, v_aggstatep,
FIELDNO_AGGSTATE_ALL_PERGROUPS,
"aggstate.all_pergroups");
v_setoff =
l_int32_const(op->d.agg_strict_trans_check.setoff);
v_transno =
l_int32_const(op->d.agg_strict_trans_check.transno);
v_pergroupp =
LLVMBuildGEP(b,
l_load_gep1(b, v_allpergroupsp, v_setoff, ""),
&v_transno, 1, "");
v_transnull =
l_load_struct_gep(b, v_pergroupp,
FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUEISNULL,
"transnull");
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ, v_transnull,
l_sbool_const(1), ""),
opblocks[jumpnull],
opblocks[i + 1]);
break;
}
case EEOP_AGG_PLAIN_PERGROUP_NULLCHECK:
{
int jumpnull;
LLVMValueRef v_aggstatep;
LLVMValueRef v_allpergroupsp;
LLVMValueRef v_pergroup_allaggs;
LLVMValueRef v_setoff;
jumpnull = op->d.agg_plain_pergroup_nullcheck.jumpnull;
/*
* pergroup_allaggs = aggstate->all_pergroups
* [op->d.agg_plain_pergroup_nullcheck.setoff];
*/
v_aggstatep = LLVMBuildBitCast(
b, v_parent, l_ptr(StructAggState), "");
v_allpergroupsp = l_load_struct_gep(
b, v_aggstatep,
FIELDNO_AGGSTATE_ALL_PERGROUPS,
"aggstate.all_pergroups");
v_setoff = l_int32_const(
op->d.agg_plain_pergroup_nullcheck.setoff);
v_pergroup_allaggs = l_load_gep1(
b, v_allpergroupsp, v_setoff, "");
LLVMBuildCondBr(
b,
LLVMBuildICmp(b, LLVMIntEQ,
LLVMBuildPtrToInt(
b, v_pergroup_allaggs, TypeSizeT, ""),
l_sizet_const(0), ""),
opblocks[jumpnull],
opblocks[i + 1]);
break;
}
case EEOP_AGG_PLAIN_TRANS_BYVAL:
case EEOP_AGG_PLAIN_TRANS:
{
AggState *aggstate;
AggStatePerTrans pertrans;
FunctionCallInfo fcinfo;
LLVMValueRef v_aggstatep;
LLVMValueRef v_fcinfo;
LLVMValueRef v_fcinfo_isnull;
LLVMValueRef v_transvaluep;
LLVMValueRef v_transnullp;
LLVMValueRef v_setoff;
LLVMValueRef v_transno;
LLVMValueRef v_aggcontext;
LLVMValueRef v_allpergroupsp;
LLVMValueRef v_current_setp;
LLVMValueRef v_current_pertransp;
LLVMValueRef v_curaggcontext;
LLVMValueRef v_pertransp;
LLVMValueRef v_pergroupp;
LLVMValueRef v_retval;
LLVMValueRef v_tmpcontext;
LLVMValueRef v_oldcontext;
aggstate = op->d.agg_trans.aggstate;
pertrans = op->d.agg_trans.pertrans;
fcinfo = pertrans->transfn_fcinfo;
v_aggstatep = l_ptr_const(aggstate,
l_ptr(StructAggState));
v_pertransp = l_ptr_const(pertrans,
l_ptr(StructAggStatePerTransData));
/*
* pergroup = &aggstate->all_pergroups
* [op->d.agg_strict_trans_check.setoff]
* [op->d.agg_init_trans_check.transno];
*/
v_allpergroupsp =
l_load_struct_gep(b, v_aggstatep,
FIELDNO_AGGSTATE_ALL_PERGROUPS,
"aggstate.all_pergroups");
v_setoff = l_int32_const(op->d.agg_trans.setoff);
v_transno = l_int32_const(op->d.agg_trans.transno);
v_pergroupp =
LLVMBuildGEP(b,
l_load_gep1(b, v_allpergroupsp, v_setoff, ""),
&v_transno, 1, "");
v_fcinfo = l_ptr_const(fcinfo,
l_ptr(StructFunctionCallInfoData));
v_aggcontext = l_ptr_const(op->d.agg_trans.aggcontext,
l_ptr(StructExprContext));
v_current_setp =
LLVMBuildStructGEP(b,
v_aggstatep,
FIELDNO_AGGSTATE_CURRENT_SET,
"aggstate.current_set");
v_curaggcontext =
LLVMBuildStructGEP(b,
v_aggstatep,
FIELDNO_AGGSTATE_CURAGGCONTEXT,
"aggstate.curaggcontext");
v_current_pertransp =
LLVMBuildStructGEP(b,
v_aggstatep,
FIELDNO_AGGSTATE_CURPERTRANS,
"aggstate.curpertrans");
/* set aggstate globals */
LLVMBuildStore(b, v_aggcontext, v_curaggcontext);
LLVMBuildStore(b, l_int32_const(op->d.agg_trans.setno),
v_current_setp);
LLVMBuildStore(b, v_pertransp, v_current_pertransp);
/* invoke transition function in per-tuple context */
v_tmpcontext =
l_ptr_const(aggstate->tmpcontext->ecxt_per_tuple_memory,
l_ptr(StructMemoryContextData));
v_oldcontext = l_mcxt_switch(mod, b, v_tmpcontext);
/* store transvalue in fcinfo->args[0] */
v_transvaluep =
LLVMBuildStructGEP(b, v_pergroupp,
FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUE,
"transvalue");
v_transnullp =
LLVMBuildStructGEP(b, v_pergroupp,
FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUEISNULL,
"transnullp");
LLVMBuildStore(b,
LLVMBuildLoad(b, v_transvaluep,
"transvalue"),
l_funcvaluep(b, v_fcinfo, 0));
LLVMBuildStore(b,
LLVMBuildLoad(b, v_transnullp, "transnull"),
l_funcnullp(b, v_fcinfo, 0));
/* and invoke transition function */
v_retval = BuildV1Call(context, b, mod, fcinfo,
&v_fcinfo_isnull);
/*
* For pass-by-ref datatype, must copy the new value into
* aggcontext and free the prior transValue. But if
* transfn returned a pointer to its first input, we don't
* need to do anything. Also, if transfn returned a
* pointer to a R/W expanded object that is already a
* child of the aggcontext, assume we can adopt that value
* without copying it.
*/
if (opcode == EEOP_AGG_PLAIN_TRANS)
{
LLVMBasicBlockRef b_call;
LLVMBasicBlockRef b_nocall;
LLVMValueRef v_fn;
LLVMValueRef v_transvalue;
LLVMValueRef v_transnull;
LLVMValueRef v_newval;
LLVMValueRef params[6];
b_call = l_bb_before_v(opblocks[i + 1],
"op.%d.transcall", i);
b_nocall = l_bb_before_v(opblocks[i + 1],
"op.%d.transnocall", i);
v_transvalue = LLVMBuildLoad(b, v_transvaluep, "");
v_transnull = LLVMBuildLoad(b, v_transnullp, "");
/*
* DatumGetPointer(newVal) !=
* DatumGetPointer(pergroup->transValue))
*/
LLVMBuildCondBr(b,
LLVMBuildICmp(b, LLVMIntEQ,
v_transvalue,
v_retval, ""),
b_nocall, b_call);
/* returned datum not passed datum, reparent */
LLVMPositionBuilderAtEnd(b, b_call);
params[0] = v_aggstatep;
params[1] = v_pertransp;
params[2] = v_retval;
params[3] = LLVMBuildTrunc(b, v_fcinfo_isnull,
TypeParamBool, "");
params[4] = v_transvalue;
params[5] = LLVMBuildTrunc(b, v_transnull,
TypeParamBool, "");
v_fn = llvm_get_decl(mod, FuncExecAggTransReparent);
v_newval =
LLVMBuildCall(b, v_fn,
params, lengthof(params),
"");
/* store trans value */
LLVMBuildStore(b, v_newval, v_transvaluep);
LLVMBuildStore(b, v_fcinfo_isnull, v_transnullp);
l_mcxt_switch(mod, b, v_oldcontext);
LLVMBuildBr(b, opblocks[i + 1]);
/* returned datum passed datum, no need to reparent */
LLVMPositionBuilderAtEnd(b, b_nocall);
}
/* store trans value */
LLVMBuildStore(b, v_retval, v_transvaluep);
LLVMBuildStore(b, v_fcinfo_isnull, v_transnullp);
l_mcxt_switch(mod, b, v_oldcontext);
LLVMBuildBr(b, opblocks[i + 1]);
break;
}
case EEOP_AGG_ORDERED_TRANS_DATUM:
build_EvalXFunc(b, mod, "ExecEvalAggOrderedTransDatum",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_AGG_ORDERED_TRANS_TUPLE:
build_EvalXFunc(b, mod, "ExecEvalAggOrderedTransTuple",
v_state, v_econtext, op);
LLVMBuildBr(b, opblocks[i + 1]);
break;
case EEOP_LAST:
Assert(false);
break;
}
}
LLVMDisposeBuilder(b);
/*
* Don't immediately emit function, instead do so the first time the
* expression is actually evaluated. That allows to emit a lot of
* functions together, avoiding a lot of repeated llvm and memory
* remapping overhead.
*/
{
CompiledExprState *cstate = palloc0(sizeof(CompiledExprState));
cstate->context = context;
cstate->funcname = funcname;
state->evalfunc = ExecRunCompiledExpr;
state->evalfunc_private = cstate;
}
llvm_leave_fatal_on_oom();
INSTR_TIME_SET_CURRENT(endtime);
INSTR_TIME_ACCUM_DIFF(context->base.instr.generation_counter,
endtime, starttime);
return true;
}
/*
* Run compiled expression.
*
* This will only be called the first time a JITed expression is called. We
* first make sure the expression is still up2date, and then get a pointer to
* the emitted function. The latter can be the first thing that triggers
* optimizing and emitting all the generated functions.
*/
static Datum
ExecRunCompiledExpr(ExprState *state, ExprContext *econtext, bool *isNull)
{
CompiledExprState *cstate = state->evalfunc_private;
ExprStateEvalFunc func;
CheckExprStillValid(state, econtext);
llvm_enter_fatal_on_oom();
func = (ExprStateEvalFunc) llvm_get_function(cstate->context,
cstate->funcname);
llvm_leave_fatal_on_oom();
Assert(func);
/* remove indirection via this function for future calls */
state->evalfunc = func;
return func(state, econtext, isNull);
}
static LLVMValueRef
BuildV1Call(LLVMJitContext *context, LLVMBuilderRef b,
LLVMModuleRef mod, FunctionCallInfo fcinfo,
LLVMValueRef *v_fcinfo_isnull)
{
LLVMValueRef v_fn;
LLVMValueRef v_fcinfo_isnullp;
LLVMValueRef v_retval;
LLVMValueRef v_fcinfo;
v_fn = llvm_function_reference(context, b, mod, fcinfo);
v_fcinfo = l_ptr_const(fcinfo, l_ptr(StructFunctionCallInfoData));
v_fcinfo_isnullp = LLVMBuildStructGEP(b, v_fcinfo,
FIELDNO_FUNCTIONCALLINFODATA_ISNULL,
"v_fcinfo_isnull");
LLVMBuildStore(b, l_sbool_const(0), v_fcinfo_isnullp);
v_retval = LLVMBuildCall(b, v_fn, &v_fcinfo, 1, "funccall");
if (v_fcinfo_isnull)
*v_fcinfo_isnull = LLVMBuildLoad(b, v_fcinfo_isnullp, "");
/*
* Add lifetime-end annotation, signalling that writes to memory don't
* have to be retained (important for inlining potential).
*/
{
LLVMValueRef v_lifetime = create_LifetimeEnd(mod);
LLVMValueRef params[2];
params[0] = l_int64_const(sizeof(NullableDatum) * fcinfo->nargs);
params[1] = l_ptr_const(fcinfo->args, l_ptr(LLVMInt8Type()));
LLVMBuildCall(b, v_lifetime, params, lengthof(params), "");
params[0] = l_int64_const(sizeof(fcinfo->isnull));
params[1] = l_ptr_const(&fcinfo->isnull, l_ptr(LLVMInt8Type()));
LLVMBuildCall(b, v_lifetime, params, lengthof(params), "");
}
return v_retval;
}
/*
* Implement an expression step by calling the function funcname.
*/
static void
build_EvalXFunc(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname,
LLVMValueRef v_state, LLVMValueRef v_econtext,
ExprEvalStep *op)
{
LLVMTypeRef sig;
LLVMValueRef v_fn;
LLVMTypeRef param_types[3];
LLVMValueRef params[3];
v_fn = LLVMGetNamedFunction(mod, funcname);
if (!v_fn)
{
param_types[0] = l_ptr(StructExprState);
param_types[1] = l_ptr(StructExprEvalStep);
param_types[2] = l_ptr(StructExprContext);
sig = LLVMFunctionType(LLVMVoidType(),
param_types, lengthof(param_types),
false);
v_fn = LLVMAddFunction(mod, funcname, sig);
}
params[0] = v_state;
params[1] = l_ptr_const(op, l_ptr(StructExprEvalStep));
params[2] = v_econtext;
LLVMBuildCall(b,
v_fn,
params, lengthof(params), "");
}
static LLVMValueRef
create_LifetimeEnd(LLVMModuleRef mod)
{
LLVMTypeRef sig;
LLVMValueRef fn;
LLVMTypeRef param_types[2];
/* LLVM 5+ has a variadic pointer argument */
#if LLVM_VERSION_MAJOR < 5
const char *nm = "llvm.lifetime.end";
#else
const char *nm = "llvm.lifetime.end.p0i8";
#endif
fn = LLVMGetNamedFunction(mod, nm);
if (fn)
return fn;
param_types[0] = LLVMInt64Type();
param_types[1] = l_ptr(LLVMInt8Type());
sig = LLVMFunctionType(LLVMVoidType(),
param_types, lengthof(param_types),
false);
fn = LLVMAddFunction(mod, nm, sig);
LLVMSetFunctionCallConv(fn, LLVMCCallConv);
Assert(LLVMGetIntrinsicID(fn));
return fn;
}
| 28.023705 | 92 | 0.638149 | [
"object"
] |
36aecc4c74f8d67935b90d45bd0704a2b6e7ed07 | 5,091 | h | C | src/yb/common/ql_scanspec.h | asad-awadia/yugabyte-db | 429e28634c13711eaa81f91d3f0d457ac6a401bc | [
"Apache-2.0",
"CC0-1.0"
] | 2,759 | 2017-10-05T22:15:20.000Z | 2019-09-16T13:16:21.000Z | src/yb/common/ql_scanspec.h | asad-awadia/yugabyte-db | 429e28634c13711eaa81f91d3f0d457ac6a401bc | [
"Apache-2.0",
"CC0-1.0"
] | 2,195 | 2017-11-06T23:38:44.000Z | 2019-09-16T20:24:31.000Z | src/yb/common/ql_scanspec.h | asad-awadia/yugabyte-db | 429e28634c13711eaa81f91d3f0d457ac6a401bc | [
"Apache-2.0",
"CC0-1.0"
] | 257 | 2017-10-06T02:23:19.000Z | 2019-09-13T18:01:15.000Z | // Copyright (c) YugaByte, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations
// under the License.
//
//
// This file contains QLScanSpec that implements a QL scan (SELECT) specification.
#ifndef YB_COMMON_QL_SCANSPEC_H
#define YB_COMMON_QL_SCANSPEC_H
#include <map>
#include <boost/functional/hash.hpp>
#include <boost/optional/optional.hpp>
#include "yb/common/common_fwd.h"
#include "yb/common/column_id.h"
#include "yb/common/common_types.pb.h"
#include "yb/common/value.pb.h"
namespace yb {
//--------------------------------------------------------------------------------------------------
// YQL Scanspec.
// This class represents all scan specifications.
//--------------------------------------------------------------------------------------------------
class YQLScanSpec {
public:
explicit YQLScanSpec(QLClient client_type) : client_type_(client_type) {
}
virtual ~YQLScanSpec() {
}
QLClient client_type() const {
return client_type_;
}
private:
const QLClient client_type_;
};
//--------------------------------------------------------------------------------------------------
// CQL Support.
//--------------------------------------------------------------------------------------------------
// A class to determine the lower/upper-bound range components of a QL scan from its WHERE
// condition.
class QLScanRange {
public:
// Value range of a column
struct QLRange {
boost::optional<QLValuePB> min_value;
boost::optional<QLValuePB> max_value;
};
QLScanRange(const Schema& schema, const QLConditionPB& condition);
QLScanRange(const Schema& schema, const PgsqlConditionPB& condition);
QLScanRange(const Schema& schema, const LWPgsqlConditionPB& condition);
QLRange RangeFor(ColumnId col_id) const {
const auto& iter = ranges_.find(col_id);
return (iter == ranges_.end() ? QLRange() : iter->second);
}
std::vector<ColumnId> GetColIds() const {
std::vector<ColumnId> col_id_list;
for (auto &it : ranges_) {
col_id_list.push_back(it.first);
}
return col_id_list;
}
bool has_in_range_options() const {
return has_in_range_options_;
}
// Intersect / union / complement operators.
QLScanRange& operator&=(const QLScanRange& other);
QLScanRange& operator|=(const QLScanRange& other);
QLScanRange& operator~();
QLScanRange& operator=(QLScanRange&& other);
private:
template <class Cond>
void Init(const Cond& cond);
// Table schema being scanned.
const Schema& schema_;
// Mapping of column id to the column value ranges (inclusive lower/upper bounds) to scan.
std::unordered_map<ColumnId, QLRange, boost::hash<ColumnId>> ranges_;
// Whether the condition has an IN condition on a range (clustering) column.
// Used in doc_ql_scanspec to try to construct the set of options for a multi-point scan.
bool has_in_range_options_ = false;
};
// A scan specification for a QL scan. It may be used to scan either a specified doc key
// or a hash key + optional WHERE condition clause.
class QLScanSpec : public YQLScanSpec {
public:
explicit QLScanSpec(QLExprExecutorPtr executor = nullptr);
// Scan for the given hash key and a condition.
QLScanSpec(const QLConditionPB* condition,
const QLConditionPB* if_condition,
const bool is_forward_scan,
QLExprExecutorPtr executor = nullptr);
virtual ~QLScanSpec() {}
// Evaluate the WHERE condition for the given row to decide if it is selected or not.
// virtual to make the class polymorphic.
virtual Status Match(const QLTableRow& table_row, bool* match) const;
bool is_forward_scan() const {
return is_forward_scan_;
}
// Get Schema if available.
virtual const Schema* schema() const { return nullptr; }
protected:
const QLConditionPB* condition_;
const QLConditionPB* if_condition_;
const bool is_forward_scan_;
QLExprExecutorPtr executor_;
};
//--------------------------------------------------------------------------------------------------
// PostgreSQL Support.
//--------------------------------------------------------------------------------------------------
class PgsqlScanSpec : public YQLScanSpec {
public:
typedef std::unique_ptr<PgsqlScanSpec> UniPtr;
explicit PgsqlScanSpec(const PgsqlExpressionPB *where_expr,
QLExprExecutorPtr executor = nullptr);
virtual ~PgsqlScanSpec();
const PgsqlExpressionPB *where_expr() {
return where_expr_;
}
protected:
const PgsqlExpressionPB *where_expr_;
QLExprExecutorPtr executor_;
};
} // namespace yb
#endif // YB_COMMON_QL_SCANSPEC_H
| 30.854545 | 100 | 0.642506 | [
"vector"
] |
36b0172069327ed5994dc4c3eced5a9fbf12778f | 9,339 | c | C | release/src/linux/linux/drivers/scsi/fcal.c | enfoTek/tomato.linksys.e2000.nvram-mod | 2ce3a5217def49d6df7348522e2bfda702b56029 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | release/src/linux/linux/drivers/scsi/fcal.c | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | release/src/linux/linux/drivers/scsi/fcal.c | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | /* fcal.c: Fibre Channel Arbitrated Loop SCSI host adapter driver.
*
* Copyright (C) 1998,1999 Jakub Jelinek (jj@ultra.linux.cz)
*
*/
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/blk.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
#include <linux/config.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include <asm/irq.h>
#include "scsi.h"
#include "hosts.h"
#include "../fc4/fcp_impl.h"
#include "fcal.h"
#include <linux/module.h>
/* #define FCAL_DEBUG */
#define fcal_printk printk ("FCAL %s: ", fc->name); printk
#ifdef FCAL_DEBUG
#define FCALD(x) fcal_printk x;
#define FCALND(x) printk ("FCAL: "); printk x;
#else
#define FCALD(x)
#define FCALND(x)
#endif
static unsigned char alpa2target[] = {
0x7e, 0x7d, 0x7c, 0xff, 0x7b, 0xff, 0xff, 0xff, 0x7a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x79,
0x78, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x77, 0x76, 0xff, 0xff, 0x75, 0xff, 0x74, 0x73, 0x72,
0xff, 0xff, 0xff, 0x71, 0xff, 0x70, 0x6f, 0x6e, 0xff, 0x6d, 0x6c, 0x6b, 0x6a, 0x69, 0x68, 0xff,
0xff, 0x67, 0x66, 0x65, 0x64, 0x63, 0x62, 0xff, 0xff, 0x61, 0x60, 0xff, 0x5f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x5e, 0xff, 0x5d, 0x5c, 0x5b, 0xff, 0x5a, 0x59, 0x58, 0x57, 0x56, 0x55, 0xff,
0xff, 0x54, 0x53, 0x52, 0x51, 0x50, 0x4f, 0xff, 0xff, 0x4e, 0x4d, 0xff, 0x4c, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x4b, 0xff, 0x4a, 0x49, 0x48, 0xff, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0xff,
0xff, 0x41, 0x40, 0x3f, 0x3e, 0x3d, 0x3c, 0xff, 0xff, 0x3b, 0x3a, 0xff, 0x39, 0xff, 0xff, 0xff,
0x38, 0x37, 0x36, 0xff, 0x35, 0xff, 0xff, 0xff, 0x34, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x33,
0x32, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0x30, 0xff, 0xff, 0x2f, 0xff, 0x2e, 0x2d, 0x2c,
0xff, 0xff, 0xff, 0x2b, 0xff, 0x2a, 0x29, 0x28, 0xff, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0xff,
0xff, 0x21, 0x20, 0x1f, 0x1e, 0x1d, 0x1c, 0xff, 0xff, 0x1b, 0x1a, 0xff, 0x19, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x18, 0xff, 0x17, 0x16, 0x15, 0xff, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0xff,
0xff, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0xff, 0xff, 0x08, 0x07, 0xff, 0x06, 0xff, 0xff, 0xff,
0x05, 0x04, 0x03, 0xff, 0x02, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
};
static unsigned char target2alpa[] = {
0xef, 0xe8, 0xe4, 0xe2, 0xe1, 0xe0, 0xdc, 0xda, 0xd9, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd1, 0xce,
0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc7, 0xc6, 0xc5, 0xc3, 0xbc, 0xba, 0xb9, 0xb6, 0xb5, 0xb4, 0xb3,
0xb2, 0xb1, 0xae, 0xad, 0xac, 0xab, 0xaa, 0xa9, 0xa7, 0xa6, 0xa5, 0xa3, 0x9f, 0x9e, 0x9d, 0x9b,
0x98, 0x97, 0x90, 0x8f, 0x88, 0x84, 0x82, 0x81, 0x80, 0x7c, 0x7a, 0x79, 0x76, 0x75, 0x74, 0x73,
0x72, 0x71, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x69, 0x67, 0x66, 0x65, 0x63, 0x5c, 0x5a, 0x59, 0x56,
0x55, 0x54, 0x53, 0x52, 0x51, 0x4e, 0x4d, 0x4c, 0x4b, 0x4a, 0x49, 0x47, 0x46, 0x45, 0x43, 0x3c,
0x3a, 0x39, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x27, 0x26,
0x25, 0x23, 0x1f, 0x1e, 0x1d, 0x1b, 0x18, 0x17, 0x10, 0x0f, 0x08, 0x04, 0x02, 0x01, 0x00
};
static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
static void fcal_select_queue_depths(struct Scsi_Host *host, Scsi_Device *devlist)
{
Scsi_Device *device;
for (device = devlist; device; device = device->next) {
if (device->host != host) continue;
if (device->tagged_supported)
device->queue_depth = /* 254 */ 8;
else
device->queue_depth = 2;
}
}
/* Detect all FC Arbitrated Loops attached to the machine.
fc4 module has done all the work for us... */
int __init fcal_detect(Scsi_Host_Template *tpnt)
{
int nfcals = 0;
fc_channel *fc;
int fcalcount;
int i;
tpnt->proc_name = "fcal";
fcalcount = 0;
for_each_online_fc_channel(fc)
if (fc->posmap)
fcalcount++;
FCALND(("%d channels online\n", fcalcount))
if (!fcalcount) {
#if defined(MODULE) && defined(CONFIG_FC4_SOCAL_MODULE) && defined(CONFIG_KMOD)
request_module("socal");
for_each_online_fc_channel(fc)
if (fc->posmap)
fcalcount++;
if (!fcalcount)
#endif
return 0;
}
for_each_online_fc_channel(fc) {
struct Scsi_Host *host;
long *ages;
struct fcal *fcal;
if (!fc->posmap) continue;
/* Strange, this is already registered to some other SCSI host, then it cannot be fcal */
if (fc->scsi_name[0]) continue;
memcpy (fc->scsi_name, "FCAL", 4);
fc->can_queue = FCAL_CAN_QUEUE;
fc->rsp_size = 64;
fc->encode_addr = fcal_encode_addr;
ages = kmalloc (128 * sizeof(long), GFP_KERNEL);
if (!ages) continue;
host = scsi_register (tpnt, sizeof (struct fcal));
if (!host)
{
kfree(ages);
continue;
}
nfcals++;
if (fc->module) __MOD_INC_USE_COUNT(fc->module);
fcal = (struct fcal *)host->hostdata;
fc->fcp_register(fc, TYPE_SCSI_FCP, 0);
for (i = 0; i < fc->posmap->len; i++) {
int status, target, alpa;
alpa = fc->posmap->list[i];
FCALD(("Sending PLOGI to %02x\n", alpa))
target = alpa2target[alpa];
status = fc_do_plogi(fc, alpa, fcal->node_wwn + target,
fcal->nport_wwn + target);
FCALD(("PLOGI returned with status %d\n", status))
if (status != FC_STATUS_OK)
continue;
FCALD(("Sending PRLI to %02x\n", alpa))
status = fc_do_prli(fc, alpa);
FCALD(("PRLI returned with status %d\n", status))
if (status == FC_STATUS_OK)
fcal->map[target] = 1;
}
host->max_id = 127;
host->irq = fc->irq;
#ifdef __sparc_v9__
host->unchecked_isa_dma = 1;
#endif
host->select_queue_depths = fcal_select_queue_depths;
fc->channels = 1;
fc->targets = 127;
fc->ages = ages;
memset (ages, 0, 128 * sizeof(long));
fcal->fc = fc;
FCALD(("Found FCAL\n"))
}
if (nfcals)
#ifdef __sparc__
printk ("FCAL: Total of %d Sun Enterprise Network Array (A5000 or EX500) channels found\n", nfcals);
#else
printk ("FCAL: Total of %d Fibre Channel Arbitrated Loops found\n", nfcals);
#endif
return nfcals;
}
int fcal_release(struct Scsi_Host *host)
{
struct fcal *fcal = (struct fcal *)host->hostdata;
fc_channel *fc = fcal->fc;
if (fc->module) __MOD_DEC_USE_COUNT(fc->module);
fc->fcp_register(fc, TYPE_SCSI_FCP, 1);
FCALND((" releasing fcal.\n"));
kfree (fc->ages);
FCALND(("released fcal!\n"));
return 0;
}
#undef SPRINTF
#define SPRINTF(args...) { if (pos < (buffer + length)) pos += sprintf (pos, ## args); }
int fcal_proc_info (char *buffer, char **start, off_t offset, int length, int hostno, int inout)
{
struct Scsi_Host *host = NULL;
struct fcal *fcal;
fc_channel *fc;
char *pos = buffer;
int i, j;
for (host=scsi_hostlist; host; host=host->next)
if (host->host_no == hostno)
break;
if (!host) return -ESRCH;
if (inout) return length;
fcal = (struct fcal *)host->hostdata;
fc = fcal->fc;
#ifdef __sparc__
SPRINTF ("Sun Enterprise Network Array (A5000 or E?500) on %s PROM node %x\n", fc->name, fc->dev->prom_node);
#else
SPRINTF ("Fibre Channel Arbitrated Loop on %s\n", fc->name);
#endif
SPRINTF ("Initiator AL-PA: %02x\n", fc->sid);
SPRINTF ("\nAttached devices: %s\n", host->host_queue ? "" : "none");
for (i = 0; i < fc->posmap->len; i++) {
unsigned char alpa = fc->posmap->list[i];
unsigned char target;
u32 *u1, *u2;
target = alpa2target[alpa];
u1 = (u32 *)&fcal->nport_wwn[target];
u2 = (u32 *)&fcal->node_wwn[target];
if (!u1[0] && !u1[1]) {
SPRINTF (" [AL-PA: %02x] Not responded to PLOGI\n", alpa);
} else if (!fcal->map[target]) {
SPRINTF (" [AL-PA: %02x, Port WWN: %08x%08x, Node WWN: %08x%08x] Not responded to PRLI\n",
alpa, u1[0], u1[1], u2[0], u2[1]);
} else {
Scsi_Device *scd;
for (scd = host->host_queue ; scd; scd = scd->next)
if (scd->host->host_no == hostno && scd->id == target) {
SPRINTF (" [AL-PA: %02x, Id: %02d, Port WWN: %08x%08x, Node WWN: %08x%08x] ",
alpa, target, u1[0], u1[1], u2[0], u2[1]);
SPRINTF ("%s ", (scd->type < MAX_SCSI_DEVICE_CODE) ?
scsi_device_types[(short) scd->type] : "Unknown device");
for (j = 0; (j < 8) && (scd->vendor[j] >= 0x20); j++)
SPRINTF ("%c", scd->vendor[j]);
SPRINTF (" ");
for (j = 0; (j < 16) && (scd->model[j] >= 0x20); j++)
SPRINTF ("%c", scd->model[j]);
SPRINTF ("\n");
}
}
}
SPRINTF ("\n");
*start = buffer + offset;
if ((pos - buffer) < offset)
return 0;
else if (pos - buffer - offset < length)
return pos - buffer - offset;
else
return length;
}
/*
For FC-AL, we use a simple addressing: we have just one channel 0,
and all AL-PAs are mapped to targets 0..0x7e
*/
static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd)
{
struct fcal *f;
/* We don't support LUNs yet - I'm not sure if LUN should be in SCSI fcp_cdb, or in second byte of addr[0] */
if (SCpnt->cmnd[1] & 0xe0) return -EINVAL;
/* FC-PLDA tells us... */
memset(addr, 0, 8);
f = (struct fcal *)SCpnt->host->hostdata;
if (!f->map[SCpnt->target]) return -EINVAL;
/* Now, determine DID: It will be Native Identifier, so we zero upper
2 bytes of the 3 byte DID, lowest byte will be AL-PA */
fcmd->did = target2alpa[SCpnt->target];
FCALD(("trying DID %06x\n", fcmd->did))
return 0;
}
static Scsi_Host_Template driver_template = FCAL;
#include "scsi_module.c"
EXPORT_NO_SYMBOLS;
| 30.720395 | 110 | 0.646857 | [
"model"
] |
36b0190bb4a81b1ce123f27d5a6afc2eb80567ee | 26,058 | c | C | ble_app/src/driver/soter_ble.c | Kayuii/hdwallet_frimware | d0c84d22d0cf924fd76a620f82e6918f62b121ca | [
"Apache-2.0"
] | 1 | 2021-08-31T02:35:57.000Z | 2021-08-31T02:35:57.000Z | ble_app/src/driver/soter_ble.c | Kayuii/hdwallet_frimware | d0c84d22d0cf924fd76a620f82e6918f62b121ca | [
"Apache-2.0"
] | null | null | null | ble_app/src/driver/soter_ble.c | Kayuii/hdwallet_frimware | d0c84d22d0cf924fd76a620f82e6918f62b121ca | [
"Apache-2.0"
] | null | null | null | #include "driver/soter_ble.h"
#include "nrf_ble_lesc.h"
#define NRF_LOG_MODULE_NAME soter_ble
#include "nrf_log.h"
NRF_LOG_MODULE_REGISTER();
#define MANUFACTURER_NAME "Digbig Co., Ltd." /**< Manufacturer. */
#define MODEL_NUMBER "V1" /**< Model Number string. */
#define MANUFACTURER_ID 0x1600161800 /**< Manufacturer ID. */
#define ORG_UNIQUE_ID 0x161816 /**< Organisation Unique ID. */
#define APP_BLE_OBSERVER_PRIO \
3 /**< Application's BLE observer priority. You shouldn't need to modify \
this value. */
#define APP_BLE_CONN_CFG_TAG \
1 /**< A tag identifying the SoftDevice BLE configuration. */
#define APP_ADV_INTERVAL \
40 /**< The advertising interval (in units of 0.625 ms. This value \
corresponds to 25 ms). */
#define APP_ADV_DURATION \
30000 /**< The advertising duration (300 seconds) in units of 10 \
milliseconds. */
#define MIN_CONN_INTERVAL \
MSEC_TO_UNITS( \
10, \
UNIT_1_25_MS) /**< Minimum acceptable connection interval (10 ms). */
#define MAX_CONN_INTERVAL \
MSEC_TO_UNITS( \
100, \
UNIT_1_25_MS) /**< Maximum acceptable connection interval (100 ms) */
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT \
MSEC_TO_UNITS( \
4000, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds). */
#define FIRST_CONN_PARAMS_UPDATE_DELAY \
APP_TIMER_TICKS( \
5000) /**< Time from initiating event (connect or start of \
notification) to first time sd_ble_gap_conn_param_update is \
called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY \
APP_TIMER_TICKS( \
30000) /**< Time between each call to sd_ble_gap_conn_param_update \
after the first call (30 seconds). */
#define MAX_CONN_PARAM_UPDATE_COUNT \
3 /**< Number of attempts before giving up the connection parameter \
negotiation. */
#define LESC_DEBUG_MODE \
0 /**< Set to 1 to use LESC debug keys, allows you to use a sniffer to \
inspect traffic. */
#define SEC_PARAM_BOND 1 /**< Perform bonding. */
#define SEC_PARAM_MITM \
1 /**< Man In The Middle protection required (applicable when display \
module is detected). */
#define SEC_PARAM_LESC 1 /**< LE Secure Connections enabled. */
#define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES \
BLE_GAP_IO_CAPS_DISPLAY_ONLY /**< Display I/O capabilities. */
#define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
#define PASSKEY_LENGTH \
6 /**< Length of pass-key received by the stack for display. */
#define SOTER_BLE_STACK_SIZE 1024
#define SOTER_BLE_PRIORITY 2
static char *m_device_name;
TaskHandle_t soter_ble_task_handle;
BLE_BAS_DEF(m_bas); /**< Battery service instance. */
NRF_BLE_GATT_DEF(m_gatt); /**< GATT module instance. */
NRF_BLE_QWR_DEF(m_qwr); /**< Context for the Queued Write module.*/
BLE_ADVERTISING_DEF(m_advertising); /**< Advertising module instance. */
BLE_SOTER_DEF(m_soter); /**< BLE Soter service instance. */
static transport_message_t *rx_message = NULL;
static SemaphoreHandle_t *rx_semaphore = NULL;
static pm_peer_id_t m_peer_to_be_deleted = PM_PEER_ID_INVALID;
static uint16_t m_conn_handle =
BLE_CONN_HANDLE_INVALID; /**< Handle of the current connection. */
static bool erase_bonds;
static ble_uuid_t
m_adv_uuids[] = /**< Universally unique service identifiers. */
{{BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}};
uint16_t soter_service_max_data_len = BLE_SEGMENT_SIZE;
static volatile m_pending_tx = false;
static void advertising_start(void *p_erase_bonds);
static void soter_service_data_handler(ble_soter_service_evt_t *p_evt);
soter_ble_pairing_pin_handler_t soter_ble_pairing_pin_handler = NULL;
void soter_ble_set_rx_parameters(transport_message_t *msg,
SemaphoreHandle_t *semaphore) {
rx_message = msg;
rx_semaphore = semaphore;
}
void soter_ble_set_pairing_pin_handler(
soter_ble_pairing_pin_handler_t handler) {
soter_ble_pairing_pin_handler = handler;
}
bool soter_ble_tx(uint8_t *message, uint16_t len) {
uint16_t pos = 1;
uint8_t *tmp_buffer = (uint8_t *)malloc(soter_service_max_data_len);
/* Chunk out message */
while (pos < len) {
memset(tmp_buffer, 0x00, soter_service_max_data_len);
tmp_buffer[0] = '?';
memcpy(tmp_buffer + 1, message + pos, soter_service_max_data_len - 1);
m_pending_tx = true;
ble_soter_service_data_send(&m_soter, tmp_buffer,
&soter_service_max_data_len, m_conn_handle);
pos += soter_service_max_data_len - 1;
while (m_pending_tx) {
vTaskDelay(1);
}
}
free(tmp_buffer);
return true;
}
/**@brief Function for handling Peer Manager events.
*
* @param[in] p_evt Peer Manager event.
*/
static void pm_evt_handler(pm_evt_t const *p_evt) {
ret_code_t err_code;
pm_handler_on_pm_evt(p_evt);
pm_handler_disconnect_on_sec_failure(p_evt);
pm_handler_flash_clean(p_evt);
switch (p_evt->evt_id) {
case PM_EVT_BONDED_PEER_CONNECTED:
NRF_LOG_INFO("PM_EVT_BONDED_PEER_CONNECTED peer_id %d",
p_evt->peer_id);
break;
case PM_EVT_CONN_SEC_START:
NRF_LOG_INFO("PM_EVT_CONN_SEC_START");
break;
case PM_EVT_CONN_SEC_SUCCEEDED: {
pm_conn_sec_status_t conn_sec_status;
// Check if the link is authenticated (meaning at least MITM).
err_code =
pm_conn_sec_status_get(p_evt->conn_handle, &conn_sec_status);
APP_ERROR_CHECK(err_code);
if (conn_sec_status.mitm_protected) {
NRF_LOG_INFO(
"Link secured. Role: %d. conn_handle: %d, Procedure: %d",
ble_conn_state_role(p_evt->conn_handle), p_evt->conn_handle,
p_evt->params.conn_sec_succeeded.procedure);
} else {
// The peer did not use MITM, disconnect.
NRF_LOG_INFO("Collector did not use MITM, disconnecting");
err_code = pm_peer_id_get(m_conn_handle, &m_peer_to_be_deleted);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_disconnect(
m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
APP_ERROR_CHECK(err_code);
}
} break;
case PM_EVT_CONN_SEC_FAILED:
NRF_LOG_INFO("PM_EVT_CONN_SEC_FAILED");
if (p_evt->params.conn_sec_failed.error ==
PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING) {
// Rebond if one party has lost its keys.
err_code = pm_conn_secure(p_evt->conn_handle, true);
if (err_code != NRF_ERROR_BUSY) {
APP_ERROR_CHECK(err_code);
}
}
m_conn_handle = BLE_CONN_HANDLE_INVALID;
break;
case PM_EVT_CONN_SEC_PARAMS_REQ:
NRF_LOG_INFO("PM_EVT_CONN_SEC_PARAMS_REQ");
break;
case PM_EVT_PEERS_DELETE_SUCCEEDED:
NRF_LOG_INFO("PM_EVT_PEERS_DELETE_SUCCEEDED");
advertising_start(false);
break;
case PM_EVT_CONN_SEC_CONFIG_REQ: {
NRF_LOG_INFO("PM_EVT_CONN_SEC_CONFIG_REQ");
pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
} break;
default:
NRF_LOG_INFO("Unhandled PM Evt %d", p_evt->evt_id);
break;
}
}
/**@brief Function for the GAP initialization.
*
* @details This function sets up all the necessary GAP (Generic Access Profile)
* parameters of the device including the device name, appearance, and the
* preferred connection parameters.
*/
static void gap_params_init(void) {
ret_code_t err_code;
ble_gap_conn_params_t gap_conn_params;
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(
&sec_mode, (const uint8_t *)m_device_name, strlen(m_device_name));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_UNKNOWN);
APP_ERROR_CHECK(err_code);
memset(&gap_conn_params, 0, sizeof(gap_conn_params));
gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
APP_ERROR_CHECK(err_code);
}
/**@brief Function for initializing the GATT module.
*/
static void gatt_init(void) {
ret_code_t err_code = nrf_ble_gatt_init(&m_gatt, NULL);
APP_ERROR_CHECK(err_code);
}
/**@brief Function for handling Queued Write Module errors.
*
* @details A pointer to this function will be passed to each service which may
* need to inform the application about an error.
*
* @param[in] nrf_error Error code containing information about what went
* wrong.
*/
static void nrf_qwr_error_handler(uint32_t nrf_error) {
APP_ERROR_HANDLER(nrf_error);
}
/**@brief Function for initializing services that will be used by the
* application.
*/
static void services_init() {
ret_code_t err_code;
ble_bas_init_t bas_init;
ble_dis_init_t dis_init;
ble_soter_service_init_t soter_service_init;
nrf_ble_qwr_init_t qwr_init = {0};
// Initialize Queued Write Module.
qwr_init.error_handler = nrf_qwr_error_handler;
err_code = nrf_ble_qwr_init(&m_qwr, &qwr_init);
APP_ERROR_CHECK(err_code);
// Initialize Battery Service.
memset(&bas_init, 0, sizeof(bas_init));
// Here the sec level for the Battery Service can be changed/increased.
bas_init.bl_rd_sec = SEC_OPEN;
bas_init.bl_cccd_wr_sec = SEC_OPEN;
bas_init.bl_report_rd_sec = SEC_OPEN;
bas_init.evt_handler = NULL;
bas_init.support_notification = true;
bas_init.p_report_ref = NULL;
bas_init.initial_batt_level = 100;
err_code = ble_bas_init(&m_bas, &bas_init);
APP_ERROR_CHECK(err_code);
// Initialize Device Information Service.
memset(&dis_init, 0, sizeof(dis_init));
ble_srv_ascii_to_utf8(&dis_init.manufact_name_str,
(char *)MANUFACTURER_NAME);
ble_srv_ascii_to_utf8(&dis_init.serial_num_str, MODEL_NUMBER);
ble_dis_sys_id_t system_id;
system_id.manufacturer_id = MANUFACTURER_ID;
system_id.organizationally_unique_id = ORG_UNIQUE_ID;
dis_init.p_sys_id = &system_id;
dis_init.dis_char_rd_sec = SEC_OPEN;
err_code = ble_dis_init(&dis_init);
APP_ERROR_CHECK(err_code);
memset(&soter_service_init, 0, sizeof(soter_service_init));
soter_service_init.data_handler = soter_service_data_handler;
err_code = ble_soter_service_init(&m_soter, &soter_service_init);
APP_ERROR_CHECK(err_code);
}
/**@brief Function for handling the Connection Parameters Module.
*
* @details This function will be called for all events in the Connection
* Parameters Module which are passed to the application.
* @note All this function does is to disconnect. This could have been
* done by simply setting the disconnect_on_fail config parameter, but instead
* we use the event handler mechanism to demonstrate its use.
*
* @param[in] p_evt Event received from the Connection Parameters Module.
*/
static void on_conn_params_evt(ble_conn_params_evt_t *p_evt) {
ret_code_t err_code;
if (p_evt->evt_type == BLE_CONN_PARAMS_EVT_FAILED) {
err_code = sd_ble_gap_disconnect(m_conn_handle,
BLE_HCI_CONN_INTERVAL_UNACCEPTABLE);
APP_ERROR_CHECK(err_code);
}
}
/**@brief Function for handling a Connection Parameters error.
*
* @param[in] nrf_error Error code containing information about what went
* wrong.
*/
static void conn_params_error_handler(uint32_t nrf_error) {
APP_ERROR_HANDLER(nrf_error);
}
/**@brief Function for initializing the Connection Parameters module.
*/
static void conn_params_init(void) {
ret_code_t err_code;
ble_conn_params_init_t cp_init;
memset(&cp_init, 0, sizeof(cp_init));
cp_init.p_conn_params = NULL;
cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
cp_init.next_conn_params_update_delay = NEXT_CONN_PARAMS_UPDATE_DELAY;
cp_init.max_conn_params_update_count = MAX_CONN_PARAM_UPDATE_COUNT;
cp_init.start_on_notify_cccd_handle = BLE_GATT_HANDLE_INVALID;
cp_init.disconnect_on_fail = false;
cp_init.evt_handler = on_conn_params_evt;
cp_init.error_handler = conn_params_error_handler;
err_code = ble_conn_params_init(&cp_init);
APP_ERROR_CHECK(err_code);
}
/**@brief Function for handling advertising events.
*
* @details This function will be called for advertising events which are passed
* to the application.
*
* @param[in] ble_adv_evt Advertising event.
*/
static void on_adv_evt(ble_adv_evt_t ble_adv_evt) {
switch (ble_adv_evt) {
case BLE_ADV_EVT_FAST:
NRF_LOG_INFO("Fast advertising.");
break;
case BLE_ADV_EVT_IDLE:
NRF_LOG_INFO("Advertising timeout, restarting.")
advertising_start(NULL);
break;
default:
break;
}
}
/**@brief Function for handling BLE events.
*
* @param[in] p_ble_evt Bluetooth stack event.
* @param[in] p_context Unused.
*/
static void ble_evt_handler(ble_evt_t const *p_ble_evt, void *p_context) {
ret_code_t err_code = NRF_SUCCESS;
pm_handler_secure_on_connection(p_ble_evt);
switch (p_ble_evt->header.evt_id) {
case BLE_GAP_EVT_CONNECTED:
NRF_LOG_INFO("Connected");
m_peer_to_be_deleted = PM_PEER_ID_INVALID;
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle);
APP_ERROR_CHECK(err_code);
break;
case BLE_GAP_EVT_DISCONNECTED:
NRF_LOG_INFO("Disconnected");
m_conn_handle = BLE_CONN_HANDLE_INVALID;
// Check if the last connected peer had not used MITM, if so, delete
// its bond information.
if (m_peer_to_be_deleted != PM_PEER_ID_INVALID) {
err_code = pm_peer_delete(m_peer_to_be_deleted);
APP_ERROR_CHECK(err_code);
NRF_LOG_DEBUG("Collector's bond deleted");
m_peer_to_be_deleted = PM_PEER_ID_INVALID;
}
break;
case BLE_GAP_EVT_PHY_UPDATE_REQUEST: {
NRF_LOG_DEBUG("PHY update request.");
ble_gap_phys_t const phys = {
.rx_phys = BLE_GAP_PHY_AUTO,
.tx_phys = BLE_GAP_PHY_AUTO,
};
err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle,
&phys);
APP_ERROR_CHECK(err_code);
} break;
case BLE_GATTC_EVT_TIMEOUT:
// Disconnect on GATT Client timeout event.
NRF_LOG_DEBUG("GATT Client Timeout.");
err_code = sd_ble_gap_disconnect(
p_ble_evt->evt.gattc_evt.conn_handle,
BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
APP_ERROR_CHECK(err_code);
break;
case BLE_EVT_USER_MEM_REQUEST:
NRF_LOG_DEBUG("BLE_EVT_USER_MEM_REQUEST");
err_code = sd_ble_user_mem_reply(
p_ble_evt->evt.gattc_evt.conn_handle, NULL);
APP_ERROR_CHECK(err_code);
break;
case BLE_GATTS_EVT_TIMEOUT:
// Disconnect on GATT Server timeout event.
NRF_LOG_DEBUG("GATT Server Timeout.");
err_code = sd_ble_gap_disconnect(
p_ble_evt->evt.gatts_evt.conn_handle,
BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
APP_ERROR_CHECK(err_code);
break;
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
NRF_LOG_DEBUG("BLE_GAP_EVT_SEC_PARAMS_REQUEST");
break;
case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: {
ble_gap_data_length_params_t dl_params;
// Clearing the struct will effectively set members to @ref
// BLE_GAP_DATA_LENGTH_AUTO.
memset(&dl_params, 0, sizeof(ble_gap_data_length_params_t));
err_code = sd_ble_gap_data_length_update(
p_ble_evt->evt.gap_evt.conn_handle, &dl_params, NULL);
APP_ERROR_CHECK(err_code);
} break;
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
NRF_LOG_DEBUG("BLE_GATTS_EVT_SYS_ATTR_MISSING");
// No system attributes have been stored.
err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
APP_ERROR_CHECK(err_code);
break;
case BLE_GAP_EVT_PASSKEY_DISPLAY: {
NRF_LOG_DEBUG("BLE_GAP_EVT_PASSKEY_DISPLAY");
char passkey[PASSKEY_LENGTH + 1];
memcpy(passkey,
p_ble_evt->evt.gap_evt.params.passkey_display.passkey,
PASSKEY_LENGTH);
passkey[PASSKEY_LENGTH] = 0;
if (soter_ble_pairing_pin_handler) {
soter_ble_pairing_pin_handler(passkey);
}
NRF_LOG_INFO("Passkey: %s", nrf_log_push(passkey));
} break;
case BLE_GAP_EVT_AUTH_KEY_REQUEST:
NRF_LOG_INFO("BLE_GAP_EVT_AUTH_KEY_REQUEST");
break;
case BLE_GAP_EVT_LESC_DHKEY_REQUEST:
NRF_LOG_INFO("BLE_GAP_EVT_LESC_DHKEY_REQUEST");
break;
case BLE_GAP_EVT_AUTH_STATUS:
NRF_LOG_INFO(
"BLE_GAP_EVT_AUTH_STATUS: status=0x%x bond=0x%x lv4: %d "
"kdist_own:0x%x kdist_peer:0x%x",
p_ble_evt->evt.gap_evt.params.auth_status.auth_status,
p_ble_evt->evt.gap_evt.params.auth_status.bonded,
p_ble_evt->evt.gap_evt.params.auth_status.sm1_levels.lv4,
*((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status
.kdist_own),
*((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status
.kdist_peer));
break;
default:
// No implementation needed.
break;
}
}
/**@brief Function for initializing the BLE stack.
*
* @details Initializes the SoftDevice and the BLE event interrupt.
*/
static void ble_stack_init(void) {
ret_code_t err_code;
err_code = nrf_sdh_enable_request();
APP_ERROR_CHECK(err_code);
// Configure the BLE stack using the default settings.
// Fetch the start address of the application RAM.
uint32_t ram_start = 0;
err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
APP_ERROR_CHECK(err_code);
// Enable BLE stack.
err_code = nrf_sdh_ble_enable(&ram_start);
APP_ERROR_CHECK(err_code);
// Register a handler for BLE events.
NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler,
NULL);
}
/**@brief Function for the Peer Manager initialization.
*/
static void peer_manager_init(void) {
ble_gap_sec_params_t sec_param;
ret_code_t err_code;
err_code = pm_init();
APP_ERROR_CHECK(err_code);
memset(&sec_param, 0, sizeof(ble_gap_sec_params_t));
// Security parameters to be used for all security procedures.
sec_param.bond = SEC_PARAM_BOND;
sec_param.mitm = SEC_PARAM_MITM;
sec_param.lesc = SEC_PARAM_LESC;
sec_param.keypress = SEC_PARAM_KEYPRESS;
sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES;
sec_param.oob = SEC_PARAM_OOB;
sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;
err_code = pm_sec_params_set(&sec_param);
APP_ERROR_CHECK(err_code);
err_code = pm_register(pm_evt_handler);
APP_ERROR_CHECK(err_code);
}
/**@brief Clear bond information from persistent storage.
*/
static void delete_bonds(void) {
ret_code_t err_code;
NRF_LOG_INFO("Erase bonds!");
err_code = pm_peers_delete();
APP_ERROR_CHECK(err_code);
}
/**@brief Function for initializing the Advertising functionality.
*/
static void advertising_init(void) {
ret_code_t err_code;
ble_advertising_init_t init;
memset(&init, 0, sizeof(init));
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = true;
init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
init.advdata.uuids_complete.uuid_cnt =
sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
init.advdata.uuids_complete.p_uuids = m_adv_uuids;
init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
init.config.ble_adv_fast_timeout = APP_ADV_DURATION;
init.evt_handler = on_adv_evt;
err_code = ble_advertising_init(&m_advertising, &init);
APP_ERROR_CHECK(err_code);
ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}
/**@brief Function for starting advertising.
*/
static void advertising_start(void *p_erase_bonds) {
bool erase_bonds = *(bool *)p_erase_bonds;
if (erase_bonds == true) {
delete_bonds();
// Advertising is started by PM_EVT_PEERS_DELETED_SUCEEDED event
} else {
ret_code_t err_code =
ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
}
}
static void soter_service_data_handler(ble_soter_service_evt_t *p_evt) {
switch (p_evt->type) {
case BLE_SOTER_EVT_RX_DATA: {
if (rx_message) {
rx_message->link_type = LINK_TYPE_BLE;
rx_message->len = p_evt->params.rx_data.length;
memcpy(rx_message->message, p_evt->params.rx_data.p_data,
rx_message->len);
xSemaphoreGive(*rx_semaphore);
}
} break;
case BLE_SOTER_EVT_TX_RDY:
m_pending_tx = false;
NRF_LOG_DEBUG("BLE_SOTER_EVT_TX_RDY");
break;
case BLE_SOTER_EVT_COMM_STARTED:
NRF_LOG_DEBUG("BLE_SOTER_EVT_COMM_STARTED");
break;
case BLE_SOTER_EVT_COMM_STOPPED:
NRF_LOG_DEBUG("BLE_SOTER_EVT_COMM_STOPPED");
break;
}
}
/**@brief Function for handling events from the GATT library. */
void gatt_evt_handler(nrf_ble_gatt_t *p_gatt, nrf_ble_gatt_evt_t const *p_evt) {
if ((m_conn_handle == p_evt->conn_handle) &&
(p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED)) {
uint16_t max_data_len =
p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
if (max_data_len <= BLE_SEGMENT_SIZE) {
soter_service_max_data_len = max_data_len;
}
NRF_LOG_INFO("Data len is set to 0x%X(%d)", soter_service_max_data_len,
soter_service_max_data_len);
}
NRF_LOG_DEBUG("ATT MTU exchange completed. central 0x%x peripheral 0x%x",
p_gatt->att_mtu_desired_central,
p_gatt->att_mtu_desired_periph);
}
static void soter_ble_task(void *arg) {
ret_code_t err_code;
NRF_LOG_DEBUG("Starting lesc task...");
while (1) {
err_code = nrf_ble_lesc_request_handler();
APP_ERROR_CHECK(err_code);
vTaskDelay(100);
}
}
void soter_ble_update_battery_level(uint8_t battery_level) {
ret_code_t err_code;
err_code = ble_bas_battery_level_update(&m_bas, battery_level,
BLE_CONN_HANDLE_ALL);
if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_INVALID_STATE) &&
(err_code != NRF_ERROR_RESOURCES) && (err_code != NRF_ERROR_BUSY) &&
(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)) {
APP_ERROR_HANDLER(err_code);
}
}
void soter_ble_remove_peer(uint16_t peer_id) {
ret_code_t err_code;
err_code = pm_peer_delete(peer_id);
APP_ERROR_CHECK(err_code);
}
void soter_ble_init(char *device_name) {
// Configure and initialize the BLE stack.
m_device_name = device_name;
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();
peer_manager_init();
if (pdPASS != xTaskCreate(soter_ble_task, "SWBLE", SOTER_BLE_STACK_SIZE,
NULL, SOTER_BLE_PRIORITY,
&soter_ble_task_handle)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
ret_code_t err_code = sd_ble_gap_tx_power_set(
BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, -20);
APP_ERROR_CHECK(err_code);
nrf_sdh_freertos_init(advertising_start, &erase_bonds);
}
bool soter_ble_connected(void) {
return (m_conn_handle != BLE_CONN_HANDLE_INVALID) ? 1 : 0;
}
| 36.753173 | 80 | 0.659452 | [
"model"
] |
36b1a9dca8ee41bc5e96d2ce4c52d137c06cd45d | 92,246 | c | C | dlls/propsys/tests/propsys.c | Demon000/wine | ab3e0776a95c3574a950983ff613bf5ef9456a5e | [
"MIT"
] | null | null | null | dlls/propsys/tests/propsys.c | Demon000/wine | ab3e0776a95c3574a950983ff613bf5ef9456a5e | [
"MIT"
] | null | null | null | dlls/propsys/tests/propsys.c | Demon000/wine | ab3e0776a95c3574a950983ff613bf5ef9456a5e | [
"MIT"
] | null | null | null | /*
* Unit tests for Windows property system
*
* Copyright 2006 Paul Vriens
* Copyright 2010 Andrew Nguyen
* Copyright 2012 Vincent Povirk
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <stdarg.h>
#include <stdio.h>
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "objbase.h"
#include "propsys.h"
#include "propvarutil.h"
#include "strsafe.h"
#include "wine/test.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID(dummy_guid, 0xdeadbeef, 0xdead, 0xbeef, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe);
DEFINE_GUID(expect_guid, 0x12345678, 0x1234, 0x1234, 0x12, 0x34, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12);
DEFINE_GUID(PKEY_WineTest, 0x7b317433, 0xdfa3, 0x4c44, 0xad, 0x3e, 0x2f, 0x80, 0x4b, 0x90, 0xdb, 0xf4);
DEFINE_GUID(DUMMY_GUID1, 0x12345678, 0x1234,0x1234, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19);
#define GUID_MEMBERS(g) {(g).Data1, (g).Data2, (g).Data3, {(g).Data4[0], (g).Data4[1], (g).Data4[2], (g).Data4[3], (g).Data4[4], (g).Data4[5], (g).Data4[6], (g).Data4[7]}}
static const char topic[] = "wine topic";
static const WCHAR topicW[] = {'w','i','n','e',' ','t','o','p','i','c',0};
static const WCHAR emptyW[] = {0};
#define EXPECT_REF(obj,ref) _expect_ref((IUnknown *)obj, ref, __LINE__)
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
{
ULONG rc;
IUnknown_AddRef(obj);
rc = IUnknown_Release(obj);
ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
}
static void test_PSStringFromPropertyKey(void)
{
static const WCHAR fillerW[] = {'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
'X','X','X','X','X','X','X','X','X','X'};
static const WCHAR zero_fillerW[] = {'\0','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
'X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
'X','X','X','X','X','X','X','X','X','X','X','X','X','X'};
static const WCHAR zero_truncatedW[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0',
'0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0',
'0','0','0','}',' ','\0','9','X','X','X','X','X','X','X','X','X'};
static const WCHAR zero_truncated2W[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0',
'0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0',
'0','0','0','}',' ','\0','9','2','7','6','9','4','9','2','X','X'};
static const WCHAR zero_truncated3W[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0',
'0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0',
'0','0','0','}',' ','\0','9','2','7','6','9','4','9','2','4','X'};
static const WCHAR zero_truncated4W[] = {'\0','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0',
'0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0',
'0','0','0','}',' ','\0','7','X','X','X','X','X','X','X','X','X'};
static const WCHAR truncatedW[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0',
'0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0',
'0','}',' ','\0','9','X','X','X','X','X','X','X','X','X'};
static const WCHAR truncated2W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0',
'0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0',
'0','}',' ','\0','9','2','7','6','9','4','9','2','X','X'};
static const WCHAR truncated3W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0',
'0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0',
'0','}',' ','\0','9','2','7','6','9','4','9','2','4','X'};
static const WCHAR truncated4W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0',
'0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0',
'0','}',' ','\0','7','X','X','X','X','X','X','X','X','X'};
static const WCHAR expectedW[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0',
'0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0',
'0','}',' ','4','2','9','4','9','6','7','2','9','5',0};
static const WCHAR expected2W[] = {'{','0','0','0','0','0','0','0','0','-','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','3','5','7','9','\0','X','X','X','X','X'};
static const WCHAR expected3W[] = {'{','0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0',
'0','-','0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0',
'0','}',' ','0','\0','X','X','X','X','X','X','X','X','X'};
PROPERTYKEY prop = {GUID_MEMBERS(GUID_NULL), ~0U};
PROPERTYKEY prop2 = {GUID_MEMBERS(GUID_NULL), 13579};
PROPERTYKEY prop3 = {GUID_MEMBERS(GUID_NULL), 0};
WCHAR out[PKEYSTR_MAX];
HRESULT ret;
const struct
{
REFPROPERTYKEY pkey;
LPWSTR psz;
UINT cch;
HRESULT hr_expect;
const WCHAR *buf_expect;
BOOL hr_broken;
HRESULT hr2;
BOOL buf_broken;
const WCHAR *buf2;
} testcases[] =
{
{NULL, NULL, 0, E_POINTER},
{&prop, NULL, 0, E_POINTER},
{&prop, NULL, PKEYSTR_MAX, E_POINTER},
{NULL, out, 0, E_NOT_SUFFICIENT_BUFFER, fillerW},
{NULL, out, PKEYSTR_MAX, E_NOT_SUFFICIENT_BUFFER, zero_fillerW, FALSE, 0, TRUE, fillerW},
{&prop, out, 0, E_NOT_SUFFICIENT_BUFFER, fillerW},
{&prop, out, GUIDSTRING_MAX, E_NOT_SUFFICIENT_BUFFER, fillerW},
{&prop, out, GUIDSTRING_MAX + 1, E_NOT_SUFFICIENT_BUFFER, fillerW},
{&prop, out, GUIDSTRING_MAX + 2, E_NOT_SUFFICIENT_BUFFER, zero_truncatedW, TRUE, S_OK, TRUE, truncatedW},
{&prop, out, PKEYSTR_MAX - 2, E_NOT_SUFFICIENT_BUFFER, zero_truncated2W, TRUE, S_OK, TRUE, truncated2W},
{&prop, out, PKEYSTR_MAX - 1, E_NOT_SUFFICIENT_BUFFER, zero_truncated3W, TRUE, S_OK, TRUE, truncated3W},
{&prop, out, PKEYSTR_MAX, S_OK, expectedW},
{&prop2, out, GUIDSTRING_MAX + 2, E_NOT_SUFFICIENT_BUFFER, zero_truncated4W, TRUE, S_OK, TRUE, truncated4W},
{&prop2, out, GUIDSTRING_MAX + 6, S_OK, expected2W},
{&prop2, out, PKEYSTR_MAX, S_OK, expected2W},
{&prop3, out, GUIDSTRING_MAX + 1, E_NOT_SUFFICIENT_BUFFER, fillerW},
{&prop3, out, GUIDSTRING_MAX + 2, S_OK, expected3W},
{&prop3, out, PKEYSTR_MAX, S_OK, expected3W},
};
int i;
for (i = 0; i < ARRAY_SIZE(testcases); i++)
{
if (testcases[i].psz)
memcpy(testcases[i].psz, fillerW, PKEYSTR_MAX * sizeof(WCHAR));
ret = PSStringFromPropertyKey(testcases[i].pkey,
testcases[i].psz,
testcases[i].cch);
ok(ret == testcases[i].hr_expect ||
broken(testcases[i].hr_broken && ret == testcases[i].hr2), /* Vista/Win2k8 */
"[%d] Expected PSStringFromPropertyKey to return 0x%08lx, got 0x%08lx\n",
i, testcases[i].hr_expect, ret);
if (testcases[i].psz)
ok(!memcmp(testcases[i].psz, testcases[i].buf_expect, PKEYSTR_MAX * sizeof(WCHAR)) ||
broken(testcases[i].buf_broken &&
!memcmp(testcases[i].psz, testcases[i].buf2, PKEYSTR_MAX * sizeof(WCHAR))), /* Vista/Win2k8 */
"[%d] Unexpected output contents\n", i);
}
}
static void test_PSPropertyKeyFromString(void)
{
static const WCHAR fmtid_clsidW[] = {'S','t','d','F','o','n','t',' ','1',0};
static const WCHAR fmtid_truncatedW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-',0};
static const WCHAR fmtid_nobracketsW[] = {'1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2',0};
static const WCHAR fmtid_badbracketW[] = {'X','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badcharW[] = {'{','X','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar2W[] = {'{','1','2','3','4','5','6','7','X','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_baddashW[] = {'{','1','2','3','4','5','6','7','8','X','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar3W[] = {'{','1','2','3','4','5','6','7','8','-','X','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar4W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','X','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_baddash2W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','X',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar5W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'X','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar6W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','X','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_baddash3W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','X','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar7W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','X','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar8W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','X','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_baddash4W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','X',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar9W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'X','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar9_adjW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','X','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar10W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','X','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar11W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','X','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar12W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','X','8','9','0','1','2','}',0};
static const WCHAR fmtid_badchar13W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','X','0','1','2','}',0};
static const WCHAR fmtid_badchar14W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','X','2','}',0};
static const WCHAR fmtid_badbracket2W[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','X',0};
static const WCHAR fmtid_spaceW[] = {' ','{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_spaceendW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',0};
static const WCHAR fmtid_spacesendW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',' ',' ',0};
static const WCHAR fmtid_nopidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',0};
static const WCHAR fmtid_badpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','D','E','A','D',0};
static const WCHAR fmtid_adjpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}','1','3','5','7','9',0};
static const WCHAR fmtid_spacespidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',' ',' ','1','3','5','7','9',0};
static const WCHAR fmtid_negpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-','1','3','5','7','9',0};
static const WCHAR fmtid_negnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-','-','1','3','5','7','9',0};
static const WCHAR fmtid_negnegnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-','-','-','1','3','5','7','9',0};
static const WCHAR fmtid_negspacepidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-',' ','1','3','5','7','9',0};
static const WCHAR fmtid_negspacenegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-',' ','-','1','3','5','7','9',0};
static const WCHAR fmtid_negspacespidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','-',' ','-',' ','-','1','3','5','7','9',0};
static const WCHAR fmtid_pospidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','+','1','3','5','7','9',0};
static const WCHAR fmtid_posnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','+','-','+','-','1','3','5','7','9',0};
static const WCHAR fmtid_symbolpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','+','/','$','-','1','3','5','7','9',0};
static const WCHAR fmtid_letterpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','A','B','C','D','1','3','5','7','9',0};
static const WCHAR fmtid_spacepadpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','3','5','7','9',' ',' ',' ',0};
static const WCHAR fmtid_spacemixpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1',' ','3',' ','5','7','9',' ',' ',' ',0};
static const WCHAR fmtid_tabpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}','\t','1','3','5','7','9',0};
static const WCHAR fmtid_hexpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','0','x','D','E','A','D',0};
static const WCHAR fmtid_mixedpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','A','9','B','5','C','3','D','1',0};
static const WCHAR fmtid_overflowpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','2','3','4','5','6','7','8','9','0','1',0};
static const WCHAR fmtid_commapidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',',','1','3','5','7','9',0};
static const WCHAR fmtid_commaspidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',',',',',',','1','3','5','7','9',0};
static const WCHAR fmtid_commaspacepidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',',',' ','1','3','5','7','9',0};
static const WCHAR fmtid_spacecommapidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',','1','3','5','7','9',0};
static const WCHAR fmtid_spccommaspcpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',',' ','1','3','5','7','9',0};
static const WCHAR fmtid_spacescommaspidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',',' ',',','1','3','5','7','9',0};
static const WCHAR fmtid_commanegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',',','-','1','3','5','7','9',0};
static const WCHAR fmtid_spccommanegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',','-','1','3','5','7','9',0};
static const WCHAR fmtid_commaspcnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',',',' ','-','1','3','5','7','9',0};
static const WCHAR fmtid_spccommaspcnegpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ',',',' ','-','1','3','5','7','9',0};
static const WCHAR fmtid_commanegspcpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',',','-',' ','1','3','5','7','9',0};
static const WCHAR fmtid_negcommapidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}','-',',','1','3','5','7','9',0};
static const WCHAR fmtid_normalpidW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','3','5','7','9',0};
static const WCHAR fmtid_udigitW[] = {'{','1','2','3','4','5','6','7','8','-','1','2','3','4','-',
'1','2','3','4','-','1','2','3','4','-',
'1','2','3','4','5','6','7','8','9','0','1','2','}',' ','1','2','3',0x661,'5','7','9',0};
PROPERTYKEY out_init = {GUID_MEMBERS(dummy_guid), 0xdeadbeef};
PROPERTYKEY out;
HRESULT ret;
const struct
{
LPCWSTR pwzString;
PROPERTYKEY *pkey;
HRESULT hr_expect;
PROPERTYKEY pkey_expect;
} testcases[] =
{
{NULL, NULL, E_POINTER},
{NULL, &out, E_POINTER, {GUID_MEMBERS(out_init.fmtid), out_init.pid}},
{emptyW, NULL, E_POINTER},
{emptyW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}},
{fmtid_clsidW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}},
{fmtid_truncatedW, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_nobracketsW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}},
{fmtid_badbracketW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}},
{fmtid_badcharW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}},
{fmtid_badchar2W, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0}},
{fmtid_baddashW, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar3W, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar4W, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_baddash2W, &out, E_INVALIDARG, { {0x12345678,0,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar5W, &out, E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar6W, &out, E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_baddash3W, &out, E_INVALIDARG, { {0x12345678,0x1234,0,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar7W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar8W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}},
{fmtid_baddash4W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0,0,0,0,0,0,0}}, 0}},
{fmtid_badchar9W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}},
{fmtid_badchar9_adjW, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0,0,0,0,0,0}}, 0}},
{fmtid_badchar10W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0,0,0,0,0}}, 0}},
{fmtid_badchar11W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0,0,0,0}}, 0}},
{fmtid_badchar12W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0,0,0}}, 0}},
{fmtid_badchar13W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0,0}}, 0}},
{fmtid_badchar14W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0}}, 0}},
{fmtid_badbracket2W, &out, E_INVALIDARG, { {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x90,0x00}}, 0 }},
{fmtid_spaceW, &out, E_INVALIDARG, {GUID_MEMBERS(GUID_NULL), 0 }},
{fmtid_spaceendW, &out, E_INVALIDARG, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_spacesendW, &out, E_INVALIDARG, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_nopidW, &out, E_INVALIDARG, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_badpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_adjpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_spacespidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_negpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_negnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}},
{fmtid_negnegnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_negspacepidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_negspacenegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}},
{fmtid_negspacespidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_pospidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_posnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_symbolpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_letterpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_spacepadpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_spacemixpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 1}},
{fmtid_tabpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_hexpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_mixedpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_overflowpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 3755744309U}},
{fmtid_commapidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_commaspidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_commaspacepidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_spacecommapidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_spccommaspcpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_spacescommaspidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_commanegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}},
{fmtid_spccommanegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}},
{fmtid_commaspcnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}},
{fmtid_spccommaspcnegpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 4294953717U}},
{fmtid_commanegspcpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0U}},
{fmtid_negcommapidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 0}},
{fmtid_normalpidW, &out, S_OK, {GUID_MEMBERS(expect_guid), 13579}},
{fmtid_udigitW, &out, S_OK, {GUID_MEMBERS(expect_guid), 123}},
};
int i;
for (i = 0; i < ARRAY_SIZE(testcases); i++)
{
if (testcases[i].pkey)
*testcases[i].pkey = out_init;
ret = PSPropertyKeyFromString(testcases[i].pwzString, testcases[i].pkey);
ok(ret == testcases[i].hr_expect,
"[%d] Expected PSPropertyKeyFromString to return 0x%08lx, got 0x%08lx\n",
i, testcases[i].hr_expect, ret);
if (testcases[i].pkey)
{
ok(IsEqualGUID(&testcases[i].pkey->fmtid, &testcases[i].pkey_expect.fmtid),
"[%d] Expected GUID %s, got %s\n",
i, wine_dbgstr_guid(&testcases[i].pkey_expect.fmtid), wine_dbgstr_guid(&testcases[i].pkey->fmtid));
ok(testcases[i].pkey->pid == testcases[i].pkey_expect.pid,
"[%d] Expected property ID %lu, got %lu\n",
i, testcases[i].pkey_expect.pid, testcases[i].pkey->pid);
}
}
}
static void test_PSRefreshPropertySchema(void)
{
HRESULT ret;
ret = PSRefreshPropertySchema();
todo_wine
ok(ret == CO_E_NOTINITIALIZED,
"Expected PSRefreshPropertySchema to return CO_E_NOTINITIALIZED, got 0x%08lx\n", ret);
CoInitialize(NULL);
ret = PSRefreshPropertySchema();
ok(ret == S_OK,
"Expected PSRefreshPropertySchema to return S_OK, got 0x%08lx\n", ret);
CoUninitialize();
}
static void test_InitPropVariantFromGUIDAsString(void)
{
PROPVARIANT propvar;
VARIANT var;
HRESULT hres;
int i;
const struct {
REFGUID guid;
const WCHAR *str;
} testcases[] = {
{&IID_NULL, L"{00000000-0000-0000-0000-000000000000}" },
{&dummy_guid, L"{DEADBEEF-DEAD-BEEF-DEAD-BEEFCAFEBABE}" },
};
hres = InitPropVariantFromGUIDAsString(NULL, &propvar);
ok(hres == E_FAIL, "InitPropVariantFromGUIDAsString returned %lx\n", hres);
if(0) {
/* Returns strange data on Win7, crashes on older systems */
InitVariantFromGUIDAsString(NULL, &var);
/* Crashes on windows */
InitPropVariantFromGUIDAsString(&IID_NULL, NULL);
InitVariantFromGUIDAsString(&IID_NULL, NULL);
}
for(i=0; i < ARRAY_SIZE(testcases); i++) {
memset(&propvar, 0, sizeof(PROPVARIANT));
hres = InitPropVariantFromGUIDAsString(testcases[i].guid, &propvar);
ok(hres == S_OK, "%d) InitPropVariantFromGUIDAsString returned %lx\n", i, hres);
ok(propvar.vt == VT_LPWSTR, "%d) propvar.vt = %d\n", i, propvar.vt);
ok(!lstrcmpW(propvar.pwszVal, testcases[i].str), "%d) propvar.pwszVal = %s\n",
i, wine_dbgstr_w(propvar.pwszVal));
CoTaskMemFree(propvar.pwszVal);
memset(&var, 0, sizeof(VARIANT));
hres = InitVariantFromGUIDAsString(testcases[i].guid, &var);
ok(hres == S_OK, "%d) InitVariantFromGUIDAsString returned %lx\n", i, hres);
ok(V_VT(&var) == VT_BSTR, "%d) V_VT(&var) = %d\n", i, V_VT(&var));
ok(SysStringLen(V_BSTR(&var)) == 38, "SysStringLen returned %d\n",
SysStringLen(V_BSTR(&var)));
ok(!lstrcmpW(V_BSTR(&var), testcases[i].str), "%d) V_BSTR(&var) = %s\n",
i, wine_dbgstr_w(V_BSTR(&var)));
VariantClear(&var);
}
}
static void test_InitPropVariantFromBuffer(void)
{
static const char data_in[] = "test";
PROPVARIANT propvar;
VARIANT var;
HRESULT hres;
void *data_out;
LONG size;
hres = InitPropVariantFromBuffer(NULL, 0, &propvar);
ok(hres == S_OK, "InitPropVariantFromBuffer returned %lx\n", hres);
ok(propvar.vt == (VT_VECTOR|VT_UI1), "propvar.vt = %d\n", propvar.vt);
ok(propvar.caub.cElems == 0, "cElems = %d\n", propvar.caub.cElems == 0);
PropVariantClear(&propvar);
hres = InitPropVariantFromBuffer(data_in, 4, &propvar);
ok(hres == S_OK, "InitPropVariantFromBuffer returned %lx\n", hres);
ok(propvar.vt == (VT_VECTOR|VT_UI1), "propvar.vt = %d\n", propvar.vt);
ok(propvar.caub.cElems == 4, "cElems = %d\n", propvar.caub.cElems == 0);
ok(!memcmp(propvar.caub.pElems, data_in, 4), "Data inside array is incorrect\n");
PropVariantClear(&propvar);
hres = InitVariantFromBuffer(NULL, 0, &var);
ok(hres == S_OK, "InitVariantFromBuffer returned %lx\n", hres);
ok(V_VT(&var) == (VT_ARRAY|VT_UI1), "V_VT(&var) = %d\n", V_VT(&var));
size = SafeArrayGetDim(V_ARRAY(&var));
ok(size == 1, "SafeArrayGetDim returned %ld\n", size);
hres = SafeArrayGetLBound(V_ARRAY(&var), 1, &size);
ok(hres == S_OK, "SafeArrayGetLBound returned %lx\n", hres);
ok(size == 0, "LBound = %ld\n", size);
hres = SafeArrayGetUBound(V_ARRAY(&var), 1, &size);
ok(hres == S_OK, "SafeArrayGetUBound returned %lx\n", hres);
ok(size == -1, "UBound = %ld\n", size);
VariantClear(&var);
hres = InitVariantFromBuffer(data_in, 4, &var);
ok(hres == S_OK, "InitVariantFromBuffer returned %lx\n", hres);
ok(V_VT(&var) == (VT_ARRAY|VT_UI1), "V_VT(&var) = %d\n", V_VT(&var));
size = SafeArrayGetDim(V_ARRAY(&var));
ok(size == 1, "SafeArrayGetDim returned %ld\n", size);
hres = SafeArrayGetLBound(V_ARRAY(&var), 1, &size);
ok(hres == S_OK, "SafeArrayGetLBound returned %lx\n", hres);
ok(size == 0, "LBound = %ld\n", size);
hres = SafeArrayGetUBound(V_ARRAY(&var), 1, &size);
ok(hres == S_OK, "SafeArrayGetUBound returned %lx\n", hres);
ok(size == 3, "UBound = %ld\n", size);
hres = SafeArrayAccessData(V_ARRAY(&var), &data_out);
ok(hres == S_OK, "SafeArrayAccessData failed %lx\n", hres);
ok(!memcmp(data_in, data_out, 4), "Data inside safe array is incorrect\n");
hres = SafeArrayUnaccessData(V_ARRAY(&var));
ok(hres == S_OK, "SafeArrayUnaccessData failed %lx\n", hres);
VariantClear(&var);
}
static void test_PropVariantToGUID(void)
{
PROPVARIANT propvar;
VARIANT var;
GUID guid;
HRESULT hres;
hres = InitPropVariantFromGUIDAsString(&IID_NULL, &propvar);
ok(hres == S_OK, "InitPropVariantFromGUIDAsString failed %lx\n", hres);
hres = PropVariantToGUID(&propvar, &guid);
ok(hres == S_OK, "PropVariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&IID_NULL, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
PropVariantClear(&propvar);
hres = InitPropVariantFromGUIDAsString(&dummy_guid, &propvar);
ok(hres == S_OK, "InitPropVariantFromGUIDAsString failed %lx\n", hres);
hres = PropVariantToGUID(&propvar, &guid);
ok(hres == S_OK, "PropVariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
ok(propvar.vt == VT_LPWSTR, "incorrect PROPVARIANT type: %d\n", propvar.vt);
propvar.pwszVal[1] = 'd';
propvar.pwszVal[2] = 'E';
propvar.pwszVal[3] = 'a';
hres = PropVariantToGUID(&propvar, &guid);
ok(hres == S_OK, "PropVariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
propvar.pwszVal[1] = 'z';
hres = PropVariantToGUID(&propvar, &guid);
ok(hres == E_INVALIDARG, "PropVariantToGUID returned %lx\n", hres);
PropVariantClear(&propvar);
hres = InitVariantFromGUIDAsString(&IID_NULL, &var);
ok(hres == S_OK, "InitVariantFromGUIDAsString failed %lx\n", hres);
hres = VariantToGUID(&var, &guid);
ok(hres == S_OK, "VariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&IID_NULL, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
VariantClear(&var);
hres = InitVariantFromGUIDAsString(&dummy_guid, &var);
ok(hres == S_OK, "InitVariantFromGUIDAsString failed %lx\n", hres);
hres = VariantToGUID(&var, &guid);
ok(hres == S_OK, "VariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
ok(V_VT(&var) == VT_BSTR, "incorrect VARIANT type: %d\n", V_VT(&var));
V_BSTR(&var)[1] = 'z';
hres = VariantToGUID(&var, &guid);
ok(hres == E_FAIL, "VariantToGUID returned %lx\n", hres);
V_BSTR(&var)[1] = 'd';
propvar.vt = V_VT(&var);
propvar.bstrVal = V_BSTR(&var);
V_VT(&var) = VT_EMPTY;
hres = PropVariantToGUID(&propvar, &guid);
ok(hres == S_OK, "PropVariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
PropVariantClear(&propvar);
memset(&guid, 0, sizeof(guid));
InitPropVariantFromCLSID(&dummy_guid, &propvar);
hres = PropVariantToGUID(&propvar, &guid);
ok(hres == S_OK, "PropVariantToGUID failed %lx\n", hres);
ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid));
PropVariantClear(&propvar);
}
static void test_PropVariantToStringAlloc(void)
{
PROPVARIANT prop;
WCHAR *str;
HRESULT hres;
prop.vt = VT_NULL;
hres = PropVariantToStringAlloc(&prop, &str);
ok(hres == S_OK, "returned %lx\n", hres);
ok(!lstrcmpW(str, emptyW), "got %s\n", wine_dbgstr_w(str));
CoTaskMemFree(str);
prop.vt = VT_LPSTR;
prop.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(prop.pszVal, topic);
hres = PropVariantToStringAlloc(&prop, &str);
ok(hres == S_OK, "returned %lx\n", hres);
ok(!lstrcmpW(str, topicW), "got %s\n", wine_dbgstr_w(str));
CoTaskMemFree(str);
PropVariantClear(&prop);
prop.vt = VT_EMPTY;
hres = PropVariantToStringAlloc(&prop, &str);
ok(hres == S_OK, "returned %lx\n", hres);
ok(!lstrcmpW(str, emptyW), "got %s\n", wine_dbgstr_w(str));
CoTaskMemFree(str);
}
static void test_PropVariantCompareEx(void)
{
PROPVARIANT empty, null, emptyarray, i2_0, i2_2, i4_large, i4_largeneg, i4_2, str_2, str_02, str_b;
PROPVARIANT clsid_null, clsid, clsid2, r4_0, r4_2, r8_0, r8_2;
PROPVARIANT ui4, ui4_large;
PROPVARIANT var1, var2;
INT res;
static const WCHAR str_2W[] = {'2', 0};
static const WCHAR str_02W[] = {'0', '2', 0};
static const WCHAR str_bW[] = {'b', 0};
SAFEARRAY emptysafearray;
unsigned char bytevector1[] = {1,2,3};
unsigned char bytevector2[] = {4,5,6};
PropVariantInit(&empty);
PropVariantInit(&null);
PropVariantInit(&emptyarray);
PropVariantInit(&i2_0);
PropVariantInit(&i2_2);
PropVariantInit(&i4_large);
PropVariantInit(&i4_largeneg);
PropVariantInit(&i4_2);
PropVariantInit(&str_2);
PropVariantInit(&str_b);
empty.vt = VT_EMPTY;
null.vt = VT_NULL;
emptyarray.vt = VT_ARRAY | VT_I4;
emptyarray.parray = &emptysafearray;
emptysafearray.cDims = 1;
emptysafearray.fFeatures = FADF_FIXEDSIZE;
emptysafearray.cbElements = 4;
emptysafearray.cLocks = 0;
emptysafearray.pvData = NULL;
emptysafearray.rgsabound[0].cElements = 0;
emptysafearray.rgsabound[0].lLbound = 0;
i2_0.vt = VT_I2;
i2_0.iVal = 0;
i2_2.vt = VT_I2;
i2_2.iVal = 2;
i4_large.vt = VT_I4;
i4_large.lVal = 65536;
i4_largeneg.vt = VT_I4;
i4_largeneg.lVal = -65536;
i4_2.vt = VT_I4;
i4_2.lVal = 2;
ui4.vt = VT_UI4;
ui4.ulVal = 2;
ui4_large.vt = VT_UI4;
ui4_large.ulVal = 65536;
str_2.vt = VT_BSTR;
str_2.bstrVal = SysAllocString(str_2W);
str_02.vt = VT_BSTR;
str_02.bstrVal = SysAllocString(str_02W);
str_b.vt = VT_BSTR;
str_b.bstrVal = SysAllocString(str_bW);
clsid_null.vt = VT_CLSID;
clsid_null.puuid = NULL;
clsid.vt = VT_CLSID;
clsid.puuid = (GUID *)&dummy_guid;
clsid2.vt = VT_CLSID;
clsid2.puuid = (GUID *)&GUID_NULL;
r4_0.vt = VT_R4;
r4_0.fltVal = 0.0f;
r4_2.vt = VT_R4;
r4_2.fltVal = 2.0f;
r8_0.vt = VT_R8;
r8_0.dblVal = 0.0;
r8_2.vt = VT_R8;
r8_2.dblVal = 2.0;
res = PropVariantCompareEx(&empty, &empty, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&empty, &null, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&null, &emptyarray, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&null, &i2_0, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_0, &null, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&null, &i2_0, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_0, &null, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &i2_0, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_0, &i2_2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&ui4, &ui4_large, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&ui4_large, &ui4, 0, 0);
ok(res == 1, "res=%i\n", res);
/* Always return -1 if second value cannot be converted to first type */
res = PropVariantCompareEx(&i2_0, &i4_large, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_0, &i4_largeneg, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i4_large, &i2_0, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&i4_largeneg, &i2_0, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &i4_2, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &str_2, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &str_02, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&str_2, &i2_2, 0, 0);
todo_wine ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&str_02, &i2_2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&str_02, &str_2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&str_02, &str_b, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&str_2, &str_02, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&i4_large, &str_b, 0, 0);
todo_wine ok(res == -5 /* ??? */, "res=%i\n", res);
/* VT_CLSID */
res = PropVariantCompareEx(&clsid_null, &clsid_null, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&clsid_null, &clsid_null, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&clsid, &clsid, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&clsid, &clsid2, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&clsid2, &clsid, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&clsid_null, &clsid, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&clsid, &clsid_null, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&clsid_null, &clsid, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&clsid, &clsid_null, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == -1, "res=%i\n", res);
/* VT_R4/VT_R8 */
res = PropVariantCompareEx(&r4_0, &r8_0, 0, 0);
todo_wine
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&r4_0, &r4_0, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&r4_0, &r4_2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&r4_2, &r4_0, 0, 0);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&r8_0, &r8_0, 0, 0);
ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&r8_0, &r8_2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&r8_2, &r8_0, 0, 0);
ok(res == 1, "res=%i\n", res);
/* VT_VECTOR | VT_UI1 */
var1.vt = VT_VECTOR | VT_UI1;
var1.caub.cElems = 1;
var1.caub.pElems = bytevector1;
var2.vt = VT_VECTOR | VT_UI1;
var2.caub.cElems = 1;
var2.caub.pElems = bytevector2;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&var2, &var1, 0, 0);
ok(res == 1, "res=%i\n", res);
/* Vector length mismatch */
var1.caub.cElems = 2;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&var2, &var1, 0, 0);
ok(res == 1, "res=%i\n", res);
var1.caub.pElems = bytevector2;
var2.caub.pElems = bytevector1;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == 1, "res=%i\n", res);
var1.caub.pElems = bytevector1;
var2.caub.pElems = bytevector2;
var1.caub.cElems = 1;
var2.caub.cElems = 2;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&var2, &var1, 0, 0);
ok(res == 1, "res=%i\n", res);
/* Length mismatch over same data */
var1.caub.pElems = bytevector1;
var2.caub.pElems = bytevector1;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&var2, &var1, 0, 0);
ok(res == 1, "res=%i\n", res);
var1.caub.cElems = 1;
var2.caub.cElems = 1;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == 0, "res=%i\n", res);
var1.caub.cElems = 0;
res = PropVariantCompareEx(&var1, &var2, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == 1, "res=%i\n", res);
res = PropVariantCompareEx(&var2, &var1, 0, PVCF_TREATEMPTYASGREATERTHAN);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == -1, "res=%i\n", res);
res = PropVariantCompareEx(&var2, &var1, 0, 0);
ok(res == 1, "res=%i\n", res);
var2.caub.cElems = 0;
res = PropVariantCompareEx(&var1, &var2, 0, 0);
ok(res == 0, "res=%i\n", res);
SysFreeString(str_2.bstrVal);
SysFreeString(str_02.bstrVal);
SysFreeString(str_b.bstrVal);
}
static void test_intconversions(void)
{
PROPVARIANT propvar;
SHORT sval;
USHORT usval;
LONG lval;
ULONG ulval;
LONGLONG llval;
ULONGLONG ullval;
HRESULT hr;
propvar.vt = 0xdead;
hr = PropVariantClear(&propvar);
ok (FAILED(hr), "PropVariantClear fails on invalid vt.\n");
propvar.vt = VT_I8;
PropVariantClear(&propvar);
propvar.vt = VT_I8;
propvar.hVal.QuadPart = (ULONGLONG)1 << 63;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == (ULONGLONG)1 << 63, "got wrong value %s\n", wine_dbgstr_longlong(llval));
hr = PropVariantToUInt64(&propvar, &ullval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
hr = PropVariantToInt32(&propvar, &lval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
hr = PropVariantToUInt32(&propvar, &ulval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
hr = PropVariantToInt16(&propvar, &sval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
hr = PropVariantToUInt16(&propvar, &usval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
propvar.vt = VT_UI8;
propvar.uhVal.QuadPart = 5;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == 5, "got wrong value %s\n", wine_dbgstr_longlong(llval));
hr = PropVariantToUInt64(&propvar, &ullval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(ullval == 5, "got wrong value %s\n", wine_dbgstr_longlong(ullval));
hr = PropVariantToInt32(&propvar, &lval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(lval == 5, "got wrong value %ld\n", lval);
hr = PropVariantToUInt32(&propvar, &ulval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(ulval == 5, "got wrong value %ld\n", ulval);
hr = PropVariantToInt16(&propvar, &sval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(sval == 5, "got wrong value %d\n", sval);
hr = PropVariantToUInt16(&propvar, &usval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(usval == 5, "got wrong value %d\n", usval);
propvar.vt = VT_I8;
propvar.hVal.QuadPart = -5;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == -5, "got wrong value %s\n", wine_dbgstr_longlong(llval));
hr = PropVariantToUInt64(&propvar, &ullval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
hr = PropVariantToInt32(&propvar, &lval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(lval == -5, "got wrong value %ld\n", lval);
hr = PropVariantToUInt32(&propvar, &ulval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
hr = PropVariantToInt16(&propvar, &sval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(sval == -5, "got wrong value %d\n", sval);
hr = PropVariantToUInt16(&propvar, &usval);
ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%lx\n", hr);
propvar.vt = VT_UI4;
propvar.ulVal = 6;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == 6, "got wrong value %s\n", wine_dbgstr_longlong(llval));
propvar.vt = VT_I4;
propvar.lVal = -6;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == -6, "got wrong value %s\n", wine_dbgstr_longlong(llval));
propvar.vt = VT_UI2;
propvar.uiVal = 7;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == 7, "got wrong value %s\n", wine_dbgstr_longlong(llval));
propvar.vt = VT_I2;
propvar.iVal = -7;
hr = PropVariantToInt64(&propvar, &llval);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(llval == -7, "got wrong value %s\n", wine_dbgstr_longlong(llval));
}
static void test_PropVariantToBoolean(void)
{
static WCHAR str_0[] = {'0',0};
static WCHAR str_1[] = {'1',0};
static WCHAR str_7[] = {'7',0};
static WCHAR str_n7[] = {'-','7',0};
static WCHAR str_true[] = {'t','r','u','e',0};
static WCHAR str_true2[] = {'#','T','R','U','E','#',0};
static WCHAR str_true_case[] = {'t','R','U','e',0};
static WCHAR str_false[] = {'f','a','l','s','e',0};
static WCHAR str_false2[] = {'#','F','A','L','S','E','#',0};
static WCHAR str_true_space[] = {'t','r','u','e',' ',0};
static WCHAR str_yes[] = {'y','e','s',0};
PROPVARIANT propvar;
HRESULT hr;
BOOL val;
/* VT_BOOL */
propvar.vt = VT_BOOL;
propvar.boolVal = VARIANT_FALSE;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_BOOL;
propvar.boolVal = 1;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_BOOL;
propvar.boolVal = VARIANT_TRUE;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
/* VT_EMPTY */
propvar.vt = VT_EMPTY;
propvar.boolVal = VARIANT_TRUE;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
/* test integer conversion */
propvar.vt = VT_I4;
propvar.lVal = 0;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_I4;
propvar.lVal = 1;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_I4;
propvar.lVal = 67;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_I4;
propvar.lVal = -67;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
/* test string conversion */
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_0;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_1;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_7;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_n7;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_true;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_true_case;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_true2;
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_false;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_false2;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_true_space;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = str_yes;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = NULL;
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
/* VT_LPSTR */
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"#TruE#";
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"#TRUE#";
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"tRUe";
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"#FALSE#";
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"fALSe";
val = TRUE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == FALSE, "Unexpected value %d\n", val);
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"1";
val = FALSE;
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
propvar.vt = VT_LPSTR;
propvar.pszVal = (char *)"-1";
hr = PropVariantToBoolean(&propvar, &val);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(val == TRUE, "Unexpected value %d\n", val);
}
static void test_PropVariantToStringWithDefault(void)
{
PROPVARIANT propvar;
static WCHAR default_value[] = {'t', 'e', 's', 't', 0};
static WCHAR wstr_test2[] = {'t', 'e', 's', 't', '2', 0};
static WCHAR wstr_empty[] = {0};
static WCHAR wstr_space[] = {' ', 0};
static CHAR str_test2[] = "test2";
static CHAR str_empty[] = "";
static CHAR str_space[] = " ";
LPCWSTR result;
propvar.vt = VT_EMPTY;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_NULL;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_BOOL;
propvar.boolVal = VARIANT_TRUE;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_I4;
propvar.lVal = 15;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
/* VT_LPWSTR */
propvar.vt = VT_LPWSTR;
propvar.pwszVal = NULL;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_LPWSTR;
propvar.pwszVal = wstr_empty;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == wstr_empty, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_LPWSTR;
propvar.pwszVal = wstr_space;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == wstr_space, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_LPWSTR;
propvar.pwszVal = wstr_test2;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == wstr_test2, "Unexpected value %s\n", wine_dbgstr_w(result));
/* VT_LPSTR */
propvar.vt = VT_LPSTR;
propvar.pszVal = NULL;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_LPSTR;
propvar.pszVal = str_empty;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_LPSTR;
propvar.pszVal = str_space;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_LPSTR;
propvar.pszVal = str_test2;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(result == default_value, "Unexpected value %s\n", wine_dbgstr_w(result));
/* VT_BSTR */
propvar.vt = VT_BSTR;
propvar.bstrVal = NULL;
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(!lstrcmpW(result, wstr_empty), "Unexpected value %s\n", wine_dbgstr_w(result));
propvar.vt = VT_BSTR;
propvar.bstrVal = SysAllocString(wstr_empty);
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(!lstrcmpW(result, wstr_empty), "Unexpected value %s\n", wine_dbgstr_w(result));
SysFreeString(propvar.bstrVal);
propvar.vt = VT_BSTR;
propvar.bstrVal = SysAllocString(wstr_space);
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(!lstrcmpW(result, wstr_space), "Unexpected value %s\n", wine_dbgstr_w(result));
SysFreeString(propvar.bstrVal);
propvar.vt = VT_BSTR;
propvar.bstrVal = SysAllocString(wstr_test2);
result = PropVariantToStringWithDefault(&propvar, default_value);
ok(!lstrcmpW(result, wstr_test2), "Unexpected value %s\n", wine_dbgstr_w(result));
SysFreeString(propvar.bstrVal);
}
static void test_PropVariantChangeType_LPWSTR(void)
{
PROPVARIANT dest, src;
HRESULT hr;
PropVariantInit(&dest);
src.vt = VT_NULL;
hr = PropVariantChangeType(&dest, &src, 0, VT_LPWSTR);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(dest.vt == VT_LPWSTR, "got %d\n", dest.vt);
ok(!lstrcmpW(dest.pwszVal, emptyW), "got %s\n", wine_dbgstr_w(dest.pwszVal));
PropVariantClear(&dest);
PropVariantClear(&src);
src.vt = VT_LPSTR;
src.pszVal = CoTaskMemAlloc(strlen(topic)+1);
strcpy(src.pszVal, topic);
hr = PropVariantChangeType(&dest, &src, 0, VT_LPWSTR);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(dest.vt == VT_LPWSTR, "got %d\n", dest.vt);
ok(!lstrcmpW(dest.pwszVal, topicW), "got %s\n", wine_dbgstr_w(dest.pwszVal));
PropVariantClear(&dest);
PropVariantClear(&src);
src.vt = VT_LPWSTR;
src.pwszVal = CoTaskMemAlloc( (lstrlenW(topicW)+1) * sizeof(WCHAR));
lstrcpyW(src.pwszVal, topicW);
hr = PropVariantChangeType(&dest, &src, 0, VT_LPWSTR);
ok(hr == S_OK, "hr=%lx\n", hr);
ok(dest.vt == VT_LPWSTR, "got %d\n", dest.vt);
ok(!lstrcmpW(dest.pwszVal, topicW), "got %s\n", wine_dbgstr_w(dest.pwszVal));
PropVariantClear(&dest);
PropVariantClear(&src);
}
static void test_InitPropVariantFromCLSID(void)
{
PROPVARIANT propvar;
GUID clsid;
HRESULT hr;
memset(&propvar, 0, sizeof(propvar));
propvar.vt = VT_I4;
propvar.lVal = 15;
memset(&clsid, 0xcc, sizeof(clsid));
hr = InitPropVariantFromCLSID(&clsid, &propvar);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(propvar.vt == VT_CLSID, "Unexpected type %d.\n", propvar.vt);
ok(IsEqualGUID(propvar.puuid, &clsid), "Unexpected puuid value.\n");
PropVariantClear(&propvar);
}
static void test_PropVariantToDouble(void)
{
PROPVARIANT propvar;
double value;
HRESULT hr;
PropVariantInit(&propvar);
propvar.vt = VT_R8;
propvar.dblVal = 15.0;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == 15.0, "Unexpected value: %f.\n", value);
PropVariantClear(&propvar);
propvar.vt = VT_I4;
propvar.lVal = 123;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == 123.0, "Unexpected value: %f.\n", value);
PropVariantClear(&propvar);
propvar.vt = VT_I4;
propvar.lVal = -256;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == -256, "Unexpected value: %f\n", value);
PropVariantClear(&propvar);
propvar.vt = VT_I8;
propvar.lVal = 65536;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == 65536.0, "Unexpected value: %f.\n", value);
PropVariantClear(&propvar);
propvar.vt = VT_I8;
propvar.lVal = -321;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == 4294966975.0, "Unexpected value: %f.\n", value);
PropVariantClear(&propvar);
propvar.vt = VT_UI4;
propvar.ulVal = 6;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == 6.0, "Unexpected value: %f.\n", value);
PropVariantClear(&propvar);
propvar.vt = VT_UI8;
propvar.uhVal.QuadPart = 8;
hr = PropVariantToDouble(&propvar, &value);
ok(hr == S_OK, "PropVariantToDouble failed: 0x%08lx.\n", hr);
ok(value == 8.0, "Unexpected value: %f.\n", value);
}
static void test_PropVariantToString(void)
{
PROPVARIANT propvar;
static CHAR string[] = "Wine";
static WCHAR stringW[] = {'W','i','n','e',0};
WCHAR bufferW[256] = {0};
HRESULT hr;
PropVariantInit(&propvar);
propvar.vt = VT_EMPTY;
propvar.pwszVal = stringW;
bufferW[0] = 65;
hr = PropVariantToString(&propvar, bufferW, 0);
ok(hr == E_INVALIDARG, "PropVariantToString should fail: 0x%08lx.\n", hr);
ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_EMPTY;
propvar.pwszVal = stringW;
bufferW[0] = 65;
hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW));
ok(hr == S_OK, "PropVariantToString failed: 0x%08lx.\n", hr);
ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_NULL;
propvar.pwszVal = stringW;
bufferW[0] = 65;
hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW));
ok(hr == S_OK, "PropVariantToString failed: 0x%08lx.\n", hr);
ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_I4;
propvar.lVal = 22;
hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW));
todo_wine ok(hr == S_OK, "PropVariantToString failed: 0x%08lx.\n", hr);
todo_wine ok(!lstrcmpW(bufferW, L"22"), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = stringW;
hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW));
ok(hr == S_OK, "PropVariantToString failed: 0x%08lx.\n", hr);
ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
PropVariantInit(&propvar);
propvar.vt = VT_LPSTR;
propvar.pszVal = string;
hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW));
ok(hr == S_OK, "PropVariantToString failed: 0x%08lx.\n", hr);
ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
PropVariantInit(&propvar);
propvar.vt = VT_LPWSTR;
propvar.pwszVal = stringW;
hr = PropVariantToString(&propvar, bufferW, 4);
ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "PropVariantToString returned: 0x%08lx.\n", hr);
ok(!memcmp(bufferW, stringW, 4), "got wrong string.\n");
memset(bufferW, 0, sizeof(bufferW));
PropVariantInit(&propvar);
propvar.vt = VT_LPSTR;
propvar.pszVal = string;
hr = PropVariantToString(&propvar, bufferW, 4);
ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "PropVariantToString returned: 0x%08lx.\n", hr);
ok(!memcmp(bufferW, stringW, 4), "got wrong string.\n");
memset(bufferW, 0, sizeof(bufferW));
PropVariantInit(&propvar);
propvar.vt = VT_BSTR;
propvar.bstrVal = SysAllocString(stringW);
hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW));
ok(hr == S_OK, "PropVariantToString failed: 0x%08lx.\n", hr);
ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW));
memset(bufferW, 0, sizeof(bufferW));
SysFreeString(propvar.bstrVal);
}
static void test_PropVariantToBuffer(void)
{
PROPVARIANT propvar;
HRESULT hr;
UINT8 data[] = {1,2,3,4,5,6,7,8,9,10};
INT8 data_int8[] = {1,2,3,4,5,6,7,8,9,10};
SAFEARRAY *sa;
SAFEARRAYBOUND sabound;
void *pdata;
UINT8 buffer[256];
hr = InitPropVariantFromBuffer(data, 10, &propvar);
ok(hr == S_OK, "InitPropVariantFromBuffer failed 0x%08lx.\n", hr);
hr = PropVariantToBuffer(&propvar, NULL, 0); /* crash when cb isn't zero */
ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08lx.\n", hr);
PropVariantClear(&propvar);
hr = InitPropVariantFromBuffer(data, 10, &propvar);
ok(hr == S_OK, "InitPropVariantFromBuffer failed 0x%08lx.\n", hr);
hr = PropVariantToBuffer(&propvar, buffer, 10);
ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08lx.\n", hr);
ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
PropVariantClear(&propvar);
hr = InitPropVariantFromBuffer(data, 10, &propvar);
ok(hr == S_OK, "InitPropVariantFromBuffer failed 0x%08lx.\n", hr);
buffer[0] = 99;
hr = PropVariantToBuffer(&propvar, buffer, 11);
ok(hr == E_FAIL, "PropVariantToBuffer returned: 0x%08lx.\n", hr);
ok(buffer[0] == 99, "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
PropVariantClear(&propvar);
hr = InitPropVariantFromBuffer(data, 10, &propvar);
ok(hr == S_OK, "InitPropVariantFromBuffer failed 0x%08lx.\n", hr);
hr = PropVariantToBuffer(&propvar, buffer, 9);
ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08lx.\n", hr);
ok(!memcmp(buffer, data, 9) && !buffer[9], "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_ARRAY|VT_UI1;
sabound.lLbound = 0;
sabound.cElements = sizeof(data);
sa = NULL;
sa = SafeArrayCreate(VT_UI1, 1, &sabound);
ok(sa != NULL, "SafeArrayCreate failed.\n");
hr = SafeArrayAccessData(sa, &pdata);
ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08lx.\n", hr);
memcpy(pdata, data, sizeof(data));
hr = SafeArrayUnaccessData(sa);
ok(hr == S_OK, "SafeArrayUnaccessData failed: 0x%08lx.\n", hr);
propvar.parray = sa;
buffer[0] = 99;
hr = PropVariantToBuffer(&propvar, buffer, 11);
todo_wine ok(hr == E_FAIL, "PropVariantToBuffer returned: 0x%08lx.\n", hr);
ok(buffer[0] == 99, "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_ARRAY|VT_UI1;
sabound.lLbound = 0;
sabound.cElements = sizeof(data);
sa = NULL;
sa = SafeArrayCreate(VT_UI1, 1, &sabound);
ok(sa != NULL, "SafeArrayCreate failed.\n");
hr = SafeArrayAccessData(sa, &pdata);
ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08lx.\n", hr);
memcpy(pdata, data, sizeof(data));
hr = SafeArrayUnaccessData(sa);
ok(hr == S_OK, "SafeArrayUnaccessData failed: 0x%08lx.\n", hr);
propvar.parray = sa;
hr = PropVariantToBuffer(&propvar, buffer, sizeof(data));
todo_wine ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08lx.\n", hr);
todo_wine ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n");
memset(buffer, 0, sizeof(buffer));
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_VECTOR|VT_I1;
propvar.caub.pElems = CoTaskMemAlloc(sizeof(data_int8));
propvar.caub.cElems = sizeof(data_int8);
memcpy(propvar.caub.pElems, data_int8, sizeof(data_int8));
hr = PropVariantToBuffer(&propvar, buffer, sizeof(data_int8));
ok(hr == E_INVALIDARG, "PropVariantToBuffer failed: 0x%08lx.\n", hr);
PropVariantClear(&propvar);
PropVariantInit(&propvar);
propvar.vt = VT_ARRAY|VT_I1;
sabound.lLbound = 0;
sabound.cElements = sizeof(data_int8);
sa = NULL;
sa = SafeArrayCreate(VT_I1, 1, &sabound);
ok(sa != NULL, "SafeArrayCreate failed.\n");
hr = SafeArrayAccessData(sa, &pdata);
ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08lx.\n", hr);
memcpy(pdata, data_int8, sizeof(data_int8));
hr = SafeArrayUnaccessData(sa);
ok(hr == S_OK, "SafeArrayUnaccessData failed: 0x%08lx.\n", hr);
propvar.parray = sa;
hr = PropVariantToBuffer(&propvar, buffer, sizeof(data_int8));
ok(hr == E_INVALIDARG, "PropVariantToBuffer failed: 0x%08lx.\n", hr);
PropVariantClear(&propvar);
}
static void test_inmemorystore(void)
{
IPropertyStoreCache *propcache;
HRESULT hr;
PROPERTYKEY pkey;
PROPVARIANT propvar;
DWORD count;
PSC_STATE state;
CoInitialize(NULL);
hr = CoCreateInstance(&CLSID_InMemoryPropertyStore, NULL, CLSCTX_INPROC_SERVER,
&IID_IPropertyStoreCache, (void**)&propcache);
ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
if (FAILED(hr))
{
win_skip("CLSID_InMemoryPropertyStore not supported\n");
CoUninitialize();
return;
}
hr = IPropertyStoreCache_GetCount(propcache, NULL);
ok(hr == E_POINTER, "GetCount failed, hr=%lx\n", hr);
hr = IPropertyStoreCache_GetCount(propcache, &count);
ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
ok(count == 0, "GetCount returned %li, expected 0\n", count);
hr = IPropertyStoreCache_Commit(propcache);
ok(hr == S_OK, "Commit failed, hr=%lx\n", hr);
hr = IPropertyStoreCache_Commit(propcache);
ok(hr == S_OK, "Commit failed, hr=%lx\n", hr);
hr = IPropertyStoreCache_GetAt(propcache, 0, &pkey);
ok(hr == E_INVALIDARG, "GetAt failed, hr=%lx\n", hr);
pkey.fmtid = PKEY_WineTest;
pkey.pid = 4;
memset(&propvar, 0, sizeof(propvar));
propvar.vt = VT_I4;
propvar.lVal = 12345;
if (0)
{
/* Crashes on Windows 7 */
hr = IPropertyStoreCache_SetValue(propcache, NULL, &propvar);
ok(hr == E_POINTER, "SetValue failed, hr=%lx\n", hr);
hr = IPropertyStoreCache_SetValue(propcache, &pkey, NULL);
ok(hr == E_POINTER, "SetValue failed, hr=%lx\n", hr);
}
hr = IPropertyStoreCache_SetValue(propcache, &pkey, &propvar);
ok(hr == S_OK, "SetValue failed, hr=%lx\n", hr);
hr = IPropertyStoreCache_GetCount(propcache, &count);
ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
ok(count == 1, "GetCount returned %li, expected 0\n", count);
memset(&pkey, 0, sizeof(pkey));
hr = IPropertyStoreCache_GetAt(propcache, 0, &pkey);
ok(hr == S_OK, "GetAt failed, hr=%lx\n", hr);
ok(IsEqualGUID(&pkey.fmtid, &PKEY_WineTest), "got wrong pkey\n");
ok(pkey.pid == 4, "got pid of %li, expected 4\n", pkey.pid);
pkey.fmtid = PKEY_WineTest;
pkey.pid = 4;
memset(&propvar, 0, sizeof(propvar));
if (0)
{
/* Crashes on Windows 7 */
hr = IPropertyStoreCache_GetValue(propcache, NULL, &propvar);
ok(hr == E_POINTER, "GetValue failed, hr=%lx\n", hr);
}
hr = IPropertyStoreCache_GetValue(propcache, &pkey, NULL);
ok(hr == E_POINTER, "GetValue failed, hr=%lx\n", hr);
hr = IPropertyStoreCache_GetValue(propcache, &pkey, &propvar);
ok(hr == S_OK, "GetValue failed, hr=%lx\n", hr);
ok(propvar.vt == VT_I4, "expected VT_I4, got %d\n", propvar.vt);
ok(propvar.lVal == 12345, "expected 12345, got %ld\n", propvar.lVal);
pkey.fmtid = PKEY_WineTest;
pkey.pid = 10;
/* Get information for field that isn't set yet */
propvar.vt = VT_I2;
hr = IPropertyStoreCache_GetValue(propcache, &pkey, &propvar);
ok(hr == S_OK, "GetValue failed, hr=%lx\n", hr);
ok(propvar.vt == VT_EMPTY, "expected VT_EMPTY, got %d\n", propvar.vt);
state = 0xdeadbeef;
hr = IPropertyStoreCache_GetState(propcache, &pkey, &state);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetState failed, hr=%lx\n", hr);
ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state);
propvar.vt = VT_I2;
state = 0xdeadbeef;
hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &state);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetValueAndState failed, hr=%lx\n", hr);
ok(propvar.vt == VT_EMPTY, "expected VT_EMPTY, got %d\n", propvar.vt);
ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state);
/* Set state on an unset field */
hr = IPropertyStoreCache_SetState(propcache, &pkey, PSC_NORMAL);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "SetState failed, hr=%lx\n", hr);
/* Manipulate state on already set field */
pkey.fmtid = PKEY_WineTest;
pkey.pid = 4;
state = 0xdeadbeef;
hr = IPropertyStoreCache_GetState(propcache, &pkey, &state);
ok(hr == S_OK, "GetState failed, hr=%lx\n", hr);
ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state);
hr = IPropertyStoreCache_SetState(propcache, &pkey, 10);
ok(hr == S_OK, "SetState failed, hr=%lx\n", hr);
state = 0xdeadbeef;
hr = IPropertyStoreCache_GetState(propcache, &pkey, &state);
ok(hr == S_OK, "GetState failed, hr=%lx\n", hr);
ok(state == 10, "expected 10, got %d\n", state);
propvar.vt = VT_I4;
propvar.lVal = 12346;
hr = IPropertyStoreCache_SetValueAndState(propcache, &pkey, &propvar, 5);
ok(hr == S_OK, "SetValueAndState failed, hr=%lx\n", hr);
memset(&propvar, 0, sizeof(propvar));
state = 0xdeadbeef;
hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &state);
ok(hr == S_OK, "GetValueAndState failed, hr=%lx\n", hr);
ok(propvar.vt == VT_I4, "expected VT_I4, got %d\n", propvar.vt);
ok(propvar.lVal == 12346, "expected 12346, got %d\n", propvar.vt);
ok(state == 5, "expected 5, got %d\n", state);
/* Set new field with state */
pkey.fmtid = PKEY_WineTest;
pkey.pid = 8;
propvar.vt = VT_I4;
propvar.lVal = 12347;
hr = IPropertyStoreCache_SetValueAndState(propcache, &pkey, &propvar, PSC_DIRTY);
ok(hr == S_OK, "SetValueAndState failed, hr=%lx\n", hr);
memset(&propvar, 0, sizeof(propvar));
state = 0xdeadbeef;
hr = IPropertyStoreCache_GetValueAndState(propcache, &pkey, &propvar, &state);
ok(hr == S_OK, "GetValueAndState failed, hr=%lx\n", hr);
ok(propvar.vt == VT_I4, "expected VT_I4, got %d\n", propvar.vt);
ok(propvar.lVal == 12347, "expected 12347, got %d\n", propvar.vt);
ok(state == PSC_DIRTY, "expected PSC_DIRTY, got %d\n", state);
IPropertyStoreCache_Release(propcache);
CoUninitialize();
}
static void test_persistserialized(void)
{
IPropertyStore *propstore;
IPersistSerializedPropStorage *serialized;
HRESULT hr;
SERIALIZEDPROPSTORAGE *result;
DWORD result_size;
CoInitialize(NULL);
hr = CoCreateInstance(&CLSID_InMemoryPropertyStore, NULL, CLSCTX_INPROC_SERVER,
&IID_IPropertyStore, (void**)&propstore);
ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
hr = IPropertyStore_QueryInterface(propstore, &IID_IPersistSerializedPropStorage,
(void**)&serialized);
todo_wine ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
if (FAILED(hr))
{
IPropertyStore_Release(propstore);
skip("IPersistSerializedPropStorage not supported\n");
CoUninitialize();
return;
}
hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, NULL, &result_size);
ok(hr == E_POINTER, "GetPropertyStorage failed, hr=%lx\n", hr);
hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, &result, NULL);
ok(hr == E_POINTER, "GetPropertyStorage failed, hr=%lx\n", hr);
hr = IPersistSerializedPropStorage_GetPropertyStorage(serialized, &result, &result_size);
ok(hr == S_OK, "GetPropertyStorage failed, hr=%lx\n", hr);
if (SUCCEEDED(hr))
{
ok(result_size == 0, "expected 0 bytes, got %li\n", result_size);
CoTaskMemFree(result);
}
hr = IPersistSerializedPropStorage_SetPropertyStorage(serialized, NULL, 4);
ok(hr == E_POINTER, "SetPropertyStorage failed, hr=%lx\n", hr);
hr = IPersistSerializedPropStorage_SetPropertyStorage(serialized, NULL, 0);
ok(hr == S_OK, "SetPropertyStorage failed, hr=%lx\n", hr);
hr = IPropertyStore_GetCount(propstore, &result_size);
ok(hr == S_OK, "GetCount failed, hr=%lx\n", hr);
ok(result_size == 0, "expecting 0, got %ld\n", result_size);
IPropertyStore_Release(propstore);
IPersistSerializedPropStorage_Release(serialized);
CoUninitialize();
}
static void test_PSCreateMemoryPropertyStore(void)
{
IPropertyStore *propstore, *propstore1;
IPersistSerializedPropStorage *serialized;
IPropertyStoreCache *propstorecache;
HRESULT hr;
/* PSCreateMemoryPropertyStore(&IID_IPropertyStore, NULL); crashes */
hr = PSCreateMemoryPropertyStore(&IID_IPropertyStore, (void **)&propstore);
ok(hr == S_OK, "PSCreateMemoryPropertyStore failed: 0x%08lx.\n", hr);
ok(propstore != NULL, "got %p.\n", propstore);
EXPECT_REF(propstore, 1);
hr = PSCreateMemoryPropertyStore(&IID_IPersistSerializedPropStorage, (void **)&serialized);
todo_wine ok(hr == S_OK, "PSCreateMemoryPropertyStore failed: 0x%08lx.\n", hr);
todo_wine ok(serialized != NULL, "got %p.\n", serialized);
EXPECT_REF(propstore, 1);
if(serialized)
{
EXPECT_REF(serialized, 1);
IPersistSerializedPropStorage_Release(serialized);
}
hr = PSCreateMemoryPropertyStore(&IID_IPropertyStoreCache, (void **)&propstorecache);
ok(hr == S_OK, "PSCreateMemoryPropertyStore failed: 0x%08lx.\n", hr);
ok(propstorecache != NULL, "got %p.\n", propstore);
ok(propstorecache != (IPropertyStoreCache *)propstore, "pointer are equal: %p, %p.\n", propstorecache, propstore);
EXPECT_REF(propstore, 1);
EXPECT_REF(propstorecache, 1);
hr = PSCreateMemoryPropertyStore(&IID_IPropertyStore, (void **)&propstore1);
ok(hr == S_OK, "PSCreateMemoryPropertyStore failed: 0x%08lx.\n", hr);
ok(propstore1 != NULL, "got %p.\n", propstore);
ok(propstore1 != propstore, "pointer are equal: %p, %p.\n", propstore1, propstore);
EXPECT_REF(propstore, 1);
EXPECT_REF(propstore1, 1);
EXPECT_REF(propstorecache, 1);
IPropertyStore_Release(propstore1);
IPropertyStore_Release(propstore);
IPropertyStoreCache_Release(propstorecache);
}
static void test_propertystore(void)
{
IPropertyStore *propstore;
HRESULT hr;
PROPVARIANT propvar, ret_propvar;
PROPERTYKEY propkey;
DWORD count = 0;
hr = PSCreateMemoryPropertyStore(&IID_IPropertyStore, (void **)&propstore);
ok(hr == S_OK, "PSCreateMemoryPropertyStore failed: 0x%08lx.\n", hr);
ok(propstore != NULL, "got %p.\n", propstore);
hr = IPropertyStore_GetCount(propstore, &count);
ok(hr == S_OK, "IPropertyStore_GetCount failed: 0x%08lx.\n", hr);
ok(!count, "got wrong property count: %ld, expected 0.\n", count);
PropVariantInit(&propvar);
propvar.vt = VT_I4;
propvar.lVal = 123;
propkey.fmtid = DUMMY_GUID1;
propkey.pid = PID_FIRST_USABLE;
hr = IPropertyStore_SetValue(propstore, &propkey, &propvar);
ok(hr == S_OK, "IPropertyStore_SetValue failed: 0x%08lx.\n", hr);
hr = IPropertyStore_Commit(propstore);
ok(hr == S_OK, "IPropertyStore_Commit failed: 0x%08lx.\n", hr);
hr = IPropertyStore_GetCount(propstore, &count);
ok(hr == S_OK, "IPropertyStore_GetCount failed: 0x%08lx.\n", hr);
ok(count == 1, "got wrong property count: %ld, expected 1.\n", count);
PropVariantInit(&ret_propvar);
ret_propvar.vt = VT_I4;
hr = IPropertyStore_GetValue(propstore, &propkey, &ret_propvar);
ok(hr == S_OK, "IPropertyStore_GetValue failed: 0x%08lx.\n", hr);
ok(ret_propvar.vt == VT_I4, "got wrong property type: %x.\n", ret_propvar.vt);
ok(ret_propvar.lVal == 123, "got wrong value: %ld, expected 123.\n", ret_propvar.lVal);
PropVariantClear(&propvar);
PropVariantClear(&ret_propvar);
PropVariantInit(&propvar);
propkey.fmtid = DUMMY_GUID1;
propkey.pid = PID_FIRST_USABLE;
hr = IPropertyStore_SetValue(propstore, &propkey, &propvar);
ok(hr == S_OK, "IPropertyStore_SetValue failed: 0x%08lx.\n", hr);
hr = IPropertyStore_Commit(propstore);
ok(hr == S_OK, "IPropertyStore_Commit failed: 0x%08lx.\n", hr);
hr = IPropertyStore_GetCount(propstore, &count);
ok(hr == S_OK, "IPropertyStore_GetCount failed: 0x%08lx.\n", hr);
ok(count == 1, "got wrong property count: %ld, expected 1.\n", count);
PropVariantInit(&ret_propvar);
hr = IPropertyStore_GetValue(propstore, &propkey, &ret_propvar);
ok(hr == S_OK, "IPropertyStore_GetValue failed: 0x%08lx.\n", hr);
ok(ret_propvar.vt == VT_EMPTY, "got wrong property type: %x.\n", ret_propvar.vt);
ok(!ret_propvar.lVal, "got wrong value: %ld, expected 0.\n", ret_propvar.lVal);
PropVariantClear(&propvar);
PropVariantClear(&ret_propvar);
IPropertyStore_Release(propstore);
}
static void test_PSCreatePropertyStoreFromObject(void)
{
IPropertyStore *propstore;
IUnknown *unk;
HRESULT hr;
hr = PSCreateMemoryPropertyStore(&IID_IPropertyStore, (void **)&propstore);
ok(hr == S_OK, "Failed to create property store, hr %#lx.\n", hr);
hr = PSCreatePropertyStoreFromObject(NULL, STGM_READWRITE, &IID_IUnknown, (void **)&unk);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = PSCreatePropertyStoreFromObject((IUnknown *)propstore, STGM_READWRITE, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = PSCreatePropertyStoreFromObject((IUnknown *)propstore, STGM_READWRITE, &IID_IUnknown, (void **)&unk);
todo_wine
ok(hr == S_OK, "Failed to create wrapper, hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
ok(unk != (IUnknown *)propstore, "Unexpected object returned.\n");
IUnknown_Release(unk);
}
hr = PSCreatePropertyStoreFromObject((IUnknown *)propstore, STGM_READWRITE, &IID_IPropertyStore, (void **)&unk);
ok(hr == S_OK, "Failed to create wrapper, hr %#lx.\n", hr);
ok(unk == (IUnknown *)propstore, "Unexpected object returned.\n");
IUnknown_Release(unk);
IPropertyStore_Release(propstore);
}
START_TEST(propsys)
{
test_PSStringFromPropertyKey();
test_PSPropertyKeyFromString();
test_PSRefreshPropertySchema();
test_InitPropVariantFromGUIDAsString();
test_InitPropVariantFromBuffer();
test_PropVariantToGUID();
test_PropVariantToStringAlloc();
test_PropVariantCompareEx();
test_intconversions();
test_PropVariantChangeType_LPWSTR();
test_PropVariantToBoolean();
test_PropVariantToStringWithDefault();
test_InitPropVariantFromCLSID();
test_PropVariantToDouble();
test_PropVariantToString();
test_PropVariantToBuffer();
test_inmemorystore();
test_persistserialized();
test_PSCreateMemoryPropertyStore();
test_propertystore();
test_PSCreatePropertyStoreFromObject();
}
| 44.84492 | 171 | 0.537758 | [
"object",
"vector"
] |
36b4e70f9eba90389c8a6f906d76be27b2eac0c3 | 525,572 | h | C | renderdoc/driver/gl/gl_dispatch_table_defs.h | isurmin/renderdoc | 476c978ed36c58e56cdb1c8699b4d509388fb41b | [
"MIT"
] | null | null | null | renderdoc/driver/gl/gl_dispatch_table_defs.h | isurmin/renderdoc | 476c978ed36c58e56cdb1c8699b4d509388fb41b | [
"MIT"
] | null | null | null | renderdoc/driver/gl/gl_dispatch_table_defs.h | isurmin/renderdoc | 476c978ed36c58e56cdb1c8699b4d509388fb41b | [
"MIT"
] | null | null | null | /******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2018 Baldur Karlsson
*
* 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
// This file is autogenerated with gen_dispatch_table.py - any changes will be overwritten next time
// that script is run.
// $ ./gen_dispatch_table.py > gl_dispatch_table_defs.h
// We need to disable clang-format since this struct is programmatically generated
// clang-format off
#define ForEachSupported(FUNC) \
FUNC(glBindTexture, glBindTexture); \
FUNC(glBlendFunc, glBlendFunc); \
FUNC(glClear, glClear); \
FUNC(glClearColor, glClearColor); \
FUNC(glClearDepth, glClearDepth); \
FUNC(glClearStencil, glClearStencil); \
FUNC(glColorMask, glColorMask); \
FUNC(glCullFace, glCullFace); \
FUNC(glDepthFunc, glDepthFunc); \
FUNC(glDepthMask, glDepthMask); \
FUNC(glDepthRange, glDepthRange); \
FUNC(glStencilFunc, glStencilFunc); \
FUNC(glStencilMask, glStencilMask); \
FUNC(glStencilOp, glStencilOp); \
FUNC(glDisable, glDisable); \
FUNC(glDrawBuffer, glDrawBuffer); \
FUNC(glDrawElements, glDrawElements); \
FUNC(glDrawArrays, glDrawArrays); \
FUNC(glEnable, glEnable); \
FUNC(glFlush, glFlush); \
FUNC(glFinish, glFinish); \
FUNC(glFrontFace, glFrontFace); \
FUNC(glGenTextures, glGenTextures); \
FUNC(glDeleteTextures, glDeleteTextures); \
FUNC(glIsEnabled, glIsEnabled); \
FUNC(glIsTexture, glIsTexture); \
FUNC(glGetError, glGetError); \
FUNC(glGetTexLevelParameteriv, glGetTexLevelParameteriv); \
FUNC(glGetTexLevelParameterfv, glGetTexLevelParameterfv); \
FUNC(glGetTexParameterfv, glGetTexParameterfv); \
FUNC(glGetTexParameteriv, glGetTexParameteriv); \
FUNC(glGetTexImage, glGetTexImage); \
FUNC(glGetBooleanv, glGetBooleanv); \
FUNC(glGetFloatv, glGetFloatv); \
FUNC(glGetDoublev, glGetDoublev); \
FUNC(glGetIntegerv, glGetIntegerv); \
FUNC(glGetPointerv, glGetPointerv); \
FUNC(glGetPointerv, glGetPointervKHR); \
FUNC(glGetString, glGetString); \
FUNC(glHint, glHint); \
FUNC(glLogicOp, glLogicOp); \
FUNC(glPixelStorei, glPixelStorei); \
FUNC(glPixelStoref, glPixelStoref); \
FUNC(glPolygonMode, glPolygonMode); \
FUNC(glPolygonOffset, glPolygonOffset); \
FUNC(glPointSize, glPointSize); \
FUNC(glLineWidth, glLineWidth); \
FUNC(glReadPixels, glReadPixels); \
FUNC(glReadBuffer, glReadBuffer); \
FUNC(glScissor, glScissor); \
FUNC(glTexImage1D, glTexImage1D); \
FUNC(glTexImage2D, glTexImage2D); \
FUNC(glTexSubImage1D, glTexSubImage1D); \
FUNC(glTexSubImage2D, glTexSubImage2D); \
FUNC(glCopyTexImage1D, glCopyTexImage1D); \
FUNC(glCopyTexImage2D, glCopyTexImage2D); \
FUNC(glCopyTexSubImage1D, glCopyTexSubImage1D); \
FUNC(glCopyTexSubImage2D, glCopyTexSubImage2D); \
FUNC(glTexParameterf, glTexParameterf); \
FUNC(glTexParameterfv, glTexParameterfv); \
FUNC(glTexParameteri, glTexParameteri); \
FUNC(glTexParameteriv, glTexParameteriv); \
FUNC(glViewport, glViewport); \
FUNC(glActiveTexture, glActiveTexture); \
FUNC(glActiveTexture, glActiveTextureARB); \
FUNC(glTexStorage1D, glTexStorage1D); \
FUNC(glTexStorage1D, glTexStorage1DEXT); \
FUNC(glTexStorage2D, glTexStorage2D); \
FUNC(glTexStorage2D, glTexStorage2DEXT); \
FUNC(glTexStorage3D, glTexStorage3D); \
FUNC(glTexStorage3D, glTexStorage3DEXT); \
FUNC(glTexStorage2DMultisample, glTexStorage2DMultisample); \
FUNC(glTexStorage3DMultisample, glTexStorage3DMultisample); \
FUNC(glTexStorage3DMultisample, glTexStorage3DMultisampleOES); \
FUNC(glTexImage3D, glTexImage3D); \
FUNC(glTexImage3D, glTexImage3DEXT); \
FUNC(glTexImage3D, glTexImage3DOES); \
FUNC(glTexSubImage3D, glTexSubImage3D); \
FUNC(glTexSubImage3D, glTexSubImage3DOES); \
FUNC(glTexBuffer, glTexBuffer); \
FUNC(glTexBuffer, glTexBufferARB); \
FUNC(glTexBuffer, glTexBufferEXT); \
FUNC(glTexBuffer, glTexBufferOES); \
FUNC(glTexImage2DMultisample, glTexImage2DMultisample); \
FUNC(glTexImage3DMultisample, glTexImage3DMultisample); \
FUNC(glCompressedTexImage1D, glCompressedTexImage1D); \
FUNC(glCompressedTexImage1D, glCompressedTexImage1DARB); \
FUNC(glCompressedTexImage2D, glCompressedTexImage2D); \
FUNC(glCompressedTexImage2D, glCompressedTexImage2DARB); \
FUNC(glCompressedTexImage3D, glCompressedTexImage3D); \
FUNC(glCompressedTexImage3D, glCompressedTexImage3DARB); \
FUNC(glCompressedTexImage3D, glCompressedTexImage3DOES); \
FUNC(glCompressedTexSubImage1D, glCompressedTexSubImage1D); \
FUNC(glCompressedTexSubImage1D, glCompressedTexSubImage1DARB); \
FUNC(glCompressedTexSubImage2D, glCompressedTexSubImage2D); \
FUNC(glCompressedTexSubImage2D, glCompressedTexSubImage2DARB); \
FUNC(glCompressedTexSubImage3D, glCompressedTexSubImage3D); \
FUNC(glCompressedTexSubImage3D, glCompressedTexSubImage3DARB); \
FUNC(glCompressedTexSubImage3D, glCompressedTexSubImage3DOES); \
FUNC(glTexBufferRange, glTexBufferRange); \
FUNC(glTexBufferRange, glTexBufferRangeEXT); \
FUNC(glTexBufferRange, glTexBufferRangeOES); \
FUNC(glTextureView, glTextureView); \
FUNC(glTextureView, glTextureViewEXT); \
FUNC(glTextureView, glTextureViewOES); \
FUNC(glTexParameterIiv, glTexParameterIiv); \
FUNC(glTexParameterIiv, glTexParameterIivEXT); \
FUNC(glTexParameterIiv, glTexParameterIivOES); \
FUNC(glTexParameterIuiv, glTexParameterIuiv); \
FUNC(glTexParameterIuiv, glTexParameterIuivEXT); \
FUNC(glTexParameterIuiv, glTexParameterIuivOES); \
FUNC(glGenerateMipmap, glGenerateMipmap); \
FUNC(glGenerateMipmap, glGenerateMipmapEXT); \
FUNC(glCopyImageSubData, glCopyImageSubData); \
FUNC(glCopyImageSubData, glCopyImageSubDataEXT); \
FUNC(glCopyImageSubData, glCopyImageSubDataOES); \
FUNC(glCopyTexSubImage3D, glCopyTexSubImage3D); \
FUNC(glCopyTexSubImage3D, glCopyTexSubImage3DOES); \
FUNC(glGetInternalformativ, glGetInternalformativ); \
FUNC(glGetInternalformati64v, glGetInternalformati64v); \
FUNC(glGetBufferParameteriv, glGetBufferParameteriv); \
FUNC(glGetBufferParameteriv, glGetBufferParameterivARB); \
FUNC(glGetBufferParameteri64v, glGetBufferParameteri64v); \
FUNC(glGetBufferPointerv, glGetBufferPointerv); \
FUNC(glGetBufferPointerv, glGetBufferPointervARB); \
FUNC(glGetBufferPointerv, glGetBufferPointervOES); \
FUNC(glGetFragDataIndex, glGetFragDataIndex); \
FUNC(glGetFragDataLocation, glGetFragDataLocation); \
FUNC(glGetFragDataLocation, glGetFragDataLocationEXT); \
FUNC(glGetStringi, glGetStringi); \
FUNC(glGetBooleani_v, glGetBooleani_v); \
FUNC(glGetIntegeri_v, glGetIntegeri_v); \
FUNC(glGetFloati_v, glGetFloati_v); \
FUNC(glGetFloati_v, glGetFloati_vEXT); \
FUNC(glGetFloati_v, glGetFloati_vOES); \
FUNC(glGetFloati_v, glGetFloati_vNV); \
FUNC(glGetDoublei_v, glGetDoublei_v); \
FUNC(glGetDoublei_v, glGetDoublei_vEXT); \
FUNC(glGetInteger64i_v, glGetInteger64i_v); \
FUNC(glGetInteger64v, glGetInteger64v); \
FUNC(glGetShaderiv, glGetShaderiv); \
FUNC(glGetShaderInfoLog, glGetShaderInfoLog); \
FUNC(glGetShaderPrecisionFormat, glGetShaderPrecisionFormat); \
FUNC(glGetShaderSource, glGetShaderSource); \
FUNC(glGetAttachedShaders, glGetAttachedShaders); \
FUNC(glGetProgramiv, glGetProgramiv); \
FUNC(glGetProgramInfoLog, glGetProgramInfoLog); \
FUNC(glGetProgramInterfaceiv, glGetProgramInterfaceiv); \
FUNC(glGetProgramResourceIndex, glGetProgramResourceIndex); \
FUNC(glGetProgramResourceiv, glGetProgramResourceiv); \
FUNC(glGetProgramResourceName, glGetProgramResourceName); \
FUNC(glGetProgramPipelineiv, glGetProgramPipelineiv); \
FUNC(glGetProgramPipelineiv, glGetProgramPipelineivEXT); \
FUNC(glGetProgramPipelineInfoLog, glGetProgramPipelineInfoLog); \
FUNC(glGetProgramPipelineInfoLog, glGetProgramPipelineInfoLogEXT); \
FUNC(glGetProgramBinary, glGetProgramBinary); \
FUNC(glGetProgramResourceLocation, glGetProgramResourceLocation); \
FUNC(glGetProgramResourceLocationIndex, glGetProgramResourceLocationIndex); \
FUNC(glGetProgramStageiv, glGetProgramStageiv); \
FUNC(glGetGraphicsResetStatus, glGetGraphicsResetStatus); \
FUNC(glGetGraphicsResetStatus, glGetGraphicsResetStatusARB); \
FUNC(glGetGraphicsResetStatus, glGetGraphicsResetStatusEXT); \
FUNC(glGetObjectLabel, glGetObjectLabel); \
FUNC(glGetObjectLabel, glGetObjectLabelKHR); \
FUNC(glGetObjectLabelEXT, glGetObjectLabelEXT); \
FUNC(glGetObjectPtrLabel, glGetObjectPtrLabel); \
FUNC(glGetObjectPtrLabel, glGetObjectPtrLabelKHR); \
FUNC(glGetDebugMessageLog, glGetDebugMessageLog); \
FUNC(glGetDebugMessageLog, glGetDebugMessageLogARB); \
FUNC(glGetDebugMessageLog, glGetDebugMessageLogKHR); \
FUNC(glGetFramebufferAttachmentParameteriv, glGetFramebufferAttachmentParameteriv); \
FUNC(glGetFramebufferAttachmentParameteriv, glGetFramebufferAttachmentParameterivEXT); \
FUNC(glGetFramebufferParameteriv, glGetFramebufferParameteriv); \
FUNC(glGetRenderbufferParameteriv, glGetRenderbufferParameteriv); \
FUNC(glGetRenderbufferParameteriv, glGetRenderbufferParameterivEXT); \
FUNC(glGetMultisamplefv, glGetMultisamplefv); \
FUNC(glGetQueryIndexediv, glGetQueryIndexediv); \
FUNC(glGetQueryObjectui64v, glGetQueryObjectui64v); \
FUNC(glGetQueryObjectui64v, glGetQueryObjectui64vEXT); \
FUNC(glGetQueryObjectuiv, glGetQueryObjectuiv); \
FUNC(glGetQueryObjectuiv, glGetQueryObjectuivARB); \
FUNC(glGetQueryObjectuiv, glGetQueryObjectuivEXT); \
FUNC(glGetQueryObjecti64v, glGetQueryObjecti64v); \
FUNC(glGetQueryObjecti64v, glGetQueryObjecti64vEXT); \
FUNC(glGetQueryObjectiv, glGetQueryObjectiv); \
FUNC(glGetQueryObjectiv, glGetQueryObjectivARB); \
FUNC(glGetQueryObjectiv, glGetQueryObjectivEXT); \
FUNC(glGetQueryiv, glGetQueryiv); \
FUNC(glGetQueryiv, glGetQueryivARB); \
FUNC(glGetQueryiv, glGetQueryivEXT); \
FUNC(glGetSynciv, glGetSynciv); \
FUNC(glGetBufferSubData, glGetBufferSubData); \
FUNC(glGetBufferSubData, glGetBufferSubDataARB); \
FUNC(glGetVertexAttribiv, glGetVertexAttribiv); \
FUNC(glGetVertexAttribPointerv, glGetVertexAttribPointerv); \
FUNC(glGetCompressedTexImage, glGetCompressedTexImage); \
FUNC(glGetCompressedTexImage, glGetCompressedTexImageARB); \
FUNC(glGetnCompressedTexImage, glGetnCompressedTexImage); \
FUNC(glGetnCompressedTexImage, glGetnCompressedTexImageARB); \
FUNC(glGetnTexImage, glGetnTexImage); \
FUNC(glGetnTexImage, glGetnTexImageARB); \
FUNC(glGetTexParameterIiv, glGetTexParameterIiv); \
FUNC(glGetTexParameterIiv, glGetTexParameterIivEXT); \
FUNC(glGetTexParameterIiv, glGetTexParameterIivOES); \
FUNC(glGetTexParameterIuiv, glGetTexParameterIuiv); \
FUNC(glGetTexParameterIuiv, glGetTexParameterIuivEXT); \
FUNC(glGetTexParameterIuiv, glGetTexParameterIuivOES); \
FUNC(glClampColor, glClampColor); \
FUNC(glClampColor, glClampColorARB); \
FUNC(glReadnPixels, glReadnPixels); \
FUNC(glReadnPixels, glReadnPixelsARB); \
FUNC(glReadnPixels, glReadnPixelsEXT); \
FUNC(glGetSamplerParameterIiv, glGetSamplerParameterIiv); \
FUNC(glGetSamplerParameterIiv, glGetSamplerParameterIivEXT); \
FUNC(glGetSamplerParameterIiv, glGetSamplerParameterIivOES); \
FUNC(glGetSamplerParameterIuiv, glGetSamplerParameterIuiv); \
FUNC(glGetSamplerParameterIuiv, glGetSamplerParameterIuivEXT); \
FUNC(glGetSamplerParameterIuiv, glGetSamplerParameterIuivOES); \
FUNC(glGetSamplerParameterfv, glGetSamplerParameterfv); \
FUNC(glGetSamplerParameteriv, glGetSamplerParameteriv); \
FUNC(glGetTransformFeedbackVarying, glGetTransformFeedbackVarying); \
FUNC(glGetTransformFeedbackVarying, glGetTransformFeedbackVaryingEXT); \
FUNC(glGetSubroutineIndex, glGetSubroutineIndex); \
FUNC(glGetSubroutineUniformLocation, glGetSubroutineUniformLocation); \
FUNC(glGetActiveAtomicCounterBufferiv, glGetActiveAtomicCounterBufferiv); \
FUNC(glGetActiveSubroutineName, glGetActiveSubroutineName); \
FUNC(glGetActiveSubroutineUniformName, glGetActiveSubroutineUniformName); \
FUNC(glGetActiveSubroutineUniformiv, glGetActiveSubroutineUniformiv); \
FUNC(glGetUniformLocation, glGetUniformLocation); \
FUNC(glGetUniformIndices, glGetUniformIndices); \
FUNC(glGetUniformSubroutineuiv, glGetUniformSubroutineuiv); \
FUNC(glGetUniformBlockIndex, glGetUniformBlockIndex); \
FUNC(glGetAttribLocation, glGetAttribLocation); \
FUNC(glGetActiveUniform, glGetActiveUniform); \
FUNC(glGetActiveUniformName, glGetActiveUniformName); \
FUNC(glGetActiveUniformBlockName, glGetActiveUniformBlockName); \
FUNC(glGetActiveUniformBlockiv, glGetActiveUniformBlockiv); \
FUNC(glGetActiveUniformsiv, glGetActiveUniformsiv); \
FUNC(glGetActiveAttrib, glGetActiveAttrib); \
FUNC(glGetUniformfv, glGetUniformfv); \
FUNC(glGetUniformiv, glGetUniformiv); \
FUNC(glGetUniformuiv, glGetUniformuiv); \
FUNC(glGetUniformuiv, glGetUniformuivEXT); \
FUNC(glGetUniformdv, glGetUniformdv); \
FUNC(glGetnUniformdv, glGetnUniformdv); \
FUNC(glGetnUniformdv, glGetnUniformdvARB); \
FUNC(glGetnUniformfv, glGetnUniformfv); \
FUNC(glGetnUniformfv, glGetnUniformfvARB); \
FUNC(glGetnUniformfv, glGetnUniformfvEXT); \
FUNC(glGetnUniformiv, glGetnUniformiv); \
FUNC(glGetnUniformiv, glGetnUniformivARB); \
FUNC(glGetnUniformiv, glGetnUniformivEXT); \
FUNC(glGetnUniformuiv, glGetnUniformuiv); \
FUNC(glGetnUniformuiv, glGetnUniformuivARB); \
FUNC(glGetVertexAttribIiv, glGetVertexAttribIiv); \
FUNC(glGetVertexAttribIiv, glGetVertexAttribIivEXT); \
FUNC(glGetVertexAttribIuiv, glGetVertexAttribIuiv); \
FUNC(glGetVertexAttribIuiv, glGetVertexAttribIuivEXT); \
FUNC(glGetVertexAttribLdv, glGetVertexAttribLdv); \
FUNC(glGetVertexAttribLdv, glGetVertexAttribLdvEXT); \
FUNC(glGetVertexAttribdv, glGetVertexAttribdv); \
FUNC(glGetVertexAttribfv, glGetVertexAttribfv); \
FUNC(glCheckFramebufferStatus, glCheckFramebufferStatus); \
FUNC(glCheckFramebufferStatus, glCheckFramebufferStatusEXT); \
FUNC(glBlendColor, glBlendColor); \
FUNC(glBlendColor, glBlendColorEXT); \
FUNC(glBlendFunci, glBlendFunci); \
FUNC(glBlendFunci, glBlendFunciARB); \
FUNC(glBlendFunci, glBlendFunciEXT); \
FUNC(glBlendFunci, glBlendFunciOES); \
FUNC(glBlendFuncSeparate, glBlendFuncSeparate); \
FUNC(glBlendFuncSeparate, glBlendFuncSeparateARB); \
FUNC(glBlendFuncSeparatei, glBlendFuncSeparatei); \
FUNC(glBlendFuncSeparatei, glBlendFuncSeparateiARB); \
FUNC(glBlendFuncSeparatei, glBlendFuncSeparateiEXT); \
FUNC(glBlendFuncSeparatei, glBlendFuncSeparateiOES); \
FUNC(glBlendEquation, glBlendEquation); \
FUNC(glBlendEquation, glBlendEquationEXT); \
FUNC(glBlendEquationi, glBlendEquationi); \
FUNC(glBlendEquationi, glBlendEquationiARB); \
FUNC(glBlendEquationi, glBlendEquationiEXT); \
FUNC(glBlendEquationi, glBlendEquationiOES); \
FUNC(glBlendEquationSeparate, glBlendEquationSeparate); \
FUNC(glBlendEquationSeparate, glBlendEquationSeparateARB); \
FUNC(glBlendEquationSeparate, glBlendEquationSeparateEXT); \
FUNC(glBlendEquationSeparatei, glBlendEquationSeparatei); \
FUNC(glBlendEquationSeparatei, glBlendEquationSeparateiARB); \
FUNC(glBlendEquationSeparatei, glBlendEquationSeparateiEXT); \
FUNC(glBlendEquationSeparatei, glBlendEquationSeparateiOES); \
FUNC(glBlendBarrierKHR, glBlendBarrierKHR); \
FUNC(glStencilFuncSeparate, glStencilFuncSeparate); \
FUNC(glStencilMaskSeparate, glStencilMaskSeparate); \
FUNC(glStencilOpSeparate, glStencilOpSeparate); \
FUNC(glColorMaski, glColorMaski); \
FUNC(glColorMaski, glColorMaskiEXT); \
FUNC(glColorMaski, glColorMaskIndexedEXT); \
FUNC(glColorMaski, glColorMaskiOES); \
FUNC(glSampleMaski, glSampleMaski); \
FUNC(glSampleCoverage, glSampleCoverage); \
FUNC(glSampleCoverage, glSampleCoverageARB); \
FUNC(glMinSampleShading, glMinSampleShading); \
FUNC(glMinSampleShading, glMinSampleShadingARB); \
FUNC(glMinSampleShading, glMinSampleShadingOES); \
FUNC(glDepthRangef, glDepthRangef); \
FUNC(glDepthRangeIndexed, glDepthRangeIndexed); \
FUNC(glDepthRangeArrayv, glDepthRangeArrayv); \
FUNC(glClipControl, glClipControl); \
FUNC(glProvokingVertex, glProvokingVertex); \
FUNC(glProvokingVertex, glProvokingVertexEXT); \
FUNC(glPrimitiveRestartIndex, glPrimitiveRestartIndex); \
FUNC(glCreateShader, glCreateShader); \
FUNC(glDeleteShader, glDeleteShader); \
FUNC(glShaderSource, glShaderSource); \
FUNC(glCompileShader, glCompileShader); \
FUNC(glCreateShaderProgramv, glCreateShaderProgramv); \
FUNC(glCreateShaderProgramv, glCreateShaderProgramvEXT); \
FUNC(glCreateProgram, glCreateProgram); \
FUNC(glDeleteProgram, glDeleteProgram); \
FUNC(glAttachShader, glAttachShader); \
FUNC(glDetachShader, glDetachShader); \
FUNC(glReleaseShaderCompiler, glReleaseShaderCompiler); \
FUNC(glLinkProgram, glLinkProgram); \
FUNC(glProgramParameteri, glProgramParameteri); \
FUNC(glProgramParameteri, glProgramParameteriARB); \
FUNC(glProgramParameteri, glProgramParameteriEXT); \
FUNC(glUseProgram, glUseProgram); \
FUNC(glShaderBinary, glShaderBinary); \
FUNC(glProgramBinary, glProgramBinary); \
FUNC(glUseProgramStages, glUseProgramStages); \
FUNC(glUseProgramStages, glUseProgramStagesEXT); \
FUNC(glValidateProgram, glValidateProgram); \
FUNC(glGenProgramPipelines, glGenProgramPipelines); \
FUNC(glGenProgramPipelines, glGenProgramPipelinesEXT); \
FUNC(glBindProgramPipeline, glBindProgramPipeline); \
FUNC(glBindProgramPipeline, glBindProgramPipelineEXT); \
FUNC(glActiveShaderProgram, glActiveShaderProgram); \
FUNC(glActiveShaderProgram, glActiveShaderProgramEXT); \
FUNC(glDeleteProgramPipelines, glDeleteProgramPipelines); \
FUNC(glDeleteProgramPipelines, glDeleteProgramPipelinesEXT); \
FUNC(glValidateProgramPipeline, glValidateProgramPipeline); \
FUNC(glValidateProgramPipeline, glValidateProgramPipelineEXT); \
FUNC(glDebugMessageCallback, glDebugMessageCallback); \
FUNC(glDebugMessageCallback, glDebugMessageCallbackARB); \
FUNC(glDebugMessageCallback, glDebugMessageCallbackKHR); \
FUNC(glDebugMessageControl, glDebugMessageControl); \
FUNC(glDebugMessageControl, glDebugMessageControlARB); \
FUNC(glDebugMessageControl, glDebugMessageControlKHR); \
FUNC(glDebugMessageInsert, glDebugMessageInsert); \
FUNC(glDebugMessageInsert, glDebugMessageInsertARB); \
FUNC(glDebugMessageInsert, glDebugMessageInsertKHR); \
FUNC(glPushDebugGroup, glPushDebugGroup); \
FUNC(glPushDebugGroup, glPushDebugGroupKHR); \
FUNC(glPopDebugGroup, glPopDebugGroup); \
FUNC(glPopDebugGroup, glPopDebugGroupKHR); \
FUNC(glObjectLabel, glObjectLabel); \
FUNC(glObjectLabel, glObjectLabelKHR); \
FUNC(glLabelObjectEXT, glLabelObjectEXT); \
FUNC(glObjectPtrLabel, glObjectPtrLabel); \
FUNC(glObjectPtrLabel, glObjectPtrLabelKHR); \
FUNC(glEnablei, glEnablei); \
FUNC(glEnablei, glEnableiEXT); \
FUNC(glEnablei, glEnableIndexedEXT); \
FUNC(glEnablei, glEnableiOES); \
FUNC(glEnablei, glEnableiNV); \
FUNC(glDisablei, glDisablei); \
FUNC(glDisablei, glDisableiEXT); \
FUNC(glDisablei, glDisableIndexedEXT); \
FUNC(glDisablei, glDisableiOES); \
FUNC(glDisablei, glDisableiNV); \
FUNC(glIsEnabledi, glIsEnabledi); \
FUNC(glIsEnabledi, glIsEnablediEXT); \
FUNC(glIsEnabledi, glIsEnabledIndexedEXT); \
FUNC(glIsEnabledi, glIsEnablediOES); \
FUNC(glIsEnabledi, glIsEnablediNV); \
FUNC(glIsBuffer, glIsBuffer); \
FUNC(glIsBuffer, glIsBufferARB); \
FUNC(glIsFramebuffer, glIsFramebuffer); \
FUNC(glIsFramebuffer, glIsFramebufferEXT); \
FUNC(glIsProgram, glIsProgram); \
FUNC(glIsProgramPipeline, glIsProgramPipeline); \
FUNC(glIsProgramPipeline, glIsProgramPipelineEXT); \
FUNC(glIsQuery, glIsQuery); \
FUNC(glIsQuery, glIsQueryARB); \
FUNC(glIsQuery, glIsQueryEXT); \
FUNC(glIsRenderbuffer, glIsRenderbuffer); \
FUNC(glIsRenderbuffer, glIsRenderbufferEXT); \
FUNC(glIsSampler, glIsSampler); \
FUNC(glIsShader, glIsShader); \
FUNC(glIsSync, glIsSync); \
FUNC(glIsTransformFeedback, glIsTransformFeedback); \
FUNC(glIsVertexArray, glIsVertexArray); \
FUNC(glIsVertexArray, glIsVertexArrayOES); \
FUNC(glGenBuffers, glGenBuffers); \
FUNC(glGenBuffers, glGenBuffersARB); \
FUNC(glBindBuffer, glBindBuffer); \
FUNC(glBindBuffer, glBindBufferARB); \
FUNC(glDrawBuffers, glDrawBuffers); \
FUNC(glDrawBuffers, glDrawBuffersARB); \
FUNC(glDrawBuffers, glDrawBuffersEXT); \
FUNC(glGenFramebuffers, glGenFramebuffers); \
FUNC(glGenFramebuffers, glGenFramebuffersEXT); \
FUNC(glBindFramebuffer, glBindFramebuffer); \
FUNC(glBindFramebuffer, glBindFramebufferEXT); \
FUNC(glFramebufferTexture, glFramebufferTexture); \
FUNC(glFramebufferTexture, glFramebufferTextureARB); \
FUNC(glFramebufferTexture, glFramebufferTextureOES); \
FUNC(glFramebufferTexture, glFramebufferTextureEXT); \
FUNC(glFramebufferTexture1D, glFramebufferTexture1D); \
FUNC(glFramebufferTexture1D, glFramebufferTexture1DEXT); \
FUNC(glFramebufferTexture2D, glFramebufferTexture2D); \
FUNC(glFramebufferTexture2D, glFramebufferTexture2DEXT); \
FUNC(glFramebufferTexture3D, glFramebufferTexture3D); \
FUNC(glFramebufferTexture3D, glFramebufferTexture3DEXT); \
FUNC(glFramebufferTexture3D, glFramebufferTexture3DOES); \
FUNC(glFramebufferRenderbuffer, glFramebufferRenderbuffer); \
FUNC(glFramebufferRenderbuffer, glFramebufferRenderbufferEXT); \
FUNC(glFramebufferTextureLayer, glFramebufferTextureLayer); \
FUNC(glFramebufferTextureLayer, glFramebufferTextureLayerARB); \
FUNC(glFramebufferTextureLayer, glFramebufferTextureLayerEXT); \
FUNC(glFramebufferParameteri, glFramebufferParameteri); \
FUNC(glDeleteFramebuffers, glDeleteFramebuffers); \
FUNC(glDeleteFramebuffers, glDeleteFramebuffersEXT); \
FUNC(glGenRenderbuffers, glGenRenderbuffers); \
FUNC(glGenRenderbuffers, glGenRenderbuffersEXT); \
FUNC(glRenderbufferStorage, glRenderbufferStorage); \
FUNC(glRenderbufferStorage, glRenderbufferStorageEXT); \
FUNC(glRenderbufferStorageMultisample, glRenderbufferStorageMultisample); \
FUNC(glRenderbufferStorageMultisample, glRenderbufferStorageMultisampleEXT); \
FUNC(glDeleteRenderbuffers, glDeleteRenderbuffers); \
FUNC(glDeleteRenderbuffers, glDeleteRenderbuffersEXT); \
FUNC(glBindRenderbuffer, glBindRenderbuffer); \
FUNC(glBindRenderbuffer, glBindRenderbufferEXT); \
FUNC(glFenceSync, glFenceSync); \
FUNC(glClientWaitSync, glClientWaitSync); \
FUNC(glWaitSync, glWaitSync); \
FUNC(glDeleteSync, glDeleteSync); \
FUNC(glGenQueries, glGenQueries); \
FUNC(glGenQueries, glGenQueriesARB); \
FUNC(glGenQueries, glGenQueriesEXT); \
FUNC(glBeginQuery, glBeginQuery); \
FUNC(glBeginQuery, glBeginQueryARB); \
FUNC(glBeginQuery, glBeginQueryEXT); \
FUNC(glBeginQueryIndexed, glBeginQueryIndexed); \
FUNC(glEndQuery, glEndQuery); \
FUNC(glEndQuery, glEndQueryARB); \
FUNC(glEndQuery, glEndQueryEXT); \
FUNC(glEndQueryIndexed, glEndQueryIndexed); \
FUNC(glBeginConditionalRender, glBeginConditionalRender); \
FUNC(glEndConditionalRender, glEndConditionalRender); \
FUNC(glQueryCounter, glQueryCounter); \
FUNC(glQueryCounter, glQueryCounterEXT); \
FUNC(glDeleteQueries, glDeleteQueries); \
FUNC(glDeleteQueries, glDeleteQueriesARB); \
FUNC(glDeleteQueries, glDeleteQueriesEXT); \
FUNC(glBufferData, glBufferData); \
FUNC(glBufferData, glBufferDataARB); \
FUNC(glBufferStorage, glBufferStorage); \
FUNC(glBufferSubData, glBufferSubData); \
FUNC(glBufferSubData, glBufferSubDataARB); \
FUNC(glCopyBufferSubData, glCopyBufferSubData); \
FUNC(glBindBufferBase, glBindBufferBase); \
FUNC(glBindBufferBase, glBindBufferBaseEXT); \
FUNC(glBindBufferRange, glBindBufferRange); \
FUNC(glBindBufferRange, glBindBufferRangeEXT); \
FUNC(glBindBuffersBase, glBindBuffersBase); \
FUNC(glBindBuffersRange, glBindBuffersRange); \
FUNC(glMapBuffer, glMapBuffer); \
FUNC(glMapBuffer, glMapBufferARB); \
FUNC(glMapBuffer, glMapBufferOES); \
FUNC(glMapBufferRange, glMapBufferRange); \
FUNC(glFlushMappedBufferRange, glFlushMappedBufferRange); \
FUNC(glUnmapBuffer, glUnmapBuffer); \
FUNC(glUnmapBuffer, glUnmapBufferARB); \
FUNC(glUnmapBuffer, glUnmapBufferOES); \
FUNC(glTransformFeedbackVaryings, glTransformFeedbackVaryings); \
FUNC(glTransformFeedbackVaryings, glTransformFeedbackVaryingsEXT); \
FUNC(glGenTransformFeedbacks, glGenTransformFeedbacks); \
FUNC(glDeleteTransformFeedbacks, glDeleteTransformFeedbacks); \
FUNC(glBindTransformFeedback, glBindTransformFeedback); \
FUNC(glBeginTransformFeedback, glBeginTransformFeedback); \
FUNC(glBeginTransformFeedback, glBeginTransformFeedbackEXT); \
FUNC(glPauseTransformFeedback, glPauseTransformFeedback); \
FUNC(glResumeTransformFeedback, glResumeTransformFeedback); \
FUNC(glEndTransformFeedback, glEndTransformFeedback); \
FUNC(glEndTransformFeedback, glEndTransformFeedbackEXT); \
FUNC(glDrawTransformFeedback, glDrawTransformFeedback); \
FUNC(glDrawTransformFeedbackInstanced, glDrawTransformFeedbackInstanced); \
FUNC(glDrawTransformFeedbackStream, glDrawTransformFeedbackStream); \
FUNC(glDrawTransformFeedbackStreamInstanced, glDrawTransformFeedbackStreamInstanced); \
FUNC(glDeleteBuffers, glDeleteBuffers); \
FUNC(glDeleteBuffers, glDeleteBuffersARB); \
FUNC(glGenVertexArrays, glGenVertexArrays); \
FUNC(glGenVertexArrays, glGenVertexArraysOES); \
FUNC(glBindVertexArray, glBindVertexArray); \
FUNC(glBindVertexArray, glBindVertexArrayOES); \
FUNC(glDeleteVertexArrays, glDeleteVertexArrays); \
FUNC(glDeleteVertexArrays, glDeleteVertexArraysOES); \
FUNC(glVertexAttrib1d, glVertexAttrib1d); \
FUNC(glVertexAttrib1d, glVertexAttrib1dARB); \
FUNC(glVertexAttrib1dv, glVertexAttrib1dv); \
FUNC(glVertexAttrib1dv, glVertexAttrib1dvARB); \
FUNC(glVertexAttrib1f, glVertexAttrib1f); \
FUNC(glVertexAttrib1f, glVertexAttrib1fARB); \
FUNC(glVertexAttrib1fv, glVertexAttrib1fv); \
FUNC(glVertexAttrib1fv, glVertexAttrib1fvARB); \
FUNC(glVertexAttrib1s, glVertexAttrib1s); \
FUNC(glVertexAttrib1s, glVertexAttrib1sARB); \
FUNC(glVertexAttrib1sv, glVertexAttrib1sv); \
FUNC(glVertexAttrib1sv, glVertexAttrib1svARB); \
FUNC(glVertexAttrib2d, glVertexAttrib2d); \
FUNC(glVertexAttrib2d, glVertexAttrib2dARB); \
FUNC(glVertexAttrib2dv, glVertexAttrib2dv); \
FUNC(glVertexAttrib2dv, glVertexAttrib2dvARB); \
FUNC(glVertexAttrib2f, glVertexAttrib2f); \
FUNC(glVertexAttrib2f, glVertexAttrib2fARB); \
FUNC(glVertexAttrib2fv, glVertexAttrib2fv); \
FUNC(glVertexAttrib2fv, glVertexAttrib2fvARB); \
FUNC(glVertexAttrib2s, glVertexAttrib2s); \
FUNC(glVertexAttrib2s, glVertexAttrib2sARB); \
FUNC(glVertexAttrib2sv, glVertexAttrib2sv); \
FUNC(glVertexAttrib2sv, glVertexAttrib2svARB); \
FUNC(glVertexAttrib3d, glVertexAttrib3d); \
FUNC(glVertexAttrib3d, glVertexAttrib3dARB); \
FUNC(glVertexAttrib3dv, glVertexAttrib3dv); \
FUNC(glVertexAttrib3dv, glVertexAttrib3dvARB); \
FUNC(glVertexAttrib3f, glVertexAttrib3f); \
FUNC(glVertexAttrib3f, glVertexAttrib3fARB); \
FUNC(glVertexAttrib3fv, glVertexAttrib3fv); \
FUNC(glVertexAttrib3fv, glVertexAttrib3fvARB); \
FUNC(glVertexAttrib3s, glVertexAttrib3s); \
FUNC(glVertexAttrib3s, glVertexAttrib3sARB); \
FUNC(glVertexAttrib3sv, glVertexAttrib3sv); \
FUNC(glVertexAttrib3sv, glVertexAttrib3svARB); \
FUNC(glVertexAttrib4Nbv, glVertexAttrib4Nbv); \
FUNC(glVertexAttrib4Nbv, glVertexAttrib4NbvARB); \
FUNC(glVertexAttrib4Niv, glVertexAttrib4Niv); \
FUNC(glVertexAttrib4Niv, glVertexAttrib4NivARB); \
FUNC(glVertexAttrib4Nsv, glVertexAttrib4Nsv); \
FUNC(glVertexAttrib4Nsv, glVertexAttrib4NsvARB); \
FUNC(glVertexAttrib4Nub, glVertexAttrib4Nub); \
FUNC(glVertexAttrib4Nubv, glVertexAttrib4Nubv); \
FUNC(glVertexAttrib4Nubv, glVertexAttrib4NubvARB); \
FUNC(glVertexAttrib4Nuiv, glVertexAttrib4Nuiv); \
FUNC(glVertexAttrib4Nuiv, glVertexAttrib4NuivARB); \
FUNC(glVertexAttrib4Nusv, glVertexAttrib4Nusv); \
FUNC(glVertexAttrib4Nusv, glVertexAttrib4NusvARB); \
FUNC(glVertexAttrib4bv, glVertexAttrib4bv); \
FUNC(glVertexAttrib4bv, glVertexAttrib4bvARB); \
FUNC(glVertexAttrib4d, glVertexAttrib4d); \
FUNC(glVertexAttrib4d, glVertexAttrib4dARB); \
FUNC(glVertexAttrib4dv, glVertexAttrib4dv); \
FUNC(glVertexAttrib4dv, glVertexAttrib4dvARB); \
FUNC(glVertexAttrib4f, glVertexAttrib4f); \
FUNC(glVertexAttrib4f, glVertexAttrib4fARB); \
FUNC(glVertexAttrib4fv, glVertexAttrib4fv); \
FUNC(glVertexAttrib4fv, glVertexAttrib4fvARB); \
FUNC(glVertexAttrib4iv, glVertexAttrib4iv); \
FUNC(glVertexAttrib4iv, glVertexAttrib4ivARB); \
FUNC(glVertexAttrib4s, glVertexAttrib4s); \
FUNC(glVertexAttrib4s, glVertexAttrib4sARB); \
FUNC(glVertexAttrib4sv, glVertexAttrib4sv); \
FUNC(glVertexAttrib4sv, glVertexAttrib4svARB); \
FUNC(glVertexAttrib4ubv, glVertexAttrib4ubv); \
FUNC(glVertexAttrib4ubv, glVertexAttrib4ubvARB); \
FUNC(glVertexAttrib4uiv, glVertexAttrib4uiv); \
FUNC(glVertexAttrib4uiv, glVertexAttrib4uivARB); \
FUNC(glVertexAttrib4usv, glVertexAttrib4usv); \
FUNC(glVertexAttrib4usv, glVertexAttrib4usvARB); \
FUNC(glVertexAttribI1i, glVertexAttribI1i); \
FUNC(glVertexAttribI1i, glVertexAttribI1iEXT); \
FUNC(glVertexAttribI1iv, glVertexAttribI1iv); \
FUNC(glVertexAttribI1iv, glVertexAttribI1ivEXT); \
FUNC(glVertexAttribI1ui, glVertexAttribI1ui); \
FUNC(glVertexAttribI1ui, glVertexAttribI1uiEXT); \
FUNC(glVertexAttribI1uiv, glVertexAttribI1uiv); \
FUNC(glVertexAttribI1uiv, glVertexAttribI1uivEXT); \
FUNC(glVertexAttribI2i, glVertexAttribI2i); \
FUNC(glVertexAttribI2i, glVertexAttribI2iEXT); \
FUNC(glVertexAttribI2iv, glVertexAttribI2iv); \
FUNC(glVertexAttribI2iv, glVertexAttribI2ivEXT); \
FUNC(glVertexAttribI2ui, glVertexAttribI2ui); \
FUNC(glVertexAttribI2ui, glVertexAttribI2uiEXT); \
FUNC(glVertexAttribI2uiv, glVertexAttribI2uiv); \
FUNC(glVertexAttribI2uiv, glVertexAttribI2uivEXT); \
FUNC(glVertexAttribI3i, glVertexAttribI3i); \
FUNC(glVertexAttribI3i, glVertexAttribI3iEXT); \
FUNC(glVertexAttribI3iv, glVertexAttribI3iv); \
FUNC(glVertexAttribI3iv, glVertexAttribI3ivEXT); \
FUNC(glVertexAttribI3ui, glVertexAttribI3ui); \
FUNC(glVertexAttribI3ui, glVertexAttribI3uiEXT); \
FUNC(glVertexAttribI3uiv, glVertexAttribI3uiv); \
FUNC(glVertexAttribI3uiv, glVertexAttribI3uivEXT); \
FUNC(glVertexAttribI4bv, glVertexAttribI4bv); \
FUNC(glVertexAttribI4bv, glVertexAttribI4bvEXT); \
FUNC(glVertexAttribI4i, glVertexAttribI4i); \
FUNC(glVertexAttribI4i, glVertexAttribI4iEXT); \
FUNC(glVertexAttribI4iv, glVertexAttribI4iv); \
FUNC(glVertexAttribI4iv, glVertexAttribI4ivEXT); \
FUNC(glVertexAttribI4sv, glVertexAttribI4sv); \
FUNC(glVertexAttribI4sv, glVertexAttribI4svEXT); \
FUNC(glVertexAttribI4ubv, glVertexAttribI4ubv); \
FUNC(glVertexAttribI4ubv, glVertexAttribI4ubvEXT); \
FUNC(glVertexAttribI4ui, glVertexAttribI4ui); \
FUNC(glVertexAttribI4ui, glVertexAttribI4uiEXT); \
FUNC(glVertexAttribI4uiv, glVertexAttribI4uiv); \
FUNC(glVertexAttribI4uiv, glVertexAttribI4uivEXT); \
FUNC(glVertexAttribI4usv, glVertexAttribI4usv); \
FUNC(glVertexAttribI4usv, glVertexAttribI4usvEXT); \
FUNC(glVertexAttribL1d, glVertexAttribL1d); \
FUNC(glVertexAttribL1d, glVertexAttribL1dEXT); \
FUNC(glVertexAttribL1dv, glVertexAttribL1dv); \
FUNC(glVertexAttribL1dv, glVertexAttribL1dvEXT); \
FUNC(glVertexAttribL2d, glVertexAttribL2d); \
FUNC(glVertexAttribL2d, glVertexAttribL2dEXT); \
FUNC(glVertexAttribL2dv, glVertexAttribL2dv); \
FUNC(glVertexAttribL2dv, glVertexAttribL2dvEXT); \
FUNC(glVertexAttribL3d, glVertexAttribL3d); \
FUNC(glVertexAttribL3d, glVertexAttribL3dEXT); \
FUNC(glVertexAttribL3dv, glVertexAttribL3dv); \
FUNC(glVertexAttribL3dv, glVertexAttribL3dvEXT); \
FUNC(glVertexAttribL4d, glVertexAttribL4d); \
FUNC(glVertexAttribL4d, glVertexAttribL4dEXT); \
FUNC(glVertexAttribL4dv, glVertexAttribL4dv); \
FUNC(glVertexAttribL4dv, glVertexAttribL4dvEXT); \
FUNC(glVertexAttribP1ui, glVertexAttribP1ui); \
FUNC(glVertexAttribP1uiv, glVertexAttribP1uiv); \
FUNC(glVertexAttribP2ui, glVertexAttribP2ui); \
FUNC(glVertexAttribP2uiv, glVertexAttribP2uiv); \
FUNC(glVertexAttribP3ui, glVertexAttribP3ui); \
FUNC(glVertexAttribP3uiv, glVertexAttribP3uiv); \
FUNC(glVertexAttribP4ui, glVertexAttribP4ui); \
FUNC(glVertexAttribP4uiv, glVertexAttribP4uiv); \
FUNC(glVertexAttribPointer, glVertexAttribPointer); \
FUNC(glVertexAttribPointer, glVertexAttribPointerARB); \
FUNC(glVertexAttribIPointer, glVertexAttribIPointer); \
FUNC(glVertexAttribIPointer, glVertexAttribIPointerEXT); \
FUNC(glVertexAttribLPointer, glVertexAttribLPointer); \
FUNC(glVertexAttribLPointer, glVertexAttribLPointerEXT); \
FUNC(glVertexAttribBinding, glVertexAttribBinding); \
FUNC(glVertexAttribFormat, glVertexAttribFormat); \
FUNC(glVertexAttribIFormat, glVertexAttribIFormat); \
FUNC(glVertexAttribLFormat, glVertexAttribLFormat); \
FUNC(glVertexAttribDivisor, glVertexAttribDivisor); \
FUNC(glVertexAttribDivisor, glVertexAttribDivisorARB); \
FUNC(glBindAttribLocation, glBindAttribLocation); \
FUNC(glBindFragDataLocation, glBindFragDataLocation); \
FUNC(glBindFragDataLocation, glBindFragDataLocationEXT); \
FUNC(glBindFragDataLocationIndexed, glBindFragDataLocationIndexed); \
FUNC(glEnableVertexAttribArray, glEnableVertexAttribArray); \
FUNC(glEnableVertexAttribArray, glEnableVertexAttribArrayARB); \
FUNC(glDisableVertexAttribArray, glDisableVertexAttribArray); \
FUNC(glDisableVertexAttribArray, glDisableVertexAttribArrayARB); \
FUNC(glBindVertexBuffer, glBindVertexBuffer); \
FUNC(glBindVertexBuffers, glBindVertexBuffers); \
FUNC(glVertexBindingDivisor, glVertexBindingDivisor); \
FUNC(glBindImageTexture, glBindImageTexture); \
FUNC(glBindImageTexture, glBindImageTextureEXT); \
FUNC(glBindImageTextures, glBindImageTextures); \
FUNC(glGenSamplers, glGenSamplers); \
FUNC(glBindSampler, glBindSampler); \
FUNC(glBindSamplers, glBindSamplers); \
FUNC(glBindTextures, glBindTextures); \
FUNC(glDeleteSamplers, glDeleteSamplers); \
FUNC(glSamplerParameteri, glSamplerParameteri); \
FUNC(glSamplerParameterf, glSamplerParameterf); \
FUNC(glSamplerParameteriv, glSamplerParameteriv); \
FUNC(glSamplerParameterfv, glSamplerParameterfv); \
FUNC(glSamplerParameterIiv, glSamplerParameterIiv); \
FUNC(glSamplerParameterIiv, glSamplerParameterIivEXT); \
FUNC(glSamplerParameterIiv, glSamplerParameterIivOES); \
FUNC(glSamplerParameterIuiv, glSamplerParameterIuiv); \
FUNC(glSamplerParameterIuiv, glSamplerParameterIuivEXT); \
FUNC(glSamplerParameterIuiv, glSamplerParameterIuivOES); \
FUNC(glPatchParameteri, glPatchParameteri); \
FUNC(glPatchParameteri, glPatchParameteriEXT); \
FUNC(glPatchParameteri, glPatchParameteriOES); \
FUNC(glPatchParameterfv, glPatchParameterfv); \
FUNC(glPointParameterf, glPointParameterf); \
FUNC(glPointParameterf, glPointParameterfARB); \
FUNC(glPointParameterf, glPointParameterfEXT); \
FUNC(glPointParameterfv, glPointParameterfv); \
FUNC(glPointParameterfv, glPointParameterfvARB); \
FUNC(glPointParameterfv, glPointParameterfvEXT); \
FUNC(glPointParameteri, glPointParameteri); \
FUNC(glPointParameteriv, glPointParameteriv); \
FUNC(glDispatchCompute, glDispatchCompute); \
FUNC(glDispatchComputeIndirect, glDispatchComputeIndirect); \
FUNC(glMemoryBarrier, glMemoryBarrier); \
FUNC(glMemoryBarrier, glMemoryBarrierEXT); \
FUNC(glMemoryBarrierByRegion, glMemoryBarrierByRegion); \
FUNC(glTextureBarrier, glTextureBarrier); \
FUNC(glClearDepthf, glClearDepthf); \
FUNC(glClearBufferfv, glClearBufferfv); \
FUNC(glClearBufferiv, glClearBufferiv); \
FUNC(glClearBufferuiv, glClearBufferuiv); \
FUNC(glClearBufferfi, glClearBufferfi); \
FUNC(glClearBufferData, glClearBufferData); \
FUNC(glClearBufferSubData, glClearBufferSubData); \
FUNC(glClearTexImage, glClearTexImage); \
FUNC(glClearTexSubImage, glClearTexSubImage); \
FUNC(glInvalidateBufferData, glInvalidateBufferData); \
FUNC(glInvalidateBufferSubData, glInvalidateBufferSubData); \
FUNC(glInvalidateFramebuffer, glInvalidateFramebuffer); \
FUNC(glInvalidateSubFramebuffer, glInvalidateSubFramebuffer); \
FUNC(glInvalidateTexImage, glInvalidateTexImage); \
FUNC(glInvalidateTexSubImage, glInvalidateTexSubImage); \
FUNC(glScissorArrayv, glScissorArrayv); \
FUNC(glScissorArrayv, glScissorArrayvOES); \
FUNC(glScissorArrayv, glScissorArrayvNV); \
FUNC(glScissorIndexed, glScissorIndexed); \
FUNC(glScissorIndexed, glScissorIndexedOES); \
FUNC(glScissorIndexed, glScissorIndexedNV); \
FUNC(glScissorIndexedv, glScissorIndexedv); \
FUNC(glScissorIndexedv, glScissorIndexedvOES); \
FUNC(glScissorIndexedv, glScissorIndexedvNV); \
FUNC(glViewportIndexedf, glViewportIndexedf); \
FUNC(glViewportIndexedf, glViewportIndexedfOES); \
FUNC(glViewportIndexedf, glViewportIndexedfNV); \
FUNC(glViewportIndexedfv, glViewportIndexedfv); \
FUNC(glViewportIndexedfv, glViewportIndexedfvOES); \
FUNC(glViewportIndexedfv, glViewportIndexedfvNV); \
FUNC(glViewportArrayv, glViewportArrayv); \
FUNC(glViewportArrayv, glViewportArrayvOES); \
FUNC(glViewportArrayv, glViewportArrayvNV); \
FUNC(glUniformBlockBinding, glUniformBlockBinding); \
FUNC(glShaderStorageBlockBinding, glShaderStorageBlockBinding); \
FUNC(glUniformSubroutinesuiv, glUniformSubroutinesuiv); \
FUNC(glUniform1f, glUniform1f); \
FUNC(glUniform1f, glUniform1fARB); \
FUNC(glUniform1i, glUniform1i); \
FUNC(glUniform1i, glUniform1iARB); \
FUNC(glUniform1ui, glUniform1ui); \
FUNC(glUniform1ui, glUniform1uiEXT); \
FUNC(glUniform1d, glUniform1d); \
FUNC(glUniform2f, glUniform2f); \
FUNC(glUniform2f, glUniform2fARB); \
FUNC(glUniform2i, glUniform2i); \
FUNC(glUniform2i, glUniform2iARB); \
FUNC(glUniform2ui, glUniform2ui); \
FUNC(glUniform2ui, glUniform2uiEXT); \
FUNC(glUniform2d, glUniform2d); \
FUNC(glUniform3f, glUniform3f); \
FUNC(glUniform3f, glUniform3fARB); \
FUNC(glUniform3i, glUniform3i); \
FUNC(glUniform3i, glUniform3iARB); \
FUNC(glUniform3ui, glUniform3ui); \
FUNC(glUniform3ui, glUniform3uiEXT); \
FUNC(glUniform3d, glUniform3d); \
FUNC(glUniform4f, glUniform4f); \
FUNC(glUniform4f, glUniform4fARB); \
FUNC(glUniform4i, glUniform4i); \
FUNC(glUniform4i, glUniform4iARB); \
FUNC(glUniform4ui, glUniform4ui); \
FUNC(glUniform4ui, glUniform4uiEXT); \
FUNC(glUniform4d, glUniform4d); \
FUNC(glUniform1fv, glUniform1fv); \
FUNC(glUniform1fv, glUniform1fvARB); \
FUNC(glUniform1iv, glUniform1iv); \
FUNC(glUniform1iv, glUniform1ivARB); \
FUNC(glUniform1uiv, glUniform1uiv); \
FUNC(glUniform1uiv, glUniform1uivEXT); \
FUNC(glUniform1dv, glUniform1dv); \
FUNC(glUniform2fv, glUniform2fv); \
FUNC(glUniform2fv, glUniform2fvARB); \
FUNC(glUniform2iv, glUniform2iv); \
FUNC(glUniform2iv, glUniform2ivARB); \
FUNC(glUniform2uiv, glUniform2uiv); \
FUNC(glUniform2uiv, glUniform2uivEXT); \
FUNC(glUniform2dv, glUniform2dv); \
FUNC(glUniform3fv, glUniform3fv); \
FUNC(glUniform3fv, glUniform3fvARB); \
FUNC(glUniform3iv, glUniform3iv); \
FUNC(glUniform3iv, glUniform3ivARB); \
FUNC(glUniform3uiv, glUniform3uiv); \
FUNC(glUniform3uiv, glUniform3uivEXT); \
FUNC(glUniform3dv, glUniform3dv); \
FUNC(glUniform4fv, glUniform4fv); \
FUNC(glUniform4fv, glUniform4fvARB); \
FUNC(glUniform4iv, glUniform4iv); \
FUNC(glUniform4iv, glUniform4ivARB); \
FUNC(glUniform4uiv, glUniform4uiv); \
FUNC(glUniform4uiv, glUniform4uivEXT); \
FUNC(glUniform4dv, glUniform4dv); \
FUNC(glUniformMatrix2fv, glUniformMatrix2fv); \
FUNC(glUniformMatrix2fv, glUniformMatrix2fvARB); \
FUNC(glUniformMatrix2x3fv, glUniformMatrix2x3fv); \
FUNC(glUniformMatrix2x4fv, glUniformMatrix2x4fv); \
FUNC(glUniformMatrix3fv, glUniformMatrix3fv); \
FUNC(glUniformMatrix3fv, glUniformMatrix3fvARB); \
FUNC(glUniformMatrix3x2fv, glUniformMatrix3x2fv); \
FUNC(glUniformMatrix3x4fv, glUniformMatrix3x4fv); \
FUNC(glUniformMatrix4fv, glUniformMatrix4fv); \
FUNC(glUniformMatrix4fv, glUniformMatrix4fvARB); \
FUNC(glUniformMatrix4x2fv, glUniformMatrix4x2fv); \
FUNC(glUniformMatrix4x3fv, glUniformMatrix4x3fv); \
FUNC(glUniformMatrix2dv, glUniformMatrix2dv); \
FUNC(glUniformMatrix2x3dv, glUniformMatrix2x3dv); \
FUNC(glUniformMatrix2x4dv, glUniformMatrix2x4dv); \
FUNC(glUniformMatrix3dv, glUniformMatrix3dv); \
FUNC(glUniformMatrix3x2dv, glUniformMatrix3x2dv); \
FUNC(glUniformMatrix3x4dv, glUniformMatrix3x4dv); \
FUNC(glUniformMatrix4dv, glUniformMatrix4dv); \
FUNC(glUniformMatrix4x2dv, glUniformMatrix4x2dv); \
FUNC(glUniformMatrix4x3dv, glUniformMatrix4x3dv); \
FUNC(glProgramUniform1f, glProgramUniform1f); \
FUNC(glProgramUniform1f, glProgramUniform1fEXT); \
FUNC(glProgramUniform1i, glProgramUniform1i); \
FUNC(glProgramUniform1i, glProgramUniform1iEXT); \
FUNC(glProgramUniform1ui, glProgramUniform1ui); \
FUNC(glProgramUniform1ui, glProgramUniform1uiEXT); \
FUNC(glProgramUniform1d, glProgramUniform1d); \
FUNC(glProgramUniform1d, glProgramUniform1dEXT); \
FUNC(glProgramUniform2f, glProgramUniform2f); \
FUNC(glProgramUniform2f, glProgramUniform2fEXT); \
FUNC(glProgramUniform2i, glProgramUniform2i); \
FUNC(glProgramUniform2i, glProgramUniform2iEXT); \
FUNC(glProgramUniform2ui, glProgramUniform2ui); \
FUNC(glProgramUniform2ui, glProgramUniform2uiEXT); \
FUNC(glProgramUniform2d, glProgramUniform2d); \
FUNC(glProgramUniform2d, glProgramUniform2dEXT); \
FUNC(glProgramUniform3f, glProgramUniform3f); \
FUNC(glProgramUniform3f, glProgramUniform3fEXT); \
FUNC(glProgramUniform3i, glProgramUniform3i); \
FUNC(glProgramUniform3i, glProgramUniform3iEXT); \
FUNC(glProgramUniform3ui, glProgramUniform3ui); \
FUNC(glProgramUniform3ui, glProgramUniform3uiEXT); \
FUNC(glProgramUniform3d, glProgramUniform3d); \
FUNC(glProgramUniform3d, glProgramUniform3dEXT); \
FUNC(glProgramUniform4f, glProgramUniform4f); \
FUNC(glProgramUniform4f, glProgramUniform4fEXT); \
FUNC(glProgramUniform4i, glProgramUniform4i); \
FUNC(glProgramUniform4i, glProgramUniform4iEXT); \
FUNC(glProgramUniform4ui, glProgramUniform4ui); \
FUNC(glProgramUniform4ui, glProgramUniform4uiEXT); \
FUNC(glProgramUniform4d, glProgramUniform4d); \
FUNC(glProgramUniform4d, glProgramUniform4dEXT); \
FUNC(glProgramUniform1fv, glProgramUniform1fv); \
FUNC(glProgramUniform1fv, glProgramUniform1fvEXT); \
FUNC(glProgramUniform1iv, glProgramUniform1iv); \
FUNC(glProgramUniform1iv, glProgramUniform1ivEXT); \
FUNC(glProgramUniform1uiv, glProgramUniform1uiv); \
FUNC(glProgramUniform1uiv, glProgramUniform1uivEXT); \
FUNC(glProgramUniform1dv, glProgramUniform1dv); \
FUNC(glProgramUniform1dv, glProgramUniform1dvEXT); \
FUNC(glProgramUniform2fv, glProgramUniform2fv); \
FUNC(glProgramUniform2fv, glProgramUniform2fvEXT); \
FUNC(glProgramUniform2iv, glProgramUniform2iv); \
FUNC(glProgramUniform2iv, glProgramUniform2ivEXT); \
FUNC(glProgramUniform2uiv, glProgramUniform2uiv); \
FUNC(glProgramUniform2uiv, glProgramUniform2uivEXT); \
FUNC(glProgramUniform2dv, glProgramUniform2dv); \
FUNC(glProgramUniform2dv, glProgramUniform2dvEXT); \
FUNC(glProgramUniform3fv, glProgramUniform3fv); \
FUNC(glProgramUniform3fv, glProgramUniform3fvEXT); \
FUNC(glProgramUniform3iv, glProgramUniform3iv); \
FUNC(glProgramUniform3iv, glProgramUniform3ivEXT); \
FUNC(glProgramUniform3uiv, glProgramUniform3uiv); \
FUNC(glProgramUniform3uiv, glProgramUniform3uivEXT); \
FUNC(glProgramUniform3dv, glProgramUniform3dv); \
FUNC(glProgramUniform3dv, glProgramUniform3dvEXT); \
FUNC(glProgramUniform4fv, glProgramUniform4fv); \
FUNC(glProgramUniform4fv, glProgramUniform4fvEXT); \
FUNC(glProgramUniform4iv, glProgramUniform4iv); \
FUNC(glProgramUniform4iv, glProgramUniform4ivEXT); \
FUNC(glProgramUniform4uiv, glProgramUniform4uiv); \
FUNC(glProgramUniform4uiv, glProgramUniform4uivEXT); \
FUNC(glProgramUniform4dv, glProgramUniform4dv); \
FUNC(glProgramUniform4dv, glProgramUniform4dvEXT); \
FUNC(glProgramUniformMatrix2fv, glProgramUniformMatrix2fv); \
FUNC(glProgramUniformMatrix2fv, glProgramUniformMatrix2fvEXT); \
FUNC(glProgramUniformMatrix2x3fv, glProgramUniformMatrix2x3fv); \
FUNC(glProgramUniformMatrix2x3fv, glProgramUniformMatrix2x3fvEXT); \
FUNC(glProgramUniformMatrix2x4fv, glProgramUniformMatrix2x4fv); \
FUNC(glProgramUniformMatrix2x4fv, glProgramUniformMatrix2x4fvEXT); \
FUNC(glProgramUniformMatrix3fv, glProgramUniformMatrix3fv); \
FUNC(glProgramUniformMatrix3fv, glProgramUniformMatrix3fvEXT); \
FUNC(glProgramUniformMatrix3x2fv, glProgramUniformMatrix3x2fv); \
FUNC(glProgramUniformMatrix3x2fv, glProgramUniformMatrix3x2fvEXT); \
FUNC(glProgramUniformMatrix3x4fv, glProgramUniformMatrix3x4fv); \
FUNC(glProgramUniformMatrix3x4fv, glProgramUniformMatrix3x4fvEXT); \
FUNC(glProgramUniformMatrix4fv, glProgramUniformMatrix4fv); \
FUNC(glProgramUniformMatrix4fv, glProgramUniformMatrix4fvEXT); \
FUNC(glProgramUniformMatrix4x2fv, glProgramUniformMatrix4x2fv); \
FUNC(glProgramUniformMatrix4x2fv, glProgramUniformMatrix4x2fvEXT); \
FUNC(glProgramUniformMatrix4x3fv, glProgramUniformMatrix4x3fv); \
FUNC(glProgramUniformMatrix4x3fv, glProgramUniformMatrix4x3fvEXT); \
FUNC(glProgramUniformMatrix2dv, glProgramUniformMatrix2dv); \
FUNC(glProgramUniformMatrix2dv, glProgramUniformMatrix2dvEXT); \
FUNC(glProgramUniformMatrix2x3dv, glProgramUniformMatrix2x3dv); \
FUNC(glProgramUniformMatrix2x3dv, glProgramUniformMatrix2x3dvEXT); \
FUNC(glProgramUniformMatrix2x4dv, glProgramUniformMatrix2x4dv); \
FUNC(glProgramUniformMatrix2x4dv, glProgramUniformMatrix2x4dvEXT); \
FUNC(glProgramUniformMatrix3dv, glProgramUniformMatrix3dv); \
FUNC(glProgramUniformMatrix3dv, glProgramUniformMatrix3dvEXT); \
FUNC(glProgramUniformMatrix3x2dv, glProgramUniformMatrix3x2dv); \
FUNC(glProgramUniformMatrix3x2dv, glProgramUniformMatrix3x2dvEXT); \
FUNC(glProgramUniformMatrix3x4dv, glProgramUniformMatrix3x4dv); \
FUNC(glProgramUniformMatrix3x4dv, glProgramUniformMatrix3x4dvEXT); \
FUNC(glProgramUniformMatrix4dv, glProgramUniformMatrix4dv); \
FUNC(glProgramUniformMatrix4dv, glProgramUniformMatrix4dvEXT); \
FUNC(glProgramUniformMatrix4x2dv, glProgramUniformMatrix4x2dv); \
FUNC(glProgramUniformMatrix4x2dv, glProgramUniformMatrix4x2dvEXT); \
FUNC(glProgramUniformMatrix4x3dv, glProgramUniformMatrix4x3dv); \
FUNC(glProgramUniformMatrix4x3dv, glProgramUniformMatrix4x3dvEXT); \
FUNC(glDrawRangeElements, glDrawRangeElements); \
FUNC(glDrawRangeElements, glDrawRangeElementsEXT); \
FUNC(glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertex); \
FUNC(glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertexEXT); \
FUNC(glDrawRangeElementsBaseVertex, glDrawRangeElementsBaseVertexOES); \
FUNC(glDrawArraysInstancedBaseInstance, glDrawArraysInstancedBaseInstance); \
FUNC(glDrawArraysInstancedBaseInstance, glDrawArraysInstancedBaseInstanceEXT); \
FUNC(glDrawArraysInstanced, glDrawArraysInstanced); \
FUNC(glDrawArraysInstanced, glDrawArraysInstancedARB); \
FUNC(glDrawArraysInstanced, glDrawArraysInstancedEXT); \
FUNC(glDrawElementsInstanced, glDrawElementsInstanced); \
FUNC(glDrawElementsInstanced, glDrawElementsInstancedARB); \
FUNC(glDrawElementsInstanced, glDrawElementsInstancedEXT); \
FUNC(glDrawElementsInstancedBaseInstance, glDrawElementsInstancedBaseInstance); \
FUNC(glDrawElementsInstancedBaseInstance, glDrawElementsInstancedBaseInstanceEXT); \
FUNC(glDrawElementsBaseVertex, glDrawElementsBaseVertex); \
FUNC(glDrawElementsBaseVertex, glDrawElementsBaseVertexEXT); \
FUNC(glDrawElementsBaseVertex, glDrawElementsBaseVertexOES); \
FUNC(glDrawElementsInstancedBaseVertex, glDrawElementsInstancedBaseVertex); \
FUNC(glDrawElementsInstancedBaseVertex, glDrawElementsInstancedBaseVertexEXT); \
FUNC(glDrawElementsInstancedBaseVertex, glDrawElementsInstancedBaseVertexOES); \
FUNC(glDrawElementsInstancedBaseVertexBaseInstance, glDrawElementsInstancedBaseVertexBaseInstance); \
FUNC(glDrawElementsInstancedBaseVertexBaseInstance, glDrawElementsInstancedBaseVertexBaseInstanceEXT); \
FUNC(glMultiDrawArrays, glMultiDrawArrays); \
FUNC(glMultiDrawArrays, glMultiDrawArraysEXT); \
FUNC(glMultiDrawElements, glMultiDrawElements); \
FUNC(glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertex); \
FUNC(glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertexEXT); \
FUNC(glMultiDrawElementsBaseVertex, glMultiDrawElementsBaseVertexOES); \
FUNC(glMultiDrawArraysIndirect, glMultiDrawArraysIndirect); \
FUNC(glMultiDrawElementsIndirect, glMultiDrawElementsIndirect); \
FUNC(glDrawArraysIndirect, glDrawArraysIndirect); \
FUNC(glDrawElementsIndirect, glDrawElementsIndirect); \
FUNC(glBlitFramebuffer, glBlitFramebuffer); \
FUNC(glBlitFramebuffer, glBlitFramebufferEXT); \
FUNC(glPrimitiveBoundingBox, glPrimitiveBoundingBox); \
FUNC(glPrimitiveBoundingBox, glPrimitiveBoundingBoxEXT); \
FUNC(glPrimitiveBoundingBox, glPrimitiveBoundingBoxOES); \
FUNC(glBlendBarrier, glBlendBarrier); \
FUNC(glFramebufferTexture2DMultisampleEXT, glFramebufferTexture2DMultisampleEXT); \
FUNC(glDiscardFramebufferEXT, glDiscardFramebufferEXT); \
FUNC(glDepthRangeArrayfvOES, glDepthRangeArrayfvOES); \
FUNC(glDepthRangeArrayfvOES, glDepthRangeArrayfvNV); \
FUNC(glDepthRangeIndexedfOES, glDepthRangeIndexedfOES); \
FUNC(glDepthRangeIndexedfOES, glDepthRangeIndexedfNV); \
FUNC(glNamedStringARB, glNamedStringARB); \
FUNC(glDeleteNamedStringARB, glDeleteNamedStringARB); \
FUNC(glCompileShaderIncludeARB, glCompileShaderIncludeARB); \
FUNC(glIsNamedStringARB, glIsNamedStringARB); \
FUNC(glGetNamedStringARB, glGetNamedStringARB); \
FUNC(glGetNamedStringivARB, glGetNamedStringivARB); \
FUNC(glDispatchComputeGroupSizeARB, glDispatchComputeGroupSizeARB); \
FUNC(glMultiDrawArraysIndirectCount, glMultiDrawArraysIndirectCount); \
FUNC(glMultiDrawArraysIndirectCount, glMultiDrawArraysIndirectCountARB); \
FUNC(glMultiDrawElementsIndirectCount, glMultiDrawElementsIndirectCount); \
FUNC(glMultiDrawElementsIndirectCount, glMultiDrawElementsIndirectCountARB); \
FUNC(glRasterSamplesEXT, glRasterSamplesEXT); \
FUNC(glDepthBoundsEXT, glDepthBoundsEXT); \
FUNC(glPolygonOffsetClamp, glPolygonOffsetClamp); \
FUNC(glPolygonOffsetClamp, glPolygonOffsetClampEXT); \
FUNC(glInsertEventMarkerEXT, glInsertEventMarkerEXT); \
FUNC(glPushGroupMarkerEXT, glPushGroupMarkerEXT); \
FUNC(glPopGroupMarkerEXT, glPopGroupMarkerEXT); \
FUNC(glFrameTerminatorGREMEDY, glFrameTerminatorGREMEDY); \
FUNC(glStringMarkerGREMEDY, glStringMarkerGREMEDY); \
FUNC(glFramebufferTextureMultiviewOVR, glFramebufferTextureMultiviewOVR); \
FUNC(glFramebufferTextureMultisampleMultiviewOVR, glFramebufferTextureMultisampleMultiviewOVR); \
FUNC(glMaxShaderCompilerThreadsKHR, glMaxShaderCompilerThreadsKHR); \
FUNC(glMaxShaderCompilerThreadsKHR, glMaxShaderCompilerThreadsARB); \
FUNC(glSpecializeShader, glSpecializeShader); \
FUNC(glSpecializeShader, glSpecializeShaderARB); \
FUNC(glGetUnsignedBytevEXT, glGetUnsignedBytevEXT); \
FUNC(glGetUnsignedBytei_vEXT, glGetUnsignedBytei_vEXT); \
FUNC(glDeleteMemoryObjectsEXT, glDeleteMemoryObjectsEXT); \
FUNC(glIsMemoryObjectEXT, glIsMemoryObjectEXT); \
FUNC(glCreateMemoryObjectsEXT, glCreateMemoryObjectsEXT); \
FUNC(glMemoryObjectParameterivEXT, glMemoryObjectParameterivEXT); \
FUNC(glGetMemoryObjectParameterivEXT, glGetMemoryObjectParameterivEXT); \
FUNC(glTexStorageMem2DEXT, glTexStorageMem2DEXT); \
FUNC(glTexStorageMem2DMultisampleEXT, glTexStorageMem2DMultisampleEXT); \
FUNC(glTexStorageMem3DEXT, glTexStorageMem3DEXT); \
FUNC(glTexStorageMem3DMultisampleEXT, glTexStorageMem3DMultisampleEXT); \
FUNC(glBufferStorageMemEXT, glBufferStorageMemEXT); \
FUNC(glTextureStorageMem2DEXT, glTextureStorageMem2DEXT); \
FUNC(glTextureStorageMem2DMultisampleEXT, glTextureStorageMem2DMultisampleEXT); \
FUNC(glTextureStorageMem3DEXT, glTextureStorageMem3DEXT); \
FUNC(glTextureStorageMem3DMultisampleEXT, glTextureStorageMem3DMultisampleEXT); \
FUNC(glNamedBufferStorageMemEXT, glNamedBufferStorageMemEXT); \
FUNC(glTexStorageMem1DEXT, glTexStorageMem1DEXT); \
FUNC(glTextureStorageMem1DEXT, glTextureStorageMem1DEXT); \
FUNC(glGenSemaphoresEXT, glGenSemaphoresEXT); \
FUNC(glDeleteSemaphoresEXT, glDeleteSemaphoresEXT); \
FUNC(glIsSemaphoreEXT, glIsSemaphoreEXT); \
FUNC(glSemaphoreParameterui64vEXT, glSemaphoreParameterui64vEXT); \
FUNC(glGetSemaphoreParameterui64vEXT, glGetSemaphoreParameterui64vEXT); \
FUNC(glWaitSemaphoreEXT, glWaitSemaphoreEXT); \
FUNC(glSignalSemaphoreEXT, glSignalSemaphoreEXT); \
FUNC(glImportMemoryFdEXT, glImportMemoryFdEXT); \
FUNC(glImportSemaphoreFdEXT, glImportSemaphoreFdEXT); \
FUNC(glImportMemoryWin32HandleEXT, glImportMemoryWin32HandleEXT); \
FUNC(glImportMemoryWin32NameEXT, glImportMemoryWin32NameEXT); \
FUNC(glImportSemaphoreWin32HandleEXT, glImportSemaphoreWin32HandleEXT); \
FUNC(glImportSemaphoreWin32NameEXT, glImportSemaphoreWin32NameEXT); \
FUNC(glAcquireKeyedMutexWin32EXT, glAcquireKeyedMutexWin32EXT); \
FUNC(glReleaseKeyedMutexWin32EXT, glReleaseKeyedMutexWin32EXT); \
FUNC(glCompressedTextureImage1DEXT, glCompressedTextureImage1DEXT); \
FUNC(glCompressedTextureImage2DEXT, glCompressedTextureImage2DEXT); \
FUNC(glCompressedTextureImage3DEXT, glCompressedTextureImage3DEXT); \
FUNC(glCompressedTextureSubImage1DEXT, glCompressedTextureSubImage1DEXT); \
FUNC(glCompressedTextureSubImage2DEXT, glCompressedTextureSubImage2DEXT); \
FUNC(glCompressedTextureSubImage3DEXT, glCompressedTextureSubImage3DEXT); \
FUNC(glGenerateTextureMipmapEXT, glGenerateTextureMipmapEXT); \
FUNC(glGetPointeri_vEXT, glGetPointeri_vEXT); \
FUNC(glGetDoubleIndexedvEXT, glGetDoubleIndexedvEXT); \
FUNC(glGetPointerIndexedvEXT, glGetPointerIndexedvEXT); \
FUNC(glGetIntegerIndexedvEXT, glGetIntegerIndexedvEXT); \
FUNC(glGetBooleanIndexedvEXT, glGetBooleanIndexedvEXT); \
FUNC(glGetFloatIndexedvEXT, glGetFloatIndexedvEXT); \
FUNC(glGetMultiTexImageEXT, glGetMultiTexImageEXT); \
FUNC(glGetMultiTexParameterfvEXT, glGetMultiTexParameterfvEXT); \
FUNC(glGetMultiTexParameterivEXT, glGetMultiTexParameterivEXT); \
FUNC(glGetMultiTexParameterIivEXT, glGetMultiTexParameterIivEXT); \
FUNC(glGetMultiTexParameterIuivEXT, glGetMultiTexParameterIuivEXT); \
FUNC(glGetMultiTexLevelParameterfvEXT, glGetMultiTexLevelParameterfvEXT); \
FUNC(glGetMultiTexLevelParameterivEXT, glGetMultiTexLevelParameterivEXT); \
FUNC(glGetCompressedMultiTexImageEXT, glGetCompressedMultiTexImageEXT); \
FUNC(glGetNamedBufferPointervEXT, glGetNamedBufferPointervEXT); \
FUNC(glGetNamedBufferPointervEXT, glGetNamedBufferPointerv); \
FUNC(glGetNamedProgramivEXT, glGetNamedProgramivEXT); \
FUNC(glGetNamedFramebufferAttachmentParameterivEXT, glGetNamedFramebufferAttachmentParameterivEXT); \
FUNC(glGetNamedFramebufferAttachmentParameterivEXT, glGetNamedFramebufferAttachmentParameteriv); \
FUNC(glGetNamedBufferParameterivEXT, glGetNamedBufferParameterivEXT); \
FUNC(glGetNamedBufferParameterivEXT, glGetNamedBufferParameteriv); \
FUNC(glCheckNamedFramebufferStatusEXT, glCheckNamedFramebufferStatusEXT); \
FUNC(glCheckNamedFramebufferStatusEXT, glCheckNamedFramebufferStatus); \
FUNC(glGetNamedBufferSubDataEXT, glGetNamedBufferSubDataEXT); \
FUNC(glGetNamedFramebufferParameterivEXT, glGetNamedFramebufferParameterivEXT); \
FUNC(glGetNamedFramebufferParameterivEXT, glGetFramebufferParameterivEXT); \
FUNC(glGetNamedFramebufferParameterivEXT, glGetNamedFramebufferParameteriv); \
FUNC(glGetNamedRenderbufferParameterivEXT, glGetNamedRenderbufferParameterivEXT); \
FUNC(glGetNamedRenderbufferParameterivEXT, glGetNamedRenderbufferParameteriv); \
FUNC(glGetVertexArrayIntegervEXT, glGetVertexArrayIntegervEXT); \
FUNC(glGetVertexArrayPointervEXT, glGetVertexArrayPointervEXT); \
FUNC(glGetVertexArrayIntegeri_vEXT, glGetVertexArrayIntegeri_vEXT); \
FUNC(glGetVertexArrayPointeri_vEXT, glGetVertexArrayPointeri_vEXT); \
FUNC(glGetCompressedTextureImageEXT, glGetCompressedTextureImageEXT); \
FUNC(glGetTextureImageEXT, glGetTextureImageEXT); \
FUNC(glGetTextureParameterivEXT, glGetTextureParameterivEXT); \
FUNC(glGetTextureParameterfvEXT, glGetTextureParameterfvEXT); \
FUNC(glGetTextureParameterIivEXT, glGetTextureParameterIivEXT); \
FUNC(glGetTextureParameterIuivEXT, glGetTextureParameterIuivEXT); \
FUNC(glGetTextureLevelParameterivEXT, glGetTextureLevelParameterivEXT); \
FUNC(glGetTextureLevelParameterfvEXT, glGetTextureLevelParameterfvEXT); \
FUNC(glBindMultiTextureEXT, glBindMultiTextureEXT); \
FUNC(glMapNamedBufferEXT, glMapNamedBufferEXT); \
FUNC(glMapNamedBufferEXT, glMapNamedBuffer); \
FUNC(glMapNamedBufferRangeEXT, glMapNamedBufferRangeEXT); \
FUNC(glFlushMappedNamedBufferRangeEXT, glFlushMappedNamedBufferRangeEXT); \
FUNC(glUnmapNamedBufferEXT, glUnmapNamedBufferEXT); \
FUNC(glUnmapNamedBufferEXT, glUnmapNamedBuffer); \
FUNC(glClearNamedBufferDataEXT, glClearNamedBufferDataEXT); \
FUNC(glClearNamedBufferDataEXT, glClearNamedBufferData); \
FUNC(glClearNamedBufferSubDataEXT, glClearNamedBufferSubDataEXT); \
FUNC(glNamedBufferDataEXT, glNamedBufferDataEXT); \
FUNC(glNamedBufferStorageEXT, glNamedBufferStorageEXT); \
FUNC(glNamedBufferSubDataEXT, glNamedBufferSubDataEXT); \
FUNC(glNamedCopyBufferSubDataEXT, glNamedCopyBufferSubDataEXT); \
FUNC(glNamedFramebufferTextureEXT, glNamedFramebufferTextureEXT); \
FUNC(glNamedFramebufferTextureEXT, glNamedFramebufferTexture); \
FUNC(glNamedFramebufferTexture1DEXT, glNamedFramebufferTexture1DEXT); \
FUNC(glNamedFramebufferTexture2DEXT, glNamedFramebufferTexture2DEXT); \
FUNC(glNamedFramebufferTexture3DEXT, glNamedFramebufferTexture3DEXT); \
FUNC(glNamedFramebufferRenderbufferEXT, glNamedFramebufferRenderbufferEXT); \
FUNC(glNamedFramebufferRenderbufferEXT, glNamedFramebufferRenderbuffer); \
FUNC(glNamedFramebufferTextureLayerEXT, glNamedFramebufferTextureLayerEXT); \
FUNC(glNamedFramebufferTextureLayerEXT, glNamedFramebufferTextureLayer); \
FUNC(glNamedFramebufferParameteriEXT, glNamedFramebufferParameteriEXT); \
FUNC(glNamedFramebufferParameteriEXT, glNamedFramebufferParameteri); \
FUNC(glNamedRenderbufferStorageEXT, glNamedRenderbufferStorageEXT); \
FUNC(glNamedRenderbufferStorageEXT, glNamedRenderbufferStorage); \
FUNC(glNamedRenderbufferStorageMultisampleEXT, glNamedRenderbufferStorageMultisampleEXT); \
FUNC(glNamedRenderbufferStorageMultisampleEXT, glNamedRenderbufferStorageMultisample); \
FUNC(glFramebufferDrawBufferEXT, glFramebufferDrawBufferEXT); \
FUNC(glFramebufferDrawBufferEXT, glNamedFramebufferDrawBuffer); \
FUNC(glFramebufferDrawBuffersEXT, glFramebufferDrawBuffersEXT); \
FUNC(glFramebufferDrawBuffersEXT, glNamedFramebufferDrawBuffers); \
FUNC(glFramebufferReadBufferEXT, glFramebufferReadBufferEXT); \
FUNC(glFramebufferReadBufferEXT, glNamedFramebufferReadBuffer); \
FUNC(glTextureBufferEXT, glTextureBufferEXT); \
FUNC(glTextureBufferRangeEXT, glTextureBufferRangeEXT); \
FUNC(glTextureImage1DEXT, glTextureImage1DEXT); \
FUNC(glTextureImage2DEXT, glTextureImage2DEXT); \
FUNC(glTextureImage3DEXT, glTextureImage3DEXT); \
FUNC(glTextureParameterfEXT, glTextureParameterfEXT); \
FUNC(glTextureParameterfvEXT, glTextureParameterfvEXT); \
FUNC(glTextureParameteriEXT, glTextureParameteriEXT); \
FUNC(glTextureParameterivEXT, glTextureParameterivEXT); \
FUNC(glTextureParameterIivEXT, glTextureParameterIivEXT); \
FUNC(glTextureParameterIuivEXT, glTextureParameterIuivEXT); \
FUNC(glTextureStorage1DEXT, glTextureStorage1DEXT); \
FUNC(glTextureStorage2DEXT, glTextureStorage2DEXT); \
FUNC(glTextureStorage3DEXT, glTextureStorage3DEXT); \
FUNC(glTextureStorage2DMultisampleEXT, glTextureStorage2DMultisampleEXT); \
FUNC(glTextureStorage3DMultisampleEXT, glTextureStorage3DMultisampleEXT); \
FUNC(glTextureSubImage1DEXT, glTextureSubImage1DEXT); \
FUNC(glTextureSubImage2DEXT, glTextureSubImage2DEXT); \
FUNC(glTextureSubImage3DEXT, glTextureSubImage3DEXT); \
FUNC(glCopyTextureImage1DEXT, glCopyTextureImage1DEXT); \
FUNC(glCopyTextureImage2DEXT, glCopyTextureImage2DEXT); \
FUNC(glCopyTextureSubImage1DEXT, glCopyTextureSubImage1DEXT); \
FUNC(glCopyTextureSubImage2DEXT, glCopyTextureSubImage2DEXT); \
FUNC(glCopyTextureSubImage3DEXT, glCopyTextureSubImage3DEXT); \
FUNC(glMultiTexParameteriEXT, glMultiTexParameteriEXT); \
FUNC(glMultiTexParameterivEXT, glMultiTexParameterivEXT); \
FUNC(glMultiTexParameterfEXT, glMultiTexParameterfEXT); \
FUNC(glMultiTexParameterfvEXT, glMultiTexParameterfvEXT); \
FUNC(glMultiTexImage1DEXT, glMultiTexImage1DEXT); \
FUNC(glMultiTexImage2DEXT, glMultiTexImage2DEXT); \
FUNC(glMultiTexSubImage1DEXT, glMultiTexSubImage1DEXT); \
FUNC(glMultiTexSubImage2DEXT, glMultiTexSubImage2DEXT); \
FUNC(glCopyMultiTexImage1DEXT, glCopyMultiTexImage1DEXT); \
FUNC(glCopyMultiTexImage2DEXT, glCopyMultiTexImage2DEXT); \
FUNC(glCopyMultiTexSubImage1DEXT, glCopyMultiTexSubImage1DEXT); \
FUNC(glCopyMultiTexSubImage2DEXT, glCopyMultiTexSubImage2DEXT); \
FUNC(glMultiTexImage3DEXT, glMultiTexImage3DEXT); \
FUNC(glMultiTexSubImage3DEXT, glMultiTexSubImage3DEXT); \
FUNC(glCopyMultiTexSubImage3DEXT, glCopyMultiTexSubImage3DEXT); \
FUNC(glCompressedMultiTexImage3DEXT, glCompressedMultiTexImage3DEXT); \
FUNC(glCompressedMultiTexImage2DEXT, glCompressedMultiTexImage2DEXT); \
FUNC(glCompressedMultiTexImage1DEXT, glCompressedMultiTexImage1DEXT); \
FUNC(glCompressedMultiTexSubImage3DEXT, glCompressedMultiTexSubImage3DEXT); \
FUNC(glCompressedMultiTexSubImage2DEXT, glCompressedMultiTexSubImage2DEXT); \
FUNC(glCompressedMultiTexSubImage1DEXT, glCompressedMultiTexSubImage1DEXT); \
FUNC(glMultiTexBufferEXT, glMultiTexBufferEXT); \
FUNC(glMultiTexParameterIivEXT, glMultiTexParameterIivEXT); \
FUNC(glMultiTexParameterIuivEXT, glMultiTexParameterIuivEXT); \
FUNC(glGenerateMultiTexMipmapEXT, glGenerateMultiTexMipmapEXT); \
FUNC(glVertexArrayVertexAttribOffsetEXT, glVertexArrayVertexAttribOffsetEXT); \
FUNC(glVertexArrayVertexAttribIOffsetEXT, glVertexArrayVertexAttribIOffsetEXT); \
FUNC(glEnableVertexArrayAttribEXT, glEnableVertexArrayAttribEXT); \
FUNC(glEnableVertexArrayAttribEXT, glEnableVertexArrayAttrib); \
FUNC(glDisableVertexArrayAttribEXT, glDisableVertexArrayAttribEXT); \
FUNC(glDisableVertexArrayAttribEXT, glDisableVertexArrayAttrib); \
FUNC(glVertexArrayBindVertexBufferEXT, glVertexArrayBindVertexBufferEXT); \
FUNC(glVertexArrayBindVertexBufferEXT, glVertexArrayVertexBuffer); \
FUNC(glVertexArrayVertexAttribFormatEXT, glVertexArrayVertexAttribFormatEXT); \
FUNC(glVertexArrayVertexAttribFormatEXT, glVertexArrayAttribFormat); \
FUNC(glVertexArrayVertexAttribIFormatEXT, glVertexArrayVertexAttribIFormatEXT); \
FUNC(glVertexArrayVertexAttribIFormatEXT, glVertexArrayAttribIFormat); \
FUNC(glVertexArrayVertexAttribLFormatEXT, glVertexArrayVertexAttribLFormatEXT); \
FUNC(glVertexArrayVertexAttribLFormatEXT, glVertexArrayAttribLFormat); \
FUNC(glVertexArrayVertexAttribBindingEXT, glVertexArrayVertexAttribBindingEXT); \
FUNC(glVertexArrayVertexAttribBindingEXT, glVertexArrayAttribBinding); \
FUNC(glVertexArrayVertexBindingDivisorEXT, glVertexArrayVertexBindingDivisorEXT); \
FUNC(glVertexArrayVertexBindingDivisorEXT, glVertexArrayBindingDivisor); \
FUNC(glVertexArrayVertexAttribLOffsetEXT, glVertexArrayVertexAttribLOffsetEXT); \
FUNC(glVertexArrayVertexAttribDivisorEXT, glVertexArrayVertexAttribDivisorEXT); \
FUNC(glCreateTransformFeedbacks, glCreateTransformFeedbacks); \
FUNC(glTransformFeedbackBufferBase, glTransformFeedbackBufferBase); \
FUNC(glTransformFeedbackBufferRange, glTransformFeedbackBufferRange); \
FUNC(glGetTransformFeedbacki64_v, glGetTransformFeedbacki64_v); \
FUNC(glGetTransformFeedbacki_v, glGetTransformFeedbacki_v); \
FUNC(glGetTransformFeedbackiv, glGetTransformFeedbackiv); \
FUNC(glCreateBuffers, glCreateBuffers); \
FUNC(glGetNamedBufferSubData, glGetNamedBufferSubData); \
FUNC(glNamedBufferStorage, glNamedBufferStorage); \
FUNC(glNamedBufferData, glNamedBufferData); \
FUNC(glNamedBufferSubData, glNamedBufferSubData); \
FUNC(glCopyNamedBufferSubData, glCopyNamedBufferSubData); \
FUNC(glClearNamedBufferSubData, glClearNamedBufferSubData); \
FUNC(glMapNamedBufferRange, glMapNamedBufferRange); \
FUNC(glFlushMappedNamedBufferRange, glFlushMappedNamedBufferRange); \
FUNC(glGetNamedBufferParameteri64v, glGetNamedBufferParameteri64v); \
FUNC(glCreateFramebuffers, glCreateFramebuffers); \
FUNC(glInvalidateNamedFramebufferData, glInvalidateNamedFramebufferData); \
FUNC(glInvalidateNamedFramebufferSubData, glInvalidateNamedFramebufferSubData); \
FUNC(glClearNamedFramebufferiv, glClearNamedFramebufferiv); \
FUNC(glClearNamedFramebufferuiv, glClearNamedFramebufferuiv); \
FUNC(glClearNamedFramebufferfv, glClearNamedFramebufferfv); \
FUNC(glClearNamedFramebufferfi, glClearNamedFramebufferfi); \
FUNC(glBlitNamedFramebuffer, glBlitNamedFramebuffer); \
FUNC(glCreateRenderbuffers, glCreateRenderbuffers); \
FUNC(glCreateTextures, glCreateTextures); \
FUNC(glTextureBuffer, glTextureBuffer); \
FUNC(glTextureBufferRange, glTextureBufferRange); \
FUNC(glTextureStorage1D, glTextureStorage1D); \
FUNC(glTextureStorage2D, glTextureStorage2D); \
FUNC(glTextureStorage3D, glTextureStorage3D); \
FUNC(glTextureStorage2DMultisample, glTextureStorage2DMultisample); \
FUNC(glTextureStorage3DMultisample, glTextureStorage3DMultisample); \
FUNC(glTextureSubImage1D, glTextureSubImage1D); \
FUNC(glTextureSubImage2D, glTextureSubImage2D); \
FUNC(glTextureSubImage3D, glTextureSubImage3D); \
FUNC(glCompressedTextureSubImage1D, glCompressedTextureSubImage1D); \
FUNC(glCompressedTextureSubImage2D, glCompressedTextureSubImage2D); \
FUNC(glCompressedTextureSubImage3D, glCompressedTextureSubImage3D); \
FUNC(glCopyTextureSubImage1D, glCopyTextureSubImage1D); \
FUNC(glCopyTextureSubImage2D, glCopyTextureSubImage2D); \
FUNC(glCopyTextureSubImage3D, glCopyTextureSubImage3D); \
FUNC(glTextureParameterf, glTextureParameterf); \
FUNC(glTextureParameterfv, glTextureParameterfv); \
FUNC(glTextureParameteri, glTextureParameteri); \
FUNC(glTextureParameterIiv, glTextureParameterIiv); \
FUNC(glTextureParameterIuiv, glTextureParameterIuiv); \
FUNC(glTextureParameteriv, glTextureParameteriv); \
FUNC(glGenerateTextureMipmap, glGenerateTextureMipmap); \
FUNC(glBindTextureUnit, glBindTextureUnit); \
FUNC(glGetTextureImage, glGetTextureImage); \
FUNC(glGetTextureSubImage, glGetTextureSubImage); \
FUNC(glGetCompressedTextureImage, glGetCompressedTextureImage); \
FUNC(glGetCompressedTextureSubImage, glGetCompressedTextureSubImage); \
FUNC(glGetTextureLevelParameterfv, glGetTextureLevelParameterfv); \
FUNC(glGetTextureLevelParameteriv, glGetTextureLevelParameteriv); \
FUNC(glGetTextureParameterIiv, glGetTextureParameterIiv); \
FUNC(glGetTextureParameterIuiv, glGetTextureParameterIuiv); \
FUNC(glGetTextureParameterfv, glGetTextureParameterfv); \
FUNC(glGetTextureParameteriv, glGetTextureParameteriv); \
FUNC(glCreateVertexArrays, glCreateVertexArrays); \
FUNC(glCreateSamplers, glCreateSamplers); \
FUNC(glCreateProgramPipelines, glCreateProgramPipelines); \
FUNC(glCreateQueries, glCreateQueries); \
FUNC(glVertexArrayElementBuffer, glVertexArrayElementBuffer); \
FUNC(glVertexArrayVertexBuffers, glVertexArrayVertexBuffers); \
FUNC(glGetVertexArrayiv, glGetVertexArrayiv); \
FUNC(glGetVertexArrayIndexed64iv, glGetVertexArrayIndexed64iv); \
FUNC(glGetVertexArrayIndexediv, glGetVertexArrayIndexediv); \
FUNC(glGetQueryBufferObjecti64v, glGetQueryBufferObjecti64v); \
FUNC(glGetQueryBufferObjectiv, glGetQueryBufferObjectiv); \
FUNC(glGetQueryBufferObjectui64v, glGetQueryBufferObjectui64v); \
FUNC(glGetQueryBufferObjectuiv, glGetQueryBufferObjectuiv); \
FUNC(wglDXSetResourceShareHandleNV, wglDXSetResourceShareHandleNV); \
FUNC(wglDXOpenDeviceNV, wglDXOpenDeviceNV); \
FUNC(wglDXCloseDeviceNV, wglDXCloseDeviceNV); \
FUNC(wglDXRegisterObjectNV, wglDXRegisterObjectNV); \
FUNC(wglDXUnregisterObjectNV, wglDXUnregisterObjectNV); \
FUNC(wglDXObjectAccessNV, wglDXObjectAccessNV); \
FUNC(wglDXLockObjectsNV, wglDXLockObjectsNV); \
FUNC(wglDXUnlockObjectsNV, wglDXUnlockObjectsNV); \
#define DefineSupportedHooks() \
FuncWrapper2(void, glBindTexture, GLenum, target, GLuint, texture); \
FuncWrapper2(void, glBlendFunc, GLenum, sfactor, GLenum, dfactor); \
FuncWrapper1(void, glClear, GLbitfield, mask); \
FuncWrapper4(void, glClearColor, GLfloat, red, GLfloat, green, GLfloat, blue, GLfloat, alpha); \
FuncWrapper1(void, glClearDepth, GLdouble, depth); \
FuncWrapper1(void, glClearStencil, GLint, s); \
FuncWrapper4(void, glColorMask, GLboolean, red, GLboolean, green, GLboolean, blue, GLboolean, alpha); \
FuncWrapper1(void, glCullFace, GLenum, mode); \
FuncWrapper1(void, glDepthFunc, GLenum, func); \
FuncWrapper1(void, glDepthMask, GLboolean, flag); \
FuncWrapper2(void, glDepthRange, GLdouble, near, GLdouble, far); \
FuncWrapper3(void, glStencilFunc, GLenum, func, GLint, ref, GLuint, mask); \
FuncWrapper1(void, glStencilMask, GLuint, mask); \
FuncWrapper3(void, glStencilOp, GLenum, fail, GLenum, zfail, GLenum, zpass); \
FuncWrapper1(void, glDisable, GLenum, cap); \
FuncWrapper1(void, glDrawBuffer, GLenum, buf); \
FuncWrapper4(void, glDrawElements, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices); \
FuncWrapper3(void, glDrawArrays, GLenum, mode, GLint, first, GLsizei, count); \
FuncWrapper1(void, glEnable, GLenum, cap); \
FuncWrapper0(void, glFlush); \
FuncWrapper0(void, glFinish); \
FuncWrapper1(void, glFrontFace, GLenum, mode); \
FuncWrapper2(void, glGenTextures, GLsizei, n, GLuint *, textures); \
FuncWrapper2(void, glDeleteTextures, GLsizei, n, const GLuint *, textures); \
FuncWrapper1(GLboolean, glIsEnabled, GLenum, cap); \
FuncWrapper1(GLboolean, glIsTexture, GLuint, texture); \
FuncWrapper0(GLenum, glGetError); \
FuncWrapper4(void, glGetTexLevelParameteriv, GLenum, target, GLint, level, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetTexLevelParameterfv, GLenum, target, GLint, level, GLenum, pname, GLfloat *, params); \
FuncWrapper3(void, glGetTexParameterfv, GLenum, target, GLenum, pname, GLfloat *, params); \
FuncWrapper3(void, glGetTexParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper5(void, glGetTexImage, GLenum, target, GLint, level, GLenum, format, GLenum, type, void *, pixels); \
FuncWrapper2(void, glGetBooleanv, GLenum, pname, GLboolean *, data); \
FuncWrapper2(void, glGetFloatv, GLenum, pname, GLfloat *, data); \
FuncWrapper2(void, glGetDoublev, GLenum, pname, GLdouble *, data); \
FuncWrapper2(void, glGetIntegerv, GLenum, pname, GLint *, data); \
FuncWrapper2(void, glGetPointerv, GLenum, pname, void **, params); \
AliasWrapper2(void, glGetPointervKHR, glGetPointerv, GLenum, pname, void **, params); \
FuncWrapper1(const GLubyte *, glGetString, GLenum, name); \
FuncWrapper2(void, glHint, GLenum, target, GLenum, mode); \
FuncWrapper1(void, glLogicOp, GLenum, opcode); \
FuncWrapper2(void, glPixelStorei, GLenum, pname, GLint, param); \
FuncWrapper2(void, glPixelStoref, GLenum, pname, GLfloat, param); \
FuncWrapper2(void, glPolygonMode, GLenum, face, GLenum, mode); \
FuncWrapper2(void, glPolygonOffset, GLfloat, factor, GLfloat, units); \
FuncWrapper1(void, glPointSize, GLfloat, size); \
FuncWrapper1(void, glLineWidth, GLfloat, width); \
FuncWrapper7(void, glReadPixels, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, void *, pixels); \
FuncWrapper1(void, glReadBuffer, GLenum, src); \
FuncWrapper4(void, glScissor, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper8(void, glTexImage1D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper9(void, glTexImage2D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper7(void, glTexSubImage1D, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper9(void, glTexSubImage2D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper7(void, glCopyTexImage1D, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLint, border); \
FuncWrapper8(void, glCopyTexImage2D, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLint, border); \
FuncWrapper6(void, glCopyTexSubImage1D, GLenum, target, GLint, level, GLint, xoffset, GLint, x, GLint, y, GLsizei, width); \
FuncWrapper8(void, glCopyTexSubImage2D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper3(void, glTexParameterf, GLenum, target, GLenum, pname, GLfloat, param); \
FuncWrapper3(void, glTexParameterfv, GLenum, target, GLenum, pname, const GLfloat *, params); \
FuncWrapper3(void, glTexParameteri, GLenum, target, GLenum, pname, GLint, param); \
FuncWrapper3(void, glTexParameteriv, GLenum, target, GLenum, pname, const GLint *, params); \
FuncWrapper4(void, glViewport, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper1(void, glActiveTexture, GLenum, texture); \
AliasWrapper1(void, glActiveTextureARB, glActiveTexture, GLenum, texture); \
FuncWrapper4(void, glTexStorage1D, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width); \
AliasWrapper4(void, glTexStorage1DEXT, glTexStorage1D, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width); \
FuncWrapper5(void, glTexStorage2D, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height); \
AliasWrapper5(void, glTexStorage2DEXT, glTexStorage2D, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper6(void, glTexStorage3D, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth); \
AliasWrapper6(void, glTexStorage3DEXT, glTexStorage3D, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth); \
FuncWrapper6(void, glTexStorage2DMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLboolean, fixedsamplelocations); \
FuncWrapper7(void, glTexStorage3DMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedsamplelocations); \
AliasWrapper7(void, glTexStorage3DMultisampleOES, glTexStorage3DMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedsamplelocations); \
FuncWrapper10(void, glTexImage3D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
AliasWrapper10(void, glTexImage3DEXT, glTexImage3D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
AliasWrapper10(void, glTexImage3DOES, glTexImage3D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper11(void, glTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, pixels); \
AliasWrapper11(void, glTexSubImage3DOES, glTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper3(void, glTexBuffer, GLenum, target, GLenum, internalformat, GLuint, buffer); \
AliasWrapper3(void, glTexBufferARB, glTexBuffer, GLenum, target, GLenum, internalformat, GLuint, buffer); \
AliasWrapper3(void, glTexBufferEXT, glTexBuffer, GLenum, target, GLenum, internalformat, GLuint, buffer); \
AliasWrapper3(void, glTexBufferOES, glTexBuffer, GLenum, target, GLenum, internalformat, GLuint, buffer); \
FuncWrapper6(void, glTexImage2DMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLboolean, fixedsamplelocations); \
FuncWrapper7(void, glTexImage3DMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedsamplelocations); \
FuncWrapper7(void, glCompressedTexImage1D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLint, border, GLsizei, imageSize, const void *, data); \
AliasWrapper7(void, glCompressedTexImage1DARB, glCompressedTexImage1D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLint, border, GLsizei, imageSize, const void *, data); \
FuncWrapper8(void, glCompressedTexImage2D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLsizei, imageSize, const void *, data); \
AliasWrapper8(void, glCompressedTexImage2DARB, glCompressedTexImage2D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLsizei, imageSize, const void *, data); \
FuncWrapper9(void, glCompressedTexImage3D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLsizei, imageSize, const void *, data); \
AliasWrapper9(void, glCompressedTexImage3DARB, glCompressedTexImage3D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLsizei, imageSize, const void *, data); \
AliasWrapper9(void, glCompressedTexImage3DOES, glCompressedTexImage3D, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLsizei, imageSize, const void *, data); \
FuncWrapper7(void, glCompressedTexSubImage1D, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLsizei, imageSize, const void *, data); \
AliasWrapper7(void, glCompressedTexSubImage1DARB, glCompressedTexSubImage1D, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLsizei, imageSize, const void *, data); \
FuncWrapper9(void, glCompressedTexSubImage2D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLsizei, imageSize, const void *, data); \
AliasWrapper9(void, glCompressedTexSubImage2DARB, glCompressedTexSubImage2D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLsizei, imageSize, const void *, data); \
FuncWrapper11(void, glCompressedTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLsizei, imageSize, const void *, data); \
AliasWrapper11(void, glCompressedTexSubImage3DARB, glCompressedTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLsizei, imageSize, const void *, data); \
AliasWrapper11(void, glCompressedTexSubImage3DOES, glCompressedTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLsizei, imageSize, const void *, data); \
FuncWrapper5(void, glTexBufferRange, GLenum, target, GLenum, internalformat, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
AliasWrapper5(void, glTexBufferRangeEXT, glTexBufferRange, GLenum, target, GLenum, internalformat, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
AliasWrapper5(void, glTexBufferRangeOES, glTexBufferRange, GLenum, target, GLenum, internalformat, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
FuncWrapper8(void, glTextureView, GLuint, texture, GLenum, target, GLuint, origtexture, GLenum, internalformat, GLuint, minlevel, GLuint, numlevels, GLuint, minlayer, GLuint, numlayers); \
AliasWrapper8(void, glTextureViewEXT, glTextureView, GLuint, texture, GLenum, target, GLuint, origtexture, GLenum, internalformat, GLuint, minlevel, GLuint, numlevels, GLuint, minlayer, GLuint, numlayers); \
AliasWrapper8(void, glTextureViewOES, glTextureView, GLuint, texture, GLenum, target, GLuint, origtexture, GLenum, internalformat, GLuint, minlevel, GLuint, numlevels, GLuint, minlayer, GLuint, numlayers); \
FuncWrapper3(void, glTexParameterIiv, GLenum, target, GLenum, pname, const GLint *, params); \
AliasWrapper3(void, glTexParameterIivEXT, glTexParameterIiv, GLenum, target, GLenum, pname, const GLint *, params); \
AliasWrapper3(void, glTexParameterIivOES, glTexParameterIiv, GLenum, target, GLenum, pname, const GLint *, params); \
FuncWrapper3(void, glTexParameterIuiv, GLenum, target, GLenum, pname, const GLuint *, params); \
AliasWrapper3(void, glTexParameterIuivEXT, glTexParameterIuiv, GLenum, target, GLenum, pname, const GLuint *, params); \
AliasWrapper3(void, glTexParameterIuivOES, glTexParameterIuiv, GLenum, target, GLenum, pname, const GLuint *, params); \
FuncWrapper1(void, glGenerateMipmap, GLenum, target); \
AliasWrapper1(void, glGenerateMipmapEXT, glGenerateMipmap, GLenum, target); \
FuncWrapper15(void, glCopyImageSubData, GLuint, srcName, GLenum, srcTarget, GLint, srcLevel, GLint, srcX, GLint, srcY, GLint, srcZ, GLuint, dstName, GLenum, dstTarget, GLint, dstLevel, GLint, dstX, GLint, dstY, GLint, dstZ, GLsizei, srcWidth, GLsizei, srcHeight, GLsizei, srcDepth); \
AliasWrapper15(void, glCopyImageSubDataEXT, glCopyImageSubData, GLuint, srcName, GLenum, srcTarget, GLint, srcLevel, GLint, srcX, GLint, srcY, GLint, srcZ, GLuint, dstName, GLenum, dstTarget, GLint, dstLevel, GLint, dstX, GLint, dstY, GLint, dstZ, GLsizei, srcWidth, GLsizei, srcHeight, GLsizei, srcDepth); \
AliasWrapper15(void, glCopyImageSubDataOES, glCopyImageSubData, GLuint, srcName, GLenum, srcTarget, GLint, srcLevel, GLint, srcX, GLint, srcY, GLint, srcZ, GLuint, dstName, GLenum, dstTarget, GLint, dstLevel, GLint, dstX, GLint, dstY, GLint, dstZ, GLsizei, srcWidth, GLsizei, srcHeight, GLsizei, srcDepth); \
FuncWrapper9(void, glCopyTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
AliasWrapper9(void, glCopyTexSubImage3DOES, glCopyTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper5(void, glGetInternalformativ, GLenum, target, GLenum, internalformat, GLenum, pname, GLsizei, bufSize, GLint *, params); \
FuncWrapper5(void, glGetInternalformati64v, GLenum, target, GLenum, internalformat, GLenum, pname, GLsizei, bufSize, GLint64 *, params); \
FuncWrapper3(void, glGetBufferParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetBufferParameterivARB, glGetBufferParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetBufferParameteri64v, GLenum, target, GLenum, pname, GLint64 *, params); \
FuncWrapper3(void, glGetBufferPointerv, GLenum, target, GLenum, pname, void **, params); \
AliasWrapper3(void, glGetBufferPointervARB, glGetBufferPointerv, GLenum, target, GLenum, pname, void **, params); \
AliasWrapper3(void, glGetBufferPointervOES, glGetBufferPointerv, GLenum, target, GLenum, pname, void **, params); \
FuncWrapper2(GLint, glGetFragDataIndex, GLuint, program, const GLchar *, name); \
FuncWrapper2(GLint, glGetFragDataLocation, GLuint, program, const GLchar *, name); \
AliasWrapper2(GLint, glGetFragDataLocationEXT, glGetFragDataLocation, GLuint, program, const GLchar *, name); \
FuncWrapper2(const GLubyte *, glGetStringi, GLenum, name, GLuint, index); \
FuncWrapper3(void, glGetBooleani_v, GLenum, target, GLuint, index, GLboolean *, data); \
FuncWrapper3(void, glGetIntegeri_v, GLenum, target, GLuint, index, GLint *, data); \
FuncWrapper3(void, glGetFloati_v, GLenum, target, GLuint, index, GLfloat *, data); \
AliasWrapper3(void, glGetFloati_vEXT, glGetFloati_v, GLenum, target, GLuint, index, GLfloat *, data); \
AliasWrapper3(void, glGetFloati_vOES, glGetFloati_v, GLenum, target, GLuint, index, GLfloat *, data); \
AliasWrapper3(void, glGetFloati_vNV, glGetFloati_v, GLenum, target, GLuint, index, GLfloat *, data); \
FuncWrapper3(void, glGetDoublei_v, GLenum, target, GLuint, index, GLdouble *, data); \
AliasWrapper3(void, glGetDoublei_vEXT, glGetDoublei_v, GLenum, target, GLuint, index, GLdouble *, data); \
FuncWrapper3(void, glGetInteger64i_v, GLenum, target, GLuint, index, GLint64 *, data); \
FuncWrapper2(void, glGetInteger64v, GLenum, pname, GLint64 *, data); \
FuncWrapper3(void, glGetShaderiv, GLuint, shader, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetShaderInfoLog, GLuint, shader, GLsizei, bufSize, GLsizei *, length, GLchar *, infoLog); \
FuncWrapper4(void, glGetShaderPrecisionFormat, GLenum, shadertype, GLenum, precisiontype, GLint *, range, GLint *, precision); \
FuncWrapper4(void, glGetShaderSource, GLuint, shader, GLsizei, bufSize, GLsizei *, length, GLchar *, source); \
FuncWrapper4(void, glGetAttachedShaders, GLuint, program, GLsizei, maxCount, GLsizei *, count, GLuint *, shaders); \
FuncWrapper3(void, glGetProgramiv, GLuint, program, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetProgramInfoLog, GLuint, program, GLsizei, bufSize, GLsizei *, length, GLchar *, infoLog); \
FuncWrapper4(void, glGetProgramInterfaceiv, GLuint, program, GLenum, programInterface, GLenum, pname, GLint *, params); \
FuncWrapper3(GLuint, glGetProgramResourceIndex, GLuint, program, GLenum, programInterface, const GLchar *, name); \
FuncWrapper8(void, glGetProgramResourceiv, GLuint, program, GLenum, programInterface, GLuint, index, GLsizei, propCount, const GLenum *, props, GLsizei, bufSize, GLsizei *, length, GLint *, params); \
FuncWrapper6(void, glGetProgramResourceName, GLuint, program, GLenum, programInterface, GLuint, index, GLsizei, bufSize, GLsizei *, length, GLchar *, name); \
FuncWrapper3(void, glGetProgramPipelineiv, GLuint, pipeline, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetProgramPipelineivEXT, glGetProgramPipelineiv, GLuint, pipeline, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetProgramPipelineInfoLog, GLuint, pipeline, GLsizei, bufSize, GLsizei *, length, GLchar *, infoLog); \
AliasWrapper4(void, glGetProgramPipelineInfoLogEXT, glGetProgramPipelineInfoLog, GLuint, pipeline, GLsizei, bufSize, GLsizei *, length, GLchar *, infoLog); \
FuncWrapper5(void, glGetProgramBinary, GLuint, program, GLsizei, bufSize, GLsizei *, length, GLenum *, binaryFormat, void *, binary); \
FuncWrapper3(GLint, glGetProgramResourceLocation, GLuint, program, GLenum, programInterface, const GLchar *, name); \
FuncWrapper3(GLint, glGetProgramResourceLocationIndex, GLuint, program, GLenum, programInterface, const GLchar *, name); \
FuncWrapper4(void, glGetProgramStageiv, GLuint, program, GLenum, shadertype, GLenum, pname, GLint *, values); \
FuncWrapper0(GLenum, glGetGraphicsResetStatus); \
AliasWrapper0(GLenum, glGetGraphicsResetStatusARB, glGetGraphicsResetStatus); \
AliasWrapper0(GLenum, glGetGraphicsResetStatusEXT, glGetGraphicsResetStatus); \
FuncWrapper5(void, glGetObjectLabel, GLenum, identifier, GLuint, name, GLsizei, bufSize, GLsizei *, length, GLchar *, label); \
AliasWrapper5(void, glGetObjectLabelKHR, glGetObjectLabel, GLenum, identifier, GLuint, name, GLsizei, bufSize, GLsizei *, length, GLchar *, label); \
FuncWrapper5(void, glGetObjectLabelEXT, GLenum, type, GLuint, object, GLsizei, bufSize, GLsizei *, length, GLchar *, label); \
FuncWrapper4(void, glGetObjectPtrLabel, const void *, ptr, GLsizei, bufSize, GLsizei *, length, GLchar *, label); \
AliasWrapper4(void, glGetObjectPtrLabelKHR, glGetObjectPtrLabel, const void *, ptr, GLsizei, bufSize, GLsizei *, length, GLchar *, label); \
FuncWrapper8(GLuint, glGetDebugMessageLog, GLuint, count, GLsizei, bufSize, GLenum *, sources, GLenum *, types, GLuint *, ids, GLenum *, severities, GLsizei *, lengths, GLchar *, messageLog); \
AliasWrapper8(GLuint, glGetDebugMessageLogARB, glGetDebugMessageLog, GLuint, count, GLsizei, bufSize, GLenum *, sources, GLenum *, types, GLuint *, ids, GLenum *, severities, GLsizei *, lengths, GLchar *, messageLog); \
AliasWrapper8(GLuint, glGetDebugMessageLogKHR, glGetDebugMessageLog, GLuint, count, GLsizei, bufSize, GLenum *, sources, GLenum *, types, GLuint *, ids, GLenum *, severities, GLsizei *, lengths, GLchar *, messageLog); \
FuncWrapper4(void, glGetFramebufferAttachmentParameteriv, GLenum, target, GLenum, attachment, GLenum, pname, GLint *, params); \
AliasWrapper4(void, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameteriv, GLenum, target, GLenum, attachment, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetFramebufferParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetRenderbufferParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetRenderbufferParameterivEXT, glGetRenderbufferParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetMultisamplefv, GLenum, pname, GLuint, index, GLfloat *, val); \
FuncWrapper4(void, glGetQueryIndexediv, GLenum, target, GLuint, index, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetQueryObjectui64v, GLuint, id, GLenum, pname, GLuint64 *, params); \
AliasWrapper3(void, glGetQueryObjectui64vEXT, glGetQueryObjectui64v, GLuint, id, GLenum, pname, GLuint64 *, params); \
FuncWrapper3(void, glGetQueryObjectuiv, GLuint, id, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetQueryObjectuivARB, glGetQueryObjectuiv, GLuint, id, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetQueryObjectuivEXT, glGetQueryObjectuiv, GLuint, id, GLenum, pname, GLuint *, params); \
FuncWrapper3(void, glGetQueryObjecti64v, GLuint, id, GLenum, pname, GLint64 *, params); \
AliasWrapper3(void, glGetQueryObjecti64vEXT, glGetQueryObjecti64v, GLuint, id, GLenum, pname, GLint64 *, params); \
FuncWrapper3(void, glGetQueryObjectiv, GLuint, id, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetQueryObjectivARB, glGetQueryObjectiv, GLuint, id, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetQueryObjectivEXT, glGetQueryObjectiv, GLuint, id, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetQueryiv, GLenum, target, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetQueryivARB, glGetQueryiv, GLenum, target, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetQueryivEXT, glGetQueryiv, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper5(void, glGetSynciv, GLsync, sync, GLenum, pname, GLsizei, bufSize, GLsizei *, length, GLint *, values); \
FuncWrapper4(void, glGetBufferSubData, GLenum, target, GLintptr, offset, GLsizeiptr, size, void *, data); \
AliasWrapper4(void, glGetBufferSubDataARB, glGetBufferSubData, GLenum, target, GLintptr, offset, GLsizeiptr, size, void *, data); \
FuncWrapper3(void, glGetVertexAttribiv, GLuint, index, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetVertexAttribPointerv, GLuint, index, GLenum, pname, void **, pointer); \
FuncWrapper3(void, glGetCompressedTexImage, GLenum, target, GLint, level, void *, img); \
AliasWrapper3(void, glGetCompressedTexImageARB, glGetCompressedTexImage, GLenum, target, GLint, level, void *, img); \
FuncWrapper4(void, glGetnCompressedTexImage, GLenum, target, GLint, lod, GLsizei, bufSize, void *, pixels); \
AliasWrapper4(void, glGetnCompressedTexImageARB, glGetnCompressedTexImage, GLenum, target, GLint, lod, GLsizei, bufSize, void *, pixels); \
FuncWrapper6(void, glGetnTexImage, GLenum, target, GLint, level, GLenum, format, GLenum, type, GLsizei, bufSize, void *, pixels); \
AliasWrapper6(void, glGetnTexImageARB, glGetnTexImage, GLenum, target, GLint, level, GLenum, format, GLenum, type, GLsizei, bufSize, void *, pixels); \
FuncWrapper3(void, glGetTexParameterIiv, GLenum, target, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetTexParameterIivEXT, glGetTexParameterIiv, GLenum, target, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetTexParameterIivOES, glGetTexParameterIiv, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetTexParameterIuiv, GLenum, target, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetTexParameterIuivEXT, glGetTexParameterIuiv, GLenum, target, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetTexParameterIuivOES, glGetTexParameterIuiv, GLenum, target, GLenum, pname, GLuint *, params); \
FuncWrapper2(void, glClampColor, GLenum, target, GLenum, clamp); \
AliasWrapper2(void, glClampColorARB, glClampColor, GLenum, target, GLenum, clamp); \
FuncWrapper8(void, glReadnPixels, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, GLsizei, bufSize, void *, data); \
AliasWrapper8(void, glReadnPixelsARB, glReadnPixels, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, GLsizei, bufSize, void *, data); \
AliasWrapper8(void, glReadnPixelsEXT, glReadnPixels, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, GLsizei, bufSize, void *, data); \
FuncWrapper3(void, glGetSamplerParameterIiv, GLuint, sampler, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetSamplerParameterIivEXT, glGetSamplerParameterIiv, GLuint, sampler, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetSamplerParameterIivOES, glGetSamplerParameterIiv, GLuint, sampler, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetSamplerParameterIuiv, GLuint, sampler, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetSamplerParameterIuivEXT, glGetSamplerParameterIuiv, GLuint, sampler, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetSamplerParameterIuivOES, glGetSamplerParameterIuiv, GLuint, sampler, GLenum, pname, GLuint *, params); \
FuncWrapper3(void, glGetSamplerParameterfv, GLuint, sampler, GLenum, pname, GLfloat *, params); \
FuncWrapper3(void, glGetSamplerParameteriv, GLuint, sampler, GLenum, pname, GLint *, params); \
FuncWrapper7(void, glGetTransformFeedbackVarying, GLuint, program, GLuint, index, GLsizei, bufSize, GLsizei *, length, GLsizei *, size, GLenum *, type, GLchar *, name); \
AliasWrapper7(void, glGetTransformFeedbackVaryingEXT, glGetTransformFeedbackVarying, GLuint, program, GLuint, index, GLsizei, bufSize, GLsizei *, length, GLsizei *, size, GLenum *, type, GLchar *, name); \
FuncWrapper3(GLuint, glGetSubroutineIndex, GLuint, program, GLenum, shadertype, const GLchar *, name); \
FuncWrapper3(GLint, glGetSubroutineUniformLocation, GLuint, program, GLenum, shadertype, const GLchar *, name); \
FuncWrapper4(void, glGetActiveAtomicCounterBufferiv, GLuint, program, GLuint, bufferIndex, GLenum, pname, GLint *, params); \
FuncWrapper6(void, glGetActiveSubroutineName, GLuint, program, GLenum, shadertype, GLuint, index, GLsizei, bufsize, GLsizei *, length, GLchar *, name); \
FuncWrapper6(void, glGetActiveSubroutineUniformName, GLuint, program, GLenum, shadertype, GLuint, index, GLsizei, bufsize, GLsizei *, length, GLchar *, name); \
FuncWrapper5(void, glGetActiveSubroutineUniformiv, GLuint, program, GLenum, shadertype, GLuint, index, GLenum, pname, GLint *, values); \
FuncWrapper2(GLint, glGetUniformLocation, GLuint, program, const GLchar *, name); \
FuncWrapper4(void, glGetUniformIndices, GLuint, program, GLsizei, uniformCount, const GLchar *const*, uniformNames, GLuint *, uniformIndices); \
FuncWrapper3(void, glGetUniformSubroutineuiv, GLenum, shadertype, GLint, location, GLuint *, params); \
FuncWrapper2(GLuint, glGetUniformBlockIndex, GLuint, program, const GLchar *, uniformBlockName); \
FuncWrapper2(GLint, glGetAttribLocation, GLuint, program, const GLchar *, name); \
FuncWrapper7(void, glGetActiveUniform, GLuint, program, GLuint, index, GLsizei, bufSize, GLsizei *, length, GLint *, size, GLenum *, type, GLchar *, name); \
FuncWrapper5(void, glGetActiveUniformName, GLuint, program, GLuint, uniformIndex, GLsizei, bufSize, GLsizei *, length, GLchar *, uniformName); \
FuncWrapper5(void, glGetActiveUniformBlockName, GLuint, program, GLuint, uniformBlockIndex, GLsizei, bufSize, GLsizei *, length, GLchar *, uniformBlockName); \
FuncWrapper4(void, glGetActiveUniformBlockiv, GLuint, program, GLuint, uniformBlockIndex, GLenum, pname, GLint *, params); \
FuncWrapper5(void, glGetActiveUniformsiv, GLuint, program, GLsizei, uniformCount, const GLuint *, uniformIndices, GLenum, pname, GLint *, params); \
FuncWrapper7(void, glGetActiveAttrib, GLuint, program, GLuint, index, GLsizei, bufSize, GLsizei *, length, GLint *, size, GLenum *, type, GLchar *, name); \
FuncWrapper3(void, glGetUniformfv, GLuint, program, GLint, location, GLfloat *, params); \
FuncWrapper3(void, glGetUniformiv, GLuint, program, GLint, location, GLint *, params); \
FuncWrapper3(void, glGetUniformuiv, GLuint, program, GLint, location, GLuint *, params); \
AliasWrapper3(void, glGetUniformuivEXT, glGetUniformuiv, GLuint, program, GLint, location, GLuint *, params); \
FuncWrapper3(void, glGetUniformdv, GLuint, program, GLint, location, GLdouble *, params); \
FuncWrapper4(void, glGetnUniformdv, GLuint, program, GLint, location, GLsizei, bufSize, GLdouble *, params); \
AliasWrapper4(void, glGetnUniformdvARB, glGetnUniformdv, GLuint, program, GLint, location, GLsizei, bufSize, GLdouble *, params); \
FuncWrapper4(void, glGetnUniformfv, GLuint, program, GLint, location, GLsizei, bufSize, GLfloat *, params); \
AliasWrapper4(void, glGetnUniformfvARB, glGetnUniformfv, GLuint, program, GLint, location, GLsizei, bufSize, GLfloat *, params); \
AliasWrapper4(void, glGetnUniformfvEXT, glGetnUniformfv, GLuint, program, GLint, location, GLsizei, bufSize, GLfloat *, params); \
FuncWrapper4(void, glGetnUniformiv, GLuint, program, GLint, location, GLsizei, bufSize, GLint *, params); \
AliasWrapper4(void, glGetnUniformivARB, glGetnUniformiv, GLuint, program, GLint, location, GLsizei, bufSize, GLint *, params); \
AliasWrapper4(void, glGetnUniformivEXT, glGetnUniformiv, GLuint, program, GLint, location, GLsizei, bufSize, GLint *, params); \
FuncWrapper4(void, glGetnUniformuiv, GLuint, program, GLint, location, GLsizei, bufSize, GLuint *, params); \
AliasWrapper4(void, glGetnUniformuivARB, glGetnUniformuiv, GLuint, program, GLint, location, GLsizei, bufSize, GLuint *, params); \
FuncWrapper3(void, glGetVertexAttribIiv, GLuint, index, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetVertexAttribIivEXT, glGetVertexAttribIiv, GLuint, index, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetVertexAttribIuiv, GLuint, index, GLenum, pname, GLuint *, params); \
AliasWrapper3(void, glGetVertexAttribIuivEXT, glGetVertexAttribIuiv, GLuint, index, GLenum, pname, GLuint *, params); \
FuncWrapper3(void, glGetVertexAttribLdv, GLuint, index, GLenum, pname, GLdouble *, params); \
AliasWrapper3(void, glGetVertexAttribLdvEXT, glGetVertexAttribLdv, GLuint, index, GLenum, pname, GLdouble *, params); \
FuncWrapper3(void, glGetVertexAttribdv, GLuint, index, GLenum, pname, GLdouble *, params); \
FuncWrapper3(void, glGetVertexAttribfv, GLuint, index, GLenum, pname, GLfloat *, params); \
FuncWrapper1(GLenum, glCheckFramebufferStatus, GLenum, target); \
AliasWrapper1(GLenum, glCheckFramebufferStatusEXT, glCheckFramebufferStatus, GLenum, target); \
FuncWrapper4(void, glBlendColor, GLfloat, red, GLfloat, green, GLfloat, blue, GLfloat, alpha); \
AliasWrapper4(void, glBlendColorEXT, glBlendColor, GLfloat, red, GLfloat, green, GLfloat, blue, GLfloat, alpha); \
FuncWrapper3(void, glBlendFunci, GLuint, buf, GLenum, src, GLenum, dst); \
AliasWrapper3(void, glBlendFunciARB, glBlendFunci, GLuint, buf, GLenum, src, GLenum, dst); \
AliasWrapper3(void, glBlendFunciEXT, glBlendFunci, GLuint, buf, GLenum, src, GLenum, dst); \
AliasWrapper3(void, glBlendFunciOES, glBlendFunci, GLuint, buf, GLenum, src, GLenum, dst); \
FuncWrapper4(void, glBlendFuncSeparate, GLenum, sfactorRGB, GLenum, dfactorRGB, GLenum, sfactorAlpha, GLenum, dfactorAlpha); \
AliasWrapper4(void, glBlendFuncSeparateARB, glBlendFuncSeparate, GLenum, sfactorRGB, GLenum, dfactorRGB, GLenum, sfactorAlpha, GLenum, dfactorAlpha); \
FuncWrapper5(void, glBlendFuncSeparatei, GLuint, buf, GLenum, srcRGB, GLenum, dstRGB, GLenum, srcAlpha, GLenum, dstAlpha); \
AliasWrapper5(void, glBlendFuncSeparateiARB, glBlendFuncSeparatei, GLuint, buf, GLenum, srcRGB, GLenum, dstRGB, GLenum, srcAlpha, GLenum, dstAlpha); \
AliasWrapper5(void, glBlendFuncSeparateiEXT, glBlendFuncSeparatei, GLuint, buf, GLenum, srcRGB, GLenum, dstRGB, GLenum, srcAlpha, GLenum, dstAlpha); \
AliasWrapper5(void, glBlendFuncSeparateiOES, glBlendFuncSeparatei, GLuint, buf, GLenum, srcRGB, GLenum, dstRGB, GLenum, srcAlpha, GLenum, dstAlpha); \
FuncWrapper1(void, glBlendEquation, GLenum, mode); \
AliasWrapper1(void, glBlendEquationEXT, glBlendEquation, GLenum, mode); \
FuncWrapper2(void, glBlendEquationi, GLuint, buf, GLenum, mode); \
AliasWrapper2(void, glBlendEquationiARB, glBlendEquationi, GLuint, buf, GLenum, mode); \
AliasWrapper2(void, glBlendEquationiEXT, glBlendEquationi, GLuint, buf, GLenum, mode); \
AliasWrapper2(void, glBlendEquationiOES, glBlendEquationi, GLuint, buf, GLenum, mode); \
FuncWrapper2(void, glBlendEquationSeparate, GLenum, modeRGB, GLenum, modeAlpha); \
AliasWrapper2(void, glBlendEquationSeparateARB, glBlendEquationSeparate, GLenum, modeRGB, GLenum, modeAlpha); \
AliasWrapper2(void, glBlendEquationSeparateEXT, glBlendEquationSeparate, GLenum, modeRGB, GLenum, modeAlpha); \
FuncWrapper3(void, glBlendEquationSeparatei, GLuint, buf, GLenum, modeRGB, GLenum, modeAlpha); \
AliasWrapper3(void, glBlendEquationSeparateiARB, glBlendEquationSeparatei, GLuint, buf, GLenum, modeRGB, GLenum, modeAlpha); \
AliasWrapper3(void, glBlendEquationSeparateiEXT, glBlendEquationSeparatei, GLuint, buf, GLenum, modeRGB, GLenum, modeAlpha); \
AliasWrapper3(void, glBlendEquationSeparateiOES, glBlendEquationSeparatei, GLuint, buf, GLenum, modeRGB, GLenum, modeAlpha); \
FuncWrapper0(void, glBlendBarrierKHR); \
FuncWrapper4(void, glStencilFuncSeparate, GLenum, face, GLenum, func, GLint, ref, GLuint, mask); \
FuncWrapper2(void, glStencilMaskSeparate, GLenum, face, GLuint, mask); \
FuncWrapper4(void, glStencilOpSeparate, GLenum, face, GLenum, sfail, GLenum, dpfail, GLenum, dppass); \
FuncWrapper5(void, glColorMaski, GLuint, index, GLboolean, r, GLboolean, g, GLboolean, b, GLboolean, a); \
AliasWrapper5(void, glColorMaskiEXT, glColorMaski, GLuint, index, GLboolean, r, GLboolean, g, GLboolean, b, GLboolean, a); \
AliasWrapper5(void, glColorMaskIndexedEXT, glColorMaski, GLuint, index, GLboolean, r, GLboolean, g, GLboolean, b, GLboolean, a); \
AliasWrapper5(void, glColorMaskiOES, glColorMaski, GLuint, index, GLboolean, r, GLboolean, g, GLboolean, b, GLboolean, a); \
FuncWrapper2(void, glSampleMaski, GLuint, maskNumber, GLbitfield, mask); \
FuncWrapper2(void, glSampleCoverage, GLfloat, value, GLboolean, invert); \
AliasWrapper2(void, glSampleCoverageARB, glSampleCoverage, GLfloat, value, GLboolean, invert); \
FuncWrapper1(void, glMinSampleShading, GLfloat, value); \
AliasWrapper1(void, glMinSampleShadingARB, glMinSampleShading, GLfloat, value); \
AliasWrapper1(void, glMinSampleShadingOES, glMinSampleShading, GLfloat, value); \
FuncWrapper2(void, glDepthRangef, GLfloat, n, GLfloat, f); \
FuncWrapper3(void, glDepthRangeIndexed, GLuint, index, GLdouble, n, GLdouble, f); \
FuncWrapper3(void, glDepthRangeArrayv, GLuint, first, GLsizei, count, const GLdouble *, v); \
FuncWrapper2(void, glClipControl, GLenum, origin, GLenum, depth); \
FuncWrapper1(void, glProvokingVertex, GLenum, mode); \
AliasWrapper1(void, glProvokingVertexEXT, glProvokingVertex, GLenum, mode); \
FuncWrapper1(void, glPrimitiveRestartIndex, GLuint, index); \
FuncWrapper1(GLuint, glCreateShader, GLenum, type); \
FuncWrapper1(void, glDeleteShader, GLuint, shader); \
FuncWrapper4(void, glShaderSource, GLuint, shader, GLsizei, count, const GLchar *const*, string, const GLint *, length); \
FuncWrapper1(void, glCompileShader, GLuint, shader); \
FuncWrapper3(GLuint, glCreateShaderProgramv, GLenum, type, GLsizei, count, const GLchar *const*, strings); \
AliasWrapper3(GLuint, glCreateShaderProgramvEXT, glCreateShaderProgramv, GLenum, type, GLsizei, count, const GLchar *const*, strings); \
FuncWrapper0(GLuint, glCreateProgram); \
FuncWrapper1(void, glDeleteProgram, GLuint, program); \
FuncWrapper2(void, glAttachShader, GLuint, program, GLuint, shader); \
FuncWrapper2(void, glDetachShader, GLuint, program, GLuint, shader); \
FuncWrapper0(void, glReleaseShaderCompiler); \
FuncWrapper1(void, glLinkProgram, GLuint, program); \
FuncWrapper3(void, glProgramParameteri, GLuint, program, GLenum, pname, GLint, value); \
AliasWrapper3(void, glProgramParameteriARB, glProgramParameteri, GLuint, program, GLenum, pname, GLint, value); \
AliasWrapper3(void, glProgramParameteriEXT, glProgramParameteri, GLuint, program, GLenum, pname, GLint, value); \
FuncWrapper1(void, glUseProgram, GLuint, program); \
FuncWrapper5(void, glShaderBinary, GLsizei, count, const GLuint *, shaders, GLenum, binaryformat, const void *, binary, GLsizei, length); \
FuncWrapper4(void, glProgramBinary, GLuint, program, GLenum, binaryFormat, const void *, binary, GLsizei, length); \
FuncWrapper3(void, glUseProgramStages, GLuint, pipeline, GLbitfield, stages, GLuint, program); \
AliasWrapper3(void, glUseProgramStagesEXT, glUseProgramStages, GLuint, pipeline, GLbitfield, stages, GLuint, program); \
FuncWrapper1(void, glValidateProgram, GLuint, program); \
FuncWrapper2(void, glGenProgramPipelines, GLsizei, n, GLuint *, pipelines); \
AliasWrapper2(void, glGenProgramPipelinesEXT, glGenProgramPipelines, GLsizei, n, GLuint *, pipelines); \
FuncWrapper1(void, glBindProgramPipeline, GLuint, pipeline); \
AliasWrapper1(void, glBindProgramPipelineEXT, glBindProgramPipeline, GLuint, pipeline); \
FuncWrapper2(void, glActiveShaderProgram, GLuint, pipeline, GLuint, program); \
AliasWrapper2(void, glActiveShaderProgramEXT, glActiveShaderProgram, GLuint, pipeline, GLuint, program); \
FuncWrapper2(void, glDeleteProgramPipelines, GLsizei, n, const GLuint *, pipelines); \
AliasWrapper2(void, glDeleteProgramPipelinesEXT, glDeleteProgramPipelines, GLsizei, n, const GLuint *, pipelines); \
FuncWrapper1(void, glValidateProgramPipeline, GLuint, pipeline); \
AliasWrapper1(void, glValidateProgramPipelineEXT, glValidateProgramPipeline, GLuint, pipeline); \
FuncWrapper2(void, glDebugMessageCallback, GLDEBUGPROC, callback, const void *, userParam); \
AliasWrapper2(void, glDebugMessageCallbackARB, glDebugMessageCallback, GLDEBUGPROC, callback, const void *, userParam); \
AliasWrapper2(void, glDebugMessageCallbackKHR, glDebugMessageCallback, GLDEBUGPROC, callback, const void *, userParam); \
FuncWrapper6(void, glDebugMessageControl, GLenum, source, GLenum, type, GLenum, severity, GLsizei, count, const GLuint *, ids, GLboolean, enabled); \
AliasWrapper6(void, glDebugMessageControlARB, glDebugMessageControl, GLenum, source, GLenum, type, GLenum, severity, GLsizei, count, const GLuint *, ids, GLboolean, enabled); \
AliasWrapper6(void, glDebugMessageControlKHR, glDebugMessageControl, GLenum, source, GLenum, type, GLenum, severity, GLsizei, count, const GLuint *, ids, GLboolean, enabled); \
FuncWrapper6(void, glDebugMessageInsert, GLenum, source, GLenum, type, GLuint, id, GLenum, severity, GLsizei, length, const GLchar *, buf); \
AliasWrapper6(void, glDebugMessageInsertARB, glDebugMessageInsert, GLenum, source, GLenum, type, GLuint, id, GLenum, severity, GLsizei, length, const GLchar *, buf); \
AliasWrapper6(void, glDebugMessageInsertKHR, glDebugMessageInsert, GLenum, source, GLenum, type, GLuint, id, GLenum, severity, GLsizei, length, const GLchar *, buf); \
FuncWrapper4(void, glPushDebugGroup, GLenum, source, GLuint, id, GLsizei, length, const GLchar *, message); \
AliasWrapper4(void, glPushDebugGroupKHR, glPushDebugGroup, GLenum, source, GLuint, id, GLsizei, length, const GLchar *, message); \
FuncWrapper0(void, glPopDebugGroup); \
AliasWrapper0(void, glPopDebugGroupKHR, glPopDebugGroup); \
FuncWrapper4(void, glObjectLabel, GLenum, identifier, GLuint, name, GLsizei, length, const GLchar *, label); \
AliasWrapper4(void, glObjectLabelKHR, glObjectLabel, GLenum, identifier, GLuint, name, GLsizei, length, const GLchar *, label); \
FuncWrapper4(void, glLabelObjectEXT, GLenum, type, GLuint, object, GLsizei, length, const GLchar *, label); \
FuncWrapper3(void, glObjectPtrLabel, const void *, ptr, GLsizei, length, const GLchar *, label); \
AliasWrapper3(void, glObjectPtrLabelKHR, glObjectPtrLabel, const void *, ptr, GLsizei, length, const GLchar *, label); \
FuncWrapper2(void, glEnablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glEnableiEXT, glEnablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glEnableIndexedEXT, glEnablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glEnableiOES, glEnablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glEnableiNV, glEnablei, GLenum, target, GLuint, index); \
FuncWrapper2(void, glDisablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glDisableiEXT, glDisablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glDisableIndexedEXT, glDisablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glDisableiOES, glDisablei, GLenum, target, GLuint, index); \
AliasWrapper2(void, glDisableiNV, glDisablei, GLenum, target, GLuint, index); \
FuncWrapper2(GLboolean, glIsEnabledi, GLenum, target, GLuint, index); \
AliasWrapper2(GLboolean, glIsEnablediEXT, glIsEnabledi, GLenum, target, GLuint, index); \
AliasWrapper2(GLboolean, glIsEnabledIndexedEXT, glIsEnabledi, GLenum, target, GLuint, index); \
AliasWrapper2(GLboolean, glIsEnablediOES, glIsEnabledi, GLenum, target, GLuint, index); \
AliasWrapper2(GLboolean, glIsEnablediNV, glIsEnabledi, GLenum, target, GLuint, index); \
FuncWrapper1(GLboolean, glIsBuffer, GLuint, buffer); \
AliasWrapper1(GLboolean, glIsBufferARB, glIsBuffer, GLuint, buffer); \
FuncWrapper1(GLboolean, glIsFramebuffer, GLuint, framebuffer); \
AliasWrapper1(GLboolean, glIsFramebufferEXT, glIsFramebuffer, GLuint, framebuffer); \
FuncWrapper1(GLboolean, glIsProgram, GLuint, program); \
FuncWrapper1(GLboolean, glIsProgramPipeline, GLuint, pipeline); \
AliasWrapper1(GLboolean, glIsProgramPipelineEXT, glIsProgramPipeline, GLuint, pipeline); \
FuncWrapper1(GLboolean, glIsQuery, GLuint, id); \
AliasWrapper1(GLboolean, glIsQueryARB, glIsQuery, GLuint, id); \
AliasWrapper1(GLboolean, glIsQueryEXT, glIsQuery, GLuint, id); \
FuncWrapper1(GLboolean, glIsRenderbuffer, GLuint, renderbuffer); \
AliasWrapper1(GLboolean, glIsRenderbufferEXT, glIsRenderbuffer, GLuint, renderbuffer); \
FuncWrapper1(GLboolean, glIsSampler, GLuint, sampler); \
FuncWrapper1(GLboolean, glIsShader, GLuint, shader); \
FuncWrapper1(GLboolean, glIsSync, GLsync, sync); \
FuncWrapper1(GLboolean, glIsTransformFeedback, GLuint, id); \
FuncWrapper1(GLboolean, glIsVertexArray, GLuint, array); \
AliasWrapper1(GLboolean, glIsVertexArrayOES, glIsVertexArray, GLuint, array); \
FuncWrapper2(void, glGenBuffers, GLsizei, n, GLuint *, buffers); \
AliasWrapper2(void, glGenBuffersARB, glGenBuffers, GLsizei, n, GLuint *, buffers); \
FuncWrapper2(void, glBindBuffer, GLenum, target, GLuint, buffer); \
AliasWrapper2(void, glBindBufferARB, glBindBuffer, GLenum, target, GLuint, buffer); \
FuncWrapper2(void, glDrawBuffers, GLsizei, n, const GLenum *, bufs); \
AliasWrapper2(void, glDrawBuffersARB, glDrawBuffers, GLsizei, n, const GLenum *, bufs); \
AliasWrapper2(void, glDrawBuffersEXT, glDrawBuffers, GLsizei, n, const GLenum *, bufs); \
FuncWrapper2(void, glGenFramebuffers, GLsizei, n, GLuint *, framebuffers); \
AliasWrapper2(void, glGenFramebuffersEXT, glGenFramebuffers, GLsizei, n, GLuint *, framebuffers); \
FuncWrapper2(void, glBindFramebuffer, GLenum, target, GLuint, framebuffer); \
AliasWrapper2(void, glBindFramebufferEXT, glBindFramebuffer, GLenum, target, GLuint, framebuffer); \
FuncWrapper4(void, glFramebufferTexture, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level); \
AliasWrapper4(void, glFramebufferTextureARB, glFramebufferTexture, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level); \
AliasWrapper4(void, glFramebufferTextureOES, glFramebufferTexture, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level); \
AliasWrapper4(void, glFramebufferTextureEXT, glFramebufferTexture, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level); \
FuncWrapper5(void, glFramebufferTexture1D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level); \
AliasWrapper5(void, glFramebufferTexture1DEXT, glFramebufferTexture1D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level); \
FuncWrapper5(void, glFramebufferTexture2D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level); \
AliasWrapper5(void, glFramebufferTexture2DEXT, glFramebufferTexture2D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level); \
FuncWrapper6(void, glFramebufferTexture3D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLint, zoffset); \
AliasWrapper6(void, glFramebufferTexture3DEXT, glFramebufferTexture3D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLint, zoffset); \
AliasWrapper6(void, glFramebufferTexture3DOES, glFramebufferTexture3D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLint, zoffset); \
FuncWrapper4(void, glFramebufferRenderbuffer, GLenum, target, GLenum, attachment, GLenum, renderbuffertarget, GLuint, renderbuffer); \
AliasWrapper4(void, glFramebufferRenderbufferEXT, glFramebufferRenderbuffer, GLenum, target, GLenum, attachment, GLenum, renderbuffertarget, GLuint, renderbuffer); \
FuncWrapper5(void, glFramebufferTextureLayer, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer); \
AliasWrapper5(void, glFramebufferTextureLayerARB, glFramebufferTextureLayer, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer); \
AliasWrapper5(void, glFramebufferTextureLayerEXT, glFramebufferTextureLayer, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer); \
FuncWrapper3(void, glFramebufferParameteri, GLenum, target, GLenum, pname, GLint, param); \
FuncWrapper2(void, glDeleteFramebuffers, GLsizei, n, const GLuint *, framebuffers); \
AliasWrapper2(void, glDeleteFramebuffersEXT, glDeleteFramebuffers, GLsizei, n, const GLuint *, framebuffers); \
FuncWrapper2(void, glGenRenderbuffers, GLsizei, n, GLuint *, renderbuffers); \
AliasWrapper2(void, glGenRenderbuffersEXT, glGenRenderbuffers, GLsizei, n, GLuint *, renderbuffers); \
FuncWrapper4(void, glRenderbufferStorage, GLenum, target, GLenum, internalformat, GLsizei, width, GLsizei, height); \
AliasWrapper4(void, glRenderbufferStorageEXT, glRenderbufferStorage, GLenum, target, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper5(void, glRenderbufferStorageMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
AliasWrapper5(void, glRenderbufferStorageMultisampleEXT, glRenderbufferStorageMultisample, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper2(void, glDeleteRenderbuffers, GLsizei, n, const GLuint *, renderbuffers); \
AliasWrapper2(void, glDeleteRenderbuffersEXT, glDeleteRenderbuffers, GLsizei, n, const GLuint *, renderbuffers); \
FuncWrapper2(void, glBindRenderbuffer, GLenum, target, GLuint, renderbuffer); \
AliasWrapper2(void, glBindRenderbufferEXT, glBindRenderbuffer, GLenum, target, GLuint, renderbuffer); \
FuncWrapper2(GLsync, glFenceSync, GLenum, condition, GLbitfield, flags); \
FuncWrapper3(GLenum, glClientWaitSync, GLsync, sync, GLbitfield, flags, GLuint64, timeout); \
FuncWrapper3(void, glWaitSync, GLsync, sync, GLbitfield, flags, GLuint64, timeout); \
FuncWrapper1(void, glDeleteSync, GLsync, sync); \
FuncWrapper2(void, glGenQueries, GLsizei, n, GLuint *, ids); \
AliasWrapper2(void, glGenQueriesARB, glGenQueries, GLsizei, n, GLuint *, ids); \
AliasWrapper2(void, glGenQueriesEXT, glGenQueries, GLsizei, n, GLuint *, ids); \
FuncWrapper2(void, glBeginQuery, GLenum, target, GLuint, id); \
AliasWrapper2(void, glBeginQueryARB, glBeginQuery, GLenum, target, GLuint, id); \
AliasWrapper2(void, glBeginQueryEXT, glBeginQuery, GLenum, target, GLuint, id); \
FuncWrapper3(void, glBeginQueryIndexed, GLenum, target, GLuint, index, GLuint, id); \
FuncWrapper1(void, glEndQuery, GLenum, target); \
AliasWrapper1(void, glEndQueryARB, glEndQuery, GLenum, target); \
AliasWrapper1(void, glEndQueryEXT, glEndQuery, GLenum, target); \
FuncWrapper2(void, glEndQueryIndexed, GLenum, target, GLuint, index); \
FuncWrapper2(void, glBeginConditionalRender, GLuint, id, GLenum, mode); \
FuncWrapper0(void, glEndConditionalRender); \
FuncWrapper2(void, glQueryCounter, GLuint, id, GLenum, target); \
AliasWrapper2(void, glQueryCounterEXT, glQueryCounter, GLuint, id, GLenum, target); \
FuncWrapper2(void, glDeleteQueries, GLsizei, n, const GLuint *, ids); \
AliasWrapper2(void, glDeleteQueriesARB, glDeleteQueries, GLsizei, n, const GLuint *, ids); \
AliasWrapper2(void, glDeleteQueriesEXT, glDeleteQueries, GLsizei, n, const GLuint *, ids); \
FuncWrapper4(void, glBufferData, GLenum, target, GLsizeiptr, size, const void *, data, GLenum, usage); \
AliasWrapper4(void, glBufferDataARB, glBufferData, GLenum, target, GLsizeiptr, size, const void *, data, GLenum, usage); \
FuncWrapper4(void, glBufferStorage, GLenum, target, GLsizeiptr, size, const void *, data, GLbitfield, flags); \
FuncWrapper4(void, glBufferSubData, GLenum, target, GLintptr, offset, GLsizeiptr, size, const void *, data); \
AliasWrapper4(void, glBufferSubDataARB, glBufferSubData, GLenum, target, GLintptr, offset, GLsizeiptr, size, const void *, data); \
FuncWrapper5(void, glCopyBufferSubData, GLenum, readTarget, GLenum, writeTarget, GLintptr, readOffset, GLintptr, writeOffset, GLsizeiptr, size); \
FuncWrapper3(void, glBindBufferBase, GLenum, target, GLuint, index, GLuint, buffer); \
AliasWrapper3(void, glBindBufferBaseEXT, glBindBufferBase, GLenum, target, GLuint, index, GLuint, buffer); \
FuncWrapper5(void, glBindBufferRange, GLenum, target, GLuint, index, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
AliasWrapper5(void, glBindBufferRangeEXT, glBindBufferRange, GLenum, target, GLuint, index, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
FuncWrapper4(void, glBindBuffersBase, GLenum, target, GLuint, first, GLsizei, count, const GLuint *, buffers); \
FuncWrapper6(void, glBindBuffersRange, GLenum, target, GLuint, first, GLsizei, count, const GLuint *, buffers, const GLintptr *, offsets, const GLsizeiptr *, sizes); \
FuncWrapper2(void *, glMapBuffer, GLenum, target, GLenum, access); \
AliasWrapper2(void *, glMapBufferARB, glMapBuffer, GLenum, target, GLenum, access); \
AliasWrapper2(void *, glMapBufferOES, glMapBuffer, GLenum, target, GLenum, access); \
FuncWrapper4(void *, glMapBufferRange, GLenum, target, GLintptr, offset, GLsizeiptr, length, GLbitfield, access); \
FuncWrapper3(void, glFlushMappedBufferRange, GLenum, target, GLintptr, offset, GLsizeiptr, length); \
FuncWrapper1(GLboolean, glUnmapBuffer, GLenum, target); \
AliasWrapper1(GLboolean, glUnmapBufferARB, glUnmapBuffer, GLenum, target); \
AliasWrapper1(GLboolean, glUnmapBufferOES, glUnmapBuffer, GLenum, target); \
FuncWrapper4(void, glTransformFeedbackVaryings, GLuint, program, GLsizei, count, const GLchar *const*, varyings, GLenum, bufferMode); \
AliasWrapper4(void, glTransformFeedbackVaryingsEXT, glTransformFeedbackVaryings, GLuint, program, GLsizei, count, const GLchar *const*, varyings, GLenum, bufferMode); \
FuncWrapper2(void, glGenTransformFeedbacks, GLsizei, n, GLuint *, ids); \
FuncWrapper2(void, glDeleteTransformFeedbacks, GLsizei, n, const GLuint *, ids); \
FuncWrapper2(void, glBindTransformFeedback, GLenum, target, GLuint, id); \
FuncWrapper1(void, glBeginTransformFeedback, GLenum, primitiveMode); \
AliasWrapper1(void, glBeginTransformFeedbackEXT, glBeginTransformFeedback, GLenum, primitiveMode); \
FuncWrapper0(void, glPauseTransformFeedback); \
FuncWrapper0(void, glResumeTransformFeedback); \
FuncWrapper0(void, glEndTransformFeedback); \
AliasWrapper0(void, glEndTransformFeedbackEXT, glEndTransformFeedback); \
FuncWrapper2(void, glDrawTransformFeedback, GLenum, mode, GLuint, id); \
FuncWrapper3(void, glDrawTransformFeedbackInstanced, GLenum, mode, GLuint, id, GLsizei, instancecount); \
FuncWrapper3(void, glDrawTransformFeedbackStream, GLenum, mode, GLuint, id, GLuint, stream); \
FuncWrapper4(void, glDrawTransformFeedbackStreamInstanced, GLenum, mode, GLuint, id, GLuint, stream, GLsizei, instancecount); \
FuncWrapper2(void, glDeleteBuffers, GLsizei, n, const GLuint *, buffers); \
AliasWrapper2(void, glDeleteBuffersARB, glDeleteBuffers, GLsizei, n, const GLuint *, buffers); \
FuncWrapper2(void, glGenVertexArrays, GLsizei, n, GLuint *, arrays); \
AliasWrapper2(void, glGenVertexArraysOES, glGenVertexArrays, GLsizei, n, GLuint *, arrays); \
FuncWrapper1(void, glBindVertexArray, GLuint, array); \
AliasWrapper1(void, glBindVertexArrayOES, glBindVertexArray, GLuint, array); \
FuncWrapper2(void, glDeleteVertexArrays, GLsizei, n, const GLuint *, arrays); \
AliasWrapper2(void, glDeleteVertexArraysOES, glDeleteVertexArrays, GLsizei, n, const GLuint *, arrays); \
FuncWrapper2(void, glVertexAttrib1d, GLuint, index, GLdouble, x); \
AliasWrapper2(void, glVertexAttrib1dARB, glVertexAttrib1d, GLuint, index, GLdouble, x); \
FuncWrapper2(void, glVertexAttrib1dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttrib1dvARB, glVertexAttrib1dv, GLuint, index, const GLdouble *, v); \
FuncWrapper2(void, glVertexAttrib1f, GLuint, index, GLfloat, x); \
AliasWrapper2(void, glVertexAttrib1fARB, glVertexAttrib1f, GLuint, index, GLfloat, x); \
FuncWrapper2(void, glVertexAttrib1fv, GLuint, index, const GLfloat *, v); \
AliasWrapper2(void, glVertexAttrib1fvARB, glVertexAttrib1fv, GLuint, index, const GLfloat *, v); \
FuncWrapper2(void, glVertexAttrib1s, GLuint, index, GLshort, x); \
AliasWrapper2(void, glVertexAttrib1sARB, glVertexAttrib1s, GLuint, index, GLshort, x); \
FuncWrapper2(void, glVertexAttrib1sv, GLuint, index, const GLshort *, v); \
AliasWrapper2(void, glVertexAttrib1svARB, glVertexAttrib1sv, GLuint, index, const GLshort *, v); \
FuncWrapper3(void, glVertexAttrib2d, GLuint, index, GLdouble, x, GLdouble, y); \
AliasWrapper3(void, glVertexAttrib2dARB, glVertexAttrib2d, GLuint, index, GLdouble, x, GLdouble, y); \
FuncWrapper2(void, glVertexAttrib2dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttrib2dvARB, glVertexAttrib2dv, GLuint, index, const GLdouble *, v); \
FuncWrapper3(void, glVertexAttrib2f, GLuint, index, GLfloat, x, GLfloat, y); \
AliasWrapper3(void, glVertexAttrib2fARB, glVertexAttrib2f, GLuint, index, GLfloat, x, GLfloat, y); \
FuncWrapper2(void, glVertexAttrib2fv, GLuint, index, const GLfloat *, v); \
AliasWrapper2(void, glVertexAttrib2fvARB, glVertexAttrib2fv, GLuint, index, const GLfloat *, v); \
FuncWrapper3(void, glVertexAttrib2s, GLuint, index, GLshort, x, GLshort, y); \
AliasWrapper3(void, glVertexAttrib2sARB, glVertexAttrib2s, GLuint, index, GLshort, x, GLshort, y); \
FuncWrapper2(void, glVertexAttrib2sv, GLuint, index, const GLshort *, v); \
AliasWrapper2(void, glVertexAttrib2svARB, glVertexAttrib2sv, GLuint, index, const GLshort *, v); \
FuncWrapper4(void, glVertexAttrib3d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z); \
AliasWrapper4(void, glVertexAttrib3dARB, glVertexAttrib3d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z); \
FuncWrapper2(void, glVertexAttrib3dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttrib3dvARB, glVertexAttrib3dv, GLuint, index, const GLdouble *, v); \
FuncWrapper4(void, glVertexAttrib3f, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z); \
AliasWrapper4(void, glVertexAttrib3fARB, glVertexAttrib3f, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z); \
FuncWrapper2(void, glVertexAttrib3fv, GLuint, index, const GLfloat *, v); \
AliasWrapper2(void, glVertexAttrib3fvARB, glVertexAttrib3fv, GLuint, index, const GLfloat *, v); \
FuncWrapper4(void, glVertexAttrib3s, GLuint, index, GLshort, x, GLshort, y, GLshort, z); \
AliasWrapper4(void, glVertexAttrib3sARB, glVertexAttrib3s, GLuint, index, GLshort, x, GLshort, y, GLshort, z); \
FuncWrapper2(void, glVertexAttrib3sv, GLuint, index, const GLshort *, v); \
AliasWrapper2(void, glVertexAttrib3svARB, glVertexAttrib3sv, GLuint, index, const GLshort *, v); \
FuncWrapper2(void, glVertexAttrib4Nbv, GLuint, index, const GLbyte *, v); \
AliasWrapper2(void, glVertexAttrib4NbvARB, glVertexAttrib4Nbv, GLuint, index, const GLbyte *, v); \
FuncWrapper2(void, glVertexAttrib4Niv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glVertexAttrib4NivARB, glVertexAttrib4Niv, GLuint, index, const GLint *, v); \
FuncWrapper2(void, glVertexAttrib4Nsv, GLuint, index, const GLshort *, v); \
AliasWrapper2(void, glVertexAttrib4NsvARB, glVertexAttrib4Nsv, GLuint, index, const GLshort *, v); \
FuncWrapper5(void, glVertexAttrib4Nub, GLuint, index, GLubyte, x, GLubyte, y, GLubyte, z, GLubyte, w); \
FuncWrapper2(void, glVertexAttrib4Nubv, GLuint, index, const GLubyte *, v); \
AliasWrapper2(void, glVertexAttrib4NubvARB, glVertexAttrib4Nubv, GLuint, index, const GLubyte *, v); \
FuncWrapper2(void, glVertexAttrib4Nuiv, GLuint, index, const GLuint *, v); \
AliasWrapper2(void, glVertexAttrib4NuivARB, glVertexAttrib4Nuiv, GLuint, index, const GLuint *, v); \
FuncWrapper2(void, glVertexAttrib4Nusv, GLuint, index, const GLushort *, v); \
AliasWrapper2(void, glVertexAttrib4NusvARB, glVertexAttrib4Nusv, GLuint, index, const GLushort *, v); \
FuncWrapper2(void, glVertexAttrib4bv, GLuint, index, const GLbyte *, v); \
AliasWrapper2(void, glVertexAttrib4bvARB, glVertexAttrib4bv, GLuint, index, const GLbyte *, v); \
FuncWrapper5(void, glVertexAttrib4d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
AliasWrapper5(void, glVertexAttrib4dARB, glVertexAttrib4d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
FuncWrapper2(void, glVertexAttrib4dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttrib4dvARB, glVertexAttrib4dv, GLuint, index, const GLdouble *, v); \
FuncWrapper5(void, glVertexAttrib4f, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
AliasWrapper5(void, glVertexAttrib4fARB, glVertexAttrib4f, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
FuncWrapper2(void, glVertexAttrib4fv, GLuint, index, const GLfloat *, v); \
AliasWrapper2(void, glVertexAttrib4fvARB, glVertexAttrib4fv, GLuint, index, const GLfloat *, v); \
FuncWrapper2(void, glVertexAttrib4iv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glVertexAttrib4ivARB, glVertexAttrib4iv, GLuint, index, const GLint *, v); \
FuncWrapper5(void, glVertexAttrib4s, GLuint, index, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
AliasWrapper5(void, glVertexAttrib4sARB, glVertexAttrib4s, GLuint, index, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
FuncWrapper2(void, glVertexAttrib4sv, GLuint, index, const GLshort *, v); \
AliasWrapper2(void, glVertexAttrib4svARB, glVertexAttrib4sv, GLuint, index, const GLshort *, v); \
FuncWrapper2(void, glVertexAttrib4ubv, GLuint, index, const GLubyte *, v); \
AliasWrapper2(void, glVertexAttrib4ubvARB, glVertexAttrib4ubv, GLuint, index, const GLubyte *, v); \
FuncWrapper2(void, glVertexAttrib4uiv, GLuint, index, const GLuint *, v); \
AliasWrapper2(void, glVertexAttrib4uivARB, glVertexAttrib4uiv, GLuint, index, const GLuint *, v); \
FuncWrapper2(void, glVertexAttrib4usv, GLuint, index, const GLushort *, v); \
AliasWrapper2(void, glVertexAttrib4usvARB, glVertexAttrib4usv, GLuint, index, const GLushort *, v); \
FuncWrapper2(void, glVertexAttribI1i, GLuint, index, GLint, x); \
AliasWrapper2(void, glVertexAttribI1iEXT, glVertexAttribI1i, GLuint, index, GLint, x); \
FuncWrapper2(void, glVertexAttribI1iv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glVertexAttribI1ivEXT, glVertexAttribI1iv, GLuint, index, const GLint *, v); \
FuncWrapper2(void, glVertexAttribI1ui, GLuint, index, GLuint, x); \
AliasWrapper2(void, glVertexAttribI1uiEXT, glVertexAttribI1ui, GLuint, index, GLuint, x); \
FuncWrapper2(void, glVertexAttribI1uiv, GLuint, index, const GLuint *, v); \
AliasWrapper2(void, glVertexAttribI1uivEXT, glVertexAttribI1uiv, GLuint, index, const GLuint *, v); \
FuncWrapper3(void, glVertexAttribI2i, GLuint, index, GLint, x, GLint, y); \
AliasWrapper3(void, glVertexAttribI2iEXT, glVertexAttribI2i, GLuint, index, GLint, x, GLint, y); \
FuncWrapper2(void, glVertexAttribI2iv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glVertexAttribI2ivEXT, glVertexAttribI2iv, GLuint, index, const GLint *, v); \
FuncWrapper3(void, glVertexAttribI2ui, GLuint, index, GLuint, x, GLuint, y); \
AliasWrapper3(void, glVertexAttribI2uiEXT, glVertexAttribI2ui, GLuint, index, GLuint, x, GLuint, y); \
FuncWrapper2(void, glVertexAttribI2uiv, GLuint, index, const GLuint *, v); \
AliasWrapper2(void, glVertexAttribI2uivEXT, glVertexAttribI2uiv, GLuint, index, const GLuint *, v); \
FuncWrapper4(void, glVertexAttribI3i, GLuint, index, GLint, x, GLint, y, GLint, z); \
AliasWrapper4(void, glVertexAttribI3iEXT, glVertexAttribI3i, GLuint, index, GLint, x, GLint, y, GLint, z); \
FuncWrapper2(void, glVertexAttribI3iv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glVertexAttribI3ivEXT, glVertexAttribI3iv, GLuint, index, const GLint *, v); \
FuncWrapper4(void, glVertexAttribI3ui, GLuint, index, GLuint, x, GLuint, y, GLuint, z); \
AliasWrapper4(void, glVertexAttribI3uiEXT, glVertexAttribI3ui, GLuint, index, GLuint, x, GLuint, y, GLuint, z); \
FuncWrapper2(void, glVertexAttribI3uiv, GLuint, index, const GLuint *, v); \
AliasWrapper2(void, glVertexAttribI3uivEXT, glVertexAttribI3uiv, GLuint, index, const GLuint *, v); \
FuncWrapper2(void, glVertexAttribI4bv, GLuint, index, const GLbyte *, v); \
AliasWrapper2(void, glVertexAttribI4bvEXT, glVertexAttribI4bv, GLuint, index, const GLbyte *, v); \
FuncWrapper5(void, glVertexAttribI4i, GLuint, index, GLint, x, GLint, y, GLint, z, GLint, w); \
AliasWrapper5(void, glVertexAttribI4iEXT, glVertexAttribI4i, GLuint, index, GLint, x, GLint, y, GLint, z, GLint, w); \
FuncWrapper2(void, glVertexAttribI4iv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glVertexAttribI4ivEXT, glVertexAttribI4iv, GLuint, index, const GLint *, v); \
FuncWrapper2(void, glVertexAttribI4sv, GLuint, index, const GLshort *, v); \
AliasWrapper2(void, glVertexAttribI4svEXT, glVertexAttribI4sv, GLuint, index, const GLshort *, v); \
FuncWrapper2(void, glVertexAttribI4ubv, GLuint, index, const GLubyte *, v); \
AliasWrapper2(void, glVertexAttribI4ubvEXT, glVertexAttribI4ubv, GLuint, index, const GLubyte *, v); \
FuncWrapper5(void, glVertexAttribI4ui, GLuint, index, GLuint, x, GLuint, y, GLuint, z, GLuint, w); \
AliasWrapper5(void, glVertexAttribI4uiEXT, glVertexAttribI4ui, GLuint, index, GLuint, x, GLuint, y, GLuint, z, GLuint, w); \
FuncWrapper2(void, glVertexAttribI4uiv, GLuint, index, const GLuint *, v); \
AliasWrapper2(void, glVertexAttribI4uivEXT, glVertexAttribI4uiv, GLuint, index, const GLuint *, v); \
FuncWrapper2(void, glVertexAttribI4usv, GLuint, index, const GLushort *, v); \
AliasWrapper2(void, glVertexAttribI4usvEXT, glVertexAttribI4usv, GLuint, index, const GLushort *, v); \
FuncWrapper2(void, glVertexAttribL1d, GLuint, index, GLdouble, x); \
AliasWrapper2(void, glVertexAttribL1dEXT, glVertexAttribL1d, GLuint, index, GLdouble, x); \
FuncWrapper2(void, glVertexAttribL1dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttribL1dvEXT, glVertexAttribL1dv, GLuint, index, const GLdouble *, v); \
FuncWrapper3(void, glVertexAttribL2d, GLuint, index, GLdouble, x, GLdouble, y); \
AliasWrapper3(void, glVertexAttribL2dEXT, glVertexAttribL2d, GLuint, index, GLdouble, x, GLdouble, y); \
FuncWrapper2(void, glVertexAttribL2dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttribL2dvEXT, glVertexAttribL2dv, GLuint, index, const GLdouble *, v); \
FuncWrapper4(void, glVertexAttribL3d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z); \
AliasWrapper4(void, glVertexAttribL3dEXT, glVertexAttribL3d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z); \
FuncWrapper2(void, glVertexAttribL3dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttribL3dvEXT, glVertexAttribL3dv, GLuint, index, const GLdouble *, v); \
FuncWrapper5(void, glVertexAttribL4d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
AliasWrapper5(void, glVertexAttribL4dEXT, glVertexAttribL4d, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
FuncWrapper2(void, glVertexAttribL4dv, GLuint, index, const GLdouble *, v); \
AliasWrapper2(void, glVertexAttribL4dvEXT, glVertexAttribL4dv, GLuint, index, const GLdouble *, v); \
FuncWrapper4(void, glVertexAttribP1ui, GLuint, index, GLenum, type, GLboolean, normalized, GLuint, value); \
FuncWrapper4(void, glVertexAttribP1uiv, GLuint, index, GLenum, type, GLboolean, normalized, const GLuint *, value); \
FuncWrapper4(void, glVertexAttribP2ui, GLuint, index, GLenum, type, GLboolean, normalized, GLuint, value); \
FuncWrapper4(void, glVertexAttribP2uiv, GLuint, index, GLenum, type, GLboolean, normalized, const GLuint *, value); \
FuncWrapper4(void, glVertexAttribP3ui, GLuint, index, GLenum, type, GLboolean, normalized, GLuint, value); \
FuncWrapper4(void, glVertexAttribP3uiv, GLuint, index, GLenum, type, GLboolean, normalized, const GLuint *, value); \
FuncWrapper4(void, glVertexAttribP4ui, GLuint, index, GLenum, type, GLboolean, normalized, GLuint, value); \
FuncWrapper4(void, glVertexAttribP4uiv, GLuint, index, GLenum, type, GLboolean, normalized, const GLuint *, value); \
FuncWrapper6(void, glVertexAttribPointer, GLuint, index, GLint, size, GLenum, type, GLboolean, normalized, GLsizei, stride, const void *, pointer); \
AliasWrapper6(void, glVertexAttribPointerARB, glVertexAttribPointer, GLuint, index, GLint, size, GLenum, type, GLboolean, normalized, GLsizei, stride, const void *, pointer); \
FuncWrapper5(void, glVertexAttribIPointer, GLuint, index, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
AliasWrapper5(void, glVertexAttribIPointerEXT, glVertexAttribIPointer, GLuint, index, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
FuncWrapper5(void, glVertexAttribLPointer, GLuint, index, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
AliasWrapper5(void, glVertexAttribLPointerEXT, glVertexAttribLPointer, GLuint, index, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
FuncWrapper2(void, glVertexAttribBinding, GLuint, attribindex, GLuint, bindingindex); \
FuncWrapper5(void, glVertexAttribFormat, GLuint, attribindex, GLint, size, GLenum, type, GLboolean, normalized, GLuint, relativeoffset); \
FuncWrapper4(void, glVertexAttribIFormat, GLuint, attribindex, GLint, size, GLenum, type, GLuint, relativeoffset); \
FuncWrapper4(void, glVertexAttribLFormat, GLuint, attribindex, GLint, size, GLenum, type, GLuint, relativeoffset); \
FuncWrapper2(void, glVertexAttribDivisor, GLuint, index, GLuint, divisor); \
AliasWrapper2(void, glVertexAttribDivisorARB, glVertexAttribDivisor, GLuint, index, GLuint, divisor); \
FuncWrapper3(void, glBindAttribLocation, GLuint, program, GLuint, index, const GLchar *, name); \
FuncWrapper3(void, glBindFragDataLocation, GLuint, program, GLuint, color, const GLchar *, name); \
AliasWrapper3(void, glBindFragDataLocationEXT, glBindFragDataLocation, GLuint, program, GLuint, color, const GLchar *, name); \
FuncWrapper4(void, glBindFragDataLocationIndexed, GLuint, program, GLuint, colorNumber, GLuint, index, const GLchar *, name); \
FuncWrapper1(void, glEnableVertexAttribArray, GLuint, index); \
AliasWrapper1(void, glEnableVertexAttribArrayARB, glEnableVertexAttribArray, GLuint, index); \
FuncWrapper1(void, glDisableVertexAttribArray, GLuint, index); \
AliasWrapper1(void, glDisableVertexAttribArrayARB, glDisableVertexAttribArray, GLuint, index); \
FuncWrapper4(void, glBindVertexBuffer, GLuint, bindingindex, GLuint, buffer, GLintptr, offset, GLsizei, stride); \
FuncWrapper5(void, glBindVertexBuffers, GLuint, first, GLsizei, count, const GLuint *, buffers, const GLintptr *, offsets, const GLsizei *, strides); \
FuncWrapper2(void, glVertexBindingDivisor, GLuint, bindingindex, GLuint, divisor); \
FuncWrapper7(void, glBindImageTexture, GLuint, unit, GLuint, texture, GLint, level, GLboolean, layered, GLint, layer, GLenum, access, GLenum, format); \
AliasWrapper7(void, glBindImageTextureEXT, glBindImageTexture, GLuint, unit, GLuint, texture, GLint, level, GLboolean, layered, GLint, layer, GLenum, access, GLenum, format); \
FuncWrapper3(void, glBindImageTextures, GLuint, first, GLsizei, count, const GLuint *, textures); \
FuncWrapper2(void, glGenSamplers, GLsizei, count, GLuint *, samplers); \
FuncWrapper2(void, glBindSampler, GLuint, unit, GLuint, sampler); \
FuncWrapper3(void, glBindSamplers, GLuint, first, GLsizei, count, const GLuint *, samplers); \
FuncWrapper3(void, glBindTextures, GLuint, first, GLsizei, count, const GLuint *, textures); \
FuncWrapper2(void, glDeleteSamplers, GLsizei, count, const GLuint *, samplers); \
FuncWrapper3(void, glSamplerParameteri, GLuint, sampler, GLenum, pname, GLint, param); \
FuncWrapper3(void, glSamplerParameterf, GLuint, sampler, GLenum, pname, GLfloat, param); \
FuncWrapper3(void, glSamplerParameteriv, GLuint, sampler, GLenum, pname, const GLint *, param); \
FuncWrapper3(void, glSamplerParameterfv, GLuint, sampler, GLenum, pname, const GLfloat *, param); \
FuncWrapper3(void, glSamplerParameterIiv, GLuint, sampler, GLenum, pname, const GLint *, param); \
AliasWrapper3(void, glSamplerParameterIivEXT, glSamplerParameterIiv, GLuint, sampler, GLenum, pname, const GLint *, param); \
AliasWrapper3(void, glSamplerParameterIivOES, glSamplerParameterIiv, GLuint, sampler, GLenum, pname, const GLint *, param); \
FuncWrapper3(void, glSamplerParameterIuiv, GLuint, sampler, GLenum, pname, const GLuint *, param); \
AliasWrapper3(void, glSamplerParameterIuivEXT, glSamplerParameterIuiv, GLuint, sampler, GLenum, pname, const GLuint *, param); \
AliasWrapper3(void, glSamplerParameterIuivOES, glSamplerParameterIuiv, GLuint, sampler, GLenum, pname, const GLuint *, param); \
FuncWrapper2(void, glPatchParameteri, GLenum, pname, GLint, value); \
AliasWrapper2(void, glPatchParameteriEXT, glPatchParameteri, GLenum, pname, GLint, value); \
AliasWrapper2(void, glPatchParameteriOES, glPatchParameteri, GLenum, pname, GLint, value); \
FuncWrapper2(void, glPatchParameterfv, GLenum, pname, const GLfloat *, values); \
FuncWrapper2(void, glPointParameterf, GLenum, pname, GLfloat, param); \
AliasWrapper2(void, glPointParameterfARB, glPointParameterf, GLenum, pname, GLfloat, param); \
AliasWrapper2(void, glPointParameterfEXT, glPointParameterf, GLenum, pname, GLfloat, param); \
FuncWrapper2(void, glPointParameterfv, GLenum, pname, const GLfloat *, params); \
AliasWrapper2(void, glPointParameterfvARB, glPointParameterfv, GLenum, pname, const GLfloat *, params); \
AliasWrapper2(void, glPointParameterfvEXT, glPointParameterfv, GLenum, pname, const GLfloat *, params); \
FuncWrapper2(void, glPointParameteri, GLenum, pname, GLint, param); \
FuncWrapper2(void, glPointParameteriv, GLenum, pname, const GLint *, params); \
FuncWrapper3(void, glDispatchCompute, GLuint, num_groups_x, GLuint, num_groups_y, GLuint, num_groups_z); \
FuncWrapper1(void, glDispatchComputeIndirect, GLintptr, indirect); \
FuncWrapper1(void, glMemoryBarrier, GLbitfield, barriers); \
AliasWrapper1(void, glMemoryBarrierEXT, glMemoryBarrier, GLbitfield, barriers); \
FuncWrapper1(void, glMemoryBarrierByRegion, GLbitfield, barriers); \
FuncWrapper0(void, glTextureBarrier); \
FuncWrapper1(void, glClearDepthf, GLfloat, d); \
FuncWrapper3(void, glClearBufferfv, GLenum, buffer, GLint, drawbuffer, const GLfloat *, value); \
FuncWrapper3(void, glClearBufferiv, GLenum, buffer, GLint, drawbuffer, const GLint *, value); \
FuncWrapper3(void, glClearBufferuiv, GLenum, buffer, GLint, drawbuffer, const GLuint *, value); \
FuncWrapper4(void, glClearBufferfi, GLenum, buffer, GLint, drawbuffer, GLfloat, depth, GLint, stencil); \
FuncWrapper5(void, glClearBufferData, GLenum, target, GLenum, internalformat, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper7(void, glClearBufferSubData, GLenum, target, GLenum, internalformat, GLintptr, offset, GLsizeiptr, size, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper5(void, glClearTexImage, GLuint, texture, GLint, level, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper11(void, glClearTexSubImage, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper1(void, glInvalidateBufferData, GLuint, buffer); \
FuncWrapper3(void, glInvalidateBufferSubData, GLuint, buffer, GLintptr, offset, GLsizeiptr, length); \
FuncWrapper3(void, glInvalidateFramebuffer, GLenum, target, GLsizei, numAttachments, const GLenum *, attachments); \
FuncWrapper7(void, glInvalidateSubFramebuffer, GLenum, target, GLsizei, numAttachments, const GLenum *, attachments, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper2(void, glInvalidateTexImage, GLuint, texture, GLint, level); \
FuncWrapper8(void, glInvalidateTexSubImage, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth); \
FuncWrapper3(void, glScissorArrayv, GLuint, first, GLsizei, count, const GLint *, v); \
AliasWrapper3(void, glScissorArrayvOES, glScissorArrayv, GLuint, first, GLsizei, count, const GLint *, v); \
AliasWrapper3(void, glScissorArrayvNV, glScissorArrayv, GLuint, first, GLsizei, count, const GLint *, v); \
FuncWrapper5(void, glScissorIndexed, GLuint, index, GLint, left, GLint, bottom, GLsizei, width, GLsizei, height); \
AliasWrapper5(void, glScissorIndexedOES, glScissorIndexed, GLuint, index, GLint, left, GLint, bottom, GLsizei, width, GLsizei, height); \
AliasWrapper5(void, glScissorIndexedNV, glScissorIndexed, GLuint, index, GLint, left, GLint, bottom, GLsizei, width, GLsizei, height); \
FuncWrapper2(void, glScissorIndexedv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glScissorIndexedvOES, glScissorIndexedv, GLuint, index, const GLint *, v); \
AliasWrapper2(void, glScissorIndexedvNV, glScissorIndexedv, GLuint, index, const GLint *, v); \
FuncWrapper5(void, glViewportIndexedf, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, w, GLfloat, h); \
AliasWrapper5(void, glViewportIndexedfOES, glViewportIndexedf, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, w, GLfloat, h); \
AliasWrapper5(void, glViewportIndexedfNV, glViewportIndexedf, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, w, GLfloat, h); \
FuncWrapper2(void, glViewportIndexedfv, GLuint, index, const GLfloat *, v); \
AliasWrapper2(void, glViewportIndexedfvOES, glViewportIndexedfv, GLuint, index, const GLfloat *, v); \
AliasWrapper2(void, glViewportIndexedfvNV, glViewportIndexedfv, GLuint, index, const GLfloat *, v); \
FuncWrapper3(void, glViewportArrayv, GLuint, first, GLsizei, count, const GLfloat *, v); \
AliasWrapper3(void, glViewportArrayvOES, glViewportArrayv, GLuint, first, GLsizei, count, const GLfloat *, v); \
AliasWrapper3(void, glViewportArrayvNV, glViewportArrayv, GLuint, first, GLsizei, count, const GLfloat *, v); \
FuncWrapper3(void, glUniformBlockBinding, GLuint, program, GLuint, uniformBlockIndex, GLuint, uniformBlockBinding); \
FuncWrapper3(void, glShaderStorageBlockBinding, GLuint, program, GLuint, storageBlockIndex, GLuint, storageBlockBinding); \
FuncWrapper3(void, glUniformSubroutinesuiv, GLenum, shadertype, GLsizei, count, const GLuint *, indices); \
FuncWrapper2(void, glUniform1f, GLint, location, GLfloat, v0); \
AliasWrapper2(void, glUniform1fARB, glUniform1f, GLint, location, GLfloat, v0); \
FuncWrapper2(void, glUniform1i, GLint, location, GLint, v0); \
AliasWrapper2(void, glUniform1iARB, glUniform1i, GLint, location, GLint, v0); \
FuncWrapper2(void, glUniform1ui, GLint, location, GLuint, v0); \
AliasWrapper2(void, glUniform1uiEXT, glUniform1ui, GLint, location, GLuint, v0); \
FuncWrapper2(void, glUniform1d, GLint, location, GLdouble, x); \
FuncWrapper3(void, glUniform2f, GLint, location, GLfloat, v0, GLfloat, v1); \
AliasWrapper3(void, glUniform2fARB, glUniform2f, GLint, location, GLfloat, v0, GLfloat, v1); \
FuncWrapper3(void, glUniform2i, GLint, location, GLint, v0, GLint, v1); \
AliasWrapper3(void, glUniform2iARB, glUniform2i, GLint, location, GLint, v0, GLint, v1); \
FuncWrapper3(void, glUniform2ui, GLint, location, GLuint, v0, GLuint, v1); \
AliasWrapper3(void, glUniform2uiEXT, glUniform2ui, GLint, location, GLuint, v0, GLuint, v1); \
FuncWrapper3(void, glUniform2d, GLint, location, GLdouble, x, GLdouble, y); \
FuncWrapper4(void, glUniform3f, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2); \
AliasWrapper4(void, glUniform3fARB, glUniform3f, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2); \
FuncWrapper4(void, glUniform3i, GLint, location, GLint, v0, GLint, v1, GLint, v2); \
AliasWrapper4(void, glUniform3iARB, glUniform3i, GLint, location, GLint, v0, GLint, v1, GLint, v2); \
FuncWrapper4(void, glUniform3ui, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2); \
AliasWrapper4(void, glUniform3uiEXT, glUniform3ui, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2); \
FuncWrapper4(void, glUniform3d, GLint, location, GLdouble, x, GLdouble, y, GLdouble, z); \
FuncWrapper5(void, glUniform4f, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2, GLfloat, v3); \
AliasWrapper5(void, glUniform4fARB, glUniform4f, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2, GLfloat, v3); \
FuncWrapper5(void, glUniform4i, GLint, location, GLint, v0, GLint, v1, GLint, v2, GLint, v3); \
AliasWrapper5(void, glUniform4iARB, glUniform4i, GLint, location, GLint, v0, GLint, v1, GLint, v2, GLint, v3); \
FuncWrapper5(void, glUniform4ui, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2, GLuint, v3); \
AliasWrapper5(void, glUniform4uiEXT, glUniform4ui, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2, GLuint, v3); \
FuncWrapper5(void, glUniform4d, GLint, location, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
FuncWrapper3(void, glUniform1fv, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper3(void, glUniform1fvARB, glUniform1fv, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper3(void, glUniform1iv, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper3(void, glUniform1ivARB, glUniform1iv, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper3(void, glUniform1uiv, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper3(void, glUniform1uivEXT, glUniform1uiv, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper3(void, glUniform1dv, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper3(void, glUniform2fv, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper3(void, glUniform2fvARB, glUniform2fv, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper3(void, glUniform2iv, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper3(void, glUniform2ivARB, glUniform2iv, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper3(void, glUniform2uiv, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper3(void, glUniform2uivEXT, glUniform2uiv, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper3(void, glUniform2dv, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper3(void, glUniform3fv, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper3(void, glUniform3fvARB, glUniform3fv, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper3(void, glUniform3iv, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper3(void, glUniform3ivARB, glUniform3iv, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper3(void, glUniform3uiv, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper3(void, glUniform3uivEXT, glUniform3uiv, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper3(void, glUniform3dv, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper3(void, glUniform4fv, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper3(void, glUniform4fvARB, glUniform4fv, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper3(void, glUniform4iv, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper3(void, glUniform4ivARB, glUniform4iv, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper3(void, glUniform4uiv, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper3(void, glUniform4uivEXT, glUniform4uiv, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper3(void, glUniform4dv, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix2fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper4(void, glUniformMatrix2fvARB, glUniformMatrix2fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix2x3fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix2x4fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix3fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper4(void, glUniformMatrix3fvARB, glUniformMatrix3fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix3x2fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix3x4fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix4fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper4(void, glUniformMatrix4fvARB, glUniformMatrix4fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix4x2fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix4x3fv, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper4(void, glUniformMatrix2dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix2x3dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix2x4dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix3dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix3x2dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix3x4dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix4dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix4x2dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper4(void, glUniformMatrix4x3dv, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper3(void, glProgramUniform1f, GLuint, program, GLint, location, GLfloat, v0); \
AliasWrapper3(void, glProgramUniform1fEXT, glProgramUniform1f, GLuint, program, GLint, location, GLfloat, v0); \
FuncWrapper3(void, glProgramUniform1i, GLuint, program, GLint, location, GLint, v0); \
AliasWrapper3(void, glProgramUniform1iEXT, glProgramUniform1i, GLuint, program, GLint, location, GLint, v0); \
FuncWrapper3(void, glProgramUniform1ui, GLuint, program, GLint, location, GLuint, v0); \
AliasWrapper3(void, glProgramUniform1uiEXT, glProgramUniform1ui, GLuint, program, GLint, location, GLuint, v0); \
FuncWrapper3(void, glProgramUniform1d, GLuint, program, GLint, location, GLdouble, v0); \
AliasWrapper3(void, glProgramUniform1dEXT, glProgramUniform1d, GLuint, program, GLint, location, GLdouble, v0); \
FuncWrapper4(void, glProgramUniform2f, GLuint, program, GLint, location, GLfloat, v0, GLfloat, v1); \
AliasWrapper4(void, glProgramUniform2fEXT, glProgramUniform2f, GLuint, program, GLint, location, GLfloat, v0, GLfloat, v1); \
FuncWrapper4(void, glProgramUniform2i, GLuint, program, GLint, location, GLint, v0, GLint, v1); \
AliasWrapper4(void, glProgramUniform2iEXT, glProgramUniform2i, GLuint, program, GLint, location, GLint, v0, GLint, v1); \
FuncWrapper4(void, glProgramUniform2ui, GLuint, program, GLint, location, GLuint, v0, GLuint, v1); \
AliasWrapper4(void, glProgramUniform2uiEXT, glProgramUniform2ui, GLuint, program, GLint, location, GLuint, v0, GLuint, v1); \
FuncWrapper4(void, glProgramUniform2d, GLuint, program, GLint, location, GLdouble, v0, GLdouble, v1); \
AliasWrapper4(void, glProgramUniform2dEXT, glProgramUniform2d, GLuint, program, GLint, location, GLdouble, v0, GLdouble, v1); \
FuncWrapper5(void, glProgramUniform3f, GLuint, program, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2); \
AliasWrapper5(void, glProgramUniform3fEXT, glProgramUniform3f, GLuint, program, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2); \
FuncWrapper5(void, glProgramUniform3i, GLuint, program, GLint, location, GLint, v0, GLint, v1, GLint, v2); \
AliasWrapper5(void, glProgramUniform3iEXT, glProgramUniform3i, GLuint, program, GLint, location, GLint, v0, GLint, v1, GLint, v2); \
FuncWrapper5(void, glProgramUniform3ui, GLuint, program, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2); \
AliasWrapper5(void, glProgramUniform3uiEXT, glProgramUniform3ui, GLuint, program, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2); \
FuncWrapper5(void, glProgramUniform3d, GLuint, program, GLint, location, GLdouble, v0, GLdouble, v1, GLdouble, v2); \
AliasWrapper5(void, glProgramUniform3dEXT, glProgramUniform3d, GLuint, program, GLint, location, GLdouble, v0, GLdouble, v1, GLdouble, v2); \
FuncWrapper6(void, glProgramUniform4f, GLuint, program, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2, GLfloat, v3); \
AliasWrapper6(void, glProgramUniform4fEXT, glProgramUniform4f, GLuint, program, GLint, location, GLfloat, v0, GLfloat, v1, GLfloat, v2, GLfloat, v3); \
FuncWrapper6(void, glProgramUniform4i, GLuint, program, GLint, location, GLint, v0, GLint, v1, GLint, v2, GLint, v3); \
AliasWrapper6(void, glProgramUniform4iEXT, glProgramUniform4i, GLuint, program, GLint, location, GLint, v0, GLint, v1, GLint, v2, GLint, v3); \
FuncWrapper6(void, glProgramUniform4ui, GLuint, program, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2, GLuint, v3); \
AliasWrapper6(void, glProgramUniform4uiEXT, glProgramUniform4ui, GLuint, program, GLint, location, GLuint, v0, GLuint, v1, GLuint, v2, GLuint, v3); \
FuncWrapper6(void, glProgramUniform4d, GLuint, program, GLint, location, GLdouble, v0, GLdouble, v1, GLdouble, v2, GLdouble, v3); \
AliasWrapper6(void, glProgramUniform4dEXT, glProgramUniform4d, GLuint, program, GLint, location, GLdouble, v0, GLdouble, v1, GLdouble, v2, GLdouble, v3); \
FuncWrapper4(void, glProgramUniform1fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper4(void, glProgramUniform1fvEXT, glProgramUniform1fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper4(void, glProgramUniform1iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper4(void, glProgramUniform1ivEXT, glProgramUniform1iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper4(void, glProgramUniform1uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper4(void, glProgramUniform1uivEXT, glProgramUniform1uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper4(void, glProgramUniform1dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
AliasWrapper4(void, glProgramUniform1dvEXT, glProgramUniform1dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper4(void, glProgramUniform2fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper4(void, glProgramUniform2fvEXT, glProgramUniform2fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper4(void, glProgramUniform2iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper4(void, glProgramUniform2ivEXT, glProgramUniform2iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper4(void, glProgramUniform2uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper4(void, glProgramUniform2uivEXT, glProgramUniform2uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper4(void, glProgramUniform2dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
AliasWrapper4(void, glProgramUniform2dvEXT, glProgramUniform2dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper4(void, glProgramUniform3fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper4(void, glProgramUniform3fvEXT, glProgramUniform3fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper4(void, glProgramUniform3iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper4(void, glProgramUniform3ivEXT, glProgramUniform3iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper4(void, glProgramUniform3uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper4(void, glProgramUniform3uivEXT, glProgramUniform3uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper4(void, glProgramUniform3dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
AliasWrapper4(void, glProgramUniform3dvEXT, glProgramUniform3dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper4(void, glProgramUniform4fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
AliasWrapper4(void, glProgramUniform4fvEXT, glProgramUniform4fv, GLuint, program, GLint, location, GLsizei, count, const GLfloat *, value); \
FuncWrapper4(void, glProgramUniform4iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
AliasWrapper4(void, glProgramUniform4ivEXT, glProgramUniform4iv, GLuint, program, GLint, location, GLsizei, count, const GLint *, value); \
FuncWrapper4(void, glProgramUniform4uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
AliasWrapper4(void, glProgramUniform4uivEXT, glProgramUniform4uiv, GLuint, program, GLint, location, GLsizei, count, const GLuint *, value); \
FuncWrapper4(void, glProgramUniform4dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
AliasWrapper4(void, glProgramUniform4dvEXT, glProgramUniform4dv, GLuint, program, GLint, location, GLsizei, count, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix2fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix2fvEXT, glProgramUniformMatrix2fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix2x3fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix2x3fvEXT, glProgramUniformMatrix2x3fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix2x4fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix2x4fvEXT, glProgramUniformMatrix2x4fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix3fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix3fvEXT, glProgramUniformMatrix3fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix3x2fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix3x2fvEXT, glProgramUniformMatrix3x2fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix3x4fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix3x4fvEXT, glProgramUniformMatrix3x4fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix4fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix4fvEXT, glProgramUniformMatrix4fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix4x2fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix4x2fvEXT, glProgramUniformMatrix4x2fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix4x3fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
AliasWrapper5(void, glProgramUniformMatrix4x3fvEXT, glProgramUniformMatrix4x3fv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
FuncWrapper5(void, glProgramUniformMatrix2dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix2dvEXT, glProgramUniformMatrix2dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix2x3dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix2x3dvEXT, glProgramUniformMatrix2x3dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix2x4dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix2x4dvEXT, glProgramUniformMatrix2x4dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix3dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix3dvEXT, glProgramUniformMatrix3dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix3x2dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix3x2dvEXT, glProgramUniformMatrix3x2dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix3x4dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix3x4dvEXT, glProgramUniformMatrix3x4dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix4dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix4dvEXT, glProgramUniformMatrix4dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix4x2dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix4x2dvEXT, glProgramUniformMatrix4x2dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper5(void, glProgramUniformMatrix4x3dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
AliasWrapper5(void, glProgramUniformMatrix4x3dvEXT, glProgramUniformMatrix4x3dv, GLuint, program, GLint, location, GLsizei, count, GLboolean, transpose, const GLdouble *, value); \
FuncWrapper6(void, glDrawRangeElements, GLenum, mode, GLuint, start, GLuint, end, GLsizei, count, GLenum, type, const void *, indices); \
AliasWrapper6(void, glDrawRangeElementsEXT, glDrawRangeElements, GLenum, mode, GLuint, start, GLuint, end, GLsizei, count, GLenum, type, const void *, indices); \
FuncWrapper7(void, glDrawRangeElementsBaseVertex, GLenum, mode, GLuint, start, GLuint, end, GLsizei, count, GLenum, type, const void *, indices, GLint, basevertex); \
AliasWrapper7(void, glDrawRangeElementsBaseVertexEXT, glDrawRangeElementsBaseVertex, GLenum, mode, GLuint, start, GLuint, end, GLsizei, count, GLenum, type, const void *, indices, GLint, basevertex); \
AliasWrapper7(void, glDrawRangeElementsBaseVertexOES, glDrawRangeElementsBaseVertex, GLenum, mode, GLuint, start, GLuint, end, GLsizei, count, GLenum, type, const void *, indices, GLint, basevertex); \
FuncWrapper5(void, glDrawArraysInstancedBaseInstance, GLenum, mode, GLint, first, GLsizei, count, GLsizei, instancecount, GLuint, baseinstance); \
AliasWrapper5(void, glDrawArraysInstancedBaseInstanceEXT, glDrawArraysInstancedBaseInstance, GLenum, mode, GLint, first, GLsizei, count, GLsizei, instancecount, GLuint, baseinstance); \
FuncWrapper4(void, glDrawArraysInstanced, GLenum, mode, GLint, first, GLsizei, count, GLsizei, instancecount); \
AliasWrapper4(void, glDrawArraysInstancedARB, glDrawArraysInstanced, GLenum, mode, GLint, first, GLsizei, count, GLsizei, instancecount); \
AliasWrapper4(void, glDrawArraysInstancedEXT, glDrawArraysInstanced, GLenum, mode, GLint, first, GLsizei, count, GLsizei, instancecount); \
FuncWrapper5(void, glDrawElementsInstanced, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount); \
AliasWrapper5(void, glDrawElementsInstancedARB, glDrawElementsInstanced, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount); \
AliasWrapper5(void, glDrawElementsInstancedEXT, glDrawElementsInstanced, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount); \
FuncWrapper6(void, glDrawElementsInstancedBaseInstance, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLuint, baseinstance); \
AliasWrapper6(void, glDrawElementsInstancedBaseInstanceEXT, glDrawElementsInstancedBaseInstance, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLuint, baseinstance); \
FuncWrapper5(void, glDrawElementsBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLint, basevertex); \
AliasWrapper5(void, glDrawElementsBaseVertexEXT, glDrawElementsBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLint, basevertex); \
AliasWrapper5(void, glDrawElementsBaseVertexOES, glDrawElementsBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLint, basevertex); \
FuncWrapper6(void, glDrawElementsInstancedBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLint, basevertex); \
AliasWrapper6(void, glDrawElementsInstancedBaseVertexEXT, glDrawElementsInstancedBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLint, basevertex); \
AliasWrapper6(void, glDrawElementsInstancedBaseVertexOES, glDrawElementsInstancedBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLint, basevertex); \
FuncWrapper7(void, glDrawElementsInstancedBaseVertexBaseInstance, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLint, basevertex, GLuint, baseinstance); \
AliasWrapper7(void, glDrawElementsInstancedBaseVertexBaseInstanceEXT, glDrawElementsInstancedBaseVertexBaseInstance, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLint, basevertex, GLuint, baseinstance); \
FuncWrapper4(void, glMultiDrawArrays, GLenum, mode, const GLint *, first, const GLsizei *, count, GLsizei, drawcount); \
AliasWrapper4(void, glMultiDrawArraysEXT, glMultiDrawArrays, GLenum, mode, const GLint *, first, const GLsizei *, count, GLsizei, drawcount); \
FuncWrapper5(void, glMultiDrawElements, GLenum, mode, const GLsizei *, count, GLenum, type, const void *const*, indices, GLsizei, drawcount); \
FuncWrapper6(void, glMultiDrawElementsBaseVertex, GLenum, mode, const GLsizei *, count, GLenum, type, const void *const*, indices, GLsizei, drawcount, const GLint *, basevertex); \
AliasWrapper6(void, glMultiDrawElementsBaseVertexEXT, glMultiDrawElementsBaseVertex, GLenum, mode, const GLsizei *, count, GLenum, type, const void *const*, indices, GLsizei, drawcount, const GLint *, basevertex); \
AliasWrapper6(void, glMultiDrawElementsBaseVertexOES, glMultiDrawElementsBaseVertex, GLenum, mode, const GLsizei *, count, GLenum, type, const void *const*, indices, GLsizei, drawcount, const GLint *, basevertex); \
FuncWrapper4(void, glMultiDrawArraysIndirect, GLenum, mode, const void *, indirect, GLsizei, drawcount, GLsizei, stride); \
FuncWrapper5(void, glMultiDrawElementsIndirect, GLenum, mode, GLenum, type, const void *, indirect, GLsizei, drawcount, GLsizei, stride); \
FuncWrapper2(void, glDrawArraysIndirect, GLenum, mode, const void *, indirect); \
FuncWrapper3(void, glDrawElementsIndirect, GLenum, mode, GLenum, type, const void *, indirect); \
FuncWrapper10(void, glBlitFramebuffer, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter); \
AliasWrapper10(void, glBlitFramebufferEXT, glBlitFramebuffer, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter); \
FuncWrapper8(void, glPrimitiveBoundingBox, GLfloat, minX, GLfloat, minY, GLfloat, minZ, GLfloat, minW, GLfloat, maxX, GLfloat, maxY, GLfloat, maxZ, GLfloat, maxW); \
AliasWrapper8(void, glPrimitiveBoundingBoxEXT, glPrimitiveBoundingBox, GLfloat, minX, GLfloat, minY, GLfloat, minZ, GLfloat, minW, GLfloat, maxX, GLfloat, maxY, GLfloat, maxZ, GLfloat, maxW); \
AliasWrapper8(void, glPrimitiveBoundingBoxOES, glPrimitiveBoundingBox, GLfloat, minX, GLfloat, minY, GLfloat, minZ, GLfloat, minW, GLfloat, maxX, GLfloat, maxY, GLfloat, maxZ, GLfloat, maxW); \
FuncWrapper0(void, glBlendBarrier); \
FuncWrapper6(void, glFramebufferTexture2DMultisampleEXT, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLsizei, samples); \
FuncWrapper3(void, glDiscardFramebufferEXT, GLenum, target, GLsizei, numAttachments, const GLenum *, attachments); \
FuncWrapper3(void, glDepthRangeArrayfvOES, GLuint, first, GLsizei, count, const GLfloat *, v); \
AliasWrapper3(void, glDepthRangeArrayfvNV, glDepthRangeArrayfvOES, GLuint, first, GLsizei, count, const GLfloat *, v); \
FuncWrapper3(void, glDepthRangeIndexedfOES, GLuint, index, GLfloat, n, GLfloat, f); \
AliasWrapper3(void, glDepthRangeIndexedfNV, glDepthRangeIndexedfOES, GLuint, index, GLfloat, n, GLfloat, f); \
FuncWrapper5(void, glNamedStringARB, GLenum, type, GLint, namelen, const GLchar *, name, GLint, stringlen, const GLchar *, string); \
FuncWrapper2(void, glDeleteNamedStringARB, GLint, namelen, const GLchar *, name); \
FuncWrapper4(void, glCompileShaderIncludeARB, GLuint, shader, GLsizei, count, const GLchar *const*, path, const GLint *, length); \
FuncWrapper2(GLboolean, glIsNamedStringARB, GLint, namelen, const GLchar *, name); \
FuncWrapper5(void, glGetNamedStringARB, GLint, namelen, const GLchar *, name, GLsizei, bufSize, GLint *, stringlen, GLchar *, string); \
FuncWrapper4(void, glGetNamedStringivARB, GLint, namelen, const GLchar *, name, GLenum, pname, GLint *, params); \
FuncWrapper6(void, glDispatchComputeGroupSizeARB, GLuint, num_groups_x, GLuint, num_groups_y, GLuint, num_groups_z, GLuint, group_size_x, GLuint, group_size_y, GLuint, group_size_z); \
FuncWrapper5(void, glMultiDrawArraysIndirectCount, GLenum, mode, const void *, indirect, GLintptr, drawcount, GLsizei, maxdrawcount, GLsizei, stride); \
AliasWrapper5(void, glMultiDrawArraysIndirectCountARB, glMultiDrawArraysIndirectCount, GLenum, mode, const void *, indirect, GLintptr, drawcount, GLsizei, maxdrawcount, GLsizei, stride); \
FuncWrapper6(void, glMultiDrawElementsIndirectCount, GLenum, mode, GLenum, type, const void *, indirect, GLintptr, drawcount, GLsizei, maxdrawcount, GLsizei, stride); \
AliasWrapper6(void, glMultiDrawElementsIndirectCountARB, glMultiDrawElementsIndirectCount, GLenum, mode, GLenum, type, const void *, indirect, GLintptr, drawcount, GLsizei, maxdrawcount, GLsizei, stride); \
FuncWrapper2(void, glRasterSamplesEXT, GLuint, samples, GLboolean, fixedsamplelocations); \
FuncWrapper2(void, glDepthBoundsEXT, GLclampd, zmin, GLclampd, zmax); \
FuncWrapper3(void, glPolygonOffsetClamp, GLfloat, factor, GLfloat, units, GLfloat, clamp); \
AliasWrapper3(void, glPolygonOffsetClampEXT, glPolygonOffsetClamp, GLfloat, factor, GLfloat, units, GLfloat, clamp); \
FuncWrapper2(void, glInsertEventMarkerEXT, GLsizei, length, const GLchar *, marker); \
FuncWrapper2(void, glPushGroupMarkerEXT, GLsizei, length, const GLchar *, marker); \
FuncWrapper0(void, glPopGroupMarkerEXT); \
FuncWrapper0(void, glFrameTerminatorGREMEDY); \
FuncWrapper2(void, glStringMarkerGREMEDY, GLsizei, len, const void *, string); \
FuncWrapper6(void, glFramebufferTextureMultiviewOVR, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, baseViewIndex, GLsizei, numViews); \
FuncWrapper7(void, glFramebufferTextureMultisampleMultiviewOVR, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLsizei, samples, GLint, baseViewIndex, GLsizei, numViews); \
FuncWrapper1(void, glMaxShaderCompilerThreadsKHR, GLuint, count); \
AliasWrapper1(void, glMaxShaderCompilerThreadsARB, glMaxShaderCompilerThreadsKHR, GLuint, count); \
FuncWrapper5(void, glSpecializeShader, GLuint, shader, const GLchar *, pEntryPoint, GLuint, numSpecializationConstants, const GLuint *, pConstantIndex, const GLuint *, pConstantValue); \
AliasWrapper5(void, glSpecializeShaderARB, glSpecializeShader, GLuint, shader, const GLchar *, pEntryPoint, GLuint, numSpecializationConstants, const GLuint *, pConstantIndex, const GLuint *, pConstantValue); \
FuncWrapper2(void, glGetUnsignedBytevEXT, GLenum, pname, GLubyte *, data); \
FuncWrapper3(void, glGetUnsignedBytei_vEXT, GLenum, target, GLuint, index, GLubyte *, data); \
FuncWrapper2(void, glDeleteMemoryObjectsEXT, GLsizei, n, const GLuint *, memoryObjects); \
FuncWrapper1(GLboolean, glIsMemoryObjectEXT, GLuint, memoryObject); \
FuncWrapper2(void, glCreateMemoryObjectsEXT, GLsizei, n, GLuint *, memoryObjects); \
FuncWrapper3(void, glMemoryObjectParameterivEXT, GLuint, memoryObject, GLenum, pname, const GLint *, params); \
FuncWrapper3(void, glGetMemoryObjectParameterivEXT, GLuint, memoryObject, GLenum, pname, GLint *, params); \
FuncWrapper7(void, glTexStorageMem2DEXT, GLenum, target, GLsizei, levels, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLuint, memory, GLuint64, offset); \
FuncWrapper8(void, glTexStorageMem2DMultisampleEXT, GLenum, target, GLsizei, samples, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLboolean, fixedSampleLocations, GLuint, memory, GLuint64, offset); \
FuncWrapper8(void, glTexStorageMem3DEXT, GLenum, target, GLsizei, levels, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLuint, memory, GLuint64, offset); \
FuncWrapper9(void, glTexStorageMem3DMultisampleEXT, GLenum, target, GLsizei, samples, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedSampleLocations, GLuint, memory, GLuint64, offset); \
FuncWrapper4(void, glBufferStorageMemEXT, GLenum, target, GLsizeiptr, size, GLuint, memory, GLuint64, offset); \
FuncWrapper7(void, glTextureStorageMem2DEXT, GLuint, texture, GLsizei, levels, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLuint, memory, GLuint64, offset); \
FuncWrapper8(void, glTextureStorageMem2DMultisampleEXT, GLuint, texture, GLsizei, samples, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLboolean, fixedSampleLocations, GLuint, memory, GLuint64, offset); \
FuncWrapper8(void, glTextureStorageMem3DEXT, GLuint, texture, GLsizei, levels, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLuint, memory, GLuint64, offset); \
FuncWrapper9(void, glTextureStorageMem3DMultisampleEXT, GLuint, texture, GLsizei, samples, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedSampleLocations, GLuint, memory, GLuint64, offset); \
FuncWrapper4(void, glNamedBufferStorageMemEXT, GLuint, buffer, GLsizeiptr, size, GLuint, memory, GLuint64, offset); \
FuncWrapper6(void, glTexStorageMem1DEXT, GLenum, target, GLsizei, levels, GLenum, internalFormat, GLsizei, width, GLuint, memory, GLuint64, offset); \
FuncWrapper6(void, glTextureStorageMem1DEXT, GLuint, texture, GLsizei, levels, GLenum, internalFormat, GLsizei, width, GLuint, memory, GLuint64, offset); \
FuncWrapper2(void, glGenSemaphoresEXT, GLsizei, n, GLuint *, semaphores); \
FuncWrapper2(void, glDeleteSemaphoresEXT, GLsizei, n, const GLuint *, semaphores); \
FuncWrapper1(GLboolean, glIsSemaphoreEXT, GLuint, semaphore); \
FuncWrapper3(void, glSemaphoreParameterui64vEXT, GLuint, semaphore, GLenum, pname, const GLuint64 *, params); \
FuncWrapper3(void, glGetSemaphoreParameterui64vEXT, GLuint, semaphore, GLenum, pname, GLuint64 *, params); \
FuncWrapper6(void, glWaitSemaphoreEXT, GLuint, semaphore, GLuint, numBufferBarriers, const GLuint *, buffers, GLuint, numTextureBarriers, const GLuint *, textures, const GLenum *, srcLayouts); \
FuncWrapper6(void, glSignalSemaphoreEXT, GLuint, semaphore, GLuint, numBufferBarriers, const GLuint *, buffers, GLuint, numTextureBarriers, const GLuint *, textures, const GLenum *, dstLayouts); \
FuncWrapper4(void, glImportMemoryFdEXT, GLuint, memory, GLuint64, size, GLenum, handleType, GLint, fd); \
FuncWrapper3(void, glImportSemaphoreFdEXT, GLuint, semaphore, GLenum, handleType, GLint, fd); \
FuncWrapper4(void, glImportMemoryWin32HandleEXT, GLuint, memory, GLuint64, size, GLenum, handleType, void *, handle); \
FuncWrapper4(void, glImportMemoryWin32NameEXT, GLuint, memory, GLuint64, size, GLenum, handleType, const void *, name); \
FuncWrapper3(void, glImportSemaphoreWin32HandleEXT, GLuint, semaphore, GLenum, handleType, void *, handle); \
FuncWrapper3(void, glImportSemaphoreWin32NameEXT, GLuint, semaphore, GLenum, handleType, const void *, name); \
FuncWrapper3(GLboolean, glAcquireKeyedMutexWin32EXT, GLuint, memory, GLuint64, key, GLuint, timeout); \
FuncWrapper2(GLboolean, glReleaseKeyedMutexWin32EXT, GLuint, memory, GLuint64, key); \
FuncWrapper8(void, glCompressedTextureImage1DEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLint, border, GLsizei, imageSize, const void *, bits); \
FuncWrapper9(void, glCompressedTextureImage2DEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLsizei, imageSize, const void *, bits); \
FuncWrapper10(void, glCompressedTextureImage3DEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLsizei, imageSize, const void *, bits); \
FuncWrapper8(void, glCompressedTextureSubImage1DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLsizei, imageSize, const void *, bits); \
FuncWrapper10(void, glCompressedTextureSubImage2DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLsizei, imageSize, const void *, bits); \
FuncWrapper12(void, glCompressedTextureSubImage3DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLsizei, imageSize, const void *, bits); \
FuncWrapper2(void, glGenerateTextureMipmapEXT, GLuint, texture, GLenum, target); \
FuncWrapper3(void, glGetPointeri_vEXT, GLenum, pname, GLuint, index, void **, params); \
FuncWrapper3(void, glGetDoubleIndexedvEXT, GLenum, target, GLuint, index, GLdouble *, data); \
FuncWrapper3(void, glGetPointerIndexedvEXT, GLenum, target, GLuint, index, void **, data); \
FuncWrapper3(void, glGetIntegerIndexedvEXT, GLenum, target, GLuint, index, GLint *, data); \
FuncWrapper3(void, glGetBooleanIndexedvEXT, GLenum, target, GLuint, index, GLboolean *, data); \
FuncWrapper3(void, glGetFloatIndexedvEXT, GLenum, target, GLuint, index, GLfloat *, data); \
FuncWrapper6(void, glGetMultiTexImageEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, format, GLenum, type, void *, pixels); \
FuncWrapper4(void, glGetMultiTexParameterfvEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLfloat *, params); \
FuncWrapper4(void, glGetMultiTexParameterivEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetMultiTexParameterIivEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetMultiTexParameterIuivEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLuint *, params); \
FuncWrapper5(void, glGetMultiTexLevelParameterfvEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, pname, GLfloat *, params); \
FuncWrapper5(void, glGetMultiTexLevelParameterivEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetCompressedMultiTexImageEXT, GLenum, texunit, GLenum, target, GLint, lod, void *, img); \
FuncWrapper3(void, glGetNamedBufferPointervEXT, GLuint, buffer, GLenum, pname, void **, params); \
AliasWrapper3(void, glGetNamedBufferPointerv, glGetNamedBufferPointervEXT, GLuint, buffer, GLenum, pname, void **, params); \
FuncWrapper4(void, glGetNamedProgramivEXT, GLuint, program, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetNamedFramebufferAttachmentParameterivEXT, GLuint, framebuffer, GLenum, attachment, GLenum, pname, GLint *, params); \
AliasWrapper4(void, glGetNamedFramebufferAttachmentParameteriv, glGetNamedFramebufferAttachmentParameterivEXT, GLuint, framebuffer, GLenum, attachment, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetNamedBufferParameterivEXT, GLuint, buffer, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetNamedBufferParameteriv, glGetNamedBufferParameterivEXT, GLuint, buffer, GLenum, pname, GLint *, params); \
FuncWrapper2(GLenum, glCheckNamedFramebufferStatusEXT, GLuint, framebuffer, GLenum, target); \
AliasWrapper2(GLenum, glCheckNamedFramebufferStatus, glCheckNamedFramebufferStatusEXT, GLuint, framebuffer, GLenum, target); \
FuncWrapper4(void, glGetNamedBufferSubDataEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, void *, data); \
FuncWrapper3(void, glGetNamedFramebufferParameterivEXT, GLuint, framebuffer, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetFramebufferParameterivEXT, glGetNamedFramebufferParameterivEXT, GLuint, framebuffer, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetNamedFramebufferParameteriv, glGetNamedFramebufferParameterivEXT, GLuint, framebuffer, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetNamedRenderbufferParameterivEXT, GLuint, renderbuffer, GLenum, pname, GLint *, params); \
AliasWrapper3(void, glGetNamedRenderbufferParameteriv, glGetNamedRenderbufferParameterivEXT, GLuint, renderbuffer, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetVertexArrayIntegervEXT, GLuint, vaobj, GLenum, pname, GLint *, param); \
FuncWrapper3(void, glGetVertexArrayPointervEXT, GLuint, vaobj, GLenum, pname, void **, param); \
FuncWrapper4(void, glGetVertexArrayIntegeri_vEXT, GLuint, vaobj, GLuint, index, GLenum, pname, GLint *, param); \
FuncWrapper4(void, glGetVertexArrayPointeri_vEXT, GLuint, vaobj, GLuint, index, GLenum, pname, void **, param); \
FuncWrapper4(void, glGetCompressedTextureImageEXT, GLuint, texture, GLenum, target, GLint, lod, void *, img); \
FuncWrapper6(void, glGetTextureImageEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, format, GLenum, type, void *, pixels); \
FuncWrapper4(void, glGetTextureParameterivEXT, GLuint, texture, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetTextureParameterfvEXT, GLuint, texture, GLenum, target, GLenum, pname, GLfloat *, params); \
FuncWrapper4(void, glGetTextureParameterIivEXT, GLuint, texture, GLenum, target, GLenum, pname, GLint *, params); \
FuncWrapper4(void, glGetTextureParameterIuivEXT, GLuint, texture, GLenum, target, GLenum, pname, GLuint *, params); \
FuncWrapper5(void, glGetTextureLevelParameterivEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, pname, GLint *, params); \
FuncWrapper5(void, glGetTextureLevelParameterfvEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, pname, GLfloat *, params); \
FuncWrapper3(void, glBindMultiTextureEXT, GLenum, texunit, GLenum, target, GLuint, texture); \
FuncWrapper2(void *, glMapNamedBufferEXT, GLuint, buffer, GLenum, access); \
AliasWrapper2(void *, glMapNamedBuffer, glMapNamedBufferEXT, GLuint, buffer, GLenum, access); \
FuncWrapper4(void *, glMapNamedBufferRangeEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, length, GLbitfield, access); \
FuncWrapper3(void, glFlushMappedNamedBufferRangeEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, length); \
FuncWrapper1(GLboolean, glUnmapNamedBufferEXT, GLuint, buffer); \
AliasWrapper1(GLboolean, glUnmapNamedBuffer, glUnmapNamedBufferEXT, GLuint, buffer); \
FuncWrapper5(void, glClearNamedBufferDataEXT, GLuint, buffer, GLenum, internalformat, GLenum, format, GLenum, type, const void *, data); \
AliasWrapper5(void, glClearNamedBufferData, glClearNamedBufferDataEXT, GLuint, buffer, GLenum, internalformat, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper7(void, glClearNamedBufferSubDataEXT, GLuint, buffer, GLenum, internalformat, GLsizeiptr, offset, GLsizeiptr, size, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper4(void, glNamedBufferDataEXT, GLuint, buffer, GLsizeiptr, size, const void *, data, GLenum, usage); \
FuncWrapper4(void, glNamedBufferStorageEXT, GLuint, buffer, GLsizeiptr, size, const void *, data, GLbitfield, flags); \
FuncWrapper4(void, glNamedBufferSubDataEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, const void *, data); \
FuncWrapper5(void, glNamedCopyBufferSubDataEXT, GLuint, readBuffer, GLuint, writeBuffer, GLintptr, readOffset, GLintptr, writeOffset, GLsizeiptr, size); \
FuncWrapper4(void, glNamedFramebufferTextureEXT, GLuint, framebuffer, GLenum, attachment, GLuint, texture, GLint, level); \
AliasWrapper4(void, glNamedFramebufferTexture, glNamedFramebufferTextureEXT, GLuint, framebuffer, GLenum, attachment, GLuint, texture, GLint, level); \
FuncWrapper5(void, glNamedFramebufferTexture1DEXT, GLuint, framebuffer, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level); \
FuncWrapper5(void, glNamedFramebufferTexture2DEXT, GLuint, framebuffer, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level); \
FuncWrapper6(void, glNamedFramebufferTexture3DEXT, GLuint, framebuffer, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLint, zoffset); \
FuncWrapper4(void, glNamedFramebufferRenderbufferEXT, GLuint, framebuffer, GLenum, attachment, GLenum, renderbuffertarget, GLuint, renderbuffer); \
AliasWrapper4(void, glNamedFramebufferRenderbuffer, glNamedFramebufferRenderbufferEXT, GLuint, framebuffer, GLenum, attachment, GLenum, renderbuffertarget, GLuint, renderbuffer); \
FuncWrapper5(void, glNamedFramebufferTextureLayerEXT, GLuint, framebuffer, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer); \
AliasWrapper5(void, glNamedFramebufferTextureLayer, glNamedFramebufferTextureLayerEXT, GLuint, framebuffer, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer); \
FuncWrapper3(void, glNamedFramebufferParameteriEXT, GLuint, framebuffer, GLenum, pname, GLint, param); \
AliasWrapper3(void, glNamedFramebufferParameteri, glNamedFramebufferParameteriEXT, GLuint, framebuffer, GLenum, pname, GLint, param); \
FuncWrapper4(void, glNamedRenderbufferStorageEXT, GLuint, renderbuffer, GLenum, internalformat, GLsizei, width, GLsizei, height); \
AliasWrapper4(void, glNamedRenderbufferStorage, glNamedRenderbufferStorageEXT, GLuint, renderbuffer, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper5(void, glNamedRenderbufferStorageMultisampleEXT, GLuint, renderbuffer, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
AliasWrapper5(void, glNamedRenderbufferStorageMultisample, glNamedRenderbufferStorageMultisampleEXT, GLuint, renderbuffer, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper2(void, glFramebufferDrawBufferEXT, GLuint, framebuffer, GLenum, mode); \
AliasWrapper2(void, glNamedFramebufferDrawBuffer, glFramebufferDrawBufferEXT, GLuint, framebuffer, GLenum, mode); \
FuncWrapper3(void, glFramebufferDrawBuffersEXT, GLuint, framebuffer, GLsizei, n, const GLenum *, bufs); \
AliasWrapper3(void, glNamedFramebufferDrawBuffers, glFramebufferDrawBuffersEXT, GLuint, framebuffer, GLsizei, n, const GLenum *, bufs); \
FuncWrapper2(void, glFramebufferReadBufferEXT, GLuint, framebuffer, GLenum, mode); \
AliasWrapper2(void, glNamedFramebufferReadBuffer, glFramebufferReadBufferEXT, GLuint, framebuffer, GLenum, mode); \
FuncWrapper4(void, glTextureBufferEXT, GLuint, texture, GLenum, target, GLenum, internalformat, GLuint, buffer); \
FuncWrapper6(void, glTextureBufferRangeEXT, GLuint, texture, GLenum, target, GLenum, internalformat, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
FuncWrapper9(void, glTextureImage1DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper10(void, glTextureImage2DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper11(void, glTextureImage3DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper4(void, glTextureParameterfEXT, GLuint, texture, GLenum, target, GLenum, pname, GLfloat, param); \
FuncWrapper4(void, glTextureParameterfvEXT, GLuint, texture, GLenum, target, GLenum, pname, const GLfloat *, params); \
FuncWrapper4(void, glTextureParameteriEXT, GLuint, texture, GLenum, target, GLenum, pname, GLint, param); \
FuncWrapper4(void, glTextureParameterivEXT, GLuint, texture, GLenum, target, GLenum, pname, const GLint *, params); \
FuncWrapper4(void, glTextureParameterIivEXT, GLuint, texture, GLenum, target, GLenum, pname, const GLint *, params); \
FuncWrapper4(void, glTextureParameterIuivEXT, GLuint, texture, GLenum, target, GLenum, pname, const GLuint *, params); \
FuncWrapper5(void, glTextureStorage1DEXT, GLuint, texture, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width); \
FuncWrapper6(void, glTextureStorage2DEXT, GLuint, texture, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper7(void, glTextureStorage3DEXT, GLuint, texture, GLenum, target, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth); \
FuncWrapper7(void, glTextureStorage2DMultisampleEXT, GLuint, texture, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLboolean, fixedsamplelocations); \
FuncWrapper8(void, glTextureStorage3DMultisampleEXT, GLuint, texture, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedsamplelocations); \
FuncWrapper8(void, glTextureSubImage1DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper10(void, glTextureSubImage2DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper12(void, glTextureSubImage3DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper8(void, glCopyTextureImage1DEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLint, border); \
FuncWrapper9(void, glCopyTextureImage2DEXT, GLuint, texture, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLint, border); \
FuncWrapper7(void, glCopyTextureSubImage1DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, x, GLint, y, GLsizei, width); \
FuncWrapper9(void, glCopyTextureSubImage2DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper10(void, glCopyTextureSubImage3DEXT, GLuint, texture, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper4(void, glMultiTexParameteriEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLint, param); \
FuncWrapper4(void, glMultiTexParameterivEXT, GLenum, texunit, GLenum, target, GLenum, pname, const GLint *, params); \
FuncWrapper4(void, glMultiTexParameterfEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLfloat, param); \
FuncWrapper4(void, glMultiTexParameterfvEXT, GLenum, texunit, GLenum, target, GLenum, pname, const GLfloat *, params); \
FuncWrapper9(void, glMultiTexImage1DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper10(void, glMultiTexImage2DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper8(void, glMultiTexSubImage1DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper10(void, glMultiTexSubImage2DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper8(void, glCopyMultiTexImage1DEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLint, border); \
FuncWrapper9(void, glCopyMultiTexImage2DEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLint, border); \
FuncWrapper7(void, glCopyMultiTexSubImage1DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, x, GLint, y, GLsizei, width); \
FuncWrapper9(void, glCopyMultiTexSubImage2DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper11(void, glMultiTexImage3DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper12(void, glMultiTexSubImage3DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper10(void, glCopyMultiTexSubImage3DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper10(void, glCompressedMultiTexImage3DEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLsizei, imageSize, const void *, bits); \
FuncWrapper9(void, glCompressedMultiTexImage2DEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLsizei, imageSize, const void *, bits); \
FuncWrapper8(void, glCompressedMultiTexImage1DEXT, GLenum, texunit, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLint, border, GLsizei, imageSize, const void *, bits); \
FuncWrapper12(void, glCompressedMultiTexSubImage3DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLsizei, imageSize, const void *, bits); \
FuncWrapper10(void, glCompressedMultiTexSubImage2DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLsizei, imageSize, const void *, bits); \
FuncWrapper8(void, glCompressedMultiTexSubImage1DEXT, GLenum, texunit, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLsizei, imageSize, const void *, bits); \
FuncWrapper4(void, glMultiTexBufferEXT, GLenum, texunit, GLenum, target, GLenum, internalformat, GLuint, buffer); \
FuncWrapper4(void, glMultiTexParameterIivEXT, GLenum, texunit, GLenum, target, GLenum, pname, const GLint *, params); \
FuncWrapper4(void, glMultiTexParameterIuivEXT, GLenum, texunit, GLenum, target, GLenum, pname, const GLuint *, params); \
FuncWrapper2(void, glGenerateMultiTexMipmapEXT, GLenum, texunit, GLenum, target); \
FuncWrapper8(void, glVertexArrayVertexAttribOffsetEXT, GLuint, vaobj, GLuint, buffer, GLuint, index, GLint, size, GLenum, type, GLboolean, normalized, GLsizei, stride, GLintptr, offset); \
FuncWrapper7(void, glVertexArrayVertexAttribIOffsetEXT, GLuint, vaobj, GLuint, buffer, GLuint, index, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
FuncWrapper2(void, glEnableVertexArrayAttribEXT, GLuint, vaobj, GLuint, index); \
AliasWrapper2(void, glEnableVertexArrayAttrib, glEnableVertexArrayAttribEXT, GLuint, vaobj, GLuint, index); \
FuncWrapper2(void, glDisableVertexArrayAttribEXT, GLuint, vaobj, GLuint, index); \
AliasWrapper2(void, glDisableVertexArrayAttrib, glDisableVertexArrayAttribEXT, GLuint, vaobj, GLuint, index); \
FuncWrapper5(void, glVertexArrayBindVertexBufferEXT, GLuint, vaobj, GLuint, bindingindex, GLuint, buffer, GLintptr, offset, GLsizei, stride); \
AliasWrapper5(void, glVertexArrayVertexBuffer, glVertexArrayBindVertexBufferEXT, GLuint, vaobj, GLuint, bindingindex, GLuint, buffer, GLintptr, offset, GLsizei, stride); \
FuncWrapper6(void, glVertexArrayVertexAttribFormatEXT, GLuint, vaobj, GLuint, attribindex, GLint, size, GLenum, type, GLboolean, normalized, GLuint, relativeoffset); \
AliasWrapper6(void, glVertexArrayAttribFormat, glVertexArrayVertexAttribFormatEXT, GLuint, vaobj, GLuint, attribindex, GLint, size, GLenum, type, GLboolean, normalized, GLuint, relativeoffset); \
FuncWrapper5(void, glVertexArrayVertexAttribIFormatEXT, GLuint, vaobj, GLuint, attribindex, GLint, size, GLenum, type, GLuint, relativeoffset); \
AliasWrapper5(void, glVertexArrayAttribIFormat, glVertexArrayVertexAttribIFormatEXT, GLuint, vaobj, GLuint, attribindex, GLint, size, GLenum, type, GLuint, relativeoffset); \
FuncWrapper5(void, glVertexArrayVertexAttribLFormatEXT, GLuint, vaobj, GLuint, attribindex, GLint, size, GLenum, type, GLuint, relativeoffset); \
AliasWrapper5(void, glVertexArrayAttribLFormat, glVertexArrayVertexAttribLFormatEXT, GLuint, vaobj, GLuint, attribindex, GLint, size, GLenum, type, GLuint, relativeoffset); \
FuncWrapper3(void, glVertexArrayVertexAttribBindingEXT, GLuint, vaobj, GLuint, attribindex, GLuint, bindingindex); \
AliasWrapper3(void, glVertexArrayAttribBinding, glVertexArrayVertexAttribBindingEXT, GLuint, vaobj, GLuint, attribindex, GLuint, bindingindex); \
FuncWrapper3(void, glVertexArrayVertexBindingDivisorEXT, GLuint, vaobj, GLuint, bindingindex, GLuint, divisor); \
AliasWrapper3(void, glVertexArrayBindingDivisor, glVertexArrayVertexBindingDivisorEXT, GLuint, vaobj, GLuint, bindingindex, GLuint, divisor); \
FuncWrapper7(void, glVertexArrayVertexAttribLOffsetEXT, GLuint, vaobj, GLuint, buffer, GLuint, index, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
FuncWrapper3(void, glVertexArrayVertexAttribDivisorEXT, GLuint, vaobj, GLuint, index, GLuint, divisor); \
FuncWrapper2(void, glCreateTransformFeedbacks, GLsizei, n, GLuint *, ids); \
FuncWrapper3(void, glTransformFeedbackBufferBase, GLuint, xfb, GLuint, index, GLuint, buffer); \
FuncWrapper5(void, glTransformFeedbackBufferRange, GLuint, xfb, GLuint, index, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
FuncWrapper4(void, glGetTransformFeedbacki64_v, GLuint, xfb, GLenum, pname, GLuint, index, GLint64 *, param); \
FuncWrapper4(void, glGetTransformFeedbacki_v, GLuint, xfb, GLenum, pname, GLuint, index, GLint *, param); \
FuncWrapper3(void, glGetTransformFeedbackiv, GLuint, xfb, GLenum, pname, GLint *, param); \
FuncWrapper2(void, glCreateBuffers, GLsizei, n, GLuint *, buffers); \
FuncWrapper4(void, glGetNamedBufferSubData, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, void *, data); \
FuncWrapper4(void, glNamedBufferStorage, GLuint, buffer, GLsizeiptr, size, const void *, data, GLbitfield, flags); \
FuncWrapper4(void, glNamedBufferData, GLuint, buffer, GLsizeiptr, size, const void *, data, GLenum, usage); \
FuncWrapper4(void, glNamedBufferSubData, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, const void *, data); \
FuncWrapper5(void, glCopyNamedBufferSubData, GLuint, readBuffer, GLuint, writeBuffer, GLintptr, readOffset, GLintptr, writeOffset, GLsizeiptr, size); \
FuncWrapper7(void, glClearNamedBufferSubData, GLuint, buffer, GLenum, internalformat, GLintptr, offset, GLsizeiptr, size, GLenum, format, GLenum, type, const void *, data); \
FuncWrapper4(void *, glMapNamedBufferRange, GLuint, buffer, GLintptr, offset, GLsizeiptr, length, GLbitfield, access); \
FuncWrapper3(void, glFlushMappedNamedBufferRange, GLuint, buffer, GLintptr, offset, GLsizeiptr, length); \
FuncWrapper3(void, glGetNamedBufferParameteri64v, GLuint, buffer, GLenum, pname, GLint64 *, params); \
FuncWrapper2(void, glCreateFramebuffers, GLsizei, n, GLuint *, framebuffers); \
FuncWrapper3(void, glInvalidateNamedFramebufferData, GLuint, framebuffer, GLsizei, numAttachments, const GLenum *, attachments); \
FuncWrapper7(void, glInvalidateNamedFramebufferSubData, GLuint, framebuffer, GLsizei, numAttachments, const GLenum *, attachments, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper4(void, glClearNamedFramebufferiv, GLuint, framebuffer, GLenum, buffer, GLint, drawbuffer, const GLint *, value); \
FuncWrapper4(void, glClearNamedFramebufferuiv, GLuint, framebuffer, GLenum, buffer, GLint, drawbuffer, const GLuint *, value); \
FuncWrapper4(void, glClearNamedFramebufferfv, GLuint, framebuffer, GLenum, buffer, GLint, drawbuffer, const GLfloat *, value); \
FuncWrapper5(void, glClearNamedFramebufferfi, GLuint, framebuffer, GLenum, buffer, GLint, drawbuffer, GLfloat, depth, GLint, stencil); \
FuncWrapper12(void, glBlitNamedFramebuffer, GLuint, readFramebuffer, GLuint, drawFramebuffer, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter); \
FuncWrapper2(void, glCreateRenderbuffers, GLsizei, n, GLuint *, renderbuffers); \
FuncWrapper3(void, glCreateTextures, GLenum, target, GLsizei, n, GLuint *, textures); \
FuncWrapper3(void, glTextureBuffer, GLuint, texture, GLenum, internalformat, GLuint, buffer); \
FuncWrapper5(void, glTextureBufferRange, GLuint, texture, GLenum, internalformat, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
FuncWrapper4(void, glTextureStorage1D, GLuint, texture, GLsizei, levels, GLenum, internalformat, GLsizei, width); \
FuncWrapper5(void, glTextureStorage2D, GLuint, texture, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height); \
FuncWrapper6(void, glTextureStorage3D, GLuint, texture, GLsizei, levels, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth); \
FuncWrapper6(void, glTextureStorage2DMultisample, GLuint, texture, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLboolean, fixedsamplelocations); \
FuncWrapper7(void, glTextureStorage3DMultisample, GLuint, texture, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedsamplelocations); \
FuncWrapper7(void, glTextureSubImage1D, GLuint, texture, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper9(void, glTextureSubImage2D, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper11(void, glTextureSubImage3D, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, pixels); \
FuncWrapper7(void, glCompressedTextureSubImage1D, GLuint, texture, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLsizei, imageSize, const void *, data); \
FuncWrapper9(void, glCompressedTextureSubImage2D, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLsizei, imageSize, const void *, data); \
FuncWrapper11(void, glCompressedTextureSubImage3D, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLsizei, imageSize, const void *, data); \
FuncWrapper6(void, glCopyTextureSubImage1D, GLuint, texture, GLint, level, GLint, xoffset, GLint, x, GLint, y, GLsizei, width); \
FuncWrapper8(void, glCopyTextureSubImage2D, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper9(void, glCopyTextureSubImage3D, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
FuncWrapper3(void, glTextureParameterf, GLuint, texture, GLenum, pname, GLfloat, param); \
FuncWrapper3(void, glTextureParameterfv, GLuint, texture, GLenum, pname, const GLfloat *, param); \
FuncWrapper3(void, glTextureParameteri, GLuint, texture, GLenum, pname, GLint, param); \
FuncWrapper3(void, glTextureParameterIiv, GLuint, texture, GLenum, pname, const GLint *, params); \
FuncWrapper3(void, glTextureParameterIuiv, GLuint, texture, GLenum, pname, const GLuint *, params); \
FuncWrapper3(void, glTextureParameteriv, GLuint, texture, GLenum, pname, const GLint *, param); \
FuncWrapper1(void, glGenerateTextureMipmap, GLuint, texture); \
FuncWrapper2(void, glBindTextureUnit, GLuint, unit, GLuint, texture); \
FuncWrapper6(void, glGetTextureImage, GLuint, texture, GLint, level, GLenum, format, GLenum, type, GLsizei, bufSize, void *, pixels); \
FuncWrapper12(void, glGetTextureSubImage, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, GLsizei, bufSize, void *, pixels); \
FuncWrapper4(void, glGetCompressedTextureImage, GLuint, texture, GLint, level, GLsizei, bufSize, void *, pixels); \
FuncWrapper10(void, glGetCompressedTextureSubImage, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLsizei, bufSize, void *, pixels); \
FuncWrapper4(void, glGetTextureLevelParameterfv, GLuint, texture, GLint, level, GLenum, pname, GLfloat *, params); \
FuncWrapper4(void, glGetTextureLevelParameteriv, GLuint, texture, GLint, level, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetTextureParameterIiv, GLuint, texture, GLenum, pname, GLint *, params); \
FuncWrapper3(void, glGetTextureParameterIuiv, GLuint, texture, GLenum, pname, GLuint *, params); \
FuncWrapper3(void, glGetTextureParameterfv, GLuint, texture, GLenum, pname, GLfloat *, params); \
FuncWrapper3(void, glGetTextureParameteriv, GLuint, texture, GLenum, pname, GLint *, params); \
FuncWrapper2(void, glCreateVertexArrays, GLsizei, n, GLuint *, arrays); \
FuncWrapper2(void, glCreateSamplers, GLsizei, n, GLuint *, samplers); \
FuncWrapper2(void, glCreateProgramPipelines, GLsizei, n, GLuint *, pipelines); \
FuncWrapper3(void, glCreateQueries, GLenum, target, GLsizei, n, GLuint *, ids); \
FuncWrapper2(void, glVertexArrayElementBuffer, GLuint, vaobj, GLuint, buffer); \
FuncWrapper6(void, glVertexArrayVertexBuffers, GLuint, vaobj, GLuint, first, GLsizei, count, const GLuint *, buffers, const GLintptr *, offsets, const GLsizei *, strides); \
FuncWrapper3(void, glGetVertexArrayiv, GLuint, vaobj, GLenum, pname, GLint *, param); \
FuncWrapper4(void, glGetVertexArrayIndexed64iv, GLuint, vaobj, GLuint, index, GLenum, pname, GLint64 *, param); \
FuncWrapper4(void, glGetVertexArrayIndexediv, GLuint, vaobj, GLuint, index, GLenum, pname, GLint *, param); \
FuncWrapper4(void, glGetQueryBufferObjecti64v, GLuint, id, GLuint, buffer, GLenum, pname, GLintptr, offset); \
FuncWrapper4(void, glGetQueryBufferObjectiv, GLuint, id, GLuint, buffer, GLenum, pname, GLintptr, offset); \
FuncWrapper4(void, glGetQueryBufferObjectui64v, GLuint, id, GLuint, buffer, GLenum, pname, GLintptr, offset); \
FuncWrapper4(void, glGetQueryBufferObjectuiv, GLuint, id, GLuint, buffer, GLenum, pname, GLintptr, offset); \
FuncWrapper2(BOOL, wglDXSetResourceShareHandleNV, void *, dxObject, HANDLE, shareHandle); \
FuncWrapper1(HANDLE, wglDXOpenDeviceNV, void *, dxDevice); \
FuncWrapper1(BOOL, wglDXCloseDeviceNV, HANDLE, hDevice); \
FuncWrapper5(HANDLE, wglDXRegisterObjectNV, HANDLE, hDevice, void *, dxObject, GLuint, name, GLenum, type, GLenum, access); \
FuncWrapper2(BOOL, wglDXUnregisterObjectNV, HANDLE, hDevice, HANDLE, hObject); \
FuncWrapper2(BOOL, wglDXObjectAccessNV, HANDLE, hObject, GLenum, access); \
FuncWrapper3(BOOL, wglDXLockObjectsNV, HANDLE, hDevice, GLint, count, HANDLE *, hObjects); \
FuncWrapper3(BOOL, wglDXUnlockObjectsNV, HANDLE, hDevice, GLint, count, HANDLE *, hObjects); \
#define ForEachUnsupported(FUNC) \
FUNC(glPrimitiveBoundingBoxARB); \
FUNC(glGetTextureHandleARB); \
FUNC(glGetTextureSamplerHandleARB); \
FUNC(glMakeTextureHandleResidentARB); \
FUNC(glMakeTextureHandleNonResidentARB); \
FUNC(glGetImageHandleARB); \
FUNC(glMakeImageHandleResidentARB); \
FUNC(glMakeImageHandleNonResidentARB); \
FUNC(glUniformHandleui64ARB); \
FUNC(glUniformHandleui64vARB); \
FUNC(glProgramUniformHandleui64ARB); \
FUNC(glProgramUniformHandleui64vARB); \
FUNC(glIsTextureHandleResidentARB); \
FUNC(glIsImageHandleResidentARB); \
FUNC(glVertexAttribL1ui64ARB); \
FUNC(glVertexAttribL1ui64vARB); \
FUNC(glGetVertexAttribLui64vARB); \
FUNC(glCreateSyncFromCLeventARB); \
FUNC(glFramebufferTextureFaceARB); \
FUNC(glUniform1i64ARB); \
FUNC(glUniform2i64ARB); \
FUNC(glUniform3i64ARB); \
FUNC(glUniform4i64ARB); \
FUNC(glUniform1i64vARB); \
FUNC(glUniform2i64vARB); \
FUNC(glUniform3i64vARB); \
FUNC(glUniform4i64vARB); \
FUNC(glUniform1ui64ARB); \
FUNC(glUniform2ui64ARB); \
FUNC(glUniform3ui64ARB); \
FUNC(glUniform4ui64ARB); \
FUNC(glUniform1ui64vARB); \
FUNC(glUniform2ui64vARB); \
FUNC(glUniform3ui64vARB); \
FUNC(glUniform4ui64vARB); \
FUNC(glGetUniformi64vARB); \
FUNC(glGetUniformui64vARB); \
FUNC(glGetnUniformi64vARB); \
FUNC(glGetnUniformui64vARB); \
FUNC(glProgramUniform1i64ARB); \
FUNC(glProgramUniform2i64ARB); \
FUNC(glProgramUniform3i64ARB); \
FUNC(glProgramUniform4i64ARB); \
FUNC(glProgramUniform1i64vARB); \
FUNC(glProgramUniform2i64vARB); \
FUNC(glProgramUniform3i64vARB); \
FUNC(glProgramUniform4i64vARB); \
FUNC(glProgramUniform1ui64ARB); \
FUNC(glProgramUniform2ui64ARB); \
FUNC(glProgramUniform3ui64ARB); \
FUNC(glProgramUniform4ui64ARB); \
FUNC(glProgramUniform1ui64vARB); \
FUNC(glProgramUniform2ui64vARB); \
FUNC(glProgramUniform3ui64vARB); \
FUNC(glProgramUniform4ui64vARB); \
FUNC(glFramebufferSampleLocationsfvARB); \
FUNC(glNamedFramebufferSampleLocationsfvARB); \
FUNC(glEvaluateDepthValuesARB); \
FUNC(glBufferPageCommitmentARB); \
FUNC(glNamedBufferPageCommitmentEXT); \
FUNC(glNamedBufferPageCommitmentARB); \
FUNC(glTexPageCommitmentARB); \
FUNC(glGetPerfMonitorGroupsAMD); \
FUNC(glGetPerfMonitorCountersAMD); \
FUNC(glGetPerfMonitorGroupStringAMD); \
FUNC(glGetPerfMonitorCounterStringAMD); \
FUNC(glGetPerfMonitorCounterInfoAMD); \
FUNC(glGenPerfMonitorsAMD); \
FUNC(glDeletePerfMonitorsAMD); \
FUNC(glSelectPerfMonitorCountersAMD); \
FUNC(glBeginPerfMonitorAMD); \
FUNC(glEndPerfMonitorAMD); \
FUNC(glGetPerfMonitorCounterDataAMD); \
FUNC(glEGLImageTargetTexStorageEXT); \
FUNC(glEGLImageTargetTextureStorageEXT); \
FUNC(glMatrixLoadfEXT); \
FUNC(glMatrixLoaddEXT); \
FUNC(glMatrixMultfEXT); \
FUNC(glMatrixMultdEXT); \
FUNC(glMatrixLoadIdentityEXT); \
FUNC(glMatrixRotatefEXT); \
FUNC(glMatrixRotatedEXT); \
FUNC(glMatrixScalefEXT); \
FUNC(glMatrixScaledEXT); \
FUNC(glMatrixTranslatefEXT); \
FUNC(glMatrixTranslatedEXT); \
FUNC(glMatrixFrustumEXT); \
FUNC(glMatrixOrthoEXT); \
FUNC(glMatrixPopEXT); \
FUNC(glMatrixPushEXT); \
FUNC(glClientAttribDefaultEXT); \
FUNC(glPushClientAttribDefaultEXT); \
FUNC(glMultiTexCoordPointerEXT); \
FUNC(glMultiTexEnvfEXT); \
FUNC(glMultiTexEnvfvEXT); \
FUNC(glMultiTexEnviEXT); \
FUNC(glMultiTexEnvivEXT); \
FUNC(glMultiTexGendEXT); \
FUNC(glMultiTexGendvEXT); \
FUNC(glMultiTexGenfEXT); \
FUNC(glMultiTexGenfvEXT); \
FUNC(glMultiTexGeniEXT); \
FUNC(glMultiTexGenivEXT); \
FUNC(glGetMultiTexEnvfvEXT); \
FUNC(glGetMultiTexEnvivEXT); \
FUNC(glGetMultiTexGendvEXT); \
FUNC(glGetMultiTexGenfvEXT); \
FUNC(glGetMultiTexGenivEXT); \
FUNC(glEnableClientStateIndexedEXT); \
FUNC(glDisableClientStateIndexedEXT); \
FUNC(glMatrixLoadTransposefEXT); \
FUNC(glMatrixLoadTransposedEXT); \
FUNC(glMatrixMultTransposefEXT); \
FUNC(glMatrixMultTransposedEXT); \
FUNC(glNamedProgramLocalParameters4fvEXT); \
FUNC(glNamedProgramLocalParameterI4iEXT); \
FUNC(glNamedProgramLocalParameterI4ivEXT); \
FUNC(glNamedProgramLocalParametersI4ivEXT); \
FUNC(glNamedProgramLocalParameterI4uiEXT); \
FUNC(glNamedProgramLocalParameterI4uivEXT); \
FUNC(glNamedProgramLocalParametersI4uivEXT); \
FUNC(glGetNamedProgramLocalParameterIivEXT); \
FUNC(glGetNamedProgramLocalParameterIuivEXT); \
FUNC(glEnableClientStateiEXT); \
FUNC(glDisableClientStateiEXT); \
FUNC(glNamedProgramStringEXT); \
FUNC(glNamedProgramLocalParameter4dEXT); \
FUNC(glNamedProgramLocalParameter4dvEXT); \
FUNC(glNamedProgramLocalParameter4fEXT); \
FUNC(glNamedProgramLocalParameter4fvEXT); \
FUNC(glGetNamedProgramLocalParameterdvEXT); \
FUNC(glGetNamedProgramLocalParameterfvEXT); \
FUNC(glGetNamedProgramStringEXT); \
FUNC(glNamedRenderbufferStorageMultisampleCoverageEXT); \
FUNC(glNamedFramebufferTextureFaceEXT); \
FUNC(glTextureRenderbufferEXT); \
FUNC(glMultiTexRenderbufferEXT); \
FUNC(glVertexArrayVertexOffsetEXT); \
FUNC(glVertexArrayColorOffsetEXT); \
FUNC(glVertexArrayEdgeFlagOffsetEXT); \
FUNC(glVertexArrayIndexOffsetEXT); \
FUNC(glVertexArrayNormalOffsetEXT); \
FUNC(glVertexArrayTexCoordOffsetEXT); \
FUNC(glVertexArrayMultiTexCoordOffsetEXT); \
FUNC(glVertexArrayFogCoordOffsetEXT); \
FUNC(glVertexArraySecondaryColorOffsetEXT); \
FUNC(glEnableVertexArrayEXT); \
FUNC(glDisableVertexArrayEXT); \
FUNC(glTexturePageCommitmentEXT); \
FUNC(glUseShaderProgramEXT); \
FUNC(glActiveProgramEXT); \
FUNC(glCreateShaderProgramEXT); \
FUNC(glFramebufferFetchBarrierEXT); \
FUNC(glWindowRectanglesEXT); \
FUNC(glApplyFramebufferAttachmentCMAAINTEL); \
FUNC(glBeginPerfQueryINTEL); \
FUNC(glCreatePerfQueryINTEL); \
FUNC(glDeletePerfQueryINTEL); \
FUNC(glEndPerfQueryINTEL); \
FUNC(glGetFirstPerfQueryIdINTEL); \
FUNC(glGetNextPerfQueryIdINTEL); \
FUNC(glGetPerfCounterInfoINTEL); \
FUNC(glGetPerfQueryDataINTEL); \
FUNC(glGetPerfQueryIdByNameINTEL); \
FUNC(glGetPerfQueryInfoINTEL); \
FUNC(glMultiDrawArraysIndirectBindlessNV); \
FUNC(glMultiDrawElementsIndirectBindlessNV); \
FUNC(glMultiDrawArraysIndirectBindlessCountNV); \
FUNC(glMultiDrawElementsIndirectBindlessCountNV); \
FUNC(glGetTextureHandleNV); \
FUNC(glGetTextureSamplerHandleNV); \
FUNC(glMakeTextureHandleResidentNV); \
FUNC(glMakeTextureHandleNonResidentNV); \
FUNC(glGetImageHandleNV); \
FUNC(glMakeImageHandleResidentNV); \
FUNC(glMakeImageHandleNonResidentNV); \
FUNC(glUniformHandleui64NV); \
FUNC(glUniformHandleui64vNV); \
FUNC(glProgramUniformHandleui64NV); \
FUNC(glProgramUniformHandleui64vNV); \
FUNC(glIsTextureHandleResidentNV); \
FUNC(glIsImageHandleResidentNV); \
FUNC(glBlendParameteriNV); \
FUNC(glBlendBarrierNV); \
FUNC(glViewportPositionWScaleNV); \
FUNC(glCreateStatesNV); \
FUNC(glDeleteStatesNV); \
FUNC(glIsStateNV); \
FUNC(glStateCaptureNV); \
FUNC(glGetCommandHeaderNV); \
FUNC(glGetStageIndexNV); \
FUNC(glDrawCommandsNV); \
FUNC(glDrawCommandsAddressNV); \
FUNC(glDrawCommandsStatesNV); \
FUNC(glDrawCommandsStatesAddressNV); \
FUNC(glCreateCommandListsNV); \
FUNC(glDeleteCommandListsNV); \
FUNC(glIsCommandListNV); \
FUNC(glListDrawCommandsStatesClientNV); \
FUNC(glCommandListSegmentsNV); \
FUNC(glCompileCommandListNV); \
FUNC(glCallCommandListNV); \
FUNC(glBeginConditionalRenderNV); \
FUNC(glEndConditionalRenderNV); \
FUNC(glSubpixelPrecisionBiasNV); \
FUNC(glConservativeRasterParameterfNV); \
FUNC(glConservativeRasterParameteriNV); \
FUNC(glDrawVkImageNV); \
FUNC(glGetVkProcAddrNV); \
FUNC(glWaitVkSemaphoreNV); \
FUNC(glSignalVkSemaphoreNV); \
FUNC(glSignalVkFenceNV); \
FUNC(glFragmentCoverageColorNV); \
FUNC(glCoverageModulationTableNV); \
FUNC(glGetCoverageModulationTableNV); \
FUNC(glCoverageModulationNV); \
FUNC(glRenderbufferStorageMultisampleCoverageNV); \
FUNC(glUniform1i64NV); \
FUNC(glUniform2i64NV); \
FUNC(glUniform3i64NV); \
FUNC(glUniform4i64NV); \
FUNC(glUniform1i64vNV); \
FUNC(glUniform2i64vNV); \
FUNC(glUniform3i64vNV); \
FUNC(glUniform4i64vNV); \
FUNC(glUniform1ui64NV); \
FUNC(glUniform2ui64NV); \
FUNC(glUniform3ui64NV); \
FUNC(glUniform4ui64NV); \
FUNC(glUniform1ui64vNV); \
FUNC(glUniform2ui64vNV); \
FUNC(glUniform3ui64vNV); \
FUNC(glUniform4ui64vNV); \
FUNC(glGetUniformi64vNV); \
FUNC(glProgramUniform1i64NV); \
FUNC(glProgramUniform2i64NV); \
FUNC(glProgramUniform3i64NV); \
FUNC(glProgramUniform4i64NV); \
FUNC(glProgramUniform1i64vNV); \
FUNC(glProgramUniform2i64vNV); \
FUNC(glProgramUniform3i64vNV); \
FUNC(glProgramUniform4i64vNV); \
FUNC(glProgramUniform1ui64NV); \
FUNC(glProgramUniform2ui64NV); \
FUNC(glProgramUniform3ui64NV); \
FUNC(glProgramUniform4ui64NV); \
FUNC(glProgramUniform1ui64vNV); \
FUNC(glProgramUniform2ui64vNV); \
FUNC(glProgramUniform3ui64vNV); \
FUNC(glProgramUniform4ui64vNV); \
FUNC(glGetInternalformatSampleivNV); \
FUNC(glGenPathsNV); \
FUNC(glDeletePathsNV); \
FUNC(glIsPathNV); \
FUNC(glPathCommandsNV); \
FUNC(glPathCoordsNV); \
FUNC(glPathSubCommandsNV); \
FUNC(glPathSubCoordsNV); \
FUNC(glPathStringNV); \
FUNC(glPathGlyphsNV); \
FUNC(glPathGlyphRangeNV); \
FUNC(glWeightPathsNV); \
FUNC(glCopyPathNV); \
FUNC(glInterpolatePathsNV); \
FUNC(glTransformPathNV); \
FUNC(glPathParameterivNV); \
FUNC(glPathParameteriNV); \
FUNC(glPathParameterfvNV); \
FUNC(glPathParameterfNV); \
FUNC(glPathDashArrayNV); \
FUNC(glPathStencilFuncNV); \
FUNC(glPathStencilDepthOffsetNV); \
FUNC(glStencilFillPathNV); \
FUNC(glStencilStrokePathNV); \
FUNC(glStencilFillPathInstancedNV); \
FUNC(glStencilStrokePathInstancedNV); \
FUNC(glPathCoverDepthFuncNV); \
FUNC(glCoverFillPathNV); \
FUNC(glCoverStrokePathNV); \
FUNC(glCoverFillPathInstancedNV); \
FUNC(glCoverStrokePathInstancedNV); \
FUNC(glGetPathParameterivNV); \
FUNC(glGetPathParameterfvNV); \
FUNC(glGetPathCommandsNV); \
FUNC(glGetPathCoordsNV); \
FUNC(glGetPathDashArrayNV); \
FUNC(glGetPathMetricsNV); \
FUNC(glGetPathMetricRangeNV); \
FUNC(glGetPathSpacingNV); \
FUNC(glIsPointInFillPathNV); \
FUNC(glIsPointInStrokePathNV); \
FUNC(glGetPathLengthNV); \
FUNC(glPointAlongPathNV); \
FUNC(glMatrixLoad3x2fNV); \
FUNC(glMatrixLoad3x3fNV); \
FUNC(glMatrixLoadTranspose3x3fNV); \
FUNC(glMatrixMult3x2fNV); \
FUNC(glMatrixMult3x3fNV); \
FUNC(glMatrixMultTranspose3x3fNV); \
FUNC(glStencilThenCoverFillPathNV); \
FUNC(glStencilThenCoverStrokePathNV); \
FUNC(glStencilThenCoverFillPathInstancedNV); \
FUNC(glStencilThenCoverStrokePathInstancedNV); \
FUNC(glPathGlyphIndexRangeNV); \
FUNC(glPathGlyphIndexArrayNV); \
FUNC(glPathMemoryGlyphIndexArrayNV); \
FUNC(glProgramPathFragmentInputGenNV); \
FUNC(glGetProgramResourcefvNV); \
FUNC(glFramebufferSampleLocationsfvNV); \
FUNC(glNamedFramebufferSampleLocationsfvNV); \
FUNC(glResolveDepthValuesNV); \
FUNC(glMakeBufferResidentNV); \
FUNC(glMakeBufferNonResidentNV); \
FUNC(glIsBufferResidentNV); \
FUNC(glMakeNamedBufferResidentNV); \
FUNC(glMakeNamedBufferNonResidentNV); \
FUNC(glIsNamedBufferResidentNV); \
FUNC(glGetBufferParameterui64vNV); \
FUNC(glGetNamedBufferParameterui64vNV); \
FUNC(glGetIntegerui64vNV); \
FUNC(glUniformui64NV); \
FUNC(glUniformui64vNV); \
FUNC(glGetUniformui64vNV); \
FUNC(glProgramUniformui64NV); \
FUNC(glProgramUniformui64vNV); \
FUNC(glTextureBarrierNV); \
FUNC(glVertexAttribL1i64NV); \
FUNC(glVertexAttribL2i64NV); \
FUNC(glVertexAttribL3i64NV); \
FUNC(glVertexAttribL4i64NV); \
FUNC(glVertexAttribL1i64vNV); \
FUNC(glVertexAttribL2i64vNV); \
FUNC(glVertexAttribL3i64vNV); \
FUNC(glVertexAttribL4i64vNV); \
FUNC(glVertexAttribL1ui64NV); \
FUNC(glVertexAttribL2ui64NV); \
FUNC(glVertexAttribL3ui64NV); \
FUNC(glVertexAttribL4ui64NV); \
FUNC(glVertexAttribL1ui64vNV); \
FUNC(glVertexAttribL2ui64vNV); \
FUNC(glVertexAttribL3ui64vNV); \
FUNC(glVertexAttribL4ui64vNV); \
FUNC(glGetVertexAttribLi64vNV); \
FUNC(glGetVertexAttribLui64vNV); \
FUNC(glVertexAttribLFormatNV); \
FUNC(glBufferAddressRangeNV); \
FUNC(glVertexFormatNV); \
FUNC(glNormalFormatNV); \
FUNC(glColorFormatNV); \
FUNC(glIndexFormatNV); \
FUNC(glTexCoordFormatNV); \
FUNC(glEdgeFlagFormatNV); \
FUNC(glSecondaryColorFormatNV); \
FUNC(glFogCoordFormatNV); \
FUNC(glVertexAttribFormatNV); \
FUNC(glVertexAttribIFormatNV); \
FUNC(glGetIntegerui64i_vNV); \
FUNC(glViewportSwizzleNV); \
FUNC(glClientActiveTexture); \
FUNC(glMultiTexCoord1d); \
FUNC(glMultiTexCoord1dv); \
FUNC(glMultiTexCoord1f); \
FUNC(glMultiTexCoord1fv); \
FUNC(glMultiTexCoord1i); \
FUNC(glMultiTexCoord1iv); \
FUNC(glMultiTexCoord1s); \
FUNC(glMultiTexCoord1sv); \
FUNC(glMultiTexCoord2d); \
FUNC(glMultiTexCoord2dv); \
FUNC(glMultiTexCoord2f); \
FUNC(glMultiTexCoord2fv); \
FUNC(glMultiTexCoord2i); \
FUNC(glMultiTexCoord2iv); \
FUNC(glMultiTexCoord2s); \
FUNC(glMultiTexCoord2sv); \
FUNC(glMultiTexCoord3d); \
FUNC(glMultiTexCoord3dv); \
FUNC(glMultiTexCoord3f); \
FUNC(glMultiTexCoord3fv); \
FUNC(glMultiTexCoord3i); \
FUNC(glMultiTexCoord3iv); \
FUNC(glMultiTexCoord3s); \
FUNC(glMultiTexCoord3sv); \
FUNC(glMultiTexCoord4d); \
FUNC(glMultiTexCoord4dv); \
FUNC(glMultiTexCoord4f); \
FUNC(glMultiTexCoord4fv); \
FUNC(glMultiTexCoord4i); \
FUNC(glMultiTexCoord4iv); \
FUNC(glMultiTexCoord4s); \
FUNC(glMultiTexCoord4sv); \
FUNC(glLoadTransposeMatrixf); \
FUNC(glLoadTransposeMatrixd); \
FUNC(glMultTransposeMatrixf); \
FUNC(glMultTransposeMatrixd); \
FUNC(glFogCoordf); \
FUNC(glFogCoordfv); \
FUNC(glFogCoordd); \
FUNC(glFogCoorddv); \
FUNC(glFogCoordPointer); \
FUNC(glSecondaryColor3b); \
FUNC(glSecondaryColor3bv); \
FUNC(glSecondaryColor3d); \
FUNC(glSecondaryColor3dv); \
FUNC(glSecondaryColor3f); \
FUNC(glSecondaryColor3fv); \
FUNC(glSecondaryColor3i); \
FUNC(glSecondaryColor3iv); \
FUNC(glSecondaryColor3s); \
FUNC(glSecondaryColor3sv); \
FUNC(glSecondaryColor3ub); \
FUNC(glSecondaryColor3ubv); \
FUNC(glSecondaryColor3ui); \
FUNC(glSecondaryColor3uiv); \
FUNC(glSecondaryColor3us); \
FUNC(glSecondaryColor3usv); \
FUNC(glSecondaryColorPointer); \
FUNC(glWindowPos2d); \
FUNC(glWindowPos2dv); \
FUNC(glWindowPos2f); \
FUNC(glWindowPos2fv); \
FUNC(glWindowPos2i); \
FUNC(glWindowPos2iv); \
FUNC(glWindowPos2s); \
FUNC(glWindowPos2sv); \
FUNC(glWindowPos3d); \
FUNC(glWindowPos3dv); \
FUNC(glWindowPos3f); \
FUNC(glWindowPos3fv); \
FUNC(glWindowPos3i); \
FUNC(glWindowPos3iv); \
FUNC(glWindowPos3s); \
FUNC(glWindowPos3sv); \
FUNC(glVertexP2ui); \
FUNC(glVertexP2uiv); \
FUNC(glVertexP3ui); \
FUNC(glVertexP3uiv); \
FUNC(glVertexP4ui); \
FUNC(glVertexP4uiv); \
FUNC(glTexCoordP1ui); \
FUNC(glTexCoordP1uiv); \
FUNC(glTexCoordP2ui); \
FUNC(glTexCoordP2uiv); \
FUNC(glTexCoordP3ui); \
FUNC(glTexCoordP3uiv); \
FUNC(glTexCoordP4ui); \
FUNC(glTexCoordP4uiv); \
FUNC(glMultiTexCoordP1ui); \
FUNC(glMultiTexCoordP1uiv); \
FUNC(glMultiTexCoordP2ui); \
FUNC(glMultiTexCoordP2uiv); \
FUNC(glMultiTexCoordP3ui); \
FUNC(glMultiTexCoordP3uiv); \
FUNC(glMultiTexCoordP4ui); \
FUNC(glMultiTexCoordP4uiv); \
FUNC(glNormalP3ui); \
FUNC(glNormalP3uiv); \
FUNC(glColorP3ui); \
FUNC(glColorP3uiv); \
FUNC(glColorP4ui); \
FUNC(glColorP4uiv); \
FUNC(glSecondaryColorP3ui); \
FUNC(glSecondaryColorP3uiv); \
FUNC(glGetnMapdv); \
FUNC(glGetnMapfv); \
FUNC(glGetnMapiv); \
FUNC(glGetnPixelMapfv); \
FUNC(glGetnPixelMapuiv); \
FUNC(glGetnPixelMapusv); \
FUNC(glGetnPolygonStipple); \
FUNC(glGetnColorTable); \
FUNC(glGetnConvolutionFilter); \
FUNC(glGetnSeparableFilter); \
FUNC(glGetnHistogram); \
FUNC(glGetnMinmax); \
FUNC(glProgramStringARB); \
FUNC(glBindProgramARB); \
FUNC(glDeleteProgramsARB); \
FUNC(glGenProgramsARB); \
FUNC(glProgramEnvParameter4dARB); \
FUNC(glProgramEnvParameter4dvARB); \
FUNC(glProgramEnvParameter4fARB); \
FUNC(glProgramEnvParameter4fvARB); \
FUNC(glProgramLocalParameter4dARB); \
FUNC(glProgramLocalParameter4dvARB); \
FUNC(glProgramLocalParameter4fARB); \
FUNC(glProgramLocalParameter4fvARB); \
FUNC(glGetProgramEnvParameterdvARB); \
FUNC(glGetProgramEnvParameterfvARB); \
FUNC(glGetProgramLocalParameterdvARB); \
FUNC(glGetProgramLocalParameterfvARB); \
FUNC(glGetProgramivARB); \
FUNC(glGetProgramStringARB); \
FUNC(glIsProgramARB); \
FUNC(glColorTable); \
FUNC(glColorTableParameterfv); \
FUNC(glColorTableParameteriv); \
FUNC(glCopyColorTable); \
FUNC(glGetColorTable); \
FUNC(glGetColorTableParameterfv); \
FUNC(glGetColorTableParameteriv); \
FUNC(glColorSubTable); \
FUNC(glCopyColorSubTable); \
FUNC(glConvolutionFilter1D); \
FUNC(glConvolutionFilter2D); \
FUNC(glConvolutionParameterf); \
FUNC(glConvolutionParameterfv); \
FUNC(glConvolutionParameteri); \
FUNC(glConvolutionParameteriv); \
FUNC(glCopyConvolutionFilter1D); \
FUNC(glCopyConvolutionFilter2D); \
FUNC(glGetConvolutionFilter); \
FUNC(glGetConvolutionParameterfv); \
FUNC(glGetConvolutionParameteriv); \
FUNC(glGetSeparableFilter); \
FUNC(glSeparableFilter2D); \
FUNC(glGetHistogram); \
FUNC(glGetHistogramParameterfv); \
FUNC(glGetHistogramParameteriv); \
FUNC(glGetMinmax); \
FUNC(glGetMinmaxParameterfv); \
FUNC(glGetMinmaxParameteriv); \
FUNC(glHistogram); \
FUNC(glMinmax); \
FUNC(glResetHistogram); \
FUNC(glResetMinmax); \
FUNC(glCurrentPaletteMatrixARB); \
FUNC(glMatrixIndexubvARB); \
FUNC(glMatrixIndexusvARB); \
FUNC(glMatrixIndexuivARB); \
FUNC(glMatrixIndexPointerARB); \
FUNC(glClientActiveTextureARB); \
FUNC(glMultiTexCoord1dARB); \
FUNC(glMultiTexCoord1dvARB); \
FUNC(glMultiTexCoord1fARB); \
FUNC(glMultiTexCoord1fvARB); \
FUNC(glMultiTexCoord1iARB); \
FUNC(glMultiTexCoord1ivARB); \
FUNC(glMultiTexCoord1sARB); \
FUNC(glMultiTexCoord1svARB); \
FUNC(glMultiTexCoord2dARB); \
FUNC(glMultiTexCoord2dvARB); \
FUNC(glMultiTexCoord2fARB); \
FUNC(glMultiTexCoord2fvARB); \
FUNC(glMultiTexCoord2iARB); \
FUNC(glMultiTexCoord2ivARB); \
FUNC(glMultiTexCoord2sARB); \
FUNC(glMultiTexCoord2svARB); \
FUNC(glMultiTexCoord3dARB); \
FUNC(glMultiTexCoord3dvARB); \
FUNC(glMultiTexCoord3fARB); \
FUNC(glMultiTexCoord3fvARB); \
FUNC(glMultiTexCoord3iARB); \
FUNC(glMultiTexCoord3ivARB); \
FUNC(glMultiTexCoord3sARB); \
FUNC(glMultiTexCoord3svARB); \
FUNC(glMultiTexCoord4dARB); \
FUNC(glMultiTexCoord4dvARB); \
FUNC(glMultiTexCoord4fARB); \
FUNC(glMultiTexCoord4fvARB); \
FUNC(glMultiTexCoord4iARB); \
FUNC(glMultiTexCoord4ivARB); \
FUNC(glMultiTexCoord4sARB); \
FUNC(glMultiTexCoord4svARB); \
FUNC(glGetnMapdvARB); \
FUNC(glGetnMapfvARB); \
FUNC(glGetnMapivARB); \
FUNC(glGetnPixelMapfvARB); \
FUNC(glGetnPixelMapuivARB); \
FUNC(glGetnPixelMapusvARB); \
FUNC(glGetnPolygonStippleARB); \
FUNC(glGetnColorTableARB); \
FUNC(glGetnConvolutionFilterARB); \
FUNC(glGetnSeparableFilterARB); \
FUNC(glGetnHistogramARB); \
FUNC(glGetnMinmaxARB); \
FUNC(glDeleteObjectARB); \
FUNC(glGetHandleARB); \
FUNC(glDetachObjectARB); \
FUNC(glCreateShaderObjectARB); \
FUNC(glShaderSourceARB); \
FUNC(glCompileShaderARB); \
FUNC(glCreateProgramObjectARB); \
FUNC(glAttachObjectARB); \
FUNC(glLinkProgramARB); \
FUNC(glUseProgramObjectARB); \
FUNC(glValidateProgramARB); \
FUNC(glGetObjectParameterfvARB); \
FUNC(glGetObjectParameterivARB); \
FUNC(glGetInfoLogARB); \
FUNC(glGetAttachedObjectsARB); \
FUNC(glGetUniformLocationARB); \
FUNC(glGetActiveUniformARB); \
FUNC(glGetUniformfvARB); \
FUNC(glGetUniformivARB); \
FUNC(glGetShaderSourceARB); \
FUNC(glLoadTransposeMatrixfARB); \
FUNC(glLoadTransposeMatrixdARB); \
FUNC(glMultTransposeMatrixfARB); \
FUNC(glMultTransposeMatrixdARB); \
FUNC(glWeightbvARB); \
FUNC(glWeightsvARB); \
FUNC(glWeightivARB); \
FUNC(glWeightfvARB); \
FUNC(glWeightdvARB); \
FUNC(glWeightubvARB); \
FUNC(glWeightusvARB); \
FUNC(glWeightuivARB); \
FUNC(glWeightPointerARB); \
FUNC(glVertexBlendARB); \
FUNC(glVertexAttrib4NubARB); \
FUNC(glGetVertexAttribdvARB); \
FUNC(glGetVertexAttribfvARB); \
FUNC(glGetVertexAttribivARB); \
FUNC(glGetVertexAttribPointervARB); \
FUNC(glBindAttribLocationARB); \
FUNC(glGetActiveAttribARB); \
FUNC(glGetAttribLocationARB); \
FUNC(glWindowPos2dARB); \
FUNC(glWindowPos2dvARB); \
FUNC(glWindowPos2fARB); \
FUNC(glWindowPos2fvARB); \
FUNC(glWindowPos2iARB); \
FUNC(glWindowPos2ivARB); \
FUNC(glWindowPos2sARB); \
FUNC(glWindowPos2svARB); \
FUNC(glWindowPos3dARB); \
FUNC(glWindowPos3dvARB); \
FUNC(glWindowPos3fARB); \
FUNC(glWindowPos3fvARB); \
FUNC(glWindowPos3iARB); \
FUNC(glWindowPos3ivARB); \
FUNC(glWindowPos3sARB); \
FUNC(glWindowPos3svARB); \
FUNC(glMultiTexCoord1bOES); \
FUNC(glMultiTexCoord1bvOES); \
FUNC(glMultiTexCoord2bOES); \
FUNC(glMultiTexCoord2bvOES); \
FUNC(glMultiTexCoord3bOES); \
FUNC(glMultiTexCoord3bvOES); \
FUNC(glMultiTexCoord4bOES); \
FUNC(glMultiTexCoord4bvOES); \
FUNC(glTexCoord1bOES); \
FUNC(glTexCoord1bvOES); \
FUNC(glTexCoord2bOES); \
FUNC(glTexCoord2bvOES); \
FUNC(glTexCoord3bOES); \
FUNC(glTexCoord3bvOES); \
FUNC(glTexCoord4bOES); \
FUNC(glTexCoord4bvOES); \
FUNC(glVertex2bOES); \
FUNC(glVertex2bvOES); \
FUNC(glVertex3bOES); \
FUNC(glVertex3bvOES); \
FUNC(glVertex4bOES); \
FUNC(glVertex4bvOES); \
FUNC(glAlphaFuncxOES); \
FUNC(glClearColorxOES); \
FUNC(glClearDepthxOES); \
FUNC(glClipPlanexOES); \
FUNC(glColor4xOES); \
FUNC(glDepthRangexOES); \
FUNC(glFogxOES); \
FUNC(glFogxvOES); \
FUNC(glFrustumxOES); \
FUNC(glGetClipPlanexOES); \
FUNC(glGetFixedvOES); \
FUNC(glGetTexEnvxvOES); \
FUNC(glGetTexParameterxvOES); \
FUNC(glLightModelxOES); \
FUNC(glLightModelxvOES); \
FUNC(glLightxOES); \
FUNC(glLightxvOES); \
FUNC(glLineWidthxOES); \
FUNC(glLoadMatrixxOES); \
FUNC(glMaterialxOES); \
FUNC(glMaterialxvOES); \
FUNC(glMultMatrixxOES); \
FUNC(glMultiTexCoord4xOES); \
FUNC(glNormal3xOES); \
FUNC(glOrthoxOES); \
FUNC(glPointParameterxvOES); \
FUNC(glPointSizexOES); \
FUNC(glPolygonOffsetxOES); \
FUNC(glRotatexOES); \
FUNC(glScalexOES); \
FUNC(glTexEnvxOES); \
FUNC(glTexEnvxvOES); \
FUNC(glTexParameterxOES); \
FUNC(glTexParameterxvOES); \
FUNC(glTranslatexOES); \
FUNC(glAccumxOES); \
FUNC(glBitmapxOES); \
FUNC(glBlendColorxOES); \
FUNC(glClearAccumxOES); \
FUNC(glColor3xOES); \
FUNC(glColor3xvOES); \
FUNC(glColor4xvOES); \
FUNC(glConvolutionParameterxOES); \
FUNC(glConvolutionParameterxvOES); \
FUNC(glEvalCoord1xOES); \
FUNC(glEvalCoord1xvOES); \
FUNC(glEvalCoord2xOES); \
FUNC(glEvalCoord2xvOES); \
FUNC(glFeedbackBufferxOES); \
FUNC(glGetConvolutionParameterxvOES); \
FUNC(glGetHistogramParameterxvOES); \
FUNC(glGetLightxOES); \
FUNC(glGetMapxvOES); \
FUNC(glGetMaterialxOES); \
FUNC(glGetPixelMapxv); \
FUNC(glGetTexGenxvOES); \
FUNC(glGetTexLevelParameterxvOES); \
FUNC(glIndexxOES); \
FUNC(glIndexxvOES); \
FUNC(glLoadTransposeMatrixxOES); \
FUNC(glMap1xOES); \
FUNC(glMap2xOES); \
FUNC(glMapGrid1xOES); \
FUNC(glMapGrid2xOES); \
FUNC(glMultTransposeMatrixxOES); \
FUNC(glMultiTexCoord1xOES); \
FUNC(glMultiTexCoord1xvOES); \
FUNC(glMultiTexCoord2xOES); \
FUNC(glMultiTexCoord2xvOES); \
FUNC(glMultiTexCoord3xOES); \
FUNC(glMultiTexCoord3xvOES); \
FUNC(glMultiTexCoord4xvOES); \
FUNC(glNormal3xvOES); \
FUNC(glPassThroughxOES); \
FUNC(glPixelMapx); \
FUNC(glPixelStorex); \
FUNC(glPixelTransferxOES); \
FUNC(glPixelZoomxOES); \
FUNC(glPrioritizeTexturesxOES); \
FUNC(glRasterPos2xOES); \
FUNC(glRasterPos2xvOES); \
FUNC(glRasterPos3xOES); \
FUNC(glRasterPos3xvOES); \
FUNC(glRasterPos4xOES); \
FUNC(glRasterPos4xvOES); \
FUNC(glRectxOES); \
FUNC(glRectxvOES); \
FUNC(glTexCoord1xOES); \
FUNC(glTexCoord1xvOES); \
FUNC(glTexCoord2xOES); \
FUNC(glTexCoord2xvOES); \
FUNC(glTexCoord3xOES); \
FUNC(glTexCoord3xvOES); \
FUNC(glTexCoord4xOES); \
FUNC(glTexCoord4xvOES); \
FUNC(glTexGenxOES); \
FUNC(glTexGenxvOES); \
FUNC(glVertex2xOES); \
FUNC(glVertex2xvOES); \
FUNC(glVertex3xOES); \
FUNC(glVertex3xvOES); \
FUNC(glVertex4xOES); \
FUNC(glVertex4xvOES); \
FUNC(glQueryMatrixxOES); \
FUNC(glClearDepthfOES); \
FUNC(glClipPlanefOES); \
FUNC(glDepthRangefOES); \
FUNC(glFrustumfOES); \
FUNC(glGetClipPlanefOES); \
FUNC(glOrthofOES); \
FUNC(glTbufferMask3DFX); \
FUNC(glDebugMessageEnableAMD); \
FUNC(glDebugMessageInsertAMD); \
FUNC(glDebugMessageCallbackAMD); \
FUNC(glGetDebugMessageLogAMD); \
FUNC(glBlendFuncIndexedAMD); \
FUNC(glBlendFuncSeparateIndexedAMD); \
FUNC(glBlendEquationIndexedAMD); \
FUNC(glBlendEquationSeparateIndexedAMD); \
FUNC(glFramebufferSamplePositionsfvAMD); \
FUNC(glNamedFramebufferSamplePositionsfvAMD); \
FUNC(glGetFramebufferParameterfvAMD); \
FUNC(glGetNamedFramebufferParameterfvAMD); \
FUNC(glVertexAttribParameteriAMD); \
FUNC(glMultiDrawArraysIndirectAMD); \
FUNC(glMultiDrawElementsIndirectAMD); \
FUNC(glGenNamesAMD); \
FUNC(glDeleteNamesAMD); \
FUNC(glIsNameAMD); \
FUNC(glQueryObjectParameteruiAMD); \
FUNC(glSetMultisamplefvAMD); \
FUNC(glTexStorageSparseAMD); \
FUNC(glTextureStorageSparseAMD); \
FUNC(glStencilOpValueAMD); \
FUNC(glTessellationFactorAMD); \
FUNC(glTessellationModeAMD); \
FUNC(glElementPointerAPPLE); \
FUNC(glDrawElementArrayAPPLE); \
FUNC(glDrawRangeElementArrayAPPLE); \
FUNC(glMultiDrawElementArrayAPPLE); \
FUNC(glMultiDrawRangeElementArrayAPPLE); \
FUNC(glGenFencesAPPLE); \
FUNC(glDeleteFencesAPPLE); \
FUNC(glSetFenceAPPLE); \
FUNC(glIsFenceAPPLE); \
FUNC(glTestFenceAPPLE); \
FUNC(glFinishFenceAPPLE); \
FUNC(glTestObjectAPPLE); \
FUNC(glFinishObjectAPPLE); \
FUNC(glBufferParameteriAPPLE); \
FUNC(glFlushMappedBufferRangeAPPLE); \
FUNC(glObjectPurgeableAPPLE); \
FUNC(glObjectUnpurgeableAPPLE); \
FUNC(glGetObjectParameterivAPPLE); \
FUNC(glTextureRangeAPPLE); \
FUNC(glGetTexParameterPointervAPPLE); \
FUNC(glBindVertexArrayAPPLE); \
FUNC(glDeleteVertexArraysAPPLE); \
FUNC(glGenVertexArraysAPPLE); \
FUNC(glIsVertexArrayAPPLE); \
FUNC(glVertexArrayRangeAPPLE); \
FUNC(glFlushVertexArrayRangeAPPLE); \
FUNC(glVertexArrayParameteriAPPLE); \
FUNC(glEnableVertexAttribAPPLE); \
FUNC(glDisableVertexAttribAPPLE); \
FUNC(glIsVertexAttribEnabledAPPLE); \
FUNC(glMapVertexAttrib1dAPPLE); \
FUNC(glMapVertexAttrib1fAPPLE); \
FUNC(glMapVertexAttrib2dAPPLE); \
FUNC(glMapVertexAttrib2fAPPLE); \
FUNC(glDrawBuffersATI); \
FUNC(glElementPointerATI); \
FUNC(glDrawElementArrayATI); \
FUNC(glDrawRangeElementArrayATI); \
FUNC(glTexBumpParameterivATI); \
FUNC(glTexBumpParameterfvATI); \
FUNC(glGetTexBumpParameterivATI); \
FUNC(glGetTexBumpParameterfvATI); \
FUNC(glGenFragmentShadersATI); \
FUNC(glBindFragmentShaderATI); \
FUNC(glDeleteFragmentShaderATI); \
FUNC(glBeginFragmentShaderATI); \
FUNC(glEndFragmentShaderATI); \
FUNC(glPassTexCoordATI); \
FUNC(glSampleMapATI); \
FUNC(glColorFragmentOp1ATI); \
FUNC(glColorFragmentOp2ATI); \
FUNC(glColorFragmentOp3ATI); \
FUNC(glAlphaFragmentOp1ATI); \
FUNC(glAlphaFragmentOp2ATI); \
FUNC(glAlphaFragmentOp3ATI); \
FUNC(glSetFragmentShaderConstantATI); \
FUNC(glMapObjectBufferATI); \
FUNC(glUnmapObjectBufferATI); \
FUNC(glPNTrianglesiATI); \
FUNC(glPNTrianglesfATI); \
FUNC(glStencilOpSeparateATI); \
FUNC(glStencilFuncSeparateATI); \
FUNC(glNewObjectBufferATI); \
FUNC(glIsObjectBufferATI); \
FUNC(glUpdateObjectBufferATI); \
FUNC(glGetObjectBufferfvATI); \
FUNC(glGetObjectBufferivATI); \
FUNC(glFreeObjectBufferATI); \
FUNC(glArrayObjectATI); \
FUNC(glGetArrayObjectfvATI); \
FUNC(glGetArrayObjectivATI); \
FUNC(glVariantArrayObjectATI); \
FUNC(glGetVariantArrayObjectfvATI); \
FUNC(glGetVariantArrayObjectivATI); \
FUNC(glVertexAttribArrayObjectATI); \
FUNC(glGetVertexAttribArrayObjectfvATI); \
FUNC(glGetVertexAttribArrayObjectivATI); \
FUNC(glVertexStream1sATI); \
FUNC(glVertexStream1svATI); \
FUNC(glVertexStream1iATI); \
FUNC(glVertexStream1ivATI); \
FUNC(glVertexStream1fATI); \
FUNC(glVertexStream1fvATI); \
FUNC(glVertexStream1dATI); \
FUNC(glVertexStream1dvATI); \
FUNC(glVertexStream2sATI); \
FUNC(glVertexStream2svATI); \
FUNC(glVertexStream2iATI); \
FUNC(glVertexStream2ivATI); \
FUNC(glVertexStream2fATI); \
FUNC(glVertexStream2fvATI); \
FUNC(glVertexStream2dATI); \
FUNC(glVertexStream2dvATI); \
FUNC(glVertexStream3sATI); \
FUNC(glVertexStream3svATI); \
FUNC(glVertexStream3iATI); \
FUNC(glVertexStream3ivATI); \
FUNC(glVertexStream3fATI); \
FUNC(glVertexStream3fvATI); \
FUNC(glVertexStream3dATI); \
FUNC(glVertexStream3dvATI); \
FUNC(glVertexStream4sATI); \
FUNC(glVertexStream4svATI); \
FUNC(glVertexStream4iATI); \
FUNC(glVertexStream4ivATI); \
FUNC(glVertexStream4fATI); \
FUNC(glVertexStream4fvATI); \
FUNC(glVertexStream4dATI); \
FUNC(glVertexStream4dvATI); \
FUNC(glNormalStream3bATI); \
FUNC(glNormalStream3bvATI); \
FUNC(glNormalStream3sATI); \
FUNC(glNormalStream3svATI); \
FUNC(glNormalStream3iATI); \
FUNC(glNormalStream3ivATI); \
FUNC(glNormalStream3fATI); \
FUNC(glNormalStream3fvATI); \
FUNC(glNormalStream3dATI); \
FUNC(glNormalStream3dvATI); \
FUNC(glClientActiveVertexStreamATI); \
FUNC(glVertexBlendEnviATI); \
FUNC(glVertexBlendEnvfATI); \
FUNC(glUniformBufferEXT); \
FUNC(glGetUniformBufferSizeEXT); \
FUNC(glGetUniformOffsetEXT); \
FUNC(glBlendFuncSeparateEXT); \
FUNC(glColorSubTableEXT); \
FUNC(glCopyColorSubTableEXT); \
FUNC(glLockArraysEXT); \
FUNC(glUnlockArraysEXT); \
FUNC(glConvolutionFilter1DEXT); \
FUNC(glConvolutionFilter2DEXT); \
FUNC(glConvolutionParameterfEXT); \
FUNC(glConvolutionParameterfvEXT); \
FUNC(glConvolutionParameteriEXT); \
FUNC(glConvolutionParameterivEXT); \
FUNC(glCopyConvolutionFilter1DEXT); \
FUNC(glCopyConvolutionFilter2DEXT); \
FUNC(glGetConvolutionFilterEXT); \
FUNC(glGetConvolutionParameterfvEXT); \
FUNC(glGetConvolutionParameterivEXT); \
FUNC(glGetSeparableFilterEXT); \
FUNC(glSeparableFilter2DEXT); \
FUNC(glTangent3bEXT); \
FUNC(glTangent3bvEXT); \
FUNC(glTangent3dEXT); \
FUNC(glTangent3dvEXT); \
FUNC(glTangent3fEXT); \
FUNC(glTangent3fvEXT); \
FUNC(glTangent3iEXT); \
FUNC(glTangent3ivEXT); \
FUNC(glTangent3sEXT); \
FUNC(glTangent3svEXT); \
FUNC(glBinormal3bEXT); \
FUNC(glBinormal3bvEXT); \
FUNC(glBinormal3dEXT); \
FUNC(glBinormal3dvEXT); \
FUNC(glBinormal3fEXT); \
FUNC(glBinormal3fvEXT); \
FUNC(glBinormal3iEXT); \
FUNC(glBinormal3ivEXT); \
FUNC(glBinormal3sEXT); \
FUNC(glBinormal3svEXT); \
FUNC(glTangentPointerEXT); \
FUNC(glBinormalPointerEXT); \
FUNC(glCopyTexImage1DEXT); \
FUNC(glCopyTexImage2DEXT); \
FUNC(glCopyTexSubImage1DEXT); \
FUNC(glCopyTexSubImage2DEXT); \
FUNC(glCopyTexSubImage3DEXT); \
FUNC(glCullParameterdvEXT); \
FUNC(glCullParameterfvEXT); \
FUNC(glBufferStorageExternalEXT); \
FUNC(glNamedBufferStorageExternalEXT); \
FUNC(glFogCoordfEXT); \
FUNC(glFogCoordfvEXT); \
FUNC(glFogCoorddEXT); \
FUNC(glFogCoorddvEXT); \
FUNC(glFogCoordPointerEXT); \
FUNC(glProgramEnvParameters4fvEXT); \
FUNC(glProgramLocalParameters4fvEXT); \
FUNC(glGetHistogramEXT); \
FUNC(glGetHistogramParameterfvEXT); \
FUNC(glGetHistogramParameterivEXT); \
FUNC(glGetMinmaxEXT); \
FUNC(glGetMinmaxParameterfvEXT); \
FUNC(glGetMinmaxParameterivEXT); \
FUNC(glHistogramEXT); \
FUNC(glMinmaxEXT); \
FUNC(glResetHistogramEXT); \
FUNC(glResetMinmaxEXT); \
FUNC(glIndexFuncEXT); \
FUNC(glIndexMaterialEXT); \
FUNC(glApplyTextureEXT); \
FUNC(glTextureLightEXT); \
FUNC(glTextureMaterialEXT); \
FUNC(glMultiDrawElementsEXT); \
FUNC(glSampleMaskEXT); \
FUNC(glSamplePatternEXT); \
FUNC(glColorTableEXT); \
FUNC(glGetColorTableEXT); \
FUNC(glGetColorTableParameterivEXT); \
FUNC(glGetColorTableParameterfvEXT); \
FUNC(glPixelTransformParameteriEXT); \
FUNC(glPixelTransformParameterfEXT); \
FUNC(glPixelTransformParameterivEXT); \
FUNC(glPixelTransformParameterfvEXT); \
FUNC(glGetPixelTransformParameterivEXT); \
FUNC(glGetPixelTransformParameterfvEXT); \
FUNC(glPolygonOffsetEXT); \
FUNC(glSecondaryColor3bEXT); \
FUNC(glSecondaryColor3bvEXT); \
FUNC(glSecondaryColor3dEXT); \
FUNC(glSecondaryColor3dvEXT); \
FUNC(glSecondaryColor3fEXT); \
FUNC(glSecondaryColor3fvEXT); \
FUNC(glSecondaryColor3iEXT); \
FUNC(glSecondaryColor3ivEXT); \
FUNC(glSecondaryColor3sEXT); \
FUNC(glSecondaryColor3svEXT); \
FUNC(glSecondaryColor3ubEXT); \
FUNC(glSecondaryColor3ubvEXT); \
FUNC(glSecondaryColor3uiEXT); \
FUNC(glSecondaryColor3uivEXT); \
FUNC(glSecondaryColor3usEXT); \
FUNC(glSecondaryColor3usvEXT); \
FUNC(glSecondaryColorPointerEXT); \
FUNC(glStencilClearTagEXT); \
FUNC(glActiveStencilFaceEXT); \
FUNC(glTexSubImage1DEXT); \
FUNC(glTexSubImage2DEXT); \
FUNC(glTexSubImage3DEXT); \
FUNC(glClearColorIiEXT); \
FUNC(glClearColorIuiEXT); \
FUNC(glAreTexturesResidentEXT); \
FUNC(glBindTextureEXT); \
FUNC(glDeleteTexturesEXT); \
FUNC(glGenTexturesEXT); \
FUNC(glIsTextureEXT); \
FUNC(glPrioritizeTexturesEXT); \
FUNC(glTextureNormalEXT); \
FUNC(glBindBufferOffsetEXT); \
FUNC(glArrayElementEXT); \
FUNC(glColorPointerEXT); \
FUNC(glDrawArraysEXT); \
FUNC(glEdgeFlagPointerEXT); \
FUNC(glGetPointervEXT); \
FUNC(glIndexPointerEXT); \
FUNC(glNormalPointerEXT); \
FUNC(glTexCoordPointerEXT); \
FUNC(glVertexPointerEXT); \
FUNC(glBeginVertexShaderEXT); \
FUNC(glEndVertexShaderEXT); \
FUNC(glBindVertexShaderEXT); \
FUNC(glGenVertexShadersEXT); \
FUNC(glDeleteVertexShaderEXT); \
FUNC(glShaderOp1EXT); \
FUNC(glShaderOp2EXT); \
FUNC(glShaderOp3EXT); \
FUNC(glSwizzleEXT); \
FUNC(glWriteMaskEXT); \
FUNC(glInsertComponentEXT); \
FUNC(glExtractComponentEXT); \
FUNC(glGenSymbolsEXT); \
FUNC(glSetInvariantEXT); \
FUNC(glSetLocalConstantEXT); \
FUNC(glVariantbvEXT); \
FUNC(glVariantsvEXT); \
FUNC(glVariantivEXT); \
FUNC(glVariantfvEXT); \
FUNC(glVariantdvEXT); \
FUNC(glVariantubvEXT); \
FUNC(glVariantusvEXT); \
FUNC(glVariantuivEXT); \
FUNC(glVariantPointerEXT); \
FUNC(glEnableVariantClientStateEXT); \
FUNC(glDisableVariantClientStateEXT); \
FUNC(glBindLightParameterEXT); \
FUNC(glBindMaterialParameterEXT); \
FUNC(glBindTexGenParameterEXT); \
FUNC(glBindTextureUnitParameterEXT); \
FUNC(glBindParameterEXT); \
FUNC(glIsVariantEnabledEXT); \
FUNC(glGetVariantBooleanvEXT); \
FUNC(glGetVariantIntegervEXT); \
FUNC(glGetVariantFloatvEXT); \
FUNC(glGetVariantPointervEXT); \
FUNC(glGetInvariantBooleanvEXT); \
FUNC(glGetInvariantIntegervEXT); \
FUNC(glGetInvariantFloatvEXT); \
FUNC(glGetLocalConstantBooleanvEXT); \
FUNC(glGetLocalConstantIntegervEXT); \
FUNC(glGetLocalConstantFloatvEXT); \
FUNC(glVertexWeightfEXT); \
FUNC(glVertexWeightfvEXT); \
FUNC(glVertexWeightPointerEXT); \
FUNC(glImportSyncEXT); \
FUNC(glImageTransformParameteriHP); \
FUNC(glImageTransformParameterfHP); \
FUNC(glImageTransformParameterivHP); \
FUNC(glImageTransformParameterfvHP); \
FUNC(glGetImageTransformParameterivHP); \
FUNC(glGetImageTransformParameterfvHP); \
FUNC(glMultiModeDrawArraysIBM); \
FUNC(glMultiModeDrawElementsIBM); \
FUNC(glFlushStaticDataIBM); \
FUNC(glColorPointerListIBM); \
FUNC(glSecondaryColorPointerListIBM); \
FUNC(glEdgeFlagPointerListIBM); \
FUNC(glFogCoordPointerListIBM); \
FUNC(glIndexPointerListIBM); \
FUNC(glNormalPointerListIBM); \
FUNC(glTexCoordPointerListIBM); \
FUNC(glVertexPointerListIBM); \
FUNC(glBlendFuncSeparateINGR); \
FUNC(glSyncTextureINTEL); \
FUNC(glUnmapTexture2DINTEL); \
FUNC(glMapTexture2DINTEL); \
FUNC(glVertexPointervINTEL); \
FUNC(glNormalPointervINTEL); \
FUNC(glColorPointervINTEL); \
FUNC(glTexCoordPointervINTEL); \
FUNC(glResizeBuffersMESA); \
FUNC(glWindowPos2dMESA); \
FUNC(glWindowPos2dvMESA); \
FUNC(glWindowPos2fMESA); \
FUNC(glWindowPos2fvMESA); \
FUNC(glWindowPos2iMESA); \
FUNC(glWindowPos2ivMESA); \
FUNC(glWindowPos2sMESA); \
FUNC(glWindowPos2svMESA); \
FUNC(glWindowPos3dMESA); \
FUNC(glWindowPos3dvMESA); \
FUNC(glWindowPos3fMESA); \
FUNC(glWindowPos3fvMESA); \
FUNC(glWindowPos3iMESA); \
FUNC(glWindowPos3ivMESA); \
FUNC(glWindowPos3sMESA); \
FUNC(glWindowPos3svMESA); \
FUNC(glWindowPos4dMESA); \
FUNC(glWindowPos4dvMESA); \
FUNC(glWindowPos4fMESA); \
FUNC(glWindowPos4fvMESA); \
FUNC(glWindowPos4iMESA); \
FUNC(glWindowPos4ivMESA); \
FUNC(glWindowPos4sMESA); \
FUNC(glWindowPos4svMESA); \
FUNC(glBeginConditionalRenderNVX); \
FUNC(glEndConditionalRenderNVX); \
FUNC(glLGPUNamedBufferSubDataNVX); \
FUNC(glLGPUCopyImageSubDataNVX); \
FUNC(glLGPUInterlockNVX); \
FUNC(glAlphaToCoverageDitherControlNV); \
FUNC(glCopyImageSubDataNV); \
FUNC(glDepthRangedNV); \
FUNC(glClearDepthdNV); \
FUNC(glDepthBoundsdNV); \
FUNC(glDrawTextureNV); \
FUNC(glMapControlPointsNV); \
FUNC(glMapParameterivNV); \
FUNC(glMapParameterfvNV); \
FUNC(glGetMapControlPointsNV); \
FUNC(glGetMapParameterivNV); \
FUNC(glGetMapParameterfvNV); \
FUNC(glGetMapAttribParameterivNV); \
FUNC(glGetMapAttribParameterfvNV); \
FUNC(glEvalMapsNV); \
FUNC(glGetMultisamplefvNV); \
FUNC(glSampleMaskIndexedNV); \
FUNC(glTexRenderbufferNV); \
FUNC(glDeleteFencesNV); \
FUNC(glGenFencesNV); \
FUNC(glIsFenceNV); \
FUNC(glTestFenceNV); \
FUNC(glGetFenceivNV); \
FUNC(glFinishFenceNV); \
FUNC(glSetFenceNV); \
FUNC(glProgramNamedParameter4fNV); \
FUNC(glProgramNamedParameter4fvNV); \
FUNC(glProgramNamedParameter4dNV); \
FUNC(glProgramNamedParameter4dvNV); \
FUNC(glGetProgramNamedParameterfvNV); \
FUNC(glGetProgramNamedParameterdvNV); \
FUNC(glProgramVertexLimitNV); \
FUNC(glFramebufferTextureFaceEXT); \
FUNC(glRenderGpuMaskNV); \
FUNC(glMulticastBufferSubDataNV); \
FUNC(glMulticastCopyBufferSubDataNV); \
FUNC(glMulticastCopyImageSubDataNV); \
FUNC(glMulticastBlitFramebufferNV); \
FUNC(glMulticastFramebufferSampleLocationsfvNV); \
FUNC(glMulticastBarrierNV); \
FUNC(glMulticastWaitSyncNV); \
FUNC(glMulticastGetQueryObjectivNV); \
FUNC(glMulticastGetQueryObjectuivNV); \
FUNC(glMulticastGetQueryObjecti64vNV); \
FUNC(glMulticastGetQueryObjectui64vNV); \
FUNC(glProgramLocalParameterI4iNV); \
FUNC(glProgramLocalParameterI4ivNV); \
FUNC(glProgramLocalParametersI4ivNV); \
FUNC(glProgramLocalParameterI4uiNV); \
FUNC(glProgramLocalParameterI4uivNV); \
FUNC(glProgramLocalParametersI4uivNV); \
FUNC(glProgramEnvParameterI4iNV); \
FUNC(glProgramEnvParameterI4ivNV); \
FUNC(glProgramEnvParametersI4ivNV); \
FUNC(glProgramEnvParameterI4uiNV); \
FUNC(glProgramEnvParameterI4uivNV); \
FUNC(glProgramEnvParametersI4uivNV); \
FUNC(glGetProgramLocalParameterIivNV); \
FUNC(glGetProgramLocalParameterIuivNV); \
FUNC(glGetProgramEnvParameterIivNV); \
FUNC(glGetProgramEnvParameterIuivNV); \
FUNC(glProgramSubroutineParametersuivNV); \
FUNC(glGetProgramSubroutineParameteruivNV); \
FUNC(glVertex2hNV); \
FUNC(glVertex2hvNV); \
FUNC(glVertex3hNV); \
FUNC(glVertex3hvNV); \
FUNC(glVertex4hNV); \
FUNC(glVertex4hvNV); \
FUNC(glNormal3hNV); \
FUNC(glNormal3hvNV); \
FUNC(glColor3hNV); \
FUNC(glColor3hvNV); \
FUNC(glColor4hNV); \
FUNC(glColor4hvNV); \
FUNC(glTexCoord1hNV); \
FUNC(glTexCoord1hvNV); \
FUNC(glTexCoord2hNV); \
FUNC(glTexCoord2hvNV); \
FUNC(glTexCoord3hNV); \
FUNC(glTexCoord3hvNV); \
FUNC(glTexCoord4hNV); \
FUNC(glTexCoord4hvNV); \
FUNC(glMultiTexCoord1hNV); \
FUNC(glMultiTexCoord1hvNV); \
FUNC(glMultiTexCoord2hNV); \
FUNC(glMultiTexCoord2hvNV); \
FUNC(glMultiTexCoord3hNV); \
FUNC(glMultiTexCoord3hvNV); \
FUNC(glMultiTexCoord4hNV); \
FUNC(glMultiTexCoord4hvNV); \
FUNC(glFogCoordhNV); \
FUNC(glFogCoordhvNV); \
FUNC(glSecondaryColor3hNV); \
FUNC(glSecondaryColor3hvNV); \
FUNC(glVertexWeighthNV); \
FUNC(glVertexWeighthvNV); \
FUNC(glVertexAttrib1hNV); \
FUNC(glVertexAttrib1hvNV); \
FUNC(glVertexAttrib2hNV); \
FUNC(glVertexAttrib2hvNV); \
FUNC(glVertexAttrib3hNV); \
FUNC(glVertexAttrib3hvNV); \
FUNC(glVertexAttrib4hNV); \
FUNC(glVertexAttrib4hvNV); \
FUNC(glVertexAttribs1hvNV); \
FUNC(glVertexAttribs2hvNV); \
FUNC(glVertexAttribs3hvNV); \
FUNC(glVertexAttribs4hvNV); \
FUNC(glGenOcclusionQueriesNV); \
FUNC(glDeleteOcclusionQueriesNV); \
FUNC(glIsOcclusionQueryNV); \
FUNC(glBeginOcclusionQueryNV); \
FUNC(glEndOcclusionQueryNV); \
FUNC(glGetOcclusionQueryivNV); \
FUNC(glGetOcclusionQueryuivNV); \
FUNC(glProgramBufferParametersfvNV); \
FUNC(glProgramBufferParametersIivNV); \
FUNC(glProgramBufferParametersIuivNV); \
FUNC(glPathColorGenNV); \
FUNC(glPathTexGenNV); \
FUNC(glPathFogGenNV); \
FUNC(glGetPathColorGenivNV); \
FUNC(glGetPathColorGenfvNV); \
FUNC(glGetPathTexGenivNV); \
FUNC(glGetPathTexGenfvNV); \
FUNC(glPixelDataRangeNV); \
FUNC(glFlushPixelDataRangeNV); \
FUNC(glPointParameteriNV); \
FUNC(glPointParameterivNV); \
FUNC(glPresentFrameKeyedNV); \
FUNC(glPresentFrameDualFillNV); \
FUNC(glGetVideoivNV); \
FUNC(glGetVideouivNV); \
FUNC(glGetVideoi64vNV); \
FUNC(glGetVideoui64vNV); \
FUNC(glPrimitiveRestartNV); \
FUNC(glPrimitiveRestartIndexNV); \
FUNC(glQueryResourceNV); \
FUNC(glGenQueryResourceTagNV); \
FUNC(glDeleteQueryResourceTagNV); \
FUNC(glQueryResourceTagNV); \
FUNC(glCombinerParameterfvNV); \
FUNC(glCombinerParameterfNV); \
FUNC(glCombinerParameterivNV); \
FUNC(glCombinerParameteriNV); \
FUNC(glCombinerInputNV); \
FUNC(glCombinerOutputNV); \
FUNC(glFinalCombinerInputNV); \
FUNC(glGetCombinerInputParameterfvNV); \
FUNC(glGetCombinerInputParameterivNV); \
FUNC(glGetCombinerOutputParameterfvNV); \
FUNC(glGetCombinerOutputParameterivNV); \
FUNC(glGetFinalCombinerInputParameterfvNV); \
FUNC(glGetFinalCombinerInputParameterivNV); \
FUNC(glCombinerStageParameterfvNV); \
FUNC(glGetCombinerStageParameterfvNV); \
FUNC(glTexImage2DMultisampleCoverageNV); \
FUNC(glTexImage3DMultisampleCoverageNV); \
FUNC(glTextureImage2DMultisampleNV); \
FUNC(glTextureImage3DMultisampleNV); \
FUNC(glTextureImage2DMultisampleCoverageNV); \
FUNC(glTextureImage3DMultisampleCoverageNV); \
FUNC(glBeginTransformFeedbackNV); \
FUNC(glEndTransformFeedbackNV); \
FUNC(glTransformFeedbackAttribsNV); \
FUNC(glBindBufferRangeNV); \
FUNC(glBindBufferOffsetNV); \
FUNC(glBindBufferBaseNV); \
FUNC(glTransformFeedbackVaryingsNV); \
FUNC(glActiveVaryingNV); \
FUNC(glGetVaryingLocationNV); \
FUNC(glGetActiveVaryingNV); \
FUNC(glGetTransformFeedbackVaryingNV); \
FUNC(glTransformFeedbackStreamAttribsNV); \
FUNC(glBindTransformFeedbackNV); \
FUNC(glDeleteTransformFeedbacksNV); \
FUNC(glGenTransformFeedbacksNV); \
FUNC(glIsTransformFeedbackNV); \
FUNC(glPauseTransformFeedbackNV); \
FUNC(glResumeTransformFeedbackNV); \
FUNC(glDrawTransformFeedbackNV); \
FUNC(glVDPAUInitNV); \
FUNC(glVDPAUFiniNV); \
FUNC(glVDPAURegisterVideoSurfaceNV); \
FUNC(glVDPAURegisterOutputSurfaceNV); \
FUNC(glVDPAUIsSurfaceNV); \
FUNC(glVDPAUUnregisterSurfaceNV); \
FUNC(glVDPAUGetSurfaceivNV); \
FUNC(glVDPAUSurfaceAccessNV); \
FUNC(glVDPAUMapSurfacesNV); \
FUNC(glVDPAUUnmapSurfacesNV); \
FUNC(glFlushVertexArrayRangeNV); \
FUNC(glVertexArrayRangeNV); \
FUNC(glAreProgramsResidentNV); \
FUNC(glBindProgramNV); \
FUNC(glDeleteProgramsNV); \
FUNC(glExecuteProgramNV); \
FUNC(glGenProgramsNV); \
FUNC(glGetProgramParameterdvNV); \
FUNC(glGetProgramParameterfvNV); \
FUNC(glGetProgramivNV); \
FUNC(glGetProgramStringNV); \
FUNC(glGetTrackMatrixivNV); \
FUNC(glGetVertexAttribdvNV); \
FUNC(glGetVertexAttribfvNV); \
FUNC(glGetVertexAttribivNV); \
FUNC(glGetVertexAttribPointervNV); \
FUNC(glIsProgramNV); \
FUNC(glLoadProgramNV); \
FUNC(glProgramParameter4dNV); \
FUNC(glProgramParameter4dvNV); \
FUNC(glProgramParameter4fNV); \
FUNC(glProgramParameter4fvNV); \
FUNC(glProgramParameters4dvNV); \
FUNC(glProgramParameters4fvNV); \
FUNC(glRequestResidentProgramsNV); \
FUNC(glTrackMatrixNV); \
FUNC(glVertexAttribPointerNV); \
FUNC(glVertexAttrib1dNV); \
FUNC(glVertexAttrib1dvNV); \
FUNC(glVertexAttrib1fNV); \
FUNC(glVertexAttrib1fvNV); \
FUNC(glVertexAttrib1sNV); \
FUNC(glVertexAttrib1svNV); \
FUNC(glVertexAttrib2dNV); \
FUNC(glVertexAttrib2dvNV); \
FUNC(glVertexAttrib2fNV); \
FUNC(glVertexAttrib2fvNV); \
FUNC(glVertexAttrib2sNV); \
FUNC(glVertexAttrib2svNV); \
FUNC(glVertexAttrib3dNV); \
FUNC(glVertexAttrib3dvNV); \
FUNC(glVertexAttrib3fNV); \
FUNC(glVertexAttrib3fvNV); \
FUNC(glVertexAttrib3sNV); \
FUNC(glVertexAttrib3svNV); \
FUNC(glVertexAttrib4dNV); \
FUNC(glVertexAttrib4dvNV); \
FUNC(glVertexAttrib4fNV); \
FUNC(glVertexAttrib4fvNV); \
FUNC(glVertexAttrib4sNV); \
FUNC(glVertexAttrib4svNV); \
FUNC(glVertexAttrib4ubNV); \
FUNC(glVertexAttrib4ubvNV); \
FUNC(glVertexAttribs1dvNV); \
FUNC(glVertexAttribs1fvNV); \
FUNC(glVertexAttribs1svNV); \
FUNC(glVertexAttribs2dvNV); \
FUNC(glVertexAttribs2fvNV); \
FUNC(glVertexAttribs2svNV); \
FUNC(glVertexAttribs3dvNV); \
FUNC(glVertexAttribs3fvNV); \
FUNC(glVertexAttribs3svNV); \
FUNC(glVertexAttribs4dvNV); \
FUNC(glVertexAttribs4fvNV); \
FUNC(glVertexAttribs4svNV); \
FUNC(glVertexAttribs4ubvNV); \
FUNC(glBeginVideoCaptureNV); \
FUNC(glBindVideoCaptureStreamBufferNV); \
FUNC(glBindVideoCaptureStreamTextureNV); \
FUNC(glEndVideoCaptureNV); \
FUNC(glGetVideoCaptureivNV); \
FUNC(glGetVideoCaptureStreamivNV); \
FUNC(glGetVideoCaptureStreamfvNV); \
FUNC(glGetVideoCaptureStreamdvNV); \
FUNC(glVideoCaptureNV); \
FUNC(glVideoCaptureStreamParameterivNV); \
FUNC(glVideoCaptureStreamParameterfvNV); \
FUNC(glVideoCaptureStreamParameterdvNV); \
FUNC(glHintPGI); \
FUNC(glDetailTexFuncSGIS); \
FUNC(glGetDetailTexFuncSGIS); \
FUNC(glFogFuncSGIS); \
FUNC(glGetFogFuncSGIS); \
FUNC(glSampleMaskSGIS); \
FUNC(glSamplePatternSGIS); \
FUNC(glPixelTexGenParameteriSGIS); \
FUNC(glPixelTexGenParameterivSGIS); \
FUNC(glPixelTexGenParameterfSGIS); \
FUNC(glPixelTexGenParameterfvSGIS); \
FUNC(glGetPixelTexGenParameterivSGIS); \
FUNC(glGetPixelTexGenParameterfvSGIS); \
FUNC(glPointParameterfSGIS); \
FUNC(glPointParameterfvSGIS); \
FUNC(glSharpenTexFuncSGIS); \
FUNC(glGetSharpenTexFuncSGIS); \
FUNC(glTexImage4DSGIS); \
FUNC(glTexSubImage4DSGIS); \
FUNC(glTextureColorMaskSGIS); \
FUNC(glGetTexFilterFuncSGIS); \
FUNC(glTexFilterFuncSGIS); \
FUNC(glAsyncMarkerSGIX); \
FUNC(glFinishAsyncSGIX); \
FUNC(glPollAsyncSGIX); \
FUNC(glGenAsyncMarkersSGIX); \
FUNC(glDeleteAsyncMarkersSGIX); \
FUNC(glIsAsyncMarkerSGIX); \
FUNC(glFlushRasterSGIX); \
FUNC(glFragmentColorMaterialSGIX); \
FUNC(glFragmentLightfSGIX); \
FUNC(glFragmentLightfvSGIX); \
FUNC(glFragmentLightiSGIX); \
FUNC(glFragmentLightivSGIX); \
FUNC(glFragmentLightModelfSGIX); \
FUNC(glFragmentLightModelfvSGIX); \
FUNC(glFragmentLightModeliSGIX); \
FUNC(glFragmentLightModelivSGIX); \
FUNC(glFragmentMaterialfSGIX); \
FUNC(glFragmentMaterialfvSGIX); \
FUNC(glFragmentMaterialiSGIX); \
FUNC(glFragmentMaterialivSGIX); \
FUNC(glGetFragmentLightfvSGIX); \
FUNC(glGetFragmentLightivSGIX); \
FUNC(glGetFragmentMaterialfvSGIX); \
FUNC(glGetFragmentMaterialivSGIX); \
FUNC(glLightEnviSGIX); \
FUNC(glFrameZoomSGIX); \
FUNC(glIglooInterfaceSGIX); \
FUNC(glGetInstrumentsSGIX); \
FUNC(glInstrumentsBufferSGIX); \
FUNC(glPollInstrumentsSGIX); \
FUNC(glReadInstrumentsSGIX); \
FUNC(glStartInstrumentsSGIX); \
FUNC(glStopInstrumentsSGIX); \
FUNC(glGetListParameterfvSGIX); \
FUNC(glGetListParameterivSGIX); \
FUNC(glListParameterfSGIX); \
FUNC(glListParameterfvSGIX); \
FUNC(glListParameteriSGIX); \
FUNC(glListParameterivSGIX); \
FUNC(glPixelTexGenSGIX); \
FUNC(glDeformationMap3dSGIX); \
FUNC(glDeformationMap3fSGIX); \
FUNC(glDeformSGIX); \
FUNC(glLoadIdentityDeformationMapSGIX); \
FUNC(glReferencePlaneSGIX); \
FUNC(glSpriteParameterfSGIX); \
FUNC(glSpriteParameterfvSGIX); \
FUNC(glSpriteParameteriSGIX); \
FUNC(glSpriteParameterivSGIX); \
FUNC(glTagSampleBufferSGIX); \
FUNC(glColorTableSGI); \
FUNC(glColorTableParameterfvSGI); \
FUNC(glColorTableParameterivSGI); \
FUNC(glCopyColorTableSGI); \
FUNC(glGetColorTableSGI); \
FUNC(glGetColorTableParameterfvSGI); \
FUNC(glGetColorTableParameterivSGI); \
FUNC(glFinishTextureSUNX); \
FUNC(glGlobalAlphaFactorbSUN); \
FUNC(glGlobalAlphaFactorsSUN); \
FUNC(glGlobalAlphaFactoriSUN); \
FUNC(glGlobalAlphaFactorfSUN); \
FUNC(glGlobalAlphaFactordSUN); \
FUNC(glGlobalAlphaFactorubSUN); \
FUNC(glGlobalAlphaFactorusSUN); \
FUNC(glGlobalAlphaFactoruiSUN); \
FUNC(glDrawMeshArraysSUN); \
FUNC(glReplacementCodeuiSUN); \
FUNC(glReplacementCodeusSUN); \
FUNC(glReplacementCodeubSUN); \
FUNC(glReplacementCodeuivSUN); \
FUNC(glReplacementCodeusvSUN); \
FUNC(glReplacementCodeubvSUN); \
FUNC(glReplacementCodePointerSUN); \
FUNC(glColor4ubVertex2fSUN); \
FUNC(glColor4ubVertex2fvSUN); \
FUNC(glColor4ubVertex3fSUN); \
FUNC(glColor4ubVertex3fvSUN); \
FUNC(glColor3fVertex3fSUN); \
FUNC(glColor3fVertex3fvSUN); \
FUNC(glNormal3fVertex3fSUN); \
FUNC(glNormal3fVertex3fvSUN); \
FUNC(glColor4fNormal3fVertex3fSUN); \
FUNC(glColor4fNormal3fVertex3fvSUN); \
FUNC(glTexCoord2fVertex3fSUN); \
FUNC(glTexCoord2fVertex3fvSUN); \
FUNC(glTexCoord4fVertex4fSUN); \
FUNC(glTexCoord4fVertex4fvSUN); \
FUNC(glTexCoord2fColor4ubVertex3fSUN); \
FUNC(glTexCoord2fColor4ubVertex3fvSUN); \
FUNC(glTexCoord2fColor3fVertex3fSUN); \
FUNC(glTexCoord2fColor3fVertex3fvSUN); \
FUNC(glTexCoord2fNormal3fVertex3fSUN); \
FUNC(glTexCoord2fNormal3fVertex3fvSUN); \
FUNC(glTexCoord2fColor4fNormal3fVertex3fSUN); \
FUNC(glTexCoord2fColor4fNormal3fVertex3fvSUN); \
FUNC(glTexCoord4fColor4fNormal3fVertex4fSUN); \
FUNC(glTexCoord4fColor4fNormal3fVertex4fvSUN); \
FUNC(glReplacementCodeuiVertex3fSUN); \
FUNC(glReplacementCodeuiVertex3fvSUN); \
FUNC(glReplacementCodeuiColor4ubVertex3fSUN); \
FUNC(glReplacementCodeuiColor4ubVertex3fvSUN); \
FUNC(glReplacementCodeuiColor3fVertex3fSUN); \
FUNC(glReplacementCodeuiColor3fVertex3fvSUN); \
FUNC(glReplacementCodeuiNormal3fVertex3fSUN); \
FUNC(glReplacementCodeuiNormal3fVertex3fvSUN); \
FUNC(glReplacementCodeuiColor4fNormal3fVertex3fSUN); \
FUNC(glReplacementCodeuiColor4fNormal3fVertex3fvSUN); \
FUNC(glReplacementCodeuiTexCoord2fVertex3fSUN); \
FUNC(glReplacementCodeuiTexCoord2fVertex3fvSUN); \
FUNC(glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN); \
FUNC(glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN); \
FUNC(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN); \
FUNC(glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN); \
FUNC(glGetGraphicsResetStatusKHR); \
FUNC(glReadnPixelsKHR); \
FUNC(glGetnUniformfvKHR); \
FUNC(glGetnUniformivKHR); \
FUNC(glGetnUniformuivKHR); \
FUNC(glEGLImageTargetTexture2DOES); \
FUNC(glEGLImageTargetRenderbufferStorageOES); \
FUNC(glGetProgramBinaryOES); \
FUNC(glProgramBinaryOES); \
FUNC(glBlitFramebufferANGLE); \
FUNC(glRenderbufferStorageMultisampleANGLE); \
FUNC(glDrawArraysInstancedANGLE); \
FUNC(glDrawElementsInstancedANGLE); \
FUNC(glVertexAttribDivisorANGLE); \
FUNC(glGetTranslatedShaderSourceANGLE); \
FUNC(glCopyTextureLevelsAPPLE); \
FUNC(glRenderbufferStorageMultisampleAPPLE); \
FUNC(glResolveMultisampleFramebufferAPPLE); \
FUNC(glFenceSyncAPPLE); \
FUNC(glIsSyncAPPLE); \
FUNC(glDeleteSyncAPPLE); \
FUNC(glClientWaitSyncAPPLE); \
FUNC(glWaitSyncAPPLE); \
FUNC(glGetInteger64vAPPLE); \
FUNC(glGetSyncivAPPLE); \
FUNC(glBindFragDataLocationIndexedEXT); \
FUNC(glGetProgramResourceLocationIndexEXT); \
FUNC(glGetFragDataIndexEXT); \
FUNC(glBufferStorageEXT); \
FUNC(glClearTexImageEXT); \
FUNC(glClearTexSubImageEXT); \
FUNC(glClipControlEXT); \
FUNC(glDrawTransformFeedbackEXT); \
FUNC(glDrawTransformFeedbackInstancedEXT); \
FUNC(glVertexAttribDivisorEXT); \
FUNC(glMapBufferRangeEXT); \
FUNC(glFlushMappedBufferRangeEXT); \
FUNC(glMultiDrawArraysIndirectEXT); \
FUNC(glMultiDrawElementsIndirectEXT); \
FUNC(glReadBufferIndexedEXT); \
FUNC(glDrawBuffersIndexedEXT); \
FUNC(glGetIntegeri_vEXT); \
FUNC(glFramebufferPixelLocalStorageSizeEXT); \
FUNC(glGetFramebufferPixelLocalStorageSizeEXT); \
FUNC(glClearPixelLocalStorageuiEXT); \
FUNC(glTexPageCommitmentEXT); \
FUNC(glGetTextureHandleIMG); \
FUNC(glGetTextureSamplerHandleIMG); \
FUNC(glUniformHandleui64IMG); \
FUNC(glUniformHandleui64vIMG); \
FUNC(glProgramUniformHandleui64IMG); \
FUNC(glProgramUniformHandleui64vIMG); \
FUNC(glFramebufferTexture2DDownsampleIMG); \
FUNC(glFramebufferTextureLayerDownsampleIMG); \
FUNC(glRenderbufferStorageMultisampleIMG); \
FUNC(glFramebufferTexture2DMultisampleIMG); \
FUNC(glCopyBufferSubDataNV); \
FUNC(glCoverageMaskNV); \
FUNC(glCoverageOperationNV); \
FUNC(glDrawBuffersNV); \
FUNC(glDrawArraysInstancedNV); \
FUNC(glDrawElementsInstancedNV); \
FUNC(glBlitFramebufferNV); \
FUNC(glRenderbufferStorageMultisampleNV); \
FUNC(glVertexAttribDivisorNV); \
FUNC(glUniformMatrix2x3fvNV); \
FUNC(glUniformMatrix3x2fvNV); \
FUNC(glUniformMatrix2x4fvNV); \
FUNC(glUniformMatrix4x2fvNV); \
FUNC(glUniformMatrix3x4fvNV); \
FUNC(glUniformMatrix4x3fvNV); \
FUNC(glPolygonModeNV); \
FUNC(glReadBufferNV); \
FUNC(glAlphaFuncQCOM); \
FUNC(glGetDriverControlsQCOM); \
FUNC(glGetDriverControlStringQCOM); \
FUNC(glEnableDriverControlQCOM); \
FUNC(glDisableDriverControlQCOM); \
FUNC(glExtGetTexturesQCOM); \
FUNC(glExtGetBuffersQCOM); \
FUNC(glExtGetRenderbuffersQCOM); \
FUNC(glExtGetFramebuffersQCOM); \
FUNC(glExtGetTexLevelParameterivQCOM); \
FUNC(glExtTexObjectStateOverrideiQCOM); \
FUNC(glExtGetTexSubImageQCOM); \
FUNC(glExtGetBufferPointervQCOM); \
FUNC(glExtGetShadersQCOM); \
FUNC(glExtGetProgramsQCOM); \
FUNC(glExtIsProgramBinaryQCOM); \
FUNC(glExtGetProgramBinarySourceQCOM); \
FUNC(glFramebufferFoveationConfigQCOM); \
FUNC(glFramebufferFoveationParametersQCOM); \
FUNC(glFramebufferFetchBarrierQCOM); \
FUNC(glTextureFoveationParametersQCOM); \
FUNC(glStartTilingQCOM); \
FUNC(glEndTilingQCOM); \
FUNC(glIsList); \
FUNC(glDeleteLists); \
FUNC(glGenLists); \
FUNC(glNewList); \
FUNC(glEndList); \
FUNC(glCallList); \
FUNC(glCallLists); \
FUNC(glListBase); \
FUNC(glPrioritizeTextures); \
FUNC(glAreTexturesResident); \
FUNC(glMap1d); \
FUNC(glMap1f); \
FUNC(glMap2d); \
FUNC(glMap2f); \
FUNC(glGetMapdv); \
FUNC(glGetMapfv); \
FUNC(glGetMapiv); \
FUNC(glEvalCoord1d); \
FUNC(glEvalCoord1f); \
FUNC(glEvalCoord1dv); \
FUNC(glEvalCoord1fv); \
FUNC(glEvalCoord2d); \
FUNC(glEvalCoord2f); \
FUNC(glEvalCoord2dv); \
FUNC(glEvalCoord2fv); \
FUNC(glMapGrid1d); \
FUNC(glMapGrid1f); \
FUNC(glMapGrid2d); \
FUNC(glMapGrid2f); \
FUNC(glEvalPoint1); \
FUNC(glEvalPoint2); \
FUNC(glEvalMesh1); \
FUNC(glEvalMesh2); \
FUNC(glFogf); \
FUNC(glFogi); \
FUNC(glFogfv); \
FUNC(glFogiv); \
FUNC(glFeedbackBuffer); \
FUNC(glPassThrough); \
FUNC(glSelectBuffer); \
FUNC(glInitNames); \
FUNC(glLoadName); \
FUNC(glPushName); \
FUNC(glPopName); \
FUNC(glBegin); \
FUNC(glEnd); \
FUNC(glVertex2d); \
FUNC(glVertex2f); \
FUNC(glVertex2i); \
FUNC(glVertex2s); \
FUNC(glVertex3d); \
FUNC(glVertex3f); \
FUNC(glVertex3i); \
FUNC(glVertex3s); \
FUNC(glVertex4d); \
FUNC(glVertex4f); \
FUNC(glVertex4i); \
FUNC(glVertex4s); \
FUNC(glVertex2dv); \
FUNC(glVertex2fv); \
FUNC(glVertex2iv); \
FUNC(glVertex2sv); \
FUNC(glVertex3dv); \
FUNC(glVertex3fv); \
FUNC(glVertex3iv); \
FUNC(glVertex3sv); \
FUNC(glVertex4dv); \
FUNC(glVertex4fv); \
FUNC(glVertex4iv); \
FUNC(glVertex4sv); \
FUNC(glNormal3b); \
FUNC(glNormal3d); \
FUNC(glNormal3f); \
FUNC(glNormal3i); \
FUNC(glNormal3s); \
FUNC(glNormal3bv); \
FUNC(glNormal3dv); \
FUNC(glNormal3fv); \
FUNC(glNormal3iv); \
FUNC(glNormal3sv); \
FUNC(glIndexd); \
FUNC(glIndexf); \
FUNC(glIndexi); \
FUNC(glIndexs); \
FUNC(glIndexub); \
FUNC(glIndexdv); \
FUNC(glIndexfv); \
FUNC(glIndexiv); \
FUNC(glIndexsv); \
FUNC(glIndexubv); \
FUNC(glColor3b); \
FUNC(glColor3d); \
FUNC(glColor3f); \
FUNC(glColor3i); \
FUNC(glColor3s); \
FUNC(glColor3ub); \
FUNC(glColor3ui); \
FUNC(glColor3us); \
FUNC(glColor4b); \
FUNC(glColor4d); \
FUNC(glColor4f); \
FUNC(glColor4i); \
FUNC(glColor4s); \
FUNC(glColor4ub); \
FUNC(glColor4ui); \
FUNC(glColor4us); \
FUNC(glColor3bv); \
FUNC(glColor3dv); \
FUNC(glColor3fv); \
FUNC(glColor3iv); \
FUNC(glColor3sv); \
FUNC(glColor3ubv); \
FUNC(glColor3uiv); \
FUNC(glColor3usv); \
FUNC(glColor4bv); \
FUNC(glColor4dv); \
FUNC(glColor4fv); \
FUNC(glColor4iv); \
FUNC(glColor4sv); \
FUNC(glColor4ubv); \
FUNC(glColor4uiv); \
FUNC(glColor4usv); \
FUNC(glTexCoord1d); \
FUNC(glTexCoord1f); \
FUNC(glTexCoord1i); \
FUNC(glTexCoord1s); \
FUNC(glTexCoord2d); \
FUNC(glTexCoord2f); \
FUNC(glTexCoord2i); \
FUNC(glTexCoord2s); \
FUNC(glTexCoord3d); \
FUNC(glTexCoord3f); \
FUNC(glTexCoord3i); \
FUNC(glTexCoord3s); \
FUNC(glTexCoord4d); \
FUNC(glTexCoord4f); \
FUNC(glTexCoord4i); \
FUNC(glTexCoord4s); \
FUNC(glTexCoord1dv); \
FUNC(glTexCoord1fv); \
FUNC(glTexCoord1iv); \
FUNC(glTexCoord1sv); \
FUNC(glTexCoord2dv); \
FUNC(glTexCoord2fv); \
FUNC(glTexCoord2iv); \
FUNC(glTexCoord2sv); \
FUNC(glTexCoord3dv); \
FUNC(glTexCoord3fv); \
FUNC(glTexCoord3iv); \
FUNC(glTexCoord3sv); \
FUNC(glTexCoord4dv); \
FUNC(glTexCoord4fv); \
FUNC(glTexCoord4iv); \
FUNC(glTexCoord4sv); \
FUNC(glRasterPos2d); \
FUNC(glRasterPos2f); \
FUNC(glRasterPos2i); \
FUNC(glRasterPos2s); \
FUNC(glRasterPos3d); \
FUNC(glRasterPos3f); \
FUNC(glRasterPos3i); \
FUNC(glRasterPos3s); \
FUNC(glRasterPos4d); \
FUNC(glRasterPos4f); \
FUNC(glRasterPos4i); \
FUNC(glRasterPos4s); \
FUNC(glRasterPos2dv); \
FUNC(glRasterPos2fv); \
FUNC(glRasterPos2iv); \
FUNC(glRasterPos2sv); \
FUNC(glRasterPos3dv); \
FUNC(glRasterPos3fv); \
FUNC(glRasterPos3iv); \
FUNC(glRasterPos3sv); \
FUNC(glRasterPos4dv); \
FUNC(glRasterPos4fv); \
FUNC(glRasterPos4iv); \
FUNC(glRasterPos4sv); \
FUNC(glRectd); \
FUNC(glRectf); \
FUNC(glRecti); \
FUNC(glRects); \
FUNC(glRectdv); \
FUNC(glRectfv); \
FUNC(glRectiv); \
FUNC(glRectsv); \
FUNC(glPixelZoom); \
FUNC(glPixelTransferf); \
FUNC(glPixelTransferi); \
FUNC(glPixelMapfv); \
FUNC(glPixelMapuiv); \
FUNC(glPixelMapusv); \
FUNC(glGetPixelMapfv); \
FUNC(glGetPixelMapuiv); \
FUNC(glGetPixelMapusv); \
FUNC(glBitmap); \
FUNC(glDrawPixels); \
FUNC(glCopyPixels); \
FUNC(glShadeModel); \
FUNC(glLightf); \
FUNC(glLighti); \
FUNC(glLightfv); \
FUNC(glLightiv); \
FUNC(glGetLightfv); \
FUNC(glGetLightiv); \
FUNC(glLightModelf); \
FUNC(glLightModeli); \
FUNC(glLightModelfv); \
FUNC(glLightModeliv); \
FUNC(glMaterialf); \
FUNC(glMateriali); \
FUNC(glMaterialfv); \
FUNC(glMaterialiv); \
FUNC(glGetMaterialfv); \
FUNC(glGetMaterialiv); \
FUNC(glColorMaterial); \
FUNC(glClearIndex); \
FUNC(glIndexMask); \
FUNC(glAlphaFunc); \
FUNC(glLineStipple); \
FUNC(glPolygonStipple); \
FUNC(glGetPolygonStipple); \
FUNC(glEdgeFlag); \
FUNC(glEdgeFlagv); \
FUNC(glClipPlane); \
FUNC(glGetClipPlane); \
FUNC(glEnableClientState); \
FUNC(glDisableClientState); \
FUNC(glPushAttrib); \
FUNC(glPopAttrib); \
FUNC(glPushClientAttrib); \
FUNC(glPopClientAttrib); \
FUNC(glRenderMode); \
FUNC(glTexGend); \
FUNC(glTexGenf); \
FUNC(glTexGeni); \
FUNC(glTexGendv); \
FUNC(glTexGenfv); \
FUNC(glTexGeniv); \
FUNC(glGetTexGendv); \
FUNC(glGetTexGenfv); \
FUNC(glGetTexGeniv); \
FUNC(glTexEnvf); \
FUNC(glTexEnvi); \
FUNC(glTexEnvfv); \
FUNC(glTexEnviv); \
FUNC(glGetTexEnvfv); \
FUNC(glGetTexEnviv); \
FUNC(glMatrixMode); \
FUNC(glOrtho); \
FUNC(glFrustum); \
FUNC(glPushMatrix); \
FUNC(glPopMatrix); \
FUNC(glLoadIdentity); \
FUNC(glLoadMatrixd); \
FUNC(glLoadMatrixf); \
FUNC(glMultMatrixd); \
FUNC(glMultMatrixf); \
FUNC(glRotated); \
FUNC(glRotatef); \
FUNC(glScaled); \
FUNC(glScalef); \
FUNC(glTranslated); \
FUNC(glTranslatef); \
FUNC(glClearAccum); \
FUNC(glAccum); \
FUNC(glVertexPointer); \
FUNC(glNormalPointer); \
FUNC(glColorPointer); \
FUNC(glIndexPointer); \
FUNC(glTexCoordPointer); \
FUNC(glEdgeFlagPointer); \
FUNC(glArrayElement); \
FUNC(glInterleavedArrays); \
#define DefineUnsupportedHooks() \
UnsupportedWrapper8(void, glPrimitiveBoundingBoxARB, GLfloat, minX, GLfloat, minY, GLfloat, minZ, GLfloat, minW, GLfloat, maxX, GLfloat, maxY, GLfloat, maxZ, GLfloat, maxW); \
UnsupportedWrapper1(GLuint64, glGetTextureHandleARB, GLuint, texture); \
UnsupportedWrapper2(GLuint64, glGetTextureSamplerHandleARB, GLuint, texture, GLuint, sampler); \
UnsupportedWrapper1(void, glMakeTextureHandleResidentARB, GLuint64, handle); \
UnsupportedWrapper1(void, glMakeTextureHandleNonResidentARB, GLuint64, handle); \
UnsupportedWrapper5(GLuint64, glGetImageHandleARB, GLuint, texture, GLint, level, GLboolean, layered, GLint, layer, GLenum, format); \
UnsupportedWrapper2(void, glMakeImageHandleResidentARB, GLuint64, handle, GLenum, access); \
UnsupportedWrapper1(void, glMakeImageHandleNonResidentARB, GLuint64, handle); \
UnsupportedWrapper2(void, glUniformHandleui64ARB, GLint, location, GLuint64, value); \
UnsupportedWrapper3(void, glUniformHandleui64vARB, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glProgramUniformHandleui64ARB, GLuint, program, GLint, location, GLuint64, value); \
UnsupportedWrapper4(void, glProgramUniformHandleui64vARB, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, values); \
UnsupportedWrapper1(GLboolean, glIsTextureHandleResidentARB, GLuint64, handle); \
UnsupportedWrapper1(GLboolean, glIsImageHandleResidentARB, GLuint64, handle); \
UnsupportedWrapper2(void, glVertexAttribL1ui64ARB, GLuint, index, GLuint64EXT, x); \
UnsupportedWrapper2(void, glVertexAttribL1ui64vARB, GLuint, index, const GLuint64EXT *, v); \
UnsupportedWrapper3(void, glGetVertexAttribLui64vARB, GLuint, index, GLenum, pname, GLuint64EXT *, params); \
UnsupportedWrapper3(GLsync, glCreateSyncFromCLeventARB, struct _cl_context *, context, struct _cl_event *, event, GLbitfield, flags); \
UnsupportedWrapper5(void, glFramebufferTextureFaceARB, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLenum, face); \
UnsupportedWrapper2(void, glUniform1i64ARB, GLint, location, GLint64, x); \
UnsupportedWrapper3(void, glUniform2i64ARB, GLint, location, GLint64, x, GLint64, y); \
UnsupportedWrapper4(void, glUniform3i64ARB, GLint, location, GLint64, x, GLint64, y, GLint64, z); \
UnsupportedWrapper5(void, glUniform4i64ARB, GLint, location, GLint64, x, GLint64, y, GLint64, z, GLint64, w); \
UnsupportedWrapper3(void, glUniform1i64vARB, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper3(void, glUniform2i64vARB, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper3(void, glUniform3i64vARB, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper3(void, glUniform4i64vARB, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper2(void, glUniform1ui64ARB, GLint, location, GLuint64, x); \
UnsupportedWrapper3(void, glUniform2ui64ARB, GLint, location, GLuint64, x, GLuint64, y); \
UnsupportedWrapper4(void, glUniform3ui64ARB, GLint, location, GLuint64, x, GLuint64, y, GLuint64, z); \
UnsupportedWrapper5(void, glUniform4ui64ARB, GLint, location, GLuint64, x, GLuint64, y, GLuint64, z, GLuint64, w); \
UnsupportedWrapper3(void, glUniform1ui64vARB, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glUniform2ui64vARB, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glUniform3ui64vARB, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glUniform4ui64vARB, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glGetUniformi64vARB, GLuint, program, GLint, location, GLint64 *, params); \
UnsupportedWrapper3(void, glGetUniformui64vARB, GLuint, program, GLint, location, GLuint64 *, params); \
UnsupportedWrapper4(void, glGetnUniformi64vARB, GLuint, program, GLint, location, GLsizei, bufSize, GLint64 *, params); \
UnsupportedWrapper4(void, glGetnUniformui64vARB, GLuint, program, GLint, location, GLsizei, bufSize, GLuint64 *, params); \
UnsupportedWrapper3(void, glProgramUniform1i64ARB, GLuint, program, GLint, location, GLint64, x); \
UnsupportedWrapper4(void, glProgramUniform2i64ARB, GLuint, program, GLint, location, GLint64, x, GLint64, y); \
UnsupportedWrapper5(void, glProgramUniform3i64ARB, GLuint, program, GLint, location, GLint64, x, GLint64, y, GLint64, z); \
UnsupportedWrapper6(void, glProgramUniform4i64ARB, GLuint, program, GLint, location, GLint64, x, GLint64, y, GLint64, z, GLint64, w); \
UnsupportedWrapper4(void, glProgramUniform1i64vARB, GLuint, program, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper4(void, glProgramUniform2i64vARB, GLuint, program, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper4(void, glProgramUniform3i64vARB, GLuint, program, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper4(void, glProgramUniform4i64vARB, GLuint, program, GLint, location, GLsizei, count, const GLint64 *, value); \
UnsupportedWrapper3(void, glProgramUniform1ui64ARB, GLuint, program, GLint, location, GLuint64, x); \
UnsupportedWrapper4(void, glProgramUniform2ui64ARB, GLuint, program, GLint, location, GLuint64, x, GLuint64, y); \
UnsupportedWrapper5(void, glProgramUniform3ui64ARB, GLuint, program, GLint, location, GLuint64, x, GLuint64, y, GLuint64, z); \
UnsupportedWrapper6(void, glProgramUniform4ui64ARB, GLuint, program, GLint, location, GLuint64, x, GLuint64, y, GLuint64, z, GLuint64, w); \
UnsupportedWrapper4(void, glProgramUniform1ui64vARB, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper4(void, glProgramUniform2ui64vARB, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper4(void, glProgramUniform3ui64vARB, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper4(void, glProgramUniform4ui64vARB, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper4(void, glFramebufferSampleLocationsfvARB, GLenum, target, GLuint, start, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper4(void, glNamedFramebufferSampleLocationsfvARB, GLuint, framebuffer, GLuint, start, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper0(void, glEvaluateDepthValuesARB); \
UnsupportedWrapper4(void, glBufferPageCommitmentARB, GLenum, target, GLintptr, offset, GLsizeiptr, size, GLboolean, commit); \
UnsupportedWrapper4(void, glNamedBufferPageCommitmentEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, GLboolean, commit); \
UnsupportedWrapper4(void, glNamedBufferPageCommitmentARB, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, GLboolean, commit); \
UnsupportedWrapper9(void, glTexPageCommitmentARB, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, commit); \
UnsupportedWrapper3(void, glGetPerfMonitorGroupsAMD, GLint *, numGroups, GLsizei, groupsSize, GLuint *, groups); \
UnsupportedWrapper5(void, glGetPerfMonitorCountersAMD, GLuint, group, GLint *, numCounters, GLint *, maxActiveCounters, GLsizei, counterSize, GLuint *, counters); \
UnsupportedWrapper4(void, glGetPerfMonitorGroupStringAMD, GLuint, group, GLsizei, bufSize, GLsizei *, length, GLchar *, groupString); \
UnsupportedWrapper5(void, glGetPerfMonitorCounterStringAMD, GLuint, group, GLuint, counter, GLsizei, bufSize, GLsizei *, length, GLchar *, counterString); \
UnsupportedWrapper4(void, glGetPerfMonitorCounterInfoAMD, GLuint, group, GLuint, counter, GLenum, pname, void *, data); \
UnsupportedWrapper2(void, glGenPerfMonitorsAMD, GLsizei, n, GLuint *, monitors); \
UnsupportedWrapper2(void, glDeletePerfMonitorsAMD, GLsizei, n, GLuint *, monitors); \
UnsupportedWrapper5(void, glSelectPerfMonitorCountersAMD, GLuint, monitor, GLboolean, enable, GLuint, group, GLint, numCounters, GLuint *, counterList); \
UnsupportedWrapper1(void, glBeginPerfMonitorAMD, GLuint, monitor); \
UnsupportedWrapper1(void, glEndPerfMonitorAMD, GLuint, monitor); \
UnsupportedWrapper5(void, glGetPerfMonitorCounterDataAMD, GLuint, monitor, GLenum, pname, GLsizei, dataSize, GLuint *, data, GLint *, bytesWritten); \
UnsupportedWrapper3(void, glEGLImageTargetTexStorageEXT, GLenum, target, GLeglImageOES, image, const GLint*, attrib_list); \
UnsupportedWrapper3(void, glEGLImageTargetTextureStorageEXT, GLuint, texture, GLeglImageOES, image, const GLint*, attrib_list); \
UnsupportedWrapper2(void, glMatrixLoadfEXT, GLenum, mode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixLoaddEXT, GLenum, mode, const GLdouble *, m); \
UnsupportedWrapper2(void, glMatrixMultfEXT, GLenum, mode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixMultdEXT, GLenum, mode, const GLdouble *, m); \
UnsupportedWrapper1(void, glMatrixLoadIdentityEXT, GLenum, mode); \
UnsupportedWrapper5(void, glMatrixRotatefEXT, GLenum, mode, GLfloat, angle, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper5(void, glMatrixRotatedEXT, GLenum, mode, GLdouble, angle, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper4(void, glMatrixScalefEXT, GLenum, mode, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper4(void, glMatrixScaledEXT, GLenum, mode, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper4(void, glMatrixTranslatefEXT, GLenum, mode, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper4(void, glMatrixTranslatedEXT, GLenum, mode, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper7(void, glMatrixFrustumEXT, GLenum, mode, GLdouble, left, GLdouble, right, GLdouble, bottom, GLdouble, top, GLdouble, zNear, GLdouble, zFar); \
UnsupportedWrapper7(void, glMatrixOrthoEXT, GLenum, mode, GLdouble, left, GLdouble, right, GLdouble, bottom, GLdouble, top, GLdouble, zNear, GLdouble, zFar); \
UnsupportedWrapper1(void, glMatrixPopEXT, GLenum, mode); \
UnsupportedWrapper1(void, glMatrixPushEXT, GLenum, mode); \
UnsupportedWrapper1(void, glClientAttribDefaultEXT, GLbitfield, mask); \
UnsupportedWrapper1(void, glPushClientAttribDefaultEXT, GLbitfield, mask); \
UnsupportedWrapper5(void, glMultiTexCoordPointerEXT, GLenum, texunit, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper4(void, glMultiTexEnvfEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLfloat, param); \
UnsupportedWrapper4(void, glMultiTexEnvfvEXT, GLenum, texunit, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper4(void, glMultiTexEnviEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLint, param); \
UnsupportedWrapper4(void, glMultiTexEnvivEXT, GLenum, texunit, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper4(void, glMultiTexGendEXT, GLenum, texunit, GLenum, coord, GLenum, pname, GLdouble, param); \
UnsupportedWrapper4(void, glMultiTexGendvEXT, GLenum, texunit, GLenum, coord, GLenum, pname, const GLdouble *, params); \
UnsupportedWrapper4(void, glMultiTexGenfEXT, GLenum, texunit, GLenum, coord, GLenum, pname, GLfloat, param); \
UnsupportedWrapper4(void, glMultiTexGenfvEXT, GLenum, texunit, GLenum, coord, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper4(void, glMultiTexGeniEXT, GLenum, texunit, GLenum, coord, GLenum, pname, GLint, param); \
UnsupportedWrapper4(void, glMultiTexGenivEXT, GLenum, texunit, GLenum, coord, GLenum, pname, const GLint *, params); \
UnsupportedWrapper4(void, glGetMultiTexEnvfvEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper4(void, glGetMultiTexEnvivEXT, GLenum, texunit, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glGetMultiTexGendvEXT, GLenum, texunit, GLenum, coord, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper4(void, glGetMultiTexGenfvEXT, GLenum, texunit, GLenum, coord, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper4(void, glGetMultiTexGenivEXT, GLenum, texunit, GLenum, coord, GLenum, pname, GLint *, params); \
UnsupportedWrapper2(void, glEnableClientStateIndexedEXT, GLenum, array, GLuint, index); \
UnsupportedWrapper2(void, glDisableClientStateIndexedEXT, GLenum, array, GLuint, index); \
UnsupportedWrapper2(void, glMatrixLoadTransposefEXT, GLenum, mode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixLoadTransposedEXT, GLenum, mode, const GLdouble *, m); \
UnsupportedWrapper2(void, glMatrixMultTransposefEXT, GLenum, mode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixMultTransposedEXT, GLenum, mode, const GLdouble *, m); \
UnsupportedWrapper5(void, glNamedProgramLocalParameters4fvEXT, GLuint, program, GLenum, target, GLuint, index, GLsizei, count, const GLfloat *, params); \
UnsupportedWrapper7(void, glNamedProgramLocalParameterI4iEXT, GLuint, program, GLenum, target, GLuint, index, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper4(void, glNamedProgramLocalParameterI4ivEXT, GLuint, program, GLenum, target, GLuint, index, const GLint *, params); \
UnsupportedWrapper5(void, glNamedProgramLocalParametersI4ivEXT, GLuint, program, GLenum, target, GLuint, index, GLsizei, count, const GLint *, params); \
UnsupportedWrapper7(void, glNamedProgramLocalParameterI4uiEXT, GLuint, program, GLenum, target, GLuint, index, GLuint, x, GLuint, y, GLuint, z, GLuint, w); \
UnsupportedWrapper4(void, glNamedProgramLocalParameterI4uivEXT, GLuint, program, GLenum, target, GLuint, index, const GLuint *, params); \
UnsupportedWrapper5(void, glNamedProgramLocalParametersI4uivEXT, GLuint, program, GLenum, target, GLuint, index, GLsizei, count, const GLuint *, params); \
UnsupportedWrapper4(void, glGetNamedProgramLocalParameterIivEXT, GLuint, program, GLenum, target, GLuint, index, GLint *, params); \
UnsupportedWrapper4(void, glGetNamedProgramLocalParameterIuivEXT, GLuint, program, GLenum, target, GLuint, index, GLuint *, params); \
UnsupportedWrapper2(void, glEnableClientStateiEXT, GLenum, array, GLuint, index); \
UnsupportedWrapper2(void, glDisableClientStateiEXT, GLenum, array, GLuint, index); \
UnsupportedWrapper5(void, glNamedProgramStringEXT, GLuint, program, GLenum, target, GLenum, format, GLsizei, len, const void *, string); \
UnsupportedWrapper7(void, glNamedProgramLocalParameter4dEXT, GLuint, program, GLenum, target, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper4(void, glNamedProgramLocalParameter4dvEXT, GLuint, program, GLenum, target, GLuint, index, const GLdouble *, params); \
UnsupportedWrapper7(void, glNamedProgramLocalParameter4fEXT, GLuint, program, GLenum, target, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper4(void, glNamedProgramLocalParameter4fvEXT, GLuint, program, GLenum, target, GLuint, index, const GLfloat *, params); \
UnsupportedWrapper4(void, glGetNamedProgramLocalParameterdvEXT, GLuint, program, GLenum, target, GLuint, index, GLdouble *, params); \
UnsupportedWrapper4(void, glGetNamedProgramLocalParameterfvEXT, GLuint, program, GLenum, target, GLuint, index, GLfloat *, params); \
UnsupportedWrapper4(void, glGetNamedProgramStringEXT, GLuint, program, GLenum, target, GLenum, pname, void *, string); \
UnsupportedWrapper6(void, glNamedRenderbufferStorageMultisampleCoverageEXT, GLuint, renderbuffer, GLsizei, coverageSamples, GLsizei, colorSamples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
UnsupportedWrapper5(void, glNamedFramebufferTextureFaceEXT, GLuint, framebuffer, GLenum, attachment, GLuint, texture, GLint, level, GLenum, face); \
UnsupportedWrapper3(void, glTextureRenderbufferEXT, GLuint, texture, GLenum, target, GLuint, renderbuffer); \
UnsupportedWrapper3(void, glMultiTexRenderbufferEXT, GLenum, texunit, GLenum, target, GLuint, renderbuffer); \
UnsupportedWrapper6(void, glVertexArrayVertexOffsetEXT, GLuint, vaobj, GLuint, buffer, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper6(void, glVertexArrayColorOffsetEXT, GLuint, vaobj, GLuint, buffer, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper4(void, glVertexArrayEdgeFlagOffsetEXT, GLuint, vaobj, GLuint, buffer, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper5(void, glVertexArrayIndexOffsetEXT, GLuint, vaobj, GLuint, buffer, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper5(void, glVertexArrayNormalOffsetEXT, GLuint, vaobj, GLuint, buffer, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper6(void, glVertexArrayTexCoordOffsetEXT, GLuint, vaobj, GLuint, buffer, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper7(void, glVertexArrayMultiTexCoordOffsetEXT, GLuint, vaobj, GLuint, buffer, GLenum, texunit, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper5(void, glVertexArrayFogCoordOffsetEXT, GLuint, vaobj, GLuint, buffer, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper6(void, glVertexArraySecondaryColorOffsetEXT, GLuint, vaobj, GLuint, buffer, GLint, size, GLenum, type, GLsizei, stride, GLintptr, offset); \
UnsupportedWrapper2(void, glEnableVertexArrayEXT, GLuint, vaobj, GLenum, array); \
UnsupportedWrapper2(void, glDisableVertexArrayEXT, GLuint, vaobj, GLenum, array); \
UnsupportedWrapper9(void, glTexturePageCommitmentEXT, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, commit); \
UnsupportedWrapper2(void, glUseShaderProgramEXT, GLenum, type, GLuint, program); \
UnsupportedWrapper1(void, glActiveProgramEXT, GLuint, program); \
UnsupportedWrapper2(GLuint, glCreateShaderProgramEXT, GLenum, type, const GLchar *, string); \
UnsupportedWrapper0(void, glFramebufferFetchBarrierEXT); \
UnsupportedWrapper3(void, glWindowRectanglesEXT, GLenum, mode, GLsizei, count, const GLint *, box); \
UnsupportedWrapper0(void, glApplyFramebufferAttachmentCMAAINTEL); \
UnsupportedWrapper1(void, glBeginPerfQueryINTEL, GLuint, queryHandle); \
UnsupportedWrapper2(void, glCreatePerfQueryINTEL, GLuint, queryId, GLuint *, queryHandle); \
UnsupportedWrapper1(void, glDeletePerfQueryINTEL, GLuint, queryHandle); \
UnsupportedWrapper1(void, glEndPerfQueryINTEL, GLuint, queryHandle); \
UnsupportedWrapper1(void, glGetFirstPerfQueryIdINTEL, GLuint *, queryId); \
UnsupportedWrapper2(void, glGetNextPerfQueryIdINTEL, GLuint, queryId, GLuint *, nextQueryId); \
UnsupportedWrapper11(void, glGetPerfCounterInfoINTEL, GLuint, queryId, GLuint, counterId, GLuint, counterNameLength, GLchar *, counterName, GLuint, counterDescLength, GLchar *, counterDesc, GLuint *, counterOffset, GLuint *, counterDataSize, GLuint *, counterTypeEnum, GLuint *, counterDataTypeEnum, GLuint64 *, rawCounterMaxValue); \
UnsupportedWrapper5(void, glGetPerfQueryDataINTEL, GLuint, queryHandle, GLuint, flags, GLsizei, dataSize, void *, data, GLuint *, bytesWritten); \
UnsupportedWrapper2(void, glGetPerfQueryIdByNameINTEL, GLchar *, queryName, GLuint *, queryId); \
UnsupportedWrapper7(void, glGetPerfQueryInfoINTEL, GLuint, queryId, GLuint, queryNameLength, GLchar *, queryName, GLuint *, dataSize, GLuint *, noCounters, GLuint *, noInstances, GLuint *, capsMask); \
UnsupportedWrapper5(void, glMultiDrawArraysIndirectBindlessNV, GLenum, mode, const void *, indirect, GLsizei, drawCount, GLsizei, stride, GLint, vertexBufferCount); \
UnsupportedWrapper6(void, glMultiDrawElementsIndirectBindlessNV, GLenum, mode, GLenum, type, const void *, indirect, GLsizei, drawCount, GLsizei, stride, GLint, vertexBufferCount); \
UnsupportedWrapper6(void, glMultiDrawArraysIndirectBindlessCountNV, GLenum, mode, const void *, indirect, GLsizei, drawCount, GLsizei, maxDrawCount, GLsizei, stride, GLint, vertexBufferCount); \
UnsupportedWrapper7(void, glMultiDrawElementsIndirectBindlessCountNV, GLenum, mode, GLenum, type, const void *, indirect, GLsizei, drawCount, GLsizei, maxDrawCount, GLsizei, stride, GLint, vertexBufferCount); \
UnsupportedWrapper1(GLuint64, glGetTextureHandleNV, GLuint, texture); \
UnsupportedWrapper2(GLuint64, glGetTextureSamplerHandleNV, GLuint, texture, GLuint, sampler); \
UnsupportedWrapper1(void, glMakeTextureHandleResidentNV, GLuint64, handle); \
UnsupportedWrapper1(void, glMakeTextureHandleNonResidentNV, GLuint64, handle); \
UnsupportedWrapper5(GLuint64, glGetImageHandleNV, GLuint, texture, GLint, level, GLboolean, layered, GLint, layer, GLenum, format); \
UnsupportedWrapper2(void, glMakeImageHandleResidentNV, GLuint64, handle, GLenum, access); \
UnsupportedWrapper1(void, glMakeImageHandleNonResidentNV, GLuint64, handle); \
UnsupportedWrapper2(void, glUniformHandleui64NV, GLint, location, GLuint64, value); \
UnsupportedWrapper3(void, glUniformHandleui64vNV, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glProgramUniformHandleui64NV, GLuint, program, GLint, location, GLuint64, value); \
UnsupportedWrapper4(void, glProgramUniformHandleui64vNV, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, values); \
UnsupportedWrapper1(GLboolean, glIsTextureHandleResidentNV, GLuint64, handle); \
UnsupportedWrapper1(GLboolean, glIsImageHandleResidentNV, GLuint64, handle); \
UnsupportedWrapper2(void, glBlendParameteriNV, GLenum, pname, GLint, value); \
UnsupportedWrapper0(void, glBlendBarrierNV); \
UnsupportedWrapper3(void, glViewportPositionWScaleNV, GLuint, index, GLfloat, xcoeff, GLfloat, ycoeff); \
UnsupportedWrapper2(void, glCreateStatesNV, GLsizei, n, GLuint *, states); \
UnsupportedWrapper2(void, glDeleteStatesNV, GLsizei, n, const GLuint *, states); \
UnsupportedWrapper1(GLboolean, glIsStateNV, GLuint, state); \
UnsupportedWrapper2(void, glStateCaptureNV, GLuint, state, GLenum, mode); \
UnsupportedWrapper2(GLuint, glGetCommandHeaderNV, GLenum, tokenID, GLuint, size); \
UnsupportedWrapper1(GLushort, glGetStageIndexNV, GLenum, shadertype); \
UnsupportedWrapper5(void, glDrawCommandsNV, GLenum, primitiveMode, GLuint, buffer, const GLintptr *, indirects, const GLsizei *, sizes, GLuint, count); \
UnsupportedWrapper4(void, glDrawCommandsAddressNV, GLenum, primitiveMode, const GLuint64 *, indirects, const GLsizei *, sizes, GLuint, count); \
UnsupportedWrapper6(void, glDrawCommandsStatesNV, GLuint, buffer, const GLintptr *, indirects, const GLsizei *, sizes, const GLuint *, states, const GLuint *, fbos, GLuint, count); \
UnsupportedWrapper5(void, glDrawCommandsStatesAddressNV, const GLuint64 *, indirects, const GLsizei *, sizes, const GLuint *, states, const GLuint *, fbos, GLuint, count); \
UnsupportedWrapper2(void, glCreateCommandListsNV, GLsizei, n, GLuint *, lists); \
UnsupportedWrapper2(void, glDeleteCommandListsNV, GLsizei, n, const GLuint *, lists); \
UnsupportedWrapper1(GLboolean, glIsCommandListNV, GLuint, list); \
UnsupportedWrapper7(void, glListDrawCommandsStatesClientNV, GLuint, list, GLuint, segment, const void **, indirects, const GLsizei *, sizes, const GLuint *, states, const GLuint *, fbos, GLuint, count); \
UnsupportedWrapper2(void, glCommandListSegmentsNV, GLuint, list, GLuint, segments); \
UnsupportedWrapper1(void, glCompileCommandListNV, GLuint, list); \
UnsupportedWrapper1(void, glCallCommandListNV, GLuint, list); \
UnsupportedWrapper2(void, glBeginConditionalRenderNV, GLuint, id, GLenum, mode); \
UnsupportedWrapper0(void, glEndConditionalRenderNV); \
UnsupportedWrapper2(void, glSubpixelPrecisionBiasNV, GLuint, xbits, GLuint, ybits); \
UnsupportedWrapper2(void, glConservativeRasterParameterfNV, GLenum, pname, GLfloat, value); \
UnsupportedWrapper2(void, glConservativeRasterParameteriNV, GLenum, pname, GLint, param); \
UnsupportedWrapper11(void, glDrawVkImageNV, GLuint64, vkImage, GLuint, sampler, GLfloat, x0, GLfloat, y0, GLfloat, x1, GLfloat, y1, GLfloat, z, GLfloat, s0, GLfloat, t0, GLfloat, s1, GLfloat, t1); \
UnsupportedWrapper1(GLVULKANPROCNV, glGetVkProcAddrNV, const GLchar *, name); \
UnsupportedWrapper1(void, glWaitVkSemaphoreNV, GLuint64, vkSemaphore); \
UnsupportedWrapper1(void, glSignalVkSemaphoreNV, GLuint64, vkSemaphore); \
UnsupportedWrapper1(void, glSignalVkFenceNV, GLuint64, vkFence); \
UnsupportedWrapper1(void, glFragmentCoverageColorNV, GLuint, color); \
UnsupportedWrapper2(void, glCoverageModulationTableNV, GLsizei, n, const GLfloat *, v); \
UnsupportedWrapper2(void, glGetCoverageModulationTableNV, GLsizei, bufsize, GLfloat *, v); \
UnsupportedWrapper1(void, glCoverageModulationNV, GLenum, components); \
UnsupportedWrapper6(void, glRenderbufferStorageMultisampleCoverageNV, GLenum, target, GLsizei, coverageSamples, GLsizei, colorSamples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
UnsupportedWrapper2(void, glUniform1i64NV, GLint, location, GLint64EXT, x); \
UnsupportedWrapper3(void, glUniform2i64NV, GLint, location, GLint64EXT, x, GLint64EXT, y); \
UnsupportedWrapper4(void, glUniform3i64NV, GLint, location, GLint64EXT, x, GLint64EXT, y, GLint64EXT, z); \
UnsupportedWrapper5(void, glUniform4i64NV, GLint, location, GLint64EXT, x, GLint64EXT, y, GLint64EXT, z, GLint64EXT, w); \
UnsupportedWrapper3(void, glUniform1i64vNV, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper3(void, glUniform2i64vNV, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper3(void, glUniform3i64vNV, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper3(void, glUniform4i64vNV, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper2(void, glUniform1ui64NV, GLint, location, GLuint64EXT, x); \
UnsupportedWrapper3(void, glUniform2ui64NV, GLint, location, GLuint64EXT, x, GLuint64EXT, y); \
UnsupportedWrapper4(void, glUniform3ui64NV, GLint, location, GLuint64EXT, x, GLuint64EXT, y, GLuint64EXT, z); \
UnsupportedWrapper5(void, glUniform4ui64NV, GLint, location, GLuint64EXT, x, GLuint64EXT, y, GLuint64EXT, z, GLuint64EXT, w); \
UnsupportedWrapper3(void, glUniform1ui64vNV, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper3(void, glUniform2ui64vNV, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper3(void, glUniform3ui64vNV, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper3(void, glUniform4ui64vNV, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper3(void, glGetUniformi64vNV, GLuint, program, GLint, location, GLint64EXT *, params); \
UnsupportedWrapper3(void, glProgramUniform1i64NV, GLuint, program, GLint, location, GLint64EXT, x); \
UnsupportedWrapper4(void, glProgramUniform2i64NV, GLuint, program, GLint, location, GLint64EXT, x, GLint64EXT, y); \
UnsupportedWrapper5(void, glProgramUniform3i64NV, GLuint, program, GLint, location, GLint64EXT, x, GLint64EXT, y, GLint64EXT, z); \
UnsupportedWrapper6(void, glProgramUniform4i64NV, GLuint, program, GLint, location, GLint64EXT, x, GLint64EXT, y, GLint64EXT, z, GLint64EXT, w); \
UnsupportedWrapper4(void, glProgramUniform1i64vNV, GLuint, program, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper4(void, glProgramUniform2i64vNV, GLuint, program, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper4(void, glProgramUniform3i64vNV, GLuint, program, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper4(void, glProgramUniform4i64vNV, GLuint, program, GLint, location, GLsizei, count, const GLint64EXT *, value); \
UnsupportedWrapper3(void, glProgramUniform1ui64NV, GLuint, program, GLint, location, GLuint64EXT, x); \
UnsupportedWrapper4(void, glProgramUniform2ui64NV, GLuint, program, GLint, location, GLuint64EXT, x, GLuint64EXT, y); \
UnsupportedWrapper5(void, glProgramUniform3ui64NV, GLuint, program, GLint, location, GLuint64EXT, x, GLuint64EXT, y, GLuint64EXT, z); \
UnsupportedWrapper6(void, glProgramUniform4ui64NV, GLuint, program, GLint, location, GLuint64EXT, x, GLuint64EXT, y, GLuint64EXT, z, GLuint64EXT, w); \
UnsupportedWrapper4(void, glProgramUniform1ui64vNV, GLuint, program, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper4(void, glProgramUniform2ui64vNV, GLuint, program, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper4(void, glProgramUniform3ui64vNV, GLuint, program, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper4(void, glProgramUniform4ui64vNV, GLuint, program, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper6(void, glGetInternalformatSampleivNV, GLenum, target, GLenum, internalformat, GLsizei, samples, GLenum, pname, GLsizei, bufSize, GLint *, params); \
UnsupportedWrapper1(GLuint, glGenPathsNV, GLsizei, range); \
UnsupportedWrapper2(void, glDeletePathsNV, GLuint, path, GLsizei, range); \
UnsupportedWrapper1(GLboolean, glIsPathNV, GLuint, path); \
UnsupportedWrapper6(void, glPathCommandsNV, GLuint, path, GLsizei, numCommands, const GLubyte *, commands, GLsizei, numCoords, GLenum, coordType, const void *, coords); \
UnsupportedWrapper4(void, glPathCoordsNV, GLuint, path, GLsizei, numCoords, GLenum, coordType, const void *, coords); \
UnsupportedWrapper8(void, glPathSubCommandsNV, GLuint, path, GLsizei, commandStart, GLsizei, commandsToDelete, GLsizei, numCommands, const GLubyte *, commands, GLsizei, numCoords, GLenum, coordType, const void *, coords); \
UnsupportedWrapper5(void, glPathSubCoordsNV, GLuint, path, GLsizei, coordStart, GLsizei, numCoords, GLenum, coordType, const void *, coords); \
UnsupportedWrapper4(void, glPathStringNV, GLuint, path, GLenum, format, GLsizei, length, const void *, pathString); \
UnsupportedWrapper10(void, glPathGlyphsNV, GLuint, firstPathName, GLenum, fontTarget, const void *, fontName, GLbitfield, fontStyle, GLsizei, numGlyphs, GLenum, type, const void *, charcodes, GLenum, handleMissingGlyphs, GLuint, pathParameterTemplate, GLfloat, emScale); \
UnsupportedWrapper9(void, glPathGlyphRangeNV, GLuint, firstPathName, GLenum, fontTarget, const void *, fontName, GLbitfield, fontStyle, GLuint, firstGlyph, GLsizei, numGlyphs, GLenum, handleMissingGlyphs, GLuint, pathParameterTemplate, GLfloat, emScale); \
UnsupportedWrapper4(void, glWeightPathsNV, GLuint, resultPath, GLsizei, numPaths, const GLuint *, paths, const GLfloat *, weights); \
UnsupportedWrapper2(void, glCopyPathNV, GLuint, resultPath, GLuint, srcPath); \
UnsupportedWrapper4(void, glInterpolatePathsNV, GLuint, resultPath, GLuint, pathA, GLuint, pathB, GLfloat, weight); \
UnsupportedWrapper4(void, glTransformPathNV, GLuint, resultPath, GLuint, srcPath, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper3(void, glPathParameterivNV, GLuint, path, GLenum, pname, const GLint *, value); \
UnsupportedWrapper3(void, glPathParameteriNV, GLuint, path, GLenum, pname, GLint, value); \
UnsupportedWrapper3(void, glPathParameterfvNV, GLuint, path, GLenum, pname, const GLfloat *, value); \
UnsupportedWrapper3(void, glPathParameterfNV, GLuint, path, GLenum, pname, GLfloat, value); \
UnsupportedWrapper3(void, glPathDashArrayNV, GLuint, path, GLsizei, dashCount, const GLfloat *, dashArray); \
UnsupportedWrapper3(void, glPathStencilFuncNV, GLenum, func, GLint, ref, GLuint, mask); \
UnsupportedWrapper2(void, glPathStencilDepthOffsetNV, GLfloat, factor, GLfloat, units); \
UnsupportedWrapper3(void, glStencilFillPathNV, GLuint, path, GLenum, fillMode, GLuint, mask); \
UnsupportedWrapper3(void, glStencilStrokePathNV, GLuint, path, GLint, reference, GLuint, mask); \
UnsupportedWrapper8(void, glStencilFillPathInstancedNV, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLenum, fillMode, GLuint, mask, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper8(void, glStencilStrokePathInstancedNV, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLint, reference, GLuint, mask, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper1(void, glPathCoverDepthFuncNV, GLenum, func); \
UnsupportedWrapper2(void, glCoverFillPathNV, GLuint, path, GLenum, coverMode); \
UnsupportedWrapper2(void, glCoverStrokePathNV, GLuint, path, GLenum, coverMode); \
UnsupportedWrapper7(void, glCoverFillPathInstancedNV, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLenum, coverMode, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper7(void, glCoverStrokePathInstancedNV, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLenum, coverMode, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper3(void, glGetPathParameterivNV, GLuint, path, GLenum, pname, GLint *, value); \
UnsupportedWrapper3(void, glGetPathParameterfvNV, GLuint, path, GLenum, pname, GLfloat *, value); \
UnsupportedWrapper2(void, glGetPathCommandsNV, GLuint, path, GLubyte *, commands); \
UnsupportedWrapper2(void, glGetPathCoordsNV, GLuint, path, GLfloat *, coords); \
UnsupportedWrapper2(void, glGetPathDashArrayNV, GLuint, path, GLfloat *, dashArray); \
UnsupportedWrapper7(void, glGetPathMetricsNV, GLbitfield, metricQueryMask, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLsizei, stride, GLfloat *, metrics); \
UnsupportedWrapper5(void, glGetPathMetricRangeNV, GLbitfield, metricQueryMask, GLuint, firstPathName, GLsizei, numPaths, GLsizei, stride, GLfloat *, metrics); \
UnsupportedWrapper9(void, glGetPathSpacingNV, GLenum, pathListMode, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLfloat, advanceScale, GLfloat, kerningScale, GLenum, transformType, GLfloat *, returnedSpacing); \
UnsupportedWrapper4(GLboolean, glIsPointInFillPathNV, GLuint, path, GLuint, mask, GLfloat, x, GLfloat, y); \
UnsupportedWrapper3(GLboolean, glIsPointInStrokePathNV, GLuint, path, GLfloat, x, GLfloat, y); \
UnsupportedWrapper3(GLfloat, glGetPathLengthNV, GLuint, path, GLsizei, startSegment, GLsizei, numSegments); \
UnsupportedWrapper8(GLboolean, glPointAlongPathNV, GLuint, path, GLsizei, startSegment, GLsizei, numSegments, GLfloat, distance, GLfloat *, x, GLfloat *, y, GLfloat *, tangentX, GLfloat *, tangentY); \
UnsupportedWrapper2(void, glMatrixLoad3x2fNV, GLenum, matrixMode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixLoad3x3fNV, GLenum, matrixMode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixLoadTranspose3x3fNV, GLenum, matrixMode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixMult3x2fNV, GLenum, matrixMode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixMult3x3fNV, GLenum, matrixMode, const GLfloat *, m); \
UnsupportedWrapper2(void, glMatrixMultTranspose3x3fNV, GLenum, matrixMode, const GLfloat *, m); \
UnsupportedWrapper4(void, glStencilThenCoverFillPathNV, GLuint, path, GLenum, fillMode, GLuint, mask, GLenum, coverMode); \
UnsupportedWrapper4(void, glStencilThenCoverStrokePathNV, GLuint, path, GLint, reference, GLuint, mask, GLenum, coverMode); \
UnsupportedWrapper9(void, glStencilThenCoverFillPathInstancedNV, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLenum, fillMode, GLuint, mask, GLenum, coverMode, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper9(void, glStencilThenCoverStrokePathInstancedNV, GLsizei, numPaths, GLenum, pathNameType, const void *, paths, GLuint, pathBase, GLint, reference, GLuint, mask, GLenum, coverMode, GLenum, transformType, const GLfloat *, transformValues); \
UnsupportedWrapper6(GLenum, glPathGlyphIndexRangeNV, GLenum, fontTarget, const void *, fontName, GLbitfield, fontStyle, GLuint, pathParameterTemplate, GLfloat, emScale, GLuint *, baseAndCount); \
UnsupportedWrapper8(GLenum, glPathGlyphIndexArrayNV, GLuint, firstPathName, GLenum, fontTarget, const void *, fontName, GLbitfield, fontStyle, GLuint, firstGlyphIndex, GLsizei, numGlyphs, GLuint, pathParameterTemplate, GLfloat, emScale); \
UnsupportedWrapper9(GLenum, glPathMemoryGlyphIndexArrayNV, GLuint, firstPathName, GLenum, fontTarget, GLsizeiptr, fontSize, const void *, fontData, GLsizei, faceIndex, GLuint, firstGlyphIndex, GLsizei, numGlyphs, GLuint, pathParameterTemplate, GLfloat, emScale); \
UnsupportedWrapper5(void, glProgramPathFragmentInputGenNV, GLuint, program, GLint, location, GLenum, genMode, GLint, components, const GLfloat *, coeffs); \
UnsupportedWrapper8(void, glGetProgramResourcefvNV, GLuint, program, GLenum, programInterface, GLuint, index, GLsizei, propCount, const GLenum *, props, GLsizei, bufSize, GLsizei *, length, GLfloat *, params); \
UnsupportedWrapper4(void, glFramebufferSampleLocationsfvNV, GLenum, target, GLuint, start, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper4(void, glNamedFramebufferSampleLocationsfvNV, GLuint, framebuffer, GLuint, start, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper0(void, glResolveDepthValuesNV); \
UnsupportedWrapper2(void, glMakeBufferResidentNV, GLenum, target, GLenum, access); \
UnsupportedWrapper1(void, glMakeBufferNonResidentNV, GLenum, target); \
UnsupportedWrapper1(GLboolean, glIsBufferResidentNV, GLenum, target); \
UnsupportedWrapper2(void, glMakeNamedBufferResidentNV, GLuint, buffer, GLenum, access); \
UnsupportedWrapper1(void, glMakeNamedBufferNonResidentNV, GLuint, buffer); \
UnsupportedWrapper1(GLboolean, glIsNamedBufferResidentNV, GLuint, buffer); \
UnsupportedWrapper3(void, glGetBufferParameterui64vNV, GLenum, target, GLenum, pname, GLuint64EXT *, params); \
UnsupportedWrapper3(void, glGetNamedBufferParameterui64vNV, GLuint, buffer, GLenum, pname, GLuint64EXT *, params); \
UnsupportedWrapper2(void, glGetIntegerui64vNV, GLenum, value, GLuint64EXT *, result); \
UnsupportedWrapper2(void, glUniformui64NV, GLint, location, GLuint64EXT, value); \
UnsupportedWrapper3(void, glUniformui64vNV, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper3(void, glGetUniformui64vNV, GLuint, program, GLint, location, GLuint64EXT *, params); \
UnsupportedWrapper3(void, glProgramUniformui64NV, GLuint, program, GLint, location, GLuint64EXT, value); \
UnsupportedWrapper4(void, glProgramUniformui64vNV, GLuint, program, GLint, location, GLsizei, count, const GLuint64EXT *, value); \
UnsupportedWrapper0(void, glTextureBarrierNV); \
UnsupportedWrapper2(void, glVertexAttribL1i64NV, GLuint, index, GLint64EXT, x); \
UnsupportedWrapper3(void, glVertexAttribL2i64NV, GLuint, index, GLint64EXT, x, GLint64EXT, y); \
UnsupportedWrapper4(void, glVertexAttribL3i64NV, GLuint, index, GLint64EXT, x, GLint64EXT, y, GLint64EXT, z); \
UnsupportedWrapper5(void, glVertexAttribL4i64NV, GLuint, index, GLint64EXT, x, GLint64EXT, y, GLint64EXT, z, GLint64EXT, w); \
UnsupportedWrapper2(void, glVertexAttribL1i64vNV, GLuint, index, const GLint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL2i64vNV, GLuint, index, const GLint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL3i64vNV, GLuint, index, const GLint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL4i64vNV, GLuint, index, const GLint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL1ui64NV, GLuint, index, GLuint64EXT, x); \
UnsupportedWrapper3(void, glVertexAttribL2ui64NV, GLuint, index, GLuint64EXT, x, GLuint64EXT, y); \
UnsupportedWrapper4(void, glVertexAttribL3ui64NV, GLuint, index, GLuint64EXT, x, GLuint64EXT, y, GLuint64EXT, z); \
UnsupportedWrapper5(void, glVertexAttribL4ui64NV, GLuint, index, GLuint64EXT, x, GLuint64EXT, y, GLuint64EXT, z, GLuint64EXT, w); \
UnsupportedWrapper2(void, glVertexAttribL1ui64vNV, GLuint, index, const GLuint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL2ui64vNV, GLuint, index, const GLuint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL3ui64vNV, GLuint, index, const GLuint64EXT *, v); \
UnsupportedWrapper2(void, glVertexAttribL4ui64vNV, GLuint, index, const GLuint64EXT *, v); \
UnsupportedWrapper3(void, glGetVertexAttribLi64vNV, GLuint, index, GLenum, pname, GLint64EXT *, params); \
UnsupportedWrapper3(void, glGetVertexAttribLui64vNV, GLuint, index, GLenum, pname, GLuint64EXT *, params); \
UnsupportedWrapper4(void, glVertexAttribLFormatNV, GLuint, index, GLint, size, GLenum, type, GLsizei, stride); \
UnsupportedWrapper4(void, glBufferAddressRangeNV, GLenum, pname, GLuint, index, GLuint64EXT, address, GLsizeiptr, length); \
UnsupportedWrapper3(void, glVertexFormatNV, GLint, size, GLenum, type, GLsizei, stride); \
UnsupportedWrapper2(void, glNormalFormatNV, GLenum, type, GLsizei, stride); \
UnsupportedWrapper3(void, glColorFormatNV, GLint, size, GLenum, type, GLsizei, stride); \
UnsupportedWrapper2(void, glIndexFormatNV, GLenum, type, GLsizei, stride); \
UnsupportedWrapper3(void, glTexCoordFormatNV, GLint, size, GLenum, type, GLsizei, stride); \
UnsupportedWrapper1(void, glEdgeFlagFormatNV, GLsizei, stride); \
UnsupportedWrapper3(void, glSecondaryColorFormatNV, GLint, size, GLenum, type, GLsizei, stride); \
UnsupportedWrapper2(void, glFogCoordFormatNV, GLenum, type, GLsizei, stride); \
UnsupportedWrapper5(void, glVertexAttribFormatNV, GLuint, index, GLint, size, GLenum, type, GLboolean, normalized, GLsizei, stride); \
UnsupportedWrapper4(void, glVertexAttribIFormatNV, GLuint, index, GLint, size, GLenum, type, GLsizei, stride); \
UnsupportedWrapper3(void, glGetIntegerui64i_vNV, GLenum, value, GLuint, index, GLuint64EXT *, result); \
UnsupportedWrapper5(void, glViewportSwizzleNV, GLuint, index, GLenum, swizzlex, GLenum, swizzley, GLenum, swizzlez, GLenum, swizzlew); \
UnsupportedWrapper1(void, glClientActiveTexture, GLenum, texture); \
UnsupportedWrapper2(void, glMultiTexCoord1d, GLenum, target, GLdouble, s); \
UnsupportedWrapper2(void, glMultiTexCoord1dv, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1f, GLenum, target, GLfloat, s); \
UnsupportedWrapper2(void, glMultiTexCoord1fv, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1i, GLenum, target, GLint, s); \
UnsupportedWrapper2(void, glMultiTexCoord1iv, GLenum, target, const GLint *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1s, GLenum, target, GLshort, s); \
UnsupportedWrapper2(void, glMultiTexCoord1sv, GLenum, target, const GLshort *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2d, GLenum, target, GLdouble, s, GLdouble, t); \
UnsupportedWrapper2(void, glMultiTexCoord2dv, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2f, GLenum, target, GLfloat, s, GLfloat, t); \
UnsupportedWrapper2(void, glMultiTexCoord2fv, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2i, GLenum, target, GLint, s, GLint, t); \
UnsupportedWrapper2(void, glMultiTexCoord2iv, GLenum, target, const GLint *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2s, GLenum, target, GLshort, s, GLshort, t); \
UnsupportedWrapper2(void, glMultiTexCoord2sv, GLenum, target, const GLshort *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3d, GLenum, target, GLdouble, s, GLdouble, t, GLdouble, r); \
UnsupportedWrapper2(void, glMultiTexCoord3dv, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3f, GLenum, target, GLfloat, s, GLfloat, t, GLfloat, r); \
UnsupportedWrapper2(void, glMultiTexCoord3fv, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3i, GLenum, target, GLint, s, GLint, t, GLint, r); \
UnsupportedWrapper2(void, glMultiTexCoord3iv, GLenum, target, const GLint *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3s, GLenum, target, GLshort, s, GLshort, t, GLshort, r); \
UnsupportedWrapper2(void, glMultiTexCoord3sv, GLenum, target, const GLshort *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4d, GLenum, target, GLdouble, s, GLdouble, t, GLdouble, r, GLdouble, q); \
UnsupportedWrapper2(void, glMultiTexCoord4dv, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4f, GLenum, target, GLfloat, s, GLfloat, t, GLfloat, r, GLfloat, q); \
UnsupportedWrapper2(void, glMultiTexCoord4fv, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4i, GLenum, target, GLint, s, GLint, t, GLint, r, GLint, q); \
UnsupportedWrapper2(void, glMultiTexCoord4iv, GLenum, target, const GLint *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4s, GLenum, target, GLshort, s, GLshort, t, GLshort, r, GLshort, q); \
UnsupportedWrapper2(void, glMultiTexCoord4sv, GLenum, target, const GLshort *, v); \
UnsupportedWrapper1(void, glLoadTransposeMatrixf, const GLfloat *, m); \
UnsupportedWrapper1(void, glLoadTransposeMatrixd, const GLdouble *, m); \
UnsupportedWrapper1(void, glMultTransposeMatrixf, const GLfloat *, m); \
UnsupportedWrapper1(void, glMultTransposeMatrixd, const GLdouble *, m); \
UnsupportedWrapper1(void, glFogCoordf, GLfloat, coord); \
UnsupportedWrapper1(void, glFogCoordfv, const GLfloat *, coord); \
UnsupportedWrapper1(void, glFogCoordd, GLdouble, coord); \
UnsupportedWrapper1(void, glFogCoorddv, const GLdouble *, coord); \
UnsupportedWrapper3(void, glFogCoordPointer, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper3(void, glSecondaryColor3b, GLbyte, red, GLbyte, green, GLbyte, blue); \
UnsupportedWrapper1(void, glSecondaryColor3bv, const GLbyte *, v); \
UnsupportedWrapper3(void, glSecondaryColor3d, GLdouble, red, GLdouble, green, GLdouble, blue); \
UnsupportedWrapper1(void, glSecondaryColor3dv, const GLdouble *, v); \
UnsupportedWrapper3(void, glSecondaryColor3f, GLfloat, red, GLfloat, green, GLfloat, blue); \
UnsupportedWrapper1(void, glSecondaryColor3fv, const GLfloat *, v); \
UnsupportedWrapper3(void, glSecondaryColor3i, GLint, red, GLint, green, GLint, blue); \
UnsupportedWrapper1(void, glSecondaryColor3iv, const GLint *, v); \
UnsupportedWrapper3(void, glSecondaryColor3s, GLshort, red, GLshort, green, GLshort, blue); \
UnsupportedWrapper1(void, glSecondaryColor3sv, const GLshort *, v); \
UnsupportedWrapper3(void, glSecondaryColor3ub, GLubyte, red, GLubyte, green, GLubyte, blue); \
UnsupportedWrapper1(void, glSecondaryColor3ubv, const GLubyte *, v); \
UnsupportedWrapper3(void, glSecondaryColor3ui, GLuint, red, GLuint, green, GLuint, blue); \
UnsupportedWrapper1(void, glSecondaryColor3uiv, const GLuint *, v); \
UnsupportedWrapper3(void, glSecondaryColor3us, GLushort, red, GLushort, green, GLushort, blue); \
UnsupportedWrapper1(void, glSecondaryColor3usv, const GLushort *, v); \
UnsupportedWrapper4(void, glSecondaryColorPointer, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper2(void, glWindowPos2d, GLdouble, x, GLdouble, y); \
UnsupportedWrapper1(void, glWindowPos2dv, const GLdouble *, v); \
UnsupportedWrapper2(void, glWindowPos2f, GLfloat, x, GLfloat, y); \
UnsupportedWrapper1(void, glWindowPos2fv, const GLfloat *, v); \
UnsupportedWrapper2(void, glWindowPos2i, GLint, x, GLint, y); \
UnsupportedWrapper1(void, glWindowPos2iv, const GLint *, v); \
UnsupportedWrapper2(void, glWindowPos2s, GLshort, x, GLshort, y); \
UnsupportedWrapper1(void, glWindowPos2sv, const GLshort *, v); \
UnsupportedWrapper3(void, glWindowPos3d, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper1(void, glWindowPos3dv, const GLdouble *, v); \
UnsupportedWrapper3(void, glWindowPos3f, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper1(void, glWindowPos3fv, const GLfloat *, v); \
UnsupportedWrapper3(void, glWindowPos3i, GLint, x, GLint, y, GLint, z); \
UnsupportedWrapper1(void, glWindowPos3iv, const GLint *, v); \
UnsupportedWrapper3(void, glWindowPos3s, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper1(void, glWindowPos3sv, const GLshort *, v); \
UnsupportedWrapper2(void, glVertexP2ui, GLenum, type, GLuint, value); \
UnsupportedWrapper2(void, glVertexP2uiv, GLenum, type, const GLuint *, value); \
UnsupportedWrapper2(void, glVertexP3ui, GLenum, type, GLuint, value); \
UnsupportedWrapper2(void, glVertexP3uiv, GLenum, type, const GLuint *, value); \
UnsupportedWrapper2(void, glVertexP4ui, GLenum, type, GLuint, value); \
UnsupportedWrapper2(void, glVertexP4uiv, GLenum, type, const GLuint *, value); \
UnsupportedWrapper2(void, glTexCoordP1ui, GLenum, type, GLuint, coords); \
UnsupportedWrapper2(void, glTexCoordP1uiv, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper2(void, glTexCoordP2ui, GLenum, type, GLuint, coords); \
UnsupportedWrapper2(void, glTexCoordP2uiv, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper2(void, glTexCoordP3ui, GLenum, type, GLuint, coords); \
UnsupportedWrapper2(void, glTexCoordP3uiv, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper2(void, glTexCoordP4ui, GLenum, type, GLuint, coords); \
UnsupportedWrapper2(void, glTexCoordP4uiv, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP1ui, GLenum, texture, GLenum, type, GLuint, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP1uiv, GLenum, texture, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP2ui, GLenum, texture, GLenum, type, GLuint, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP2uiv, GLenum, texture, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP3ui, GLenum, texture, GLenum, type, GLuint, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP3uiv, GLenum, texture, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP4ui, GLenum, texture, GLenum, type, GLuint, coords); \
UnsupportedWrapper3(void, glMultiTexCoordP4uiv, GLenum, texture, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper2(void, glNormalP3ui, GLenum, type, GLuint, coords); \
UnsupportedWrapper2(void, glNormalP3uiv, GLenum, type, const GLuint *, coords); \
UnsupportedWrapper2(void, glColorP3ui, GLenum, type, GLuint, color); \
UnsupportedWrapper2(void, glColorP3uiv, GLenum, type, const GLuint *, color); \
UnsupportedWrapper2(void, glColorP4ui, GLenum, type, GLuint, color); \
UnsupportedWrapper2(void, glColorP4uiv, GLenum, type, const GLuint *, color); \
UnsupportedWrapper2(void, glSecondaryColorP3ui, GLenum, type, GLuint, color); \
UnsupportedWrapper2(void, glSecondaryColorP3uiv, GLenum, type, const GLuint *, color); \
UnsupportedWrapper4(void, glGetnMapdv, GLenum, target, GLenum, query, GLsizei, bufSize, GLdouble *, v); \
UnsupportedWrapper4(void, glGetnMapfv, GLenum, target, GLenum, query, GLsizei, bufSize, GLfloat *, v); \
UnsupportedWrapper4(void, glGetnMapiv, GLenum, target, GLenum, query, GLsizei, bufSize, GLint *, v); \
UnsupportedWrapper3(void, glGetnPixelMapfv, GLenum, map, GLsizei, bufSize, GLfloat *, values); \
UnsupportedWrapper3(void, glGetnPixelMapuiv, GLenum, map, GLsizei, bufSize, GLuint *, values); \
UnsupportedWrapper3(void, glGetnPixelMapusv, GLenum, map, GLsizei, bufSize, GLushort *, values); \
UnsupportedWrapper2(void, glGetnPolygonStipple, GLsizei, bufSize, GLubyte *, pattern); \
UnsupportedWrapper5(void, glGetnColorTable, GLenum, target, GLenum, format, GLenum, type, GLsizei, bufSize, void *, table); \
UnsupportedWrapper5(void, glGetnConvolutionFilter, GLenum, target, GLenum, format, GLenum, type, GLsizei, bufSize, void *, image); \
UnsupportedWrapper8(void, glGetnSeparableFilter, GLenum, target, GLenum, format, GLenum, type, GLsizei, rowBufSize, void *, row, GLsizei, columnBufSize, void *, column, void *, span); \
UnsupportedWrapper6(void, glGetnHistogram, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, GLsizei, bufSize, void *, values); \
UnsupportedWrapper6(void, glGetnMinmax, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, GLsizei, bufSize, void *, values); \
UnsupportedWrapper4(void, glProgramStringARB, GLenum, target, GLenum, format, GLsizei, len, const void *, string); \
UnsupportedWrapper2(void, glBindProgramARB, GLenum, target, GLuint, program); \
UnsupportedWrapper2(void, glDeleteProgramsARB, GLsizei, n, const GLuint *, programs); \
UnsupportedWrapper2(void, glGenProgramsARB, GLsizei, n, GLuint *, programs); \
UnsupportedWrapper6(void, glProgramEnvParameter4dARB, GLenum, target, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper3(void, glProgramEnvParameter4dvARB, GLenum, target, GLuint, index, const GLdouble *, params); \
UnsupportedWrapper6(void, glProgramEnvParameter4fARB, GLenum, target, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper3(void, glProgramEnvParameter4fvARB, GLenum, target, GLuint, index, const GLfloat *, params); \
UnsupportedWrapper6(void, glProgramLocalParameter4dARB, GLenum, target, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper3(void, glProgramLocalParameter4dvARB, GLenum, target, GLuint, index, const GLdouble *, params); \
UnsupportedWrapper6(void, glProgramLocalParameter4fARB, GLenum, target, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper3(void, glProgramLocalParameter4fvARB, GLenum, target, GLuint, index, const GLfloat *, params); \
UnsupportedWrapper3(void, glGetProgramEnvParameterdvARB, GLenum, target, GLuint, index, GLdouble *, params); \
UnsupportedWrapper3(void, glGetProgramEnvParameterfvARB, GLenum, target, GLuint, index, GLfloat *, params); \
UnsupportedWrapper3(void, glGetProgramLocalParameterdvARB, GLenum, target, GLuint, index, GLdouble *, params); \
UnsupportedWrapper3(void, glGetProgramLocalParameterfvARB, GLenum, target, GLuint, index, GLfloat *, params); \
UnsupportedWrapper3(void, glGetProgramivARB, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetProgramStringARB, GLenum, target, GLenum, pname, void *, string); \
UnsupportedWrapper1(GLboolean, glIsProgramARB, GLuint, program); \
UnsupportedWrapper6(void, glColorTable, GLenum, target, GLenum, internalformat, GLsizei, width, GLenum, format, GLenum, type, const void *, table); \
UnsupportedWrapper3(void, glColorTableParameterfv, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glColorTableParameteriv, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper5(void, glCopyColorTable, GLenum, target, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper4(void, glGetColorTable, GLenum, target, GLenum, format, GLenum, type, void *, table); \
UnsupportedWrapper3(void, glGetColorTableParameterfv, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetColorTableParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper6(void, glColorSubTable, GLenum, target, GLsizei, start, GLsizei, count, GLenum, format, GLenum, type, const void *, data); \
UnsupportedWrapper5(void, glCopyColorSubTable, GLenum, target, GLsizei, start, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper6(void, glConvolutionFilter1D, GLenum, target, GLenum, internalformat, GLsizei, width, GLenum, format, GLenum, type, const void *, image); \
UnsupportedWrapper7(void, glConvolutionFilter2D, GLenum, target, GLenum, internalformat, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, image); \
UnsupportedWrapper3(void, glConvolutionParameterf, GLenum, target, GLenum, pname, GLfloat, params); \
UnsupportedWrapper3(void, glConvolutionParameterfv, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glConvolutionParameteri, GLenum, target, GLenum, pname, GLint, params); \
UnsupportedWrapper3(void, glConvolutionParameteriv, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper5(void, glCopyConvolutionFilter1D, GLenum, target, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper6(void, glCopyConvolutionFilter2D, GLenum, target, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
UnsupportedWrapper4(void, glGetConvolutionFilter, GLenum, target, GLenum, format, GLenum, type, void *, image); \
UnsupportedWrapper3(void, glGetConvolutionParameterfv, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetConvolutionParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper6(void, glGetSeparableFilter, GLenum, target, GLenum, format, GLenum, type, void *, row, void *, column, void *, span); \
UnsupportedWrapper8(void, glSeparableFilter2D, GLenum, target, GLenum, internalformat, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, row, const void *, column); \
UnsupportedWrapper5(void, glGetHistogram, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, void *, values); \
UnsupportedWrapper3(void, glGetHistogramParameterfv, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetHistogramParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper5(void, glGetMinmax, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, void *, values); \
UnsupportedWrapper3(void, glGetMinmaxParameterfv, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetMinmaxParameteriv, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glHistogram, GLenum, target, GLsizei, width, GLenum, internalformat, GLboolean, sink); \
UnsupportedWrapper3(void, glMinmax, GLenum, target, GLenum, internalformat, GLboolean, sink); \
UnsupportedWrapper1(void, glResetHistogram, GLenum, target); \
UnsupportedWrapper1(void, glResetMinmax, GLenum, target); \
UnsupportedWrapper1(void, glCurrentPaletteMatrixARB, GLint, index); \
UnsupportedWrapper2(void, glMatrixIndexubvARB, GLint, size, const GLubyte *, indices); \
UnsupportedWrapper2(void, glMatrixIndexusvARB, GLint, size, const GLushort *, indices); \
UnsupportedWrapper2(void, glMatrixIndexuivARB, GLint, size, const GLuint *, indices); \
UnsupportedWrapper4(void, glMatrixIndexPointerARB, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper1(void, glClientActiveTextureARB, GLenum, texture); \
UnsupportedWrapper2(void, glMultiTexCoord1dARB, GLenum, target, GLdouble, s); \
UnsupportedWrapper2(void, glMultiTexCoord1dvARB, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1fARB, GLenum, target, GLfloat, s); \
UnsupportedWrapper2(void, glMultiTexCoord1fvARB, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1iARB, GLenum, target, GLint, s); \
UnsupportedWrapper2(void, glMultiTexCoord1ivARB, GLenum, target, const GLint *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1sARB, GLenum, target, GLshort, s); \
UnsupportedWrapper2(void, glMultiTexCoord1svARB, GLenum, target, const GLshort *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2dARB, GLenum, target, GLdouble, s, GLdouble, t); \
UnsupportedWrapper2(void, glMultiTexCoord2dvARB, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2fARB, GLenum, target, GLfloat, s, GLfloat, t); \
UnsupportedWrapper2(void, glMultiTexCoord2fvARB, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2iARB, GLenum, target, GLint, s, GLint, t); \
UnsupportedWrapper2(void, glMultiTexCoord2ivARB, GLenum, target, const GLint *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2sARB, GLenum, target, GLshort, s, GLshort, t); \
UnsupportedWrapper2(void, glMultiTexCoord2svARB, GLenum, target, const GLshort *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3dARB, GLenum, target, GLdouble, s, GLdouble, t, GLdouble, r); \
UnsupportedWrapper2(void, glMultiTexCoord3dvARB, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3fARB, GLenum, target, GLfloat, s, GLfloat, t, GLfloat, r); \
UnsupportedWrapper2(void, glMultiTexCoord3fvARB, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3iARB, GLenum, target, GLint, s, GLint, t, GLint, r); \
UnsupportedWrapper2(void, glMultiTexCoord3ivARB, GLenum, target, const GLint *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3sARB, GLenum, target, GLshort, s, GLshort, t, GLshort, r); \
UnsupportedWrapper2(void, glMultiTexCoord3svARB, GLenum, target, const GLshort *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4dARB, GLenum, target, GLdouble, s, GLdouble, t, GLdouble, r, GLdouble, q); \
UnsupportedWrapper2(void, glMultiTexCoord4dvARB, GLenum, target, const GLdouble *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4fARB, GLenum, target, GLfloat, s, GLfloat, t, GLfloat, r, GLfloat, q); \
UnsupportedWrapper2(void, glMultiTexCoord4fvARB, GLenum, target, const GLfloat *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4iARB, GLenum, target, GLint, s, GLint, t, GLint, r, GLint, q); \
UnsupportedWrapper2(void, glMultiTexCoord4ivARB, GLenum, target, const GLint *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4sARB, GLenum, target, GLshort, s, GLshort, t, GLshort, r, GLshort, q); \
UnsupportedWrapper2(void, glMultiTexCoord4svARB, GLenum, target, const GLshort *, v); \
UnsupportedWrapper4(void, glGetnMapdvARB, GLenum, target, GLenum, query, GLsizei, bufSize, GLdouble *, v); \
UnsupportedWrapper4(void, glGetnMapfvARB, GLenum, target, GLenum, query, GLsizei, bufSize, GLfloat *, v); \
UnsupportedWrapper4(void, glGetnMapivARB, GLenum, target, GLenum, query, GLsizei, bufSize, GLint *, v); \
UnsupportedWrapper3(void, glGetnPixelMapfvARB, GLenum, map, GLsizei, bufSize, GLfloat *, values); \
UnsupportedWrapper3(void, glGetnPixelMapuivARB, GLenum, map, GLsizei, bufSize, GLuint *, values); \
UnsupportedWrapper3(void, glGetnPixelMapusvARB, GLenum, map, GLsizei, bufSize, GLushort *, values); \
UnsupportedWrapper2(void, glGetnPolygonStippleARB, GLsizei, bufSize, GLubyte *, pattern); \
UnsupportedWrapper5(void, glGetnColorTableARB, GLenum, target, GLenum, format, GLenum, type, GLsizei, bufSize, void *, table); \
UnsupportedWrapper5(void, glGetnConvolutionFilterARB, GLenum, target, GLenum, format, GLenum, type, GLsizei, bufSize, void *, image); \
UnsupportedWrapper8(void, glGetnSeparableFilterARB, GLenum, target, GLenum, format, GLenum, type, GLsizei, rowBufSize, void *, row, GLsizei, columnBufSize, void *, column, void *, span); \
UnsupportedWrapper6(void, glGetnHistogramARB, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, GLsizei, bufSize, void *, values); \
UnsupportedWrapper6(void, glGetnMinmaxARB, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, GLsizei, bufSize, void *, values); \
UnsupportedWrapper1(void, glDeleteObjectARB, GLhandleARB, obj); \
UnsupportedWrapper1(GLhandleARB, glGetHandleARB, GLenum, pname); \
UnsupportedWrapper2(void, glDetachObjectARB, GLhandleARB, containerObj, GLhandleARB, attachedObj); \
UnsupportedWrapper1(GLhandleARB, glCreateShaderObjectARB, GLenum, shaderType); \
UnsupportedWrapper4(void, glShaderSourceARB, GLhandleARB, shaderObj, GLsizei, count, const GLcharARB **, string, const GLint *, length); \
UnsupportedWrapper1(void, glCompileShaderARB, GLhandleARB, shaderObj); \
UnsupportedWrapper0(GLhandleARB, glCreateProgramObjectARB); \
UnsupportedWrapper2(void, glAttachObjectARB, GLhandleARB, containerObj, GLhandleARB, obj); \
UnsupportedWrapper1(void, glLinkProgramARB, GLhandleARB, programObj); \
UnsupportedWrapper1(void, glUseProgramObjectARB, GLhandleARB, programObj); \
UnsupportedWrapper1(void, glValidateProgramARB, GLhandleARB, programObj); \
UnsupportedWrapper3(void, glGetObjectParameterfvARB, GLhandleARB, obj, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetObjectParameterivARB, GLhandleARB, obj, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glGetInfoLogARB, GLhandleARB, obj, GLsizei, maxLength, GLsizei *, length, GLcharARB *, infoLog); \
UnsupportedWrapper4(void, glGetAttachedObjectsARB, GLhandleARB, containerObj, GLsizei, maxCount, GLsizei *, count, GLhandleARB *, obj); \
UnsupportedWrapper2(GLint, glGetUniformLocationARB, GLhandleARB, programObj, const GLcharARB *, name); \
UnsupportedWrapper7(void, glGetActiveUniformARB, GLhandleARB, programObj, GLuint, index, GLsizei, maxLength, GLsizei *, length, GLint *, size, GLenum *, type, GLcharARB *, name); \
UnsupportedWrapper3(void, glGetUniformfvARB, GLhandleARB, programObj, GLint, location, GLfloat *, params); \
UnsupportedWrapper3(void, glGetUniformivARB, GLhandleARB, programObj, GLint, location, GLint *, params); \
UnsupportedWrapper4(void, glGetShaderSourceARB, GLhandleARB, obj, GLsizei, maxLength, GLsizei *, length, GLcharARB *, source); \
UnsupportedWrapper1(void, glLoadTransposeMatrixfARB, const GLfloat *, m); \
UnsupportedWrapper1(void, glLoadTransposeMatrixdARB, const GLdouble *, m); \
UnsupportedWrapper1(void, glMultTransposeMatrixfARB, const GLfloat *, m); \
UnsupportedWrapper1(void, glMultTransposeMatrixdARB, const GLdouble *, m); \
UnsupportedWrapper2(void, glWeightbvARB, GLint, size, const GLbyte *, weights); \
UnsupportedWrapper2(void, glWeightsvARB, GLint, size, const GLshort *, weights); \
UnsupportedWrapper2(void, glWeightivARB, GLint, size, const GLint *, weights); \
UnsupportedWrapper2(void, glWeightfvARB, GLint, size, const GLfloat *, weights); \
UnsupportedWrapper2(void, glWeightdvARB, GLint, size, const GLdouble *, weights); \
UnsupportedWrapper2(void, glWeightubvARB, GLint, size, const GLubyte *, weights); \
UnsupportedWrapper2(void, glWeightusvARB, GLint, size, const GLushort *, weights); \
UnsupportedWrapper2(void, glWeightuivARB, GLint, size, const GLuint *, weights); \
UnsupportedWrapper4(void, glWeightPointerARB, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper1(void, glVertexBlendARB, GLint, count); \
UnsupportedWrapper5(void, glVertexAttrib4NubARB, GLuint, index, GLubyte, x, GLubyte, y, GLubyte, z, GLubyte, w); \
UnsupportedWrapper3(void, glGetVertexAttribdvARB, GLuint, index, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper3(void, glGetVertexAttribfvARB, GLuint, index, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetVertexAttribivARB, GLuint, index, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetVertexAttribPointervARB, GLuint, index, GLenum, pname, void **, pointer); \
UnsupportedWrapper3(void, glBindAttribLocationARB, GLhandleARB, programObj, GLuint, index, const GLcharARB *, name); \
UnsupportedWrapper7(void, glGetActiveAttribARB, GLhandleARB, programObj, GLuint, index, GLsizei, maxLength, GLsizei *, length, GLint *, size, GLenum *, type, GLcharARB *, name); \
UnsupportedWrapper2(GLint, glGetAttribLocationARB, GLhandleARB, programObj, const GLcharARB *, name); \
UnsupportedWrapper2(void, glWindowPos2dARB, GLdouble, x, GLdouble, y); \
UnsupportedWrapper1(void, glWindowPos2dvARB, const GLdouble *, v); \
UnsupportedWrapper2(void, glWindowPos2fARB, GLfloat, x, GLfloat, y); \
UnsupportedWrapper1(void, glWindowPos2fvARB, const GLfloat *, v); \
UnsupportedWrapper2(void, glWindowPos2iARB, GLint, x, GLint, y); \
UnsupportedWrapper1(void, glWindowPos2ivARB, const GLint *, v); \
UnsupportedWrapper2(void, glWindowPos2sARB, GLshort, x, GLshort, y); \
UnsupportedWrapper1(void, glWindowPos2svARB, const GLshort *, v); \
UnsupportedWrapper3(void, glWindowPos3dARB, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper1(void, glWindowPos3dvARB, const GLdouble *, v); \
UnsupportedWrapper3(void, glWindowPos3fARB, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper1(void, glWindowPos3fvARB, const GLfloat *, v); \
UnsupportedWrapper3(void, glWindowPos3iARB, GLint, x, GLint, y, GLint, z); \
UnsupportedWrapper1(void, glWindowPos3ivARB, const GLint *, v); \
UnsupportedWrapper3(void, glWindowPos3sARB, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper1(void, glWindowPos3svARB, const GLshort *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1bOES, GLenum, texture, GLbyte, s); \
UnsupportedWrapper2(void, glMultiTexCoord1bvOES, GLenum, texture, const GLbyte *, coords); \
UnsupportedWrapper3(void, glMultiTexCoord2bOES, GLenum, texture, GLbyte, s, GLbyte, t); \
UnsupportedWrapper2(void, glMultiTexCoord2bvOES, GLenum, texture, const GLbyte *, coords); \
UnsupportedWrapper4(void, glMultiTexCoord3bOES, GLenum, texture, GLbyte, s, GLbyte, t, GLbyte, r); \
UnsupportedWrapper2(void, glMultiTexCoord3bvOES, GLenum, texture, const GLbyte *, coords); \
UnsupportedWrapper5(void, glMultiTexCoord4bOES, GLenum, texture, GLbyte, s, GLbyte, t, GLbyte, r, GLbyte, q); \
UnsupportedWrapper2(void, glMultiTexCoord4bvOES, GLenum, texture, const GLbyte *, coords); \
UnsupportedWrapper1(void, glTexCoord1bOES, GLbyte, s); \
UnsupportedWrapper1(void, glTexCoord1bvOES, const GLbyte *, coords); \
UnsupportedWrapper2(void, glTexCoord2bOES, GLbyte, s, GLbyte, t); \
UnsupportedWrapper1(void, glTexCoord2bvOES, const GLbyte *, coords); \
UnsupportedWrapper3(void, glTexCoord3bOES, GLbyte, s, GLbyte, t, GLbyte, r); \
UnsupportedWrapper1(void, glTexCoord3bvOES, const GLbyte *, coords); \
UnsupportedWrapper4(void, glTexCoord4bOES, GLbyte, s, GLbyte, t, GLbyte, r, GLbyte, q); \
UnsupportedWrapper1(void, glTexCoord4bvOES, const GLbyte *, coords); \
UnsupportedWrapper2(void, glVertex2bOES, GLbyte, x, GLbyte, y); \
UnsupportedWrapper1(void, glVertex2bvOES, const GLbyte *, coords); \
UnsupportedWrapper3(void, glVertex3bOES, GLbyte, x, GLbyte, y, GLbyte, z); \
UnsupportedWrapper1(void, glVertex3bvOES, const GLbyte *, coords); \
UnsupportedWrapper4(void, glVertex4bOES, GLbyte, x, GLbyte, y, GLbyte, z, GLbyte, w); \
UnsupportedWrapper1(void, glVertex4bvOES, const GLbyte *, coords); \
UnsupportedWrapper2(void, glAlphaFuncxOES, GLenum, func, GLfixed, ref); \
UnsupportedWrapper4(void, glClearColorxOES, GLfixed, red, GLfixed, green, GLfixed, blue, GLfixed, alpha); \
UnsupportedWrapper1(void, glClearDepthxOES, GLfixed, depth); \
UnsupportedWrapper2(void, glClipPlanexOES, GLenum, plane, const GLfixed *, equation); \
UnsupportedWrapper4(void, glColor4xOES, GLfixed, red, GLfixed, green, GLfixed, blue, GLfixed, alpha); \
UnsupportedWrapper2(void, glDepthRangexOES, GLfixed, n, GLfixed, f); \
UnsupportedWrapper2(void, glFogxOES, GLenum, pname, GLfixed, param); \
UnsupportedWrapper2(void, glFogxvOES, GLenum, pname, const GLfixed *, param); \
UnsupportedWrapper6(void, glFrustumxOES, GLfixed, l, GLfixed, r, GLfixed, b, GLfixed, t, GLfixed, n, GLfixed, f); \
UnsupportedWrapper2(void, glGetClipPlanexOES, GLenum, plane, GLfixed *, equation); \
UnsupportedWrapper2(void, glGetFixedvOES, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper3(void, glGetTexEnvxvOES, GLenum, target, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper3(void, glGetTexParameterxvOES, GLenum, target, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper2(void, glLightModelxOES, GLenum, pname, GLfixed, param); \
UnsupportedWrapper2(void, glLightModelxvOES, GLenum, pname, const GLfixed *, param); \
UnsupportedWrapper3(void, glLightxOES, GLenum, light, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glLightxvOES, GLenum, light, GLenum, pname, const GLfixed *, params); \
UnsupportedWrapper1(void, glLineWidthxOES, GLfixed, width); \
UnsupportedWrapper1(void, glLoadMatrixxOES, const GLfixed *, m); \
UnsupportedWrapper3(void, glMaterialxOES, GLenum, face, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glMaterialxvOES, GLenum, face, GLenum, pname, const GLfixed *, param); \
UnsupportedWrapper1(void, glMultMatrixxOES, const GLfixed *, m); \
UnsupportedWrapper5(void, glMultiTexCoord4xOES, GLenum, texture, GLfixed, s, GLfixed, t, GLfixed, r, GLfixed, q); \
UnsupportedWrapper3(void, glNormal3xOES, GLfixed, nx, GLfixed, ny, GLfixed, nz); \
UnsupportedWrapper6(void, glOrthoxOES, GLfixed, l, GLfixed, r, GLfixed, b, GLfixed, t, GLfixed, n, GLfixed, f); \
UnsupportedWrapper2(void, glPointParameterxvOES, GLenum, pname, const GLfixed *, params); \
UnsupportedWrapper1(void, glPointSizexOES, GLfixed, size); \
UnsupportedWrapper2(void, glPolygonOffsetxOES, GLfixed, factor, GLfixed, units); \
UnsupportedWrapper4(void, glRotatexOES, GLfixed, angle, GLfixed, x, GLfixed, y, GLfixed, z); \
UnsupportedWrapper3(void, glScalexOES, GLfixed, x, GLfixed, y, GLfixed, z); \
UnsupportedWrapper3(void, glTexEnvxOES, GLenum, target, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glTexEnvxvOES, GLenum, target, GLenum, pname, const GLfixed *, params); \
UnsupportedWrapper3(void, glTexParameterxOES, GLenum, target, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glTexParameterxvOES, GLenum, target, GLenum, pname, const GLfixed *, params); \
UnsupportedWrapper3(void, glTranslatexOES, GLfixed, x, GLfixed, y, GLfixed, z); \
UnsupportedWrapper2(void, glAccumxOES, GLenum, op, GLfixed, value); \
UnsupportedWrapper7(void, glBitmapxOES, GLsizei, width, GLsizei, height, GLfixed, xorig, GLfixed, yorig, GLfixed, xmove, GLfixed, ymove, const GLubyte *, bitmap); \
UnsupportedWrapper4(void, glBlendColorxOES, GLfixed, red, GLfixed, green, GLfixed, blue, GLfixed, alpha); \
UnsupportedWrapper4(void, glClearAccumxOES, GLfixed, red, GLfixed, green, GLfixed, blue, GLfixed, alpha); \
UnsupportedWrapper3(void, glColor3xOES, GLfixed, red, GLfixed, green, GLfixed, blue); \
UnsupportedWrapper1(void, glColor3xvOES, const GLfixed *, components); \
UnsupportedWrapper1(void, glColor4xvOES, const GLfixed *, components); \
UnsupportedWrapper3(void, glConvolutionParameterxOES, GLenum, target, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glConvolutionParameterxvOES, GLenum, target, GLenum, pname, const GLfixed *, params); \
UnsupportedWrapper1(void, glEvalCoord1xOES, GLfixed, u); \
UnsupportedWrapper1(void, glEvalCoord1xvOES, const GLfixed *, coords); \
UnsupportedWrapper2(void, glEvalCoord2xOES, GLfixed, u, GLfixed, v); \
UnsupportedWrapper1(void, glEvalCoord2xvOES, const GLfixed *, coords); \
UnsupportedWrapper3(void, glFeedbackBufferxOES, GLsizei, n, GLenum, type, const GLfixed *, buffer); \
UnsupportedWrapper3(void, glGetConvolutionParameterxvOES, GLenum, target, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper3(void, glGetHistogramParameterxvOES, GLenum, target, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper3(void, glGetLightxOES, GLenum, light, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper3(void, glGetMapxvOES, GLenum, target, GLenum, query, GLfixed *, v); \
UnsupportedWrapper3(void, glGetMaterialxOES, GLenum, face, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glGetPixelMapxv, GLenum, map, GLint, size, GLfixed *, values); \
UnsupportedWrapper3(void, glGetTexGenxvOES, GLenum, coord, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper4(void, glGetTexLevelParameterxvOES, GLenum, target, GLint, level, GLenum, pname, GLfixed *, params); \
UnsupportedWrapper1(void, glIndexxOES, GLfixed, component); \
UnsupportedWrapper1(void, glIndexxvOES, const GLfixed *, component); \
UnsupportedWrapper1(void, glLoadTransposeMatrixxOES, const GLfixed *, m); \
UnsupportedWrapper6(void, glMap1xOES, GLenum, target, GLfixed, u1, GLfixed, u2, GLint, stride, GLint, order, GLfixed, points); \
UnsupportedWrapper10(void, glMap2xOES, GLenum, target, GLfixed, u1, GLfixed, u2, GLint, ustride, GLint, uorder, GLfixed, v1, GLfixed, v2, GLint, vstride, GLint, vorder, GLfixed, points); \
UnsupportedWrapper3(void, glMapGrid1xOES, GLint, n, GLfixed, u1, GLfixed, u2); \
UnsupportedWrapper5(void, glMapGrid2xOES, GLint, n, GLfixed, u1, GLfixed, u2, GLfixed, v1, GLfixed, v2); \
UnsupportedWrapper1(void, glMultTransposeMatrixxOES, const GLfixed *, m); \
UnsupportedWrapper2(void, glMultiTexCoord1xOES, GLenum, texture, GLfixed, s); \
UnsupportedWrapper2(void, glMultiTexCoord1xvOES, GLenum, texture, const GLfixed *, coords); \
UnsupportedWrapper3(void, glMultiTexCoord2xOES, GLenum, texture, GLfixed, s, GLfixed, t); \
UnsupportedWrapper2(void, glMultiTexCoord2xvOES, GLenum, texture, const GLfixed *, coords); \
UnsupportedWrapper4(void, glMultiTexCoord3xOES, GLenum, texture, GLfixed, s, GLfixed, t, GLfixed, r); \
UnsupportedWrapper2(void, glMultiTexCoord3xvOES, GLenum, texture, const GLfixed *, coords); \
UnsupportedWrapper2(void, glMultiTexCoord4xvOES, GLenum, texture, const GLfixed *, coords); \
UnsupportedWrapper1(void, glNormal3xvOES, const GLfixed *, coords); \
UnsupportedWrapper1(void, glPassThroughxOES, GLfixed, token); \
UnsupportedWrapper3(void, glPixelMapx, GLenum, map, GLint, size, const GLfixed *, values); \
UnsupportedWrapper2(void, glPixelStorex, GLenum, pname, GLfixed, param); \
UnsupportedWrapper2(void, glPixelTransferxOES, GLenum, pname, GLfixed, param); \
UnsupportedWrapper2(void, glPixelZoomxOES, GLfixed, xfactor, GLfixed, yfactor); \
UnsupportedWrapper3(void, glPrioritizeTexturesxOES, GLsizei, n, const GLuint *, textures, const GLfixed *, priorities); \
UnsupportedWrapper2(void, glRasterPos2xOES, GLfixed, x, GLfixed, y); \
UnsupportedWrapper1(void, glRasterPos2xvOES, const GLfixed *, coords); \
UnsupportedWrapper3(void, glRasterPos3xOES, GLfixed, x, GLfixed, y, GLfixed, z); \
UnsupportedWrapper1(void, glRasterPos3xvOES, const GLfixed *, coords); \
UnsupportedWrapper4(void, glRasterPos4xOES, GLfixed, x, GLfixed, y, GLfixed, z, GLfixed, w); \
UnsupportedWrapper1(void, glRasterPos4xvOES, const GLfixed *, coords); \
UnsupportedWrapper4(void, glRectxOES, GLfixed, x1, GLfixed, y1, GLfixed, x2, GLfixed, y2); \
UnsupportedWrapper2(void, glRectxvOES, const GLfixed *, v1, const GLfixed *, v2); \
UnsupportedWrapper1(void, glTexCoord1xOES, GLfixed, s); \
UnsupportedWrapper1(void, glTexCoord1xvOES, const GLfixed *, coords); \
UnsupportedWrapper2(void, glTexCoord2xOES, GLfixed, s, GLfixed, t); \
UnsupportedWrapper1(void, glTexCoord2xvOES, const GLfixed *, coords); \
UnsupportedWrapper3(void, glTexCoord3xOES, GLfixed, s, GLfixed, t, GLfixed, r); \
UnsupportedWrapper1(void, glTexCoord3xvOES, const GLfixed *, coords); \
UnsupportedWrapper4(void, glTexCoord4xOES, GLfixed, s, GLfixed, t, GLfixed, r, GLfixed, q); \
UnsupportedWrapper1(void, glTexCoord4xvOES, const GLfixed *, coords); \
UnsupportedWrapper3(void, glTexGenxOES, GLenum, coord, GLenum, pname, GLfixed, param); \
UnsupportedWrapper3(void, glTexGenxvOES, GLenum, coord, GLenum, pname, const GLfixed *, params); \
UnsupportedWrapper1(void, glVertex2xOES, GLfixed, x); \
UnsupportedWrapper1(void, glVertex2xvOES, const GLfixed *, coords); \
UnsupportedWrapper2(void, glVertex3xOES, GLfixed, x, GLfixed, y); \
UnsupportedWrapper1(void, glVertex3xvOES, const GLfixed *, coords); \
UnsupportedWrapper3(void, glVertex4xOES, GLfixed, x, GLfixed, y, GLfixed, z); \
UnsupportedWrapper1(void, glVertex4xvOES, const GLfixed *, coords); \
UnsupportedWrapper2(GLbitfield, glQueryMatrixxOES, GLfixed *, mantissa, GLint *, exponent); \
UnsupportedWrapper1(void, glClearDepthfOES, GLclampf, depth); \
UnsupportedWrapper2(void, glClipPlanefOES, GLenum, plane, const GLfloat *, equation); \
UnsupportedWrapper2(void, glDepthRangefOES, GLclampf, n, GLclampf, f); \
UnsupportedWrapper6(void, glFrustumfOES, GLfloat, l, GLfloat, r, GLfloat, b, GLfloat, t, GLfloat, n, GLfloat, f); \
UnsupportedWrapper2(void, glGetClipPlanefOES, GLenum, plane, GLfloat *, equation); \
UnsupportedWrapper6(void, glOrthofOES, GLfloat, l, GLfloat, r, GLfloat, b, GLfloat, t, GLfloat, n, GLfloat, f); \
UnsupportedWrapper1(void, glTbufferMask3DFX, GLuint, mask); \
UnsupportedWrapper5(void, glDebugMessageEnableAMD, GLenum, category, GLenum, severity, GLsizei, count, const GLuint *, ids, GLboolean, enabled); \
UnsupportedWrapper5(void, glDebugMessageInsertAMD, GLenum, category, GLenum, severity, GLuint, id, GLsizei, length, const GLchar *, buf); \
UnsupportedWrapper2(void, glDebugMessageCallbackAMD, GLDEBUGPROCAMD, callback, void *, userParam); \
UnsupportedWrapper7(GLuint, glGetDebugMessageLogAMD, GLuint, count, GLsizei, bufsize, GLenum *, categories, GLuint *, severities, GLuint *, ids, GLsizei *, lengths, GLchar *, message); \
UnsupportedWrapper3(void, glBlendFuncIndexedAMD, GLuint, buf, GLenum, src, GLenum, dst); \
UnsupportedWrapper5(void, glBlendFuncSeparateIndexedAMD, GLuint, buf, GLenum, srcRGB, GLenum, dstRGB, GLenum, srcAlpha, GLenum, dstAlpha); \
UnsupportedWrapper2(void, glBlendEquationIndexedAMD, GLuint, buf, GLenum, mode); \
UnsupportedWrapper3(void, glBlendEquationSeparateIndexedAMD, GLuint, buf, GLenum, modeRGB, GLenum, modeAlpha); \
UnsupportedWrapper4(void, glFramebufferSamplePositionsfvAMD, GLenum, target, GLuint, numsamples, GLuint, pixelindex, const GLfloat *, values); \
UnsupportedWrapper4(void, glNamedFramebufferSamplePositionsfvAMD, GLuint, framebuffer, GLuint, numsamples, GLuint, pixelindex, const GLfloat *, values); \
UnsupportedWrapper6(void, glGetFramebufferParameterfvAMD, GLenum, target, GLenum, pname, GLuint, numsamples, GLuint, pixelindex, GLsizei, size, GLfloat *, values); \
UnsupportedWrapper6(void, glGetNamedFramebufferParameterfvAMD, GLuint, framebuffer, GLenum, pname, GLuint, numsamples, GLuint, pixelindex, GLsizei, size, GLfloat *, values); \
UnsupportedWrapper3(void, glVertexAttribParameteriAMD, GLuint, index, GLenum, pname, GLint, param); \
UnsupportedWrapper4(void, glMultiDrawArraysIndirectAMD, GLenum, mode, const void *, indirect, GLsizei, primcount, GLsizei, stride); \
UnsupportedWrapper5(void, glMultiDrawElementsIndirectAMD, GLenum, mode, GLenum, type, const void *, indirect, GLsizei, primcount, GLsizei, stride); \
UnsupportedWrapper3(void, glGenNamesAMD, GLenum, identifier, GLuint, num, GLuint *, names); \
UnsupportedWrapper3(void, glDeleteNamesAMD, GLenum, identifier, GLuint, num, const GLuint *, names); \
UnsupportedWrapper2(GLboolean, glIsNameAMD, GLenum, identifier, GLuint, name); \
UnsupportedWrapper4(void, glQueryObjectParameteruiAMD, GLenum, target, GLuint, id, GLenum, pname, GLuint, param); \
UnsupportedWrapper3(void, glSetMultisamplefvAMD, GLenum, pname, GLuint, index, const GLfloat *, val); \
UnsupportedWrapper7(void, glTexStorageSparseAMD, GLenum, target, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLsizei, layers, GLbitfield, flags); \
UnsupportedWrapper8(void, glTextureStorageSparseAMD, GLuint, texture, GLenum, target, GLenum, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLsizei, layers, GLbitfield, flags); \
UnsupportedWrapper2(void, glStencilOpValueAMD, GLenum, face, GLuint, value); \
UnsupportedWrapper1(void, glTessellationFactorAMD, GLfloat, factor); \
UnsupportedWrapper1(void, glTessellationModeAMD, GLenum, mode); \
UnsupportedWrapper2(void, glElementPointerAPPLE, GLenum, type, const void *, pointer); \
UnsupportedWrapper3(void, glDrawElementArrayAPPLE, GLenum, mode, GLint, first, GLsizei, count); \
UnsupportedWrapper5(void, glDrawRangeElementArrayAPPLE, GLenum, mode, GLuint, start, GLuint, end, GLint, first, GLsizei, count); \
UnsupportedWrapper4(void, glMultiDrawElementArrayAPPLE, GLenum, mode, const GLint *, first, const GLsizei *, count, GLsizei, primcount); \
UnsupportedWrapper6(void, glMultiDrawRangeElementArrayAPPLE, GLenum, mode, GLuint, start, GLuint, end, const GLint *, first, const GLsizei *, count, GLsizei, primcount); \
UnsupportedWrapper2(void, glGenFencesAPPLE, GLsizei, n, GLuint *, fences); \
UnsupportedWrapper2(void, glDeleteFencesAPPLE, GLsizei, n, const GLuint *, fences); \
UnsupportedWrapper1(void, glSetFenceAPPLE, GLuint, fence); \
UnsupportedWrapper1(GLboolean, glIsFenceAPPLE, GLuint, fence); \
UnsupportedWrapper1(GLboolean, glTestFenceAPPLE, GLuint, fence); \
UnsupportedWrapper1(void, glFinishFenceAPPLE, GLuint, fence); \
UnsupportedWrapper2(GLboolean, glTestObjectAPPLE, GLenum, object, GLuint, name); \
UnsupportedWrapper2(void, glFinishObjectAPPLE, GLenum, object, GLint, name); \
UnsupportedWrapper3(void, glBufferParameteriAPPLE, GLenum, target, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glFlushMappedBufferRangeAPPLE, GLenum, target, GLintptr, offset, GLsizeiptr, size); \
UnsupportedWrapper3(GLenum, glObjectPurgeableAPPLE, GLenum, objectType, GLuint, name, GLenum, option); \
UnsupportedWrapper3(GLenum, glObjectUnpurgeableAPPLE, GLenum, objectType, GLuint, name, GLenum, option); \
UnsupportedWrapper4(void, glGetObjectParameterivAPPLE, GLenum, objectType, GLuint, name, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glTextureRangeAPPLE, GLenum, target, GLsizei, length, const void *, pointer); \
UnsupportedWrapper3(void, glGetTexParameterPointervAPPLE, GLenum, target, GLenum, pname, void **, params); \
UnsupportedWrapper1(void, glBindVertexArrayAPPLE, GLuint, array); \
UnsupportedWrapper2(void, glDeleteVertexArraysAPPLE, GLsizei, n, const GLuint *, arrays); \
UnsupportedWrapper2(void, glGenVertexArraysAPPLE, GLsizei, n, GLuint *, arrays); \
UnsupportedWrapper1(GLboolean, glIsVertexArrayAPPLE, GLuint, array); \
UnsupportedWrapper2(void, glVertexArrayRangeAPPLE, GLsizei, length, void *, pointer); \
UnsupportedWrapper2(void, glFlushVertexArrayRangeAPPLE, GLsizei, length, void *, pointer); \
UnsupportedWrapper2(void, glVertexArrayParameteriAPPLE, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glEnableVertexAttribAPPLE, GLuint, index, GLenum, pname); \
UnsupportedWrapper2(void, glDisableVertexAttribAPPLE, GLuint, index, GLenum, pname); \
UnsupportedWrapper2(GLboolean, glIsVertexAttribEnabledAPPLE, GLuint, index, GLenum, pname); \
UnsupportedWrapper7(void, glMapVertexAttrib1dAPPLE, GLuint, index, GLuint, size, GLdouble, u1, GLdouble, u2, GLint, stride, GLint, order, const GLdouble *, points); \
UnsupportedWrapper7(void, glMapVertexAttrib1fAPPLE, GLuint, index, GLuint, size, GLfloat, u1, GLfloat, u2, GLint, stride, GLint, order, const GLfloat *, points); \
UnsupportedWrapper11(void, glMapVertexAttrib2dAPPLE, GLuint, index, GLuint, size, GLdouble, u1, GLdouble, u2, GLint, ustride, GLint, uorder, GLdouble, v1, GLdouble, v2, GLint, vstride, GLint, vorder, const GLdouble *, points); \
UnsupportedWrapper11(void, glMapVertexAttrib2fAPPLE, GLuint, index, GLuint, size, GLfloat, u1, GLfloat, u2, GLint, ustride, GLint, uorder, GLfloat, v1, GLfloat, v2, GLint, vstride, GLint, vorder, const GLfloat *, points); \
UnsupportedWrapper2(void, glDrawBuffersATI, GLsizei, n, const GLenum *, bufs); \
UnsupportedWrapper2(void, glElementPointerATI, GLenum, type, const void *, pointer); \
UnsupportedWrapper2(void, glDrawElementArrayATI, GLenum, mode, GLsizei, count); \
UnsupportedWrapper4(void, glDrawRangeElementArrayATI, GLenum, mode, GLuint, start, GLuint, end, GLsizei, count); \
UnsupportedWrapper2(void, glTexBumpParameterivATI, GLenum, pname, const GLint *, param); \
UnsupportedWrapper2(void, glTexBumpParameterfvATI, GLenum, pname, const GLfloat *, param); \
UnsupportedWrapper2(void, glGetTexBumpParameterivATI, GLenum, pname, GLint *, param); \
UnsupportedWrapper2(void, glGetTexBumpParameterfvATI, GLenum, pname, GLfloat *, param); \
UnsupportedWrapper1(GLuint, glGenFragmentShadersATI, GLuint, range); \
UnsupportedWrapper1(void, glBindFragmentShaderATI, GLuint, id); \
UnsupportedWrapper1(void, glDeleteFragmentShaderATI, GLuint, id); \
UnsupportedWrapper0(void, glBeginFragmentShaderATI); \
UnsupportedWrapper0(void, glEndFragmentShaderATI); \
UnsupportedWrapper3(void, glPassTexCoordATI, GLuint, dst, GLuint, coord, GLenum, swizzle); \
UnsupportedWrapper3(void, glSampleMapATI, GLuint, dst, GLuint, interp, GLenum, swizzle); \
UnsupportedWrapper7(void, glColorFragmentOp1ATI, GLenum, op, GLuint, dst, GLuint, dstMask, GLuint, dstMod, GLuint, arg1, GLuint, arg1Rep, GLuint, arg1Mod); \
UnsupportedWrapper10(void, glColorFragmentOp2ATI, GLenum, op, GLuint, dst, GLuint, dstMask, GLuint, dstMod, GLuint, arg1, GLuint, arg1Rep, GLuint, arg1Mod, GLuint, arg2, GLuint, arg2Rep, GLuint, arg2Mod); \
UnsupportedWrapper13(void, glColorFragmentOp3ATI, GLenum, op, GLuint, dst, GLuint, dstMask, GLuint, dstMod, GLuint, arg1, GLuint, arg1Rep, GLuint, arg1Mod, GLuint, arg2, GLuint, arg2Rep, GLuint, arg2Mod, GLuint, arg3, GLuint, arg3Rep, GLuint, arg3Mod); \
UnsupportedWrapper6(void, glAlphaFragmentOp1ATI, GLenum, op, GLuint, dst, GLuint, dstMod, GLuint, arg1, GLuint, arg1Rep, GLuint, arg1Mod); \
UnsupportedWrapper9(void, glAlphaFragmentOp2ATI, GLenum, op, GLuint, dst, GLuint, dstMod, GLuint, arg1, GLuint, arg1Rep, GLuint, arg1Mod, GLuint, arg2, GLuint, arg2Rep, GLuint, arg2Mod); \
UnsupportedWrapper12(void, glAlphaFragmentOp3ATI, GLenum, op, GLuint, dst, GLuint, dstMod, GLuint, arg1, GLuint, arg1Rep, GLuint, arg1Mod, GLuint, arg2, GLuint, arg2Rep, GLuint, arg2Mod, GLuint, arg3, GLuint, arg3Rep, GLuint, arg3Mod); \
UnsupportedWrapper2(void, glSetFragmentShaderConstantATI, GLuint, dst, const GLfloat *, value); \
UnsupportedWrapper1(void *, glMapObjectBufferATI, GLuint, buffer); \
UnsupportedWrapper1(void, glUnmapObjectBufferATI, GLuint, buffer); \
UnsupportedWrapper2(void, glPNTrianglesiATI, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glPNTrianglesfATI, GLenum, pname, GLfloat, param); \
UnsupportedWrapper4(void, glStencilOpSeparateATI, GLenum, face, GLenum, sfail, GLenum, dpfail, GLenum, dppass); \
UnsupportedWrapper4(void, glStencilFuncSeparateATI, GLenum, frontfunc, GLenum, backfunc, GLint, ref, GLuint, mask); \
UnsupportedWrapper3(GLuint, glNewObjectBufferATI, GLsizei, size, const void *, pointer, GLenum, usage); \
UnsupportedWrapper1(GLboolean, glIsObjectBufferATI, GLuint, buffer); \
UnsupportedWrapper5(void, glUpdateObjectBufferATI, GLuint, buffer, GLuint, offset, GLsizei, size, const void *, pointer, GLenum, preserve); \
UnsupportedWrapper3(void, glGetObjectBufferfvATI, GLuint, buffer, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetObjectBufferivATI, GLuint, buffer, GLenum, pname, GLint *, params); \
UnsupportedWrapper1(void, glFreeObjectBufferATI, GLuint, buffer); \
UnsupportedWrapper6(void, glArrayObjectATI, GLenum, array, GLint, size, GLenum, type, GLsizei, stride, GLuint, buffer, GLuint, offset); \
UnsupportedWrapper3(void, glGetArrayObjectfvATI, GLenum, array, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetArrayObjectivATI, GLenum, array, GLenum, pname, GLint *, params); \
UnsupportedWrapper5(void, glVariantArrayObjectATI, GLuint, id, GLenum, type, GLsizei, stride, GLuint, buffer, GLuint, offset); \
UnsupportedWrapper3(void, glGetVariantArrayObjectfvATI, GLuint, id, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetVariantArrayObjectivATI, GLuint, id, GLenum, pname, GLint *, params); \
UnsupportedWrapper7(void, glVertexAttribArrayObjectATI, GLuint, index, GLint, size, GLenum, type, GLboolean, normalized, GLsizei, stride, GLuint, buffer, GLuint, offset); \
UnsupportedWrapper3(void, glGetVertexAttribArrayObjectfvATI, GLuint, index, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetVertexAttribArrayObjectivATI, GLuint, index, GLenum, pname, GLint *, params); \
UnsupportedWrapper2(void, glVertexStream1sATI, GLenum, stream, GLshort, x); \
UnsupportedWrapper2(void, glVertexStream1svATI, GLenum, stream, const GLshort *, coords); \
UnsupportedWrapper2(void, glVertexStream1iATI, GLenum, stream, GLint, x); \
UnsupportedWrapper2(void, glVertexStream1ivATI, GLenum, stream, const GLint *, coords); \
UnsupportedWrapper2(void, glVertexStream1fATI, GLenum, stream, GLfloat, x); \
UnsupportedWrapper2(void, glVertexStream1fvATI, GLenum, stream, const GLfloat *, coords); \
UnsupportedWrapper2(void, glVertexStream1dATI, GLenum, stream, GLdouble, x); \
UnsupportedWrapper2(void, glVertexStream1dvATI, GLenum, stream, const GLdouble *, coords); \
UnsupportedWrapper3(void, glVertexStream2sATI, GLenum, stream, GLshort, x, GLshort, y); \
UnsupportedWrapper2(void, glVertexStream2svATI, GLenum, stream, const GLshort *, coords); \
UnsupportedWrapper3(void, glVertexStream2iATI, GLenum, stream, GLint, x, GLint, y); \
UnsupportedWrapper2(void, glVertexStream2ivATI, GLenum, stream, const GLint *, coords); \
UnsupportedWrapper3(void, glVertexStream2fATI, GLenum, stream, GLfloat, x, GLfloat, y); \
UnsupportedWrapper2(void, glVertexStream2fvATI, GLenum, stream, const GLfloat *, coords); \
UnsupportedWrapper3(void, glVertexStream2dATI, GLenum, stream, GLdouble, x, GLdouble, y); \
UnsupportedWrapper2(void, glVertexStream2dvATI, GLenum, stream, const GLdouble *, coords); \
UnsupportedWrapper4(void, glVertexStream3sATI, GLenum, stream, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper2(void, glVertexStream3svATI, GLenum, stream, const GLshort *, coords); \
UnsupportedWrapper4(void, glVertexStream3iATI, GLenum, stream, GLint, x, GLint, y, GLint, z); \
UnsupportedWrapper2(void, glVertexStream3ivATI, GLenum, stream, const GLint *, coords); \
UnsupportedWrapper4(void, glVertexStream3fATI, GLenum, stream, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glVertexStream3fvATI, GLenum, stream, const GLfloat *, coords); \
UnsupportedWrapper4(void, glVertexStream3dATI, GLenum, stream, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper2(void, glVertexStream3dvATI, GLenum, stream, const GLdouble *, coords); \
UnsupportedWrapper5(void, glVertexStream4sATI, GLenum, stream, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
UnsupportedWrapper2(void, glVertexStream4svATI, GLenum, stream, const GLshort *, coords); \
UnsupportedWrapper5(void, glVertexStream4iATI, GLenum, stream, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper2(void, glVertexStream4ivATI, GLenum, stream, const GLint *, coords); \
UnsupportedWrapper5(void, glVertexStream4fATI, GLenum, stream, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper2(void, glVertexStream4fvATI, GLenum, stream, const GLfloat *, coords); \
UnsupportedWrapper5(void, glVertexStream4dATI, GLenum, stream, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper2(void, glVertexStream4dvATI, GLenum, stream, const GLdouble *, coords); \
UnsupportedWrapper4(void, glNormalStream3bATI, GLenum, stream, GLbyte, nx, GLbyte, ny, GLbyte, nz); \
UnsupportedWrapper2(void, glNormalStream3bvATI, GLenum, stream, const GLbyte *, coords); \
UnsupportedWrapper4(void, glNormalStream3sATI, GLenum, stream, GLshort, nx, GLshort, ny, GLshort, nz); \
UnsupportedWrapper2(void, glNormalStream3svATI, GLenum, stream, const GLshort *, coords); \
UnsupportedWrapper4(void, glNormalStream3iATI, GLenum, stream, GLint, nx, GLint, ny, GLint, nz); \
UnsupportedWrapper2(void, glNormalStream3ivATI, GLenum, stream, const GLint *, coords); \
UnsupportedWrapper4(void, glNormalStream3fATI, GLenum, stream, GLfloat, nx, GLfloat, ny, GLfloat, nz); \
UnsupportedWrapper2(void, glNormalStream3fvATI, GLenum, stream, const GLfloat *, coords); \
UnsupportedWrapper4(void, glNormalStream3dATI, GLenum, stream, GLdouble, nx, GLdouble, ny, GLdouble, nz); \
UnsupportedWrapper2(void, glNormalStream3dvATI, GLenum, stream, const GLdouble *, coords); \
UnsupportedWrapper1(void, glClientActiveVertexStreamATI, GLenum, stream); \
UnsupportedWrapper2(void, glVertexBlendEnviATI, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glVertexBlendEnvfATI, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glUniformBufferEXT, GLuint, program, GLint, location, GLuint, buffer); \
UnsupportedWrapper2(GLint, glGetUniformBufferSizeEXT, GLuint, program, GLint, location); \
UnsupportedWrapper2(GLintptr, glGetUniformOffsetEXT, GLuint, program, GLint, location); \
UnsupportedWrapper4(void, glBlendFuncSeparateEXT, GLenum, sfactorRGB, GLenum, dfactorRGB, GLenum, sfactorAlpha, GLenum, dfactorAlpha); \
UnsupportedWrapper6(void, glColorSubTableEXT, GLenum, target, GLsizei, start, GLsizei, count, GLenum, format, GLenum, type, const void *, data); \
UnsupportedWrapper5(void, glCopyColorSubTableEXT, GLenum, target, GLsizei, start, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper2(void, glLockArraysEXT, GLint, first, GLsizei, count); \
UnsupportedWrapper0(void, glUnlockArraysEXT); \
UnsupportedWrapper6(void, glConvolutionFilter1DEXT, GLenum, target, GLenum, internalformat, GLsizei, width, GLenum, format, GLenum, type, const void *, image); \
UnsupportedWrapper7(void, glConvolutionFilter2DEXT, GLenum, target, GLenum, internalformat, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, image); \
UnsupportedWrapper3(void, glConvolutionParameterfEXT, GLenum, target, GLenum, pname, GLfloat, params); \
UnsupportedWrapper3(void, glConvolutionParameterfvEXT, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glConvolutionParameteriEXT, GLenum, target, GLenum, pname, GLint, params); \
UnsupportedWrapper3(void, glConvolutionParameterivEXT, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper5(void, glCopyConvolutionFilter1DEXT, GLenum, target, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper6(void, glCopyConvolutionFilter2DEXT, GLenum, target, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
UnsupportedWrapper4(void, glGetConvolutionFilterEXT, GLenum, target, GLenum, format, GLenum, type, void *, image); \
UnsupportedWrapper3(void, glGetConvolutionParameterfvEXT, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetConvolutionParameterivEXT, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper6(void, glGetSeparableFilterEXT, GLenum, target, GLenum, format, GLenum, type, void *, row, void *, column, void *, span); \
UnsupportedWrapper8(void, glSeparableFilter2DEXT, GLenum, target, GLenum, internalformat, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, row, const void *, column); \
UnsupportedWrapper3(void, glTangent3bEXT, GLbyte, tx, GLbyte, ty, GLbyte, tz); \
UnsupportedWrapper1(void, glTangent3bvEXT, const GLbyte *, v); \
UnsupportedWrapper3(void, glTangent3dEXT, GLdouble, tx, GLdouble, ty, GLdouble, tz); \
UnsupportedWrapper1(void, glTangent3dvEXT, const GLdouble *, v); \
UnsupportedWrapper3(void, glTangent3fEXT, GLfloat, tx, GLfloat, ty, GLfloat, tz); \
UnsupportedWrapper1(void, glTangent3fvEXT, const GLfloat *, v); \
UnsupportedWrapper3(void, glTangent3iEXT, GLint, tx, GLint, ty, GLint, tz); \
UnsupportedWrapper1(void, glTangent3ivEXT, const GLint *, v); \
UnsupportedWrapper3(void, glTangent3sEXT, GLshort, tx, GLshort, ty, GLshort, tz); \
UnsupportedWrapper1(void, glTangent3svEXT, const GLshort *, v); \
UnsupportedWrapper3(void, glBinormal3bEXT, GLbyte, bx, GLbyte, by, GLbyte, bz); \
UnsupportedWrapper1(void, glBinormal3bvEXT, const GLbyte *, v); \
UnsupportedWrapper3(void, glBinormal3dEXT, GLdouble, bx, GLdouble, by, GLdouble, bz); \
UnsupportedWrapper1(void, glBinormal3dvEXT, const GLdouble *, v); \
UnsupportedWrapper3(void, glBinormal3fEXT, GLfloat, bx, GLfloat, by, GLfloat, bz); \
UnsupportedWrapper1(void, glBinormal3fvEXT, const GLfloat *, v); \
UnsupportedWrapper3(void, glBinormal3iEXT, GLint, bx, GLint, by, GLint, bz); \
UnsupportedWrapper1(void, glBinormal3ivEXT, const GLint *, v); \
UnsupportedWrapper3(void, glBinormal3sEXT, GLshort, bx, GLshort, by, GLshort, bz); \
UnsupportedWrapper1(void, glBinormal3svEXT, const GLshort *, v); \
UnsupportedWrapper3(void, glTangentPointerEXT, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper3(void, glBinormalPointerEXT, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper7(void, glCopyTexImage1DEXT, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLint, border); \
UnsupportedWrapper8(void, glCopyTexImage2DEXT, GLenum, target, GLint, level, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLint, border); \
UnsupportedWrapper6(void, glCopyTexSubImage1DEXT, GLenum, target, GLint, level, GLint, xoffset, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper8(void, glCopyTexSubImage2DEXT, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
UnsupportedWrapper9(void, glCopyTexSubImage3DEXT, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, x, GLint, y, GLsizei, width, GLsizei, height); \
UnsupportedWrapper2(void, glCullParameterdvEXT, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper2(void, glCullParameterfvEXT, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper5(void, glBufferStorageExternalEXT, GLenum, target, GLintptr, offset, GLsizeiptr, size, GLeglClientBufferEXT, clientBuffer, GLbitfield, flags); \
UnsupportedWrapper5(void, glNamedBufferStorageExternalEXT, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, GLeglClientBufferEXT, clientBuffer, GLbitfield, flags); \
UnsupportedWrapper1(void, glFogCoordfEXT, GLfloat, coord); \
UnsupportedWrapper1(void, glFogCoordfvEXT, const GLfloat *, coord); \
UnsupportedWrapper1(void, glFogCoorddEXT, GLdouble, coord); \
UnsupportedWrapper1(void, glFogCoorddvEXT, const GLdouble *, coord); \
UnsupportedWrapper3(void, glFogCoordPointerEXT, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper4(void, glProgramEnvParameters4fvEXT, GLenum, target, GLuint, index, GLsizei, count, const GLfloat *, params); \
UnsupportedWrapper4(void, glProgramLocalParameters4fvEXT, GLenum, target, GLuint, index, GLsizei, count, const GLfloat *, params); \
UnsupportedWrapper5(void, glGetHistogramEXT, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, void *, values); \
UnsupportedWrapper3(void, glGetHistogramParameterfvEXT, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetHistogramParameterivEXT, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper5(void, glGetMinmaxEXT, GLenum, target, GLboolean, reset, GLenum, format, GLenum, type, void *, values); \
UnsupportedWrapper3(void, glGetMinmaxParameterfvEXT, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetMinmaxParameterivEXT, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glHistogramEXT, GLenum, target, GLsizei, width, GLenum, internalformat, GLboolean, sink); \
UnsupportedWrapper3(void, glMinmaxEXT, GLenum, target, GLenum, internalformat, GLboolean, sink); \
UnsupportedWrapper1(void, glResetHistogramEXT, GLenum, target); \
UnsupportedWrapper1(void, glResetMinmaxEXT, GLenum, target); \
UnsupportedWrapper2(void, glIndexFuncEXT, GLenum, func, GLclampf, ref); \
UnsupportedWrapper2(void, glIndexMaterialEXT, GLenum, face, GLenum, mode); \
UnsupportedWrapper1(void, glApplyTextureEXT, GLenum, mode); \
UnsupportedWrapper1(void, glTextureLightEXT, GLenum, pname); \
UnsupportedWrapper2(void, glTextureMaterialEXT, GLenum, face, GLenum, mode); \
UnsupportedWrapper5(void, glMultiDrawElementsEXT, GLenum, mode, const GLsizei *, count, GLenum, type, const void *const*, indices, GLsizei, primcount); \
UnsupportedWrapper2(void, glSampleMaskEXT, GLclampf, value, GLboolean, invert); \
UnsupportedWrapper1(void, glSamplePatternEXT, GLenum, pattern); \
UnsupportedWrapper6(void, glColorTableEXT, GLenum, target, GLenum, internalFormat, GLsizei, width, GLenum, format, GLenum, type, const void *, table); \
UnsupportedWrapper4(void, glGetColorTableEXT, GLenum, target, GLenum, format, GLenum, type, void *, data); \
UnsupportedWrapper3(void, glGetColorTableParameterivEXT, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetColorTableParameterfvEXT, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glPixelTransformParameteriEXT, GLenum, target, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glPixelTransformParameterfEXT, GLenum, target, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glPixelTransformParameterivEXT, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glPixelTransformParameterfvEXT, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glGetPixelTransformParameterivEXT, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetPixelTransformParameterfvEXT, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper2(void, glPolygonOffsetEXT, GLfloat, factor, GLfloat, bias); \
UnsupportedWrapper3(void, glSecondaryColor3bEXT, GLbyte, red, GLbyte, green, GLbyte, blue); \
UnsupportedWrapper1(void, glSecondaryColor3bvEXT, const GLbyte *, v); \
UnsupportedWrapper3(void, glSecondaryColor3dEXT, GLdouble, red, GLdouble, green, GLdouble, blue); \
UnsupportedWrapper1(void, glSecondaryColor3dvEXT, const GLdouble *, v); \
UnsupportedWrapper3(void, glSecondaryColor3fEXT, GLfloat, red, GLfloat, green, GLfloat, blue); \
UnsupportedWrapper1(void, glSecondaryColor3fvEXT, const GLfloat *, v); \
UnsupportedWrapper3(void, glSecondaryColor3iEXT, GLint, red, GLint, green, GLint, blue); \
UnsupportedWrapper1(void, glSecondaryColor3ivEXT, const GLint *, v); \
UnsupportedWrapper3(void, glSecondaryColor3sEXT, GLshort, red, GLshort, green, GLshort, blue); \
UnsupportedWrapper1(void, glSecondaryColor3svEXT, const GLshort *, v); \
UnsupportedWrapper3(void, glSecondaryColor3ubEXT, GLubyte, red, GLubyte, green, GLubyte, blue); \
UnsupportedWrapper1(void, glSecondaryColor3ubvEXT, const GLubyte *, v); \
UnsupportedWrapper3(void, glSecondaryColor3uiEXT, GLuint, red, GLuint, green, GLuint, blue); \
UnsupportedWrapper1(void, glSecondaryColor3uivEXT, const GLuint *, v); \
UnsupportedWrapper3(void, glSecondaryColor3usEXT, GLushort, red, GLushort, green, GLushort, blue); \
UnsupportedWrapper1(void, glSecondaryColor3usvEXT, const GLushort *, v); \
UnsupportedWrapper4(void, glSecondaryColorPointerEXT, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper2(void, glStencilClearTagEXT, GLsizei, stencilTagBits, GLuint, stencilClearTag); \
UnsupportedWrapper1(void, glActiveStencilFaceEXT, GLenum, face); \
UnsupportedWrapper7(void, glTexSubImage1DEXT, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLenum, type, const void *, pixels); \
UnsupportedWrapper9(void, glTexSubImage2DEXT, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels); \
UnsupportedWrapper11(void, glTexSubImage3DEXT, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, pixels); \
UnsupportedWrapper4(void, glClearColorIiEXT, GLint, red, GLint, green, GLint, blue, GLint, alpha); \
UnsupportedWrapper4(void, glClearColorIuiEXT, GLuint, red, GLuint, green, GLuint, blue, GLuint, alpha); \
UnsupportedWrapper3(GLboolean, glAreTexturesResidentEXT, GLsizei, n, const GLuint *, textures, GLboolean *, residences); \
UnsupportedWrapper2(void, glBindTextureEXT, GLenum, target, GLuint, texture); \
UnsupportedWrapper2(void, glDeleteTexturesEXT, GLsizei, n, const GLuint *, textures); \
UnsupportedWrapper2(void, glGenTexturesEXT, GLsizei, n, GLuint *, textures); \
UnsupportedWrapper1(GLboolean, glIsTextureEXT, GLuint, texture); \
UnsupportedWrapper3(void, glPrioritizeTexturesEXT, GLsizei, n, const GLuint *, textures, const GLclampf *, priorities); \
UnsupportedWrapper1(void, glTextureNormalEXT, GLenum, mode); \
UnsupportedWrapper4(void, glBindBufferOffsetEXT, GLenum, target, GLuint, index, GLuint, buffer, GLintptr, offset); \
UnsupportedWrapper1(void, glArrayElementEXT, GLint, i); \
UnsupportedWrapper5(void, glColorPointerEXT, GLint, size, GLenum, type, GLsizei, stride, GLsizei, count, const void *, pointer); \
UnsupportedWrapper3(void, glDrawArraysEXT, GLenum, mode, GLint, first, GLsizei, count); \
UnsupportedWrapper3(void, glEdgeFlagPointerEXT, GLsizei, stride, GLsizei, count, const GLboolean *, pointer); \
UnsupportedWrapper2(void, glGetPointervEXT, GLenum, pname, void **, params); \
UnsupportedWrapper4(void, glIndexPointerEXT, GLenum, type, GLsizei, stride, GLsizei, count, const void *, pointer); \
UnsupportedWrapper4(void, glNormalPointerEXT, GLenum, type, GLsizei, stride, GLsizei, count, const void *, pointer); \
UnsupportedWrapper5(void, glTexCoordPointerEXT, GLint, size, GLenum, type, GLsizei, stride, GLsizei, count, const void *, pointer); \
UnsupportedWrapper5(void, glVertexPointerEXT, GLint, size, GLenum, type, GLsizei, stride, GLsizei, count, const void *, pointer); \
UnsupportedWrapper0(void, glBeginVertexShaderEXT); \
UnsupportedWrapper0(void, glEndVertexShaderEXT); \
UnsupportedWrapper1(void, glBindVertexShaderEXT, GLuint, id); \
UnsupportedWrapper1(GLuint, glGenVertexShadersEXT, GLuint, range); \
UnsupportedWrapper1(void, glDeleteVertexShaderEXT, GLuint, id); \
UnsupportedWrapper3(void, glShaderOp1EXT, GLenum, op, GLuint, res, GLuint, arg1); \
UnsupportedWrapper4(void, glShaderOp2EXT, GLenum, op, GLuint, res, GLuint, arg1, GLuint, arg2); \
UnsupportedWrapper5(void, glShaderOp3EXT, GLenum, op, GLuint, res, GLuint, arg1, GLuint, arg2, GLuint, arg3); \
UnsupportedWrapper6(void, glSwizzleEXT, GLuint, res, GLuint, in, GLenum, outX, GLenum, outY, GLenum, outZ, GLenum, outW); \
UnsupportedWrapper6(void, glWriteMaskEXT, GLuint, res, GLuint, in, GLenum, outX, GLenum, outY, GLenum, outZ, GLenum, outW); \
UnsupportedWrapper3(void, glInsertComponentEXT, GLuint, res, GLuint, src, GLuint, num); \
UnsupportedWrapper3(void, glExtractComponentEXT, GLuint, res, GLuint, src, GLuint, num); \
UnsupportedWrapper4(GLuint, glGenSymbolsEXT, GLenum, datatype, GLenum, storagetype, GLenum, range, GLuint, components); \
UnsupportedWrapper3(void, glSetInvariantEXT, GLuint, id, GLenum, type, const void *, addr); \
UnsupportedWrapper3(void, glSetLocalConstantEXT, GLuint, id, GLenum, type, const void *, addr); \
UnsupportedWrapper2(void, glVariantbvEXT, GLuint, id, const GLbyte *, addr); \
UnsupportedWrapper2(void, glVariantsvEXT, GLuint, id, const GLshort *, addr); \
UnsupportedWrapper2(void, glVariantivEXT, GLuint, id, const GLint *, addr); \
UnsupportedWrapper2(void, glVariantfvEXT, GLuint, id, const GLfloat *, addr); \
UnsupportedWrapper2(void, glVariantdvEXT, GLuint, id, const GLdouble *, addr); \
UnsupportedWrapper2(void, glVariantubvEXT, GLuint, id, const GLubyte *, addr); \
UnsupportedWrapper2(void, glVariantusvEXT, GLuint, id, const GLushort *, addr); \
UnsupportedWrapper2(void, glVariantuivEXT, GLuint, id, const GLuint *, addr); \
UnsupportedWrapper4(void, glVariantPointerEXT, GLuint, id, GLenum, type, GLuint, stride, const void *, addr); \
UnsupportedWrapper1(void, glEnableVariantClientStateEXT, GLuint, id); \
UnsupportedWrapper1(void, glDisableVariantClientStateEXT, GLuint, id); \
UnsupportedWrapper2(GLuint, glBindLightParameterEXT, GLenum, light, GLenum, value); \
UnsupportedWrapper2(GLuint, glBindMaterialParameterEXT, GLenum, face, GLenum, value); \
UnsupportedWrapper3(GLuint, glBindTexGenParameterEXT, GLenum, unit, GLenum, coord, GLenum, value); \
UnsupportedWrapper2(GLuint, glBindTextureUnitParameterEXT, GLenum, unit, GLenum, value); \
UnsupportedWrapper1(GLuint, glBindParameterEXT, GLenum, value); \
UnsupportedWrapper2(GLboolean, glIsVariantEnabledEXT, GLuint, id, GLenum, cap); \
UnsupportedWrapper3(void, glGetVariantBooleanvEXT, GLuint, id, GLenum, value, GLboolean *, data); \
UnsupportedWrapper3(void, glGetVariantIntegervEXT, GLuint, id, GLenum, value, GLint *, data); \
UnsupportedWrapper3(void, glGetVariantFloatvEXT, GLuint, id, GLenum, value, GLfloat *, data); \
UnsupportedWrapper3(void, glGetVariantPointervEXT, GLuint, id, GLenum, value, void **, data); \
UnsupportedWrapper3(void, glGetInvariantBooleanvEXT, GLuint, id, GLenum, value, GLboolean *, data); \
UnsupportedWrapper3(void, glGetInvariantIntegervEXT, GLuint, id, GLenum, value, GLint *, data); \
UnsupportedWrapper3(void, glGetInvariantFloatvEXT, GLuint, id, GLenum, value, GLfloat *, data); \
UnsupportedWrapper3(void, glGetLocalConstantBooleanvEXT, GLuint, id, GLenum, value, GLboolean *, data); \
UnsupportedWrapper3(void, glGetLocalConstantIntegervEXT, GLuint, id, GLenum, value, GLint *, data); \
UnsupportedWrapper3(void, glGetLocalConstantFloatvEXT, GLuint, id, GLenum, value, GLfloat *, data); \
UnsupportedWrapper1(void, glVertexWeightfEXT, GLfloat, weight); \
UnsupportedWrapper1(void, glVertexWeightfvEXT, const GLfloat *, weight); \
UnsupportedWrapper4(void, glVertexWeightPointerEXT, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper3(GLsync, glImportSyncEXT, GLenum, external_sync_type, GLintptr, external_sync, GLbitfield, flags); \
UnsupportedWrapper3(void, glImageTransformParameteriHP, GLenum, target, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glImageTransformParameterfHP, GLenum, target, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glImageTransformParameterivHP, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glImageTransformParameterfvHP, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glGetImageTransformParameterivHP, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetImageTransformParameterfvHP, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper5(void, glMultiModeDrawArraysIBM, const GLenum *, mode, const GLint *, first, const GLsizei *, count, GLsizei, primcount, GLint, modestride); \
UnsupportedWrapper6(void, glMultiModeDrawElementsIBM, const GLenum *, mode, const GLsizei *, count, GLenum, type, const void *const*, indices, GLsizei, primcount, GLint, modestride); \
UnsupportedWrapper1(void, glFlushStaticDataIBM, GLenum, target); \
UnsupportedWrapper5(void, glColorPointerListIBM, GLint, size, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper5(void, glSecondaryColorPointerListIBM, GLint, size, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper3(void, glEdgeFlagPointerListIBM, GLint, stride, const GLboolean **, pointer, GLint, ptrstride); \
UnsupportedWrapper4(void, glFogCoordPointerListIBM, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper4(void, glIndexPointerListIBM, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper4(void, glNormalPointerListIBM, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper5(void, glTexCoordPointerListIBM, GLint, size, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper5(void, glVertexPointerListIBM, GLint, size, GLenum, type, GLint, stride, const void **, pointer, GLint, ptrstride); \
UnsupportedWrapper4(void, glBlendFuncSeparateINGR, GLenum, sfactorRGB, GLenum, dfactorRGB, GLenum, sfactorAlpha, GLenum, dfactorAlpha); \
UnsupportedWrapper1(void, glSyncTextureINTEL, GLuint, texture); \
UnsupportedWrapper2(void, glUnmapTexture2DINTEL, GLuint, texture, GLint, level); \
UnsupportedWrapper5(void *, glMapTexture2DINTEL, GLuint, texture, GLint, level, GLbitfield, access, GLint *, stride, GLenum *, layout); \
UnsupportedWrapper3(void, glVertexPointervINTEL, GLint, size, GLenum, type, const void **, pointer); \
UnsupportedWrapper2(void, glNormalPointervINTEL, GLenum, type, const void **, pointer); \
UnsupportedWrapper3(void, glColorPointervINTEL, GLint, size, GLenum, type, const void **, pointer); \
UnsupportedWrapper3(void, glTexCoordPointervINTEL, GLint, size, GLenum, type, const void **, pointer); \
UnsupportedWrapper0(void, glResizeBuffersMESA); \
UnsupportedWrapper2(void, glWindowPos2dMESA, GLdouble, x, GLdouble, y); \
UnsupportedWrapper1(void, glWindowPos2dvMESA, const GLdouble *, v); \
UnsupportedWrapper2(void, glWindowPos2fMESA, GLfloat, x, GLfloat, y); \
UnsupportedWrapper1(void, glWindowPos2fvMESA, const GLfloat *, v); \
UnsupportedWrapper2(void, glWindowPos2iMESA, GLint, x, GLint, y); \
UnsupportedWrapper1(void, glWindowPos2ivMESA, const GLint *, v); \
UnsupportedWrapper2(void, glWindowPos2sMESA, GLshort, x, GLshort, y); \
UnsupportedWrapper1(void, glWindowPos2svMESA, const GLshort *, v); \
UnsupportedWrapper3(void, glWindowPos3dMESA, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper1(void, glWindowPos3dvMESA, const GLdouble *, v); \
UnsupportedWrapper3(void, glWindowPos3fMESA, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper1(void, glWindowPos3fvMESA, const GLfloat *, v); \
UnsupportedWrapper3(void, glWindowPos3iMESA, GLint, x, GLint, y, GLint, z); \
UnsupportedWrapper1(void, glWindowPos3ivMESA, const GLint *, v); \
UnsupportedWrapper3(void, glWindowPos3sMESA, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper1(void, glWindowPos3svMESA, const GLshort *, v); \
UnsupportedWrapper4(void, glWindowPos4dMESA, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper1(void, glWindowPos4dvMESA, const GLdouble *, v); \
UnsupportedWrapper4(void, glWindowPos4fMESA, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper1(void, glWindowPos4fvMESA, const GLfloat *, v); \
UnsupportedWrapper4(void, glWindowPos4iMESA, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper1(void, glWindowPos4ivMESA, const GLint *, v); \
UnsupportedWrapper4(void, glWindowPos4sMESA, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
UnsupportedWrapper1(void, glWindowPos4svMESA, const GLshort *, v); \
UnsupportedWrapper1(void, glBeginConditionalRenderNVX, GLuint, id); \
UnsupportedWrapper0(void, glEndConditionalRenderNVX); \
UnsupportedWrapper5(void, glLGPUNamedBufferSubDataNVX, GLbitfield, gpuMask, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, const void *, data); \
UnsupportedWrapper17(void, glLGPUCopyImageSubDataNVX, GLuint, sourceGpu, GLbitfield, destinationGpuMask, GLuint, srcName, GLenum, srcTarget, GLint, srcLevel, GLint, srcX, GLint, srxY, GLint, srcZ, GLuint, dstName, GLenum, dstTarget, GLint, dstLevel, GLint, dstX, GLint, dstY, GLint, dstZ, GLsizei, width, GLsizei, height, GLsizei, depth); \
UnsupportedWrapper0(void, glLGPUInterlockNVX); \
UnsupportedWrapper1(void, glAlphaToCoverageDitherControlNV, GLenum, mode); \
UnsupportedWrapper15(void, glCopyImageSubDataNV, GLuint, srcName, GLenum, srcTarget, GLint, srcLevel, GLint, srcX, GLint, srcY, GLint, srcZ, GLuint, dstName, GLenum, dstTarget, GLint, dstLevel, GLint, dstX, GLint, dstY, GLint, dstZ, GLsizei, width, GLsizei, height, GLsizei, depth); \
UnsupportedWrapper2(void, glDepthRangedNV, GLdouble, zNear, GLdouble, zFar); \
UnsupportedWrapper1(void, glClearDepthdNV, GLdouble, depth); \
UnsupportedWrapper2(void, glDepthBoundsdNV, GLdouble, zmin, GLdouble, zmax); \
UnsupportedWrapper11(void, glDrawTextureNV, GLuint, texture, GLuint, sampler, GLfloat, x0, GLfloat, y0, GLfloat, x1, GLfloat, y1, GLfloat, z, GLfloat, s0, GLfloat, t0, GLfloat, s1, GLfloat, t1); \
UnsupportedWrapper9(void, glMapControlPointsNV, GLenum, target, GLuint, index, GLenum, type, GLsizei, ustride, GLsizei, vstride, GLint, uorder, GLint, vorder, GLboolean, packed, const void *, points); \
UnsupportedWrapper3(void, glMapParameterivNV, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glMapParameterfvNV, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper7(void, glGetMapControlPointsNV, GLenum, target, GLuint, index, GLenum, type, GLsizei, ustride, GLsizei, vstride, GLboolean, packed, void *, points); \
UnsupportedWrapper3(void, glGetMapParameterivNV, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetMapParameterfvNV, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper4(void, glGetMapAttribParameterivNV, GLenum, target, GLuint, index, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glGetMapAttribParameterfvNV, GLenum, target, GLuint, index, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper2(void, glEvalMapsNV, GLenum, target, GLenum, mode); \
UnsupportedWrapper3(void, glGetMultisamplefvNV, GLenum, pname, GLuint, index, GLfloat *, val); \
UnsupportedWrapper2(void, glSampleMaskIndexedNV, GLuint, index, GLbitfield, mask); \
UnsupportedWrapper2(void, glTexRenderbufferNV, GLenum, target, GLuint, renderbuffer); \
UnsupportedWrapper2(void, glDeleteFencesNV, GLsizei, n, const GLuint *, fences); \
UnsupportedWrapper2(void, glGenFencesNV, GLsizei, n, GLuint *, fences); \
UnsupportedWrapper1(GLboolean, glIsFenceNV, GLuint, fence); \
UnsupportedWrapper1(GLboolean, glTestFenceNV, GLuint, fence); \
UnsupportedWrapper3(void, glGetFenceivNV, GLuint, fence, GLenum, pname, GLint *, params); \
UnsupportedWrapper1(void, glFinishFenceNV, GLuint, fence); \
UnsupportedWrapper2(void, glSetFenceNV, GLuint, fence, GLenum, condition); \
UnsupportedWrapper7(void, glProgramNamedParameter4fNV, GLuint, id, GLsizei, len, const GLubyte *, name, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper4(void, glProgramNamedParameter4fvNV, GLuint, id, GLsizei, len, const GLubyte *, name, const GLfloat *, v); \
UnsupportedWrapper7(void, glProgramNamedParameter4dNV, GLuint, id, GLsizei, len, const GLubyte *, name, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper4(void, glProgramNamedParameter4dvNV, GLuint, id, GLsizei, len, const GLubyte *, name, const GLdouble *, v); \
UnsupportedWrapper4(void, glGetProgramNamedParameterfvNV, GLuint, id, GLsizei, len, const GLubyte *, name, GLfloat *, params); \
UnsupportedWrapper4(void, glGetProgramNamedParameterdvNV, GLuint, id, GLsizei, len, const GLubyte *, name, GLdouble *, params); \
UnsupportedWrapper2(void, glProgramVertexLimitNV, GLenum, target, GLint, limit); \
UnsupportedWrapper5(void, glFramebufferTextureFaceEXT, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLenum, face); \
UnsupportedWrapper1(void, glRenderGpuMaskNV, GLbitfield, mask); \
UnsupportedWrapper5(void, glMulticastBufferSubDataNV, GLbitfield, gpuMask, GLuint, buffer, GLintptr, offset, GLsizeiptr, size, const void *, data); \
UnsupportedWrapper7(void, glMulticastCopyBufferSubDataNV, GLuint, readGpu, GLbitfield, writeGpuMask, GLuint, readBuffer, GLuint, writeBuffer, GLintptr, readOffset, GLintptr, writeOffset, GLsizeiptr, size); \
UnsupportedWrapper17(void, glMulticastCopyImageSubDataNV, GLuint, srcGpu, GLbitfield, dstGpuMask, GLuint, srcName, GLenum, srcTarget, GLint, srcLevel, GLint, srcX, GLint, srcY, GLint, srcZ, GLuint, dstName, GLenum, dstTarget, GLint, dstLevel, GLint, dstX, GLint, dstY, GLint, dstZ, GLsizei, srcWidth, GLsizei, srcHeight, GLsizei, srcDepth); \
UnsupportedWrapper12(void, glMulticastBlitFramebufferNV, GLuint, srcGpu, GLuint, dstGpu, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter); \
UnsupportedWrapper5(void, glMulticastFramebufferSampleLocationsfvNV, GLuint, gpu, GLuint, framebuffer, GLuint, start, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper0(void, glMulticastBarrierNV); \
UnsupportedWrapper2(void, glMulticastWaitSyncNV, GLuint, signalGpu, GLbitfield, waitGpuMask); \
UnsupportedWrapper4(void, glMulticastGetQueryObjectivNV, GLuint, gpu, GLuint, id, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glMulticastGetQueryObjectuivNV, GLuint, gpu, GLuint, id, GLenum, pname, GLuint *, params); \
UnsupportedWrapper4(void, glMulticastGetQueryObjecti64vNV, GLuint, gpu, GLuint, id, GLenum, pname, GLint64 *, params); \
UnsupportedWrapper4(void, glMulticastGetQueryObjectui64vNV, GLuint, gpu, GLuint, id, GLenum, pname, GLuint64 *, params); \
UnsupportedWrapper6(void, glProgramLocalParameterI4iNV, GLenum, target, GLuint, index, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper3(void, glProgramLocalParameterI4ivNV, GLenum, target, GLuint, index, const GLint *, params); \
UnsupportedWrapper4(void, glProgramLocalParametersI4ivNV, GLenum, target, GLuint, index, GLsizei, count, const GLint *, params); \
UnsupportedWrapper6(void, glProgramLocalParameterI4uiNV, GLenum, target, GLuint, index, GLuint, x, GLuint, y, GLuint, z, GLuint, w); \
UnsupportedWrapper3(void, glProgramLocalParameterI4uivNV, GLenum, target, GLuint, index, const GLuint *, params); \
UnsupportedWrapper4(void, glProgramLocalParametersI4uivNV, GLenum, target, GLuint, index, GLsizei, count, const GLuint *, params); \
UnsupportedWrapper6(void, glProgramEnvParameterI4iNV, GLenum, target, GLuint, index, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper3(void, glProgramEnvParameterI4ivNV, GLenum, target, GLuint, index, const GLint *, params); \
UnsupportedWrapper4(void, glProgramEnvParametersI4ivNV, GLenum, target, GLuint, index, GLsizei, count, const GLint *, params); \
UnsupportedWrapper6(void, glProgramEnvParameterI4uiNV, GLenum, target, GLuint, index, GLuint, x, GLuint, y, GLuint, z, GLuint, w); \
UnsupportedWrapper3(void, glProgramEnvParameterI4uivNV, GLenum, target, GLuint, index, const GLuint *, params); \
UnsupportedWrapper4(void, glProgramEnvParametersI4uivNV, GLenum, target, GLuint, index, GLsizei, count, const GLuint *, params); \
UnsupportedWrapper3(void, glGetProgramLocalParameterIivNV, GLenum, target, GLuint, index, GLint *, params); \
UnsupportedWrapper3(void, glGetProgramLocalParameterIuivNV, GLenum, target, GLuint, index, GLuint *, params); \
UnsupportedWrapper3(void, glGetProgramEnvParameterIivNV, GLenum, target, GLuint, index, GLint *, params); \
UnsupportedWrapper3(void, glGetProgramEnvParameterIuivNV, GLenum, target, GLuint, index, GLuint *, params); \
UnsupportedWrapper3(void, glProgramSubroutineParametersuivNV, GLenum, target, GLsizei, count, const GLuint *, params); \
UnsupportedWrapper3(void, glGetProgramSubroutineParameteruivNV, GLenum, target, GLuint, index, GLuint *, param); \
UnsupportedWrapper2(void, glVertex2hNV, GLhalfNV, x, GLhalfNV, y); \
UnsupportedWrapper1(void, glVertex2hvNV, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glVertex3hNV, GLhalfNV, x, GLhalfNV, y, GLhalfNV, z); \
UnsupportedWrapper1(void, glVertex3hvNV, const GLhalfNV *, v); \
UnsupportedWrapper4(void, glVertex4hNV, GLhalfNV, x, GLhalfNV, y, GLhalfNV, z, GLhalfNV, w); \
UnsupportedWrapper1(void, glVertex4hvNV, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glNormal3hNV, GLhalfNV, nx, GLhalfNV, ny, GLhalfNV, nz); \
UnsupportedWrapper1(void, glNormal3hvNV, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glColor3hNV, GLhalfNV, red, GLhalfNV, green, GLhalfNV, blue); \
UnsupportedWrapper1(void, glColor3hvNV, const GLhalfNV *, v); \
UnsupportedWrapper4(void, glColor4hNV, GLhalfNV, red, GLhalfNV, green, GLhalfNV, blue, GLhalfNV, alpha); \
UnsupportedWrapper1(void, glColor4hvNV, const GLhalfNV *, v); \
UnsupportedWrapper1(void, glTexCoord1hNV, GLhalfNV, s); \
UnsupportedWrapper1(void, glTexCoord1hvNV, const GLhalfNV *, v); \
UnsupportedWrapper2(void, glTexCoord2hNV, GLhalfNV, s, GLhalfNV, t); \
UnsupportedWrapper1(void, glTexCoord2hvNV, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glTexCoord3hNV, GLhalfNV, s, GLhalfNV, t, GLhalfNV, r); \
UnsupportedWrapper1(void, glTexCoord3hvNV, const GLhalfNV *, v); \
UnsupportedWrapper4(void, glTexCoord4hNV, GLhalfNV, s, GLhalfNV, t, GLhalfNV, r, GLhalfNV, q); \
UnsupportedWrapper1(void, glTexCoord4hvNV, const GLhalfNV *, v); \
UnsupportedWrapper2(void, glMultiTexCoord1hNV, GLenum, target, GLhalfNV, s); \
UnsupportedWrapper2(void, glMultiTexCoord1hvNV, GLenum, target, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glMultiTexCoord2hNV, GLenum, target, GLhalfNV, s, GLhalfNV, t); \
UnsupportedWrapper2(void, glMultiTexCoord2hvNV, GLenum, target, const GLhalfNV *, v); \
UnsupportedWrapper4(void, glMultiTexCoord3hNV, GLenum, target, GLhalfNV, s, GLhalfNV, t, GLhalfNV, r); \
UnsupportedWrapper2(void, glMultiTexCoord3hvNV, GLenum, target, const GLhalfNV *, v); \
UnsupportedWrapper5(void, glMultiTexCoord4hNV, GLenum, target, GLhalfNV, s, GLhalfNV, t, GLhalfNV, r, GLhalfNV, q); \
UnsupportedWrapper2(void, glMultiTexCoord4hvNV, GLenum, target, const GLhalfNV *, v); \
UnsupportedWrapper1(void, glFogCoordhNV, GLhalfNV, fog); \
UnsupportedWrapper1(void, glFogCoordhvNV, const GLhalfNV *, fog); \
UnsupportedWrapper3(void, glSecondaryColor3hNV, GLhalfNV, red, GLhalfNV, green, GLhalfNV, blue); \
UnsupportedWrapper1(void, glSecondaryColor3hvNV, const GLhalfNV *, v); \
UnsupportedWrapper1(void, glVertexWeighthNV, GLhalfNV, weight); \
UnsupportedWrapper1(void, glVertexWeighthvNV, const GLhalfNV *, weight); \
UnsupportedWrapper2(void, glVertexAttrib1hNV, GLuint, index, GLhalfNV, x); \
UnsupportedWrapper2(void, glVertexAttrib1hvNV, GLuint, index, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glVertexAttrib2hNV, GLuint, index, GLhalfNV, x, GLhalfNV, y); \
UnsupportedWrapper2(void, glVertexAttrib2hvNV, GLuint, index, const GLhalfNV *, v); \
UnsupportedWrapper4(void, glVertexAttrib3hNV, GLuint, index, GLhalfNV, x, GLhalfNV, y, GLhalfNV, z); \
UnsupportedWrapper2(void, glVertexAttrib3hvNV, GLuint, index, const GLhalfNV *, v); \
UnsupportedWrapper5(void, glVertexAttrib4hNV, GLuint, index, GLhalfNV, x, GLhalfNV, y, GLhalfNV, z, GLhalfNV, w); \
UnsupportedWrapper2(void, glVertexAttrib4hvNV, GLuint, index, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glVertexAttribs1hvNV, GLuint, index, GLsizei, n, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glVertexAttribs2hvNV, GLuint, index, GLsizei, n, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glVertexAttribs3hvNV, GLuint, index, GLsizei, n, const GLhalfNV *, v); \
UnsupportedWrapper3(void, glVertexAttribs4hvNV, GLuint, index, GLsizei, n, const GLhalfNV *, v); \
UnsupportedWrapper2(void, glGenOcclusionQueriesNV, GLsizei, n, GLuint *, ids); \
UnsupportedWrapper2(void, glDeleteOcclusionQueriesNV, GLsizei, n, const GLuint *, ids); \
UnsupportedWrapper1(GLboolean, glIsOcclusionQueryNV, GLuint, id); \
UnsupportedWrapper1(void, glBeginOcclusionQueryNV, GLuint, id); \
UnsupportedWrapper0(void, glEndOcclusionQueryNV); \
UnsupportedWrapper3(void, glGetOcclusionQueryivNV, GLuint, id, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetOcclusionQueryuivNV, GLuint, id, GLenum, pname, GLuint *, params); \
UnsupportedWrapper5(void, glProgramBufferParametersfvNV, GLenum, target, GLuint, bindingIndex, GLuint, wordIndex, GLsizei, count, const GLfloat *, params); \
UnsupportedWrapper5(void, glProgramBufferParametersIivNV, GLenum, target, GLuint, bindingIndex, GLuint, wordIndex, GLsizei, count, const GLint *, params); \
UnsupportedWrapper5(void, glProgramBufferParametersIuivNV, GLenum, target, GLuint, bindingIndex, GLuint, wordIndex, GLsizei, count, const GLuint *, params); \
UnsupportedWrapper4(void, glPathColorGenNV, GLenum, color, GLenum, genMode, GLenum, colorFormat, const GLfloat *, coeffs); \
UnsupportedWrapper4(void, glPathTexGenNV, GLenum, texCoordSet, GLenum, genMode, GLint, components, const GLfloat *, coeffs); \
UnsupportedWrapper1(void, glPathFogGenNV, GLenum, genMode); \
UnsupportedWrapper3(void, glGetPathColorGenivNV, GLenum, color, GLenum, pname, GLint *, value); \
UnsupportedWrapper3(void, glGetPathColorGenfvNV, GLenum, color, GLenum, pname, GLfloat *, value); \
UnsupportedWrapper3(void, glGetPathTexGenivNV, GLenum, texCoordSet, GLenum, pname, GLint *, value); \
UnsupportedWrapper3(void, glGetPathTexGenfvNV, GLenum, texCoordSet, GLenum, pname, GLfloat *, value); \
UnsupportedWrapper3(void, glPixelDataRangeNV, GLenum, target, GLsizei, length, const void *, pointer); \
UnsupportedWrapper1(void, glFlushPixelDataRangeNV, GLenum, target); \
UnsupportedWrapper2(void, glPointParameteriNV, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glPointParameterivNV, GLenum, pname, const GLint *, params); \
UnsupportedWrapper11(void, glPresentFrameKeyedNV, GLuint, video_slot, GLuint64EXT, minPresentTime, GLuint, beginPresentTimeId, GLuint, presentDurationId, GLenum, type, GLenum, target0, GLuint, fill0, GLuint, key0, GLenum, target1, GLuint, fill1, GLuint, key1); \
UnsupportedWrapper13(void, glPresentFrameDualFillNV, GLuint, video_slot, GLuint64EXT, minPresentTime, GLuint, beginPresentTimeId, GLuint, presentDurationId, GLenum, type, GLenum, target0, GLuint, fill0, GLenum, target1, GLuint, fill1, GLenum, target2, GLuint, fill2, GLenum, target3, GLuint, fill3); \
UnsupportedWrapper3(void, glGetVideoivNV, GLuint, video_slot, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetVideouivNV, GLuint, video_slot, GLenum, pname, GLuint *, params); \
UnsupportedWrapper3(void, glGetVideoi64vNV, GLuint, video_slot, GLenum, pname, GLint64EXT *, params); \
UnsupportedWrapper3(void, glGetVideoui64vNV, GLuint, video_slot, GLenum, pname, GLuint64EXT *, params); \
UnsupportedWrapper0(void, glPrimitiveRestartNV); \
UnsupportedWrapper1(void, glPrimitiveRestartIndexNV, GLuint, index); \
UnsupportedWrapper4(GLint, glQueryResourceNV, GLenum, queryType, GLint, tagId, GLuint, bufSize, GLint *, buffer); \
UnsupportedWrapper2(void, glGenQueryResourceTagNV, GLsizei, n, GLint *, tagIds); \
UnsupportedWrapper2(void, glDeleteQueryResourceTagNV, GLsizei, n, const GLint *, tagIds); \
UnsupportedWrapper2(void, glQueryResourceTagNV, GLint, tagId, const GLchar *, tagString); \
UnsupportedWrapper2(void, glCombinerParameterfvNV, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper2(void, glCombinerParameterfNV, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glCombinerParameterivNV, GLenum, pname, const GLint *, params); \
UnsupportedWrapper2(void, glCombinerParameteriNV, GLenum, pname, GLint, param); \
UnsupportedWrapper6(void, glCombinerInputNV, GLenum, stage, GLenum, portion, GLenum, variable, GLenum, input, GLenum, mapping, GLenum, componentUsage); \
UnsupportedWrapper10(void, glCombinerOutputNV, GLenum, stage, GLenum, portion, GLenum, abOutput, GLenum, cdOutput, GLenum, sumOutput, GLenum, scale, GLenum, bias, GLboolean, abDotProduct, GLboolean, cdDotProduct, GLboolean, muxSum); \
UnsupportedWrapper4(void, glFinalCombinerInputNV, GLenum, variable, GLenum, input, GLenum, mapping, GLenum, componentUsage); \
UnsupportedWrapper5(void, glGetCombinerInputParameterfvNV, GLenum, stage, GLenum, portion, GLenum, variable, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper5(void, glGetCombinerInputParameterivNV, GLenum, stage, GLenum, portion, GLenum, variable, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glGetCombinerOutputParameterfvNV, GLenum, stage, GLenum, portion, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper4(void, glGetCombinerOutputParameterivNV, GLenum, stage, GLenum, portion, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetFinalCombinerInputParameterfvNV, GLenum, variable, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetFinalCombinerInputParameterivNV, GLenum, variable, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glCombinerStageParameterfvNV, GLenum, stage, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glGetCombinerStageParameterfvNV, GLenum, stage, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper7(void, glTexImage2DMultisampleCoverageNV, GLenum, target, GLsizei, coverageSamples, GLsizei, colorSamples, GLint, internalFormat, GLsizei, width, GLsizei, height, GLboolean, fixedSampleLocations); \
UnsupportedWrapper8(void, glTexImage3DMultisampleCoverageNV, GLenum, target, GLsizei, coverageSamples, GLsizei, colorSamples, GLint, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedSampleLocations); \
UnsupportedWrapper7(void, glTextureImage2DMultisampleNV, GLuint, texture, GLenum, target, GLsizei, samples, GLint, internalFormat, GLsizei, width, GLsizei, height, GLboolean, fixedSampleLocations); \
UnsupportedWrapper8(void, glTextureImage3DMultisampleNV, GLuint, texture, GLenum, target, GLsizei, samples, GLint, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedSampleLocations); \
UnsupportedWrapper8(void, glTextureImage2DMultisampleCoverageNV, GLuint, texture, GLenum, target, GLsizei, coverageSamples, GLsizei, colorSamples, GLint, internalFormat, GLsizei, width, GLsizei, height, GLboolean, fixedSampleLocations); \
UnsupportedWrapper9(void, glTextureImage3DMultisampleCoverageNV, GLuint, texture, GLenum, target, GLsizei, coverageSamples, GLsizei, colorSamples, GLint, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, fixedSampleLocations); \
UnsupportedWrapper1(void, glBeginTransformFeedbackNV, GLenum, primitiveMode); \
UnsupportedWrapper0(void, glEndTransformFeedbackNV); \
UnsupportedWrapper3(void, glTransformFeedbackAttribsNV, GLsizei, count, const GLint *, attribs, GLenum, bufferMode); \
UnsupportedWrapper5(void, glBindBufferRangeNV, GLenum, target, GLuint, index, GLuint, buffer, GLintptr, offset, GLsizeiptr, size); \
UnsupportedWrapper4(void, glBindBufferOffsetNV, GLenum, target, GLuint, index, GLuint, buffer, GLintptr, offset); \
UnsupportedWrapper3(void, glBindBufferBaseNV, GLenum, target, GLuint, index, GLuint, buffer); \
UnsupportedWrapper4(void, glTransformFeedbackVaryingsNV, GLuint, program, GLsizei, count, const GLint *, locations, GLenum, bufferMode); \
UnsupportedWrapper2(void, glActiveVaryingNV, GLuint, program, const GLchar *, name); \
UnsupportedWrapper2(GLint, glGetVaryingLocationNV, GLuint, program, const GLchar *, name); \
UnsupportedWrapper7(void, glGetActiveVaryingNV, GLuint, program, GLuint, index, GLsizei, bufSize, GLsizei *, length, GLsizei *, size, GLenum *, type, GLchar *, name); \
UnsupportedWrapper3(void, glGetTransformFeedbackVaryingNV, GLuint, program, GLuint, index, GLint *, location); \
UnsupportedWrapper5(void, glTransformFeedbackStreamAttribsNV, GLsizei, count, const GLint *, attribs, GLsizei, nbuffers, const GLint *, bufstreams, GLenum, bufferMode); \
UnsupportedWrapper2(void, glBindTransformFeedbackNV, GLenum, target, GLuint, id); \
UnsupportedWrapper2(void, glDeleteTransformFeedbacksNV, GLsizei, n, const GLuint *, ids); \
UnsupportedWrapper2(void, glGenTransformFeedbacksNV, GLsizei, n, GLuint *, ids); \
UnsupportedWrapper1(GLboolean, glIsTransformFeedbackNV, GLuint, id); \
UnsupportedWrapper0(void, glPauseTransformFeedbackNV); \
UnsupportedWrapper0(void, glResumeTransformFeedbackNV); \
UnsupportedWrapper2(void, glDrawTransformFeedbackNV, GLenum, mode, GLuint, id); \
UnsupportedWrapper2(void, glVDPAUInitNV, const void *, vdpDevice, const void *, getProcAddress); \
UnsupportedWrapper0(void, glVDPAUFiniNV); \
UnsupportedWrapper4(GLvdpauSurfaceNV, glVDPAURegisterVideoSurfaceNV, const void *, vdpSurface, GLenum, target, GLsizei, numTextureNames, const GLuint *, textureNames); \
UnsupportedWrapper4(GLvdpauSurfaceNV, glVDPAURegisterOutputSurfaceNV, const void *, vdpSurface, GLenum, target, GLsizei, numTextureNames, const GLuint *, textureNames); \
UnsupportedWrapper1(GLboolean, glVDPAUIsSurfaceNV, GLvdpauSurfaceNV, surface); \
UnsupportedWrapper1(void, glVDPAUUnregisterSurfaceNV, GLvdpauSurfaceNV, surface); \
UnsupportedWrapper5(void, glVDPAUGetSurfaceivNV, GLvdpauSurfaceNV, surface, GLenum, pname, GLsizei, bufSize, GLsizei *, length, GLint *, values); \
UnsupportedWrapper2(void, glVDPAUSurfaceAccessNV, GLvdpauSurfaceNV, surface, GLenum, access); \
UnsupportedWrapper2(void, glVDPAUMapSurfacesNV, GLsizei, numSurfaces, const GLvdpauSurfaceNV *, surfaces); \
UnsupportedWrapper2(void, glVDPAUUnmapSurfacesNV, GLsizei, numSurface, const GLvdpauSurfaceNV *, surfaces); \
UnsupportedWrapper0(void, glFlushVertexArrayRangeNV); \
UnsupportedWrapper2(void, glVertexArrayRangeNV, GLsizei, length, const void *, pointer); \
UnsupportedWrapper3(GLboolean, glAreProgramsResidentNV, GLsizei, n, const GLuint *, programs, GLboolean *, residences); \
UnsupportedWrapper2(void, glBindProgramNV, GLenum, target, GLuint, id); \
UnsupportedWrapper2(void, glDeleteProgramsNV, GLsizei, n, const GLuint *, programs); \
UnsupportedWrapper3(void, glExecuteProgramNV, GLenum, target, GLuint, id, const GLfloat *, params); \
UnsupportedWrapper2(void, glGenProgramsNV, GLsizei, n, GLuint *, programs); \
UnsupportedWrapper4(void, glGetProgramParameterdvNV, GLenum, target, GLuint, index, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper4(void, glGetProgramParameterfvNV, GLenum, target, GLuint, index, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetProgramivNV, GLuint, id, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetProgramStringNV, GLuint, id, GLenum, pname, GLubyte *, program); \
UnsupportedWrapper4(void, glGetTrackMatrixivNV, GLenum, target, GLuint, address, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetVertexAttribdvNV, GLuint, index, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper3(void, glGetVertexAttribfvNV, GLuint, index, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetVertexAttribivNV, GLuint, index, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetVertexAttribPointervNV, GLuint, index, GLenum, pname, void **, pointer); \
UnsupportedWrapper1(GLboolean, glIsProgramNV, GLuint, id); \
UnsupportedWrapper4(void, glLoadProgramNV, GLenum, target, GLuint, id, GLsizei, len, const GLubyte *, program); \
UnsupportedWrapper6(void, glProgramParameter4dNV, GLenum, target, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper3(void, glProgramParameter4dvNV, GLenum, target, GLuint, index, const GLdouble *, v); \
UnsupportedWrapper6(void, glProgramParameter4fNV, GLenum, target, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper3(void, glProgramParameter4fvNV, GLenum, target, GLuint, index, const GLfloat *, v); \
UnsupportedWrapper4(void, glProgramParameters4dvNV, GLenum, target, GLuint, index, GLsizei, count, const GLdouble *, v); \
UnsupportedWrapper4(void, glProgramParameters4fvNV, GLenum, target, GLuint, index, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper2(void, glRequestResidentProgramsNV, GLsizei, n, const GLuint *, programs); \
UnsupportedWrapper4(void, glTrackMatrixNV, GLenum, target, GLuint, address, GLenum, matrix, GLenum, transform); \
UnsupportedWrapper5(void, glVertexAttribPointerNV, GLuint, index, GLint, fsize, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper2(void, glVertexAttrib1dNV, GLuint, index, GLdouble, x); \
UnsupportedWrapper2(void, glVertexAttrib1dvNV, GLuint, index, const GLdouble *, v); \
UnsupportedWrapper2(void, glVertexAttrib1fNV, GLuint, index, GLfloat, x); \
UnsupportedWrapper2(void, glVertexAttrib1fvNV, GLuint, index, const GLfloat *, v); \
UnsupportedWrapper2(void, glVertexAttrib1sNV, GLuint, index, GLshort, x); \
UnsupportedWrapper2(void, glVertexAttrib1svNV, GLuint, index, const GLshort *, v); \
UnsupportedWrapper3(void, glVertexAttrib2dNV, GLuint, index, GLdouble, x, GLdouble, y); \
UnsupportedWrapper2(void, glVertexAttrib2dvNV, GLuint, index, const GLdouble *, v); \
UnsupportedWrapper3(void, glVertexAttrib2fNV, GLuint, index, GLfloat, x, GLfloat, y); \
UnsupportedWrapper2(void, glVertexAttrib2fvNV, GLuint, index, const GLfloat *, v); \
UnsupportedWrapper3(void, glVertexAttrib2sNV, GLuint, index, GLshort, x, GLshort, y); \
UnsupportedWrapper2(void, glVertexAttrib2svNV, GLuint, index, const GLshort *, v); \
UnsupportedWrapper4(void, glVertexAttrib3dNV, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper2(void, glVertexAttrib3dvNV, GLuint, index, const GLdouble *, v); \
UnsupportedWrapper4(void, glVertexAttrib3fNV, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glVertexAttrib3fvNV, GLuint, index, const GLfloat *, v); \
UnsupportedWrapper4(void, glVertexAttrib3sNV, GLuint, index, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper2(void, glVertexAttrib3svNV, GLuint, index, const GLshort *, v); \
UnsupportedWrapper5(void, glVertexAttrib4dNV, GLuint, index, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper2(void, glVertexAttrib4dvNV, GLuint, index, const GLdouble *, v); \
UnsupportedWrapper5(void, glVertexAttrib4fNV, GLuint, index, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper2(void, glVertexAttrib4fvNV, GLuint, index, const GLfloat *, v); \
UnsupportedWrapper5(void, glVertexAttrib4sNV, GLuint, index, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
UnsupportedWrapper2(void, glVertexAttrib4svNV, GLuint, index, const GLshort *, v); \
UnsupportedWrapper5(void, glVertexAttrib4ubNV, GLuint, index, GLubyte, x, GLubyte, y, GLubyte, z, GLubyte, w); \
UnsupportedWrapper2(void, glVertexAttrib4ubvNV, GLuint, index, const GLubyte *, v); \
UnsupportedWrapper3(void, glVertexAttribs1dvNV, GLuint, index, GLsizei, count, const GLdouble *, v); \
UnsupportedWrapper3(void, glVertexAttribs1fvNV, GLuint, index, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper3(void, glVertexAttribs1svNV, GLuint, index, GLsizei, count, const GLshort *, v); \
UnsupportedWrapper3(void, glVertexAttribs2dvNV, GLuint, index, GLsizei, count, const GLdouble *, v); \
UnsupportedWrapper3(void, glVertexAttribs2fvNV, GLuint, index, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper3(void, glVertexAttribs2svNV, GLuint, index, GLsizei, count, const GLshort *, v); \
UnsupportedWrapper3(void, glVertexAttribs3dvNV, GLuint, index, GLsizei, count, const GLdouble *, v); \
UnsupportedWrapper3(void, glVertexAttribs3fvNV, GLuint, index, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper3(void, glVertexAttribs3svNV, GLuint, index, GLsizei, count, const GLshort *, v); \
UnsupportedWrapper3(void, glVertexAttribs4dvNV, GLuint, index, GLsizei, count, const GLdouble *, v); \
UnsupportedWrapper3(void, glVertexAttribs4fvNV, GLuint, index, GLsizei, count, const GLfloat *, v); \
UnsupportedWrapper3(void, glVertexAttribs4svNV, GLuint, index, GLsizei, count, const GLshort *, v); \
UnsupportedWrapper3(void, glVertexAttribs4ubvNV, GLuint, index, GLsizei, count, const GLubyte *, v); \
UnsupportedWrapper1(void, glBeginVideoCaptureNV, GLuint, video_capture_slot); \
UnsupportedWrapper4(void, glBindVideoCaptureStreamBufferNV, GLuint, video_capture_slot, GLuint, stream, GLenum, frame_region, GLintptrARB, offset); \
UnsupportedWrapper5(void, glBindVideoCaptureStreamTextureNV, GLuint, video_capture_slot, GLuint, stream, GLenum, frame_region, GLenum, target, GLuint, texture); \
UnsupportedWrapper1(void, glEndVideoCaptureNV, GLuint, video_capture_slot); \
UnsupportedWrapper3(void, glGetVideoCaptureivNV, GLuint, video_capture_slot, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glGetVideoCaptureStreamivNV, GLuint, video_capture_slot, GLuint, stream, GLenum, pname, GLint *, params); \
UnsupportedWrapper4(void, glGetVideoCaptureStreamfvNV, GLuint, video_capture_slot, GLuint, stream, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper4(void, glGetVideoCaptureStreamdvNV, GLuint, video_capture_slot, GLuint, stream, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper3(GLenum, glVideoCaptureNV, GLuint, video_capture_slot, GLuint *, sequence_num, GLuint64EXT *, capture_time); \
UnsupportedWrapper4(void, glVideoCaptureStreamParameterivNV, GLuint, video_capture_slot, GLuint, stream, GLenum, pname, const GLint *, params); \
UnsupportedWrapper4(void, glVideoCaptureStreamParameterfvNV, GLuint, video_capture_slot, GLuint, stream, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper4(void, glVideoCaptureStreamParameterdvNV, GLuint, video_capture_slot, GLuint, stream, GLenum, pname, const GLdouble *, params); \
UnsupportedWrapper2(void, glHintPGI, GLenum, target, GLint, mode); \
UnsupportedWrapper3(void, glDetailTexFuncSGIS, GLenum, target, GLsizei, n, const GLfloat *, points); \
UnsupportedWrapper2(void, glGetDetailTexFuncSGIS, GLenum, target, GLfloat *, points); \
UnsupportedWrapper2(void, glFogFuncSGIS, GLsizei, n, const GLfloat *, points); \
UnsupportedWrapper1(void, glGetFogFuncSGIS, GLfloat *, points); \
UnsupportedWrapper2(void, glSampleMaskSGIS, GLclampf, value, GLboolean, invert); \
UnsupportedWrapper1(void, glSamplePatternSGIS, GLenum, pattern); \
UnsupportedWrapper2(void, glPixelTexGenParameteriSGIS, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glPixelTexGenParameterivSGIS, GLenum, pname, const GLint *, params); \
UnsupportedWrapper2(void, glPixelTexGenParameterfSGIS, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glPixelTexGenParameterfvSGIS, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper2(void, glGetPixelTexGenParameterivSGIS, GLenum, pname, GLint *, params); \
UnsupportedWrapper2(void, glGetPixelTexGenParameterfvSGIS, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper2(void, glPointParameterfSGIS, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glPointParameterfvSGIS, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glSharpenTexFuncSGIS, GLenum, target, GLsizei, n, const GLfloat *, points); \
UnsupportedWrapper2(void, glGetSharpenTexFuncSGIS, GLenum, target, GLfloat *, points); \
UnsupportedWrapper11(void, glTexImage4DSGIS, GLenum, target, GLint, level, GLenum, internalformat, GLsizei, width, GLsizei, height, GLsizei, depth, GLsizei, size4d, GLint, border, GLenum, format, GLenum, type, const void *, pixels); \
UnsupportedWrapper13(void, glTexSubImage4DSGIS, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLint, woffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLsizei, size4d, GLenum, format, GLenum, type, const void *, pixels); \
UnsupportedWrapper4(void, glTextureColorMaskSGIS, GLboolean, red, GLboolean, green, GLboolean, blue, GLboolean, alpha); \
UnsupportedWrapper3(void, glGetTexFilterFuncSGIS, GLenum, target, GLenum, filter, GLfloat *, weights); \
UnsupportedWrapper4(void, glTexFilterFuncSGIS, GLenum, target, GLenum, filter, GLsizei, n, const GLfloat *, weights); \
UnsupportedWrapper1(void, glAsyncMarkerSGIX, GLuint, marker); \
UnsupportedWrapper1(GLint, glFinishAsyncSGIX, GLuint *, markerp); \
UnsupportedWrapper1(GLint, glPollAsyncSGIX, GLuint *, markerp); \
UnsupportedWrapper1(GLuint, glGenAsyncMarkersSGIX, GLsizei, range); \
UnsupportedWrapper2(void, glDeleteAsyncMarkersSGIX, GLuint, marker, GLsizei, range); \
UnsupportedWrapper1(GLboolean, glIsAsyncMarkerSGIX, GLuint, marker); \
UnsupportedWrapper0(void, glFlushRasterSGIX); \
UnsupportedWrapper2(void, glFragmentColorMaterialSGIX, GLenum, face, GLenum, mode); \
UnsupportedWrapper3(void, glFragmentLightfSGIX, GLenum, light, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glFragmentLightfvSGIX, GLenum, light, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glFragmentLightiSGIX, GLenum, light, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glFragmentLightivSGIX, GLenum, light, GLenum, pname, const GLint *, params); \
UnsupportedWrapper2(void, glFragmentLightModelfSGIX, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glFragmentLightModelfvSGIX, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper2(void, glFragmentLightModeliSGIX, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glFragmentLightModelivSGIX, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glFragmentMaterialfSGIX, GLenum, face, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glFragmentMaterialfvSGIX, GLenum, face, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glFragmentMaterialiSGIX, GLenum, face, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glFragmentMaterialivSGIX, GLenum, face, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glGetFragmentLightfvSGIX, GLenum, light, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetFragmentLightivSGIX, GLenum, light, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glGetFragmentMaterialfvSGIX, GLenum, face, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetFragmentMaterialivSGIX, GLenum, face, GLenum, pname, GLint *, params); \
UnsupportedWrapper2(void, glLightEnviSGIX, GLenum, pname, GLint, param); \
UnsupportedWrapper1(void, glFrameZoomSGIX, GLint, factor); \
UnsupportedWrapper2(void, glIglooInterfaceSGIX, GLenum, pname, const void *, params); \
UnsupportedWrapper0(GLint, glGetInstrumentsSGIX); \
UnsupportedWrapper2(void, glInstrumentsBufferSGIX, GLsizei, size, GLint *, buffer); \
UnsupportedWrapper1(GLint, glPollInstrumentsSGIX, GLint *, marker_p); \
UnsupportedWrapper1(void, glReadInstrumentsSGIX, GLint, marker); \
UnsupportedWrapper0(void, glStartInstrumentsSGIX); \
UnsupportedWrapper1(void, glStopInstrumentsSGIX, GLint, marker); \
UnsupportedWrapper3(void, glGetListParameterfvSGIX, GLuint, list, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetListParameterivSGIX, GLuint, list, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glListParameterfSGIX, GLuint, list, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glListParameterfvSGIX, GLuint, list, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glListParameteriSGIX, GLuint, list, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glListParameterivSGIX, GLuint, list, GLenum, pname, const GLint *, params); \
UnsupportedWrapper1(void, glPixelTexGenSGIX, GLenum, mode); \
UnsupportedWrapper14(void, glDeformationMap3dSGIX, GLenum, target, GLdouble, u1, GLdouble, u2, GLint, ustride, GLint, uorder, GLdouble, v1, GLdouble, v2, GLint, vstride, GLint, vorder, GLdouble, w1, GLdouble, w2, GLint, wstride, GLint, worder, const GLdouble *, points); \
UnsupportedWrapper14(void, glDeformationMap3fSGIX, GLenum, target, GLfloat, u1, GLfloat, u2, GLint, ustride, GLint, uorder, GLfloat, v1, GLfloat, v2, GLint, vstride, GLint, vorder, GLfloat, w1, GLfloat, w2, GLint, wstride, GLint, worder, const GLfloat *, points); \
UnsupportedWrapper1(void, glDeformSGIX, GLbitfield, mask); \
UnsupportedWrapper1(void, glLoadIdentityDeformationMapSGIX, GLbitfield, mask); \
UnsupportedWrapper1(void, glReferencePlaneSGIX, const GLdouble *, equation); \
UnsupportedWrapper2(void, glSpriteParameterfSGIX, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glSpriteParameterfvSGIX, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper2(void, glSpriteParameteriSGIX, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glSpriteParameterivSGIX, GLenum, pname, const GLint *, params); \
UnsupportedWrapper0(void, glTagSampleBufferSGIX); \
UnsupportedWrapper6(void, glColorTableSGI, GLenum, target, GLenum, internalformat, GLsizei, width, GLenum, format, GLenum, type, const void *, table); \
UnsupportedWrapper3(void, glColorTableParameterfvSGI, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glColorTableParameterivSGI, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper5(void, glCopyColorTableSGI, GLenum, target, GLenum, internalformat, GLint, x, GLint, y, GLsizei, width); \
UnsupportedWrapper4(void, glGetColorTableSGI, GLenum, target, GLenum, format, GLenum, type, void *, table); \
UnsupportedWrapper3(void, glGetColorTableParameterfvSGI, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetColorTableParameterivSGI, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper0(void, glFinishTextureSUNX); \
UnsupportedWrapper1(void, glGlobalAlphaFactorbSUN, GLbyte, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactorsSUN, GLshort, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactoriSUN, GLint, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactorfSUN, GLfloat, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactordSUN, GLdouble, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactorubSUN, GLubyte, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactorusSUN, GLushort, factor); \
UnsupportedWrapper1(void, glGlobalAlphaFactoruiSUN, GLuint, factor); \
UnsupportedWrapper4(void, glDrawMeshArraysSUN, GLenum, mode, GLint, first, GLsizei, count, GLsizei, width); \
UnsupportedWrapper1(void, glReplacementCodeuiSUN, GLuint, code); \
UnsupportedWrapper1(void, glReplacementCodeusSUN, GLushort, code); \
UnsupportedWrapper1(void, glReplacementCodeubSUN, GLubyte, code); \
UnsupportedWrapper1(void, glReplacementCodeuivSUN, const GLuint *, code); \
UnsupportedWrapper1(void, glReplacementCodeusvSUN, const GLushort *, code); \
UnsupportedWrapper1(void, glReplacementCodeubvSUN, const GLubyte *, code); \
UnsupportedWrapper3(void, glReplacementCodePointerSUN, GLenum, type, GLsizei, stride, const void **, pointer); \
UnsupportedWrapper6(void, glColor4ubVertex2fSUN, GLubyte, r, GLubyte, g, GLubyte, b, GLubyte, a, GLfloat, x, GLfloat, y); \
UnsupportedWrapper2(void, glColor4ubVertex2fvSUN, const GLubyte *, c, const GLfloat *, v); \
UnsupportedWrapper7(void, glColor4ubVertex3fSUN, GLubyte, r, GLubyte, g, GLubyte, b, GLubyte, a, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glColor4ubVertex3fvSUN, const GLubyte *, c, const GLfloat *, v); \
UnsupportedWrapper6(void, glColor3fVertex3fSUN, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glColor3fVertex3fvSUN, const GLfloat *, c, const GLfloat *, v); \
UnsupportedWrapper6(void, glNormal3fVertex3fSUN, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glNormal3fVertex3fvSUN, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper10(void, glColor4fNormal3fVertex3fSUN, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, a, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glColor4fNormal3fVertex3fvSUN, const GLfloat *, c, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper5(void, glTexCoord2fVertex3fSUN, GLfloat, s, GLfloat, t, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glTexCoord2fVertex3fvSUN, const GLfloat *, tc, const GLfloat *, v); \
UnsupportedWrapper8(void, glTexCoord4fVertex4fSUN, GLfloat, s, GLfloat, t, GLfloat, p, GLfloat, q, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper2(void, glTexCoord4fVertex4fvSUN, const GLfloat *, tc, const GLfloat *, v); \
UnsupportedWrapper9(void, glTexCoord2fColor4ubVertex3fSUN, GLfloat, s, GLfloat, t, GLubyte, r, GLubyte, g, GLubyte, b, GLubyte, a, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glTexCoord2fColor4ubVertex3fvSUN, const GLfloat *, tc, const GLubyte *, c, const GLfloat *, v); \
UnsupportedWrapper8(void, glTexCoord2fColor3fVertex3fSUN, GLfloat, s, GLfloat, t, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glTexCoord2fColor3fVertex3fvSUN, const GLfloat *, tc, const GLfloat *, c, const GLfloat *, v); \
UnsupportedWrapper8(void, glTexCoord2fNormal3fVertex3fSUN, GLfloat, s, GLfloat, t, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glTexCoord2fNormal3fVertex3fvSUN, const GLfloat *, tc, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper12(void, glTexCoord2fColor4fNormal3fVertex3fSUN, GLfloat, s, GLfloat, t, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, a, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper4(void, glTexCoord2fColor4fNormal3fVertex3fvSUN, const GLfloat *, tc, const GLfloat *, c, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper15(void, glTexCoord4fColor4fNormal3fVertex4fSUN, GLfloat, s, GLfloat, t, GLfloat, p, GLfloat, q, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, a, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper4(void, glTexCoord4fColor4fNormal3fVertex4fvSUN, const GLfloat *, tc, const GLfloat *, c, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper4(void, glReplacementCodeuiVertex3fSUN, GLuint, rc, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper2(void, glReplacementCodeuiVertex3fvSUN, const GLuint *, rc, const GLfloat *, v); \
UnsupportedWrapper8(void, glReplacementCodeuiColor4ubVertex3fSUN, GLuint, rc, GLubyte, r, GLubyte, g, GLubyte, b, GLubyte, a, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glReplacementCodeuiColor4ubVertex3fvSUN, const GLuint *, rc, const GLubyte *, c, const GLfloat *, v); \
UnsupportedWrapper7(void, glReplacementCodeuiColor3fVertex3fSUN, GLuint, rc, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glReplacementCodeuiColor3fVertex3fvSUN, const GLuint *, rc, const GLfloat *, c, const GLfloat *, v); \
UnsupportedWrapper7(void, glReplacementCodeuiNormal3fVertex3fSUN, GLuint, rc, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glReplacementCodeuiNormal3fVertex3fvSUN, const GLuint *, rc, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper11(void, glReplacementCodeuiColor4fNormal3fVertex3fSUN, GLuint, rc, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, a, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper4(void, glReplacementCodeuiColor4fNormal3fVertex3fvSUN, const GLuint *, rc, const GLfloat *, c, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper6(void, glReplacementCodeuiTexCoord2fVertex3fSUN, GLuint, rc, GLfloat, s, GLfloat, t, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glReplacementCodeuiTexCoord2fVertex3fvSUN, const GLuint *, rc, const GLfloat *, tc, const GLfloat *, v); \
UnsupportedWrapper9(void, glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN, GLuint, rc, GLfloat, s, GLfloat, t, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper4(void, glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN, const GLuint *, rc, const GLfloat *, tc, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper13(void, glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN, GLuint, rc, GLfloat, s, GLfloat, t, GLfloat, r, GLfloat, g, GLfloat, b, GLfloat, a, GLfloat, nx, GLfloat, ny, GLfloat, nz, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper5(void, glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN, const GLuint *, rc, const GLfloat *, tc, const GLfloat *, c, const GLfloat *, n, const GLfloat *, v); \
UnsupportedWrapper0(GLenum, glGetGraphicsResetStatusKHR); \
UnsupportedWrapper8(void, glReadnPixelsKHR, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, GLsizei, bufSize, void *, data); \
UnsupportedWrapper4(void, glGetnUniformfvKHR, GLuint, program, GLint, location, GLsizei, bufSize, GLfloat *, params); \
UnsupportedWrapper4(void, glGetnUniformivKHR, GLuint, program, GLint, location, GLsizei, bufSize, GLint *, params); \
UnsupportedWrapper4(void, glGetnUniformuivKHR, GLuint, program, GLint, location, GLsizei, bufSize, GLuint *, params); \
UnsupportedWrapper2(void, glEGLImageTargetTexture2DOES, GLenum, target, GLeglImageOES, image); \
UnsupportedWrapper2(void, glEGLImageTargetRenderbufferStorageOES, GLenum, target, GLeglImageOES, image); \
UnsupportedWrapper5(void, glGetProgramBinaryOES, GLuint, program, GLsizei, bufSize, GLsizei *, length, GLenum *, binaryFormat, void *, binary); \
UnsupportedWrapper4(void, glProgramBinaryOES, GLuint, program, GLenum, binaryFormat, const void *, binary, GLint, length); \
UnsupportedWrapper10(void, glBlitFramebufferANGLE, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter); \
UnsupportedWrapper5(void, glRenderbufferStorageMultisampleANGLE, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
UnsupportedWrapper4(void, glDrawArraysInstancedANGLE, GLenum, mode, GLint, first, GLsizei, count, GLsizei, primcount); \
UnsupportedWrapper5(void, glDrawElementsInstancedANGLE, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, primcount); \
UnsupportedWrapper2(void, glVertexAttribDivisorANGLE, GLuint, index, GLuint, divisor); \
UnsupportedWrapper4(void, glGetTranslatedShaderSourceANGLE, GLuint, shader, GLsizei, bufsize, GLsizei *, length, GLchar *, source); \
UnsupportedWrapper4(void, glCopyTextureLevelsAPPLE, GLuint, destinationTexture, GLuint, sourceTexture, GLint, sourceBaseLevel, GLsizei, sourceLevelCount); \
UnsupportedWrapper5(void, glRenderbufferStorageMultisampleAPPLE, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
UnsupportedWrapper0(void, glResolveMultisampleFramebufferAPPLE); \
UnsupportedWrapper2(GLsync, glFenceSyncAPPLE, GLenum, condition, GLbitfield, flags); \
UnsupportedWrapper1(GLboolean, glIsSyncAPPLE, GLsync, sync); \
UnsupportedWrapper1(void, glDeleteSyncAPPLE, GLsync, sync); \
UnsupportedWrapper3(GLenum, glClientWaitSyncAPPLE, GLsync, sync, GLbitfield, flags, GLuint64, timeout); \
UnsupportedWrapper3(void, glWaitSyncAPPLE, GLsync, sync, GLbitfield, flags, GLuint64, timeout); \
UnsupportedWrapper2(void, glGetInteger64vAPPLE, GLenum, pname, GLint64 *, params); \
UnsupportedWrapper5(void, glGetSyncivAPPLE, GLsync, sync, GLenum, pname, GLsizei, bufSize, GLsizei *, length, GLint *, values); \
UnsupportedWrapper4(void, glBindFragDataLocationIndexedEXT, GLuint, program, GLuint, colorNumber, GLuint, index, const GLchar *, name); \
UnsupportedWrapper3(GLint, glGetProgramResourceLocationIndexEXT, GLuint, program, GLenum, programInterface, const GLchar *, name); \
UnsupportedWrapper2(GLint, glGetFragDataIndexEXT, GLuint, program, const GLchar *, name); \
UnsupportedWrapper4(void, glBufferStorageEXT, GLenum, target, GLsizeiptr, size, const void *, data, GLbitfield, flags); \
UnsupportedWrapper5(void, glClearTexImageEXT, GLuint, texture, GLint, level, GLenum, format, GLenum, type, const void *, data); \
UnsupportedWrapper11(void, glClearTexSubImageEXT, GLuint, texture, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const void *, data); \
UnsupportedWrapper2(void, glClipControlEXT, GLenum, origin, GLenum, depth); \
UnsupportedWrapper2(void, glDrawTransformFeedbackEXT, GLenum, mode, GLuint, id); \
UnsupportedWrapper3(void, glDrawTransformFeedbackInstancedEXT, GLenum, mode, GLuint, id, GLsizei, instancecount); \
UnsupportedWrapper2(void, glVertexAttribDivisorEXT, GLuint, index, GLuint, divisor); \
UnsupportedWrapper4(void *, glMapBufferRangeEXT, GLenum, target, GLintptr, offset, GLsizeiptr, length, GLbitfield, access); \
UnsupportedWrapper3(void, glFlushMappedBufferRangeEXT, GLenum, target, GLintptr, offset, GLsizeiptr, length); \
UnsupportedWrapper4(void, glMultiDrawArraysIndirectEXT, GLenum, mode, const void *, indirect, GLsizei, drawcount, GLsizei, stride); \
UnsupportedWrapper5(void, glMultiDrawElementsIndirectEXT, GLenum, mode, GLenum, type, const void *, indirect, GLsizei, drawcount, GLsizei, stride); \
UnsupportedWrapper2(void, glReadBufferIndexedEXT, GLenum, src, GLint, index); \
UnsupportedWrapper3(void, glDrawBuffersIndexedEXT, GLint, n, const GLenum *, location, const GLint *, indices); \
UnsupportedWrapper3(void, glGetIntegeri_vEXT, GLenum, target, GLuint, index, GLint *, data); \
UnsupportedWrapper2(void, glFramebufferPixelLocalStorageSizeEXT, GLuint, target, GLsizei, size); \
UnsupportedWrapper1(GLsizei, glGetFramebufferPixelLocalStorageSizeEXT, GLuint, target); \
UnsupportedWrapper3(void, glClearPixelLocalStorageuiEXT, GLsizei, offset, GLsizei, n, const GLuint *, values); \
UnsupportedWrapper9(void, glTexPageCommitmentEXT, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLboolean, commit); \
UnsupportedWrapper1(GLuint64, glGetTextureHandleIMG, GLuint, texture); \
UnsupportedWrapper2(GLuint64, glGetTextureSamplerHandleIMG, GLuint, texture, GLuint, sampler); \
UnsupportedWrapper2(void, glUniformHandleui64IMG, GLint, location, GLuint64, value); \
UnsupportedWrapper3(void, glUniformHandleui64vIMG, GLint, location, GLsizei, count, const GLuint64 *, value); \
UnsupportedWrapper3(void, glProgramUniformHandleui64IMG, GLuint, program, GLint, location, GLuint64, value); \
UnsupportedWrapper4(void, glProgramUniformHandleui64vIMG, GLuint, program, GLint, location, GLsizei, count, const GLuint64 *, values); \
UnsupportedWrapper7(void, glFramebufferTexture2DDownsampleIMG, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLint, xscale, GLint, yscale); \
UnsupportedWrapper7(void, glFramebufferTextureLayerDownsampleIMG, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer, GLint, xscale, GLint, yscale); \
UnsupportedWrapper5(void, glRenderbufferStorageMultisampleIMG, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
UnsupportedWrapper6(void, glFramebufferTexture2DMultisampleIMG, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level, GLsizei, samples); \
UnsupportedWrapper5(void, glCopyBufferSubDataNV, GLenum, readTarget, GLenum, writeTarget, GLintptr, readOffset, GLintptr, writeOffset, GLsizeiptr, size); \
UnsupportedWrapper1(void, glCoverageMaskNV, GLboolean, mask); \
UnsupportedWrapper1(void, glCoverageOperationNV, GLenum, operation); \
UnsupportedWrapper2(void, glDrawBuffersNV, GLsizei, n, const GLenum *, bufs); \
UnsupportedWrapper4(void, glDrawArraysInstancedNV, GLenum, mode, GLint, first, GLsizei, count, GLsizei, primcount); \
UnsupportedWrapper5(void, glDrawElementsInstancedNV, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, primcount); \
UnsupportedWrapper10(void, glBlitFramebufferNV, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter); \
UnsupportedWrapper5(void, glRenderbufferStorageMultisampleNV, GLenum, target, GLsizei, samples, GLenum, internalformat, GLsizei, width, GLsizei, height); \
UnsupportedWrapper2(void, glVertexAttribDivisorNV, GLuint, index, GLuint, divisor); \
UnsupportedWrapper4(void, glUniformMatrix2x3fvNV, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
UnsupportedWrapper4(void, glUniformMatrix3x2fvNV, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
UnsupportedWrapper4(void, glUniformMatrix2x4fvNV, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
UnsupportedWrapper4(void, glUniformMatrix4x2fvNV, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
UnsupportedWrapper4(void, glUniformMatrix3x4fvNV, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
UnsupportedWrapper4(void, glUniformMatrix4x3fvNV, GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value); \
UnsupportedWrapper2(void, glPolygonModeNV, GLenum, face, GLenum, mode); \
UnsupportedWrapper1(void, glReadBufferNV, GLenum, mode); \
UnsupportedWrapper2(void, glAlphaFuncQCOM, GLenum, func, GLclampf, ref); \
UnsupportedWrapper3(void, glGetDriverControlsQCOM, GLint *, num, GLsizei, size, GLuint *, driverControls); \
UnsupportedWrapper4(void, glGetDriverControlStringQCOM, GLuint, driverControl, GLsizei, bufSize, GLsizei *, length, GLchar *, driverControlString); \
UnsupportedWrapper1(void, glEnableDriverControlQCOM, GLuint, driverControl); \
UnsupportedWrapper1(void, glDisableDriverControlQCOM, GLuint, driverControl); \
UnsupportedWrapper3(void, glExtGetTexturesQCOM, GLuint *, textures, GLint, maxTextures, GLint *, numTextures); \
UnsupportedWrapper3(void, glExtGetBuffersQCOM, GLuint *, buffers, GLint, maxBuffers, GLint *, numBuffers); \
UnsupportedWrapper3(void, glExtGetRenderbuffersQCOM, GLuint *, renderbuffers, GLint, maxRenderbuffers, GLint *, numRenderbuffers); \
UnsupportedWrapper3(void, glExtGetFramebuffersQCOM, GLuint *, framebuffers, GLint, maxFramebuffers, GLint *, numFramebuffers); \
UnsupportedWrapper5(void, glExtGetTexLevelParameterivQCOM, GLuint, texture, GLenum, face, GLint, level, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glExtTexObjectStateOverrideiQCOM, GLenum, target, GLenum, pname, GLint, param); \
UnsupportedWrapper11(void, glExtGetTexSubImageQCOM, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, void *, texels); \
UnsupportedWrapper2(void, glExtGetBufferPointervQCOM, GLenum, target, void **, params); \
UnsupportedWrapper3(void, glExtGetShadersQCOM, GLuint *, shaders, GLint, maxShaders, GLint *, numShaders); \
UnsupportedWrapper3(void, glExtGetProgramsQCOM, GLuint *, programs, GLint, maxPrograms, GLint *, numPrograms); \
UnsupportedWrapper1(GLboolean, glExtIsProgramBinaryQCOM, GLuint, program); \
UnsupportedWrapper4(void, glExtGetProgramBinarySourceQCOM, GLuint, program, GLenum, shadertype, GLchar *, source, GLint *, length); \
UnsupportedWrapper5(void, glFramebufferFoveationConfigQCOM, GLuint, framebuffer, GLuint, numLayers, GLuint, focalPointsPerLayer, GLuint, requestedFeatures, GLuint *, providedFeatures); \
UnsupportedWrapper8(void, glFramebufferFoveationParametersQCOM, GLuint, framebuffer, GLuint, layer, GLuint, focalPoint, GLfloat, focalX, GLfloat, focalY, GLfloat, gainX, GLfloat, gainY, GLfloat, foveaArea); \
UnsupportedWrapper0(void, glFramebufferFetchBarrierQCOM); \
UnsupportedWrapper8(void, glTextureFoveationParametersQCOM, GLuint, texture, GLuint, layer, GLuint, focalPoint, GLfloat, focalX, GLfloat, focalY, GLfloat, gainX, GLfloat, gainY, GLfloat, foveaArea); \
UnsupportedWrapper5(void, glStartTilingQCOM, GLuint, x, GLuint, y, GLuint, width, GLuint, height, GLbitfield, preserveMask); \
UnsupportedWrapper1(void, glEndTilingQCOM, GLbitfield, preserveMask); \
UnsupportedWrapper1(GLboolean, glIsList, GLuint, list); \
UnsupportedWrapper2(void, glDeleteLists, GLuint, list, GLsizei, range); \
UnsupportedWrapper1(GLuint, glGenLists, GLsizei, range); \
UnsupportedWrapper2(void, glNewList, GLuint, list, GLenum, mode); \
UnsupportedWrapper0(void, glEndList); \
UnsupportedWrapper1(void, glCallList, GLuint, list); \
UnsupportedWrapper3(void, glCallLists, GLsizei, n, GLenum, type, const void *, lists); \
UnsupportedWrapper1(void, glListBase, GLuint, base); \
UnsupportedWrapper3(void, glPrioritizeTextures, GLsizei, n, const GLuint *, textures, const GLfloat *, priorities); \
UnsupportedWrapper3(GLboolean, glAreTexturesResident, GLsizei, n, const GLuint *, textures, GLboolean *, residences); \
UnsupportedWrapper6(void, glMap1d, GLenum, target, GLdouble, u1, GLdouble, u2, GLint, stride, GLint, order, const GLdouble *, points); \
UnsupportedWrapper6(void, glMap1f, GLenum, target, GLfloat, u1, GLfloat, u2, GLint, stride, GLint, order, const GLfloat *, points); \
UnsupportedWrapper10(void, glMap2d, GLenum, target, GLdouble, u1, GLdouble, u2, GLint, ustride, GLint, uorder, GLdouble, v1, GLdouble, v2, GLint, vstride, GLint, vorder, const GLdouble *, points); \
UnsupportedWrapper10(void, glMap2f, GLenum, target, GLfloat, u1, GLfloat, u2, GLint, ustride, GLint, uorder, GLfloat, v1, GLfloat, v2, GLint, vstride, GLint, vorder, const GLfloat *, points); \
UnsupportedWrapper3(void, glGetMapdv, GLenum, target, GLenum, query, GLdouble *, v); \
UnsupportedWrapper3(void, glGetMapfv, GLenum, target, GLenum, query, GLfloat *, v); \
UnsupportedWrapper3(void, glGetMapiv, GLenum, target, GLenum, query, GLint *, v); \
UnsupportedWrapper1(void, glEvalCoord1d, GLdouble, u); \
UnsupportedWrapper1(void, glEvalCoord1f, GLfloat, u); \
UnsupportedWrapper1(void, glEvalCoord1dv, const GLdouble *, u); \
UnsupportedWrapper1(void, glEvalCoord1fv, const GLfloat *, u); \
UnsupportedWrapper2(void, glEvalCoord2d, GLdouble, u, GLdouble, v); \
UnsupportedWrapper2(void, glEvalCoord2f, GLfloat, u, GLfloat, v); \
UnsupportedWrapper1(void, glEvalCoord2dv, const GLdouble *, u); \
UnsupportedWrapper1(void, glEvalCoord2fv, const GLfloat *, u); \
UnsupportedWrapper3(void, glMapGrid1d, GLint, un, GLdouble, u1, GLdouble, u2); \
UnsupportedWrapper3(void, glMapGrid1f, GLint, un, GLfloat, u1, GLfloat, u2); \
UnsupportedWrapper6(void, glMapGrid2d, GLint, un, GLdouble, u1, GLdouble, u2, GLint, vn, GLdouble, v1, GLdouble, v2); \
UnsupportedWrapper6(void, glMapGrid2f, GLint, un, GLfloat, u1, GLfloat, u2, GLint, vn, GLfloat, v1, GLfloat, v2); \
UnsupportedWrapper1(void, glEvalPoint1, GLint, i); \
UnsupportedWrapper2(void, glEvalPoint2, GLint, i, GLint, j); \
UnsupportedWrapper3(void, glEvalMesh1, GLenum, mode, GLint, i1, GLint, i2); \
UnsupportedWrapper5(void, glEvalMesh2, GLenum, mode, GLint, i1, GLint, i2, GLint, j1, GLint, j2); \
UnsupportedWrapper2(void, glFogf, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glFogi, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glFogfv, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper2(void, glFogiv, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glFeedbackBuffer, GLsizei, size, GLenum, type, GLfloat *, buffer); \
UnsupportedWrapper1(void, glPassThrough, GLfloat, token); \
UnsupportedWrapper2(void, glSelectBuffer, GLsizei, size, GLuint *, buffer); \
UnsupportedWrapper0(void, glInitNames); \
UnsupportedWrapper1(void, glLoadName, GLuint, name); \
UnsupportedWrapper1(void, glPushName, GLuint, name); \
UnsupportedWrapper0(void, glPopName); \
UnsupportedWrapper1(void, glBegin, GLenum, mode); \
UnsupportedWrapper0(void, glEnd); \
UnsupportedWrapper2(void, glVertex2d, GLdouble, x, GLdouble, y); \
UnsupportedWrapper2(void, glVertex2f, GLfloat, x, GLfloat, y); \
UnsupportedWrapper2(void, glVertex2i, GLint, x, GLint, y); \
UnsupportedWrapper2(void, glVertex2s, GLshort, x, GLshort, y); \
UnsupportedWrapper3(void, glVertex3d, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper3(void, glVertex3f, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glVertex3i, GLint, x, GLint, y, GLint, z); \
UnsupportedWrapper3(void, glVertex3s, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper4(void, glVertex4d, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper4(void, glVertex4f, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper4(void, glVertex4i, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper4(void, glVertex4s, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
UnsupportedWrapper1(void, glVertex2dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glVertex2fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glVertex2iv, const GLint *, v); \
UnsupportedWrapper1(void, glVertex2sv, const GLshort *, v); \
UnsupportedWrapper1(void, glVertex3dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glVertex3fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glVertex3iv, const GLint *, v); \
UnsupportedWrapper1(void, glVertex3sv, const GLshort *, v); \
UnsupportedWrapper1(void, glVertex4dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glVertex4fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glVertex4iv, const GLint *, v); \
UnsupportedWrapper1(void, glVertex4sv, const GLshort *, v); \
UnsupportedWrapper3(void, glNormal3b, GLbyte, nx, GLbyte, ny, GLbyte, nz); \
UnsupportedWrapper3(void, glNormal3d, GLdouble, nx, GLdouble, ny, GLdouble, nz); \
UnsupportedWrapper3(void, glNormal3f, GLfloat, nx, GLfloat, ny, GLfloat, nz); \
UnsupportedWrapper3(void, glNormal3i, GLint, nx, GLint, ny, GLint, nz); \
UnsupportedWrapper3(void, glNormal3s, GLshort, nx, GLshort, ny, GLshort, nz); \
UnsupportedWrapper1(void, glNormal3bv, const GLbyte *, v); \
UnsupportedWrapper1(void, glNormal3dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glNormal3fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glNormal3iv, const GLint *, v); \
UnsupportedWrapper1(void, glNormal3sv, const GLshort *, v); \
UnsupportedWrapper1(void, glIndexd, GLdouble, c); \
UnsupportedWrapper1(void, glIndexf, GLfloat, c); \
UnsupportedWrapper1(void, glIndexi, GLint, c); \
UnsupportedWrapper1(void, glIndexs, GLshort, c); \
UnsupportedWrapper1(void, glIndexub, GLubyte, c); \
UnsupportedWrapper1(void, glIndexdv, const GLdouble *, c); \
UnsupportedWrapper1(void, glIndexfv, const GLfloat *, c); \
UnsupportedWrapper1(void, glIndexiv, const GLint *, c); \
UnsupportedWrapper1(void, glIndexsv, const GLshort *, c); \
UnsupportedWrapper1(void, glIndexubv, const GLubyte *, c); \
UnsupportedWrapper3(void, glColor3b, GLbyte, red, GLbyte, green, GLbyte, blue); \
UnsupportedWrapper3(void, glColor3d, GLdouble, red, GLdouble, green, GLdouble, blue); \
UnsupportedWrapper3(void, glColor3f, GLfloat, red, GLfloat, green, GLfloat, blue); \
UnsupportedWrapper3(void, glColor3i, GLint, red, GLint, green, GLint, blue); \
UnsupportedWrapper3(void, glColor3s, GLshort, red, GLshort, green, GLshort, blue); \
UnsupportedWrapper3(void, glColor3ub, GLubyte, red, GLubyte, green, GLubyte, blue); \
UnsupportedWrapper3(void, glColor3ui, GLuint, red, GLuint, green, GLuint, blue); \
UnsupportedWrapper3(void, glColor3us, GLushort, red, GLushort, green, GLushort, blue); \
UnsupportedWrapper4(void, glColor4b, GLbyte, red, GLbyte, green, GLbyte, blue, GLbyte, alpha); \
UnsupportedWrapper4(void, glColor4d, GLdouble, red, GLdouble, green, GLdouble, blue, GLdouble, alpha); \
UnsupportedWrapper4(void, glColor4f, GLfloat, red, GLfloat, green, GLfloat, blue, GLfloat, alpha); \
UnsupportedWrapper4(void, glColor4i, GLint, red, GLint, green, GLint, blue, GLint, alpha); \
UnsupportedWrapper4(void, glColor4s, GLshort, red, GLshort, green, GLshort, blue, GLshort, alpha); \
UnsupportedWrapper4(void, glColor4ub, GLubyte, red, GLubyte, green, GLubyte, blue, GLubyte, alpha); \
UnsupportedWrapper4(void, glColor4ui, GLuint, red, GLuint, green, GLuint, blue, GLuint, alpha); \
UnsupportedWrapper4(void, glColor4us, GLushort, red, GLushort, green, GLushort, blue, GLushort, alpha); \
UnsupportedWrapper1(void, glColor3bv, const GLbyte *, v); \
UnsupportedWrapper1(void, glColor3dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glColor3fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glColor3iv, const GLint *, v); \
UnsupportedWrapper1(void, glColor3sv, const GLshort *, v); \
UnsupportedWrapper1(void, glColor3ubv, const GLubyte *, v); \
UnsupportedWrapper1(void, glColor3uiv, const GLuint *, v); \
UnsupportedWrapper1(void, glColor3usv, const GLushort *, v); \
UnsupportedWrapper1(void, glColor4bv, const GLbyte *, v); \
UnsupportedWrapper1(void, glColor4dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glColor4fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glColor4iv, const GLint *, v); \
UnsupportedWrapper1(void, glColor4sv, const GLshort *, v); \
UnsupportedWrapper1(void, glColor4ubv, const GLubyte *, v); \
UnsupportedWrapper1(void, glColor4uiv, const GLuint *, v); \
UnsupportedWrapper1(void, glColor4usv, const GLushort *, v); \
UnsupportedWrapper1(void, glTexCoord1d, GLdouble, s); \
UnsupportedWrapper1(void, glTexCoord1f, GLfloat, s); \
UnsupportedWrapper1(void, glTexCoord1i, GLint, s); \
UnsupportedWrapper1(void, glTexCoord1s, GLshort, s); \
UnsupportedWrapper2(void, glTexCoord2d, GLdouble, s, GLdouble, t); \
UnsupportedWrapper2(void, glTexCoord2f, GLfloat, s, GLfloat, t); \
UnsupportedWrapper2(void, glTexCoord2i, GLint, s, GLint, t); \
UnsupportedWrapper2(void, glTexCoord2s, GLshort, s, GLshort, t); \
UnsupportedWrapper3(void, glTexCoord3d, GLdouble, s, GLdouble, t, GLdouble, r); \
UnsupportedWrapper3(void, glTexCoord3f, GLfloat, s, GLfloat, t, GLfloat, r); \
UnsupportedWrapper3(void, glTexCoord3i, GLint, s, GLint, t, GLint, r); \
UnsupportedWrapper3(void, glTexCoord3s, GLshort, s, GLshort, t, GLshort, r); \
UnsupportedWrapper4(void, glTexCoord4d, GLdouble, s, GLdouble, t, GLdouble, r, GLdouble, q); \
UnsupportedWrapper4(void, glTexCoord4f, GLfloat, s, GLfloat, t, GLfloat, r, GLfloat, q); \
UnsupportedWrapper4(void, glTexCoord4i, GLint, s, GLint, t, GLint, r, GLint, q); \
UnsupportedWrapper4(void, glTexCoord4s, GLshort, s, GLshort, t, GLshort, r, GLshort, q); \
UnsupportedWrapper1(void, glTexCoord1dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glTexCoord1fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glTexCoord1iv, const GLint *, v); \
UnsupportedWrapper1(void, glTexCoord1sv, const GLshort *, v); \
UnsupportedWrapper1(void, glTexCoord2dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glTexCoord2fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glTexCoord2iv, const GLint *, v); \
UnsupportedWrapper1(void, glTexCoord2sv, const GLshort *, v); \
UnsupportedWrapper1(void, glTexCoord3dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glTexCoord3fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glTexCoord3iv, const GLint *, v); \
UnsupportedWrapper1(void, glTexCoord3sv, const GLshort *, v); \
UnsupportedWrapper1(void, glTexCoord4dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glTexCoord4fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glTexCoord4iv, const GLint *, v); \
UnsupportedWrapper1(void, glTexCoord4sv, const GLshort *, v); \
UnsupportedWrapper2(void, glRasterPos2d, GLdouble, x, GLdouble, y); \
UnsupportedWrapper2(void, glRasterPos2f, GLfloat, x, GLfloat, y); \
UnsupportedWrapper2(void, glRasterPos2i, GLint, x, GLint, y); \
UnsupportedWrapper2(void, glRasterPos2s, GLshort, x, GLshort, y); \
UnsupportedWrapper3(void, glRasterPos3d, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper3(void, glRasterPos3f, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glRasterPos3i, GLint, x, GLint, y, GLint, z); \
UnsupportedWrapper3(void, glRasterPos3s, GLshort, x, GLshort, y, GLshort, z); \
UnsupportedWrapper4(void, glRasterPos4d, GLdouble, x, GLdouble, y, GLdouble, z, GLdouble, w); \
UnsupportedWrapper4(void, glRasterPos4f, GLfloat, x, GLfloat, y, GLfloat, z, GLfloat, w); \
UnsupportedWrapper4(void, glRasterPos4i, GLint, x, GLint, y, GLint, z, GLint, w); \
UnsupportedWrapper4(void, glRasterPos4s, GLshort, x, GLshort, y, GLshort, z, GLshort, w); \
UnsupportedWrapper1(void, glRasterPos2dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glRasterPos2fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glRasterPos2iv, const GLint *, v); \
UnsupportedWrapper1(void, glRasterPos2sv, const GLshort *, v); \
UnsupportedWrapper1(void, glRasterPos3dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glRasterPos3fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glRasterPos3iv, const GLint *, v); \
UnsupportedWrapper1(void, glRasterPos3sv, const GLshort *, v); \
UnsupportedWrapper1(void, glRasterPos4dv, const GLdouble *, v); \
UnsupportedWrapper1(void, glRasterPos4fv, const GLfloat *, v); \
UnsupportedWrapper1(void, glRasterPos4iv, const GLint *, v); \
UnsupportedWrapper1(void, glRasterPos4sv, const GLshort *, v); \
UnsupportedWrapper4(void, glRectd, GLdouble, x1, GLdouble, y1, GLdouble, x2, GLdouble, y2); \
UnsupportedWrapper4(void, glRectf, GLfloat, x1, GLfloat, y1, GLfloat, x2, GLfloat, y2); \
UnsupportedWrapper4(void, glRecti, GLint, x1, GLint, y1, GLint, x2, GLint, y2); \
UnsupportedWrapper4(void, glRects, GLshort, x1, GLshort, y1, GLshort, x2, GLshort, y2); \
UnsupportedWrapper2(void, glRectdv, const GLdouble *, v1, const GLdouble *, v2); \
UnsupportedWrapper2(void, glRectfv, const GLfloat *, v1, const GLfloat *, v2); \
UnsupportedWrapper2(void, glRectiv, const GLint *, v1, const GLint *, v2); \
UnsupportedWrapper2(void, glRectsv, const GLshort *, v1, const GLshort *, v2); \
UnsupportedWrapper2(void, glPixelZoom, GLfloat, xfactor, GLfloat, yfactor); \
UnsupportedWrapper2(void, glPixelTransferf, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glPixelTransferi, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glPixelMapfv, GLenum, map, GLsizei, mapsize, const GLfloat *, values); \
UnsupportedWrapper3(void, glPixelMapuiv, GLenum, map, GLsizei, mapsize, const GLuint *, values); \
UnsupportedWrapper3(void, glPixelMapusv, GLenum, map, GLsizei, mapsize, const GLushort *, values); \
UnsupportedWrapper2(void, glGetPixelMapfv, GLenum, map, GLfloat *, values); \
UnsupportedWrapper2(void, glGetPixelMapuiv, GLenum, map, GLuint *, values); \
UnsupportedWrapper2(void, glGetPixelMapusv, GLenum, map, GLushort *, values); \
UnsupportedWrapper7(void, glBitmap, GLsizei, width, GLsizei, height, GLfloat, xorig, GLfloat, yorig, GLfloat, xmove, GLfloat, ymove, const GLubyte *, bitmap); \
UnsupportedWrapper5(void, glDrawPixels, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels); \
UnsupportedWrapper5(void, glCopyPixels, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, type); \
UnsupportedWrapper1(void, glShadeModel, GLenum, mode); \
UnsupportedWrapper3(void, glLightf, GLenum, light, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glLighti, GLenum, light, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glLightfv, GLenum, light, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glLightiv, GLenum, light, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glGetLightfv, GLenum, light, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetLightiv, GLenum, light, GLenum, pname, GLint *, params); \
UnsupportedWrapper2(void, glLightModelf, GLenum, pname, GLfloat, param); \
UnsupportedWrapper2(void, glLightModeli, GLenum, pname, GLint, param); \
UnsupportedWrapper2(void, glLightModelfv, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper2(void, glLightModeliv, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glMaterialf, GLenum, face, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glMateriali, GLenum, face, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glMaterialfv, GLenum, face, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glMaterialiv, GLenum, face, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glGetMaterialfv, GLenum, face, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetMaterialiv, GLenum, face, GLenum, pname, GLint *, params); \
UnsupportedWrapper2(void, glColorMaterial, GLenum, face, GLenum, mode); \
UnsupportedWrapper1(void, glClearIndex, GLfloat, c); \
UnsupportedWrapper1(void, glIndexMask, GLuint, mask); \
UnsupportedWrapper2(void, glAlphaFunc, GLenum, func, GLfloat, ref); \
UnsupportedWrapper2(void, glLineStipple, GLint, factor, GLushort, pattern); \
UnsupportedWrapper1(void, glPolygonStipple, const GLubyte *, mask); \
UnsupportedWrapper1(void, glGetPolygonStipple, GLubyte *, mask); \
UnsupportedWrapper1(void, glEdgeFlag, GLboolean, flag); \
UnsupportedWrapper1(void, glEdgeFlagv, const GLboolean *, flag); \
UnsupportedWrapper2(void, glClipPlane, GLenum, plane, const GLdouble *, equation); \
UnsupportedWrapper2(void, glGetClipPlane, GLenum, plane, GLdouble *, equation); \
UnsupportedWrapper1(void, glEnableClientState, GLenum, array); \
UnsupportedWrapper1(void, glDisableClientState, GLenum, array); \
UnsupportedWrapper1(void, glPushAttrib, GLbitfield, mask); \
UnsupportedWrapper0(void, glPopAttrib); \
UnsupportedWrapper1(void, glPushClientAttrib, GLbitfield, mask); \
UnsupportedWrapper0(void, glPopClientAttrib); \
UnsupportedWrapper1(GLint, glRenderMode, GLenum, mode); \
UnsupportedWrapper3(void, glTexGend, GLenum, coord, GLenum, pname, GLdouble, param); \
UnsupportedWrapper3(void, glTexGenf, GLenum, coord, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glTexGeni, GLenum, coord, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glTexGendv, GLenum, coord, GLenum, pname, const GLdouble *, params); \
UnsupportedWrapper3(void, glTexGenfv, GLenum, coord, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glTexGeniv, GLenum, coord, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glGetTexGendv, GLenum, coord, GLenum, pname, GLdouble *, params); \
UnsupportedWrapper3(void, glGetTexGenfv, GLenum, coord, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetTexGeniv, GLenum, coord, GLenum, pname, GLint *, params); \
UnsupportedWrapper3(void, glTexEnvf, GLenum, target, GLenum, pname, GLfloat, param); \
UnsupportedWrapper3(void, glTexEnvi, GLenum, target, GLenum, pname, GLint, param); \
UnsupportedWrapper3(void, glTexEnvfv, GLenum, target, GLenum, pname, const GLfloat *, params); \
UnsupportedWrapper3(void, glTexEnviv, GLenum, target, GLenum, pname, const GLint *, params); \
UnsupportedWrapper3(void, glGetTexEnvfv, GLenum, target, GLenum, pname, GLfloat *, params); \
UnsupportedWrapper3(void, glGetTexEnviv, GLenum, target, GLenum, pname, GLint *, params); \
UnsupportedWrapper1(void, glMatrixMode, GLenum, mode); \
UnsupportedWrapper6(void, glOrtho, GLdouble, left, GLdouble, right, GLdouble, bottom, GLdouble, top, GLdouble, zNear, GLdouble, zFar); \
UnsupportedWrapper6(void, glFrustum, GLdouble, left, GLdouble, right, GLdouble, bottom, GLdouble, top, GLdouble, zNear, GLdouble, zFar); \
UnsupportedWrapper0(void, glPushMatrix); \
UnsupportedWrapper0(void, glPopMatrix); \
UnsupportedWrapper0(void, glLoadIdentity); \
UnsupportedWrapper1(void, glLoadMatrixd, const GLdouble *, m); \
UnsupportedWrapper1(void, glLoadMatrixf, const GLfloat *, m); \
UnsupportedWrapper1(void, glMultMatrixd, const GLdouble *, m); \
UnsupportedWrapper1(void, glMultMatrixf, const GLfloat *, m); \
UnsupportedWrapper4(void, glRotated, GLdouble, angle, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper4(void, glRotatef, GLfloat, angle, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glScaled, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper3(void, glScalef, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper3(void, glTranslated, GLdouble, x, GLdouble, y, GLdouble, z); \
UnsupportedWrapper3(void, glTranslatef, GLfloat, x, GLfloat, y, GLfloat, z); \
UnsupportedWrapper4(void, glClearAccum, GLfloat, red, GLfloat, green, GLfloat, blue, GLfloat, alpha); \
UnsupportedWrapper2(void, glAccum, GLenum, op, GLfloat, value); \
UnsupportedWrapper4(void, glVertexPointer, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper3(void, glNormalPointer, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper4(void, glColorPointer, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper3(void, glIndexPointer, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper4(void, glTexCoordPointer, GLint, size, GLenum, type, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper2(void, glEdgeFlagPointer, GLsizei, stride, const void *, pointer); \
UnsupportedWrapper1(void, glArrayElement, GLint, i); \
UnsupportedWrapper3(void, glInterleavedArrays, GLenum, format, GLsizei, stride, const void *, pointer); \
// the _renderdoc_hooked variants are to make sure we always have a function symbol exported that we
// can return from GetProcAddress. On posix systems if another library (or the application itself)
// creates a symbol called 'glEnable' we'll return the address of that, and break badly. Instead we
// leave the 'naked' versions for applications trying to import those symbols, and declare the
// _renderdoc_hooked for returning as a func pointer. The raw version calls directly into the hooked
// version to hopefully allow the linker to tail-call optimise and reduce the overhead.
#define FuncWrapper0(ret, function) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)() \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, ); \
return glhook.driver->function(); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)() \
{ \
return CONCAT(function, _renderdoc_hooked)(); \
} \
HOOK_EXPORT ret HOOK_CC function();
#define AliasWrapper0(ret, function, realfunc) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)() \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, ); \
return glhook.driver->realfunc(); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)() \
{ \
return CONCAT(function, _renderdoc_hooked)(); \
} \
HOOK_EXPORT ret HOOK_CC function();
#define UnsupportedWrapper0(ret, function) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)() \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)() \
{ \
return CONCAT(function, _renderdoc_hooked)(); \
} \
HOOK_EXPORT ret HOOK_CC function();
#define FuncWrapper1(ret, function, t1, p1) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1); \
return glhook.driver->function(p1); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1);
#define AliasWrapper1(ret, function, realfunc, t1, p1) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1); \
return glhook.driver->realfunc(p1); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1);
#define UnsupportedWrapper1(ret, function, t1, p1) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1);
#define FuncWrapper2(ret, function, t1, p1, t2, p2) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2); \
return glhook.driver->function(p1, p2); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2);
#define AliasWrapper2(ret, function, realfunc, t1, p1, t2, p2) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2); \
return glhook.driver->realfunc(p1, p2); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2);
#define UnsupportedWrapper2(ret, function, t1, p1, t2, p2) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2);
#define FuncWrapper3(ret, function, t1, p1, t2, p2, t3, p3) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3); \
return glhook.driver->function(p1, p2, p3); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3);
#define AliasWrapper3(ret, function, realfunc, t1, p1, t2, p2, t3, p3) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3); \
return glhook.driver->realfunc(p1, p2, p3); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3);
#define UnsupportedWrapper3(ret, function, t1, p1, t2, p2, t3, p3) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3);
#define FuncWrapper4(ret, function, t1, p1, t2, p2, t3, p3, t4, p4) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4); \
return glhook.driver->function(p1, p2, p3, p4); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4);
#define AliasWrapper4(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4); \
return glhook.driver->realfunc(p1, p2, p3, p4); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4);
#define UnsupportedWrapper4(ret, function, t1, p1, t2, p2, t3, p3, t4, p4) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4);
#define FuncWrapper5(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5); \
return glhook.driver->function(p1, p2, p3, p4, p5); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5);
#define AliasWrapper5(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5);
#define UnsupportedWrapper5(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5);
#define FuncWrapper6(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6);
#define AliasWrapper6(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6);
#define UnsupportedWrapper6(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6);
#define FuncWrapper7(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7);
#define AliasWrapper7(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7);
#define UnsupportedWrapper7(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7);
#define FuncWrapper8(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8);
#define AliasWrapper8(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8);
#define UnsupportedWrapper8(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8);
#define FuncWrapper9(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9);
#define AliasWrapper9(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9);
#define UnsupportedWrapper9(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9);
#define FuncWrapper10(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10);
#define AliasWrapper10(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10);
#define UnsupportedWrapper10(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10);
#define FuncWrapper11(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11);
#define AliasWrapper11(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11);
#define UnsupportedWrapper11(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11);
#define FuncWrapper12(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12);
#define AliasWrapper12(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12);
#define UnsupportedWrapper12(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12);
#define FuncWrapper13(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13);
#define AliasWrapper13(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13);
#define UnsupportedWrapper13(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13);
#define FuncWrapper14(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14);
#define AliasWrapper14(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14);
#define UnsupportedWrapper14(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14);
#define FuncWrapper15(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15);
#define AliasWrapper15(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15);
#define UnsupportedWrapper15(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15);
#define FuncWrapper16(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15, t16, p16) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16);
#define AliasWrapper16(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15, t16, p16) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16);
#define UnsupportedWrapper16(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15, t16, p16) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16);
#define FuncWrapper17(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15, t16, p16, t17, p17) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(function, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
return glhook.driver->function(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17);
#define AliasWrapper17(ret, function, realfunc, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15, t16, p16, t17, p17) \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17) \
{ \
SCOPED_GLCALL(function); \
UNINIT_CALL(realfunc, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
return glhook.driver->realfunc(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17);
#define UnsupportedWrapper17(ret, function, t1, p1, t2, p2, t3, p3, t4, p4, t5, p5, t6, p6, t7, p7, t8, p8, t9, p9, t10, p10, t11, p11, t12, p12, t13, p13, t14, p14, t15, p15, t16, p16, t17, p17) \
typedef ret(HOOK_CC *CONCAT(function, _hooktype))(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17); \
CONCAT(function, _hooktype) CONCAT(unsupported_real_, function) = NULL; \
ret HOOK_CC CONCAT(function, _renderdoc_hooked)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17) \
{ \
static bool hit = false; \
if(hit == false) \
{ \
RDCERR("Function " STRINGIZE(function) " not supported - capture may be broken"); \
hit = true; \
} \
if(!CONCAT(unsupported_real_, function)) \
CONCAT(unsupported_real_, function) = \
(CONCAT(function, _hooktype))glhook.GetUnsupportedFunction(STRINGIZE(function)); \
return CONCAT(unsupported_real_, function)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
} \
HOOK_EXPORT ret HOOK_CC GL_EXPORT_NAME(function)(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17) \
{ \
return CONCAT(function, _renderdoc_hooked)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); \
} \
HOOK_EXPORT ret HOOK_CC function(t1 p1, t2 p2, t3 p3, t4 p4, t5 p5, t6 p6, t7 p7, t8 p8, t9 p9, t10 p10, t11 p11, t12 p12, t13 p13, t14 p14, t15 p15, t16 p16, t17 p17);
| 72.303205 | 344 | 0.761104 | [
"object",
"transform"
] |
36b7cce170234ba6d9f9b5913700461e0009ba3b | 2,713 | h | C | clang-tools-extra/clangd/ExpectedTypes.h | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | clang-tools-extra/clangd/ExpectedTypes.h | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | clang-tools-extra/clangd/ExpectedTypes.h | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | //===--- ExpectedTypes.h - Simplified C++ types -----------------*- C++-*--===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// A simplified model of C++ types that can be used to check whether they are
// convertible between each other for the purposes of code completion ranking
// without looking at the ASTs. Note that we don't aim to fully mimic the C++
// conversion rules, merely try to have a model that gives useful improvements
// to the code completion ranking.
//
// We define an encoding of AST types as opaque strings, which can be stored in
// the index. Similar types (such as `int` and `long`) are folded together,
// forming equivalence classes with the same encoding.
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_EXPECTED_TYPES_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_EXPECTED_TYPES_H
#include "clang/AST/Type.h"
#include "llvm/ADT/StringRef.h"
namespace clang {
class CodeCompletionResult;
namespace clangd {
/// A representation of a type that can be computed based on clang AST and
/// compared for equality. The encoding is stable between different ASTs, this
/// allows the representation to be stored in the index and compared with types
/// coming from a different AST later.
/// OpaqueType is a strongly-typedefed std::string, you can get the underlying
/// string with raw().
class OpaqueType {
public:
/// Create a type from a code completion result.
static llvm::Optional<OpaqueType>
fromCompletionResult(ASTContext &Ctx, const CodeCompletionResult &R);
/// Construct an instance from a clang::QualType. This is usually a
/// PreferredType from a clang's completion context.
static llvm::Optional<OpaqueType> fromType(ASTContext &Ctx, QualType Type);
/// Get the raw byte representation of the type. You can only rely on the
/// types being equal iff their raw representation is the same. The particular
/// details of the used encoding might change over time and one should not
/// rely on it.
llvm::StringRef raw() const { return Data; }
friend bool operator==(const OpaqueType &L, const OpaqueType &R) {
return L.Data == R.Data;
}
friend bool operator!=(const OpaqueType &L, const OpaqueType &R) {
return !(L == R);
}
private:
static llvm::Optional<OpaqueType> encode(ASTContext &Ctx, QualType Type);
explicit OpaqueType(std::string Data);
std::string Data;
};
} // namespace clangd
} // namespace clang
#endif
| 41.738462 | 80 | 0.691117 | [
"model"
] |
36b987e84059421a81565e9042b2078bf0b3a5e1 | 1,847 | h | C | mindspore/ccsrc/session/cpu_session.h | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | 1 | 2020-06-20T06:22:41.000Z | 2020-06-20T06:22:41.000Z | mindspore/ccsrc/session/cpu_session.h | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | null | null | null | mindspore/ccsrc/session/cpu_session.h | ZephyrChenzf/mindspore | 8f191847cf71e12715ced96bc3575914f980127a | [
"Apache-2.0"
] | null | null | null | /**
* Copyright 2019 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_CCSRC_SESSION_CPU_SESSION_H
#define MINDSPORE_CCSRC_SESSION_CPU_SESSION_H
#include <string>
#include <memory>
#include <vector>
#include "session/session_basic.h"
#include "session/kernel_graph.h"
#include "device/cpu/cpu_kernel_runtime.h"
#include "session/session_factory.h"
namespace mindspore {
namespace session {
class CPUSession : public SessionBasic {
public:
CPUSession() = default;
~CPUSession() override = default;
void Init(uint32_t device_id) override {
SessionBasic::Init(device_id);
context_ = std::make_shared<Context>(kCPUDevice, device_id);
}
GraphId CompileGraph(const AnfNodePtrList &lst, const AnfNodePtrList &outputs) override;
void RunGraph(const GraphId &graph_id, const std::vector<tensor::TensorPtr> &inputs, VectorRef *outputs) override;
protected:
ParameterPtr CreateNewParameterFromParameter(const AnfNodePtr &anf, bool valid_input, KernelGraph *graph) override;
private:
void SetKernelInfo(const KernelGraph *kernel_graph);
void BuildKernel(const KernelGraph *kernel_graph);
device::cpu::CPUKernelRuntime runtime_;
};
MS_REG_SESSION(kCPUDevice, CPUSession);
} // namespace session
} // namespace mindspore
#endif // MINDSPORE_CCSRC_SESSION_CPU_SESSION_H
| 36.94 | 117 | 0.77477 | [
"vector"
] |
36b9e43156d65d6f6d93e94122b1fc015650d5f9 | 2,843 | h | C | chrome/browser/metrics/perf/perf_output.h | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | chrome/browser/metrics/perf/perf_output.h | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 86 | 2015-10-21T13:02:42.000Z | 2022-03-14T07:50:50.000Z | chrome/browser/metrics/perf/perf_output.h | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_METRICS_PERF_PERF_OUTPUT_H_
#define CHROME_BROWSER_METRICS_PERF_PERF_OUTPUT_H_
#include <memory>
#include <string>
#include <vector>
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/pipe_reader.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace chromeos {
class DebugDaemonClient;
} // namespace chromeos
namespace metrics {
// Class for handling getting output from perf over DBus. Manages the
// asynchronous DBus call and retrieving data from quipper over a pipe.
class PerfOutputCall {
public:
// Called once GetPerfOutput() is complete, or an error occurred.
// The callback may delete this object.
// The argument is one of:
// - Output from "perf record", in PerfDataProto format, OR
// - The empty string if there was an error.
// The output is transferred to |perf_stdout|.
using DoneCallback = base::OnceCallback<void(std::string perf_stdout)>;
PerfOutputCall(chromeos::DebugDaemonClient* debug_daemon_client,
base::TimeDelta duration,
const std::vector<std::string>& perf_args,
DoneCallback callback);
PerfOutputCall(const PerfOutputCall&) = delete;
PerfOutputCall& operator=(const PerfOutputCall&) = delete;
virtual ~PerfOutputCall();
// Stop() is made virtual for mocks in testing.
virtual void Stop();
protected:
// Exposed for mocking in unit test.
PerfOutputCall();
private:
// Internal callbacks.
void OnIOComplete(absl::optional<std::string> data);
void OnGetPerfOutput(absl::optional<uint64_t> result);
void StopImpl();
// A non-retaining pointer to the DebugDaemonClient instance.
chromeos::DebugDaemonClient* debug_daemon_client_;
// Used to capture perf data written to a pipe.
std::unique_ptr<chromeos::PipeReader> perf_data_pipe_reader_;
// Saved arguments.
base::TimeDelta duration_;
std::vector<std::string> perf_args_;
DoneCallback done_callback_;
// Whether Stop() is called before OnGetPerfOutput() has returned the session
// ID. If true (meaning Stop() is called very soon after we request perf
// output), the stop request will be sent out after we have the session ID to
// stop the perf session.
bool pending_stop_;
absl::optional<uint64_t> perf_session_id_;
SEQUENCE_CHECKER(sequence_checker_);
// To pass around the "this" pointer across threads safely.
base::WeakPtrFactory<PerfOutputCall> weak_factory_{this};
};
} // namespace metrics
#endif // CHROME_BROWSER_METRICS_PERF_PERF_OUTPUT_H_
| 31.94382 | 79 | 0.745691 | [
"object",
"vector"
] |
36bc13fbec99dd04ace6ac247f3007ae23b19c31 | 3,831 | h | C | third_party/poco_1.5.3/Data/SQLite/include/Poco/Data/SQLite/SQLiteException.h | 0u812/roadrunner | f464c2649e388fa1f5a015592b0b29b65cc84b4b | [
"Apache-2.0"
] | 1 | 2015-10-20T09:48:14.000Z | 2015-10-20T09:48:14.000Z | Data/SQLite/include/Poco/Data/SQLite/SQLiteException.h | byteman/poco | f0f7f0fd3ce0ae3098de075a9c36bbd2f2ed0a13 | [
"BSL-1.0"
] | null | null | null | Data/SQLite/include/Poco/Data/SQLite/SQLiteException.h | byteman/poco | f0f7f0fd3ce0ae3098de075a9c36bbd2f2ed0a13 | [
"BSL-1.0"
] | 3 | 2018-01-17T02:09:24.000Z | 2019-11-16T23:55:53.000Z | //
// SQLiteException.h
//
// $Id: //poco/Main/Data/SQLite/include/Poco/Data/SQLite/SQLiteException.h#2 $
//
// Library: SQLite
// Package: SQLite
// Module: SQLiteException
//
// Definition of SQLiteException.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef SQLite_SQLiteException_INCLUDED
#define SQLite_SQLiteException_INCLUDED
#include "Poco/Data/SQLite/SQLite.h"
#include "Poco/Data/DataException.h"
namespace Poco {
namespace Data {
namespace SQLite {
POCO_DECLARE_EXCEPTION(SQLite_API, SQLiteException, Poco::Data::DataException)
POCO_DECLARE_EXCEPTION(SQLite_API, InvalidSQLStatementException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, InternalDBErrorException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, DBAccessDeniedException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, ExecutionAbortedException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, DBLockedException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, TableLockedException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, NoMemoryException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, ReadOnlyException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, InterruptException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, IOErrorException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, CorruptImageException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, TableNotFoundException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, DatabaseFullException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, CantOpenDBFileException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, LockProtocolException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, SchemaDiffersException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, RowTooBigException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, ConstraintViolationException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, DataTypeMismatchException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, ParameterCountMismatchException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, InvalidLibraryUseException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, OSFeaturesMissingException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, AuthorizationDeniedException, SQLiteException)
POCO_DECLARE_EXCEPTION(SQLite_API, TransactionException, SQLiteException)
} } } // namespace Poco::Data::SQLite
#endif
| 46.156627 | 84 | 0.83242 | [
"object"
] |
36bc42942e89e647dd219c566f9826b219e0410b | 24,764 | c | C | sources/drivers/gpio/gpio-mcp23s08.c | fuldaros/paperplane_kernel_wileyfox-spark | bea244880d2de50f4ad14bb6fa5777652232c033 | [
"Apache-2.0"
] | 2 | 2018-03-09T23:59:27.000Z | 2018-04-01T07:58:39.000Z | sources/drivers/gpio/gpio-mcp23s08.c | fuldaros/paperplane_kernel_wileyfox-spark | bea244880d2de50f4ad14bb6fa5777652232c033 | [
"Apache-2.0"
] | null | null | null | sources/drivers/gpio/gpio-mcp23s08.c | fuldaros/paperplane_kernel_wileyfox-spark | bea244880d2de50f4ad14bb6fa5777652232c033 | [
"Apache-2.0"
] | 3 | 2017-06-24T20:23:09.000Z | 2018-03-25T04:30:11.000Z | /*
* MCP23S08 SPI/I2C GPIO gpio expander driver
*
* The inputs and outputs of the mcp23s08, mcp23s17, mcp23008 and mcp23017 are
* supported.
* For the I2C versions of the chips (mcp23008 and mcp23017) generation of
* interrupts is also supported.
* The hardware of the SPI versions of the chips (mcp23s08 and mcp23s17) is
* also capable of generating interrupts, but the linux driver does not
* support that yet.
*/
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <linux/spi/mcp23s08.h>
#include <linux/slab.h>
#include <asm/byteorder.h>
#include <linux/interrupt.h>
#include <linux/of_irq.h>
#include <linux/of_device.h>
/**
* MCP types supported by driver
*/
#define MCP_TYPE_S08 0
#define MCP_TYPE_S17 1
#define MCP_TYPE_008 2
#define MCP_TYPE_017 3
/* Registers are all 8 bits wide.
*
* The mcp23s17 has twice as many bits, and can be configured to work
* with either 16 bit registers or with two adjacent 8 bit banks.
*/
#define MCP_IODIR 0x00 /* init/reset: all ones */
#define MCP_IPOL 0x01
#define MCP_GPINTEN 0x02
#define MCP_DEFVAL 0x03
#define MCP_INTCON 0x04
#define MCP_IOCON 0x05
# define IOCON_MIRROR (1 << 6)
# define IOCON_SEQOP (1 << 5)
# define IOCON_HAEN (1 << 3)
# define IOCON_ODR (1 << 2)
# define IOCON_INTPOL (1 << 1)
#define MCP_GPPU 0x06
#define MCP_INTF 0x07
#define MCP_INTCAP 0x08
#define MCP_GPIO 0x09
#define MCP_OLAT 0x0a
struct mcp23s08;
struct mcp23s08_ops {
int (*read)(struct mcp23s08 *mcp, unsigned reg);
int (*write)(struct mcp23s08 *mcp, unsigned reg, unsigned val);
int (*read_regs)(struct mcp23s08 *mcp, unsigned reg,
u16 *vals, unsigned n);
};
struct mcp23s08 {
u8 addr;
u16 cache[11];
u16 irq_rise;
u16 irq_fall;
int irq;
bool irq_controller;
/* lock protects the cached values */
struct mutex lock;
struct mutex irq_lock;
struct irq_domain *irq_domain;
struct gpio_chip chip;
const struct mcp23s08_ops *ops;
void *data; /* ops specific data */
};
/* A given spi_device can represent up to eight mcp23sxx chips
* sharing the same chipselect but using different addresses
* (e.g. chips #0 and #3 might be populated, but not #1 or $2).
* Driver data holds all the per-chip data.
*/
struct mcp23s08_driver_data {
unsigned ngpio;
struct mcp23s08 *mcp[8];
struct mcp23s08 chip[];
};
/* This lock class tells lockdep that GPIO irqs are in a different
* category than their parents, so it won't report false recursion.
*/
static struct lock_class_key gpio_lock_class;
/*----------------------------------------------------------------------*/
#if IS_ENABLED(CONFIG_I2C)
static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg)
{
return i2c_smbus_read_byte_data(mcp->data, reg);
}
static int mcp23008_write(struct mcp23s08 *mcp, unsigned reg, unsigned val)
{
return i2c_smbus_write_byte_data(mcp->data, reg, val);
}
static int
mcp23008_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
{
while (n--) {
int ret = mcp23008_read(mcp, reg++);
if (ret < 0)
return ret;
*vals++ = ret;
}
return 0;
}
static int mcp23017_read(struct mcp23s08 *mcp, unsigned reg)
{
return i2c_smbus_read_word_data(mcp->data, reg << 1);
}
static int mcp23017_write(struct mcp23s08 *mcp, unsigned reg, unsigned val)
{
return i2c_smbus_write_word_data(mcp->data, reg << 1, val);
}
static int
mcp23017_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
{
while (n--) {
int ret = mcp23017_read(mcp, reg++);
if (ret < 0)
return ret;
*vals++ = ret;
}
return 0;
}
static const struct mcp23s08_ops mcp23008_ops = {
.read = mcp23008_read,
.write = mcp23008_write,
.read_regs = mcp23008_read_regs,
};
static const struct mcp23s08_ops mcp23017_ops = {
.read = mcp23017_read,
.write = mcp23017_write,
.read_regs = mcp23017_read_regs,
};
#endif /* CONFIG_I2C */
/*----------------------------------------------------------------------*/
#ifdef CONFIG_SPI_MASTER
static int mcp23s08_read(struct mcp23s08 *mcp, unsigned reg)
{
u8 tx[2], rx[1];
int status;
tx[0] = mcp->addr | 0x01;
tx[1] = reg;
status = spi_write_then_read(mcp->data, tx, sizeof(tx), rx, sizeof(rx));
return (status < 0) ? status : rx[0];
}
static int mcp23s08_write(struct mcp23s08 *mcp, unsigned reg, unsigned val)
{
u8 tx[3];
tx[0] = mcp->addr;
tx[1] = reg;
tx[2] = val;
return spi_write_then_read(mcp->data, tx, sizeof(tx), NULL, 0);
}
static int
mcp23s08_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
{
u8 tx[2], *tmp;
int status;
if ((n + reg) > sizeof(mcp->cache))
return -EINVAL;
tx[0] = mcp->addr | 0x01;
tx[1] = reg;
tmp = (u8 *)vals;
status = spi_write_then_read(mcp->data, tx, sizeof(tx), tmp, n);
if (status >= 0) {
while (n--)
vals[n] = tmp[n]; /* expand to 16bit */
}
return status;
}
static int mcp23s17_read(struct mcp23s08 *mcp, unsigned reg)
{
u8 tx[2], rx[2];
int status;
tx[0] = mcp->addr | 0x01;
tx[1] = reg << 1;
status = spi_write_then_read(mcp->data, tx, sizeof(tx), rx, sizeof(rx));
return (status < 0) ? status : (rx[0] | (rx[1] << 8));
}
static int mcp23s17_write(struct mcp23s08 *mcp, unsigned reg, unsigned val)
{
u8 tx[4];
tx[0] = mcp->addr;
tx[1] = reg << 1;
tx[2] = val;
tx[3] = val >> 8;
return spi_write_then_read(mcp->data, tx, sizeof(tx), NULL, 0);
}
static int
mcp23s17_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n)
{
u8 tx[2];
int status;
if ((n + reg) > sizeof(mcp->cache))
return -EINVAL;
tx[0] = mcp->addr | 0x01;
tx[1] = reg << 1;
status = spi_write_then_read(mcp->data, tx, sizeof(tx),
(u8 *)vals, n * 2);
if (status >= 0) {
while (n--)
vals[n] = __le16_to_cpu((__le16)vals[n]);
}
return status;
}
static const struct mcp23s08_ops mcp23s08_ops = {
.read = mcp23s08_read,
.write = mcp23s08_write,
.read_regs = mcp23s08_read_regs,
};
static const struct mcp23s08_ops mcp23s17_ops = {
.read = mcp23s17_read,
.write = mcp23s17_write,
.read_regs = mcp23s17_read_regs,
};
#endif /* CONFIG_SPI_MASTER */
/*----------------------------------------------------------------------*/
static int mcp23s08_direction_input(struct gpio_chip *chip, unsigned offset)
{
struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip);
int status;
mutex_lock(&mcp->lock);
mcp->cache[MCP_IODIR] |= (1 << offset);
status = mcp->ops->write(mcp, MCP_IODIR, mcp->cache[MCP_IODIR]);
mutex_unlock(&mcp->lock);
return status;
}
static int mcp23s08_get(struct gpio_chip *chip, unsigned offset)
{
struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip);
int status;
mutex_lock(&mcp->lock);
/* REVISIT reading this clears any IRQ ... */
status = mcp->ops->read(mcp, MCP_GPIO);
if (status < 0)
status = 0;
else {
mcp->cache[MCP_GPIO] = status;
status = !!(status & (1 << offset));
}
mutex_unlock(&mcp->lock);
return status;
}
static int __mcp23s08_set(struct mcp23s08 *mcp, unsigned mask, int value)
{
unsigned olat = mcp->cache[MCP_OLAT];
if (value)
olat |= mask;
else
olat &= ~mask;
mcp->cache[MCP_OLAT] = olat;
return mcp->ops->write(mcp, MCP_OLAT, olat);
}
static void mcp23s08_set(struct gpio_chip *chip, unsigned offset, int value)
{
struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip);
unsigned mask = 1 << offset;
mutex_lock(&mcp->lock);
__mcp23s08_set(mcp, mask, value);
mutex_unlock(&mcp->lock);
}
static int
mcp23s08_direction_output(struct gpio_chip *chip, unsigned offset, int value)
{
struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip);
unsigned mask = 1 << offset;
int status;
mutex_lock(&mcp->lock);
status = __mcp23s08_set(mcp, mask, value);
if (status == 0) {
mcp->cache[MCP_IODIR] &= ~mask;
status = mcp->ops->write(mcp, MCP_IODIR, mcp->cache[MCP_IODIR]);
}
mutex_unlock(&mcp->lock);
return status;
}
/*----------------------------------------------------------------------*/
static irqreturn_t mcp23s08_irq(int irq, void *data)
{
struct mcp23s08 *mcp = data;
int intcap, intf, i;
unsigned int child_irq;
mutex_lock(&mcp->lock);
intf = mcp->ops->read(mcp, MCP_INTF);
if (intf < 0) {
mutex_unlock(&mcp->lock);
return IRQ_HANDLED;
}
mcp->cache[MCP_INTF] = intf;
intcap = mcp->ops->read(mcp, MCP_INTCAP);
if (intcap < 0) {
mutex_unlock(&mcp->lock);
return IRQ_HANDLED;
}
mcp->cache[MCP_INTCAP] = intcap;
mutex_unlock(&mcp->lock);
for (i = 0; i < mcp->chip.ngpio; i++) {
if ((BIT(i) & mcp->cache[MCP_INTF]) &&
((BIT(i) & intcap & mcp->irq_rise) ||
(mcp->irq_fall & ~intcap & BIT(i)))) {
child_irq = irq_find_mapping(mcp->irq_domain, i);
handle_nested_irq(child_irq);
}
}
return IRQ_HANDLED;
}
static int mcp23s08_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip);
return irq_find_mapping(mcp->irq_domain, offset);
}
static void mcp23s08_irq_mask(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
unsigned int pos = data->hwirq;
mcp->cache[MCP_GPINTEN] &= ~BIT(pos);
}
static void mcp23s08_irq_unmask(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
unsigned int pos = data->hwirq;
mcp->cache[MCP_GPINTEN] |= BIT(pos);
}
static int mcp23s08_irq_set_type(struct irq_data *data, unsigned int type)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
unsigned int pos = data->hwirq;
int status = 0;
if ((type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) {
mcp->cache[MCP_INTCON] &= ~BIT(pos);
mcp->irq_rise |= BIT(pos);
mcp->irq_fall |= BIT(pos);
} else if (type & IRQ_TYPE_EDGE_RISING) {
mcp->cache[MCP_INTCON] &= ~BIT(pos);
mcp->irq_rise |= BIT(pos);
mcp->irq_fall &= ~BIT(pos);
} else if (type & IRQ_TYPE_EDGE_FALLING) {
mcp->cache[MCP_INTCON] &= ~BIT(pos);
mcp->irq_rise &= ~BIT(pos);
mcp->irq_fall |= BIT(pos);
} else
return -EINVAL;
return status;
}
static void mcp23s08_irq_bus_lock(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
mutex_lock(&mcp->irq_lock);
}
static void mcp23s08_irq_bus_unlock(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
mutex_lock(&mcp->lock);
mcp->ops->write(mcp, MCP_GPINTEN, mcp->cache[MCP_GPINTEN]);
mcp->ops->write(mcp, MCP_DEFVAL, mcp->cache[MCP_DEFVAL]);
mcp->ops->write(mcp, MCP_INTCON, mcp->cache[MCP_INTCON]);
mutex_unlock(&mcp->lock);
mutex_unlock(&mcp->irq_lock);
}
static int mcp23s08_irq_reqres(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
if (gpio_lock_as_irq(&mcp->chip, data->hwirq)) {
dev_err(mcp->chip.dev,
"unable to lock HW IRQ %lu for IRQ usage\n",
data->hwirq);
return -EINVAL;
}
return 0;
}
static void mcp23s08_irq_relres(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
gpio_unlock_as_irq(&mcp->chip, data->hwirq);
}
static struct irq_chip mcp23s08_irq_chip = {
.name = "gpio-mcp23xxx",
.irq_mask = mcp23s08_irq_mask,
.irq_unmask = mcp23s08_irq_unmask,
.irq_set_type = mcp23s08_irq_set_type,
.irq_bus_lock = mcp23s08_irq_bus_lock,
.irq_bus_sync_unlock = mcp23s08_irq_bus_unlock,
.irq_request_resources = mcp23s08_irq_reqres,
.irq_release_resources = mcp23s08_irq_relres,
};
static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
{
struct gpio_chip *chip = &mcp->chip;
int err, irq, j;
mutex_init(&mcp->irq_lock);
mcp->irq_domain = irq_domain_add_linear(chip->dev->of_node, chip->ngpio,
&irq_domain_simple_ops, mcp);
if (!mcp->irq_domain)
return -ENODEV;
err = devm_request_threaded_irq(chip->dev, mcp->irq, NULL, mcp23s08_irq,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
dev_name(chip->dev), mcp);
if (err != 0) {
dev_err(chip->dev, "unable to request IRQ#%d: %d\n",
mcp->irq, err);
return err;
}
chip->to_irq = mcp23s08_gpio_to_irq;
for (j = 0; j < mcp->chip.ngpio; j++) {
irq = irq_create_mapping(mcp->irq_domain, j);
irq_set_lockdep_class(irq, &gpio_lock_class);
irq_set_chip_data(irq, mcp);
irq_set_chip(irq, &mcp23s08_irq_chip);
irq_set_nested_thread(irq, true);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
irq_set_noprobe(irq);
#endif
}
return 0;
}
static void mcp23s08_irq_teardown(struct mcp23s08 *mcp)
{
unsigned int irq, i;
free_irq(mcp->irq, mcp);
for (i = 0; i < mcp->chip.ngpio; i++) {
irq = irq_find_mapping(mcp->irq_domain, i);
if (irq > 0)
irq_dispose_mapping(irq);
}
irq_domain_remove(mcp->irq_domain);
}
/*----------------------------------------------------------------------*/
#ifdef CONFIG_DEBUG_FS
#include <linux/seq_file.h>
/*
* This shows more info than the generic gpio dump code:
* pullups, deglitching, open drain drive.
*/
static void mcp23s08_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{
struct mcp23s08 *mcp;
char bank;
int t;
unsigned mask;
mcp = container_of(chip, struct mcp23s08, chip);
/* NOTE: we only handle one bank for now ... */
bank = '0' + ((mcp->addr >> 1) & 0x7);
mutex_lock(&mcp->lock);
t = mcp->ops->read_regs(mcp, 0, mcp->cache, ARRAY_SIZE(mcp->cache));
if (t < 0) {
seq_printf(s, " I/O ERROR %d\n", t);
goto done;
}
for (t = 0, mask = 1; t < chip->ngpio; t++, mask <<= 1) {
const char *label;
label = gpiochip_is_requested(chip, t);
if (!label)
continue;
seq_printf(s, " gpio-%-3d P%c.%d (%-12s) %s %s %s",
chip->base + t, bank, t, label,
(mcp->cache[MCP_IODIR] & mask) ? "in " : "out",
(mcp->cache[MCP_GPIO] & mask) ? "hi" : "lo",
(mcp->cache[MCP_GPPU] & mask) ? "up" : " ");
/* NOTE: ignoring the irq-related registers */
seq_puts(s, "\n");
}
done:
mutex_unlock(&mcp->lock);
}
#else
#define mcp23s08_dbg_show NULL
#endif
/*----------------------------------------------------------------------*/
static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
void *data, unsigned addr, unsigned type,
struct mcp23s08_platform_data *pdata, int cs)
{
int status;
bool mirror = false;
mutex_init(&mcp->lock);
mcp->data = data;
mcp->addr = addr;
mcp->chip.direction_input = mcp23s08_direction_input;
mcp->chip.get = mcp23s08_get;
mcp->chip.direction_output = mcp23s08_direction_output;
mcp->chip.set = mcp23s08_set;
mcp->chip.dbg_show = mcp23s08_dbg_show;
#ifdef CONFIG_OF
mcp->chip.of_gpio_n_cells = 2;
mcp->chip.of_node = dev->of_node;
#endif
switch (type) {
#ifdef CONFIG_SPI_MASTER
case MCP_TYPE_S08:
mcp->ops = &mcp23s08_ops;
mcp->chip.ngpio = 8;
mcp->chip.label = "mcp23s08";
break;
case MCP_TYPE_S17:
mcp->ops = &mcp23s17_ops;
mcp->chip.ngpio = 16;
mcp->chip.label = "mcp23s17";
break;
#endif /* CONFIG_SPI_MASTER */
#if IS_ENABLED(CONFIG_I2C)
case MCP_TYPE_008:
mcp->ops = &mcp23008_ops;
mcp->chip.ngpio = 8;
mcp->chip.label = "mcp23008";
break;
case MCP_TYPE_017:
mcp->ops = &mcp23017_ops;
mcp->chip.ngpio = 16;
mcp->chip.label = "mcp23017";
break;
#endif /* CONFIG_I2C */
default:
dev_err(dev, "invalid device type (%d)\n", type);
return -EINVAL;
}
mcp->chip.base = pdata->base;
mcp->chip.can_sleep = true;
mcp->chip.dev = dev;
mcp->chip.owner = THIS_MODULE;
/* verify MCP_IOCON.SEQOP = 0, so sequential reads work,
* and MCP_IOCON.HAEN = 1, so we work with all chips.
*/
status = mcp->ops->read(mcp, MCP_IOCON);
if (status < 0)
goto fail;
mcp->irq_controller = pdata->irq_controller;
if (mcp->irq && mcp->irq_controller && (type == MCP_TYPE_017))
mirror = pdata->mirror;
if ((status & IOCON_SEQOP) || !(status & IOCON_HAEN) || mirror) {
/* mcp23s17 has IOCON twice, make sure they are in sync */
status &= ~(IOCON_SEQOP | (IOCON_SEQOP << 8));
status |= IOCON_HAEN | (IOCON_HAEN << 8);
status &= ~(IOCON_INTPOL | (IOCON_INTPOL << 8));
if (mirror)
status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
status = mcp->ops->write(mcp, MCP_IOCON, status);
if (status < 0)
goto fail;
}
/* configure ~100K pullups */
status = mcp->ops->write(mcp, MCP_GPPU, pdata->chip[cs].pullups);
if (status < 0)
goto fail;
status = mcp->ops->read_regs(mcp, 0, mcp->cache, ARRAY_SIZE(mcp->cache));
if (status < 0)
goto fail;
/* disable inverter on input */
if (mcp->cache[MCP_IPOL] != 0) {
mcp->cache[MCP_IPOL] = 0;
status = mcp->ops->write(mcp, MCP_IPOL, 0);
if (status < 0)
goto fail;
}
/* disable irqs */
if (mcp->cache[MCP_GPINTEN] != 0) {
mcp->cache[MCP_GPINTEN] = 0;
status = mcp->ops->write(mcp, MCP_GPINTEN, 0);
if (status < 0)
goto fail;
}
status = gpiochip_add(&mcp->chip);
if (status < 0)
goto fail;
if (mcp->irq && mcp->irq_controller) {
status = mcp23s08_irq_setup(mcp);
if (status) {
mcp23s08_irq_teardown(mcp);
goto fail;
}
}
fail:
if (status < 0)
dev_dbg(dev, "can't setup chip %d, --> %d\n",
addr, status);
return status;
}
/*----------------------------------------------------------------------*/
#ifdef CONFIG_OF
#ifdef CONFIG_SPI_MASTER
static const struct of_device_id mcp23s08_spi_of_match[] = {
{
.compatible = "microchip,mcp23s08",
.data = (void *) MCP_TYPE_S08,
},
{
.compatible = "microchip,mcp23s17",
.data = (void *) MCP_TYPE_S17,
},
/* NOTE: The use of the mcp prefix is deprecated and will be removed. */
{
.compatible = "mcp,mcp23s08",
.data = (void *) MCP_TYPE_S08,
},
{
.compatible = "mcp,mcp23s17",
.data = (void *) MCP_TYPE_S17,
},
{ },
};
MODULE_DEVICE_TABLE(of, mcp23s08_spi_of_match);
#endif
#if IS_ENABLED(CONFIG_I2C)
static const struct of_device_id mcp23s08_i2c_of_match[] = {
{
.compatible = "microchip,mcp23008",
.data = (void *) MCP_TYPE_008,
},
{
.compatible = "microchip,mcp23017",
.data = (void *) MCP_TYPE_017,
},
/* NOTE: The use of the mcp prefix is deprecated and will be removed. */
{
.compatible = "mcp,mcp23008",
.data = (void *) MCP_TYPE_008,
},
{
.compatible = "mcp,mcp23017",
.data = (void *) MCP_TYPE_017,
},
{ },
};
MODULE_DEVICE_TABLE(of, mcp23s08_i2c_of_match);
#endif
#endif /* CONFIG_OF */
#if IS_ENABLED(CONFIG_I2C)
static int mcp230xx_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct mcp23s08_platform_data *pdata, local_pdata;
struct mcp23s08 *mcp;
int status;
const struct of_device_id *match;
match = of_match_device(of_match_ptr(mcp23s08_i2c_of_match),
&client->dev);
if (match) {
pdata = &local_pdata;
pdata->base = -1;
pdata->chip[0].pullups = 0;
pdata->irq_controller = of_property_read_bool(
client->dev.of_node,
"interrupt-controller");
pdata->mirror = of_property_read_bool(client->dev.of_node,
"microchip,irq-mirror");
client->irq = irq_of_parse_and_map(client->dev.of_node, 0);
} else {
pdata = dev_get_platdata(&client->dev);
if (!pdata) {
pdata = devm_kzalloc(&client->dev,
sizeof(struct mcp23s08_platform_data),
GFP_KERNEL);
pdata->base = -1;
}
}
mcp = kzalloc(sizeof(*mcp), GFP_KERNEL);
if (!mcp)
return -ENOMEM;
mcp->irq = client->irq;
status = mcp23s08_probe_one(mcp, &client->dev, client, client->addr,
id->driver_data, pdata, 0);
if (status)
goto fail;
i2c_set_clientdata(client, mcp);
return 0;
fail:
kfree(mcp);
return status;
}
static int mcp230xx_remove(struct i2c_client *client)
{
struct mcp23s08 *mcp = i2c_get_clientdata(client);
if (client->irq && mcp->irq_controller)
mcp23s08_irq_teardown(mcp);
gpiochip_remove(&mcp->chip);
kfree(mcp);
return 0;
}
static const struct i2c_device_id mcp230xx_id[] = {
{ "mcp23008", MCP_TYPE_008 },
{ "mcp23017", MCP_TYPE_017 },
{ },
};
MODULE_DEVICE_TABLE(i2c, mcp230xx_id);
static struct i2c_driver mcp230xx_driver = {
.driver = {
.name = "mcp230xx",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(mcp23s08_i2c_of_match),
},
.probe = mcp230xx_probe,
.remove = mcp230xx_remove,
.id_table = mcp230xx_id,
};
static int __init mcp23s08_i2c_init(void)
{
return i2c_add_driver(&mcp230xx_driver);
}
static void mcp23s08_i2c_exit(void)
{
i2c_del_driver(&mcp230xx_driver);
}
#else
static int __init mcp23s08_i2c_init(void) { return 0; }
static void mcp23s08_i2c_exit(void) { }
#endif /* CONFIG_I2C */
/*----------------------------------------------------------------------*/
#ifdef CONFIG_SPI_MASTER
static int mcp23s08_probe(struct spi_device *spi)
{
struct mcp23s08_platform_data *pdata, local_pdata;
unsigned addr;
int chips = 0;
struct mcp23s08_driver_data *data;
int status, type;
unsigned ngpio = 0;
const struct of_device_id *match;
u32 spi_present_mask = 0;
match = of_match_device(of_match_ptr(mcp23s08_spi_of_match), &spi->dev);
if (match) {
type = (int)(uintptr_t)match->data;
status = of_property_read_u32(spi->dev.of_node,
"microchip,spi-present-mask", &spi_present_mask);
if (status) {
status = of_property_read_u32(spi->dev.of_node,
"mcp,spi-present-mask", &spi_present_mask);
if (status) {
dev_err(&spi->dev,
"DT has no spi-present-mask\n");
return -ENODEV;
}
}
if ((spi_present_mask <= 0) || (spi_present_mask >= 256)) {
dev_err(&spi->dev, "invalid spi-present-mask\n");
return -ENODEV;
}
pdata = &local_pdata;
pdata->base = -1;
for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) {
pdata->chip[addr].pullups = 0;
if (spi_present_mask & (1 << addr))
chips++;
}
pdata->irq_controller = of_property_read_bool(
spi->dev.of_node,
"interrupt-controller");
pdata->mirror = of_property_read_bool(spi->dev.of_node,
"microchip,irq-mirror");
} else {
type = spi_get_device_id(spi)->driver_data;
pdata = dev_get_platdata(&spi->dev);
if (!pdata) {
pdata = devm_kzalloc(&spi->dev,
sizeof(struct mcp23s08_platform_data),
GFP_KERNEL);
pdata->base = -1;
}
for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) {
if (!pdata->chip[addr].is_present)
continue;
chips++;
if ((type == MCP_TYPE_S08) && (addr > 3)) {
dev_err(&spi->dev,
"mcp23s08 only supports address 0..3\n");
return -EINVAL;
}
spi_present_mask |= 1 << addr;
}
}
if (!chips)
return -ENODEV;
data = kzalloc(sizeof(*data) + chips * sizeof(struct mcp23s08),
GFP_KERNEL);
if (!data)
return -ENOMEM;
spi_set_drvdata(spi, data);
for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) {
if (!(spi_present_mask & (1 << addr)))
continue;
chips--;
data->mcp[addr] = &data->chip[chips];
status = mcp23s08_probe_one(data->mcp[addr], &spi->dev, spi,
0x40 | (addr << 1), type, pdata,
addr);
if (status < 0)
goto fail;
if (pdata->base != -1)
pdata->base += (type == MCP_TYPE_S17) ? 16 : 8;
ngpio += (type == MCP_TYPE_S17) ? 16 : 8;
}
data->ngpio = ngpio;
/* NOTE: these chips have a relatively sane IRQ framework, with
* per-signal masking and level/edge triggering. It's not yet
* handled here...
*/
return 0;
fail:
for (addr = 0; addr < ARRAY_SIZE(data->mcp); addr++) {
if (!data->mcp[addr])
continue;
gpiochip_remove(&data->mcp[addr]->chip);
}
kfree(data);
return status;
}
static int mcp23s08_remove(struct spi_device *spi)
{
struct mcp23s08_driver_data *data = spi_get_drvdata(spi);
unsigned addr;
for (addr = 0; addr < ARRAY_SIZE(data->mcp); addr++) {
if (!data->mcp[addr])
continue;
gpiochip_remove(&data->mcp[addr]->chip);
}
kfree(data);
return 0;
}
static const struct spi_device_id mcp23s08_ids[] = {
{ "mcp23s08", MCP_TYPE_S08 },
{ "mcp23s17", MCP_TYPE_S17 },
{ },
};
MODULE_DEVICE_TABLE(spi, mcp23s08_ids);
static struct spi_driver mcp23s08_driver = {
.probe = mcp23s08_probe,
.remove = mcp23s08_remove,
.id_table = mcp23s08_ids,
.driver = {
.name = "mcp23s08",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(mcp23s08_spi_of_match),
},
};
static int __init mcp23s08_spi_init(void)
{
return spi_register_driver(&mcp23s08_driver);
}
static void mcp23s08_spi_exit(void)
{
spi_unregister_driver(&mcp23s08_driver);
}
#else
static int __init mcp23s08_spi_init(void) { return 0; }
static void mcp23s08_spi_exit(void) { }
#endif /* CONFIG_SPI_MASTER */
/*----------------------------------------------------------------------*/
static int __init mcp23s08_init(void)
{
int ret;
ret = mcp23s08_spi_init();
if (ret)
goto spi_fail;
ret = mcp23s08_i2c_init();
if (ret)
goto i2c_fail;
return 0;
i2c_fail:
mcp23s08_spi_exit();
spi_fail:
return ret;
}
/* register after spi/i2c postcore initcall and before
* subsys initcalls that may rely on these GPIOs
*/
subsys_initcall(mcp23s08_init);
static void __exit mcp23s08_exit(void)
{
mcp23s08_spi_exit();
mcp23s08_i2c_exit();
}
module_exit(mcp23s08_exit);
MODULE_LICENSE("GPL");
| 23.318267 | 78 | 0.66205 | [
"3d"
] |
36bcf79d549b5ceae360a4a6257936d0fc266092 | 2,814 | c | C | mode/mode.c | bepiis/zedcrypt | 6c808831d7bee500264a312fac9e93425bd861b0 | [
"MIT"
] | null | null | null | mode/mode.c | bepiis/zedcrypt | 6c808831d7bee500264a312fac9e93425bd861b0 | [
"MIT"
] | null | null | null | mode/mode.c | bepiis/zedcrypt | 6c808831d7bee500264a312fac9e93425bd861b0 | [
"MIT"
] | null | null | null | //
// Created by SC 2135-047 on 7/1/21.
//
#include "mode.h"
// ECB and CBC, total bits in plaintext must be multiple of block size b ie. n*b
// For AES block size is 128 bits, so bits_total mod 16 must be 0
// CFB, total bits in plaintext must be multiple of parameter s, where s does not exceed the block size
/*
OFB, CTR plaintext doesnt need to be multiple of block size. Instead if n and u are a pair of unique
unsigned integers s.t. the total number of bits of plaintext is (n-1)b + u where 1 <= u <= b.
Plaintext conists of n bit strings with a bit length of the block size and the last bit string u is
not and thus may not complete a block
*/
// CFB, CBC and OFB use an initialization vector (IV) as a cipher block. Used in initial step of
// encryption and decryption
// For CBC and CFB, IV must be unpredictable
// For OFB, unique IVs are needed for each execution of encryption process
// ECB encryption: C_j = CIPH_k(P_j)
// ECB decryption: P_j = CIPH^-1_k(C_j)
// both for j = 1 to n
/// @return -1: msg length is larger than block size
/// @return -2: msg length is equal to block size. Add padded block to end of msg array
/// @return 0: msg was padded
int pad_msg(byte msg[], byte msg_len, byte blk_size){
byte idx = msg_len;
byte left;
if((left = blk_size - msg_len) < 0){
return -1;
} else if(left == 0){
return -2;
}
msg[idx++] = 0x80;
for(; idx < blk_size; idx++){
msg[idx] = 0x0;
}
return 0;
}
// dblblk[] needs to be 2*blk_size ie. the contents of the last two blocks
byte *unpad_msg(const byte dblblk[], byte blk_size, byte num_blks, int *ret_len){
byte *ret, it, fnd;
it = 2 * blk_size - 1;
fnd = -1;
while(it >= 0){
if(dblblk[it] == 0x1){
fnd = it;
break;
}
it--;
}
if(fnd < 0){
*ret_len = -1;
return NULL;
}
ret = malloc(fnd);
memcpy(ret, dblblk, fnd);
*ret_len = fnd;
return ret;
}
byte *get_padded_blk(byte blk_size){
}
void mode_init(state st, lword totlen, byte blk_size, byte key_size, void (*fp)(byte[], byte[], const byte[])){
st->mlen = 0;
st->tlen = 0;
st->fp = fp;
//TODO: free
st->blk = malloc(blk_size);
st->ciph = malloc(blk_size);
st->out = malloc(totlen);
st->key = malloc(key_size);
}
void mode_update(state st, const byte msg[], lword mlen, byte blk_size){
for(unsigned i=0; i < mlen; i++){
st->blk[st->mlen++] = msg[i];
if(st->mlen == blk_size){
st->fp(st->blk, st->ciph, st->key);
st->tlen += blk_size;
for(unsigned c=st->tlen - blk_size, h=0; h < blk_size; c++, h++){
st->out[c] = st->ciph[h];
}
st->mlen = 0;
}
}
}
| 25.125 | 111 | 0.587775 | [
"vector"
] |
36bd243a64183e6e6b34fd91e4f4bb890644f053 | 3,529 | h | C | src/scripting/operators/export_selection_of_contacts.h | kliment-olechnovic/voronota | 4e3063aa86b44f1f2e7b088ec9976f3e12047549 | [
"MIT"
] | 9 | 2019-08-23T10:46:18.000Z | 2022-03-11T12:20:27.000Z | src/scripting/operators/export_selection_of_contacts.h | kliment-olechnovic/voronota | 4e3063aa86b44f1f2e7b088ec9976f3e12047549 | [
"MIT"
] | null | null | null | src/scripting/operators/export_selection_of_contacts.h | kliment-olechnovic/voronota | 4e3063aa86b44f1f2e7b088ec9976f3e12047549 | [
"MIT"
] | 3 | 2020-09-17T19:07:47.000Z | 2021-04-29T01:19:38.000Z | #ifndef SCRIPTING_OPERATORS_EXPORT_SELECTION_OF_CONTACTS_H_
#define SCRIPTING_OPERATORS_EXPORT_SELECTION_OF_CONTACTS_H_
#include "../operators_common.h"
namespace voronota
{
namespace scripting
{
namespace operators
{
class ExportSelectionOfContacts : public OperatorBase<ExportSelectionOfContacts>
{
public:
struct Result : public OperatorResultBase<Result>
{
std::string file;
std::string dump;
SummaryOfContacts contacts_summary;
std::size_t number_of_descriptors_written;
Result() : number_of_descriptors_written(0)
{
}
void store(HeterogeneousStorage& heterostorage) const
{
heterostorage.variant_object.value("file")=file;
if(!dump.empty())
{
heterostorage.variant_object.value("dump")=dump;
}
VariantSerialization::write(contacts_summary, heterostorage.variant_object.object("contacts_summary"));
heterostorage.variant_object.value("number_of_descriptors_written")=number_of_descriptors_written;
}
};
std::string file;
SelectionManager::Query parameters_for_selecting;
bool no_serial;
bool no_name;
bool no_resSeq;
bool no_resName;
ExportSelectionOfContacts() : no_serial(false), no_name(false), no_resSeq(false), no_resName(false)
{
}
void initialize(CommandInput& input)
{
file=input.get_value_or_first_unused_unnamed_value("file");
assert_file_name_input(file, false);
parameters_for_selecting=OperatorsUtilities::read_generic_selecting_query(input);
no_serial=input.get_flag("no-serial");
no_name=input.get_flag("no-name");
no_resSeq=input.get_flag("no-resSeq");
no_resName=input.get_flag("no-resName");
}
void document(CommandDocumentation& doc) const
{
doc.set_option_decription(CDOD("file", CDOD::DATATYPE_STRING, "path to file"));
OperatorsUtilities::document_read_generic_selecting_query(doc);
doc.set_option_decription(CDOD("no-serial", CDOD::DATATYPE_BOOL, "flag to exclude atom serials"));
doc.set_option_decription(CDOD("no-name", CDOD::DATATYPE_BOOL, "flag to exclude atom names"));
doc.set_option_decription(CDOD("no-resSeq", CDOD::DATATYPE_BOOL, "flag to exclude residue sequence numbers"));
doc.set_option_decription(CDOD("no-resName", CDOD::DATATYPE_BOOL, "flag to exclude residue names"));
}
Result run(DataManager& data_manager) const
{
data_manager.assert_contacts_availability();
assert_file_name_input(file, false);
const std::set<std::size_t> ids=data_manager.selection_manager().select_contacts(parameters_for_selecting);
if(ids.empty())
{
throw std::runtime_error(std::string("No contacts selected."));
}
OutputSelector output_selector(file);
std::ostream& output=output_selector.stream();
assert_io_stream(file, output);
std::set<common::ChainResidueAtomDescriptorsPair> set_of_crads_pairs;
for(std::set<std::size_t>::const_iterator it=ids.begin();it!=ids.end();++it)
{
set_of_crads_pairs.insert(
common::ConversionOfDescriptors::get_contact_descriptor(
data_manager.atoms(), data_manager.contacts()[*it]).without_some_info(
no_serial, no_name, no_resSeq, no_resName));
}
auxiliaries::IOUtilities().write_set(set_of_crads_pairs, output);
Result result;
result.file=file;
if(output_selector.location_type()==OutputSelector::TEMPORARY_MEMORY)
{
result.dump=output_selector.str();
}
result.contacts_summary=SummaryOfContacts(data_manager.contacts(), ids);
result.number_of_descriptors_written=set_of_crads_pairs.size();
return result;
}
};
}
}
}
#endif /* SCRIPTING_OPERATORS_EXPORT_SELECTION_OF_CONTACTS_H_ */
| 29.165289 | 112 | 0.771607 | [
"object"
] |
36c14ca71fc199bb6accc65f23bf760a963ca4e8 | 7,734 | h | C | src/mongo/db/commands.h | citsoft/mongo | 5f949c19a26099320f1040e875b3841d4a362b26 | [
"Apache-2.0"
] | 1 | 2015-12-19T08:02:37.000Z | 2015-12-19T08:02:37.000Z | src/mongo/db/commands.h | citsoft/mongo | 5f949c19a26099320f1040e875b3841d4a362b26 | [
"Apache-2.0"
] | null | null | null | src/mongo/db/commands.h | citsoft/mongo | 5f949c19a26099320f1040e875b3841d4a362b26 | [
"Apache-2.0"
] | null | null | null | // commands.h
/* Copyright 2009 10gen Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <vector>
#include "mongo/db/auth/privilege.h"
#include "mongo/db/client_basic.h"
#include "mongo/db/jsobj.h"
namespace mongo {
class BSONObj;
class BSONObjBuilder;
class Client;
class Timer;
/** mongodb "commands" (sent via db.$cmd.findOne(...))
subclass to make a command. define a singleton object for it.
*/
class Command {
protected:
string parseNsFullyQualified(const string& dbname, const BSONObj& cmdObj) const;
public:
// only makes sense for commands where 1st parm is the collection.
virtual string parseNs(const string& dbname, const BSONObj& cmdObj) const;
// warning: isAuthorized uses the lockType() return values, and values are being passed
// around as ints so be careful as it isn't really typesafe and will need cleanup later
enum LockType { READ = -1 , NONE = 0 , WRITE = 1 };
const string name;
/* run the given command
implement this...
fromRepl - command is being invoked as part of replication syncing. In this situation you
normally do not want to log the command to the local oplog.
return value is true if succeeded. if false, set errmsg text.
*/
virtual bool run(const string& db, BSONObj& cmdObj, int options, string& errmsg, BSONObjBuilder& result, bool fromRepl = false ) = 0;
/*
note: logTheOp() MUST be false if READ
if NONE, can't use Client::Context setup
use with caution
*/
virtual LockType locktype() const = 0;
/** if true, lock globally instead of just the one database. by default only the one
database will be locked.
*/
virtual bool lockGlobally() const { return false; }
/* Return true if only the admin ns has privileges to run this command. */
virtual bool adminOnly() const {
return false;
}
void htmlHelp(stringstream&) const;
/* Like adminOnly, but even stricter: we must either be authenticated for admin db,
or, if running without auth, on the local interface. Used for things which
are so major that remote invocation may not make sense (e.g., shutdownServer).
When localHostOnlyIfNoAuth() is true, adminOnly() must also be true.
*/
virtual bool localHostOnlyIfNoAuth(const BSONObj& cmdObj) { return false; }
/* Return true if slaves are allowed to execute the command
(the command directly from a client -- if fromRepl, always allowed).
*/
virtual bool slaveOk() const = 0;
/* Return true if the client force a command to be run on a slave by
turning on the 'slaveOk' option in the command query.
*/
virtual bool slaveOverrideOk() const {
return false;
}
/* Override and return true to if true,log the operation (logOp()) to the replication log.
(not done if fromRepl of course)
Note if run() returns false, we do NOT log.
*/
virtual bool logTheOp() { return false; }
virtual void help( stringstream& help ) const;
/**
* Appends to "*out" the privileges required to run this command on database "dbname" with
* the invocation described by "cmdObj".
*/
virtual void addRequiredPrivileges(const std::string& dbname,
const BSONObj& cmdObj,
std::vector<Privilege>* out) = 0;
/* Return true if a replica set secondary should go into "recovering"
(unreadable) state while running this command.
*/
virtual bool maintenanceMode() const { return false; }
/* Return true if command should be permitted when a replica set secondary is in "recovering"
(unreadable) state.
*/
virtual bool maintenanceOk() const { return true; /* assumed true prior to commit */ }
/** @param webUI expose the command in the web ui as localhost:28017/<name>
@param oldName an optional old, deprecated name for the command
*/
Command(StringData _name, bool webUI = false, StringData oldName = StringData());
virtual ~Command() {}
protected:
BSONObj getQuery( const BSONObj& cmdObj ) {
if ( cmdObj["query"].type() == Object )
return cmdObj["query"].embeddedObject();
if ( cmdObj["q"].type() == Object )
return cmdObj["q"].embeddedObject();
return BSONObj();
}
static void logIfSlow( const Timer& cmdTimer, const string& msg);
static map<string,Command*> * _commands;
static map<string,Command*> * _commandsByBestName;
static map<string,Command*> * _webCommands;
public:
// Stop all index builds required to run this command and return index builds killed.
virtual std::vector<BSONObj> stopIndexBuilds(const std::string& dbname,
const BSONObj& cmdObj);
static const map<string,Command*>* commandsByBestName() { return _commandsByBestName; }
static const map<string,Command*>* webCommands() { return _webCommands; }
/** @return if command was found */
static void runAgainstRegistered(const char *ns,
BSONObj& jsobj,
BSONObjBuilder& anObjBuilder,
int queryOptions = 0);
static LockType locktype( const string& name );
static Command * findCommand( const string& name );
// For mongod and webserver.
static void execCommand(Command* c,
Client& client,
int queryOptions,
const char *ns,
BSONObj& cmdObj,
BSONObjBuilder& result,
bool fromRepl );
// For mongos
static void execCommandClientBasic(Command* c,
ClientBasic& client,
int queryOptions,
const char *ns,
BSONObj& cmdObj,
BSONObjBuilder& result,
bool fromRepl );
// Helper for setting errmsg and ok field in command result object.
static void appendCommandStatus(BSONObjBuilder& result, bool ok, const std::string& errmsg);
// Set by command line. Controls whether or not testing-only commands should be available.
static int testCommandsEnabled;
};
bool _runCommands(const char *ns, BSONObj& jsobj, BufBuilder &b, BSONObjBuilder& anObjBuilder, bool fromRepl, int queryOptions);
} // namespace mongo
| 41.138298 | 141 | 0.585855 | [
"object",
"vector"
] |
36c64c5d075189e203d1ce1fafff8b9d99376501 | 19,344 | h | C | include/xgboost/c_api.h | nicewsyly/GitHubTest-boosting-xgboost | a997d6e4640e3fbe60bb5e71c64e665aa2fe607a | [
"Apache-2.0"
] | 1 | 2016-10-31T01:32:02.000Z | 2016-10-31T01:32:02.000Z | include/xgboost/c_api.h | nicewsyly/GitHubTest-boosting-xgboost | a997d6e4640e3fbe60bb5e71c64e665aa2fe607a | [
"Apache-2.0"
] | null | null | null | include/xgboost/c_api.h | nicewsyly/GitHubTest-boosting-xgboost | a997d6e4640e3fbe60bb5e71c64e665aa2fe607a | [
"Apache-2.0"
] | null | null | null | /*!
* Copyright (c) 2015 by Contributors
* \file c_api.h
* \author Tianqi Chen
* \brief C API of XGBoost, used to interfacing with other languages.
*/
#ifndef XGBOOST_C_API_H_
#define XGBOOST_C_API_H_
#ifdef __cplusplus
#define XGB_EXTERN_C extern "C"
#endif
// XGBoost C API will include APIs in Rabit C API
XGB_EXTERN_C {
#include <stdio.h>
}
#include <rabit/c_api.h>
#if defined(_MSC_VER) || defined(_WIN32)
#define XGB_DLL XGB_EXTERN_C __declspec(dllexport)
#else
#define XGB_DLL XGB_EXTERN_C
#endif
// manually define unsign long
typedef uint64_t bst_ulong; // NOLINT(*)
/*! \brief handle to DMatrix */
typedef void *DMatrixHandle;
/*! \brief handle to Booster */
typedef void *BoosterHandle;
/*! \brief handle to a data iterator */
typedef void *DataIterHandle;
/*! \brief handle to a internal data holder. */
typedef void *DataHolderHandle;
/*! \brief Mini batch used in XGBoost Data Iteration */
typedef struct {
/*! \brief number of rows in the minibatch */
size_t size;
/*! \brief row pointer to the rows in the data */
#ifdef __APPLE__
/* Necessary as Java on MacOS defines jlong as long int
* and gcc defines int64_t as long long int. */
long* offset; // NOLINT(*)
#else
int64_t* offset; // NOLINT(*)
#endif
/*! \brief labels of each instance */
float* label;
/*! \brief weight of each instance, can be NULL */
float* weight;
/*! \brief feature index */
int* index;
/*! \brief feature values */
float* value;
} XGBoostBatchCSR;
/*!
* \brief Callback to set the data to handle,
* \param handle The handle to the callback.
* \param batch The data content to be setted.
*/
XGB_EXTERN_C typedef int XGBCallbackSetData(
DataHolderHandle handle, XGBoostBatchCSR batch);
/*!
* \brief The data reading callback function.
* The iterator will be able to give subset of batch in the data.
*
* If there is data, the function will call set_function to set the data.
*
* \param data_handle The handle to the callback.
* \param set_function The batch returned by the iterator
* \param set_function_handle The handle to be passed to set function.
* \return 0 if we are reaching the end and batch is not returned.
*/
XGB_EXTERN_C typedef int XGBCallbackDataIterNext(
DataIterHandle data_handle,
XGBCallbackSetData* set_function,
DataHolderHandle set_function_handle);
/*!
* \brief get string message of the last error
*
* all function in this file will return 0 when success
* and -1 when an error occured,
* XGBGetLastError can be called to retrieve the error
*
* this function is threadsafe and can be called by different thread
* \return const char* error inforomation
*/
XGB_DLL const char *XGBGetLastError();
/*!
* \brief load a data matrix
* \param fname the name of the file
* \param silent whether print messages during loading
* \param out a loaded data matrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromFile(const char *fname,
int silent,
DMatrixHandle *out);
/*!
* \brief Create a DMatrix from a data iterator.
* \param data_handle The handle to the data.
* \param callback The callback to get the data.
* \param cache_info Additional information about cache file, can be null.
* \param out The created DMatrix
* \return 0 when success, -1 when failure happens.
*/
XGB_DLL int XGDMatrixCreateFromDataIter(
DataIterHandle data_handle,
XGBCallbackDataIterNext* callback,
const char* cache_info,
DMatrixHandle *out);
/*!
* \brief create a matrix content from CSR format
* \param indptr pointer to row headers
* \param indices findex
* \param data fvalue
* \param nindptr number of rows in the matix + 1
* \param nelem number of nonzero elements in the matrix
* \param num_col number of columns; when it's set to 0, then guess from data
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromCSREx(const size_t* indptr,
const unsigned* indices,
const float* data,
size_t nindptr,
size_t nelem,
size_t num_col,
DMatrixHandle* out);
/*!
* \deprecated
* \brief create a matrix content from CSR format
* \param indptr pointer to row headers
* \param indices findex
* \param data fvalue
* \param nindptr number of rows in the matix + 1
* \param nelem number of nonzero elements in the matrix
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromCSR(const bst_ulong *indptr,
const unsigned *indices,
const float *data,
bst_ulong nindptr,
bst_ulong nelem,
DMatrixHandle *out);
/*!
* \brief create a matrix content from CSC format
* \param col_ptr pointer to col headers
* \param indices findex
* \param data fvalue
* \param nindptr number of rows in the matix + 1
* \param nelem number of nonzero elements in the matrix
* \param num_row number of rows; when it's set to 0, then guess from data
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromCSCEx(const size_t* col_ptr,
const unsigned* indices,
const float* data,
size_t nindptr,
size_t nelem,
size_t num_row,
DMatrixHandle* out);
/*!
* \deprecated
* \brief create a matrix content from CSC format
* \param col_ptr pointer to col headers
* \param indices findex
* \param data fvalue
* \param nindptr number of rows in the matix + 1
* \param nelem number of nonzero elements in the matrix
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromCSC(const bst_ulong *col_ptr,
const unsigned *indices,
const float *data,
bst_ulong nindptr,
bst_ulong nelem,
DMatrixHandle *out);
/*!
* \brief create matrix content from dense matrix
* \param data pointer to the data space
* \param nrow number of rows
* \param ncol number columns
* \param missing which value to represent missing value
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromMat(const float *data,
bst_ulong nrow,
bst_ulong ncol,
float missing,
DMatrixHandle *out);
/*!
* \brief create a new dmatrix from sliced content of existing matrix
* \param handle instance of data matrix to be sliced
* \param idxset index set
* \param len length of index set
* \param out a sliced new matrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixSliceDMatrix(DMatrixHandle handle,
const int *idxset,
bst_ulong len,
DMatrixHandle *out);
/*!
* \brief free space in data matrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixFree(void *handle);
/*!
* \brief load a data matrix into binary file
* \param handle a instance of data matrix
* \param fname file name
* \param silent print statistics when saving
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixSaveBinary(DMatrixHandle handle,
const char *fname, int silent);
/*!
* \brief set float vector to a content in info
* \param handle a instance of data matrix
* \param field field name, can be label, weight
* \param array pointer to float vector
* \param len length of array
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixSetFloatInfo(DMatrixHandle handle,
const char *field,
const float *array,
bst_ulong len);
/*!
* \brief set uint32 vector to a content in info
* \param handle a instance of data matrix
* \param field field name
* \param array pointer to float vector
* \param len length of array
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixSetUIntInfo(DMatrixHandle handle,
const char *field,
const unsigned *array,
bst_ulong len);
/*!
* \brief set label of the training matrix
* \param handle a instance of data matrix
* \param group pointer to group size
* \param len length of array
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixSetGroup(DMatrixHandle handle,
const unsigned *group,
bst_ulong len);
/*!
* \brief get float info vector from matrix
* \param handle a instance of data matrix
* \param field field name
* \param out_len used to set result length
* \param out_dptr pointer to the result
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixGetFloatInfo(const DMatrixHandle handle,
const char *field,
bst_ulong* out_len,
const float **out_dptr);
/*!
* \brief get uint32 info vector from matrix
* \param handle a instance of data matrix
* \param field field name
* \param out_len The length of the field.
* \param out_dptr pointer to the result
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixGetUIntInfo(const DMatrixHandle handle,
const char *field,
bst_ulong* out_len,
const unsigned **out_dptr);
/*!
* \brief get number of rows.
* \param handle the handle to the DMatrix
* \param out The address to hold number of rows.
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixNumRow(DMatrixHandle handle,
bst_ulong *out);
/*!
* \brief get number of columns
* \param handle the handle to the DMatrix
* \param out The output of number of columns
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixNumCol(DMatrixHandle handle,
bst_ulong *out);
// --- start XGBoost class
/*!
* \brief create xgboost learner
* \param dmats matrices that are set to be cached
* \param len length of dmats
* \param out handle to the result booster
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterCreate(const DMatrixHandle dmats[],
bst_ulong len,
BoosterHandle *out);
/*!
* \brief free obj in handle
* \param handle handle to be freed
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterFree(BoosterHandle handle);
/*!
* \brief set parameters
* \param handle handle
* \param name parameter name
* \param value value of parameter
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterSetParam(BoosterHandle handle,
const char *name,
const char *value);
/*!
* \brief update the model in one round using dtrain
* \param handle handle
* \param iter current iteration rounds
* \param dtrain training data
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterUpdateOneIter(BoosterHandle handle,
int iter,
DMatrixHandle dtrain);
/*!
* \brief update the model, by directly specify gradient and second order gradient,
* this can be used to replace UpdateOneIter, to support customized loss function
* \param handle handle
* \param dtrain training data
* \param grad gradient statistics
* \param hess second order gradient statistics
* \param len length of grad/hess array
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterBoostOneIter(BoosterHandle handle,
DMatrixHandle dtrain,
float *grad,
float *hess,
bst_ulong len);
/*!
* \brief get evaluation statistics for xgboost
* \param handle handle
* \param iter current iteration rounds
* \param dmats pointers to data to be evaluated
* \param evnames pointers to names of each data
* \param len length of dmats
* \param out_result the string containing evaluation statistics
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterEvalOneIter(BoosterHandle handle,
int iter,
DMatrixHandle dmats[],
const char *evnames[],
bst_ulong len,
const char **out_result);
/*!
* \brief make prediction based on dmat
* \param handle handle
* \param dmat data matrix
* \param option_mask bit-mask of options taken in prediction, possible values
* 0:normal prediction
* 1:output margin instead of transformed value
* 2:output leaf index of trees instead of leaf value, note leaf index is unique per tree
* \param ntree_limit limit number of trees used for prediction, this is only valid for boosted trees
* when the parameter is set to 0, we will use all the trees
* \param out_len used to store length of returning result
* \param out_result used to set a pointer to array
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterPredict(BoosterHandle handle,
DMatrixHandle dmat,
int option_mask,
unsigned ntree_limit,
bst_ulong *out_len,
const float **out_result);
/*!
* \brief load model from existing file
* \param handle handle
* \param fname file name
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterLoadModel(BoosterHandle handle,
const char *fname);
/*!
* \brief save model into existing file
* \param handle handle
* \param fname file name
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterSaveModel(BoosterHandle handle,
const char *fname);
/*!
* \brief load model from in memory buffer
* \param handle handle
* \param buf pointer to the buffer
* \param len the length of the buffer
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterLoadModelFromBuffer(BoosterHandle handle,
const void *buf,
bst_ulong len);
/*!
* \brief save model into binary raw bytes, return header of the array
* user must copy the result out, before next xgboost call
* \param handle handle
* \param out_len the argument to hold the output length
* \param out_dptr the argument to hold the output data pointer
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterGetModelRaw(BoosterHandle handle,
bst_ulong *out_len,
const char **out_dptr);
/*!
* \brief dump model, return array of strings representing model dump
* \param handle handle
* \param fmap name to fmap can be empty string
* \param with_stats whether to dump with statistics
* \param out_len length of output array
* \param out_dump_array pointer to hold representing dump of each model
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterDumpModel(BoosterHandle handle,
const char *fmap,
int with_stats,
bst_ulong *out_len,
const char ***out_dump_array);
/*!
* \brief dump model, return array of strings representing model dump
* \param handle handle
* \param fnum number of features
* \param fname names of features
* \param ftype types of features
* \param with_stats whether to dump with statistics
* \param out_len length of output array
* \param out_models pointer to hold representing dump of each model
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterDumpModelWithFeatures(BoosterHandle handle,
int fnum,
const char **fname,
const char **ftype,
int with_stats,
bst_ulong *out_len,
const char ***out_models);
/*!
* \brief Get string attribute from Booster.
* \param handle handle
* \param key The key of the attribute.
* \param out The result attribute, can be NULL if the attribute do not exist.
* \param success Whether the result is contained in out.
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterGetAttr(BoosterHandle handle,
const char* key,
const char** out,
int *success);
/*!
* \brief Set or delete string attribute.
*
* \param handle handle
* \param key The key of the attribute.
* \param value The value to be saved.
* If nullptr, the attribute would be deleted.
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterSetAttr(BoosterHandle handle,
const char* key,
const char* value);
/*!
* \brief Get the names of all attribute from Booster.
* \param handle handle
* \param out_len the argument to hold the output length
* \param out pointer to hold the output attribute stings
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterGetAttrNames(BoosterHandle handle,
bst_ulong* out_len,
const char*** out);
// --- Distributed training API----
// NOTE: functions in rabit/c_api.h will be also available in libxgboost.so
/*!
* \brief Initialize the booster from rabit checkpoint.
* This is used in distributed training API.
* \param handle handle
* \param version The output version of the model.
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterLoadRabitCheckpoint(
BoosterHandle handle,
int* version);
/*!
* \brief Save the current checkpoint to rabit.
* \param handle handle
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGBoosterSaveRabitCheckpoint(BoosterHandle handle);
#endif // XGBOOST_C_API_H_
| 36.916031 | 101 | 0.622208 | [
"vector",
"model"
] |
36c7519e9a34ccd5d8a4e681c87bb6f6e6ffe6d8 | 1,603 | h | C | framework/utils/globalSettings.h | ShengQiangLiu/CicadaPlayer | cec58cf9cd31d2f7cbab1317c556a58b5bdd026e | [
"MIT"
] | 38 | 2019-12-16T14:31:00.000Z | 2020-01-11T03:01:26.000Z | framework/utils/globalSettings.h | ShengQiangLiu/CicadaPlayer | cec58cf9cd31d2f7cbab1317c556a58b5bdd026e | [
"MIT"
] | 11 | 2020-01-07T06:32:11.000Z | 2020-01-13T03:52:37.000Z | framework/utils/globalSettings.h | ShengQiangLiu/CicadaPlayer | cec58cf9cd31d2f7cbab1317c556a58b5bdd026e | [
"MIT"
] | 14 | 2019-12-30T01:19:04.000Z | 2020-01-11T02:12:35.000Z | //
// Created by lifujun on 2019/4/11.
//
#ifndef SOURCE_GLOBALSETTINGS_H
#define SOURCE_GLOBALSETTINGS_H
#include <string>
#include <thread>
#include <mutex>
#include <vector>
#include <map>
#include <set>
#include "af_string.h"
using namespace std;
namespace Cicada{
class globalSettings {
private:
class property {
public:
string key = "";
string value = "";
thread::id bindingTid;
};
globalSettings() = default;
public:
using type_resolve = std::map<std::string, std::set<std::string>>;
static globalSettings &getSetting();
int setProperty(const string &key, const string &value);
const string &getProperty(const string &key);
int addResolve(const string &host, const string &ip);
void removeResolve(const string &host, const string &ip);
mutex &getMutex()
{
return mMutex;
}
const type_resolve &getResolve()
{
return mResolve;
}
void setIpResolveType(int value) {
setProperty("protected.IpResolveType", AfString::to_string(value));
}
int getIpResolveType() {
const string& value = getProperty("protected.IpResolveType");
return value.empty() ? 0 /*IpResolveWhatEver*/ : atoi(value.c_str());
}
private:
mutex mMutex;
vector <property> mProperties;
const string mDefaultKeyValue = "";
type_resolve mResolve;
};
};
#endif //SOURCE_GLOBALSETTINGS_H
| 22.263889 | 81 | 0.585777 | [
"vector"
] |
36c7e6f21f84b80bb4b29956aa98176e0f626295 | 11,494 | c | C | Source/Lib/Common/ASM_AVX2/EbRestorationPick_AVX2.c | xuguangxin/SVT-AV1 | b4ca700d36c9655e37e9f091bfe983a23ec0c1bd | [
"BSD-2-Clause-Patent"
] | null | null | null | Source/Lib/Common/ASM_AVX2/EbRestorationPick_AVX2.c | xuguangxin/SVT-AV1 | b4ca700d36c9655e37e9f091bfe983a23ec0c1bd | [
"BSD-2-Clause-Patent"
] | null | null | null | Source/Lib/Common/ASM_AVX2/EbRestorationPick_AVX2.c | xuguangxin/SVT-AV1 | b4ca700d36c9655e37e9f091bfe983a23ec0c1bd | [
"BSD-2-Clause-Patent"
] | null | null | null | /*
* Copyright(c) 2019 Intel Corporation
* SPDX - License - Identifier: BSD - 2 - Clause - Patent
*/
#include "EbDefinitions.h"
#include "EbRestoration.h"
#include <immintrin.h>
#include<math.h>
#include "synonyms.h"
static INLINE void avx2_mul_epi16_epi32(__m256i *a, __m256i *b, __m256i *out) {
__m256i a_32[2];
__m256i b_32[2];
a_32[0] = _mm256_cvtepi16_epi32(_mm256_extracti128_si256(*a, 1));
a_32[1] = _mm256_cvtepi16_epi32(_mm256_extracti128_si256(*a, 0));
b_32[0] = _mm256_cvtepi16_epi32(_mm256_extracti128_si256(*b, 1));
b_32[1] = _mm256_cvtepi16_epi32(_mm256_extracti128_si256(*b, 0));
out[0] = _mm256_mullo_epi32(a_32[0], b_32[0]);
out[1] = _mm256_mullo_epi32(a_32[1], b_32[1]);
}
void get_proj_subspace_avx2(const uint8_t *src8, int width, int height,
int src_stride, const uint8_t *dat8,
int dat_stride, int use_highbitdepth,
int32_t *flt0, int flt0_stride, int32_t *flt1,
int flt1_stride, int *xq,
const SgrParamsType *params) {
int i, j;
double H[2][2] = { { 0, 0 }, { 0, 0 } };
double C[2] = { 0, 0 };
double Det;
double x[2];
const int size = width * height;
aom_clear_system_state();
RunEmms();
// Default
xq[0] = 0;
xq[1] = 0;
__m256i H_00, H_01, H_10, H_11;
__m256i C_0, C_1;
H_00 = _mm256_setzero_si256();
H_01 = _mm256_setzero_si256();
H_11 = _mm256_setzero_si256();
C_0 = _mm256_setzero_si256();
C_1 = _mm256_setzero_si256();
__m256i u_256, s_256, f1_256, f2_256;
__m256i f1_256_tmp, f2_256_tmp;
__m256i out[2];
int avx2_cnt = 0;
if (!use_highbitdepth) {
const uint8_t *src = src8;
const uint8_t *dat = dat8;
for (i = 0; i < height; ++i) {
for (j = 0, avx2_cnt = 0; avx2_cnt < width / 16; j += 16, ++avx2_cnt) {
u_256 = _mm256_cvtepu8_epi16(_mm_loadu_si128(
(const __m128i *)(dat + i * dat_stride + j)));
u_256 = _mm256_slli_epi16(u_256, SGRPROJ_RST_BITS);
s_256 = _mm256_cvtepu8_epi16(_mm_loadu_si128(
(const __m128i *)(src + i * src_stride + j)));
s_256 = _mm256_slli_epi16(s_256, SGRPROJ_RST_BITS);
s_256 = _mm256_sub_epi16(s_256, u_256);
if (params->r[0] > 0) {
f1_256 = _mm256_loadu_si256(
(const __m256i *)(flt0 + i * flt0_stride + j));
f1_256_tmp = _mm256_loadu_si256(
(const __m256i *)(flt0 + i * flt0_stride + j + 8));
f1_256 = _mm256_hadd_epi16(f1_256, f1_256_tmp);
f1_256 = _mm256_permute4x64_epi64(f1_256, 0xD8);
f1_256 = _mm256_sub_epi16(f1_256, u_256);
} else {
f1_256 = _mm256_set1_epi16(0);
}
if (params->r[1] > 0) {
f2_256 = _mm256_loadu_si256(
(const __m256i *)(flt1 + i * flt1_stride + j));
f2_256_tmp = _mm256_loadu_si256(
(const __m256i *)(flt1 + i * flt1_stride + j + 8));
f2_256 = _mm256_hadd_epi16(f2_256, f2_256_tmp);
f2_256 = _mm256_permute4x64_epi64(f2_256, 0xD8);
f2_256 = _mm256_sub_epi16(f2_256, u_256);
} else {
f2_256 = _mm256_set1_epi16(0);
}
// H[0][0] += f1 * f1;
avx2_mul_epi16_epi32(&f1_256, &f1_256, out);
H_00 = _mm256_add_epi32(H_00, out[0]);
H_00 = _mm256_add_epi32(H_00, out[1]);
// H[1][1] += f2 * f2;
avx2_mul_epi16_epi32(&f2_256, &f2_256, out);
H_11 = _mm256_add_epi32(H_11, out[0]);
H_11 = _mm256_add_epi32(H_11, out[1]);
// H[0][1] += f1 * f2;
avx2_mul_epi16_epi32(&f1_256, &f2_256, out);
H_01 = _mm256_add_epi32(H_01, out[0]);
H_01 = _mm256_add_epi32(H_01, out[1]);
// C[0] += f1 * s;
avx2_mul_epi16_epi32(&f1_256, &s_256, out);
C_0 = _mm256_add_epi32(C_0, out[0]);
C_0 = _mm256_add_epi32(C_0, out[1]);
// C[1] += f2 * s;
avx2_mul_epi16_epi32(&f2_256, &s_256, out);
C_1 = _mm256_add_epi32(C_1, out[0]);
C_1 = _mm256_add_epi32(C_1, out[1]);
}
//Complement when width not divided by 16
for (; j < width; ++j) {
const double u = (double)(dat[i * dat_stride + j] << SGRPROJ_RST_BITS);
const double s =
(double)(src[i * src_stride + j] << SGRPROJ_RST_BITS) - u;
const double f1 =
(params->r[0] > 0) ? (double)flt0[i * flt0_stride + j] - u : 0;
const double f2 =
(params->r[1] > 0) ? (double)flt1[i * flt1_stride + j] - u : 0;
H[0][0] += f1 * f1;
H[1][1] += f2 * f2;
H[0][1] += f1 * f2;
C[0] += f1 * s;
C[1] += f2 * s;
}
//Summary in each row, to not overflow 32 bits value H_
H_00 = _mm256_hadd_epi32(H_00, H_00);//indexes 0,1,4,5
H_00 = _mm256_hadd_epi32(H_00, H_00);//indexes 0,4
H[0][0] += (double)_mm256_extract_epi32(H_00, 0) +
_mm256_extract_epi32(H_00, 4);
H_11 = _mm256_hadd_epi32(H_11, H_11);//indexes 0,1,4,5
H_11 = _mm256_hadd_epi32(H_11, H_11);//indexes 0,4
H[1][1] += (double)_mm256_extract_epi32(H_11, 0) +
_mm256_extract_epi32(H_11, 4);
H_01 = _mm256_hadd_epi32(H_01, H_01);//indexes 0,1,4,5
H_01 = _mm256_hadd_epi32(H_01, H_01);//indexes 0,4
H[0][1] += (double)_mm256_extract_epi32(H_01, 0) +
_mm256_extract_epi32(H_01, 4);
C_0 = _mm256_hadd_epi32(C_0, C_0);//indexes 0,1,4,5
C_0 = _mm256_hadd_epi32(C_0, C_0);//indexes 0,4
C[0] += (double)_mm256_extract_epi32(C_0, 0) +
_mm256_extract_epi32(C_0, 4);
C_1 = _mm256_hadd_epi32(C_1, C_1);//indexes 0,1,4,5
C_1 = _mm256_hadd_epi32(C_1, C_1);//indexes 0,4
C[1] += (double)_mm256_extract_epi32(C_1, 0) +
_mm256_extract_epi32(C_1, 4);
H_00 = _mm256_setzero_si256();
H_01 = _mm256_setzero_si256();
H_11 = _mm256_setzero_si256();
C_0 = _mm256_setzero_si256();
C_1 = _mm256_setzero_si256();
}
} else {
const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
const uint16_t *dat = CONVERT_TO_SHORTPTR(dat8);
for (i = 0; i < height; ++i) {
for (j = 0, avx2_cnt = 0; avx2_cnt < width / 16; j += 16, ++avx2_cnt) {
u_256 = _mm256_loadu_si256(
(const __m256i *)(dat + i * dat_stride + j));
u_256 = _mm256_slli_epi16(u_256, SGRPROJ_RST_BITS);
s_256 = _mm256_loadu_si256(
(const __m256i *)(src + i * src_stride + j));
s_256 = _mm256_slli_epi16(s_256, SGRPROJ_RST_BITS);
s_256 = _mm256_sub_epi16(s_256, u_256);
if (params->r[0] > 0) {
f1_256 = _mm256_loadu_si256(
(const __m256i *)(flt0 + i * flt0_stride + j));
f1_256_tmp = _mm256_loadu_si256(
(const __m256i *)(flt0 + i * flt0_stride + j + 8));
f1_256 = _mm256_hadd_epi16(f1_256, f1_256_tmp);
f1_256 = _mm256_permute4x64_epi64(f1_256, 0xD8);
f1_256 = _mm256_sub_epi16(f1_256, u_256);
} else {
f1_256 = _mm256_set1_epi16(0);
}
if (params->r[1] > 0) {
f2_256 = _mm256_loadu_si256(
(const __m256i *)(flt1 + i * flt1_stride + j));
f2_256_tmp = _mm256_loadu_si256(
(const __m256i *)(flt1 + i * flt1_stride + j + 8));
f2_256 = _mm256_hadd_epi16(f2_256, f2_256_tmp);
f2_256 = _mm256_permute4x64_epi64(f2_256, 0xD8);
f2_256 = _mm256_sub_epi16(f2_256, u_256);
} else {
f2_256 = _mm256_set1_epi16(0);
}
// H[0][0] += f1 * f1;
avx2_mul_epi16_epi32(&f1_256, &f1_256, out);
H_00 = _mm256_add_epi32(H_00, out[0]);
H_00 = _mm256_add_epi32(H_00, out[1]);
// H[1][1] += f2 * f2;
avx2_mul_epi16_epi32(&f2_256, &f2_256, out);
H_11 = _mm256_add_epi32(H_11, out[0]);
H_11 = _mm256_add_epi32(H_11, out[1]);
// H[0][1] += f1 * f2;
avx2_mul_epi16_epi32(&f1_256, &f2_256, out);
H_01 = _mm256_add_epi32(H_01, out[0]);
H_01 = _mm256_add_epi32(H_01, out[1]);
// C[0] += f1 * s;
avx2_mul_epi16_epi32(&f1_256, &s_256, out);
C_0 = _mm256_add_epi32(C_0, out[0]);
C_0 = _mm256_add_epi32(C_0, out[1]);
// C[1] += f2 * s;
avx2_mul_epi16_epi32(&f2_256, &s_256, out);
C_1 = _mm256_add_epi32(C_1, out[0]);
C_1 = _mm256_add_epi32(C_1, out[1]);
}
//Complement when width not divided by 16
for (; j < width; ++j) {
const double u = (double)(dat[i * dat_stride + j] << SGRPROJ_RST_BITS);
const double s =
(double)(src[i * src_stride + j] << SGRPROJ_RST_BITS) - u;
const double f1 =
(params->r[0] > 0) ? (double)flt0[i * flt0_stride + j] - u : 0;
const double f2 =
(params->r[1] > 0) ? (double)flt1[i * flt1_stride + j] - u : 0;
H[0][0] += f1 * f1;
H[1][1] += f2 * f2;
H[0][1] += f1 * f2;
C[0] += f1 * s;
C[1] += f2 * s;
}
//Summary in each row, to not overflow 32 bits value H_
H_00 = _mm256_hadd_epi32(H_00, H_00);//indexes 0,1,4,5
H_00 = _mm256_hadd_epi32(H_00, H_00);//indexes 0,4
H[0][0] += (double)_mm256_extract_epi32(H_00, 0) +
_mm256_extract_epi32(H_00, 4);
H_11 = _mm256_hadd_epi32(H_11, H_11);//indexes 0,1,4,5
H_11 = _mm256_hadd_epi32(H_11, H_11);//indexes 0,4
H[1][1] += (double)_mm256_extract_epi32(H_11, 0) +
_mm256_extract_epi32(H_11, 4);
H_01 = _mm256_hadd_epi32(H_01, H_01);//indexes 0,1,4,5
H_01 = _mm256_hadd_epi32(H_01, H_01);//indexes 0,4
H[0][1] += (double)_mm256_extract_epi32(H_01, 0) +
_mm256_extract_epi32(H_01, 4);
C_0 = _mm256_hadd_epi32(C_0, C_0);//indexes 0,1,4,5
C_0 = _mm256_hadd_epi32(C_0, C_0);//indexes 0,4
C[0] += (double)_mm256_extract_epi32(C_0, 0) +
_mm256_extract_epi32(C_0, 4);
C_1 = _mm256_hadd_epi32(C_1, C_1);//indexes 0,1,4,5
C_1 = _mm256_hadd_epi32(C_1, C_1);//indexes 0,4
C[1] += (double)_mm256_extract_epi32(C_1, 0) +
_mm256_extract_epi32(C_1, 4);
H_00 = _mm256_setzero_si256();
H_01 = _mm256_setzero_si256();
H_11 = _mm256_setzero_si256();
C_0 = _mm256_setzero_si256();
C_1 = _mm256_setzero_si256();
}
}
H[0][0] /= size;
H[0][1] /= size;
H[1][1] /= size;
H[1][0] = H[0][1];
C[0] /= size;
C[1] /= size;
if (params->r[0] == 0) {
// H matrix is now only the scalar H[1][1]
// C vector is now only the scalar C[1]
Det = H[1][1];
if (Det < 1e-8) return; // ill-posed, return default values
x[0] = 0;
x[1] = C[1] / Det;
xq[0] = 0;
xq[1] = (int)rint(x[1] * (1 << SGRPROJ_PRJ_BITS));
} else if (params->r[1] == 0) {
// H matrix is now only the scalar H[0][0]
// C vector is now only the scalar C[0]
Det = H[0][0];
if (Det < 1e-8) return; // ill-posed, return default values
x[0] = C[0] / Det;
x[1] = 0;
xq[0] = (int)rint(x[0] * (1 << SGRPROJ_PRJ_BITS));
xq[1] = 0;
} else {
Det = (H[0][0] * H[1][1] - H[0][1] * H[1][0]);
if (Det < 1e-8) return; // ill-posed, return default values
x[0] = (H[1][1] * C[0] - H[0][1] * C[1]) / Det;
x[1] = (H[0][0] * C[1] - H[1][0] * C[0]) / Det;
xq[0] = (int)rint(x[0] * (1 << SGRPROJ_PRJ_BITS));
xq[1] = (int)rint(x[1] * (1 << SGRPROJ_PRJ_BITS));
}
}
| 35.366154 | 79 | 0.561945 | [
"vector"
] |
36cb8b48ed831b6dfd07edd3cb36ac14b894a6e5 | 1,956 | h | C | RainbowChat/Quickblox.framework/Versions/A/Headers/ChatService/Classes/Business/Models/QBChatMessage.h | lephuocdai/RainbowChat | 8864e742bd61e01fdf0c281ec9fb700152e45fad | [
"MIT"
] | 4 | 2015-05-18T22:36:52.000Z | 2021-07-30T05:38:03.000Z | RainbowChat/Quickblox.framework/Versions/A/Headers/ChatService/Classes/Business/Models/QBChatMessage.h | lephuocdai/RainbowChat | 8864e742bd61e01fdf0c281ec9fb700152e45fad | [
"MIT"
] | null | null | null | RainbowChat/Quickblox.framework/Versions/A/Headers/ChatService/Classes/Business/Models/QBChatMessage.h | lephuocdai/RainbowChat | 8864e742bd61e01fdf0c281ec9fb700152e45fad | [
"MIT"
] | 3 | 2015-05-18T22:36:57.000Z | 2021-07-30T05:38:05.000Z | //
// QBChatMessage.h
// Сhat
//
// Copyright 2012 QuickBlox team. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
QBChatMessage structure. Represents message object for peer-to-peer chat.
Please set only text, recipientID & senderID values since ID is setted automatically by QBChat
*/
@interface QBChatMessage : NSObject <NSCoding, NSCopying>{
@private
NSString *ID;
NSString *text;
NSUInteger recipientID;
NSUInteger senderID;
NSDate *datetime;
BOOL delayed;
NSMutableDictionary *customParameters;
}
/**
Unique identifier of message (sequential number)
*/
@property (nonatomic, copy) NSString *ID;
/**
Message text
*/
@property (nonatomic, copy) NSString *text;
/**
Message receiver ID
*/
@property (nonatomic, assign) NSUInteger recipientID;
/**
Message sender ID, use only for 1-1 Chat
*/
@property (nonatomic, assign) NSUInteger senderID;
/**
Message sender nick, use only for group Chat
*/
@property (nonatomic, copy) NSString *senderNick;
/**
Message datetime
*/
@property (nonatomic, copy) NSDate *datetime;
/**
Is this message delayed
*/
@property (nonatomic, assign) BOOL delayed;
/**
Message custom parameters. Don't use 'body' & 'delay' as keys for parameters.
*/
@property (nonatomic, retain) NSMutableDictionary *customParameters;
/** Create new message
@return New instance of QBChatMessage
*/
+ (instancetype)message;
/** Save message to history in Custom Objects
@param classname Custom Objects class name
@param additionalParameters Additional Custom Objects fields
*/
- (void)saveWhenDeliveredToCustomObjectsWithClassName:(NSString *)classname additionalParameters:(NSDictionary *)additionalParameters;
/**
Custom Objects class name
*/
@property (nonatomic, readonly) NSString *customObjectsClassName;
/**
Additional Custom Objects fields
*/
@property (nonatomic, readonly) NSDictionary *customObjectsAdditionalParameters;
@end
| 21.26087 | 134 | 0.734151 | [
"object"
] |
36ccbf432435431e3eea122f9e8d9c75bdfe02c9 | 3,280 | h | C | include/cognitao_ros2/server/Ros2ActionServer.h | cogniteam/cogniteam_ros2 | 13bd6dfb11f641ba78a0d26bb77cfda9d2d53d13 | [
"Apache-2.0"
] | null | null | null | include/cognitao_ros2/server/Ros2ActionServer.h | cogniteam/cogniteam_ros2 | 13bd6dfb11f641ba78a0d26bb77cfda9d2d53d13 | [
"Apache-2.0"
] | null | null | null | include/cognitao_ros2/server/Ros2ActionServer.h | cogniteam/cogniteam_ros2 | 13bd6dfb11f641ba78a0d26bb77cfda9d2d53d13 | [
"Apache-2.0"
] | null | null | null | /**
* @brief ROS 2 Action Server
*
* @file Ros2ActionServer.h
*
* @author Lin Azan (lin@cogniteam.com)
* @date 2020-03-15
* @copyright Cogniteam (c) 2020
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the 'Software'), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
#ifndef INCLUDE_ROS2_ACTION_SERVER_H_
#define INCLUDE_ROS2_ACTION_SERVER_H_
#include <inttypes.h>
#include <memory>
#include "rclcpp/rclcpp.hpp"
#include "rclcpp_action/rclcpp_action.hpp"
#include "Ros2ActionContext.h"
using namespace std;
using actionType=cognitao_ros2::action::Action;
using GoalHandleActionType = rclcpp_action::ServerGoalHandle<actionType>;
using namespace std::placeholders;
class Ros2ActionServer {
public:
/**
* @brief Construct a new Ros 2 Action Server object
* @param node
* @param action
*/
Ros2ActionServer(rclcpp::Node::SharedPtr node, const std::string action) {
g_node_ = node;
this->server_ = rclcpp_action::create_server<actionType>(
g_node_, action, std::bind(&Ros2ActionServer::handleGoal,
this, std::placeholders::_1, std::placeholders::_2),
std::bind(&Ros2ActionServer::handleCancel, this, std::placeholders::_1),
std::bind(&Ros2ActionServer::onStart, this, std::placeholders::_1) );
}
/**
* @brief Destroys the Ros 2 Action Server object
*/
virtual ~Ros2ActionServer(){};
private:
rclcpp_action::GoalResponse handleGoal(
const std::array<uint8_t, 16> &,
std::shared_ptr<const actionType::Goal> ) {
return rclcpp_action::GoalResponse::ACCEPT_AND_EXECUTE;
}
rclcpp_action::CancelResponse handleCancel(
const std::shared_ptr<GoalHandleActionType> ) {
return rclcpp_action::CancelResponse::ACCEPT;
}
void onStart(const std::shared_ptr<GoalHandleActionType> goal_handle) {
Ros2ActionContext ros2ActionContext(goal_handle);
std::thread{std::bind(&Ros2ActionServer::execute, this, _1),
ros2ActionContext}.detach();
}
virtual void execute(Ros2ActionContext ros2ActionContext) = 0;
private:
rclcpp::Node::SharedPtr g_node_ = nullptr;
rclcpp_action::Server<actionType>::SharedPtr server_;
};
#endif /* INCLUDE_ROS2_ACTION_SERVER_H_ */
| 31.238095 | 81 | 0.71189 | [
"object"
] |
36cd63644179856e671e5b4940cc00fe2383ff87 | 1,482 | c | C | examples/graphics/wide_rez/ex10b.c | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | null | null | null | examples/graphics/wide_rez/ex10b.c | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | examples/graphics/wide_rez/ex10b.c | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null | /*=========================================================================
GFX EXAMPLE CODE - #10b
"shaded 3D blocks"
Wide resolution version, without surface buffer (still not implemented)
Copyright (C) 2004 Rafael de Oliveira Jannone
Copyright (C) 2009 Stefano Bodrato
This example's source code is Public Domain.
WARNING: The author makes no guarantees and holds no responsibility for
any damage, injury or loss that may result from the use of this source
code. USE IT AT YOUR OWN RISK.
Contact the author:
by e-mail : rafael AT jannone DOT org
homepage : http://jannone.org/gfxlib
ICQ UIN : 10115284
=========================================================================*/
#include <graphics.h>
#pragma output nogfxglobals
unsigned char stencil[256*4];
main() {
int c, l;
unsigned char i;
unsigned int dly;
clg();
c = 0;
// paint polygon
for (;;) {
clg();
for (i=4;i>0;i--) {
// fake light source
stencil_init(stencil);
stencil_add_circle(getmaxx()/2-50+c*3-i, 42+i, i*3+10, 1, stencil);
stencil_render(stencil, i);
}
for (i=10;i>0;i--) {
stencil_init(stencil);
stencil_add_circle(getmaxx()/2+(33-(i*3)), 145 - i, i*6 ,1, stencil);
stencil_add_side(getmaxx()/2-i*6+(33-(i*3)), 145 - i, getmaxx()/2, 30+i, stencil);
stencil_add_side(getmaxx()/2+i*6+(33-(i*3)), 145 - i, getmaxx()/2, 30+i, stencil);
stencil_render(stencil, (12-i)*(c+1)/6);
}
for (dly=0;dly<30000;dly++) {};
c = (c+1) & 15;
}
}
| 23.52381 | 85 | 0.589744 | [
"3d"
] |
36ced94fba4881f141f919d5c3b8ee6fc2cccbe5 | 13,311 | h | C | DataStructures/Graph/Utils/Conversion.h | phidra/ULTRA | d3de3dbbbd651ee8279dd605e6d8f73365c81735 | [
"MIT"
] | 14 | 2019-07-13T10:53:45.000Z | 2022-03-18T11:06:32.000Z | DataStructures/Graph/Utils/Conversion.h | phidra/ULTRA | d3de3dbbbd651ee8279dd605e6d8f73365c81735 | [
"MIT"
] | 1 | 2021-02-04T12:16:02.000Z | 2021-02-04T12:16:02.000Z | DataStructures/Graph/Utils/Conversion.h | phidra/ULTRA | d3de3dbbbd651ee8279dd605e6d8f73365c81735 | [
"MIT"
] | 8 | 2019-10-24T05:23:24.000Z | 2021-08-29T08:30:12.000Z | /**********************************************************************************
Copyright (c) 2019 Jonas Sauer, Tobias Zündorf
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**********************************************************************************/
#pragma once
#include <vector>
#include "../Classes/GraphInterface.h"
#include "../Classes/DynamicGraph.h"
#include "../Classes/StaticGraph.h"
#include "../Classes/EdgeList.h"
#include "../../../Helpers/Assert.h"
#include "../../../Helpers/Vector/Permutation.h"
namespace Graph {
template<typename GRAPH>
inline void computeReverseEdgePointers(GRAPH& graph) noexcept {
if constexpr (GRAPH::HasEdgeAttribute(ReverseEdge)) {
for (const auto [edge, from] : graph.edgesWithFromVertex()) {
if (graph.isEdge(graph.get(ReverseEdge, edge))) continue;
const Edge reverse = graph.findEdge(graph.get(ToVertex, edge), from);
if (!graph.isEdge(reverse)) continue;
if (graph.isEdge(graph.get(ReverseEdge, reverse))) continue;
graph.set(ReverseEdge, edge, reverse);
graph.set(ReverseEdge, reverse, edge);
}
}
}
// StaticGraph --> StaticGraph
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(StaticGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, StaticGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = StaticGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
using ToType = StaticGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>;
to.clear();
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
to.beginOut.swap(from.beginOut);
if constexpr (ToType::HasEdgeAttribute(FromVertex) && !FromType::HasEdgeAttribute(FromVertex)) {
for (const Vertex vertex : to.vertices()) {
for (const Edge edge : to.edgesFrom(vertex)) {
to.set(FromVertex, edge, vertex);
}
}
}
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
to.checkVectorSize();
Assert(to.satisfiesInvariants());
from.clear();
}
// StaticGraph --> DynamicGraph
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(StaticGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, DynamicGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = StaticGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
std::vector<size_t> outDegree;
outDegree.reserve(from.numVertices() * 1.2);
for (const Vertex vertex : from.vertices()) {
outDegree.emplace_back(from.outDegree(vertex));
}
from.beginOut.pop_back();
to.edgeCount = from.numEdges();
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
to.vertexAttributes.get(BeginOut).swap(from.beginOut);
to.vertexAttributes.get(OutDegree).swap(outDegree);
for (const Vertex vertex : to.vertices()) {
for (const Edge edge : to.edgesFrom(vertex)) {
to[Valid][edge] = true;
to.get(IncomingEdgePointer, edge) = to.get(IncomingEdges, to.get(ToVertex, edge)).size();
to.get(IncomingEdges, to.get(ToVertex, edge)).push_back(edge);
to.set(FromVertex, edge, vertex);
}
}
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
AssertMsg(to.satisfiesInvariants(), "Invariants not satisfied!");
from.clear();
}
// StaticGraph --> EdgeList
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(StaticGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, EdgeListImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = StaticGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
std::vector<Vertex> fromVertex;
if constexpr (FromType::HasEdgeAttribute(FromVertex)) {
fromVertex = from.get(FromVertex);
} else {
fromVertex.resize(from.numEdges());
for (const Vertex vertex : from.vertices()) {
for (const Edge edge : from.edgesFrom(vertex)) {
fromVertex[edge] = vertex;
}
}
}
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
to.get(FromVertex).swap(fromVertex);
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
from.clear();
}
// DynamicGraph --> StaticGraph
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(DynamicGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, StaticGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = DynamicGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
from.packEdges();
to.beginOut = from.get(BeginOut);
to.beginOut.emplace_back(from.numEdges());
for (Vertex v = Vertex(to.beginOut.size() - 2); v < to.beginOut.size(); v--) {
const Vertex u = Vertex(v + 1);
if (from[OutDegree][v] == 0) to.beginOut[v] = to.beginOut[u];
AssertMsg(to.beginOut[v] <= to.beginOut[u], "Adjacency data structure is out of order!");
}
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
to.checkVectorSize();
AssertMsg(to.satisfiesInvariants(), "Invariants not satisfied!");
from.clear();
}
// DynamicGraph --> DynamicGraph
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(DynamicGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, DynamicGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = DynamicGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
to.edgeCount = from.edgeCount;
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
to.checkVectorSize();
AssertMsg(to.satisfiesInvariants(), "Invariants not satisfied!");
from.clear();
}
// DynamicGraph --> EdgeList
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(DynamicGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, EdgeListImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = DynamicGraphImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
from.packEdges();
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
from.clear();
}
// EdgeList --> EdgeList
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(EdgeListImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, EdgeListImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = EdgeListImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
from.clear();
}
// EdgeList --> StaticGraph
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(EdgeListImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, StaticGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
using FromType = EdgeListImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>;
to.clear();
const Order order(Construct::Sort, from.get(FromVertex));
from.applyEdgeOrder(order);
for (const Edge edge : from.edges()) {
while (to.beginOut.size() <= from.get(FromVertex, edge)) {
to.beginOut.emplace_back(edge);
}
}
while (to.beginOut.size() <= from.numVertices()) {
to.beginOut.emplace_back(from.numEdges());
}
to.vertexAttributes.assign(from.vertexAttributes, attributeNameChanges...);
to.edgeAttributes.assign(from.edgeAttributes, attributeNameChanges...);
if constexpr (!FromType::HasEdgeAttribute(ReverseEdge)) {
computeReverseEdgePointers(to);
}
to.checkVectorSize();
AssertMsg(to.satisfiesInvariants(), "Invariants not satisfied!");
from.clear();
}
// EdgeList --> DynamicGraph
template<typename VERTEX_ATTRIBUTES_FROM, typename EDGE_ATTRIBUTES_FROM, typename VERTEX_ATTRIBUTES_TO, typename EDGE_ATTRIBUTES_TO, typename... ATTRIBUTE_NAME_CHANGES>
inline void move(EdgeListImplementation<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM>&& from, DynamicGraphImplementation<VERTEX_ATTRIBUTES_TO, EDGE_ATTRIBUTES_TO>& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) {
StaticGraph<VERTEX_ATTRIBUTES_FROM, EDGE_ATTRIBUTES_FROM> tempGraph;
move(std::move(from), tempGraph, attributeNameChanges...);
move(std::move(tempGraph), to, attributeNameChanges...);
}
// Copy graph data instead of moving it
template<typename FROM_GRAPH_TYPE, typename TO_GRAPH_TYPE, typename... ATTRIBUTE_NAME_CHANGES>
inline void copy(const FROM_GRAPH_TYPE& from, TO_GRAPH_TYPE& to, const ATTRIBUTE_NAME_CHANGES... attributeNameChanges) noexcept {
FROM_GRAPH_TYPE fromCopy = from;
move(std::move(fromCopy), to, attributeNameChanges...);
}
}
| 56.164557 | 231 | 0.701826 | [
"vector"
] |
36cef3ccdc016bd2d8223da7d81662087de6e131 | 16,640 | c | C | source/blender/editors/gpencil/gpencil_merge.c | intrigus/blender-1 | c3001812dc0253624c03236e75da229418a8c4ad | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 116 | 2015-11-02T16:36:53.000Z | 2021-06-08T20:36:18.000Z | source/blender/editors/gpencil/gpencil_merge.c | intrigus/blender-1 | c3001812dc0253624c03236e75da229418a8c4ad | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 39 | 2016-04-25T12:18:34.000Z | 2021-03-01T19:06:36.000Z | source/blender/editors/gpencil/gpencil_merge.c | intrigus/blender-1 | c3001812dc0253624c03236e75da229418a8c4ad | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 19 | 2016-01-24T14:24:00.000Z | 2020-07-19T05:26:24.000Z | /*
* 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, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2019, Blender Foundation.
* This is a new part of Blender
* Operators for merge Grease Pencil strokes
*/
/** \file
* \ingroup edgpencil
*/
#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "DNA_gpencil_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_gpencil.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "ED_gpencil.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "gpencil_intern.h"
typedef struct tGPencilPointCache {
float factor; /* value to sort */
bGPDstroke *gps;
float x, y, z;
float pressure;
float strength;
} tGPencilPointCache;
/* helper function to sort points */
static int gpencil_sort_points(const void *a1, const void *a2)
{
const tGPencilPointCache *ps1 = a1, *ps2 = a2;
if (ps1->factor < ps2->factor) {
return -1;
}
else if (ps1->factor > ps2->factor) {
return 1;
}
return 0;
}
static void gpencil_insert_points_to_stroke(bGPDstroke *gps,
tGPencilPointCache *points_array,
int totpoints)
{
tGPencilPointCache *point_elem = NULL;
for (int i = 0; i < totpoints; i++) {
point_elem = &points_array[i];
bGPDspoint *pt_dst = &gps->points[i];
copy_v3_v3(&pt_dst->x, &point_elem->x);
pt_dst->pressure = point_elem->pressure;
pt_dst->strength = point_elem->strength;
pt_dst->uv_fac = 1.0f;
pt_dst->uv_rot = 0;
pt_dst->flag |= GP_SPOINT_SELECT;
}
}
static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpoints)
{
Main *bmain = CTX_data_main(C);
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
Scene *scene = CTX_data_scene(C);
const bool back = RNA_boolean_get(op->ptr, "back");
const bool additive = RNA_boolean_get(op->ptr, "additive");
const bool cyclic = RNA_boolean_get(op->ptr, "cyclic");
Paint *paint = &ts->gp_paint->paint;
/* if not exist, create a new one */
if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) {
/* create new brushes */
BKE_brush_gpencil_presets(bmain, ts);
}
Brush *brush = paint->brush;
/* frame */
short add_frame_mode;
if (additive) {
add_frame_mode = GP_GETFRAME_ADD_COPY;
}
else {
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, CFRA, add_frame_mode);
/* stroke */
bGPDstroke *gps = MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
gps->totpoints = totpoints;
gps->inittime = 0.0f;
gps->thickness = brush->size;
gps->gradient_f = brush->gpencil_settings->gradient_f;
copy_v2_v2(gps->gradient_s, brush->gpencil_settings->gradient_s);
gps->flag |= GP_STROKE_SELECT;
gps->flag |= GP_STROKE_3DSPACE;
gps->mat_nr = ob->actcol - 1;
/* allocate memory for points */
gps->points = MEM_callocN(sizeof(bGPDspoint) * totpoints, "gp_stroke_points");
/* initialize triangle memory to dummy data */
gps->tot_triangles = 0;
gps->triangles = NULL;
gps->flag |= GP_STROKE_RECALC_GEOMETRY;
if (cyclic) {
gps->flag |= GP_STROKE_CYCLIC;
}
/* add new stroke to frame */
if (back) {
BLI_addhead(&gpf->strokes, gps);
}
else {
BLI_addtail(&gpf->strokes, gps);
}
return gps;
}
static void gpencil_get_elements_len(bContext *C, int *totstrokes, int *totpoints)
{
bGPDspoint *pt;
int i;
/* count number of strokes and selected points */
CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) {
if (gps->flag & GP_STROKE_SELECT) {
*totstrokes += 1;
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
if (pt->flag & GP_SPOINT_SELECT) {
*totpoints += 1;
}
}
}
}
CTX_DATA_END;
}
static void gpencil_dissolve_points(bContext *C)
{
bGPDstroke *gps, *gpsn;
CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) {
bGPDframe *gpf = gpl->actframe;
if (gpf == NULL) {
continue;
}
for (gps = gpf->strokes.first; gps; gps = gpsn) {
gpsn = gps->next;
gp_stroke_delete_tagged_points(gpf, gps, gpsn, GP_SPOINT_TAG, false, 0);
}
}
CTX_DATA_END;
}
/* Calc a factor of each selected point and fill an array with all the data.
*
* The factor is calculated using an imaginary circle, using the angle relative
* to this circle and the distance to the calculated center of the selected points.
*
* All the data is saved to be sorted and used later.
*/
static void gpencil_calc_points_factor(bContext *C,
const int mode,
int totpoints,
const bool clear_point,
const bool clear_stroke,
tGPencilPointCache *src_array)
{
bGPDspoint *pt;
int i;
int idx = 0;
/* create selected point array an fill it */
bGPDstroke **gps_array = MEM_callocN(sizeof(bGPDstroke *) * totpoints, __func__);
bGPDspoint *pt_array = MEM_callocN(sizeof(bGPDspoint) * totpoints, __func__);
CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) {
bGPDframe *gpf = gpl->actframe;
if (gpf == NULL) {
continue;
}
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
if (gps->flag & GP_STROKE_SELECT) {
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
if (clear_stroke) {
pt->flag |= GP_SPOINT_TAG;
}
else {
pt->flag &= ~GP_SPOINT_TAG;
}
if (pt->flag & GP_SPOINT_SELECT) {
bGPDspoint *pt2 = &pt_array[idx];
copy_v3_v3(&pt2->x, &pt->x);
pt2->pressure = pt->pressure;
pt2->strength = pt->strength;
pt->flag &= ~GP_SPOINT_SELECT;
if (clear_point) {
pt->flag |= GP_SPOINT_TAG;
}
/* save stroke */
gps_array[idx] = gps;
idx++;
}
}
gps->flag &= ~GP_STROKE_SELECT;
}
}
}
CTX_DATA_END;
/* project in 2d plane */
int direction = 0;
float(*points2d)[2] = MEM_mallocN(sizeof(*points2d) * totpoints, "GP Stroke temp 2d points");
BKE_gpencil_stroke_2d_flat(pt_array, totpoints, points2d, &direction);
/* calc center */
float center[2] = {0.0f, 0.0f};
for (i = 0; i < totpoints; i++) {
center[0] += points2d[i][0];
center[1] += points2d[i][1];
}
mul_v2_fl(center, 1.0f / totpoints);
/* calc angle and distance to center for each point */
const float axis[2] = {1.0f, 0.0f};
float v1[3];
for (i = 0; i < totpoints; i++) {
float ln = len_v2v2(center, points2d[i]);
sub_v2_v2v2(v1, points2d[i], center);
float angle = angle_signed_v2v2(axis, v1);
if (angle < 0.0f) {
angle = fabsf(angle);
}
else {
angle = (M_PI * 2.0) - angle;
}
tGPencilPointCache *sort_pt = &src_array[i];
bGPDspoint *pt2 = &pt_array[i];
copy_v3_v3(&sort_pt->x, &pt2->x);
sort_pt->pressure = pt2->pressure;
sort_pt->strength = pt2->strength;
sort_pt->gps = gps_array[i];
if (mode == GP_MERGE_STROKE) {
sort_pt->factor = angle;
}
else {
sort_pt->factor = (angle * 100000.0f) + ln;
}
}
MEM_SAFE_FREE(points2d);
MEM_SAFE_FREE(gps_array);
MEM_SAFE_FREE(pt_array);
}
/* insert a group of points in destination array */
static int gpencil_insert_to_array(tGPencilPointCache *src_array,
tGPencilPointCache *dst_array,
int totpoints,
bGPDstroke *gps_filter,
bool reverse,
int last)
{
tGPencilPointCache *src_elem = NULL;
tGPencilPointCache *dst_elem = NULL;
int idx = 0;
for (int i = 0; i < totpoints; i++) {
if (!reverse) {
idx = i;
}
else {
idx = totpoints - i - 1;
}
src_elem = &src_array[idx];
/* check if all points or only a stroke */
if ((gps_filter != NULL) && (gps_filter != src_elem->gps)) {
continue;
}
dst_elem = &dst_array[last];
last++;
copy_v3_v3(&dst_elem->x, &src_elem->x);
dst_elem->gps = src_elem->gps;
dst_elem->pressure = src_elem->pressure;
dst_elem->strength = src_elem->strength;
dst_elem->factor = src_elem->factor;
}
return last;
}
/* get first and last point location */
static void gpencil_get_extremes(
tGPencilPointCache *src_array, int totpoints, bGPDstroke *gps_filter, float *start, float *end)
{
tGPencilPointCache *array_pt = NULL;
int i;
/* find first point */
for (i = 0; i < totpoints; i++) {
array_pt = &src_array[i];
if (gps_filter == array_pt->gps) {
copy_v3_v3(start, &array_pt->x);
break;
}
}
/* find last point */
for (i = totpoints - 1; i >= 0; i--) {
array_pt = &src_array[i];
if (gps_filter == array_pt->gps) {
copy_v3_v3(end, &array_pt->x);
break;
}
}
}
static int gpencil_analyze_strokes(tGPencilPointCache *src_array,
int totstrokes,
int totpoints,
tGPencilPointCache *dst_array)
{
int i;
int last = 0;
GHash *all_strokes = BLI_ghash_ptr_new(__func__);
/* add first stroke to array */
tGPencilPointCache *sort_pt = &src_array[0];
bGPDstroke *gps = sort_pt->gps;
last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps, false, last);
float start[3];
float end[3];
float end_prv[3];
gpencil_get_extremes(src_array, totpoints, gps, start, end);
copy_v3_v3(end_prv, end);
BLI_ghash_insert(all_strokes, sort_pt->gps, sort_pt->gps);
/* look for near stroke */
bool loop = (bool)(totstrokes > 1);
while (loop) {
bGPDstroke *gps_next = NULL;
GHash *strokes = BLI_ghash_ptr_new(__func__);
float dist_start = 0.0f;
float dist_end = 0.0f;
float dist = FLT_MAX;
bool reverse = false;
for (i = 0; i < totpoints; i++) {
sort_pt = &src_array[i];
/* avoid dups */
if (BLI_ghash_haskey(all_strokes, sort_pt->gps)) {
continue;
}
if (!BLI_ghash_haskey(strokes, sort_pt->gps)) {
gpencil_get_extremes(src_array, totpoints, sort_pt->gps, start, end);
/* distances to previous end */
dist_start = len_v3v3(end_prv, start);
dist_end = len_v3v3(end_prv, end);
if (dist > dist_start) {
gps_next = sort_pt->gps;
dist = dist_start;
reverse = false;
}
if (dist > dist_end) {
gps_next = sort_pt->gps;
dist = dist_end;
reverse = true;
}
BLI_ghash_insert(strokes, sort_pt->gps, sort_pt->gps);
}
}
BLI_ghash_free(strokes, NULL, NULL);
/* add the stroke to array */
if (gps->next != NULL) {
BLI_ghash_insert(all_strokes, gps_next, gps_next);
last = gpencil_insert_to_array(src_array, dst_array, totpoints, gps_next, reverse, last);
/* replace last end */
sort_pt = &dst_array[last - 1];
copy_v3_v3(end_prv, &sort_pt->x);
}
/* loop exit */
if (last >= totpoints) {
loop = false;
}
}
BLI_ghash_free(all_strokes, NULL, NULL);
return last;
}
static bool gp_strokes_merge_poll(bContext *C)
{
/* only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
return false;
}
/* check material */
Material *ma = NULL;
ma = BKE_material_gpencil_get(ob, ob->actcol);
if ((ma == NULL) || (ma->gp_style == NULL)) {
return false;
}
/* check hidden or locked materials */
MaterialGPencilStyle *gp_style = ma->gp_style;
if ((gp_style->flag & GP_STYLE_COLOR_HIDE) || (gp_style->flag & GP_STYLE_COLOR_LOCKED)) {
return false;
}
/* check layer */
bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
if ((gpl == NULL) || (gpl->flag & GP_LAYER_LOCKED) || (gpl->flag & GP_LAYER_HIDE)) {
return false;
}
/* NOTE: this is a bit slower, but is the most accurate... */
return (CTX_DATA_COUNT(C, editable_gpencil_strokes) != 0) && ED_operator_view3d_active(C);
}
static int gp_stroke_merge_exec(bContext *C, wmOperator *op)
{
const int mode = RNA_enum_get(op->ptr, "mode");
const bool clear_point = RNA_boolean_get(op->ptr, "clear_point");
const bool clear_stroke = RNA_boolean_get(op->ptr, "clear_stroke");
Object *ob = CTX_data_active_object(C);
/* sanity checks */
if (!ob || ob->type != OB_GPENCIL) {
return OPERATOR_CANCELLED;
}
bGPdata *gpd = (bGPdata *)ob->data;
bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
if (gpl == NULL) {
return OPERATOR_CANCELLED;
}
int totstrokes = 0;
int totpoints = 0;
/* count number of strokes and selected points */
gpencil_get_elements_len(C, &totstrokes, &totpoints);
if (totpoints == 0) {
return OPERATOR_CANCELLED;
}
/* calc factor of each point and fill an array with all data */
tGPencilPointCache *sorted_array = NULL;
tGPencilPointCache *original_array = MEM_callocN(sizeof(tGPencilPointCache) * totpoints,
__func__);
gpencil_calc_points_factor(C, mode, totpoints, clear_point, clear_stroke, original_array);
/* for strokes analyze strokes and load sorted array */
if (mode == GP_MERGE_STROKE) {
sorted_array = MEM_callocN(sizeof(tGPencilPointCache) * totpoints, __func__);
totpoints = gpencil_analyze_strokes(original_array, totstrokes, totpoints, sorted_array);
}
else {
/* make a copy to sort */
sorted_array = MEM_dupallocN(original_array);
/* sort by factor around center */
qsort(sorted_array, totpoints, sizeof(tGPencilPointCache), gpencil_sort_points);
}
/* prepare the new stroke */
bGPDstroke *gps = gpencil_prepare_stroke(C, op, totpoints);
/* copy original points to final stroke */
gpencil_insert_points_to_stroke(gps, sorted_array, totpoints);
/* dissolve all tagged points */
if ((clear_point) || (clear_stroke)) {
gpencil_dissolve_points(C);
}
/* free memory */
MEM_SAFE_FREE(original_array);
MEM_SAFE_FREE(sorted_array);
/* notifiers */
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
void GPENCIL_OT_stroke_merge(wmOperatorType *ot)
{
static const EnumPropertyItem mode_type[] = {
{GP_MERGE_STROKE, "STROKE", 0, "Stroke", ""},
{GP_MERGE_POINT, "POINT", 0, "Point", ""},
{0, NULL, 0, NULL, NULL},
};
/* identifiers */
ot->name = "Merge Strokes";
ot->idname = "GPENCIL_OT_stroke_merge";
ot->description = "Create a new stroke with the selected stroke points";
/* api callbacks */
ot->exec = gp_stroke_merge_exec;
ot->poll = gp_strokes_merge_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "mode", mode_type, GP_MERGE_STROKE, "Mode", "");
RNA_def_boolean(
ot->srna, "back", 0, "Draw on Back", "Draw new stroke below all previous strokes");
RNA_def_boolean(ot->srna, "additive", 0, "Additive Drawing", "Add to previous drawing");
RNA_def_boolean(ot->srna, "cyclic", 0, "Cyclic", "Close new stroke");
RNA_def_boolean(ot->srna, "clear_point", 0, "Dissolve Points", "Dissolve old selected points");
RNA_def_boolean(ot->srna, "clear_stroke", 0, "Delete Strokes", "Delete old selected strokes");
}
| 29.090909 | 99 | 0.630709 | [
"object"
] |
36d0d720439e4859b12d8502d1f1094d50915d67 | 11,861 | h | C | src/yb/docdb/docdb.h | nchandrappa/yugabyte-db | 508a0e997245296683bff8e2c77a5c643d845153 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/yb/docdb/docdb.h | nchandrappa/yugabyte-db | 508a0e997245296683bff8e2c77a5c643d845153 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/yb/docdb/docdb.h | nchandrappa/yugabyte-db | 508a0e997245296683bff8e2c77a5c643d845153 | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2022-01-24T11:53:58.000Z | 2022-01-24T11:53:58.000Z | // Copyright (c) YugaByte, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations
// under the License.
//
#ifndef YB_DOCDB_DOCDB_H_
#define YB_DOCDB_DOCDB_H_
#include <cstdint>
#include <ostream>
#include <string>
#include <vector>
#include <boost/function.hpp>
#include "yb/common/doc_hybrid_time.h"
#include "yb/common/hybrid_time.h"
#include "yb/common/read_hybrid_time.h"
#include "yb/common/transaction.h"
#include "yb/docdb/docdb_fwd.h"
#include "yb/docdb/shared_lock_manager_fwd.h"
#include "yb/docdb/doc_path.h"
#include "yb/docdb/doc_write_batch.h"
#include "yb/docdb/docdb.pb.h"
#include "yb/docdb/docdb_types.h"
#include "yb/docdb/lock_batch.h"
#include "yb/docdb/subdocument.h"
#include "yb/docdb/value.h"
#include "yb/rocksdb/rocksdb_fwd.h"
#include "yb/util/result.h"
#include "yb/util/strongly_typed_bool.h"
// DocDB mapping on top of the key-value map in RocksDB:
// <document_key> <hybrid_time> -> <doc_type>
// <document_key> <hybrid_time> <key_a> <gen_ts_a> -> <subdoc_a_type_or_value>
//
// Assuming the type of subdocument corresponding to key_a in the above example is "object", the
// contents of that subdocument are stored in a similar way:
// <document_key> <hybrid_time> <key_a> <gen_ts_a> <key_aa> <gen_ts_aa> -> <subdoc_aa_type_or_value>
// <document_key> <hybrid_time> <key_a> <gen_ts_a> <key_ab> <gen_ts_ab> -> <subdoc_ab_type_or_value>
// ...
//
// See doc_key.h for the encoding of the <document_key> part.
//
// <key_a>, <key_aa> are subkeys indicating a path inside a document.
// Their encoding is as follows:
// <value_type> -- one byte, see the ValueType enum.
// <value_specific_encoding> -- e.g. a big-endian 8-byte integer, or a string in a "zero encoded"
// format. This is empty for null or true/false values.
//
// <hybrid_time>, <gen_ts_a>, <gen_ts_ab> are "generation hybrid_times" corresponding to hybrid
// clock hybrid_times of the last time a particular top-level document / subdocument was fully
// overwritten or deleted.
//
// <subdoc_a_type_or_value>, <subdoc_aa_type_or_value>, <subdoc_ab_type_or_value> are values of the
// following form:
// - One-byte value type (see the ValueType enum).
// - For primitive values, the encoded value. Note: the value encoding may be different from the
// key encoding for the same data type. E.g. we only flip the sign bit for signed 64-bit
// integers when encoded as part of a RocksDB key, not value.
//
// Also see this document for a high-level overview of how we lay out JSON documents on top of
// RocksDB:
// https://docs.google.com/document/d/1uEOHUqGBVkijw_CGD568FMt8UOJdHtiE3JROUOppYBU/edit
namespace yb {
class Histogram;
namespace docdb {
class DocOperation;
// This function prepares the transaction by taking locks. The set of keys locked are returned to
// the caller via the keys_locked argument (because they need to be saved and unlocked when the
// transaction commits). A flag is also returned to indicate if any of the write operations
// requires a clean read snapshot to be taken before being applied (see DocOperation for details).
//
// Example: doc_write_ops might consist of the following operations:
// a.b = {}, a.b.c = 1, a.b.d = 2, e.d = 3
// We will generate all the lock_prefixes for the keys with lock types
// a - shared, a.b - exclusive, a - shared, a.b - shared, a.b.c - exclusive ...
// Then we will deduplicate the keys and promote shared locks to exclusive, and sort them.
// Finally, the locks taken will be in order:
// a - shared, a.b - exclusive, a.b.c - exclusive, a.b.d - exclusive, e - shared, e.d - exclusive.
// Then the sorted lock key list will be returned. (Type is not returned because it is not needed
// for unlocking)
// TODO(akashnil): If a.b is exclusive, we don't need to lock any sub-paths under it.
//
// Input: doc_write_ops
// Context: lock_manager
struct PrepareDocWriteOperationResult {
LockBatch lock_batch;
bool need_read_snapshot = false;
};
Result<PrepareDocWriteOperationResult> PrepareDocWriteOperation(
const std::vector<std::unique_ptr<DocOperation>>& doc_write_ops,
const google::protobuf::RepeatedPtrField<KeyValuePairPB>& read_pairs,
const scoped_refptr<Histogram>& write_lock_latency,
const IsolationLevel isolation_level,
const OperationKind operation_kind,
const RowMarkType row_mark_type,
bool transactional_table,
bool write_transaction_metadata,
CoarseTimePoint deadline,
PartialRangeKeyIntents partial_range_key_intents,
SharedLockManager *lock_manager);
// This constructs a DocWriteBatch using the given list of DocOperations, reading the previous
// state of data from RocksDB when necessary.
//
// Input: doc_write_ops, read snapshot hybrid_time if requested in PrepareDocWriteOperation().
// Context: rocksdb
// Outputs: keys_locked, write_batch
Status AssembleDocWriteBatch(
const std::vector<std::unique_ptr<DocOperation>>& doc_write_ops,
CoarseTimePoint deadline,
const ReadHybridTime& read_time,
const DocDB& doc_db,
KeyValueWriteBatchPB* write_batch,
InitMarkerBehavior init_marker_behavior,
std::atomic<int64_t>* monotonic_counter,
HybridTime* restart_read_ht,
const std::string& table_name);
struct ExternalTxnApplyStateData {
HybridTime commit_ht;
IntraTxnWriteId write_id = 0;
std::string ToString() const {
return YB_STRUCT_TO_STRING(commit_ht, write_id);
}
};
using ExternalTxnApplyState = std::map<TransactionId, ExternalTxnApplyStateData>;
class ExternalTxnIntentsState {
public:
IntraTxnWriteId GetWriteIdAndIncrement(const TransactionId& txn_id);
void EraseEntry(const TransactionId& txn_id);
private:
std::mutex mutex_;
std::unordered_map<TransactionId, IntraTxnWriteId, TransactionIdHash> map_;
};
// Adds external pair to write batch.
// Returns true if add was skipped because pair is a regular (non external) record.
bool AddExternalPairToWriteBatch(
const KeyValuePairPB& kv_pair,
HybridTime hybrid_time,
ExternalTxnApplyState* apply_external_transactions,
rocksdb::WriteBatch* regular_write_batch,
rocksdb::WriteBatch* intents_write_batch,
ExternalTxnIntentsState* external_txn_intents_state);
// Prepares external part of non transaction write batch.
// Batch could contain intents for external transactions, in this case those intents
// will be added to intents_write_batch.
//
// Returns true if batch contains regular entries.
bool PrepareExternalWriteBatch(
const docdb::KeyValueWriteBatchPB& put_batch,
HybridTime hybrid_time,
rocksdb::DB* intents_db,
rocksdb::WriteBatch* regular_write_batch,
rocksdb::WriteBatch* intents_write_batch,
ExternalTxnIntentsState* external_txn_intents_state);
YB_STRONGLY_TYPED_BOOL(LastKey);
// Enumerates intents corresponding to provided key value pairs.
// For each key it generates a strong intent and for each parent of each it generates a weak one.
// functor should accept 3 arguments:
// intent_kind - kind of intent weak or strong
// value_slice - value of intent
// key - pointer to key in format of SubDocKey (no ht)
// last_key - whether it is last strong key in enumeration
// Indicates that the intent contains a full document key, i.e. it does not omit any final range
// components of the document key. This flag is also true for intents that include subdocument keys.
YB_STRONGLY_TYPED_BOOL(FullDocKey);
// TODO(dtxn) don't expose this method outside of DocDB if TransactionConflictResolver is moved
// inside DocDB.
// Note: From https://stackoverflow.com/a/17278470/461529:
// "As of GCC 4.8.1, the std::function in libstdc++ optimizes only for pointers to functions and
// methods. So regardless the size of your functor (lambdas included), initializing a std::function
// from it triggers heap allocation."
// So, we use boost::function which doesn't have such issue:
// http://www.boost.org/doc/libs/1_65_1/doc/html/function/misc.html
typedef boost::function<
Status(IntentStrength, FullDocKey, Slice, KeyBytes*, LastKey)> EnumerateIntentsCallback;
Status EnumerateIntents(
const google::protobuf::RepeatedPtrField<yb::docdb::KeyValuePairPB>& kv_pairs,
const EnumerateIntentsCallback& functor, PartialRangeKeyIntents partial_range_key_intents);
Status EnumerateIntents(
Slice key, const Slice& intent_value, const EnumerateIntentsCallback& functor,
KeyBytes* encoded_key_buffer, PartialRangeKeyIntents partial_range_key_intents,
LastKey last_key = LastKey::kFalse);
// replicated_batches_state format does not matter at this point, because it is just
// appended to appropriate value.
void PrepareTransactionWriteBatch(
const docdb::KeyValueWriteBatchPB& put_batch,
HybridTime hybrid_time,
rocksdb::WriteBatch* rocksdb_write_batch,
const TransactionId& transaction_id,
IsolationLevel isolation_level,
PartialRangeKeyIntents partial_range_key_intents,
const Slice& replicated_batches_state,
IntraTxnWriteId* write_id);
struct IntentKeyValueForCDC {
Slice key;
Slice value;
std::string key_buf, value_buf;
std::string reverse_index_key;
IntraTxnWriteId write_id = 0;
std::string ToString() const;
template <class PB>
void ToPB(PB* pb) const {
pb->set_key(key);
pb->set_value(value);
pb->set_reverse_index_key(reverse_index_key);
pb->set_write_id(write_id);
}
template <class PB>
static IntentKeyValueForCDC FromPB(const PB& pb) {
return IntentKeyValueForCDC {
.key = pb.key(),
.value = pb.value(),
.reverse_index_key = pb.reverse_index_key(),
.write_id = pb.write_id(),
};
}
};
// See ApplyTransactionStatePB for details.
struct ApplyTransactionState {
std::string key;
IntraTxnWriteId write_id = 0;
AbortedSubTransactionSet aborted;
bool active() const {
return !key.empty();
}
std::string ToString() const;
template <class PB>
void ToPB(PB* pb) const {
pb->set_key(key);
pb->set_write_id(write_id);
aborted.ToPB(pb->mutable_aborted()->mutable_set());
}
template <class PB>
static Result<ApplyTransactionState> FromPB(const PB& pb) {
return ApplyTransactionState {
.key = pb.key(),
.write_id = pb.write_id(),
.aborted = VERIFY_RESULT(AbortedSubTransactionSet::FromPB(pb.aborted().set())),
};
}
};
Result<ApplyTransactionState> GetIntentsBatch(
const TransactionId& transaction_id,
const KeyBounds* key_bounds,
const ApplyTransactionState* stream_state,
rocksdb::DB* intents_db,
std::vector<IntentKeyValueForCDC>* keyValueIntents);
void AppendTransactionKeyPrefix(const TransactionId& transaction_id, docdb::KeyBytes* out);
// Class that is used while combining external intents into single key value pair.
class ExternalIntentsProvider {
public:
// Set output key.
virtual void SetKey(const Slice& slice) = 0;
// Set output value.
virtual void SetValue(const Slice& slice) = 0;
// Get next external intent, returns false when there are no more intents.
virtual boost::optional<std::pair<Slice, Slice>> Next() = 0;
virtual const Uuid& InvolvedTablet() = 0;
virtual ~ExternalIntentsProvider() = default;
};
// Combine external intents into single key value pair.
void CombineExternalIntents(
const TransactionId& txn_id,
ExternalIntentsProvider* provider);
} // namespace docdb
} // namespace yb
#endif // YB_DOCDB_DOCDB_H_
| 37.065625 | 100 | 0.749684 | [
"object",
"vector"
] |
36d3b34e213481ec2798a1bb727e80b5a6aeb4de | 1,910 | h | C | Plugins/LeapMotion/Source/LeapMotion/Public/LeapSwipeGesture.h | vrmad1/UE4-LeapMotionPlugin | 1cbbd4fe30bb2b0c7b6f1a641eb3afb69cab49ae | [
"MIT"
] | 246 | 2015-01-03T03:29:03.000Z | 2021-11-17T11:22:58.000Z | Plugins/LeapMotion/Source/LeapMotion/Public/LeapSwipeGesture.h | vrmad1/UE4-LeapMotionPlugin | 1cbbd4fe30bb2b0c7b6f1a641eb3afb69cab49ae | [
"MIT"
] | 27 | 2015-01-07T04:57:47.000Z | 2021-11-23T17:14:10.000Z | Plugins/LeapMotion/Source/LeapMotion/Public/LeapSwipeGesture.h | vrmad1/UE4-LeapMotionPlugin | 1cbbd4fe30bb2b0c7b6f1a641eb3afb69cab49ae | [
"MIT"
] | 88 | 2015-01-08T15:35:14.000Z | 2021-04-14T02:27:57.000Z | #pragma once
#include "LeapMotionPublicPCH.h"
#include "LeapGesture.h"
#include "LeapSwipeGesture.generated.h"
/**
* The SwipeGesture class represents a swiping motion a finger or tool.
* SwipeGesture objects are generated for each visible finger or tool.
* Swipe gestures are continuous; a gesture object with the same ID value
* will appear in each frame while the gesture continues.
*
* Leap API reference: https://developer.leapmotion.com/documentation/cpp/api/Leap.SwipeGesture.html
*/
UCLASS(BlueprintType)
class LEAPMOTION_API ULeapSwipeGesture : public ULeapGesture
{
GENERATED_UCLASS_BODY()
public:
~ULeapSwipeGesture();
/**
* The unit direction vector parallel to the swipe motion in basic enum form, useful for switching through common directions checks (Up/Down, Left/Right, In/Out)
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Leap Swipe Gesture")
TEnumAsByte<LeapBasicDirection> BasicDirection;
/**
* The unit direction vector parallel to the swipe motion.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Leap Swipe Gesture")
FVector Direction;
/**
* The finger performing the swipe gesture.
*
* @return A Pointable object representing the swiping finger.
*/
UFUNCTION(BlueprintCallable, Category = "Leap Swipe Gesture")
class ULeapPointable* Pointable();
/**
* The current position of the swipe.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Leap Swipe Gesture")
FVector Position;
/**
* The swipe speed in cm/second.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Leap Swipe Gesture")
float Speed;
/**
* The position where the swipe began.
*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Leap Swipe Gesture")
FVector StartPosition;
void SetGesture(const class Leap::SwipeGesture &Gesture);
private:
class PrivateSwipeGesture* Private;
UPROPERTY()
ULeapPointable* PPointable = nullptr;
}; | 28.507463 | 161 | 0.764398 | [
"object",
"vector"
] |
36e21ee7249b894c4fd838be6d55d5d4debc64b4 | 2,730 | h | C | thrift/lib/cpp/DistinctTable.h | laohubuzaijia/fbthrift | ab263311864ec93b8e52665dad954264f094137f | [
"Apache-2.0"
] | 2,112 | 2015-01-02T11:34:27.000Z | 2022-03-31T16:30:42.000Z | thrift/lib/cpp/DistinctTable.h | laohubuzaijia/fbthrift | ab263311864ec93b8e52665dad954264f094137f | [
"Apache-2.0"
] | 372 | 2015-01-05T10:40:09.000Z | 2022-03-31T20:45:11.000Z | thrift/lib/cpp/DistinctTable.h | laohubuzaijia/fbthrift | ab263311864ec93b8e52665dad954264f094137f | [
"Apache-2.0"
] | 582 | 2015-01-03T01:51:56.000Z | 2022-03-31T02:01:09.000Z | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <cassert>
#include <unordered_set>
#include <vector>
namespace apache {
namespace thrift {
template <class T>
struct BaseDistinctTablePolicy {
template <class Hash, class Equal>
using Index = std::unordered_set<size_t, Hash, Equal>;
using Hash = std::hash<T>;
using Equal = std::equal_to<T>;
using Store = std::vector<T>;
};
/**
* Accumulates only distinct values in an externally owned store.
*/
template <class T, template <class> class Policy = BaseDistinctTablePolicy>
class DistinctTable {
public:
typedef typename Policy<T>::Store Store;
typedef typename Policy<T>::Hash Hash;
typedef typename Policy<T>::Equal Equal;
explicit DistinctTable(
Store* store, Equal equal = Equal(), Hash hash = Hash())
: store_(store),
indexes_(0, HashIndirect(hash, store), EqualIndirect(equal, store)) {
assert(store->empty());
}
/**
* Construct a T given the arguments, return the index at which such a value
* can now be found, either newly or previously constructed.
*/
template <class... Args>
size_t add(Args&&... args) {
auto index = store_->size();
store_->push_back(std::forward<Args>(args)...);
auto insertion = indexes_.insert(index);
if (insertion.second) {
return index;
} else {
store_->pop_back();
return *insertion.first;
}
}
private:
class HashIndirect : public Hash {
public:
HashIndirect(Hash _hash, Store* store)
: Hash(std::move(_hash)), store_(store) {}
size_t operator()(size_t i) const { return Hash::operator()((*store_)[i]); }
private:
Store* store_;
};
class EqualIndirect : public Equal {
public:
EqualIndirect(Equal equal, Store* store)
: Equal(std::move(equal)), store_(store) {}
bool operator()(size_t a, size_t b) const {
return a == b || Equal::operator()((*store_)[a], (*store_)[b]);
}
private:
Store* store_;
};
typedef typename Policy<T>::template Index<HashIndirect, EqualIndirect> Index;
Store* store_;
Index indexes_;
};
} // namespace thrift
} // namespace apache
| 26.504854 | 80 | 0.672527 | [
"vector"
] |
d217b4d4a55b3ebf1551f576cdf341cf1571844c | 6,645 | h | C | pxr/imaging/lib/glf/uvTextureData.h | chen2qu/USD | 2bbedce05f61f37e7461b0319609f9ceeb91725e | [
"AML"
] | 88 | 2018-07-13T01:22:00.000Z | 2022-01-16T22:15:27.000Z | pxr/imaging/lib/glf/uvTextureData.h | chen2qu/USD | 2bbedce05f61f37e7461b0319609f9ceeb91725e | [
"AML"
] | 1 | 2022-01-14T21:25:56.000Z | 2022-01-14T21:25:56.000Z | pxr/imaging/lib/glf/uvTextureData.h | chen2qu/USD | 2bbedce05f61f37e7461b0319609f9ceeb91725e | [
"AML"
] | 26 | 2018-06-06T03:39:22.000Z | 2021-08-28T23:02:42.000Z | //
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef GLF_UVTEXTURE_DATA_H
#define GLF_UVTEXTURE_DATA_H
#include "pxr/pxr.h"
#include "pxr/imaging/glf/api.h"
#include "pxr/imaging/glf/image.h"
#include "pxr/imaging/glf/baseTextureData.h"
#include <boost/shared_ptr.hpp>
#include <memory>
#include <string>
PXR_NAMESPACE_OPEN_SCOPE
typedef boost::shared_ptr<class GlfImage> GlfImageSharedPtr;
TF_DECLARE_WEAK_AND_REF_PTRS(GlfUVTextureData);
class GlfUVTextureData : public GlfBaseTextureData {
public:
struct Params {
Params()
: targetMemory(0)
, cropTop(0)
, cropBottom(0)
, cropLeft(0)
, cropRight(0)
{ }
bool operator==(const Params& rhs) const
{
return (targetMemory == rhs.targetMemory &&
cropTop == rhs.cropTop &&
cropBottom == rhs.cropBottom &&
cropLeft == rhs.cropLeft &&
cropRight == rhs.cropRight);
}
bool operator!=(const Params& rhs) const
{
return !(*this == rhs);
}
size_t targetMemory;
unsigned int cropTop, cropBottom, cropLeft, cropRight;
};
GLF_API
static GlfUVTextureDataRefPtr
New(std::string const &filePath,
size_t targetMemory,
unsigned int cropTop,
unsigned int cropBottom,
unsigned int cropLeft,
unsigned int cropRight);
GLF_API
static GlfUVTextureDataRefPtr
New(std::string const &filePath, Params const ¶ms);
const Params& GetParams() const { return _params; }
// GlfBaseTextureData overrides
GLF_API
virtual int ResizedWidth(int mipLevel = 0) const;
GLF_API
virtual int ResizedHeight(int mipLevel = 0) const;
virtual GLenum GLInternalFormat() const {
return _glInternalFormat;
};
virtual GLenum GLFormat() const {
return _glFormat;
};
virtual GLenum GLType() const {
return _glType;
};
virtual size_t TargetMemory() const {
return _targetMemory;
};
virtual WrapInfo GetWrapInfo() const {
return _wrapInfo;
};
GLF_API
virtual size_t ComputeBytesUsed() const;
GLF_API
virtual size_t ComputeBytesUsedByMip(int mipLevel = 0) const;
GLF_API
virtual bool HasRawBuffer(int mipLevel = 0) const;
GLF_API
virtual unsigned char * GetRawBuffer(int mipLevel = 0) const;
GLF_API
virtual bool Read(int degradeLevel, bool generateMipmap,
GlfImage::ImageOriginLocation originLocation =
GlfImage::OriginUpperLeft);
GLF_API
virtual int GetNumMipLevels() const;
private:
// A structure that keeps the mips loaded from disk in the format
// that the gpu needs.
struct Mip {
Mip()
: size(0), offset(0), width(0), height(0)
{ }
size_t size;
size_t offset;
int width;
int height;
};
// A structure keeping a down-sampled image input and floats indicating the
// downsample rate (e.g., if the resolution changed from 2048x1024 to
// 512x256, scaleX=0.25 and scaleY=0.25).
struct _DegradedImageInput {
_DegradedImageInput(double scaleX, double scaleY,
GlfImageSharedPtr image) : scaleX(scaleX), scaleY(scaleY)
{
images.push_back(image);
}
_DegradedImageInput(double scaleX, double scaleY)
: scaleX(scaleX), scaleY(scaleY)
{ }
double scaleX;
double scaleY;
std::vector<GlfImageSharedPtr> images;
};
// Reads an image using GlfImage. If possible and requested, it will
// load a down-sampled version (when mipmapped .tex file) of the image.
// If targetMemory is > 0, it will iterate through the down-sampled version
// until the estimated required GPU memory is smaller than targetMemory.
// Otherwise, it will use the given degradeLevel.
// When estimating the required GPU memory, it will take into account that
// the GPU might generate MipMaps.
_DegradedImageInput _ReadDegradedImageInput(bool generateMipmap,
size_t targetMemory,
size_t degradeLevel);
// Helper to read degraded image chains, given a starting mip and an
// ending mip it will fill the image chain.
_DegradedImageInput _GetDegradedImageInputChain(double scaleX,
double scaleY,
int startMip,
int lastMip);
// Given a GlfImage it will return the number of mip levels that
// are actually valid to be loaded to the GPU. For instance, it will
// drop textures with non valid OpenGL pyramids.
int _GetNumMipLevelsValid(const GlfImageSharedPtr image) const;
GlfUVTextureData(std::string const &filePath, Params const ¶ms);
virtual ~GlfUVTextureData();
const std::string _filePath;
const Params _params;
size_t _targetMemory;
int _nativeWidth, _nativeHeight;
int _resizedWidth, _resizedHeight;
int _bytesPerPixel;
GLenum _glInternalFormat, _glFormat, _glType;
WrapInfo _wrapInfo;
size_t _size;
std::unique_ptr<unsigned char[]> _rawBuffer;
std::vector<Mip> _rawBufferMips;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // GLF_UVTEXTURE_DATA_H
| 30.62212 | 79 | 0.637171 | [
"vector"
] |
d2181b0e36b73853a5b76daf54c78e4dc4d9074c | 14,839 | h | C | original/IntelliKeys/WindowsOld/Control Panel/REALbasic Plugin and bundle/QT6/Interfaces & Libraries/QTDevWin/CIncludes/QD3DTransform.h | ATMakersBill/OpenIKeys | 629f88a35322245c623f59f387cc39a2444f02c4 | [
"MIT"
] | 11 | 2017-10-24T16:46:14.000Z | 2021-02-20T13:11:35.000Z | original/IntelliKeys/WindowsOld/Control Panel/REALbasic Plugin and bundle/QT6/Interfaces & Libraries/QTDevWin/CIncludes/QD3DTransform.h | ATMakersBill/OpenIKeys | 629f88a35322245c623f59f387cc39a2444f02c4 | [
"MIT"
] | 7 | 2017-11-03T22:30:12.000Z | 2021-01-15T02:51:07.000Z | original/IntelliKeys/WindowsOld/Control Panel/REALbasic Plugin and bundle/QT6/Interfaces & Libraries/QTDevWin/CIncludes/QD3DTransform.h | ATMakersBill/OpenIKeys | 629f88a35322245c623f59f387cc39a2444f02c4 | [
"MIT"
] | 4 | 2018-02-23T09:58:50.000Z | 2019-03-06T02:46:55.000Z | /*
File: QD3DTransform.h
Contains: Q3Transform routines
Version: Technology: Quickdraw 3D 1.6
Release: QuickTime 6.0.2
Copyright: (c) 1995-2001 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __QD3DTRANSFORM__
#define __QD3DTRANSFORM__
#ifndef __QD3D__
#include <QD3D.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=power
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
#if PRAGMA_ENUM_ALWAYSINT
#if defined(__fourbyteints__) && !__fourbyteints__
#define __QD3DTRANSFORM__RESTORE_TWOBYTEINTS
#pragma fourbyteints on
#endif
#pragma enumsalwaysint on
#elif PRAGMA_ENUM_OPTIONS
#pragma option enum=int
#elif PRAGMA_ENUM_PACK
#if __option(pack_enums)
#define __QD3DTRANSFORM__RESTORE_PACKED_ENUMS
#pragma options(!pack_enums)
#endif
#endif
/******************************************************************************
** **
** Transform Routines **
** **
*****************************************************************************/
#if CALL_NOT_IN_CARBON
EXTERN_API_C( TQ3ObjectType )
Q3Transform_GetType (TQ3TransformObject transform);
EXTERN_API_C( TQ3Matrix4x4 *)
Q3Transform_GetMatrix (TQ3TransformObject transform,
TQ3Matrix4x4 * matrix);
EXTERN_API_C( TQ3Status )
Q3Transform_Submit (TQ3TransformObject transform,
TQ3ViewObject view);
/******************************************************************************
** **
** MatrixTransform Routines **
** **
*****************************************************************************/
EXTERN_API_C( TQ3TransformObject )
Q3MatrixTransform_New (const TQ3Matrix4x4 * matrix);
EXTERN_API_C( TQ3Status )
Q3MatrixTransform_Submit (const TQ3Matrix4x4 * matrix,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3MatrixTransform_Set (TQ3TransformObject transform,
const TQ3Matrix4x4 * matrix);
EXTERN_API_C( TQ3Status )
Q3MatrixTransform_Get (TQ3TransformObject transform,
TQ3Matrix4x4 * matrix);
/******************************************************************************
** **
** RotateTransform Data **
** **
*****************************************************************************/
#endif /* CALL_NOT_IN_CARBON */
struct TQ3RotateTransformData {
TQ3Axis axis;
float radians;
};
typedef struct TQ3RotateTransformData TQ3RotateTransformData;
/******************************************************************************
** **
** RotateTransform Routines **
** **
*****************************************************************************/
#if CALL_NOT_IN_CARBON
EXTERN_API_C( TQ3TransformObject )
Q3RotateTransform_New (const TQ3RotateTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_Submit (const TQ3RotateTransformData * data,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_SetData (TQ3TransformObject transform,
const TQ3RotateTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_GetData (TQ3TransformObject transform,
TQ3RotateTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_SetAxis (TQ3TransformObject transform,
TQ3Axis axis);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_SetAngle (TQ3TransformObject transform,
float radians);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_GetAxis (TQ3TransformObject renderable,
TQ3Axis * axis);
EXTERN_API_C( TQ3Status )
Q3RotateTransform_GetAngle (TQ3TransformObject transform,
float * radians);
/******************************************************************************
** **
** RotateAboutPointTransform Data **
** **
*****************************************************************************/
#endif /* CALL_NOT_IN_CARBON */
struct TQ3RotateAboutPointTransformData {
TQ3Axis axis;
float radians;
TQ3Point3D about;
};
typedef struct TQ3RotateAboutPointTransformData TQ3RotateAboutPointTransformData;
/******************************************************************************
** **
** RotateAboutPointTransform Routines **
** **
*****************************************************************************/
#if CALL_NOT_IN_CARBON
EXTERN_API_C( TQ3TransformObject )
Q3RotateAboutPointTransform_New (const TQ3RotateAboutPointTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_Submit (const TQ3RotateAboutPointTransformData * data,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_SetData (TQ3TransformObject transform,
const TQ3RotateAboutPointTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_GetData (TQ3TransformObject transform,
TQ3RotateAboutPointTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_SetAxis (TQ3TransformObject transform,
TQ3Axis axis);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_GetAxis (TQ3TransformObject transform,
TQ3Axis * axis);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_SetAngle (TQ3TransformObject transform,
float radians);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_GetAngle (TQ3TransformObject transform,
float * radians);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_SetAboutPoint (TQ3TransformObject transform,
const TQ3Point3D * about);
EXTERN_API_C( TQ3Status )
Q3RotateAboutPointTransform_GetAboutPoint (TQ3TransformObject transform,
TQ3Point3D * about);
/******************************************************************************
** **
** RotateAboutAxisTransform Data **
** **
*****************************************************************************/
#endif /* CALL_NOT_IN_CARBON */
struct TQ3RotateAboutAxisTransformData {
TQ3Point3D origin;
TQ3Vector3D orientation;
float radians;
};
typedef struct TQ3RotateAboutAxisTransformData TQ3RotateAboutAxisTransformData;
/******************************************************************************
** **
** RotateAboutAxisTransform Routines **
** **
*****************************************************************************/
#if CALL_NOT_IN_CARBON
EXTERN_API_C( TQ3TransformObject )
Q3RotateAboutAxisTransform_New (const TQ3RotateAboutAxisTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_Submit (const TQ3RotateAboutAxisTransformData * data,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_SetData (TQ3TransformObject transform,
const TQ3RotateAboutAxisTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_GetData (TQ3TransformObject transform,
TQ3RotateAboutAxisTransformData * data);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_SetOrientation (TQ3TransformObject transform,
const TQ3Vector3D * axis);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_GetOrientation (TQ3TransformObject transform,
TQ3Vector3D * axis);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_SetAngle (TQ3TransformObject transform,
float radians);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_GetAngle (TQ3TransformObject transform,
float * radians);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_SetOrigin (TQ3TransformObject transform,
const TQ3Point3D * origin);
EXTERN_API_C( TQ3Status )
Q3RotateAboutAxisTransform_GetOrigin (TQ3TransformObject transform,
TQ3Point3D * origin);
/******************************************************************************
** **
** ScaleTransform Routines **
** **
*****************************************************************************/
EXTERN_API_C( TQ3TransformObject )
Q3ScaleTransform_New (const TQ3Vector3D * scale);
EXTERN_API_C( TQ3Status )
Q3ScaleTransform_Submit (const TQ3Vector3D * scale,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3ScaleTransform_Set (TQ3TransformObject transform,
const TQ3Vector3D * scale);
EXTERN_API_C( TQ3Status )
Q3ScaleTransform_Get (TQ3TransformObject transform,
TQ3Vector3D * scale);
/******************************************************************************
** **
** TranslateTransform Routines **
** **
*****************************************************************************/
EXTERN_API_C( TQ3TransformObject )
Q3TranslateTransform_New (const TQ3Vector3D * translate);
EXTERN_API_C( TQ3Status )
Q3TranslateTransform_Submit (const TQ3Vector3D * translate,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3TranslateTransform_Set (TQ3TransformObject transform,
const TQ3Vector3D * translate);
EXTERN_API_C( TQ3Status )
Q3TranslateTransform_Get (TQ3TransformObject transform,
TQ3Vector3D * translate);
/******************************************************************************
** **
** QuaternionTransform Routines **
** **
*****************************************************************************/
EXTERN_API_C( TQ3TransformObject )
Q3QuaternionTransform_New (const TQ3Quaternion * quaternion);
EXTERN_API_C( TQ3Status )
Q3QuaternionTransform_Submit (const TQ3Quaternion * quaternion,
TQ3ViewObject view);
EXTERN_API_C( TQ3Status )
Q3QuaternionTransform_Set (TQ3TransformObject transform,
const TQ3Quaternion * quaternion);
EXTERN_API_C( TQ3Status )
Q3QuaternionTransform_Get (TQ3TransformObject transform,
TQ3Quaternion * quaternion);
/******************************************************************************
** **
** ResetTransform Routines **
** **
*****************************************************************************/
EXTERN_API_C( TQ3TransformObject )
Q3ResetTransform_New (void);
EXTERN_API_C( TQ3Status )
Q3ResetTransform_Submit (TQ3ViewObject view);
#endif /* CALL_NOT_IN_CARBON */
#if PRAGMA_ENUM_ALWAYSINT
#pragma enumsalwaysint reset
#ifdef __QD3DTRANSFORM__RESTORE_TWOBYTEINTS
#pragma fourbyteints off
#endif
#elif PRAGMA_ENUM_OPTIONS
#pragma option enum=reset
#elif defined(__QD3DTRANSFORM__RESTORE_PACKED_ENUMS)
#pragma options(pack_enums)
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __QD3DTRANSFORM__ */
| 49.463333 | 82 | 0.457578 | [
"transform",
"3d"
] |
d21d2fac5ef4d83a48ae6ae972e5368469c80bfe | 1,779 | h | C | cartographer/mapping/3d/range_data_inserter_3d.h | ablk/cartographer | 81d34ef18548bb35d0e1c1c4832d3f3e6031603b | [
"Apache-2.0"
] | 1 | 2020-10-14T03:06:31.000Z | 2020-10-14T03:06:31.000Z | cartographer/mapping/3d/range_data_inserter_3d.h | ablk/cartographer | 81d34ef18548bb35d0e1c1c4832d3f3e6031603b | [
"Apache-2.0"
] | null | null | null | cartographer/mapping/3d/range_data_inserter_3d.h | ablk/cartographer | 81d34ef18548bb35d0e1c1c4832d3f3e6031603b | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2016 The Cartographer Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CARTOGRAPHER_MAPPING_3D_RANGE_DATA_INSERTER_3D_H_
#define CARTOGRAPHER_MAPPING_3D_RANGE_DATA_INSERTER_3D_H_
#include "cartographer/mapping/3d/hybrid_grid.h"
#include "cartographer/mapping/proto/range_data_inserter_options_3d.pb.h"
#include "cartographer/sensor/point_cloud.h"
#include "cartographer/sensor/range_data.h"
namespace cartographer {
namespace mapping {
proto::RangeDataInserterOptions3D CreateRangeDataInserterOptions3D(
common::LuaParameterDictionary* parameter_dictionary);
class RangeDataInserter3D {
public:
explicit RangeDataInserter3D(
const proto::RangeDataInserterOptions3D& options);
RangeDataInserter3D(const RangeDataInserter3D&) = delete;
RangeDataInserter3D& operator=(const RangeDataInserter3D&) = delete;
// Inserts 'range_data' into 'hybrid_grid'.
void Insert(const sensor::RangeData& range_data,
HybridGrid* hybrid_grid) const;
private:
const proto::RangeDataInserterOptions3D options_;
const std::vector<uint16> hit_table_;
const std::vector<uint16> miss_table_;
};
} // namespace mapping
} // namespace cartographer
#endif // CARTOGRAPHER_MAPPING_3D_RANGE_DATA_INSERTER_3D_H_
| 33.566038 | 75 | 0.783024 | [
"vector",
"3d"
] |
d220392bb0f717d7581696368b059e26b097f971 | 5,776 | h | C | minix/drivers/net/fxp/mii.h | calmsacibis995/minix | dfba95598f553b6560131d35a76658f1f8c9cf38 | [
"Unlicense"
] | 3 | 2021-10-07T18:19:37.000Z | 2021-10-07T19:02:14.000Z | minix/drivers/net/fxp/mii.h | calmsacibis995/minix | dfba95598f553b6560131d35a76658f1f8c9cf38 | [
"Unlicense"
] | null | null | null | minix/drivers/net/fxp/mii.h | calmsacibis995/minix | dfba95598f553b6560131d35a76658f1f8c9cf38 | [
"Unlicense"
] | 3 | 2021-12-02T11:09:09.000Z | 2022-01-25T21:31:23.000Z | /*
ibm/mii.h
Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
Definitions for the Media Independent (Ethernet) Interface
*/
#ifndef _FXP_MII_H
#define _FXP_MII_H
/* Registers in the Machine Independent Interface (MII) to the PHY.
* IEEE 802.3 (2000 Edition) Clause 22.
*/
#define MII_CTRL 0x0 /* Control Register (basic) */
#define MII_CTRL_RST 0x8000 /* Reset PHY */
#define MII_CTRL_LB 0x4000 /* Enable Loopback Mode */
#define MII_CTRL_SP_LSB 0x2000 /* Speed Selection (LSB) */
#define MII_CTRL_ANE 0x1000 /* Auto Negotiation Enable */
#define MII_CTRL_PD 0x0800 /* Power Down */
#define MII_CTRL_ISO 0x0400 /* Isolate */
#define MII_CTRL_RAN 0x0200 /* Restart Auto-Negotiation Process */
#define MII_CTRL_DM 0x0100 /* Full Duplex */
#define MII_CTRL_CT 0x0080 /* Enable COL Signal Test */
#define MII_CTRL_SP_MSB 0x0040 /* Speed Selection (MSB) */
#define MII_CTRL_SP_10 0x0000 /* 10 Mb/s */
#define MII_CTRL_SP_100 0x2000 /* 100 Mb/s */
#define MII_CTRL_SP_1000 0x0040 /* 1000 Mb/s */
#define MII_CTRL_SP_RES 0x2040 /* Reserved */
#define MII_CTRL_RES 0x003F /* Reserved */
#define MII_STATUS 0x1 /* Status Register (basic) */
#define MII_STATUS_100T4 0x8000 /* 100Base-T4 support */
#define MII_STATUS_100XFD 0x4000 /* 100Base-X FD support */
#define MII_STATUS_100XHD 0x2000 /* 100Base-X HD support */
#define MII_STATUS_10FD 0x1000 /* 10 Mb/s FD support */
#define MII_STATUS_10HD 0x0800 /* 10 Mb/s HD support */
#define MII_STATUS_100T2FD 0x0400 /* 100Base-T2 FD support */
#define MII_STATUS_100T2HD 0x0200 /* 100Base-T2 HD support */
#define MII_STATUS_EXT_STAT 0x0100 /* Supports MII_EXT_STATUS */
#define MII_STATUS_RES 0x0080 /* Reserved */
#define MII_STATUS_MFPS 0x0040 /* MF Preamble Suppression */
#define MII_STATUS_ANC 0x0020 /* Auto-Negotiation Completed */
#define MII_STATUS_RF 0x0010 /* Remote Fault Detected */
#define MII_STATUS_ANA 0x0008 /* Auto-Negotiation Ability */
#define MII_STATUS_LS 0x0004 /* Link Up */
#define MII_STATUS_JD 0x0002 /* Jabber Condition Detected */
#define MII_STATUS_EC 0x0001 /* Ext Register Capabilities */
#define MII_PHYID_H 0x2 /* PHY ID (high) */
#define MII_PH_OUI_H_MASK 0xFFFF /* High part of OUI */
#define MII_PH_OUI_H_C_SHIFT 6 /* Shift up in OUI */
#define MII_PHYID_L 0x3 /* PHY ID (low) */
#define MII_PL_OUI_L_MASK 0xFC00 /* Low part of OUI */
#define MII_PL_OUI_L_SHIFT 10
#define MII_PL_MODEL_MASK 0x03F0 /* Model */
#define MII_PL_MODEL_SHIFT 4
#define MII_PL_REV_MASK 0x000F /* Revision */
#define MII_ANA 0x4 /* Auto-Negotiation Advertisement */
#define MII_ANA_NP 0x8000 /* Next PAge */
#define MII_ANA_RES 0x4000 /* Reserved */
#define MII_ANA_RF 0x2000 /* Remote Fault */
#define MII_ANA_TAF_M 0x1FE0 /* Technology Ability Field */
#define MII_ANA_TAF_S 5 /* Shift */
#define MII_ANA_TAF_RES 0x1000 /* Reserved */
#define MII_ANA_PAUSE_ASYM 0x0800 /* Asym. Pause */
#define MII_ANA_PAUSE_SYM 0x0400 /* Sym. Pause */
#define MII_ANA_100T4 0x0200 /* 100Base-T4 */
#define MII_ANA_100TXFD 0x0100 /* 100Base-TX FD */
#define MII_ANA_100TXHD 0x0080 /* 100Base-TX HD */
#define MII_ANA_10TFD 0x0040 /* 10Base-T FD */
#define MII_ANA_10THD 0x0020 /* 10Base-T HD */
#define MII_ANA_SEL_M 0x001F /* Selector Field */
#define MII_ANA_SEL_802_3 0x0001 /* 802.3 */
#define MII_ANLPA 0x5 /* Auto-Neg Link Partner Ability Register */
#define MII_ANLPA_NP 0x8000 /* Next Page */
#define MII_ANLPA_ACK 0x4000 /* Acknowledge */
#define MII_ANLPA_RF 0x2000 /* Remote Fault */
#define MII_ANLPA_TAF_M 0x1FC0 /* Technology Ability Field */
#define MII_ANLPA_SEL_M 0x001F /* Selector Field */
#define MII_ANE 0x6 /* Auto-Negotiation Expansion */
#define MII_ANE_RES 0xFFE0 /* Reserved */
#define MII_ANE_PDF 0x0010 /* Parallel Detection Fault */
#define MII_ANE_LPNPA 0x0008 /* Link Partner is Next Page Able */
#define MII_ANE_NPA 0x0002 /* Local Device is Next Page Able */
#define MII_ANE_PR 0x0002 /* New Page has been received */
#define MII_ANE_LPANA 0x0001 /* Link Partner is Auto-Neg.able */
#define MII_ANNPT 0x7 /* Auto-Negotiation Next Page Transmit */
#define MII_ANLPRNP 0x8 /* Auto-Neg Link Partner Received Next Page */
#define MII_MS_CTRL 0x9 /* MASTER-SLAVE Control Register */
#define MII_MSC_TEST_MODE 0xE000 /* Test mode */
#define MII_MSC_MS_MANUAL 0x1000 /* Master/slave manual config */
#define MII_MSC_MS_VAL 0x0800 /* Master/slave value */
#define MII_MSC_MULTIPORT 0x0400 /* Multi-port device */
#define MII_MSC_1000T_FD 0x0200 /* 1000Base-T Full Duplex */
#define MII_MSC_1000T_HD 0x0100 /* 1000Base-T Half Duplex */
#define MII_MSC_RES 0x00FF /* Reserved */
#define MII_MS_STATUS 0xA /* MASTER-SLAVE Status Register */
#define MII_MSS_FAULT 0x8000 /* Master/slave config fault */
#define MII_MSS_MASTER 0x4000 /* Master */
#define MII_MSS_LOCREC 0x2000 /* Local Receiver OK */
#define MII_MSS_REMREC 0x1000 /* Remote Receiver OK */
#define MII_MSS_LP1000T_FD 0x0800 /* Link Partner 1000-T FD */
#define MII_MSS_LP1000T_HD 0x0400 /* Link Partner 1000-T HD */
#define MII_MSS_RES 0x0300 /* Reserved */
#define MII_MSS_IDLE_ERR 0x00FF /* Idle Error Counter */
/* 0xB ... 0xE */ /* Reserved */
#define MII_EXT_STATUS 0xF /* Extended Status */
#define MII_ESTAT_1000XFD 0x8000 /* 1000Base-X Full Duplex */
#define MII_ESTAT_1000XHD 0x4000 /* 1000Base-X Half Duplex */
#define MII_ESTAT_1000TFD 0x2000 /* 1000Base-T Full Duplex */
#define MII_ESTAT_1000THD 0x1000 /* 1000Base-T Half Duplex */
#define MII_ESTAT_RES 0x0FFF /* Reserved */
/* 0x10 ... 0x1F */ /* Vendor Specific */
void mii_print_stat_speed(u16_t stat, u16_t extstat);
void mii_print_techab(u16_t techab);
#endif
/*
* $PchId: mii.h,v 1.1 2004/12/27 13:33:30 philip Exp $
*/
| 47.735537 | 70 | 0.733033 | [
"model"
] |
d220f65d85332a1b9edf74c12af39cfd3eabc25d | 2,567 | h | C | include/llvm/CodeGen/GlobalISel/CombinerHelper.h | sperezglz/llvm | a488f0fa72863b991a860fe1caa4eda020498bbb | [
"Apache-2.0"
] | 2 | 2015-01-27T05:07:21.000Z | 2020-11-12T16:46:44.000Z | include/llvm/CodeGen/GlobalISel/CombinerHelper.h | sperezglz/llvm | a488f0fa72863b991a860fe1caa4eda020498bbb | [
"Apache-2.0"
] | null | null | null | include/llvm/CodeGen/GlobalISel/CombinerHelper.h | sperezglz/llvm | a488f0fa72863b991a860fe1caa4eda020498bbb | [
"Apache-2.0"
] | 3 | 2015-04-14T18:51:28.000Z | 2019-07-06T18:02:05.000Z | //===-- llvm/CodeGen/GlobalISel/CombinerHelper.h --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------------------------------------------------------===//
//
/// This contains common combine transformations that may be used in a combine
/// pass,or by the target elsewhere.
/// Targets can pick individual opcode transformations from the helper or use
/// tryCombine which invokes all transformations. All of the transformations
/// return true if the MachineInstruction changed and false otherwise.
//
//===--------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GLOBALISEL_COMBINER_HELPER_H
#define LLVM_CODEGEN_GLOBALISEL_COMBINER_HELPER_H
#include "llvm/CodeGen/LowLevelType.h"
#include "llvm/CodeGen/Register.h"
namespace llvm {
class GISelChangeObserver;
class MachineIRBuilder;
class MachineRegisterInfo;
class MachineInstr;
class MachineOperand;
struct PreferredTuple {
LLT Ty; // The result type of the extend.
unsigned ExtendOpcode; // G_ANYEXT/G_SEXT/G_ZEXT
MachineInstr *MI;
};
class CombinerHelper {
MachineIRBuilder &Builder;
MachineRegisterInfo &MRI;
GISelChangeObserver &Observer;
public:
CombinerHelper(GISelChangeObserver &Observer, MachineIRBuilder &B);
/// MachineRegisterInfo::replaceRegWith() and inform the observer of the changes
void replaceRegWith(MachineRegisterInfo &MRI, Register FromReg, Register ToReg) const;
/// Replace a single register operand with a new register and inform the
/// observer of the changes.
void replaceRegOpWith(MachineRegisterInfo &MRI, MachineOperand &FromRegOp,
Register ToReg) const;
/// If \p MI is COPY, try to combine it.
/// Returns true if MI changed.
bool tryCombineCopy(MachineInstr &MI);
bool matchCombineCopy(MachineInstr &MI);
void applyCombineCopy(MachineInstr &MI);
/// If \p MI is extend that consumes the result of a load, try to combine it.
/// Returns true if MI changed.
bool tryCombineExtendingLoads(MachineInstr &MI);
bool matchCombineExtendingLoads(MachineInstr &MI, PreferredTuple &MatchInfo);
void applyCombineExtendingLoads(MachineInstr &MI, PreferredTuple &MatchInfo);
/// Try to transform \p MI by using all of the above
/// combine functions. Returns true if changed.
bool tryCombine(MachineInstr &MI);
};
} // namespace llvm
#endif
| 35.652778 | 88 | 0.704324 | [
"transform"
] |
d22101866125961f4342ed02c4c310c24d0c5a57 | 2,806 | h | C | src/utils/voyager_eventloop.h | pengdu/bubblefs | 9b27e191a287b3a1d012adfd3bab6a30629a5f33 | [
"BSD-3-Clause"
] | 1 | 2021-01-11T14:19:51.000Z | 2021-01-11T14:19:51.000Z | src/utils/voyager_eventloop.h | pengdu/bubblefs | 9b27e191a287b3a1d012adfd3bab6a30629a5f33 | [
"BSD-3-Clause"
] | null | null | null | src/utils/voyager_eventloop.h | pengdu/bubblefs | 9b27e191a287b3a1d012adfd3bab6a30629a5f33 | [
"BSD-3-Clause"
] | null | null | null | // Copyright (c) 2016 Mirants Lu. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// voyager/voyager/core/eventloop.h
#ifndef BUBBLEFS_UTILS_VOYAGER_EVENTLOOP_H_
#define BUBBLEFS_UTILS_VOYAGER_EVENTLOOP_H_
#include <atomic>
#include <functional>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
#include <unordered_map>
#include <utility>
#include <vector>
#include "utils/voyager_callback.h"
namespace bubblefs {
namespace myvoyager {
class Dispatch;
class EventPoller;
class Timer;
class TimerList;
typedef std::pair<uint64_t, Timer*> TimerId;
enum PollType { kSelect, kPoll, kEpoll };
class EventLoop {
public:
typedef std::function<void()> Func;
explicit EventLoop(PollType type = kEpoll);
~EventLoop();
void Loop();
void Exit();
void RunInLoop(const Func& func);
void QueueInLoop(const Func& func);
void RunInLoop(Func&& func);
void QueueInLoop(Func&& func);
TimerId RunAt(uint64_t micros_value, const TimerProcCallback& cb);
TimerId RunAfter(uint64_t micros_delay, const TimerProcCallback& cb);
TimerId RunEvery(uint64_t micros_interval, const TimerProcCallback& cb);
TimerId RunAt(uint64_t micros_value, TimerProcCallback&& cb);
TimerId RunAfter(uint64_t micros_delay, TimerProcCallback&& cb);
TimerId RunEvery(uint64_t micros_interval, TimerProcCallback&& cb);
void RemoveTimer(TimerId t);
void AssertInMyLoop() {
if (!IsInMyLoop()) {
Abort();
}
}
bool IsInMyLoop() const { return tid_ == std::this_thread::get_id(); }
PollType GetPollType() const { return type_; }
// the eventloop of current thread.
static EventLoop* RunLoop();
// only internal use
void RemoveDispatch(Dispatch* dispatch);
void UpdateDispatch(Dispatch* dispatch);
bool HasDispatch(Dispatch* dispatch);
void AddConnection(const TcpConnectionPtr& ptr);
void RemoveConnection(const TcpConnectionPtr& ptr);
int ConnectionSize() const { return connection_size_; }
static int AllConnectionSize() { return all_connection_size_; }
private:
void RunFuncs();
void HandleRead();
void Abort();
void WakeUp();
static std::atomic<int> all_connection_size_;
const std::thread::id tid_;
const PollType type_;
bool exit_;
bool run_;
std::atomic<int> connection_size_;
std::unique_ptr<EventPoller> poller_;
std::unique_ptr<TimerList> timers_;
int wakeup_fd_[2];
std::unique_ptr<Dispatch> wakeup_dispatch_;
std::mutex mutex_;
std::vector<Func> funcs_;
std::unordered_map<std::string, TcpConnectionPtr> connections_;
// No copying allowed
EventLoop(const EventLoop&);
void operator=(const EventLoop&);
};
} // namespace myvoyager
} // namespace bubblefs
#endif // BUBBLEFS_UTILS_VOYAGER_EVENTLOOP_H_ | 24.4 | 74 | 0.739487 | [
"vector"
] |
d2242eed3266b5b4be7ace81f300ec4e07267045 | 3,842 | h | C | LEDA/incl/LEDA/core/array2.h | 2ashish/smallest_enclosing_circle | 889916a3011ab2b649ab7f1fc1e042f879acecce | [
"MIT"
] | null | null | null | LEDA/incl/LEDA/core/array2.h | 2ashish/smallest_enclosing_circle | 889916a3011ab2b649ab7f1fc1e042f879acecce | [
"MIT"
] | null | null | null | LEDA/incl/LEDA/core/array2.h | 2ashish/smallest_enclosing_circle | 889916a3011ab2b649ab7f1fc1e042f879acecce | [
"MIT"
] | null | null | null | /*******************************************************************************
+
+ LEDA 6.3
+
+
+ array2.h
+
+
+ Copyright (c) 1995-2010
+ by Algorithmic Solutions Software GmbH
+ All rights reserved.
+
*******************************************************************************/
#ifndef LEDA_ARRAY2_H
#define LEDA_ARRAY2_H
#if !defined(LEDA_ROOT_INCL_ID)
#define LEDA_ROOT_INCL_ID 600042
#include <LEDA/internal/PREAMBLE.h>
#endif
#include <LEDA/core/array.h>
//--------------------------------------------------------------------------
// 2 dimensional arrays
//--------------------------------------------------------------------------
LEDA_BEGIN_NAMESPACE
/*{\Manpage {array2} {E} {Two Dimensional Arrays} }*/
template<class E>
class array2 {
/*{\Mdefinition
An instance $A$ of the parameterized data type |\Mname| is a mapping from a
set of pairs $I = [a..b] \times [c..d]$, called the index set of $A$, to the
set of variables of data type $E$, called the element type of $A$, for two
fixed intervals of integers $[a..b]$ and $[c..d]$. $A(i,j)$ is called the
element at position $(i,j)$.
}*/
int l1;
int h1;
int l2;
int h2;
int dim1;
int dim2;
int sz;
E* vec;
public:
/*{\Mcreation A }*/
array2(int a, int b, int c, int d) : l1(a), h1(b), l2(c), h2(d)
{ dim1 = b-a+1;
dim2 = d-c+1;
sz = dim1*dim2;
vec = LEDA_NEW_VECTOR(E,sz);
for(int i=0; i<sz; i++) new(vec+i) E;
}
/*{\Mcreate creates an instance |\Mvar| of type |\Mname| with index set
$[a..b]\times [c..d]$. }*/
array2(int n, int m) : l1(0),h1(n-1),l2(0),h2(m-1),dim1(n),dim2(m),sz(n*m)
{ vec = LEDA_NEW_VECTOR(E,sz);
for(int i=0; i<sz; i++) new(vec+i) E;
}
/*{\Mcreate creates an instance |\Mvar| of type |\Mname| with index set
$[0..n-1]\times [0..m-1]$. }*/
array2(const array2& A) : l1(A.l1),h1(A.h1),l2(A.l2),h2(A.h2),dim1(A.dim1),dim2(A.dim2), sz(A.sz)
{ vec = LEDA_NEW_VECTOR(E,sz);
for(int i=0; i<sz; i++) new(vec+i) E(A.vec[i]);
cout << "sz = " << sz <<endl;
}
~array2()
{ for(int i=0; i<sz; i++) vec[i].~E();
LEDA_DEL_VECTOR(vec);
}
array2<E>& operator=(const array2<E>& A)
{ if (this != &A)
{ // destroy old vector
for(int i=0; i<sz; i++) vec[i].~E();
LEDA_DEL_VECTOR(vec);
// construct new vector
l1 = A.l1; h1 = A.h1;
l2 = A.l2; h2 = A.h2;
dim1 = A.dim1;
dim2 = A.dim2;
sz = A.sz;
vec = LEDA_NEW_VECTOR(E,sz);
for(int i=0; i<sz; i++) new(vec+i) E(A.vec[i]);
}
return *this;
}
/*{\Moperations 1.5 5 }*/
void init(const E& x)
{ for(int i=0; i<sz; i++) vec[i] = x; }
/*{\Mop assigns $x$ to each element of $A$. }*/
E& operator()(int i, int j) {
#if !defined(LEDA_CHECKING_OFF)
if (i < l1 || i > h1 || j < l2 || j > h2)
LEDA_EXCEPTION(99,string("array2[%d,%d]: index out of bounds",i,j));
#endif
return vec[(i-l1)*dim2+(j-l2)];
}
/*{\Mfunop returns $A(i,j)$.\\
\precond $a\le i\le b$ and $c\le j\le d$.}*/
const E& operator()(int i, int j) const {
#if !defined(LEDA_CHECKING_OFF)
if (i < l1 || i > h1 || j < l2 || j > h2)
LEDA_EXCEPTION(99,string("array2[%d,%d]: index out of bounds",i,j));
#endif
return vec[(i-l1)*dim2+(j-l2)];
}
int low1() const { return l1; }
/*{\Mop returns $a$. }*/
int high1() const {return h1; }
/*{\Mop returns $b$. }*/
int low2() const {return l2; }
/*{\Mop returns $c$. }*/
int high2() const {return h2; }
/*{\Mop returns $d$. }*/
};
/*{\Mimplementation
Two dimensional arrays are implemented by \CC vectors. All operations
take time $O(1)$, the space requirement is $O(|I|* sizeof(E))$.
}*/
#if LEDA_ROOT_INCL_ID == 600042
#undef LEDA_ROOT_INCL_ID
#include <LEDA/internal/POSTAMBLE.h>
#endif
LEDA_END_NAMESPACE
#endif
| 22.337209 | 97 | 0.522384 | [
"vector"
] |
d22a054ba6f80ac12afefe7bab44703ddaf18f83 | 2,254 | h | C | exportNF/release/windows/obj/include/flixel/math/FlxMatrix.h | theblobscp/NekoFreakMod-FridayNightFunkin | 232bcb08234cfe881fd6d52b13e6ae443e105fd1 | [
"BSD-3-Clause"
] | null | null | null | exportNF/release/windows/obj/include/flixel/math/FlxMatrix.h | theblobscp/NekoFreakMod-FridayNightFunkin | 232bcb08234cfe881fd6d52b13e6ae443e105fd1 | [
"BSD-3-Clause"
] | null | null | null | exportNF/release/windows/obj/include/flixel/math/FlxMatrix.h | theblobscp/NekoFreakMod-FridayNightFunkin | 232bcb08234cfe881fd6d52b13e6ae443e105fd1 | [
"BSD-3-Clause"
] | null | null | null | // Generated by Haxe 4.2.1+bf9ff69
#ifndef INCLUDED_flixel_math_FlxMatrix
#define INCLUDED_flixel_math_FlxMatrix
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
#ifndef INCLUDED_openfl_geom_Matrix
#include <openfl/geom/Matrix.h>
#endif
HX_DECLARE_CLASS2(flixel,math,FlxMatrix)
HX_DECLARE_CLASS2(openfl,geom,Matrix)
namespace flixel{
namespace math{
class HXCPP_CLASS_ATTRIBUTES FlxMatrix_obj : public ::openfl::geom::Matrix_obj
{
public:
typedef ::openfl::geom::Matrix_obj super;
typedef FlxMatrix_obj OBJ_;
FlxMatrix_obj();
public:
enum { _hx_ClassId = 0x666c094f };
void __construct( ::Dynamic a, ::Dynamic b, ::Dynamic c, ::Dynamic d, ::Dynamic tx, ::Dynamic ty);
inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="flixel.math.FlxMatrix")
{ return ::hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return ::hx::Object::operator new(inSize+extra,true,"flixel.math.FlxMatrix"); }
static ::hx::ObjectPtr< FlxMatrix_obj > __new( ::Dynamic a, ::Dynamic b, ::Dynamic c, ::Dynamic d, ::Dynamic tx, ::Dynamic ty);
static ::hx::ObjectPtr< FlxMatrix_obj > __alloc(::hx::Ctx *_hx_ctx, ::Dynamic a, ::Dynamic b, ::Dynamic c, ::Dynamic d, ::Dynamic tx, ::Dynamic ty);
static void * _hx_vtable;
static Dynamic __CreateEmpty();
static Dynamic __Create(::hx::DynamicArray inArgs);
//~FlxMatrix_obj();
HX_DO_RTTI_ALL;
::hx::Val __Field(const ::String &inString, ::hx::PropertyAccess inCallProp);
static void __register();
bool _hx_isInstanceOf(int inClassId);
::String __ToString() const { return HX_("FlxMatrix",33,30,b7,3d); }
::flixel::math::FlxMatrix rotateWithTrig(Float cos,Float sin);
::Dynamic rotateWithTrig_dyn();
::flixel::math::FlxMatrix rotateBy180();
::Dynamic rotateBy180_dyn();
::flixel::math::FlxMatrix rotateByPositive90();
::Dynamic rotateByPositive90_dyn();
::flixel::math::FlxMatrix rotateByNegative90();
::Dynamic rotateByNegative90_dyn();
Float transformX(Float px,Float py);
::Dynamic transformX_dyn();
Float transformY(Float px,Float py);
::Dynamic transformY_dyn();
};
} // end namespace flixel
} // end namespace math
#endif /* INCLUDED_flixel_math_FlxMatrix */
| 31.746479 | 150 | 0.727152 | [
"object",
"3d"
] |
d22c689063c2e558af9f3eb04228122dde35b54e | 10,257 | c | C | Peripherals/Boot/startup.c | frawang/CoOS | 3e611175e79f8cf86665f328a46d7c9691247be3 | [
"BSD-3-Clause"
] | null | null | null | Peripherals/Boot/startup.c | frawang/CoOS | 3e611175e79f8cf86665f328a46d7c9691247be3 | [
"BSD-3-Clause"
] | null | null | null | Peripherals/Boot/startup.c | frawang/CoOS | 3e611175e79f8cf86665f328a46d7c9691247be3 | [
"BSD-3-Clause"
] | 1 | 2020-01-18T08:04:33.000Z | 2020-01-18T08:04:33.000Z | /**
******************************************************************************
* @file startup.c
* @author Coocox
* @version V1.0
* @date 03/09/2011
* @brief Cortex M3 Devices Startup code.
* This module performs:
* - Set the initial SP
* - Set the vector table entries with the exceptions ISR address
* - Initialize data and bss
* - Call the application's entry point.
* After Reset the Cortex-M3 processor is in Thread mode,
* priority is Privileged, and the Stack is set to Main.
*******************************************************************************
*/
#include <peri.h>
#include "sram.h"
/*----------Stack Configuration-----------------------------------------------*/
#define STACK_SIZE 0x00000200 /*!< The Stack size suggest using even number */
__attribute__ ((section(".co_stack")))
unsigned long pulStack[STACK_SIZE];
/*----------Macro definition--------------------------------------------------*/
#define WEAK __attribute__ ((weak))
/*----------Declaration of the default fault handlers-------------------------*/
/* System exception vector handler */
__attribute__ ((used))
void WEAK Reset_Handler(void);
void WEAK NMI_Handler(void);
void WEAK HardFault_Handler(void);
void WEAK MemManage_Handler(void);
void WEAK BusFault_Handler(void);
void WEAK UsageFault_Handler(void);
void WEAK SVC_Handler(void);
void WEAK DebugMon_Handler(void);
void WEAK PendSV_Handler(void);
void WEAK SysTick_Handler(void);
/*----------Symbols defined in linker script----------------------------------*/
extern unsigned long _sidata; /*!< Start address for the initialization
values of the .data section. */
extern unsigned long _sdata; /*!< Start address for the .data section */
extern unsigned long _edata; /*!< End address for the .data section */
extern unsigned long _sbss; /*!< Start address for the .bss section */
extern unsigned long _ebss; /*!< End address for the .bss section */
extern void _eram; /*!< End address for ram */
/* SRAM section definitions from the linker */
extern unsigned long __sram_code_start, __ssram_code_text, __esram_code_text;
extern unsigned long __sram_data_start, __ssram_data, __esram_data;
/*----------Function prototypes-----------------------------------------------*/
extern int main(void); /*!< The entry point for the application. */
extern void dump_regs_info(U32 *stack); /* Dump stack information function */
extern void set_mcujtag_iomux(void);
void Default_Reset_Handler(void); /*!< Default reset handler */
static void Default_Handler(void); /*!< Default exception handler */
/**
*@brief The minimal vector table for a Cortex M3. Note that the proper constructs
* must be placed on this to ensure that it ends up at physical address
* 0x00000000.
*/
__attribute__ ((used,section(".isr_vector")))
void (* const g_pfnVectors[])(void) =
{
/*----------Core Exceptions------------------------------------------------ */
(void *)&pulStack[STACK_SIZE], /*!< The initial stack pointer */
Reset_Handler, /*!< Reset Handler */
NMI_Handler, /*!< NMI Handler */
HardFault_Handler, /*!< Hard Fault Handler */
MemManage_Handler, /*!< MPU Fault Handler */
BusFault_Handler, /*!< Bus Fault Handler */
UsageFault_Handler, /*!< Usage Fault Handler */
0,0,0,0, /*!< Reserved */
SVC_Handler, /*!< SVCall Handler */
DebugMon_Handler, /*!< Debug Monitor Handler */
0, /*!< Reserved */
PendSV_Handler, /*!< PendSV Handler */
SysTick_Handler, /*!< SysTick Handler */
/*----------256 External Exceptions-----------------------------------------*/
#ifdef RK3368
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
Mbox_IRQHandler, /*!< 138: Mbox0 */
Mbox_IRQHandler, /*!< 139: Mbox0 */
Mbox_IRQHandler, /*!< 140: Mbox0 */
Mbox_IRQHandler, /*!< 141: Mbox0 */
#elif RK3366
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Mbox_IRQHandler, /*!< 128: Mbox0 */
Mbox_IRQHandler, /*!< 129: Mbox0 */
Mbox_IRQHandler, /*!< 130: Mbox0 */
Mbox_IRQHandler, /*!< 131: Mbox0 */
#elif RK3399
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0, Mbox_IRQHandler, /*!< 17: Mbox */
0,0,0,0,0,0,0,0,0,0,0,0,0,0
#else
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
#endif
};
/**
* @brief This is the code that gets called when the processor first
* starts execution following a reset event. Only the absolutely
* necessary set is performed, after which the application
* supplied main() routine is called.
* @param None
* @retval None
*/
void Default_Reset_Handler(void)
{
/* Initialize data and bss */
unsigned long *pulSrc, *pulDest;
U32 sram_size = MCU_SRAM_SIZE;
/* Copy the data segment initializers from flash to SRAM */
pulSrc = &_sidata;
for(pulDest = &_sdata; pulDest < &_edata; )
{
*(pulDest++) = *(pulSrc++);
}
/* Zero fill the bss segment. This is done with inline assembly since this
will clear the value of pulDest if it is not kept in a register. */
#ifdef BUILD_M3
__asm(" ldr r0, =_sbss\n"
" ldr r1, =_ebss\n"
" mov r2, #0\n"
" .thumb_func\n"
"zero_loop:\n"
" cmp r0, r1\n"
" it lt\n"
" strlt r2, [r0], #4\n"
" blt zero_loop");
#elif BUILD_M0
__asm(" ldr r0, =_sbss \n"
" ldr r1, =_ebss \n"
" mov r2, #0 \n"
" b zero_loop \n"
" .thumb_func \n"
"fill_zero: \n"
" str r2, [r0] \n"
" add r0, r0, #4\n"
" .thumb_func \n"
"zero_loop: \n"
" cmp r0, r1 \n"
" bcc fill_zero ");
#endif
/* Zero sram segment. */
pulDest = &__ssram_code_text;
while (sram_size > 0) {
*(pulDest++) = 0;
sram_size -= sizeof(*pulDest);
}
/* Copy sram code from DDR to SRAM */
pulDest = &__ssram_code_text;
pulSrc = &__sram_code_start;
while(pulDest < &__esram_code_text) {
*(pulDest++) = *(pulSrc++);
}
/* Copy sram data from DDR to SRAM */
pulDest = &__ssram_data;
pulSrc = &__sram_data_start;
while(pulDest < &__esram_data) {
*(pulDest++) = *(pulSrc++);
}
/* enable mcu jtag */
set_mcujtag_iomux();
/* Call the application's entry point.*/
main();
}
/**
*@brief Provide weak aliases for each Exception handler to the Default_Handler.
* As they are weak aliases, any function with the same name will override
* this definition.
*/
#pragma weak Reset_Handler = Default_Reset_Handler
#pragma weak NMI_Handler = Default_Handler
#pragma weak HardFault_Handler = Default_Handler
#pragma weak MemManage_Handler = Default_Handler
#pragma weak BusFault_Handler = Default_Handler
#pragma weak UsageFault_Handler = Default_Handler
#pragma weak SVC_Handler = Default_Handler
#pragma weak DebugMon_Handler = Default_Handler
#pragma weak PendSV_Handler = Default_Handler
#pragma weak SysTick_Handler = Default_Handler
/**
* @brief This is the code that gets called when the processor receives an
* unexpected interrupt. This simply enters an infinite loop,
* preserving the system state for examination by a debugger.
* @param None
* @retval None
*/
static void Default_Handler(void)
{
volatile register U32 stack;
/* First, acquire the stack addr of the exception scene */
#ifdef BUILD_M3
__asm volatile
(
"TST LR, #4 \n"
"ITE EQ \n"
"MRSEQ R0, MSP \n"
"MRSNE R0, PSP \n"
"MOV %0, R0 \n"
: "=r" (stack)
);
#elif BUILD_M0
__asm volatile
(
" MOV R7, #4 \n"
" MOV R0, LR \n"
" TST R0, R7 \n"
" BNE NE_OPT \n"
" MRS R0, MSP \n"
" B END_OPT \n"
"NE_OPT: \n"
" MRS R0, PSP \n"
"END_OPT: \n"
" MOV %0, R0 \n"
: "=r" (stack)
);
#endif
/* Second, dump stack regs information */
dump_regs_info((U32 *)stack);
/* Go into an infinite loop. */
while (1) ;
}
/*********************** (C) COPYRIGHT 2009 Coocox ************END OF FILE*****/
| 37.434307 | 92 | 0.486497 | [
"vector"
] |
d22cc7cba7e53213b56962bdb432be94f6b7b364 | 8,332 | h | C | src/core/analysis/style.h | willhemsley/biodynamo | c36830de621f8e105bf5eac913b96405b5c9d75c | [
"Apache-2.0"
] | null | null | null | src/core/analysis/style.h | willhemsley/biodynamo | c36830de621f8e105bf5eac913b96405b5c9d75c | [
"Apache-2.0"
] | null | null | null | src/core/analysis/style.h | willhemsley/biodynamo | c36830de621f8e105bf5eac913b96405b5c9d75c | [
"Apache-2.0"
] | null | null | null | // -----------------------------------------------------------------------------
//
// Copyright (C) 2021 CERN & Newcastle University for the benefit of the
// BioDynaMo collaboration. 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.
//
// See the LICENSE file distributed with this work for details.
// See the NOTICE file distributed with this work for additional information
// regarding copyright ownership.
//
// -----------------------------------------------------------------------------
#ifndef CORE_ANALYSIS_STYLE_H_
#define CORE_ANALYSIS_STYLE_H_
#include "TStyle.h"
namespace bdm {
namespace experimental {
/// This is just a replacement for TStyle until a bug related to JSON
/// deserialization is resolved.
/// \see https://root-forum.cern.ch/t/error-restoring-tstyle-from-json/44879
class Style : public TNamed,
public TAttLine,
public TAttFill,
public TAttMarker,
public TAttText {
public:
Style();
~Style();
operator TStyle*() const;
TStyle* GetTStyle() const;
private:
mutable TStyle* tstyle_ = nullptr; //!
// The following attributes were copied from TStyle
TAttAxis fXaxis; ///< X axis attributes
TAttAxis fYaxis; ///< Y axis attributes
TAttAxis fZaxis; ///< Z axis attributes
Float_t fBarWidth; ///< Width of bar for graphs
Float_t fBarOffset; ///< Offset of bar for graphs
Int_t fColorModelPS; ///< PostScript color model: 0 = RGB, 1 = CMYK
Int_t fDrawBorder; ///< Flag to draw border(=1) or not (0)
Int_t fOptLogx; ///< True if log scale in X
Int_t fOptLogy; ///< True if log scale in y
Int_t fOptLogz; ///< True if log scale in z
Int_t fOptDate; ///< True if date option is selected
Int_t fOptStat; ///< True if option Stat is selected
Int_t fOptTitle; ///< True if option Title is selected
Int_t fOptFile; ///< True if option File is selected
Int_t fOptFit; ///< True if option Fit is selected
Int_t fShowEventStatus; ///< Show event status panel
Int_t fShowEditor; ///< Show pad editor
Int_t fShowToolBar; ///< Show toolbar
Int_t fNumberContours; ///< Default number of contours for 2-d plots
TAttText fAttDate; ///< Canvas date attribute
Float_t fDateX; ///< X position of the date in the canvas (in NDC)
Float_t fDateY; ///< Y position of the date in the canvas (in NDC)
Float_t fEndErrorSize; ///< Size of lines at the end of error bars
Float_t fErrorX; ///< Per cent of bin width for errors along X
Color_t fFuncColor; ///< Function color
Style_t fFuncStyle; ///< Function style
Width_t fFuncWidth; ///< Function line width
Color_t fGridColor; ///< Grid line color (if 0 use axis line color)
Style_t fGridStyle; ///< Grid line style
Width_t fGridWidth; ///< Grid line width
Width_t fLegendBorderSize; ///< Legend box border size
Color_t fLegendFillColor; ///< Legend fill color
Style_t fLegendFont; ///< Legend font style
Double_t fLegendTextSize; ///< Legend text size. If 0 the size is computed
///< automatically
Int_t fHatchesLineWidth; ///< Hatches line width for hatch styles > 3100
Double_t fHatchesSpacing; ///< Hatches spacing for hatch styles > 3100
Color_t fFrameFillColor; ///< Pad frame fill color
Color_t fFrameLineColor; ///< Pad frame line color
Style_t fFrameFillStyle; ///< Pad frame fill style
Style_t fFrameLineStyle; ///< Pad frame line style
Width_t fFrameLineWidth; ///< Pad frame line width
Width_t fFrameBorderSize; ///< Pad frame border size
Int_t fFrameBorderMode; ///< Pad frame border mode
Color_t fHistFillColor; ///< Histogram fill color
Color_t fHistLineColor; ///< Histogram line color
Style_t fHistFillStyle; ///< Histogram fill style
Style_t fHistLineStyle; ///< Histogram line style
Width_t fHistLineWidth; ///< Histogram line width
Bool_t fHistMinimumZero; ///< True if default minimum is 0, false if minimum
///< is automatic
Double_t fHistTopMargin; ///< Margin between histogram's top and pad's top
Bool_t fCanvasPreferGL; ///< If true, rendering in canvas is with GL
Color_t fCanvasColor; ///< Canvas color
Width_t fCanvasBorderSize; ///< Canvas border size
Int_t fCanvasBorderMode; ///< Canvas border mode
Int_t fCanvasDefH; ///< Default canvas height
Int_t fCanvasDefW; ///< Default canvas width
Int_t fCanvasDefX; ///< Default canvas top X position
Int_t fCanvasDefY; ///< Default canvas top Y position
Color_t fPadColor; ///< Pad color
Width_t fPadBorderSize; ///< Pad border size
Int_t fPadBorderMode; ///< Pad border mode
Float_t fPadBottomMargin; ///< Pad bottom margin
Float_t fPadTopMargin; ///< Pad top margin
Float_t fPadLeftMargin; ///< Pad left margin
Float_t fPadRightMargin; ///< Pad right margin
Bool_t fPadGridX; ///< True to get the grid along X
Bool_t fPadGridY; ///< True to get the grid along Y
Int_t fPadTickX; ///< True to set special pad ticks along X
Int_t fPadTickY; ///< True to set special pad ticks along Y
Float_t fPaperSizeX; ///< PostScript paper size along X
Float_t fPaperSizeY; ///< PostScript paper size along Y
Float_t
fScreenFactor; ///< Multiplication factor for canvas size and position
Color_t fStatColor; ///< Stat fill area color
Color_t fStatTextColor; ///< Stat text color
Width_t fStatBorderSize; ///< Border size of Stats PaveLabel
Style_t fStatFont; ///< Font style of Stats PaveLabel
Float_t
fStatFontSize; ///< Font size in pixels for fonts with precision type 3
Style_t fStatStyle; ///< Fill area style of Stats PaveLabel
TString fStatFormat; ///< Printing format for stats
Float_t fStatX; ///< X position of top right corner of stat box
Float_t fStatY; ///< Y position of top right corner of stat box
Float_t fStatW; ///< Width of stat box
Float_t fStatH; ///< Height of stat box
Bool_t fStripDecimals; ///< Strip decimals in axis labels
Int_t fTitleAlign; ///< Title box alignment
Color_t fTitleColor; ///< Title fill area color
Color_t fTitleTextColor; ///< Title text color
Width_t fTitleBorderSize; ///< Border size of Title PavelLabel
Style_t fTitleFont; ///< Font style of Title PaveLabel
Float_t
fTitleFontSize; ///< Font size in pixels for fonts with precision type 3
Style_t fTitleStyle; ///< Fill area style of title PaveLabel
Float_t fTitleX; ///< X position of top left corner of title box
Float_t fTitleY; ///< Y position of top left corner of title box
Float_t fTitleW; ///< Width of title box
Float_t fTitleH; ///< Height of title box
Float_t fLegoInnerR; ///< Inner radius for cylindrical legos
// This is the attribute that causes problems
// TString fLineStyle[30]; ///< String describing line style i (for
// postScript)
TString fHeaderPS; ///< User defined additional Postscript header
TString fTitlePS; ///< User defined Postscript file title
TString fFitFormat; ///< Printing format for fit parameters
TString fPaintTextFormat; ///< Printing format for TH2::PaintText
Float_t fLineScalePS; ///< Line scale factor when drawing lines on Postscript
Int_t fJoinLinePS; ///< Determines the appearance of joining lines on
///< PostScript, PDF and SVG
Int_t fCapLinePS; ///< Determines the appearance of line caps on PostScript,
///< PDF and SVG
Double_t fTimeOffset; ///< Time offset to the beginning of an axis
Float_t fImageScaling; ///< Image scaling to produce high definition bitmap
///< images
void ToTStyle() const;
void FromTStyle(TStyle* style);
ClassDefNV(Style, 1);
};
} // namespace experimental
} // namespace bdm
#endif // CORE_ANALYSIS_STYLE_H_
| 49.011765 | 80 | 0.645583 | [
"model"
] |
d232640c97e684f0e2af3f17cf990ea53da6b7a3 | 796 | h | C | Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModelBus.h | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-20T12:39:24.000Z | 2021-07-20T12:39:24.000Z | Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModelBus.h | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | null | null | null | Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModelBus.h | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-20T11:07:25.000Z | 2021-07-20T11:07:25.000Z | /*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/Component/Entity.h>
namespace AzToolsFramework
{
class EditorEntityModelRequests : public AZ::EBusTraits
{
public:
virtual ~EditorEntityModelRequests() = default;
virtual void AddToChildrenWithOverrides(const EntityIdList& parentEntityIds, const AZ::EntityId& entityId) = 0;
virtual void RemoveFromChildrenWithOverrides(const EntityIdList& parentEntityIds, const AZ::EntityId& entityId) = 0;
};
using EditorEntityModelRequestBus = AZ::EBus<EditorEntityModelRequests>;
}
| 33.166667 | 158 | 0.746231 | [
"3d"
] |
d23af33c4960108b1e0f4baed0f20fa5e586d0b2 | 16,178 | h | C | include/perfetto/protozero/proto_decoder.h | android-risc-v/external_perfetto | f4448c4e7b8d8be7e10c3fe4b8c1d7a8a76330f4 | [
"Apache-2.0"
] | 190 | 2017-09-06T19:55:48.000Z | 2022-02-11T22:26:29.000Z | include/perfetto/protozero/proto_decoder.h | android-risc-v/external_perfetto | f4448c4e7b8d8be7e10c3fe4b8c1d7a8a76330f4 | [
"Apache-2.0"
] | 30 | 2017-10-02T09:26:11.000Z | 2021-06-05T22:06:34.000Z | include/perfetto/protozero/proto_decoder.h | android-risc-v/external_perfetto | f4448c4e7b8d8be7e10c3fe4b8c1d7a8a76330f4 | [
"Apache-2.0"
] | 37 | 2020-11-13T15:44:23.000Z | 2022-03-25T09:08:22.000Z | /*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
#define INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
#include <stdint.h>
#include <array>
#include <memory>
#include <vector>
#include "perfetto/base/compiler.h"
#include "perfetto/base/logging.h"
#include "perfetto/protozero/field.h"
#include "perfetto/protozero/proto_utils.h"
namespace protozero {
// A generic protobuf decoder. Doesn't require any knowledge about the proto
// schema. It tokenizes fields, retrieves their ID and type and exposes
// accessors to retrieve its values.
// It does NOT recurse in nested submessages, instead it just computes their
// boundaries, recursion is left to the caller.
// This class is designed to be used in perf-sensitive contexts. It does not
// allocate and does not perform any proto semantic checks (e.g. repeated /
// required / optional). It's supposedly safe wrt out-of-bounds memory accesses
// (see proto_decoder_fuzzer.cc).
// This class serves also as a building block for TypedProtoDecoder, used when
// the schema is known at compile time.
class PERFETTO_EXPORT ProtoDecoder {
public:
// Creates a ProtoDecoder using the given |buffer| with size |length| bytes.
ProtoDecoder(const void* buffer, size_t length)
: begin_(reinterpret_cast<const uint8_t*>(buffer)),
end_(begin_ + length),
read_ptr_(begin_) {}
ProtoDecoder(const std::string& str) : ProtoDecoder(str.data(), str.size()) {}
ProtoDecoder(const ConstBytes& cb) : ProtoDecoder(cb.data, cb.size) {}
// Reads the next field from the buffer and advances the read cursor. If a
// full field cannot be read, the returned Field will be invalid (i.e.
// field.valid() == false).
Field ReadField();
// Finds the first field with the given id. Doesn't affect the read cursor.
Field FindField(uint32_t field_id);
// Resets the read cursor to the start of the buffer.
void Reset() { read_ptr_ = begin_; }
// Resets the read cursor to the given position (must be within the buffer).
void Reset(const uint8_t* pos) {
PERFETTO_DCHECK(pos >= begin_ && pos < end_);
read_ptr_ = pos;
}
// Returns the position of read cursor, relative to the start of the buffer.
size_t read_offset() const { return static_cast<size_t>(read_ptr_ - begin_); }
size_t bytes_left() const {
PERFETTO_DCHECK(read_ptr_ <= end_);
return static_cast<size_t>(end_ - read_ptr_);
}
const uint8_t* begin() const { return begin_; }
const uint8_t* end() const { return end_; }
protected:
const uint8_t* const begin_;
const uint8_t* const end_;
const uint8_t* read_ptr_ = nullptr;
};
// An iterator-like class used to iterate through repeated fields. Used by
// TypedProtoDecoder. The iteration sequence is a bit counter-intuitive due to
// the fact that fields_[field_id] holds the *last* value of the field, not the
// first, but the remaining storage holds repeated fields in FIFO order.
// Assume that we push the 10,11,12 into a repeated field with ID=1.
//
// Decoder memory layout: [ fields storage ] [ repeated fields storage ]
// 1st iteration: 10
// 2nd iteration: 11 10
// 3rd iteration: 12 10 11
//
// We start the iteration @ fields_[num_fields], which is the start of the
// repeated fields storage, proceed until the end and lastly jump @ fields_[id].
template <typename T>
class RepeatedFieldIterator {
public:
RepeatedFieldIterator(uint32_t field_id,
const Field* begin,
const Field* end,
const Field* last)
: field_id_(field_id), iter_(begin), end_(end), last_(last) {
FindNextMatchingId();
}
// Constructs an invalid iterator.
RepeatedFieldIterator()
: field_id_(0u), iter_(nullptr), end_(nullptr), last_(nullptr) {}
explicit operator bool() const { return iter_ != end_; }
const Field& field() const { return *iter_; }
T operator*() const {
T val{};
iter_->get(&val);
return val;
}
const Field* operator->() const { return iter_; }
RepeatedFieldIterator& operator++() {
PERFETTO_DCHECK(iter_ != end_);
if (iter_ == last_) {
iter_ = end_;
return *this;
}
++iter_;
FindNextMatchingId();
return *this;
}
RepeatedFieldIterator operator++(int) {
PERFETTO_DCHECK(iter_ != end_);
RepeatedFieldIterator it(*this);
++(*this);
return it;
}
private:
void FindNextMatchingId() {
PERFETTO_DCHECK(iter_ != last_);
for (; iter_ != end_; ++iter_) {
if (iter_->id() == field_id_)
return;
}
iter_ = last_->valid() ? last_ : end_;
}
uint32_t field_id_;
// Initially points to the beginning of the repeated field storage, then is
// incremented as we call operator++().
const Field* iter_;
// Always points to fields_[size_], i.e. past the end of the storage.
const Field* end_;
// Always points to fields_[field_id].
const Field* last_;
};
// As RepeatedFieldIterator, but allows iterating over a packed repeated field
// (which will be initially stored as a single length-delimited field).
// See |GetPackedRepeatedField| for details.
//
// Assumes little endianness, and that the input buffers are well formed -
// containing an exact multiple of encoded elements.
template <proto_utils::ProtoWireType wire_type, typename CppType>
class PackedRepeatedFieldIterator {
public:
PackedRepeatedFieldIterator(const uint8_t* data_begin,
size_t size,
bool* parse_error_ptr)
: data_end_(data_begin ? data_begin + size : nullptr),
read_ptr_(data_begin),
parse_error_(parse_error_ptr) {
using proto_utils::ProtoWireType;
static_assert(wire_type == ProtoWireType::kVarInt ||
wire_type == ProtoWireType::kFixed32 ||
wire_type == ProtoWireType::kFixed64,
"invalid type");
PERFETTO_DCHECK(parse_error_ptr);
// Either the field is unset (and there are no data pointer), or the field
// is set with a zero length payload. Mark the iterator as invalid in both
// cases.
if (size == 0) {
curr_value_valid_ = false;
return;
}
if ((wire_type == ProtoWireType::kFixed32 && (size % 4) != 0) ||
(wire_type == ProtoWireType::kFixed64 && (size % 8) != 0)) {
*parse_error_ = true;
curr_value_valid_ = false;
return;
}
++(*this);
}
const CppType operator*() const { return curr_value_; }
explicit operator bool() const { return curr_value_valid_; }
PackedRepeatedFieldIterator& operator++() {
using proto_utils::ProtoWireType;
if (PERFETTO_UNLIKELY(!curr_value_valid_))
return *this;
if (PERFETTO_UNLIKELY(read_ptr_ == data_end_)) {
curr_value_valid_ = false;
return *this;
}
if (wire_type == ProtoWireType::kVarInt) {
uint64_t new_value = 0;
const uint8_t* new_pos =
proto_utils::ParseVarInt(read_ptr_, data_end_, &new_value);
if (PERFETTO_UNLIKELY(new_pos == read_ptr_)) {
// Failed to decode the varint (probably incomplete buffer).
*parse_error_ = true;
curr_value_valid_ = false;
} else {
read_ptr_ = new_pos;
curr_value_ = static_cast<CppType>(new_value);
}
} else { // kFixed32 or kFixed64
constexpr size_t kStep = wire_type == ProtoWireType::kFixed32 ? 4 : 8;
// NB: the raw buffer is not guaranteed to be aligned, so neither are
// these copies.
memcpy(&curr_value_, read_ptr_, sizeof(CppType));
read_ptr_ += kStep;
}
return *this;
}
PackedRepeatedFieldIterator operator++(int) {
PackedRepeatedFieldIterator it(*this);
++(*this);
return it;
}
private:
// Might be null if the backing proto field isn't set.
const uint8_t* const data_end_;
// The iterator looks ahead by an element, so |curr_value| holds the value
// to be returned when the caller dereferences the iterator, and |read_ptr_|
// points at the start of the next element to be decoded.
// |read_ptr_| might be null if the backing proto field isn't set.
const uint8_t* read_ptr_;
CppType curr_value_ = 0;
// Set to false once we've exhausted the iterator, or encountered an error.
bool curr_value_valid_ = true;
// Where to set parsing errors, supplied by the caller.
bool* const parse_error_;
};
// This decoder loads all fields upfront, without recursing in nested messages.
// It is used as a base class for typed decoders generated by the pbzero plugin.
// The split between TypedProtoDecoderBase and TypedProtoDecoder<> is to have
// unique definition of functions like ParseAllFields() and ExpandHeapStorage().
// The storage (either on-stack or on-heap) for this class is organized as
// follows:
// |-------------------------- fields_ ----------------------|
// [ field 0 (invalid) ] [ fields 1 .. N ] [ repeated fields ]
// ^ ^
// num_fields_ size_
class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder {
public:
// If the field |id| is known at compile time, prefer the templated
// specialization at<kFieldNumber>().
const Field& Get(uint32_t id) const {
return PERFETTO_LIKELY(id < num_fields_) ? fields_[id] : fields_[0];
}
// Returns an object that allows to iterate over all instances of a repeated
// field given its id. Example usage:
// for (auto it = decoder.GetRepeated<int32_t>(N); it; ++it) { ... }
template <typename T>
RepeatedFieldIterator<T> GetRepeated(uint32_t field_id) const {
return RepeatedFieldIterator<T>(field_id, &fields_[num_fields_],
&fields_[size_], &fields_[field_id]);
}
// Returns an objects that allows to iterate over all entries of a packed
// repeated field given its id and type. The |wire_type| is necessary for
// decoding the packed field, the |cpp_type| is for convenience & stronger
// typing.
//
// The caller must also supply a pointer to a bool that is set to true if the
// packed buffer is found to be malformed while iterating (so you need to
// exhaust the iterator if you want to check the full extent of the buffer).
//
// Note that unlike standard protobuf parsers, protozero does not allow
// treating of packed repeated fields as non-packed and vice-versa (therefore
// not making the packed option forwards and backwards compatible). So
// the caller needs to use the right accessor for correct results.
template <proto_utils::ProtoWireType wire_type, typename cpp_type>
PackedRepeatedFieldIterator<wire_type, cpp_type> GetPackedRepeated(
uint32_t field_id,
bool* parse_error_location) const {
const Field& field = Get(field_id);
if (field.valid()) {
return PackedRepeatedFieldIterator<wire_type, cpp_type>(
field.data(), field.size(), parse_error_location);
} else {
return PackedRepeatedFieldIterator<wire_type, cpp_type>(
nullptr, 0, parse_error_location);
}
}
protected:
TypedProtoDecoderBase(Field* storage,
uint32_t num_fields,
uint32_t capacity,
const uint8_t* buffer,
size_t length)
: ProtoDecoder(buffer, length),
fields_(storage),
num_fields_(num_fields),
size_(num_fields),
capacity_(capacity) {
// The reason why Field needs to be trivially de/constructible is to avoid
// implicit initializers on all the ~1000 entries. We need it to initialize
// only on the first |max_field_id| fields, the remaining capacity doesn't
// require initialization.
static_assert(std::is_trivially_constructible<Field>::value &&
std::is_trivially_destructible<Field>::value &&
std::is_trivial<Field>::value,
"Field must be a trivial aggregate type");
memset(fields_, 0, sizeof(Field) * num_fields_);
}
void ParseAllFields();
// Called when the default on-stack storage is exhausted and new repeated
// fields need to be pushed.
void ExpandHeapStorage();
// Used only in presence of a large number of repeated fields, when the
// default on-stack storage is exhausted.
std::unique_ptr<Field[]> heap_storage_;
// Points to the storage, either on-stack (default, provided by the template
// specialization) or |heap_storage_| after ExpandHeapStorage() is called, in
// case of a large number of repeated fields.
Field* fields_;
// Number of fields without accounting repeated storage. This is equal to
// MAX_FIELD_ID + 1 (to account for the invalid 0th field).
// This value is always <= size_ (and hence <= capacity);
uint32_t num_fields_;
// Number of active |fields_| entries. This is initially equal to the highest
// number of fields for the message (num_fields_ == MAX_FIELD_ID + 1) and can
// grow up to |capacity_| in the case of repeated fields.
uint32_t size_;
// Initially equal to kFieldsCapacity of the TypedProtoDecoder
// specialization. Can grow when falling back on heap-based storage, in which
// case it represents the size (#fields with each entry of a repeated field
// counted individually) of the |heap_storage_| array.
uint32_t capacity_;
};
// Template class instantiated by the auto-generated decoder classes declared in
// xxx.pbzero.h files.
template <int MAX_FIELD_ID, bool HAS_NONPACKED_REPEATED_FIELDS>
class TypedProtoDecoder : public TypedProtoDecoderBase {
public:
TypedProtoDecoder(const uint8_t* buffer, size_t length)
: TypedProtoDecoderBase(on_stack_storage_,
/*num_fields=*/MAX_FIELD_ID + 1,
kCapacity,
buffer,
length) {
static_assert(MAX_FIELD_ID <= kMaxDecoderFieldId, "Field ordinal too high");
TypedProtoDecoderBase::ParseAllFields();
}
template <uint32_t FIELD_ID>
const Field& at() const {
static_assert(FIELD_ID <= MAX_FIELD_ID, "FIELD_ID > MAX_FIELD_ID");
return fields_[FIELD_ID];
}
TypedProtoDecoder(TypedProtoDecoder&& other) noexcept
: TypedProtoDecoderBase(std::move(other)) {
// If the moved-from decoder was using on-stack storage, we need to update
// our pointer to point to this decoder's on-stack storage.
if (fields_ == other.on_stack_storage_) {
fields_ = on_stack_storage_;
memcpy(on_stack_storage_, other.on_stack_storage_,
sizeof(on_stack_storage_));
}
}
private:
// In the case of non-repeated fields, this constant defines the highest field
// id we are able to decode. This is to limit the on-stack storage.
// In the case of repeated fields, this constant defines the max number of
// repeated fields that we'll be able to store before falling back on the
// heap. Keep this value in sync with the one in protozero_generator.cc.
static constexpr size_t kMaxDecoderFieldId = 999;
// If we the message has no repeated fields we need at most N Field entries
// in the on-stack storage, where N is the highest field id.
// Otherwise we need some room to store repeated fields.
static constexpr size_t kCapacity =
1 + (HAS_NONPACKED_REPEATED_FIELDS ? kMaxDecoderFieldId : MAX_FIELD_ID);
Field on_stack_storage_[kCapacity];
};
} // namespace protozero
#endif // INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
| 37.623256 | 80 | 0.679441 | [
"object",
"vector"
] |
d2405e5953e35978effd88eecb354c7d2cb98727 | 1,221 | h | C | FSGDEngine-Student/RTAnim/Interpolator.h | Cabrra/Engine-Development | cce5930e2264048b0be58b691729407ca507d1af | [
"MIT"
] | 2 | 2019-03-30T11:14:01.000Z | 2020-10-27T00:55:01.000Z | FSGDEngine-Student/RTAnim/Interpolator.h | Cabrra/Engine-Development | cce5930e2264048b0be58b691729407ca507d1af | [
"MIT"
] | null | null | null | FSGDEngine-Student/RTAnim/Interpolator.h | Cabrra/Engine-Development | cce5930e2264048b0be58b691729407ca507d1af | [
"MIT"
] | 1 | 2019-01-29T20:12:24.000Z | 2019-01-29T20:12:24.000Z | #pragma once
#include <vector>
#include "../EDUtilities/ContentManager.h"
using namespace EDUtilities;
#include "Clip.h"
namespace RTAnim
{
class InterpolatedBone
{
friend class Interpolator;
public:
InterpolatedBone(void) : currentKeyFrame(0), bone(nullptr) {}
const EDMath::Float4x4& GetLocalTransform(void)const { return local; }
const AnimatedBone* GetAnimatedBone(void)const { return bone; }
private:
void Update(float animTime, float duration);
EDMath::Float4x4 local;
int currentKeyFrame;
const AnimatedBone* bone;
};
class Interpolator
{
public:
Interpolator(void) : animTime(0.0f), clipPtr(nullptr) {}
void SetClip(const char* filePath);
void SetClip(EDUtilities::ContentHandle<Clip> handle);
void SetTime(float t);
void AddTime(float delta);
const std::vector<InterpolatedBone>& GetInterpolatedBones(void) const { return interpolatedBones; }
EDUtilities::ContentHandle<Clip> GetClip(void){ return clipHandle; }
const Clip* GetClip(void) const { return clipPtr; }
void Process(void);
private:
bool outdated;
float animTime;
EDUtilities::ContentHandle<Clip> clipHandle;
Clip* clipPtr;
std::vector<InterpolatedBone> interpolatedBones;
};
} | 21.421053 | 101 | 0.73792 | [
"vector"
] |
d243cdadd13871a0733f45b94d12024b96ed77f0 | 6,316 | h | C | logdevice/server/locallogstore/ShardedRocksDBLocalLogStore.h | SimonKinds/LogDevice | fc9ac2fccb6faa3292b2b0a610a9eb77fd445824 | [
"BSD-3-Clause"
] | 1 | 2018-10-17T06:49:04.000Z | 2018-10-17T06:49:04.000Z | logdevice/server/locallogstore/ShardedRocksDBLocalLogStore.h | msdgwzhy6/LogDevice | bc2491b7dfcd129e25490c7d5321d3d701f53ac4 | [
"BSD-3-Clause"
] | null | null | null | logdevice/server/locallogstore/ShardedRocksDBLocalLogStore.h | msdgwzhy6/LogDevice | bc2491b7dfcd129e25490c7d5321d3d701f53ac4 | [
"BSD-3-Clause"
] | null | null | null | /**
* Copyright (c) 2017-present, Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <memory>
#include <vector>
#include <rocksdb/env.h>
#include <boost/filesystem.hpp>
#include "logdevice/common/debug.h"
#include "logdevice/common/settings/RebuildingSettings.h"
#include "logdevice/common/settings/Settings.h"
#include "logdevice/common/configuration/UpdateableConfig.h"
#include "logdevice/common/settings/UpdateableSettings.h"
#include "logdevice/include/types.h"
#include "logdevice/server/locallogstore/LocalLogStore.h"
#include "logdevice/server/locallogstore/RocksDBCompactionFilter.h"
#include "logdevice/server/locallogstore/RocksDBEnv.h"
#include "logdevice/server/locallogstore/RocksDBLogStoreConfig.h"
#include "logdevice/server/locallogstore/RocksDBSettings.h"
namespace facebook { namespace logdevice {
/**
* @file
*
* Implementation of ShardedLocalLogStore where each shard is a RocksDB
* instance. The instances share a background thread pool and block cache.
*
* Directory structure:
* + base_path
* +-- NSHARDS // control file so we don't accidentally reshard
* +-- shard0 // first RocksDB instance
* +-- shard1
* ...
* +-- shard<n-1>
*/
struct RocksDBCache;
class ShardedStorageThreadPool;
class ShardedRocksDBLocalLogStore : public ShardedLocalLogStore {
public:
/**
* Constructor.
*
* base_path must:
* - not exist (a new sharded database is created), or
* - be an empty directory (a new sharded database is created), or
* - contain a previously created sharded database with the same number of
* shards
*
* @param num_shards number of shards to create database with, if -1
* NSHARDS file must already exist
* @param config current configuration; pointer is only guaranted to be
* valid during the call; can be nullptr in tests
* @param caches if not null, this object will be updated with pointers to
* RocksDB block caches
*
* @throws ConstructorFailed
*/
ShardedRocksDBLocalLogStore(
const std::string& base_path,
shard_size_t num_shards,
Settings settings,
UpdateableSettings<RocksDBSettings> db_settings,
UpdateableSettings<RebuildingSettings> rebuilding_settings,
std::shared_ptr<UpdateableConfig> updateable_config,
RocksDBCache* caches,
StatsHolder* stats = nullptr);
~ShardedRocksDBLocalLogStore() override;
int numShards() const override {
return shards_.size();
}
LocalLogStore* getByIndex(int idx) override {
ld_check(idx >= 0 && idx < numShards());
if (idx < 0 || idx >= shards_.size()) {
return nullptr;
}
return shards_[idx].get();
}
void setShardedStorageThreadPool(const ShardedStorageThreadPool*);
struct DiskShardMappingEntry {
// Canonical path to one of the shards. The path can be used to find the
// free space on the device.
boost::filesystem::path example_path;
// List of shards on the disk
std::vector<int> shards;
std::atomic<bool> sequencer_initiated_space_based_retention{false};
};
/**
* Generates a DiskShardMappingEntry for each disk/device that some of our
* shards live on. (Typical configurations are one disk for all shards, or
* one per shard.)
*
* Returns the number of shards for which the disk was successfully
* determined. Full success is indicated by rv == numShards(), anything
* less means there were issues.
*/
size_t createDiskShardMapping();
const std::unordered_map<dev_t, DiskShardMappingEntry>&
getShardToDiskMapping();
/**
* If the shards use LogsDB, per-disk space-based trimming is enabled, and
* space usage has reached that limit, trim logs on the given disk until that
* disk's space usage no longer exceeds the given space-based retention
* threshold. The low pri thread in each shard will be told to drop the
* partitions and trim logs accordingly.
*
* @param mapping Name of the mount point(example path) to perform trimming on
* @param info Filesystem space info
* @param full Indicates if coordinated space-based retention threshold
* was exceeded AND the sequencer had not initiated trimming.
* In this case, the disk should be marked full by monitor.
*/
int trimLogsBasedOnSpaceIfNeeded(const DiskShardMappingEntry& mapping,
boost::filesystem::space_info info,
bool* full);
/**
* Adjust DiskInfo to indicate sequencer initiated space-based retention.
*/
void setSequencerInitiatedSpaceBasedRetention(int shard_idx) override;
struct DiskInfo {
DiskInfo() : sequencer_initiated_space_based_retention(false), shards() {}
std::atomic<bool> sequencer_initiated_space_based_retention;
std::vector<int> shards;
};
private:
void printDiskShardMapping();
void onSettingsUpdated();
StatsHolder* stats_;
// Shards that use FailingLocalLogStore because they failed to open DB.
std::set<int> failing_log_store_shards_;
std::unique_ptr<RocksDBEnv> env_;
RocksDBLogStoreConfig rocksdb_config_;
// subscription to update db settings on update of RocksDB settings.
UpdateableSettings<RocksDBSettings>::SubscriptionHandle
rocksdb_settings_handle_;
UpdateableSettings<RocksDBSettings> db_settings_;
// Compaction filter factories, which we need to keep around so that we can
// propagate pointers to StorageThreadPool instances after the pools are
// created.
std::vector<std::shared_ptr<RocksDBCompactionFilterFactory>> filters_;
// Actual RocksDBLogStoreBase instances
std::vector<std::unique_ptr<LocalLogStore>> shards_;
// For each shard, the directory containing the shard's database
std::vector<boost::filesystem::path> shard_paths_;
std::vector<dev_t> shard_to_devt_;
// Mapping between shard idx, and the disk on which it resides
std::unordered_map<dev_t, DiskShardMappingEntry> fspath_to_dsme_;
// Indicating if shards are partitioned
const bool partitioned_;
};
}} // namespace facebook::logdevice
| 34.326087 | 80 | 0.717068 | [
"object",
"vector"
] |
d24512d9b53fc25255ff1c0401279b4b794eb709 | 7,190 | h | C | src/elements/FElibrary.h | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | src/elements/FElibrary.h | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | src/elements/FElibrary.h | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | /*
This file is part of TACS: The Toolkit for the Analysis of Composite
Structures, a parallel finite-element code for structural and
multidisciplinary design optimization.
Copyright (C) 2010 University of Toronto
Copyright (C) 2012 University of Michigan
Copyright (C) 2014 Georgia Tech Research Corporation
Additional copyright (C) 2010 Graeme J. Kennedy and Joaquim
R.R.A. Martins All rights reserved.
TACS is licensed under the Apache License, Version 2.0 (the
"License"); you may not use this software except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
*/
#ifndef TACS_FE_LIBRARY_H
#define TACS_FE_LIBRARY_H
/*!
FElibrary.h contains many important functions and data that are
repeatedly used in the formation of various finite element stiffness
matricies. The intent of this code is to provide functions for
calculating shape functions, Gauss points and functions for
calculating the Jacobians for element stiffness matricies.
*/
#include <stdlib.h>
#include <math.h>
#include "TACSObject.h"
/*
The following data defines the quadrature rules that can be used in
the elements. The default is to use tensor-product Gauss quadrature
rules, however, more sophisticated methods can be used.
Currently, the options are Gauss quadrature or Lobatto (or
Gauss-Lobatto) quadrature schemes that include the end points of the
interval.
*/
enum QuadratureType { GAUSS_QUADRATURE,
LOBATTO_QUADRATURE };
TACS_BEGIN_NAMESPACE(FElibrary)
/*!
Solve the quadratic equation and return the positive and negative
roots.
The code returns the roots of the equation:
a*x^2 + b*x + c = 0
This code avoids truncation error by testing the sign of the
b coefficient and using the corresponding expression with the
least susceptibility to truncation error.
*/
template <class ScalarType>
void solveQERoots( ScalarType * r1, ScalarType * r2,
ScalarType a, ScalarType b, ScalarType c ){
ScalarType discrim = b*b - 4.0*a*c;
if (TacsRealPart(discrim) < 0.0){
*r1 = *r2 = 0.0;
return;
}
if (TacsRealPart(a) == 0.0){
if (TacsRealPart(b) == 0.0){
*r1 = *r2 = 0.0;
return;
}
// Solve b*x + c = 0
*r1 = - c/b;
*r2 = 0.0;
return;
}
// Depending on the sign of b, use different expressions to
// avoid truncation error
discrim = sqrt(discrim);
if (TacsRealPart(b) > 0.0){
*r1 = -(b + discrim)/(2.0*a);
*r2 = c/((*r1)*a);
}
else { // b < 0.0
*r1 = -(b - discrim)/(2.0*a);
*r2 = c/((*r1)*a);
}
}
/*
Test the derivative of the b-spline basis
input:
k: the order of the basis to test
*/
void bspline_basis_test( int k );
/*
Find the interval for the computing the basis function
input:
u: the parametric location
T: the knot locations
n: the number of control points
k: the order of the b-spline
*/
int bspline_interval( double u, const double * T, int n, int k );
/*
Evaluate the basis functions and optionally their derivatives
output:
N: the basis functions - an array of size k
input:
idx: the index of the interval for u
u: the parametric position
Tu: the knot vector
ku: the order of the basis functions
work: a temporary array of size 2*k
u is on the idx-th knot span such that u is in the interval
u \in [Tu[idx], Tu[idx+1])
*/
void bspline_basis( double * N, const int idx, const double u,
const double * Tu,
const int ku, double * work );
/*
Compute the derivative of the b-spline basis
output:
N: the basis functions - an array of size k*(ideriv+1)
input:
idx: the index of the interval for u
u: the parametric position
Tu: the knot vector
ku: the order of the basis functions
work: a temporary array of size 2*k + k*k
u is on the idx-th knot span such that u is in the interval
u \in [Tu[idx], Tu[idx+1])
*/
void bspline_basis_derivative( double * N, const int idx, const double u,
int ideriv, const double * Tu,
const int ku, double * work );
/*
Evaluate the one-dimensional b-spline
input:
u: the parametric location for the spline evaluation
idu: the order of the derivative to use
T: the knot vector of length n + k
n: the number of knots
k: the order of the spline to evaluate
coef: the spline coefficients
work: a working array for temporary storage
the work array must be of size:
if idu == 0: len = 3*ku
otherwise: len = (idu+3)*ku + ku*ku
returns:
the value of the interpolant (or its derivative) at u
*/
TacsScalar bspline1d( const double u, const int idu, const double * Tu,
const int nu, const int ku, const TacsScalar * coef,
double * work );
/*
Evaluate a two-dimensional tensor product b-spline
input:
u, v: the parametric location for the spline evaluation
idu, idv: the order of the derivative to use
Tu, Tv: the knot vector of length n + k
nu, nv: the number of knots
ku, kv: the order of the spline to evaluate
coef: the spline coefficients
work: a working array for temporary storage
the work array must be of size:
if idu == 0: len = ku + kv + 2*max(ku, kv)
otherwise: len = (idu+1)*ku + (idv+1)*kv + max(2*ku + ku**2, 2*kv + kv**2)
returns:
the value of the interpolant (or its derivative) at u
*/
TacsScalar bspline2d( const double u, const double v,
const int idu, const int idv,
const double * Tu, const double * Tv,
const int nu, const int nv, const int ku, const int kv,
const TacsScalar * coef,
double * work );
/*
Evaluate a three-dimensional tensor product b-spline
input:
u, v, w: the parametric location for the spline evaluation
idu, idv, idw: the order of the derivative to use
Tu, Tv, Tw: the knot vector of length n + k
nu, nv, nw: the number of knots
ku, kv, kw: the order of the spline to evaluate
coef: the spline coefficients
work: a working array for temporary storage
the work array must be of size:
if idu == 0: len = ku + kv + kw + 2*max(ku, kv, kw)
otherwise:
len = (idu+1)*ku + (idv+1)*kv + (idw+1)*kw +
max(2*ku + ku**2, 2*kv + kv**2, 2*kw + kw**2)
returns:
the value of the interpolant (or its derivative) at u
*/
TacsScalar bspline3d( const double u, const double v, const double w,
const int idu, const int idv, const int idw,
const double * Tu, const double * Tv, const double * Tw,
const int nu, const int nv, const int nw,
const int ku, const int kv, const int kw,
const TacsScalar * coef,
double * work );
/*
C1 functions for one dimensional problems
*/
void cubicHP( double N[], double Na[], double Naa[], double a );
void quinticHP( double N[], double Na[], double Naa[], double a );
TACS_END_NAMESPACE
#endif
| 29.834025 | 78 | 0.643115 | [
"shape",
"vector"
] |
d24ef0232b3e45a03f7c13508b0fea9d4eaecadd | 795 | h | C | code/modules/opengl/resources/opengl/shaders/2d/figure/vs.shader.h | BrightComposite/RaptureStateToolkit | 6eb3c831540ba6a9d29e903dd3c537aac2e7f91f | [
"MIT"
] | null | null | null | code/modules/opengl/resources/opengl/shaders/2d/figure/vs.shader.h | BrightComposite/RaptureStateToolkit | 6eb3c831540ba6a9d29e903dd3c537aac2e7f91f | [
"MIT"
] | null | null | null | code/modules/opengl/resources/opengl/shaders/2d/figure/vs.shader.h | BrightComposite/RaptureStateToolkit | 6eb3c831540ba6a9d29e903dd3c537aac2e7f91f | [
"MIT"
] | null | null | null | //---------------------------------------------------------------------------
#include <opengl/vertex_layout.h>
//---------------------------------------------------------------------------
static const char * const shader_code_2d_figure_vs = R"SHADER(
/**
* !vertex: p2
*/
#version 330 core
layout(std140) uniform Model
{
mat4 model;
};
layout(std140) uniform Projection
{
mat4 projection;
};
in vec2 position;
void main(void)
{
gl_Position = vec4(position, 0.0, 1.0) * model * projection;
}
)SHADER";
//---------------------------------------------------------------------------
static const ::asd::opengl::vertex_layout & shader_code_2d_figure_layout = ::asd::opengl::vertex_layouts::p2::get();
//---------------------------------------------------------------------------
| 21.486486 | 116 | 0.426415 | [
"model"
] |
d24f333ca28db02031f542ef01bff14824555466 | 4,649 | h | C | content/browser/android/in_process/synchronous_compositor_output_surface.h | Fusion-Rom/android_external_chromium_org | d8b126911c6ea9753e9f526bee5654419e1d0ebd | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2015-08-13T21:04:58.000Z | 2015-08-13T21:04:58.000Z | content/browser/android/in_process/synchronous_compositor_output_surface.h | Fusion-Rom/android_external_chromium_org | d8b126911c6ea9753e9f526bee5654419e1d0ebd | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | content/browser/android/in_process/synchronous_compositor_output_surface.h | Fusion-Rom/android_external_chromium_org | d8b126911c6ea9753e9f526bee5654419e1d0ebd | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T06:34:36.000Z | 2020-11-04T06:34:36.000Z | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
#define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/managed_memory_policy.h"
#include "cc/output/output_surface.h"
#include "content/public/browser/android/synchronous_compositor.h"
#include "ipc/ipc_message.h"
#include "ui/gfx/transform.h"
namespace cc {
class ContextProvider;
class CompositorFrameMetadata;
}
namespace IPC {
class Message;
}
namespace content {
class FrameSwapMessageQueue;
class SynchronousCompositorClient;
class SynchronousCompositorOutputSurface;
class WebGraphicsContext3DCommandBufferImpl;
class SynchronousCompositorOutputSurfaceDelegate {
public:
virtual void DidBindOutputSurface(
SynchronousCompositorOutputSurface* output_surface) = 0;
virtual void DidDestroySynchronousOutputSurface(
SynchronousCompositorOutputSurface* output_surface) = 0;
virtual void SetContinuousInvalidate(bool enable) = 0;
virtual void DidActivatePendingTree() = 0;
protected:
SynchronousCompositorOutputSurfaceDelegate() {}
virtual ~SynchronousCompositorOutputSurfaceDelegate() {}
};
// Specialization of the output surface that adapts it to implement the
// content::SynchronousCompositor public API. This class effects an "inversion
// of control" - enabling drawing to be orchestrated by the embedding
// layer, instead of driven by the compositor internals - hence it holds two
// 'client' pointers (|client_| in the OutputSurface baseclass and
// GetDelegate()) which represent the consumers of the two roles in plays.
// This class can be created only on the main thread, but then becomes pinned
// to a fixed thread when BindToClient is called.
class SynchronousCompositorOutputSurface
: NON_EXPORTED_BASE(public cc::OutputSurface) {
public:
explicit SynchronousCompositorOutputSurface(
int routing_id,
scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue);
virtual ~SynchronousCompositorOutputSurface();
// OutputSurface.
virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE;
virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE;
virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE;
// Partial SynchronousCompositor API implementation.
bool InitializeHwDraw(
scoped_refptr<cc::ContextProvider> onscreen_context_provider);
void ReleaseHwDraw();
scoped_ptr<cc::CompositorFrame> DemandDrawHw(
gfx::Size surface_size,
const gfx::Transform& transform,
gfx::Rect viewport,
gfx::Rect clip,
gfx::Rect viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority);
void ReturnResources(const cc::CompositorFrameAck& frame_ack);
scoped_ptr<cc::CompositorFrame> DemandDrawSw(SkCanvas* canvas);
void SetMemoryPolicy(const SynchronousCompositorMemoryPolicy& policy);
void GetMessagesToDeliver(ScopedVector<IPC::Message>* messages);
private:
class SoftwareDevice;
friend class SoftwareDevice;
void InvokeComposite(const gfx::Transform& transform,
gfx::Rect viewport,
gfx::Rect clip,
gfx::Rect viewport_rect_for_tile_priority,
gfx::Transform transform_for_tile_priority,
bool hardware_draw);
bool CalledOnValidThread() const;
SynchronousCompositorOutputSurfaceDelegate* GetDelegate();
int routing_id_;
bool needs_begin_frame_;
bool invoking_composite_;
gfx::Transform cached_hw_transform_;
gfx::Rect cached_hw_viewport_;
gfx::Rect cached_hw_clip_;
gfx::Rect cached_hw_viewport_rect_for_tile_priority_;
gfx::Transform cached_hw_transform_for_tile_priority_;
// Only valid (non-NULL) during a DemandDrawSw() call.
SkCanvas* current_sw_canvas_;
cc::ManagedMemoryPolicy memory_policy_;
cc::OutputSurfaceClient* output_surface_client_;
scoped_ptr<cc::CompositorFrame> frame_holder_;
scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface);
};
} // namespace content
#endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
| 36.320313 | 86 | 0.785115 | [
"vector",
"transform"
] |
d24fbb40c775002f4eed2c20a641f1761e4d6513 | 1,815 | h | C | headers/mt.h | nicoleipi/hpccs | c4e9a54a2e37282352747a2a15187ed255b44a02 | [
"Unlicense"
] | 31 | 2015-02-28T23:51:10.000Z | 2021-12-25T04:16:01.000Z | headers/mt.h | nicoleipi/hpccs | c4e9a54a2e37282352747a2a15187ed255b44a02 | [
"Unlicense"
] | 126 | 2015-01-01T13:42:05.000Z | 2021-07-13T14:11:42.000Z | headers/mt.h | nicoleipi/hpccs | c4e9a54a2e37282352747a2a15187ed255b44a02 | [
"Unlicense"
] | 14 | 2015-02-10T15:08:32.000Z | 2019-09-17T01:21:25.000Z | /**
* mt.h: Mersenne Twister header file
*
* Jason R. Blevins <jrblevin@sdf.lonestar.org>
* Durham, March 7, 2007
*/
#ifndef METRICS_MT_H
#define METRICS_MT_H
/**
* Mersenne Twister.
*
* M. Matsumoto and T. Nishimura, "Mersenne Twister: A
* 623-dimensionally equidistributed uniform pseudorandom number
* generator", ACM Trans. on Modeling and Computer Simulation Vol. 8,
* No. 1, January pp.3-30 (1998).
*
* http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html.
*/
class MersenneTwister
{
public:
MersenneTwister(void);
~MersenneTwister(void);
double random(void) { return genrand_real1(); }
void print(void);
void init_genrand(unsigned long s);
void init_by_array(unsigned long* init_key, int key_length);
unsigned long genrand_int32(void);
long genrand_int31(void);
double genrand_real1(void);
double genrand_real2(void);
double genrand_real3(void);
double genrand_res53(void);
private:
static const int N = 624;
static const int M = 397;
// constant vector a
static const unsigned long MATRIX_A = 0x9908b0dfUL;
// most significant w-r bits
static const unsigned long UPPER_MASK = 0x80000000UL;
// least significant r bits
static const unsigned long LOWER_MASK = 0x7fffffffUL;
unsigned long* mt_; // the state vector
int mti_; // mti == N+1 means mt not initialized
unsigned long* init_key_; // Storage for the seed vector
int key_length_; // Seed vector length
unsigned long s_; // Seed integer
bool seeded_by_array_; // Seeded by an array
bool seeded_by_int_; // Seeded by an integer
};
#endif // METRICS_MT_H
| 29.754098 | 79 | 0.63416 | [
"vector"
] |
d2537004a08194de83cbf37efdc7bcce309f4d89 | 4,994 | h | C | Common/OpenCL/ITKimprovements/itkGPUUnaryFunctorImageFilter.h | alvarez-pa/elastix | b161a0b07eb2b828a748a0a1c2782e950069fb56 | [
"Apache-2.0"
] | null | null | null | Common/OpenCL/ITKimprovements/itkGPUUnaryFunctorImageFilter.h | alvarez-pa/elastix | b161a0b07eb2b828a748a0a1c2782e950069fb56 | [
"Apache-2.0"
] | null | null | null | Common/OpenCL/ITKimprovements/itkGPUUnaryFunctorImageFilter.h | alvarez-pa/elastix | b161a0b07eb2b828a748a0a1c2782e950069fb56 | [
"Apache-2.0"
] | null | null | null | /*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkGPUUnaryFunctorImageFilter_h
#define itkGPUUnaryFunctorImageFilter_h
#include "itkGPUFunctorBase.h"
#include "itkGPUInPlaceImageFilter.h"
#include "itkUnaryFunctorImageFilter.h"
namespace itk
{
/** \class GPUUnaryFunctorImageFilter
* \brief Implements pixel-wise generic operation on one image using the GPU.
*
* GPU version of unary functor image filter.
* GPU Functor handles parameter setup for the GPU kernel.
*
* \note This file was taken from ITK 4.1.0.
* It was modified by Denis P. Shamonin and Marius Staring.
* Division of Image Processing,
* Department of Radiology, Leiden, The Netherlands.
* Added functionality is described in the Insight Journal paper:
* http://hdl.handle.net/10380/3393
*
* \ingroup ITKGPUCommon
*/
template <typename TInputImage,
typename TOutputImage,
typename TFunction,
typename TParentImageFilter = InPlaceImageFilter<TInputImage, TOutputImage>>
class ITKOpenCL_EXPORT GPUUnaryFunctorImageFilter
: public GPUInPlaceImageFilter<TInputImage, TOutputImage, TParentImageFilter>
{
public:
/** Standard class typedefs. */
typedef GPUUnaryFunctorImageFilter Self;
typedef TParentImageFilter CPUSuperclass;
typedef GPUInPlaceImageFilter<TInputImage, TOutputImage> GPUSuperclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(GPUUnaryFunctorImageFilter, GPUInPlaceImageFilter);
/** Some typedefs. */
typedef TFunction FunctorType;
typedef TInputImage InputImageType;
typedef typename InputImageType::ConstPointer InputImagePointer;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
typedef TOutputImage OutputImageType;
typedef typename OutputImageType::Pointer OutputImagePointer;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename OutputImageType::PixelType OutputImagePixelType;
/** ImageDimension constants */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
FunctorType &
GetFunctor()
{
return m_Functor;
}
const FunctorType &
GetFunctor() const
{
return m_Functor;
}
/** Set the functor object. */
void
SetFunctor(const FunctorType & functor)
{
if (m_Functor != functor)
{
m_Functor = functor;
this->Modified();
}
}
protected:
GPUUnaryFunctorImageFilter() = default;
~GPUUnaryFunctorImageFilter() override = default;
void
GenerateOutputInformation() override;
void
GPUGenerateData() override;
/** GPU kernel handle is defined here instead of in the child class
* because GPUGenerateData() in this base class is used. */
int m_UnaryFunctorImageFilterGPUKernelHandle;
private:
GPUUnaryFunctorImageFilter(const Self &) = delete;
void
operator=(const Self &) = delete;
FunctorType m_Functor;
};
} // end of namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkGPUUnaryFunctorImageFilter.hxx"
#endif
#endif
| 32.640523 | 88 | 0.684021 | [
"object"
] |
d253f4a7d5617a8a617bfed259875507491195bb | 4,800 | h | C | src/kmscon_conf.h | sjnewbury/kmscon | 0fc6ec4e7d9e6cf26d0508d2a684a9f0ddccbffa | [
"MIT"
] | 262 | 2015-01-01T02:17:03.000Z | 2022-03-30T21:11:14.000Z | src/kmscon_conf.h | sjnewbury/kmscon | 0fc6ec4e7d9e6cf26d0508d2a684a9f0ddccbffa | [
"MIT"
] | 35 | 2018-05-28T02:07:23.000Z | 2022-02-22T23:53:35.000Z | src/kmscon_conf.h | sjnewbury/kmscon | 0fc6ec4e7d9e6cf26d0508d2a684a9f0ddccbffa | [
"MIT"
] | 50 | 2015-04-16T03:06:19.000Z | 2022-02-27T19:16:55.000Z | /*
* Main App
*
* Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* This includes global data for the whole kmscon application. For instance,
* global parameters can be accessed via this header.
*/
#ifndef KMSCON_MAIN_H
#define KMSCON_MAIN_H
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include "conf.h"
#include "shl_dlist.h"
enum kmscon_conf_gpu_selection {
KMSCON_GPU_ALL,
KMSCON_GPU_AUX,
KMSCON_GPU_PRIMARY,
};
struct kmscon_conf_t {
/* header information */
bool seat_config;
/* General Options */
/* show help/usage information */
bool help;
/* exit application after parsing options */
bool exit;
/* enable verbose info messages */
bool verbose;
/* enable debug messages */
bool debug;
/* disable notices and warnings */
bool silent;
/* config directory name */
char *configdir;
/* listen mode */
bool listen;
/* Seat Options */
/* VT number to run on */
char *vt;
/* enter new VT directly */
bool switchvt;
/* seats */
char **seats;
/* Session Options */
/* sessions */
unsigned int session_max;
/* allow keyboard session control */
bool session_control;
/* run terminal session */
bool terminal_session;
/* Terminal Options */
/* custom login process */
bool login;
/* argv for login process */
char **argv;
/* TERM value */
char *term;
/* reset environment */
bool reset_env;
/* color palette */
char *palette;
/* terminal scroll-back buffer size */
unsigned int sb_size;
/* Input Options */
/* input KBD model */
char *xkb_model;
/* input KBD layout */
char *xkb_layout;
/* input KBD variant */
char *xkb_variant;
/* input KBD options */
char *xkb_options;
/* input predefined KBD keymap */
char *xkb_keymap;
/* keyboard key-repeat delay */
unsigned int xkb_repeat_delay;
/* keyboard key-repeat rate */
unsigned int xkb_repeat_rate;
/* Grabs / Keyboard-Shortcuts */
/* scroll-up grab */
struct conf_grab *grab_scroll_up;
/* scroll-down grab */
struct conf_grab *grab_scroll_down;
/* page-up grab */
struct conf_grab *grab_page_up;
/* page-down grab */
struct conf_grab *grab_page_down;
/* zoom-in grab */
struct conf_grab *grab_zoom_in;
/* zoom-out grab */
struct conf_grab *grab_zoom_out;
/* session-next grab */
struct conf_grab *grab_session_next;
/* session-prev grab */
struct conf_grab *grab_session_prev;
/* session-dummy grab */
struct conf_grab *grab_session_dummy;
/* session-close grab */
struct conf_grab *grab_session_close;
/* terminal-new grab */
struct conf_grab *grab_terminal_new;
/* Video Options */
/* use DRM if available */
bool drm;
/* use 3D hardware-acceleration if available */
bool hwaccel;
/* gpu selection mode */
unsigned int gpus;
/* render engine */
char *render_engine;
/* Font Options */
/* font engine */
char *font_engine;
/* font size */
unsigned int font_size;
/* font name */
char *font_name;
/* font ppi (overrides per monitor PPI) */
unsigned int font_ppi;
};
int kmscon_conf_new(struct conf_ctx **out);
void kmscon_conf_free(struct conf_ctx *ctx);
int kmscon_conf_load_main(struct conf_ctx *ctx, int argc, char **argv);
int kmscon_conf_load_seat(struct conf_ctx *ctx, const struct conf_ctx *main,
const char *seat);
static inline bool kmscon_conf_is_current_seat(struct kmscon_conf_t *conf)
{
return conf && shl_string_list_is(conf->seats, "current");
}
static inline bool kmscon_conf_is_all_seats(struct kmscon_conf_t *conf)
{
return conf && shl_string_list_is(conf->seats, "all");
}
static inline bool kmscon_conf_is_single_seat(struct kmscon_conf_t *conf)
{
return conf && !kmscon_conf_is_all_seats(conf) &&
shl_string_list_count(conf->seats, true) == 1;
}
#endif /* KMSCON_MAIN_H */
| 26.666667 | 76 | 0.720833 | [
"render",
"model",
"3d"
] |
d257c8dbdc030154bc64e821949902216032a57e | 3,726 | h | C | curryfire/TKAnimatedCounterLabel.h | devinross/curry-fire | f81484a50bca24d603254cab91697428972671c6 | [
"MIT"
] | 133 | 2015-08-30T11:00:02.000Z | 2022-01-13T10:25:29.000Z | curryfire/TKAnimatedCounterLabel.h | manooj-uitoux/curry-fire | e4804f4548973be11567923bf82b06a5f2f4adc3 | [
"MIT"
] | 1 | 2015-08-26T06:01:41.000Z | 2016-09-13T05:05:58.000Z | curryfire/TKAnimatedCounterLabel.h | manooj-uitoux/curry-fire | e4804f4548973be11567923bf82b06a5f2f4adc3 | [
"MIT"
] | 17 | 2015-12-23T12:31:08.000Z | 2020-04-11T15:43:58.000Z | //
// TKAnimatedCounterLabel.h
// Created by Devin Ross on 1/14/15.
//
/*
curryfire || https://github.com/devinross/curry-fire
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
@import UIKit;
#if TARGET_OS_IOS
@import pop;
#endif
/** The curve that the progress will animate at. */
typedef enum {
TKAnimatedCounterLabelAnimationCurveLinear = 0,
TKAnimatedCounterLabelAnimationCurveQuadratic = 1,
TKAnimatedCounterLabelAnimationCurveSpring = 2,
} TKAnimatedCounterLabelAnimationCurve;
/** `TKAnimatedCounterLabel` is a label used specifically to animate the counting up or down of a number. */
@interface TKAnimatedCounterLabel : UIView
/** The number formatter used to generate the text string for a numer. If you want to count money, you should change this to a current style formatter. */
@property (nonatomic,strong) NSNumberFormatter *numberFormatter;
/** The progress of the circle. */
@property (nonatomic,assign) TKAnimatedCounterLabelAnimationCurve curve;
/* The current text to this number with animating.
@param number The number.
*/
- (void) setNumber:(NSNumber *)number;
/* The current text to this number with animating.
@param number The number.
@param animated The duration of the animation.
*/
- (void) setNumber:(NSNumber *)number animated:(BOOL)animated;
/* The current text to this number with animating.
@param number The number.
@param duration The duration of the animation.
*/
- (void) setNumber:(NSNumber *)number duration:(NSTimeInterval)duration;
/* The current text to this number with animating.
@param number The number.
@param duration The duration of the animation.
@param completion The completion callback.
*/
- (void) setNumber:(NSNumber *)number duration:(NSTimeInterval)duration completion:(void (^)(BOOL finished))completion;
/* The text of the label. */
@property (nonatomic,copy) NSString *text;
/* The font of the label. */
@property (nonatomic,retain) UIFont *font;
/* The text color of the label. */
@property (nonatomic,retain) UIColor *textColor;
/* The line break mode of the label. */
@property (nonatomic,assign) NSLineBreakMode lineBreakMode;
/* The kerning of the label. */
@property (nonatomic,assign) CGFloat kerning;
/* The space inbetween characters. */
@property (nonatomic,assign) CGFloat characterPadding;
/* The text alignment of the label. */
@property (nonatomic,assign) NSTextAlignment textAlignment;
/* Default is '9'. The character width of each character is uniform so it animates nicely. The model character is the character used to figure out the character width. */
@property (nonatomic,copy) NSString *modelCharacter;
#if TARGET_OS_IOS
@property (nonatomic,strong) POPSpringAnimation *springAnimation;
#endif
@end
| 34.183486 | 170 | 0.767042 | [
"model"
] |
d25dcc2f3db08b213cefffd61711d6c8a62bbcf6 | 1,984 | h | C | Source/igstkCylinderObject.h | ipa/IGSTK | d31f77b04aa72469e18e8a989ed8316bad39ed7a | [
"BSD-3-Clause"
] | 5 | 2016-02-12T18:55:20.000Z | 2022-02-05T09:23:07.000Z | Source/igstkCylinderObject.h | ipa/IGSTK | d31f77b04aa72469e18e8a989ed8316bad39ed7a | [
"BSD-3-Clause"
] | 1 | 2018-01-26T10:39:31.000Z | 2018-01-26T10:39:31.000Z | Source/igstkCylinderObject.h | ipa/IGSTK | d31f77b04aa72469e18e8a989ed8316bad39ed7a | [
"BSD-3-Clause"
] | 4 | 2017-09-24T01:19:32.000Z | 2021-06-20T18:02:42.000Z | /*=========================================================================
Program: Image Guided Surgery Software Toolkit
Module: igstkCylinderObject.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) ISC Insight Software Consortium. All rights reserved.
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __igstkCylinderObject_h
#define __igstkCylinderObject_h
#include "igstkMacros.h"
#include "igstkSpatialObject.h"
#include <itkCylinderSpatialObject.h>
namespace igstk
{
/** \class CylinderObject
*
* \brief This class represents a cylinder object. The parameters of the
* object are the height of the object, and the radius.
* Default representation axis is X.
*
* \ingroup Object
*/
class CylinderObject
: public SpatialObject
{
public:
/** Macro with standard traits declarations. */
igstkStandardClassTraitsMacro( CylinderObject, SpatialObject )
public:
/** Typedefs */
typedef itk::CylinderSpatialObject CylinderSpatialObjectType;
/** Set the radius of the Cylinder */
void SetRadius( double radius );
/** Get the radius of the Cylinder */
double GetRadius() const;
/** Set the height of the Cylinder */
void SetHeight( double height );
/** Get the height of the Cylinder */
double GetHeight() const;
protected:
CylinderObject( void );
~CylinderObject( void );
/** Print object information */
virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
private:
/** Internal itkSpatialObject */
CylinderSpatialObjectType::Pointer m_CylinderSpatialObject;
};
} // end namespace igstk
#endif // __igstkCylinderObject_h
| 24.493827 | 75 | 0.669355 | [
"object"
] |
d2649e35beb669af0e47987421b2454d8917d1ae | 2,890 | h | C | util/Port.h | erikleitch/cpputil | 6dbd4bdbaaa60d911d166b68fdad6af6afd04963 | [
"MIT"
] | null | null | null | util/Port.h | erikleitch/cpputil | 6dbd4bdbaaa60d911d166b68fdad6af6afd04963 | [
"MIT"
] | null | null | null | util/Port.h | erikleitch/cpputil | 6dbd4bdbaaa60d911d166b68fdad6af6afd04963 | [
"MIT"
] | null | null | null | #ifndef GCP_UTIL_PORT_H
#define GCP_UTIL_PORT_H
/**
* @file Port.h
*
* Tagged: Mon May 10 16:41:20 PDT 2004
*
* @author Erik Leitch
*/
#include <string>
#include <deque>
#include "gcp/util/String.h"
#include "gcp/util/Vector.h"
namespace gcp {
namespace util {
class Port {
public:
static const unsigned int MAX_RCV_BUFFER = 300;
// The default telnet port number
static const unsigned TELNET_PORT_NO = 23;
/**
* Constructor
*/
Port(int fd = -1);
/**
* Destructor
*/
virtual ~Port();
/**
* Return the file descriptor associated with our port connection
*/
inline int getFd() {
return fd_;
}
/**
* Connect to the port
*/
virtual int connect() {return -1;};
/**
* Write a message to the port
*/
void writeString(std::string& message, int fd=-1);
void writeBytes(Vector<unsigned char>& buffer);
static void writeBytes(Vector<unsigned char>& buffer, int fd);
/**
* Read a message from the port
*/
unsigned int readBytes(unsigned char *message, int fd=-1);
unsigned int readBytes(Vector<unsigned char>& buffer);
// Read tne next byte from the serial port
unsigned char getNextByte();
std::string readString(int fd=-1);
bool concatenateString(std::ostringstream& os, int fd=-1,
bool cont=true);
void concatenateChar(std::ostringstream& os, int fd=-1);
int getNbyte(int fd=-1);
/**
* terminate a read when any of the following characters are
* read from the port
*/
void terminateAt(std::string strip);
/**
* Strip any of the following characters from data read from the
* port
*/
void strip(std::string strip);
/**
* Characters we mustn't strip. Note that this will override
* duplicate characters implied by stripUnprintable()
*/
void dontStrip(std::string strip);
/**
* Strip any unprintable characters
*/
void stripUnprintable(bool strip);
/**
* Append the passed string to the end of each line
*/
void append(std::string append);
/**
* Set no buffering for this stream
*/
void setNoBuf();
/**
* Set line buffering for this stream
*/
void setLineBuf();
protected:
int fd_;
private:
String termStr_;
String stripStr_;
String dontStripStr_;
String appendStr_;
bool stripUnprintable_;
}; // End class Port
} // End namespace util
} // End namespace gcp
#endif // End #ifndef GCP_UTIL_PORT_H
| 21.567164 | 71 | 0.548789 | [
"vector"
] |
d26721e0e5b000d68cb4c302fc1dfe47af13f578 | 54,286 | c | C | drivers/input/mxt.c | eenurkka/incubator-nuttx | 5c3d6bba6d9ec5015896c3019cd2064696373210 | [
"Apache-2.0"
] | 1 | 2022-01-04T04:04:56.000Z | 2022-01-04T04:04:56.000Z | drivers/input/mxt.c | eenurkka/incubator-nuttx | 5c3d6bba6d9ec5015896c3019cd2064696373210 | [
"Apache-2.0"
] | 4 | 2021-12-04T01:29:43.000Z | 2022-03-30T00:02:20.000Z | drivers/input/mxt.c | eenurkka/incubator-nuttx | 5c3d6bba6d9ec5015896c3019cd2064696373210 | [
"Apache-2.0"
] | null | null | null | /****************************************************************************
* drivers/input/mxt.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/* Suppress verbose debug output so that we don't swamp the system */
#ifdef CONFIG_MXT_DISABLE_CONFIG_DEBUG_INFO
# undef CONFIG_DEBUG_INFO
#endif
#include <sys/types.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <assert.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
#include <nuttx/fs/fs.h>
#include <nuttx/i2c/i2c_master.h>
#include <nuttx/wqueue.h>
#include <nuttx/random.h>
#include <nuttx/signal.h>
#include <nuttx/semaphore.h>
#include <nuttx/input/touchscreen.h>
#include <nuttx/input/mxt.h>
#include "mxt.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Driver support ***********************************************************/
/* This format is used to construct the /dev/input[n] device driver path. It
* defined here so that it will be used consistently in all places.
*/
#define DEV_FORMAT "/dev/input%d"
#define DEV_NAMELEN 16
/* This is a value for the threshold that guarantees a big difference on the
* first pendown (but can't overflow).
*/
#define INVALID_POSITION 0x1000
/* Maximum number of retries */
#define MAX_RETRIES 3
/* Get a 16-bit value in little endian order (not necessarily aligned). The
* source data is in little endian order. The host byte order does not
* matter in this case.
*/
#define MXT_GETUINT16(p) \
(((uint16_t)(((FAR uint8_t *)(p))[1]) << 8) | \
(uint16_t)(((FAR uint8_t *)(p))[0]))
/****************************************************************************
* Private Types
****************************************************************************/
/* This enumeration describes the state of one contact.
*
* |
* v
* CONTACT_NONE (1) Touch
* / (1) ^ (3) (2) Release
* v \ (3) Event reported
* CONTACT_NEW CONTACT_LOST
* \ (3) ^ (2)
* v /
* CONTACT_REPORT
* \ (1) ^ (3)
* v /
* CONTACT_MOVE
*
* NOTE: This state transition diagram is simplified. There are a few other
* sneaky transitions to handle unexpected conditions.
*/
enum mxt_contact_e
{
CONTACT_NONE = 0, /* No contact */
CONTACT_NEW, /* New contact */
CONTACT_MOVE, /* Same contact, possibly different position */
CONTACT_REPORT, /* Contact reported */
CONTACT_LOST, /* Contact lost */
};
/* This structure describes the results of one MXT sample */
struct mxt_sample_s
{
uint8_t id; /* Sampled touch point ID */
uint8_t contact; /* Contact state (see enum mxt_contact_e) */
bool valid; /* True: x,y,pressure contain valid, sampled data */
uint16_t x; /* Measured X position */
uint16_t y; /* Measured Y position */
uint16_t lastx; /* Last reported X position */
uint16_t lasty; /* Last reported Y position */
uint8_t area; /* Contact area */
uint8_t pressure; /* Contact pressure */
};
/* This 7-bit 'info' data read from the MXT and that describes the
* characteristics of the particular maXTouch chip
*/
struct mxt_info_s
{
uint8_t family; /* MXT family ID */
uint8_t variant; /* MXT variant ID */
uint8_t version; /* MXT version number */
uint8_t build; /* MXT build number */
uint8_t xsize; /* Matrix X size */
uint8_t ysize; /* Matrix Y size */
uint8_t nobjects; /* Number of objects */
};
#define MXT_INFO_SIZE 7
/* Describes the state of the MXT driver */
struct mxt_dev_s
{
/* These are the retained references to the I2C device and to the
* lower half configuration data.
*/
FAR struct i2c_master_s *i2c;
FAR const struct mxt_lower_s *lower;
/* This is the allocated array of object information */
FAR struct mxt_object_s *objtab;
/* This is an allocated array of sample data, one for each possible touch */
FAR struct mxt_sample_s *sample; /* Last sampled touch point data */
uint8_t nwaiters; /* Number of threads waiting for MXT data */
uint8_t id; /* Current touch point ID */
uint8_t nslots; /* Number of slots */
uint8_t crefs; /* Reference count */
/* Cached parameters from object table */
#ifdef MXT_SUPPORT_T6
uint8_t t6id; /* T6 report ID */
#endif
uint8_t t9idmin; /* T9 touch event report IDs */
uint8_t t9idmax;
#ifdef CONFIG_MXT_BUTTONS
uint8_t t19id; /* T19 button report ID */
#endif
volatile bool event; /* True: An unreported event is buffered */
sem_t devsem; /* Manages exclusive access to this structure */
sem_t waitsem; /* Used to wait for the availability of data */
uint32_t frequency; /* Current I2C frequency */
char phys[64]; /* Device physical location */
struct mxt_info_s info; /* Configuration info read from device */
struct work_s work; /* Supports the interrupt handling "bottom half" */
/* The following is a list if poll structures of threads waiting for
* driver events. The 'struct pollfd' reference for each open is also
* retained in the f_priv field of the 'struct file'.
*/
struct pollfd *fds[CONFIG_MXT_NPOLLWAITERS];
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/* MXT register access */
static int mxt_getreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
FAR uint8_t *buffer, size_t buflen);
static int mxt_putreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
FAR const uint8_t *buffer, size_t buflen);
/* MXT object/message access */
static FAR struct mxt_object_s *mxt_object(FAR struct mxt_dev_s *priv,
uint8_t type);
static int mxt_getmessage(FAR struct mxt_dev_s *priv,
FAR struct mxt_msg_s *msg);
static int mxt_putobject(FAR struct mxt_dev_s *priv, uint8_t type,
uint8_t offset, uint8_t value);
#if 0 /* Not used */
static int mxt_getobject(FAR struct mxt_dev_s *priv, uint8_t type,
uint8_t offset, FAR uint8_t *value);
#endif
static int mxt_flushmsgs(FAR struct mxt_dev_s *priv);
/* Poll support */
static void mxt_notify(FAR struct mxt_dev_s *priv);
/* Touch event waiting */
static inline int mxt_checksample(FAR struct mxt_dev_s *priv);
static inline int mxt_waitsample(FAR struct mxt_dev_s *priv);
/* Interrupt handling/position sampling */
#ifdef CONFIG_MXT_BUTTONS
static void mxt_button_event(FAR struct mxt_dev_s *priv,
FAR struct mxt_msg_s *msg);
#endif
static void mxt_touch_event(FAR struct mxt_dev_s *priv,
FAR struct mxt_msg_s *msg, int ndx);
static void mxt_worker(FAR void *arg);
static int mxt_interrupt(FAR const struct mxt_lower_s *lower,
FAR void *context);
/* Character driver methods */
static int mxt_open(FAR struct file *filep);
static int mxt_close(FAR struct file *filep);
static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer,
size_t len);
static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int mxt_poll(FAR struct file *filep, struct pollfd *fds, bool setup);
/* Initialization */
static int mxt_getinfo(struct mxt_dev_s *priv);
static int mxt_getobjtab(FAR struct mxt_dev_s *priv);
static int mxt_hwinitialize(FAR struct mxt_dev_s *priv);
/****************************************************************************
* Private Data
****************************************************************************/
/* This the vtable that supports the character driver interface */
static const struct file_operations mxt_fops =
{
mxt_open, /* open */
mxt_close, /* close */
mxt_read, /* read */
NULL, /* write */
NULL, /* seek */
mxt_ioctl, /* ioctl */
mxt_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, NULL /* unlink */
#endif
};
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: mxt_getreg
****************************************************************************/
static int mxt_getreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
FAR uint8_t *buffer, size_t buflen)
{
struct i2c_msg_s msg[2];
uint8_t addrbuf[2];
int retries;
int ret;
/* Try up to three times to read the register */
for (retries = 1; retries <= MAX_RETRIES; retries++)
{
iinfo("retries=%d regaddr=%04x buflen=%d\n", retries, regaddr, buflen);
/* Set up to write the address */
addrbuf[0] = regaddr & 0xff;
addrbuf[1] = (regaddr >> 8) & 0xff;
msg[0].frequency = priv->frequency;
msg[0].addr = priv->lower->address;
msg[0].flags = 0;
msg[0].buffer = addrbuf;
msg[0].length = 2;
/* Followed by the read data */
msg[1].frequency = priv->frequency;
msg[1].addr = priv->lower->address;
msg[1].flags = I2C_M_READ;
msg[1].buffer = buffer;
msg[1].length = buflen;
/* Read the register data. The returned value is the number messages
* completed.
*/
ret = I2C_TRANSFER(priv->i2c, msg, 2);
if (ret < 0)
{
#ifdef CONFIG_I2C_RESET
/* Perhaps the I2C bus is locked up? Try to shake the bus free.
* Don't bother with the reset if this was the last attempt.
*/
if (retries < MAX_RETRIES)
{
iwarn("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret);
ret = I2C_RESET(priv->i2c);
if (ret < 0)
{
ierr("ERROR: I2C_RESET failed: %d\n", ret);
break;
}
}
#else
ierr("ERROR: I2C_TRANSFER failed: %d\n", ret);
#endif
}
else
{
/* The I2C transfer was successful... break out of the loop and
* return the success indication.
*/
break;
}
}
/* Return the last status returned by I2C_TRANSFER */
return ret;
}
/****************************************************************************
* Name: mxt_putreg
****************************************************************************/
static int mxt_putreg(FAR struct mxt_dev_s *priv, uint16_t regaddr,
FAR const uint8_t *buffer, size_t buflen)
{
struct i2c_msg_s msg[2];
uint8_t addrbuf[2];
int retries;
int ret;
/* Try up to three times to read the register */
for (retries = 1; retries <= MAX_RETRIES; retries++)
{
iinfo("retries=%d regaddr=%04x buflen=%d\n", retries, regaddr, buflen);
/* Set up to write the address */
addrbuf[0] = regaddr & 0xff;
addrbuf[1] = (regaddr >> 8) & 0xff;
msg[0].frequency = priv->frequency;
msg[0].addr = priv->lower->address;
msg[0].flags = 0;
msg[0].buffer = addrbuf;
msg[0].length = 2;
/* Followed by the write data (with no repeated start) */
msg[1].frequency = priv->frequency;
msg[1].addr = priv->lower->address;
msg[1].flags = I2C_M_NOSTART;
msg[1].buffer = (FAR uint8_t *)buffer;
msg[1].length = buflen;
/* Write the register data. The returned value is the number messages
* completed.
*/
ret = I2C_TRANSFER(priv->i2c, msg, 2);
if (ret < 0)
{
#ifdef CONFIG_I2C_RESET
/* Perhaps the I2C bus is locked up? Try to shake the bus free.
* Don't bother with the reset if this was the last attempt.
*/
if (retries < MAX_RETRIES)
{
iwarn("WARNING: I2C_TRANSFER failed: %d ... Resetting\n", ret);
ret = I2C_RESET(priv->i2c);
if (ret < 0)
{
ierr("ERROR: I2C_RESET failed: %d\n", ret);
}
}
#else
ierr("ERROR: I2C_TRANSFER failed: %d\n", ret);
#endif
}
else
{
/* The I2C transfer was successful... break out of the loop and
* return the success indication.
*/
break;
}
}
/* Return the last status returned by I2C_TRANSFER */
return ret;
}
/****************************************************************************
* Name: mxt_object
****************************************************************************/
static FAR struct mxt_object_s *mxt_object(FAR struct mxt_dev_s *priv,
uint8_t type)
{
struct mxt_object_s *object;
int i;
/* Search the object table for the entry matching the type */
for (i = 0; i < priv->info.nobjects; i++)
{
object = &priv->objtab[i];
if (object->type == type)
{
/* Found it.. return the pointer to the object structure */
return object;
}
}
ierr("ERROR: Invalid object type: %d\n", type);
return NULL;
}
/****************************************************************************
* Name: mxt_getmessage
****************************************************************************/
static int mxt_getmessage(FAR struct mxt_dev_s *priv,
FAR struct mxt_msg_s *msg)
{
struct mxt_object_s *object;
uint16_t regaddr;
object = mxt_object(priv, MXT_GEN_MESSAGE_T5);
if (object == NULL)
{
ierr("ERROR: mxt_object failed\n");
return -EINVAL;
}
regaddr = MXT_GETUINT16(object->addr);
return mxt_getreg(priv, regaddr, (FAR uint8_t *)msg,
sizeof(struct mxt_msg_s));
}
/****************************************************************************
* Name: mxt_putobject
****************************************************************************/
static int mxt_putobject(FAR struct mxt_dev_s *priv, uint8_t type,
uint8_t offset, uint8_t value)
{
FAR struct mxt_object_s *object;
uint16_t regaddr;
object = mxt_object(priv, type);
if (object == NULL || offset >= object->size + 1)
{
return -EINVAL;
}
regaddr = MXT_GETUINT16(object->addr);
return mxt_putreg(priv, regaddr + offset, &value, 1);
}
/****************************************************************************
* Name: mxt_getobject
****************************************************************************/
#if 0 /* Not used */
static int mxt_getobject(FAR struct mxt_dev_s *priv, uint8_t type,
uint8_t offset, FAR uint8_t *value)
{
FAR struct mxt_object_s *object;
uint16_t regaddr;
object = mxt_object(priv, type);
if (object == NULL || offset >= object->size + 1)
{
return -EINVAL;
}
regaddr = MXT_GETUINT16(object->addr);
return mxt_getreg(priv, regaddr + offset, value, 1);
}
#endif
/****************************************************************************
* Name: mxt_flushmsgs
*
* Clear any pending messages be reading messages until there are no
* pending messages. This will force the CHG pin to the high state and
* prevent spurious initial interrupts.
*
****************************************************************************/
static int mxt_flushmsgs(FAR struct mxt_dev_s *priv)
{
struct mxt_msg_s msg;
int retries = 16;
int ret;
/* Read dummy message until there are no more to read (or until we have
* tried 10 times).
*/
do
{
ret = mxt_getmessage(priv, &msg);
if (ret < 0)
{
ierr("ERROR: mxt_getmessage failed: %d\n", ret);
return ret;
}
}
while (msg.id != 0xff && --retries > 0);
/* Complain if we exceed the retry limit */
if (retries <= 0)
{
ierr("ERROR: Failed to clear messages: ID=%02x\n", msg.id);
return -EBUSY;
}
return OK;
}
/****************************************************************************
* Name: mxt_notify
****************************************************************************/
static void mxt_notify(FAR struct mxt_dev_s *priv)
{
int i;
/* If there are threads waiting on poll() for maXTouch data to become
* available, then wake them up now. NOTE: we wake up all waiting threads
* because we do not know that they are going to do. If they all try to
* read the data, then some make end up blocking after all.
*/
for (i = 0; i < CONFIG_MXT_NPOLLWAITERS; i++)
{
struct pollfd *fds = priv->fds[i];
if (fds)
{
fds->revents |= POLLIN;
iinfo("Report events: %08" PRIx32 "\n", fds->revents);
nxsem_post(fds->sem);
}
}
/* If there are threads waiting for read data, then signal one of them
* that the read data is available.
*/
if (priv->nwaiters > 0)
{
/* After posting this semaphore, we need to exit because the maXTouch
* is no longer available.
*/
nxsem_post(&priv->waitsem);
}
}
/****************************************************************************
* Name: mxt_checksample
*
* Description:
* This function implements a test and clear of the priv->event flag.
* Called only from mxt_waitsample.
*
* Assumptions:
* - Scheduler must be locked to prevent the worker thread from running
* while this thread runs. The sample data is, of course, updated from
* the worker thread.
* - Interrupts must be disabled when this is called to (1) prevent posting
* of semaphores from interrupt handlers, and (2) to prevent sampled data
* from changing until it has been reported.
*
****************************************************************************/
static inline int mxt_checksample(FAR struct mxt_dev_s *priv)
{
/* Is there new maXTouch sample data available? */
if (priv->event)
{
/* Yes.. clear the flag and return success */
priv->event = false;
return OK;
}
/* No.. return failure */
return -EAGAIN;
}
/****************************************************************************
* Name: mxt_waitsample
*
* Wait until sample data is available. Called only from mxt_read.
*
* Assumptions:
* - Scheduler must be locked to prevent the worker thread from running
* while this thread runs. The sample data is, of course, updated from
* the worker thread.
*
****************************************************************************/
static inline int mxt_waitsample(FAR struct mxt_dev_s *priv)
{
irqstate_t flags;
int ret;
/* Interrupts me be disabled when this is called to (1) prevent posting
* of semaphores from interrupt handlers, and (2) to prevent sampled data
* from changing until it has been reported.
*/
flags = enter_critical_section();
/* Now release the semaphore that manages mutually exclusive access to
* the device structure. This may cause other tasks to become ready to
* run, but they cannot run yet because pre-emption is disabled.
*/
nxsem_post(&priv->devsem);
/* Try to get the a sample... if we cannot, then wait on the semaphore
* that is posted when new sample data is available.
*/
while (mxt_checksample(priv) < 0)
{
/* Wait for a change in the maXTouch state */
priv->nwaiters++;
ret = nxsem_wait(&priv->waitsem);
priv->nwaiters--;
if (ret < 0)
{
goto errout;
}
}
/* Re-acquire the semaphore that manages mutually exclusive access to
* the device structure. We may have to wait here. But we have our
* sample. Interrupts and pre-emption will be re-enabled while we wait.
*/
ret = nxsem_wait(&priv->devsem);
errout:
/* Then re-enable interrupts. We might get interrupt here and there
* could be a new sample. But no new threads will run because we still
* have pre-emption disabled.
*/
leave_critical_section(flags);
return ret;
}
/****************************************************************************
* Name: mxt_button_event
****************************************************************************/
#ifdef CONFIG_MXT_BUTTONS
static void mxt_button_event(FAR struct mxt_dev_s *priv,
FAR struct mxt_msg_s *msg)
{
bool button;
int i;
/* REVISIT: Button inputs are currently ignored */
/* Buttons are active low and determined by the GPIO bit
* settings in byte 0 of the message data: A button is
* pressed if the corresponding bit is zero.
*/
for (i = 0; i < priv->lower->nbuttons; i++)
{
uint8_t bit = (MXT_GPIO0_MASK << i);
/* Does this implementation support the button? */
if ((priv->lower->bmask & bit) != 0)
{
/* Yes.. get the button state */
button = (msg->body[0] & mask) == 0;
/* Now what? */
UNUSED(button);
}
}
}
#endif
/****************************************************************************
* Name: mxt_touch_event
****************************************************************************/
static void mxt_touch_event(FAR struct mxt_dev_s *priv,
FAR struct mxt_msg_s *msg, int ndx)
{
FAR struct mxt_sample_s *sample;
uint16_t x;
uint16_t y;
uint8_t area;
uint8_t pressure;
uint8_t status;
/* Extract the 12-bit X and Y positions */
x = ((uint16_t)msg->body[1] << 4) |
(((uint16_t)msg->body[3] >> 4) & 0x0f);
y = ((uint16_t)msg->body[2] << 4) |
(((uint16_t)msg->body[3] & 0x0f));
/* Swap X/Y as necessary */
if (priv->lower->swapxy)
{
uint16_t tmp = x;
y = x;
x = tmp;
}
/* Extract area pressure and status */
area = msg->body[4];
pressure = msg->body[5];
status = msg->body[0];
iinfo("ndx=%u status=%02x pos(%u,%u) area=%u pressure=%u\n",
ndx, status, x, y, area, pressure);
/* The normal sequence that we would see for a touch would be something
* like:
*
* 1. MXT_DETECT + MXT_PRESS
* 2. MXT_DETECT + MXT_AMP
* 3. MXT_DETECT + MXT_MOVE + MXT_AMP
* 4. MXT_RELEASE
*
* So we really only need to check MXT_DETECT to drive this state machine.
*/
/* Is this a loss of contact? */
sample = &priv->sample[ndx];
if ((status & MXT_DETECT) == 0)
{
/* Ignore the event if there was no contact to be lost:
*
* CONTACT_NONE = No touch and loss-of-contact already reported
* CONTACT_LOST = No touch and unreported loss-of-contact.
*/
if (sample->contact == CONTACT_NONE)
{
/* Return without posting any event */
return;
}
/* State is one of CONTACT_NEW, CONTACT_MOVE, CONTACT_REPORT or
* CONTACT_LOST.
*
* NOTE: Here we do not check for these other states because there is
* not much that can be done anyway. The transition to CONTACK_LOST
* really only makes sense if the preceding state was CONTACT_REPORT.
* If we were in (unreported) CONTACT_NEW or CONTACT_MOVE states, then
* this will overwrite that event and it will not be reported. This
* opens the possibility for contact lost reports when no contact was
* ever reported.
*
* We could improve this be leaving the unreported states in place,
* remembering that the contact was lost, and then reporting the loss-
* of-contact after touch state is reported.
*/
sample->contact = CONTACT_LOST;
/* Reset the last position so that we guarantee that the next position
* will pass the thresholding test.
*/
sample->lastx = INVALID_POSITION;
sample->lasty = INVALID_POSITION;
}
else
{
/* It is a touch event. If the last loss-of-contact event has not
* been processed yet, then have to bump up the touch identifier and
* hope that the client is smart enough to infer the loss-of-contact
* event for the preceding touch.
*/
if (sample->contact == CONTACT_LOST)
{
priv->id++;
}
/* Save the measurements */
sample->x = x;
sample->y = y;
sample->area = area;
sample->pressure = pressure;
sample->valid = true;
add_ui_randomness((x << 16) ^ y ^ (area << 9) ^ (pressure << 1));
/* If this is not the first touch report, then report it as a move:
* Same contact, same ID, but with a new, updated position.
* The CONTACT_REPORT state means that a contacted has been detected,
* but all contact events have been successfully reported.
*/
if (sample->contact == CONTACT_REPORT)
{
uint16_t xdiff;
uint16_t ydiff;
/* Not a new contact. Check if the new measurements represent a
* non-trivial change in position. A trivial change is detected
* by comparing the change in position since the last report
* against configurable threshold values.
*
* REVISIT: Should a large change in pressure also generate a
* event?
*/
xdiff = x > sample->lastx ? (x - sample->lastx) :
(sample->lastx - x);
ydiff = y > sample->lasty ? (y - sample->lasty) :
(sample->lasty - y);
/* Check the thresholds */
if (xdiff >= CONFIG_MXT_THRESHX || ydiff >= CONFIG_MXT_THRESHY)
{
/* Report a contact move event. This state will be set back
* to CONTACT_REPORT after it been reported.
*/
sample->contact = CONTACT_MOVE;
/* Update the last position for next threshold calculations */
sample->lastx = x;
sample->lasty = y;
}
else
{
/* Bail without reporting anything for this event */
return;
}
}
/* If we have seen this contact before but it has not yet been
* reported, then do nothing other than overwrite the positional
* data.
*
* This the state must be one of CONTACT_NONE or CONTACT_LOST (see
* above) and we have a new contact with a new ID.
*/
else if (sample->contact != CONTACT_NEW &&
sample->contact != CONTACT_MOVE)
{
/* First contact. Save the contact event and assign a new
* ID to the contact.
*/
sample->contact = CONTACT_NEW;
sample->id = priv->id++;
/* Update the last position for next threshold calculations */
sample->lastx = x;
sample->lasty = y;
/* This state will be set to CONTACT_REPORT after it
* been reported.
*/
}
}
/* Indicate the availability of new sample data for this ID and notify
* any waiters that new maXTouch data is available
*/
priv->event = true;
mxt_notify(priv);
}
/****************************************************************************
* Name: mxt_worker
****************************************************************************/
static void mxt_worker(FAR void *arg)
{
FAR struct mxt_dev_s *priv = (FAR struct mxt_dev_s *)arg;
FAR const struct mxt_lower_s *lower;
struct mxt_msg_s msg;
uint8_t id;
int retries;
int ret;
DEBUGASSERT(priv != NULL);
/* Get a pointer the callbacks for convenience (and so the code is not so
* ugly).
*/
lower = priv->lower;
DEBUGASSERT(lower != NULL);
/* Get exclusive access to the MXT driver data structure */
do
{
ret = nxsem_wait_uninterruptible(&priv->devsem);
/* This would only fail if something canceled the worker thread?
* That is not expected.
*/
DEBUGASSERT(ret == OK || ret == -ECANCELED);
}
while (ret < 0);
/* Loop, processing each message from the maXTouch */
retries = 0;
do
{
/* Retrieve the next message from the maXTouch */
ret = mxt_getmessage(priv, &msg);
if (ret < 0)
{
ierr("ERROR: mxt_getmessage failed: %d\n", ret);
goto errout_with_semaphore;
}
id = msg.id;
#ifdef MXT_SUPPORT_T6
/* Check for T6 */
if (id == priv->t6id)
{
uint32_t chksum;
int status;
status = msg.body[0];
chksum = (uint32_t)msg.body[1] |
((uint32_t)msg.body[2] << 8) |
((uint32_t)msg.body[3] << 16);
iinfo("T6: status: %02x checksum: %06lx\n",
status, (unsigned long)chksum);
retries = 0;
}
else
#endif
/* Check for T9 */
if (id >= priv->t9idmin && id <= priv->t9idmax)
{
mxt_touch_event(priv, &msg, id - priv->t9idmin);
retries = 0;
}
#ifdef CONFIG_MXT_BUTTONS
/* Check for T19 */
else if (msg.id == priv->t19id)
{
mxt_button_event(priv, &msg);
retries = 0;
}
#endif
/* 0xff marks the end of the messages; any other message IDs are
* ignored (after complaining a little).
*/
else if (msg.id != 0xff)
{
iinfo("Ignored: id=%u message="
"{%02x %02x %02x %02x %02x %02x %02x}\n",
msg.id,
msg.body[0], msg.body[1], msg.body[2],
msg.body[3], msg.body[4], msg.body[5],
msg.body[6]);
retries++;
}
}
while (id != 0xff && retries < 16);
errout_with_semaphore:
/* Release our lock on the MXT device */
nxsem_post(&priv->devsem);
/* Acknowledge and re-enable maXTouch interrupts */
MXT_CLEAR(lower);
MXT_ENABLE(lower);
}
/****************************************************************************
* Name: mxt_interrupt
****************************************************************************/
static int mxt_interrupt(FAR const struct mxt_lower_s *lower, FAR void *arg)
{
FAR struct mxt_dev_s *priv = (FAR struct mxt_dev_s *)arg;
int ret;
/* Get a pointer the callbacks for convenience (and so the code is not so
* ugly).
*/
DEBUGASSERT(lower != NULL && priv != NULL);
/* Disable further interrupts */
MXT_DISABLE(lower);
/* Transfer processing to the worker thread. Since maXTouch interrupts are
* disabled while the work is pending, no special action should be required
* to protected the work queue.
*/
DEBUGASSERT(priv->work.worker == NULL);
ret = work_queue(HPWORK, &priv->work, mxt_worker, priv, 0);
if (ret != 0)
{
ierr("ERROR: Failed to queue work: %d\n", ret);
}
/* Clear any pending interrupts and return success */
lower->clear(lower);
return OK;
}
/****************************************************************************
* Name: mxt_open
****************************************************************************/
static int mxt_open(FAR struct file *filep)
{
FAR struct inode *inode;
FAR struct mxt_dev_s *priv;
uint8_t tmp;
int ret;
DEBUGASSERT(filep);
inode = filep->f_inode;
DEBUGASSERT(inode && inode->i_private);
priv = (FAR struct mxt_dev_s *)inode->i_private;
/* Get exclusive access to the driver data structure */
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
/* Increment the reference count */
tmp = priv->crefs + 1;
if (tmp == 0)
{
/* More than 255 opens; uint8_t overflows to zero */
ierr("ERROR: Too many opens: %d\n", priv->crefs);
ret = -EMFILE;
goto errout_with_sem;
}
/* When the reference increments to 1, this is the first open event
* on the driver.. and an opportunity to do any one-time initialization.
*/
if (tmp == 1)
{
/* Touch enable */
ret = mxt_putobject(priv, MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0x83);
if (ret < 0)
{
ierr("ERROR: Failed to enable touch: %d\n", ret);
goto errout_with_sem;
}
/* Clear any pending messages by reading all messages. This will
* force the CHG interrupt pin to the high state and prevent spurious
* interrupts when they are enabled.
*/
ret = mxt_flushmsgs(priv);
if (ret < 0)
{
ierr("ERROR: mxt_flushmsgs failed: %d\n", ret);
mxt_putobject(priv, MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0);
goto errout_with_sem;
}
/* Enable touch interrupts */
MXT_ENABLE(priv->lower);
}
/* Save the new open count on success */
priv->crefs = tmp;
errout_with_sem:
nxsem_post(&priv->devsem);
return ret;
}
/****************************************************************************
* Name: mxt_close
****************************************************************************/
static int mxt_close(FAR struct file *filep)
{
FAR struct inode *inode;
FAR struct mxt_dev_s *priv;
int ret;
DEBUGASSERT(filep);
inode = filep->f_inode;
DEBUGASSERT(inode && inode->i_private);
priv = (FAR struct mxt_dev_s *)inode->i_private;
/* Get exclusive access to the driver data structure */
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
/* Decrement the reference count unless it would decrement a negative
* value. When the count decrements to zero, there are no further
* open references to the driver.
*/
if (priv->crefs >= 1)
{
if (--priv->crefs < 1)
{
/* Disable touch interrupts */
MXT_ENABLE(priv->lower);
/* Touch disable */
ret = mxt_putobject(priv, MXT_TOUCH_MULTI_T9, MXT_TOUCH_CTRL, 0);
if (ret < 0)
{
ierr("ERROR: Failed to disable touch: %d\n", ret);
}
}
}
nxsem_post(&priv->devsem);
return OK;
}
/****************************************************************************
* Name: mxt_read
****************************************************************************/
static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer, size_t len)
{
FAR struct inode *inode;
FAR struct mxt_dev_s *priv;
ssize_t samplesize;
int ncontacts;
int ret;
int i;
int j;
DEBUGASSERT(filep);
inode = filep->f_inode;
DEBUGASSERT(inode && inode->i_private);
priv = (FAR struct mxt_dev_s *)inode->i_private;
/* Verify that the caller has provided a buffer large enough to receive
* the touch data.
*/
if (len < SIZEOF_TOUCH_SAMPLE_S(1))
{
/* We could provide logic to break up a touch report into segments and
* handle smaller reads... but why?
*/
return -ENOSYS;
}
/* Get exclusive access to the driver data structure */
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
/* Locking the scheduler will prevent the worker thread from running
* until we finish here.
*/
sched_lock();
/* Try to read sample data. */
ret = mxt_checksample(priv);
if (ret < 0)
{
/* Sample data is not available now. We would ave to wait to get
* receive sample data. If the user has specified the O_NONBLOCK
* option, then just return an error.
*/
if (filep->f_oflags & O_NONBLOCK)
{
ret = -EAGAIN;
goto errout;
}
/* Wait for sample data */
ret = mxt_waitsample(priv);
if (ret < 0)
{
/* We might have been awakened by a signal */
goto errout;
}
}
/* In any event, we now have sampled maXTouch data that we can report
* to the caller. First, count the number of valid contacts.
*/
samplesize = 0;
ncontacts = 0;
for (i = 0; i < priv->nslots; i++)
{
FAR struct mxt_sample_s *sample = &priv->sample[i];
/* Do we need to report this? We need to report the event if
* it is CONTACT_LOST or CONTACT_REPORT or CONTACT_MOVE (with new,
* valid positional data).
*/
if (sample->contact == CONTACT_LOST ||
sample->contact == CONTACT_NEW ||
sample->contact == CONTACT_MOVE)
{
int newcount = ncontacts + 1;
ssize_t newsize = SIZEOF_TOUCH_SAMPLE_S(newcount);
/* Would this sample exceed the buffer size provided by the
* caller?
*/
if (newsize > len)
{
/* Yes.. break out of the loop using the previous size and
* count.
*/
break;
}
/* Save the new size and count */
ncontacts = newcount;
samplesize = newsize;
}
}
/* Did we find any valid samples? */
if (ncontacts > 0)
{
FAR struct touch_sample_s *report =
(FAR struct touch_sample_s *)buffer;
/* Yes, copy the sample data into the user buffer */
memset(report, 0, SIZEOF_TOUCH_SAMPLE_S(ncontacts));
report->npoints = ncontacts;
for (i = 0, j = 0; i < priv->nslots && j < ncontacts; i++)
{
FAR struct mxt_sample_s *sample = &priv->sample[i];
/* Do we need to report this? We need to report the event if
* it is CONTACT_LOST or CONTACT_REPORT or CONTACT_MOVE (with new,
* valid positional data).
*/
if (sample->contact == CONTACT_LOST ||
sample->contact == CONTACT_NEW ||
sample->contact == CONTACT_MOVE)
{
/* Yes.. transfer the sample data */
FAR struct touch_point_s *point = &report->point[j];
j++;
/* REVISIT: height and width are not set, area is
* not used.
*/
point->id = sample->id;
point->x = sample->x;
point->y = sample->y;
point->pressure = sample->pressure;
/* Report the appropriate flags */
if (sample->contact == CONTACT_LOST)
{
/* The contact was lost. Is the positional data
* valid? This is important to know because the release
* will be sent to the window based on its last positional
* data.
*/
if (sample->valid)
{
point->flags = TOUCH_UP | TOUCH_ID_VALID |
TOUCH_POS_VALID | TOUCH_PRESSURE_VALID;
}
else
{
point->flags = TOUCH_UP | TOUCH_ID_VALID;
}
/* Change to CONTACT_NONE to indicate that the sample
* has been reported. From here it can change only
* to CONTACT_REPORT (with a new ID).
*/
sample->contact = CONTACT_NONE;
}
else
{
/* We have contact. Is it the first contact? */
if (sample->contact == CONTACT_NEW)
{
/* Yes.. first contact. */
point->flags = TOUCH_DOWN | TOUCH_ID_VALID |
TOUCH_POS_VALID;
}
else /* if (sample->contact == CONTACT_MOVE) */
{
/* No.. then it must be movement of the same contact */
point->flags = TOUCH_MOVE | TOUCH_ID_VALID |
TOUCH_POS_VALID;
}
/* Change to CONTACT_REPORT to indicate that the sample
* has been reported. From here is can change to
* CONTACT_LOST (same ID), CONTACT_MOVE (same ID) or back
* to CONTACT_NEW (new ID).
*/
sample->contact = CONTACT_REPORT;
/* A pressure measurement of zero means that pressure is
* not available.
*/
if (point->pressure != 0)
{
point->flags |= TOUCH_PRESSURE_VALID;
}
}
/* In any case, the sample data has been reported and is no
* longer valid.
*/
sample->valid = false;
}
}
}
ret = samplesize;
errout:
sched_unlock();
nxsem_post(&priv->devsem);
return ret;
}
/****************************************************************************
* Name: mxt_ioctl
****************************************************************************/
static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
FAR struct inode *inode;
FAR struct mxt_dev_s *priv;
int ret;
iinfo("cmd: %d arg: %ld\n", cmd, arg);
DEBUGASSERT(filep);
inode = filep->f_inode;
DEBUGASSERT(inode && inode->i_private);
priv = (FAR struct mxt_dev_s *)inode->i_private;
/* Get exclusive access to the driver data structure */
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
/* Process the IOCTL by command */
switch (cmd)
{
case TSIOC_SETFREQUENCY: /* arg: Pointer to uint32_t frequency value */
{
FAR uint32_t *ptr = (FAR uint32_t *)((uintptr_t)arg);
DEBUGASSERT(priv->lower != NULL && ptr != NULL);
priv->frequency = *ptr;
}
break;
case TSIOC_GETFREQUENCY: /* arg: Pointer to uint32_t frequency value */
{
FAR uint32_t *ptr = (FAR uint32_t *)((uintptr_t)arg);
DEBUGASSERT(priv->lower != NULL && ptr != NULL);
*ptr = priv->frequency;
}
break;
default:
ret = -ENOTTY;
break;
}
nxsem_post(&priv->devsem);
return ret;
}
/****************************************************************************
* Name: mxt_poll
****************************************************************************/
static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
bool setup)
{
FAR struct inode *inode;
FAR struct mxt_dev_s *priv;
int ret;
int i;
iinfo("setup: %d\n", (int)setup);
DEBUGASSERT(filep && fds);
inode = filep->f_inode;
DEBUGASSERT(inode && inode->i_private);
priv = (FAR struct mxt_dev_s *)inode->i_private;
/* Are we setting up the poll? Or tearing it down? */
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
if (setup)
{
/* Ignore waits that do not include POLLIN */
if ((fds->events & POLLIN) == 0)
{
ierr("ERROR: Missing POLLIN: revents: %08" PRIx32 "\n",
fds->revents);
ret = -EDEADLK;
goto errout;
}
/* This is a request to set up the poll. Find an available
* slot for the poll structure reference
*/
for (i = 0; i < CONFIG_MXT_NPOLLWAITERS; i++)
{
/* Find an available slot */
if (!priv->fds[i])
{
/* Bind the poll structure and this slot */
priv->fds[i] = fds;
fds->priv = &priv->fds[i];
break;
}
}
if (i >= CONFIG_MXT_NPOLLWAITERS)
{
ierr("ERROR: No available slot found: %d\n", i);
fds->priv = NULL;
ret = -EBUSY;
goto errout;
}
/* Should we immediately notify on any of the requested events? */
if (priv->event)
{
mxt_notify(priv);
}
}
else if (fds->priv)
{
/* This is a request to tear down the poll. */
struct pollfd **slot = (struct pollfd **)fds->priv;
DEBUGASSERT(slot != NULL);
/* Remove all memory of the poll setup */
*slot = NULL;
fds->priv = NULL;
}
errout:
nxsem_post(&priv->devsem);
return ret;
}
/****************************************************************************
* Name: mxt_getinfo
****************************************************************************/
static int mxt_getinfo(struct mxt_dev_s *priv)
{
int ret;
/* Read 7-byte information block starting at address MXT_INFO */
ret = mxt_getreg(priv, MXT_INFO, (FAR uint8_t *)&priv->info,
sizeof(struct mxt_info_s));
if (ret < 0)
{
ierr("ERROR: mxt_getreg failed: %d\n", ret);
return ret;
}
return OK;
}
/****************************************************************************
* Name: mxt_getobjtab
****************************************************************************/
static int mxt_getobjtab(FAR struct mxt_dev_s *priv)
{
FAR struct mxt_object_s *object;
size_t tabsize;
uint8_t idmin;
uint8_t idmax;
uint8_t id;
int ret;
int i;
/* Read the size of the object table */
tabsize = priv->info.nobjects * sizeof(struct mxt_object_s);
ret = mxt_getreg(priv, MXT_OBJECT_START, (FAR uint8_t *)priv->objtab,
tabsize);
if (ret < 0)
{
ierr("ERROR: Failed to object table size: %d\n", ret);
return ret;
}
/* Search through the object table. Find the values associated with
* certain object types and save those ID.Valid report IDs start at ID=1.
*/
for (i = 0, id = 1; i < priv->info.nobjects; i++)
{
object = &priv->objtab[i];
if (object->nids > 0)
{
idmin = id;
id += object->nids * (object->ninstances + 1);
idmax = id - 1;
}
else
{
idmin = 0;
idmax = 0;
}
iinfo("%2d. type %2d addr %04x size: %d instances: %d IDs: %u-%u\n",
i, object->type, MXT_GETUINT16(object->addr), object->size + 1,
object->ninstances + 1, idmin, idmax);
switch (object->type)
{
#ifdef MXT_SUPPORT_T6
case MXT_GEN_COMMAND_T6:
priv->t6id = idmin;
break;
#endif
case MXT_TOUCH_MULTI_T9:
priv->t9idmin = idmin;
priv->t9idmax = idmax;
break;
#ifdef CONFIG_MXT_BUTTONS
case MXT_SPT_GPIOPWM_T19:
priv->t19id = idmin;
break;
#endif
default:
break;
}
}
return OK;
}
/****************************************************************************
* Name: mxt_hwinitialize
****************************************************************************/
static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
{
struct mxt_info_s *info = &priv->info;
unsigned int nslots;
uint8_t regval;
int ret;
/* Set the selected I2C frequency */
priv->frequency = priv->lower->frequency;
/* Read the info registers from the device */
ret = mxt_getinfo(priv);
if (ret < 0)
{
ierr("ERROR: Failed to read info registers: %d\n", ret);
return ret;
}
/* Allocate memory for the object table */
priv->objtab = kmm_zalloc(info->nobjects * sizeof(struct mxt_object_s));
if (priv->objtab == NULL)
{
ierr("ERROR: Failed to allocate object table\n");
return -ENOMEM;
}
/* Get object table information */
ret = mxt_getobjtab(priv);
if (ret < 0)
{
goto errout_with_objtab;
}
/* Perform a soft reset */
ret = mxt_putobject(priv, MXT_GEN_COMMAND_T6, MXT_COMMAND_RESET, 1);
if (ret < 0)
{
ierr("ERROR: Soft reset failed: %d\n", ret);
goto errout_with_objtab;
}
nxsig_usleep(MXT_RESET_TIME);
/* Update matrix size in the info structure */
ret = mxt_getreg(priv, MXT_MATRIX_X_SIZE, (FAR uint8_t *)®val, 1);
if (ret < 0)
{
ierr("ERROR: Failed to get X size: %d\n", ret);
goto errout_with_objtab;
}
info->xsize = regval;
ret = mxt_getreg(priv, MXT_MATRIX_Y_SIZE, (FAR uint8_t *)®val, 1);
if (ret < 0)
{
ierr("ERROR: Failed to get Y size: %d\n", ret);
goto errout_with_objtab;
}
info->ysize = regval;
iinfo("Family: %u variant: %u version: %u.%u.%02x\n",
info->family, info->variant, info->version >> 4,
info->version & 0x0f, info->build);
iinfo("Matrix size: (%u,%u) objects: %u\n",
info->xsize, info->ysize, info->nobjects);
/* How many multi touch "slots" */
nslots = priv->t9idmax - priv->t9idmin + 1;
DEBUGASSERT(nslots > 0 && nslots < 256);
priv->nslots = nslots;
/* Allocate a place to hold sample data for each slot */
priv->sample = (FAR struct mxt_sample_s *)
kmm_zalloc(nslots * sizeof(struct mxt_sample_s));
if (priv->sample == NULL)
{
ierr("ERROR: Failed to allocate object table\n");
ret = -ENOMEM;
goto errout_with_objtab;
}
return OK;
/* Error exits */
errout_with_objtab:
kmm_free(priv->objtab);
priv->objtab = NULL;
return ret;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: mxt_register
*
* Description:
* Configure the maXTouch to use the provided I2C device instance. This
* will register the driver as /dev/inputN where N is the minor device
* number
*
* Input Parameters:
* i2c - An I2C driver instance
* lower - Persistent board configuration data
* minor - The input device minor number
*
* Returned Value:
* Zero is returned on success. Otherwise, a negated errno value is
* returned to indicate the nature of the failure.
*
****************************************************************************/
int mxt_register(FAR struct i2c_master_s *i2c,
FAR const struct mxt_lower_s * const lower, int minor)
{
FAR struct mxt_dev_s *priv;
char devname[DEV_NAMELEN];
int ret;
iinfo("i2c: %p minor: %d\n", i2c, minor);
/* Debug-only sanity checks */
DEBUGASSERT(i2c != NULL && lower != NULL && minor >= 0 && minor < 100);
/* Create and initialize a maXTouch device driver instance */
priv = (FAR struct mxt_dev_s *)kmm_zalloc(sizeof(struct mxt_dev_s));
if (priv == NULL)
{
ierr("ERROR: Failed allocate device structure\n");
return -ENOMEM;
}
/* Initialize the ADS7843E device driver instance */
memset(priv, 0, sizeof(struct mxt_dev_s));
priv->i2c = i2c; /* Save the SPI device handle */
priv->lower = lower; /* Save the board configuration */
/* Initialize semaphores */
nxsem_init(&priv->devsem, 0, 1); /* Initialize device semaphore */
nxsem_init(&priv->waitsem, 0, 0); /* Initialize event wait semaphore */
/* The event wait semaphore is used for signaling and, hence, should not
* have priority inheritance enabled.
*/
nxsem_set_protocol(&priv->waitsem, SEM_PRIO_NONE);
/* Make sure that interrupts are disabled */
MXT_CLEAR(lower);
MXT_DISABLE(lower);
/* Attach the interrupt handler */
ret = MXT_ATTACH(lower, mxt_interrupt, priv);
if (ret < 0)
{
ierr("ERROR: Failed to attach interrupt\n");
goto errout_with_priv;
}
/* Configure the MXT hardware */
ret = mxt_hwinitialize(priv);
if (ret < 0)
{
ierr("ERROR: mxt_hwinitialize failed: %d\n", ret);
goto errout_with_irq;
}
/* Register the device as an input device */
snprintf(devname, sizeof(devname), DEV_FORMAT, minor);
iinfo("Registering %s\n", devname);
ret = register_driver(devname, &mxt_fops, 0666, priv);
if (ret < 0)
{
ierr("ERROR: register_driver() failed: %d\n", ret);
goto errout_with_hwinit;
}
/* And return success. MXT interrupts will not be enable until the
* MXT device has been opened (see mxt_open).
*/
return OK;
/* Error clean-up exits */
errout_with_hwinit:
kmm_free(priv->objtab);
kmm_free(priv->sample);
errout_with_irq:
MXT_DETACH(lower);
errout_with_priv:
nxsem_destroy(&priv->devsem);
nxsem_destroy(&priv->waitsem);
kmm_free(priv);
return ret;
}
| 27.88187 | 87 | 0.52835 | [
"object"
] |
d2688687582753dc8e29b5f9b337726d57629966 | 1,191 | h | C | main/utils/render.h | rain-377/rain-csgo-base | 58bed13ce272f5403ac7324f79ca9a6b3f7a63a5 | [
"MIT"
] | 13 | 2021-05-27T19:14:26.000Z | 2022-01-27T11:29:38.000Z | main/utils/render.h | rain-377/rain-csgo-base | 58bed13ce272f5403ac7324f79ca9a6b3f7a63a5 | [
"MIT"
] | 2 | 2021-06-03T16:18:59.000Z | 2022-03-29T15:29:17.000Z | main/utils/render.h | rain-377/rain-csgo-base | 58bed13ce272f5403ac7324f79ca9a6b3f7a63a5 | [
"MIT"
] | 4 | 2021-05-25T21:23:17.000Z | 2021-08-20T22:03:02.000Z | #pragma once
#include "../common.h"
#include "../sdk/vector.h"
enum font_flags : unsigned int
{
FONT_NONE = 0,
FONT_DROPSHADOW = 1 << 0,
FONT_OUTLINE = 1 << 1,
FONT_CENTERED_X = 1 << 2,
FONT_CENTERED_Y = 1 << 2,
};
namespace render
{
void setup(IDirect3DDevice9* pDevice);
void restore();
void add_to_draw_list();
void begin();
void text(std::string_view txt, ImVec2 pos, const ImColor& clr, ImFont* font, float font_size, uint8_t flags);
bool world_to_screen(vector& in, vector_2d& out);
inline ImVec2 get_text_size(std::string_view text, ImFont* font)
{
const auto size = font->CalcTextSizeA(font->FontSize, FLT_MAX, 0.f, text.data());
return size;
}
inline void text(std::string_view txt, vector pos, const ImColor& clr, ImFont* font, float font_size, uint8_t flags)
{
text(txt, ImVec2(pos.x, pos.y), clr, font, font_size, flags);
}
inline bool m_initialized = false;
inline std::mutex m_mutex;
inline std::shared_ptr<ImDrawList> m_draw_list;
inline std::shared_ptr<ImDrawList> m_data_draw_list;
inline std::shared_ptr<ImDrawList> m_replace_draw_list;
}
namespace fonts
{
inline ImFont* m_tahoma12 = nullptr;
inline ImFont* m_tahoma14 = nullptr;
} | 24.306122 | 117 | 0.722922 | [
"render",
"vector"
] |
d269bdede4bce37bf5c68a44f5942d03e544518b | 21,948 | h | C | third_party/WebKit/Source/core/testing/Internals.h | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | third_party/WebKit/Source/core/testing/Internals.h | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | third_party/WebKit/Source/core/testing/Internals.h | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | /*
* Copyright (C) 2012 Google Inc. All rights reserved.
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef Internals_h
#define Internals_h
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/Iterable.h"
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/css/CSSComputedStyleDeclaration.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/text/WTFString.h"
namespace blink {
class Animation;
class CallbackFunctionTest;
class CanvasRenderingContext;
class ClientRect;
class ClientRectList;
class DOMArrayBuffer;
class DOMPoint;
class DictionaryTest;
class Document;
class DocumentMarker;
class Element;
class ExceptionState;
class GCObservation;
class HTMLInputElement;
class HTMLMediaElement;
class HTMLSelectElement;
class InternalRuntimeFlags;
class InternalSettings;
class LayerRectList;
class LocalDOMWindow;
class LocalFrame;
class Location;
class Node;
class OriginTrialsTest;
class Page;
class Range;
class SerializedScriptValue;
class ShadowRoot;
class TypeConversions;
class UnionTypesTest;
class ScrollState;
template <typename NodeType>
class StaticNodeTypeList;
using StaticNodeList = StaticNodeTypeList<Node>;
class Internals final : public GarbageCollected<Internals>,
public ScriptWrappable,
public ValueIterable<int> {
DEFINE_WRAPPERTYPEINFO();
public:
static Internals* create(ExecutionContext* context) {
return new Internals(context);
}
static void resetToConsistentState(Page*);
String elementLayoutTreeAsText(Element*, ExceptionState&);
String address(Node*);
GCObservation* observeGC(ScriptValue);
bool isPreloaded(const String& url);
bool isPreloadedBy(const String& url, Document*);
bool isLoading(const String& url);
bool isLoadingFromMemoryCache(const String& url);
int getResourcePriority(const String& url, Document*);
String getResourceHeader(const String& url, const String& header, Document*);
bool isSharingStyle(Element*, Element*) const;
CSSStyleDeclaration* computedStyleIncludingVisitedInfo(Node*) const;
ShadowRoot* createUserAgentShadowRoot(Element* host);
ShadowRoot* shadowRoot(Element* host);
ShadowRoot* youngestShadowRoot(Element* host);
ShadowRoot* oldestShadowRoot(Element* host);
ShadowRoot* youngerShadowRoot(Node* shadow, ExceptionState&);
String shadowRootType(const Node*, ExceptionState&) const;
bool hasShadowInsertionPoint(const Node*, ExceptionState&) const;
bool hasContentElement(const Node*, ExceptionState&) const;
size_t countElementShadow(const Node*, ExceptionState&) const;
const AtomicString& shadowPseudoId(Element*);
// Animation testing.
void pauseAnimations(double pauseTime, ExceptionState&);
bool isCompositedAnimation(Animation*);
void disableCompositedAnimation(Animation*);
void disableCSSAdditiveAnimations();
// Modifies m_desiredFrameStartTime in BitmapImage to advance the next frame
// time for testing whether animated images work properly.
void advanceTimeForImage(Element* image,
double deltaTimeInSeconds,
ExceptionState&);
// Advances an animated image. For BitmapImage (e.g., animated gifs) this
// will advance to the next frame. For SVGImage, this will trigger an
// animation update for CSS and advance the SMIL timeline by one frame.
void advanceImageAnimation(Element* image, ExceptionState&);
bool isValidContentSelect(Element* insertionPoint, ExceptionState&);
Node* treeScopeRootNode(Node*);
Node* parentTreeScope(Node*);
bool hasSelectorForIdInShadow(Element* host,
const AtomicString& idValue,
ExceptionState&);
bool hasSelectorForClassInShadow(Element* host,
const AtomicString& className,
ExceptionState&);
bool hasSelectorForAttributeInShadow(Element* host,
const AtomicString& attributeName,
ExceptionState&);
unsigned short compareTreeScopePosition(const Node*,
const Node*,
ExceptionState&) const;
Node* nextSiblingInFlatTree(Node*, ExceptionState&);
Node* firstChildInFlatTree(Node*, ExceptionState&);
Node* lastChildInFlatTree(Node*, ExceptionState&);
Node* nextInFlatTree(Node*, ExceptionState&);
Node* previousInFlatTree(Node*, ExceptionState&);
unsigned updateStyleAndReturnAffectedElementCount(ExceptionState&) const;
unsigned needsLayoutCount(ExceptionState&) const;
unsigned hitTestCount(Document*, ExceptionState&) const;
unsigned hitTestCacheHits(Document*, ExceptionState&) const;
Element* elementFromPoint(Document*,
double x,
double y,
bool ignoreClipping,
bool allowChildFrameContent,
ExceptionState&) const;
void clearHitTestCache(Document*, ExceptionState&) const;
String visiblePlaceholder(Element*);
void selectColorInColorChooser(Element*, const String& colorValue);
void endColorChooser(Element*);
bool hasAutofocusRequest(Document*);
bool hasAutofocusRequest();
Vector<String> formControlStateOfHistoryItem(ExceptionState&);
void setFormControlStateOfHistoryItem(const Vector<String>&, ExceptionState&);
DOMWindow* pagePopupWindow() const;
ClientRect* absoluteCaretBounds(ExceptionState&);
ClientRect* boundingBox(Element*);
void setMarker(Document*, const Range*, const String&, ExceptionState&);
unsigned markerCountForNode(Node*, const String&, ExceptionState&);
unsigned activeMarkerCountForNode(Node*);
Range* markerRangeForNode(Node*,
const String& markerType,
unsigned index,
ExceptionState&);
String markerDescriptionForNode(Node*,
const String& markerType,
unsigned index,
ExceptionState&);
void addTextMatchMarker(const Range*, bool isActive);
void addCompositionMarker(const Range*,
const String& underlineColorValue,
bool thick,
const String& backgroundColorValue,
ExceptionState&);
void setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool);
void setMarkedTextMatchesAreHighlighted(Document*, bool);
void setFrameViewPosition(Document*, long x, long y, ExceptionState&);
String viewportAsText(Document*,
float devicePixelRatio,
int availableWidth,
int availableHeight,
ExceptionState&);
bool elementShouldAutoComplete(Element* inputElement, ExceptionState&);
String suggestedValue(Element*, ExceptionState&);
void setSuggestedValue(Element*, const String&, ExceptionState&);
void setEditingValue(Element* inputElement, const String&, ExceptionState&);
void setAutofilled(Element*, bool enabled, ExceptionState&);
Range* rangeFromLocationAndLength(Element* scope,
int rangeLocation,
int rangeLength);
unsigned locationFromRange(Element* scope, const Range*);
unsigned lengthFromRange(Element* scope, const Range*);
String rangeAsText(const Range*);
DOMPoint* touchPositionAdjustedToBestClickableNode(long x,
long y,
long width,
long height,
Document*,
ExceptionState&);
Node* touchNodeAdjustedToBestClickableNode(long x,
long y,
long width,
long height,
Document*,
ExceptionState&);
DOMPoint* touchPositionAdjustedToBestContextMenuNode(long x,
long y,
long width,
long height,
Document*,
ExceptionState&);
Node* touchNodeAdjustedToBestContextMenuNode(long x,
long y,
long width,
long height,
Document*,
ExceptionState&);
ClientRect* bestZoomableAreaForTouchPoint(long x,
long y,
long width,
long height,
Document*,
ExceptionState&);
int lastSpellCheckRequestSequence(Document*, ExceptionState&);
int lastSpellCheckProcessedSequence(Document*, ExceptionState&);
Vector<AtomicString> userPreferredLanguages() const;
void setUserPreferredLanguages(const Vector<String>&);
unsigned mediaKeysCount();
unsigned mediaKeySessionCount();
unsigned suspendableObjectCount(Document*);
unsigned wheelEventHandlerCount(Document*);
unsigned scrollEventHandlerCount(Document*);
unsigned touchStartOrMoveEventHandlerCount(Document*);
unsigned touchEndOrCancelEventHandlerCount(Document*);
LayerRectList* touchEventTargetLayerRects(Document*, ExceptionState&);
bool executeCommand(Document*,
const String& name,
const String& value,
ExceptionState&);
AtomicString htmlNamespace();
Vector<AtomicString> htmlTags();
AtomicString svgNamespace();
Vector<AtomicString> svgTags();
// This is used to test rect based hit testing like what's done on touch
// screens.
StaticNodeList* nodesFromRect(Document*,
int x,
int y,
unsigned topPadding,
unsigned rightPadding,
unsigned bottomPadding,
unsigned leftPadding,
bool ignoreClipping,
bool allowChildFrameContent,
ExceptionState&) const;
bool hasSpellingMarker(Document*, int from, int length, ExceptionState&);
bool hasGrammarMarker(Document*, int from, int length, ExceptionState&);
void setSpellCheckingEnabled(bool, ExceptionState&);
void replaceMisspelled(Document*, const String&, ExceptionState&);
bool canHyphenate(const AtomicString& locale);
void setMockHyphenation(const AtomicString& locale);
bool isOverwriteModeEnabled(Document*);
void toggleOverwriteModeEnabled(Document*);
unsigned numberOfScrollableAreas(Document*);
bool isPageBoxVisible(Document*, int pageNumber);
InternalSettings* settings() const;
InternalRuntimeFlags* runtimeFlags() const;
unsigned workerThreadCount() const;
void setDeviceProximity(Document*,
const String& eventType,
double value,
double min,
double max,
ExceptionState&);
String layerTreeAsText(Document*, unsigned flags, ExceptionState&) const;
String layerTreeAsText(Document*, ExceptionState&) const;
String elementLayerTreeAsText(Element*,
unsigned flags,
ExceptionState&) const;
String elementLayerTreeAsText(Element*, ExceptionState&) const;
bool scrollsWithRespectTo(Element*, Element*, ExceptionState&);
String scrollingStateTreeAsText(Document*) const;
String mainThreadScrollingReasons(Document*, ExceptionState&) const;
ClientRectList* nonFastScrollableRects(Document*, ExceptionState&) const;
void evictAllResources() const;
unsigned numberOfLiveNodes() const;
unsigned numberOfLiveDocuments() const;
String dumpRefCountedInstanceCounts() const;
LocalDOMWindow* openDummyInspectorFrontend(const String& url);
void closeDummyInspectorFrontend();
String counterValue(Element*);
int pageNumber(Element*, float pageWidth, float pageHeight, ExceptionState&);
Vector<String> shortcutIconURLs(Document*) const;
Vector<String> allIconURLs(Document*) const;
int numberOfPages(float pageWidthInPixels,
float pageHeightInPixels,
ExceptionState&);
String pageProperty(String, int, ExceptionState& = ASSERT_NO_EXCEPTION) const;
String pageSizeAndMarginsInPixels(
int,
int,
int,
int,
int,
int,
int,
ExceptionState& = ASSERT_NO_EXCEPTION) const;
float pageScaleFactor(ExceptionState&);
void setPageScaleFactor(float scaleFactor, ExceptionState&);
void setPageScaleFactorLimits(float minScaleFactor,
float maxScaleFactor,
ExceptionState&);
bool magnifyScaleAroundAnchor(float factor, float x, float y);
void setIsCursorVisible(Document*, bool, ExceptionState&);
String effectivePreload(HTMLMediaElement*);
void mediaPlayerRemoteRouteAvailabilityChanged(HTMLMediaElement*, bool);
void mediaPlayerPlayingRemotelyChanged(HTMLMediaElement*, bool);
void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme);
void registerURLSchemeAsBypassingContentSecurityPolicy(
const String& scheme,
const Vector<String>& policyAreas);
void removeURLSchemeRegisteredAsBypassingContentSecurityPolicy(
const String& scheme);
TypeConversions* typeConversions() const;
DictionaryTest* dictionaryTest() const;
UnionTypesTest* unionTypesTest() const;
OriginTrialsTest* originTrialsTest() const;
CallbackFunctionTest* callbackFunctionTest() const;
Vector<String> getReferencedFilePaths() const;
void startStoringCompositedLayerDebugInfo(Document*, ExceptionState&);
void stopStoringCompositedLayerDebugInfo(Document*, ExceptionState&);
void startTrackingRepaints(Document*, ExceptionState&);
void stopTrackingRepaints(Document*, ExceptionState&);
void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(
Node*,
ExceptionState&);
void forceFullRepaint(Document*, ExceptionState&);
ClientRectList* draggableRegions(Document*, ExceptionState&);
ClientRectList* nonDraggableRegions(Document*, ExceptionState&);
DOMArrayBuffer* serializeObject(PassRefPtr<SerializedScriptValue>) const;
PassRefPtr<SerializedScriptValue> deserializeBuffer(DOMArrayBuffer*) const;
String getCurrentCursorInfo();
bool cursorUpdatePending() const;
String markerTextForListItem(Element*);
void forceReload(bool bypassCache);
String getImageSourceURL(Element*);
String selectMenuListText(HTMLSelectElement*);
bool isSelectPopupVisible(Node*);
bool selectPopupItemStyleIsRtl(Node*, int);
int selectPopupItemStyleFontHeight(Node*, int);
void resetTypeAheadSession(HTMLSelectElement*);
ClientRect* selectionBounds(ExceptionState&);
bool loseSharedGraphicsContext3D();
void forceCompositingUpdate(Document*, ExceptionState&);
void setZoomFactor(float);
void setShouldRevealPassword(Element*, bool, ExceptionState&);
ScriptPromise createResolvedPromise(ScriptState*, ScriptValue);
ScriptPromise createRejectedPromise(ScriptState*, ScriptValue);
ScriptPromise addOneToPromise(ScriptState*, ScriptPromise);
ScriptPromise promiseCheck(ScriptState*,
long,
bool,
const Dictionary&,
const String&,
const Vector<String>&,
ExceptionState&);
ScriptPromise promiseCheckWithoutExceptionState(ScriptState*,
const Dictionary&,
const String&,
const Vector<String>&);
ScriptPromise promiseCheckRange(ScriptState*, long);
ScriptPromise promiseCheckOverload(ScriptState*, Location*);
ScriptPromise promiseCheckOverload(ScriptState*, Document*);
ScriptPromise promiseCheckOverload(ScriptState*, Location*, long, long);
DECLARE_TRACE();
void setValueForUser(HTMLInputElement*, const String&);
String textSurroundingNode(Node*, int x, int y, unsigned long maxLength);
void setFocused(bool);
void setInitialFocus(bool);
bool ignoreLayoutWithPendingStylesheets(Document*);
void setNetworkConnectionInfoOverride(bool,
const String&,
double downlinkMaxMbps,
ExceptionState&);
void clearNetworkConnectionInfoOverride();
unsigned countHitRegions(CanvasRenderingContext*);
bool isInCanvasFontCache(Document*, const String&);
unsigned canvasFontCacheMaxFonts();
void setScrollChain(ScrollState*,
const HeapVector<Member<Element>>& elements,
ExceptionState&);
// Schedule a forced Blink GC run (Oilpan) at the end of event loop.
// Note: This is designed to be only used from PerformanceTests/BlinkGC to
// explicitly measure only Blink GC time. Normal LayoutTests should use
// gc() instead as it would trigger both Blink GC and V8 GC.
void forceBlinkGCWithoutV8GC();
String selectedHTMLForClipboard();
String selectedTextForClipboard();
void setVisualViewportOffset(int x, int y);
int visualViewportHeight();
int visualViewportWidth();
// The scroll position of the visual viewport relative to the document origin.
float visualViewportScrollX();
float visualViewportScrollY();
// Return true if the given use counter exists for the given document.
// |useCounterId| must be one of the values from the UseCounter::Feature enum.
bool isUseCounted(Document*, int useCounterId);
bool isCSSPropertyUseCounted(Document*, const String&);
String unscopableAttribute();
String unscopableMethod();
ClientRectList* focusRingRects(Element*);
ClientRectList* outlineRects(Element*);
void setCapsLockState(bool enabled);
bool setScrollbarVisibilityInScrollableArea(Node*, bool visible);
// Translate given platform monotonic time in seconds to high resolution
// document time in seconds
double monotonicTimeToZeroBasedDocumentTime(double, ExceptionState&);
void setMediaElementNetworkState(HTMLMediaElement*, int state);
// Returns the run state of the node's scroll animator (see
// ScrollAnimatorCompositorCoordinater::RunState), or -1 if the node does not
// have a scrollable area.
String getScrollAnimationState(Node*) const;
// Returns the run state of the node's programmatic scroll animator (see
// ScrollAnimatorCompositorCoordinater::RunState), or -1 if the node does not
// have a scrollable area.
String getProgrammaticScrollAnimationState(Node*) const;
// Returns the visual rect of a node's LayoutObject.
ClientRect* visualRect(Node*);
// Intentional crash.
void crash();
// Overrides if the device is low-end (low on memory).
void setIsLowEndDevice(bool);
private:
explicit Internals(ExecutionContext*);
Document* contextDocument() const;
LocalFrame* frame() const;
Vector<String> iconURLs(Document*, int iconTypesMask) const;
ClientRectList* annotatedRegions(Document*, bool draggable, ExceptionState&);
DocumentMarker* markerAt(Node*,
const String& markerType,
unsigned index,
ExceptionState&);
Member<InternalRuntimeFlags> m_runtimeFlags;
Member<Document> m_document;
IterationSource* startIteration(ScriptState*, ExceptionState&) override;
};
} // namespace blink
#endif // Internals_h
| 39.688969 | 80 | 0.666029 | [
"vector"
] |
d26cd5e6bb30ba1ffb8d163a6eade289bf6b4b0e | 1,750 | h | C | lite/ort/cv/tiny_yolov4_voc.h | IgiArdiyanto/litehub | 54a43690d80e57f16bea1efc698e7d30f06b9d4f | [
"MIT"
] | null | null | null | lite/ort/cv/tiny_yolov4_voc.h | IgiArdiyanto/litehub | 54a43690d80e57f16bea1efc698e7d30f06b9d4f | [
"MIT"
] | null | null | null | lite/ort/cv/tiny_yolov4_voc.h | IgiArdiyanto/litehub | 54a43690d80e57f16bea1efc698e7d30f06b9d4f | [
"MIT"
] | null | null | null | //
// Created by DefTruth on 2021/8/7.
//
#ifndef LITE_AI_ORT_CV_TINY_YOLOV4_VOC_H
#define LITE_AI_ORT_CV_TINY_YOLOV4_VOC_H
#include "lite/ort/core/ort_core.h"
namespace ortcv
{
class LITE_EXPORTS TinyYoloV4VOC : public BasicOrtHandler
{
public:
explicit TinyYoloV4VOC(const std::string &_onnx_path, unsigned int _num_threads = 1) :
BasicOrtHandler(_onnx_path, _num_threads)
{};
~TinyYoloV4VOC() override = default;
private:
static constexpr const float mean_val = 0.f;
static constexpr const float scale_val = 1.0 / 255.f;
const char *class_names[20] = {
"aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow",
"diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa",
"train", "tvmonitor"
}; // voc 20 classes
enum NMS
{
HARD = 0, BLEND = 1, OFFSET = 2
};
static constexpr const unsigned int max_nms = 30000;
private:
Ort::Value transform(const cv::Mat &mat) override;
void generate_bboxes(std::vector<types::Boxf> &bbox_collection,
std::vector<Ort::Value> &output_tensors,
float score_threshold, float img_height,
float img_width); // rescale & exclude
void nms(std::vector<types::Boxf> &input, std::vector<types::Boxf> &output,
float iou_threshold, unsigned int topk, unsigned int nms_type);
public:
void detect(const cv::Mat &mat, std::vector<types::Boxf> &detected_boxes,
float score_threshold = 0.25f, float iou_threshold = 0.45f,
unsigned int topk = 100, unsigned int nms_type = NMS::OFFSET);
};
}
#endif //LITE_AI_ORT_CV_TINY_YOLOV4_VOC_H
| 31.818182 | 94 | 0.639429 | [
"vector",
"transform"
] |
d2704300d1960e4593e6b17f549b5c2b90fd4155 | 17,597 | h | C | blaze/math/simd/Stream.h | AuroraDysis/blaze | d5cacf64e8059ca924eef4b4e2a74fc9446d71cb | [
"Unlicense"
] | 1 | 2017-07-21T09:55:12.000Z | 2017-07-21T09:55:12.000Z | blaze/math/simd/Stream.h | AuroraDysis/blaze | d5cacf64e8059ca924eef4b4e2a74fc9446d71cb | [
"Unlicense"
] | null | null | null | blaze/math/simd/Stream.h | AuroraDysis/blaze | d5cacf64e8059ca924eef4b4e2a74fc9446d71cb | [
"Unlicense"
] | null | null | null | //=================================================================================================
/*!
// \file blaze/math/simd/Stream.h
// \brief Header file for the SIMD stream functionality
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
#ifndef _BLAZE_MATH_SIMD_STREAM_H_
#define _BLAZE_MATH_SIMD_STREAM_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blaze/math/simd/BasicTypes.h>
#include <blaze/system/Inline.h>
#include <blaze/system/Vectorization.h>
#include <blaze/util/AlignmentCheck.h>
#include <blaze/util/Assert.h>
#include <blaze/util/Complex.h>
#include <blaze/util/EnableIf.h>
#include <blaze/util/mpl/And.h>
#include <blaze/util/StaticAssert.h>
#include <blaze/util/typetraits/HasSize.h>
#include <blaze/util/typetraits/IsIntegral.h>
namespace blaze {
//=================================================================================================
//
// 8-BIT INTEGRAL SIMD TYPES
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 1-byte integral values.
// \ingroup simd
//
// \param address The target address.
// \param value The 1-byte integral vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,1UL> > >
stream( T1* address, const SIMDi8<T2>& value ) noexcept
{
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512BW_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 1-byte integral complex values.
// \ingroup simd
//
// \param address The target address.
// \param value The 1-byte integral complex vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,1UL> > >
stream( complex<T1>* address, const SIMDci8<T2>& value ) noexcept
{
BLAZE_STATIC_ASSERT( sizeof( complex<T1> ) == 2UL*sizeof( T1 ) );
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512BW_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//=================================================================================================
//
// 16-BIT INTEGRAL SIMD TYPES
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 2-byte integral values.
// \ingroup simd
//
// \param address The target address.
// \param value The 2-byte integral vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,2UL> > >
stream( T1* address, const SIMDi16<T2>& value ) noexcept
{
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512BW_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 2-byte integral complex values.
// \ingroup simd
//
// \param address The target address.
// \param value The 2-byte integral complex vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,2UL> > >
stream( complex<T1>* address, const SIMDci16<T2>& value ) noexcept
{
BLAZE_STATIC_ASSERT( sizeof( complex<T1> ) == 2UL*sizeof( T1 ) );
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512BW_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//=================================================================================================
//
// 32-BIT INTEGRAL SIMD TYPES
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 4-byte integral values.
// \ingroup simd
//
// \param address The target address.
// \param value The 4-byte integral vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,4UL> > >
stream( T1* address, const SIMDi32<T2>& value ) noexcept
{
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_si512( reinterpret_cast<__m512i*>( address ), (~value).value );
#elif BLAZE_MIC_MODE
_mm512_store_epi32( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 4-byte integral complex values.
// \ingroup simd
//
// \param address The target address.
// \param value The 4-byte integral complex vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,4UL> > >
stream( complex<T1>* address, const SIMDci32<T2>& value ) noexcept
{
BLAZE_STATIC_ASSERT( sizeof( complex<T1> ) == 2UL*sizeof( T1 ) );
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_MIC_MODE
_mm512_store_epi32( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//=================================================================================================
//
// 64-BIT INTEGRAL SIMD TYPES
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 8-byte integral values.
// \ingroup simd
//
// \param address The target address.
// \param value The 8-byte integral vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,8UL> > >
stream( T1* address, const SIMDi64<T2>& value ) noexcept
{
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_MIC_MODE
_mm512_store_epi64( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 8-byte integral complex values.
// \ingroup simd
//
// \param address The target address.
// \param value The 8-byte integral complex vector to be streamed.
// \return void
*/
template< typename T1 // Type of the integral value
, typename T2 > // Type of the SIMD data type
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral<T1>, HasSize<T1,8UL> > >
stream( complex<T1>* address, const SIMDci64<T2>& value ) noexcept
{
BLAZE_STATIC_ASSERT( sizeof( complex<T1> ) == 2UL*sizeof( T1 ) );
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_si512( address, (~value).value );
#elif BLAZE_MIC_MODE
_mm512_store_epi64( address, (~value).value );
#elif BLAZE_AVX2_MODE
_mm256_stream_si256( reinterpret_cast<__m256i*>( address ), (~value).value );
#elif BLAZE_SSE2_MODE
_mm_stream_si128( reinterpret_cast<__m128i*>( address ), (~value).value );
#else
*address = (~value).value;
#endif
}
//*************************************************************************************************
//=================================================================================================
//
// 32-BIT FLOATING POINT SIMD TYPES
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 'float' values.
// \ingroup simd
//
// \param address The target address.
// \param value The 'float' vector to be streamed.
// \return void
*/
template< typename T > // Type of the operand
BLAZE_ALWAYS_INLINE void stream( float* address, const SIMDf32<T>& value ) noexcept
{
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_ps( address, (~value).value );
#elif BLAZE_MIC_MODE
_mm512_storenr_ps( address, (~value).eval().value );
#elif BLAZE_AVX_MODE
_mm256_stream_ps( address, (~value).eval().value );
#elif BLAZE_SSE_MODE
_mm_stream_ps( address, (~value).eval().value );
#else
*address = (~value).eval().value;
#endif
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 'complex<float>' values.
// \ingroup simd
//
// \param address The target address.
// \param value The 'complex<float>' vector to be streamed.
// \return void
*/
BLAZE_ALWAYS_INLINE void stream( complex<float>* address, const SIMDcfloat& value ) noexcept
{
BLAZE_STATIC_ASSERT ( sizeof( complex<float> ) == 2UL*sizeof( float ) );
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_ps( reinterpret_cast<float*>( address ), (~value).value );
#elif BLAZE_MIC_MODE
_mm512_storenr_ps( reinterpret_cast<float*>( address ), value.value );
#elif BLAZE_AVX_MODE
_mm256_stream_ps( reinterpret_cast<float*>( address ), value.value );
#elif BLAZE_SSE_MODE
_mm_stream_ps( reinterpret_cast<float*>( address ), value.value );
#else
*address = value.value;
#endif
}
//*************************************************************************************************
//=================================================================================================
//
// 64-BIT FLOATING POINT SIMD TYPES
//
//=================================================================================================
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 'double' values.
// \ingroup simd
//
// \param address The target address.
// \param value The 'double' vector to be streamed.
// \return void
*/
template< typename T > // Type of the operand
BLAZE_ALWAYS_INLINE void stream( double* address, const SIMDf64<T>& value ) noexcept
{
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_pd( address, (~value).value );
#elif BLAZE_MIC_MODE
_mm512_storenr_pd( address, (~value).eval().value );
#elif BLAZE_AVX_MODE
_mm256_stream_pd( address, (~value).eval().value );
#elif BLAZE_SSE2_MODE
_mm_stream_pd( address, (~value).eval().value );
#else
*address = (~value).eval().value;
#endif
}
//*************************************************************************************************
//*************************************************************************************************
/*!\brief Aligned, non-temporal store of a vector of 'complex<double>' values.
// \ingroup simd
//
// \param address The target address.
// \param value The 'complex<double>' vector to be streamed.
// \return void
*/
BLAZE_ALWAYS_INLINE void stream( complex<double>* address, const SIMDcdouble& value ) noexcept
{
BLAZE_STATIC_ASSERT ( sizeof( complex<double> ) == 2UL*sizeof( double ) );
BLAZE_INTERNAL_ASSERT( checkAlignment( address ), "Invalid alignment detected" );
#if BLAZE_AVX512F_MODE
_mm512_stream_pd( reinterpret_cast<double*>( address ), (~value).value );
#elif BLAZE_MIC_MODE
_mm512_storenr_pd( reinterpret_cast<double*>( address ), value.value );
#elif BLAZE_AVX_MODE
_mm256_stream_pd( reinterpret_cast<double*>( address ), value.value );
#elif BLAZE_SSE2_MODE
_mm_stream_pd( reinterpret_cast<double*>( address ), value.value );
#else
*address = value.value;
#endif
}
//*************************************************************************************************
} // namespace blaze
#endif
| 39.104444 | 99 | 0.559073 | [
"vector"
] |
d271d342d668a79c16ef540eedd2392c6b1900d4 | 17,476 | c | C | process.c | apoelstra/RamseyScript | 83261f9a620c04af594cefdb462bf64768d47bc4 | [
"CC0-1.0"
] | 8 | 2015-04-05T20:31:57.000Z | 2021-03-14T05:25:55.000Z | process.c | apoelstra/RamseyScript | 83261f9a620c04af594cefdb462bf64768d47bc4 | [
"CC0-1.0"
] | null | null | null | process.c | apoelstra/RamseyScript | 83261f9a620c04af594cefdb462bf64768d47bc4 | [
"CC0-1.0"
] | 1 | 2018-11-18T06:32:27.000Z | 2018-11-18T06:32:27.000Z | /* RamseyScript
* Written in 2012 by
* Andrew Poelstra <apoelstra@wpsoftware.net>
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to
* the public domain worldwide. This software is distributed without
* any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication
* along with this software.
* If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "global.h"
#include "dump/dump.h"
#include "file-stream.h"
#include "filter/filter.h"
#include "process.h"
#include "recurse.h"
#include "ramsey/ramsey.h"
#include "setting.h"
#include "target/target.h"
#define strmatch(s, r) (!strcmp ((s), (r)))
struct _global_data *set_defaults (stream_t *in, stream_t *out, stream_t *err)
{
struct _global_data *rv = malloc (sizeof *rv);
if (rv)
{
rv->settings = setting_list_new ();
#define NEW_SET(s,t) rv->settings->add_setting (rv->settings, setting_new ((s), (t)))
NEW_SET ("prune_tree", "1");
NEW_SET ("n_colors", "3");
NEW_SET ("random_length", "10");
NEW_SET ("dump_depth", "400");
#undef NEW_SET
rv->filters = NULL;
rv->dumps = NULL;
rv->kill_now = 0;
rv->interactive = 0;
rv->quiet = 0;
rv->in_stream = in;
rv->out_stream = out;
rv->err_stream = err;
/* Set max-length as a target by default.
* We do this purely for historical reasons */
rv->targets = malloc (sizeof *rv->targets);
rv->targets->data = target_new ("max_length", rv->settings);
rv->targets->next = NULL;
/**/
}
return rv;
}
void process (struct _global_data *state)
{
char *buf;
int i;
/* Parse */
if (state->interactive)
{
printf ("ramsey> ");
fflush (stdout);
}
while ((buf = state->in_stream->read_line (state->in_stream)))
{
char *tok;
/* Convert all - signs to _ so lispers can feel at home */
for (i = 0; buf[i]; ++i)
if (buf[i] == '-')
buf[i] = '_';
else if (isalpha (buf[i]))
buf[i] = tolower (buf[i]);
tok = strtok (buf, " \t\n");
/* skip comments and blank lines */
if (tok == NULL || *tok == '#')
{
/**/
}
/* set <variable> <value> */
else if (strmatch (tok, "set"))
{
const char *name = strtok (NULL, " #\t\n");
const char *text = strtok (NULL, "#\n");
setting_t *new_set = setting_new (name, text);
if (state->settings->add_setting (state->settings, new_set))
{
if (state->interactive)
new_set->print (new_set, state->out_stream);
}
else if (name == NULL)
printf ("Usage: set <variable> <value>\n");
else
fprintf (stderr, "Failed to add setting ``%s''.\n", name);
}
/* get <variable> */
else if (strmatch (tok, "get"))
{
tok = strtok (NULL, " #\t\n");
if (tok && *tok)
{
const setting_t *set = SETTING (tok);
if (set)
set->print (set, state->out_stream);
else
fprintf (stderr, "No such variable ``%s''.\n", tok);
}
else
state->settings->print (state->settings, state->out_stream);
}
/* unset <variable> */
else if (strmatch (tok, "unset"))
{
const char *name = strtok (NULL, " #\t\n");
if (name == NULL)
printf ("Usage: unset <variable>\n");
else if (state->settings->remove_setting (state->settings, name))
{
if (state->interactive)
stream_printf (state->out_stream, "Removed ``%s''.\n", name);
}
}
/* filter <no-double-3-aps|no-additive-squares> */
else if (strmatch (tok, "filter"))
{
tok = strtok (NULL, " #\t\n");
/* Delete all filters */
if ((tok != NULL) && strmatch (tok, "clear"))
{
filter_list *flist = state->filters;
while (flist)
{
filter_list *tmp = flist;
flist = flist->next;
if (state->interactive)
stream_printf (state->out_stream, "Removed filter ``%s''.\n",
tmp->data->get_type (tmp->data));
tmp->data->destroy (tmp->data);
free (tmp);
}
state->filters = NULL;
}
/* Add a new filter */
else if (tok != NULL)
{
filter_t *new_filter = filter_new (tok, state->settings);
if (new_filter != NULL)
{
filter_list *new_cell = malloc (sizeof *new_cell);
new_cell->next = state->filters;
new_cell->data = new_filter;
state->filters = new_cell;
if (!state->quiet)
stream_printf (state->out_stream, "Added filter ``%s''.\n",
new_filter->get_type (new_filter));
}
else
filter_usage (state->out_stream);
}
else
filter_usage (state->out_stream);
}
/* dump <iterations-per-length> */
else if (strmatch (tok, "dump"))
{
tok = strtok (NULL, " #\t\n");
/* Delete all dumps */
if (tok != NULL && strmatch (tok, "clear"))
{
dc_list *dlist = state->dumps;
while (dlist)
{
dc_list *tmp = dlist;
dlist = dlist->next;
if (state->interactive)
stream_printf (state->out_stream, "Removed dump ``%s''.\n",
tmp->data->get_type (tmp->data));
tmp->data->destroy (tmp->data);
free (tmp);
}
state->dumps = NULL;
}
/* Add a new dump */
else if (tok != NULL)
{
data_collector_t *new_dump = dump_new (tok, state->settings);
if (new_dump != NULL)
{
dc_list *new_cell = malloc (sizeof *new_cell);
new_cell->next = state->dumps;
new_cell->data = new_dump;
state->dumps = new_cell;
if (!state->quiet)
stream_printf (state->out_stream, "Added dump ``%s''.\n",
new_dump->get_type (new_dump));
}
else
dump_usage (state->out_stream);
}
else
dump_usage (state->out_stream);
}
/* target <max-length> */
else if (strmatch (tok, "target"))
{
tok = strtok (NULL, " #\t\n");
/* Delete all target */
if (tok != NULL && strmatch (tok, "clear"))
{
dc_list *dlist = state->targets;
while (dlist)
{
dc_list *tmp = dlist;
dlist = dlist->next;
if (state->interactive)
stream_printf (state->out_stream, "Removed target ``%s''.\n",
tmp->data->get_type (tmp->data));
tmp->data->destroy (tmp->data);
free (tmp);
}
state->targets = NULL;
}
/* Add a new target */
else if (tok != NULL)
{
data_collector_t *new_target = target_new (tok, state->settings);
if (new_target != NULL)
{
dc_list *new_cell = malloc (sizeof *new_cell);
new_cell->next = state->targets;
new_cell->data = new_target;
state->targets = new_cell;
if (!state->quiet)
stream_printf (state->out_stream, "Added target ``%s''.\n",
new_target->get_type (new_target));
}
else
target_usage (state->out_stream);
}
else
target_usage (state->out_stream);
}
/* search <seqences|colorings|words> [seed] */
else if (strmatch (tok, "search"))
{
ramsey_t *seed = NULL;
tok = strtok (NULL, " #\t\n");
if (tok)
seed = ramsey_new (tok, state->settings);
if (seed == NULL)
ramsey_usage (state->out_stream);
else
{
filter_list *flist;
dc_list *dlist;
const setting_t *max_iters_set = SETTING ("max_iterations");
const setting_t *max_depth_set = SETTING ("max_depth");
const setting_t *max_run_time_set = SETTING ("max_run_time");
const setting_t *stall_after_set = SETTING ("stall_after");
const setting_t *alphabet_set = SETTING ("alphabet");
const setting_t *gap_set_set = SETTING ("gap_set");
const setting_t *rand_len_set = SETTING ("random_length");
time_t start = time (NULL);
/* Apply filters */
for (flist = state->filters; flist; flist = flist->next)
seed->add_filter (seed, flist->data->clone (flist->data));
/* Reset dump data */
for (dlist = state->dumps; dlist; dlist = dlist->next)
dlist->data->reset (dlist->data);
for (dlist = state->targets; dlist; dlist = dlist->next)
dlist->data->reset (dlist->data);
/* Parse seed */
tok = strtok (NULL, "\n");
if (tok && *tok == '[')
seed->parse (seed, tok);
else if (tok && strmatch (tok, "random"))
seed->randomize (seed, rand_len_set->get_int_value (rand_len_set));
/* Output header */
if (!state->quiet)
{
stream_printf (state->out_stream, "#### Starting %s search ####\n",
seed->get_type (seed));
if (max_iters_set)
stream_printf (state->out_stream, " Stop after: \t%ld iterations\n",
max_iters_set->get_int_value (max_iters_set));
if (max_run_time_set)
stream_printf (state->out_stream, " Stop after: \t%ld seconds\n",
max_run_time_set->get_int_value (max_run_time_set));
if (stall_after_set)
stream_printf (state->out_stream, " Stall after: \t%ld iterations\n",
stall_after_set->get_int_value (stall_after_set));
if (max_depth_set)
stream_printf (state->out_stream, " Max. depth: \t%ld\n",
max_depth_set->get_int_value (max_depth_set));
if (alphabet_set && alphabet_set->type == TYPE_RAMSEY)
{
const ramsey_t *alphabet = alphabet_set->get_ramsey_value (alphabet_set);
stream_printf (state->out_stream, " Alphabet: \t");
alphabet->print (alphabet, state->out_stream);
stream_printf (state->out_stream, "\n");
}
if (gap_set_set && gap_set_set->type == TYPE_RAMSEY)
stream_printf (state->out_stream, " Gap set: \t%s\n", gap_set_set->get_text (gap_set_set));
stream_printf (state->out_stream, " Targets: \t");
for (dlist = state->targets; dlist; dlist = dlist->next)
stream_printf (state->out_stream, "%s ", dlist->data->get_type (dlist->data));
stream_printf (state->out_stream, "\n");
stream_printf (state->out_stream, " Filters: \t");
for (flist = state->filters; flist; flist = flist->next)
stream_printf (state->out_stream, "%s ", flist->data->get_type (flist->data));
stream_printf (state->out_stream, "\n");
stream_printf (state->out_stream, " Dump data: \t");
for (dlist = state->dumps; dlist; dlist = dlist->next)
stream_printf (state->out_stream, "%s ", dlist->data->get_type (dlist->data));
stream_printf (state->out_stream, "\n");
stream_printf (state->out_stream, " Seed:\t\t");
seed->print (seed, state->out_stream);
stream_printf (state->out_stream, "\n");
}
/* Do recursion */
recursion_reset (seed, state);
seed->recurse (seed, state);
/* Output dump and target data */
if (!state->quiet)
{
for (dlist = state->targets; dlist; dlist = dlist->next)
dlist->data->output (dlist->data, state->out_stream);
for (dlist = state->dumps; dlist; dlist = dlist->next)
dlist->data->output (dlist->data, state->out_stream);
stream_printf (state->out_stream, "Time taken: %ds. Iterations: %ld\n#### Done. ####\n\n",
(int) (time (NULL) - start), seed->r_iterations);
}
/* Cleanup */
seed->destroy (seed);
}
}
/* Manual recursion */
else if (strmatch (tok, "reset"))
{
dc_list *dlist;
for (dlist = state->targets; dlist; dlist = dlist->next)
dlist->data->reset (dlist->data);
for (dlist = state->dumps; dlist; dlist = dlist->next)
dlist->data->reset (dlist->data);
}
else if (strmatch (tok, "process"))
{
ramsey_t *seed = NULL;
tok = strtok (NULL, " #\t\n");
if (tok)
seed = ramsey_new (tok, state->settings);
if (seed == NULL)
ramsey_usage (state->out_stream);
else
{
const setting_t *rand_len_set = SETTING ("random_length");
/* Apply filters */
filter_list *flist;
for (flist = state->filters; flist; flist = flist->next)
seed->add_filter (seed, flist->data->clone (flist->data));
/* Do -not- reset dump data */
/* Parse "seed" */
tok = strtok (NULL, "\n");
if (tok && *tok == '[')
seed->parse (seed, tok);
else if (tok && strmatch (tok, "random"))
seed->randomize (seed, rand_len_set->get_int_value (rand_len_set));
/* "Recurse" */
recursion_preamble (seed, state);
/* Cleanup */
seed->destroy (seed);
}
}
else if (strmatch (tok, "state"))
{
dc_list *dlist;
for (dlist = state->targets; dlist; dlist = dlist->next)
dlist->data->output (dlist->data, state->out_stream);
for (dlist = state->dumps; dlist; dlist = dlist->next)
dlist->data->output (dlist->data, state->out_stream);
}
/* Interactive mode commands */
else if (strmatch (tok, "quiet"))
{
state->quiet = !state->quiet;
if (state->interactive)
stream_printf (state->out_stream, "Quiet mode %s.\n",
state->quiet ? "on" : "off");
}
else if (strmatch (tok, "echo"))
{
tok = strtok (NULL, "\n");
stream_printf (state->out_stream, "%s\n", tok);
}
else if (strmatch (tok, "help"))
stream_printf (state->out_stream,
"Commands:\n"
" set: set a variable\n"
" unset: unset a variable\n"
" get: see all variables\n"
"\n"
" dump: set a data dump\n"
" filter: set a filter\n"
" search: recursively explore Ramsey objects\n"
" target: set a target\n"
"\n"
" reset: reset all targets, dumps and filters\n"
" process: run targets, dumps and filters on a given object\n"
" state: output state of dumps and targets\n"
"\n"
" quiet: supress metadata output.\n"
" echo: output some text.\n"
" help: display this message.\n"
" quit: exit the program.\n"
);
else if (strmatch (tok, "quit") || strmatch (tok, "exit"))
return;
else if (state->interactive)
fprintf (stderr, "Unrecognized command ``%s''. Type 'help' for help, or\n"
"see the README file for a full language specification.\n", tok);
else
fprintf (stderr, "Unrecognized command ``%s''.\n", tok);
free (buf);
if (state->interactive)
{
printf ("ramsey> ");
fflush (stdout);
}
}
}
| 37.663793 | 112 | 0.477169 | [
"object"
] |
d2730797bed2beef5775587fe5adf1d0c67fc17e | 7,721 | h | C | iPhoneOS14.2.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBody.h | Zi0P4tch0/sdks | 96951a2b5a0c0a58963a8f9c37bc44ec9991153b | [
"MIT"
] | 416 | 2016-08-20T03:40:59.000Z | 2022-03-30T14:27:47.000Z | iPhoneOS14.4.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBody.h | haoict/sdks | 40a7cee1dc15ae097d867ae0c5133709fa103040 | [
"MIT"
] | 41 | 2016-08-22T14:41:42.000Z | 2022-02-25T11:38:16.000Z | iPhoneOS14.4.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SCNPhysicsBody.h | haoict/sdks | 40a7cee1dc15ae097d867ae0c5133709fa103040 | [
"MIT"
] | 173 | 2016-08-28T15:09:18.000Z | 2022-03-23T15:42:52.000Z | //
// SCNPhysicsBody.h
// SceneKit
//
// Copyright © 2014-2020 Apple Inc. All rights reserved.
//
#import <SceneKit/SceneKitTypes.h>
NS_ASSUME_NONNULL_BEGIN
@class SCNPhysicsShape;
//Physics Body type
typedef NS_ENUM(NSInteger, SCNPhysicsBodyType) {
SCNPhysicsBodyTypeStatic,
SCNPhysicsBodyTypeDynamic,
SCNPhysicsBodyTypeKinematic
} API_AVAILABLE(macos(10.10));
//Collision default category
typedef NS_OPTIONS(NSUInteger, SCNPhysicsCollisionCategory) {
SCNPhysicsCollisionCategoryDefault = 1 << 0, // default collision group for dynamic and kinematic objects
SCNPhysicsCollisionCategoryStatic = 1 << 1, // default collision group for static objects
SCNPhysicsCollisionCategoryAll = ~0UL // default for collision mask
} API_AVAILABLE(macos(10.10));
/*!
@class SCNPhysicsBody
@abstract The SCNPhysicsBody class describes the physics properties (such as mass, friction...) of a node.
*/
SCN_EXPORT API_AVAILABLE(macos(10.10))
@interface SCNPhysicsBody : NSObject <NSCopying, NSSecureCoding>
//Creates an instance of a static body with default properties.
+ (instancetype)staticBody;
//Creates an instance of a dynamic body with default properties.
+ (instancetype)dynamicBody;
//Creates an instance of a kinematic body with default properties.
+ (instancetype)kinematicBody;
//Creates an instance of a rigid body with a specific shape.
+ (instancetype)bodyWithType:(SCNPhysicsBodyType)type shape:(nullable SCNPhysicsShape *)shape;
//Specifies the type of the receiver.
@property(nonatomic) SCNPhysicsBodyType type;
//Specifies the Mass of the body in kilogram. Defaults to 1 for dynamic bodies, defaults to 0 for static bodies.
@property(nonatomic) CGFloat mass;
//Specifies the moment of inertia of the body as a vector in 3D. Disable usesDefaultMomentOfInertia for this value to be used instead of the default moment of inertia that is calculated from the shape geometry.
@property(nonatomic) SCNVector3 momentOfInertia API_AVAILABLE(macos(10.11), ios(9.0));
//Permits to disable the use of the default moment of inertia in favor of the one stored in momentOfInertia.
@property(nonatomic) BOOL usesDefaultMomentOfInertia API_AVAILABLE(macos(10.11), ios(9.0));
// Specifies the charge on the body. Charge determines the degree to which a body is affected by
// electric and magnetic fields. Note that this is a unitless quantity, it is up to the developer to
// set charge and field strength appropriately. Defaults to 0.0
@property(nonatomic) CGFloat charge;
//Specifies the force resisting the relative motion of solid sliding against each other. Defaults to 0.5.
@property(nonatomic) CGFloat friction;
//Specifies the restitution of collisions. Defaults to 0.5.
@property(nonatomic) CGFloat restitution;
//Specifies the force resisting the relative motion of solid rolling against each other. Defaults to 0.
@property(nonatomic) CGFloat rollingFriction;
//Specifies the physics shape of the receiver. Leaving this nil will let the system decide and use the most efficients bounding representation of the actual geometry.
@property(nonatomic, retain, nullable) SCNPhysicsShape *physicsShape;
//If the physics simulation has determined that this body is at rest it may set the resting property to YES. Resting bodies do not participate in the simulation until some collision with a non-resting object, or an impulse is applied, that unrests it. If all bodies in the world are resting then the simulation as a whole is "at rest".
@property(nonatomic, readonly) BOOL isResting;
//Specifies if the receiver can be set at rest.
@property(nonatomic) BOOL allowsResting;
//Specifies the linear velocity of the receiver.
@property(nonatomic) SCNVector3 velocity;
//Specifies the angular velocity of the receiver as an axis angle.
@property(nonatomic) SCNVector4 angularVelocity;
//Specifies the damping factor of the receiver. Optionally reduce the body's linear velocity each frame to simulate fluid/air friction. Value should be zero or greater. Defaults to 0.1.
@property(nonatomic) CGFloat damping;
//Specifies the angular damping of the receiver. Optionally reduce the body's angular velocity each frame to simulate rotational friction. (0.0 - 1.0). Defaults to 0.1.
@property(nonatomic) CGFloat angularDamping;
//Specifies a factor applied on the translation that results from the physics simulation before applying it to the node.
@property(nonatomic) SCNVector3 velocityFactor;
//Specifies a factor applied on the rotation on each axis that results from the physics simulation before applying it to the node.
@property(nonatomic) SCNVector3 angularVelocityFactor;
//Defines what logical 'categories' this body belongs too.
//Defaults to SCNPhysicsCollisionCategoryStatic for static bodies and SCNPhysicsCollisionCategoryDefault for the other body types.
//limited to the first 15 bits on macOS 10.10 and iOS 8.
@property(nonatomic) NSUInteger categoryBitMask;
//Defines what logical 'categories' of bodies this body responds to collisions with. Defaults to all bits set (all categories).
@property(nonatomic) NSUInteger collisionBitMask;
//A mask that defines which categories of bodies cause intersection notifications with this physics body. Defaults to 0.
//On iOS 8 and macOS 10.10 and lower the intersection notifications are always sent when a collision occurs.
@property(nonatomic) NSUInteger contactTestBitMask API_AVAILABLE(macos(10.11), ios(9.0));
//If set to YES this node will be affected by gravity. The default is YES.
@property(nonatomic, getter=isAffectedByGravity) BOOL affectedByGravity API_AVAILABLE(macos(10.11), ios(9.0));
//Applies a linear force in the specified direction. The linear force is applied on the center of mass of the receiver. If impulse is set to YES then the force is applied for just one frame, otherwise it applies a continuous force.
- (void)applyForce:(SCNVector3)direction impulse:(BOOL)impulse;
//Applies a linear force with the specified position and direction. The position is relative to the node that owns the physics body.
- (void)applyForce:(SCNVector3)direction atPosition:(SCNVector3)position impulse:(BOOL)impulse;
//Applies an angular force (torque). If impulse is set to YES then the force is applied for just one frame, otherwise it applies a continuous force. The torque is specified as an axis angle.
- (void)applyTorque:(SCNVector4)torque impulse:(BOOL)impulse;
//Clears the forces applied one the receiver.
- (void)clearAllForces;
//Reset the physical transform to the node's model transform.
- (void)resetTransform;
// Sets a physics body at rest (or not)
- (void)setResting:(BOOL)resting API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
// Use discrete collision detection if the body’s distance traveled in one step is at or below this threshold, or continuous collision detection otherwise. Defaults to zero, indicating that continuous collision detection is always disabled.
@property (nonatomic) CGFloat continuousCollisionDetectionThreshold API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
// Specifies an offset for the center of mass of the body. Defaults to (0,0,0).
@property(nonatomic) SCNVector3 centerOfMassOffset API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
// Linear velocity threshold under which the body may be considered resting. Defaults to 0.1.
@property (nonatomic) CGFloat linearRestingThreshold API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
// Angular velocity threshold under which the body may be considered resting. Defaults to 0.1.
@property (nonatomic) CGFloat angularRestingThreshold API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0));
@end
NS_ASSUME_NONNULL_END
| 51.818792 | 335 | 0.790183 | [
"geometry",
"object",
"shape",
"vector",
"model",
"transform",
"3d",
"solid"
] |
d273cdbcb44477b5fae026cc60492fe064b8d0c4 | 1,157 | h | C | source/RDP/Models/DriverMessageProcessorThread.h | play704611/dev_driver_tools | 312d40afb533b623e441139797410a33ecab3182 | [
"MIT"
] | null | null | null | source/RDP/Models/DriverMessageProcessorThread.h | play704611/dev_driver_tools | 312d40afb533b623e441139797410a33ecab3182 | [
"MIT"
] | null | null | null | source/RDP/Models/DriverMessageProcessorThread.h | play704611/dev_driver_tools | 312d40afb533b623e441139797410a33ecab3182 | [
"MIT"
] | 1 | 2018-10-02T08:47:03.000Z | 2018-10-02T08:47:03.000Z | //=============================================================================
/// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief A background worker responsible for reading driver log messages.
//=============================================================================
#ifndef _DRIVER_MESSAGE_PROCESSOR_THREAD_H_
#define _DRIVER_MESSAGE_PROCESSOR_THREAD_H_
#include <QObject>
struct ChannelContext;
class DeveloperPanelModel;
/// A background processor thread responsible for processing incoming messages.
class DriverMessageProcessorThread : public QObject
{
Q_OBJECT
public:
explicit DriverMessageProcessorThread(ChannelContext* pChannelContext, DeveloperPanelModel* pPanelModel);
virtual ~DriverMessageProcessorThread();
public slots:
void StartMessageProcessingLoop();
void ThreadFinished();
private:
ChannelContext* m_pContext; ///< The ChannelContext used to send messages.
DeveloperPanelModel* m_pDeveloperPanelModel; ///< The main Developer Panel Model.
};
#endif // _DRIVER_MESSAGE_PROCESSOR_THREAD_H_
| 34.029412 | 109 | 0.668107 | [
"model"
] |
d273ecb5baecdccf20d646bba9c0a1c9763cac9e | 4,323 | h | C | aws-cpp-sdk-mediatailor/include/aws/mediatailor/model/UpdateChannelRequest.h | blinemedical/aws-sdk-cpp | c7c814b2d6862b4cb48f3fb3ac083a9e419674e8 | [
"Apache-2.0"
] | 1 | 2021-12-06T20:36:35.000Z | 2021-12-06T20:36:35.000Z | aws-cpp-sdk-mediatailor/include/aws/mediatailor/model/UpdateChannelRequest.h | blinemedical/aws-sdk-cpp | c7c814b2d6862b4cb48f3fb3ac083a9e419674e8 | [
"Apache-2.0"
] | 1 | 2022-01-03T23:59:37.000Z | 2022-01-03T23:59:37.000Z | aws-cpp-sdk-mediatailor/include/aws/mediatailor/model/UpdateChannelRequest.h | ravindra-wagh/aws-sdk-cpp | 7d5ff01b3c3b872f31ca98fb4ce868cd01e97696 | [
"Apache-2.0"
] | 1 | 2021-12-30T04:25:33.000Z | 2021-12-30T04:25:33.000Z | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/mediatailor/MediaTailor_EXPORTS.h>
#include <aws/mediatailor/MediaTailorRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/mediatailor/model/RequestOutputItem.h>
#include <utility>
namespace Aws
{
namespace MediaTailor
{
namespace Model
{
/**
*/
class AWS_MEDIATAILOR_API UpdateChannelRequest : public MediaTailorRequest
{
public:
UpdateChannelRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "UpdateChannel"; }
Aws::String SerializePayload() const override;
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline const Aws::String& GetChannelName() const{ return m_channelName; }
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline bool ChannelNameHasBeenSet() const { return m_channelNameHasBeenSet; }
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline void SetChannelName(const Aws::String& value) { m_channelNameHasBeenSet = true; m_channelName = value; }
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline void SetChannelName(Aws::String&& value) { m_channelNameHasBeenSet = true; m_channelName = std::move(value); }
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline void SetChannelName(const char* value) { m_channelNameHasBeenSet = true; m_channelName.assign(value); }
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline UpdateChannelRequest& WithChannelName(const Aws::String& value) { SetChannelName(value); return *this;}
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline UpdateChannelRequest& WithChannelName(Aws::String&& value) { SetChannelName(std::move(value)); return *this;}
/**
* <p>The identifier for the channel you are working on.</p>
*/
inline UpdateChannelRequest& WithChannelName(const char* value) { SetChannelName(value); return *this;}
/**
* <p>The channel's output properties.</p>
*/
inline const Aws::Vector<RequestOutputItem>& GetOutputs() const{ return m_outputs; }
/**
* <p>The channel's output properties.</p>
*/
inline bool OutputsHasBeenSet() const { return m_outputsHasBeenSet; }
/**
* <p>The channel's output properties.</p>
*/
inline void SetOutputs(const Aws::Vector<RequestOutputItem>& value) { m_outputsHasBeenSet = true; m_outputs = value; }
/**
* <p>The channel's output properties.</p>
*/
inline void SetOutputs(Aws::Vector<RequestOutputItem>&& value) { m_outputsHasBeenSet = true; m_outputs = std::move(value); }
/**
* <p>The channel's output properties.</p>
*/
inline UpdateChannelRequest& WithOutputs(const Aws::Vector<RequestOutputItem>& value) { SetOutputs(value); return *this;}
/**
* <p>The channel's output properties.</p>
*/
inline UpdateChannelRequest& WithOutputs(Aws::Vector<RequestOutputItem>&& value) { SetOutputs(std::move(value)); return *this;}
/**
* <p>The channel's output properties.</p>
*/
inline UpdateChannelRequest& AddOutputs(const RequestOutputItem& value) { m_outputsHasBeenSet = true; m_outputs.push_back(value); return *this; }
/**
* <p>The channel's output properties.</p>
*/
inline UpdateChannelRequest& AddOutputs(RequestOutputItem&& value) { m_outputsHasBeenSet = true; m_outputs.push_back(std::move(value)); return *this; }
private:
Aws::String m_channelName;
bool m_channelNameHasBeenSet;
Aws::Vector<RequestOutputItem> m_outputs;
bool m_outputsHasBeenSet;
};
} // namespace Model
} // namespace MediaTailor
} // namespace Aws
| 33.253846 | 155 | 0.683784 | [
"vector",
"model"
] |
d274c1c01ce56acafce259bf785aeb68e58f0b42 | 4,498 | h | C | libs/antares/Attributes_Panel_Implementation.h | osu-sim/ANL_polaris | a7b96f908017d02af3a79a510c813f45c2373c84 | [
"BSD-3-Clause"
] | null | null | null | libs/antares/Attributes_Panel_Implementation.h | osu-sim/ANL_polaris | a7b96f908017d02af3a79a510c813f45c2373c84 | [
"BSD-3-Clause"
] | null | null | null | libs/antares/Attributes_Panel_Implementation.h | osu-sim/ANL_polaris | a7b96f908017d02af3a79a510c813f45c2373c84 | [
"BSD-3-Clause"
] | null | null | null | //*********************************************************
// Attributes_Panel_Implementation.cpp - Container Panel for Attributes
//*********************************************************
#pragma once
#include "Attributes_Panel.h"
//---------------------------------------------------------
// Attributes_Panel_Implementation - attribute_panel class definition
//---------------------------------------------------------
implementation class Attributes_Panel_Implementation : public Polaris_Component<MasterType,INHERIT(Attributes_Panel_Implementation),NULLTYPE>,public wxPanel
{
public:
Attributes_Panel_Implementation(wxFrame* parent);
virtual ~Attributes_Panel_Implementation(void){};
//feature_implementation void Push_Schema(vector<string>& attributes_schema);
void Push_Attributes(std::vector<pair<string,string>>& attributes);
m_data(wxListCtrl*,attributes_list, NONE, NONE);
m_data(wxBoxSizer*,sizer, NONE, NONE);
};
//---------------------------------------------------------
// Attributes_Panel_Implementation - attribute_panel initialization
//---------------------------------------------------------
template<typename MasterType,typename InheritanceList>
Attributes_Panel_Implementation<MasterType,InheritanceList>::Attributes_Panel_Implementation(wxFrame* parent) : wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize)
{
//---- initialize the sizers ----
_sizer=new wxBoxSizer(wxVERTICAL);
//---- initialize and add the components ----
_attributes_list=new wxListCtrl(this,wxID_ANY,wxDefaultPosition,wxSize(-1,700),wxLC_REPORT|wxLC_HRULES|wxLC_VRULES);
wxListItem columns[2];
columns[0].SetId(0);
columns[0].SetText("Attribute");
_attributes_list->InsertColumn(0, columns[0]);
columns[1].SetId(1);
columns[1].SetText("Value");
_attributes_list->InsertColumn(1, columns[1]);
wxListItem atts_rows[100];
for(int i=0;i<100;i++)
{
atts_rows[i].SetId(i);
_attributes_list->InsertItem(atts_rows[i]);
_attributes_list->SetItem(i,0,"");
_attributes_list->SetItem(i,1,"");
}
_sizer->Add(_attributes_list,0,wxEXPAND|wxALL,10);
//---- set the sizer ----
SetSizer(_sizer);
}
//---------------------------------------------------------
// Push_Schema
//--------------------------------------------------------
//template<typename MasterType,typename ParentType,typename InheritanceList>
//template<typename ComponentType,typename CallerType,typename TargetType>
//void Attributes_Panel_Implementation<MasterType,ParentType,InheritanceList>::Push_Schema(vector<string>& attributes_schema)
//{
// for(int i=0;i<20;i++)
// {
// _attributes_list->SetItem(i,0,"");
// _attributes_list->SetItem(i,1,"");
// }
//
// int atts_row_counter = 0;
//
// vector<string>::iterator itr;
//
// for(itr=attributes_schema.begin();itr!=attributes_schema.end();itr++,atts_row_counter++)
// {
// _attributes_list->SetItem( atts_row_counter,0,(*itr).c_str() );
// }
//
// //const char* schema_itr = schema.c_str();
// //const char* const schema_end = schema_itr + schema.size();
//
// //int atts_row_counter = 0;
// //string new_token("");
//
// //while( schema_itr != schema_end )
// //{
// // if((*schema_itr) == ',')
// // {
// // _attributes_list->SetItem(atts_row_counter,0,new_token.c_str());
// // new_token.clear();
// // ++atts_row_counter;
// // }
// // else
// // {
// // new_token.push_back((*schema_itr));
// // }
//
// // ++schema_itr;
// //}
//
// //_attributes_list->SetItem(atts_row_counter,0,new_token.c_str());
//
//
//
//
//
// _attributes_list->SetColumnWidth(0,wxLIST_AUTOSIZE);
// _attributes_list->SetColumnWidth(1,wxLIST_AUTOSIZE);
//
// Refresh();
//}
//---------------------------------------------------------
// Push_Attributes
//--------------------------------------------------------
template<typename MasterType,typename InheritanceList>
void Attributes_Panel_Implementation<MasterType,InheritanceList>::Push_Attributes(std::vector<pair<string,string>>& attributes)
{
for(int i=0;i<100;i++)
{
_attributes_list->SetItem(i,0,"");
_attributes_list->SetItem(i,1,"");
}
int atts_row_counter = 0;
std::vector<pair<string,string>>::iterator itr;
for(itr=attributes.begin();itr!=attributes.end();itr++,atts_row_counter++)
{
if(atts_row_counter == 100) break;
_attributes_list->SetItem(atts_row_counter,0,itr->first);
_attributes_list->SetItem(atts_row_counter,1,itr->second);
}
_attributes_list->SetColumnWidth(0,wxLIST_AUTOSIZE);
_attributes_list->SetColumnWidth(1,wxLIST_AUTOSIZE);
Refresh();
}
| 28.833333 | 162 | 0.63317 | [
"vector"
] |
d2755bd1fbff9dfc137e3b729d651c80b8d40f04 | 8,624 | h | C | VTK/Utilities/vtknetcdf/nc.h | matthb2/ParaView-beforekitwareswtichedtogit | e47e57d6ce88444d9e6af9ab29f9db8c23d24cef | [
"BSD-3-Clause"
] | 1 | 2021-07-31T19:38:03.000Z | 2021-07-31T19:38:03.000Z | VTK/Utilities/vtknetcdf/nc.h | matthb2/ParaView-beforekitwareswtichedtogit | e47e57d6ce88444d9e6af9ab29f9db8c23d24cef | [
"BSD-3-Clause"
] | null | null | null | VTK/Utilities/vtknetcdf/nc.h | matthb2/ParaView-beforekitwareswtichedtogit | e47e57d6ce88444d9e6af9ab29f9db8c23d24cef | [
"BSD-3-Clause"
] | 2 | 2019-01-22T19:51:40.000Z | 2021-07-31T19:38:05.000Z | /*
* Copyright 1996, University Corporation for Atmospheric Research
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
/* $Id$ */
#ifndef _NC_H_
#define _NC_H_
/*
* netcdf library 'private' data structures, objects and interfaces
*/
#include "ncconfig.h"
/* If netcdf-4 is in use, rename all nc_ functions to nc3_ functions. */
#ifdef USE_NETCDF4
#include <netcdf3.h>
#include <nc3convert.h>
#endif
#include <stddef.h> /* size_t */
#ifndef NO_SYS_TYPES_H
# include <sys/types.h> /* off_t */
#endif /* NO_SYS_TYPES_H */
#include "netcdf.h"
#include "ncio.h" /* ncio */
#include "fbits.h"
#ifndef NC_ARRAY_GROWBY
#define NC_ARRAY_GROWBY 4
#endif
/*
* The extern size of an empty
* netcdf version 1 file.
* The initial value of ncp->xsz.
*/
#define MIN_NC_XSZ 32
typedef struct NC NC; /* forward reference */
/*
* The internal data types
*/
typedef enum {
NC_UNSPECIFIED = 0,
/* future NC_BITFIELD = 7, */
/* NC_STRING = 8, */
NC_DIMENSION = 10,
NC_VARIABLE = 11,
NC_ATTRIBUTE = 12
} NCtype;
/*
* Counted string for names and such
*/
typedef struct {
/* all xdr'd */
size_t nchars;
char *cp;
} NC_string;
/* Begin defined in string.c */
extern void
free_NC_string(NC_string *ncstrp);
extern int
NC_check_name(const char *name);
extern NC_string *
new_NC_string(size_t slen, const char *str);
extern int
set_NC_string(NC_string *ncstrp, const char *str);
/* End defined in string.c */
/*
* NC dimension stucture
*/
typedef struct {
/* all xdr'd */
NC_string *name;
size_t size;
} NC_dim;
typedef struct NC_dimarray {
size_t nalloc; /* number allocated >= nelems */
/* below gets xdr'd */
/* NCtype type = NC_DIMENSION */
size_t nelems; /* length of the array */
NC_dim **value;
} NC_dimarray;
/* Begin defined in dim.c */
extern void
free_NC_dim(NC_dim *dimp);
extern NC_dim *
new_x_NC_dim(NC_string *name);
extern int
find_NC_Udim(const NC_dimarray *ncap, NC_dim **dimpp);
/* dimarray */
extern void
free_NC_dimarrayV0(NC_dimarray *ncap);
extern void
free_NC_dimarrayV(NC_dimarray *ncap);
extern int
dup_NC_dimarrayV(NC_dimarray *ncap, const NC_dimarray *ref);
extern NC_dim *
elem_NC_dimarray(const NC_dimarray *ncap, size_t elem);
/* End defined in dim.c */
/*
* NC attribute
*/
typedef struct {
size_t xsz; /* amount of space at xvalue */
/* below gets xdr'd */
NC_string *name;
nc_type type; /* the discriminant */
size_t nelems; /* length of the array */
void *xvalue; /* the actual data, in external representation */
} NC_attr;
typedef struct NC_attrarray {
size_t nalloc; /* number allocated >= nelems */
/* below gets xdr'd */
/* NCtype type = NC_ATTRIBUTE */
size_t nelems; /* length of the array */
NC_attr **value;
} NC_attrarray;
/* Begin defined in attr.c */
extern void
free_NC_attr(NC_attr *attrp);
extern NC_attr *
new_x_NC_attr(
NC_string *strp,
nc_type type,
size_t nelems);
extern NC_attr **
NC_findattr(const NC_attrarray *ncap, const char *name);
/* attrarray */
extern void
free_NC_attrarrayV0(NC_attrarray *ncap);
extern void
free_NC_attrarrayV(NC_attrarray *ncap);
extern int
dup_NC_attrarrayV(NC_attrarray *ncap, const NC_attrarray *ref);
extern NC_attr *
elem_NC_attrarray(const NC_attrarray *ncap, size_t elem);
/* End defined in attr.c */
/*
* NC variable: description and data
*/
typedef struct {
size_t xsz; /* xszof 1 element */
size_t *shape; /* compiled info: dim->size of each dim */
size_t *dsizes; /* compiled info: the right to left product of shape */
/* below gets xdr'd */
NC_string *name;
/* next two: formerly NC_iarray *assoc */ /* user definition */
size_t ndims; /* assoc->count */
int *dimids; /* assoc->value */
NC_attrarray attrs;
nc_type type; /* the discriminant */
size_t len; /* the total length originally allocated */
off_t begin;
} NC_var;
typedef struct NC_vararray {
size_t nalloc; /* number allocated >= nelems */
/* below gets xdr'd */
/* NCtype type = NC_VARIABLE */
size_t nelems; /* length of the array */
NC_var **value;
} NC_vararray;
/* Begin defined in var.c */
extern void
free_NC_var(NC_var *varp);
extern NC_var *
new_x_NC_var(
NC_string *strp,
size_t ndims);
/* vararray */
extern void
free_NC_vararrayV0(NC_vararray *ncap);
extern void
free_NC_vararrayV(NC_vararray *ncap);
extern int
dup_NC_vararrayV(NC_vararray *ncap, const NC_vararray *ref);
extern int
NC_var_shape(NC_var *varp, const NC_dimarray *dims);
extern int
NC_findvar(const NC_vararray *ncap, const char *name, NC_var **varpp);
extern int
NC_check_vlen(NC_var *varp, size_t vlen_max);
extern NC_var *
NC_lookupvar(NC *ncp, int varid);
/* End defined in var.c */
#define IS_RECVAR(vp) \
((vp)->shape != NULL ? (*(vp)->shape == NC_UNLIMITED) : 0 )
#ifdef LOCKNUMREC
/*
* typedef SHMEM type
* for whenever the SHMEM functions can handle other than shorts
*/
typedef unsigned short int ushmem_t;
typedef short int shmem_t;
#endif
struct NC {
/* links to make list of open netcdf's */
struct NC *next;
struct NC *prev;
/* contains the previous NC during redef. */
struct NC *old;
/* flags */
#define NC_CREAT 2 /* in create phase, cleared by ncendef */
#define NC_INDEF 8 /* in define mode, cleared by ncendef */
#define NC_NSYNC 0x10 /* synchronise numrecs on change */
#define NC_HSYNC 0x20 /* synchronise whole header on change */
#define NC_NDIRTY 0x40 /* numrecs has changed */
#define NC_HDIRTY 0x80 /* header info has changed */
/* NC_NOFILL in netcdf.h, historical interface */
int flags;
ncio *nciop;
size_t chunk; /* largest extent this layer will request from ncio->get() */
size_t xsz; /* external size of this header, == var[0].begin */
off_t begin_var; /* position of the first (non-record) var */
off_t begin_rec; /* position of the first 'record' */
/* don't constrain maximum size of record unnecessarily */
#if SIZEOF_OFF_T > SIZEOF_SIZE_T
off_t recsize; /* length of 'record' */
#else
size_t recsize; /* length of 'record' */
#endif
/* below gets xdr'd */
size_t numrecs; /* number of 'records' allocated */
NC_dimarray dims;
NC_attrarray attrs;
NC_vararray vars;
#ifdef LOCKNUMREC
/* size and named indexes for the lock array protecting NC.numrecs */
# define LOCKNUMREC_DIM 4
# define LOCKNUMREC_VALUE 0
# define LOCKNUMREC_LOCK 1
# define LOCKNUMREC_SERVING 2
# define LOCKNUMREC_BASEPE 3
/* Used on Cray T3E MPP to maintain the
* integrity of numrecs for an unlimited dimension
*/
ushmem_t lock[LOCKNUMREC_DIM];
#endif
};
#define NC_readonly(ncp) \
(!fIsSet(ncp->nciop->ioflags, NC_WRITE))
#define NC_IsNew(ncp) \
fIsSet((ncp)->flags, NC_CREAT)
#define NC_indef(ncp) \
(NC_IsNew(ncp) || fIsSet((ncp)->flags, NC_INDEF))
#define set_NC_ndirty(ncp) \
fSet((ncp)->flags, NC_NDIRTY)
#define NC_ndirty(ncp) \
fIsSet((ncp)->flags, NC_NDIRTY)
#define set_NC_hdirty(ncp) \
fSet((ncp)->flags, NC_HDIRTY)
#define NC_hdirty(ncp) \
fIsSet((ncp)->flags, NC_HDIRTY)
#define NC_dofill(ncp) \
(!fIsSet((ncp)->flags, NC_NOFILL))
#define NC_doHsync(ncp) \
fIsSet((ncp)->flags, NC_HSYNC)
#define NC_doNsync(ncp) \
fIsSet((ncp)->flags, NC_NSYNC)
#ifndef LOCKNUMREC
# define NC_get_numrecs(ncp) \
((ncp)->numrecs)
# define NC_set_numrecs(ncp, nrecs) \
{((ncp)->numrecs = (nrecs));}
# define NC_increase_numrecs(ncp, nrecs) \
{if((nrecs) > (ncp)->numrecs) ((ncp)->numrecs = (nrecs));}
#else
size_t NC_get_numrecs(const NC *ncp);
void NC_set_numrecs(NC *ncp, size_t nrecs);
void NC_increase_numrecs(NC *ncp, size_t nrecs);
#endif
/* Begin defined in nc.c */
extern int
NC_check_id(int ncid, NC **ncpp);
extern int
nc_cktype(nc_type datatype);
extern size_t
ncx_howmany(nc_type type, size_t xbufsize);
extern int
read_numrecs(NC *ncp);
extern int
write_numrecs(NC *ncp);
extern int
NC_sync(NC *ncp);
extern int
NC_calcsize(NC *ncp, off_t *filesizep);
/* End defined in nc.c */
/* Begin defined in v1hpg.c */
extern size_t
ncx_len_NC(const NC *ncp, size_t sizeof_off_t);
extern int
ncx_put_NC(const NC *ncp, void **xpp, off_t offset, size_t extent);
extern int
nc_get_NC( NC *ncp);
/* End defined in v1hpg.c */
/* Begin defined in putget.c */
extern int
fill_NC_var(NC *ncp, const NC_var *varp, size_t varsize, size_t recno);
extern int
nc_inq_rec(int ncid, size_t *nrecvars, int *recvarids, size_t *recsizes);
extern int
nc_get_rec(int ncid, size_t recnum, void **datap);
extern int
nc_put_rec(int ncid, size_t recnum, void *const *datap);
/* End defined in putget.c */
#endif /* _NC_H_ */
| 22.112821 | 77 | 0.695965 | [
"shape"
] |
d2769161f7d8cd7ceb76be55cdb48650ee2a3dc9 | 15,571 | c | C | lib/abc/src/proof/acec/acecCo.c | Ace-Ma/LSOracle | 6e940906303ef6c2c6b96352f44206567fdd50d3 | [
"MIT"
] | 9 | 2017-06-12T17:58:42.000Z | 2021-02-04T00:02:29.000Z | lib/abc/src/proof/acec/acecCo.c | Ace-Ma/LSOracle | 6e940906303ef6c2c6b96352f44206567fdd50d3 | [
"MIT"
] | 1 | 2020-12-15T05:59:37.000Z | 2020-12-15T05:59:37.000Z | lib/abc/src/proof/acec/acecCo.c | Ace-Ma/LSOracle | 6e940906303ef6c2c6b96352f44206567fdd50d3 | [
"MIT"
] | 3 | 2018-04-23T22:52:53.000Z | 2020-12-15T16:36:19.000Z | /**CFile****************************************************************
FileName [acecCo.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [CEC for arithmetic circuits.]
Synopsis [Core procedures.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: acecCo.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "acecInt.h"
#include "misc/vec/vecWec.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [Collect non-XOR inputs.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_PolynCoreNonXors_rec( Gia_Man_t * pGia, Gia_Obj_t * pObj, Vec_Int_t * vXorPairs )
{
extern int Gia_ManSuppSizeOne( Gia_Man_t * p, Gia_Obj_t * pObj );
Gia_Obj_t * pFan0, * pFan1;
if ( !Gia_ObjRecognizeExor(pObj, &pFan0, &pFan1) )
return;
Gia_PolynCoreNonXors_rec( pGia, Gia_Regular(pFan0), vXorPairs );
Gia_PolynCoreNonXors_rec( pGia, Gia_Regular(pFan1), vXorPairs );
//if ( Gia_ManSuppSizeOne(pGia, pObj) > 4 )
//if ( Gia_ObjId(pGia, pObj) >= 73 )
Vec_IntPushTwo( vXorPairs, Gia_ObjId(pGia, Gia_Regular(pFan0)), Gia_ObjId(pGia, Gia_Regular(pFan1)) );
}
Vec_Int_t * Gia_PolynAddHaRoots( Gia_Man_t * pGia )
{
int i, iFan0, iFan1;
Vec_Int_t * vNewOuts = Vec_IntAlloc( 100 );
Vec_Int_t * vXorPairs = Vec_IntAlloc( 100 );
Gia_Obj_t * pObj = Gia_ManCo( pGia, Gia_ManCoNum(pGia)-1 );
Gia_PolynCoreNonXors_rec( pGia, Gia_ObjFanin0(pObj), vXorPairs );
// add new outputs
Gia_ManSetPhase( pGia );
Vec_IntForEachEntryDouble( vXorPairs, iFan0, iFan1, i )
{
Gia_Obj_t * pFan0 = Gia_ManObj( pGia, iFan0 );
Gia_Obj_t * pFan1 = Gia_ManObj( pGia, iFan1 );
int iLit0 = Abc_Var2Lit( iFan0, pFan0->fPhase );
int iLit1 = Abc_Var2Lit( iFan1, pFan1->fPhase );
int iRoot = Gia_ManAppendAnd( pGia, iLit0, iLit1 );
Vec_IntPush( vNewOuts, Abc_Lit2Var(iRoot) );
}
Vec_IntFree( vXorPairs );
Vec_IntReverseOrder( vNewOuts );
// Vec_IntPop( vNewOuts );
return vNewOuts;
}
/**Function*************************************************************
Synopsis [Detects the order of adders.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Wec_t * Gia_PolynComputeMap( Vec_Int_t * vAdds, int nObjs )
{
// map nodes driven by adders into adder indexes
Vec_Wec_t * vMap = Vec_WecStart( nObjs ); int i;
for ( i = 0; 6*i < Vec_IntSize(vAdds); i++ )
{
int Entry1 = Vec_IntEntry( vAdds, 6*i + 3 );
int Entry2 = Vec_IntEntry( vAdds, 6*i + 4 );
Vec_WecPush( vMap, Entry1, i );
Vec_WecPush( vMap, Entry1, Entry2 );
Vec_WecPush( vMap, Entry2, i );
Vec_WecPush( vMap, Entry2, Entry1 );
}
return vMap;
}
Vec_Int_t * Gia_PolynCoreOrder_int( Gia_Man_t * pGia, Vec_Int_t * vAdds, Vec_Wec_t * vMap, Vec_Int_t * vRoots, Vec_Int_t ** pvIns )
{
Vec_Int_t * vOrder = Vec_IntAlloc( 1000 );
Vec_Bit_t * vIsRoot = Vec_BitStart( Gia_ManObjNum(pGia) );
int i, k, Index = -1, Driver, Entry1, Entry2 = -1;
// mark roots
Vec_IntForEachEntry( vRoots, Driver, i )
Vec_BitWriteEntry( vIsRoot, Driver, 1 );
// collect boxes
while ( 1 )
{
// iterate through boxes driving this one
Vec_IntForEachEntry( vRoots, Entry1, i )
{
Vec_Int_t * vLevel = Vec_WecEntry( vMap, Entry1 );
Vec_IntForEachEntryDouble( vLevel, Index, Entry2, k )
if ( Vec_BitEntry(vIsRoot, Entry2) )
break;
if ( k == Vec_IntSize(vLevel) )
continue;
assert( Vec_BitEntry(vIsRoot, Entry1) );
assert( Vec_BitEntry(vIsRoot, Entry2) );
// collect adder
Vec_IntPush( vOrder, Index );
// clean marks
Vec_BitWriteEntry( vIsRoot, Entry1, 0 );
Vec_BitWriteEntry( vIsRoot, Entry2, 0 );
Vec_IntRemove( vRoots, Entry1 );
Vec_IntRemove( vRoots, Entry2 );
// set new marks
Entry1 = Vec_IntEntry( vAdds, 6*Index + 0 );
Entry2 = Vec_IntEntry( vAdds, 6*Index + 1 );
Driver = Vec_IntEntry( vAdds, 6*Index + 2 );
Vec_BitWriteEntry( vIsRoot, Entry1, 1 );
Vec_BitWriteEntry( vIsRoot, Entry2, 1 );
Vec_BitWriteEntry( vIsRoot, Driver, 1 );
Vec_IntPushUnique( vRoots, Entry1 );
Vec_IntPushUnique( vRoots, Entry2 );
Vec_IntPushUnique( vRoots, Driver );
break;
}
if ( i == Vec_IntSize(vRoots) )
break;
}
// collect remaining leaves
if ( pvIns )
{
*pvIns = Vec_IntAlloc( Vec_BitSize(vIsRoot) );
Vec_BitForEachEntryStart( vIsRoot, Driver, i, 1 )
if ( Driver )
Vec_IntPush( *pvIns, i );
}
Vec_BitFree( vIsRoot );
return vOrder;
}
Vec_Int_t * Gia_PolynCoreOrder( Gia_Man_t * pGia, Vec_Int_t * vAdds, Vec_Int_t * vAddCos, Vec_Int_t ** pvIns, Vec_Int_t ** pvOuts )
{
Vec_Int_t * vOrder;
Vec_Wec_t * vMap = Gia_PolynComputeMap( vAdds, Gia_ManObjNum(pGia) );
Vec_Int_t * vRoots = Vec_IntAlloc( Gia_ManCoNum(pGia) );
int i, Driver;
// collect roots
Gia_ManForEachCoDriverId( pGia, Driver, i )
Vec_IntPush( vRoots, Driver );
// collect additional outputs
if ( vAddCos )
Vec_IntForEachEntry( vAddCos, Driver, i )
Vec_IntPush( vRoots, Driver );
// remember roots
if ( pvOuts )
*pvOuts = Vec_IntDup( vRoots );
// create order
vOrder = Gia_PolynCoreOrder_int( pGia, vAdds, vMap, vRoots, pvIns );
Vec_IntFree( vRoots );
Vec_WecFree( vMap );
printf( "Collected %d boxes.\n", Vec_IntSize(vOrder) );
return vOrder;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_PolyCollectRoots_rec( Vec_Int_t * vAdds, Vec_Wec_t * vMap, Vec_Bit_t * vMarks, int iBox, Vec_Int_t * vRoots )
{
int k;
for ( k = 0; k < 3; k++ )
{
int i, Index, Sum, Carry = Vec_IntEntry( vAdds, 6*iBox+k );
Vec_Int_t * vLevel = Vec_WecEntry( vMap, Carry );
if ( Carry == 0 )
continue;
Vec_IntForEachEntryDouble( vLevel, Index, Sum, i )
if ( Vec_IntEntry(vAdds, 6*Index+4) == Carry && !Vec_BitEntry(vMarks, Sum) )
{
Vec_IntPush( vRoots, Sum );
Gia_PolyCollectRoots_rec( vAdds, vMap, vMarks, Index, vRoots );
}
}
}
void Gia_PolyCollectRoots( Vec_Int_t * vAdds, Vec_Wec_t * vMap, Vec_Bit_t * vMarks, int iBox, Vec_Int_t * vRoots )
{
Vec_IntClear( vRoots );
Vec_IntPush( vRoots, Vec_IntEntry(vAdds, 6*iBox+3) );
Vec_IntPush( vRoots, Vec_IntEntry(vAdds, 6*iBox+4) );
Gia_PolyCollectRoots_rec( vAdds, vMap, vMarks, iBox, vRoots );
}
Vec_Wec_t * Gia_PolynCoreOrderArray( Gia_Man_t * pGia, Vec_Int_t * vAdds, Vec_Int_t * vRootBoxes )
{
extern Vec_Bit_t * Acec_ManPoolGetPointed( Gia_Man_t * p, Vec_Int_t * vAdds );
Vec_Bit_t * vMarks = Acec_ManPoolGetPointed( pGia, vAdds );
Vec_Wec_t * vMap = Gia_PolynComputeMap( vAdds, Gia_ManObjNum(pGia) );
Vec_Wec_t * vRes = Vec_WecStart( Vec_IntSize(vRootBoxes) );
Vec_Int_t * vRoots = Vec_IntAlloc( 64 );
Vec_Int_t * vOrder;
int i, iBox;
Vec_IntForEachEntry( vRootBoxes, iBox, i )
{
Gia_PolyCollectRoots( vAdds, vMap, vMarks, iBox, vRoots );
vOrder = Gia_PolynCoreOrder_int( pGia, vAdds, vMap, vRoots, NULL );
Vec_IntAppend( Vec_WecEntry(vRes, i), vOrder );
Vec_IntFree( vOrder );
}
Vec_BitFree( vMarks );
Vec_IntFree( vRoots );
Vec_WecFree( vMap );
return vRes;
}
/**Function*************************************************************
Synopsis [Collect internal node order.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_PolynCoreCollect_rec( Gia_Man_t * pGia, int iObj, Vec_Int_t * vNodes, Vec_Bit_t * vVisited )
{
if ( Vec_BitEntry(vVisited, iObj) )
return;
Vec_BitSetEntry( vVisited, iObj, 1 );
Gia_PolynCoreCollect_rec( pGia, Gia_ObjFaninId0p(pGia, Gia_ManObj(pGia, iObj)), vNodes, vVisited );
Gia_PolynCoreCollect_rec( pGia, Gia_ObjFaninId1p(pGia, Gia_ManObj(pGia, iObj)), vNodes, vVisited );
Vec_IntPush( vNodes, iObj );
}
Vec_Int_t * Gia_PolynCoreCollect( Gia_Man_t * pGia, Vec_Int_t * vAdds, Vec_Int_t * vOrder )
{
Vec_Int_t * vNodes = Vec_IntAlloc( 1000 );
Vec_Bit_t * vVisited = Vec_BitStart( Gia_ManObjNum(pGia) );
int i, Index, Entry1, Entry2, Entry3;
Vec_IntForEachEntryReverse( vOrder, Index, i )
{
// mark inputs
Entry1 = Vec_IntEntry( vAdds, 6*Index + 0 );
Entry2 = Vec_IntEntry( vAdds, 6*Index + 1 );
Entry3 = Vec_IntEntry( vAdds, 6*Index + 2 );
Vec_BitWriteEntry( vVisited, Entry1, 1 );
Vec_BitWriteEntry( vVisited, Entry2, 1 );
Vec_BitWriteEntry( vVisited, Entry3, 1 );
// traverse from outputs
Entry1 = Vec_IntEntry( vAdds, 6*Index + 3 );
Entry2 = Vec_IntEntry( vAdds, 6*Index + 4 );
Gia_PolynCoreCollect_rec( pGia, Entry1, vNodes, vVisited );
Gia_PolynCoreCollect_rec( pGia, Entry2, vNodes, vVisited );
}
Vec_BitFree( vVisited );
return vNodes;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_PolynCorePrintCones( Gia_Man_t * pGia, Vec_Int_t * vLeaves, int fVerbose )
{
int i, iObj;
if ( fVerbose )
{
Vec_IntForEachEntry( vLeaves, iObj, i )
{
printf( "%4d : ", i );
printf( "Supp = %3d ", Gia_ManSuppSize(pGia, &iObj, 1) );
printf( "Cone = %3d ", Gia_ManConeSize(pGia, &iObj, 1) );
printf( "\n" );
}
}
else
{
int SuppMax = 0, ConeMax = 0;
Vec_IntForEachEntry( vLeaves, iObj, i )
{
SuppMax = Abc_MaxInt( SuppMax, Gia_ManSuppSize(pGia, &iObj, 1) );
ConeMax = Abc_MaxInt( ConeMax, Gia_ManConeSize(pGia, &iObj, 1) );
}
printf( "Remaining cones: Count = %d. SuppMax = %d. ConeMax = %d.\n", Vec_IntSize(vLeaves), SuppMax, ConeMax );
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Gia_PolynCoreDupTreePlus_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
{
if ( ~pObj->Value )
return pObj->Value;
assert( Gia_ObjIsAnd(pObj) );
Gia_PolynCoreDupTreePlus_rec( pNew, p, Gia_ObjFanin0(pObj) );
Gia_PolynCoreDupTreePlus_rec( pNew, p, Gia_ObjFanin1(pObj) );
return pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
}
Gia_Man_t * Gia_PolynCoreDupTree( Gia_Man_t * p, Vec_Int_t * vAddCos, Vec_Int_t * vLeaves, Vec_Int_t * vNodes, int fAddCones )
{
Gia_Man_t * pNew;
Gia_Obj_t * pObj;
int i;
assert( Gia_ManRegNum(p) == 0 );
Gia_ManFillValue( p );
pNew = Gia_ManStart( Gia_ManObjNum(p) );
pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
Gia_ManConst0(p)->Value = 0;
if ( fAddCones )
{
Gia_ManForEachPi( p, pObj, i )
pObj->Value = Gia_ManAppendCi(pNew);
Gia_ManForEachObjVec( vLeaves, p, pObj, i )
pObj->Value = Gia_PolynCoreDupTreePlus_rec( pNew, p, pObj );
}
else
{
Gia_ManForEachObjVec( vLeaves, p, pObj, i )
pObj->Value = Gia_ManAppendCi(pNew);
}
Gia_ManForEachObjVec( vNodes, p, pObj, i )
pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
Gia_ManForEachCo( p, pObj, i )
Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
Gia_ManForEachObjVec( vAddCos, p, pObj, i )
Gia_ManAppendCo( pNew, pObj->Value );
return pNew;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t * Gia_PolynCoreDetectTest_int( Gia_Man_t * pGia, Vec_Int_t * vAddCos, int fAddCones, int fVerbose )
{
extern Vec_Int_t * Ree_ManComputeCuts( Gia_Man_t * p, Vec_Int_t ** pvXors, int fVerbose );
abctime clk = Abc_Clock();
Gia_Man_t * pNew;
Vec_Int_t * vAdds = Ree_ManComputeCuts( pGia, NULL, 1 );
Vec_Int_t * vLeaves, * vRoots, * vOrder = Gia_PolynCoreOrder( pGia, vAdds, vAddCos, &vLeaves, &vRoots );
Vec_Int_t * vNodes = Gia_PolynCoreCollect( pGia, vAdds, vOrder );
//Gia_ManShow( pGia, vNodes, 0 );
printf( "Detected %d FAs/HAs. Roots = %d. Leaves = %d. Nodes = %d. Adds = %d. ",
Vec_IntSize(vAdds)/6, Vec_IntSize(vLeaves), Vec_IntSize(vRoots), Vec_IntSize(vNodes), Vec_IntSize(vOrder) );
Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
Gia_PolynCorePrintCones( pGia, vLeaves, fVerbose );
pNew = Gia_PolynCoreDupTree( pGia, vAddCos, vLeaves, vNodes, fAddCones );
Vec_IntFree( vAdds );
Vec_IntFree( vLeaves );
Vec_IntFree( vRoots );
Vec_IntFree( vOrder );
Vec_IntFree( vNodes );
return pNew;
}
Gia_Man_t * Gia_PolynCoreDetectTest( Gia_Man_t * pGia, int fAddExtra, int fAddCones, int fVerbose )
{
Vec_Int_t * vAddCos = fAddExtra ? Gia_PolynAddHaRoots( pGia ) : Vec_IntAlloc(0);
Gia_Man_t * pNew = Gia_PolynCoreDetectTest_int( pGia, vAddCos, fAddCones, fVerbose );
printf( "On top of %d COs, created %d new adder outputs.\n", Gia_ManCoNum(pGia), Vec_IntSize(vAddCos) );
Vec_IntFree( vAddCos );
return pNew;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
| 36.211628 | 132 | 0.539336 | [
"3d"
] |
d27859910c55c693b712e97c5a3911b56da3f493 | 9,790 | h | C | thirdparty/Assimp/assimp/IOStreamBuffer.h | GuangfuWang/threedbody | 31c544c25e524cecf107a505c3b4438fc04cd766 | [
"BSD-2-Clause"
] | null | null | null | thirdparty/Assimp/assimp/IOStreamBuffer.h | GuangfuWang/threedbody | 31c544c25e524cecf107a505c3b4438fc04cd766 | [
"BSD-2-Clause"
] | null | null | null | thirdparty/Assimp/assimp/IOStreamBuffer.h | GuangfuWang/threedbody | 31c544c25e524cecf107a505c3b4438fc04cd766 | [
"BSD-2-Clause"
] | null | null | null | #pragma once
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2019, assimp team
All rights reserved.
Redistribution and use of this software 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 assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
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.
----------------------------------------------------------------------
*/
#include <assimp/types.h>
#include <assimp/IOStream.hpp>
#include "ParsingUtils.h"
#include <vector>
namespace Assimp {
// ---------------------------------------------------------------------------
/**
* Implementation of a cached stream buffer.
*/
template<class T>
class IOStreamBuffer {
public:
/// @brief The class constructor.
IOStreamBuffer(size_t cache = 4096 * 4096);
/// @brief The class destructor.
~IOStreamBuffer();
/// @brief Will open the cached access for a given stream.
/// @param stream The stream to cache.
/// @return true if successful.
bool open(IOStream *stream);
/// @brief Will close the cached access.
/// @return true if successful.
bool close();
/// @brief Returns the file-size.
/// @return The file-size.
size_t size() const;
/// @brief Returns the cache size.
/// @return The cache size.
size_t cacheSize() const;
/// @brief Will read the next block.
/// @return true if successful.
bool readNextBlock();
/// @brief Returns the number of blocks to read.
/// @return The number of blocks.
size_t getNumBlocks() const;
/// @brief Returns the current block index.
/// @return The current block index.
size_t getCurrentBlockIndex() const;
/// @brief Returns the current file pos.
/// @return The current file pos.
size_t getFilePos() const;
/// @brief Will read the next line.
/// @param buffer The buffer for the next line.
/// @return true if successful.
bool getNextDataLine(std::vector<T> &buffer, T continuationToken);
/// @brief Will read the next line ascii or binary end line char.
/// @param buffer The buffer for the next line.
/// @return true if successful.
bool getNextLine(std::vector<T> &buffer);
/// @brief Will read the next block.
/// @param buffer The buffer for the next block.
/// @return true if successful.
bool getNextBlock(std::vector<T> &buffer);
private:
IOStream *m_stream;
size_t m_filesize;
size_t m_cacheSize;
size_t m_numBlocks;
size_t m_blockIdx;
std::vector<T> m_cache;
size_t m_cachePos;
size_t m_filePos;
};
template<class T>
inline
IOStreamBuffer<T>::IOStreamBuffer(size_t cache)
: m_stream(nullptr), m_filesize(0), m_cacheSize(cache), m_numBlocks(0), m_blockIdx(0), m_cachePos(0),
m_filePos(0) {
m_cache.resize(cache);
std::fill(m_cache.begin(), m_cache.end(), '\n');
}
template<class T>
inline
IOStreamBuffer<T>::~IOStreamBuffer() {
// empty
}
template<class T>
inline
bool IOStreamBuffer<T>::open(IOStream *stream) {
// file still opened!
if (nullptr != m_stream) {
return false;
}
// Invalid stream pointer
if (nullptr == stream) {
return false;
}
m_stream = stream;
m_filesize = m_stream->FileSize();
if (m_filesize == 0) {
return false;
}
if (m_filesize < m_cacheSize) {
m_cacheSize = m_filesize;
}
m_numBlocks = m_filesize / m_cacheSize;
if ((m_filesize % m_cacheSize) > 0) {
m_numBlocks++;
}
return true;
}
template<class T>
inline
bool IOStreamBuffer<T>::close() {
if (nullptr == m_stream) {
return false;
}
// init counters and state vars
m_stream = nullptr;
m_filesize = 0;
m_numBlocks = 0;
m_blockIdx = 0;
m_cachePos = 0;
m_filePos = 0;
return true;
}
template<class T>
inline
size_t IOStreamBuffer<T>::size() const {
return m_filesize;
}
template<class T>
inline
size_t IOStreamBuffer<T>::cacheSize() const {
return m_cacheSize;
}
template<class T>
inline
bool IOStreamBuffer<T>::readNextBlock() {
m_stream->Seek(m_filePos, aiOrigin_SET);
size_t readLen = m_stream->Read(&m_cache[0], sizeof(T), m_cacheSize);
if (readLen == 0) {
return false;
}
if (readLen < m_cacheSize) {
m_cacheSize = readLen;
}
m_filePos += m_cacheSize;
m_cachePos = 0;
m_blockIdx++;
return true;
}
template<class T>
inline
size_t IOStreamBuffer<T>::getNumBlocks() const {
return m_numBlocks;
}
template<class T>
inline
size_t IOStreamBuffer<T>::getCurrentBlockIndex() const {
return m_blockIdx;
}
template<class T>
inline
size_t IOStreamBuffer<T>::getFilePos() const {
return m_filePos;
}
template<class T>
inline
bool IOStreamBuffer<T>::getNextDataLine(std::vector<T> &buffer, T continuationToken) {
buffer.resize(m_cacheSize);
if (m_cachePos >= m_cacheSize || 0 == m_filePos) {
if (!readNextBlock()) {
return false;
}
}
bool continuationFound(false);
size_t i = 0;
for (;;) {
if (continuationToken == m_cache[m_cachePos]) {
continuationFound = true;
++m_cachePos;
}
if (IsLineEnd(m_cache[m_cachePos])) {
if (!continuationFound) {
// the end of the data line
break;
} else {
// skip line end
while (m_cache[m_cachePos] != '\n') {
++m_cachePos;
}
++m_cachePos;
continuationFound = false;
}
}
buffer[i] = m_cache[m_cachePos];
++m_cachePos;
++i;
if (m_cachePos >= size()) {
break;
}
if (m_cachePos >= m_cacheSize) {
if (!readNextBlock()) {
return false;
}
}
}
buffer[i] = '\n';
++m_cachePos;
return true;
}
static inline
bool isEndOfCache(size_t pos, size_t cacheSize) {
return (pos == cacheSize);
}
template<class T>
inline
bool IOStreamBuffer<T>::getNextLine(std::vector<T> &buffer) {
buffer.resize(m_cacheSize);
if (isEndOfCache(m_cachePos, m_cacheSize) || 0 == m_filePos) {
if (!readNextBlock()) {
return false;
}
}
if (IsLineEnd(m_cache[m_cachePos])) {
// skip line end
while (m_cache[m_cachePos] != '\n') {
++m_cachePos;
}
++m_cachePos;
if (isEndOfCache(m_cachePos, m_cacheSize)) {
if (!readNextBlock()) {
return false;
}
}
}
size_t i(0);
while (!IsLineEnd(m_cache[m_cachePos])) {
buffer[i] = m_cache[m_cachePos];
++m_cachePos;
++i;
if (m_cachePos >= m_cacheSize) {
if (!readNextBlock()) {
return false;
}
}
}
buffer[i] = '\n';
++m_cachePos;
return true;
}
template<class T>
inline
bool IOStreamBuffer<T>::getNextBlock(std::vector<T> &buffer) {
// Return the last block-value if getNextLine was used before
if (0 != m_cachePos) {
buffer = std::vector<T>(m_cache.begin() + m_cachePos, m_cache.end());
m_cachePos = 0;
} else {
if (!readNextBlock()) {
return false;
}
buffer = std::vector<T>(m_cache.begin(), m_cache.end());
}
return true;
}
} // !ns Assimp
| 27.891738 | 113 | 0.548723 | [
"vector"
] |
d278c1d8cef28cb1ec1c839f4853d71965c82c5b | 46,261 | h | C | AcquireIOSDK.xcframework/ios-i386_x86_64-simulator/AcquireIOSDK.framework/Headers/AcquireIOSDK-Swift.h | acquireio/AcquireIO-Lite-Swift | e0acb38d923bd22c2189fd73837d04f8c2485f81 | [
"Apache-2.0"
] | null | null | null | AcquireIOSDK.xcframework/ios-i386_x86_64-simulator/AcquireIOSDK.framework/Headers/AcquireIOSDK-Swift.h | acquireio/AcquireIO-Lite-Swift | e0acb38d923bd22c2189fd73837d04f8c2485f81 | [
"Apache-2.0"
] | null | null | null | AcquireIOSDK.xcframework/ios-i386_x86_64-simulator/AcquireIOSDK.framework/Headers/AcquireIOSDK-Swift.h | acquireio/AcquireIO-Lite-Swift | e0acb38d923bd22c2189fd73837d04f8c2485f81 | [
"Apache-2.0"
] | null | null | null | #if 0
#elif defined(__x86_64__) && __x86_64__
// Generated by Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)
#ifndef ACQUIREIOSDK_SWIFT_H
#define ACQUIREIOSDK_SWIFT_H
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
#else
# define SWIFT_RUNTIME_NAME(X)
#endif
#if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
#else
# define SWIFT_COMPILE_NAME(X)
#endif
#if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
#else
# define SWIFT_METHOD_FAMILY(X)
#endif
#if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
#else
# define SWIFT_NOESCAPE
#endif
#if __has_attribute(ns_consumed)
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
#else
# define SWIFT_RELEASES_ARGUMENT
#endif
#if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SWIFT_WARN_UNUSED_RESULT
#endif
#if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
#else
# define SWIFT_NORETURN
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_RESILIENT_CLASS)
# if __has_attribute(objc_class_stub)
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
# else
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_WEAK_IMPORT)
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
#else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if !defined(IBSegueAction)
# define IBSegueAction
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
@import UIKit;
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AcquireIOSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
@class AcquireIOConfig;
SWIFT_CLASS("_TtC12AcquireIOSDK9AcquireIO")
@interface AcquireIO : NSObject
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AcquireIO * _Nonnull support;)
+ (AcquireIO * _Nonnull)support SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
/// This is init method for initilize AcquireIO chat
/// Calling setAccount method you must pass one accountUID parameter.
/// @param accountUID This is your account unique id
/// @param optionDictionary is a dict for additional detail.
- (void)setAccount:(NSString * _Nonnull)accountUID withOptions:(AcquireIOConfig * _Nullable)optionDictionary;
@end
@class UIViewController;
enum AcquireIOAPNSTokenType : NSInteger;
enum AcquireIOPushMessageStatus : NSInteger;
enum AcquireIOConnectionStatus : NSInteger;
@interface AcquireIO (SWIFT_EXTENSION(AcquireIOSDK))
/// Start a connection session with acquire server. After calling startSession, the AcquireIODelegate delegate will receive either didChangeConnectionStatus: or onError:.
/// <em>setAccount: should be called first.</em>
/// @Available Available in SDK version 1.0 or later
- (void)showSupport:(UIViewController * _Nonnull)viewController;
/// Start a connection session with acquire server. After calling startSession, the AcquireIODelegate delegate will receive either didChangeConnectionStatus: or onError:.
/// <em>setAccount: should be called first.</em>
- (void)startSession;
/// Set APNS token for the application. This APNS token will be used to register
/// @param apnsToken The APNS token for the application.
/// @param type The type of APNS token. Debug builds should use
/// AcquireIOAPNSTokenTypeSandbox. Alternatively, you can supply
/// AcquireIOAPNSTokenTypeProd to have the type automatically
/// detected based on your provisioning profile.
/// @available Available in SDK version 1.0 or later
- (void)setAPNSToken:(NSData * _Nonnull)apnsToken type:(enum AcquireIOAPNSTokenType)type;
/// Use this to track message delivery and analytics for messages, typically
/// when you receive a notification in <code>application:didReceiveRemoteNotification:</code>.
/// @param message The downstream message received by the application.
/// @return Information about the downstream message.
/// @available Available in SDK version 1.0 or later
- (enum AcquireIOPushMessageStatus)appDidReceiveMessageWithMessage:(NSDictionary * _Nonnull)message SWIFT_WARN_UNUSED_RESULT;
/// Set Visitor Info
/// Update configuration after init method calles.
/// * Set an visitor identifier for your visitor.
/// *
/// * This is part of additional visitor configuration. The user identifier will be passed through to the admin dashboard as “User ID” under customer info.
/// * @param visitorIdentifier A string to identify your visitor.
/// *
/// * @available Available in SDK version 1.0 or later
- (void)setVisitorIdentifierWithVisitorIdentifier:(NSString * _Nonnull)visitorIdentifier;
/// Set the name, phone and email of the app visitor.
/// *
/// * This is part of additional visitor configuration. If this is provided through the api, user will not be prompted to re-enter this information again.
/// * Pass nil values for both name and email to clear out old existing values.
/// *
/// * @param name The name of the user.
/// * @param phone The phone of the user.
/// * @param email The email address of the user.
/// * @param department The department of the user.
/// *
/// * @available Available in SDK version 1.0 or later
- (void)setVisitor:(NSString * _Nullable)name phone:(NSString * _Nullable)phone email:(NSString * _Nullable)email department:(NSString * _Nullable)department;
/// Set the name, phone , email and fields of the app visitor.
/// *
/// <ul>
/// <li>
/// This is part of additional visitor configuration. If this is provided through the api, user will not be prompted to re-enter this information again.
/// </li>
/// <li>
/// Pass nil values for both name and email to clear out old existing values.
/// </li>
/// <li>
/// </li>
/// <li>
/// @param name The name of the user.
/// </li>
/// <li>
/// @param phone The phone of the user.
/// </li>
/// <li>
/// @param email The email address of the user.
/// </li>
/// <li>
/// @param fields array of field. field dictionary format: {“n”:“field_key”,“v”:“field_value”}.
/// </li>
/// <li>
/// </li>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (void)setVisitorDetail:(NSString * _Nullable)name phone:(NSString * _Nullable)phone email:(NSString * _Nullable)email extraFields:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)fields;
/// Set the extra detail of the app visitor.
/// *
/// * This is part of additional visitor configuration. If this is provided through the api, user will not be prompted to re-enter this information again.
/// * Pass nil values for data to clear out old existing values.
/// *
/// * @param fields array of field. field dictionary format: {“l”:“FIELD_LABEL”,“n”:“FIELD_KEY”,“v”:“FIELD_VALUE”}.
/// *
/// * @available Available in SDK version 1.0 or later
- (void)setVisitorExtraField:(NSArray<NSDictionary<NSString *, id> *> * _Nonnull)fields;
/// If your visitor is identified (i.e., visitor has already logged in your app and you have a email address of visitor), call the following method before setAccount: an identified user.
/// @note This must be called before setAccount: takes place and must pass same email in setVisitor:.
/// parameter <code>visitorHash</code> A HMAC digest of the visitor email.
/// <ul>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (void)setVisitorHash:(NSString * _Nonnull)visitorHash;
/// <ul>
/// <li>
/// Get visitor Id, after acquire session Connected
/// </li>
/// <li>
/// </li>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (NSString * _Nonnull)getVisitorId SWIFT_WARN_UNUSED_RESULT;
/// AcquireIO session connection status
/// @return AcquireIOConnectionStatus Enum value.
/// <ul>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (enum AcquireIOConnectionStatus)getConnectionStatus SWIFT_WARN_UNUSED_RESULT;
/// If you have set visitor hash (HMAC digest) and visitor just logged out from account and need to manage user integrity with agent, call method logoutVisitor to remove all acquire data from app related to visitorHash.
/// @note This should be called when visit logged out.
/// <ul>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (void)logoutVisitor;
- (void)onErrorWithError:(NSError * _Nonnull)error;
/// Total unread count of message(s).
/// @available Available in SDK version 1.0 or later
- (NSInteger)getUnreadCount SWIFT_WARN_UNUSED_RESULT;
/// Total available agent count
/// @available Available in SDK version 1.0 or later
- (NSInteger)getAvailableAgentCount SWIFT_WARN_UNUSED_RESULT;
@end
/// Status for the acquire.io app support notification environment
typedef SWIFT_ENUM(NSInteger, AcquireIOAPNSTokenType, open) {
/// Unknown token type.
AcquireIOAPNSTokenTypeUnknown = 0,
/// Sandbox token type.
AcquireIOAPNSTokenTypeSandbox = 1,
/// Production token type.
AcquireIOAPNSTokenTypeProd = 2,
};
/// Status for the agent.
typedef SWIFT_ENUM(NSInteger, AcquireIOAgentStatus, open) {
/// Online status for agent.
AcquireIOAgentStatusOnline = 0,
/// Offline status for agent.
AcquireIOAgentStatusOffline = 1,
/// Invisible status for agent.
AcquireIOAgentStatusInvisible = 2,
};
/// Status for the acquire.io app support call video/audio.
typedef SWIFT_ENUM(NSInteger, AcquireIOCallSupportStatus, open) {
AcquireIOCallSupportStatusNotConnected = 0,
AcquireIOCallSupportStatusDisconnected = 1,
AcquireIOCallSupportStatusConnecting = 2,
AcquireIOCallSupportStatusConnected = 3,
};
SWIFT_CLASS("_TtC12AcquireIOSDK15AcquireIOConfig")
@interface AcquireIOConfig : NSObject
/// Return an instance of AcquireIOConfig
/// Call any method of AcquireIOConfig instance you need to use shared <code>config</code> object. For example you want to setDict for setting
/// Objective-c : Config setting then you call as [AcquireIOConfig config] setDict:NSDictionary
/// Swift : Config setting then you call as AcquireIOConfig.config.setDict([String:Any])
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AcquireIOConfig * _Nonnull config;)
+ (AcquireIOConfig * _Nonnull)config SWIFT_WARN_UNUSED_RESULT;
/// This is init key for initilize AcquireIO chat with system button bottom right
/// Set image name should be put in Assets.xcassets of app.
/// Initialize dictionary key: ButtonImageName
@property (nonatomic, readonly, copy) NSString * _Nonnull buttonImageName;
/// Initilize AcquireIO chat with custom server, Websocket server ip or url to connect support socket server
/// This is optional, if not set default AcquireIO socket server will connect
/// Initialize dictionary key: WebSocketServer
@property (nonatomic, readonly, copy) NSString * _Nonnull webSocketServer;
/// if your added in ThemeOptions key in AcquireIOConfig
/// then set useDefaultTheme YES to load default theme setting instead of your
/// ThemeOptions theme setting
/// if not set key in config ThemeOptions in your AcquireIOConfig then always load theme default setting
/// Initialize dictionary key: UseDefaultTheme
@property (nonatomic, readonly) BOOL useDefaultTheme;
/// Default theme option like color before session start, after session start theme color will be change according to your acquire setting. See more to know about theme customization https://goo.gl/FvrtXf
/// Initialize dictionary key: ThemeOptions
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull themeOptions;
/// Show avatar of agent or visitor in main chat messages screen and available support agents list
/// Initialize dictionary key: ShowAvatar
@property (nonatomic, readonly) BOOL showAvatar;
/// show list of threads.
/// Initialize dictionary key: ShowThreadList
@property (nonatomic, readonly) BOOL showThreadList;
/// Show chat button in right bottom on user’s screen and its just hide button but chat functionality will not affect by this option.
/// Initialize dictionary key: ShowChatButton
@property (nonatomic, readonly) BOOL showChatButton;
/// Show video button in top tab list on visitor’s main chat messages screen and its just hide button but video functionality will not affect by this option.
/// Initialize dictionary key: ShowVideoButton
@property (nonatomic, readonly) BOOL showVideoButton;
/// Show audio button in top tab list on visitor’s main chat messages screen and its just hide button but audio functionality will not affect by this option.
/// Initialize dictionary key: ShowAudioButton
@property (nonatomic, readonly) BOOL showAudioButton;
/// Show in-app notifiction when app state is active state.
/// Initialize dictionary key: ShowLocalNotificationInApp
@property (nonatomic, readonly) BOOL showLocalNotificationInApp;
/// Session will be auto connect to server and start and no need to invoke any additional method for start session. If you set @“SessionConnectAndStartAuto”: @NO then you must call [[AcquireIO support] startSession] method to start connection with server.
/// Initialize dictionary key: SessionConnectAndStartAuto
@property (nonatomic, readonly) BOOL sessionConnectAndStartAuto;
/// Forcefully remove video call disconnect button to prevent visitor to disconnect with agent.
/// This is optional, if not set default @NO
/// Initialize dictionary key: RemoveVideoCallDisconnectButton
@property (nonatomic, readonly) BOOL removeVideoCallDisconnectButton;
/// Forcefully remove audio call disconnect button to prevent visitor to disconnect with agent.
/// This is optional, if not set default @NO
/// Initialize dictionary key: RemoveAudioCallDisconnectButton
@property (nonatomic, readonly) BOOL removeAudioCallDisconnectButton;
/// if yes then user want be able to upload any attachment in chat.
/// This is optional, if not set default is @NO
@property (nonatomic, readonly) BOOL disableAttachment;
/// Forcefully remove audio call disconnect button to prevent visitor to disconnect with agent.
/// This is optional, if not set default @NO
/// Initialize dictionary key: removeCallViewResizeButton
@property (nonatomic, readonly) BOOL removeCallViewResizeButton;
/// <ul>
/// <li>
/// if yes/true then user want be able to start new chat with agents.
/// </li>
/// <li>
/// if No/false, User can start new chat with agnets.
/// </li>
/// <li>
/// This is optional, if not set default @NO/false
/// </li>
/// <li>
/// Initialize dictionary key: isHideNewChat
/// </li>
/// </ul>
@property (nonatomic, readonly) BOOL isHideNewChat;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
/// if your app require changes in UI and supported functions to reset default setting with simple dictionary
/// @param dict NSDictionary or [String: Any] of option for support view
/// Set dictionary key values format: setDict
- (void)setDict:(NSDictionary<NSString *, id> * _Nonnull)dict;
@end
/// Status for Socket
typedef SWIFT_ENUM(NSInteger, AcquireIOConnectionStatus, open) {
/// App support session connection status not connected.
AcquireIOConnectionStatusNotConnected = 0,
/// App support session connection status disconnected.
AcquireIOConnectionStatusDisconnected = 1,
/// App support session connection status connecting.
AcquireIOConnectionStatusConnecting = 2,
/// App support session connection status connected.
AcquireIOConnectionStatusConnected = 3,
/// App support session connection status started.
AcquireIOConnectionStatusSessionStarted = 4,
};
typedef SWIFT_ENUM(NSInteger, AcquireIOInteractionEventType, open) {
AcquireIOInteractionEventTypeAudioCallStarted = 0,
AcquireIOInteractionEventTypeVideoCallStarted = 1,
AcquireIOInteractionEventTypeAudioCallAnswered = 2,
AcquireIOInteractionEventTypeVideoCallAnswered = 3,
AcquireIOInteractionEventTypeCallDeclined = 4,
AcquireIOInteractionEventTypeCallAutoDeclined = 5,
AcquireIOInteractionEventTypeCallerViewMinimize = 6,
AcquireIOInteractionEventTypeCallerViewMaximize = 7,
AcquireIOInteractionEventTypeCallerViewCameraSwitchToFront = 8,
AcquireIOInteractionEventTypeCallerViewCameraSwitchToBack = 9,
AcquireIOInteractionEventTypeCallSpeakerOn = 10,
AcquireIOInteractionEventTypeCallSpeakerOff = 11,
AcquireIOInteractionEventTypeCallMute = 12,
AcquireIOInteractionEventTypeCallUnmute = 13,
AcquireIOInteractionEventTypeCallVideoOn = 14,
AcquireIOInteractionEventTypeCallVideoOff = 15,
AcquireIOInteractionEventTypeCallDisconnected = 16,
AcquireIOInteractionEventTypeConversationStart = 17,
AcquireIOInteractionEventTypeConversationEnd = 18,
AcquireIOInteractionEventTypeConversationFeedbackSubmit = 19,
};
/// Status for the acquire.io app support notification message
typedef SWIFT_ENUM(NSInteger, AcquireIOPushMessageStatus, open) {
/// Unknown status.
AcquireIOPushMessageStatusUnknown = 0,
/// New downstream message received by the app.
AcquireIOPushMessageStatusNew = 1,
};
@interface UIViewController (SWIFT_EXTENSION(AcquireIOSDK))
- (void)awakeFromNib;
@end
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#endif
#elif defined(__i386__) && __i386__
// Generated by Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)
#ifndef ACQUIREIOSDK_SWIFT_H
#define ACQUIREIOSDK_SWIFT_H
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
#else
# define SWIFT_RUNTIME_NAME(X)
#endif
#if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
#else
# define SWIFT_COMPILE_NAME(X)
#endif
#if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
#else
# define SWIFT_METHOD_FAMILY(X)
#endif
#if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
#else
# define SWIFT_NOESCAPE
#endif
#if __has_attribute(ns_consumed)
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
#else
# define SWIFT_RELEASES_ARGUMENT
#endif
#if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SWIFT_WARN_UNUSED_RESULT
#endif
#if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
#else
# define SWIFT_NORETURN
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_RESILIENT_CLASS)
# if __has_attribute(objc_class_stub)
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
# else
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_WEAK_IMPORT)
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
#else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if !defined(IBSegueAction)
# define IBSegueAction
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
@import UIKit;
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AcquireIOSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
@class AcquireIOConfig;
SWIFT_CLASS("_TtC12AcquireIOSDK9AcquireIO")
@interface AcquireIO : NSObject
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AcquireIO * _Nonnull support;)
+ (AcquireIO * _Nonnull)support SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
/// This is init method for initilize AcquireIO chat
/// Calling setAccount method you must pass one accountUID parameter.
/// @param accountUID This is your account unique id
/// @param optionDictionary is a dict for additional detail.
- (void)setAccount:(NSString * _Nonnull)accountUID withOptions:(AcquireIOConfig * _Nullable)optionDictionary;
@end
@class UIViewController;
enum AcquireIOAPNSTokenType : NSInteger;
enum AcquireIOPushMessageStatus : NSInteger;
enum AcquireIOConnectionStatus : NSInteger;
@interface AcquireIO (SWIFT_EXTENSION(AcquireIOSDK))
/// Start a connection session with acquire server. After calling startSession, the AcquireIODelegate delegate will receive either didChangeConnectionStatus: or onError:.
/// <em>setAccount: should be called first.</em>
/// @Available Available in SDK version 1.0 or later
- (void)showSupport:(UIViewController * _Nonnull)viewController;
/// Start a connection session with acquire server. After calling startSession, the AcquireIODelegate delegate will receive either didChangeConnectionStatus: or onError:.
/// <em>setAccount: should be called first.</em>
- (void)startSession;
/// Set APNS token for the application. This APNS token will be used to register
/// @param apnsToken The APNS token for the application.
/// @param type The type of APNS token. Debug builds should use
/// AcquireIOAPNSTokenTypeSandbox. Alternatively, you can supply
/// AcquireIOAPNSTokenTypeProd to have the type automatically
/// detected based on your provisioning profile.
/// @available Available in SDK version 1.0 or later
- (void)setAPNSToken:(NSData * _Nonnull)apnsToken type:(enum AcquireIOAPNSTokenType)type;
/// Use this to track message delivery and analytics for messages, typically
/// when you receive a notification in <code>application:didReceiveRemoteNotification:</code>.
/// @param message The downstream message received by the application.
/// @return Information about the downstream message.
/// @available Available in SDK version 1.0 or later
- (enum AcquireIOPushMessageStatus)appDidReceiveMessageWithMessage:(NSDictionary * _Nonnull)message SWIFT_WARN_UNUSED_RESULT;
/// Set Visitor Info
/// Update configuration after init method calles.
/// * Set an visitor identifier for your visitor.
/// *
/// * This is part of additional visitor configuration. The user identifier will be passed through to the admin dashboard as “User ID” under customer info.
/// * @param visitorIdentifier A string to identify your visitor.
/// *
/// * @available Available in SDK version 1.0 or later
- (void)setVisitorIdentifierWithVisitorIdentifier:(NSString * _Nonnull)visitorIdentifier;
/// Set the name, phone and email of the app visitor.
/// *
/// * This is part of additional visitor configuration. If this is provided through the api, user will not be prompted to re-enter this information again.
/// * Pass nil values for both name and email to clear out old existing values.
/// *
/// * @param name The name of the user.
/// * @param phone The phone of the user.
/// * @param email The email address of the user.
/// * @param department The department of the user.
/// *
/// * @available Available in SDK version 1.0 or later
- (void)setVisitor:(NSString * _Nullable)name phone:(NSString * _Nullable)phone email:(NSString * _Nullable)email department:(NSString * _Nullable)department;
/// Set the name, phone , email and fields of the app visitor.
/// *
/// <ul>
/// <li>
/// This is part of additional visitor configuration. If this is provided through the api, user will not be prompted to re-enter this information again.
/// </li>
/// <li>
/// Pass nil values for both name and email to clear out old existing values.
/// </li>
/// <li>
/// </li>
/// <li>
/// @param name The name of the user.
/// </li>
/// <li>
/// @param phone The phone of the user.
/// </li>
/// <li>
/// @param email The email address of the user.
/// </li>
/// <li>
/// @param fields array of field. field dictionary format: {“n”:“field_key”,“v”:“field_value”}.
/// </li>
/// <li>
/// </li>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (void)setVisitorDetail:(NSString * _Nullable)name phone:(NSString * _Nullable)phone email:(NSString * _Nullable)email extraFields:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)fields;
/// Set the extra detail of the app visitor.
/// *
/// * This is part of additional visitor configuration. If this is provided through the api, user will not be prompted to re-enter this information again.
/// * Pass nil values for data to clear out old existing values.
/// *
/// * @param fields array of field. field dictionary format: {“l”:“FIELD_LABEL”,“n”:“FIELD_KEY”,“v”:“FIELD_VALUE”}.
/// *
/// * @available Available in SDK version 1.0 or later
- (void)setVisitorExtraField:(NSArray<NSDictionary<NSString *, id> *> * _Nonnull)fields;
/// If your visitor is identified (i.e., visitor has already logged in your app and you have a email address of visitor), call the following method before setAccount: an identified user.
/// @note This must be called before setAccount: takes place and must pass same email in setVisitor:.
/// parameter <code>visitorHash</code> A HMAC digest of the visitor email.
/// <ul>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (void)setVisitorHash:(NSString * _Nonnull)visitorHash;
/// <ul>
/// <li>
/// Get visitor Id, after acquire session Connected
/// </li>
/// <li>
/// </li>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (NSString * _Nonnull)getVisitorId SWIFT_WARN_UNUSED_RESULT;
/// AcquireIO session connection status
/// @return AcquireIOConnectionStatus Enum value.
/// <ul>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (enum AcquireIOConnectionStatus)getConnectionStatus SWIFT_WARN_UNUSED_RESULT;
/// If you have set visitor hash (HMAC digest) and visitor just logged out from account and need to manage user integrity with agent, call method logoutVisitor to remove all acquire data from app related to visitorHash.
/// @note This should be called when visit logged out.
/// <ul>
/// <li>
/// @available Available in SDK version 1.0 or later
/// </li>
/// </ul>
- (void)logoutVisitor;
- (void)onErrorWithError:(NSError * _Nonnull)error;
/// Total unread count of message(s).
/// @available Available in SDK version 1.0 or later
- (NSInteger)getUnreadCount SWIFT_WARN_UNUSED_RESULT;
/// Total available agent count
/// @available Available in SDK version 1.0 or later
- (NSInteger)getAvailableAgentCount SWIFT_WARN_UNUSED_RESULT;
@end
/// Status for the acquire.io app support notification environment
typedef SWIFT_ENUM(NSInteger, AcquireIOAPNSTokenType, open) {
/// Unknown token type.
AcquireIOAPNSTokenTypeUnknown = 0,
/// Sandbox token type.
AcquireIOAPNSTokenTypeSandbox = 1,
/// Production token type.
AcquireIOAPNSTokenTypeProd = 2,
};
/// Status for the agent.
typedef SWIFT_ENUM(NSInteger, AcquireIOAgentStatus, open) {
/// Online status for agent.
AcquireIOAgentStatusOnline = 0,
/// Offline status for agent.
AcquireIOAgentStatusOffline = 1,
/// Invisible status for agent.
AcquireIOAgentStatusInvisible = 2,
};
/// Status for the acquire.io app support call video/audio.
typedef SWIFT_ENUM(NSInteger, AcquireIOCallSupportStatus, open) {
AcquireIOCallSupportStatusNotConnected = 0,
AcquireIOCallSupportStatusDisconnected = 1,
AcquireIOCallSupportStatusConnecting = 2,
AcquireIOCallSupportStatusConnected = 3,
};
SWIFT_CLASS("_TtC12AcquireIOSDK15AcquireIOConfig")
@interface AcquireIOConfig : NSObject
/// Return an instance of AcquireIOConfig
/// Call any method of AcquireIOConfig instance you need to use shared <code>config</code> object. For example you want to setDict for setting
/// Objective-c : Config setting then you call as [AcquireIOConfig config] setDict:NSDictionary
/// Swift : Config setting then you call as AcquireIOConfig.config.setDict([String:Any])
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AcquireIOConfig * _Nonnull config;)
+ (AcquireIOConfig * _Nonnull)config SWIFT_WARN_UNUSED_RESULT;
/// This is init key for initilize AcquireIO chat with system button bottom right
/// Set image name should be put in Assets.xcassets of app.
/// Initialize dictionary key: ButtonImageName
@property (nonatomic, readonly, copy) NSString * _Nonnull buttonImageName;
/// Initilize AcquireIO chat with custom server, Websocket server ip or url to connect support socket server
/// This is optional, if not set default AcquireIO socket server will connect
/// Initialize dictionary key: WebSocketServer
@property (nonatomic, readonly, copy) NSString * _Nonnull webSocketServer;
/// if your added in ThemeOptions key in AcquireIOConfig
/// then set useDefaultTheme YES to load default theme setting instead of your
/// ThemeOptions theme setting
/// if not set key in config ThemeOptions in your AcquireIOConfig then always load theme default setting
/// Initialize dictionary key: UseDefaultTheme
@property (nonatomic, readonly) BOOL useDefaultTheme;
/// Default theme option like color before session start, after session start theme color will be change according to your acquire setting. See more to know about theme customization https://goo.gl/FvrtXf
/// Initialize dictionary key: ThemeOptions
@property (nonatomic, readonly, copy) NSDictionary<NSString *, id> * _Nonnull themeOptions;
/// Show avatar of agent or visitor in main chat messages screen and available support agents list
/// Initialize dictionary key: ShowAvatar
@property (nonatomic, readonly) BOOL showAvatar;
/// show list of threads.
/// Initialize dictionary key: ShowThreadList
@property (nonatomic, readonly) BOOL showThreadList;
/// Show chat button in right bottom on user’s screen and its just hide button but chat functionality will not affect by this option.
/// Initialize dictionary key: ShowChatButton
@property (nonatomic, readonly) BOOL showChatButton;
/// Show video button in top tab list on visitor’s main chat messages screen and its just hide button but video functionality will not affect by this option.
/// Initialize dictionary key: ShowVideoButton
@property (nonatomic, readonly) BOOL showVideoButton;
/// Show audio button in top tab list on visitor’s main chat messages screen and its just hide button but audio functionality will not affect by this option.
/// Initialize dictionary key: ShowAudioButton
@property (nonatomic, readonly) BOOL showAudioButton;
/// Show in-app notifiction when app state is active state.
/// Initialize dictionary key: ShowLocalNotificationInApp
@property (nonatomic, readonly) BOOL showLocalNotificationInApp;
/// Session will be auto connect to server and start and no need to invoke any additional method for start session. If you set @“SessionConnectAndStartAuto”: @NO then you must call [[AcquireIO support] startSession] method to start connection with server.
/// Initialize dictionary key: SessionConnectAndStartAuto
@property (nonatomic, readonly) BOOL sessionConnectAndStartAuto;
/// Forcefully remove video call disconnect button to prevent visitor to disconnect with agent.
/// This is optional, if not set default @NO
/// Initialize dictionary key: RemoveVideoCallDisconnectButton
@property (nonatomic, readonly) BOOL removeVideoCallDisconnectButton;
/// Forcefully remove audio call disconnect button to prevent visitor to disconnect with agent.
/// This is optional, if not set default @NO
/// Initialize dictionary key: RemoveAudioCallDisconnectButton
@property (nonatomic, readonly) BOOL removeAudioCallDisconnectButton;
/// if yes then user want be able to upload any attachment in chat.
/// This is optional, if not set default is @NO
@property (nonatomic, readonly) BOOL disableAttachment;
/// Forcefully remove audio call disconnect button to prevent visitor to disconnect with agent.
/// This is optional, if not set default @NO
/// Initialize dictionary key: removeCallViewResizeButton
@property (nonatomic, readonly) BOOL removeCallViewResizeButton;
/// <ul>
/// <li>
/// if yes/true then user want be able to start new chat with agents.
/// </li>
/// <li>
/// if No/false, User can start new chat with agnets.
/// </li>
/// <li>
/// This is optional, if not set default @NO/false
/// </li>
/// <li>
/// Initialize dictionary key: isHideNewChat
/// </li>
/// </ul>
@property (nonatomic, readonly) BOOL isHideNewChat;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
/// if your app require changes in UI and supported functions to reset default setting with simple dictionary
/// @param dict NSDictionary or [String: Any] of option for support view
/// Set dictionary key values format: setDict
- (void)setDict:(NSDictionary<NSString *, id> * _Nonnull)dict;
@end
/// Status for Socket
typedef SWIFT_ENUM(NSInteger, AcquireIOConnectionStatus, open) {
/// App support session connection status not connected.
AcquireIOConnectionStatusNotConnected = 0,
/// App support session connection status disconnected.
AcquireIOConnectionStatusDisconnected = 1,
/// App support session connection status connecting.
AcquireIOConnectionStatusConnecting = 2,
/// App support session connection status connected.
AcquireIOConnectionStatusConnected = 3,
/// App support session connection status started.
AcquireIOConnectionStatusSessionStarted = 4,
};
typedef SWIFT_ENUM(NSInteger, AcquireIOInteractionEventType, open) {
AcquireIOInteractionEventTypeAudioCallStarted = 0,
AcquireIOInteractionEventTypeVideoCallStarted = 1,
AcquireIOInteractionEventTypeAudioCallAnswered = 2,
AcquireIOInteractionEventTypeVideoCallAnswered = 3,
AcquireIOInteractionEventTypeCallDeclined = 4,
AcquireIOInteractionEventTypeCallAutoDeclined = 5,
AcquireIOInteractionEventTypeCallerViewMinimize = 6,
AcquireIOInteractionEventTypeCallerViewMaximize = 7,
AcquireIOInteractionEventTypeCallerViewCameraSwitchToFront = 8,
AcquireIOInteractionEventTypeCallerViewCameraSwitchToBack = 9,
AcquireIOInteractionEventTypeCallSpeakerOn = 10,
AcquireIOInteractionEventTypeCallSpeakerOff = 11,
AcquireIOInteractionEventTypeCallMute = 12,
AcquireIOInteractionEventTypeCallUnmute = 13,
AcquireIOInteractionEventTypeCallVideoOn = 14,
AcquireIOInteractionEventTypeCallVideoOff = 15,
AcquireIOInteractionEventTypeCallDisconnected = 16,
AcquireIOInteractionEventTypeConversationStart = 17,
AcquireIOInteractionEventTypeConversationEnd = 18,
AcquireIOInteractionEventTypeConversationFeedbackSubmit = 19,
};
/// Status for the acquire.io app support notification message
typedef SWIFT_ENUM(NSInteger, AcquireIOPushMessageStatus, open) {
/// Unknown status.
AcquireIOPushMessageStatusUnknown = 0,
/// New downstream message received by the app.
AcquireIOPushMessageStatusNew = 1,
};
@interface UIViewController (SWIFT_EXTENSION(AcquireIOSDK))
- (void)awakeFromNib;
@end
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#endif
#endif
| 42.017257 | 255 | 0.779317 | [
"object"
] |
d27a1f2280ef6d50f127fcf84dd1640f6f88b816 | 3,563 | h | C | dev/integration_tests/ios_add2app/Pods/Headers/Public/EarlGrey/EarlGrey/GREYScreenshotUtil.h | ActionVenturesAB/flutter | ddee4f716cf8fc07ee179671d25c66883a0876ea | [
"BSD-3-Clause"
] | 3 | 2019-03-24T14:38:15.000Z | 2019-03-24T14:38:35.000Z | dev/integration_tests/ios_add2app/Pods/Headers/Public/EarlGrey/EarlGrey/GREYScreenshotUtil.h | atlas1119/flutter | 5099701f88f49ec12ebca676d8e61149917bde9c | [
"BSD-3-Clause"
] | 1 | 2019-08-26T01:39:09.000Z | 2019-08-26T01:39:09.000Z | dev/integration_tests/ios_add2app/Pods/Headers/Public/EarlGrey/EarlGrey/GREYScreenshotUtil.h | atlas1119/flutter | 5099701f88f49ec12ebca676d8e61149917bde9c | [
"BSD-3-Clause"
] | 2 | 2020-12-05T06:02:29.000Z | 2020-12-05T06:02:39.000Z | //
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <UIKit/UIKit.h>
#import <EarlGrey/GREYDefines.h>
NS_ASSUME_NONNULL_BEGIN
/**
* Provides interfaces for taking screenshots of the entire screen and UI elements of the App.
*/
@interface GREYScreenshotUtil : NSObject
/**
* Draws the application's main screen using the bitmap graphics context specified by the @c
* bitmapContextRef reference, centering it if the context size is different than the screen size.
* The provided reference must point to a CGBitmapContext. When @c afterUpdates is set to @c YES,
* this method waits for the screen to draw pending changes before taking a screenshot, otherwise
* the screenshot contains the current contents of the screen.
*
* @param bitmapContextRef Target bitmap context for rendering.
* @param afterUpdates Boolean indicating whether to render before (@c NO) or after (@c YES)
* screen updates.
*/
+ (void)drawScreenInContext:(CGContextRef)bitmapContextRef afterScreenUpdates:(BOOL)afterUpdates;
/**
* @return An image of the current app's screen frame buffer. This method waits for any pending
* screen updates to go through before taking a screenshot. Returned image orientation is
* same as the current interface orientation.
*/
+ (UIImage *)takeScreenshot;
/**
* @return The App Store and iTunes Connect friendly image of the current screen frame buffer.
*/
+ (UIImage *)takeScreenshotForAppStore;
/**
* @return A snapshot of the provided @c element. @c element must be an instance of @c UIView or
* an accessibility element.
*/
+ (UIImage *)snapshotElement:(id)element;
/**
* Saves the provided @c image as a PNG to the given @c filename under the given @c directoryPath.
* If the given directory path doesn't exist, it will be created.
*
* @param image The source image.
* @param filename The target file name.
* @param directoryPath The path to the directory where the image must be saved.
*
* @return The complete filepath and name of the saved image or @c nil on failure.
*/
+ (NSString *)saveImageAsPNG:(UIImage *)image
toFile:(NSString *)filename
inDirectory:(NSString *)directoryPath;
@end
/**
* Returns a new buffer that contains XRGB pixels for the provided @c imageRef i.e. the alpha
* channel is removed. If @c outBitmapContext is not @c NULL, it is set to the bitmap context of
* the returned buffer and caller must call CGContextRelease on it. Each pixel in returned buffer
* occupies 4 bytes and the buffer must be free()'d by the caller.
*
* @param imageRef The source image.
* @param[out] outBmpCtx Optional bitmap context that holds the returned buffer.
*
* @return A new buffer that contains XRGB pixels for the provided image.
*/
GREY_EXPORT unsigned char *_Nullable grey_createImagePixelDataFromCGImageRef(
CGImageRef imageRef, CGContextRef _Nullable *_Nullable outBmpCtx);
NS_ASSUME_NONNULL_END
| 39.588889 | 99 | 0.726354 | [
"render"
] |
cfa45bb21e56e6af85a89b18554864b5ff596247 | 420 | h | C | Src/Evora/GodotUI/Floor.h | medovina/Evora | 95e41e7b2d5c408d515a01a5649ddfaa211e9349 | [
"Apache-2.0"
] | 1 | 2020-11-25T20:53:36.000Z | 2020-11-25T20:53:36.000Z | Src/Evora/GodotUI/Floor.h | medovina/Evora | 95e41e7b2d5c408d515a01a5649ddfaa211e9349 | [
"Apache-2.0"
] | 16 | 2020-03-06T09:11:55.000Z | 2020-07-24T10:57:41.000Z | Src/Evora/GodotUI/Floor.h | medovina/Evora | 95e41e7b2d5c408d515a01a5649ddfaa211e9349 | [
"Apache-2.0"
] | 1 | 2020-01-18T13:11:38.000Z | 2020-01-18T13:11:38.000Z | #pragma once
#include <core/Godot.hpp>
#include <Control.hpp>
#include <vector>
#include <Node2D.hpp>
namespace godot
{
class Floor :public Node2D
{
GODOT_CLASS(Floor, Node2D)
public:
int m_tile_count;
static void _register_methods();
void _init();
bool is_mouse_over();
void set_highlight(bool cond);
void tile_moved(Vector2 position, int color);
std::vector<Vector2> get_n_positions(int n);
};
}
| 19.090909 | 47 | 0.72381 | [
"vector"
] |
cfa474491509595a13417374f6fa5ea8975f47b2 | 5,216 | h | C | core/io/resource_format_xml.h | abhishekkumar-/godot | e086bccd63e64b8d3bd2b6b5ce000ef8abd71584 | [
"MIT"
] | 1 | 2020-07-12T20:35:19.000Z | 2020-07-12T20:35:19.000Z | core/io/resource_format_xml.h | abhishekkumar-/godot | e086bccd63e64b8d3bd2b6b5ce000ef8abd71584 | [
"MIT"
] | null | null | null | core/io/resource_format_xml.h | abhishekkumar-/godot | e086bccd63e64b8d3bd2b6b5ce000ef8abd71584 | [
"MIT"
] | null | null | null | /*************************************************************************/
/* resource_format_xml.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* 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 RESOURCE_FORMAT_XML_H
#define RESOURCE_FORMAT_XML_H
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/file_access.h"
class ResourceInteractiveLoaderXML : public ResourceInteractiveLoader {
String local_path;
String res_path;
FileAccess *f;
struct Tag {
String name;
HashMap<String,String> args;
};
_FORCE_INLINE_ Error _parse_array_element(Vector<char> &buff,bool p_number_only,FileAccess *f,bool *end);
List<StringName> ext_resources;
int resources_total;
int resource_current;
String resource_type;
mutable int lines;
uint8_t get_char() const;
int get_current_line() const;
friend class ResourceFormatLoaderXML;
List<Tag> tag_stack;
List<RES> resource_cache;
Tag* parse_tag(bool* r_exit=NULL,bool p_printerr=true);
Error close_tag(const String& p_name);
_FORCE_INLINE_ void unquote(String& p_str);
Error goto_end_of_tag();
Error parse_property_data(String &r_data);
Error parse_property(Variant& r_v, String &r_name);
Error error;
RES resource;
public:
virtual void set_local_path(const String& p_local_path);
virtual Ref<Resource> get_resource();
virtual Error poll();
virtual int get_stage() const;
virtual int get_stage_count() const;
void open(FileAccess *p_f);
String recognize(FileAccess *p_f);
void get_dependencies(FileAccess *p_f,List<String> *p_dependencies);
~ResourceInteractiveLoaderXML();
};
class ResourceFormatLoaderXML : public ResourceFormatLoader {
public:
virtual Ref<ResourceInteractiveLoader> load_interactive(const String &p_path);
virtual void get_recognized_extensions_for_type(const String& p_type,List<String> *p_extensions) const;
virtual void get_recognized_extensions(List<String> *p_extensions) const;
virtual bool handles_type(const String& p_type) const;
virtual String get_resource_type(const String &p_path) const;
virtual void get_dependencies(const String& p_path,List<String> *p_dependencies);
};
////////////////////////////////////////////////////////////////////////////////////////////
class ResourceFormatSaverXMLInstance {
String local_path;
bool relative_paths;
bool bundle_resources;
bool skip_editor;
FileAccess *f;
int depth;
Map<RES,int> resource_map;
List<RES> saved_resources;
Set<RES> external_resources;
void enter_tag(const char* p_tag,const String& p_args=String());
void exit_tag(const char* p_tag);
void _find_resources(const Variant& p_variant,bool p_main=false);
void write_property(const String& p_name,const Variant& p_property,bool *r_ok=NULL);
void escape(String& p_str);
void write_tabs(int p_diff=0);
void write_string(String p_str,bool p_escape=true);
public:
Error save(const String &p_path,const RES& p_resource,uint32_t p_flags=0);
};
class ResourceFormatSaverXML : public ResourceFormatSaver {
public:
virtual Error save(const String &p_path,const RES& p_resource,uint32_t p_flags=0);
virtual bool recognize(const RES& p_resource) const;
virtual void get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const;
};
#endif // RESOURCE_FORMAT_XML_H
| 32.805031 | 106 | 0.63056 | [
"vector"
] |
cfa49273b24b3d51885366926d222e5cada3c3b1 | 4,487 | h | C | cxx/src/libmxp/include/mxp/message/eject_rsp.h | MoysheBenRabi/setp | 7619f0bae457e14e2fb41e58bfe517019628c5de | [
"Apache-2.0"
] | 1 | 2021-07-13T12:22:22.000Z | 2021-07-13T12:22:22.000Z | cxx/src/libmxp/include/mxp/message/eject_rsp.h | MoysheBenRabi/setp | 7619f0bae457e14e2fb41e58bfe517019628c5de | [
"Apache-2.0"
] | 1 | 2021-01-04T21:53:56.000Z | 2021-01-04T21:59:36.000Z | cxx/src/libmxp/include/mxp/message/eject_rsp.h | MoysheBenRabi/setp | 7619f0bae457e14e2fb41e58bfe517019628c5de | [
"Apache-2.0"
] | 1 | 2021-09-19T16:18:54.000Z | 2021-09-19T16:18:54.000Z | #ifndef MXP_MESSAGE_EJECT_RSP
#define MXP_MESSAGE_EJECT_RSP
/* Copyright (c) 2009-2010 Tyrell Corporation & Moyshe Ben Rabi.
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is an implementation of the Metaverse eXchange Protocol.
The Initial Developer of the Original Code is Akos Maroy and Moyshe Ben Rabi.
All Rights Reserved.
Contributor(s): Akos Maroy and Moyshe Ben Rabi.
Alternatively, the contents of this file may be used under the terms
of the Affero General Public License (the "AGPL"), in which case the
provisions of the AGPL are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the AGPL and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the AGPL. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the AGPL.
*/
#include <boost/type.hpp>
#include "mxp/serialization/serialize.h"
#include "mxp/serialization/deserialize.h"
#include "mxp/message/message.h"
#include "response_fragment.h"
namespace mxp {
namespace message {
using namespace mxp;
/*! A Eject request message, as specified by MXP.
*/
class eject_rsp : public message {
public:
/*! Eject response fragment */
response_fragment response_header;
/*! Constructor. */
eject_rsp() : message(EJECT_RSP) {}
/*! Virtual destructor. */
virtual ~eject_rsp() {}
/*! Copy constructor.
\param ect_rsp the object to base this copy on.
*/
eject_rsp(const eject_rsp & ect_rsp) : message(EJECT_RSP) {
response_header = ect_rsp.response_header;
}
/*! Assignment operator.
\param ect_rsp the object to base this object on.
\return a reference to this object, after the assignemt has been made.
*/
eject_rsp& operator=(const eject_rsp & ect_rsp) {
if (this == &ect_rsp) {
return *this;
}
response_header = ect_rsp.response_header;
return *this;
}
/*! equals.
\param other the object to equal with this one.
\return true if objects is equal and false afterwards.
*/
virtual bool equals(const message & other) const {
return (this == &other) ||
((get_type() == other.get_type()) &&
(response_header == ((eject_rsp &) other).response_header));
}
virtual unsigned int size() const {
return response_header.size();
}
/*! Serialize this message.
\param writer the byte writer to serialize this message into, as a
sequence of bytes values added to the iterator.
\return the number of advances made on the iterator during serialization
*/
virtual unsigned int
serialize(serialization::byte_writer_base & writer) const {
return response_header.serialize(writer);
}
/*! De-serialize this message. The contents of this message will be filled
with the de-serialized values read from the supplied byte reader.
\param reader the byte reader to serialize this message from by reading
a sequence of bytes from it
\param len the maximum number of reads to make on the supplied
reader
*/
virtual void
deserialize(serialization::byte_reader_base & reader, unsigned int len) {
response_header.deserialize(reader,len);
}
};
/*! Write a human-readable representation of a message to an output stream.
\param os the output stream to write to.
\param ect_rsp the message to write.
\return the output stream after the message has been written to it.
*/
inline
std::ostream& operator<<(std::ostream &os, const eject_rsp & ect_rsp) {
os << "eject_rsp[type: " << ect_rsp.get_type();
os << ",response_header=";
os << ect_rsp.response_header;
os << "]";
return os;
}
}
}
#endif
| 31.822695 | 80 | 0.683976 | [
"object"
] |
cfaa927bdcf8d59f6af2933d5996df89f7149884 | 7,136 | h | C | cpp/src/plasma/plasma.h | ueshin/apache-arrow | 0a2cf3ac164d18d1cbf08470be51f336e35073a7 | [
"Apache-2.0",
"CC0-1.0"
] | 32 | 2016-05-13T07:11:26.000Z | 2022-02-25T07:31:16.000Z | cpp/src/plasma/plasma.h | ueshin/apache-arrow | 0a2cf3ac164d18d1cbf08470be51f336e35073a7 | [
"Apache-2.0",
"CC0-1.0"
] | 8 | 2017-07-18T16:43:43.000Z | 2020-10-27T13:45:12.000Z | cpp/src/plasma/plasma.h | ueshin/apache-arrow | 0a2cf3ac164d18d1cbf08470be51f336e35073a7 | [
"Apache-2.0",
"CC0-1.0"
] | 20 | 2017-07-17T18:55:59.000Z | 2021-07-21T14:56:25.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 PLASMA_PLASMA_H
#define PLASMA_PLASMA_H
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> // pid_t
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include "plasma/compat.h"
#include "arrow/status.h"
#include "arrow/util/logging.h"
#include "plasma/common.h"
#include "plasma/common_generated.h"
#ifdef PLASMA_GPU
#include "arrow/gpu/cuda_api.h"
using arrow::gpu::CudaIpcMemHandle;
#endif
namespace plasma {
#define HANDLE_SIGPIPE(s, fd_) \
do { \
Status _s = (s); \
if (!_s.ok()) { \
if (errno == EPIPE || errno == EBADF || errno == ECONNRESET) { \
ARROW_LOG(WARNING) \
<< "Received SIGPIPE, BAD FILE DESCRIPTOR, or ECONNRESET when " \
"sending a message to client on fd " \
<< fd_ \
<< ". " \
"The client on the other end may have hung up."; \
} else { \
return _s; \
} \
} \
} while (0);
/// Allocation granularity used in plasma for object allocation.
#define BLOCK_SIZE 64
struct Client;
/// Mapping from object IDs to type and status of the request.
typedef std::unordered_map<ObjectID, ObjectRequest, UniqueIDHasher> ObjectRequestMap;
// TODO(pcm): Replace this by the flatbuffers message PlasmaObjectSpec.
struct PlasmaObject {
#ifdef PLASMA_GPU
// IPC handle for Cuda.
std::shared_ptr<CudaIpcMemHandle> ipc_handle;
#endif
/// The file descriptor of the memory mapped file in the store. It is used as
/// a unique identifier of the file in the client to look up the corresponding
/// file descriptor on the client's side.
int store_fd;
/// The offset in bytes in the memory mapped file of the data.
ptrdiff_t data_offset;
/// The offset in bytes in the memory mapped file of the metadata.
ptrdiff_t metadata_offset;
/// The size in bytes of the data.
int64_t data_size;
/// The size in bytes of the metadata.
int64_t metadata_size;
/// Device number object is on.
int device_num;
};
enum object_state {
/// Object was created but not sealed in the local Plasma Store.
PLASMA_CREATED = 1,
/// Object is sealed and stored in the local Plasma Store.
PLASMA_SEALED
};
enum object_status {
/// The object was not found.
OBJECT_NOT_FOUND = 0,
/// The object was found.
OBJECT_FOUND = 1
};
/// This type is used by the Plasma store. It is here because it is exposed to
/// the eviction policy.
struct ObjectTableEntry {
/// Object id of this object.
ObjectID object_id;
/// Object info like size, creation time and owner.
ObjectInfoT info;
/// Memory mapped file containing the object.
int fd;
/// Device number.
int device_num;
/// Size of the underlying map.
int64_t map_size;
/// Offset from the base of the mmap.
ptrdiff_t offset;
/// Pointer to the object data. Needed to free the object.
uint8_t* pointer;
#ifdef PLASMA_GPU
/// IPC GPU handle to share with clients.
std::shared_ptr<CudaIpcMemHandle> ipc_handle;
#endif
/// Set of clients currently using this object.
std::unordered_set<Client*> clients;
/// The state of the object, e.g., whether it is open or sealed.
object_state state;
/// The digest of the object. Used to see if two objects are the same.
unsigned char digest[kDigestSize];
};
/// The plasma store information that is exposed to the eviction policy.
struct PlasmaStoreInfo {
/// Objects that are in the Plasma store.
std::unordered_map<ObjectID, std::unique_ptr<ObjectTableEntry>, UniqueIDHasher> objects;
/// The amount of memory (in bytes) that we allow to be allocated in the
/// store.
int64_t memory_capacity;
/// Boolean flag indicating whether to start the object store with hugepages
/// support enabled. Huge pages are substantially larger than normal memory
/// pages (e.g. 2MB or 1GB instead of 4KB) and using them can reduce
/// bookkeeping overhead from the OS.
bool hugepages_enabled;
/// A (platform-dependent) directory where to create the memory-backed file.
std::string directory;
};
/// Get an entry from the object table and return NULL if the object_id
/// is not present.
///
/// @param store_info The PlasmaStoreInfo that contains the object table.
/// @param object_id The object_id of the entry we are looking for.
/// @return The entry associated with the object_id or NULL if the object_id
/// is not present.
ObjectTableEntry* get_object_table_entry(PlasmaStoreInfo* store_info,
const ObjectID& object_id);
/// Print a warning if the status is less than zero. This should be used to check
/// the success of messages sent to plasma clients. We print a warning instead of
/// failing because the plasma clients are allowed to die. This is used to handle
/// situations where the store writes to a client file descriptor, and the client
/// may already have disconnected. If we have processed the disconnection and
/// closed the file descriptor, we should get a BAD FILE DESCRIPTOR error. If we
/// have not, then we should get a SIGPIPE. If we write to a TCP socket that
/// isn't connected yet, then we should get an ECONNRESET.
///
/// @param status The status to check. If it is less less than zero, we will
/// print a warning.
/// @param client_sock The client socket. This is just used to print some extra
/// information.
/// @return The errno set.
int warn_if_sigpipe(int status, int client_sock);
uint8_t* create_object_info_buffer(ObjectInfoT* object_info);
} // namespace plasma
#endif // PLASMA_PLASMA_H
| 38.160428 | 90 | 0.642937 | [
"object"
] |
cfaf59e70e11512390b4f006a41db3ec291b50a4 | 7,509 | h | C | src/third_party/wiredtiger/src/include/btree.h | hobinyoon/mongo | f1b767ff814dbe26fc68f6fdc42716542f0909ee | [
"Apache-2.0"
] | 1 | 2020-01-01T06:16:58.000Z | 2020-01-01T06:16:58.000Z | src/third_party/wiredtiger/src/include/btree.h | Man1029/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/src/include/btree.h | Man1029/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | /*-
* Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
* See the file LICENSE for redistribution information.
*/
/*
* Supported btree formats: the "current" version is the maximum supported
* major/minor versions.
*/
#define WT_BTREE_MAJOR_VERSION_MIN 1 /* Oldest version supported */
#define WT_BTREE_MINOR_VERSION_MIN 1
#define WT_BTREE_MAJOR_VERSION_MAX 1 /* Newest version supported */
#define WT_BTREE_MINOR_VERSION_MAX 1
/*
* The maximum btree leaf and internal page size is 512MB (2^29). The limit
* is enforced in software, it could be larger, specifically, the underlying
* default block manager can support 4GB (2^32). Currently, the maximum page
* size must accommodate our dependence on the maximum page size fitting into
* a number of bits less than 32; see the row-store page key-lookup functions
* for the magic.
*/
#define WT_BTREE_PAGE_SIZE_MAX (512 * WT_MEGABYTE)
/*
* The length of variable-length column-store values and row-store keys/values
* are stored in a 4B type, so the largest theoretical key/value item is 4GB.
* However, in the WT_UPDATE structure we use the UINT32_MAX size as a "deleted"
* flag, and second, the size of an overflow object is constrained by what an
* underlying block manager can actually write. (For example, in the default
* block manager, writing an overflow item includes the underlying block's page
* header and block manager specific structure, aligned to an allocation-sized
* unit). The btree engine limits the size of a single object to (4GB - 1KB);
* that gives us additional bytes if we ever want to store a structure length
* plus the object size in 4B, or if we need additional flag values. Attempts
* to store large key/value items in the tree trigger an immediate check to the
* block manager, to make sure it can write the item. Storing 4GB objects in a
* btree borders on clinical insanity, anyway.
*
* Record numbers are stored in 64-bit unsigned integers, meaning the largest
* record number is "really, really big".
*/
#define WT_BTREE_MAX_OBJECT_SIZE (UINT32_MAX - 1024)
/*
* A location in a file is a variable-length cookie, but it has a maximum size
* so it's easy to create temporary space in which to store them. (Locations
* can't be much larger than this anyway, they must fit onto the minimum size
* page because a reference to an overflow page is itself a location.)
*/
#define WT_BTREE_MAX_ADDR_COOKIE 255 /* Maximum address cookie */
/* Evict pages if we see this many consecutive deleted records. */
#define WT_BTREE_DELETE_THRESHOLD 1000
/*
* WT_BTREE --
* A btree handle.
*/
struct __wt_btree {
WT_DATA_HANDLE *dhandle;
WT_CKPT *ckpt; /* Checkpoint information */
enum { BTREE_COL_FIX=1, /* Fixed-length column store */
BTREE_COL_VAR=2, /* Variable-length column store */
BTREE_ROW=3 /* Row-store */
} type; /* Type */
const char *key_format; /* Key format */
const char *value_format; /* Value format */
uint8_t bitcnt; /* Fixed-length field size in bits */
WT_COLLATOR *collator; /* Row-store comparator */
int collator_owned; /* The collator needs to be freed */
uint32_t id; /* File ID, for logging */
uint32_t key_gap; /* Row-store prefix key gap */
uint32_t allocsize; /* Allocation size */
uint32_t maxintlpage; /* Internal page max size */
uint32_t maxintlkey; /* Internal page max key size */
uint32_t maxleafpage; /* Leaf page max size */
uint32_t maxleafkey; /* Leaf page max key size */
uint32_t maxleafvalue; /* Leaf page max value size */
uint64_t maxmempage; /* In-memory page max size */
uint64_t splitmempage; /* In-memory split trigger size */
void *huffman_key; /* Key huffman encoding */
void *huffman_value; /* Value huffman encoding */
enum { CKSUM_ON=1, /* On */
CKSUM_OFF=2, /* Off */
CKSUM_UNCOMPRESSED=3 /* Uncompressed blocks only */
} checksum; /* Checksum configuration */
/*
* Reconciliation...
*/
u_int dictionary; /* Dictionary slots */
bool internal_key_truncate; /* Internal key truncate */
int maximum_depth; /* Maximum tree depth */
bool prefix_compression; /* Prefix compression */
u_int prefix_compression_min; /* Prefix compression min */
#define WT_SPLIT_DEEPEN_MIN_CHILD_DEF 10000
u_int split_deepen_min_child; /* Minimum entries to deepen tree */
#define WT_SPLIT_DEEPEN_PER_CHILD_DEF 100
u_int split_deepen_per_child; /* Entries per child when deepened */
int split_pct; /* Split page percent */
WT_COMPRESSOR *compressor; /* Page compressor */
WT_KEYED_ENCRYPTOR *kencryptor; /* Page encryptor */
WT_RWLOCK *ovfl_lock; /* Overflow lock */
uint64_t last_recno; /* Column-store last record number */
WT_REF root; /* Root page reference */
int modified; /* If the tree ever modified */
bool bulk_load_ok; /* Bulk-load is a possibility */
WT_BM *bm; /* Block manager reference */
u_int block_header; /* WT_PAGE_HEADER_BYTE_SIZE */
uint64_t checkpoint_gen; /* Checkpoint generation */
bool include_checkpoint_txn;/* ID checks include checkpoint */
uint64_t rec_max_txn; /* Maximum txn seen (clean trees) */
uint64_t write_gen; /* Write generation */
uint64_t bytes_inmem; /* Cache bytes in memory. */
uint64_t bytes_dirty_leaf; /* Bytes in dirty leaf pages. */
WT_REF *evict_ref; /* Eviction thread's location */
uint64_t evict_priority; /* Relative priority of cached pages */
u_int evict_walk_period; /* Skip this many LRU walks */
u_int evict_walk_saved; /* Saved walk skips for checkpoints */
u_int evict_walk_skips; /* Number of walks skipped */
u_int evict_disabled; /* Eviction disabled count */
volatile uint32_t evict_busy; /* Count of threads in eviction */
bool evict_walk_reverse; /* Walk direction */
enum {
WT_CKPT_OFF, WT_CKPT_PREPARE, WT_CKPT_RUNNING
} checkpointing; /* Checkpoint in progress */
/*
* We flush pages from the tree (in order to make checkpoint faster),
* without a high-level lock. To avoid multiple threads flushing at
* the same time, lock the tree.
*/
WT_SPINLOCK flush_lock; /* Lock to flush the tree's pages */
/* Flags values up to 0xff are reserved for WT_DHANDLE_* */
#define WT_BTREE_BULK 0x00100 /* Bulk-load handle */
#define WT_BTREE_IN_MEMORY 0x00200 /* Cache-resident object */
#define WT_BTREE_LOOKASIDE 0x00400 /* Look-aside table */
#define WT_BTREE_NO_CHECKPOINT 0x00800 /* Disable checkpoints */
#define WT_BTREE_NO_EVICTION 0x01000 /* Disable eviction */
#define WT_BTREE_NO_LOGGING 0x02000 /* Disable logging */
#define WT_BTREE_NO_RECONCILE 0x04000 /* Allow splits, even with no evict */
#define WT_BTREE_REBALANCE 0x08000 /* Handle is for rebalance */
#define WT_BTREE_SALVAGE 0x10000 /* Handle is for salvage */
#define WT_BTREE_SKIP_CKPT 0x20000 /* Handle skipped checkpoint */
#define WT_BTREE_UPGRADE 0x40000 /* Handle is for upgrade */
#define WT_BTREE_VERIFY 0x80000 /* Handle is for verify */
uint32_t flags;
};
/* Flags that make a btree handle special (not for normal use). */
#define WT_BTREE_SPECIAL_FLAGS \
(WT_BTREE_BULK | WT_BTREE_REBALANCE | \
WT_BTREE_SALVAGE | WT_BTREE_UPGRADE | WT_BTREE_VERIFY)
/*
* WT_SALVAGE_COOKIE --
* Encapsulation of salvage information for reconciliation.
*/
struct __wt_salvage_cookie {
uint64_t missing; /* Initial items to create */
uint64_t skip; /* Initial items to skip */
uint64_t take; /* Items to take */
bool done; /* Ignore the rest */
};
| 39.941489 | 80 | 0.728326 | [
"object"
] |
cfb265d1f2a9e0e2263a9b0f178769aaccbbd7eb | 6,136 | h | C | Soomla/CCSoomlaLevelUp.h | markpetersen01/Cocos2D-game | 93e12850f3ecdfbda9c1ce60792b8e7b1c2bd4b8 | [
"Apache-2.0"
] | 14 | 2015-01-29T10:39:08.000Z | 2019-05-09T09:30:58.000Z | Soomla/CCSoomlaLevelUp.h | markpetersen01/Cocos2D-game | 93e12850f3ecdfbda9c1ce60792b8e7b1c2bd4b8 | [
"Apache-2.0"
] | 10 | 2015-02-09T07:48:33.000Z | 2017-03-17T10:24:20.000Z | Soomla/CCSoomlaLevelUp.h | markpetersen01/Cocos2D-game | 93e12850f3ecdfbda9c1ce60792b8e7b1c2bd4b8 | [
"Apache-2.0"
] | 13 | 2015-02-09T01:28:08.000Z | 2019-09-05T07:31:12.000Z | /*
Copyright (C) 2012-2014 Soomla Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Copyright (C) 2012-2014 Soomla Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef __CCSoomlaLevelUp_H_
#define __CCSoomlaLevelUp_H_
#include "cocos2d.h"
#include "CCGate.h"
#include "CCMission.h"
namespace soomla {
class CCWorld;
class CCReward;
class CCScore;
class CCGate;
class CCMission;
class CCLevel;
/**
@class CCSoomlaLevelUp
@brief This is the top level container for the cocos2dx-levelup model and
definitions. It stores the configurations of the game's world-hierarchy and
provides lookup functions for levelup model elements.
*/
class CCSoomlaLevelUp: public cocos2d::Ref {
private:
// Initial `World` to begin the game.
CCWorld *mInitialWorld;
// Potential rewards of the `InitialWorld`.
cocos2d::__Dictionary *mRewards;
CCSoomlaLevelUp(): mInitialWorld(NULL), mRewards(NULL) {
}
public:
// The instance of `LevelUp` for this game.
static CCSoomlaLevelUp *getInstance();
/**
Converts this instance of `LevelUp` to a `Dictionary`.
*/
virtual cocos2d::__Dictionary *toDictionary();
virtual ~CCSoomlaLevelUp();
/**
Initializes the specified `InitialWorld` and rewards.
@param initialWorld Initial `World` to begin the game.
@param rewards Rewards for the initial `World`.
*/
void initialize(CCWorld *initialWorld, cocos2d::__Array *rewards = NULL);
/**
Retrieves the reward with the given ID.
@param rewardId ID of the `Reward` to be fetched.
@return The reward that was fetched.
*/
CCReward *getReward(char const *rewardId);
/**
Retrieves the `Score` with the given score ID.
@param scoreId ID of the `Score` to be fetched.
@return The score.
*/
CCScore *getScore(char const *scoreId);
/**
Retrieves the `World` with the given world ID.
@param worldId ID of the `World` to be fetched.
@return The world.
*/
CCWorld *getWorld(char const *worldId);
/**
Retrieves the `Level` with the given level ID.
@param levelId ID of the `Level` to be fetched.
@return The world.
*/
CCLevel *getLevel(char const *levelId);
/**
Retrieves the `Gate` with the given ID.
@param gateId ID of the `Gate` to be fetched.</param>
@return The gate.
*/
CCGate *getGate(char const *gateId);
/**
Retrieves the `Mission` with the given ID.
@param missionId ID of the `Mission` to be fetched.
@return The mission.
*/
CCMission *getMission(char const *missionId);
/**
Counts all the `Level`s in all `World`s and inner `World`s
starting from the `InitialWorld`.
@return The number of levels in all worlds and their inner worlds.
*/
int getLevelCount();
/**
Counts all the `Level`s in all `World`s and inner `World`s
starting from the given `World`.
@param world The world to examine.
@return The number of levels in the given world and its inner worlds.
*/
int getLevelCountInWorld(CCWorld *world);
/**
Counts all `World`s and their inner `World`s with or without their
`Level`s according to the given `withLevels`.
@param withLevels Indicates whether to count `Level`s also.
@return The number of `World`s, and optionally their inner `Level`s.
*/
int getWorldCount(bool withLevels);
/**
Counts all completed `Level`s.
@return The number of completed `Level`s and their inner completed
`Level`s.
*/
int getCompletedLevelCount();
/**
Counts the number of completed `World`s.
@return The number of completed `World`s and their inner completed
`World`s.
*/
int getCompletedWorldCount();
/**
* Clears all current progress of LevelUp.
*/
virtual void clearCurrentState();
private:
CCWorld *fetchWorld(char const *worldId, cocos2d::__Dictionary *worlds);
CCScore *fetchScoreFromWorlds(char const *scoreId, cocos2d::__Dictionary *worlds);
CCGate *fetchGate(char const *gateId, cocos2d::__Dictionary *worlds);
CCGate *fetchGateFromMissions(char const *gateId, cocos2d::__Array *missions);
CCGate *fetchGateFromGate(char const *gateId, CCGate *targetGate);
int getRecursiveCount(CCWorld *world, bool (*isAccepted)(CCWorld *));
CCMission *fetchMission(char const *missionId, cocos2d::__Dictionary *worlds);
CCMission *fetchMission(char const *missionId, cocos2d::__Array *missions);
CCMission *fetchMission(char const *missionId, CCMission *targetMission);
void save();
};
}
#endif //__CCSoomlaLevelUp_H_
| 31.306122 | 90 | 0.640319 | [
"model"
] |
cfb4691ba6203062a26bab716b47e2811582947b | 4,490 | h | C | src/blockchain_utilities/fake_core.h | BixBite-project/bixbite | b57ab624ab4747ef9b32da2e7cfe97199f4e65c3 | [
"BSD-3-Clause"
] | 8 | 2018-04-10T20:35:07.000Z | 2020-02-13T17:08:17.000Z | src/blockchain_utilities/fake_core.h | BixBite-project/bixbite | b57ab624ab4747ef9b32da2e7cfe97199f4e65c3 | [
"BSD-3-Clause"
] | 5 | 2018-04-10T19:33:50.000Z | 2019-01-23T17:03:00.000Z | src/blockchain_utilities/fake_core.h | BixBite-project/bixbite | b57ab624ab4747ef9b32da2e7cfe97199f4e65c3 | [
"BSD-3-Clause"
] | 7 | 2018-05-10T16:32:49.000Z | 2019-01-02T10:16:17.000Z | // Copyright (c) 2014-2016, The Monero Project
// Copyright (c) 2017-2018, The Bixbite Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. 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.
#pragma once
#include <boost/filesystem.hpp>
#include "cryptonote_core/blockchain.h" // BlockchainDB
#include "cryptonote_core/tx_pool.h"
#include "blockchain_db/blockchain_db.h"
#include "blockchain_db/lmdb/db_lmdb.h"
#if defined(BERKELEY_DB)
#include "blockchain_db/berkeleydb/db_bdb.h"
#endif
using namespace cryptonote;
namespace
{
// NOTE: These values should match blockchain.cpp
// TODO: Refactor
const uint64_t mainnet_hard_fork_version_1_till = (uint64_t)-1;
const uint64_t testnet_hard_fork_version_1_till = (uint64_t)-1;
}
struct fake_core_db
{
Blockchain m_storage;
HardFork* m_hardfork = nullptr;
tx_memory_pool m_pool;
bool support_batch;
bool support_add_block;
// for multi_db_runtime:
fake_core_db(const boost::filesystem::path &path, const bool use_testnet=false, const bool do_batch=true, const std::string& db_type="lmdb", const int db_flags=0) : m_pool(m_storage), m_storage(m_pool)
{
m_pool.init(path.string());
BlockchainDB* db = nullptr;
if (db_type == "lmdb")
db = new BlockchainLMDB();
#if defined(BERKELEY_DB)
else if (db_type == "berkeley")
db = new BlockchainBDB();
#endif
else
{
LOG_ERROR("Attempted to use non-existent database type: " << db_type);
throw std::runtime_error("Attempting to use non-existent database type");
}
boost::filesystem::path folder(path);
folder /= db->get_db_name();
LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ...");
const std::string filename = folder.string();
try
{
db->open(filename, db_flags);
}
catch (const std::exception& e)
{
LOG_PRINT_L0("Error opening database: " << e.what());
throw;
}
db->check_hard_fork_info();
uint64_t hard_fork_version_1_till = use_testnet ? testnet_hard_fork_version_1_till : mainnet_hard_fork_version_1_till;
m_hardfork = new HardFork(*db, 1, hard_fork_version_1_till);
m_storage.init(db, m_hardfork, use_testnet);
if (do_batch)
m_storage.get_db().set_batch_transactions(do_batch);
support_batch = true;
support_add_block = true;
}
~fake_core_db()
{
m_storage.get_db().check_hard_fork_info();
m_storage.deinit();
}
uint64_t add_block(const block& blk
, const size_t& block_size
, const difficulty_type& cumulative_difficulty
, const uint64_t& coins_generated
, const std::vector<transaction>& txs
)
{
return m_storage.get_db().add_block(blk, block_size, cumulative_difficulty, coins_generated, txs);
}
void batch_start(uint64_t batch_num_blocks = 0)
{
m_storage.get_db().batch_start(batch_num_blocks);
}
void batch_stop()
{
m_storage.get_db().batch_stop();
}
};
| 33.259259 | 203 | 0.707795 | [
"vector"
] |
cfb5817b46957ba3399fa0aa55ae2cff1c36ea3f | 907 | h | C | Castlevania/Black_Knight.h | ctelotuong/CaslteVania | dd4631a4895b0b91d5d8f80ba505dad7c4d81fab | [
"MIT"
] | null | null | null | Castlevania/Black_Knight.h | ctelotuong/CaslteVania | dd4631a4895b0b91d5d8f80ba505dad7c4d81fab | [
"MIT"
] | null | null | null | Castlevania/Black_Knight.h | ctelotuong/CaslteVania | dd4631a4895b0b91d5d8f80ba505dad7c4d81fab | [
"MIT"
] | null | null | null | #pragma once
#include "GameObject.h"
#include "Utils.h"
#include "Item.h"
#include "Ground.h"
namespace enemy
{
class Black_Knight :public core::CGameObject
{
float start_x, end_x;
float destination_x;
bool IsOntheGround = false;
bool Simon_in_the_zone = false;
public:
Black_Knight();
virtual void Update(DWORD dt, vector<core::LPGAMEOBJECT>* List_Objects_In_Game, vector<core::LPGAMEOBJECT>* coObject) override;
virtual void LoadResources(core::CTexture*& textures, core::CSprites*& sprites, core::CAnimations*& animations) override;
void Render() override;
virtual void GetBBox(float& B_left, float& B_top, float& B_right, float& B_bottom) override;
void Set_destination_x(float x) { this->destination_x = x; }
void Set_start_end(float start_x, float end_x) { this->start_x = start_x; this->end_x = end_x; }
void Is_Simon_in_the_target(float sx, float sy,bool x);
};
}
| 32.392857 | 129 | 0.739802 | [
"render",
"vector"
] |
cfb6cc03a986729bebc475e1ba7af36239b0a5bd | 2,121 | h | C | customer.h | Razdeep/OnlineBankingSystem | dc2130a110212b7faebaaa2dafd7af2f3d2af304 | [
"MIT"
] | 10 | 2018-04-22T15:26:20.000Z | 2021-11-09T13:16:29.000Z | customer.h | Razdeep/OnlineBankingSystem | dc2130a110212b7faebaaa2dafd7af2f3d2af304 | [
"MIT"
] | 2 | 2018-06-10T02:55:48.000Z | 2018-06-12T10:19:39.000Z | customer.h | Razdeep/OnlineBankingSystem | dc2130a110212b7faebaaa2dafd7af2f3d2af304 | [
"MIT"
] | 1 | 2020-10-21T15:13:26.000Z | 2020-10-21T15:13:26.000Z | /* Copyright (c) Rajdeep Roy Chowdhury 2018 <rrajdeeproychowdhury@gmail.com>
* This file is part of CSE202 Online Banking Management System 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.*/
#include<iostream>
#include"person.h"
#ifndef __CUSTOMER_H
#define __CUSTOMER_H
class Customer:public Person{
private:
float balance;
protected:
public:
Customer():Person(),balance(0){}
// Customer(int ID,std::string name,std::string address,long int phone, TimeStamp dob,std::string pass,float balance):
// Person(ID,name,address,phone,dob,pass),balance(balance){};
Customer(int ID,const char* name,const char* address,long int phone, TimeStamp dob,const char* pass,float balance):
Person(ID,name,address,phone,dob,pass),balance(balance){};
//COPY CONSTRUCTOR MUST BE PROVIDED, ELSE VECTOR WONT WORK
Customer(const Customer& other):Person(other){
this->balance=other.balance;
}
float getBalance() const;
void showDetails() const;
// void setValues();
void deposit(float);
void withdraw(float);
};
#endif | 47.133333 | 122 | 0.735974 | [
"vector"
] |
cfb7be40bed7a55a453757b30bf20772590b718d | 49,834 | h | C | include/drm/drm_modeset_helper_vtables.h | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | null | null | null | include/drm/drm_modeset_helper_vtables.h | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | null | null | null | include/drm/drm_modeset_helper_vtables.h | fergy/aplit_linux-5 | a6ef4cb0e17e1eec9743c064e65f730c49765711 | [
"MIT"
] | null | null | null | /*
* Copyright © 2006 Keith Packard
* Copyright © 2007-2008 Dave Airlie
* Copyright © 2007-2008 Intel Corporation
* Jesse Barnes <jesse.barnes@intel.com>
* Copyright © 2011-2013 Intel Corporation
* Copyright © 2015 Intel Corporation
* Daniel Vetter <daniel.vetter@ffwll.ch>
*
* 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 __DRM_MODESET_HELPER_VTABLES_H__
#define __DRM_MODESET_HELPER_VTABLES_H__
#include <drm/drm_crtc.h>
#include <drm/drm_encoder.h>
/**
* DOC: overview
*
* The DRM mode setting helper functions are common code for drivers to use if
* they wish. Drivers are not forced to use this code in their
* implementations but it would be useful if the code they do use at least
* provides a consistent interface and operation to userspace. Therefore it is
* highly recommended to use the provided helpers as much as possible.
*
* Because there is only one pointer per modeset object to hold a vfunc table
* for helper libraries they are by necessity shared among the different
* helpers.
*
* To make this clear all the helper vtables are pulled together in this location here.
*/
enum mode_set_atomic;
/**
* struct drm_crtc_helper_funcs - helper operations for CRTCs
*
* These hooks are used by the legacy CRTC helpers, the transitional plane
* helpers and the new atomic modesetting helpers.
*/
struct drm_crtc_helper_funcs {
/**
* @dpms:
*
* Callback to control power levels on the CRTC. If the mode passed in
* is unsupported, the provider must use the next lowest power level.
* This is used by the legacy CRTC helpers to implement DPMS
* functionality in drm_helper_connector_dpms().
*
* This callback is also used to disable a CRTC by calling it with
* DRM_MODE_DPMS_OFF if the @disable hook isn't used.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for enabling and disabling a CRTC to
* facilitate transitions to atomic, but it is deprecated. Instead
* @atomic_enable and @atomic_disable should be used.
*/
void (*dpms)(struct drm_crtc *crtc, int mode);
/**
* @prepare:
*
* This callback should prepare the CRTC for a subsequent modeset, which
* in practice means the driver should disable the CRTC if it is
* running. Most drivers ended up implementing this by calling their
* @dpms hook with DRM_MODE_DPMS_OFF.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for disabling a CRTC to facilitate
* transitions to atomic, but it is deprecated. Instead @atomic_disable
* should be used.
*/
void (*prepare)(struct drm_crtc *crtc);
/**
* @commit:
*
* This callback should commit the new mode on the CRTC after a modeset,
* which in practice means the driver should enable the CRTC. Most
* drivers ended up implementing this by calling their @dpms hook with
* DRM_MODE_DPMS_ON.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for enabling a CRTC to facilitate
* transitions to atomic, but it is deprecated. Instead @atomic_enable
* should be used.
*/
void (*commit)(struct drm_crtc *crtc);
/**
* @mode_valid:
*
* This callback is used to check if a specific mode is valid in this
* crtc. This should be implemented if the crtc has some sort of
* restriction in the modes it can display. For example, a given crtc
* may be responsible to set a clock value. If the clock can not
* produce all the values for the available modes then this callback
* can be used to restrict the number of modes to only the ones that
* can be displayed.
*
* This hook is used by the probe helpers to filter the mode list in
* drm_helper_probe_single_connector_modes(), and it is used by the
* atomic helpers to validate modes supplied by userspace in
* drm_atomic_helper_check_modeset().
*
* This function is optional.
*
* NOTE:
*
* Since this function is both called from the check phase of an atomic
* commit, and the mode validation in the probe paths it is not allowed
* to look at anything else but the passed-in mode, and validate it
* against configuration-invariant hardward constraints. Any further
* limits which depend upon the configuration can only be checked in
* @mode_fixup or @atomic_check.
*
* RETURNS:
*
* drm_mode_status Enum
*/
enum drm_mode_status (*mode_valid)(struct drm_crtc *crtc,
const struct drm_display_mode *mode);
/**
* @mode_fixup:
*
* This callback is used to validate a mode. The parameter mode is the
* display mode that userspace requested, adjusted_mode is the mode the
* encoders need to be fed with. Note that this is the inverse semantics
* of the meaning for the &drm_encoder and &drm_bridge_funcs.mode_fixup
* vfunc. If the CRTC cannot support the requested conversion from mode
* to adjusted_mode it should reject the modeset. See also
* &drm_crtc_state.adjusted_mode for more details.
*
* This function is used by both legacy CRTC helpers and atomic helpers.
* With atomic helpers it is optional.
*
* NOTE:
*
* This function is called in the check phase of atomic modesets, which
* can be aborted for any reason (including on userspace's request to
* just check whether a configuration would be possible). Atomic drivers
* MUST NOT touch any persistent state (hardware or software) or data
* structures except the passed in adjusted_mode parameter.
*
* This is in contrast to the legacy CRTC helpers where this was
* allowed.
*
* Atomic drivers which need to inspect and adjust more state should
* instead use the @atomic_check callback, but note that they're not
* perfectly equivalent: @mode_valid is called from
* drm_atomic_helper_check_modeset(), but @atomic_check is called from
* drm_atomic_helper_check_planes(), because originally it was meant for
* plane update checks only.
*
* Also beware that userspace can request its own custom modes, neither
* core nor helpers filter modes to the list of probe modes reported by
* the GETCONNECTOR IOCTL and stored in &drm_connector.modes. To ensure
* that modes are filtered consistently put any CRTC constraints and
* limits checks into @mode_valid.
*
* RETURNS:
*
* True if an acceptable configuration is possible, false if the modeset
* operation should be rejected.
*/
bool (*mode_fixup)(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
/**
* @mode_set:
*
* This callback is used by the legacy CRTC helpers to set a new mode,
* position and framebuffer. Since it ties the primary plane to every
* mode change it is incompatible with universal plane support. And
* since it can't update other planes it's incompatible with atomic
* modeset support.
*
* This callback is only used by CRTC helpers and deprecated.
*
* RETURNS:
*
* 0 on success or a negative error code on failure.
*/
int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode, int x, int y,
struct drm_framebuffer *old_fb);
/**
* @mode_set_nofb:
*
* This callback is used to update the display mode of a CRTC without
* changing anything of the primary plane configuration. This fits the
* requirement of atomic and hence is used by the atomic helpers. It is
* also used by the transitional plane helpers to implement a
* @mode_set hook in drm_helper_crtc_mode_set().
*
* Note that the display pipe is completely off when this function is
* called. Atomic drivers which need hardware to be running before they
* program the new display mode (e.g. because they implement runtime PM)
* should not use this hook. This is because the helper library calls
* this hook only once per mode change and not every time the display
* pipeline is suspended using either DPMS or the new "ACTIVE" property.
* Which means register values set in this callback might get reset when
* the CRTC is suspended, but not restored. Such drivers should instead
* move all their CRTC setup into the @atomic_enable callback.
*
* This callback is optional.
*/
void (*mode_set_nofb)(struct drm_crtc *crtc);
/**
* @mode_set_base:
*
* This callback is used by the legacy CRTC helpers to set a new
* framebuffer and scanout position. It is optional and used as an
* optimized fast-path instead of a full mode set operation with all the
* resulting flickering. If it is not present
* drm_crtc_helper_set_config() will fall back to a full modeset, using
* the @mode_set callback. Since it can't update other planes it's
* incompatible with atomic modeset support.
*
* This callback is only used by the CRTC helpers and deprecated.
*
* RETURNS:
*
* 0 on success or a negative error code on failure.
*/
int (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
struct drm_framebuffer *old_fb);
/**
* @mode_set_base_atomic:
*
* This callback is used by the fbdev helpers to set a new framebuffer
* and scanout without sleeping, i.e. from an atomic calling context. It
* is only used to implement kgdb support.
*
* This callback is optional and only needed for kgdb support in the fbdev
* helpers.
*
* RETURNS:
*
* 0 on success or a negative error code on failure.
*/
int (*mode_set_base_atomic)(struct drm_crtc *crtc,
struct drm_framebuffer *fb, int x, int y,
enum mode_set_atomic);
/**
* @disable:
*
* This callback should be used to disable the CRTC. With the atomic
* drivers it is called after all encoders connected to this CRTC have
* been shut off already using their own
* &drm_encoder_helper_funcs.disable hook. If that sequence is too
* simple drivers can just add their own hooks and call it from this
* CRTC callback here by looping over all encoders connected to it using
* for_each_encoder_on_crtc().
*
* This hook is used both by legacy CRTC helpers and atomic helpers.
* Atomic drivers don't need to implement it if there's no need to
* disable anything at the CRTC level. To ensure that runtime PM
* handling (using either DPMS or the new "ACTIVE" property) works
* @disable must be the inverse of @atomic_enable for atomic drivers.
* Atomic drivers should consider to use @atomic_disable instead of
* this one.
*
* NOTE:
*
* With legacy CRTC helpers there's a big semantic difference between
* @disable and other hooks (like @prepare or @dpms) used to shut down a
* CRTC: @disable is only called when also logically disabling the
* display pipeline and needs to release any resources acquired in
* @mode_set (like shared PLLs, or again release pinned framebuffers).
*
* Therefore @disable must be the inverse of @mode_set plus @commit for
* drivers still using legacy CRTC helpers, which is different from the
* rules under atomic.
*/
void (*disable)(struct drm_crtc *crtc);
/**
* @atomic_check:
*
* Drivers should check plane-update related CRTC constraints in this
* hook. They can also check mode related limitations but need to be
* aware of the calling order, since this hook is used by
* drm_atomic_helper_check_planes() whereas the preparations needed to
* check output routing and the display mode is done in
* drm_atomic_helper_check_modeset(). Therefore drivers that want to
* check output routing and display mode constraints in this callback
* must ensure that drm_atomic_helper_check_modeset() has been called
* beforehand. This is calling order used by the default helper
* implementation in drm_atomic_helper_check().
*
* When using drm_atomic_helper_check_planes() this hook is called
* after the &drm_plane_helper_funcs.atomic_check hook for planes, which
* allows drivers to assign shared resources requested by planes in this
* callback here. For more complicated dependencies the driver can call
* the provided check helpers multiple times until the computed state
* has a final configuration and everything has been checked.
*
* This function is also allowed to inspect any other object's state and
* can add more state objects to the atomic commit if needed. Care must
* be taken though to ensure that state check and compute functions for
* these added states are all called, and derived state in other objects
* all updated. Again the recommendation is to just call check helpers
* until a maximal configuration is reached.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*
* NOTE:
*
* This function is called in the check phase of an atomic update. The
* driver is not allowed to change anything outside of the free-standing
* state objects passed-in or assembled in the overall &drm_atomic_state
* update tracking structure.
*
* Also beware that userspace can request its own custom modes, neither
* core nor helpers filter modes to the list of probe modes reported by
* the GETCONNECTOR IOCTL and stored in &drm_connector.modes. To ensure
* that modes are filtered consistently put any CRTC constraints and
* limits checks into @mode_valid.
*
* RETURNS:
*
* 0 on success, -EINVAL if the state or the transition can't be
* supported, -ENOMEM on memory allocation failure and -EDEADLK if an
* attempt to obtain another state object ran into a &drm_modeset_lock
* deadlock.
*/
int (*atomic_check)(struct drm_crtc *crtc,
struct drm_crtc_state *state);
/**
* @atomic_begin:
*
* Drivers should prepare for an atomic update of multiple planes on
* a CRTC in this hook. Depending upon hardware this might be vblank
* evasion, blocking updates by setting bits or doing preparatory work
* for e.g. manual update display.
*
* This hook is called before any plane commit functions are called.
*
* Note that the power state of the display pipe when this function is
* called depends upon the exact helpers and calling sequence the driver
* has picked. See drm_atomic_helper_commit_planes() for a discussion of
* the tradeoffs and variants of plane commit helpers.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*/
void (*atomic_begin)(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state);
/**
* @atomic_flush:
*
* Drivers should finalize an atomic update of multiple planes on
* a CRTC in this hook. Depending upon hardware this might include
* checking that vblank evasion was successful, unblocking updates by
* setting bits or setting the GO bit to flush out all updates.
*
* Simple hardware or hardware with special requirements can commit and
* flush out all updates for all planes from this hook and forgo all the
* other commit hooks for plane updates.
*
* This hook is called after any plane commit functions are called.
*
* Note that the power state of the display pipe when this function is
* called depends upon the exact helpers and calling sequence the driver
* has picked. See drm_atomic_helper_commit_planes() for a discussion of
* the tradeoffs and variants of plane commit helpers.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*/
void (*atomic_flush)(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state);
/**
* @atomic_enable:
*
* This callback should be used to enable the CRTC. With the atomic
* drivers it is called before all encoders connected to this CRTC are
* enabled through the encoder's own &drm_encoder_helper_funcs.enable
* hook. If that sequence is too simple drivers can just add their own
* hooks and call it from this CRTC callback here by looping over all
* encoders connected to it using for_each_encoder_on_crtc().
*
* This hook is used only by atomic helpers, for symmetry with
* @atomic_disable. Atomic drivers don't need to implement it if there's
* no need to enable anything at the CRTC level. To ensure that runtime
* PM handling (using either DPMS or the new "ACTIVE" property) works
* @atomic_enable must be the inverse of @atomic_disable for atomic
* drivers.
*
* Drivers can use the @old_crtc_state input parameter if the operations
* needed to enable the CRTC don't depend solely on the new state but
* also on the transition between the old state and the new state.
*/
void (*atomic_enable)(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state);
/**
* @atomic_disable:
*
* This callback should be used to disable the CRTC. With the atomic
* drivers it is called after all encoders connected to this CRTC have
* been shut off already using their own
* &drm_encoder_helper_funcs.disable hook. If that sequence is too
* simple drivers can just add their own hooks and call it from this
* CRTC callback here by looping over all encoders connected to it using
* for_each_encoder_on_crtc().
*
* This hook is used only by atomic helpers. Atomic drivers don't
* need to implement it if there's no need to disable anything at the
* CRTC level.
*
* Comparing to @disable, this one provides the additional input
* parameter @old_crtc_state which could be used to access the old
* state. Atomic drivers should consider to use this one instead
* of @disable.
*/
void (*atomic_disable)(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state);
};
/**
* drm_crtc_helper_add - sets the helper vtable for a crtc
* @crtc: DRM CRTC
* @funcs: helper vtable to set for @crtc
*/
static inline void drm_crtc_helper_add(struct drm_crtc *crtc,
const struct drm_crtc_helper_funcs *funcs)
{
crtc->helper_private = funcs;
}
/**
* struct drm_encoder_helper_funcs - helper operations for encoders
*
* These hooks are used by the legacy CRTC helpers, the transitional plane
* helpers and the new atomic modesetting helpers.
*/
struct drm_encoder_helper_funcs {
/**
* @dpms:
*
* Callback to control power levels on the encoder. If the mode passed in
* is unsupported, the provider must use the next lowest power level.
* This is used by the legacy encoder helpers to implement DPMS
* functionality in drm_helper_connector_dpms().
*
* This callback is also used to disable an encoder by calling it with
* DRM_MODE_DPMS_OFF if the @disable hook isn't used.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for enabling and disabling an encoder to
* facilitate transitions to atomic, but it is deprecated. Instead
* @enable and @disable should be used.
*/
void (*dpms)(struct drm_encoder *encoder, int mode);
/**
* @mode_valid:
*
* This callback is used to check if a specific mode is valid in this
* encoder. This should be implemented if the encoder has some sort
* of restriction in the modes it can display. For example, a given
* encoder may be responsible to set a clock value. If the clock can
* not produce all the values for the available modes then this callback
* can be used to restrict the number of modes to only the ones that
* can be displayed.
*
* This hook is used by the probe helpers to filter the mode list in
* drm_helper_probe_single_connector_modes(), and it is used by the
* atomic helpers to validate modes supplied by userspace in
* drm_atomic_helper_check_modeset().
*
* This function is optional.
*
* NOTE:
*
* Since this function is both called from the check phase of an atomic
* commit, and the mode validation in the probe paths it is not allowed
* to look at anything else but the passed-in mode, and validate it
* against configuration-invariant hardward constraints. Any further
* limits which depend upon the configuration can only be checked in
* @mode_fixup or @atomic_check.
*
* RETURNS:
*
* drm_mode_status Enum
*/
enum drm_mode_status (*mode_valid)(struct drm_encoder *crtc,
const struct drm_display_mode *mode);
/**
* @mode_fixup:
*
* This callback is used to validate and adjust a mode. The parameter
* mode is the display mode that should be fed to the next element in
* the display chain, either the final &drm_connector or a &drm_bridge.
* The parameter adjusted_mode is the input mode the encoder requires. It
* can be modified by this callback and does not need to match mode. See
* also &drm_crtc_state.adjusted_mode for more details.
*
* This function is used by both legacy CRTC helpers and atomic helpers.
* This hook is optional.
*
* NOTE:
*
* This function is called in the check phase of atomic modesets, which
* can be aborted for any reason (including on userspace's request to
* just check whether a configuration would be possible). Atomic drivers
* MUST NOT touch any persistent state (hardware or software) or data
* structures except the passed in adjusted_mode parameter.
*
* This is in contrast to the legacy CRTC helpers where this was
* allowed.
*
* Atomic drivers which need to inspect and adjust more state should
* instead use the @atomic_check callback. If @atomic_check is used,
* this hook isn't called since @atomic_check allows a strict superset
* of the functionality of @mode_fixup.
*
* Also beware that userspace can request its own custom modes, neither
* core nor helpers filter modes to the list of probe modes reported by
* the GETCONNECTOR IOCTL and stored in &drm_connector.modes. To ensure
* that modes are filtered consistently put any encoder constraints and
* limits checks into @mode_valid.
*
* RETURNS:
*
* True if an acceptable configuration is possible, false if the modeset
* operation should be rejected.
*/
bool (*mode_fixup)(struct drm_encoder *encoder,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
/**
* @prepare:
*
* This callback should prepare the encoder for a subsequent modeset,
* which in practice means the driver should disable the encoder if it
* is running. Most drivers ended up implementing this by calling their
* @dpms hook with DRM_MODE_DPMS_OFF.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for disabling an encoder to facilitate
* transitions to atomic, but it is deprecated. Instead @disable should
* be used.
*/
void (*prepare)(struct drm_encoder *encoder);
/**
* @commit:
*
* This callback should commit the new mode on the encoder after a modeset,
* which in practice means the driver should enable the encoder. Most
* drivers ended up implementing this by calling their @dpms hook with
* DRM_MODE_DPMS_ON.
*
* This callback is used by the legacy CRTC helpers. Atomic helpers
* also support using this hook for enabling an encoder to facilitate
* transitions to atomic, but it is deprecated. Instead @enable should
* be used.
*/
void (*commit)(struct drm_encoder *encoder);
/**
* @mode_set:
*
* This callback is used to update the display mode of an encoder.
*
* Note that the display pipe is completely off when this function is
* called. Drivers which need hardware to be running before they program
* the new display mode (because they implement runtime PM) should not
* use this hook, because the helper library calls it only once and not
* every time the display pipeline is suspend using either DPMS or the
* new "ACTIVE" property. Such drivers should instead move all their
* encoder setup into the @enable callback.
*
* This callback is used both by the legacy CRTC helpers and the atomic
* modeset helpers. It is optional in the atomic helpers.
*
* NOTE:
*
* If the driver uses the atomic modeset helpers and needs to inspect
* the connector state or connector display info during mode setting,
* @atomic_mode_set can be used instead.
*/
void (*mode_set)(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
/**
* @atomic_mode_set:
*
* This callback is used to update the display mode of an encoder.
*
* Note that the display pipe is completely off when this function is
* called. Drivers which need hardware to be running before they program
* the new display mode (because they implement runtime PM) should not
* use this hook, because the helper library calls it only once and not
* every time the display pipeline is suspended using either DPMS or the
* new "ACTIVE" property. Such drivers should instead move all their
* encoder setup into the @enable callback.
*
* This callback is used by the atomic modeset helpers in place of the
* @mode_set callback, if set by the driver. It is optional and should
* be used instead of @mode_set if the driver needs to inspect the
* connector state or display info, since there is no direct way to
* go from the encoder to the current connector.
*/
void (*atomic_mode_set)(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state);
/**
* @get_crtc:
*
* This callback is used by the legacy CRTC helpers to work around
* deficiencies in its own book-keeping.
*
* Do not use, use atomic helpers instead, which get the book keeping
* right.
*
* FIXME:
*
* Currently only nouveau is using this, and as soon as nouveau is
* atomic we can ditch this hook.
*/
struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder);
/**
* @detect:
*
* This callback can be used by drivers who want to do detection on the
* encoder object instead of in connector functions.
*
* It is not used by any helper and therefore has purely driver-specific
* semantics. New drivers shouldn't use this and instead just implement
* their own private callbacks.
*
* FIXME:
*
* This should just be converted into a pile of driver vfuncs.
* Currently radeon, amdgpu and nouveau are using it.
*/
enum drm_connector_status (*detect)(struct drm_encoder *encoder,
struct drm_connector *connector);
/**
* @disable:
*
* This callback should be used to disable the encoder. With the atomic
* drivers it is called before this encoder's CRTC has been shut off
* using their own &drm_crtc_helper_funcs.disable hook. If that
* sequence is too simple drivers can just add their own driver private
* encoder hooks and call them from CRTC's callback by looping over all
* encoders connected to it using for_each_encoder_on_crtc().
*
* This hook is used both by legacy CRTC helpers and atomic helpers.
* Atomic drivers don't need to implement it if there's no need to
* disable anything at the encoder level. To ensure that runtime PM
* handling (using either DPMS or the new "ACTIVE" property) works
* @disable must be the inverse of @enable for atomic drivers.
*
* NOTE:
*
* With legacy CRTC helpers there's a big semantic difference between
* @disable and other hooks (like @prepare or @dpms) used to shut down a
* encoder: @disable is only called when also logically disabling the
* display pipeline and needs to release any resources acquired in
* @mode_set (like shared PLLs, or again release pinned framebuffers).
*
* Therefore @disable must be the inverse of @mode_set plus @commit for
* drivers still using legacy CRTC helpers, which is different from the
* rules under atomic.
*/
void (*disable)(struct drm_encoder *encoder);
/**
* @enable:
*
* This callback should be used to enable the encoder. With the atomic
* drivers it is called after this encoder's CRTC has been enabled using
* their own &drm_crtc_helper_funcs.enable hook. If that sequence is
* too simple drivers can just add their own driver private encoder
* hooks and call them from CRTC's callback by looping over all encoders
* connected to it using for_each_encoder_on_crtc().
*
* This hook is used only by atomic helpers, for symmetry with @disable.
* Atomic drivers don't need to implement it if there's no need to
* enable anything at the encoder level. To ensure that runtime PM handling
* (using either DPMS or the new "ACTIVE" property) works
* @enable must be the inverse of @disable for atomic drivers.
*/
void (*enable)(struct drm_encoder *encoder);
/**
* @atomic_check:
*
* This callback is used to validate encoder state for atomic drivers.
* Since the encoder is the object connecting the CRTC and connector it
* gets passed both states, to be able to validate interactions and
* update the CRTC to match what the encoder needs for the requested
* connector.
*
* Since this provides a strict superset of the functionality of
* @mode_fixup (the requested and adjusted modes are both available
* through the passed in &struct drm_crtc_state) @mode_fixup is not
* called when @atomic_check is implemented.
*
* This function is used by the atomic helpers, but it is optional.
*
* NOTE:
*
* This function is called in the check phase of an atomic update. The
* driver is not allowed to change anything outside of the free-standing
* state objects passed-in or assembled in the overall &drm_atomic_state
* update tracking structure.
*
* Also beware that userspace can request its own custom modes, neither
* core nor helpers filter modes to the list of probe modes reported by
* the GETCONNECTOR IOCTL and stored in &drm_connector.modes. To ensure
* that modes are filtered consistently put any encoder constraints and
* limits checks into @mode_valid.
*
* RETURNS:
*
* 0 on success, -EINVAL if the state or the transition can't be
* supported, -ENOMEM on memory allocation failure and -EDEADLK if an
* attempt to obtain another state object ran into a &drm_modeset_lock
* deadlock.
*/
int (*atomic_check)(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state);
};
/**
* drm_encoder_helper_add - sets the helper vtable for an encoder
* @encoder: DRM encoder
* @funcs: helper vtable to set for @encoder
*/
static inline void drm_encoder_helper_add(struct drm_encoder *encoder,
const struct drm_encoder_helper_funcs *funcs)
{
encoder->helper_private = funcs;
}
/**
* struct drm_connector_helper_funcs - helper operations for connectors
*
* These functions are used by the atomic and legacy modeset helpers and by the
* probe helpers.
*/
struct drm_connector_helper_funcs {
/**
* @get_modes:
*
* This function should fill in all modes currently valid for the sink
* into the &drm_connector.probed_modes list. It should also update the
* EDID property by calling drm_connector_update_edid_property().
*
* The usual way to implement this is to cache the EDID retrieved in the
* probe callback somewhere in the driver-private connector structure.
* In this function drivers then parse the modes in the EDID and add
* them by calling drm_add_edid_modes(). But connectors that driver a
* fixed panel can also manually add specific modes using
* drm_mode_probed_add(). Drivers which manually add modes should also
* make sure that the &drm_connector.display_info,
* &drm_connector.width_mm and &drm_connector.height_mm fields are
* filled in.
*
* Virtual drivers that just want some standard VESA mode with a given
* resolution can call drm_add_modes_noedid(), and mark the preferred
* one using drm_set_preferred_mode().
*
* This function is only called after the @detect hook has indicated
* that a sink is connected and when the EDID isn't overridden through
* sysfs or the kernel commandline.
*
* This callback is used by the probe helpers in e.g.
* drm_helper_probe_single_connector_modes().
*
* To avoid races with concurrent connector state updates, the helper
* libraries always call this with the &drm_mode_config.connection_mutex
* held. Because of this it's safe to inspect &drm_connector->state.
*
* RETURNS:
*
* The number of modes added by calling drm_mode_probed_add().
*/
int (*get_modes)(struct drm_connector *connector);
/**
* @detect_ctx:
*
* Check to see if anything is attached to the connector. The parameter
* force is set to false whilst polling, true when checking the
* connector due to a user request. force can be used by the driver to
* avoid expensive, destructive operations during automated probing.
*
* This callback is optional, if not implemented the connector will be
* considered as always being attached.
*
* This is the atomic version of &drm_connector_funcs.detect.
*
* To avoid races against concurrent connector state updates, the
* helper libraries always call this with ctx set to a valid context,
* and &drm_mode_config.connection_mutex will always be locked with
* the ctx parameter set to this ctx. This allows taking additional
* locks as required.
*
* RETURNS:
*
* &drm_connector_status indicating the connector's status,
* or the error code returned by drm_modeset_lock(), -EDEADLK.
*/
int (*detect_ctx)(struct drm_connector *connector,
struct drm_modeset_acquire_ctx *ctx,
bool force);
/**
* @mode_valid:
*
* Callback to validate a mode for a connector, irrespective of the
* specific display configuration.
*
* This callback is used by the probe helpers to filter the mode list
* (which is usually derived from the EDID data block from the sink).
* See e.g. drm_helper_probe_single_connector_modes().
*
* This function is optional.
*
* NOTE:
*
* This only filters the mode list supplied to userspace in the
* GETCONNECTOR IOCTL. Compared to &drm_encoder_helper_funcs.mode_valid,
* &drm_crtc_helper_funcs.mode_valid and &drm_bridge_funcs.mode_valid,
* which are also called by the atomic helpers from
* drm_atomic_helper_check_modeset(). This allows userspace to force and
* ignore sink constraint (like the pixel clock limits in the screen's
* EDID), which is useful for e.g. testing, or working around a broken
* EDID. Any source hardware constraint (which always need to be
* enforced) therefore should be checked in one of the above callbacks,
* and not this one here.
*
* To avoid races with concurrent connector state updates, the helper
* libraries always call this with the &drm_mode_config.connection_mutex
* held. Because of this it's safe to inspect &drm_connector->state.
*
* RETURNS:
*
* Either &drm_mode_status.MODE_OK or one of the failure reasons in &enum
* drm_mode_status.
*/
enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
struct drm_display_mode *mode);
/**
* @best_encoder:
*
* This function should select the best encoder for the given connector.
*
* This function is used by both the atomic helpers (in the
* drm_atomic_helper_check_modeset() function) and in the legacy CRTC
* helpers.
*
* NOTE:
*
* In atomic drivers this function is called in the check phase of an
* atomic update. The driver is not allowed to change or inspect
* anything outside of arguments passed-in. Atomic drivers which need to
* inspect dynamic configuration state should instead use
* @atomic_best_encoder.
*
* You can leave this function to NULL if the connector is only
* attached to a single encoder and you are using the atomic helpers.
* In this case, the core will call drm_atomic_helper_best_encoder()
* for you.
*
* RETURNS:
*
* Encoder that should be used for the given connector and connector
* state, or NULL if no suitable encoder exists. Note that the helpers
* will ensure that encoders aren't used twice, drivers should not check
* for this.
*/
struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
/**
* @atomic_best_encoder:
*
* This is the atomic version of @best_encoder for atomic drivers which
* need to select the best encoder depending upon the desired
* configuration and can't select it statically.
*
* This function is used by drm_atomic_helper_check_modeset().
* If it is not implemented, the core will fallback to @best_encoder
* (or drm_atomic_helper_best_encoder() if @best_encoder is NULL).
*
* NOTE:
*
* This function is called in the check phase of an atomic update. The
* driver is not allowed to change anything outside of the free-standing
* state objects passed-in or assembled in the overall &drm_atomic_state
* update tracking structure.
*
* RETURNS:
*
* Encoder that should be used for the given connector and connector
* state, or NULL if no suitable encoder exists. Note that the helpers
* will ensure that encoders aren't used twice, drivers should not check
* for this.
*/
struct drm_encoder *(*atomic_best_encoder)(struct drm_connector *connector,
struct drm_connector_state *connector_state);
/**
* @atomic_check:
*
* This hook is used to validate connector state. This function is
* called from &drm_atomic_helper_check_modeset, and is called when
* a connector property is set, or a modeset on the crtc is forced.
*
* Because &drm_atomic_helper_check_modeset may be called multiple times,
* this function should handle being called multiple times as well.
*
* This function is also allowed to inspect any other object's state and
* can add more state objects to the atomic commit if needed. Care must
* be taken though to ensure that state check and compute functions for
* these added states are all called, and derived state in other objects
* all updated. Again the recommendation is to just call check helpers
* until a maximal configuration is reached.
*
* NOTE:
*
* This function is called in the check phase of an atomic update. The
* driver is not allowed to change anything outside of the free-standing
* state objects passed-in or assembled in the overall &drm_atomic_state
* update tracking structure.
*
* RETURNS:
*
* 0 on success, -EINVAL if the state or the transition can't be
* supported, -ENOMEM on memory allocation failure and -EDEADLK if an
* attempt to obtain another state object ran into a &drm_modeset_lock
* deadlock.
*/
int (*atomic_check)(struct drm_connector *connector,
struct drm_connector_state *state);
/**
* @atomic_commit:
*
* This hook is to be used by drivers implementing writeback connectors
* that need a point when to commit the writeback job to the hardware.
* The writeback_job to commit is available in
* &drm_connector_state.writeback_job.
*
* This hook is optional.
*
* This callback is used by the atomic modeset helpers.
*/
void (*atomic_commit)(struct drm_connector *connector,
struct drm_connector_state *state);
};
/**
* drm_connector_helper_add - sets the helper vtable for a connector
* @connector: DRM connector
* @funcs: helper vtable to set for @connector
*/
static inline void drm_connector_helper_add(struct drm_connector *connector,
const struct drm_connector_helper_funcs *funcs)
{
connector->helper_private = funcs;
}
/**
* struct drm_plane_helper_funcs - helper operations for planes
*
* These functions are used by the atomic helpers and by the transitional plane
* helpers.
*/
struct drm_plane_helper_funcs {
/**
* @prepare_fb:
*
* This hook is to prepare a framebuffer for scanout by e.g. pinning
* its backing storage or relocating it into a contiguous block of
* VRAM. Other possible preparatory work includes flushing caches.
*
* This function must not block for outstanding rendering, since it is
* called in the context of the atomic IOCTL even for async commits to
* be able to return any errors to userspace. Instead the recommended
* way is to fill out the &drm_plane_state.fence of the passed-in
* &drm_plane_state. If the driver doesn't support native fences then
* equivalent functionality should be implemented through private
* members in the plane structure.
*
* Drivers which always have their buffers pinned should use
* drm_gem_fb_prepare_fb() for this hook.
*
* The helpers will call @cleanup_fb with matching arguments for every
* successful call to this hook.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*
* RETURNS:
*
* 0 on success or one of the following negative error codes allowed by
* the &drm_mode_config_funcs.atomic_commit vfunc. When using helpers
* this callback is the only one which can fail an atomic commit,
* everything else must complete successfully.
*/
int (*prepare_fb)(struct drm_plane *plane,
struct drm_plane_state *new_state);
/**
* @cleanup_fb:
*
* This hook is called to clean up any resources allocated for the given
* framebuffer and plane configuration in @prepare_fb.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*/
void (*cleanup_fb)(struct drm_plane *plane,
struct drm_plane_state *old_state);
/**
* @atomic_check:
*
* Drivers should check plane specific constraints in this hook.
*
* When using drm_atomic_helper_check_planes() plane's @atomic_check
* hooks are called before the ones for CRTCs, which allows drivers to
* request shared resources that the CRTC controls here. For more
* complicated dependencies the driver can call the provided check helpers
* multiple times until the computed state has a final configuration and
* everything has been checked.
*
* This function is also allowed to inspect any other object's state and
* can add more state objects to the atomic commit if needed. Care must
* be taken though to ensure that state check and compute functions for
* these added states are all called, and derived state in other objects
* all updated. Again the recommendation is to just call check helpers
* until a maximal configuration is reached.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*
* NOTE:
*
* This function is called in the check phase of an atomic update. The
* driver is not allowed to change anything outside of the free-standing
* state objects passed-in or assembled in the overall &drm_atomic_state
* update tracking structure.
*
* RETURNS:
*
* 0 on success, -EINVAL if the state or the transition can't be
* supported, -ENOMEM on memory allocation failure and -EDEADLK if an
* attempt to obtain another state object ran into a &drm_modeset_lock
* deadlock.
*/
int (*atomic_check)(struct drm_plane *plane,
struct drm_plane_state *state);
/**
* @atomic_update:
*
* Drivers should use this function to update the plane state. This
* hook is called in-between the &drm_crtc_helper_funcs.atomic_begin and
* drm_crtc_helper_funcs.atomic_flush callbacks.
*
* Note that the power state of the display pipe when this function is
* called depends upon the exact helpers and calling sequence the driver
* has picked. See drm_atomic_helper_commit_planes() for a discussion of
* the tradeoffs and variants of plane commit helpers.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*/
void (*atomic_update)(struct drm_plane *plane,
struct drm_plane_state *old_state);
/**
* @atomic_disable:
*
* Drivers should use this function to unconditionally disable a plane.
* This hook is called in-between the
* &drm_crtc_helper_funcs.atomic_begin and
* drm_crtc_helper_funcs.atomic_flush callbacks. It is an alternative to
* @atomic_update, which will be called for disabling planes, too, if
* the @atomic_disable hook isn't implemented.
*
* This hook is also useful to disable planes in preparation of a modeset,
* by calling drm_atomic_helper_disable_planes_on_crtc() from the
* &drm_crtc_helper_funcs.disable hook.
*
* Note that the power state of the display pipe when this function is
* called depends upon the exact helpers and calling sequence the driver
* has picked. See drm_atomic_helper_commit_planes() for a discussion of
* the tradeoffs and variants of plane commit helpers.
*
* This callback is used by the atomic modeset helpers and by the
* transitional plane helpers, but it is optional.
*/
void (*atomic_disable)(struct drm_plane *plane,
struct drm_plane_state *old_state);
/**
* @atomic_async_check:
*
* Drivers should set this function pointer to check if the plane state
* can be updated in a async fashion. Here async means "not vblank
* synchronized".
*
* This hook is called by drm_atomic_async_check() to establish if a
* given update can be committed asynchronously, that is, if it can
* jump ahead of the state currently queued for update.
*
* RETURNS:
*
* Return 0 on success and any error returned indicates that the update
* can not be applied in asynchronous manner.
*/
int (*atomic_async_check)(struct drm_plane *plane,
struct drm_plane_state *state);
/**
* @atomic_async_update:
*
* Drivers should set this function pointer to perform asynchronous
* updates of planes, that is, jump ahead of the currently queued
* state and update the plane. Here async means "not vblank
* synchronized".
*
* This hook is called by drm_atomic_helper_async_commit().
*
* An async update will happen on legacy cursor updates. An async
* update won't happen if there is an outstanding commit modifying
* the same plane.
*
* Note that unlike &drm_plane_helper_funcs.atomic_update this hook
* takes the new &drm_plane_state as parameter. When doing async_update
* drivers shouldn't replace the &drm_plane_state but update the
* current one with the new plane configurations in the new
* plane_state.
*
* FIXME:
* - It only works for single plane updates
* - Async Pageflips are not supported yet
* - Some hw might still scan out the old buffer until the next
* vblank, however we let go of the fb references as soon as
* we run this hook. For now drivers must implement their own workers
* for deferring if needed, until a common solution is created.
*/
void (*atomic_async_update)(struct drm_plane *plane,
struct drm_plane_state *new_state);
};
/**
* drm_plane_helper_add - sets the helper vtable for a plane
* @plane: DRM plane
* @funcs: helper vtable to set for @plane
*/
static inline void drm_plane_helper_add(struct drm_plane *plane,
const struct drm_plane_helper_funcs *funcs)
{
plane->helper_private = funcs;
}
/**
* struct drm_mode_config_helper_funcs - global modeset helper operations
*
* These helper functions are used by the atomic helpers.
*/
struct drm_mode_config_helper_funcs {
/**
* @atomic_commit_tail:
*
* This hook is used by the default atomic_commit() hook implemented in
* drm_atomic_helper_commit() together with the nonblocking commit
* helpers (see drm_atomic_helper_setup_commit() for a starting point)
* to implement blocking and nonblocking commits easily. It is not used
* by the atomic helpers
*
* This function is called when the new atomic state has already been
* swapped into the various state pointers. The passed in state
* therefore contains copies of the old/previous state. This hook should
* commit the new state into hardware. Note that the helpers have
* already waited for preceeding atomic commits and fences, but drivers
* can add more waiting calls at the start of their implementation, e.g.
* to wait for driver-internal request for implicit syncing, before
* starting to commit the update to the hardware.
*
* After the atomic update is committed to the hardware this hook needs
* to call drm_atomic_helper_commit_hw_done(). Then wait for the upate
* to be executed by the hardware, for example using
* drm_atomic_helper_wait_for_vblanks() or
* drm_atomic_helper_wait_for_flip_done(), and then clean up the old
* framebuffers using drm_atomic_helper_cleanup_planes().
*
* When disabling a CRTC this hook _must_ stall for the commit to
* complete. Vblank waits don't work on disabled CRTC, hence the core
* can't take care of this. And it also can't rely on the vblank event,
* since that can be signalled already when the screen shows black,
* which can happen much earlier than the last hardware access needed to
* shut off the display pipeline completely.
*
* This hook is optional, the default implementation is
* drm_atomic_helper_commit_tail().
*/
void (*atomic_commit_tail)(struct drm_atomic_state *state);
};
#endif
| 40.027309 | 87 | 0.738873 | [
"object"
] |
cfb93ce100a8f7d9cfc4f8a758e1f98217878590 | 50,268 | h | C | bmptk/targets/cortex/lpc/cmsis/12xx/inc/LPC122x.h | TheBlindMick/MPU6050 | 66880369fa7a73755846e60568137dfc07da1b5c | [
"BSL-1.0"
] | 1 | 2018-03-19T02:38:48.000Z | 2018-03-19T02:38:48.000Z | bmptk/targets/cortex/lpc/cmsis/12xx/inc/LPC122x.h | TheBlindMick/MPU6050 | 66880369fa7a73755846e60568137dfc07da1b5c | [
"BSL-1.0"
] | null | null | null | bmptk/targets/cortex/lpc/cmsis/12xx/inc/LPC122x.h | TheBlindMick/MPU6050 | 66880369fa7a73755846e60568137dfc07da1b5c | [
"BSL-1.0"
] | null | null | null | /**************************************************************************//**
* $Id: LPC122x.h 6933 2011-03-23 19:02:11Z nxp28548 $
*
* @file LPC122x.h
* @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File for
* NXP LPC122x Device Series
* @version 1.1
* @date $Date:: 2011-03-23#$
* @author NXP MCU Team
*
* @note
* Copyright (C) 2011 NXP Semiconductors(NXP). All rights reserved.
*
* @par
* Software that is described herein is for illustrative purposes only
* which provides customers with programming information regarding the
* products. This software is supplied "AS IS" without any warranties.
* NXP Semiconductors assumes no responsibility or liability for the
* use of the software, conveys no license or title under any patent,
* copyright, or mask work right to the product. NXP Semiconductors
* reserves the right to make changes in the software without
* notification. NXP Semiconductors also make no representation or
* warranty that such application will be suitable for the specified
* use without further testing or modification.
******************************************************************************/
/** @addtogroup (null)
* @{
*/
/** @addtogroup LPC122x
* @{
*/
#ifndef __LPC122X_H__
#define __LPC122X_H__
#ifdef __cplusplus
extern "C" {
#endif
#if defined ( __CC_ARM )
#pragma anon_unions
#endif
/* Interrupt Number Definition */
typedef enum {
// ------------------------- Cortex-M0 Processor Exceptions Numbers -----------------------------
Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */
NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */
HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault */
SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */
DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor */
PendSV_IRQn = -2, /*!< 14 Pendable request for system service */
SysTick_IRQn = -1, /*!< 15 System Tick Timer */
// --------------------------- LPC122x Specific Interrupt Numbers -------------------------------
WAKEUP0_IRQn = 0, /*!< PIO0_0 to PIO0_11 Wakeup */
WAKEUP1_IRQn = 1,
WAKEUP2_IRQn = 2,
WAKEUP3_IRQn = 3,
WAKEUP4_IRQn = 4,
WAKEUP5_IRQn = 5,
WAKEUP6_IRQn = 6,
WAKEUP7_IRQn = 7,
WAKEUP8_IRQn = 8,
WAKEUP9_IRQn = 9,
WAKEUP10_IRQn = 10,
WAKEUP11_IRQn = 11, /*!< PIO0_0 to PIO0_11 Wakeup */
I2C_IRQn =12, /*!< I2C Interrupt */
TIMER_16_0_IRQn = 13, /*!< 16-bit Timer0 Interrupt */
TIMER_16_1_IRQn = 14, /*!< 16-bit Timer1 Interrupt */
TIMER_32_0_IRQn = 15, /*!< 32-bit Timer0 Interrupt */
TIMER_32_1_IRQn = 16, /*!< 32-bit Timer1 Interrupt */
SSP_IRQn = 17, /*!< SSP Interrupt */
UART0_IRQn = 18, /*!< UART0 Interrupt */
UART1_IRQn = 19, /*!< UART1 Interrupt */
CMP_IRQn = 20, /*!< Comparator Interrupt */
ADC_IRQn = 21, /*!< A/D Converter Interrupt */
WDT_IRQn = 22, /*!< Watchdog timer Interrupt */
BOD_IRQn = 23, /*!< Brown Out Detect(BOD) Interrupt */
EINT0_IRQn = 25, /*!< External Interrupt 0 Interrupt */
EINT1_IRQn = 26, /*!< External Interrupt 1 Interrupt */
EINT2_IRQn = 27, /*!< External Interrupt 2 Interrupt */
DMA_IRQn = 29, /*!< DMA Interrupt */
RTC_IRQn = 30, /*!< RTC Interrupt */
} IRQn_Type;
/** @addtogroup Configuration_of_CMSIS
* @{
*/
/*
* ==========================================================================
* ----------- Processor and Core Peripheral Section ------------------------
* ==========================================================================
*/
/* Configuration of the Cortex-M0 Processor and Core Peripherals */
#define __MPU_PRESENT 0 /*!< MPU present or not */
#define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
/*@}*/ /* end of group LPC12xx_CMSIS */
#include "core_cm0.h" /* Cortex-M0 processor and core peripherals */
#include "system_LPC122x.h" /* System Header */
/** @addtogroup Device_Peripheral_Registers
* @{
*/
// ------------------------------------------------------------------------------------------------
// ----- I2C -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x I2C-bus controller Modification date=2/2/2011 Major revision=0 Minor revision=17 (I2C)
*/
typedef struct { /*!< (@ 0x40000000) I2C Structure */
__IO uint32_t CONSET; /*!< (@ 0x40000000) I2C Control Set Register. When a one is written to a bit of this register, the corresponding bit in the I2C control register is set. Writing a zero has no effect on the corresponding bit in the I2C control register. */
__I uint32_t STAT; /*!< (@ 0x40000004) I2C Status Register. During I2C operation, this register provides detailed status codes that allow software to determine the next action needed. */
__IO uint32_t DAT; /*!< (@ 0x40000008) I2C Data Register. During master or slave transmit mode, data to be transmitted is written to this register. During master or slave receive mode, data that has been received may be read from this register. */
__IO uint32_t ADR0; /*!< (@ 0x4000000C) I2C Slave Address Register 0. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */
__IO uint32_t SCLH; /*!< (@ 0x40000010) SCH Duty Cycle Register High Half Word. Determines the high time of the I2C clock. */
__IO uint32_t SCLL; /*!< (@ 0x40000014) SCL Duty Cycle Register Low Half Word. Determines the low time of the I2C clock. I2nSCLL and I2nSCLH together determine the clock frequency generated by an I2C master and certain times used in slave mode. */
__IO uint32_t CONCLR; /*!< (@ 0x40000018) I2C Control Clear Register. When a one is written to a bit of this register, the corresponding bit in the I2C control register is cleared. Writing a zero has no effect on the corresponding bit in the I2C control register. */
__IO uint32_t MMCTRL; /*!< (@ 0x4000001C) Monitor mode control register. */
__IO uint32_t ADR1; /*!< (@ 0x40000020) I2C Slave Address Register. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */
__IO uint32_t ADR2; /*!< (@ 0x40000024) I2C Slave Address Register. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */
__IO uint32_t ADR3; /*!< (@ 0x40000028) I2C Slave Address Register. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */
__I uint32_t DATA_BUFFER; /*!< (@ 0x4000002C) Data buffer register. The contents of the 8 MSBs of the I2DAT shift register will be transferred to the DATA_BUFFER automatically after every nine bits (8 bits of data plus ACK or NACK) has been received on the bus. */
__IO uint32_t MASK[4]; /*!< (@ 0x40000030) I2C Slave address mask register. This mask register is associated with I2ADR0 to determine an address match. The mask register has no effect when comparing to the General Call address (0000000). */
} LPC_I2C_Type;
// ------------------------------------------------------------------------------------------------
// ----- WWDT -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x Windowed Watchdog Timer (WWDT) Modification date=2/2/2011 Major revision=0 Minor revision=17 (WWDT)
*/
typedef struct { /*!< (@ 0x40004000) WWDT Structure */
__IO uint32_t MOD; /*!< (@ 0x40004000) Watchdog mode register. This register contains the basic mode and status of the Watchdog Timer. */
__IO uint32_t TC; /*!< (@ 0x40004004) Watchdog timer constant register. This register determines the time-out value. */
__IO uint32_t FEED; /*!< (@ 0x40004008) Watchdog feed sequence register. Writing 0xAA followed by 0x55 to this register reloads the Watchdog timer with the value contained in TC. */
__I uint32_t TV; /*!< (@ 0x4000400C) Watchdog timer value register. This register reads out the current value of the Watchdog timer. */
__IO uint32_t CLKSEL; /*!< (@ 0x40004010) Watchdog clock source selection register. */
__IO uint32_t WARNINT; /*!< (@ 0x40004014) Watchdog Warning Interrupt compare value. */
__IO uint32_t WINDOW; /*!< (@ 0x40004018) Watchdog Window compare value. */
} LPC_WWDT_Type;
// ------------------------------------------------------------------------------------------------
// ----- UART0 -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x UART0 with modem control Modification date=2/2/2011 Major revision=0 Minor revision=17 (UART0)
*/
typedef struct { /*!< (@ 0x40008000) UART0 Structure */
union {
__IO uint32_t DLL; /*!< (@ 0x40008000) Divisor Latch LSB. Least significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider. (DLAB = 1) */
__IO uint32_t THR; /*!< (@ 0x40008000) Transmit Holding Register. The next character to be transmitted is written here. (DLAB=0) */
__I uint32_t RBR; /*!< (@ 0x40008000) Receiver Buffer Register. Contains the next received character to be read. (DLAB=0) */
};
union {
__IO uint32_t IER; /*!< (@ 0x40008004) Interrupt Enable Register. Contains individual interrupt enable bits for the 7 potential UART interrupts. (DLAB=0) */
__IO uint32_t DLM; /*!< (@ 0x40008004) Divisor Latch MSB. Most significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider. (DLAB = 1) */
};
union {
__IO uint32_t FCR; /*!< (@ 0x40008008) FIFO Control Register. Controls UART FIFO usage and modes. */
__I uint32_t IIR; /*!< (@ 0x40008008) Interrupt ID Register. Identifies which interrupt(s) are pending. */
};
__IO uint32_t LCR; /*!< (@ 0x4000800C) Line Control Register. Contains controls for frame formatting and break generation. */
__IO uint32_t MCR; /*!< (@ 0x40008010) Modem control register */
__I uint32_t LSR; /*!< (@ 0x40008014) Line Status Register. Contains flags for transmit and receive status, including line errors. */
__I uint32_t MSR; /*!< (@ 0x40008018) Modem status register */
__IO uint32_t SCR; /*!< (@ 0x4000801C) Scratch Pad Register. Eight-bit temporary storage for software. */
__IO uint32_t ACR; /*!< (@ 0x40008020) Auto-baud Control Register. Contains controls for the auto-baud feature. */
__I uint32_t RESERVED0[1];
__IO uint32_t FDR; /*!< (@ 0x40008028) Fractional Divider Register. Generates a clock input for the baud rate divider. */
__I uint32_t RESERVED1[1];
__IO uint32_t TER; /*!< (@ 0x40008030) Transmit Enable Register. Turns off UART transmitter for use with software flow control. */
__I uint32_t RESERVED2[6];
__IO uint32_t RS485CTRL; /*!< (@ 0x4000804C) RS-485/EIA-485 Control. Contains controls to configure various aspects of RS-485/EIA-485 modes. */
__IO uint32_t RS485ADRMATCH; /*!< (@ 0x40008050) RS-485/EIA-485 address match. Contains the address match value for RS-485/EIA-485 mode. */
__IO uint32_t RS485DLY; /*!< (@ 0x40008054) RS-485/EIA-485 direction control delay. */
__I uint32_t FIFOLVL; /*!< (@ 0x40008058) FIFO Level register. Provides the current fill levels of the transmit and receive FIFOs. */
} LPC_UART0_Type;
// ------------------------------------------------------------------------------------------------
// ----- UART1 -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x UART1 Modification date=2/3/2011 Major revision=0 Minor revision=17 (UART1)
*/
typedef struct { /*!< (@ 0x4000C000) UART1 Structure */
union {
__IO uint32_t DLL; /*!< (@ 0x4000C000) Divisor Latch LSB. Least significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider. */
__IO uint32_t THR; /*!< (@ 0x4000C000) Transmit Holding Register. The next character to be transmitted is written here. */
__I uint32_t RBR; /*!< (@ 0x4000C000) Receiver Buffer Register. Contains the next received character to be read. */
};
union {
__IO uint32_t IER; /*!< (@ 0x4000C004) Interrupt Enable Register. Contains individual interrupt enable bits for the 7 potential UART interrupts. */
__IO uint32_t DLM; /*!< (@ 0x4000C004) Divisor Latch MSB. Most significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider. */
};
union {
__IO uint32_t FCR; /*!< (@ 0x4000C008) FIFO Control Register. Controls UART FIFO usage and modes. */
__I uint32_t IIR; /*!< (@ 0x4000C008) Interrupt ID Register. Identifies which interrupt(s) are pending. */
};
__IO uint32_t LCR; /*!< (@ 0x4000C00C) Line Control Register. Contains controls for frame formatting and break generation. */
__I uint32_t RESERVED0[1];
__I uint32_t LSR; /*!< (@ 0x4000C014) Line Status Register. Contains flags for transmit and receive status, including line errors. */
__I uint32_t RESERVED1[1];
__IO uint32_t SCR; /*!< (@ 0x4000C01C) Scratch Pad Register. Eight-bit temporary storage for software. */
__IO uint32_t ACR; /*!< (@ 0x4000C020) Auto-baud Control Register. Contains controls for the auto-baud feature. */
__IO uint32_t ICR; /*!< (@ 0x4000C024) IrDA Control Register. Enables and configures the IrDA mode. */
__IO uint32_t FDR; /*!< (@ 0x4000C028) Fractional Divider Register. Generates a clock input for the baud rate divider. */
__I uint32_t RESERVED2[1];
__IO uint32_t TER; /*!< (@ 0x4000C030) Transmit Enable Register. Turns off UART transmitter for use with software flow control. */
__I uint32_t RESERVED3[9];
__I uint32_t FIFOLVL; /*!< (@ 0x4000C058) FIFO Level register. Provides the current fill levels of the transmit and receive FIFOs. */
} LPC_UART1_Type;
// ------------------------------------------------------------------------------------------------
// ----- CT32B0 -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x 32-bit Counter/timer 0/1 (CT32B0/1) Modification date=2/3/2011 Major revision=0 Minor revision=17 (CT32B0)
*/
typedef struct { /*!< (@ 0x40018000) CT32B0 Structure */
__IO uint32_t IR; /*!< (@ 0x40018000) Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending. */
__IO uint32_t TCR; /*!< (@ 0x40018004) Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. */
__IO uint32_t TC; /*!< (@ 0x40018008) Timer Counter. The 32-bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR. */
__IO uint32_t PR; /*!< (@ 0x4001800C) Prescale Register. When the Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC. */
__IO uint32_t PC; /*!< (@ 0x40018010) Prescale Counter. The 32-bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface. */
__IO uint32_t MCR; /*!< (@ 0x40018014) Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. */
union {
__IO uint32_t MR[4]; /*!< (@ 0x40018018) Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */
struct{
__IO uint32_t MR0; /*!< (@ 0x40018018) Match Register. MR0 */
__IO uint32_t MR1; /*!< (@ 0x40018018) Match Register. MR1 */
__IO uint32_t MR2; /*!< (@ 0x40018018) Match Register. MR2 */
__IO uint32_t MR3; /*!< (@ 0x40018018) Match Register. MR3 */
};
};
__IO uint32_t CCR; /*!< (@ 0x40018028) Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place. */
union{
__I uint32_t CR[4]; /*!< (@ 0x4001802C) Capture Register. CR is loaded with the value of TC when there is an event on the CT32B_CAP input. */
struct{
__I uint32_t CR0; /*!< (@ 0x4001802C) Capture Register. CR 0 */
__I uint32_t CR1; /*!< (@ 0x4001802C) Capture Register. CR 1 */
__I uint32_t CR2; /*!< (@ 0x4001802C) Capture Register. CR 2 */
__I uint32_t CR3; /*!< (@ 0x4001802C) Capture Register. CR 3 */
};
};
__IO uint32_t EMR; /*!< (@ 0x4001803C) External Match Register. The EMR controls the match function and the external match pins CT32Bn_MAT[3:0]. */
__I uint32_t RESERVED0[12];
__IO uint32_t CTCR; /*!< (@ 0x40018070) Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting. */
__IO uint32_t PWMC; /*!< (@ 0x40018074) PWM Control Register. The PWMCON enables PWM mode for the external match pins CT32Bn_MAT[3:0]. */
} LPC_CTxxBx_Type;
// ------------------------------------------------------------------------------------------------
// ----- ADC -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x ADC Modification date=2/9/2011 Major revision=0 Minor revision=17 (ADC)
*/
typedef struct { /*!< (@ 0x40020000) ADC Structure */
__IO uint32_t CR; /*!< (@ 0x40020000) A/D Control Register. The CR register must be written to select the operating mode before A/D conversion can occur. */
__IO uint32_t GDR; /*!< (@ 0x40020004) A/D Global Data Register. Contains the result of the most recent A/D conversion. */
__I uint32_t RESERVED0[1];
__IO uint32_t INTEN; /*!< (@ 0x4002000C) A/D Interrupt Enable Register. This register contains enable bits that allow the DONE flag of each A/D channel to be included or excluded from contributing to the generation of an A/D interrupt. */
union{
__IO uint32_t DR[8]; /*!< (@ 0x40020010) A/D Channel Data Register. This register contains the result of the most recent conversion completed on channel. */
struct{
__IO uint32_t DR0; /*!< (@ 0x40020010) A/D Channel Data Register 0*/
__IO uint32_t DR1; /*!< (@ 0x40020010) A/D Channel Data Register 1*/
__IO uint32_t DR2; /*!< (@ 0x40020010) A/D Channel Data Register 2*/
__IO uint32_t DR3; /*!< (@ 0x40020010) A/D Channel Data Register 3*/
__IO uint32_t DR4; /*!< (@ 0x40020010) A/D Channel Data Register 4*/
__IO uint32_t DR5; /*!< (@ 0x40020010) A/D Channel Data Register 5*/
__IO uint32_t DR6; /*!< (@ 0x40020010) A/D Channel Data Register 6*/
__IO uint32_t DR7; /*!< (@ 0x40020010) A/D Channel Data Register 7*/
};
};
__I uint32_t STAT; /*!< (@ 0x40020030) A/D Status Register. This register contains DONE and OVERRUN flags for all of the A/D channels, as well as the A/D interrupt flag. */
__IO uint32_t TRM; /*!< (@ 0x40020034) A/D trim register */
} LPC_ADC_Type;
// ------------------------------------------------------------------------------------------------
// ----- PMU -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x Power Monitor Unit (PMU) Modification date=2/10/2011 Major revision=0 Minor revision=17 (PMU)
*/
typedef struct { /*!< (@ 0x40038000) PMU Structure */
__IO uint32_t PCON; /*!< (@ 0x40038000) Power control register */
union{
__IO uint32_t GPREG[4]; /*!< (@ 0x40038004) General purpose register */
struct{
__IO uint32_t GPREG0; /*!< (@ 0x40038004) General purpose register 0 */
__IO uint32_t GPREG1; /*!< (@ 0x40038004) General purpose register 1 */
__IO uint32_t GPREG2; /*!< (@ 0x40038004) General purpose register 2 */
__IO uint32_t GPREG3; /*!< (@ 0x40038004) General purpose register 3 */
};
};
__IO uint32_t SYSCFG; /*!< (@ 0x40038014) System configuration register (RTC clock control and hysteresis of the WAKEUP pin). */
} LPC_PMU_Type;
// ------------------------------------------------------------------------------------------------
// ----- SSP -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x SSP controller Modification date=2/10/2011 Major revision=0 Minor revision=17 (SSP)
*/
typedef struct { /*!< (@ 0x40040000) SSP Structure */
union{
__IO uint32_t CR[2]; /*!< (@ 0x40040000) Control Registers. */
struct{
__IO uint32_t CR0; /*!< (@ 0x40040000) Control Register 0. Selects the serial clock rate, bus type, and data size. */
__IO uint32_t CR1; /*!< (@ 0x40040004) Control Register 1. Selects master/slave and other modes. */
};
};
__IO uint32_t DR; /*!< (@ 0x40040008) Data Register. Writes fill the transmit FIFO, and reads empty the receive FIFO. */
__I uint32_t SR; /*!< (@ 0x4004000C) Status Register */
__IO uint32_t CPSR; /*!< (@ 0x40040010) Clock Prescale Register */
__IO uint32_t IMSC; /*!< (@ 0x40040014) Interrupt Mask Set and Clear Register */
__I uint32_t RIS; /*!< (@ 0x40040018) Raw Interrupt Status Register */
__I uint32_t MIS; /*!< (@ 0x4004001C) Masked Interrupt Status Register */
__IO uint32_t ICR; /*!< (@ 0x40040020) SSPICR Interrupt Clear Register */
__IO uint32_t DMACR; /*!< (@ 0x40040024) DMA Control Register */
} LPC_SSP_Type;
// ------------------------------------------------------------------------------------------------
// ----- IOCON -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x /O configuration (IOCONFIG) Modification date=2/11/2011 Major revision=1 Minor revision=0 (IOCON)
*/
typedef struct { /*!< (@ 0x40044000) IOCON Structure */
__I uint32_t RESERVED0[2];
__IO uint32_t PIO0_19; /*!< (@ 0x40044008) Configures pin PIO0_19/ACMP0_I0/CT32B0_1. */
__IO uint32_t PIO0_20; /*!< (@ 0x4004400C) Configures pin PIO0_20/ACMP0_I1/CT32B0_2. */
__IO uint32_t PIO0_21; /*!< (@ 0x40044010) Configures pin PIO0_21/ACMP0_I2/CT32B0_3. */
__IO uint32_t PIO0_22; /*!< (@ 0x40044014) Configures pin PIO0_22/ACMP0_I3. */
__IO uint32_t PIO0_23; /*!< (@ 0x40044018) Configures pin PIO0_23/ACMP1_I0/CT32B1_0. */
__IO uint32_t PIO0_24; /*!< (@ 0x4004401C) Configures pin PIO0_24/ACMP1_I1/CT32B1_1. */
__IO uint32_t SWDIO_PIO0_25; /*!< (@ 0x40044020) Configures pin SWDIO/ACMP1_I2/ CT32B1_2/PIO0_25. */
__IO uint32_t SWCLK_PIO0_26; /*!< (@ 0x40044024) Configures pin SWCLK/PIO0_26/ACMP1_I3/ CT32B1_3/PIO0_26 */
__IO uint32_t PIO0_27; /*!< (@ 0x40044028) Configures pin PIO0_27/ACMP0_O. */
__IO uint32_t PIO2_12; /*!< (@ 0x4004402C) Configures pin PIO2_12/RXD1. */
__IO uint32_t PIO2_13; /*!< (@ 0x40044030) Configures pin PIO2_13/TXD1. */
__IO uint32_t PIO2_14; /*!< (@ 0x40044034) Configures pin PIO2_14. */
__IO uint32_t PIO2_15; /*!< (@ 0x40044038) Configures pin PIO2_15. */
__IO uint32_t PIO0_28; /*!< (@ 0x4004403C) Configures pin PIO0_28/ACMP1_O/CT16B0_0. */
__IO uint32_t PIO0_29; /*!< (@ 0x40044040) Configures pin PIO0_29/ROSC/CT16B0_1. */
__IO uint32_t PIO0_0; /*!< (@ 0x40044044) Configures pin PIO0_0/ RTS0. */
__IO uint32_t PIO0_1; /*!< (@ 0x40044048) Configures pin PIO0_1CT32B0_0/RXD0. */
__IO uint32_t PIO0_2; /*!< (@ 0x4004404C) Configures pin PIO0_2/TXD0/CT32B0_1. */
__I uint32_t RESERVED1[1];
__IO uint32_t PIO0_3; /*!< (@ 0x40044054) Configures pin PIO0_3/DTR0/CT32B0_2. */
__IO uint32_t PIO0_4; /*!< (@ 0x40044058) Configures pin PIO0_4/ DSR0/CT32B0_3. */
__IO uint32_t PIO0_5; /*!< (@ 0x4004405C) Configures pin PIO0_5. */
__IO uint32_t PIO0_6; /*!< (@ 0x40044060) Configures pin PIO0_6/RI0/CT32B1_0. */
__IO uint32_t PIO0_7; /*!< (@ 0x40044064) Configures pin PIO0_7CTS0/CT32B1_1. */
__IO uint32_t PIO0_8; /*!< (@ 0x40044068) Configures pin PIO0_8/RXD1/CT32B1_2. */
__IO uint32_t PIO0_9; /*!< (@ 0x4004406C) Configures pin PIO0_9/TXD1/CT32B1_3. */
__IO uint32_t PIO2_0; /*!< (@ 0x40044070) Configures pin PIO2_0/CT16B0_0/ RTS0. */
__IO uint32_t PIO2_1; /*!< (@ 0x40044074) Configures pin PIO2_1/CT16B0_1/RXD0. */
__IO uint32_t PIO2_2; /*!< (@ 0x40044078) Configures pin PIO2_2/CT16B1_0/TXD0. */
__IO uint32_t PIO2_3; /*!< (@ 0x4004407C) Configures pin PIO2_3/CT16B1_1/DTR0. */
__IO uint32_t PIO2_4; /*!< (@ 0x40044080) Configures pin PIO2_4/CT32B0_0/CTS0. */
__IO uint32_t PIO2_5; /*!< (@ 0x40044084) Configures pin PIO2_5/CT32B0_1/ DCD0. */
__IO uint32_t PIO2_6; /*!< (@ 0x40044088) Configures pin PIO2_6/CT32B0_2/RI0. */
__IO uint32_t PIO2_7; /*!< (@ 0x4004408C) Configures pin PIO2_7/CT32B0_3/DSR0. */
__IO uint32_t PIO0_10; /*!< (@ 0x40044090) Configures pin PIO0_10/SCL. */
__IO uint32_t PIO0_11; /*!< (@ 0x40044094) Configures pin PIO0_11/SDA/CT16B0_0. */
__IO uint32_t PIO0_12; /*!< (@ 0x40044098) Configures pin PIO0_12/CLKOUT/CT16B0_1. */
__IO uint32_t RESET_PIO0_13; /*!< (@ 0x4004409C) Configures pin RESET/PIO0_13. */
__IO uint32_t PIO0_14; /*!< (@ 0x400440A0) Configures pin PIO0_14/SSP_CLK. */
__IO uint32_t PIO0_15; /*!< (@ 0x400440A4) Configures pin PIO0_15/SSP_SSEL/CT16B1_0. */
__IO uint32_t PIO0_16; /*!< (@ 0x400440A8) Configures pin PIO0_16/SSP_MISO/CT16B1_1. */
__IO uint32_t PIO0_17; /*!< (@ 0x400440AC) Configures pin PIO0_17/SSP_MOSI. */
__IO uint32_t PIO0_18; /*!< (@ 0x400440B0) Configures pin PIO0_18/SWCLK/CT32B0_0. */
__IO uint32_t R_PIO0_30; /*!< (@ 0x400440B4) Configures pin R/PIO0_30/AD0. */
__IO uint32_t R_PIO0_31; /*!< (@ 0x400440B8) Configures pin R/PIO0_31/AD1. */
__IO uint32_t R_PIO1_0; /*!< (@ 0x400440BC) Configures pin R/PIO1_0/AD2. */
__IO uint32_t R_PIO1_1; /*!< (@ 0x400440C0) Configures pin R/PIO1_1/AD3. */
__IO uint32_t PIO1_2; /*!< (@ 0x400440C4) Configures pin PIO1_2/SWDIO/AD4. */
__IO uint32_t PIO1_3; /*!< (@ 0x400440C8) Configures pin PIO1_3/AD5/WAKEUP. */
__IO uint32_t PIO1_4; /*!< (@ 0x400440CC) Configures pin PIO1_4/AD6 */
__IO uint32_t PIO1_5; /*!< (@ 0x400440D0) Configures pin PIO1_5/AD7/CT16B1_0. */
__IO uint32_t PIO1_6; /*!< (@ 0x400440D4) Configures pin PIO1_6/CT16B1_1. */
__I uint32_t RESERVED2[2];
__IO uint32_t PIO2_8; /*!< (@ 0x400440E0) Configures pin PIO2_8/CT32B1_0. */
__IO uint32_t PIO2_9; /*!< (@ 0x400440E4) Configures pin PIO2_9/CT32B1_1. */
__IO uint32_t PIO2_10; /*!< (@ 0x400440E8) Configures pin PIO2_10/CT32B1_2/TXD1. */
__IO uint32_t PIO2_11; /*!< (@ 0x400440EC) Configures pin PIO2_11/CT32B1_3/RXD1. */
} LPC_IOCON_Type;
// ------------------------------------------------------------------------------------------------
// ----- SYSCON -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x System control (SYSCON) Modification date=2/10/2011 Major revision=1 Minor revision=0 (SYSCON)
*/
typedef struct { /*!< (@ 0x40048000) SYSCON Structure */
__IO uint32_t SYSMEMREMAP; /*!< (@ 0x40048000) System memory remap */
__IO uint32_t PRESETCTRL; /*!< (@ 0x40048004) Peripheral reset control and flash timing overwrite */
__IO uint32_t SYSPLLCTRL; /*!< (@ 0x40048008) System PLL control */
__I uint32_t SYSPLLSTAT; /*!< (@ 0x4004800C) System PLL status */
__I uint32_t RESERVED0[4];
__IO uint32_t SYSOSCCTRL; /*!< (@ 0x40048020) System oscillator control */
__IO uint32_t WDTOSCCTRL; /*!< (@ 0x40048024) Watchdog oscillator control */
__IO uint32_t IRCCTRL; /*!< (@ 0x40048028) IRC control */
__I uint32_t RESERVED1[1];
__IO uint32_t SYSRESSTAT; /*!< (@ 0x40048030) System reset status register */
__I uint32_t RESERVED2[3];
__IO uint32_t SYSPLLCLKSEL; /*!< (@ 0x40048040) System PLL clock source select */
__IO uint32_t SYSPLLCLKUEN; /*!< (@ 0x40048044) System PLL clock source update enable */
__I uint32_t RESERVED3[10];
__IO uint32_t MAINCLKSEL; /*!< (@ 0x40048070) Main clock source select */
__IO uint32_t MAINCLKUEN; /*!< (@ 0x40048074) Main clock source update enable */
__IO uint32_t SYSAHBCLKDIV; /*!< (@ 0x40048078) System AHB clock divider */
__I uint32_t RESERVED4[1];
__IO uint32_t SYSAHBCLKCTRL; /*!< (@ 0x40048080) System AHB clock control */
__I uint32_t RESERVED5[4];
__IO uint32_t SSPCLKDIV; /*!< (@ 0x40048094) SSP clock divder */
__IO uint32_t UART0CLKDIV; /*!< (@ 0x40048098) UART0 clock divider */
__IO uint32_t UART1CLKDIV; /*!< (@ 0x4004809C) UART1 clock divider */
__IO uint32_t RTCCLKDIV; /*!< (@ 0x400480A0) RTC clock divider */
__I uint32_t RESERVED6[15];
__IO uint32_t CLKOUTCLKSEL; /*!< (@ 0x400480E0) CLKOUT clock source select */
__IO uint32_t CLKOUTUEN; /*!< (@ 0x400480E4) CLKOUT clock source update enable */
__IO uint32_t CLKOUTDIV; /*!< (@ 0x400480E8) CLKOUT clock divider */
__I uint32_t RESERVED7[5];
__I uint32_t PIOPORCAP0; /*!< (@ 0x40048100) POR captured PIO status 0 */
__I uint32_t PIOPORCAP1; /*!< (@ 0x40048104) POR captured PIO status 1 */
__I uint32_t RESERVED8[11];
__IO uint32_t IOCONFIGCLKDIV6; /*!< (@ 0x40048134) Peripheral clock 6 to the IOCONFIG block for programmable glitch filter */
__IO uint32_t IOCONFIGCLKDIV5; /*!< (@ 0x40048138) Peripheral clock 5 to the IOCONFIG block for programmable glitch filter */
__IO uint32_t IOCONFIGCLKDIV4; /*!< (@ 0x4004813C) Peripheral clock 4 to the IOCONFIG block for programmable glitch filter */
__IO uint32_t IOCONFIGCLKDIV3; /*!< (@ 0x40048140) Peripheral clock 3to the IOCONFIG block for programmable glitch filter */
__IO uint32_t IOCONFIGCLKDIV2; /*!< (@ 0x40048144) Peripheral clock 2 to the IOCONFIG block for programmable glitch filter */
__IO uint32_t IOCONFIGCLKDIV1; /*!< (@ 0x40048148) Peripheral clock 1 to the IOCONFIG block for programmable glitch filter */
__IO uint32_t IOCONFIGCLKDIV0; /*!< (@ 0x4004814C) Peripheral clock 0 to the IOCONFIG block for programmable glitch filter */
__IO uint32_t BODCTRL; /*!< (@ 0x40048150) BOD control */
__IO uint32_t SYSTCKCAL; /*!< (@ 0x40048154) System tick counter calibration */
__IO uint32_t AHBPRIO; /*!< (@ 0x40048158) AHB priority setting */
__I uint32_t RESERVED9[5];
__IO uint32_t IRQLATENCY; /*!< (@ 0x40048170) IQR delay. Allows trade-off between interrupt latency and determinism. */
__IO uint32_t INTNMI; /*!< (@ 0x40048174) NMI interrupt source configuration control */
__I uint32_t RESERVED10[34];
__IO uint32_t STARTAPRP0; /*!< (@ 0x40048200) Start logic edge control register 0 */
__IO uint32_t STARTERP0; /*!< (@ 0x40048204) Start logic signal enable register 0 */
__IO uint32_t STARTRSRP0CLR; /*!< (@ 0x40048208) Start logic reset register 0 */
__I uint32_t STARTSRP0; /*!< (@ 0x4004820C) Start logic status register 0 */
__IO uint32_t STARTAPRP1; /*!< (@ 0x40048210) Start logic edge control register 1; peripheral interrupts */
__IO uint32_t STARTERP1; /*!< (@ 0x40048214) Start logic signal enable register 1; peripheral interrupts */
__IO uint32_t STARTRSRP1CLR; /*!< (@ 0x40048218) Start logic reset register 1; peripheral interrupts */
__I uint32_t STARTSRP1; /*!< (@ 0x4004821C) Start logic status register 1; peripheral interrupts */
__I uint32_t RESERVED11[4];
__IO uint32_t PDSLEEPCFG; /*!< (@ 0x40048230) Power-down states in Deep-sleep mode */
__IO uint32_t PDAWAKECFG; /*!< (@ 0x40048234) Power-down states after wake-up from Deep-sleep mode */
__IO uint32_t PDRUNCFG; /*!< (@ 0x40048238) Power-down configuration register */
__I uint32_t RESERVED12[110];
__I uint32_t DEVICE_ID; /*!< (@ 0x400483F4) Device ID */
} LPC_SYSCON_Type;
// ------------------------------------------------------------------------------------------------
// ----- MICRO_DMA -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x General purpose micro DMA controller Modification date=2/10/2011 Major revision=0 Minor revision=17 (MICRO_DMA)
*/
typedef struct { /*!< (@ 0x4004C000) MICRO_DMA Structure */
__I uint32_t DMA_STATUS; /*!< (@ 0x4004C000) DMA status register */
__IO uint32_t DMA_CFG; /*!< (@ 0x4004C004) DMA configuration register */
__IO uint32_t CTRL_BASE_PTR; /*!< (@ 0x4004C008) Channel control base pointer register */
__I uint32_t ATL_CTRL_BASE_PTR; /*!< (@ 0x4004C00C) Channel alternate control base pointer register */
__I uint32_t DMA_WAITONREQ_STATUS; /*!< (@ 0x4004C010) Channel wait on request status register */
__IO uint32_t CHNL_SW_REQUEST; /*!< (@ 0x4004C014) Channel software request register */
__IO uint32_t CHNL_USEBURST_SET; /*!< (@ 0x4004C018) Channel useburst set register */
__IO uint32_t CHNL_USEBURST_CLR; /*!< (@ 0x4004C01C) Channel useburst clear register */
__IO uint32_t CHNL_REQ_MASK_SET; /*!< (@ 0x4004C020) Channel request mask set register */
__IO uint32_t CHNL_REQ_MASK_CLR; /*!< (@ 0x4004C024) Channel request mask clear register */
__IO uint32_t CHNL_ENABLE_SET; /*!< (@ 0x4004C028) Channel enable set register */
__IO uint32_t CHNL_ENABLE_CLR; /*!< (@ 0x4004C02C) Channel enable clear register */
__IO uint32_t CHNL_PRI_ALT_SET; /*!< (@ 0x4004C030) Channel primary-alternate set register */
__IO uint32_t CHNL_PRI_ALT_CLR; /*!< (@ 0x4004C034) Channel primary-alternate clear register */
__IO uint32_t CHNL_PRIORITY_SET; /*!< (@ 0x4004C038) Channel priority set register */
__IO uint32_t CHNL_PRIORITY_CLR; /*!< (@ 0x4004C03C) Channel priority clear register */
__I uint32_t RESERVED0[3];
__IO uint32_t ERR_CLR; /*!< (@ 0x4004C04C) Bus error clear register */
__I uint32_t RESERVED1[12];
__IO uint32_t CHNL_IRQ_STATUS; /*!< (@ 0x4004C080) Channel DMA interrupt status register */
__IO uint32_t IRQ_ERR_ENABLE; /*!< (@ 0x4004C084) DMA error interrupt enable register */
__IO uint32_t CHNL_IRQ_ENABLE; /*!< (@ 0x4004C088) Channel DMA interrupt enable register */
} LPC_MICRO_DMA_Type;
// ------------------------------------------------------------------------------------------------
// ----- RTC -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x Real-Time Clock (RTC) Modification date=2/11/2011 Major revision=1 Minor revision=0 (RTC)
*/
typedef struct { /*!< (@ 0x40050000) RTC Structure */
__I uint32_t DR; /*!< (@ 0x40050000) Data register */
__IO uint32_t MR; /*!< (@ 0x40050004) Match register */
__IO uint32_t LR; /*!< (@ 0x40050008) Load register */
__IO uint32_t CR; /*!< (@ 0x4005000C) Control register */
__IO uint32_t ICSC; /*!< (@ 0x40050010) Interrupt control set/clear register */
__I uint32_t RIS; /*!< (@ 0x40050014) Raw interrupt status register */
__I uint32_t MIS; /*!< (@ 0x40050018) Masked interrupt status register */
__IO uint32_t ICR; /*!< (@ 0x4005001C) Interrupt clear register */
} LPC_RTC_Type;
// ------------------------------------------------------------------------------------------------
// ----- ACOMP -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x Comparator Modification date=2/11/2011 Major revision=0 Minor revision=17 (ACOMP)
*/
typedef struct { /*!< (@ 0x40054000) ACOMP Structure */
__IO uint32_t CMP; /*!< (@ 0x40054000) Comparator control register */
__IO uint32_t VLAD; /*!< (@ 0x40054004) Voltage ladder register */
} LPC_ACOMP_Type;
// ------------------------------------------------------------------------------------------------
// ----- GPIO0/1/2 -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x General Purpose I/O (GPIO) Modification date=2/11/2011 Major revision=0 Minor revision=17 (GPIO0)
*/
typedef struct { /*!< (@ 0x500X0000) GPIO0 Structure */
__IO uint32_t MASK; /*!< (@ 0x500X0000) Pin value mask register. Affects operations on PIN, OUT, SET, CLR, and NOT registers. */
__I uint32_t PIN; /*!< (@ 0x500X0004) Pin value register. */
__IO uint32_t OUT; /*!< (@ 0x500X0008) Pin output value register. */
__IO uint32_t SET; /*!< (@ 0x500X000C) Pin output value set register. */
__IO uint32_t CLR; /*!< (@ 0x500X0010) Pin output value clear register. */
__IO uint32_t NOT; /*!< (@ 0x500X0014) Pin output value invert register. */
__I uint32_t RESERVED0[2];
__IO uint32_t DIR; /*!< (@ 0x500X0020) Data direction register. */
__IO uint32_t IS; /*!< (@ 0x500X0024) Interrupt sense register. */
__IO uint32_t IBE; /*!< (@ 0x500X0028) Interrupt both edges register. */
__IO uint32_t IEV; /*!< (@ 0x500X002C) Interrupt event register. */
__IO uint32_t IE; /*!< (@ 0x500X0030) Interrupt mask register. */
__I uint32_t RIS; /*!< (@ 0x500X0034) Raw interrupt status register. */
__I uint32_t MIS; /*!< (@ 0x500X0038) Masked interrupt status register. */
__IO uint32_t IC; /*!< (@ 0x5000003C) Interrupt clear register. */
} LPC_GPIO_Type;
// ------------------------------------------------------------------------------------------------
// ----- FLASHCTRL -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x System control (SYSCON) Modification date=2/16/2011 Major revision=1 Minor revision=0 (FLASHCTRL)
*/
typedef struct { /*!< (@ 0x50060000) FLASHCTRL Structure */
__I uint32_t RESERVED0[10];
__IO uint32_t FLASHCFG; /*!< (@ 0x50060028) Flash read cycle configuration */
} LPC_FLASHCTRL_Type;
// ------------------------------------------------------------------------------------------------
// ----- CRC -----
// ------------------------------------------------------------------------------------------------
/**
* @brief Product name title=UM10441 Chapter title=LPC122x CRC engine Modification date=2/11/2011 Major revision=0 Minor revision=17 (CRC)
*/
typedef struct { /*!< (@ 0x50070000) CRC Structure */
__IO uint32_t MODE; /*!< (@ 0x50070000) CRC mode register */
__IO uint32_t SEED; /*!< (@ 0x50070004) CRC seed register */
union {
union{
__O uint8_t WR_DATA_8; /*!< (@ 0x50070008) CRC 8-bit data register */
__O uint16_t WR_DATA_16; /*!< (@ 0x50070008) CRC 16-bit data register */
__O uint32_t WR_DATA_32; /*!< (@ 0x50070008) CRC 32-bit data register */
};
__I uint32_t SUM; /*!< (@ 0x50070008) CRC checksum register */
};
} LPC_CRC_Type;
#if defined ( __CC_ARM )
#pragma no_anon_unions
#endif
// ------------------------------------------------------------------------------------------------
// ----- Peripheral memory map -----
// ------------------------------------------------------------------------------------------------
#define LPC_I2C_BASE (0x40000000)
#define LPC_WWDT_BASE (0x40004000)
#define LPC_UART0_BASE (0x40008000)
#define LPC_UART1_BASE (0x4000C000)
#define LPC_CT16B0_BASE (0x40010000)
#define LPC_CT16B1_BASE (0x40014000)
#define LPC_CT32B0_BASE (0x40018000)
#define LPC_CT32B1_BASE (0x4001C000)
#define LPC_ADC_BASE (0x40020000)
#define LPC_PMU_BASE (0x40038000)
#define LPC_SSP_BASE (0x40040000)
#define LPC_IOCON_BASE (0x40044000)
#define LPC_SYSCON_BASE (0x40048000)
#define LPC_MICRO_DMA_BASE (0x4004C000)
#define LPC_RTC_BASE (0x40050000)
#define LPC_ACOMP_BASE (0x40054000)
#define LPC_GPIO0_BASE (0x50000000)
#define LPC_GPIO1_BASE (0x50010000)
#define LPC_GPIO2_BASE (0x50020000)
#define LPC_FLASHCTRL_BASE (0x50060000)
#define LPC_CRC_BASE (0x50070000)
// ------------------------------------------------------------------------------------------------
// ----- Peripheral declaration -----
// ------------------------------------------------------------------------------------------------
#define LPC_I2C ((LPC_I2C_Type *) LPC_I2C_BASE)
#define LPC_WWDT ((LPC_WWDT_Type *) LPC_WWDT_BASE)
#define LPC_UART0 ((LPC_UART0_Type *) LPC_UART0_BASE)
#define LPC_UART1 ((LPC_UART1_Type *) LPC_UART1_BASE)
#define LPC_CT16B0 ((LPC_CTxxBx_Type *) LPC_CT16B0_BASE)
#define LPC_CT16B1 ((LPC_CTxxBx_Type *) LPC_CT16B1_BASE)
#define LPC_CT32B0 ((LPC_CTxxBx_Type *) LPC_CT32B0_BASE)
#define LPC_CT32B1 ((LPC_CTxxBx_Type *) LPC_CT32B1_BASE)
#define LPC_ADC ((LPC_ADC_Type *) LPC_ADC_BASE)
#define LPC_PMU ((LPC_PMU_Type *) LPC_PMU_BASE)
#define LPC_SSP ((LPC_SSP_Type *) LPC_SSP_BASE)
#define LPC_IOCON ((LPC_IOCON_Type *) LPC_IOCON_BASE)
#define LPC_SYSCON ((LPC_SYSCON_Type *) LPC_SYSCON_BASE)
#define LPC_MICRO_DMA ((LPC_MICRO_DMA_Type *) LPC_MICRO_DMA_BASE)
#define LPC_RTC ((LPC_RTC_Type *) LPC_RTC_BASE)
#define LPC_ACOMP ((LPC_ACOMP_Type *) LPC_ACOMP_BASE)
#define LPC_GPIO0 ((LPC_GPIO_Type *) LPC_GPIO0_BASE)
#define LPC_GPIO1 ((LPC_GPIO_Type *) LPC_GPIO1_BASE)
#define LPC_GPIO2 ((LPC_GPIO_Type *) LPC_GPIO2_BASE)
#define LPC_FLASHCTRL ((LPC_FLASHCTRL_Type *) LPC_FLASHCTRL_BASE)
#define LPC_CRC ((LPC_CRC_Type *) LPC_CRC_BASE)
/** @} */ /* End of group Device_Peripheral_Registers */
/** @} */ /* End of group (null) */
/** @} */ /* End of group LPC122x */
#ifdef __cplusplus
}
#endif
#endif // __LPC122X_H__
| 69.239669 | 302 | 0.537976 | [
"vector"
] |
cfba23c4da625301eac5ba11953cea7a3d9af14c | 3,587 | h | C | src/include/metrics/transaction_metric.h | portablesounds/terrier | 313c83f04fa3a38c48dfb6aa8f140c8dba709b65 | [
"MIT"
] | 1 | 2019-03-08T18:59:57.000Z | 2019-03-08T18:59:57.000Z | src/include/metrics/transaction_metric.h | portablesounds/terrier | 313c83f04fa3a38c48dfb6aa8f140c8dba709b65 | [
"MIT"
] | 34 | 2019-03-21T20:47:59.000Z | 2019-05-17T06:06:46.000Z | src/include/metrics/transaction_metric.h | portablesounds/terrier | 313c83f04fa3a38c48dfb6aa8f140c8dba709b65 | [
"MIT"
] | 1 | 2021-11-21T12:50:38.000Z | 2021-11-21T12:50:38.000Z | #pragma once
#include <algorithm>
#include <chrono> //NOLINT
#include <fstream>
#include <list>
#include <utility>
#include <vector>
#include "catalog/catalog_defs.h"
#include "metrics/abstract_metric.h"
#include "metrics/metrics_util.h"
#include "transaction/transaction_defs.h"
namespace terrier::metrics {
/**
* Raw data object for holding stats collected at transaction level
*/
class TransactionMetricRawData : public AbstractRawData {
public:
void Aggregate(AbstractRawData *const other) override {
auto other_db_metric = dynamic_cast<TransactionMetricRawData *>(other);
if (!other_db_metric->begin_data_.empty()) {
begin_data_.splice(begin_data_.cbegin(), other_db_metric->begin_data_);
}
if (!other_db_metric->commit_data_.empty()) {
commit_data_.splice(commit_data_.cbegin(), other_db_metric->commit_data_);
}
}
/**
* @return the type of the metric this object is holding the data for
*/
MetricsComponent GetMetricType() const override { return MetricsComponent::TRANSACTION; }
/**
* Writes the data out to ofstreams
* @param outfiles vector of ofstreams to write to that have been opened by the MetricsManager
*/
void ToCSV(std::vector<std::ofstream> *const outfiles) final {
TERRIER_ASSERT(outfiles->size() == FILES.size(), "Number of files passed to metric is wrong.");
TERRIER_ASSERT(std::count_if(outfiles->cbegin(), outfiles->cend(),
[](const std::ofstream &outfile) { return !outfile.is_open(); }) == 0,
"Not all files are open.");
for (const auto &data : begin_data_) {
((*outfiles)[0]) << data.now_ << "," << data.elapsed_us_ << "," << data.txn_start_ << std::endl;
}
for (const auto &data : commit_data_) {
((*outfiles)[1]) << data.now_ << "," << data.elapsed_us_ << "," << data.txn_start_ << std::endl;
}
begin_data_.clear();
commit_data_.clear();
}
/**
* Files to use for writing to CSV.
*/
static constexpr std::array<std::string_view, 2> FILES = {"./txn_begin.csv", "./txn_commit.csv"};
/**
* Columns to use for writing to CSV.
*/
static constexpr std::array<std::string_view, 2> COLUMNS = {"now,elapsed_us,txn_start", "now,elapsed_us,txn_start"};
private:
friend class TransactionMetric;
FRIEND_TEST(MetricsTests, TransactionCSVTest);
void RecordBeginData(const uint64_t elapsed_us, const transaction::timestamp_t txn_start) {
begin_data_.emplace_back(elapsed_us, txn_start);
}
void RecordCommitData(const uint64_t elapsed_us, const transaction::timestamp_t txn_start) {
commit_data_.emplace_back(elapsed_us, txn_start);
}
struct Data {
Data(const uint64_t elapsed_us, const transaction::timestamp_t txn_start)
: now_(MetricsUtil::Now()), elapsed_us_(elapsed_us), txn_start_(txn_start) {}
const uint64_t now_;
const uint64_t elapsed_us_;
const transaction::timestamp_t txn_start_;
};
std::list<Data> begin_data_;
std::list<Data> commit_data_;
};
/**
* Metrics for the transaction components of the system: currently begin gate and table latch
*/
class TransactionMetric : public AbstractMetric<TransactionMetricRawData> {
private:
friend class MetricsStore;
void RecordBeginData(const uint64_t elapsed_us, const transaction::timestamp_t txn_start) {
GetRawData()->RecordBeginData(elapsed_us, txn_start);
}
void RecordCommitData(const uint64_t elapsed_us, const transaction::timestamp_t txn_start) {
GetRawData()->RecordCommitData(elapsed_us, txn_start);
}
};
} // namespace terrier::metrics
| 33.839623 | 118 | 0.703095 | [
"object",
"vector"
] |
cfbc2c020ab0183794b83c72760a448335141531 | 111,570 | c | C | ncgen/ncgenl.c | mandrakos/netcdf-c | b9bb44f58508c293d437aaa698fbc419bede47fe | [
"BSD-3-Clause"
] | 1 | 2021-01-10T22:59:50.000Z | 2021-01-10T22:59:50.000Z | ncgen/ncgenl.c | mandrakos/netcdf-c | b9bb44f58508c293d437aaa698fbc419bede47fe | [
"BSD-3-Clause"
] | 36 | 2020-04-24T18:31:01.000Z | 2020-05-19T00:21:38.000Z | ncgen/ncgenl.c | mandrakos/netcdf-c | b9bb44f58508c293d437aaa698fbc419bede47fe | [
"BSD-3-Clause"
] | 3 | 2020-04-24T18:01:32.000Z | 2020-05-18T19:51:57.000Z |
#line 3 "ncgenl.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define yy_create_buffer ncg_create_buffer
#define yy_delete_buffer ncg_delete_buffer
#define yy_flex_debug ncg_flex_debug
#define yy_init_buffer ncg_init_buffer
#define yy_flush_buffer ncg_flush_buffer
#define yy_load_buffer_state ncg_load_buffer_state
#define yy_switch_to_buffer ncg_switch_to_buffer
#define yyin ncgin
#define yyleng ncgleng
#define yylex ncglex
#define yylineno ncglineno
#define yyout ncgout
#define yyrestart ncgrestart
#define yytext ncgtext
#define yywrap ncgwrap
#define yyalloc ncgalloc
#define yyrealloc ncgrealloc
#define yyfree ncgfree
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 0
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE ncgrestart(ncgin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern yy_size_t ncgleng;
extern FILE *ncgin, *ncgout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up ncgtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up ncgtext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via ncgrestart()), so that the user can continue scanning by
* just pointing ncgin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*
* Returns the top of the stack, or NULL.
*/
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* yy_hold_char holds the character lost when ncgtext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t ncgleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow ncgwrap()'s to do buffer switches
* instead of setting up a fresh ncgin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void ncgrestart (FILE *input_file );
void ncg_switch_to_buffer (YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE ncg_create_buffer (FILE *file,int size );
void ncg_delete_buffer (YY_BUFFER_STATE b );
void ncg_flush_buffer (YY_BUFFER_STATE b );
void ncgpush_buffer_state (YY_BUFFER_STATE new_buffer );
void ncgpop_buffer_state (void );
static void ncgensure_buffer_stack (void );
static void ncg_load_buffer_state (void );
static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );
#define YY_FLUSH_BUFFER ncg_flush_buffer(YY_CURRENT_BUFFER )
YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len );
void *ncgalloc (yy_size_t );
void *ncgrealloc (void *,yy_size_t );
void ncgfree (void * );
#define yy_new_buffer ncg_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
ncgensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
ncg_create_buffer(ncgin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
ncgensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
ncg_create_buffer(ncgin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
typedef unsigned char YY_CHAR;
FILE *ncgin = (FILE *) 0, *ncgout = (FILE *) 0;
typedef int yy_state_type;
extern int ncglineno;
int ncglineno = 1;
extern char *ncgtext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
#define yytext_ptr ncgtext
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
#if defined(__GNUC__) && __GNUC__ >= 3
__attribute__((__noreturn__))
#endif
static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up ncgtext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
ncgleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 49
#define YY_END_OF_BUFFER 50
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
{
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[422] =
{ 0,
0, 0, 46, 46, 0, 0, 50, 48, 1, 44,
48, 48, 48, 48, 38, 32, 36, 36, 35, 35,
35, 35, 35, 35, 35, 48, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 48, 48, 48, 46, 49, 34, 49, 1,
0, 3, 0, 0, 0, 38, 36, 0, 0, 38,
38, 0, 39, 45, 2, 32, 0, 0, 0, 0,
36, 36, 36, 36, 0, 35, 0, 0, 0, 0,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 0, 0, 46, 0, 47, 34, 40,
0, 0, 0, 0, 38, 0, 0, 38, 2, 32,
0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
35, 35, 35, 35, 35, 35, 31, 28, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
14, 35, 28, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 0, 43, 0, 0, 38,
0, 32, 0, 0, 0, 0, 0, 0, 0, 4,
37, 37, 0, 35, 35, 29, 35, 35, 30, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 10, 9, 35, 35, 35, 35, 6, 35,
35, 35, 35, 14, 35, 35, 35, 8, 35, 35,
35, 35, 35, 15, 35, 35, 35, 35, 0, 0,
29, 0, 32, 0, 0, 0, 0, 0, 0, 0,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 24,
35, 35, 35, 16, 35, 35, 35, 35, 12, 35,
35, 35, 11, 35, 35, 15, 35, 35, 35, 41,
42, 0, 0, 0, 0, 35, 35, 35, 26, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 18, 25, 35, 7, 19,
5, 21, 17, 35, 35, 13, 35, 0, 0, 35,
35, 35, 35, 35, 35, 35, 35, 33, 35, 35,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
0, 35, 27, 35, 35, 35, 35, 35, 35, 35,
35, 35, 5, 35, 35, 35, 35, 27, 27, 20,
35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 23, 35, 35,
35, 22, 35, 35, 35, 35, 35, 35, 35, 35,
0
} ;
static yyconst YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 5, 6, 5, 5, 5, 5, 7, 5,
5, 8, 9, 5, 10, 11, 12, 13, 14, 15,
16, 17, 14, 18, 14, 19, 19, 20, 5, 5,
5, 5, 5, 21, 22, 23, 24, 25, 26, 27,
28, 28, 29, 28, 28, 30, 31, 32, 28, 33,
28, 28, 34, 35, 36, 37, 28, 38, 28, 28,
5, 39, 5, 5, 40, 5, 41, 42, 43, 44,
45, 46, 47, 48, 49, 28, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 28, 38,
62, 63, 64, 5, 5, 5, 1, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 1, 1, 1, 1, 1, 1,
1, 1, 1, 67, 67, 67, 67, 67, 67, 67,
67, 67, 67, 67, 67, 67, 67, 67, 67, 68,
68, 68, 68, 68, 68, 68, 68, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst YY_CHAR yy_meta[69] =
{ 0,
1, 1, 2, 1, 1, 1, 3, 4, 5, 5,
6, 7, 8, 8, 8, 8, 8, 8, 8, 1,
5, 9, 9, 9, 9, 10, 9, 11, 12, 13,
11, 11, 11, 13, 11, 11, 11, 11, 11, 11,
9, 9, 9, 9, 10, 9, 11, 11, 11, 11,
13, 11, 11, 11, 11, 11, 11, 13, 11, 11,
11, 11, 11, 14, 1, 11, 11, 11
} ;
static yyconst flex_uint16_t yy_base[440] =
{ 0,
0, 0, 325, 321, 264, 255, 318, 2387, 67, 2387,
64, 269, 61, 62, 95, 77, 136, 259, 51, 61,
188, 97, 118, 150, 65, 195, 233, 153, 183, 222,
241, 202, 207, 213, 238, 246, 243, 257, 268, 264,
298, 276, 221, 219, 218, 270, 236, 0, 2387, 79,
87, 2387, 244, 238, 344, 0, 206, 358, 190, 0,
2387, 370, 2387, 2387, 0, 342, 377, 177, 175, 174,
200, 2387, 54, 377, 0, 254, 397, 171, 170, 169,
358, 85, 404, 373, 376, 398, 391, 406, 412, 417,
421, 428, 432, 451, 454, 443, 473, 476, 486, 489,
494, 499, 511, 508, 520, 530, 546, 542, 550, 553,
556, 560, 563, 566, 586, 598, 602, 605, 608, 623,
612, 644, 647, 168, 167, 222, 217, 2387, 0, 2387,
221, 680, 219, 703, 710, 179, 728, 749, 0, 691,
666, 765, 159, 158, 135, 130, 128, 651, 125, 123,
739, 716, 721, 751, 764, 770, 757, 775, 783, 760,
794, 800, 806, 809, 813, 824, 820, 844, 839, 830,
854, 850, 862, 869, 874, 886, 904, 893, 908, 917,
947, 934, 912, 964, 943, 954, 900, 957, 973, 969,
987, 990, 995, 1006, 999, 118, 2387, 735, 0, 2387,
50, 1030, 1062, 117, 115, 112, 110, 108, 104, 904,
72, 2387, 103, 1020, 1025, 1043, 1046, 1064, 1051, 1069,
1076, 1055, 1085, 1088, 1099, 1094, 1118, 1102, 1125, 1132,
1137, 1142, 1149, 1156, 1167, 1162, 1172, 1175, 1179, 1192,
1197, 1210, 1214, 1205, 1223, 1230, 1227, 1217, 1240, 1247,
1262, 1253, 1265, 1298, 1278, 1283, 1295, 1301, 160, 154,
2387, 107, 1314, 1350, 93, 91, 77, 73, 72, 70,
1332, 1344, 1335, 1320, 1356, 1340, 1352, 1374, 1388, 1391,
1366, 1396, 1406, 1412, 1409, 1422, 1428, 1442, 1445, 2387,
1448, 1452, 1462, 1459, 1478, 1465, 1495, 1498, 1482, 1508,
1501, 1515, 1485, 1519, 1531, 1534, 1540, 1545, 1549, 2387,
2387, 85, 65, 59, 36, 1564, 1556, 1575, 1553, 1590,
1571, 1587, 1594, 1609, 1606, 1601, 1612, 1627, 1642, 1645,
1648, 1651, 1661, 1667, 1682, 1685, 2387, 1697, 1691, 1700,
1716, 2387, 1703, 1733, 1721, 1707, 1740, 39, 27, 1751,
1746, 1754, 1770, 1766, 1758, 1788, 1784, 1763, 1800, 1803,
1814, 1818, 1833, 1807, 1821, 1825, 1837, 1851, 1857, 1867,
24, 1870, 1874, 1882, 1888, 1892, 1900, 1904, 1908, 1923,
1938, 1934, 1913, 1943, 1918, 1948, 1954, 36, 1958, 1964,
1968, 1978, 1989, 1994, 2002, 2010, 1999, 2020, 2013, 2033,
2025, 2036, 2050, 2059, 2045, 2056, 2070, 2387, 2075, 2089,
2082, 2387, 2093, 2096, 2100, 2108, 2112, 2132, 2119, 2138,
2387, 2206, 2220, 2234, 2248, 2257, 2266, 2275, 2288, 2302,
2315, 2329, 2339, 2345, 2353, 2355, 2361, 2367, 2373
} ;
static yyconst flex_int16_t yy_def[440] =
{ 0,
421, 1, 422, 422, 423, 423, 421, 421, 421, 421,
424, 425, 421, 426, 421, 427, 421, 17, 428, 428,
428, 428, 428, 428, 428, 421, 428, 428, 428, 428,
21, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 421, 421, 421, 429, 429, 430, 421, 421,
424, 421, 424, 421, 431, 15, 17, 421, 421, 15,
421, 421, 421, 421, 432, 433, 421, 421, 421, 421,
17, 421, 421, 421, 434, 428, 421, 421, 421, 421,
428, 21, 21, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 421, 421, 429, 429, 421, 430, 421,
421, 421, 435, 421, 421, 421, 421, 421, 432, 433,
436, 421, 421, 421, 421, 421, 421, 437, 421, 421,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 421, 421, 421, 438, 421,
421, 439, 421, 421, 421, 421, 421, 421, 421, 437,
421, 421, 421, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 421, 421,
421, 421, 439, 421, 421, 421, 421, 421, 421, 421,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 421,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 421,
421, 421, 421, 421, 421, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 421, 428, 428, 428,
428, 421, 428, 428, 428, 428, 428, 421, 421, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
421, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 421, 428, 428,
428, 428, 428, 428, 428, 428, 428, 428, 428, 428,
428, 428, 428, 428, 428, 428, 428, 421, 428, 428,
428, 421, 428, 428, 428, 428, 428, 428, 428, 428,
0, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421
} ;
static yyconst flex_uint16_t yy_nxt[2456] =
{ 0,
8, 9, 10, 9, 8, 11, 12, 8, 13, 14,
15, 16, 17, 18, 18, 18, 18, 18, 18, 8,
8, 19, 19, 19, 20, 21, 22, 19, 23, 19,
19, 24, 19, 19, 19, 25, 19, 19, 26, 27,
19, 28, 29, 30, 31, 32, 33, 19, 34, 19,
35, 19, 36, 37, 19, 19, 38, 39, 40, 41,
42, 19, 19, 8, 8, 43, 44, 45, 50, 52,
50, 56, 56, 57, 57, 57, 57, 57, 57, 57,
50, 261, 50, 72, 64, 388, 58, 58, 65, 77,
59, 263, 52, 76, 76, 261, 90, 371, 262, 77,
202, 212, 53, 77, 72, 58, 58, 60, 60, 60,
60, 60, 60, 60, 81, 67, 78, 79, 80, 61,
62, 63, 212, 349, 61, 53, 78, 79, 80, 263,
78, 79, 80, 348, 140, 77, 315, 202, 61, 62,
63, 314, 68, 69, 70, 61, 56, 84, 71, 71,
71, 71, 71, 71, 71, 313, 77, 263, 72, 312,
311, 58, 78, 79, 80, 73, 310, 76, 66, 72,
85, 74, 270, 75, 140, 86, 269, 72, 87, 268,
58, 202, 91, 78, 79, 80, 73, 213, 77, 76,
88, 77, 209, 72, 66, 74, 82, 82, 89, 208,
83, 83, 83, 83, 83, 83, 83, 91, 91, 91,
91, 91, 91, 91, 99, 78, 79, 80, 78, 79,
80, 77, 207, 140, 201, 197, 77, 197, 421, 127,
100, 196, 91, 150, 149, 76, 101, 421, 147, 146,
77, 66, 136, 421, 130, 77, 421, 128, 78, 79,
80, 77, 106, 78, 79, 80, 92, 93, 94, 95,
77, 96, 102, 107, 97, 108, 98, 78, 79, 80,
103, 77, 78, 79, 80, 104, 77, 127, 78, 79,
80, 77, 125, 124, 77, 91, 110, 78, 79, 80,
111, 109, 77, 105, 112, 77, 421, 113, 78, 79,
80, 114, 77, 78, 79, 80, 77, 55, 78, 79,
80, 78, 79, 80, 77, 115, 123, 421, 49, 78,
79, 80, 78, 79, 80, 117, 116, 49, 47, 78,
79, 80, 47, 78, 79, 80, 77, 421, 421, 118,
421, 78, 79, 80, 421, 421, 119, 421, 120, 421,
121, 421, 421, 141, 421, 122, 132, 132, 132, 132,
132, 132, 421, 78, 79, 80, 134, 134, 421, 421,
135, 135, 135, 135, 135, 135, 135, 421, 137, 137,
142, 133, 138, 138, 138, 138, 138, 138, 138, 66,
66, 66, 66, 66, 66, 66, 77, 421, 421, 72,
76, 76, 76, 76, 76, 421, 73, 143, 144, 145,
72, 77, 76, 76, 77, 421, 76, 151, 72, 421,
157, 155, 421, 78, 79, 80, 154, 73, 152, 77,
153, 421, 156, 152, 72, 76, 77, 158, 78, 79,
80, 78, 79, 80, 77, 421, 159, 152, 421, 153,
77, 421, 421, 421, 152, 77, 78, 79, 80, 77,
76, 421, 157, 78, 79, 80, 77, 421, 421, 421,
77, 78, 79, 80, 421, 160, 161, 78, 79, 80,
421, 77, 78, 79, 80, 421, 78, 79, 80, 77,
421, 421, 77, 78, 79, 80, 167, 78, 79, 80,
166, 421, 163, 162, 164, 421, 421, 165, 78, 79,
80, 77, 421, 421, 77, 421, 78, 79, 80, 78,
79, 80, 421, 169, 77, 421, 168, 77, 421, 173,
421, 421, 77, 421, 170, 171, 421, 77, 78, 79,
80, 78, 79, 80, 172, 174, 77, 421, 421, 77,
421, 78, 79, 80, 78, 79, 80, 175, 77, 78,
79, 80, 176, 421, 78, 79, 80, 177, 77, 421,
421, 421, 421, 78, 79, 80, 78, 79, 80, 178,
77, 421, 421, 179, 77, 78, 79, 80, 77, 421,
421, 77, 421, 421, 77, 78, 79, 80, 77, 180,
181, 77, 182, 185, 77, 183, 186, 78, 79, 80,
157, 78, 79, 80, 184, 78, 79, 80, 78, 79,
80, 78, 79, 80, 77, 78, 79, 80, 78, 79,
80, 78, 79, 80, 421, 421, 77, 421, 421, 187,
77, 421, 421, 77, 421, 421, 77, 421, 421, 421,
77, 78, 79, 80, 188, 421, 189, 421, 421, 421,
191, 77, 193, 78, 79, 80, 190, 78, 79, 80,
78, 79, 80, 78, 79, 80, 192, 78, 79, 80,
211, 421, 77, 421, 212, 77, 197, 421, 78, 79,
80, 194, 198, 198, 198, 198, 198, 198, 421, 421,
421, 211, 141, 195, 203, 421, 421, 421, 212, 78,
79, 80, 78, 79, 80, 135, 135, 135, 135, 135,
135, 135, 135, 135, 135, 135, 135, 135, 135, 142,
421, 204, 205, 206, 200, 421, 63, 421, 421, 200,
138, 138, 138, 138, 138, 138, 138, 259, 259, 259,
259, 259, 259, 200, 77, 63, 143, 144, 145, 77,
200, 138, 138, 138, 138, 138, 138, 138, 140, 140,
140, 140, 140, 61, 421, 63, 421, 77, 61, 421,
214, 78, 79, 80, 140, 421, 78, 79, 80, 77,
421, 215, 61, 218, 63, 77, 421, 421, 77, 61,
421, 421, 77, 140, 78, 79, 80, 421, 77, 216,
421, 220, 217, 77, 421, 421, 78, 79, 80, 221,
219, 77, 78, 79, 80, 78, 79, 80, 140, 78,
79, 80, 77, 421, 421, 78, 79, 80, 77, 222,
78, 79, 80, 223, 77, 421, 421, 77, 78, 79,
80, 77, 228, 225, 421, 227, 224, 421, 77, 78,
79, 80, 77, 421, 421, 78, 79, 80, 77, 226,
229, 78, 79, 80, 78, 79, 80, 77, 78, 79,
80, 421, 77, 231, 421, 78, 79, 80, 77, 78,
79, 80, 77, 421, 233, 78, 79, 80, 230, 421,
77, 421, 421, 421, 78, 79, 80, 77, 232, 78,
79, 80, 77, 421, 236, 78, 79, 80, 234, 78,
79, 80, 421, 235, 77, 421, 421, 78, 79, 80,
237, 77, 421, 211, 78, 79, 80, 212, 77, 78,
79, 80, 77, 421, 239, 238, 77, 421, 240, 421,
77, 78, 79, 80, 211, 77, 249, 219, 78, 79,
80, 212, 421, 421, 242, 78, 79, 80, 421, 78,
79, 80, 77, 78, 79, 80, 241, 78, 79, 80,
244, 77, 78, 79, 80, 77, 421, 245, 421, 421,
421, 243, 77, 421, 421, 77, 421, 421, 247, 78,
79, 80, 77, 421, 248, 250, 246, 77, 78, 79,
80, 77, 78, 79, 80, 421, 251, 252, 421, 78,
79, 80, 78, 79, 80, 77, 421, 253, 77, 78,
79, 80, 421, 77, 78, 79, 80, 77, 78, 79,
80, 141, 255, 256, 77, 254, 421, 258, 421, 421,
421, 421, 78, 79, 80, 78, 79, 80, 77, 257,
78, 79, 80, 77, 78, 79, 80, 421, 264, 421,
271, 78, 79, 80, 202, 202, 202, 202, 202, 202,
202, 77, 421, 272, 77, 78, 79, 80, 274, 77,
78, 79, 80, 77, 421, 265, 266, 267, 273, 275,
421, 421, 77, 421, 421, 277, 421, 77, 78, 79,
80, 78, 79, 80, 77, 421, 78, 79, 80, 421,
78, 79, 80, 77, 421, 421, 77, 421, 276, 78,
79, 80, 77, 278, 78, 79, 80, 77, 279, 421,
77, 78, 79, 80, 421, 282, 280, 421, 421, 421,
78, 79, 80, 78, 79, 80, 77, 281, 284, 78,
79, 80, 283, 77, 78, 79, 80, 78, 79, 80,
77, 421, 421, 285, 421, 77, 421, 286, 421, 421,
77, 290, 421, 78, 79, 80, 288, 77, 421, 421,
78, 79, 80, 287, 77, 421, 421, 78, 79, 80,
77, 421, 78, 79, 80, 77, 421, 78, 79, 80,
77, 421, 421, 77, 78, 79, 80, 77, 421, 421,
289, 78, 79, 80, 291, 292, 294, 78, 79, 80,
77, 421, 78, 79, 80, 77, 421, 78, 79, 80,
78, 79, 80, 77, 78, 79, 80, 296, 77, 421,
248, 293, 77, 421, 421, 77, 421, 78, 79, 80,
295, 77, 78, 79, 80, 77, 421, 421, 77, 421,
78, 79, 80, 297, 421, 78, 79, 80, 77, 78,
79, 80, 78, 79, 80, 77, 298, 421, 78, 79,
80, 77, 78, 79, 80, 78, 79, 80, 299, 300,
77, 421, 421, 77, 301, 78, 79, 80, 421, 303,
302, 421, 78, 79, 80, 304, 77, 421, 78, 79,
80, 77, 421, 421, 306, 141, 421, 78, 79, 80,
78, 79, 80, 77, 307, 421, 77, 421, 421, 77,
421, 309, 305, 78, 79, 80, 319, 421, 78, 79,
80, 308, 264, 263, 263, 263, 263, 263, 77, 421,
78, 79, 80, 78, 79, 80, 78, 79, 80, 263,
77, 421, 317, 77, 421, 421, 316, 421, 77, 265,
266, 267, 77, 318, 320, 78, 79, 80, 263, 321,
77, 421, 322, 421, 77, 421, 421, 78, 79, 80,
78, 79, 80, 421, 77, 78, 79, 80, 326, 78,
79, 80, 77, 263, 323, 421, 421, 78, 79, 80,
421, 78, 79, 80, 324, 421, 77, 421, 421, 77,
421, 78, 79, 80, 77, 325, 327, 421, 421, 78,
79, 80, 421, 421, 77, 421, 421, 77, 421, 421,
77, 421, 421, 78, 79, 80, 78, 79, 80, 330,
77, 78, 79, 80, 328, 329, 77, 331, 332, 421,
421, 78, 79, 80, 78, 79, 80, 78, 79, 80,
77, 337, 421, 77, 421, 421, 77, 78, 79, 80,
77, 319, 421, 78, 79, 80, 336, 77, 333, 421,
77, 421, 421, 77, 334, 335, 421, 78, 79, 80,
78, 79, 80, 78, 79, 80, 77, 78, 79, 80,
77, 421, 338, 77, 78, 79, 80, 78, 79, 80,
78, 79, 80, 77, 342, 343, 77, 421, 421, 77,
319, 421, 339, 78, 79, 80, 77, 78, 79, 80,
78, 79, 80, 77, 340, 421, 421, 77, 421, 341,
78, 79, 80, 78, 79, 80, 78, 79, 80, 77,
421, 421, 77, 78, 79, 80, 421, 344, 77, 421,
78, 79, 80, 77, 78, 79, 80, 77, 345, 421,
347, 77, 350, 421, 77, 421, 78, 79, 80, 78,
79, 80, 77, 346, 354, 78, 79, 80, 351, 77,
78, 79, 80, 77, 78, 79, 80, 421, 78, 79,
80, 78, 79, 80, 353, 77, 421, 421, 77, 78,
79, 80, 77, 352, 421, 421, 78, 79, 80, 77,
78, 79, 80, 421, 77, 355, 356, 77, 359, 357,
77, 421, 78, 79, 80, 78, 79, 80, 421, 78,
79, 80, 358, 421, 421, 77, 78, 79, 80, 360,
358, 78, 79, 80, 78, 79, 80, 78, 79, 80,
77, 421, 421, 77, 421, 421, 77, 421, 421, 77,
421, 421, 78, 79, 80, 358, 361, 363, 362, 77,
421, 421, 364, 421, 421, 77, 421, 78, 79, 80,
78, 79, 80, 78, 79, 80, 78, 79, 80, 365,
77, 421, 421, 77, 421, 421, 78, 79, 80, 77,
366, 421, 78, 79, 80, 77, 421, 421, 77, 421,
421, 77, 421, 421, 421, 77, 421, 78, 79, 80,
78, 79, 80, 244, 77, 421, 78, 79, 80, 77,
421, 421, 78, 79, 80, 78, 79, 80, 78, 79,
80, 77, 78, 79, 80, 367, 421, 368, 77, 369,
421, 78, 79, 80, 77, 421, 78, 79, 80, 77,
370, 216, 77, 421, 421, 374, 77, 421, 78, 79,
80, 77, 376, 372, 77, 78, 79, 80, 77, 421,
421, 78, 79, 80, 375, 373, 78, 79, 80, 78,
79, 80, 77, 78, 79, 80, 77, 421, 78, 79,
80, 78, 79, 80, 378, 78, 79, 80, 77, 421,
377, 77, 421, 421, 379, 77, 380, 421, 421, 78,
79, 80, 77, 78, 79, 80, 77, 382, 381, 77,
421, 421, 358, 77, 383, 78, 79, 80, 78, 79,
80, 77, 78, 79, 80, 77, 421, 358, 384, 78,
79, 80, 421, 78, 79, 80, 78, 79, 80, 77,
78, 79, 80, 385, 421, 77, 421, 421, 78, 79,
80, 386, 78, 79, 80, 77, 390, 306, 77, 421,
421, 387, 77, 421, 421, 389, 78, 79, 80, 216,
77, 392, 78, 79, 80, 421, 77, 421, 421, 421,
77, 421, 78, 79, 80, 78, 79, 80, 77, 78,
79, 80, 77, 421, 393, 421, 77, 78, 79, 80,
391, 77, 421, 78, 79, 80, 77, 78, 79, 80,
421, 77, 383, 394, 395, 78, 79, 80, 396, 78,
79, 80, 77, 78, 79, 80, 77, 421, 78, 79,
80, 77, 421, 78, 79, 80, 77, 398, 78, 79,
80, 390, 77, 421, 397, 399, 77, 421, 421, 78,
79, 80, 77, 78, 79, 80, 77, 421, 78, 79,
80, 400, 401, 78, 79, 80, 77, 404, 421, 78,
79, 80, 402, 78, 79, 80, 358, 77, 421, 78,
79, 80, 77, 78, 79, 80, 421, 77, 358, 421,
77, 421, 421, 78, 79, 80, 403, 421, 77, 421,
421, 77, 408, 421, 78, 79, 80, 405, 77, 78,
79, 80, 406, 77, 78, 79, 80, 78, 79, 80,
407, 77, 421, 358, 77, 78, 79, 80, 78, 79,
80, 421, 358, 77, 421, 78, 79, 80, 77, 412,
78, 79, 80, 410, 77, 421, 409, 77, 78, 79,
80, 78, 79, 80, 421, 411, 421, 358, 77, 421,
78, 79, 80, 77, 421, 78, 79, 80, 415, 413,
77, 78, 79, 80, 78, 79, 80, 77, 421, 421,
421, 77, 421, 414, 77, 78, 79, 80, 77, 421,
78, 79, 80, 358, 416, 421, 77, 78, 79, 80,
77, 421, 421, 358, 78, 79, 80, 77, 78, 79,
80, 78, 79, 80, 417, 78, 79, 80, 421, 418,
77, 421, 420, 78, 79, 80, 77, 78, 79, 80,
419, 421, 421, 421, 78, 79, 80, 421, 421, 421,
358, 421, 421, 421, 421, 421, 421, 78, 79, 80,
421, 421, 421, 78, 79, 80, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 54, 54,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 54, 57, 421, 57, 421, 57, 421, 57, 66,
421, 421, 66, 421, 66, 66, 66, 66, 66, 76,
76, 421, 76, 76, 76, 76, 76, 76, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 129, 129, 129, 129, 129, 129, 129, 129,
129, 129, 129, 129, 129, 131, 421, 131, 131, 131,
131, 131, 131, 131, 131, 131, 131, 131, 131, 139,
421, 139, 139, 139, 139, 139, 139, 139, 139, 139,
139, 139, 139, 140, 140, 140, 140, 140, 140, 140,
140, 140, 148, 148, 148, 199, 421, 421, 421, 421,
199, 199, 199, 202, 202, 202, 202, 202, 210, 210,
210, 421, 421, 210, 260, 260, 260, 263, 263, 263,
263, 263, 263, 263, 263, 263, 7, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421
} ;
static yyconst flex_int16_t yy_chk[2456] =
{ 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, 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, 9, 11,
9, 13, 14, 13, 13, 13, 13, 13, 13, 13,
50, 388, 50, 73, 16, 371, 13, 14, 16, 19,
14, 349, 51, 82, 82, 201, 25, 348, 201, 20,
315, 211, 11, 25, 73, 13, 14, 15, 15, 15,
15, 15, 15, 15, 20, 16, 19, 19, 19, 15,
15, 15, 211, 314, 15, 51, 20, 20, 20, 313,
25, 25, 25, 312, 270, 22, 269, 268, 15, 15,
15, 267, 16, 16, 16, 15, 17, 22, 17, 17,
17, 17, 17, 17, 17, 266, 23, 265, 17, 262,
260, 17, 22, 22, 22, 17, 259, 213, 209, 17,
23, 17, 208, 17, 207, 24, 206, 17, 24, 205,
17, 204, 196, 23, 23, 23, 17, 150, 24, 149,
24, 28, 147, 17, 146, 17, 21, 21, 24, 145,
21, 21, 21, 21, 21, 21, 21, 26, 26, 26,
26, 26, 26, 26, 28, 24, 24, 24, 28, 28,
28, 29, 144, 143, 136, 133, 21, 131, 127, 126,
29, 125, 124, 80, 79, 78, 29, 71, 70, 69,
32, 68, 59, 57, 54, 33, 53, 47, 29, 29,
29, 34, 32, 21, 21, 21, 27, 27, 27, 27,
30, 27, 30, 33, 27, 34, 27, 32, 32, 32,
30, 27, 33, 33, 33, 30, 35, 46, 34, 34,
34, 37, 45, 44, 36, 43, 36, 30, 30, 30,
36, 35, 76, 31, 36, 38, 18, 37, 27, 27,
27, 38, 40, 35, 35, 35, 39, 12, 37, 37,
37, 36, 36, 36, 42, 39, 42, 7, 6, 76,
76, 76, 38, 38, 38, 40, 39, 5, 4, 40,
40, 40, 3, 39, 39, 39, 41, 0, 0, 41,
0, 42, 42, 42, 0, 0, 41, 0, 41, 0,
41, 0, 0, 66, 0, 41, 55, 55, 55, 55,
55, 55, 0, 41, 41, 41, 58, 58, 0, 0,
58, 58, 58, 58, 58, 58, 58, 0, 62, 62,
66, 55, 62, 62, 62, 62, 62, 62, 62, 67,
67, 67, 67, 67, 67, 67, 81, 0, 0, 74,
77, 77, 77, 77, 77, 0, 74, 66, 66, 66,
74, 84, 83, 83, 85, 0, 77, 81, 74, 0,
87, 85, 0, 81, 81, 81, 84, 74, 83, 87,
83, 0, 86, 83, 74, 77, 86, 88, 84, 84,
84, 85, 85, 85, 88, 0, 90, 83, 0, 83,
89, 0, 0, 0, 83, 90, 87, 87, 87, 91,
77, 0, 89, 86, 86, 86, 92, 0, 0, 0,
93, 88, 88, 88, 0, 92, 93, 89, 89, 89,
0, 96, 90, 90, 90, 0, 91, 91, 91, 94,
0, 0, 95, 92, 92, 92, 97, 93, 93, 93,
96, 0, 95, 94, 95, 0, 0, 95, 96, 96,
96, 97, 0, 0, 98, 0, 94, 94, 94, 95,
95, 95, 0, 98, 99, 0, 97, 100, 0, 100,
0, 0, 101, 0, 98, 98, 0, 102, 97, 97,
97, 98, 98, 98, 99, 101, 104, 0, 0, 103,
0, 99, 99, 99, 100, 100, 100, 102, 105, 101,
101, 101, 103, 0, 102, 102, 102, 104, 106, 0,
0, 0, 0, 104, 104, 104, 103, 103, 103, 105,
108, 0, 0, 106, 107, 105, 105, 105, 109, 0,
0, 110, 0, 0, 111, 106, 106, 106, 112, 107,
108, 113, 109, 113, 114, 110, 114, 108, 108, 108,
112, 107, 107, 107, 111, 109, 109, 109, 110, 110,
110, 111, 111, 111, 115, 112, 112, 112, 113, 113,
113, 114, 114, 114, 0, 0, 116, 0, 0, 115,
117, 0, 0, 118, 0, 0, 119, 0, 0, 0,
121, 115, 115, 115, 116, 0, 117, 0, 0, 0,
119, 120, 121, 116, 116, 116, 118, 117, 117, 117,
118, 118, 118, 119, 119, 119, 120, 121, 121, 121,
148, 0, 122, 0, 148, 123, 132, 0, 120, 120,
120, 122, 132, 132, 132, 132, 132, 132, 0, 0,
0, 148, 140, 123, 141, 0, 0, 0, 148, 122,
122, 122, 123, 123, 123, 134, 134, 134, 134, 134,
134, 134, 135, 135, 135, 135, 135, 135, 135, 140,
0, 141, 141, 141, 135, 0, 135, 0, 0, 135,
137, 137, 137, 137, 137, 137, 137, 198, 198, 198,
198, 198, 198, 135, 152, 135, 140, 140, 140, 153,
135, 138, 138, 138, 138, 138, 138, 138, 142, 142,
142, 142, 142, 138, 0, 138, 0, 151, 138, 0,
151, 152, 152, 152, 142, 0, 153, 153, 153, 154,
0, 154, 138, 156, 138, 157, 0, 0, 160, 138,
0, 0, 155, 142, 151, 151, 151, 0, 156, 155,
0, 159, 155, 158, 0, 0, 154, 154, 154, 160,
158, 159, 157, 157, 157, 160, 160, 160, 142, 155,
155, 155, 161, 0, 0, 156, 156, 156, 162, 161,
158, 158, 158, 162, 163, 0, 0, 164, 159, 159,
159, 165, 167, 164, 0, 166, 163, 0, 167, 161,
161, 161, 166, 0, 0, 162, 162, 162, 170, 165,
168, 163, 163, 163, 164, 164, 164, 169, 165, 165,
165, 0, 168, 170, 0, 167, 167, 167, 172, 166,
166, 166, 171, 0, 172, 170, 170, 170, 169, 0,
173, 0, 0, 0, 169, 169, 169, 174, 171, 168,
168, 168, 175, 0, 175, 172, 172, 172, 173, 171,
171, 171, 0, 174, 176, 0, 0, 173, 173, 173,
176, 178, 0, 210, 174, 174, 174, 210, 187, 175,
175, 175, 177, 0, 178, 177, 179, 0, 179, 0,
183, 176, 176, 176, 210, 180, 187, 183, 178, 178,
178, 210, 0, 0, 181, 187, 187, 187, 0, 177,
177, 177, 182, 179, 179, 179, 180, 183, 183, 183,
182, 185, 180, 180, 180, 181, 0, 184, 0, 0,
0, 181, 186, 0, 0, 188, 0, 0, 185, 182,
182, 182, 184, 0, 186, 188, 184, 190, 185, 185,
185, 189, 181, 181, 181, 0, 188, 189, 0, 186,
186, 186, 188, 188, 188, 191, 0, 190, 192, 184,
184, 184, 0, 193, 190, 190, 190, 195, 189, 189,
189, 202, 192, 193, 194, 191, 0, 195, 0, 0,
0, 0, 191, 191, 191, 192, 192, 192, 214, 194,
193, 193, 193, 215, 195, 195, 195, 0, 202, 0,
214, 194, 194, 194, 203, 203, 203, 203, 203, 203,
203, 216, 0, 215, 217, 214, 214, 214, 218, 219,
215, 215, 215, 222, 0, 202, 202, 202, 217, 220,
0, 0, 218, 0, 0, 222, 0, 220, 216, 216,
216, 217, 217, 217, 221, 0, 219, 219, 219, 0,
222, 222, 222, 223, 0, 0, 224, 0, 221, 218,
218, 218, 226, 223, 220, 220, 220, 225, 224, 0,
228, 221, 221, 221, 0, 226, 224, 0, 0, 0,
223, 223, 223, 224, 224, 224, 227, 225, 228, 226,
226, 226, 227, 229, 225, 225, 225, 228, 228, 228,
230, 0, 0, 229, 0, 231, 0, 230, 0, 0,
232, 236, 0, 227, 227, 227, 232, 233, 0, 0,
229, 229, 229, 231, 234, 0, 0, 230, 230, 230,
236, 0, 231, 231, 231, 235, 0, 232, 232, 232,
237, 0, 0, 238, 233, 233, 233, 239, 0, 0,
235, 234, 234, 234, 237, 238, 242, 236, 236, 236,
240, 0, 235, 235, 235, 241, 0, 237, 237, 237,
238, 238, 238, 244, 239, 239, 239, 245, 242, 0,
240, 241, 243, 0, 0, 248, 0, 240, 240, 240,
243, 245, 241, 241, 241, 247, 0, 0, 246, 0,
244, 244, 244, 246, 0, 242, 242, 242, 249, 243,
243, 243, 248, 248, 248, 250, 247, 0, 245, 245,
245, 252, 247, 247, 247, 246, 246, 246, 249, 250,
251, 0, 0, 253, 251, 249, 249, 249, 0, 253,
252, 0, 250, 250, 250, 254, 255, 0, 252, 252,
252, 256, 0, 0, 255, 263, 0, 251, 251, 251,
253, 253, 253, 257, 256, 0, 254, 0, 0, 258,
0, 258, 254, 255, 255, 255, 274, 0, 256, 256,
256, 257, 263, 264, 264, 264, 264, 264, 274, 0,
257, 257, 257, 254, 254, 254, 258, 258, 258, 264,
271, 0, 272, 273, 0, 0, 271, 0, 276, 263,
263, 263, 272, 273, 275, 274, 274, 274, 264, 276,
277, 0, 277, 0, 275, 0, 0, 271, 271, 271,
273, 273, 273, 0, 281, 276, 276, 276, 281, 272,
272, 272, 278, 264, 278, 0, 0, 277, 277, 277,
0, 275, 275, 275, 279, 0, 279, 0, 0, 280,
0, 281, 281, 281, 282, 280, 282, 0, 0, 278,
278, 278, 0, 0, 283, 0, 0, 285, 0, 0,
284, 0, 0, 279, 279, 279, 280, 280, 280, 285,
286, 282, 282, 282, 283, 284, 287, 286, 287, 0,
0, 283, 283, 283, 285, 285, 285, 284, 284, 284,
288, 293, 0, 289, 0, 0, 291, 286, 286, 286,
292, 296, 0, 287, 287, 287, 292, 294, 288, 0,
293, 0, 0, 296, 289, 291, 0, 288, 288, 288,
289, 289, 289, 291, 291, 291, 295, 292, 292, 292,
299, 0, 295, 303, 294, 294, 294, 293, 293, 293,
296, 296, 296, 297, 302, 304, 298, 0, 0, 301,
297, 0, 298, 295, 295, 295, 300, 299, 299, 299,
303, 303, 303, 302, 300, 0, 0, 304, 0, 301,
297, 297, 297, 298, 298, 298, 301, 301, 301, 305,
0, 0, 306, 300, 300, 300, 0, 305, 307, 0,
302, 302, 302, 308, 304, 304, 304, 309, 307, 0,
309, 319, 316, 0, 317, 0, 305, 305, 305, 306,
306, 306, 316, 308, 321, 307, 307, 307, 317, 321,
308, 308, 308, 318, 309, 309, 309, 0, 319, 319,
319, 317, 317, 317, 320, 322, 0, 0, 320, 316,
316, 316, 323, 318, 0, 0, 321, 321, 321, 326,
318, 318, 318, 0, 325, 322, 323, 324, 326, 324,
327, 0, 322, 322, 322, 320, 320, 320, 0, 323,
323, 323, 325, 0, 0, 328, 326, 326, 326, 328,
327, 325, 325, 325, 324, 324, 324, 327, 327, 327,
329, 0, 0, 330, 0, 0, 331, 0, 0, 332,
0, 0, 328, 328, 328, 330, 329, 332, 331, 333,
0, 0, 333, 0, 0, 334, 0, 329, 329, 329,
330, 330, 330, 331, 331, 331, 332, 332, 332, 334,
335, 0, 0, 336, 0, 0, 333, 333, 333, 339,
335, 0, 334, 334, 334, 338, 0, 0, 340, 0,
0, 343, 0, 0, 0, 346, 0, 335, 335, 335,
336, 336, 336, 338, 341, 0, 339, 339, 339, 345,
0, 0, 338, 338, 338, 340, 340, 340, 343, 343,
343, 344, 346, 346, 346, 341, 0, 344, 347, 345,
0, 341, 341, 341, 351, 0, 345, 345, 345, 350,
347, 351, 352, 0, 0, 353, 355, 0, 344, 344,
344, 358, 355, 350, 354, 347, 347, 347, 353, 0,
0, 351, 351, 351, 354, 352, 350, 350, 350, 352,
352, 352, 357, 355, 355, 355, 356, 0, 358, 358,
358, 354, 354, 354, 357, 353, 353, 353, 359, 0,
356, 360, 0, 0, 359, 364, 360, 0, 0, 357,
357, 357, 361, 356, 356, 356, 362, 364, 361, 365,
0, 0, 362, 366, 365, 359, 359, 359, 360, 360,
360, 363, 364, 364, 364, 367, 0, 363, 366, 361,
361, 361, 0, 362, 362, 362, 365, 365, 365, 368,
366, 366, 366, 367, 0, 369, 0, 0, 363, 363,
363, 369, 367, 367, 367, 370, 374, 368, 372, 0,
0, 370, 373, 0, 0, 372, 368, 368, 368, 373,
374, 376, 369, 369, 369, 0, 375, 0, 0, 0,
376, 0, 370, 370, 370, 372, 372, 372, 377, 373,
373, 373, 378, 0, 377, 0, 379, 374, 374, 374,
375, 383, 0, 375, 375, 375, 385, 376, 376, 376,
0, 380, 385, 378, 379, 377, 377, 377, 380, 378,
378, 378, 382, 379, 379, 379, 381, 0, 383, 383,
383, 384, 0, 385, 385, 385, 386, 382, 380, 380,
380, 386, 387, 0, 381, 384, 389, 0, 0, 382,
382, 382, 390, 381, 381, 381, 391, 0, 384, 384,
384, 387, 391, 386, 386, 386, 392, 395, 0, 387,
387, 387, 392, 389, 389, 389, 396, 393, 0, 390,
390, 390, 394, 391, 391, 391, 0, 397, 394, 0,
395, 0, 0, 392, 392, 392, 393, 0, 396, 0,
0, 399, 400, 0, 393, 393, 393, 397, 398, 394,
394, 394, 398, 401, 397, 397, 397, 395, 395, 395,
399, 400, 0, 404, 402, 396, 396, 396, 399, 399,
399, 0, 401, 405, 0, 398, 398, 398, 403, 407,
401, 401, 401, 405, 406, 0, 402, 404, 400, 400,
400, 402, 402, 402, 0, 406, 0, 403, 407, 0,
405, 405, 405, 409, 0, 403, 403, 403, 411, 409,
411, 406, 406, 406, 404, 404, 404, 410, 0, 0,
0, 413, 0, 410, 414, 407, 407, 407, 415, 0,
409, 409, 409, 413, 415, 0, 416, 411, 411, 411,
417, 0, 0, 414, 410, 410, 410, 419, 413, 413,
413, 414, 414, 414, 416, 415, 415, 415, 0, 417,
418, 0, 419, 416, 416, 416, 420, 417, 417, 417,
418, 0, 0, 0, 419, 419, 419, 0, 0, 0,
420, 0, 0, 0, 0, 0, 0, 418, 418, 418,
0, 0, 0, 420, 420, 420, 422, 422, 422, 422,
422, 422, 422, 422, 422, 422, 422, 422, 422, 422,
423, 423, 423, 423, 423, 423, 423, 423, 423, 423,
423, 423, 423, 423, 424, 424, 424, 424, 424, 424,
424, 424, 424, 424, 424, 424, 424, 424, 425, 425,
425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
425, 425, 426, 0, 426, 0, 426, 0, 426, 427,
0, 0, 427, 0, 427, 427, 427, 427, 427, 428,
428, 0, 428, 428, 428, 428, 428, 428, 429, 429,
429, 429, 429, 429, 429, 429, 429, 429, 429, 429,
429, 429, 430, 430, 430, 430, 430, 430, 430, 430,
430, 430, 430, 430, 430, 431, 0, 431, 431, 431,
431, 431, 431, 431, 431, 431, 431, 431, 431, 432,
0, 432, 432, 432, 432, 432, 432, 432, 432, 432,
432, 432, 432, 433, 433, 433, 433, 433, 433, 433,
433, 433, 434, 434, 434, 435, 0, 0, 0, 0,
435, 435, 435, 436, 436, 436, 436, 436, 437, 437,
437, 0, 0, 437, 438, 438, 438, 439, 439, 439,
439, 439, 439, 439, 439, 439, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
extern int ncg_flex_debug;
int ncg_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *ncgtext;
#line 1 "ncgen.l"
#line 2 "ncgen.l"
/*********************************************************************
* Copyright 1993, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
* $Id: ncgen.l,v 1.24 2009/09/25 18:22:35 dmh Exp $
*********************************************************************/
/* Problems:
1. We assume the input is true utf8.
Unfortunately, we may actually get iso-latin-8859-1.
This means that there will be ambiguity about the characters
in the range 128-255 because they will look like n-byte unicode
when they are 1-byte 8859 characters. Because of our encoding,
8859 characters above 128 will be handles as n-byte utf8 and so
will probably not lex correctly.
Solution: assume utf8 and note in the documentation that
ISO8859 is specifically unsupported.
2. The netcdf function NC_check_name in string.c must be modified to
conform to the use of UTF8.
3. We actually have three tests for UTF8 of increasing correctness
(in the sense that the least correct will allow some sequences that
are technically illegal UTF8).
The tests are derived from the table at
http://www.w3.org/2005/03/23-lex-U
We include lexical definitions for all three, but use the second version.
4. Single character constants enclosed in '...' cannot be
utf-8, so we assume they are by default encoded using the 1-byte
subset of utf-8. It turns out that this subset is in fact
equivalent to US-Ascii (7-bit).
We could use ISO-8859-1, but that conflicts with UTF-8 above value 127.
*/
/* lex specification for tokens for ncgen */
/* Fill value used by ncdump from version 2.4 and later. Should match
definition of FILL_STRING in ../ncdump/vardata.h */
#include "ncgen.h"
#include "ncgeny.h"
EXTERNL int fileno(FILE*);
#define FILL_STRING "_"
#define XDR_INT32_MIN (-2147483647-1)
#define XDR_INT32_MAX 2147483647
#define XDR_INT64_MIN (-9223372036854775807LL-1)
#define XDR_INT64_MAX (9223372036854775807LL)
#undef DEBUG
#ifdef DEBUG
static int MIN_BYTE = NC_MIN_BYTE;
static int MIN_SHORT = NC_MIN_SHORT;
static int MIN_INT = NC_MIN_INT;
static int MAX_BYTE = NC_MAX_BYTE;
static int MAX_SHORT = NC_MAX_SHORT;
static int MAX_INT = NC_MAX_INT;
static int MAX_UBYTE = NC_MAX_UBYTE;
static int MAX_USHORT = NC_MAX_USHORT;
static unsigned int MAX_UINT = NC_MAX_UINT;
#undef NC_MIN_BYTE
#undef NC_MIN_SHORT
#undef NC_MIN_INT
#undef NC_MAX_BYTE
#undef NC_MAX_SHORT
#undef NC_MAX_INT
#undef NC_MAX_UBYTE
#undef NC_MAX_USHORT
#undef NC_MAX_UINT
#define NC_MIN_BYTE MIN_BYTE
#define NC_MIN_SHORT MIN_SHORT
#define NC_MIN_INT MIN_INT
#define NC_MAX_BYTE MAX_BYTE
#define NC_MAX_SHORT MAX_SHORT
#define NC_MAX_INT MAX_INT
#define NC_MAX_UBYTE MAX_UBYTE
#define NC_MAX_USHORT MAX_USHORT
#define NC_MAX_UINT MAX_UINT
#endif
#define TAGCHARS "BbSsLlUu"
#define tstdecimal(ch) ((ch) >= '0' && (ch) <= '9')
#define tstoctal(ch) ((ch) == '0')
/*Mnemonics*/
#define ISIDENT 1
/* Define a fake constant indicating that
no tag was specified */
#define NC_NOTAG (-1)
char errstr[100]; /* for short error messages */
int lineno; /* line number for error messages */
Bytebuffer* lextext; /* name or string with escapes removed */
#define YY_BREAK /* defining as nothing eliminates unreachable
statement warnings from flex output,
but make sure every action ends with
"return" or "break"! */
int specialconstants; /* 1 if nan, nanf, infinity, etc is used */
double double_val; /* last double value read */
float float_val; /* last float value read */
long long int64_val; /* last int64 value read */
int int32_val; /* last int32 value read */
short int16_val; /* last short value read */
unsigned long long uint64_val; /* last int64 value read */
unsigned int uint32_val; /* last int32 value read */
unsigned short uint16_val; /* last short value read */
char char_val; /* last char value read */
signed char byte_val; /* last byte value read */
unsigned char ubyte_val; /* last byte value read */
static Symbol* makepath(char* text);
static int lexdebug(int);
static unsigned long long parseULL(int radix, char* text, int*);
static nc_type downconvert(unsigned long long uint64, int*, int, int);
static int tagmatch(nc_type nct, int tag);
static int nct2lexeme(nc_type nct);
static int collecttag(char* text, char** stagp);
struct Specialtoken specials[] = {
{"_FillValue",_FILLVALUE,_FILLVALUE_FLAG},
{"_Format",_FORMAT,_FORMAT_FLAG},
{"_Storage",_STORAGE,_STORAGE_FLAG},
{"_ChunkSizes",_CHUNKSIZES,_CHUNKSIZES_FLAG},
{"_Fletcher32",_FLETCHER32,_FLETCHER32_FLAG},
{"_DeflateLevel",_DEFLATELEVEL,_DEFLATE_FLAG},
{"_Shuffle",_SHUFFLE,_SHUFFLE_FLAG},
{"_Endianness",_ENDIANNESS,_ENDIAN_FLAG},
{"_NoFill",_NOFILL,_NOFILL_FLAG},
{"_NCProperties",_NCPROPS,_NCPROPS_FLAG},
{"_IsNetcdf4",_ISNETCDF4,_ISNETCDF4_FLAG},
{"_SuperblockVersion",_SUPERBLOCK,_SUPERBLOCK_FLAG},
{"_Filter",_FILTER,_FILTER_FLAG},
{NULL,0} /* null terminate */
};
/* The most correct (validating) version of UTF8 character set
(Taken from: http://www.w3.org/2005/03/23-lex-U)
The lines of the expression cover the UTF8 characters as follows:
1. non-overlong 2-byte
2. excluding overlongs
3. straight 3-byte
4. excluding surrogates
5. straight 3-byte
6. planes 1-3
7. planes 4-15
8. plane 16
UTF8 ([\xC2-\xDF][\x80-\xBF]) \
| (\xE0[\xA0-\xBF][\x80-\xBF]) \
| ([\xE1-\xEC][\x80-\xBF][\x80-\xBF]) \
| (\xED[\x80-\x9F][\x80-\xBF]) \
| ([\xEE-\xEF][\x80-\xBF][\x80-\xBF]) \
| (\xF0[\x90-\xBF][\x80-\xBF][\x80-\xBF]) \
| ([\xF1-\xF3][\x80-\xBF][\x80-\xBF][\x80-\xBF]) \
| (\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]) \
*/
/* Wish there was some way to ifdef lex files */
/*The most relaxed version of UTF8 (not used)
UTF8 ([\xC0-\xD6].)|([\xE0-\xEF]..)|([\xF0-\xF7]...)
*/
/*The partially relaxed version of UTF8, and the one used here */
/* The old definition of ID
ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
*/
/* Don't permit control characters or '/' in names, but other special
chars OK if escaped. Note that to preserve backwards
compatibility, none of the characters _.@+- should be escaped, as
they were previously permitted in names without escaping. */
/* New definition to conform to a subset of string.c */
/* Capture a datasetidentifier */
/* DATASETID ([a-zA-Z0-9!#$%&*:;<=>?/^|~_.@+-]|{UTF8})* */
/* Note: this definition of string will work for utf8 as well,
although it is a very relaxed definition
*/
#line 1352 "ncgenl.c"
#define INITIAL 0
#define ST_C_COMMENT 1
#define TEXT 2
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include <unistd.h>
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int ncglex_destroy (void );
int ncgget_debug (void );
void ncgset_debug (int debug_flag );
YY_EXTRA_TYPE ncgget_extra (void );
void ncgset_extra (YY_EXTRA_TYPE user_defined );
FILE *ncgget_in (void );
void ncgset_in (FILE * _in_str );
FILE *ncgget_out (void );
void ncgset_out (FILE * _out_str );
yy_size_t ncgget_leng (void );
char *ncgget_text (void );
int ncgget_lineno (void );
void ncgset_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int ncgwrap (void );
#else
extern int ncgwrap (void );
#endif
#endif
#ifndef YY_NO_UNPUT
static void yyunput (int c,char *buf_ptr );
#endif
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void );
#else
static int input (void );
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( ncgtext, ncgleng, 1, ncgout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( ncgin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
while ( (result = fread(buf, 1, max_size, ncgin))==0 && ferror(ncgin)) \
{ \
if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
} \
errno=0; \
clearerr(ncgin); \
} \
}\
\
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
/* end tables serialization structures and prototypes */
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
extern int ncglex (void);
#define YY_DECL int ncglex (void)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after ncgtext and ncgleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
yy_state_type yy_current_state;
char *yy_cp, *yy_bp;
int yy_act;
if ( !(yy_init) )
{
(yy_init) = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
if ( ! ncgin )
ncgin = stdin;
if ( ! ncgout )
ncgout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
ncgensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
ncg_create_buffer(ncgin,YY_BUF_SIZE );
}
ncg_load_buffer_state( );
}
{
#line 221 "ncgen.l"
#line 1574 "ncgenl.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
/* Support of ncgtext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = (yy_start);
yy_match:
do
{
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 422 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 2387 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = (yy_hold_char);
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 222 "ncgen.l"
{ /* whitespace */
break;
}
YY_BREAK
case 2:
YY_RULE_SETUP
#line 226 "ncgen.l"
{ /* comment */
break;
}
YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 230 "ncgen.l"
{int len; char* s = NULL;
/* In netcdf4, this will be used in a variety
of places, so only remove escapes */
/*
if(ncgleng > MAXTRST) {
yyerror("string too long, truncated\n");
ncgtext[MAXTRST-1] = '\0';
}
*/
len = unescape((char *)ncgtext+1,ncgleng-2,!ISIDENT,&s);
if(len < 0) {
sprintf(errstr,"Illegal character: %s",ncgtext);
yyerror(errstr);
}
bbClear(lextext);
bbAppendn(lextext,s,len);
bbNull(lextext);
if(s) efree(s);
return lexdebug(TERMSTRING);
}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 251 "ncgen.l"
{ /* drop leading 0x; pad to even number of chars */
char* p = ncgtext+2;
int len = ncgleng - 2;
bbClear(lextext);
bbAppendn(lextext,p,len);
if((len % 2) == 1) bbAppend(lextext,'0');
bbNull(lextext);
/* convert all chars to lower case */
for(p=bbContents(lextext);(int)*p;p++) *p = tolower(*p);
return lexdebug(OPAQUESTRING);
}
YY_BREAK
case 5:
YY_RULE_SETUP
#line 263 "ncgen.l"
{return lexdebug(COMPOUND);}
YY_BREAK
case 6:
YY_RULE_SETUP
#line 264 "ncgen.l"
{return lexdebug(ENUM);}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 265 "ncgen.l"
{return lexdebug(OPAQUE_);}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 267 "ncgen.l"
{return lexdebug(FLOAT_K);}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 268 "ncgen.l"
{return lexdebug(CHAR_K);}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 269 "ncgen.l"
{return lexdebug(BYTE_K);}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 270 "ncgen.l"
{return lexdebug(UBYTE_K);}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 271 "ncgen.l"
{return lexdebug(SHORT_K);}
YY_BREAK
case 13:
YY_RULE_SETUP
#line 272 "ncgen.l"
{return lexdebug(USHORT_K);}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 273 "ncgen.l"
{return lexdebug(INT_K);}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 274 "ncgen.l"
{return lexdebug(UINT_K);}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 275 "ncgen.l"
{return lexdebug(INT64_K);}
YY_BREAK
case 17:
YY_RULE_SETUP
#line 276 "ncgen.l"
{return lexdebug(UINT64_K);}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 277 "ncgen.l"
{return lexdebug(DOUBLE_K);}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 278 "ncgen.l"
{return lexdebug(STRING_K);}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 280 "ncgen.l"
{int32_val = -1;
return lexdebug(NC_UNLIMITED_K);}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 283 "ncgen.l"
{return lexdebug(TYPES);}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 284 "ncgen.l"
{return lexdebug(DIMENSIONS);}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 285 "ncgen.l"
{return lexdebug(VARIABLES);}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 286 "ncgen.l"
{return lexdebug(DATA);}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 287 "ncgen.l"
{return lexdebug(GROUP);}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 289 "ncgen.l"
{BEGIN(TEXT);return lexdebug(NETCDF);}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 291 "ncgen.l"
{ /* missing value (pre-2.4 backward compatibility) */
if (ncgtext[0] == '-') {
double_val = NEGNC_INFINITE;
} else {
double_val = NC_INFINITE;
}
specialconstants = 1;
return lexdebug(DOUBLE_CONST);
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 300 "ncgen.l"
{ /* missing value (pre-2.4 backward compatibility) */
double_val = NAN;
specialconstants = 1;
return lexdebug(DOUBLE_CONST);
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 306 "ncgen.l"
{/* missing value (pre-2.4 backward compatibility)*/
if (ncgtext[0] == '-') {
float_val = NEGNC_INFINITEF;
} else {
float_val = NC_INFINITEF;
}
specialconstants = 1;
return lexdebug(FLOAT_CONST);
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 315 "ncgen.l"
{ /* missing value (pre-2.4 backward compatibility) */
float_val = NANF;
specialconstants = 1;
return lexdebug(FLOAT_CONST);
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 321 "ncgen.l"
{
#ifdef USE_NETCDF4
if(l_flag == L_C || l_flag == L_BINARY)
return lexdebug(NIL);
yyerror("NIL only allowed for netcdf-4 and for -lc or -lb");
#else
yyerror("NIL only allowed for netcdf-4 and for -lc or -lb");
#endif
}
YY_BREAK
case 32:
YY_RULE_SETUP
#line 331 "ncgen.l"
{
bbClear(lextext);
bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */
bbNull(lextext);
yylval.sym = makepath(bbContents(lextext));
return lexdebug(PATH);
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 340 "ncgen.l"
{struct Specialtoken* st;
bbClear(lextext);
bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */
bbNull(lextext);
for(st=specials;st->name;st++) {
if(strcmp(bbContents(lextext),st->name)==0) {return lexdebug(st->token);}
}
return 0;
}
YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
#line 350 "ncgen.l"
{
int c;
char* p; char* q;
/* copy the trimmed name */
bbClear(lextext);
bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */
bbNull(lextext);
p = bbContents(lextext);
q = p;
while((c=*p++)) {if(c > ' ') *q++ = c;}
*q = '\0';
if(datasetname == NULL)
datasetname = bbDup(lextext);
BEGIN(INITIAL);
return lexdebug(DATASETID);
}
YY_BREAK
case 35:
YY_RULE_SETUP
#line 367 "ncgen.l"
{ char* id = NULL; int len;
len = strlen(ncgtext);
len = unescape(ncgtext,len,ISIDENT,&id);
if(NCSTREQ(id, FILL_STRING)) {
efree(id);
return lexdebug(FILLMARKER);
}
yylval.sym = install(id);
efree(id);
return lexdebug(IDENT);
}
YY_BREAK
case 36:
YY_RULE_SETUP
#line 379 "ncgen.l"
{
/*
We need to try to see what size of integer ((u)int).
Technically, the user should specify, but...
If out of any integer range, then complain
Also, if the digits begin with 0, then assume octal.
*/
int slen = strlen(ncgtext);
char* stag = NULL;
int tag = NC_NAT;
int isneg = 0;
int c = ncgtext[0];
int fail = 0;
nc_type nct = 0;
char* pos = NULL;
int hasU = 0;
int radix = 10;
pos = ncgtext;
/* capture the tag string */
tag = collecttag(pos,&stag);
if(tag == NC_NAT) {
sprintf(errstr,"Illegal integer suffix: %s",stag);
yyerror(errstr);
goto done;
}
/* drop the tag from the input text */
ncgtext[slen - strlen(stag)] = '\0';
hasU = isuinttype(tag);
/* Capture the sign, if any */
isneg = (c == '-');
/* skip leading sign */
if(c == '-' || c == '+')
pos++;
c = pos[0];
if(tstoctal(c))
radix = 8;
else
radix = 10;
if(isneg && hasU) {
sprintf(errstr,"Unsigned integer cannot be signed: %s",ncgtext);
yyerror(errstr);
goto done;
}
uint64_val = parseULL(radix, pos,&fail);
if(fail) {
sprintf(errstr,"integer constant out of range: %s",ncgtext);
yyerror(errstr);
goto done;
}
/* Down convert to smallest possible range */
nct = downconvert(uint64_val,&tag,isneg,hasU);
switch (k_flag) {
case NC_FORMAT_64BIT_DATA:
case NC_FORMAT_NETCDF4:
return lexdebug(nct2lexeme(nct));
case NC_FORMAT_CLASSIC:
case NC_FORMAT_64BIT_OFFSET:
case NC_FORMAT_NETCDF4_CLASSIC:
if(nct > NC_INT) {
sprintf(errstr,"Illegal integer constant for classic format: %s",ncgtext);
yyerror(errstr);
goto done;
}
}
if(!tagmatch(nct,tag)) {
semwarn(lineno,"Warning: Integer out of range for tag: %s; tag treated as changed.",ncgtext);
}
return lexdebug(nct2lexeme(nct));
done: return 0;
}
YY_BREAK
case 37:
YY_RULE_SETUP
#line 457 "ncgen.l"
{
int c;
int token = 0;
int slen = strlen(ncgtext);
char* stag = NULL;
int tag = NC_NAT;
char* hex = ncgtext+2; /* point to first true hex digit */
int xlen = (slen - 3); /* true hex length */
ncgtext[slen-1] = '\0';
/* capture the tag string */
tag = collecttag(ncgtext,&stag);
if(tag == NC_NAT) {
sprintf(errstr,"Illegal integer suffix: %s",stag);
yyerror(errstr);
goto done;
}
ncgtext[slen - strlen(stag)] = '\0';
if(xlen > 16) { /* truncate hi order digits */
hex += (xlen - 16);
}
/* convert to an unsigned long long */
uint64_val = 0;
while((c=*hex++)) {
unsigned int hexdigit = (c <= '9'?(c-'0'):(c-'a')+0xa);
uint64_val = ((uint64_val << 4) | hexdigit);
}
switch (tag) {
case NC_USHORT:
uint16_val = (unsigned short)uint64_val;
token = USHORT_CONST;
break;
case NC_UINT:
token = UINT_CONST;
break;
case NC_UINT64:
token = UINT64_CONST;
break;
default: /* should never happen */
if (sscanf((char*)ncgtext, "%i", &uint32_val) != 1) {
sprintf(errstr,"bad unsigned int constant: %s",(char*)ncgtext);
yyerror(errstr);
}
token = UINT_CONST;
}
return lexdebug(token);
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 504 "ncgen.l"
{
if (sscanf((char*)ncgtext, "%le", &double_val) != 1) {
sprintf(errstr,"bad long or double constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return lexdebug(DOUBLE_CONST);
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 511 "ncgen.l"
{
if (sscanf((char*)ncgtext, "%e", &float_val) != 1) {
sprintf(errstr,"bad float constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return lexdebug(FLOAT_CONST);
}
YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
#line 518 "ncgen.l"
{
(void) sscanf((char*)&ncgtext[1],"%c",&byte_val);
return lexdebug(BYTE_CONST);
}
YY_BREAK
case 41:
YY_RULE_SETUP
#line 522 "ncgen.l"
{
int oct = unescapeoct(&ncgtext[2]);
if(oct < 0) {
sprintf(errstr,"bad octal character constant: %s",(char*)ncgtext);
yyerror(errstr);
}
byte_val = (unsigned int)oct;
return lexdebug(BYTE_CONST);
}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 531 "ncgen.l"
{
int hex = unescapehex(&ncgtext[3]);
if(byte_val < 0) {
sprintf(errstr,"bad hex character constant: %s",(char*)ncgtext);
yyerror(errstr);
}
byte_val = (unsigned int)hex;
return lexdebug(BYTE_CONST);
}
YY_BREAK
case 43:
YY_RULE_SETUP
#line 540 "ncgen.l"
{
switch ((char)ncgtext[2]) {
case 'a': byte_val = '\007'; break; /* not everyone under-
* stands '\a' yet */
case 'b': byte_val = '\b'; break;
case 'f': byte_val = '\f'; break;
case 'n': byte_val = '\n'; break;
case 'r': byte_val = '\r'; break;
case 't': byte_val = '\t'; break;
case 'v': byte_val = '\v'; break;
case '\\': byte_val = '\\'; break;
case '?': byte_val = '\177'; break;
case '\'': byte_val = '\''; break;
default: byte_val = (char)ncgtext[2];
}
return lexdebug(BYTE_CONST);
}
YY_BREAK
case 44:
/* rule 44 can match eol */
YY_RULE_SETUP
#line 558 "ncgen.l"
{
lineno++ ;
break;
}
YY_BREAK
case 45:
YY_RULE_SETUP
#line 563 "ncgen.l"
{/*initial*/
BEGIN(ST_C_COMMENT);
break;
}
YY_BREAK
case 46:
/* rule 46 can match eol */
YY_RULE_SETUP
#line 568 "ncgen.l"
{/* continuation */
break;
}
YY_BREAK
case 47:
YY_RULE_SETUP
#line 572 "ncgen.l"
{/* final */
BEGIN(INITIAL);
break;
}
YY_BREAK
case YY_STATE_EOF(ST_C_COMMENT):
#line 577 "ncgen.l"
{/* final, error */
fprintf(stderr,"unterminated /**/ comment");
BEGIN(INITIAL);
break;
}
YY_BREAK
case 48:
YY_RULE_SETUP
#line 583 "ncgen.l"
{/* Note: this next rule will not work for UTF8 characters */
return lexdebug(ncgtext[0]) ;
}
YY_BREAK
case 49:
YY_RULE_SETUP
#line 586 "ncgen.l"
ECHO;
YY_BREAK
#line 2176 "ncgenl.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(TEXT):
yyterminate();
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed ncgin at a new source and called
* ncglex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
YY_CURRENT_BUFFER_LVALUE->yy_input_file = ncgin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = (yy_c_buf_p);
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
(yy_did_buffer_switch_on_eof) = 0;
if ( ncgwrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* ncgtext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) =
(yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
(yy_c_buf_p) =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
} /* end of ncglex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = (yytext_ptr);
yy_size_t number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
ncgrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
ncgrestart(ncgin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ncgrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
yy_state_type yy_current_state;
char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 422 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
int yy_is_jam;
char *yy_cp = (yy_c_buf_p);
YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 422 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 421);
return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_UNPUT
static void yyunput (int c, char * yy_bp )
{
char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up ncgtext */
*yy_cp = (yy_hold_char);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
yy_size_t number_to_move = (yy_n_chars) + 2;
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
(yytext_ptr) = yy_bp;
(yy_hold_char) = *yy_cp;
(yy_c_buf_p) = yy_cp;
}
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
#else
static int input (void)
#endif
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
*(yy_c_buf_p) = '\0';
else
{ /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
ncgrestart(ncgin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
if ( ncgwrap( ) )
return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
*(yy_c_buf_p) = '\0'; /* preserve ncgtext */
(yy_hold_char) = *++(yy_c_buf_p);
return c;
}
#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void ncgrestart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
ncgensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
ncg_create_buffer(ncgin,YY_BUF_SIZE );
}
ncg_init_buffer(YY_CURRENT_BUFFER,input_file );
ncg_load_buffer_state( );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
void ncg_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
* ncgpop_buffer_state();
* ncgpush_buffer_state(new_buffer);
*/
ncgensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
ncg_load_buffer_state( );
/* We don't actually know whether we did this switch during
* EOF (ncgwrap()) processing, but the only time this flag
* is looked at is after ncgwrap() is called, so it's safe
* to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
static void ncg_load_buffer_state (void)
{
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
ncgin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
(yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE ncg_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) ncgalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in ncg_create_buffer()" );
b->yy_buf_size = (yy_size_t)size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) ncgalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in ncg_create_buffer()" );
b->yy_is_our_buffer = 1;
ncg_init_buffer(b,file );
return b;
}
/** Destroy the buffer.
* @param b a buffer created with ncg_create_buffer()
*
*/
void ncg_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
ncgfree((void *) b->yy_ch_buf );
ncgfree((void *) b );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a ncgrestart() or at EOF.
*/
static void ncg_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
int oerrno = errno;
ncg_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
/* If b is the current buffer, then ncg_init_buffer was _probably_
* called from ncgrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
void ncg_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
ncg_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*/
void ncgpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
if (new_buffer == NULL)
return;
ncgensure_buffer_stack();
/* This block is copied from ncg_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
/* Only push if top exists. Otherwise, replace top. */
if (YY_CURRENT_BUFFER)
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from ncg_switch_to_buffer. */
ncg_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*/
void ncgpop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
ncg_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
ncg_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
static void ncgensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
(yy_buffer_stack) = (struct yy_buffer_state**)ncgalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in ncgensure_buffer_stack()" );
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
}
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)ncgrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in ncgensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
}
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) ncgalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in ncg_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
ncg_switch_to_buffer(b );
return b;
}
/** Setup the input buffer state to scan a string. The next call to ncglex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* ncg_scan_bytes() instead.
*/
YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )
{
return ncg_scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to ncglex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) ncgalloc(n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in ncg_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = ncg_scan_buffer(buf,n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in ncg_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
static void yy_fatal_error (yyconst char* msg )
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up ncgtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
ncgtext[ncgleng] = (yy_hold_char); \
(yy_c_buf_p) = ncgtext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
ncgleng = yyless_macro_arg; \
} \
while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
*
*/
int ncgget_lineno (void)
{
return ncglineno;
}
/** Get the input stream.
*
*/
FILE *ncgget_in (void)
{
return ncgin;
}
/** Get the output stream.
*
*/
FILE *ncgget_out (void)
{
return ncgout;
}
/** Get the length of the current token.
*
*/
yy_size_t ncgget_leng (void)
{
return ncgleng;
}
/** Get the current token.
*
*/
char *ncgget_text (void)
{
return ncgtext;
}
/** Set the current line number.
* @param _line_number line number
*
*/
void ncgset_lineno (int _line_number )
{
ncglineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param _in_str A readable stream.
*
* @see ncg_switch_to_buffer
*/
void ncgset_in (FILE * _in_str )
{
ncgin = _in_str ;
}
void ncgset_out (FILE * _out_str )
{
ncgout = _out_str ;
}
int ncgget_debug (void)
{
return ncg_flex_debug;
}
void ncgset_debug (int _bdebug )
{
ncg_flex_debug = _bdebug ;
}
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
* This function is called from ncglex_destroy(), so don't allocate here.
*/
(yy_buffer_stack) = 0;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
(yy_c_buf_p) = (char *) 0;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
ncgin = stdin;
ncgout = stdout;
#else
ncgin = (FILE *) 0;
ncgout = (FILE *) 0;
#endif
/* For future reference: Set errno on error, since we are called by
* ncglex_init()
*/
return 0;
}
/* ncglex_destroy is for both reentrant and non-reentrant scanners. */
int ncglex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
ncg_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
ncgpop_buffer_state();
}
/* Destroy the stack itself. */
ncgfree((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* ncglex() is called, initialization will occur. */
yy_init_globals( );
return 0;
}
/*
* Internal utility routines.
*/
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
void *ncgalloc (yy_size_t size )
{
return (void *) malloc( size );
}
void *ncgrealloc (void * ptr, yy_size_t size )
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
void ncgfree (void * ptr )
{
free( (char *) ptr ); /* see ncgrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
#line 586 "ncgen.l"
static int
lexdebug(int token)
{
if(debug >= 2)
{
char* text = ncgtext;
text[ncgleng] = 0;
fprintf(stderr,"Token=%d |%s| line=%d\n",token,text,lineno);
}
return token;
}
int
lex_init(void)
{
lineno = 1;
lextext = bbNew();
if(0) unput(0); /* keep -Wall quiet */
return 0;
}
static Symbol*
makepath(char* text0)
{
/* Create a reference symbol.
Convert path to a sequence of symbols.
Use last name as symbol name (with root group reference ('/') as exception).
*/
Symbol* refsym = NULL;
/* walk the path converting to a sequence of symbols */
if(strcmp(text0,"/")==0) {
/* special case of root reference */
refsym = rootgroup;
} else {
List* prefix = listnew();
/* split the text into IDENT chunks, convert to symbols */
Symbol* container = rootgroup;
char *ident, *p, *match;
char* text = estrdup(text0);
int lastident;
ident=text+1; p=ident; /* skip leading '/' */
lastident = 0;
do {
match = esc_strchr(p,'/',0);
lastident = (*match == '\0');
*match='\0';
(void)unescape(p,strlen(p),ISIDENT,&ident);
refsym = lookupingroup(NC_GRP,ident,container);
if(!lastident) {
if(refsym == NULL) {
sprintf(errstr,"Undefined or forward referenced group: %s",ident);
yyerror(errstr);
refsym = rootgroup;
} else
listpush(prefix,(void*)refsym);
} else {/* lasiident is true */
refsym = install(ident); /* create as symbol */
refsym->objectclass = NC_GRP;/* tentative */
refsym->ref.is_ref = 1;
refsym->container = container;
refsym->subnodes = listnew();
}
container = refsym;
p = (lastident?match:match+1);
if(ident) efree(ident);
} while(!lastident);
refsym->prefix = prefix;
efree(text);
}
return refsym;
}
/*
Parse a simple string of digits into an unsigned long long
Return the value.
*/
static unsigned long long
parseULL(int radix, char* text, int* failp)
{
extern int errno;
char* endptr;
unsigned long long uint64 = 0;
errno = 0; endptr = NULL;
#ifdef HAVE_STRTOULL
uint64 = strtoull(text,&endptr,radix);
if(errno == ERANGE) {
if(failp) *failp = ERANGE;
return 0;
}
#else /*!defined HAVE_STRTOULL*/
/* Have no useful way to detect out of range */
if(radix == 8)
sscanf((char*)text, "%llo", &uint64);
else
sscanf((char*)text, "%llu", &uint64);
#endif /*!defined HAVE_STRTOULL*/
return uint64;
}
/**
Given the raw bits, the sign char, the tag, and hasU
fill in the appropriate *_val field
and return the type.
Note that we cannot return unsigned types if running pure netcdf classic.
The rule is to pick the smallest enclosing type.
The rule used here is that the tag (the suffix, if any)
always takes precedence and the value is modified to conform
if possible, otherwise out-of-range is signalled.
For historical reasons (ncgen3), values that fit as unsigned
are acceptable for the signed tag and conversion is attempted;
e.g. 65535s; is legal and is return as a negative short.
*/
static nc_type
downconvert(unsigned long long uint64, int* tagp, int isneg, int hasU)
{
nc_type nct = NC_NAT;
int tag = *tagp;
int bit63set = (uint64 >> 63);
long long int64 = *((long long*)&uint64);
if(isneg && hasU) {
return (*tagp = NC_NAT);
}
/* To simplify the code, we look for special case of NC_UINT64
constants that will not fit into an NC_INT64 constant.
*/
if(tag == NC_UINT64 && bit63set) {
uint64_val = uint64;
return tag;
}
/* At this point we need deal only with int64 value */
/* Apply the isneg */
if(isneg)
int64 = - int64;
if(tag == NC_NOTAG) {
/* If we have no other info, then assume NC_(U)INT(64) */
if(int64 >= NC_MIN_INT && int64 <= NC_MAX_INT) {
nct = (tag = NC_INT);
int32_val = (signed int)int64;
} else if(int64 >= 0 && int64 <= NC_MAX_UINT) {
nct = (tag = NC_UINT);
uint32_val = (unsigned int)int64;
} else if(int64 < 0) {
nct = (tag = NC_INT64);
int64_val = (signed long long)int64;
} else {
nct = (tag = NC_UINT64);
uint64_val = (unsigned long long)int64;
}
goto done;
}
if(isuinttype(tag) && int64 < 0)
goto outofrange;
switch (tag) {
case NC_UBYTE:
if(int64 <= NC_MAX_UBYTE) {
nct = NC_UBYTE;
ubyte_val = (unsigned char)int64;
} else
goto outofrange;
break;
case NC_USHORT:
if(int64 <= NC_MAX_USHORT) {
nct = NC_USHORT;
uint16_val = (unsigned short)int64;
} else
goto outofrange;
break;
case NC_UINT:
if(int64 <= NC_MAX_UINT) {
nct = NC_UINT;
uint32_val = (unsigned int)int64;
} else
goto outofrange;
break;
case NC_UINT64:
if(int64 <= NC_MAX_UINT64) {
nct = NC_UINT64;
uint64_val = uint64;
} else
goto outofrange;
break;
case NC_INT64:
nct = NC_INT64;
int64_val = int64;
break;
case NC_BYTE:
nct = NC_BYTE;
byte_val = (signed char)int64;
break;
case NC_SHORT:
nct = NC_SHORT;
int16_val = (signed short)int64;
break;
case NC_INT:
nct = NC_INT;
int32_val = (signed int)int64;
break;
default:
goto outofrange;
}
done:
*tagp = tag;
return nct;
outofrange:
yyerror("Value out of range");
return NC_NAT;
}
static int
nct2lexeme(nc_type nct)
{
switch(nct) {
case NC_BYTE: return BYTE_CONST;
case NC_CHAR: return CHAR_CONST;
case NC_SHORT: return SHORT_CONST;
case NC_INT: return INT_CONST;
case NC_UBYTE: return UBYTE_CONST;
case NC_USHORT: return USHORT_CONST;
case NC_UINT: return UINT_CONST;
case NC_INT64: return INT64_CONST;
case NC_UINT64: return UINT64_CONST;
}
return 0;
}
static int
tagmatch(nc_type nct, int tag)
{
if(tag == NC_NAT || tag == NC_NOTAG)
return 1;
return nct == tag;
}
/* capture the tag string */
static int
collecttag(char* text, char** stagp)
{
char* stag0;
#define MAXTAGLEN 3
char stag[MAXTAGLEN+1];
int slen = strlen(text);
int staglen;
int tag = NC_NAT;
int hasU = 0;
for(stag0 = text+(slen-1);stag0 > 0;stag0--) {
if(strchr(TAGCHARS,*stag0) == NULL) {stag0++; break;}
}
if(stagp) *stagp = stag0;
staglen = strlen(stag0);
if(staglen == 0)
return NC_NOTAG;
if(staglen > MAXTAGLEN)
return tag;
strncpy(stag,stag0,sizeof(stag));
stag[MAXTAGLEN] = '\0';
if(stag[0] == 'U' || stag[0] == 'u') {
hasU = 1;
memmove(stag,stag+1,MAXTAGLEN);
staglen--;
} else if(stag[staglen-1] == 'U' || stag[staglen-1] == 'u') {
hasU = 1;
staglen--;
stag[staglen] = '\0';
}
if(strlen(stag) == 0 && hasU) {
tag = NC_UINT;
} else if(strlen(stag) == 1) {
switch (stag[0]) {
case 'B': case 'b': tag = (hasU ? NC_UBYTE : NC_BYTE); break;
case 'S': case 's': tag = (hasU ? NC_USHORT : NC_SHORT); break;
case 'L': case 'l': tag = (hasU ? NC_UINT : NC_INT); break;
default: break;
}
} else if(strcasecmp(stag,"ll") == 0) {
tag = (hasU ? NC_UINT64 : NC_INT64);
}
if(tag == NC_NAT) {
if(strlen(stag) > 0)
return tag;
tag = NC_NAT;
}
return tag;
}
| 32.134217 | 117 | 0.554638 | [
"object"
] |
cfbc69772081813b766bea814b5e3d119c8ce755 | 3,195 | h | C | arangod/GeoIndex/Index.h | rajeev02101987/arangodb | 817e6c04cb82777d266f3b444494140676da98e2 | [
"Apache-2.0"
] | 1 | 2020-07-30T23:33:02.000Z | 2020-07-30T23:33:02.000Z | arangod/GeoIndex/Index.h | rajeev02101987/arangodb | 817e6c04cb82777d266f3b444494140676da98e2 | [
"Apache-2.0"
] | 109 | 2022-01-06T07:05:24.000Z | 2022-03-21T01:39:35.000Z | arangod/GeoIndex/Index.h | rajeev02101987/arangodb | 817e6c04cb82777d266f3b444494140676da98e2 | [
"Apache-2.0"
] | null | null | null | ////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2017-2018 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Simon Grätzer
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_GEO_INDEX_H
#define ARANGOD_GEO_INDEX_H 1
#include <s2/s2cell_id.h>
#include <s2/s2latlng.h>
#include "Basics/Result.h"
#include "Geo/GeoParams.h"
namespace arangodb {
namespace aql {
struct AstNode;
struct Variable;
} // namespace aql
namespace basics {
struct AttributeName;
}
namespace velocypack {
class Slice;
}
namespace geo {
struct Coordinate;
struct QueryParams;
class ShapeContainer;
} // namespace geo
namespace geo_index {
/// Mixin for geo indexes
struct Index {
/// @brief geo index variants
enum class Variant : uint8_t {
NONE = 0,
/// two distinct fields representing GeoJSON Point
INDIVIDUAL_LAT_LON,
/// pair [<latitude>, <longitude>] eqvivalent to GeoJSON Point
COMBINED_LAT_LON,
// geojson object or legacy coordinate
// pair [<longitude>, <latitude>]. Should also support
// other geojson object types.
GEOJSON
};
protected:
/// @brief Initialize coverParams
Index(velocypack::Slice const&, std::vector<std::vector<basics::AttributeName>> const&);
public:
/// @brief Parse document and return cells for indexing
Result indexCells(velocypack::Slice const& doc, std::vector<S2CellId>& cells,
S2Point& centroid) const;
Result shape(velocypack::Slice const& doc, geo::ShapeContainer& shape) const;
/// @brief Parse AQL condition into query parameters
/// Public to allow usage by legacy geo indexes
static void parseCondition(aql::AstNode const* node, aql::Variable const* reference,
geo::QueryParams& params);
Variant variant() const { return _variant; }
private:
static S2LatLng parseGeoDistance(aql::AstNode const* node, aql::Variable const* ref);
static S2LatLng parseDistFCall(aql::AstNode const* node, aql::Variable const* ref);
static void handleNode(aql::AstNode const* node, aql::Variable const* ref,
geo::QueryParams& params);
protected:
/// @brief immutable region coverer parameters
geo::RegionCoverParams _coverParams;
/// @brief the type of geo we support
Variant _variant;
/// @brief attribute paths
std::vector<std::string> _location;
std::vector<std::string> _latitude;
std::vector<std::string> _longitude;
};
} // namespace geo_index
} // namespace arangodb
#endif
| 29.583333 | 90 | 0.672926 | [
"object",
"shape",
"vector"
] |
cfc6f8b7ebeab7f8e1a8836367dfa44c27f02e2c | 63,775 | h | C | deps/pybind11/include/pybind11/cast.h | Mistobaan/coremltools | e5ce33c6396077c0b267180a92573355a8ab53eb | [
"BSD-3-Clause"
] | 11,356 | 2017-12-08T19:42:32.000Z | 2022-03-31T16:55:25.000Z | deps/pybind11/include/pybind11/cast.h | Mistobaan/coremltools | e5ce33c6396077c0b267180a92573355a8ab53eb | [
"BSD-3-Clause"
] | 2,402 | 2017-12-08T22:31:01.000Z | 2022-03-28T19:25:52.000Z | deps/pybind11/include/pybind11/cast.h | Mistobaan/coremltools | e5ce33c6396077c0b267180a92573355a8ab53eb | [
"BSD-3-Clause"
] | 1,343 | 2017-12-08T19:47:19.000Z | 2022-03-26T11:31:36.000Z | /*
pybind11/cast.h: Partial template specializations to cast between
C++ and Python types
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
All rights reserved. Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.
*/
#pragma once
#include "pytypes.h"
#include "typeid.h"
#include "descr.h"
#include <array>
#include <limits>
NAMESPACE_BEGIN(pybind11)
NAMESPACE_BEGIN(detail)
/// Additional type information which does not fit into the PyTypeObject
struct type_info {
PyTypeObject *type;
size_t type_size;
void (*init_holder)(PyObject *, const void *);
std::vector<PyObject *(*)(PyObject *, PyTypeObject *)> implicit_conversions;
std::vector<std::pair<const std::type_info *, void *(*)(void *)>> implicit_casts;
std::vector<bool (*)(PyObject *, void *&)> *direct_conversions;
buffer_info *(*get_buffer)(PyObject *, void *) = nullptr;
void *get_buffer_data = nullptr;
/** A simple type never occurs as a (direct or indirect) parent
* of a class that makes use of multiple inheritance */
bool simple_type = true;
/* for base vs derived holder_type checks */
bool default_holder = true;
};
PYBIND11_NOINLINE inline internals &get_internals() {
static internals *internals_ptr = nullptr;
if (internals_ptr)
return *internals_ptr;
handle builtins(PyEval_GetBuiltins());
const char *id = PYBIND11_INTERNALS_ID;
if (builtins.contains(id) && isinstance<capsule>(builtins[id])) {
internals_ptr = capsule(builtins[id]);
} else {
internals_ptr = new internals();
#if defined(WITH_THREAD)
PyEval_InitThreads();
PyThreadState *tstate = PyThreadState_Get();
internals_ptr->tstate = PyThread_create_key();
PyThread_set_key_value(internals_ptr->tstate, tstate);
internals_ptr->istate = tstate->interp;
#endif
builtins[id] = capsule(internals_ptr);
internals_ptr->registered_exception_translators.push_front(
[](std::exception_ptr p) -> void {
try {
if (p) std::rethrow_exception(p);
} catch (error_already_set &e) { e.restore(); return;
} catch (const builtin_exception &e) { e.set_error(); return;
} catch (const std::bad_alloc &e) { PyErr_SetString(PyExc_MemoryError, e.what()); return;
} catch (const std::domain_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
} catch (const std::invalid_argument &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
} catch (const std::length_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
} catch (const std::out_of_range &e) { PyErr_SetString(PyExc_IndexError, e.what()); return;
} catch (const std::range_error &e) { PyErr_SetString(PyExc_ValueError, e.what()); return;
} catch (const std::exception &e) { PyErr_SetString(PyExc_RuntimeError, e.what()); return;
} catch (...) {
PyErr_SetString(PyExc_RuntimeError, "Caught an unknown exception!");
return;
}
}
);
}
return *internals_ptr;
}
PYBIND11_NOINLINE inline detail::type_info* get_type_info(PyTypeObject *type) {
auto const &type_dict = get_internals().registered_types_py;
do {
auto it = type_dict.find(type);
if (it != type_dict.end())
return (detail::type_info *) it->second;
type = type->tp_base;
if (!type)
return nullptr;
} while (true);
}
PYBIND11_NOINLINE inline detail::type_info *get_type_info(const std::type_info &tp,
bool throw_if_missing = false) {
auto &types = get_internals().registered_types_cpp;
auto it = types.find(std::type_index(tp));
if (it != types.end())
return (detail::type_info *) it->second;
if (throw_if_missing) {
std::string tname = tp.name();
detail::clean_type_id(tname);
pybind11_fail("pybind11::detail::get_type_info: unable to find type info for \"" + tname + "\"");
}
return nullptr;
}
PYBIND11_NOINLINE inline handle get_type_handle(const std::type_info &tp, bool throw_if_missing) {
detail::type_info *type_info = get_type_info(tp, throw_if_missing);
return handle(type_info ? ((PyObject *) type_info->type) : nullptr);
}
PYBIND11_NOINLINE inline bool isinstance_generic(handle obj, const std::type_info &tp) {
handle type = detail::get_type_handle(tp, false);
if (!type)
return false;
return isinstance(obj, type);
}
PYBIND11_NOINLINE inline std::string error_string() {
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_RuntimeError, "Unknown internal error occurred");
return "Unknown internal error occurred";
}
error_scope scope; // Preserve error state
std::string errorString;
if (scope.type) {
errorString += handle(scope.type).attr("__name__").cast<std::string>();
errorString += ": ";
}
if (scope.value)
errorString += (std::string) str(scope.value);
PyErr_NormalizeException(&scope.type, &scope.value, &scope.trace);
#if PY_MAJOR_VERSION >= 3
if (scope.trace != nullptr)
PyException_SetTraceback(scope.value, scope.trace);
#endif
#if !defined(PYPY_VERSION)
if (scope.trace) {
PyTracebackObject *trace = (PyTracebackObject *) scope.trace;
/* Get the deepest trace possible */
while (trace->tb_next)
trace = trace->tb_next;
PyFrameObject *frame = trace->tb_frame;
errorString += "\n\nAt:\n";
while (frame) {
int lineno = PyFrame_GetLineNumber(frame);
errorString +=
" " + handle(frame->f_code->co_filename).cast<std::string>() +
"(" + std::to_string(lineno) + "): " +
handle(frame->f_code->co_name).cast<std::string>() + "\n";
frame = frame->f_back;
}
trace = trace->tb_next;
}
#endif
return errorString;
}
PYBIND11_NOINLINE inline handle get_object_handle(const void *ptr, const detail::type_info *type ) {
auto &instances = get_internals().registered_instances;
auto range = instances.equal_range(ptr);
for (auto it = range.first; it != range.second; ++it) {
auto instance_type = detail::get_type_info(Py_TYPE(it->second));
if (instance_type && instance_type == type)
return handle((PyObject *) it->second);
}
return handle();
}
inline PyThreadState *get_thread_state_unchecked() {
#if defined(PYPY_VERSION)
return PyThreadState_GET();
#elif PY_VERSION_HEX < 0x03000000
return _PyThreadState_Current;
#elif PY_VERSION_HEX < 0x03050000
return (PyThreadState*) _Py_atomic_load_relaxed(&_PyThreadState_Current);
#elif PY_VERSION_HEX < 0x03050200
return (PyThreadState*) _PyThreadState_Current.value;
#else
return _PyThreadState_UncheckedGet();
#endif
}
// Forward declaration
inline void keep_alive_impl(handle nurse, handle patient);
class type_caster_generic {
public:
PYBIND11_NOINLINE type_caster_generic(const std::type_info &type_info)
: typeinfo(get_type_info(type_info)) { }
PYBIND11_NOINLINE bool load(handle src, bool convert) {
if (!src)
return false;
return load(src, convert, Py_TYPE(src.ptr()));
}
bool load(handle src, bool convert, PyTypeObject *tobj) {
if (!src || !typeinfo)
return false;
if (src.is_none()) {
value = nullptr;
return true;
}
if (typeinfo->simple_type) { /* Case 1: no multiple inheritance etc. involved */
/* Check if we can safely perform a reinterpret-style cast */
if (PyType_IsSubtype(tobj, typeinfo->type)) {
value = reinterpret_cast<instance<void> *>(src.ptr())->value;
return true;
}
} else { /* Case 2: multiple inheritance */
/* Check if we can safely perform a reinterpret-style cast */
if (tobj == typeinfo->type) {
value = reinterpret_cast<instance<void> *>(src.ptr())->value;
return true;
}
/* If this is a python class, also check the parents recursively */
auto const &type_dict = get_internals().registered_types_py;
bool new_style_class = PyType_Check((PyObject *) tobj);
if (type_dict.find(tobj) == type_dict.end() && new_style_class && tobj->tp_bases) {
auto parents = reinterpret_borrow<tuple>(tobj->tp_bases);
for (handle parent : parents) {
bool result = load(src, convert, (PyTypeObject *) parent.ptr());
if (result)
return true;
}
}
/* Try implicit casts */
for (auto &cast : typeinfo->implicit_casts) {
type_caster_generic sub_caster(*cast.first);
if (sub_caster.load(src, convert)) {
value = cast.second(sub_caster.value);
return true;
}
}
}
/* Perform an implicit conversion */
if (convert) {
for (auto &converter : typeinfo->implicit_conversions) {
temp = reinterpret_steal<object>(converter(src.ptr(), typeinfo->type));
if (load(temp, false))
return true;
}
for (auto &converter : *typeinfo->direct_conversions) {
if (converter(src.ptr(), value))
return true;
}
}
return false;
}
PYBIND11_NOINLINE static handle cast(const void *_src, return_value_policy policy, handle parent,
const std::type_info *type_info,
const std::type_info *type_info_backup,
void *(*copy_constructor)(const void *),
void *(*move_constructor)(const void *),
const void *existing_holder = nullptr) {
void *src = const_cast<void *>(_src);
if (src == nullptr)
return none().inc_ref();
auto &internals = get_internals();
auto it = internals.registered_types_cpp.find(std::type_index(*type_info));
if (it == internals.registered_types_cpp.end()) {
type_info = type_info_backup;
it = internals.registered_types_cpp.find(std::type_index(*type_info));
}
if (it == internals.registered_types_cpp.end()) {
std::string tname = type_info->name();
detail::clean_type_id(tname);
std::string msg = "Unregistered type : " + tname;
PyErr_SetString(PyExc_TypeError, msg.c_str());
return handle();
}
auto tinfo = (const detail::type_info *) it->second;
auto it_instances = internals.registered_instances.equal_range(src);
for (auto it_i = it_instances.first; it_i != it_instances.second; ++it_i) {
auto instance_type = detail::get_type_info(Py_TYPE(it_i->second));
if (instance_type && instance_type == tinfo)
return handle((PyObject *) it_i->second).inc_ref();
}
auto inst = reinterpret_steal<object>(PyType_GenericAlloc(tinfo->type, 0));
auto wrapper = (instance<void> *) inst.ptr();
wrapper->value = nullptr;
wrapper->owned = false;
switch (policy) {
case return_value_policy::automatic:
case return_value_policy::take_ownership:
wrapper->value = src;
wrapper->owned = true;
break;
case return_value_policy::automatic_reference:
case return_value_policy::reference:
wrapper->value = src;
wrapper->owned = false;
break;
case return_value_policy::copy:
if (copy_constructor)
wrapper->value = copy_constructor(src);
else
throw cast_error("return_value_policy = copy, but the "
"object is non-copyable!");
wrapper->owned = true;
break;
case return_value_policy::move:
if (move_constructor)
wrapper->value = move_constructor(src);
else if (copy_constructor)
wrapper->value = copy_constructor(src);
else
throw cast_error("return_value_policy = move, but the "
"object is neither movable nor copyable!");
wrapper->owned = true;
break;
case return_value_policy::reference_internal:
wrapper->value = src;
wrapper->owned = false;
detail::keep_alive_impl(inst, parent);
break;
default:
throw cast_error("unhandled return_value_policy: should not happen!");
}
tinfo->init_holder(inst.ptr(), existing_holder);
internals.registered_instances.emplace(wrapper->value, inst.ptr());
return inst.release();
}
protected:
const type_info *typeinfo = nullptr;
void *value = nullptr;
object temp;
};
/* Determine suitable casting operator */
template <typename T>
using cast_op_type = typename std::conditional<std::is_pointer<typename std::remove_reference<T>::type>::value,
typename std::add_pointer<intrinsic_t<T>>::type,
typename std::add_lvalue_reference<intrinsic_t<T>>::type>::type;
// std::is_copy_constructible isn't quite enough: it lets std::vector<T> (and similar) through when
// T is non-copyable, but code containing such a copy constructor fails to actually compile.
template <typename T, typename SFINAE = void> struct is_copy_constructible : std::is_copy_constructible<T> {};
// Specialization for types that appear to be copy constructible but also look like stl containers
// (we specifically check for: has `value_type` and `reference` with `reference = value_type&`): if
// so, copy constructability depends on whether the value_type is copy constructible.
template <typename Container> struct is_copy_constructible<Container, enable_if_t<
std::is_copy_constructible<Container>::value &&
std::is_same<typename Container::value_type &, typename Container::reference>::value
>> : std::is_copy_constructible<typename Container::value_type> {};
/// Generic type caster for objects stored on the heap
template <typename type> class type_caster_base : public type_caster_generic {
using itype = intrinsic_t<type>;
public:
static PYBIND11_DESCR name() { return type_descr(_<type>()); }
type_caster_base() : type_caster_base(typeid(type)) { }
explicit type_caster_base(const std::type_info &info) : type_caster_generic(info) { }
static handle cast(const itype &src, return_value_policy policy, handle parent) {
if (policy == return_value_policy::automatic || policy == return_value_policy::automatic_reference)
policy = return_value_policy::copy;
return cast(&src, policy, parent);
}
static handle cast(itype &&src, return_value_policy, handle parent) {
return cast(&src, return_value_policy::move, parent);
}
static handle cast(const itype *src, return_value_policy policy, handle parent) {
return type_caster_generic::cast(
src, policy, parent, src ? &typeid(*src) : nullptr, &typeid(type),
make_copy_constructor(src), make_move_constructor(src));
}
static handle cast_holder(const itype *src, const void *holder) {
return type_caster_generic::cast(
src, return_value_policy::take_ownership, {},
src ? &typeid(*src) : nullptr, &typeid(type),
nullptr, nullptr, holder);
}
template <typename T> using cast_op_type = pybind11::detail::cast_op_type<T>;
operator itype*() { return (type *) value; }
operator itype&() { if (!value) throw reference_cast_error(); return *((itype *) value); }
protected:
typedef void *(*Constructor)(const void *stream);
#if !defined(_MSC_VER)
/* Only enabled when the types are {copy,move}-constructible *and* when the type
does not have a private operator new implementaton. */
template <typename T = type, typename = enable_if_t<is_copy_constructible<T>::value>> static auto make_copy_constructor(const T *value) -> decltype(new T(*value), Constructor(nullptr)) {
return [](const void *arg) -> void * { return new T(*((const T *) arg)); }; }
template <typename T = type> static auto make_move_constructor(const T *value) -> decltype(new T(std::move(*((T *) value))), Constructor(nullptr)) {
return [](const void *arg) -> void * { return (void *) new T(std::move(*const_cast<T *>(reinterpret_cast<const T *>(arg)))); }; }
#else
/* Visual Studio 2015's SFINAE implementation doesn't yet handle the above robustly in all situations.
Use a workaround that only tests for constructibility for now. */
template <typename T = type, typename = enable_if_t<is_copy_constructible<T>::value>>
static Constructor make_copy_constructor(const T *value) {
return [](const void *arg) -> void * { return new T(*((const T *)arg)); }; }
template <typename T = type, typename = enable_if_t<std::is_move_constructible<T>::value>>
static Constructor make_move_constructor(const T *value) {
return [](const void *arg) -> void * { return (void *) new T(std::move(*((T *)arg))); }; }
#endif
static Constructor make_copy_constructor(...) { return nullptr; }
static Constructor make_move_constructor(...) { return nullptr; }
};
template <typename type, typename SFINAE = void> class type_caster : public type_caster_base<type> { };
template <typename type> using make_caster = type_caster<intrinsic_t<type>>;
// Shortcut for calling a caster's `cast_op_type` cast operator for casting a type_caster to a T
template <typename T> typename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &caster) {
return caster.operator typename make_caster<T>::template cast_op_type<T>();
}
template <typename T> typename make_caster<T>::template cast_op_type<T> cast_op(make_caster<T> &&caster) {
return cast_op<T>(caster);
}
template <typename type> class type_caster<std::reference_wrapper<type>> : public type_caster_base<type> {
public:
static handle cast(const std::reference_wrapper<type> &src, return_value_policy policy, handle parent) {
return type_caster_base<type>::cast(&src.get(), policy, parent);
}
template <typename T> using cast_op_type = std::reference_wrapper<type>;
operator std::reference_wrapper<type>() { return std::ref(*((type *) this->value)); }
};
#define PYBIND11_TYPE_CASTER(type, py_name) \
protected: \
type value; \
public: \
static PYBIND11_DESCR name() { return type_descr(py_name); } \
static handle cast(const type *src, return_value_policy policy, handle parent) { \
return cast(*src, policy, parent); \
} \
operator type*() { return &value; } \
operator type&() { return value; } \
template <typename _T> using cast_op_type = pybind11::detail::cast_op_type<_T>
template <typename CharT> using is_std_char_type = any_of<
std::is_same<CharT, char>, /* std::string */
std::is_same<CharT, char16_t>, /* std::u16string */
std::is_same<CharT, char32_t>, /* std::u32string */
std::is_same<CharT, wchar_t> /* std::wstring */
>;
template <typename T>
struct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_type<T>::value>> {
using _py_type_0 = conditional_t<sizeof(T) <= sizeof(long), long, long long>;
using _py_type_1 = conditional_t<std::is_signed<T>::value, _py_type_0, typename std::make_unsigned<_py_type_0>::type>;
using py_type = conditional_t<std::is_floating_point<T>::value, double, _py_type_1>;
public:
bool load(handle src, bool convert) {
py_type py_value;
if (!src)
return false;
if (std::is_floating_point<T>::value) {
if (convert || PyFloat_Check(src.ptr()))
py_value = (py_type) PyFloat_AsDouble(src.ptr());
else
return false;
} else if (sizeof(T) <= sizeof(long)) {
if (PyFloat_Check(src.ptr()))
return false;
if (std::is_signed<T>::value)
py_value = (py_type) PyLong_AsLong(src.ptr());
else
py_value = (py_type) PyLong_AsUnsignedLong(src.ptr());
} else {
if (PyFloat_Check(src.ptr()))
return false;
if (std::is_signed<T>::value)
py_value = (py_type) PYBIND11_LONG_AS_LONGLONG(src.ptr());
else
py_value = (py_type) PYBIND11_LONG_AS_UNSIGNED_LONGLONG(src.ptr());
}
if ((py_value == (py_type) -1 && PyErr_Occurred()) ||
(std::is_integral<T>::value && sizeof(py_type) != sizeof(T) &&
(py_value < (py_type) std::numeric_limits<T>::min() ||
py_value > (py_type) std::numeric_limits<T>::max()))) {
#if PY_VERSION_HEX < 0x03000000
bool type_error = PyErr_ExceptionMatches(PyExc_SystemError);
#else
bool type_error = PyErr_ExceptionMatches(PyExc_TypeError);
#endif
PyErr_Clear();
if (type_error && convert && PyNumber_Check(src.ptr())) {
auto tmp = reinterpret_borrow<object>(std::is_floating_point<T>::value
? PyNumber_Float(src.ptr())
: PyNumber_Long(src.ptr()));
PyErr_Clear();
return load(tmp, false);
}
return false;
}
value = (T) py_value;
return true;
}
static handle cast(T src, return_value_policy /* policy */, handle /* parent */) {
if (std::is_floating_point<T>::value) {
return PyFloat_FromDouble((double) src);
} else if (sizeof(T) <= sizeof(long)) {
if (std::is_signed<T>::value)
return PyLong_FromLong((long) src);
else
return PyLong_FromUnsignedLong((unsigned long) src);
} else {
if (std::is_signed<T>::value)
return PyLong_FromLongLong((long long) src);
else
return PyLong_FromUnsignedLongLong((unsigned long long) src);
}
}
PYBIND11_TYPE_CASTER(T, _<std::is_integral<T>::value>("int", "float"));
};
template<typename T> struct void_caster {
public:
bool load(handle, bool) { return false; }
static handle cast(T, return_value_policy /* policy */, handle /* parent */) {
return none().inc_ref();
}
PYBIND11_TYPE_CASTER(T, _("None"));
};
template <> class type_caster<void_type> : public void_caster<void_type> {};
template <> class type_caster<void> : public type_caster<void_type> {
public:
using type_caster<void_type>::cast;
bool load(handle h, bool) {
if (!h) {
return false;
} else if (h.is_none()) {
value = nullptr;
return true;
}
/* Check if this is a capsule */
if (isinstance<capsule>(h)) {
value = reinterpret_borrow<capsule>(h);
return true;
}
/* Check if this is a C++ type */
if (get_type_info((PyTypeObject *) h.get_type().ptr())) {
value = ((instance<void> *) h.ptr())->value;
return true;
}
/* Fail */
return false;
}
static handle cast(const void *ptr, return_value_policy /* policy */, handle /* parent */) {
if (ptr)
return capsule(ptr).release();
else
return none().inc_ref();
}
template <typename T> using cast_op_type = void*&;
operator void *&() { return value; }
static PYBIND11_DESCR name() { return type_descr(_("capsule")); }
private:
void *value = nullptr;
};
template <> class type_caster<std::nullptr_t> : public type_caster<void_type> { };
template <> class type_caster<bool> {
public:
bool load(handle src, bool) {
if (!src) return false;
else if (src.ptr() == Py_True) { value = true; return true; }
else if (src.ptr() == Py_False) { value = false; return true; }
else return false;
}
static handle cast(bool src, return_value_policy /* policy */, handle /* parent */) {
return handle(src ? Py_True : Py_False).inc_ref();
}
PYBIND11_TYPE_CASTER(bool, _("bool"));
};
// Helper class for UTF-{8,16,32} C++ stl strings:
template <typename CharT, class Traits, class Allocator>
struct type_caster<std::basic_string<CharT, Traits, Allocator>, enable_if_t<is_std_char_type<CharT>::value>> {
// Simplify life by being able to assume standard char sizes (the standard only guarantees
// minimums), but Python requires exact sizes
static_assert(!std::is_same<CharT, char>::value || sizeof(CharT) == 1, "Unsupported char size != 1");
static_assert(!std::is_same<CharT, char16_t>::value || sizeof(CharT) == 2, "Unsupported char16_t size != 2");
static_assert(!std::is_same<CharT, char32_t>::value || sizeof(CharT) == 4, "Unsupported char32_t size != 4");
// wchar_t can be either 16 bits (Windows) or 32 (everywhere else)
static_assert(!std::is_same<CharT, wchar_t>::value || sizeof(CharT) == 2 || sizeof(CharT) == 4,
"Unsupported wchar_t size != 2/4");
static constexpr size_t UTF_N = 8 * sizeof(CharT);
static constexpr const char *encoding = UTF_N == 8 ? "utf8" : UTF_N == 16 ? "utf16" : "utf32";
using StringType = std::basic_string<CharT, Traits, Allocator>;
bool load(handle src, bool) {
#if PY_VERSION_MAJOR < 3
object temp;
#endif
handle load_src = src;
if (!src) {
return false;
} else if (!PyUnicode_Check(load_src.ptr())) {
#if PY_VERSION_MAJOR >= 3
return false;
// The below is a guaranteed failure in Python 3 when PyUnicode_Check returns false
#else
temp = reinterpret_steal<object>(PyUnicode_FromObject(load_src.ptr()));
if (!temp) { PyErr_Clear(); return false; }
load_src = temp;
#endif
}
object utfNbytes = reinterpret_steal<object>(PyUnicode_AsEncodedString(
load_src.ptr(), encoding, nullptr));
if (!utfNbytes) { PyErr_Clear(); return false; }
const CharT *buffer = reinterpret_cast<const CharT *>(PYBIND11_BYTES_AS_STRING(utfNbytes.ptr()));
size_t length = (size_t) PYBIND11_BYTES_SIZE(utfNbytes.ptr()) / sizeof(CharT);
if (UTF_N > 8) { buffer++; length--; } // Skip BOM for UTF-16/32
value = StringType(buffer, length);
return true;
}
static handle cast(const StringType &src, return_value_policy /* policy */, handle /* parent */) {
const char *buffer = reinterpret_cast<const char *>(src.c_str());
ssize_t nbytes = ssize_t(src.size() * sizeof(CharT));
handle s = PyUnicode_Decode(buffer, nbytes, encoding, nullptr);
if (!s) throw error_already_set();
return s;
}
PYBIND11_TYPE_CASTER(StringType, _(PYBIND11_STRING_NAME));
};
// Type caster for C-style strings. We basically use a std::string type caster, but also add the
// ability to use None as a nullptr char* (which the string caster doesn't allow).
template <typename CharT> struct type_caster<CharT, enable_if_t<is_std_char_type<CharT>::value>> {
using StringType = std::basic_string<CharT>;
using StringCaster = type_caster<StringType>;
StringCaster str_caster;
bool none = false;
public:
bool load(handle src, bool convert) {
if (!src) return false;
if (src.is_none()) {
// Defer accepting None to other overloads (if we aren't in convert mode):
if (!convert) return false;
none = true;
return true;
}
return str_caster.load(src, convert);
}
static handle cast(const CharT *src, return_value_policy policy, handle parent) {
if (src == nullptr) return pybind11::none().inc_ref();
return StringCaster::cast(StringType(src), policy, parent);
}
static handle cast(CharT src, return_value_policy policy, handle parent) {
if (std::is_same<char, CharT>::value) {
handle s = PyUnicode_DecodeLatin1((const char *) &src, 1, nullptr);
if (!s) throw error_already_set();
return s;
}
return StringCaster::cast(StringType(1, src), policy, parent);
}
operator CharT*() { return none ? nullptr : const_cast<CharT *>(static_cast<StringType &>(str_caster).c_str()); }
operator CharT() {
if (none)
throw value_error("Cannot convert None to a character");
auto &value = static_cast<StringType &>(str_caster);
size_t str_len = value.size();
if (str_len == 0)
throw value_error("Cannot convert empty string to a character");
// If we're in UTF-8 mode, we have two possible failures: one for a unicode character that
// is too high, and one for multiple unicode characters (caught later), so we need to figure
// out how long the first encoded character is in bytes to distinguish between these two
// errors. We also allow want to allow unicode characters U+0080 through U+00FF, as those
// can fit into a single char value.
if (StringCaster::UTF_N == 8 && str_len > 1 && str_len <= 4) {
unsigned char v0 = static_cast<unsigned char>(value[0]);
size_t char0_bytes = !(v0 & 0x80) ? 1 : // low bits only: 0-127
(v0 & 0xE0) == 0xC0 ? 2 : // 0b110xxxxx - start of 2-byte sequence
(v0 & 0xF0) == 0xE0 ? 3 : // 0b1110xxxx - start of 3-byte sequence
4; // 0b11110xxx - start of 4-byte sequence
if (char0_bytes == str_len) {
// If we have a 128-255 value, we can decode it into a single char:
if (char0_bytes == 2 && (v0 & 0xFC) == 0xC0) { // 0x110000xx 0x10xxxxxx
return static_cast<CharT>(((v0 & 3) << 6) + (static_cast<unsigned char>(value[1]) & 0x3F));
}
// Otherwise we have a single character, but it's > U+00FF
throw value_error("Character code point not in range(0x100)");
}
}
// UTF-16 is much easier: we can only have a surrogate pair for values above U+FFFF, thus a
// surrogate pair with total length 2 instantly indicates a range error (but not a "your
// string was too long" error).
else if (StringCaster::UTF_N == 16 && str_len == 2) {
char16_t v0 = static_cast<char16_t>(value[0]);
if (v0 >= 0xD800 && v0 < 0xE000)
throw value_error("Character code point not in range(0x10000)");
}
if (str_len != 1)
throw value_error("Expected a character, but multi-character string found");
return value[0];
}
static PYBIND11_DESCR name() { return type_descr(_(PYBIND11_STRING_NAME)); }
template <typename _T> using cast_op_type = typename std::remove_reference<pybind11::detail::cast_op_type<_T>>::type;
};
template <typename T1, typename T2> class type_caster<std::pair<T1, T2>> {
typedef std::pair<T1, T2> type;
public:
bool load(handle src, bool convert) {
if (!isinstance<sequence>(src))
return false;
const auto seq = reinterpret_borrow<sequence>(src);
if (seq.size() != 2)
return false;
return first.load(seq[0], convert) && second.load(seq[1], convert);
}
static handle cast(const type &src, return_value_policy policy, handle parent) {
auto o1 = reinterpret_steal<object>(make_caster<T1>::cast(src.first, policy, parent));
auto o2 = reinterpret_steal<object>(make_caster<T2>::cast(src.second, policy, parent));
if (!o1 || !o2)
return handle();
tuple result(2);
PyTuple_SET_ITEM(result.ptr(), 0, o1.release().ptr());
PyTuple_SET_ITEM(result.ptr(), 1, o2.release().ptr());
return result.release();
}
static PYBIND11_DESCR name() {
return type_descr(
_("Tuple[") + make_caster<T1>::name() + _(", ") + make_caster<T2>::name() + _("]")
);
}
template <typename T> using cast_op_type = type;
operator type() {
return type(cast_op<T1>(first), cast_op<T2>(second));
}
protected:
make_caster<T1> first;
make_caster<T2> second;
};
template <typename... Tuple> class type_caster<std::tuple<Tuple...>> {
using type = std::tuple<Tuple...>;
using indices = make_index_sequence<sizeof...(Tuple)>;
static constexpr auto size = sizeof...(Tuple);
public:
bool load(handle src, bool convert) {
if (!isinstance<sequence>(src))
return false;
const auto seq = reinterpret_borrow<sequence>(src);
if (seq.size() != size)
return false;
return load_impl(seq, convert, indices{});
}
static handle cast(const type &src, return_value_policy policy, handle parent) {
return cast_impl(src, policy, parent, indices{});
}
static PYBIND11_DESCR name() {
return type_descr(_("Tuple[") + detail::concat(make_caster<Tuple>::name()...) + _("]"));
}
template <typename T> using cast_op_type = type;
operator type() { return implicit_cast(indices{}); }
protected:
template <size_t... Is>
type implicit_cast(index_sequence<Is...>) { return type(cast_op<Tuple>(std::get<Is>(value))...); }
static constexpr bool load_impl(const sequence &, bool, index_sequence<>) { return true; }
template <size_t... Is>
bool load_impl(const sequence &seq, bool convert, index_sequence<Is...>) {
for (bool r : {std::get<Is>(value).load(seq[Is], convert)...})
if (!r)
return false;
return true;
}
static handle cast_impl(const type &, return_value_policy, handle,
index_sequence<>) { return tuple().release(); }
/* Implementation: Convert a C++ tuple into a Python tuple */
template <size_t... Is>
static handle cast_impl(const type &src, return_value_policy policy, handle parent, index_sequence<Is...>) {
std::array<object, size> entries {{
reinterpret_steal<object>(make_caster<Tuple>::cast(std::get<Is>(src), policy, parent))...
}};
for (const auto &entry: entries)
if (!entry)
return handle();
tuple result(size);
int counter = 0;
for (auto & entry: entries)
PyTuple_SET_ITEM(result.ptr(), counter++, entry.release().ptr());
return result.release();
}
std::tuple<make_caster<Tuple>...> value;
};
/// Helper class which abstracts away certain actions. Users can provide specializations for
/// custom holders, but it's only necessary if the type has a non-standard interface.
template <typename T>
struct holder_helper {
static auto get(const T &p) -> decltype(p.get()) { return p.get(); }
};
/// Type caster for holder types like std::shared_ptr, etc.
template <typename type, typename holder_type>
struct copyable_holder_caster : public type_caster_base<type> {
public:
using base = type_caster_base<type>;
using base::base;
using base::cast;
using base::typeinfo;
using base::value;
using base::temp;
PYBIND11_NOINLINE bool load(handle src, bool convert) {
return load(src, convert, Py_TYPE(src.ptr()));
}
bool load(handle src, bool convert, PyTypeObject *tobj) {
if (!src || !typeinfo)
return false;
if (src.is_none()) {
value = nullptr;
return true;
}
if (typeinfo->simple_type) { /* Case 1: no multiple inheritance etc. involved */
/* Check if we can safely perform a reinterpret-style cast */
if (PyType_IsSubtype(tobj, typeinfo->type))
return load_value_and_holder(src);
} else { /* Case 2: multiple inheritance */
/* Check if we can safely perform a reinterpret-style cast */
if (tobj == typeinfo->type)
return load_value_and_holder(src);
/* If this is a python class, also check the parents recursively */
auto const &type_dict = get_internals().registered_types_py;
bool new_style_class = PyType_Check((PyObject *) tobj);
if (type_dict.find(tobj) == type_dict.end() && new_style_class && tobj->tp_bases) {
auto parents = reinterpret_borrow<tuple>(tobj->tp_bases);
for (handle parent : parents) {
bool result = load(src, convert, (PyTypeObject *) parent.ptr());
if (result)
return true;
}
}
if (try_implicit_casts(src, convert))
return true;
}
if (convert) {
for (auto &converter : typeinfo->implicit_conversions) {
temp = reinterpret_steal<object>(converter(src.ptr(), typeinfo->type));
if (load(temp, false))
return true;
}
}
return false;
}
bool load_value_and_holder(handle src) {
auto inst = (instance<type, holder_type> *) src.ptr();
value = (void *) inst->value;
if (inst->holder_constructed) {
holder = inst->holder;
return true;
} else {
throw cast_error("Unable to cast from non-held to held instance (T& to Holder<T>) "
#if defined(NDEBUG)
"(compile in debug mode for type information)");
#else
"of type '" + type_id<holder_type>() + "''");
#endif
}
}
template <typename T = holder_type, detail::enable_if_t<!std::is_constructible<T, const T &, type*>::value, int> = 0>
bool try_implicit_casts(handle, bool) { return false; }
template <typename T = holder_type, detail::enable_if_t<std::is_constructible<T, const T &, type*>::value, int> = 0>
bool try_implicit_casts(handle src, bool convert) {
for (auto &cast : typeinfo->implicit_casts) {
copyable_holder_caster sub_caster(*cast.first);
if (sub_caster.load(src, convert)) {
value = cast.second(sub_caster.value);
holder = holder_type(sub_caster.holder, (type *) value);
return true;
}
}
return false;
}
explicit operator type*() { return this->value; }
explicit operator type&() { return *(this->value); }
explicit operator holder_type*() { return &holder; }
// Workaround for Intel compiler bug
// see pybind11 issue 94
#if defined(__ICC) || defined(__INTEL_COMPILER)
operator holder_type&() { return holder; }
#else
explicit operator holder_type&() { return holder; }
#endif
static handle cast(const holder_type &src, return_value_policy, handle) {
const auto *ptr = holder_helper<holder_type>::get(src);
return type_caster_base<type>::cast_holder(ptr, &src);
}
protected:
holder_type holder;
};
/// Specialize for the common std::shared_ptr, so users don't need to
template <typename T>
class type_caster<std::shared_ptr<T>> : public copyable_holder_caster<T, std::shared_ptr<T>> { };
template <typename type, typename holder_type>
struct move_only_holder_caster {
static handle cast(holder_type &&src, return_value_policy, handle) {
auto *ptr = holder_helper<holder_type>::get(src);
return type_caster_base<type>::cast_holder(ptr, &src);
}
static PYBIND11_DESCR name() { return type_caster_base<type>::name(); }
};
template <typename type, typename deleter>
class type_caster<std::unique_ptr<type, deleter>>
: public move_only_holder_caster<type, std::unique_ptr<type, deleter>> { };
template <typename type, typename holder_type>
using type_caster_holder = conditional_t<std::is_copy_constructible<holder_type>::value,
copyable_holder_caster<type, holder_type>,
move_only_holder_caster<type, holder_type>>;
template <typename T, bool Value = false> struct always_construct_holder { static constexpr bool value = Value; };
/// Create a specialization for custom holder types (silently ignores std::shared_ptr)
#define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) \
namespace pybind11 { namespace detail { \
template <typename type> \
struct always_construct_holder<holder_type> : always_construct_holder<void, ##__VA_ARGS__> { }; \
template <typename type> \
class type_caster<holder_type, enable_if_t<!is_shared_ptr<holder_type>::value>> \
: public type_caster_holder<type, holder_type> { }; \
}}
// PYBIND11_DECLARE_HOLDER_TYPE holder types:
template <typename base, typename holder> struct is_holder_type :
std::is_base_of<detail::type_caster_holder<base, holder>, detail::type_caster<holder>> {};
// Specialization for always-supported unique_ptr holders:
template <typename base, typename deleter> struct is_holder_type<base, std::unique_ptr<base, deleter>> :
std::true_type {};
template <typename T> struct handle_type_name { static PYBIND11_DESCR name() { return _<T>(); } };
template <> struct handle_type_name<bytes> { static PYBIND11_DESCR name() { return _(PYBIND11_BYTES_NAME); } };
template <> struct handle_type_name<args> { static PYBIND11_DESCR name() { return _("*args"); } };
template <> struct handle_type_name<kwargs> { static PYBIND11_DESCR name() { return _("**kwargs"); } };
template <typename type>
struct pyobject_caster {
template <typename T = type, enable_if_t<std::is_same<T, handle>::value, int> = 0>
bool load(handle src, bool /* convert */) { value = src; return static_cast<bool>(value); }
template <typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>
bool load(handle src, bool /* convert */) {
if (!isinstance<type>(src))
return false;
value = reinterpret_borrow<type>(src);
return true;
}
static handle cast(const handle &src, return_value_policy /* policy */, handle /* parent */) {
return src.inc_ref();
}
PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name());
};
template <typename T>
class type_caster<T, enable_if_t<is_pyobject<T>::value>> : public pyobject_caster<T> { };
// Our conditions for enabling moving are quite restrictive:
// At compile time:
// - T needs to be a non-const, non-pointer, non-reference type
// - type_caster<T>::operator T&() must exist
// - the type must be move constructible (obviously)
// At run-time:
// - if the type is non-copy-constructible, the object must be the sole owner of the type (i.e. it
// must have ref_count() == 1)h
// If any of the above are not satisfied, we fall back to copying.
template <typename T> using move_is_plain_type = satisfies_none_of<T,
std::is_void, std::is_pointer, std::is_reference, std::is_const
>;
template <typename T, typename SFINAE = void> struct move_always : std::false_type {};
template <typename T> struct move_always<T, enable_if_t<all_of<
move_is_plain_type<T>,
negation<std::is_copy_constructible<T>>,
std::is_move_constructible<T>,
std::is_same<decltype(std::declval<make_caster<T>>().operator T&()), T&>
>::value>> : std::true_type {};
template <typename T, typename SFINAE = void> struct move_if_unreferenced : std::false_type {};
template <typename T> struct move_if_unreferenced<T, enable_if_t<all_of<
move_is_plain_type<T>,
negation<move_always<T>>,
std::is_move_constructible<T>,
std::is_same<decltype(std::declval<make_caster<T>>().operator T&()), T&>
>::value>> : std::true_type {};
template <typename T> using move_never = none_of<move_always<T>, move_if_unreferenced<T>>;
// Detect whether returning a `type` from a cast on type's type_caster is going to result in a
// reference or pointer to a local variable of the type_caster. Basically, only
// non-reference/pointer `type`s and reference/pointers from a type_caster_generic are safe;
// everything else returns a reference/pointer to a local variable.
template <typename type> using cast_is_temporary_value_reference = bool_constant<
(std::is_reference<type>::value || std::is_pointer<type>::value) &&
!std::is_base_of<type_caster_generic, make_caster<type>>::value
>;
// Basic python -> C++ casting; throws if casting fails
template <typename T, typename SFINAE> type_caster<T, SFINAE> &load_type(type_caster<T, SFINAE> &conv, const handle &handle) {
if (!conv.load(handle, true)) {
#if defined(NDEBUG)
throw cast_error("Unable to cast Python instance to C++ type (compile in debug mode for details)");
#else
throw cast_error("Unable to cast Python instance of type " +
(std::string) str(handle.get_type()) + " to C++ type '" + type_id<T>() + "''");
#endif
}
return conv;
}
// Wrapper around the above that also constructs and returns a type_caster
template <typename T> make_caster<T> load_type(const handle &handle) {
make_caster<T> conv;
load_type(conv, handle);
return conv;
}
NAMESPACE_END(detail)
// pytype -> C++ type
template <typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
T cast(const handle &handle) {
using namespace detail;
static_assert(!cast_is_temporary_value_reference<T>::value,
"Unable to cast type to reference: value is local to type caster");
return cast_op<T>(load_type<T>(handle));
}
// pytype -> pytype (calls converting constructor)
template <typename T, detail::enable_if_t<detail::is_pyobject<T>::value, int> = 0>
T cast(const handle &handle) { return T(reinterpret_borrow<object>(handle)); }
// C++ type -> py::object
template <typename T, detail::enable_if_t<!detail::is_pyobject<T>::value, int> = 0>
object cast(const T &value, return_value_policy policy = return_value_policy::automatic_reference,
handle parent = handle()) {
if (policy == return_value_policy::automatic)
policy = std::is_pointer<T>::value ? return_value_policy::take_ownership : return_value_policy::copy;
else if (policy == return_value_policy::automatic_reference)
policy = std::is_pointer<T>::value ? return_value_policy::reference : return_value_policy::copy;
return reinterpret_steal<object>(detail::make_caster<T>::cast(value, policy, parent));
}
template <typename T> T handle::cast() const { return pybind11::cast<T>(*this); }
template <> inline void handle::cast() const { return; }
template <typename T>
detail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj) {
if (obj.ref_count() > 1)
#if defined(NDEBUG)
throw cast_error("Unable to cast Python instance to C++ rvalue: instance has multiple references"
" (compile in debug mode for details)");
#else
throw cast_error("Unable to move from Python " + (std::string) str(obj.get_type()) +
" instance to C++ " + type_id<T>() + " instance: instance has multiple references");
#endif
// Move into a temporary and return that, because the reference may be a local value of `conv`
T ret = std::move(detail::load_type<T>(obj).operator T&());
return ret;
}
// Calling cast() on an rvalue calls pybind::cast with the object rvalue, which does:
// - If we have to move (because T has no copy constructor), do it. This will fail if the moved
// object has multiple references, but trying to copy will fail to compile.
// - If both movable and copyable, check ref count: if 1, move; otherwise copy
// - Otherwise (not movable), copy.
template <typename T> detail::enable_if_t<detail::move_always<T>::value, T> cast(object &&object) {
return move<T>(std::move(object));
}
template <typename T> detail::enable_if_t<detail::move_if_unreferenced<T>::value, T> cast(object &&object) {
if (object.ref_count() > 1)
return cast<T>(object);
else
return move<T>(std::move(object));
}
template <typename T> detail::enable_if_t<detail::move_never<T>::value, T> cast(object &&object) {
return cast<T>(object);
}
template <typename T> T object::cast() const & { return pybind11::cast<T>(*this); }
template <typename T> T object::cast() && { return pybind11::cast<T>(std::move(*this)); }
template <> inline void object::cast() const & { return; }
template <> inline void object::cast() && { return; }
NAMESPACE_BEGIN(detail)
// Declared in pytypes.h:
template <typename T, enable_if_t<!is_pyobject<T>::value, int>>
object object_or_cast(T &&o) { return pybind11::cast(std::forward<T>(o)); }
struct overload_unused {}; // Placeholder type for the unneeded (and dead code) static variable in the OVERLOAD_INT macro
template <typename ret_type> using overload_caster_t = conditional_t<
cast_is_temporary_value_reference<ret_type>::value, make_caster<ret_type>, overload_unused>;
// Trampoline use: for reference/pointer types to value-converted values, we do a value cast, then
// store the result in the given variable. For other types, this is a no-op.
template <typename T> enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&o, make_caster<T> &caster) {
return cast_op<T>(load_type(caster, o));
}
template <typename T> enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&, overload_unused &) {
pybind11_fail("Internal error: cast_ref fallback invoked"); }
// Trampoline use: Having a pybind11::cast with an invalid reference type is going to static_assert, even
// though if it's in dead code, so we provide a "trampoline" to pybind11::cast that only does anything in
// cases where pybind11::cast is valid.
template <typename T> enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&o) {
return pybind11::cast<T>(std::move(o)); }
template <typename T> enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&) {
pybind11_fail("Internal error: cast_safe fallback invoked"); }
template <> inline void cast_safe<void>(object &&) {}
NAMESPACE_END(detail)
template <return_value_policy policy = return_value_policy::automatic_reference,
typename... Args> tuple make_tuple(Args&&... args_) {
const size_t size = sizeof...(Args);
std::array<object, size> args {
{ reinterpret_steal<object>(detail::make_caster<Args>::cast(
std::forward<Args>(args_), policy, nullptr))... }
};
for (auto &arg_value : args) {
if (!arg_value) {
#if defined(NDEBUG)
throw cast_error("make_tuple(): unable to convert arguments to Python object (compile in debug mode for details)");
#else
throw cast_error("make_tuple(): unable to convert arguments of types '" +
(std::string) type_id<std::tuple<Args...>>() + "' to Python object");
#endif
}
}
tuple result(size);
int counter = 0;
for (auto &arg_value : args)
PyTuple_SET_ITEM(result.ptr(), counter++, arg_value.release().ptr());
return result;
}
/// \ingroup annotations
/// Annotation for arguments
struct arg {
/// Constructs an argument with the name of the argument; if null or omitted, this is a positional argument.
constexpr explicit arg(const char *name = nullptr) : name(name), flag_noconvert(false) { }
/// Assign a value to this argument
template <typename T> arg_v operator=(T &&value) const;
/// Indicate that the type should not be converted in the type caster
arg &noconvert(bool flag = true) { flag_noconvert = flag; return *this; }
const char *name; ///< If non-null, this is a named kwargs argument
bool flag_noconvert : 1; ///< If set, do not allow conversion (requires a supporting type caster!)
};
/// \ingroup annotations
/// Annotation for arguments with values
struct arg_v : arg {
private:
template <typename T>
arg_v(arg &&base, T &&x, const char *descr = nullptr)
: arg(base),
value(reinterpret_steal<object>(
detail::make_caster<T>::cast(x, return_value_policy::automatic, {})
)),
descr(descr)
#if !defined(NDEBUG)
, type(type_id<T>())
#endif
{ }
public:
/// Direct construction with name, default, and description
template <typename T>
arg_v(const char *name, T &&x, const char *descr = nullptr)
: arg_v(arg(name), std::forward<T>(x), descr) { }
/// Called internally when invoking `py::arg("a") = value`
template <typename T>
arg_v(const arg &base, T &&x, const char *descr = nullptr)
: arg_v(arg(base), std::forward<T>(x), descr) { }
/// Same as `arg::noconvert()`, but returns *this as arg_v&, not arg&
arg_v &noconvert(bool flag = true) { arg::noconvert(flag); return *this; }
/// The default value
object value;
/// The (optional) description of the default value
const char *descr;
#if !defined(NDEBUG)
/// The C++ type name of the default value (only available when compiled in debug mode)
std::string type;
#endif
};
template <typename T>
arg_v arg::operator=(T &&value) const { return {std::move(*this), std::forward<T>(value)}; }
/// Alias for backward compatibility -- to be removed in version 2.0
template <typename /*unused*/> using arg_t = arg_v;
inline namespace literals {
/** \rst
String literal version of `arg`
\endrst */
constexpr arg operator"" _a(const char *name, size_t) { return arg(name); }
}
NAMESPACE_BEGIN(detail)
// forward declaration
struct function_record;
/// Internal data associated with a single function call
struct function_call {
function_call(function_record &f, handle p); // Implementation in attr.h
/// The function data:
const function_record &func;
/// Arguments passed to the function:
std::vector<handle> args;
/// The `convert` value the arguments should be loaded with
std::vector<bool> args_convert;
/// The parent, if any
handle parent;
};
/// Helper class which loads arguments for C++ functions called from Python
template <typename... Args>
class argument_loader {
using indices = make_index_sequence<sizeof...(Args)>;
template <typename Arg> using argument_is_args = std::is_same<intrinsic_t<Arg>, args>;
template <typename Arg> using argument_is_kwargs = std::is_same<intrinsic_t<Arg>, kwargs>;
// Get args/kwargs argument positions relative to the end of the argument list:
static constexpr auto args_pos = constexpr_first<argument_is_args, Args...>() - (int) sizeof...(Args),
kwargs_pos = constexpr_first<argument_is_kwargs, Args...>() - (int) sizeof...(Args);
static constexpr bool args_kwargs_are_last = kwargs_pos >= - 1 && args_pos >= kwargs_pos - 1;
static_assert(args_kwargs_are_last, "py::args/py::kwargs are only permitted as the last argument(s) of a function");
public:
static constexpr bool has_kwargs = kwargs_pos < 0;
static constexpr bool has_args = args_pos < 0;
static PYBIND11_DESCR arg_names() { return detail::concat(make_caster<Args>::name()...); }
bool load_args(function_call &call) {
return load_impl_sequence(call, indices{});
}
template <typename Return, typename Func>
enable_if_t<!std::is_void<Return>::value, Return> call(Func &&f) {
return call_impl<Return>(std::forward<Func>(f), indices{});
}
template <typename Return, typename Func>
enable_if_t<std::is_void<Return>::value, void_type> call(Func &&f) {
call_impl<Return>(std::forward<Func>(f), indices{});
return void_type();
}
private:
static bool load_impl_sequence(function_call &, index_sequence<>) { return true; }
template <size_t... Is>
bool load_impl_sequence(function_call &call, index_sequence<Is...>) {
for (bool r : {std::get<Is>(value).load(call.args[Is], call.args_convert[Is])...})
if (!r)
return false;
return true;
}
template <typename Return, typename Func, size_t... Is>
Return call_impl(Func &&f, index_sequence<Is...>) {
return std::forward<Func>(f)(cast_op<Args>(std::get<Is>(value))...);
}
std::tuple<make_caster<Args>...> value;
};
/// Helper class which collects only positional arguments for a Python function call.
/// A fancier version below can collect any argument, but this one is optimal for simple calls.
template <return_value_policy policy>
class simple_collector {
public:
template <typename... Ts>
explicit simple_collector(Ts &&...values)
: m_args(pybind11::make_tuple<policy>(std::forward<Ts>(values)...)) { }
const tuple &args() const & { return m_args; }
dict kwargs() const { return {}; }
tuple args() && { return std::move(m_args); }
/// Call a Python function and pass the collected arguments
object call(PyObject *ptr) const {
PyObject *result = PyObject_CallObject(ptr, m_args.ptr());
if (!result)
throw error_already_set();
return reinterpret_steal<object>(result);
}
private:
tuple m_args;
};
/// Helper class which collects positional, keyword, * and ** arguments for a Python function call
template <return_value_policy policy>
class unpacking_collector {
public:
template <typename... Ts>
explicit unpacking_collector(Ts &&...values) {
// Tuples aren't (easily) resizable so a list is needed for collection,
// but the actual function call strictly requires a tuple.
auto args_list = list();
int _[] = { 0, (process(args_list, std::forward<Ts>(values)), 0)... };
ignore_unused(_);
m_args = std::move(args_list);
}
const tuple &args() const & { return m_args; }
const dict &kwargs() const & { return m_kwargs; }
tuple args() && { return std::move(m_args); }
dict kwargs() && { return std::move(m_kwargs); }
/// Call a Python function and pass the collected arguments
object call(PyObject *ptr) const {
PyObject *result = PyObject_Call(ptr, m_args.ptr(), m_kwargs.ptr());
if (!result)
throw error_already_set();
return reinterpret_steal<object>(result);
}
private:
template <typename T>
void process(list &args_list, T &&x) {
auto o = reinterpret_steal<object>(detail::make_caster<T>::cast(std::forward<T>(x), policy, {}));
if (!o) {
#if defined(NDEBUG)
argument_cast_error();
#else
argument_cast_error(std::to_string(args_list.size()), type_id<T>());
#endif
}
args_list.append(o);
}
void process(list &args_list, detail::args_proxy ap) {
for (const auto &a : ap)
args_list.append(a);
}
void process(list &/*args_list*/, arg_v a) {
if (!a.name)
#if defined(NDEBUG)
nameless_argument_error();
#else
nameless_argument_error(a.type);
#endif
if (m_kwargs.contains(a.name)) {
#if defined(NDEBUG)
multiple_values_error();
#else
multiple_values_error(a.name);
#endif
}
if (!a.value) {
#if defined(NDEBUG)
argument_cast_error();
#else
argument_cast_error(a.name, a.type);
#endif
}
m_kwargs[a.name] = a.value;
}
void process(list &/*args_list*/, detail::kwargs_proxy kp) {
if (!kp)
return;
for (const auto &k : reinterpret_borrow<dict>(kp)) {
if (m_kwargs.contains(k.first)) {
#if defined(NDEBUG)
multiple_values_error();
#else
multiple_values_error(str(k.first));
#endif
}
m_kwargs[k.first] = k.second;
}
}
[[noreturn]] static void nameless_argument_error() {
throw type_error("Got kwargs without a name; only named arguments "
"may be passed via py::arg() to a python function call. "
"(compile in debug mode for details)");
}
[[noreturn]] static void nameless_argument_error(std::string type) {
throw type_error("Got kwargs without a name of type '" + type + "'; only named "
"arguments may be passed via py::arg() to a python function call. ");
}
[[noreturn]] static void multiple_values_error() {
throw type_error("Got multiple values for keyword argument "
"(compile in debug mode for details)");
}
[[noreturn]] static void multiple_values_error(std::string name) {
throw type_error("Got multiple values for keyword argument '" + name + "'");
}
[[noreturn]] static void argument_cast_error() {
throw cast_error("Unable to convert call argument to Python object "
"(compile in debug mode for details)");
}
[[noreturn]] static void argument_cast_error(std::string name, std::string type) {
throw cast_error("Unable to convert call argument '" + name
+ "' of type '" + type + "' to Python object");
}
private:
tuple m_args;
dict m_kwargs;
};
/// Collect only positional arguments for a Python function call
template <return_value_policy policy, typename... Args,
typename = enable_if_t<all_of<is_positional<Args>...>::value>>
simple_collector<policy> collect_arguments(Args &&...args) {
return simple_collector<policy>(std::forward<Args>(args)...);
}
/// Collect all arguments, including keywords and unpacking (only instantiated when needed)
template <return_value_policy policy, typename... Args,
typename = enable_if_t<!all_of<is_positional<Args>...>::value>>
unpacking_collector<policy> collect_arguments(Args &&...args) {
// Following argument order rules for generalized unpacking according to PEP 448
static_assert(
constexpr_last<is_positional, Args...>() < constexpr_first<is_keyword_or_ds, Args...>()
&& constexpr_last<is_s_unpacking, Args...>() < constexpr_first<is_ds_unpacking, Args...>(),
"Invalid function call: positional args must precede keywords and ** unpacking; "
"* unpacking must precede ** unpacking"
);
return unpacking_collector<policy>(std::forward<Args>(args)...);
}
template <typename Derived>
template <return_value_policy policy, typename... Args>
object object_api<Derived>::operator()(Args &&...args) const {
return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
}
template <typename Derived>
template <return_value_policy policy, typename... Args>
object object_api<Derived>::call(Args &&...args) const {
return operator()<policy>(std::forward<Args>(args)...);
}
NAMESPACE_END(detail)
#define PYBIND11_MAKE_OPAQUE(Type) \
namespace pybind11 { namespace detail { \
template<> class type_caster<Type> : public type_caster_base<Type> { }; \
}}
NAMESPACE_END(pybind11)
| 40.698787 | 190 | 0.632552 | [
"object",
"vector"
] |
cfcd3acc39161dd55a9a17ce53d8a71020a1338d | 1,067 | h | C | Programs/Program_7/BBoard_Part_2/User.h | benjaminmao123/UCR-CS012 | c2292162a79bb711156f93e9c08af2a61079838d | [
"Apache-2.0"
] | null | null | null | Programs/Program_7/BBoard_Part_2/User.h | benjaminmao123/UCR-CS012 | c2292162a79bb711156f93e9c08af2a61079838d | [
"Apache-2.0"
] | null | null | null | Programs/Program_7/BBoard_Part_2/User.h | benjaminmao123/UCR-CS012 | c2292162a79bb711156f93e9c08af2a61079838d | [
"Apache-2.0"
] | null | null | null | #ifndef USER_H
#define USER_H
#include <iostream>
#include <string>
using namespace std;
class User {
private:
string username;
string password;
public:
//creates a user with empty name and password.
User();
// creates a user with given username and password.
User(const string& uname, const string& pass);
//returns the username
string getUsername() const;
// returns true if the stored username/password matches with the
// parameters. Otherwise returns false.
// Note that, even though a User with empty name and password is
// actually a valid User object (it is the default User), this
// function must still return false if given a empty uname string.
bool check(const string &uname, const string &pass) const;
// sets a new password.
// This function should only set the new password if the current (old)
// password is passed in. Also, a default User cannot have its
// password changed.
// returns true if password changed, false if not.
bool setPassword(const string &oldpass, const string &newpass);
};
#endif | 28.078947 | 73 | 0.726336 | [
"object"
] |
cfd11eb6d7980910ec5fc48b9b2505c2478a526f | 4,479 | h | C | packages/pips-gfc/gcc-4.4.5/gcc/config/rs6000/vxworks.h | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/pips-gfc/gcc-4.4.5/gcc/config/rs6000/vxworks.h | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/pips-gfc/gcc-4.4.5/gcc/config/rs6000/vxworks.h | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | /* Definitions of target machine for GNU compiler. Vxworks PowerPC version.
Copyright (C) 1996, 2000, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Note to future editors: VxWorks is mostly an EABI target. We do
not use rs6000/eabi.h because we would have to override most of
it anyway. However, if you change that file, consider making
analogous changes here too. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC VxWorks)");
/* CPP predefined macros. */
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__ppc"); \
builtin_define ("__EABI__"); \
builtin_define ("__ELF__"); \
builtin_define ("__vxworks"); \
builtin_define ("__VXWORKS__"); \
if (!TARGET_SOFT_FLOAT) \
builtin_define ("__hardfp"); \
\
/* C89 namespace violation! */ \
builtin_define ("CPU_FAMILY=PPC"); \
} \
while (0)
/* Only big endian PPC is supported by VxWorks. */
#undef BYTES_BIG_ENDIAN
#define BYTES_BIG_ENDIAN 1
/* We have to kill off the entire specs set created by rs6000/sysv4.h
and substitute our own set. The top level vxworks.h has done some
of this for us. */
#undef SUBTARGET_EXTRA_SPECS
#undef CPP_SPEC
#undef CC1_SPEC
#undef ASM_SPEC
#define SUBTARGET_EXTRA_SPECS /* none needed */
/* FIXME: The only reason we allow no -mcpu switch at all is because
config-ml.in insists on a "." multilib. */
#define CPP_SPEC \
"%{!DCPU=*: \
%{mcpu=403 : -DCPU=PPC403 ; \
mcpu=405 : -DCPU=PPC405 ; \
mcpu=440 : -DCPU=PPC440 ; \
mcpu=603 : -DCPU=PPC603 ; \
mcpu=604 : -DCPU=PPC604 ; \
mcpu=860 : -DCPU=PPC860 ; \
mcpu=8540: -DCPU=PPC85XX ; \
: -DCPU=PPC604 }}" \
VXWORKS_ADDITIONAL_CPP_SPEC
#define CC1_SPEC \
"%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
%{mlittle|mlittle-endian:-mstrict-align} \
%{profile: -p} \
%{fvec:-maltivec} %{fvec-eabi:-maltivec -mabi=altivec}"
#define ASM_SPEC \
"%(asm_cpu) \
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
%{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
#undef LIB_SPEC
#define LIB_SPEC VXWORKS_LIB_SPEC
#undef LINK_SPEC
#define LINK_SPEC VXWORKS_LINK_SPEC
#undef STARTFILE_SPEC
#define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC
#undef ENDFILE_SPEC
#define ENDFILE_SPEC VXWORKS_ENDFILE_SPEC
/* There is no default multilib. */
#undef MULTILIB_DEFAULTS
#undef TARGET_DEFAULT
#define TARGET_DEFAULT \
(MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_EABI | MASK_STRICT_ALIGN)
#undef PROCESSOR_DEFAULT
#define PROCESSOR_DEFAULT PROCESSOR_PPC604
/* Nor sdata, for kernel mode. We use this in
SUBSUBTARGET_INITIALIZE_OPTIONS, after rs6000_rtp has been initialized. */
#undef SDATA_DEFAULT_SIZE
#define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0)
#undef STACK_BOUNDARY
#define STACK_BOUNDARY (16*BITS_PER_UNIT)
/* Override sysv4.h, reset to the default. */
#undef PREFERRED_STACK_BOUNDARY
/* Make -mcpu=8540 imply SPE. ISEL is automatically enabled, the
others must be done by hand. Handle -mrtp. Disable -fPIC
for -mrtp - the VxWorks PIC model is not compatible with it. */
#undef SUBSUBTARGET_OVERRIDE_OPTIONS
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
do { \
if (TARGET_E500) \
{ \
rs6000_spe = 1; \
rs6000_spe_abi = 1; \
rs6000_float_gprs = 1; \
} \
\
if (!g_switch_set) \
g_switch_value = SDATA_DEFAULT_SIZE; \
VXWORKS_OVERRIDE_OPTIONS; \
} while (0)
/* No _mcount profiling on VxWorks. */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE,LABELNO) VXWORKS_FUNCTION_PROFILER(FILE,LABELNO)
| 31.992857 | 79 | 0.695691 | [
"model"
] |
cfd19da3c09e0b74a7519cfec210190e43ce3e50 | 3,382 | h | C | Example/Pods/Headers/Public/Tempo_ios_sdk/CartoMobileSDK/NTPoint.h | jesusgeographica/pruebaSDK | 329f6b27674137fda682cd1e974c2bb6b5901d99 | [
"MIT"
] | null | null | null | Example/Pods/Headers/Public/Tempo_ios_sdk/CartoMobileSDK/NTPoint.h | jesusgeographica/pruebaSDK | 329f6b27674137fda682cd1e974c2bb6b5901d99 | [
"MIT"
] | null | null | null | Example/Pods/Headers/Public/Tempo_ios_sdk/CartoMobileSDK/NTPoint.h | jesusgeographica/pruebaSDK | 329f6b27674137fda682cd1e974c2bb6b5901d99 | [
"MIT"
] | null | null | null | /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.11
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#import <Foundation/Foundation.h>
#ifdef __cplusplus
extern "C" {
#endif
#import "NTMapPos.h"
#import "NTPointGeometry.h"
#import "NTPointStyle.h"
#import "NTVectorElement.h"
/**
* A geometric point that can be displayed on the map.
*/
__attribute__ ((visibility("default"))) @interface NTPoint : NTVectorElement
/** @internal:nodoc: */
-(void*)getCptr;
/** @internal:nodoc: */
-(id)initWithCptr: (void*)cptr swigOwnCObject: (BOOL)ownCObject;
/**
* Creates a polymorphic instance of the given native object. This is used internally by the SDK.
* @param cPtr The native pointer of the instance.
* @param cMemoryOwn The ownership flag.
* @return The new instance.
*/
/** @internal:nodoc: */
+(NTPoint*)swigCreatePolymorphicInstance:(void*)cPtr swigOwnCObject:(BOOL)cMemoryOwn;
/**
* Constructs a Point object from a geometry object and a style.<br>
* @param geometry The geometry object that defines the location of this point.<br>
* @param style The style that defines what this point looks like.
*/
-(id)initWithGeometry: (NTPointGeometry*)geometry style: (NTPointStyle*)style;
/**
* Constructs a Point object from a map position and a style.<br>
* @param pos The map position that defines the location of this point.<br>
* @param style The style that defines what this point looks like.
*/
-(id)initWithPos: (NTMapPos*)pos style: (NTPointStyle*)style;
-(NTPointGeometry*)getGeometry;
/**
* Sets the location for this point.<br>
* @param geometry The new geometry object that defines the location of this point.
*/
-(void)setGeometry: (NTPointGeometry*)geometry;
/**
* Returns the location of this point.<br>
* @return The map position that defines the location of this point.
*/
-(NTMapPos*)getPos;
/**
* Sets the location of this point.<br>
* @param pos The new map position that defines the location of this point.
*/
-(void)setPos: (NTMapPos*)pos;
/**
* Returns the style of this point.<br>
* @return The style that defines what this point looks like.
*/
-(NTPointStyle*)getStyle;
/**
* Sets a style for this point.<br>
* @param style The new style that defines what this point looks like.
*/
-(void)setStyle: (NTPointStyle*)style;
/**
* Returns the raw pointer to the object. This is used internally by the SDK.<br>
* @return The internal pointer of the object.
*/
/** @internal:nodoc: */
-(long long)swigGetRawPtr;
/**
* Returns the actual class name of this object. This is used internally by the SDK.<br>
* @return The class name of this object.
*/
/** @internal:nodoc: */
-(NSString*)swigGetClassName;
/**
* Returns the pointer to the connected director object. This is used internally by the SDK.<br>
* @return The pointer to the connected director object or null if director is not connected.
*/
/** @internal:nodoc: */
-(void *)swigGetDirectorObject;
-(void)dealloc;
@end
#ifdef __cplusplus
}
#endif
| 31.314815 | 97 | 0.688054 | [
"geometry",
"object"
] |
cfd2233183a9313b9f64fece18ace3df53f172bf | 3,295 | h | C | pytorch/torch/csrc/autograd/python_function.h | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | pytorch/torch/csrc/autograd/python_function.h | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | 1 | 2019-07-22T09:48:46.000Z | 2019-07-22T09:48:46.000Z | pytorch/torch/csrc/autograd/python_function.h | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | #pragma once
#include <torch/csrc/python_headers.h>
#include <torch/csrc/Exceptions.h>
#include <torch/csrc/autograd/function.h>
#include <torch/csrc/autograd/variable.h>
#include <torch/csrc/autograd/saved_variable.h>
#include <torch/csrc/utils/object_ptr.h>
#include <c10/util/Optional.h>
#include <c10/core/DeviceGuard.h>
#include <vector>
#include <utility>
#include <memory>
namespace torch { namespace jit { struct Graph; }}
namespace torch { namespace autograd {
struct VariableInfo {
explicit VariableInfo(const Variable& var);
Variable zeros(at::OptionalDeviceGuard& device_guard) const;
at::Backend backend = at::Backend::Undefined;
at::Device device = at::kCPU;
at::ScalarType scalar_type = at::kFloat;
std::vector<int64_t> size;
bool requires_grad;
};
// A Function which is implemented by a Python object (i.e., a THPFunction).
// Calls to 'apply' are forwarded to the Python method implementation.
struct PyFunction : public Function {
PyFunction(PyObject* obj) : obj(obj) {}
variable_list apply(variable_list&& inputs) override;
variable_list legacy_apply(const variable_list& inputs);
void release_variables() override;
std::string name() const override;
std::shared_ptr<Function> get_shared_ptr() override;
bool is_traceable() override;
// THPFunction this Function is wrapping.
PyObject* obj;
};
/**
* Cast an object into a tuple, if it is not a tuple already. Returns true
* if the original object was not a tuple.
*/
inline bool ensure_tuple(THPObjectPtr& obj) {
if (PyTuple_Check(obj.get()))
return false;
PyObject *tuple = PyTuple_New(1);
if (!tuple) throw python_error();
PyTuple_SET_ITEM(tuple, 0, obj.release());
obj = tuple;
return true;
}
}} // namespace torch::autograd
struct THPFunction {
PyObject_HEAD
PyObject *needs_input_grad;
// Python tuple of tensors whose variables we should save. Set
// by Python with 'save_for_backward'. If nullptr, no tensors were
// saved.
PyObject *to_save;
// Python tuple of tensors which are not differentiable. Set by
// Python with 'mark_non_differentiable'. If nullptr, no tensors were
// non-differentiable.
PyObject *non_differentiable;
// Python tuple of tensors which had inplace updates in the forward()
// pass. Set by Python with 'mark_dirty'. If nullptr, no tensors were
// modified inplace.
PyObject *dirty_tensors;
std::vector<torch::autograd::VariableInfo> output_info;
std::vector<torch::autograd::VariableInfo> input_info;
std::vector<torch::autograd::SavedVariable> saved_variables;
// For each input, true if the input is a THPVariable
std::vector<bool> is_variable_input;
char has_freed_buffers;
// The C++ wrapper for this Python function.
// See a comment in THPFunction_asFunction for details about this field.
torch::autograd::PyFunction cdata;
};
bool THPFunction_initModule(PyObject *module);
extern PyTypeObject THPFunctionType;
extern PyObject *THPFunctionClass;
// XXX: this function requires the GIL (it can have side effects).
std::shared_ptr<torch::autograd::PyFunction> THPFunction_asFunction(THPFunction* self);
inline bool THPFunction_Check(PyObject* obj) {
return PyObject_IsInstance(obj, (PyObject*)&THPFunctionType);
}
| 30.794393 | 87 | 0.734143 | [
"object",
"vector"
] |
cfd466978b07f2ccc534e560a887bb5acae82d74 | 5,156 | h | C | be/src/olap/rowset/alpha_rowset_reader.h | xinghuayu007/doris-vectorized | dcb0dcb1596bcc73f4497c08a3a212b0c34127f7 | [
"Apache-2.0"
] | null | null | null | be/src/olap/rowset/alpha_rowset_reader.h | xinghuayu007/doris-vectorized | dcb0dcb1596bcc73f4497c08a3a212b0c34127f7 | [
"Apache-2.0"
] | null | null | null | be/src/olap/rowset/alpha_rowset_reader.h | xinghuayu007/doris-vectorized | dcb0dcb1596bcc73f4497c08a3a212b0c34127f7 | [
"Apache-2.0"
] | null | null | null | // 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 DORIS_BE_SRC_OLAP_ROWSET_ALPHA_ROWSET_READER_H
#define DORIS_BE_SRC_OLAP_ROWSET_ALPHA_ROWSET_READER_H
#include <queue>
#include <vector>
#include "olap/rowset/alpha_rowset.h"
#include "olap/rowset/alpha_rowset_meta.h"
#include "olap/rowset/column_data.h"
#include "olap/rowset/rowset_reader.h"
#include "olap/rowset/segment_group.h"
namespace doris {
// Each segment group corresponds to a MergeContext, which is able to produce ordered rows.
struct AlphaMergeContext {
std::unique_ptr<ColumnData> column_data = nullptr;
int key_range_index = -1;
// Read data from ColumnData for the first time.
// ScanKey should be sought in this case.
bool first_read_symbol = true;
RowBlock* row_block = nullptr;
std::unique_ptr<RowCursor> row_cursor = nullptr;
bool is_eof = false;
};
struct AlphaMergeContextComparator {
bool operator()(const AlphaMergeContext* x, const AlphaMergeContext* y) const;
};
class AlphaRowsetReader : public RowsetReader {
public:
AlphaRowsetReader(int num_rows_per_row_block, AlphaRowsetSharedPtr rowset,
const std::shared_ptr<MemTracker>& parent_tracker = nullptr);
~AlphaRowsetReader() override;
// reader init
OLAPStatus init(RowsetReaderContext* read_context) override;
// read next block data
// If parent_tracker is not null, the block we get from next_block() will have the parent_tracker.
// It's ok, because we only get ref here, the block's owner is this reader.
OLAPStatus next_block(RowBlock** block) override;
OLAPStatus next_block(vectorized::Block *block) override {
return OLAP_ERR_DATA_EOF;
}
bool delete_flag() override;
Version version() override;
VersionHash version_hash() override;
RowsetSharedPtr rowset() override;
int64_t filtered_rows() override;
RowsetReaderType type() const override {
return RowsetReaderType::ALPHA;
}
private:
OLAPStatus _init_merge_ctxs(RowsetReaderContext* read_context);
OLAPStatus _union_block(RowBlock** block);
OLAPStatus _merge_block(RowBlock** block);
OLAPStatus _pull_next_block(AlphaMergeContext* merge_ctx);
// Doris will split query predicates to several scan keys
// This function is used to fetch block when advancing
// current scan key to next scan key.
OLAPStatus _pull_first_block(AlphaMergeContext* merge_ctx);
// merge by priority queue(_merge_heap)
OLAPStatus _pull_next_row_for_merge_rowset_v2(RowCursor** row);
// init the merge heap, this should be call before calling _pull_next_row_for_merge_rowset_v2();
OLAPStatus _init_merge_heap();
// update the merge ctx.
// 1. get next row block of this ctx, if current row block is empty.
// 2. read the current row of the row block and push it to merge heap.
// 3. point to the next row of the row block
OLAPStatus _update_merge_ctx_and_build_merge_heap(AlphaMergeContext* merge_ctx);
private:
int _num_rows_per_row_block;
AlphaRowsetSharedPtr _rowset;
std::shared_ptr<MemTracker> _parent_tracker;
std::string _rowset_path;
AlphaRowsetMeta* _alpha_rowset_meta;
const std::vector<std::shared_ptr<SegmentGroup>>& _segment_groups;
// In '_union_block' mode, it has items to traverse.
// In '_merge_block' mode, it will be cleared after '_merge_heap' has been built.
std::list<AlphaMergeContext*> _sequential_ctxs;
std::unique_ptr<RowBlock> _read_block;
OLAPStatus (AlphaRowsetReader::*_next_block)(RowBlock** block) = nullptr;
RowCursor* _dst_cursor = nullptr;
int _key_range_size;
// In streaming ingestion, row among different segment
// groups may overlap, and is necessary to be taken
// into consideration deliberately.
bool _is_segments_overlapping;
// Current AlphaMergeContext to read data, just valid in '_union_block' mode.
AlphaMergeContext* _cur_ctx = nullptr;
// A priority queue for merging rowsets, just valid in '_merge_block' mode.
std::priority_queue<AlphaMergeContext*, vector<AlphaMergeContext*>, AlphaMergeContextComparator>
_merge_heap;
RowsetReaderContext* _current_read_context;
OlapReaderStatistics _owned_stats;
OlapReaderStatistics* _stats = &_owned_stats;
};
} // namespace doris
#endif // DORIS_BE_SRC_OLAP_ROWSET_ALPHA_ROWSET_READER_H
| 35.805556 | 102 | 0.745345 | [
"vector"
] |
cfe127cbf1dbf3d6dd43b371428e5c66c2aeb66d | 1,542 | c | C | src/Tower/tower_profit.c | Leosle/MUL_my_defender_2019 | 65102cfa0732b86af56f578383e4d98d92a72450 | [
"Unlicense"
] | 1 | 2020-03-18T19:02:32.000Z | 2020-03-18T19:02:32.000Z | src/Tower/tower_profit.c | Leosle/MUL_my_defender_2019 | 65102cfa0732b86af56f578383e4d98d92a72450 | [
"Unlicense"
] | null | null | null | src/Tower/tower_profit.c | Leosle/MUL_my_defender_2019 | 65102cfa0732b86af56f578383e4d98d92a72450 | [
"Unlicense"
] | 1 | 2020-05-06T17:49:45.000Z | 2020-05-06T17:49:45.000Z | /*
** EPITECH PROJECT, 2019
** MUL_my_defender_2019
** File description:
** tower_profit.c
*/
#include "../fonctions.h"
basicobject_t *init_tower_profit
(basicobject_t *body, float x, float y, char *path)
{
body->texture = sfTexture_createFromFile(path, NULL);
body->sprite = sfSprite_create();
sfSprite_setTexture(body->sprite, body->texture, 1);
body->vector.x = x;
body->vector.y = y;
sfSprite_setPosition(body->sprite, body->vector);
return (body);
}
void create_tower_profit(game_t *game)
{
game->play->tower_profit[0].body = init_tower_profit
(game->play->tower_profit[0].body, 1555.0, 400.0,
"picture/dtls_profit.png");
game->play->tower_profit[1].body = init_tower_profit
(game->play->tower_profit[1].body, 68.0, 320.0, "picture/tower-canon.png");
game->play->tower_profit[2].body = init_tower_profit
(game->play->tower_profit[2].body, 380.0, 285.0, "picture/tower-canon.png");
game->play->tower_profit[3].body = init_tower_profit
(game->play->tower_profit[3].body, 740.0, 425.0, "picture/tower-canon.png");
game->play->tower_profit[4].body = init_tower_profit
(game->play->tower_profit[4].body, 1090.0, 510.0,
"picture/tower-canon.png");
game->play->tower_profit[5].body = init_tower_profit
(game->play->tower_profit[5].body, 1285.0, 220.0,
"picture/tower-canon.png");
} | 39.538462 | 80 | 0.608949 | [
"vector"
] |
cfe3729d2fb207ac9d22b1ab6f3be0d5d1306672 | 6,263 | h | C | examples/platforms/samr21/crypto/aes_alt.h | doublemis1/openthread | 2bb72299d3d91109247001116a1e15a3bbbf8f68 | [
"BSD-3-Clause"
] | 2 | 2021-12-09T11:45:57.000Z | 2022-03-03T18:08:37.000Z | examples/platforms/samr21/crypto/aes_alt.h | doublemis1/openthread | 2bb72299d3d91109247001116a1e15a3bbbf8f68 | [
"BSD-3-Clause"
] | 37 | 2022-01-31T08:29:51.000Z | 2022-03-31T08:38:33.000Z | examples/platforms/samr21/crypto/aes_alt.h | doublemis1/openthread | 2bb72299d3d91109247001116a1e15a3bbbf8f68 | [
"BSD-3-Clause"
] | 3 | 2021-02-12T17:11:10.000Z | 2022-03-16T14:40:20.000Z | /*
* Copyright (c) 2019, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. 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.
*/
#ifndef MBEDTLS_AES_ALT_H
#define MBEDTLS_AES_ALT_H
#if !defined(MBEDTLS_CONFIG_FILE)
#include "samr21-mbedtls-config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#ifdef MBEDTLS_AES_ALT
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
uint8_t hwKeyLen;
unsigned char aes_enc_key[32]; /* Encryption key */
unsigned char aes_dec_key[32]; /* Decryption key */
} mbedtls_aes_context;
/**
* @brief Initialize AES context
*
* @param [in,out] ctx AES context to be initialized
*/
void mbedtls_aes_init(mbedtls_aes_context *ctx);
/**
* @brief Clear AES context
*
* \param ctx AES context to be cleared
*/
void mbedtls_aes_free(mbedtls_aes_context *ctx);
/**
* \brief AES key schedule (encryption)
*
* \param ctx AES context to be initialized
* \param key encryption key
* \param keybits must be 128, 192 or 256
*
* \return 0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
*/
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits);
/**
* \brief AES key schedule (decryption)
*
* \param ctx AES context to be initialized
* \param key decryption key
* \param keybits must be 128, 192 or 256
*
* \return 0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
*/
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits);
/**
* \brief AES-ECB block encryption/decryption
*
* \param ctx AES context
* \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
* \param input 16-byte input block
* \param output 16-byte output block
*
* \return 0 if successful
*/
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16]);
/**
* \brief AES-CBC buffer encryption/decryption
* Length should be a multiple of the block
* size (16 bytes)
*
* \note Upon exit, the content of the IV is updated so that you can
* call the function same function again on the following
* block(s) of data and get the same result as if it was
* encrypted in one call. This allows a "streaming" usage.
* If on the other hand you need to retain the contents of the
* IV, you should either save it manually or use the cipher
* module instead.
*
* \param ctx AES context
* \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
* \param length length of the input data
* \param iv initialization vector (updated after use)
* \param input buffer holding the input data
* \param output buffer holding the output data
*
* \return 0 if successful, or MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH
*/
int mbedtls_aes_crypt_cbc(mbedtls_aes_context *ctx,
int mode,
size_t length,
unsigned char iv[16],
const unsigned char *input,
unsigned char * output);
/**
* \brief AES-CTR buffer encryption/decryption
*
* Warning: You have to keep the maximum use of your counter in mind!
*
* Note: Due to the nature of CTR you should use the same key schedule for
* both encryption and decryption. So a context initialized with
* mbedtls_aes_setkey_enc() for both MBEDTLS_AES_ENCRYPT and MBEDTLS_AES_DECRYPT.
*
* \param ctx AES context
* \param length The length of the data
* \param nc_off The offset in the current stream_block (for resuming
* within current cipher stream). The offset pointer to
* should be 0 at the start of a stream.
* \param nonce_counter The 128-bit nonce and counter.
* \param stream_block The saved stream-block for resuming. Is overwritten
* by the function.
* \param input The input data stream
* \param output The output data stream
*
* \return 0 if successful
*/
int mbedtls_aes_crypt_ctr(mbedtls_aes_context *ctx,
size_t length,
size_t * nc_off,
unsigned char nonce_counter[16],
unsigned char stream_block[16],
const unsigned char *input,
unsigned char * output);
#ifdef __cplusplus
}
#endif
#endif /* MBEDTLS_AES_ALT */
#endif /* MBEDTLS_AES_ALT_H */
| 37.957576 | 119 | 0.656874 | [
"vector"
] |
cfe71344ca08b0914f0a71f6acb78bf5851b45c2 | 3,268 | h | C | aws-cpp-sdk-forecast/include/aws/forecast/model/DeleteForecastRequest.h | grujicbr/aws-sdk-cpp | bdd43c178042f09c6739645e3f6cd17822a7c35c | [
"Apache-2.0"
] | 1 | 2019-10-10T20:58:44.000Z | 2019-10-10T20:58:44.000Z | aws-cpp-sdk-forecast/include/aws/forecast/model/DeleteForecastRequest.h | novaquark/aws-sdk-cpp | a0969508545bec9ae2864c9e1e2bb9aff109f90c | [
"Apache-2.0"
] | null | null | null | aws-cpp-sdk-forecast/include/aws/forecast/model/DeleteForecastRequest.h | novaquark/aws-sdk-cpp | a0969508545bec9ae2864c9e1e2bb9aff109f90c | [
"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/forecast/ForecastService_EXPORTS.h>
#include <aws/forecast/ForecastServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace ForecastService
{
namespace Model
{
/**
*/
class AWS_FORECASTSERVICE_API DeleteForecastRequest : public ForecastServiceRequest
{
public:
DeleteForecastRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DeleteForecast"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline const Aws::String& GetForecastArn() const{ return m_forecastArn; }
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline bool ForecastArnHasBeenSet() const { return m_forecastArnHasBeenSet; }
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline void SetForecastArn(const Aws::String& value) { m_forecastArnHasBeenSet = true; m_forecastArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline void SetForecastArn(Aws::String&& value) { m_forecastArnHasBeenSet = true; m_forecastArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline void SetForecastArn(const char* value) { m_forecastArnHasBeenSet = true; m_forecastArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline DeleteForecastRequest& WithForecastArn(const Aws::String& value) { SetForecastArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline DeleteForecastRequest& WithForecastArn(Aws::String&& value) { SetForecastArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the forecast to delete.</p>
*/
inline DeleteForecastRequest& WithForecastArn(const char* value) { SetForecastArn(value); return *this;}
private:
Aws::String m_forecastArn;
bool m_forecastArnHasBeenSet;
};
} // namespace Model
} // namespace ForecastService
} // namespace Aws
| 34.041667 | 121 | 0.704712 | [
"model"
] |
cfe938448aab13f3a78b87944dcf875f47e8b58c | 9,193 | h | C | test/checkpoint_test.h | Bhaskers-Blu-Org2/FishStore | 6d0a20b9012d9d1af11f9354bd053b251774cf25 | [
"MIT"
] | 184 | 2019-06-15T20:56:50.000Z | 2022-01-13T09:45:58.000Z | test/checkpoint_test.h | Bhaskers-Blu-Org2/FishStore | 6d0a20b9012d9d1af11f9354bd053b251774cf25 | [
"MIT"
] | 13 | 2019-06-15T01:15:20.000Z | 2021-03-19T15:12:36.000Z | test/checkpoint_test.h | microsoft/FishStore | 6d0a20b9012d9d1af11f9354bd053b251774cf25 | [
"MIT"
] | 18 | 2019-06-20T05:54:12.000Z | 2021-12-13T11:56:57.000Z | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#include "core/fishstore.h"
using namespace fishstore::core;
using adapter_t = fishstore::adapter::SIMDJsonAdapter;
using disk_t = fishstore::device::FileSystemDisk<handler_t, 33554432L>;
using store_t = FishStore<disk_t, adapter_t>;
const size_t n_records = 1500000;
const size_t n_threads = 4;
const char* pattern =
"{\"id\": \"%zu\", \"name\": \"name%zu\", \"gender\": \"%s\", \"school\": {\"id\": \"%zu\", \"name\": \"school%zu\"}}";
Guid log_token, index_token;
class JsonGeneralScanContext : public IAsyncContext {
public:
JsonGeneralScanContext(uint16_t psf_id, const char* value, uint32_t expected)
: hash_{ Utility::HashBytesWithPSFID(psf_id, value, strlen(value)) },
psf_id_{ psf_id },
value_size_{ static_cast<uint32_t>(strlen(value)) },
value_{ value },
cnt{ 0 },
expected{ expected } {
}
JsonGeneralScanContext(uint16_t psf_id, const char* value, size_t length, uint32_t expected)
: hash_{ Utility::HashBytesWithPSFID(psf_id, value, length) },
psf_id_{ psf_id },
value_size_{ static_cast<uint32_t>(length) },
value_{ value },
cnt{ 0 },
expected{ expected } {
}
JsonGeneralScanContext(const JsonGeneralScanContext& other)
: hash_{ other.hash_ },
psf_id_{ other.psf_id_ },
value_size_{ other.value_size_ },
cnt{ other.cnt },
expected{ other.expected } {
set_from_deep_copy();
char* res = (char*)malloc(value_size_);
memcpy(res, other.value_, value_size_);
value_ = res;
}
~JsonGeneralScanContext() {
if (from_deep_copy()) free((void*)value_);
}
inline void Touch(const char* payload, uint32_t payload_size) {
++cnt;
}
inline void Finalize() {
ASSERT_EQ(cnt, expected);
}
inline KeyHash get_hash() const {
return hash_;
}
inline bool check(const KeyPointer* kpt) {
return kpt->mode == 0 && kpt->general_psf_id == psf_id_ &&
kpt->value_size == value_size_ &&
!memcmp(kpt->get_value(), value_, value_size_);
}
protected:
Status DeepCopy_Internal(IAsyncContext*& context_copy) {
return IAsyncContext::DeepCopy_Internal(*this, context_copy);
}
private:
KeyHash hash_;
uint16_t psf_id_;
uint32_t value_size_;
const char* value_;
uint32_t cnt, expected;
};
class JsonFullScanContext : public IAsyncContext {
public:
JsonFullScanContext(const std::vector<std::string>& field_names,
const general_psf_t<adapter_t>& pred, const char* value, uint32_t expected)
: eval_{ pred },
cnt{ 0 },
expected{ expected },
value_{ value },
value_size_{ static_cast<uint32_t>(strlen(value)) },
field_names{field_names},
parser{field_names} {
}
JsonFullScanContext(const JsonFullScanContext& other)
: field_names{ other.field_names },
eval_{ other.eval_ },
value_size_{ other.value_size_ },
cnt{ other.cnt },
expected{ other.expected },
parser{other.field_names} {
set_from_deep_copy();
char* res = (char*)malloc(value_size_);
memcpy(res, other.value_, value_size_);
value_ = res;
}
~JsonFullScanContext() {
if (from_deep_copy()) {
free((void*)value_);
}
}
inline void Touch(const char* payload, uint32_t payload_size) {
++cnt;
}
inline void Finalize() {
ASSERT_EQ(cnt, expected);
}
inline bool check(const char* payload, uint32_t payload_size) {
parser.Load(payload, payload_size);
auto& record = parser.NextRecord();
tsl::hopscotch_map<uint16_t, typename adapter_t::field_t> field_map(field_names.size());
for (auto& field : record.GetFields()) {
field_map.emplace(static_cast<int16_t>(field.FieldId()), field);
}
std::vector<adapter_t::field_t> args;
args.reserve(field_names.size());
for (uint16_t i = 0; i < field_names.size(); ++i) {
auto it = field_map.find(i);
if (it == field_map.end()) return false;
args.emplace_back(it->second);
}
auto res = eval_(args);
if (res.is_null) return false;
bool pass = (res.size == value_size_ && !strncmp(res.payload, value_, value_size_));
if (res.need_free) delete res.payload;
return pass;
}
protected:
Status DeepCopy_Internal(IAsyncContext * &context_copy) {
return IAsyncContext::DeepCopy_Internal(*this, context_copy);
}
private:
adapter_t::parser_t parser;
std::vector<std::string> field_names;
general_psf_t<adapter_t> eval_;
uint32_t cnt, expected;
uint32_t value_size_;
const char* value_;
};
TEST(CLASS, Checkpoint_Concurrent) {
std::experimental::filesystem::remove_all("test");
std::experimental::filesystem::create_directories("test");
std::vector<Guid> guids(n_threads);
{
store_t store{ 8192, 201326592, "test" };
store.StartSession();
auto id_proj = store.MakeProjection("/id");
auto gender_proj = store.MakeProjection("/gender");
std::vector<ParserAction> actions;
actions.push_back({ REGISTER_GENERAL_PSF, id_proj });
actions.push_back({ REGISTER_GENERAL_PSF, gender_proj });
uint64_t safe_register_address, safe_unregister_address;
safe_unregister_address = store.ApplyParserShift(
actions, [&safe_register_address](uint64_t safe_address) {
safe_register_address = safe_address;
});
store.CompleteAction(true);
static auto checkpoint_callback = [](Status result) {
ASSERT_EQ(result, Status::Ok);
};
static auto hybrid_log_persistence_callback =
[](Status result, uint64_t persistent_serial_num, uint32_t persistent_offset) {
ASSERT_EQ(result, Status::Ok);
};
std::atomic_size_t cnt{ 0 };
std::vector<std::thread> thds;
for (size_t i = 0; i < n_threads; ++i) {
thds.emplace_back([&store, &cnt, &guids](size_t start) {
guids[start] = store.StartSession();
char buf[1024];
uint64_t serial_num = 0;
size_t op_cnt = 0;
for (size_t i = start; i < n_records; i += n_threads) {
auto n = sprintf(buf, pattern, i, i, (i % 2) ? "male" : "female", i % 10, i % 10);
cnt += store.BatchInsert(buf, n, serial_num);
++op_cnt;
if (op_cnt % 256 == 0) store.Refresh();
++serial_num;
}
store.StopSession();
}, i);
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
store.CheckpointIndex(checkpoint_callback, index_token);
store.CompleteAction(true);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
store.CheckpointHybridLog(hybrid_log_persistence_callback, log_token);
store.CompleteAction(true);
for (auto& thd : thds) {
thd.join();
}
ASSERT_EQ(cnt, n_records);
actions.clear();
actions.push_back({ DEREGISTER_GENERAL_PSF, id_proj });
actions.push_back({ DEREGISTER_GENERAL_PSF, gender_proj });
safe_unregister_address = store.ApplyParserShift(
actions, [&safe_register_address](uint64_t safe_address) {
safe_register_address = safe_address;
});
store.CompleteAction(true);
store.StopSession();
}
store_t new_store{ 8192, 201326592, "test" };
uint32_t version;
std::vector<Guid> recovered_session_ids;
new_store.Recover(index_token, log_token, version, recovered_session_ids);
new_store.StartSession();
std::vector<std::pair<uint64_t, uint32_t>> sessions(n_threads);
std::vector<std::thread> thds;
auto new_worker_thd = [&](int thread_no) {
uint64_t serial_num;
uint32_t offset;
std::tie(serial_num, offset) = new_store.ContinueSession(guids[thread_no]);
size_t begin_line = thread_no;
auto callback = [](IAsyncContext* ctxt, Status result) {
assert(false);
};
new_store.Refresh();
uint32_t op_cnt = 0;
char buf[1024];
bool flag = true;
for (size_t i = begin_line + serial_num * n_threads; i < n_records; i += n_threads) {
auto n = sprintf(buf, pattern, i, i, (i % 2) ? "male" : "female", i % 10, i % 10);
if (flag) {
new_store.BatchInsert(buf, n, serial_num, offset);
flag = false;
}
else {
new_store.BatchInsert(buf, n, serial_num);
}
++op_cnt;
if (op_cnt % 256 == 0) new_store.Refresh();
++serial_num;
}
new_store.CompleteAction(true);
new_store.StopSession();
};
for (int i = 0; i < n_threads; ++i) {
thds.emplace_back(std::thread(new_worker_thd, i));
}
for (int i = 0; i < n_threads; ++i) {
thds[i].join();
}
auto callback = [](IAsyncContext* ctxt, Status result) {
ASSERT_EQ(result, Status::Ok);
};
JsonGeneralScanContext context2{ 1, "male", n_records / 2 };
auto res = new_store.Scan(context2, callback, 0);
ASSERT_EQ(res, Status::Pending);
new_store.CompletePending(true);
std::vector<ParserAction> actions;
uint64_t safe_register_address, safe_unregister_address;
actions.push_back({ DEREGISTER_GENERAL_PSF, 0 });
actions.push_back({ DEREGISTER_GENERAL_PSF, 1 });
safe_unregister_address = new_store.ApplyParserShift(
actions, [&safe_register_address](uint64_t safe_address) {
safe_register_address = safe_address;
});
new_store.CompleteAction(true);
new_store.StopSession();
}
| 30.140984 | 121 | 0.668661 | [
"vector"
] |
cfecccf793272285c35a84fc198b9e47bf26d4f6 | 23,799 | c | C | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gtestdbus.c | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gtestdbus.c | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glib-2.0/1_2.60.3-r0/glib-2.60.3/gio/gtestdbus.c | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | /* GIO testing utilities
*
* Copyright (C) 2008-2010 Red Hat, Inc.
* Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
*
* 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/>.
*
* Authors: David Zeuthen <davidz@redhat.com>
* Xavier Claessens <xavier.claessens@collabora.co.uk>
*/
#include "config.h"
#include <errno.h>
#include <gstdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef G_OS_UNIX
#include <unistd.h>
#endif
#ifdef G_OS_WIN32
#include <io.h>
#endif
#include <glib.h>
#include "gdbusconnection.h"
#include "gdbusprivate.h"
#include "gfile.h"
#include "gioenumtypes.h"
#include "glibintl.h"
#include "gtestdbus.h"
#ifdef G_OS_WIN32
#include <windows.h>
#endif
/* -------------------------------------------------------------------------- */
/* Utility: Wait until object has a single ref */
typedef struct
{
GMainLoop* loop;
gboolean timed_out;
} WeakNotifyData;
static gboolean on_weak_notify_timeout(gpointer user_data)
{
WeakNotifyData* data = user_data;
data->timed_out = TRUE;
g_main_loop_quit(data->loop);
return FALSE;
}
static gboolean dispose_on_idle(gpointer object)
{
g_object_run_dispose(object);
g_object_unref(object);
return FALSE;
}
static gboolean _g_object_dispose_and_wait_weak_notify(gpointer object)
{
WeakNotifyData data;
guint timeout_id;
data.loop = g_main_loop_new(NULL, FALSE);
data.timed_out = FALSE;
g_object_weak_ref(object, (GWeakNotify)g_main_loop_quit, data.loop);
/* Drop the ref in an idle callback, this is to make sure the mainloop
* is already running when weak notify happens */
g_idle_add(dispose_on_idle, object);
/* Make sure we don't block forever */
timeout_id = g_timeout_add(30 * 1000, on_weak_notify_timeout, &data);
g_main_loop_run(data.loop);
if (data.timed_out)
{
g_warning("Weak notify timeout, object ref_count=%d",
G_OBJECT(object)->ref_count);
}
else
{
g_source_remove(timeout_id);
}
g_main_loop_unref(data.loop);
return data.timed_out;
}
/* -------------------------------------------------------------------------- */
/* Utilities to cleanup the mess in the case unit test process crash */
#ifdef G_OS_WIN32
/* This could be interesting to expose in public API */
static void _g_test_watcher_add_pid(GPid pid)
{
static gsize started = 0;
HANDLE job;
if (g_once_init_enter(&started))
{
JOBOBJECT_EXTENDED_LIMIT_INFORMATION info;
job = CreateJobObjectW(NULL, NULL);
memset(&info, 0, sizeof(info));
info.BasicLimitInformation.LimitFlags =
0x2000 /* JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE */;
if (!SetInformationJobObject(job, JobObjectExtendedLimitInformation,
&info, sizeof(info)))
g_warning("Can't enable JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: %s",
g_win32_error_message(GetLastError()));
g_once_init_leave(&started, (gsize)job);
}
job = (HANDLE)started;
if (!AssignProcessToJobObject(job, pid))
g_warning("Can't assign process to job: %s",
g_win32_error_message(GetLastError()));
}
static void _g_test_watcher_remove_pid(GPid pid)
{
/* No need to unassign the process from the job object as the process
will be killed anyway */
}
#else
#define ADD_PID_FORMAT "add pid %d\n"
#define REMOVE_PID_FORMAT "remove pid %d\n"
static void watch_parent(gint fd)
{
GIOChannel* channel;
GPollFD fds[1];
GArray* pids_to_kill;
channel = g_io_channel_unix_new(fd);
fds[0].fd = fd;
fds[0].events = G_IO_HUP | G_IO_IN;
fds[0].revents = 0;
pids_to_kill = g_array_new(FALSE, FALSE, sizeof(guint));
do
{
gint num_events;
gchar* command = NULL;
guint pid;
guint n;
GError* error = NULL;
num_events = g_poll(fds, 1, -1);
if (num_events == 0)
continue;
if (fds[0].revents & G_IO_HUP)
{
/* Parent quit, cleanup the mess and exit */
for (n = 0; n < pids_to_kill->len; n++)
{
pid = g_array_index(pids_to_kill, guint, n);
g_printerr("cleaning up pid %d\n", pid);
kill(pid, SIGTERM);
}
g_array_unref(pids_to_kill);
g_io_channel_shutdown(channel, FALSE, &error);
g_assert_no_error(error);
g_io_channel_unref(channel);
exit(0);
}
/* Read the command from the input */
g_io_channel_read_line(channel, &command, NULL, NULL, &error);
g_assert_no_error(error);
/* Check for known commands */
if (sscanf(command, ADD_PID_FORMAT, &pid) == 1)
{
g_array_append_val(pids_to_kill, pid);
}
else if (sscanf(command, REMOVE_PID_FORMAT, &pid) == 1)
{
for (n = 0; n < pids_to_kill->len; n++)
{
if (g_array_index(pids_to_kill, guint, n) == pid)
{
g_array_remove_index(pids_to_kill, n);
pid = 0;
break;
}
}
if (pid != 0)
{
g_warning("unknown pid %d to remove", pid);
}
}
else
{
g_warning("unknown command from parent '%s'", command);
}
g_free(command);
} while (TRUE);
}
static GIOChannel* watcher_init(void)
{
static gsize started = 0;
static GIOChannel* channel = NULL;
int errsv;
if (g_once_init_enter(&started))
{
gint pipe_fds[2];
/* fork a child to clean up when we are killed */
if (pipe(pipe_fds) != 0)
{
errsv = errno;
g_warning("pipe() failed: %s", g_strerror(errsv));
g_assert_not_reached();
}
switch (fork())
{
case -1:
errsv = errno;
g_warning("fork() failed: %s", g_strerror(errsv));
g_assert_not_reached();
break;
case 0:
/* child */
close(pipe_fds[1]);
watch_parent(pipe_fds[0]);
break;
default:
/* parent */
close(pipe_fds[0]);
channel = g_io_channel_unix_new(pipe_fds[1]);
}
g_once_init_leave(&started, 1);
}
return channel;
}
static void watcher_send_command(const gchar* command)
{
GIOChannel* channel;
GError* error = NULL;
channel = watcher_init();
g_io_channel_write_chars(channel, command, -1, NULL, &error);
g_assert_no_error(error);
g_io_channel_flush(channel, &error);
g_assert_no_error(error);
}
/* This could be interesting to expose in public API */
static void _g_test_watcher_add_pid(GPid pid)
{
gchar* command;
command = g_strdup_printf(ADD_PID_FORMAT, (guint)pid);
watcher_send_command(command);
g_free(command);
}
static void _g_test_watcher_remove_pid(GPid pid)
{
gchar* command;
command = g_strdup_printf(REMOVE_PID_FORMAT, (guint)pid);
watcher_send_command(command);
g_free(command);
}
#endif
/* -------------------------------------------------------------------------- */
/* GTestDBus object implementation */
/**
* SECTION:gtestdbus
* @short_description: D-Bus testing helper
* @include: gio/gio.h
*
* A helper class for testing code which uses D-Bus without touching the user's
* session bus.
*
* Note that #GTestDBus modifies the user’s environment, calling setenv().
* This is not thread-safe, so all #GTestDBus calls should be completed before
* threads are spawned, or should have appropriate locking to ensure no access
* conflicts to environment variables shared between #GTestDBus and other
* threads.
*
* ## Creating unit tests using GTestDBus
*
* Testing of D-Bus services can be tricky because normally we only ever run
* D-Bus services over an existing instance of the D-Bus daemon thus we
* usually don't activate D-Bus services that are not yet installed into the
* target system. The #GTestDBus object makes this easier for us by taking care
* of the lower level tasks such as running a private D-Bus daemon and looking
* up uninstalled services in customizable locations, typically in your source
* code tree.
*
* The first thing you will need is a separate service description file for the
* D-Bus daemon. Typically a `services` subdirectory of your `tests` directory
* is a good place to put this file.
*
* The service file should list your service along with an absolute path to the
* uninstalled service executable in your source tree. Using autotools we would
* achieve this by adding a file such as `my-server.service.in` in the services
* directory and have it processed by configure.
* |[
* [D-BUS Service]
* Name=org.gtk.GDBus.Examples.ObjectManager
* Exec=@abs_top_builddir@/gio/tests/gdbus-example-objectmanager-server
* ]|
* You will also need to indicate this service directory in your test
* fixtures, so you will need to pass the path while compiling your
* test cases. Typically this is done with autotools with an added
* preprocessor flag specified to compile your tests such as:
* |[
* -DTEST_SERVICES=\""$(abs_top_builddir)/tests/services"\"
* ]|
* Once you have a service definition file which is local to your source
* tree, you can proceed to set up a GTest fixture using the #GTestDBus
* scaffolding.
*
* An example of a test fixture for D-Bus services can be found
* here:
* [gdbus-test-fixture.c](https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-test-fixture.c)
*
* Note that these examples only deal with isolating the D-Bus aspect of your
* service. To successfully run isolated unit tests on your service you may need
* some additional modifications to your test case fixture. For example; if your
* service uses GSettings and installs a schema then it is important that your
* test service not load the schema in the ordinary installed location (chances
* are that your service and schema files are not yet installed, or worse; there
* is an older version of the schema file sitting in the install location).
*
* Most of the time we can work around these obstacles using the
* environment. Since the environment is inherited by the D-Bus daemon
* created by #GTestDBus and then in turn inherited by any services the
* D-Bus daemon activates, using the setup routine for your fixture is
* a practical place to help sandbox your runtime environment. For the
* rather typical GSettings case we can work around this by setting
* `GSETTINGS_SCHEMA_DIR` to the in tree directory holding your schemas
* in the above fixture_setup() routine.
*
* The GSettings schemas need to be locally pre-compiled for this to work. This
* can be achieved by compiling the schemas locally as a step before running
* test cases, an autotools setup might do the following in the directory
* holding schemas:
* |[
* all-am:
* $(GLIB_COMPILE_SCHEMAS) .
*
* CLEANFILES += gschemas.compiled
* ]|
*/
typedef struct _GTestDBusClass GTestDBusClass;
typedef struct _GTestDBusPrivate GTestDBusPrivate;
/**
* GTestDBus:
*
* The #GTestDBus structure contains only private data and
* should only be accessed using the provided API.
*
* Since: 2.34
*/
struct _GTestDBus
{
GObject parent;
GTestDBusPrivate* priv;
};
struct _GTestDBusClass
{
GObjectClass parent_class;
};
struct _GTestDBusPrivate
{
GTestDBusFlags flags;
GPtrArray* service_dirs;
GPid bus_pid;
gint bus_stdout_fd;
gchar* bus_address;
gboolean up;
};
enum
{
PROP_0,
PROP_FLAGS,
};
G_DEFINE_TYPE_WITH_PRIVATE(GTestDBus, g_test_dbus, G_TYPE_OBJECT)
static void g_test_dbus_init(GTestDBus* self)
{
self->priv = g_test_dbus_get_instance_private(self);
self->priv->service_dirs = g_ptr_array_new_with_free_func(g_free);
}
static void g_test_dbus_dispose(GObject* object)
{
GTestDBus* self = (GTestDBus*)object;
if (self->priv->up)
g_test_dbus_down(self);
G_OBJECT_CLASS(g_test_dbus_parent_class)->dispose(object);
}
static void g_test_dbus_finalize(GObject* object)
{
GTestDBus* self = (GTestDBus*)object;
g_ptr_array_unref(self->priv->service_dirs);
g_free(self->priv->bus_address);
G_OBJECT_CLASS(g_test_dbus_parent_class)->finalize(object);
}
static void g_test_dbus_get_property(GObject* object, guint property_id,
GValue* value, GParamSpec* pspec)
{
GTestDBus* self = (GTestDBus*)object;
switch (property_id)
{
case PROP_FLAGS:
g_value_set_flags(value, g_test_dbus_get_flags(self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
}
static void g_test_dbus_set_property(GObject* object, guint property_id,
const GValue* value, GParamSpec* pspec)
{
GTestDBus* self = (GTestDBus*)object;
switch (property_id)
{
case PROP_FLAGS:
self->priv->flags = g_value_get_flags(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
}
static void g_test_dbus_class_init(GTestDBusClass* klass)
{
GObjectClass* object_class = G_OBJECT_CLASS(klass);
object_class->dispose = g_test_dbus_dispose;
object_class->finalize = g_test_dbus_finalize;
object_class->get_property = g_test_dbus_get_property;
object_class->set_property = g_test_dbus_set_property;
/**
* GTestDBus:flags:
*
* #GTestDBusFlags specifying the behaviour of the D-Bus session.
*
* Since: 2.34
*/
g_object_class_install_property(
object_class, PROP_FLAGS,
g_param_spec_flags(
"flags", P_("D-Bus session flags"),
P_("Flags specifying the behaviour of the D-Bus session"),
G_TYPE_TEST_DBUS_FLAGS, G_TEST_DBUS_NONE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
}
static gchar* write_config_file(GTestDBus* self)
{
GString* contents;
gint fd;
guint i;
GError* error = NULL;
gchar* path = NULL;
fd = g_file_open_tmp("g-test-dbus-XXXXXX", &path, &error);
g_assert_no_error(error);
contents = g_string_new(NULL);
g_string_append(contents, "<busconfig>\n"
" <type>session</type>\n"
#ifdef G_OS_WIN32
" <listen>nonce-tcp:</listen>\n"
#else
" <listen>unix:tmpdir=/tmp</listen>\n"
#endif
);
for (i = 0; i < self->priv->service_dirs->len; i++)
{
const gchar* dir_path = g_ptr_array_index(self->priv->service_dirs, i);
g_string_append_printf(contents, " <servicedir>%s</servicedir>\n",
dir_path);
}
g_string_append(contents,
" <policy context=\"default\">\n"
" <!-- Allow everything to be sent -->\n"
" <allow send_destination=\"*\" eavesdrop=\"true\"/>\n"
" <!-- Allow everything to be received -->\n"
" <allow eavesdrop=\"true\"/>\n"
" <!-- Allow anyone to own anything -->\n"
" <allow own=\"*\"/>\n"
" </policy>\n"
"</busconfig>\n");
close(fd);
g_file_set_contents(path, contents->str, contents->len, &error);
g_assert_no_error(error);
g_string_free(contents, TRUE);
return path;
}
static void start_daemon(GTestDBus* self)
{
const gchar* argv[] = {"dbus-daemon", "--print-address",
"--config-file=foo", NULL};
gchar* config_path;
gchar* config_arg;
GIOChannel* channel;
gint stdout_fd2;
gsize termpos;
GError* error = NULL;
if (g_getenv("G_TEST_DBUS_DAEMON") != NULL)
argv[0] = (gchar*)g_getenv("G_TEST_DBUS_DAEMON");
/* Write config file and set its path in argv */
config_path = write_config_file(self);
config_arg = g_strdup_printf("--config-file=%s", config_path);
argv[2] = config_arg;
/* Spawn dbus-daemon */
g_spawn_async_with_pipes(NULL, (gchar**)argv, NULL,
#ifdef G_OS_WIN32
/* We Need this to get the pid returned on win32 */
G_SPAWN_DO_NOT_REAP_CHILD |
#endif
G_SPAWN_SEARCH_PATH,
NULL, NULL, &self->priv->bus_pid, NULL,
&self->priv->bus_stdout_fd, NULL, &error);
g_assert_no_error(error);
_g_test_watcher_add_pid(self->priv->bus_pid);
/* Read bus address from daemon' stdout. We have to be careful to avoid
* closing the FD, as it is passed to any D-Bus service activated processes,
* and if we close it, they will get a SIGPIPE and die when they try to
* write to their stdout. */
stdout_fd2 = dup(self->priv->bus_stdout_fd);
g_assert_cmpint(stdout_fd2, >=, 0);
channel = g_io_channel_unix_new(stdout_fd2);
g_io_channel_read_line(channel, &self->priv->bus_address, NULL, &termpos,
&error);
g_assert_no_error(error);
self->priv->bus_address[termpos] = '\0';
/* start dbus-monitor */
if (g_getenv("G_DBUS_MONITOR") != NULL)
{
gchar* command;
command = g_strdup_printf("dbus-monitor --address %s",
self->priv->bus_address);
g_spawn_command_line_async(command, NULL);
g_free(command);
g_usleep(500 * 1000);
}
/* Cleanup */
g_io_channel_shutdown(channel, FALSE, &error);
g_assert_no_error(error);
g_io_channel_unref(channel);
/* Don't use g_file_delete since it calls into gvfs */
if (g_unlink(config_path) != 0)
g_assert_not_reached();
g_free(config_path);
g_free(config_arg);
}
static void stop_daemon(GTestDBus* self)
{
#ifdef G_OS_WIN32
if (!TerminateProcess(self->priv->bus_pid, 0))
g_warning("Can't terminate process: %s",
g_win32_error_message(GetLastError()));
#else
kill(self->priv->bus_pid, SIGTERM);
#endif
_g_test_watcher_remove_pid(self->priv->bus_pid);
g_spawn_close_pid(self->priv->bus_pid);
self->priv->bus_pid = 0;
close(self->priv->bus_stdout_fd);
self->priv->bus_stdout_fd = -1;
g_free(self->priv->bus_address);
self->priv->bus_address = NULL;
}
/**
* g_test_dbus_new:
* @flags: a #GTestDBusFlags
*
* Create a new #GTestDBus object.
*
* Returns: (transfer full): a new #GTestDBus.
*/
GTestDBus* g_test_dbus_new(GTestDBusFlags flags)
{
return g_object_new(G_TYPE_TEST_DBUS, "flags", flags, NULL);
}
/**
* g_test_dbus_get_flags:
* @self: a #GTestDBus
*
* Get the flags of the #GTestDBus object.
*
* Returns: the value of #GTestDBus:flags property
*/
GTestDBusFlags g_test_dbus_get_flags(GTestDBus* self)
{
g_return_val_if_fail(G_IS_TEST_DBUS(self), G_TEST_DBUS_NONE);
return self->priv->flags;
}
/**
* g_test_dbus_get_bus_address:
* @self: a #GTestDBus
*
* Get the address on which dbus-daemon is running. If g_test_dbus_up() has not
* been called yet, %NULL is returned. This can be used with
* g_dbus_connection_new_for_address().
*
* Returns: (nullable): the address of the bus, or %NULL.
*/
const gchar* g_test_dbus_get_bus_address(GTestDBus* self)
{
g_return_val_if_fail(G_IS_TEST_DBUS(self), NULL);
return self->priv->bus_address;
}
/**
* g_test_dbus_add_service_dir:
* @self: a #GTestDBus
* @path: path to a directory containing .service files
*
* Add a path where dbus-daemon will look up .service files. This can't be
* called after g_test_dbus_up().
*/
void g_test_dbus_add_service_dir(GTestDBus* self, const gchar* path)
{
g_return_if_fail(G_IS_TEST_DBUS(self));
g_return_if_fail(self->priv->bus_address == NULL);
g_ptr_array_add(self->priv->service_dirs, g_strdup(path));
}
/**
* g_test_dbus_up:
* @self: a #GTestDBus
*
* Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
* call, it is safe for unit tests to start sending messages on the session bus.
*
* If this function is called from setup callback of g_test_add(),
* g_test_dbus_down() must be called in its teardown callback.
*
* If this function is called from unit test's main(), then g_test_dbus_down()
* must be called after g_test_run().
*/
void g_test_dbus_up(GTestDBus* self)
{
g_return_if_fail(G_IS_TEST_DBUS(self));
g_return_if_fail(self->priv->bus_address == NULL);
g_return_if_fail(!self->priv->up);
start_daemon(self);
g_test_dbus_unset();
g_setenv("DBUS_SESSION_BUS_ADDRESS", self->priv->bus_address, TRUE);
self->priv->up = TRUE;
}
/**
* g_test_dbus_stop:
* @self: a #GTestDBus
*
* Stop the session bus started by g_test_dbus_up().
*
* Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
* singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
* tests wanting to verify behaviour after the session bus has been stopped
* can use this function but should still call g_test_dbus_down() when done.
*/
void g_test_dbus_stop(GTestDBus* self)
{
g_return_if_fail(G_IS_TEST_DBUS(self));
g_return_if_fail(self->priv->bus_address != NULL);
stop_daemon(self);
}
/**
* g_test_dbus_down:
* @self: a #GTestDBus
*
* Stop the session bus started by g_test_dbus_up().
*
* This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
* is destroyed. This is done to ensure that the next unit test won't get a
* leaked singleton from this test.
*/
void g_test_dbus_down(GTestDBus* self)
{
GDBusConnection* connection;
g_return_if_fail(G_IS_TEST_DBUS(self));
g_return_if_fail(self->priv->up);
connection = _g_bus_get_singleton_if_exists(G_BUS_TYPE_SESSION);
if (connection != NULL)
g_dbus_connection_set_exit_on_close(connection, FALSE);
if (self->priv->bus_address != NULL)
stop_daemon(self);
if (connection != NULL)
_g_object_dispose_and_wait_weak_notify(connection);
g_test_dbus_unset();
_g_bus_forget_singleton(G_BUS_TYPE_SESSION);
self->priv->up = FALSE;
}
/**
* g_test_dbus_unset:
*
* Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
* won't use user's session bus.
*
* This is useful for unit tests that want to verify behaviour when no session
* bus is running. It is not necessary to call this if unit test already calls
* g_test_dbus_up() before acquiring the session bus.
*/
void g_test_dbus_unset(void)
{
g_unsetenv("DISPLAY");
g_unsetenv("DBUS_SESSION_BUS_ADDRESS");
g_unsetenv("DBUS_STARTER_ADDRESS");
g_unsetenv("DBUS_STARTER_BUS_TYPE");
/* avoid using XDG_RUNTIME_DIR/bus */
g_unsetenv("XDG_RUNTIME_DIR");
}
| 29.129743 | 96 | 0.648473 | [
"object"
] |
cfee6dd9fb4409d49685cc57f1da05a220893a60 | 4,912 | h | C | src/condor_starter.V6.1/local_user_log.h | final-israel/htcondor | d3bdad3136de345366761664ecd12b615d33e6a0 | [
"Apache-2.0"
] | null | null | null | src/condor_starter.V6.1/local_user_log.h | final-israel/htcondor | d3bdad3136de345366761664ecd12b615d33e6a0 | [
"Apache-2.0"
] | null | null | null | src/condor_starter.V6.1/local_user_log.h | final-israel/htcondor | d3bdad3136de345366761664ecd12b615d33e6a0 | [
"Apache-2.0"
] | null | null | null | /***************************************************************
*
* Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* 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 !defined(_CONDOR_LOCAL_USER_LOG_H)
#define _CONDOR_LOCAL_USER_LOG_H
#include "condor_daemon_core.h"
#include "condor_classad.h"
#include "condor_attributes.h"
#include "write_user_log.h"
/**
This class is used by the starter to maintain a local user log
file for a job that runs under its control. Each
JobInfoCommunicator has a pointer to one of these, and if the job
wants it for whatever reason, a LocalUserLog object is
instantiated, and anytime the shadow would be writing a userlog
event for this job, we do so here, too.
*/
/*
Since JobInfoCommunicator and LocalUserLog each have a pointer to
each other, the include files can't both include the other without
trouble. So, we just declare the class here, instead of including
job_info_communicator.h, and everything is happy.
*/
class JobInfoCommunicator;
class LocalUserLog : public Service {
public:
/// Constructor
LocalUserLog( JobInfoCommunicator* my_jic );
/// Destructor
~LocalUserLog();
// // // // // // // // // // // //
// Initialization
// // // // // // // // // // // //
/** Initialize ourselves with the info in the given job ad.
If starter_ulog=true, then we will write to the log file
given by ATTR_STARTER_ULOG_FILE.
If starter_ulog=false, then we will write to the user,
dagman, and global event logs as part of the local universe.
*/
bool initFromJobAd( ClassAd* ad, bool starter_ulog = true );
/// Do we want to be writing a log or not?
bool wantsLog( void ) { return should_log; };
// // // // // // // // // // // //
// Writing Events
// // // // // // // // // // // //
/** Log an execute event for this job. */
bool logExecute( ClassAd* ad );
/** Log a suspend event for this job.
@param ad ClassAd containing the info we need for the
event (which is what the JIC would be sending to the
controller in some way)
*/
bool logSuspend( ClassAd* ad );
/** Log a continue event for this job.
*/
bool logContinue( ClassAd* ad );
/** Log a checkpoint event for this job.
*/
bool logCheckpoint( ClassAd* ad );
/** Log an event about a fatal starter error
*/
bool logStarterError( const char* err_msg, bool critical );
/** Since whenever a job exits, we want to do the same checks
on the exit reason to decide what kind of event (terminate
or evict) to log, everyone can just call this method,
which will check the exit_reason and try to log the
appropriate event for you.
*/
bool logJobExit( ClassAd* ad, int exit_reason );
/** Log a terminate event for this job.
*/
bool logTerminate( ClassAd* ad );
/** Log an evict event for this job.
@param ad ClassAd containing the info we need for the
event (which is what the JIC would be sending to the
controller in some way)
@param checkpointed did this job checkpoint or not?
*/
bool logEvict( ClassAd* ad, bool checkpointed );
/**
* Writes an EVICT event to the user log with the requeue flag
* set to true. We will stuff information about why the job
* exited into the event object, such as the exit signal.
*
* @param ad - the job to update the user log for
* @param checkpointed - whether the job was checkpointed or not
**/
bool logRequeueEvent( ClassAd* ad, bool checkpointed );
private:
// // // // // // // // // // // //
// Private helper methods
// // // // // // // // // // // //
/** Since both logTerminate() and logEvict() want to include
rusage information, we have a shared helper function to
pull the relevent ClassAd attributes out of the ad and to
initialize an rusage structure.
*/
struct rusage getRusageFromAd( ClassAd* ad );
// // // // // // // // // // // //
// Private data members
// // // // // // // // // // // //
/// Pointer to the jic for this LocalUserLog object.
JobInfoCommunicator* jic;
/// Have we been initialized yet?
bool is_initialized;
/// Should we do logging?
bool should_log;
/// The actual UserLog object we're using to write events.
WriteUserLog u_log;
};
#endif /* _CONDOR_LOCAL_USER_LOG_H */
| 30.7 | 75 | 0.655537 | [
"object"
] |
cff642c4a92ec8380c29bad43a3892cb467ddad8 | 5,649 | h | C | src/CCA/Components/Arches/SourceTerms/SourceTermBase.h | abagusetty/Uintah | fa1bf819664fa6f09c5a7cd076870a40816d35c9 | [
"MIT"
] | 2 | 2021-12-17T05:50:44.000Z | 2021-12-22T21:37:32.000Z | src/CCA/Components/Arches/SourceTerms/SourceTermBase.h | abagusetty/Uintah | fa1bf819664fa6f09c5a7cd076870a40816d35c9 | [
"MIT"
] | null | null | null | src/CCA/Components/Arches/SourceTerms/SourceTermBase.h | abagusetty/Uintah | fa1bf819664fa6f09c5a7cd076870a40816d35c9 | [
"MIT"
] | 1 | 2020-11-30T04:46:05.000Z | 2020-11-30T04:46:05.000Z | #ifndef Uintah_Component_Arches_SourceTermBase_h
#define Uintah_Component_Arches_SourceTermBase_h
#include <CCA/Components/Arches/ArchesMaterial.h>
#include <CCA/Components/Arches/ChemMix/ChemHelper.h>
#include <CCA/Ports/Scheduler.h>
#include <Core/Exceptions/InvalidValue.h>
#include <Core/GeometryPiece/GeometryPiece.h>
#include <Core/GeometryPiece/GeometryPieceFactory.h>
#include <Core/Grid/Box.h>
#include <Core/Grid/GridP.h>
#include <Core/Grid/MaterialManager.h>
#include <Core/Grid/MaterialManagerP.h>
#include <Core/Grid/Variables/CCVariable.h>
#include <Core/Grid/Variables/SFCXVariable.h>
#include <Core/Grid/Variables/SFCYVariable.h>
#include <Core/Grid/Variables/SFCZVariable.h>
#include <Core/Grid/Variables/VarTypes.h>
#include <Core/Parallel/Parallel.h>
#include <Core/ProblemSpec/ProblemSpec.h>
#include <typeinfo>
//===============================================================
/**
* @class SourceTermBase
* @author Jeremy Thornock
* @date Nov, 5 2008
*
* @brief A base class for source terms for a transport
* equation.
*
*/
namespace Uintah {
class BoundaryCondition;
class TableLookup;
class WBCHelper;
class SourceTermBase{
public:
SourceTermBase( std::string srcName, MaterialManagerP& materialManager,
std::vector<std::string> reqLabelNames, std::string type );
virtual ~SourceTermBase();
/** @brief Indicates the var type of source this is **/
enum MY_GRID_TYPE {CC_SRC, CCVECTOR_SRC, FX_SRC, FY_SRC, FZ_SRC};
/** @brief Input file interface */
virtual void problemSetup(const ProblemSpecP& db) = 0;
/** @brief Returns a list of required variables from the DW for scheduling */
//virtual void getDwVariableList() = 0;
/** @brief Schedule the source for computation. */
virtual void sched_computeSource(const LevelP& level, SchedulerP& sched, int timeSubStep ) = 0;
/** @brief Actually compute the source. */
virtual void computeSource( const ProcessorGroup* pc,
const PatchSubset* patches,
const MaterialSubset* matls,
DataWarehouse* old_dw,
DataWarehouse* new_dw,
int timeSubStep ) = 0;
/** @brief Initialize variables. */
virtual void sched_initialize( const LevelP& level, SchedulerP& sched ) = 0;
/** @brief Initialize variables during a restart */
virtual void sched_restartInitialize( const LevelP& level, SchedulerP& sched ){};
// An optional call for the application to check their reduction vars.
virtual void checkReductionVars( const ProcessorGroup * pg,
const PatchSubset * patches,
const MaterialSubset * matls,
DataWarehouse * old_dw,
DataWarehouse * new_dw ) {};
/** @brief Work to be performed after properties are setup */
virtual void extraSetup( GridP& grid, BoundaryCondition* bc, TableLookup* table_lookup ){ }
/** @brief Returns a list of any extra local labels this source may compute **/
inline const std::vector<const VarLabel*> getExtraLocalLabels(){
return _extra_local_labels; }
/** @brief Return the grid type of source (CC, FCX, etc... ) **/
inline MY_GRID_TYPE getSourceGridType(){ return _source_grid_type; }
/** @brief Return the type of source (constant, do_radation, etc... ) **/
inline std::string getSourceType(){ return _type; }
/** @brief Return an int indicating the stage this source should be executed **/
int stage_compute() const { return _stage; }
/** @brief Set the stage number **/
void set_stage( const int stage );
/** @brief Builder class containing instructions on how to build the property model **/
class Builder {
public:
virtual ~Builder() {}
virtual SourceTermBase* build() = 0;
protected:
std::string _name;
std::string _type;
};
/** @brief In the case where a source base returns multiple sources, this returns that list.
This is a limiting case with the current abstraction. **/
std::vector<std::string>& get_all_src_names(){ return _mult_srcs; }
void set_bcHelper( WBCHelper* helper ){
m_bcHelper = helper;
}
protected:
std::string _src_name; ///< User assigned source name
std::vector<std::string> _mult_srcs; ///< If a source produces multiple labels, this vector holds the name of each.
std::string _init_type; ///< Initialization type.
std::string _type; ///< Source type (eg, constant, westbrook dryer, .... )
bool _compute_me; ///< To indicate if calculating this source is needed or has already been computed.
const VarLabel* _src_label; ///< Source varlabel
const VarLabel* _simulationTimeLabel;
int _stage; ///< At which stage should this be computed: 0) before table lookup 1) after table lookup 2) after RK ave
MaterialManagerP& _materialManager; ///< Local copy of materialManager
std::vector<std::string> _required_labels; ///< Vector of required labels
std::vector<const VarLabel*> _extra_local_labels; ///< Extra labels that might be useful for storage
MY_GRID_TYPE _source_grid_type; ///< Source grid type
TableLookup* _table_lookup;
WBCHelper* m_bcHelper;
}; // end SourceTermBase
} // end namespace Uintah
#endif
| 37.912752 | 163 | 0.642946 | [
"vector",
"model"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.