hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 588
values | lang stringclasses 305
values | max_stars_repo_path stringlengths 3 363 | max_stars_repo_name stringlengths 5 118 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringdate 2015-01-01 00:00:35 2022-03-31 23:43:49 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 12:37:38 2022-03-31 23:59:52 ⌀ | max_issues_repo_path stringlengths 3 363 | max_issues_repo_name stringlengths 5 118 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count float64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 363 | max_forks_repo_name stringlengths 5 135 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringdate 2015-01-01 00:01:02 2022-03-31 23:27:27 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 08:55:07 2022-03-31 23:59:24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1.13 1.04M | max_line_length int64 1 1.05M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d0576abd731ed0e8f77a924aac6e6347615d51e5 | 693 | c | C | dovecot-2.2.33.2/src/imap/cmd-id.c | NicoleRobin/dovecot | f971413537673e781c00808bc039fde5749fcc95 | [
"MIT"
] | null | null | null | dovecot-2.2.33.2/src/imap/cmd-id.c | NicoleRobin/dovecot | f971413537673e781c00808bc039fde5749fcc95 | [
"MIT"
] | null | null | null | dovecot-2.2.33.2/src/imap/cmd-id.c | NicoleRobin/dovecot | f971413537673e781c00808bc039fde5749fcc95 | [
"MIT"
] | null | null | null | /* Copyright (c) 2008-2017 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "imap-id.h"
bool cmd_id(struct client_command_context *cmd)
{
const struct imap_settings *set = cmd->client->set;
const struct imap_arg *args;
const char *value;
if (!client_read_args(cmd, 0, 0, &args))
return FALSE;
if (!cmd->client->id_logged) {
cmd->client->id_logged = TRUE;
value = imap_id_args_get_log_reply(args, set->imap_id_log);
if (value != NULL)
i_info("ID sent: %s", value);
}
client_send_line(cmd->client, t_strdup_printf(
"* ID %s", imap_id_reply_generate(set->imap_id_send)));
client_send_tagline(cmd, "OK ID completed.");
return TRUE;
}
| 24.75 | 76 | 0.705628 |
fde29cb2911b5adc376d585f5c3865198a4807df | 9,699 | c | C | MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c | DK519/DK_Project | b562574ba2d223aff5dd3f3c3260ee1f9905e735 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 1 | 2019-04-28T16:32:26.000Z | 2019-04-28T16:32:26.000Z | MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c | DK519/DK_Project | b562574ba2d223aff5dd3f3c3260ee1f9905e735 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | null | null | null | MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c | DK519/DK_Project | b562574ba2d223aff5dd3f3c3260ee1f9905e735 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | null | null | null | /** @file
Brotli Decompress interfaces
Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <BrotliDecompressLibInternal.h>
/**
Dummy malloc function for compiler.
**/
VOID *
BrDummyMalloc (
IN size_t Size
)
{
ASSERT (FALSE);
return NULL;
}
/**
Dummy free function for compiler.
**/
VOID
BrDummyFree (
IN VOID * Ptr
)
{
ASSERT (FALSE);
}
/**
Allocation routine used by BROTLI decompression.
@param Ptr Pointer to the BROTLI_BUFF instance.
@param Size The size in bytes to be allocated.
@return The allocated pointer address, or NULL on failure
**/
VOID *
BrAlloc (
IN VOID * Ptr,
IN size_t Size
)
{
VOID *Addr;
BROTLI_BUFF *Private;
Private = (BROTLI_BUFF *)Ptr;
if (Private->BuffSize >= Size) {
Addr = Private->Buff;
Private->Buff = (VOID *) ((UINT8 *)Addr + Size);
Private->BuffSize -= Size;
return Addr;
} else {
ASSERT (FALSE);
return NULL;
}
}
/**
Free routine used by BROTLI decompression.
@param Ptr Pointer to the BROTLI_BUFF instance
@param Address The address to be freed
**/
VOID
BrFree (
IN VOID * Ptr,
IN VOID * Address
)
{
//
// We use the 'scratch buffer' for allocations, so there is no free
// operation required. The scratch buffer will be freed by the caller
// of the decompression code.
//
}
/**
Decompresses a Brotli compressed source buffer.
Extracts decompressed data to its original form.
If the compressed source data specified by Source is successfully decompressed
into Destination, then EFI_SUCCESS is returned. If the compressed source data
specified by Source is not in a valid compressed data format,
then EFI_INVALID_PARAMETER is returned.
@param Source The source buffer containing the compressed data.
@param SourceSize The size of source buffer.
@param Destination The destination buffer to store the decompressed data.
@param DestSize The destination buffer size.
@param BuffInfo The pointer to the BROTLI_BUFF instance.
@retval EFI_SUCCESS Decompression completed successfully, and
the uncompressed buffer is returned in Destination.
@retval EFI_INVALID_PARAMETER
The source buffer specified by Source is corrupted
(not in a valid compressed format).
**/
EFI_STATUS
BrotliDecompress (
IN CONST VOID* Source,
IN UINTN SourceSize,
IN OUT VOID* Destination,
IN OUT UINTN DestSize,
IN VOID * BuffInfo
)
{
UINT8 * Input;
UINT8 * Output;
const UINT8 * NextIn;
UINT8 * NextOut;
size_t TotalOut;
size_t AvailableIn;
size_t AvailableOut;
VOID * Temp;
BrotliDecoderResult Result;
BrotliDecoderState * BroState;
TotalOut = 0;
AvailableOut = FILE_BUFFER_SIZE;
Result = BROTLI_DECODER_RESULT_ERROR;
BroState = BrotliDecoderCreateInstance(BrAlloc, BrFree, BuffInfo);
Temp = Destination;
if (BroState == NULL) {
return EFI_INVALID_PARAMETER;
}
Input = (UINT8 *)BrAlloc(BuffInfo, FILE_BUFFER_SIZE);
Output = (UINT8 *)BrAlloc(BuffInfo, FILE_BUFFER_SIZE);
if ((Input==NULL) || (Output==NULL)) {
BrFree(BuffInfo, Input);
BrFree(BuffInfo, Output);
BrotliDecoderDestroyInstance(BroState);
return EFI_INVALID_PARAMETER;
}
NextOut = Output;
Result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT;
while (1) {
if (Result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {
if (SourceSize == 0) {
break;
}
if (SourceSize >= FILE_BUFFER_SIZE) {
AvailableIn = FILE_BUFFER_SIZE;
}else{
AvailableIn = SourceSize;
}
CopyMem(Input, Source, AvailableIn);
Source = (VOID *)((UINT8 *)Source + AvailableIn);
SourceSize -= AvailableIn;
NextIn = Input;
} else if (Result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
CopyMem(Temp, Output, FILE_BUFFER_SIZE);
AvailableOut = FILE_BUFFER_SIZE;
Temp = (VOID *)((UINT8 *)Temp +FILE_BUFFER_SIZE);
NextOut = Output;
} else {
break; /* Error or success. */
}
Result = BrotliDecoderDecompressStream(
BroState,
&AvailableIn,
&NextIn,
&AvailableOut,
&NextOut,
&TotalOut
);
}
if (NextOut != Output) {
CopyMem(Temp, Output, (size_t)(NextOut - Output));
}
DestSize = TotalOut;
BrFree(BuffInfo, Input);
BrFree(BuffInfo, Output);
BrotliDecoderDestroyInstance(BroState);
return (Result == BROTLI_DECODER_RESULT_SUCCESS) ? EFI_SUCCESS : EFI_INVALID_PARAMETER;
}
/**
Get the size of the uncompressed buffer by parsing EncodeData header.
@param EncodedData Pointer to the compressed data.
@param StartOffset Start offset of the compressed data.
@param EndOffset End offset of the compressed data.
@return The size of the uncompressed buffer.
**/
UINT64
BrGetDecodedSizeOfBuf(
IN UINT8 * EncodedData,
IN UINT8 StartOffset,
IN UINT8 EndOffset
)
{
UINT64 DecodedSize;
INTN Index;
/* Parse header */
DecodedSize = 0;
for (Index = EndOffset - 1; Index >= StartOffset; Index--)
DecodedSize = LShiftU64(DecodedSize, 8) + EncodedData[Index];
return DecodedSize;
}
/**
Given a Brotli compressed source buffer, this function retrieves the size of
the uncompressed buffer and the size of the scratch buffer required
to decompress the compressed source buffer.
Retrieves the size of the uncompressed buffer and the temporary scratch buffer
required to decompress the buffer specified by Source and SourceSize.
The size of the uncompressed buffer is returned in DestinationSize,
the size of the scratch buffer is returned in ScratchSize, and EFI_SUCCESS is returned.
This function does not have scratch buffer available to perform a thorough
checking of the validity of the source data. It just retrieves the "Original Size"
field from the BROTLI_SCRATCH_MAX beginning bytes of the source data and output it as DestinationSize.
And ScratchSize is specific to the decompression implementation.
If SourceSize is less than BROTLI_SCRATCH_MAX, then ASSERT().
@param Source The source buffer containing the compressed data.
@param SourceSize The size, in bytes, of the source buffer.
@param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer
that will be generated when the compressed buffer specified
by Source and SourceSize is decompressed.
@param ScratchSize A pointer to the size, in bytes, of the scratch buffer that
is required to decompress the compressed buffer specified
by Source and SourceSize.
@retval EFI_SUCCESS The size of the uncompressed data was returned
in DestinationSize and the size of the scratch
buffer was returned in ScratchSize.
**/
EFI_STATUS
EFIAPI
BrotliUefiDecompressGetInfo (
IN CONST VOID * Source,
IN UINT32 SourceSize,
OUT UINT32 * DestinationSize,
OUT UINT32 * ScratchSize
)
{
UINT64 GetSize;
UINT8 MaxOffset;
ASSERT(SourceSize >= BROTLI_SCRATCH_MAX);
MaxOffset = BROTLI_DECODE_MAX;
GetSize = BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);
*DestinationSize = (UINT32)GetSize;
MaxOffset = BROTLI_SCRATCH_MAX;
GetSize = BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);
*ScratchSize = (UINT32)GetSize;
return EFI_SUCCESS;
}
/**
Decompresses a Brotli compressed source buffer.
Extracts decompressed data to its original form.
If the compressed source data specified by Source is successfully decompressed
into Destination, then RETURN_SUCCESS is returned. If the compressed source data
specified by Source is not in a valid compressed data format,
then RETURN_INVALID_PARAMETER is returned.
@param Source The source buffer containing the compressed data.
@param SourceSize The size of source buffer.
@param Destination The destination buffer to store the decompressed data
@param Scratch A temporary scratch buffer that is used to perform the decompression.
This is an optional parameter that may be NULL if the
required scratch buffer size is 0.
@retval EFI_SUCCESS Decompression completed successfully, and
the uncompressed buffer is returned in Destination.
@retval EFI_INVALID_PARAMETER
The source buffer specified by Source is corrupted
(not in a valid compressed format).
**/
EFI_STATUS
EFIAPI
BrotliUefiDecompress (
IN CONST VOID * Source,
IN UINTN SourceSize,
IN OUT VOID * Destination,
IN OUT VOID * Scratch
)
{
UINTN DestSize = 0;
EFI_STATUS Status;
BROTLI_BUFF BroBuff;
UINT64 GetSize;
UINT8 MaxOffset;
MaxOffset = BROTLI_SCRATCH_MAX;
GetSize = BrGetDecodedSizeOfBuf((UINT8 *)Source, MaxOffset - BROTLI_INFO_SIZE, MaxOffset);
BroBuff.Buff = Scratch;
BroBuff.BuffSize = (UINTN)GetSize;
Status = BrotliDecompress(
(VOID *)((UINT8 *)Source + BROTLI_SCRATCH_MAX),
SourceSize - BROTLI_SCRATCH_MAX,
Destination,
DestSize,
(VOID *)(&BroBuff)
);
return Status;
}
| 30.596215 | 104 | 0.669141 |
650dff338b428c2bd070af1338109fcd4d2e1cae | 1,282 | h | C | frameworks/include/battery_framework.h | openharmony-sig-ci/powermgr_battery_lite | 2c2d5504c409e960ebb308399eb254329b6ce9f1 | [
"Apache-2.0"
] | null | null | null | frameworks/include/battery_framework.h | openharmony-sig-ci/powermgr_battery_lite | 2c2d5504c409e960ebb308399eb254329b6ce9f1 | [
"Apache-2.0"
] | null | null | null | frameworks/include/battery_framework.h | openharmony-sig-ci/powermgr_battery_lite | 2c2d5504c409e960ebb308399eb254329b6ce9f1 | [
"Apache-2.0"
] | 1 | 2021-09-13T12:10:43.000Z | 2021-09-13T12:10:43.000Z | /*
* Copyright (c) 2021 Huawei Device 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 BATTERY_FRAMEWORK_H
#define BATTERY_FRAMEWORK_H
#include <iunknown.h>
#include <samgr_lite.h>
#include "battery_info.h"
#include "battery_mgr.h"
#include "batterymgr_intf_define.h"
#include "hilog_wrapper.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
static inline IUnknown *GetBatteryIUnknown(void)
{
IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(BATTERY_SERVICE, BATTERY_INNER);
if (iUnknown == NULL) {
POWER_HILOGE("[SERVICE:%s]:BatteryClient::ChargingApiGet iUnknown is null", BATTERY_SERVICE);
return NULL;
}
return iUnknown;
}
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // BATTERY_FRAMEWORK_H | 29.813953 | 101 | 0.73791 |
c8fb07dfdc797ad3b501232145b00fcb947eb607 | 13,111 | c | C | src/virtio/virtqueue.c | jsultond/nanos | 8668a362343243641ca019661ae46ccb36c68851 | [
"Apache-2.0"
] | null | null | null | src/virtio/virtqueue.c | jsultond/nanos | 8668a362343243641ca019661ae46ccb36c68851 | [
"Apache-2.0"
] | null | null | null | src/virtio/virtqueue.c | jsultond/nanos | 8668a362343243641ca019661ae46ccb36c68851 | [
"Apache-2.0"
] | null | null | null | /*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice unmodified, this list of conditions, and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <kernel.h>
#include <page.h>
#include "virtio_internal.h"
//#define VIRTQUEUE_DEBUG
//#define VIRTQUEUE_DEBUG_VERBOSE
#ifdef VIRTQUEUE_DEBUG
# define virtqueue_debug rprintf
#else
# define virtqueue_debug(...) do { } while(0)
#endif // defined(VIRTQUEUE_DEBUG)
#ifdef VIRTQUEUE_DEBUG_VERBOSE
# define virtqueue_debug_verbose rprintf
#else
# define virtqueue_debug_verbose(...) do { } while(0)
#endif // defined(VIRTQUEUE_DEBUG_VERBOSE)
#define VQ_RING_DESC_CHAIN_END 32768
#define VRING_DESC_F_NEXT 1
#define VRING_DESC_F_WRITE 2
#define VRING_DESC_F_INDIRECT 4
/* shared with vqmsg with next unused */
struct vring_desc {
u64 busaddr; /* phys for now */
u32 len;
u16 flags;
u16 next;
} __attribute__((packed));
struct vring_avail {
u16 flags;
u16 idx;
u16 ring[0];
} __attribute__((packed));
struct vring_used_elem {
/* Index of start of used descriptor chain. */
u32 id;
/* Total length of the descriptor chain which was written to. */
u32 len;
};
struct vring_used {
u16 flags;
u16 idx;
struct vring_used_elem ring[0];
} __attribute__((packed));
typedef struct vqmsg {
struct list l; /* vq->msgqueue when queued, or chained for bh process */
union {
u64 count; /* descriptor count when queued */
u64 len; /* length on return */
};
buffer descv; /* XXX should be a variable stride vector */
vqfinish completion;
} *vqmsg;
typedef struct virtqueue {
vtdev dev;
const char *name;
u16 entries;
u16 queue_index;
bytes notify_offset;
void *ring_mem;
bytes avail_offset;
bytes used_offset;
volatile struct vring_desc *desc;
volatile struct vring_avail *avail;
volatile struct vring_used *used;
u64 free_cnt; /* atomic */
u16 desc_idx; /* head of descriptor free list */
u16 last_used_idx; /* irq only */
int max_queued;
struct list msgqueue;
queue servicequeue;
thunk service;
struct spinlock fill_lock; /* XXX - tmp hack for smp */
vqmsg msgs[0];
} *virtqueue;
/* Most uses here are a chain of 3 or less descriptors. */
#define VQMSG_DEFAULT_SIZE 3
vqmsg allocate_vqmsg(virtqueue vq)
{
heap h = vq->dev->general;
vqmsg m = allocate(h, sizeof(struct vqmsg));
list_init(&m->l);
m->count = 0;
m->descv = allocate_buffer(h, sizeof(struct vring_desc) * VQMSG_DEFAULT_SIZE);
if (m->descv == INVALID_ADDRESS) {
deallocate(h, m, sizeof(struct vqmsg));
return INVALID_ADDRESS;
}
m->completion = 0; /* fill on queue */
return m;
}
void deallocate_vqmsg(virtqueue vq, vqmsg m)
{
deallocate_buffer(m->descv);
deallocate(vq->dev->general, m, sizeof(struct vqmsg));
}
void vqmsg_push(virtqueue vq, vqmsg m, void * addr, u32 len, boolean write)
{
buffer_extend(m->descv, (m->count + 1) * sizeof(struct vring_desc));
struct vring_desc * d = buffer_ref(m->descv, m->count * sizeof(struct vring_desc));
d->busaddr = physical_from_virtual(addr);
d->len = len;
d->flags = write ? VRING_DESC_F_WRITE : 0;
d->next = 0;
m->count++;
}
static void virtqueue_fill(virtqueue vq);
void vqmsg_commit(virtqueue vq, vqmsg m, vqfinish completion)
{
m->completion = completion;
/* XXX noirq */
list_push_back(&vq->msgqueue, &m->l);
virtqueue_fill(vq);
}
closure_function(1, 0, void, vq_interrupt,
virtqueue, vq)
{
// ensure we see up-to-date used->idx (updated by host)
memory_barrier();
virtqueue vq = bound(vq);
virtqueue_debug_verbose("%s: ENTRY: vq %s: entries %d, last_used_idx %d, used->idx %d, desc_idx %d\n",
__func__, vq->name, vq->entries, vq->last_used_idx, vq->used->idx, vq->desc_idx);
int processed = 0;
struct list q;
list_init(&q);
spin_lock(&vq->fill_lock);
while (vq->last_used_idx != vq->used->idx) {
volatile struct vring_used_elem *uep = vq->used->ring + (vq->last_used_idx & (vq->entries - 1));
virtqueue_debug_verbose("%s: vq %s: last_used_idx %d, id %d, len %d\n",
__func__, vq->name, vq->last_used_idx, uep->id, uep->len);
u16 head = uep->id;
vqmsg m = vq->msgs[head];
/* return descriptor(s) to free list */
int dcount = 1;
volatile struct vring_desc *d = vq->desc + head;
while ((d->flags & VRING_DESC_F_NEXT)) {
d = vq->desc + d->next;
dcount++;
}
assert(dcount == m->count);
d->next = vq->desc_idx;
vq->desc_idx = head;
vq->last_used_idx++;
processed++;
fetch_and_add(&vq->free_cnt, m->count);
m->len = uep->len;
vq->msgs[head] = 0;
virtqueue_debug("add msg %p\n", m);
list_insert_before(&q, &m->l);
}
spin_unlock(&vq->fill_lock);
if (processed > 0) {
/* a little trick ... collapse the list head for queueing */
list l = list_get_next(&q);
assert(l);
list_delete(&q);
assert(enqueue(vq->servicequeue, l));
enqueue(bhqueue, vq->service);
}
virtqueue_fill(vq);
virtqueue_debug("%s: EXIT: vq %s: processed %d, last_used_idx %d, desc_idx %d\n",
__func__, vq->name, processed, vq->last_used_idx, vq->desc_idx);
}
closure_function(1, 0, void, virtqueue_service_vqmsgs,
virtqueue, vq)
{
virtqueue vq = bound(vq);
virtqueue_debug("%s enter, vq %s\n", __func__, vq->name);
list l;
while ((l = (list)dequeue(vq->servicequeue)) != INVALID_ADDRESS) {
struct list q;
list_insert_before(l, &q);
list_foreach(&q, p) {
vqmsg m = struct_from_list(p, vqmsg, l);
virtqueue_debug(" msg %p, completion %F, len %ld\n", m, m->completion, m->len);
apply(m->completion, m->len);
list_delete(p);
deallocate_vqmsg(vq, m);
}
}
virtqueue_debug("%s exit\n", __func__);
}
status virtqueue_alloc(vtdev dev,
const char *name,
u16 queue,
u16 size,
bytes notify_offset,
int align,
virtqueue *vqp,
thunk *t)
{
u64 vq_alloc_size = sizeof(struct virtqueue) + size * sizeof(vqmsg);
virtqueue vq = allocate(dev->general, vq_alloc_size);
vq->avail_offset = size * sizeof(struct vring_desc);
vq->used_offset = pad(vq->avail_offset + sizeof(*vq->avail) + sizeof(vq->avail->ring[0]) * size, align);
bytes alloc = vq->used_offset + pad(sizeof(*vq->used) + sizeof(vq->used->ring[0]) * size, align);
if (vq == INVALID_ADDRESS)
return timm("status", "cannot allocate virtqueue");
vq->dev = dev;
vq->name = name;
virtqueue_debug("%s: vq %s: idx %d, size %d, alloc %d\n",
__func__, vq->name, queue, size, alloc);
vq->queue_index = queue;
vq->notify_offset = notify_offset;
vq->entries = size;
vq->free_cnt = size;
vq->max_queued = 0;
list_init(&vq->msgqueue);
vq->servicequeue = allocate_queue(dev->general, 512);
assert(vq->servicequeue != INVALID_ADDRESS);
vq->service = closure(dev->general, virtqueue_service_vqmsgs, vq);
spin_lock_init(&vq->fill_lock);
if ((vq->ring_mem = allocate_zero(dev->contiguous, alloc)) == INVALID_ADDRESS) {
deallocate(dev->general, vq, vq_alloc_size);
return(timm("status", "cannot allocate memory for virtqueue ring"));
}
vq->desc = (struct vring_desc *) vq->ring_mem;
vq->avail = (struct vring_avail *) (vq->ring_mem + vq->avail_offset);
vq->used = (struct vring_used *) (vq->ring_mem + vq->used_offset);
virtqueue_debug("%s: vq %p: desc %p, avail %p, used %p\n",
__func__, vq, vq->desc, vq->avail, vq->used);
// initialize descriptor chains
for (int i = 0; i < vq->entries - 1; i++)
vq->desc[i].next = i + 1;
vq->desc[vq->entries - 1].next = VQ_RING_DESC_CHAIN_END;
*t = closure(dev->general, vq_interrupt, vq);
*vqp = vq;
return STATUS_OK;
}
void virtqueue_set_max_queued(virtqueue vq, int max_queued)
{
vq->max_queued = max_queued;
virtqueue_debug("%s: vq %s: max_queued = %d\n", __func__, vq->name, vq->max_queued);
}
physical virtqueue_desc_paddr(virtqueue vq)
{
return physical_from_virtual(vq->ring_mem);
}
physical virtqueue_avail_paddr(virtqueue vq)
{
return physical_from_virtual(vq->ring_mem) + vq->avail_offset;
}
physical virtqueue_used_paddr(virtqueue vq)
{
return physical_from_virtual(vq->ring_mem) + vq->used_offset;
}
u16 virtqueue_entries(virtqueue vq)
{
return vq->entries;
}
static int virtqueue_notify(virtqueue vq)
{
// ensure used->flags update is visible to us
// and updated avail->idx is visible to host
memory_barrier();
int should_notify = (vq->used->flags & VRING_USED_F_NO_NOTIFY) == 0;
if (should_notify)
apply(vq->dev->notify, vq->queue_index, vq->notify_offset);
return should_notify;
}
/* called from interrupt level or with ints disabled */
static void virtqueue_fill(virtqueue vq)
{
virtqueue_debug("%s: ENTRY: vq %s: entries %d, desc_idx %d, avail->idx %d, avail->flags 0x%x\n",
__func__, vq->name, vq->entries, vq->desc_idx, vq->avail->idx, vq->avail->flags);
/* irqs already disabled */
spin_lock(&vq->fill_lock);
list n = list_get_next(&vq->msgqueue);
u16 added = 0;
while (n && n != &vq->msgqueue) {
vqmsg m = struct_from_list(n, vqmsg, l);
if (vq->free_cnt < m->count) {
virtqueue_debug_verbose("%s: vq %s: queue full (vq->free_cnt %ld)\n",
__func__, vq->name, vq->free_cnt);
break;
}
assert(vq->free_cnt <= vq->entries);
if (vq->max_queued > 0 && vq->entries - vq->free_cnt >= vq->max_queued) {
virtqueue_debug_verbose("%s: vq %s: max queued reached (vq->max_queued %d, vq->free_cnt %ld)\n",
__func__, vq->name, vq->max_queued, vq->free_cnt);
break;
}
assert(m->completion);
u16 head = vq->desc_idx;
vq->msgs[head] = m;
for (int i = 0; i < m->count; i++) {
struct vring_desc *src = buffer_ref(m->descv, i * sizeof(*src));
volatile struct vring_desc *d = vq->desc + vq->desc_idx;
d->busaddr = src->busaddr;
d->len = src->len;
d->flags = src->flags;
if (i < m->count - 1)
d->flags |= VRING_DESC_F_NEXT;
vq->desc_idx = d->next;
virtqueue_debug_verbose("%s: vq %s: msg %p (count %d): desc->flags 0x%x, desc->next %d\n",
__func__, vq->name, m, m->count, d->flags, d->next);
}
u16 avail_idx = vq->avail->idx & (vq->entries - 1);
vq->avail->ring[avail_idx] = head;
virtqueue_debug_verbose("%s: vq %s: msg %p (count %d): avail->ring[%d] = %d\n",
__func__, vq->name, m, m->count, avail_idx, head);
fetch_and_add(&vq->free_cnt, -m->count);
added++;
// ensure desc and avail ring updates above are visible before updating avail->idx
write_barrier();
vq->avail->idx++;
list nn = list_get_next(n);
list_delete(n);
n = nn;
}
int notified = 0;
if (added > 0)
notified = virtqueue_notify(vq);
(void) notified;
spin_unlock(&vq->fill_lock);
virtqueue_debug_verbose("%s: EXIT: vq %s: added %d, notified %d, desc_idx %d\n",
__func__, vq->name, added, notified, vq->desc_idx);
}
| 33.70437 | 108 | 0.617497 |
0c0b2d23a38878c54d40a7a0cf27b0f4c7b53b7f | 12,244 | h | C | src/include/sof/math/trig.h | jairaj-arava/sof | bcccf1253d8b52bfdfc2ba1c4b178d747ee0cf79 | [
"BSD-3-Clause"
] | 325 | 2018-06-08T11:41:48.000Z | 2022-03-30T06:09:11.000Z | src/include/sof/math/trig.h | jairaj-arava/sof | bcccf1253d8b52bfdfc2ba1c4b178d747ee0cf79 | [
"BSD-3-Clause"
] | 4,535 | 2018-05-31T20:56:48.000Z | 2022-03-31T23:44:25.000Z | src/include/sof/math/trig.h | jairaj-arava/sof | bcccf1253d8b52bfdfc2ba1c4b178d747ee0cf79 | [
"BSD-3-Clause"
] | 237 | 2018-06-12T08:29:07.000Z | 2022-03-30T21:33:09.000Z | /* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2016 Intel Corporation. All rights reserved.
*
* Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
* Liam Girdwood <liam.r.girdwood@linux.intel.com>
* Keyon Jie <yang.jie@linux.intel.com>
* Shriram Shastry <malladi.sastry@linux.intel.com>
*/
#ifndef __SOF_MATH_TRIG_H__
#define __SOF_MATH_TRIG_H__
#include <stdint.h>
#define PI_DIV2_Q4_28 421657428
#define PI_DIV2_Q3_29 843314856
#define PI_Q4_28 843314857
#define PI_MUL2_Q4_28 1686629713
#define CORDIC_31B_TABLE_SIZE 31
#define CORDIC_15B_TABLE_SIZE 15
#define CORDIC_30B_ITABLE_SIZE 30
#define CORDIC_16B_ITABLE_SIZE 16
typedef enum {
EN_32B_CORDIC_SINE,
EN_32B_CORDIC_COSINE,
EN_32B_CORDIC_CEXP,
EN_16B_CORDIC_SINE,
EN_16B_CORDIC_COSINE,
EN_16B_CORDIC_CEXP,
} cordic_cfg;
struct cordic_cmpx {
int32_t re;
int32_t im;
};
void cordic_approx(int32_t th_rad_fxp, int32_t a_idx, int32_t *sign, int32_t *b_yn, int32_t *xn,
int32_t *th_cdc_fxp);
int32_t is_scalar_cordic_acos(int32_t realvalue, int16_t numiters);
int32_t is_scalar_cordic_asin(int32_t realvalue, int16_t numiters);
void cmpx_cexp(int32_t sign, int32_t b_yn, int32_t xn, cordic_cfg type, struct cordic_cmpx *cexp);
/* Input is Q4.28, output is Q1.31 */
/**
* Compute fixed point cordicsine with table lookup and interpolation
* The cordic sine algorithm converges, when the angle is in the range
* [-pi/2, pi/2).If an angle is outside of this range, then a multiple of
* pi/2 is added or subtracted from the angle until it is within the range
* [-pi/2,pi/2).Start with the angle in the range [-2*pi, 2*pi) and output
* has range in [-1.0 to 1.0]
* +------------------+-----------------+--------+--------+
* | thRadFxp | cdcsinth |thRadFxp|cdcsinth|
* +----+-----+-------+----+----+-------+--------+--------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat|
* +----+-----+-------+----+----+-------+--------+--------+
* | 32 | 28 | 1 | 32 | 31 | 1 | 4.28 | 1.31 |
* +------------------+-----------------+--------+--------+
*/
static inline int32_t sin_fixed_32b(int32_t th_rad_fxp)
{
int32_t th_cdc_fxp;
int32_t sign;
int32_t b_yn;
int32_t xn;
cordic_approx(th_rad_fxp, CORDIC_31B_TABLE_SIZE, &sign, &b_yn, &xn, &th_cdc_fxp);
th_cdc_fxp = sign * b_yn;
/*convert Q2.30 to Q1.31 format*/
return sat_int32(Q_SHIFT_LEFT((int64_t)th_cdc_fxp, 30, 31));
}
/**
* Compute fixed point cordicsine with table lookup and interpolation
* The cordic cosine algorithm converges, when the angle is in the range
* [-pi/2, pi/2).If an angle is outside of this range, then a multiple of
* pi/2 is added or subtracted from the angle until it is within the range
* [-pi/2,pi/2).Start with the angle in the range [-2*pi, 2*pi) and output
* has range in [-1.0 to 1.0]
* +------------------+-----------------+--------+--------+
* | thRadFxp | cdccosth |thRadFxp|cdccosth|
* +----+-----+-------+----+----+-------+--------+--------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat|
* +----+-----+-------+----+----+-------+--------+--------+
* | 32 | 28 | 1 | 32 | 31 | 1 | 4.28 | 1.31 |
* +------------------+-----------------+--------+--------+
*/
static inline int32_t cos_fixed_32b(int32_t th_rad_fxp)
{
int32_t th_cdc_fxp;
int32_t sign;
int32_t b_yn;
int32_t xn;
cordic_approx(th_rad_fxp, CORDIC_31B_TABLE_SIZE, &sign, &b_yn, &xn, &th_cdc_fxp);
th_cdc_fxp = sign * xn;
/*convert Q2.30 to Q1.31 format*/
return sat_int32(Q_SHIFT_LEFT((int64_t)th_cdc_fxp, 30, 31));
}
/* Input is Q4.28, output is Q1.15 */
/**
* Compute fixed point cordic sine with table lookup and interpolation
* The cordic sine algorithm converges, when the angle is in the range
* [-pi/2, pi/2).If an angle is outside of this range, then a multiple of
* pi/2 is added or subtracted from the angle until it is within the range
* [-pi/2,pi/2).Start with the angle in the range [-2*pi, 2*pi) and output
* has range in [-1.0 to 1.0]
* +------------------+-----------------+--------+------------+
* | thRadFxp | cdcsinth |thRadFxp| cdcsinth|
* +----+-----+-------+----+----+-------+--------+------------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat |
* +----+-----+-------+----+----+-------+--------+------------+
* | 32 | 28 | 1 | 32 | 15 | 1 | 4.28 | 1.15 |
* +------------------+-----------------+--------+------------+
*/
static inline int16_t sin_fixed_16b(int32_t th_rad_fxp)
{
int32_t th_cdc_fxp;
int32_t sign;
int32_t b_yn;
int32_t xn;
cordic_approx(th_rad_fxp, CORDIC_15B_TABLE_SIZE, &sign, &b_yn, &xn, &th_cdc_fxp);
th_cdc_fxp = sign * b_yn;
/*convert Q2.30 to Q1.15 format*/
return sat_int16(Q_SHIFT_RND(th_cdc_fxp, 30, 15));
}
/**
* Compute fixed point cordic cosine with table lookup and interpolation
* The cordic cos algorithm converges, when the angle is in the range
* [-pi/2, pi/2).If an angle is outside of this range, then a multiple of
* pi/2 is added or subtracted from the angle until it is within the range
* [-pi/2,pi/2).Start with the angle in the range [-2*pi, 2*pi) and output
* has range in [-1.0 to 1.0]
* +------------------+-----------------+--------+------------+
* | thRadFxp | cdccosth |thRadFxp| cdccosth|
* +----+-----+-------+----+----+-------+--------+------------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat |
* +----+-----+-------+----+----+-------+--------+------------+
* | 32 | 28 | 1 | 32 | 15 | 1 | 4.28 | 1.15 |
* +------------------+-----------------+--------+------------+
*/
static inline int16_t cos_fixed_16b(int32_t th_rad_fxp)
{
int32_t th_cdc_fxp;
int32_t sign;
int32_t b_yn;
int32_t xn;
cordic_approx(th_rad_fxp, CORDIC_15B_TABLE_SIZE, &sign, &b_yn, &xn, &th_cdc_fxp);
th_cdc_fxp = sign * xn;
/*convert Q2.30 to Q1.15 format*/
return sat_int16(Q_SHIFT_RND(th_cdc_fxp, 30, 15));
}
/**
* CORDIC-based approximation of complex exponential e^(j*THETA).
* computes COS(THETA) + j*SIN(THETA) using CORDIC algorithm
* approximation and returns the complex result.
* THETA values must be in the range [-2*pi, 2*pi). The cordic
* exponential algorithm converges, when the angle is in the
* range [-pi/2, pi/2).If an angle is outside of this range,
* then a multiple of pi/2 is added or subtracted from the
* angle until it is within the range [-pi/2,pi/2).Start
* with the angle in the range [-2*pi, 2*pi) and output has
* range in [-1.0 to 1.0]
* Error (max = 0.000000015832484), THD+N = -167.082852232808847
* +------------------+-----------------+--------+------------+
* | thRadFxp |cdccexpth |thRadFxp| cdccexpth|
* +----+-----+-------+----+----+-------+--------+------------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat |
* +----+-----+-------+----+----+-------+--------+------------+
* | 32 | 28 | 1 | 32 | 15 | 1 | 4.28 | 2.30 |
* +------------------+-----------------+--------+------------+
*/
static inline void cmpx_exp_32b(int32_t th_rad_fxp, struct cordic_cmpx *cexp)
{
int32_t th_cdc_fxp;
int32_t sign;
int32_t b_yn;
int32_t xn;
cordic_approx(th_rad_fxp, CORDIC_31B_TABLE_SIZE, &sign, &b_yn, &xn, &th_cdc_fxp);
cmpx_cexp(sign, b_yn, xn, EN_32B_CORDIC_CEXP, cexp);
/* return the complex(re & im) result in Q2.30*/
}
/**
* CORDIC-based approximation of complex exponential e^(j*THETA).
* computes COS(THETA) + j*SIN(THETA) using CORDIC algorithm
* approximation and returns the complex result.
* THETA values must be in the range [-2*pi, 2*pi). The cordic
* exponential algorithm converges, when the angle is in the
* range [-pi/2, pi/2).If an angle is outside of this range,
* then a multiple of pi/2 is added or subtracted from the
* angle until it is within the range [-pi/2,pi/2).Start
* with the angle in the range [-2*pi, 2*pi) and output has
* range in [-1.0 to 1.0]
* Error (max = 0.000060862861574), THD+N = -89.049303454077403
* +------------------+-----------------+--------+------------+
* | thRadFxp |cdccexpth |thRadFxp| cdccexpth|
* +----+-----+-------+----+----+-------+--------+------------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat |
* +----+-----+-------+----+----+-------+--------+------------+
* | 32 | 28 | 1 | 32 | 15 | 1 | 4.28 | 1.15 |
* +------------------+-----------------+--------+------------+
*/
static inline void cmpx_exp_16b(int32_t th_rad_fxp, struct cordic_cmpx *cexp)
{
int32_t th_cdc_fxp;
int32_t sign;
int32_t b_yn;
int32_t xn;
/* compute coeff from angles */
cordic_approx(th_rad_fxp, CORDIC_15B_TABLE_SIZE, &sign, &b_yn, &xn, &th_cdc_fxp);
cmpx_cexp(sign, b_yn, xn, EN_16B_CORDIC_CEXP, cexp);
/* return the complex(re & im) result in Q1.15*/
}
/**
* CORDIC-based approximation of inverse sine
* inverse sine of cdc_asin_theta based on a CORDIC approximation.
* asin(cdc_asin_th) inverse sine angle values in radian produces using the DCORDIC
* (Double CORDIC) algorithm.
* Inverse sine angle values in rad
* Q2.30 cdc_asin_th, value in between range of [-1 to 1]
* Q2.30 th_asin_fxp, output value range [-1.5707963258028 to 1.5707963258028]
* LUT size set type 15
* Error (max = 0.000000027939677), THD+N = -157.454534077921551 (dBc)
*/
static inline int32_t asin_fixed_32b(int32_t cdc_asin_th)
{
int32_t th_asin_fxp;
if (cdc_asin_th >= 0)
th_asin_fxp = is_scalar_cordic_asin(cdc_asin_th,
CORDIC_31B_TABLE_SIZE);
else
th_asin_fxp = -is_scalar_cordic_asin(-cdc_asin_th,
CORDIC_31B_TABLE_SIZE);
return th_asin_fxp; /* Q2.30 */
}
/**
* CORDIC-based approximation of inverse cosine
* inverse cosine of cdc_acos_theta based on a CORDIC approximation
* acos(cdc_acos_th) inverse cosine angle values in radian produces using the DCORDIC
* (Double CORDIC) algorithm.
* Q2.30 cdc_acos_th , input value range [-1 to 1]
* Q3.29 th_acos_fxp, output value range [3.14159265346825 to 0]
* LUT size set type 31
* Error (max = 0.000000026077032), THD+N = -157.948952635422842 (dBc)
*/
static inline int32_t acos_fixed_32b(int32_t cdc_acos_th)
{
int32_t th_acos_fxp;
if (cdc_acos_th >= 0)
th_acos_fxp = is_scalar_cordic_acos(cdc_acos_th,
CORDIC_31B_TABLE_SIZE);
else
th_acos_fxp =
PI_MUL2_Q4_28 - is_scalar_cordic_acos(-cdc_acos_th,
CORDIC_31B_TABLE_SIZE);
return th_acos_fxp; /* Q3.29 */
}
/**
* CORDIC-based approximation of inverse sine
* inverse sine of cdc_asin_theta based on a CORDIC approximation.
* asin(cdc_asin_th) inverse sine angle values in radian produces using the DCORDIC
* (Double CORDIC) algorithm.
* Inverse sine angle values in rad
* Q2.30 cdc_asin_th, value in between range of [-1 to 1]
* Q2.14 th_asin_fxp, output value range [-1.5707963258028 to 1.5707963258028]
* LUT size set type 31
* number of iteration 15
* Error (max = 0.000059800222516), THD+N = -89.824282520774048 (dBc)
*/
static inline int16_t asin_fixed_16b(int32_t cdc_asin_th)
{
int32_t th_asin_fxp;
if (cdc_asin_th >= 0)
th_asin_fxp = is_scalar_cordic_asin(cdc_asin_th,
CORDIC_16B_ITABLE_SIZE);
else
th_asin_fxp = -is_scalar_cordic_asin(-cdc_asin_th,
CORDIC_16B_ITABLE_SIZE);
/*convert Q2.30 to Q2.14 format*/
return sat_int16(Q_SHIFT_RND(th_asin_fxp, 30, 14));
}
/**
* CORDIC-based approximation of inverse cosine
* inverse cosine of cdc_acos_theta based on a CORDIC approximation
* acos(cdc_acos_th) inverse cosine angle values in radian produces using the DCORDIC
* (Double CORDIC) algorithm.
* Q2.30 cdc_acos_th , input value range [-1 to 1]
* Q3.13 th_acos_fxp, output value range [3.14159265346825 to 0]
* LUT size set type 31
* number of iteration 15
* Error (max = 0.000059799232976), THD+N = -89.824298401466635 (dBc)
*/
static inline int16_t acos_fixed_16b(int32_t cdc_acos_th)
{
int32_t th_acos_fxp;
if (cdc_acos_th >= 0)
th_acos_fxp = is_scalar_cordic_acos(cdc_acos_th,
CORDIC_16B_ITABLE_SIZE);
else
th_acos_fxp =
PI_MUL2_Q4_28 - is_scalar_cordic_acos(-cdc_acos_th,
CORDIC_16B_ITABLE_SIZE);
/*convert Q3.29 to Q3.13 format*/
return sat_int16(Q_SHIFT_RND(th_acos_fxp, 29, 13));
}
#endif /* __SOF_MATH_TRIG_H__ */
| 37.215805 | 98 | 0.624796 |
bd8b301d36d4ebcd2dd1d76db80489326752d528 | 278 | h | C | onlybot/indicators/Supertrend.h | IxDaddy/AMA | 76450ee40ee2104c98cf19403e355579448bb90b | [
"MIT"
] | 1 | 2021-07-25T12:08:19.000Z | 2021-07-25T12:08:19.000Z | onlybot/indicators/Supertrend.h | IxDaddy/AMA | 76450ee40ee2104c98cf19403e355579448bb90b | [
"MIT"
] | null | null | null | onlybot/indicators/Supertrend.h | IxDaddy/AMA | 76450ee40ee2104c98cf19403e355579448bb90b | [
"MIT"
] | null | null | null | # ifndef SUPERTREND_H_
# define SUPERTREND_H_
#include <stddef.h>
#include <stdio.h>
#include <math.h>
#include "../StockData.h"
void SuperTrend(StockData *m, double* hausse, double* baisse, double* atr_mat, double* supertrend, double* final_up, double* final_down);
# endif
| 23.166667 | 137 | 0.741007 |
266b4f020b65500462bbed5c7275ede1baca3b86 | 1,032 | h | C | ios/chrome/browser/ui/overlays/overlay_request_coordinator_delegate.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 | ios/chrome/browser/ui/overlays/overlay_request_coordinator_delegate.h | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | ios/chrome/browser/ui/overlays/overlay_request_coordinator_delegate.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 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_REQUEST_COORDINATOR_DELEGATE_H_
#define IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_REQUEST_COORDINATOR_DELEGATE_H_
class OverlayRequest;
// Delegate class used to communicate overlay UI presentation events back to
// OverlayPresenter.
class OverlayRequestCoordinatorDelegate {
public:
OverlayRequestCoordinatorDelegate() = default;
virtual ~OverlayRequestCoordinatorDelegate() = default;
// Called to notify the delegate that the UI for |request| has finished being
// presented.
virtual void OverlayUIDidFinishPresentation(OverlayRequest* request) = 0;
// Called to notify the delegate that the UI for |request| is finished
// being dismissed.
virtual void OverlayUIDidFinishDismissal(OverlayRequest* request) = 0;
};
#endif // IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_REQUEST_COORDINATOR_DELEGATE_H_
| 38.222222 | 81 | 0.814922 |
64bae53559869c6075b8878e3e67c691f95a23b3 | 1,269 | h | C | MMTabBarView/MMTabBarView/MMAttachedTabBarButton.h | nivekkagicom/MMTabBarView | f665754350e6bf9d8514eb556d7952b48e734a0e | [
"Unlicense"
] | 137 | 2015-01-02T09:45:55.000Z | 2021-12-27T17:49:12.000Z | MMTabBarView/MMTabBarView/MMAttachedTabBarButton.h | nivekkagicom/MMTabBarView | f665754350e6bf9d8514eb556d7952b48e734a0e | [
"Unlicense"
] | 38 | 2015-02-10T10:58:23.000Z | 2022-03-22T11:37:17.000Z | MMTabBarView/MMTabBarView/MMAttachedTabBarButton.h | nivekkagicom/MMTabBarView | f665754350e6bf9d8514eb556d7952b48e734a0e | [
"Unlicense"
] | 50 | 2015-02-15T20:14:31.000Z | 2021-12-27T17:49:17.000Z | //
// MMAttachedTabBarButton.h
// MMTabBarView
//
// Created by Michael Monscheuer on 9/5/12.
//
//
#import "MMTabBarButton.h"
#import "MMAttachedTabBarButtonCell.h"
#import "MMProgressIndicator.h"
#import "MMTabBarView.h"
NS_ASSUME_NONNULL_BEGIN
@class MMAttachedTabBarButtonCell;
@protocol MMTabStyle;
@interface MMAttachedTabBarButton : MMTabBarButton
// designated initializer
- (instancetype)initWithFrame:(NSRect)frame tabViewItem:(NSTabViewItem *)anItem NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithFrame:(NSRect)frame NS_UNAVAILABLE;
// overidden accessors (casting)
@property (nullable, strong) __kindof MMAttachedTabBarButtonCell *cell;
#pragma mark Properties
@property (strong) NSTabViewItem *tabViewItem;
@property (assign) NSRect slidingFrame;
@property (readonly) BOOL isInAnimatedSlide;
@property (assign) BOOL isInDraggedSlide;
@property (readonly) BOOL isSliding;
@property (assign) BOOL isOverflowButton;
#pragma mark Drag Support
@property (readonly) NSRect draggingRect;
@property (readonly) NSImage *dragImage;
#pragma mark -
#pragma mark Animation Support
- (void)slideAnimationWillStart;
- (void)slideAnimationDidEnd;
@end
NS_ASSUME_NONNULL_END
| 23.072727 | 106 | 0.799054 |
d92be41928c43e2852e5be3f58e2b07f92e5237d | 2,213 | h | C | src/Generic/names/discmodel/featuretypes/IdFCenterTrigramWCFeatureType.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/Generic/names/discmodel/featuretypes/IdFCenterTrigramWCFeatureType.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/Generic/names/discmodel/featuretypes/IdFCenterTrigramWCFeatureType.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | // Copyright 2008 by BBN Technologies Corp.
// All Rights Reserved.
#ifndef D_T_IDF_CENTER_TRIGRAM_WC_FEATURE_TYPE_H
#define D_T_IDF_CENTER_TRIGRAM_WC_FEATURE_TYPE_H
#include "Generic/common/Symbol.h"
#include "Generic/common/SymbolConstants.h"
#include "Generic/names/discmodel/PIdFFeatureType.h"
#include "Generic/discTagger/DTIntFeature.h"
#include "Generic/discTagger/DTState.h"
#include "Generic/names/discmodel/TokenObservation.h"
#include "Generic/wordClustering/WordClusterClass.h"
class IdFCenterTrigramWCFeatureType : public PIdFFeatureType {
public:
IdFCenterTrigramWCFeatureType() : PIdFFeatureType(Symbol(L"centertrigram-wc"), InfoSource::OBSERVATION) {}
virtual DTFeature *makeEmptyFeature() const {
return _new DTIntFeature(this, SymbolConstants::nullSymbol, -1);
}
virtual int extractFeatures(const DTState &state,
DTFeature **resultArray) const
{
if((state.getIndex()-1) < 0){
return 0;
}
if((state.getIndex()+1) >= state.getNObservations()){
return 0;
}
int n_results = 0;
TokenObservation *o_1 = static_cast<TokenObservation*>(
state.getObservation(state.getIndex()-1));
TokenObservation *o_2= static_cast<TokenObservation*>(
state.getObservation(state.getIndex()));
TokenObservation *o_3= static_cast<TokenObservation*>(
state.getObservation(state.getIndex()+1));
wchar_t trigram[MAX_TOKEN_SIZE*3 + 1];
wcsncpy(trigram, o_1->getSymbol().to_string(), MAX_TOKEN_SIZE + 1);
wcsncat(trigram, o_2->getSymbol().to_string(), MAX_TOKEN_SIZE);
wcsncat(trigram, o_3->getSymbol().to_string(), MAX_TOKEN_SIZE);
WordClusterClass wordClass = WordClusterClass(Symbol(trigram));
if (wordClass.c8() != 0)
resultArray[n_results++] = _new DTIntFeature(this, state.getTag(), wordClass.c8());
if (wordClass.c12() != 0)
resultArray[n_results++] = _new DTIntFeature(this, state.getTag(), wordClass.c12());
if (wordClass.c16() != 0)
resultArray[n_results++] = _new DTIntFeature(this, state.getTag(), wordClass.c16());
if (wordClass.c20() != 0)
resultArray[n_results++] = _new DTIntFeature(this, state.getTag(), wordClass.c20());
return n_results;
}
};
#endif
| 34.578125 | 108 | 0.719385 |
23b9a1a5abb449d04fb2fb928ef58325cf0a832d | 1,025 | h | C | include/il2cpp/Dpr/UI/UIPofinKinomiSelect/__c.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | 1 | 2022-01-15T20:20:27.000Z | 2022-01-15T20:20:27.000Z | include/il2cpp/Dpr/UI/UIPofinKinomiSelect/__c.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | include/il2cpp/Dpr/UI/UIPofinKinomiSelect/__c.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | #pragma once
#include "il2cpp.h"
void Dpr_UI_UIPofinKinomiSelect___c___cctor (const MethodInfo* method_info);
void Dpr_UI_UIPofinKinomiSelect___c___ctor (Dpr_UI_UIPofinKinomiSelect___c_o* __this, const MethodInfo* method_info);
void Dpr_UI_UIPofinKinomiSelect___c___OnUpdateDefault_b__28_0 (Dpr_UI_UIPofinKinomiSelect___c_o* __this, Dpr_UI_UIWindow_o* window, const MethodInfo* method_info);
void Dpr_UI_UIPofinKinomiSelect___c___KinomiUndo_b__29_0 (Dpr_UI_UIPofinKinomiSelect___c_o* __this, Dpr_Item_ItemInfo_o* x, const MethodInfo* method_info);
void Dpr_UI_UIPofinKinomiSelect___c___KinomiRedo_b__30_0 (Dpr_UI_UIPofinKinomiSelect___c_o* __this, Dpr_Item_ItemInfo_o* x, const MethodInfo* method_info);
void Dpr_UI_UIPofinKinomiSelect___c___SetSprite_b__33_0 (Dpr_UI_UIPofinKinomiSelect___c_o* __this, DG_Tweening_Tweener_o* x, const MethodInfo* method_info);
void Dpr_UI_UIPofinKinomiSelect___c___RemoveLastItem_b__37_0 (Dpr_UI_UIPofinKinomiSelect___c_o* __this, DG_Tweening_Tweener_o* x, const MethodInfo* method_info);
| 85.416667 | 163 | 0.884878 |
8c2705e16ef752bffd1683d8e4547bbf8e90f86c | 3,894 | h | C | net-next/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h | CavalryXD/APN6_Repo | 7a6af135ad936d52599b3ce59cf4f377a97a51d4 | [
"Apache-2.0"
] | 2 | 2020-09-18T07:01:49.000Z | 2022-01-27T08:59:04.000Z | net-next/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h | MaoJianwei/Mao_Linux_Network_Enhance | 2ba9e6278e3f405dcb9fc807d9f9a8d4ff0356dd | [
"Apache-2.0"
] | null | null | null | net-next/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.h | MaoJianwei/Mao_Linux_Network_Enhance | 2ba9e6278e3f405dcb9fc807d9f9a8d4ff0356dd | [
"Apache-2.0"
] | 4 | 2020-06-29T04:09:48.000Z | 2022-01-27T08:59:01.000Z | /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
/* Copyright (c) 2017-2018 Mellanox Technologies. All rights reserved */
#ifndef _MLXSW_CORE_ACL_FLEX_ACTIONS_H
#define _MLXSW_CORE_ACL_FLEX_ACTIONS_H
#include <linux/types.h>
#include <linux/netdevice.h>
#include <net/flow_offload.h>
struct mlxsw_afa;
struct mlxsw_afa_block;
struct mlxsw_afa_ops {
int (*kvdl_set_add)(void *priv, u32 *p_kvdl_index,
char *enc_actions, bool is_first);
void (*kvdl_set_del)(void *priv, u32 kvdl_index, bool is_first);
int (*kvdl_set_activity_get)(void *priv, u32 kvdl_index,
bool *activity);
int (*kvdl_fwd_entry_add)(void *priv, u32 *p_kvdl_index, u8 local_port);
void (*kvdl_fwd_entry_del)(void *priv, u32 kvdl_index);
int (*counter_index_get)(void *priv, unsigned int *p_counter_index);
void (*counter_index_put)(void *priv, unsigned int counter_index);
int (*mirror_add)(void *priv, u8 local_in_port,
const struct net_device *out_dev,
bool ingress, int *p_span_id);
void (*mirror_del)(void *priv, u8 local_in_port, int span_id,
bool ingress);
bool dummy_first_set;
};
struct mlxsw_afa *mlxsw_afa_create(unsigned int max_acts_per_set,
const struct mlxsw_afa_ops *ops,
void *ops_priv);
void mlxsw_afa_destroy(struct mlxsw_afa *mlxsw_afa);
struct mlxsw_afa_block *mlxsw_afa_block_create(struct mlxsw_afa *mlxsw_afa);
void mlxsw_afa_block_destroy(struct mlxsw_afa_block *block);
int mlxsw_afa_block_commit(struct mlxsw_afa_block *block);
char *mlxsw_afa_block_first_set(struct mlxsw_afa_block *block);
char *mlxsw_afa_block_cur_set(struct mlxsw_afa_block *block);
u32 mlxsw_afa_block_first_kvdl_index(struct mlxsw_afa_block *block);
int mlxsw_afa_block_activity_get(struct mlxsw_afa_block *block, bool *activity);
int mlxsw_afa_block_continue(struct mlxsw_afa_block *block);
int mlxsw_afa_block_jump(struct mlxsw_afa_block *block, u16 group_id);
int mlxsw_afa_block_terminate(struct mlxsw_afa_block *block);
const struct flow_action_cookie *
mlxsw_afa_cookie_lookup(struct mlxsw_afa *mlxsw_afa, u32 cookie_index);
int mlxsw_afa_block_append_drop(struct mlxsw_afa_block *block, bool ingress,
const struct flow_action_cookie *fa_cookie,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_trap(struct mlxsw_afa_block *block, u16 trap_id);
int mlxsw_afa_block_append_trap_and_forward(struct mlxsw_afa_block *block,
u16 trap_id);
int mlxsw_afa_block_append_mirror(struct mlxsw_afa_block *block,
u8 local_in_port,
const struct net_device *out_dev,
bool ingress,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_fwd(struct mlxsw_afa_block *block,
u8 local_port, bool in_port,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_vlan_modify(struct mlxsw_afa_block *block,
u16 vid, u8 pcp, u8 et,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_qos_switch_prio(struct mlxsw_afa_block *block,
u8 prio,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_qos_dsfield(struct mlxsw_afa_block *block,
u8 dsfield,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_qos_dscp(struct mlxsw_afa_block *block,
u8 dscp, struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_qos_ecn(struct mlxsw_afa_block *block,
u8 ecn, struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_allocated_counter(struct mlxsw_afa_block *block,
u32 counter_index);
int mlxsw_afa_block_append_counter(struct mlxsw_afa_block *block,
u32 *p_counter_index,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_fid_set(struct mlxsw_afa_block *block, u16 fid,
struct netlink_ext_ack *extack);
int mlxsw_afa_block_append_mcrouter(struct mlxsw_afa_block *block,
u16 expected_irif, u16 min_mtu,
bool rmid_valid, u32 kvdl_index);
#endif
| 44.758621 | 80 | 0.780688 |
96a21c54da32c202303a2c7b32b80931da801b0c | 249 | h | C | STWebArchiver-iOS/STWebArchiver-iOS Demo/ViewController.h | Fykec/STWebArchiver | 30883506eca4efd4726830bd11d08c598afd1aac | [
"Unlicense"
] | null | null | null | STWebArchiver-iOS/STWebArchiver-iOS Demo/ViewController.h | Fykec/STWebArchiver | 30883506eca4efd4726830bd11d08c598afd1aac | [
"Unlicense"
] | null | null | null | STWebArchiver-iOS/STWebArchiver-iOS Demo/ViewController.h | Fykec/STWebArchiver | 30883506eca4efd4726830bd11d08c598afd1aac | [
"Unlicense"
] | null | null | null | //
// ViewController.h
// STWebArchiver-iOS Demo
//
// Created by Foster Yin on 10/29/12.
// Copyright (c) 2012 Foster Yin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UIWebViewDelegate>
@end
| 17.785714 | 64 | 0.710843 |
bb030040a3b45cb6aa686f1d2b0bcde460ca1434 | 17,323 | h | C | cc3200-sdk/ti_rtos/ti_rtos_config/ewarm/iar/tirtos/xdc/runtime/knl/package/GateH_Proxy.h | rchtsang/cc3200-sdk-linux-gcc | 92d11e088a19cdea9374ef0ead2c3dd55995dcff | [
"MIT"
] | 2 | 2017-04-27T09:24:42.000Z | 2020-04-01T17:52:28.000Z | cc3200-sdk/ti_rtos/ti_rtos_config/ewarm/iar/tirtos/xdc/runtime/knl/package/GateH_Proxy.h | rchtsang/cc3200-sdk-linux-gcc | 92d11e088a19cdea9374ef0ead2c3dd55995dcff | [
"MIT"
] | null | null | null | cc3200-sdk/ti_rtos/ti_rtos_config/ewarm/iar/tirtos/xdc/runtime/knl/package/GateH_Proxy.h | rchtsang/cc3200-sdk-linux-gcc | 92d11e088a19cdea9374ef0ead2c3dd55995dcff | [
"MIT"
] | 3 | 2018-01-30T16:38:52.000Z | 2022-03-30T00:56:46.000Z | /*
* Do not modify this file; it is automatically
* generated and any modifications will be overwritten.
*
* @(#) xdc-B06
*/
/*
* ======== GENERATED SECTIONS ========
*
* PROLOGUE
* INCLUDES
*
* MODULE-WIDE CONFIGS
* PER-INSTANCE TYPES
* VIRTUAL FUNCTIONS
* FUNCTION DECLARATIONS
* CONVERTORS
* SYSTEM FUNCTIONS
*
* EPILOGUE
* PREFIX ALIASES
*/
/*
* ======== PROLOGUE ========
*/
#ifndef xdc_runtime_knl_GateH_Proxy__include
#define xdc_runtime_knl_GateH_Proxy__include
#ifndef __nested__
#define __nested__
#define xdc_runtime_knl_GateH_Proxy__top__
#endif
#ifdef __cplusplus
#define __extern extern "C"
#else
#define __extern extern
#endif
#define xdc_runtime_knl_GateH_Proxy___VERS 160
/*
* ======== INCLUDES ========
*/
#include <xdc/std.h>
#include <xdc/runtime/xdc.h>
#include <xdc/runtime/Types.h>
#include <xdc/runtime/IInstance.h>
#include <xdc/runtime/knl/package/package.defs.h>
#include <xdc/runtime/IGateProvider.h>
/*
* ======== AUXILIARY DEFINITIONS ========
*/
/* Q_BLOCKING */
#define xdc_runtime_knl_GateH_Proxy_Q_BLOCKING (1)
/* Q_PREEMPTING */
#define xdc_runtime_knl_GateH_Proxy_Q_PREEMPTING (2)
/*
* ======== MODULE-WIDE CONFIGS ========
*/
/* Module__diagsEnabled */
typedef xdc_Bits32 CT__xdc_runtime_knl_GateH_Proxy_Module__diagsEnabled;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__diagsEnabled xdc_runtime_knl_GateH_Proxy_Module__diagsEnabled__C;
/* Module__diagsIncluded */
typedef xdc_Bits32 CT__xdc_runtime_knl_GateH_Proxy_Module__diagsIncluded;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__diagsIncluded xdc_runtime_knl_GateH_Proxy_Module__diagsIncluded__C;
/* Module__diagsMask */
typedef xdc_Bits16 *CT__xdc_runtime_knl_GateH_Proxy_Module__diagsMask;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__diagsMask xdc_runtime_knl_GateH_Proxy_Module__diagsMask__C;
/* Module__gateObj */
typedef xdc_Ptr CT__xdc_runtime_knl_GateH_Proxy_Module__gateObj;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__gateObj xdc_runtime_knl_GateH_Proxy_Module__gateObj__C;
/* Module__gatePrms */
typedef xdc_Ptr CT__xdc_runtime_knl_GateH_Proxy_Module__gatePrms;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__gatePrms xdc_runtime_knl_GateH_Proxy_Module__gatePrms__C;
/* Module__id */
typedef xdc_runtime_Types_ModuleId CT__xdc_runtime_knl_GateH_Proxy_Module__id;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__id xdc_runtime_knl_GateH_Proxy_Module__id__C;
/* Module__loggerDefined */
typedef xdc_Bool CT__xdc_runtime_knl_GateH_Proxy_Module__loggerDefined;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerDefined xdc_runtime_knl_GateH_Proxy_Module__loggerDefined__C;
/* Module__loggerObj */
typedef xdc_Ptr CT__xdc_runtime_knl_GateH_Proxy_Module__loggerObj;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerObj xdc_runtime_knl_GateH_Proxy_Module__loggerObj__C;
/* Module__loggerFxn0 */
typedef xdc_runtime_Types_LoggerFxn0 CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn0;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn0 xdc_runtime_knl_GateH_Proxy_Module__loggerFxn0__C;
/* Module__loggerFxn1 */
typedef xdc_runtime_Types_LoggerFxn1 CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn1;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn1 xdc_runtime_knl_GateH_Proxy_Module__loggerFxn1__C;
/* Module__loggerFxn2 */
typedef xdc_runtime_Types_LoggerFxn2 CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn2;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn2 xdc_runtime_knl_GateH_Proxy_Module__loggerFxn2__C;
/* Module__loggerFxn4 */
typedef xdc_runtime_Types_LoggerFxn4 CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn4;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn4 xdc_runtime_knl_GateH_Proxy_Module__loggerFxn4__C;
/* Module__loggerFxn8 */
typedef xdc_runtime_Types_LoggerFxn8 CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn8;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__loggerFxn8 xdc_runtime_knl_GateH_Proxy_Module__loggerFxn8__C;
/* Module__startupDoneFxn */
typedef xdc_Bool (*CT__xdc_runtime_knl_GateH_Proxy_Module__startupDoneFxn)(void);
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Module__startupDoneFxn xdc_runtime_knl_GateH_Proxy_Module__startupDoneFxn__C;
/* Object__count */
typedef xdc_Int CT__xdc_runtime_knl_GateH_Proxy_Object__count;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Object__count xdc_runtime_knl_GateH_Proxy_Object__count__C;
/* Object__heap */
typedef xdc_runtime_IHeap_Handle CT__xdc_runtime_knl_GateH_Proxy_Object__heap;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Object__heap xdc_runtime_knl_GateH_Proxy_Object__heap__C;
/* Object__sizeof */
typedef xdc_SizeT CT__xdc_runtime_knl_GateH_Proxy_Object__sizeof;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Object__sizeof xdc_runtime_knl_GateH_Proxy_Object__sizeof__C;
/* Object__table */
typedef xdc_Ptr CT__xdc_runtime_knl_GateH_Proxy_Object__table;
__extern __FAR__ const CT__xdc_runtime_knl_GateH_Proxy_Object__table xdc_runtime_knl_GateH_Proxy_Object__table__C;
/*
* ======== PER-INSTANCE TYPES ========
*/
/* Params */
struct xdc_runtime_knl_GateH_Proxy_Params {
size_t __size;
const void *__self;
void *__fxns;
xdc_runtime_IInstance_Params *instance;
xdc_runtime_IInstance_Params __iprms;
};
/* Struct */
struct xdc_runtime_knl_GateH_Proxy_Struct {
const xdc_runtime_knl_GateH_Proxy_Fxns__ *__fxns;
xdc_runtime_Types_CordAddr __name;
};
/*
* ======== VIRTUAL FUNCTIONS ========
*/
/* Fxns__ */
struct xdc_runtime_knl_GateH_Proxy_Fxns__ {
xdc_runtime_Types_Base* __base;
const xdc_runtime_Types_SysFxns2 *__sysp;
xdc_Bool (*query)(xdc_Int);
xdc_IArg (*enter)(xdc_runtime_knl_GateH_Proxy_Handle);
xdc_Void (*leave)(xdc_runtime_knl_GateH_Proxy_Handle, xdc_IArg);
xdc_runtime_Types_SysFxns2 __sfxns;
};
/* Module__FXNS__C */
__extern const xdc_runtime_knl_GateH_Proxy_Fxns__ xdc_runtime_knl_GateH_Proxy_Module__FXNS__C;
/*
* ======== FUNCTION DECLARATIONS ========
*/
/* Module_startup */
#define xdc_runtime_knl_GateH_Proxy_Module_startup( state ) (-1)
/* Handle__label__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Handle__label__S, "xdc_runtime_knl_GateH_Proxy_Handle__label__S")
__extern xdc_runtime_Types_Label *xdc_runtime_knl_GateH_Proxy_Handle__label__S( xdc_Ptr obj, xdc_runtime_Types_Label *lab );
/* Module__startupDone__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Module__startupDone__S, "xdc_runtime_knl_GateH_Proxy_Module__startupDone__S")
__extern xdc_Bool xdc_runtime_knl_GateH_Proxy_Module__startupDone__S( void );
/* Object__create__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Object__create__S, "xdc_runtime_knl_GateH_Proxy_Object__create__S")
__extern xdc_Ptr xdc_runtime_knl_GateH_Proxy_Object__create__S( xdc_Ptr __oa, xdc_SizeT __osz, xdc_Ptr __aa, const xdc_UChar *__pa, xdc_SizeT __psz, xdc_runtime_Error_Block *__eb );
/* create */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_create, "xdc_runtime_knl_GateH_Proxy_create")
__extern xdc_runtime_knl_GateH_Proxy_Handle xdc_runtime_knl_GateH_Proxy_create( const xdc_runtime_knl_GateH_Proxy_Params *__prms, xdc_runtime_Error_Block *__eb );
/* Object__delete__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Object__delete__S, "xdc_runtime_knl_GateH_Proxy_Object__delete__S")
__extern xdc_Void xdc_runtime_knl_GateH_Proxy_Object__delete__S( xdc_Ptr instp );
/* delete */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_delete, "xdc_runtime_knl_GateH_Proxy_delete")
__extern void xdc_runtime_knl_GateH_Proxy_delete(xdc_runtime_knl_GateH_Proxy_Handle *instp);
/* Object__destruct__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Object__destruct__S, "xdc_runtime_knl_GateH_Proxy_Object__destruct__S")
__extern xdc_Void xdc_runtime_knl_GateH_Proxy_Object__destruct__S( xdc_Ptr objp );
/* Object__get__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Object__get__S, "xdc_runtime_knl_GateH_Proxy_Object__get__S")
__extern xdc_Ptr xdc_runtime_knl_GateH_Proxy_Object__get__S( xdc_Ptr oarr, xdc_Int i );
/* Object__first__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Object__first__S, "xdc_runtime_knl_GateH_Proxy_Object__first__S")
__extern xdc_Ptr xdc_runtime_knl_GateH_Proxy_Object__first__S( void );
/* Object__next__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Object__next__S, "xdc_runtime_knl_GateH_Proxy_Object__next__S")
__extern xdc_Ptr xdc_runtime_knl_GateH_Proxy_Object__next__S( xdc_Ptr obj );
/* Params__init__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Params__init__S, "xdc_runtime_knl_GateH_Proxy_Params__init__S")
__extern xdc_Void xdc_runtime_knl_GateH_Proxy_Params__init__S( xdc_Ptr dst, const xdc_Void *src, xdc_SizeT psz, xdc_SizeT isz );
/* Proxy__abstract__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Proxy__abstract__S, "xdc_runtime_knl_GateH_Proxy_Proxy__abstract__S")
__extern xdc_Bool xdc_runtime_knl_GateH_Proxy_Proxy__abstract__S( void );
/* Proxy__delegate__S */
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_Proxy__delegate__S, "xdc_runtime_knl_GateH_Proxy_Proxy__delegate__S")
__extern xdc_Ptr xdc_runtime_knl_GateH_Proxy_Proxy__delegate__S( void );
/* query__E */
#define xdc_runtime_knl_GateH_Proxy_query xdc_runtime_knl_GateH_Proxy_query__E
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_query__E, "xdc_runtime_knl_GateH_Proxy_query")
__extern xdc_Bool xdc_runtime_knl_GateH_Proxy_query__E( xdc_Int qual );
/* enter__E */
#define xdc_runtime_knl_GateH_Proxy_enter xdc_runtime_knl_GateH_Proxy_enter__E
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_enter__E, "xdc_runtime_knl_GateH_Proxy_enter")
__extern xdc_IArg xdc_runtime_knl_GateH_Proxy_enter__E( xdc_runtime_knl_GateH_Proxy_Handle __inst );
/* leave__E */
#define xdc_runtime_knl_GateH_Proxy_leave xdc_runtime_knl_GateH_Proxy_leave__E
xdc__CODESECT(xdc_runtime_knl_GateH_Proxy_leave__E, "xdc_runtime_knl_GateH_Proxy_leave")
__extern xdc_Void xdc_runtime_knl_GateH_Proxy_leave__E( xdc_runtime_knl_GateH_Proxy_Handle __inst, xdc_IArg key );
/*
* ======== CONVERTORS ========
*/
/* Module_upCast */
static inline xdc_runtime_IGateProvider_Module xdc_runtime_knl_GateH_Proxy_Module_upCast( void )
{
return (xdc_runtime_IGateProvider_Module)xdc_runtime_knl_GateH_Proxy_Proxy__delegate__S();
}
/* Module_to_xdc_runtime_IGateProvider */
#define xdc_runtime_knl_GateH_Proxy_Module_to_xdc_runtime_IGateProvider xdc_runtime_knl_GateH_Proxy_Module_upCast
/* Handle_upCast */
static inline xdc_runtime_IGateProvider_Handle xdc_runtime_knl_GateH_Proxy_Handle_upCast( xdc_runtime_knl_GateH_Proxy_Handle i )
{
return (xdc_runtime_IGateProvider_Handle)i;
}
/* Handle_to_xdc_runtime_IGateProvider */
#define xdc_runtime_knl_GateH_Proxy_Handle_to_xdc_runtime_IGateProvider xdc_runtime_knl_GateH_Proxy_Handle_upCast
/* Handle_downCast */
static inline xdc_runtime_knl_GateH_Proxy_Handle xdc_runtime_knl_GateH_Proxy_Handle_downCast( xdc_runtime_IGateProvider_Handle i )
{
xdc_runtime_IGateProvider_Handle i2 = (xdc_runtime_IGateProvider_Handle)i;
if (xdc_runtime_knl_GateH_Proxy_Proxy__abstract__S()) return (xdc_runtime_knl_GateH_Proxy_Handle)i;
return (void*)i2->__fxns == (void*)xdc_runtime_knl_GateH_Proxy_Proxy__delegate__S() ? (xdc_runtime_knl_GateH_Proxy_Handle)i : 0;
}
/* Handle_from_xdc_runtime_IGateProvider */
#define xdc_runtime_knl_GateH_Proxy_Handle_from_xdc_runtime_IGateProvider xdc_runtime_knl_GateH_Proxy_Handle_downCast
/*
* ======== SYSTEM FUNCTIONS ========
*/
/* Module_startupDone */
#define xdc_runtime_knl_GateH_Proxy_Module_startupDone() xdc_runtime_knl_GateH_Proxy_Module__startupDone__S()
/* Object_heap */
#define xdc_runtime_knl_GateH_Proxy_Object_heap() xdc_runtime_knl_GateH_Proxy_Object__heap__C
/* Module_heap */
#define xdc_runtime_knl_GateH_Proxy_Module_heap() xdc_runtime_knl_GateH_Proxy_Object__heap__C
/* Module_id */
static inline CT__xdc_runtime_knl_GateH_Proxy_Module__id xdc_runtime_knl_GateH_Proxy_Module_id( void )
{
return xdc_runtime_knl_GateH_Proxy_Module__id__C;
}
/* Proxy_abstract */
#define xdc_runtime_knl_GateH_Proxy_Proxy_abstract() xdc_runtime_knl_GateH_Proxy_Proxy__abstract__S()
/* Proxy_delegate */
#define xdc_runtime_knl_GateH_Proxy_Proxy_delegate() ((xdc_runtime_IGateProvider_Module)xdc_runtime_knl_GateH_Proxy_Proxy__delegate__S())
/* Params_init */
static inline void xdc_runtime_knl_GateH_Proxy_Params_init( xdc_runtime_knl_GateH_Proxy_Params *prms )
{
if (prms) {
xdc_runtime_knl_GateH_Proxy_Params__init__S(prms, 0, sizeof(xdc_runtime_knl_GateH_Proxy_Params), sizeof(xdc_runtime_IInstance_Params));
}
}
/* Params_copy */
static inline void xdc_runtime_knl_GateH_Proxy_Params_copy(xdc_runtime_knl_GateH_Proxy_Params *dst, const xdc_runtime_knl_GateH_Proxy_Params *src)
{
if (dst) {
xdc_runtime_knl_GateH_Proxy_Params__init__S(dst, (const void *)src, sizeof(xdc_runtime_knl_GateH_Proxy_Params), sizeof(xdc_runtime_IInstance_Params));
}
}
/*
* ======== EPILOGUE ========
*/
#ifdef xdc_runtime_knl_GateH_Proxy__top__
#undef __nested__
#endif
#endif /* xdc_runtime_knl_GateH_Proxy__include */
/*
* ======== PREFIX ALIASES ========
*/
#if !defined(__nested__) && !defined(xdc_runtime_knl_GateH_Proxy__nolocalnames)
#ifndef xdc_runtime_knl_GateH_Proxy__localnames__done
#define xdc_runtime_knl_GateH_Proxy__localnames__done
/* module prefix */
#define GateH_Proxy_Instance xdc_runtime_knl_GateH_Proxy_Instance
#define GateH_Proxy_Handle xdc_runtime_knl_GateH_Proxy_Handle
#define GateH_Proxy_Module xdc_runtime_knl_GateH_Proxy_Module
#define GateH_Proxy_Object xdc_runtime_knl_GateH_Proxy_Object
#define GateH_Proxy_Struct xdc_runtime_knl_GateH_Proxy_Struct
#define GateH_Proxy_Q_BLOCKING xdc_runtime_knl_GateH_Proxy_Q_BLOCKING
#define GateH_Proxy_Q_PREEMPTING xdc_runtime_knl_GateH_Proxy_Q_PREEMPTING
#define GateH_Proxy_Params xdc_runtime_knl_GateH_Proxy_Params
#define GateH_Proxy_query xdc_runtime_knl_GateH_Proxy_query
#define GateH_Proxy_enter xdc_runtime_knl_GateH_Proxy_enter
#define GateH_Proxy_leave xdc_runtime_knl_GateH_Proxy_leave
#define GateH_Proxy_Module_name xdc_runtime_knl_GateH_Proxy_Module_name
#define GateH_Proxy_Module_id xdc_runtime_knl_GateH_Proxy_Module_id
#define GateH_Proxy_Module_startup xdc_runtime_knl_GateH_Proxy_Module_startup
#define GateH_Proxy_Module_startupDone xdc_runtime_knl_GateH_Proxy_Module_startupDone
#define GateH_Proxy_Module_hasMask xdc_runtime_knl_GateH_Proxy_Module_hasMask
#define GateH_Proxy_Module_getMask xdc_runtime_knl_GateH_Proxy_Module_getMask
#define GateH_Proxy_Module_setMask xdc_runtime_knl_GateH_Proxy_Module_setMask
#define GateH_Proxy_Object_heap xdc_runtime_knl_GateH_Proxy_Object_heap
#define GateH_Proxy_Module_heap xdc_runtime_knl_GateH_Proxy_Module_heap
#define GateH_Proxy_construct xdc_runtime_knl_GateH_Proxy_construct
#define GateH_Proxy_create xdc_runtime_knl_GateH_Proxy_create
#define GateH_Proxy_handle xdc_runtime_knl_GateH_Proxy_handle
#define GateH_Proxy_struct xdc_runtime_knl_GateH_Proxy_struct
#define GateH_Proxy_Handle_label xdc_runtime_knl_GateH_Proxy_Handle_label
#define GateH_Proxy_Handle_name xdc_runtime_knl_GateH_Proxy_Handle_name
#define GateH_Proxy_Instance_init xdc_runtime_knl_GateH_Proxy_Instance_init
#define GateH_Proxy_Object_count xdc_runtime_knl_GateH_Proxy_Object_count
#define GateH_Proxy_Object_get xdc_runtime_knl_GateH_Proxy_Object_get
#define GateH_Proxy_Object_first xdc_runtime_knl_GateH_Proxy_Object_first
#define GateH_Proxy_Object_next xdc_runtime_knl_GateH_Proxy_Object_next
#define GateH_Proxy_Object_sizeof xdc_runtime_knl_GateH_Proxy_Object_sizeof
#define GateH_Proxy_Params_copy xdc_runtime_knl_GateH_Proxy_Params_copy
#define GateH_Proxy_Params_init xdc_runtime_knl_GateH_Proxy_Params_init
#define GateH_Proxy_Instance_State xdc_runtime_knl_GateH_Proxy_Instance_State
#define GateH_Proxy_Proxy_abstract xdc_runtime_knl_GateH_Proxy_Proxy_abstract
#define GateH_Proxy_Proxy_delegate xdc_runtime_knl_GateH_Proxy_Proxy_delegate
#define GateH_Proxy_delete xdc_runtime_knl_GateH_Proxy_delete
#define GateH_Proxy_destruct xdc_runtime_knl_GateH_Proxy_destruct
#define GateH_Proxy_Module_upCast xdc_runtime_knl_GateH_Proxy_Module_upCast
#define GateH_Proxy_Module_to_xdc_runtime_IGateProvider xdc_runtime_knl_GateH_Proxy_Module_to_xdc_runtime_IGateProvider
#define GateH_Proxy_Handle_upCast xdc_runtime_knl_GateH_Proxy_Handle_upCast
#define GateH_Proxy_Handle_to_xdc_runtime_IGateProvider xdc_runtime_knl_GateH_Proxy_Handle_to_xdc_runtime_IGateProvider
#define GateH_Proxy_Handle_downCast xdc_runtime_knl_GateH_Proxy_Handle_downCast
#define GateH_Proxy_Handle_from_xdc_runtime_IGateProvider xdc_runtime_knl_GateH_Proxy_Handle_from_xdc_runtime_IGateProvider
#endif /* xdc_runtime_knl_GateH_Proxy__localnames__done */
#endif
| 42.562654 | 182 | 0.84535 |
af6764022dd133da5ad7a7784210a9001c327284 | 1,468 | h | C | tools/fastmodels/config.h | lambdaxymox/barrelfish | 06a9f54721a8d96874a8939d8973178a562c342f | [
"MIT"
] | 111 | 2015-02-03T02:57:27.000Z | 2022-03-01T23:57:09.000Z | tools/fastmodels/config.h | lambdaxymox/barrelfish | 06a9f54721a8d96874a8939d8973178a562c342f | [
"MIT"
] | 12 | 2016-03-22T14:44:32.000Z | 2020-03-18T13:30:29.000Z | tools/fastmodels/config.h | lambdaxymox/barrelfish | 06a9f54721a8d96874a8939d8973178a562c342f | [
"MIT"
] | 55 | 2015-02-03T05:28:12.000Z | 2022-03-31T05:00:03.000Z | #ifndef __CONFIG_H
#define __CONFIG_H
#include <multiboot2.h>
#include <stdint.h>
/* The default inital stack size for the CPU driver, if it's not specified in
* the configuration file. */
#define DEFAULT_STACK_SIZE 16384
struct component_config {
/* The offset and length of the image path, and argument strings for this
* component. */
size_t path_start, path_len;
size_t args_start, args_len;
/* The size and target address of the ELF image. */
size_t image_size, alloc_size;
uint64_t image_address;
/* A pointer to the module tag in the multiboot info image. */
struct multiboot_tag_module_64 *tag;
/* A pointer to the loaded image. */
void *image;
struct component_config *next;
};
struct config {
/* The raw configuration file. */
char *buf;
/* The multiboot information structure. */
void *multiboot;
size_t multiboot_size, multiboot_alloc;
/* Pointers (within the multiboot structure), to the memory map that needs
* to be filled in after all allocation is finished. */
struct multiboot_tag_efi_mmap *mmap_tag;
void *mmap_start;
/* The CPU driver load information. */
struct component_config *kernel;
uint64_t kernel_entry;
uint64_t kernel_stack;
uint64_t stack_size;
/* The additional modules. */
struct component_config *first_module, *last_module;
};
struct config *parse_config(char *buf, size_t size);
#endif /* __CONFIG_H */
| 26.214286 | 78 | 0.702316 |
4b876685687b17360fe20ab6fe8d721e8742aba1 | 404 | c | C | C/ConditionalsAndLoops/digitsum.c | jerubball/HackerRank | c484532d6e4cd57227d17f049df5dd754611f281 | [
"Unlicense"
] | null | null | null | C/ConditionalsAndLoops/digitsum.c | jerubball/HackerRank | c484532d6e4cd57227d17f049df5dd754611f281 | [
"Unlicense"
] | null | null | null | C/ConditionalsAndLoops/digitsum.c | jerubball/HackerRank | c484532d6e4cd57227d17f049df5dd754611f281 | [
"Unlicense"
] | null | null | null | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
/*
* HackerRank C ConditionalsAndLoops 3
* https://www.hackerrank.com/challenges/sum-of-digits-of-a-five-digit-number/problem
* Author: Hasol
*/
int main ()
{
int n;
scanf ("%d", &n);
int sum = 0;
while (n > 0)
{
sum += n % 10;
n /= 10;
}
printf ("%d", sum);
return 0;
}
| 14.962963 | 85 | 0.54703 |
15e1c724b7de2edb2b3009398610cc48326070c0 | 148 | h | C | api.h | norbertwenzel/test_dso_exported_syms | f4d33cb8e9d6371488fca6436e1d13643c3ccf0c | [
"Unlicense"
] | null | null | null | api.h | norbertwenzel/test_dso_exported_syms | f4d33cb8e9d6371488fca6436e1d13643c3ccf0c | [
"Unlicense"
] | null | null | null | api.h | norbertwenzel/test_dso_exported_syms | f4d33cb8e9d6371488fca6436e1d13643c3ccf0c | [
"Unlicense"
] | null | null | null | #ifndef LINUX_DSO_API_H
#define LINUX_DSO_API_H
extern "C" {
void __attribute__((visibility("default"))) api_func();
}
#endif //LINUX_DSO_API_H
| 13.454545 | 55 | 0.75 |
189268cde2c5b787e1f9436628b67b2fc79d0041 | 2,892 | h | C | src/qt/qtwebkit/Source/WebCore/svg/SVGZoomAndPan.h | viewdy/phantomjs | eddb0db1d253fd0c546060a4555554c8ee08c13c | [
"BSD-3-Clause"
] | 1 | 2015-05-27T13:52:20.000Z | 2015-05-27T13:52:20.000Z | src/qt/qtwebkit/Source/WebCore/svg/SVGZoomAndPan.h | mrampersad/phantomjs | dca6f77a36699eb4e1c46f7600cca618f01b0ac3 | [
"BSD-3-Clause"
] | null | null | null | src/qt/qtwebkit/Source/WebCore/svg/SVGZoomAndPan.h | mrampersad/phantomjs | dca6f77a36699eb4e1c46f7600cca618f01b0ac3 | [
"BSD-3-Clause"
] | 1 | 2017-03-19T13:03:23.000Z | 2017-03-19T13:03:23.000Z | /*
* Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SVGZoomAndPan_h
#define SVGZoomAndPan_h
#if ENABLE(SVG)
#include "QualifiedName.h"
#include "SVGNames.h"
#include <wtf/HashSet.h>
namespace WebCore {
enum SVGZoomAndPanType {
SVGZoomAndPanUnknown = 0,
SVGZoomAndPanDisable,
SVGZoomAndPanMagnify
};
class SVGZoomAndPan {
public:
// Forward declare enumerations in the W3C naming scheme, for IDL generation.
enum {
SVG_ZOOMANDPAN_UNKNOWN = SVGZoomAndPanUnknown,
SVG_ZOOMANDPAN_DISABLE = SVGZoomAndPanDisable,
SVG_ZOOMANDPAN_MAGNIFY = SVGZoomAndPanMagnify
};
static bool isKnownAttribute(const QualifiedName&);
static void addSupportedAttributes(HashSet<QualifiedName>&);
static SVGZoomAndPanType parseFromNumber(unsigned short number)
{
if (!number || number > SVGZoomAndPanMagnify)
return SVGZoomAndPanUnknown;
return static_cast<SVGZoomAndPanType>(number);
}
static bool parseZoomAndPan(const UChar*& start, const UChar* end, SVGZoomAndPanType&);
template<class SVGElementTarget>
static bool parseAttribute(SVGElementTarget* target, const QualifiedName& name, const AtomicString& value)
{
ASSERT(target);
ASSERT(target->document());
if (name == SVGNames::zoomAndPanAttr) {
const UChar* start = value.characters();
const UChar* end = start + value.length();
SVGZoomAndPanType zoomAndPan = SVGZoomAndPanUnknown;
parseZoomAndPan(start, end, zoomAndPan);
target->setZoomAndPan(zoomAndPan);
return true;
}
return false;
}
SVGZoomAndPanType zoomAndPan() const { return SVGZoomAndPanUnknown; }
// These methods only exist to allow us to compile JSSVGZoomAndPan.*.
// These are never called, and thus ASSERT_NOT_REACHED.
void ref();
void deref();
void setZoomAndPan(unsigned short);
};
} // namespace WebCore
#endif // ENABLE(SVG)
#endif // SVGZoomAndPan_h
| 32.863636 | 110 | 0.707815 |
eb8adba9c818eecc2a5ada39787749f9c872fc6d | 606 | h | C | Source/ChuckieEgg/header.h | VictorLeach96/ChuckieEgg | 837af27b6a8da70d491721e7bdb6543e6654349c | [
"MIT"
] | null | null | null | Source/ChuckieEgg/header.h | VictorLeach96/ChuckieEgg | 837af27b6a8da70d491721e7bdb6543e6654349c | [
"MIT"
] | null | null | null | Source/ChuckieEgg/header.h | VictorLeach96/ChuckieEgg | 837af27b6a8da70d491721e7bdb6543e6654349c | [
"MIT"
] | null | null | null | #ifndef _HEADERS_
#define _HEADERS_
//Frameworks
#include <allegro.h>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
//Misc
#include "config.h"
#include "structures.h"
#include "collision.h"
//Objects
#include "ce_object.h"
#include "ce_actor.h"
#include "level.h"
#include "ce_wall.h"
#include "ce_wall_inv.h"
#include "ce_ladder.h"
#include "ce_egg.h"
#include "ce_grain.h"
#include "ce_pawn.h"
#include "ce_player.h"
#include "ce_swan.h"
//Instances
#include "button.h"
#include "menu.h"
#include "game.h"
using namespace std;
#endif | 16.378378 | 25 | 0.679868 |
9dc18b6774fafa16c90846ae5cd052e6490ed408 | 1,124 | h | C | System/Library/PrivateFrameworks/ProVideo.framework/FxFilter.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | 1 | 2020-11-04T15:43:01.000Z | 2020-11-04T15:43:01.000Z | System/Library/PrivateFrameworks/ProVideo.framework/FxFilter.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/ProVideo.framework/FxFilter.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.0
* on Monday, September 28, 2020 at 5:58:42 PM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/ProVideo.framework/ProVideo
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
@protocol FxFilter <FxBaseEffect>
@optional
-(unsigned long long)numberOfFramesToScheduleAtRenderTime:(/*function pointer*/void**)arg1;
-(void)schedule:(unsigned long long)arg1 frames:(/*function pointer*/void**)arg2 forRenderAtTime:(/*function pointer*/void**)arg3;
@required
-(BOOL)getOutputWidth:(unsigned long long*)arg1 height:(unsigned long long*)arg2 withInput:(SCD_Struct_PA83)arg3 withInfo:(SCD_Struct_OZ104*)arg4;
-(BOOL)frameSetup:(SCD_Struct_OZ104*)arg1 inputInfo:(SCD_Struct_PA83)arg2 hardware:(BOOL*)arg3 software:(BOOL*)arg4;
-(BOOL)frameCleanup;
-(BOOL)renderOutput:(id)arg1 withInput:(id)arg2 withInfo:(SCD_Struct_OZ104*)arg3;
@end
| 48.869565 | 146 | 0.686833 |
e470262c56053832e5e0d80bfe7348de45bb8db7 | 2,453 | h | C | Source/ImsvGraphVis/IGVTreemapLayout.h | Sapphirine/GraphVR | 7ba0d744250ab8932abbab891d3482197a8f6bad | [
"BSD-3-Clause"
] | null | null | null | Source/ImsvGraphVis/IGVTreemapLayout.h | Sapphirine/GraphVR | 7ba0d744250ab8932abbab891d3482197a8f6bad | [
"BSD-3-Clause"
] | null | null | null | Source/ImsvGraphVis/IGVTreemapLayout.h | Sapphirine/GraphVR | 7ba0d744250ab8932abbab891d3482197a8f6bad | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2017 Oh-Hyun Kwon. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
enum class EIGVTreemapOrientation : uint8
{
Vertical,
Horizontal
};
struct IMSVGRAPHVIS_API FIGVTreemapNode
{
struct FIGVCluster* const Cluster;
TArray<FIGVTreemapNode*> Children;
FBox2D Rect;
float Weight;
FIGVTreemapNode(struct FIGVCluster* const InCluster);
template <class FunctionType>
void ForEachDescendantFirst(FunctionType Function)
{
for (FIGVTreemapNode* const Child : Children)
{
Child->ForEachDescendantFirst(Function);
}
Function(*this);
}
template <class FunctionType>
void ForEachAncestorFirst(FunctionType Function)
{
Function(*this);
for (FIGVTreemapNode* const Child : Children)
{
Child->ForEachAncestorFirst(Function);
}
}
bool IsLeaf() const;
void SetRandomWeights();
void SortChildrenBySize();
};
class IMSVGRAPHVIS_API FIGVTreemapLayout
{
class AIGVGraphActor* const GraphActor;
struct FIGVCluster* const RootCluster;
TArray<FIGVTreemapNode> TreemapNodes;
FIGVTreemapNode* RootTreemapNode;
public:
FIGVTreemapLayout(class AIGVGraphActor* const InGraphActor);
void Compute();
public:
static void SliceAndDice(FIGVTreemapNode& ParentNode, int32 const FirstIdx, int32 const LastIdx,
FBox2D const& Bounds, EIGVTreemapOrientation const Orientation);
static void SliceAndDice(FIGVTreemapNode& ParentNode, int32 const FirstIdx, int32 const LastIdx,
FBox2D const& Bounds);
static void SliceAndDice(FIGVTreemapNode& ParentNode, FBox2D const& Bounds,
EIGVTreemapOrientation const Orientation);
static void SliceAndDice(FIGVTreemapNode& ParentNode, FBox2D const& Bounds);
static void SliceAndDice(FIGVTreemapNode& ParentNode, EIGVTreemapOrientation const Orientation);
static void SliceAndDice(FIGVTreemapNode& ParentNode);
static void Squarified(FIGVTreemapNode& ParentNode, int32 const FirstIdx, int32 const LastIdx,
FBox2D const& Bounds);
static void Squarified(FIGVTreemapNode& ParentNode, float Nesting);
static void Squarified(FIGVTreemapNode& ParentNode);
protected:
void SetupTreemapNodes();
static double AccumulateWeight(FIGVTreemapNode& ParentNode, int32 const FirstIdx,
int32 const LastIdx);
static float NormalizedAspectRatio(float const Big, float const Small,
double const RelativeWeight, double const WeightOffset);
};
| 28.858824 | 98 | 0.753771 |
9d20fe2a088f64c516fe6452342bebe52ecd4f5a | 2,460 | h | C | src/Rtsp/UDPServer.h | KISSMonX/ZLMediaKit | 1979d66dd2377daeb96ac18de67c0d43852b7d86 | [
"MIT"
] | null | null | null | src/Rtsp/UDPServer.h | KISSMonX/ZLMediaKit | 1979d66dd2377daeb96ac18de67c0d43852b7d86 | [
"MIT"
] | null | null | null | src/Rtsp/UDPServer.h | KISSMonX/ZLMediaKit | 1979d66dd2377daeb96ac18de67c0d43852b7d86 | [
"MIT"
] | null | null | null | /*
* MIT License
*
* Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
*
* 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 RTSP_UDPSERVER_H_
#define RTSP_UDPSERVER_H_
#include <stdint.h>
#include <mutex>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include "Util/util.h"
#include "Util/logger.h"
#include "Network/Socket.h"
using namespace std;
using namespace toolkit;
namespace mediakit {
class UDPServer : public std::enable_shared_from_this<UDPServer> {
public:
typedef function<bool(int intervaled, const Buffer::Ptr& buffer, struct sockaddr* peer_addr)> onRecvData;
~UDPServer();
static UDPServer& Instance();
Socket::Ptr getSock(const char* strLocalIp, int intervaled, uint16_t iLocalPort = 0);
void listenPeer(const char* strPeerIp, void* pSelf, const onRecvData& cb);
void stopListenPeer(const char* strPeerIp, void* pSelf);
private:
UDPServer();
void onRcvData(int intervaled, const Buffer::Ptr& pBuf, struct sockaddr* pPeerAddr);
void onErr(const string& strKey, const SockException& err);
unordered_map<string, Socket::Ptr> _mapUpdSock;
mutex _mtxUpdSock;
unordered_map<string, unordered_map<void*, onRecvData>> _mapDataHandler;
mutex _mtxDataHandler;
};
} /* namespace mediakit */
#endif /* RTSP_UDPSERVER_H_ */
| 36.716418 | 107 | 0.743902 |
12732fd1d93f383728e35865b37d5c63ca3b7eac | 2,841 | h | C | xianglegou/HenticaLib/Network/Hen_MessageManager.h | lieonCX/XGG | 7af459d3d32535d63e3d6e9126df12db1f3e5724 | [
"MIT"
] | null | null | null | xianglegou/HenticaLib/Network/Hen_MessageManager.h | lieonCX/XGG | 7af459d3d32535d63e3d6e9126df12db1f3e5724 | [
"MIT"
] | null | null | null | xianglegou/HenticaLib/Network/Hen_MessageManager.h | lieonCX/XGG | 7af459d3d32535d63e3d6e9126df12db1f3e5724 | [
"MIT"
] | null | null | null | //
// MessageManager.h
// Vpn
//
// Created by jiwuwang on 15/9/17.
// Copyright (c) 2015年 jiwuwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
#import "Hen_HttpManager.h"
#import "Hen_BaseLoginViewController.h"
///请求结果回调
typedef void(^RequestResultBlock)(NSString* errCode, NSString* errMsg, id data);
///缓存结果回调
typedef void(^CacheResultBlock)(id data);
///上传进度回调
typedef void(^UploadProgressBlock)(CGFloat total, CGFloat current);
///检测更新回调
typedef void(^CheckAppVersonBlock)(BOOL isUpdate, id updateInfo);
///请求类型
typedef NS_ENUM(NSInteger, RequsetType){
RequsetTypeOfNormal = 1, // 普通
RequsetTypeOfCache, // 缓存
RequsetTypeOfImage, // 带图片
RequsetTypeOfImageArray // 多张图片
};
@interface Hen_MessageManager : NSObject
///用户id
@property(nonatomic, strong) NSString *userId;
///Session
@property(nonatomic, strong) NSString *session;
///SignKey
@property(nonatomic, strong) NSString *signKey;
///登录viewController
@property(nonatomic, strong) Hen_BaseLoginViewController *loginVc;
///是否到登录
@property(nonatomic, assign) BOOL isToLogin;
+ (Hen_MessageManager *)shareMessageManager;
///请求数据
- (NSString*)requestWithAction:(NSString *)action
dictionaryParam:(NSDictionary *)param
withResultBlock:(RequestResultBlock)resultBlock;
///请求数据(缓存请求返回数据)
- (NSString*)requestWithAction:(NSString *)action
dictionaryParam:(NSDictionary *)param
cacheFileName:(NSString*)fileName
withResultBlock:(RequestResultBlock)resultBlock
withCacheResultBlock:(CacheResultBlock)cacheBlock;
///请求数据,带图片
- (NSString*)requestWithAction:(NSString *)action
dictionaryParam:(NSDictionary *)param
imageParamName:(NSString*)imageParamName
image:(UIImage *)image
withResultBlock:(RequestResultBlock)resultBlock
withProgressBlock:(UploadProgressBlock)progressBlock;
///请求数据(上传多张图片)
-(NSString*)requestWithAction:(NSString *)action
dictionaryParam:(NSDictionary*)param
imageParameName:(NSString*)imageParameName
imageArray:(NSArray*)imageDatas
withResultBlock:(RequestResultBlock)resultBlock;
///请求数据(上传音频)
-(NSString*)requestWithAction:(NSString*)action
dictionaryParam:(NSDictionary*)parame
voiceParameName:(NSString*)voiceParameName
voiceURLArray:(NSArray*)voiceURLArray
withResultBlock:(RequestResultBlock)resultBlock;
///添加不提示网络错误请求
-(void)addUnNoticeNetworkErrorRequestId:(NSString*)requestId;
///添加不跳转登录请求
-(void)addUnToLoginRequestId:(NSString*)requestId;
///重新请求
-(void)reRequst;
#pragma mark -- 更新
///检测 app 是否跟新时使用
- (void)checkAppIsUpdateAPPID:(NSString *)appid andBlock:(CheckAppVersonBlock)completion;
@end
| 29.28866 | 89 | 0.716297 |
c4aab015ebd85602e8d191a78800c97ed079d489 | 42,717 | h | C | pynrfjprog/docs/jlinkarm_unknown_nrfjprogdll.h | ryanjh/pynrfjprog | 2e08ac42b9f836b5854e8fe3a3010015540e2435 | [
"RSA-MD"
] | null | null | null | pynrfjprog/docs/jlinkarm_unknown_nrfjprogdll.h | ryanjh/pynrfjprog | 2e08ac42b9f836b5854e8fe3a3010015540e2435 | [
"RSA-MD"
] | null | null | null | pynrfjprog/docs/jlinkarm_unknown_nrfjprogdll.h | ryanjh/pynrfjprog | 2e08ac42b9f836b5854e8fe3a3010015540e2435 | [
"RSA-MD"
] | null | null | null | /*
* Copyright (c) 2010 - 2018, Nordic Semiconductor ASA
* 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, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, 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 Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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 JLINKARM_UNKNOWN_NRFJPROGDLL_H
#define JLINKARM_UNKNOWN_NRFJPROGDLL_H
#include <stdint.h>
#include "DllCommonDefinitions.h"
#if defined(__cplusplus)
extern "C" {
#endif
/**
* @brief Returns the JLinkARM DLL version.
*
* @details Returns the JLinkARM DLL version that has been opened in with the NRFJPROG_open_dll() function.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
*
* @param major Pointer for storing of dll major version.
* @param minor Pointer for storing of dll minor version.
* @param revision Pointer for storing of dll revision.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* @retval INVALID_PARAMETER The major parameter is NULL.
* The minor parameter is NULL.
* The revision parameter is NULL.
*/
nrfjprogdll_err_t NRFJPROG_dll_version(uint32_t * major, uint32_t * minor, char * revision);
/**
* @brief Checks if the JLinkARM DLL is open.
*
* @details Checks if the NRFJPROG_open_dll() function has been called since the last call to NRFJPROG_close_dll() or since the loading of this dll.
*
* @param opened Pointer of the location to store the result.
*
* @retval SUCCESS
* @retval INVALID_PARAMETER The opened parameter is NULL.
*/
nrfjprogdll_err_t NRFJPROG_is_dll_open(bool * opened);
/**
* @brief Opens the JLinkARM DLL and sets the log callback. Prepares the dll for work with an nRF device.
*
* @details This function opens the JLinkARM DLL using the received path. The path should include the name of the DLL
* itself (i.e. "JLinkARM.dll"). Only JLinkARM DLLs whose versions are greater than a minimum version will be
* accepted. The minimum version for the JLinkARM DLL is defined in MIN_JLINK_MAJOR_VERSION and
* MIN_JLINK_MINOR_VERSION defines. The log callback may be NULL. In that case no logging mechanism is provided.
* The msg_callback typedef is defined elsewhere in this file. To close the dll, see NRFJPROG_close_dll() function.
*
* @pre Before the execution of this function, the dll must not be open. To close the dll, see NRFJPROG_close_dll() function.
*
* @post After the execution of this function, the JLINKARM DLL pointers will be loaded and some memory reserved. To unload the pointers and free the memory, see NRFJPROG_close_dll() function.
*
* @param jlink_path Path to the JLinkARM DLL. Does not support unicode paths. If NULL or nullptr, nrfjprog will attempt to find the newest installed J-Link Dll.
* @param cb Callback for reporting informational and error messages.
* @param family Defines the device family the next commands are going to be called to.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has already been called.
* @retval INVALID_PARAMETER The provided device family is not supported by this DLL.
* @retval JLINKARM_DLL_TOO_OLD The version of JLinkARM is lower than the minimum version required.
* @retval JLINKARM_DLL_NOT_FOUND The jlink_path did not yield a usable DLL, or the automatic search failed.
* @retval JLINKARM_DLL_COULD_NOT_BE_OPENED An error occurred while opening the JLinkARM DLL.
* A required function could not be loaded from the DLL.
*/
nrfjprogdll_err_t NRFJPROG_open_dll(const char * jlink_path, msg_callback * cb, device_family_t family);
/**
* @brief Closes and frees the JLinkARM DLL.
*
* @details Closes and frees the JLinkARM DLL. This function needs to be called before exiting if NRFJPROG_open_dll() has been called.
* After the execution of this function, the device CPU will not change its state from running or halted.
*
* @post After the execution of this function, the JLINKARM DLL function pointers will be unloaded and the reserved memory freed. To open the dll, see NRFJPROG_open_dll() function.
* @post After the execution of this function, the device will not be in debug interface mode. To enter debug interface mode, see NRFJPROG_connect_to_device() function.
* @post After the execution of this function, the PC will be disconnected from an emulator. To connect to an emulator, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*/
void NRFJPROG_close_dll(void);
/**
* @brief Enumerates all comports connected to a given Segger debug probe
*
* @details This function finds all com ports hosted by a given debug probe.
* The number of com ports found is written into the num_com_ports parameter. It also copies
* up to com_ports_len com_port_info_t objects into the com_ports array parameter.
*
* @param serial_number Serial number of the debug probe to find the com port of.
* @param com_ports Array in which to store the enumerated com ports.
* @param com_ports_len Number of com_port_info_t values that can be stored in the
* com_ports array.
* @param num_com_ports The number of com ports that were discovered.
*
* @retval SUCCESS
* @retval INTERNAL_ERROR An internal error has occured.
* @retval INVALID_PARAMETER The com_ports parameter is NULL.
* The com_ports_len parameter is 0.
* The num_available parameter is NULL.
**/
nrfjprogdll_err_t NRFJPROG_enum_emu_com(uint32_t serial_number, com_port_info_t com_ports[], uint32_t com_ports_len, uint32_t * num_com_ports);
/**
* @brief Enumerates the serial numbers of connected USB J-Link emulators.
*
* @details This function asks the JLinkARM DLL how many USB J-Link emulators are connected to
* the PC, and writes that value into the num_available parameter. It also copies
* up to serial_numbers_len serial numbers into the serial_numbers array parameter.
* The function can be called with serial_numbers set to NULL and serial_numbers_len
* set to zero to obtain the number of connected emulators.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
*
* @param serial_numbers Array in which to store the enumerated serial numbers.
* @param serial_numbers_len Number of uint32_t values that can be stored in the
* serial_numbers array (may be zero).
* @param num_available The number of serial numbers that were enumerated.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
* @retval INVALID_PARAMETER The serial_numbers parameter is NULL but serial_numbers_len is > 0.
* The num_available parameter is NULL.
* @retval OUT_OF_MEMORY Memory could not be allocated for the operation.
*/
nrfjprogdll_err_t NRFJPROG_enum_emu_snr(uint32_t serial_numbers[], uint32_t serial_numbers_len, uint32_t * num_available);
/**
* @brief Checks if the emulator has an established connection with Segger emulator/debugger.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
*
* @param is_pc_connected_to_emu Pointer of the location to store the result.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* @retval INVALID_PARAMETER The is_connected_to_emu pointer is NULL.
*/
nrfjprogdll_err_t NRFJPROG_is_connected_to_emu(bool * is_pc_connected_to_emu);
/**
* @brief Connects to a given emulator/debugger.
*
* @details This function connects to serial_number emulator and sets the SWD communication speed at clock_speed_in_khz.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must not be established. To disconnect from an emulator, see NRFJPROG_disconnect_from_emu() function.
* @pre Before the execution of this function, the emulator must be physically connected to a powered board.
*
* @post After the execution of this function, the PC will be connected to an emulator. To disconnect to the emulator, see NRFJPROG_disconnect_from_emu() and NRFJPROG_close_dll() functions.
*
* @param serial_number Serial number of the emulator to connect to.
* @param clock_speed_in_khz Speed for the SWD communication. It must be between JLINKARM_SWD_MIN_SPEED_KHZ
* and JLINKARM_SWD_MAX_SPEED_KHZ defined in DllCommonDefinitions.h. If the emulator
* does not support the input clock_speed, the emulators maximum supported speed
* will be used.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() has already been called.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
* @retval LOW_VOLTAGE Low voltage was detected at the target device.
* @retval INVALID_PARAMETER The clock_speed_in_khz parameter is not within limits.
* @retval EMULATOR_NOT_CONNECTED The serial_number emulator is not connected to the PC.
*/
nrfjprogdll_err_t NRFJPROG_connect_to_emu_with_snr(uint32_t serial_number, uint32_t clock_speed_in_khz);
/**
* @brief Connects to an emulator/debugger.
*
* @details This function connects to an available emulator and sets the SWD communication speed at clock_speed_in_khz.
* If more than one emulator is available, a pop-up window will appear to make a selection.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must not be established. To disconnect from an emulator, see NRFJPROG_disconnect_from_emu() function.
* @pre Before the execution of this function, the emulator must be physically connected to a powered board.
*
* @post After the execution of this function, the PC will be connected to an emulator. To disconnect to the emulator, see NRFJPROG_disconnect_from_emu() and NRFJPROG_close_dll() functions.
*
* @param clock_speed_in_khz Speed for the SWD communication. It must be between JLINKARM_SWD_MIN_SPEED_KHZ
* and JLINKARM_SWD_MAX_SPEED_KHZ defined in DllCommonDefinitions.h. If the emulator
* does not support the input clock_speed, the emulators maximum supported speed
* will be used.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() has already been called.
* @retval NO_EMULATOR_CONNECTED There is no emulator connected to the PC.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
* @retval LOW_VOLTAGE Low voltage was detected at the target device.
* @retval INVALID_PARAMETER The clock_speed_in_khz parameter is not within limits.
*/
nrfjprogdll_err_t NRFJPROG_connect_to_emu_without_snr(uint32_t clock_speed_in_khz);
/**
* @brief Attempts to reset the connected J-Link OB.
*
* @details Resets and reconnects to the J-Link OB.
This operation is only available in debug probes of type J-Link OB-SAM3U128-V2-NordicSemi.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection,
* see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @post After the execution of this function, the PC will still be connected to the emulator.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() has not been called.
* @retval INVALID_DEVICE_FOR_OPERATION The connected debug probe does not support the ResetJLink command.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error, check log for details.
* @retval EMULATOR_NOT_CONNECTED The emulator did not successfully reenumerate within 10s after the reset.
*/
nrfjprogdll_err_t NRFJPROG_reset_connected_emu(void);
/**
* @brief Replaces the firmware on the connected J-Link debug probe.
*
* @details Replaces the firmware on the selected debug probe.
* The debug probe firmware is replaced with the fw version that shipped with the J-Link DLL selected in open_dll()
* even if a newer version is already present.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection,
* see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @post After the execution of this function, the debug probe will have been reset.
* @post After the execution of this function, the PC will still be connected to the emulator.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() has not been called.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error, check log for details.
* @retval EMULATOR_NOT_CONNECTED The emulator did not successfully reenumerate within 10s after the reset.
*/
nrfjprogdll_err_t NRFJPROG_replace_connected_emu_fw(void);
/**
* @brief Reads the serial number of the emulator connected to.
*
* @details Reads the serial number of the emulator connected to.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() function has not been called.
* @retval INVALID_PARAMETER The serial_number pointer is NULL.
*/
nrfjprogdll_err_t NRFJPROG_read_connected_emu_snr(uint32_t * serial_number);
/**
* @brief Reads the firmware identification string of the emulator connected to.
*
* @details This function reads the firmware identification string of the emulator connected to into the
* given buffer. The function will read a maximum of buffer_size-1 characters into the buffer, and 0-terminate it.
* Any excess characters are not read.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @param buffer Pointer to buffer to contain the firmware string.
* @param buffer_size Size of the buffer. The user is responsible for ensuring a big enough buffer. A 255 byte buffer is suggested.
* Maximum buffer_size value is INT_MAX (2147483647).
*
* @retval SUCCESS
* @retval INVALID_OPERATION NRFJPROG_open_dll() function has not been called.
* NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() has not been called.
* @retval INVALID_PARAMETER The character buffer pointer is a NULL-pointer.
*/
nrfjprogdll_err_t NRFJPROG_read_connected_emu_fwstr(char * buffer, uint32_t buffer_size);
/**
* @brief Disconnects from an emulator.
*
* @details This function disconnects from a connected emulator. This also disconnects from a connected device if connected. Will
* not fail if we have never connected to an emulator. After the execution of this function, the device CPU will not change
* its state from running or halted.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
*
* @post After the execution of this function, the device will not be in debug interface mode. To enter debug interface mode, see NRFJPROG_connect_to_device() function.
* @post After the execution of this function, the PC will be disconnected from an emulator. To connect to an emulator, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
*/
nrfjprogdll_err_t NRFJPROG_disconnect_from_emu(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_coprocessor_enabled(coprocessor_t coprocessor, bool * is_coprocessor_enabled);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_enable_coprocessor(coprocessor_t coprocessor);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_disable_coprocessor(coprocessor_t coprocessor);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_select_coprocessor(coprocessor_t coprocessor);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_recover(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_connected_to_device(bool * is_emu_connected_to_device);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_connect_to_device(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_disconnect_from_device(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_readback_protect(readback_protection_status_t desired_protection);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_readback_status(readback_protection_status_t * status);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_region_0_size_and_source(uint32_t * size, region_0_source_t * source);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_debug_reset(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_sys_reset(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_pin_reset(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_disable_bprot(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_bprot_enabled(bool * bprot_enabled, uint32_t address_start, uint32_t length);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_erase_all(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_erase_page(uint32_t addr);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_erase_uicr(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_write_u32(uint32_t addr, uint32_t data, bool nvmc_control);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_u32(uint32_t addr, uint32_t * data);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_write(uint32_t addr, const uint8_t * data, uint32_t data_len, bool nvmc_control);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read(uint32_t addr, uint8_t * data, uint32_t data_len);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_halted(bool * is_device_halted);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_halt(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_run(uint32_t pc, uint32_t sp);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_go(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_step(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_ram_sections_count(uint32_t * ram_sections_count);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_ram_sections_size(uint32_t * ram_sections_size, uint32_t ram_sections_size_len);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_ram_sections_power_status(ram_section_power_status_t * ram_sections_power_status, uint32_t ram_sections_power_status_len);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_ram_powered(ram_section_power_status_t * ram_sections_power_status, uint32_t ram_sections_power_status_array_size, uint32_t * ram_sections_number, uint32_t * ram_sections_size);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_power_ram_all(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_unpower_ram_section(uint32_t section_index);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_cpu_register(cpu_registers_t register_name, uint32_t * register_value);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_write_cpu_register(cpu_registers_t register_name, uint32_t register_value);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_device_version(device_version_t * version);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_read_device_info(device_version_t * version, device_name_t * name, device_memory_t * memory, device_revision_t * revision);
/**
* @brief Reads the family of the device connected to the emulator.
*
* @details Reads the family of the device connected to the emulator by the use of NRFJPROG_read_access_port_register() function.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @post After the execution of this function, the device will be in debug interface mode. To exit debug interface mode, see the appropriate family header file for functions that can take the device out of debug interface mode.
*
* @param family Pointer of the location to store the device family.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() function has not been called.
* @retval INVALID_PARAMETER The family parameter is null.
* @retval UNKNOWN_DEVICE Family identification failed.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
*/
nrfjprogdll_err_t NRFJPROG_read_device_family(device_family_t * family);
/**
* @brief Reads a debug port register.
*
* @details Reads into data pointer a debug port register.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @param reg_addr Register address to read, either in debug port or access port.
* @param data Pointer of the location to store the value read.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() function has not been called.
* @retval INVALID_PARAMETER The data parameter is null.
* The register address is not 32-bit aligned.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
*/
nrfjprogdll_err_t NRFJPROG_read_debug_port_register(uint8_t reg_addr, uint32_t * data);
/**
* @brief Writes a debug port register.
*
* @details Writes data parameter into a debug port register.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @param reg_addr Register address to write, either in debug port or access port.
* @param data Data to write into the register.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() function has not been called.
* @retval INVALID_PARAMETER The data parameter is null.
* The register address is not 32-bit aligned.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
*/
nrfjprogdll_err_t NRFJPROG_write_debug_port_register(uint8_t reg_addr, uint32_t data);
/**
* @brief Reads a debugger access port register.
*
* @details Reads into data pointer a debugger access port register.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @post After the execution of this function, the device will be in debug interface mode. To exit debug interface mode, see NRFJPROG_pin_reset(), NRFJPROG_disconnect_from_emu() and NRFJPROG_close_dll() functions.
*
* @param ap_index Access port index for read if ap_access.
* @param reg_addr Register address to read, either in debug port or access port.
* @param data Pointer of the location to store the value read.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() function has not been called.
* @retval INVALID_PARAMETER The data parameter is null.
* The register address is not 32-bit aligned.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
*/
nrfjprogdll_err_t NRFJPROG_read_access_port_register(uint8_t ap_index, uint8_t reg_addr, uint32_t * data);
/**
* @brief Writes a debugger access port register.
*
* @details Writes data parameter into a debugger access port register.
*
* @pre Before the execution of this function, the dll must be open. To open the dll, see NRFJPROG_open_dll() function.
* @pre Before the execution of this function, a connection to the emulator must be established. To establish a connection, see NRFJPROG_connect_to_emu_with_snr() and NRFJPROG_connect_to_emu_without_snr() functions.
*
* @post After the execution of this function, the device will be in debug interface mode. To exit debug interface mode, see NRFJPROG_pin_reset(), NRFJPROG_disconnect_from_emu() and NRFJPROG_close_dll() functions.
*
* @param ap_index Access port index for write if ap_access.
* @param reg_addr Register address to write, either in debug port or access port.
* @param data Data to write into the register.
*
* @retval SUCCESS
* @retval INVALID_OPERATION The NRFJPROG_open_dll() function has not been called.
* The NRFJPROG_connect_to_emu_with_snr() or NRFJPROG_connect_to_emu_without_snr() function has not been called.
* @retval INVALID_PARAMETER The data parameter is null.
* The register address is not 32-bit aligned.
* @retval JLINKARM_DLL_ERROR The JLinkARM DLL function returned an error.
*/
nrfjprogdll_err_t NRFJPROG_write_access_port_register(uint8_t ap_index, uint8_t reg_addr, uint32_t data);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_rtt_started(bool * started);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_set_control_block_address(uint32_t address);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_start(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_is_control_block_found(bool * is_control_block_found);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_stop(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_read(uint32_t up_channel_index, char * data, uint32_t data_len, uint32_t * data_read);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_write(uint32_t down_channel_index, const char * data, uint32_t data_len, uint32_t * data_written);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_read_channel_count(uint32_t * down_channel_number, uint32_t * up_channel_number);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_rtt_read_channel_info(uint32_t channel_index, rtt_direction_t dir, char * channel_name, uint32_t channel_name_len, uint32_t * channel_size);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_is_qspi_init(bool * initialized);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_qspi_init(bool retain_ram, const qspi_init_params_t * init_params);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_qspi_uninit(void);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_qspi_read(uint32_t addr, uint8_t * data, uint32_t data_len);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_qspi_write(uint32_t addr, const uint8_t * data, uint32_t data_len);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_qspi_erase(uint32_t addr, qspi_erase_len_t length);
/**
* @brief Operation not available without a known family.
*
* @retval INVALID_OPERATION This function cannot be executed without a known family.
*/
nrfjprogdll_err_t NRFJPROG_qspi_custom(uint8_t instruction_code,
uint32_t instruction_length,
const uint8_t * data_in,
uint8_t * data_out);
#if defined(__cplusplus)
}
#endif
#endif /* JLINKARM_UNKNOWN_NRFJPROGDLL_H */
| 47.622074 | 230 | 0.695554 |
160bd2f05427dfdb840ea5b9163e947dd78adf9f | 2,768 | c | C | Devices/Commisioned_Outlet/Outlet.c | afugs98/SmartHome | ffe5926b8eb632a84a6f57c072d67eb6b3ceb9af | [
"MIT"
] | null | null | null | Devices/Commisioned_Outlet/Outlet.c | afugs98/SmartHome | ffe5926b8eb632a84a6f57c072d67eb6b3ceb9af | [
"MIT"
] | 2 | 2019-06-22T02:39:36.000Z | 2019-06-22T05:22:42.000Z | Devices/Commisioned_Outlet/Outlet.c | afugs98/SmartHome | ffe5926b8eb632a84a6f57c072d67eb6b3ceb9af | [
"MIT"
] | null | null | null | #include "Outlet.h"
const int outlet_gpio = 0; // 0 for the cheap relay modules
bool outletStatus = false;
homekit_characteristic_t name = HOMEKIT_CHARACTERISTIC_(NAME, "Outlet safety"); // Deals with the auto gen name
homekit_characteristic_t switch_outlet_in_use = HOMEKIT_CHARACTERISTIC_(OUTLET_IN_USE, true); // Gotta have the outlet in use
void outlet_write(bool on)
{
gpio_write(outlet_gpio, on ? 0 : 1);
}
void outlet_init()
{
gpio_enable(outlet_gpio, GPIO_OUTPUT);
outlet_write(outletStatus);
}
void outlet_identify_task(void *_args)
{
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 2; j++)
{
outlet_write(true);
vTaskDelay(100 / portTICK_PERIOD_MS);
outlet_write(false);
vTaskDelay(100 / portTICK_PERIOD_MS);
}
vTaskDelay(250 / portTICK_PERIOD_MS);
}
outlet_write(outletStatus);
vTaskDelete(NULL);
}
void outlet_identify(homekit_value_t _value)
{
printf("LED identify\n");
xTaskCreate(outlet_identify_task, "LED identify", 128, NULL, 2, NULL);
}
homekit_value_t outlet_on_get()
{
return HOMEKIT_BOOL(outletStatus);
}
void outlet_on_set(homekit_value_t value)
{
if(value.format != homekit_format_bool)
{
printf("Invalid value format: %d\n", value.format);
return;
}
outletStatus = value.bool_value;
printf("------------------- Outlet status: %d\n", outletStatus);
outlet_write(outletStatus);
}
homekit_accessory_t * CreateOutlet()
{
// accessory name suffix.
uint8_t macaddr[6];
sdk_wifi_get_macaddr(STATION_IF, macaddr);
int name_len = snprintf(NULL, 0, "Outlet-%02X%02X%02X", macaddr[3], macaddr[4], macaddr[5]);
char *name_value = malloc(name_len + 1);
snprintf(name_value, name_len + 1, "Outlet-%02X%02X%02X", macaddr[3], macaddr[4], macaddr[5]);
name.value = HOMEKIT_STRING(name_value);
homekit_accessory_t *ptr = HOMEKIT_ACCESSORY(.id = 1, .category = homekit_accessory_category_outlet, .services=(homekit_service_t*[]){
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]){
&name,
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "TrapHouse"),
HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, "137A3BRCF11A"),
HOMEKIT_CHARACTERISTIC(MODEL, "OutletGen1"),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "4.20"),
HOMEKIT_CHARACTERISTIC(IDENTIFY, outlet_identify),
NULL
}),
HOMEKIT_SERVICE(OUTLET, .primary=true, .characteristics=(homekit_characteristic_t*[]){
HOMEKIT_CHARACTERISTIC(NAME, "Outlet"),
&switch_outlet_in_use,
HOMEKIT_CHARACTERISTIC(
ON, false,
.getter=outlet_on_get,
.setter=outlet_on_set
),
NULL
}),
NULL
});
outlet_init();
return ptr;
}
;
| 27.405941 | 137 | 0.684971 |
3fa4f8a9a908c08e70d10febc1abeedb47e19f88 | 3,571 | c | C | GnuWin32/calc/src/calc/2.11.10.1/calc-2.11.10.1/have_varvs.c | hyller/GladiatorLibrary | 38d99f345db80ebb00116e54c91eada7968fa447 | [
"Unlicense"
] | 7 | 2018-07-22T14:29:58.000Z | 2021-05-03T04:40:13.000Z | GnuWin32/calc/src/calc/2.11.10.1/calc-2.11.10.1/have_varvs.c | hyller/GladiatorLibrary | 38d99f345db80ebb00116e54c91eada7968fa447 | [
"Unlicense"
] | null | null | null | GnuWin32/calc/src/calc/2.11.10.1/calc-2.11.10.1/have_varvs.c | hyller/GladiatorLibrary | 38d99f345db80ebb00116e54c91eada7968fa447 | [
"Unlicense"
] | 5 | 2019-02-13T14:50:51.000Z | 2020-07-24T09:05:22.000Z | /*
* have_varvs - try <varargs.h> to see if it really works with vsprintf()
*
* Copyright (C) 1999 Landon Curt Noll
*
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* Calc 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.
*
* A copy of version 2.1 of the GNU Lesser General Public License is
* distributed with calc under the filename COPYING-LGPL. You should have
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* @(#) $Revision: 29.2 $
* @(#) $Id: have_varvs.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/have_varvs.c,v $
*
* Under source code control: 1995/09/09 22:41:10
* File existed as early as: 1995
*
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/
/*
* Some systems have bugs in the <varargs.h> implementation that show up in
* vsprintf(), so we may have to try to use sprintf() as if it were vsprintf()
* and hope for the best.
*
* This program will output #defines and exits 0 if vsprintf() (or sprintf())
* produces the results that we expect. This program exits 1 if vsprintf()
* (or sprintf()) produces unexpected results while using the <stdarg.h>
* include file.
*/
#include <stdio.h>
#include "have_unistd.h"
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include "have_string.h"
#ifdef HAVE_STRING_H
# include <string.h>
#endif
char buf[BUFSIZ];
#if !defined(STDARG) && !defined(SIMULATE_STDARG)
#include <varargs.h>
void
try_this(char *fmt, ...)
{
va_list ap;
va_start(ap);
#if !defined(DONT_HAVE_VSPRINTF)
vsprintf(buf, fmt, ap);
#else
sprintf(buf, fmt, ap);
#endif
va_end(ap);
}
#else
void
try_this(char *a, int b, char *c, int d)
{
return;
}
#endif
int
main(void)
{
/*
* setup
*/
buf[0] = '\0';
/*
* test variable args and vsprintf/sprintf
*/
try_this("@%d:%s:%d@", 1, "hi", 2);
if (strcmp(buf, "@1:hi:2@") != 0) {
#if !defined(DONT_HAVE_VSPRINTF)
/* <varargs.h> with vsprintf() didn't work */
#else
/* <varargs.h> with sprintf() simulating vsprintf() didn't work */
#endif
exit(1);
}
try_this("%s %d%s%d%d %s",
"Landon Noll 1st proved that", 2, "^", 23209, -1, "was prime");
if (strcmp(buf,
"Landon Noll 1st proved that 2^23209-1 was prime") != 0) {
#if !defined(DONT_HAVE_VSPRINTF)
/* <stdarg.h> with vsprintf() didn't work */
#else
/* <stdarg.h> with sprintf() simulating vsprintf() didn't work */
#endif
exit(1);
}
/*
* report the result
*/
puts("/* what type of variable args do we have? */");
puts("#define VARARGS /* use <varargs.h> */");
puts("#include <varargs.h>");
puts("\n/* should we use vsprintf()? */");
#if !defined(DONT_HAVE_VSPRINTF)
puts("#define HAVE_VS /* yes */");
#else
puts("/*");
puts(" * Hack aleart!!!");
puts(" *");
puts(" * Systems that do not have vsprintf() need something. In some");
puts(" * cases the sprintf function will deal correctly with the");
puts(" * va_alist 3rd arg. Hope for the best!");
puts(" */");
puts("#define vsprintf sprintf");
puts("#undef HAVE_VS");
#endif
/* exit(0); */
return 0;
}
| 25.147887 | 78 | 0.652198 |
85491c5d2130f4647fc49490e54a5f1027ce70c9 | 814 | h | C | client/include/game/CCopPed.h | MayconFelipeA/sampvoiceatt | 3fae8a2cf37dfad2e3925d56aebfbbcd4162b0ff | [
"MIT"
] | 368 | 2015-01-01T21:42:00.000Z | 2022-03-29T06:22:22.000Z | client/include/game/CCopPed.h | MayconFelipeA/sampvoiceatt | 3fae8a2cf37dfad2e3925d56aebfbbcd4162b0ff | [
"MIT"
] | 92 | 2019-01-23T23:02:31.000Z | 2022-03-23T19:59:40.000Z | client/include/game/CCopPed.h | MayconFelipeA/sampvoiceatt | 3fae8a2cf37dfad2e3925d56aebfbbcd4162b0ff | [
"MIT"
] | 179 | 2015-02-03T23:41:17.000Z | 2022-03-26T08:27:16.000Z | /*
Plugin-SDK (Grand Theft Auto San Andreas) header file
Authors: GTA Community. See more here
https://github.com/DK22Pac/plugin-sdk
Do not delete this comment block. Respect others' work!
*/
#pragma once
#include "PluginBase.h"
#include "CPed.h"
#include "eCopType.h"
class PLUGIN_API CCopPed : public CPed {
public:
char field_79C;
char field_79D;
private:
char padding[2];
public:
eCopType m_copType;
int field_7A4;
CCopPed *m_pCopPartner;
CPed *m_apCriminalsToKill[5];
char field_7C0;
// we can use modelIds as copType too!
CCopPed(eCopType copType);
void SetPartner(CCopPed* partner);
void AddCriminalToKill(CPed* criminal);
void RemoveCriminalToKill(CPed* likeUnused, int criminalIdx);
void ClearCriminalsToKill();
};
VALIDATE_SIZE(CCopPed, 0x7C4); | 22.611111 | 62 | 0.724816 |
87f928f165cb1f638cdc53f611f0986261867f63 | 623 | h | C | chromium/ui/views/test/platform_test_helper.h | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 27 | 2016-04-27T01:02:03.000Z | 2021-12-13T08:53:19.000Z | chromium/ui/views/test/platform_test_helper.h | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 2 | 2017-03-09T09:00:50.000Z | 2017-09-21T15:48:20.000Z | chromium/ui/views/test/platform_test_helper.h | wedataintelligence/vivaldi-source | 22a46f2c969f6a0b7ca239a05575d1ea2738768c | [
"BSD-3-Clause"
] | 17 | 2016-04-27T02:06:39.000Z | 2019-12-18T08:07:00.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 UI_VIEWS_TEST_PLATFORM_TEST_HELPER_H_
#define UI_VIEWS_TEST_PLATFORM_TEST_HELPER_H_
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
namespace views {
class PlatformTestHelper {
public:
PlatformTestHelper() {}
virtual ~PlatformTestHelper() {}
static scoped_ptr<PlatformTestHelper> Create();
private:
DISALLOW_COPY_AND_ASSIGN(PlatformTestHelper);
};
} // namespace views
#endif // UI_VIEWS_TEST_PLATFORM_TEST_HELPER_H_
| 23.074074 | 73 | 0.783307 |
8f7b8e08cf833bc44a785dd3ffd6946603ca57ab | 5,986 | h | C | Source/SVWidgetsLib/FilterParameterWidgets/ComparisonContainerWidget.h | jmarquisbq/SIMPL | 375653013742cfe9aed603fc9a6bab6d9c96be31 | [
"NRL"
] | null | null | null | Source/SVWidgetsLib/FilterParameterWidgets/ComparisonContainerWidget.h | jmarquisbq/SIMPL | 375653013742cfe9aed603fc9a6bab6d9c96be31 | [
"NRL"
] | null | null | null | Source/SVWidgetsLib/FilterParameterWidgets/ComparisonContainerWidget.h | jmarquisbq/SIMPL | 375653013742cfe9aed603fc9a6bab6d9c96be31 | [
"NRL"
] | null | null | null | /* ============================================================================
* Copyright (c) 2009-2016 BlueQuartz Software, LLC
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither the name of BlueQuartz Software, the US Air Force, 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.
*
* The code contained herein was partially funded by the followig contracts:
* United States Air Force Prime Contract FA8650-07-D-5800
* United States Air Force Prime Contract FA8650-10-D-5210
* United States Prime Contract Navy N00173-07-C-2068
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#pragma once
#include <QtGui/QMouseEvent>
#include <QtWidgets/QFrame>
#include "SIMPLib/Filtering/AbstractComparison.h"
#include "SVWidgetsLib/FilterParameterWidgets/IComparisonWidget.h"
#include "SVWidgetsLib/SVWidgetsLib.h"
#include "ui_ComparisonContainerWidget.h"
class ComparisonSetWidget;
/**
* @brief ComparisonContainerWidget is used to display widgets for AbstractComparisons, edit the comparison's, union operator,
* and allow the widgets to be dragged and reordered between ComparisonSetWidgets
*/
class SVWidgetsLib_EXPORT ComparisonContainerWidget : public QFrame, private Ui::ComparisonContainerWidget
{
Q_OBJECT
public:
ComparisonContainerWidget(QWidget* parent, AbstractComparison::Pointer& comparison);
~ComparisonContainerWidget() override;
/**
* @brief Returns the union operator for this comparison
* @return
*/
int getUnionOperator();
/**
* @brief Sets the union operator for this comparison
* @param unionOperator Union operator to be used by this comparison
*/
void setUnionOperator(int unionOperator);
/**
* @brief Set whether or not the union operator should be shows for this widget
* @param enabled Specifies whether or not the union operator is shown
*/
void showUnionOperator(bool enabled = true);
/**
* @brief Hides the union operator for this widget
*/
void hideUnionOperator();
/**
* @brief Sets the comparison this widget represents
* @param comparison AbstractComparison to be represented by this widget
*/
void setComparison(AbstractComparison::Pointer& comparison);
/**
* @brief Sets the comparison widget to be shown in this widget
* @param widget the IComparisonWidget that stores the AbstractComparison shown
*/
void setComparisonWidget(IComparisonWidget* widget);
/**
* @brief Returns the value of the stored AbstractComparison
* @return
*/
AbstractComparison::Pointer getCurrentComparison();
/**
* @brief Returns the IComparisonWidget displayed
* @return
*/
IComparisonWidget* getComparisonWidget();
/**
* @brief Returns the ComparisonSetWidget this widget belongs to
* @return
*/
ComparisonSetWidget* getComparisonSetWidget();
/**
* @brief Sets a new ComparisonSetWidget to belong to and changes any signal and slot connections to reflect the change
* @param comparisonSetWidget The new ComparisonSetWidget to belong to
*/
void setComparisonSetWidget(ComparisonSetWidget* comparisonSetWidget);
/**
* @brief Selects the current widget and draws a border around it to show which ComparisonContainerWidget is being moved
*/
void select();
/**
* @brief Removes any styling given by select() and clears the selection
*/
void deselect();
/**
* @brief This method does additional GUI widget connections
*/
void setupGui();
public Q_SLOTS:
/**
* @brief Delete this and remove the comparison from the current ComparisonSet
*/
void deleteItem();
Q_SIGNALS:
/**
* @brief Signifies that the comparison stored has changed
*/
void comparisonChanged();
protected:
static ComparisonContainerWidget* SelectedItem; // Currently Selected Widget
static QString BorderStyleSheet(); // Style Sheet Used When Selected
/**
* @brief MousePressEvent
* @param event Move press event
*/
void mousePressEvent(QMouseEvent* event) override;
/**
* @brief MouseMoveEvent
* @param event Mouse move event
*/
void mouseMoveEvent(QMouseEvent* event) override;
/**
* @brief MouseReleaseEvent
* @param event Mouse release event
*/
void mouseReleaseEvent(QMouseEvent* event) override;
protected Q_SLOTS:
/**
* @brief Union operator has been changed in the UI and needs to update the comparison
* @param unionOp New union operator
*/
void unionOperatorChanged(int unionOp);
private:
IComparisonWidget* m_comparisonWidget;
ComparisonSetWidget* m_comparisonSetWidget;
QString m_BaseName;
QPoint m_startDragPoint;
};
| 33.819209 | 126 | 0.727698 |
e909eeb14b88d0266f53a81cdeb8650e09868e9f | 2,838 | h | C | gpvdm_core/include/ray.h | roderickmackenzie/gpvdm | 914fd2ee93e7202339853acaec1d61d59b789987 | [
"BSD-3-Clause"
] | 12 | 2016-09-13T08:58:13.000Z | 2022-01-17T07:04:52.000Z | gpvdm_core/include/ray.h | roderickmackenzie/gpvdm | 914fd2ee93e7202339853acaec1d61d59b789987 | [
"BSD-3-Clause"
] | 3 | 2017-11-11T12:33:02.000Z | 2019-03-08T00:48:08.000Z | gpvdm_core/include/ray.h | roderickmackenzie/gpvdm | 914fd2ee93e7202339853acaec1d61d59b789987 | [
"BSD-3-Clause"
] | 6 | 2019-01-03T06:17:12.000Z | 2022-01-01T15:59:00.000Z | //
// General-purpose Photovoltaic Device Model gpvdm.com - a drift diffusion
// base/Shockley-Read-Hall model for 1st, 2nd and 3rd generation solarcells.
// The model can simulate OLEDs, Perovskite cells, and OFETs.
//
// Copyright 2008-2022 Roderick C. I. MacKenzie https://www.gpvdm.com
// r.c.i.mackenzie at 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.
//
/** @file ray.h
@brief ray tracing header files.
*/
#ifndef ray_h
#define ray_h
#include <enabled_libs.h>
#include <vec.h>
#include <i.h>
#include <sim_struct.h>
#include <triangle.h>
#include <dim.h>
#include <shape_struct.h>
#include <object.h>
#include <gpvdm_const.h>
#include <pthread.h>
struct ray
{
struct vec xy;
struct vec xy_end;
struct vec dir;
int state;
int bounce;
int obj_uid_start; //The ray started in
int parent;
int uid;
double mag;
};
struct ray_worker
{
struct ray *rays;
int nrays;
int nray_max;
int top_of_done_rays;
int l;
int working;
pthread_t thread_han;
int worker_n;
};
struct ray_src
{
double x;
double y;
double z;
int theta_steps;
double theta_start;
double theta_stop;
int phi_steps;
double phi_start;
double phi_stop;
int epi_layer; //epi layer
int light; //light source
int emission_source; //single point or mesh
};
struct image
{
int enabled;
int worker_max;
struct ray_worker *worker;
struct ray_src *ray_srcs;
int n_ray_srcs;
double y_escape_level;
long double *angle;
long double **ang_escape;
int ray_wavelength_points;
double *lam;
int escape_bins;
double ray_lambda_start;
double ray_lambda_stop;
int ray_auto_wavelength_range;
//benchmarking
int tot_rays;
double start_time;
//run control
int ray_auto_run;
int dump_snapshots;
struct dimensions viewpoint_dim;
long double ***viewpoint_image;
};
#endif
| 22.171875 | 81 | 0.743481 |
e971fed6a48f84eb5bf2afd6d045de7d73c82e0c | 9,190 | c | C | cqt_lib/numpy.c | Kocha/try_ctyolo | d0858d6173f18dc29b69af54834625f6b33cdbf0 | [
"MIT"
] | 1 | 2018-08-12T02:09:48.000Z | 2018-08-12T02:09:48.000Z | cqt_lib/numpy.c | Kocha/try_ctyolo | d0858d6173f18dc29b69af54834625f6b33cdbf0 | [
"MIT"
] | null | null | null | cqt_lib/numpy.c | Kocha/try_ctyolo | d0858d6173f18dc29b69af54834625f6b33cdbf0 | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include "cqt.h"
#include "numpy.h"
//see https://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
const NUMPY_HEADER default_numpy_header = {0,0,0,CQT_DTYPE_NONE, 0, {0,0,0,0}};
//x93NUMPY
const unsigned char np_magic[6] = {0x93, 0x4E, 0x55, 0x4D, 0x50, 0x59};
int np_check_header(FILE *fp, NUMPY_HEADER *hp);
int np_parse_header_dic(char *buf, NUMPY_HEADER *hp);
void np_print_heaer_info(const NUMPY_HEADER *hp);
int load_from_numpy(void *dp, const char *numpy_fname, int size, NUMPY_HEADER *hp)
{
FILE *fp;
int ret;
int size_from_shape;
assert(dp!=NULL);
assert(numpy_fname!=NULL);
assert(size > 0);
assert(hp!=NULL);
fp = fopen(numpy_fname, "rb");
if(fp==NULL) {
printf("ERROR:cant'open %s\n", numpy_fname);
return CQT_ERR_NO_FILE;
}
ret = np_check_header(fp, hp);
if(ret != CQT_RET_OK) {
printf("ERROR:numpy header error %s\n", numpy_fname);
return ret;
}
#ifdef DEBUG
printf("load from %s\n", numpy_fname);
//np_print_heaer_info(hp);
#endif
//引数のサイズと、numpyヘッダーのサイズを比較
if(hp->shape[1] == 0) {
size_from_shape = hp->shape[0];
} else if (hp->shape[2] == 0) {
size_from_shape = hp->shape[0] * hp->shape[1];
} else if (hp->shape[3] == 0) {
size_from_shape = hp->shape[0] * hp->shape[1] * hp->shape[2];
} else {
size_from_shape = hp->shape[0] * hp->shape[1] * hp->shape[2] * hp->shape[3];
}
#ifdef DEBUG
printf("size = %d, size_from_shape = %d\n", size, size_from_shape);
#endif
if(size != size_from_shape) {
printf("ERROR:numpy header error %s\n", numpy_fname);
return CQT_NP_HEADER_ERR;
}
switch (hp->descr) {
case CQT_FLOAT32:
assert(sizeof(float)==4);
ret = fread(dp, 4, size, fp);
if (ret != size) {
return CQT_FREAD_ERR;
}
break;
case CQT_UINT8: //fall through
case CQT_FIX8:
ret = fread(dp, 1, size, fp);
if (ret != size) {
return CQT_FREAD_ERR;
}
break;
case CQT_FIX16: //fall through
case CQT_FLOAT16:
ret = fread(dp, 2, size, fp);
if (ret != size) {
return CQT_FREAD_ERR;
}
break;
default:
printf("ERROR:numpy header error dscr = %d\n", hp->descr);
return CQT_NP_HEADER_ERR;
}
fclose(fp);
return CQT_RET_OK;
}
//---------------------------------------------------------------------
// np_check_header
// 機能:numpyファイルのヘッダーチェックし、fpをデータの先頭までseekする
//
// 引数
// fp numpyファイルへのファイルポインタ。ファイル先頭を指していること
// (fopen直後の状態であること)
// hp ヘッダー情報の格納先
//
// 戻り値:
// ヘッダー情報がおかしいとき、CQT_NP_HEADER_ERRを返す。
// ヘッダー情報が問題ない場合は, CQT_RET_OKを返す。
int np_check_header(FILE *fp, NUMPY_HEADER *hp)
{
unsigned char buf[CQT_NP_BUF_SIZE];
int i;
int size;
int ret;
//check magic number
ret = fread(&buf, 1, 6, fp);
if (ret != 6) {
return CQT_FREAD_ERR;
}
for(i=0;i<6;i++) {
if(buf[i]!=np_magic[i]) {
return CQT_NP_HEADER_ERR;
}
}
//version
ret = fread(&buf, 1, 2, fp);
if (ret != 2) {
return CQT_FREAD_ERR;
}
hp->major_version = buf[0];
hp->minor_version = buf[1];
//header_size
ret = fread(&size, 2, 1, fp);
if (ret != 1) {
return CQT_FREAD_ERR;
}
hp->header_len = size;
assert(hp->header_len < CQT_NP_BUF_SIZE-1);
ret = fread(&buf, 1, hp->header_len, fp);
if (ret != hp->header_len) {
return CQT_FREAD_ERR;
}
buf[hp->header_len] = '\0';
ret = np_parse_header_dic((char *)buf, hp);
if(ret != CQT_RET_OK) {
return ret;
}
fseek(fp, 8+2+(hp->header_len), 0);
return CQT_RET_OK;
}
//---------------------------------------------------------------------
// np_check_header
// 機能:numpyのヘッダーに含まれる辞書をパース氏、引数のhpに値を設定素する。
//
// 引数:
// fp numpyファイルへのファイルポインタ。dic先頭を指していること
// fpの値は更新される。
// hp ヘッダー情報の格納先
//
// 戻り値:
// ヘッダー情報がおかしいとき、CQT_NP_HEADER_ERRを返す。
// ヘッダー情報が問題ない場合は, CQT_RET_OKを返す。
int np_parse_header_dic(char *buf, NUMPY_HEADER *hp)
{
char *cp;
const char *delimiter = ",{} ";
int dim = 0;
int ret;
int size;
//info
hp->shape[0] = 0;
hp->shape[1] = 0;
hp->shape[2] = 0;
hp->shape[3] = 0;
cp = strtok((char *)buf, delimiter);
while(cp!=NULL) {
if ((*cp == ' ') || *cp == '{') {
cp = strtok(NULL, delimiter);
continue;
}
if(strstr(cp, "'descr':")!=NULL) {
cp = strtok(NULL, delimiter);
if(strstr(cp, "'<f4'")!=NULL) {
hp->descr = CQT_FLOAT32;
} else if(strstr(cp, "'|u1'")!=NULL) {
hp->descr = CQT_UINT8;
} else if(strstr(cp, "'<i2'")!=NULL) {
hp->descr = CQT_FIX16;
} else if(strstr(cp, "'|i1'")!=NULL) {
hp->descr = CQT_FIX8;
} else if (strstr(cp, "'<f2'")!=NULL) {
hp->descr = CQT_FLOAT16;
} else{
printf("ERROR unkown descr %s\n", cp);
return CQT_NP_HEADER_ERR;
}
} else if(strstr(cp, "'fortran_order'")!=NULL) {
cp = strtok(NULL, delimiter);
//一文字目で判断
if(*cp=='F') {
hp->fortran_order = false;
} else {
printf("ERROR unsupported fortran_order %s\n", cp);
return CQT_NP_HEADER_ERR;
}
} else if(strstr(cp, "'shape':")!=NULL) {
do {
cp = strtok(NULL, delimiter);
//要素数が1の時は終了
if(*cp==')') break;
//(はスペースでつぶす
if(*cp=='(') *cp = ' ';
ret = sscanf(cp, "%d", &size);
if(ret!=1) {
printf("ERROR unsupported shape %s\n", cp);
return CQT_NP_HEADER_ERR;
}
//hp->shapeがサイズ4の配列だから。
if(dim>4) {
printf("ERROR unsupported shape %s\n", cp);
return CQT_NP_HEADER_ERR;
}
hp->shape[dim] = size;
dim++;
} while(strstr(cp, ")")==NULL);
}
cp = strtok(NULL, delimiter);
}
return CQT_RET_OK;
}
void np_print_heaer_info(const NUMPY_HEADER *hp)
{
printf("major_version=%d, ", hp->major_version);
printf("minor_version=%d\n", hp->minor_version);
printf("HEADER LEN=%d\n", hp->header_len);
printf("descr=");
switch(hp->descr) {
case CQT_INT32:
printf("int32");
break;
case CQT_FLOAT32:
printf("float32");
break;
case CQT_QINT8:
printf("qint8");
break;
case CQT_FIX16:
printf("fix16");
break;
case CQT_FIX8:
printf("fix8");
break;
case CQT_DTYPE_NONE:
printf("none");
break;
default:
printf("\nERROR unkown descr = %d", hp->descr);
}
printf("\n");
if(hp->fortran_order) {
printf("fortran_order=True\n");
} else {
printf("fortran_order=False\n");
}
printf("shape = (%d, %d, %d, %d)\n", hp->shape[0], hp->shape[1], hp->shape[2], hp->shape[3]);
}
int save_to_numpy(void *dp, const char *numpy_fname, NUMPY_HEADER *hp)
{
FILE *fp;
unsigned char buf[CQT_NP_BUF_SIZE];
int i;
int len;
char *descr;
char *type_float = "<f4";
char *type_fix16 = "<i2";
char *type_fix8 = "|i1";
int size_from_shape;
int data_size;
assert(dp!=NULL);
assert(numpy_fname!=NULL);
assert(hp!=NULL);
assert(hp->shape[0] != 0);
assert(hp->fortran_order == false);
//引数のサイズと、numpyヘッダーのサイズを比較
if(hp->shape[1] == 0) {
size_from_shape = hp->shape[0];
} else if (hp->shape[2] == 0) {
size_from_shape = hp->shape[0] * hp->shape[1];
} else if (hp->shape[3] == 0) {
size_from_shape = hp->shape[0] * hp->shape[1] * hp->shape[2];
} else {
size_from_shape = hp->shape[0] * hp->shape[1] * hp->shape[2] * hp->shape[3];
}
fp = fopen(numpy_fname, "wb");
if(fp==NULL) {
printf("ERROR:cant'open %s\n", numpy_fname);
return CQT_ERR_NO_FILE;
}
//write magic number
fwrite(np_magic, 1, 6, fp);
//version
fwrite(&(hp->major_version), 1, 1, fp);
fwrite(&(hp->minor_version), 1, 1, fp);
//size
fwrite(&(hp->header_len), 2, 1, fp);
//dictionary
//padding
for(i=0;i<CQT_NP_BUF_SIZE;i++) {
buf[i] = ' ';
}
if(hp->descr == CQT_FLOAT32) {
descr = type_float;
data_size = 4;
} else if(hp->descr == CQT_FIX16) {
descr = type_fix16;
data_size = 2;
} else if(hp->descr == CQT_FIX8) {
descr = type_fix8;
data_size = 1;
} else {
printf("ERROR unkown descr %d\n", hp->descr);
return CQT_NP_HEADER_ERR;
}
//{'descr': '<f4', 'fortran_order': False, 'shape': (32,), }
if(hp->shape[1] == 0) {
len = sprintf((char *)buf, "{'descr': '%s', 'fortran_order': False, 'shape': (%d,), }", descr, hp->shape[0]);
} else if(hp->shape[2] == 0) {
len = sprintf((char *)buf, "{'descr': '%s', 'fortran_order': False, 'shape': (%d, %d), }", descr, hp->shape[0], hp->shape[1]);
} else if(hp->shape[3] == 0) {
len = sprintf((char *)buf, "{'descr': '%s', 'fortran_order': False, 'shape': (%d, %d, %d), }", descr, hp->shape[0], hp->shape[1], hp->shape[2]);
} else {
len = sprintf((char *)buf, "{'descr': '%s', 'fortran_order': False, 'shape': (%d, %d, %d, %d), }", descr, hp->shape[0], hp->shape[1], hp->shape[2], hp->shape[3]);
}
assert(len!=0);
buf[len] = ' ';
buf[hp->header_len-1] = '\n';
fwrite(buf,1, hp->header_len, fp);
fwrite(dp, data_size, size_from_shape, fp);
fclose(fp);
return CQT_RET_OK;
}
| 23.265823 | 166 | 0.567682 |
d4185fd494f1530c007123b34fb8034844d427c3 | 383 | h | C | HealthFeedSDKPod/Model/Profile/MedicalHistory/HFCodeStartEndPointTime.h | 95krasovsky/HealthFeedSDKPod | 24574cf227c64fd2522614a9aa5b6990d452acd5 | [
"MIT"
] | 1 | 2016-06-23T18:58:58.000Z | 2016-06-23T18:58:58.000Z | HealthFeedSDKPod/Model/Profile/MedicalHistory/HFCodeStartEndPointTime.h | 95krasovsky/HealthFeedSDKPod | 24574cf227c64fd2522614a9aa5b6990d452acd5 | [
"MIT"
] | null | null | null | HealthFeedSDKPod/Model/Profile/MedicalHistory/HFCodeStartEndPointTime.h | 95krasovsky/HealthFeedSDKPod | 24574cf227c64fd2522614a9aa5b6990d452acd5 | [
"MIT"
] | null | null | null | //
// HFCodeStartEndPointTime.h
// HealthFeedApp
//
// Created by Aravind Kilaru on 6/8/16.
// Copyright © 2016 softteco. All rights reserved.
//
#import "HFBaseCode.h"
@interface HFCodeStartEndPointTime : HFBaseCode
@property(nonatomic, strong)NSDate *startDateTime;
@property(nonatomic, strong)NSDate *eventDateTime;
@property(nonatomic, strong)NSDate *pointDateTime;
@end
| 21.277778 | 51 | 0.759791 |
6acd93614fee29ae3fb94f419bda73e60d6d8028 | 1,617 | h | C | WeChat-Headers/WCPayChooseCardViewController.h | RockerHX/FishChat | d47f3228dd1f05a7547300330adfe45a09e0175d | [
"MIT"
] | 678 | 2017-11-17T08:33:19.000Z | 2022-03-26T10:40:20.000Z | WeChat-Headers/WCPayChooseCardViewController.h | 274077005/FishChat | 5432fbc1a9be0c886b2d5800e28118c11df1f0c0 | [
"MIT"
] | 22 | 2019-04-16T05:51:53.000Z | 2021-11-08T06:18:45.000Z | WeChat-Headers/WCPayChooseCardViewController.h | 274077005/FishChat | 5432fbc1a9be0c886b2d5800e28118c11df1f0c0 | [
"MIT"
] | 170 | 2018-06-10T07:59:20.000Z | 2022-03-22T16:19:33.000Z | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "WCPayBaseViewController.h"
#import "UITableViewDataSource.h"
#import "UITableViewDelegate.h"
@class MMTableView, NSMutableArray, NSString, UITableViewCell, WCPayBindCardInfo;
@interface WCPayChooseCardViewController : WCPayBaseViewController <UITableViewDelegate, UITableViewDataSource>
{
NSMutableArray *m_arrAvailableCards;
UITableViewCell *m_oCellForAddCard;
WCPayBindCardInfo *m_oSeletedCard;
MMTableView *m_tableView;
id <WCPayChooseCardViewControllerDelegate> _m_delegate;
}
@property(nonatomic) __weak id <WCPayChooseCardViewControllerDelegate> m_delegate; // @synthesize m_delegate=_m_delegate;
- (void).cxx_destruct;
- (id)getChargeRateStr:(id)arg1;
- (id)getCardName:(id)arg1;
- (void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2;
- (id)tableView:(id)arg1 willSelectRowAtIndexPath:(id)arg2;
- (double)tableView:(id)arg1 heightForHeaderInSection:(long long)arg2;
- (id)tableView:(id)arg1 viewForHeaderInSection:(long long)arg2;
- (id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2;
- (long long)tableView:(id)arg1 numberOfRowsInSection:(long long)arg2;
- (long long)numberOfSectionsInTableView:(id)arg1;
- (void)didReceiveMemoryWarning;
- (void)viewDidLoad;
- (id)initWithPayData:(id)arg1 selected:(id)arg2;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| 35.152174 | 121 | 0.782313 |
8de31b5ba3c0ced7057783a8a6b799e558214367 | 10,488 | h | C | third_party/cypress/release/BT/apps/demo/dual_hf_a2dp/dual_a2dp_hfp_audio.h | h-hys/rk2108_202012_SDK | c0880365a8eb208979df0a45ae350c8fe8f565c6 | [
"Apache-2.0"
] | null | null | null | third_party/cypress/release/BT/apps/demo/dual_hf_a2dp/dual_a2dp_hfp_audio.h | h-hys/rk2108_202012_SDK | c0880365a8eb208979df0a45ae350c8fe8f565c6 | [
"Apache-2.0"
] | 1 | 2021-08-19T10:47:10.000Z | 2021-08-19T10:47:10.000Z | third_party/cypress/release/BT/apps/demo/dual_hf_a2dp/dual_a2dp_hfp_audio.h | h-hys/rk2108_202012_SDK | c0880365a8eb208979df0a45ae350c8fe8f565c6 | [
"Apache-2.0"
] | 3 | 2021-04-24T23:33:56.000Z | 2022-01-14T07:13:38.000Z | /*
* $ Copyright Cypress Semiconductor $
*/
/*
* @file:dual_a2dp_hfp_audio.h
*
* This file contains definitions required for implementing an
* application framework that can handle multiple profiles
* simultaneously or according to policy definitions.
*/
#pragma once
#include "platform.h"
#include "bluetooth_audio.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************
* Macros
******************************************************/
/******************************************************
* Constants
******************************************************/
/* Our table is based on the levels of priority. with the current design, Multiple services can have same priority.
* This macro defines the total number of priority levels we have and not the total number of services.
* Though, it is quite possible that total number of services is same as priority levels.
*/
#define WICED_MAXIMUM_PRIORITY_LEVELS 4
#define WICED_APP_REBOOT_DELAY_MSECS (500)
/******************************************************
* Enumerations
******************************************************/
typedef enum
{
NO_ACTION = 0x0,
/*
* ACTION_BT_CONNECT_TO_LAST_CONN_DEVICE
* ACTION_BT_DIAL_LAST_NUMBER
*/
ACTION_MULTI_FUNCTION_SHORT_RELEASE = 0x1,
/*
* ACTION_BT_SET_INQUIRY_SCAN_MODE
* ACTION_BT_START_VOICE_DIAL
*/
ACTION_MULTI_FUNCTION_LONG_RELEASE,
/* Multiple HFP actions mapped:
* ACTION_HFP_ACCEPT_CALL
* ACTION_HFP_REJECT_CALL
* ACTION_HFP_REJECT_OUTGOING_CALL
* ACTION_HFP_HANGUP_CALL
* ACTION_HFP_HOLD_CALL
* ACTION_HFP_ACCEPT_INCOMING_END_ACTIVE
* ACTION_HFP_ACCEPT_INCOMING_HOLD_ACTIVE
* ACTION_HFP_REJECT_INCOMING_WHILE_ACTIVE
* ACTION_HFP_END_ACTIVE_RELEASE_HELD_CALL
* ACTION_HFP_START_THREE_WAY_CALL
*/
/* Play or Pause on the remote audio source[With Bluetooth] */
ACTION_PAUSE_PLAY,
/* Sends "Stop" music(a remote control command) command on the remote audio source[With Bluetooth] */
ACTION_STOP,
/* Skip Forward the Audio/Music on the remote audio source[With Bluetooth] */
ACTION_FORWARD,
/* Stop backwards Audio/Music on the remote audio source[With Bluetooth] */
ACTION_BACKWARD,
/* Send Volume UP command on the remote audio source[With Bluetooth] */
ACTION_VOLUME_UP,
/* Send Volume DOWN on the remote audio source[With Bluetooth] */
ACTION_VOLUME_DOWN,
ACTION_FACTORY_RESET,
} app_service_action_t;
/**
* Service type
* The service type should always be 1 left shifted by a predefined number, as the
* service type also helps decide pre-emption policies.
*/
typedef enum
{
SERVICE_NONE = (0),
SERVICE_BT_A2DP = (1), //!< SERVICE_BT_A2DP
SERVICE_BT_HFP = (2), //!< SERVICE_BT_HFP
} service_type_t;
typedef enum
{
SERVICE_GROUP_BLUETOOTH = 0,
} service_group_type_t;
/**
* The states of a service are defined here.
*/
typedef enum
{
/* Service has been disabled or disactivated either by application[user] or got some events
* from remote device which made the service disabled or It has not been started at all */
SERVICE_DISABLED = 0,
/* Service is idle when it is connected but not consuming any system resources, same as ENABLED */
SERVICE_IDLE,//!< SERVICE_IDLE
/* same as IDLE. Service is enabled but not using any critical system resource */
SERVICE_ENABLED = SERVICE_IDLE,
/* Service is pending getting enabled due to a resource lock elsewhere. */
SERVICE_PENDING,
/* Service is playing; owner of audio resources */
SERVICE_PLAYING_AUDIO, //!< SERVICE_PLAYING
/* Service has been paused, may or may not release audio resources */
SERVICE_PAUSED_AUDIO, //!< SERVICE_PAUSED
/* Service has been stopped(playing), may or may not release audio resources */
SERVICE_STOPPED_AUDIO, //!< SERVICE_STOPPED
/* Service has been 'prevented' by a higher-priority service. Future requests from
* this service to get audio resources must be rejected by the library until application
* 'allow' it back
*/
SERVICE_PREVENTED,//!< SERVICE_PREVENTED
/* Service has been preempted, i.e. the service was active when it got 'prevented' by
* a higher priority service */
SERVICE_PREEMPTED,//!< SERVICE_PREEMPTED
} service_state_t;
/**
* Service priorities are defined here.
*/
typedef enum
{
SERVICE_DAEMON_PRIORITY = 0, //!< SERVICE_DAEMON_PRIORITY
SERVICE_BT_A2DP_PRIORITY, //!< SERVICE_BT_A2DP_PRIORITY
SERVICE_BT_HFP_PRIORITY, //!< SERVICE_BT_HFP_PRIORITY
} service_priority_t;
/**
* Specific service events.
* For new services, append to the enum.
*/
typedef enum
{
WICED_BT_RECONNECT_ON_LINK_LOSS = (1 << 0),
WICED_BT_CONNECT_A2DP = (1 << 1),
WICED_BT_DISCONNECT_A2DP = (1 << 2),
WICED_BT_CONNECT_AVRCP = (1 << 3),
WICED_BT_DISCONNECT_AVRCP = (1 << 4),
WICED_BT_CONNECT_HFP = (1 << 5),
WICED_BT_DISCONNECT_HFP = (1 << 6),
} app_event_t ;
/******************************************************
* Type Definitions
******************************************************/
/**
* API Typedefs.
*/
typedef struct wiced_app_service wiced_app_service_t;
typedef void (*WICED_APP_INIT_SERVICE)(void);
typedef void (*WICED_APP_DEINIT_SERVICE)(void);
typedef void (*WICED_APP_CONNECT_SERVICE)(void);
typedef void (*WICED_APP_DISCONNECT_SERVICE)(void);
typedef void (*WICED_APP_PREVENT_SERVICE)(wiced_app_service_t *service);
typedef void (*WICED_APP_ALLOW_SERVICE)(wiced_app_service_t *service);
typedef void (*WICED_APP_FORCE_PLAYBACK)(void);
typedef void (*WICED_APP_FORCE_STOP_PLAYBACK)(void);
typedef wiced_result_t (*WICED_APP_BUTTON_HANDLER)(app_service_action_t action);
/******************************************************
* Structures
******************************************************/
/**
* Service Struct: Definition
*/
struct wiced_app_service
{
/* Priority of the service */
int priority;
/* Index */
int type;
/* State of the service */
volatile service_state_t state;
/* Function pointers for controlling the state of the service */
/* initialize service function pointer. Typically, will invoke library-specific initialization routines */
WICED_APP_INIT_SERVICE init_service;
/* connect service */
WICED_APP_CONNECT_SERVICE connect_service;
/* dusconncet service */
WICED_APP_DISCONNECT_SERVICE disconnect_service;
/* deinitialize service */
WICED_APP_DEINIT_SERVICE deinit_service;
/* Flag the library to prevent this service from being activated until allow_service is called;
* Underlying libraries should ensure that if 'prevent_service' has been called and the service
* is currently active, then it must free up the system resources.
*/
WICED_APP_PREVENT_SERVICE prevent_service;
/* Opposite of prevent_service */
WICED_APP_ALLOW_SERVICE allow_service;
/* Feed Button-events and action to this handler */
WICED_APP_BUTTON_HANDLER button_handler;
};
/**
* Queue element for app framework queue.
*/
typedef struct
{
app_event_t event;
void (*function)(void);
wiced_bool_t wait_for_event_complete;
service_type_t event_source;
} app_queue_element_t;
/**
* Single cell of the app service table.
*/
typedef struct _app_service_cell
{
wiced_app_service_t service;
struct _app_service_cell *next;
} wiced_app_service_cell_t;
typedef enum
{
STREAM_IDLE = 0,
STREAM_PLAYING,
STREAM_SUSPEND_PENDING,
} stream_state_t;
typedef struct
{
wiced_bool_t sink_connected;
wiced_bool_t rc_connected;
wiced_bt_device_address_t avrc_peer_address;
wiced_bt_device_address_t a2dp_peer_address;
uint32_t peer_features;
bt_audio_config_t audio_config;
wiced_bt_a2dp_codec_info_t decoder_config;
wiced_bool_t in_use_context;
stream_state_t stream_status;
} a2dp_context_data_t;
typedef struct
{
wiced_mutex_t lock;
wiced_thread_t thread_handle;
wiced_queue_t queue;
wiced_app_service_t *current_service;
wiced_bool_t play_button_state;
wiced_bool_t a2dp_media_state;
a2dp_context_data_t *a2dp_current_stream;
a2dp_context_data_t *a2dp_last_stream;
wiced_semaphore_t queue_semaphore;
uint32_t event_mask;
} app_worker_data_t;
typedef wiced_result_t (*button_event_function_t)(void);
typedef struct
{
/* Logical action-enum */
app_service_action_t action;
/* Primary routine which will be executed to service above action */
button_event_function_t primary;
/* Secondary routine which need to be executed only when either primary routine has not been defined
* or when Primary routines fails to service the action */
button_event_function_t secondary;
} button_action_function_table_t;
/******************************************************
* Global Variables
******************************************************/
extern app_worker_data_t app_data;
extern wiced_app_service_cell_t *wiced_service_array[];
/******************************************************
* Function Declarations
******************************************************/
wiced_app_service_t *get_app_current_service(void);
wiced_result_t app_set_service_state(service_type_t service_type, service_state_t state);
wiced_result_t app_disable_service(service_type_t service_type);
wiced_result_t app_set_current_service(service_type_t service_type);
wiced_result_t app_reset_current_service(service_type_t service_type);
wiced_result_t wiced_app_shutdown_action(void);
void wiced_app_system_reboot(void);
void signal_for_event_semaphore(app_event_t event, wiced_bool_t completed);
#ifdef __cplusplus
} /*extern "C" */
#endif
| 33.507987 | 115 | 0.641972 |
e1d025f482804e6db2130a3970b724b00ca1c2d3 | 579 | c | C | src/Pipeline/WriteBack.c | 0xbf00/rcpu-simulator | dde4004ce8566157702ef5c0dc9bff04c52d70be | [
"MIT"
] | 1 | 2015-06-24T15:03:31.000Z | 2015-06-24T15:03:31.000Z | src/Pipeline/WriteBack.c | 0xbf00/rcpu-simulator | dde4004ce8566157702ef5c0dc9bff04c52d70be | [
"MIT"
] | null | null | null | src/Pipeline/WriteBack.c | 0xbf00/rcpu-simulator | dde4004ce8566157702ef5c0dc9bff04c52d70be | [
"MIT"
] | null | null | null | #include "WriteBack.h"
#include <stdlib.h>
void write_back(const mem_result_t * const in)
{
if (in == NULL)
return;
const uint8_t opcode = instruction_decode_opcode(in->inst);
const uint8_t type = instruction_decode_type(in->inst);
if (type == BINARY_ARITHMETIC || type == UNARY_ARITHMETIC)
{
// decode destination
const uint32_t dest = instruction_decode_destination(in->inst);
registers[dest] = in->result;
} else if (opcode == OPCODE_LOAD) {
registers[in->io_op] = in->result;
}
free((void *)in);
}
| 24.125 | 71 | 0.635579 |
c041cec390a3992aedf07b9e995f12b169c7fd72 | 392 | h | C | src/TpMMPD/DIDRO/cAppuis2homol.h | kikislater/micmac | 3009dbdad62b3ad906ec882b74b85a3db86ca755 | [
"CECILL-B"
] | 451 | 2016-11-25T09:40:28.000Z | 2022-03-30T04:20:42.000Z | src/TpMMPD/DIDRO/cAppuis2homol.h | kikislater/micmac | 3009dbdad62b3ad906ec882b74b85a3db86ca755 | [
"CECILL-B"
] | 143 | 2016-11-25T20:35:57.000Z | 2022-03-01T11:58:02.000Z | src/TpMMPD/DIDRO/cAppuis2homol.h | kikislater/micmac | 3009dbdad62b3ad906ec882b74b85a3db86ca755 | [
"CECILL-B"
] | 139 | 2016-12-02T10:26:21.000Z | 2022-03-10T19:40:29.000Z | #ifndef CAPPUIS2HOMOL_H
#define CAPPUIS2HOMOL_H
#include "StdAfx.h"
// goal: convert 2D measure of appuis (from saisie appuis tools ) to homol format
class cAppuis2Homol
{
public:
cAppuis2Homol(int argc, char** argv);
private:
cInterfChantierNameManipulateur * mICNM;
bool mDebug,mExpTxt;
std::string mIm1,mIm2,mHomPackOut, mSH, m2DMesFileName;
};
#endif // CAPPUIS2HOMOL_H
| 23.058824 | 81 | 0.752551 |
0e1e65a8c4a78783139bf7fd0984ce700729cc35 | 263 | h | C | Sherlock/GoogleDriveStorage.h | soheilpro/Sherlock-iOS | 37cc8afc1c111bd7678c271076d7207d30b54c6e | [
"MIT"
] | 5 | 2015-03-31T09:40:37.000Z | 2021-08-17T17:51:51.000Z | Sherlock/GoogleDriveStorage.h | soheilpro/Sherlock-iOS | 37cc8afc1c111bd7678c271076d7207d30b54c6e | [
"MIT"
] | null | null | null | Sherlock/GoogleDriveStorage.h | soheilpro/Sherlock-iOS | 37cc8afc1c111bd7678c271076d7207d30b54c6e | [
"MIT"
] | 1 | 2016-04-01T04:36:35.000Z | 2016-04-01T04:36:35.000Z | //
// GoogleDriveStorage.h
// Sherlock
//
// Created by Soheil Rashidi on 8/15/14.
// Copyright (c) 2014 Softtool. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "StorageWithCache.h"
@interface GoogleDriveStorage : StorageWithCache
@end
| 17.533333 | 53 | 0.726236 |
0763273e918a0eba862f4cea980f9cbae2856c7b | 1,910 | h | C | Code/OSUI/OSWindow.h | qq573011406/FASTBuild_UnrealEngine | 29c49672f82173a903cb32f0e4656e2fd07ebef2 | [
"MIT"
] | 30 | 2020-07-15T06:16:55.000Z | 2022-02-10T21:37:52.000Z | Code/OSUI/OSWindow.h | qq573011406/FASTBuild_UnrealEngine | 29c49672f82173a903cb32f0e4656e2fd07ebef2 | [
"MIT"
] | 1 | 2020-10-19T22:12:03.000Z | 2020-10-19T22:12:03.000Z | Code/OSUI/OSWindow.h | qq573011406/FASTBuild_UnrealEngine | 29c49672f82173a903cb32f0e4656e2fd07ebef2 | [
"MIT"
] | 12 | 2020-09-16T17:39:34.000Z | 2021-08-17T11:32:37.000Z | // OSWindow.h
//------------------------------------------------------------------------------
#pragma once
// Includes
//------------------------------------------------------------------------------
#include "Core/Containers/Array.h"
#include "Core/Env/Types.h"
// Forward Declarations
//------------------------------------------------------------------------------
class AString;
class OSDropDown;
class OSWidget;
class OSWindow;
// Defines
//------------------------------------------------------------------------------
#if defined( __WINDOWS__ )
// Windows user messages
#define OSUI_WM_TRAYICON ( WM_USER + 1 )
#endif
// OSWindow
//------------------------------------------------------------------------------
class OSWindow
{
public:
explicit OSWindow( void * hInstance = nullptr );
virtual ~OSWindow();
void Init( int32_t x, int32_t y, uint32_t w, uint32_t h );
void AddChild( OSWidget * childWidget );
inline void * GetHandle() const { return m_Handle; }
#if defined( __WINDOWS__ )
inline void * GetHInstance() const { return m_HInstance; }
OSWidget * GetChildFromHandle( void * handle );
#endif
void SetTitle( const char * title );
void SetMinimized( bool minimized );
static uint32_t GetPrimaryScreenWidth();
void PumpMessages();
// Events for derived classes to respond to
virtual bool OnMinimize();
virtual bool OnClose();
virtual bool OnQuit();
virtual bool OnTrayIconLeftClick();
virtual bool OnTrayIconRightClick();
virtual void OnDropDownSelectionChanged( OSDropDown * dropDown );
virtual void OnTrayIconMenuItemSelected( uint32_t index );
protected:
void * m_Handle;
#if defined( __WINDOWS__ )
void * m_HInstance;
#endif
Array< OSWidget * > m_ChildWidgets;
};
//------------------------------------------------------------------------------
| 27.681159 | 80 | 0.508377 |
6da68f9114840d20b6be047cd99d0c894d2e3704 | 2,727 | h | C | simulation/Simulation.h | shehabattia96/EsCarGo | 8b82863b1d74eb21cfeec2906a98bde0737d97c8 | [
"MIT"
] | 2 | 2021-04-06T03:09:24.000Z | 2021-12-12T20:01:13.000Z | simulation/Simulation.h | shehabattia96/EsCarGo | 8b82863b1d74eb21cfeec2906a98bde0737d97c8 | [
"MIT"
] | 1 | 2021-05-20T09:12:08.000Z | 2021-05-20T09:12:08.000Z | simulation/Simulation.h | shehabattia96/EsCarGo | 8b82863b1d74eb21cfeec2906a98bde0737d97c8 | [
"MIT"
] | null | null | null | #ifndef Simulation_h
#define Simulation_h
// system
#include <iostream>
#include <thread>
// cinder
#include "cinder/CameraUi.h"
#include "cinder/ObjLoader.h"
#include "cinder/gl/gl.h"
#include "cinder/Capture.h"
#include "cinder/Log.h"
#include "../externals/Cinder-Simulation-App/src/CinderAppHelper.h"
#include "glm/common.hpp"
// SLAM
#include <opencv2\opencv.hpp>
// physx
#include <ctype.h>
#include "PxConfig.h"
#include "PxPhysicsAPI.h"
// pxcinder
#include "./pxcinder/createPxActors.h"
#include "./pxcinder/PxCinderObject.h"
// networking
#include "./mqtt.h"
using namespace std;
using namespace physx;
using namespace pxcinder;
bool isExitSignal = false;
class Simulation : public App {
public:
void setup() override;
void cleanup() override;
void keyDown(KeyEvent event) override;
void keyUp(KeyEvent event) override;
void mouseDown( MouseEvent event ) override;
void mouseDrag( MouseEvent event ) override;
void update() override;
void draw() override;
void resize();
void updateSettingsSidebarParameters(bool updateNamesOfObjectsList);
void initWorld();
private:
std::shared_ptr<CameraPersp> mCam;
CameraUi mCameraUi;
vec3 eyePoint;
gl::FboRef mFbo;
std::map<std::string, SimulationObject::type> simulationObjectsMap;
SettingsSidebarStruct::type settingsSidebar;
params::InterfaceGlRef settingsSidebarParameters;
gl::GlslProgRef mStockShader;
float mFPS = .0f;
int selectedCamera = 0;
void Simulation::OnLoadResources();
void createSimulationObjectsFromSceneActors();
void createSimulationObjectsFromCinderVehiclesArray(const std::vector<PxCinderVehicle>& cinderVehicleArray);
void createSimulationObjectsFromCinderStaticMeshesArray(const std::vector<PxCinderStaticMesh>& cinderStaticMeshesArray);
void createSimulationObjectsFromCinderDynamicMeshesArray(const std::vector<PxCinderDynamicMesh>& cinderDynamicMeshesArray);
void Simulation::createSimulationObject(string objectId, PxRigidActor* actor, PxShape* actorShape, geom::SourceMods shape, gl::GlslProgRef shader, ci::ColorA* color);
std::vector<std::shared_ptr<PxCinderObject>> mPxCinderObjects;
std::vector<std::shared_ptr<PxCinderVehicle>> mCinderVehicles;
std::vector<PxVehicleWheels*> mVehiclesWheels;
std::vector<std::shared_ptr<PxCinderCamera>> mCinderCameras;
void Simulation::updateCameraLookAt(std::shared_ptr<PxCinderCamera> cameraHolder);
void Simulation::updateCameraFrameBuffer(std::shared_ptr<PxCinderCamera> cameraHolder);
const float minLoadingTextDuration = 1000.f;
void Simulation::displayLoadingText(std::shared_ptr<CameraPersp>& cam);
std::string loadingText;
void setLoadingText(std::string text, float milliseconds) {
loadingText = text;
sleep(milliseconds);
}
};
#endif | 30.988636 | 167 | 0.790246 |
efa0852d9e9cc65450c5e7c437d8265a9e0b6702 | 9,549 | h | C | lib/runtime/RuntimeInterface.h | alexanderlinne/TypeART | a83c63b3c82d1e4801c1c4651c9351b311ef1fa6 | [
"BSD-3-Clause"
] | null | null | null | lib/runtime/RuntimeInterface.h | alexanderlinne/TypeART | a83c63b3c82d1e4801c1c4651c9351b311ef1fa6 | [
"BSD-3-Clause"
] | null | null | null | lib/runtime/RuntimeInterface.h | alexanderlinne/TypeART | a83c63b3c82d1e4801c1c4651c9351b311ef1fa6 | [
"BSD-3-Clause"
] | null | null | null | // TypeART library
//
// Copyright (c) 2017-2022 TypeART Authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE.txt or copy at
// https://opensource.org/licenses/BSD-3-Clause)
//
// Project home: https://github.com/tudasc/TypeART
//
// SPDX-License-Identifier: BSD-3-Clause
//
#ifndef TYPEART_RUNTIMEINTERFACE_H
#define TYPEART_RUNTIMEINTERFACE_H
#include "TypeInterface.h"
#ifdef __cplusplus
#include <cstddef>
#else
#include <stdbool.h>
#include <stddef.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef enum typeart_status_t { // NOLINT
TYPEART_OK,
TYPEART_UNKNOWN_ADDRESS,
TYPEART_BAD_ALIGNMENT,
TYPEART_BAD_OFFSET,
TYPEART_WRONG_KIND,
TYPEART_INVALID_ID,
TYPEART_ERROR
} typeart_status;
typedef struct typeart_struct_layout_t { // NOLINT
int type_id;
const char* name;
size_t extent;
size_t num_members;
const size_t* offsets;
const int* member_types;
const size_t* count;
} typeart_struct_layout;
/**
* Determines the type and array element count at the given address.
* For nested types with classes/structs, the containing type is resolved recursively, until an exact with the address
* is found.
* See typeart_get_type_length and typeart_get_type_id for resolving only one such parameter
*
* Note that this function will always return the outermost type lining up with the address.
* Given a pointer to the start of a struct, the returned type will therefore be that of the struct, not of the first
* member.
*
* \param[in] addr The address.
* \param[out] type_id Type ID
* \param[out] count Allocation size
*
* \return A status code:
* - TYPEART_OK: The query was successful and the contents of type and count are valid.
* - TYPEART_UNKNOWN_ADDRESS: The given address is either not allocated, or was not correctly recorded by the runtime.
* - TYPEART_BAD_ALIGNMENT: The given address does not line up with the start of the atomic type at that location.
* - TYPEART_INVALID_ID: Encountered unregistered ID during lookup.
*/
typeart_status typeart_get_type(const void* addr, int* type_id, size_t* count);
typeart_status typeart_get_type_length(const void* addr, size_t* count);
typeart_status typeart_get_type_id(const void* addr, int* type_id);
/**
* Determines the outermost type and array element count at the given address.
* Unlike in typeart_get_type(), there is no further resolution of subtypes.
* Instead, additional information about the position of the address within the containing type is returned.
*
* The starting address of the referenced array element can be deduced by computing `(size_t) addr - offset`.
*
* \param[in] addr The address.
* \param[out] count Number of elements in the containing buffer, not counting elements before the given address.
* \param[out] base_address Address of the containing buffer.
* \param[out] offset The byte offset within that buffer element.
*
* \return A status code. For an explanation of errors, refer to typeart_get_type().
*
*/
typeart_status typeart_get_containing_type(const void* addr, int* type_id, size_t* count, const void** base_address,
size_t* offset);
/**
* Determines the subtype at the given offset w.r.t. a base address and a corresponding containing type.
* Note that if the subtype is itself a struct, you may have to call this function again.
* If it returns with *subTypeOffset == 0, the address has been fully resolved.
*
* \param[in] baseAddr Pointer to the start of the containing type.
* \param[in] offset Byte offset within the containing type.
* \param[in] container_layout typeart_struct_layout corresponding to the containing type
* \param[out] subtype_id The type ID corresponding to the subtype.
* \param[out] subtype_base_addr Pointer to the start of the subtype.
* \param[out] subtype_offset Byte offset within the subtype.
* \param[out] subtype_count Number of elements in subarray.
*
* \return One of the following status codes:
* - TYPEART_OK: Success.
* - TYPEART_BAD_ALIGNMENT: Address corresponds to location inside an atomic type or padding.
* - TYPEART_BAD_OFFSET: The provided offset is invalid.
*/
typeart_status typeart_get_subtype(const void* base_addr, size_t offset, typeart_struct_layout container_layout,
int* subtype_id, const void** subtype_base_addr, size_t* subtype_offset,
size_t* subtype_count);
/**
* Returns the stored debug address generated by __builtin_return_address(0).
*
* \param[in] addr The address.
* \param[out] return_addr The approximate address where the allocation occurred, or nullptr.
*
* \return One of the following status codes:
* - TYPEART_OK: Success.
* - TYPEART_UNKNOWN_ADDRESS: The given address is either not allocated, or was not recorded by the runtime.
*/
typeart_status typeart_get_return_address(const void* addr, const void** return_addr);
/**
* Tries to return file, function and line of a memory address from the current process.
* Needs (1) either llvm-symbolizer or addr2line to be installed, and (2) target code should be compiled debug
* information for useful output. Note: file, function, line are allocated with malloc. They need to be free'd by the
* caller.
*
* \param[in] addr The address.
* \param[out] file The file where the address was created at.
* \param[out] function The function where the address was created at.
* \param[out] line The approximate line where the address was created at.
*
* \return One of the following status codes:
* - TYPEART_OK: Success.
* - TYPEART_UNKNOWN_ADDRESS: The given address is either not allocated, or was not recorded by the runtime.
* - TYPEART_ERROR: Memory could not be allocated.
*/
typeart_status typeart_get_source_location(const void* addr, char** file, char** function, char** line);
/**
* Given an address, this function provides information about the corresponding struct type.
* This is more expensive than the below version, since the pointer addr must be resolved.
*
* \param[in] addr The pointer address
* \param[out] struct_layout Data layout of the struct.
*
* \return One of the following status codes:
* - TYPEART_OK: Success.
* - TYPEART_WRONG_KIND: ID does not correspond to a struct type.
* - TYPEART_UNKNOWN_ADDRESS: The given address is either not allocated, or was not correctly recorded by the runtime.
* - TYPEART_BAD_ALIGNMENT: The given address does not line up with the start of the atomic type at that location.
* - TYPEART_INVALID_ID: Encountered unregistered ID during lookup.
*/
typeart_status typeart_resolve_type_addr(const void* addr, typeart_struct_layout* struct_layout);
/**
* Given a type ID, this function provides information about the corresponding struct type.
*
* \param[in] type_id The type ID.
* \param[out] struct_layout Data layout of the struct.
*
* \return One of the following status codes:
* - TYPEART_OK: Success.
* - TYPEART_WRONG_KIND: ID does not correspond to a struct type.
* - TYPEART_INVALID_ID: ID is not valid.
*/
typeart_status typeart_resolve_type_id(int type_id, typeart_struct_layout* struct_layout);
/**
* Returns the name of the type corresponding to the given type ID.
* This can be used for debugging and error messages.
*
* \param[in] type_id The type ID.
* \return The name of the type, or "typeart_unknown_struct" if the ID is unknown.
*/
const char* typeart_get_type_name(int type_id);
/**
* Returns true if this is a valid type according to
* e.g., a built-in type or a user-defined type,
* see also TypeInterface.h
*
* \param[in] type_id The type ID.
* \return true, false
*/
bool typeart_is_valid_type(int type_id);
/**
* Returns true if the type ID is in the pre-determined reserved range,
* see TypeInterface.h
*
* \param[in] type_id The type ID.
* \return true, false
*/
bool typeart_is_reserved_type(int type_id);
/**
* Returns true if the type ID is a built-in type,
* see TypeInterface.h
*
* \param[in] type_id The type ID.
* \return true, false
*/
bool typeart_is_builtin_type(int type_id);
/**
* Returns true if the type ID is a structure type.
* Note: This can be a user-defined struct or class, or a
* LLVM vector type. Use the below queries for specifics.
*
* \param[in] type_id The type ID.
* \return true, false
*/
bool typeart_is_struct_type(int type_id);
/**
* Returns true if the type ID is a user-defined structure type
* (struct, class etc.)
*
* \param[in] type_id The type ID.
* \return true, false
*/
bool typeart_is_userdefined_type(int type_id);
/**
* Returns true if the type ID is a LLVM SIMD vector type
*
* \param[in] type_id The type ID.
* \return true, false
*/
bool typeart_is_vector_type(int type_id);
/**
* Returns the byte size of the type behind the ID.
*
* \param[in] type_id The type ID.
* \return size in bytes of the type
*/
size_t typeart_get_type_size(int type_id);
/**
* Version string "major.minor(.patch)" of TypeART.
*
* \return version string
*/
const char* typeart_get_project_version();
/**
* Short Git revision (length: 10) string of TypeART.
* Char "+" is appended, if uncommitted changes were detected.
* Returns "N/A" if revision couldn't be generated.
*
* \return revision string
*/
const char* typeart_get_git_revision();
/**
* Version string "major.minor" of LLVM used to build TypeART.
*
* \return version string
*/
const char* typeart_get_llvm_version();
#ifdef __cplusplus
}
#endif
#endif // TYPEART_RUNTIMEINTERFACE_H
| 34.850365 | 119 | 0.73725 |
b4a02d8d4815408cd0e75cb1bed2223baf9801be | 413 | h | C | usr/libexec/wifianalyticsd/WAIOReporterPopulatorMessageDelegate-Protocol.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 2 | 2021-11-02T09:23:27.000Z | 2022-03-28T08:21:57.000Z | usr/libexec/wifianalyticsd/WAIOReporterPopulatorMessageDelegate-Protocol.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | null | null | null | usr/libexec/wifianalyticsd/WAIOReporterPopulatorMessageDelegate-Protocol.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 1 | 2022-03-28T08:21:59.000Z | 2022-03-28T08:21:59.000Z | //
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import "NSObject-Protocol.h"
@class NSString, WAMessage;
@protocol WAIOReporterPopulatorMessageDelegate <NSObject>
- (WAMessage *)getNewMessageForKey:(NSString *)arg1 groupType:(long long)arg2 forProcessWithToken:(NSString *)arg3;
@end
| 27.533333 | 120 | 0.745763 |
470374639eb2a5035dd89b0a5f7f83a1b34ddbbd | 566 | h | C | isserver3/controls/STipView.h | redleafnew/sinstar3 | 7c7582ff8a17a07b575c4bc403a6e65cc95ed020 | [
"MIT"
] | 1 | 2021-07-28T07:53:57.000Z | 2021-07-28T07:53:57.000Z | isserver3/controls/STipView.h | redleafnew/sinstar3 | 7c7582ff8a17a07b575c4bc403a6e65cc95ed020 | [
"MIT"
] | null | null | null | isserver3/controls/STipView.h | redleafnew/sinstar3 | 7c7582ff8a17a07b575c4bc403a6e65cc95ed020 | [
"MIT"
] | null | null | null | #pragma once
namespace SOUI
{
SEVENT_BEGIN(EventSwitchTip, EVT_EXTERNAL_BEGIN + 800)
bool bNext;
SEVENT_END()
class STipView : public SWindow
{
SOUI_CLASS_NAME(STipView,L"tipview")
public:
STipView();
~STipView();
protected:
void OnLButtonDown(UINT uFlag, CPoint pt);
void OnRButtonDown(UINT uFlag, CPoint pt);
SOUI_MSG_MAP_BEGIN()
MSG_WM_LBUTTONDOWN(OnLButtonDown)
MSG_WM_LBUTTONDBLCLK(OnLButtonDown)
MSG_WM_RBUTTONDOWN(OnRButtonDown)
MSG_WM_RBUTTONDBLCLK(OnRButtonDown)
SOUI_MSG_MAP_END()
};
}
| 18.866667 | 56 | 0.719081 |
699b1fead70a0915834355a898834ddad136062f | 201 | c | C | sm64ex-nightly/levels/bitfs/areas/1/6/geo.inc.c | alex-free/sm64ex-creator | e7089df69fb43f266b2165078d94245b33b8e72a | [
"Intel",
"X11",
"Unlicense"
] | 2 | 2022-03-12T08:27:53.000Z | 2022-03-12T18:26:06.000Z | levels/bitfs/areas/1/6/geo.inc.c | Daviz00/sm64 | fd2ed5e0e72d04732034919f8442f8d2cc40fd67 | [
"Unlicense"
] | null | null | null | levels/bitfs/areas/1/6/geo.inc.c | Daviz00/sm64 | fd2ed5e0e72d04732034919f8442f8d2cc40fd67 | [
"Unlicense"
] | null | null | null | // 0x0E000510
const GeoLayout bitfs_geo_000510[] = {
GEO_CULLING_RADIUS(2600),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, bitfs_seg7_dl_07004630),
GEO_CLOSE_NODE(),
GEO_END(),
};
| 22.333333 | 60 | 0.721393 |
748c5357c4f3f0970952c4f7642e34bde3449354 | 2,236 | h | C | multimedia/dshow/filters/core/filgraph/squish/squish.h | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | multimedia/dshow/filters/core/filgraph/squish/squish.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | multimedia/dshow/filters/core/filgraph/squish/squish.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | // Copyright (c) 1997 - 1999 Microsoft Corporation. All Rights Reserved.
// code to convert between the REGFILTER2 structure (defined in
// axextend.idl) and the REGFILTER_REG structure (defined in
// regtypes.h).
// exported functions
HRESULT RegSquish(
BYTE *pb, // REGFILTER_REG (version = 2) out; can be null
const REGFILTER2 **ppregFilter, // in
ULONG *pcbUsed, // bytes necessary/used
int nFilters = 1); //
HRESULT UnSquish(
BYTE *pbSrc, ULONG cbIn, // REGFILTER_REG (1 or 2) in
REGFILTER2 ***pppDest, // out
int nFilters = 1);
// private stuff
struct RgMemAlloc
{
DWORD ib; /* current byte */
DWORD cbLeft; /* bytes left */
BYTE *pb; /* beginning of block */
};
class CSquish
{
public:
CSquish();
HRESULT RegSquish(BYTE *pb, const REGFILTER2 **pregFilter, ULONG *pcbUsed, int nFilters);
private:
RgMemAlloc m_rgMemAlloc;
// pointer to first guid/medium
GUID *m_pGuids;
REGPINMEDIUM *m_pMediums;
// # allocated in m_pGuids/mediums
UINT m_cGuids;
UINT m_cMediums;
DWORD RgAlloc(DWORD cb);
DWORD AllocateOrCollapseGuid(const GUID *pGuid);
DWORD AllocateOrCollapseMedium(const REGPINMEDIUM *pMed);
ULONG CbRequiredSquish(const REGFILTER2 *pregFilter);
};
class CUnsquish
{
public:
HRESULT UnSquish(
BYTE *pbSrc, ULONG cbIn,
REGFILTER2 ***pppDest, int iFilters);
private:
RgMemAlloc m_rgMemAlloc;
HRESULT CUnsquish::CbRequiredUnquishAndValidate(
const BYTE *pbSrc,
ULONG *pcbOut, ULONG cbIn
);
inline void *RgAllocPtr(DWORD cb);
HRESULT UnSquishPins(
REGFILTER2 *prf2, const REGFILTER_REG1 **prfr1, const BYTE *pbSrc);
HRESULT UnSquishTypes(
REGFILTERPINS2 *prfp2,
const REGFILTERPINS_REG1 *prfpr1,
const BYTE *pbSrc);
};
static inline bool IsEqualMedium(
const REGPINMEDIUM *rp1,
const REGPINMEDIUM *rp2)
{
return
rp1->clsMedium == rp2->clsMedium &&
rp1->dw1 == rp2->dw1 &&
rp1->dw2 == rp2->dw2;
}
| 25.409091 | 94 | 0.607335 |
598ec95dd6fe43d4bb66b3587f01d5bf5983a5ec | 494 | h | C | tests/assert.h | Sanix-Darker/c-starter | cc43973134218b5d65f21795d51f897d5a1938ca | [
"MIT"
] | 1 | 2020-05-11T11:18:29.000Z | 2020-05-11T11:18:29.000Z | tests/assert.h | Sanix-Darker/c-starter | cc43973134218b5d65f21795d51f897d5a1938ca | [
"MIT"
] | null | null | null | tests/assert.h | Sanix-Darker/c-starter | cc43973134218b5d65f21795d51f897d5a1938ca | [
"MIT"
] | null | null | null | #include <string.h>
_Bool assert(char *func_name, _Bool condition, char *message){
if(condition){
printf("[+] > '%s' passed successfully,\n", func_name);
return true;
}else{
if(strlen(message) <= 2){
printf("[x] Error in the test : %s \n", func_name);
}else{
printf("[x] %s\n", message);
}
return false;
}
}
int eval(_Bool func){
if (func == true){
return 1;
}else{
return 0;
}
}
| 20.583333 | 63 | 0.497976 |
f7f2fd7efcbc81dd6e4ea80a60d8a94d82ba6fbe | 413 | h | C | SCAdViewDemo/SCAdDemoCollectionViewCell.h | kuah/SCAdView | 623fc856122dd52bdee14b7adc919fea6e85f03a | [
"MIT"
] | 160 | 2017-07-18T03:57:20.000Z | 2022-03-26T10:29:38.000Z | SCAdViewDemo/SCAdDemoCollectionViewCell.h | earlyfly/SCAdView | 623fc856122dd52bdee14b7adc919fea6e85f03a | [
"MIT"
] | 11 | 2017-09-11T08:53:20.000Z | 2018-05-18T07:32:30.000Z | SCAdViewDemo/SCAdDemoCollectionViewCell.h | earlyfly/SCAdView | 623fc856122dd52bdee14b7adc919fea6e85f03a | [
"MIT"
] | 32 | 2017-08-13T16:03:24.000Z | 2020-12-29T06:30:46.000Z | //
// SCAdDemoCollectionViewCell.h
// SCAdViewDemo
//
// Created by 陈世翰 on 17/2/7.
// Copyright © 2017年 Coder Chan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SCAdViewRenderDelegate.h"
@interface SCAdDemoCollectionViewCell : UICollectionViewCell<SCAdViewRenderDelegate>
@property (strong, nonatomic) IBOutlet UIImageView *showImage;
@property (strong, nonatomic) IBOutlet UIView *bgView;
@end
| 25.8125 | 84 | 0.767554 |
5aa1e7dd0a37eb8c13422560950357df5336bb0f | 172 | h | C | Data Structures/filaEstatica.h | LHenrique42/random-codes-c | 5f4dae1f868b06d86bff24ed23b9c49a18bcb43d | [
"MIT"
] | null | null | null | Data Structures/filaEstatica.h | LHenrique42/random-codes-c | 5f4dae1f868b06d86bff24ed23b9c49a18bcb43d | [
"MIT"
] | null | null | null | Data Structures/filaEstatica.h | LHenrique42/random-codes-c | 5f4dae1f868b06d86bff24ed23b9c49a18bcb43d | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
typedef struct node {
int chave;
struct node prox;
} node;
typedef struct lista {
node head;
node tail;
} LISTCIRC; | 14.333333 | 22 | 0.651163 |
5a05b15c30a69fe278977cbc1863a6498f9c7daa | 30,133 | c | C | analyzer/data/fs/linux-3.17/qnx6.c | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 23 | 2016-01-06T07:01:46.000Z | 2022-02-12T15:53:20.000Z | analyzer/data/fs/linux-3.17/qnx6.c | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 1 | 2019-04-02T00:42:29.000Z | 2019-04-02T00:42:29.000Z | analyzer/data/fs/linux-3.17/qnx6.c | oslab-swrc/juxta | 481cd6f01e87790041a07379805968bcf57d75f4 | [
"MIT"
] | 16 | 2016-01-06T07:01:46.000Z | 2021-11-29T11:43:16.000Z | /*
* QNX6 file system, Linux implementation.
*
* Version : 1.0.0
*
* History :
*
* 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
* 16-02-2012 pagemap extension by Al Viro
*
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/highuid.h>
#include <linux/pagemap.h>
#include <linux/buffer_head.h>
#include <linux/writeback.h>
#include <linux/statfs.h>
#include <linux/parser.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <linux/crc32.h>
#include <linux/mpage.h>
#include "qnx6.h"
static const struct super_operations qnx6_sops;
static void qnx6_put_super(struct super_block *sb);
static struct inode *qnx6_alloc_inode(struct super_block *sb);
static void qnx6_destroy_inode(struct inode *inode);
static int qnx6_remount(struct super_block *sb, int *flags, char *data);
static int qnx6_statfs(struct dentry *dentry, struct kstatfs *buf);
static int qnx6_show_options(struct seq_file *seq, struct dentry *root);
static const struct super_operations qnx6_sops = {
.alloc_inode = qnx6_alloc_inode,
.destroy_inode = qnx6_destroy_inode,
.put_super = qnx6_put_super,
.statfs = qnx6_statfs,
.remount_fs = qnx6_remount,
.show_options = qnx6_show_options,
};
static int qnx6_show_options(struct seq_file *seq, struct dentry *root)
{
struct super_block *sb = root->d_sb;
struct qnx6_sb_info *sbi = QNX6_SB(sb);
if (sbi->s_mount_opt & QNX6_MOUNT_MMI_FS)
seq_puts(seq, ",mmi_fs");
return 0;
}
static int qnx6_remount(struct super_block *sb, int *flags, char *data)
{
sync_filesystem(sb);
*flags |= MS_RDONLY;
return 0;
}
static unsigned qnx6_get_devblock(struct super_block *sb, __fs32 block)
{
struct qnx6_sb_info *sbi = QNX6_SB(sb);
return fs32_to_cpu(sbi, block) + sbi->s_blks_off;
}
static unsigned qnx6_block_map(struct inode *inode, unsigned iblock);
static int qnx6_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh, int create)
{
unsigned phys;
pr_debug("qnx6_get_block inode=[%ld] iblock=[%ld]\n",
inode->i_ino, (unsigned long)iblock);
phys = qnx6_block_map(inode, iblock);
if (phys) {
/* logical block is before EOF */
map_bh(bh, inode->i_sb, phys);
}
return 0;
}
static int qnx6_check_blockptr(__fs32 ptr)
{
if (ptr == ~(__fs32)0) {
pr_err("hit unused blockpointer.\n");
return 0;
}
return 1;
}
static int qnx6_readpage(struct file *file, struct page *page)
{
return mpage_readpage(page, qnx6_get_block);
}
static int qnx6_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
return mpage_readpages(mapping, pages, nr_pages, qnx6_get_block);
}
/*
* returns the block number for the no-th element in the tree
* inodebits requred as there are multiple inodes in one inode block
*/
static unsigned qnx6_block_map(struct inode *inode, unsigned no)
{
struct super_block *s = inode->i_sb;
struct qnx6_sb_info *sbi = QNX6_SB(s);
struct qnx6_inode_info *ei = QNX6_I(inode);
unsigned block = 0;
struct buffer_head *bh;
__fs32 ptr;
int levelptr;
int ptrbits = sbi->s_ptrbits;
int bitdelta;
u32 mask = (1 << ptrbits) - 1;
int depth = ei->di_filelevels;
int i;
bitdelta = ptrbits * depth;
levelptr = no >> bitdelta;
if (levelptr > QNX6_NO_DIRECT_POINTERS - 1) {
pr_err("Requested file block number (%u) too big.", no);
return 0;
}
block = qnx6_get_devblock(s, ei->di_block_ptr[levelptr]);
for (i = 0; i < depth; i++) {
bh = sb_bread(s, block);
if (!bh) {
pr_err("Error reading block (%u)\n", block);
return 0;
}
bitdelta -= ptrbits;
levelptr = (no >> bitdelta) & mask;
ptr = ((__fs32 *)bh->b_data)[levelptr];
if (!qnx6_check_blockptr(ptr))
return 0;
block = qnx6_get_devblock(s, ptr);
brelse(bh);
}
return block;
}
static int qnx6_statfs(struct dentry *dentry, struct kstatfs *buf)
{
struct super_block *sb = dentry->d_sb;
struct qnx6_sb_info *sbi = QNX6_SB(sb);
u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
buf->f_type = sb->s_magic;
buf->f_bsize = sb->s_blocksize;
buf->f_blocks = fs32_to_cpu(sbi, sbi->sb->sb_num_blocks);
buf->f_bfree = fs32_to_cpu(sbi, sbi->sb->sb_free_blocks);
buf->f_files = fs32_to_cpu(sbi, sbi->sb->sb_num_inodes);
buf->f_ffree = fs32_to_cpu(sbi, sbi->sb->sb_free_inodes);
buf->f_bavail = buf->f_bfree;
buf->f_namelen = QNX6_LONG_NAME_MAX;
buf->f_fsid.val[0] = (u32)id;
buf->f_fsid.val[1] = (u32)(id >> 32);
return 0;
}
/*
* Check the root directory of the filesystem to make sure
* it really _is_ a qnx6 filesystem, and to check the size
* of the directory entry.
*/
static const char *qnx6_checkroot(struct super_block *s)
{
static char match_root[2][3] = {".\0\0", "..\0"};
int i, error = 0;
struct qnx6_dir_entry *dir_entry;
struct inode *root = s->s_root->d_inode;
struct address_space *mapping = root->i_mapping;
struct page *page = read_mapping_page(mapping, 0, NULL);
if (IS_ERR(page))
return "error reading root directory";
kmap(page);
dir_entry = page_address(page);
for (i = 0; i < 2; i++) {
/* maximum 3 bytes - due to match_root limitation */
if (strncmp(dir_entry[i].de_fname, match_root[i], 3))
error = 1;
}
qnx6_put_page(page);
if (error)
return "error reading root directory.";
return NULL;
}
#ifdef CONFIG_QNX6FS_DEBUG
void qnx6_superblock_debug(struct qnx6_super_block *sb, struct super_block *s)
{
struct qnx6_sb_info *sbi = QNX6_SB(s);
pr_debug("magic: %08x\n", fs32_to_cpu(sbi, sb->sb_magic));
pr_debug("checksum: %08x\n", fs32_to_cpu(sbi, sb->sb_checksum));
pr_debug("serial: %llx\n", fs64_to_cpu(sbi, sb->sb_serial));
pr_debug("flags: %08x\n", fs32_to_cpu(sbi, sb->sb_flags));
pr_debug("blocksize: %08x\n", fs32_to_cpu(sbi, sb->sb_blocksize));
pr_debug("num_inodes: %08x\n", fs32_to_cpu(sbi, sb->sb_num_inodes));
pr_debug("free_inodes: %08x\n", fs32_to_cpu(sbi, sb->sb_free_inodes));
pr_debug("num_blocks: %08x\n", fs32_to_cpu(sbi, sb->sb_num_blocks));
pr_debug("free_blocks: %08x\n", fs32_to_cpu(sbi, sb->sb_free_blocks));
pr_debug("inode_levels: %02x\n", sb->Inode.levels);
}
#endif
enum {
Opt_mmifs,
Opt_err
};
static const match_table_t tokens = {
{Opt_mmifs, "mmi_fs"},
{Opt_err, NULL}
};
static int qnx6_parse_options(char *options, struct super_block *sb)
{
char *p;
struct qnx6_sb_info *sbi = QNX6_SB(sb);
substring_t args[MAX_OPT_ARGS];
if (!options)
return 1;
while ((p = strsep(&options, ",")) != NULL) {
int token;
if (!*p)
continue;
token = match_token(p, tokens, args);
switch (token) {
case Opt_mmifs:
set_opt(sbi->s_mount_opt, MMI_FS);
break;
default:
return 0;
}
}
return 1;
}
static struct buffer_head *qnx6_check_first_superblock(struct super_block *s,
int offset, int silent)
{
struct qnx6_sb_info *sbi = QNX6_SB(s);
struct buffer_head *bh;
struct qnx6_super_block *sb;
/* Check the superblock signatures
start with the first superblock */
bh = sb_bread(s, offset);
if (!bh) {
pr_err("unable to read the first superblock\n");
return NULL;
}
sb = (struct qnx6_super_block *)bh->b_data;
if (fs32_to_cpu(sbi, sb->sb_magic) != QNX6_SUPER_MAGIC) {
sbi->s_bytesex = BYTESEX_BE;
if (fs32_to_cpu(sbi, sb->sb_magic) == QNX6_SUPER_MAGIC) {
/* we got a big endian fs */
pr_debug("fs got different endianness.\n");
return bh;
} else
sbi->s_bytesex = BYTESEX_LE;
if (!silent) {
if (offset == 0) {
pr_err("wrong signature (magic) in superblock #1.\n");
} else {
pr_info("wrong signature (magic) at position (0x%lx) - will try alternative position (0x0000).\n",
offset * s->s_blocksize);
}
}
brelse(bh);
return NULL;
}
return bh;
}
static struct inode *qnx6_private_inode(struct super_block *s,
struct qnx6_root_node *p);
static int qnx6_fill_super(struct super_block *s, void *data, int silent)
{
struct buffer_head *bh1 = NULL, *bh2 = NULL;
struct qnx6_super_block *sb1 = NULL, *sb2 = NULL;
struct qnx6_sb_info *sbi;
struct inode *root;
const char *errmsg;
struct qnx6_sb_info *qs;
int ret = -EINVAL;
u64 offset;
int bootblock_offset = QNX6_BOOTBLOCK_SIZE;
qs = kzalloc(sizeof(struct qnx6_sb_info), GFP_KERNEL);
if (!qs)
return -ENOMEM;
s->s_fs_info = qs;
/* Superblock always is 512 Byte long */
if (!sb_set_blocksize(s, QNX6_SUPERBLOCK_SIZE)) {
pr_err("unable to set blocksize\n");
goto outnobh;
}
/* parse the mount-options */
if (!qnx6_parse_options((char *) data, s)) {
pr_err("invalid mount options.\n");
goto outnobh;
}
if (test_opt(s, MMI_FS)) {
sb1 = qnx6_mmi_fill_super(s, silent);
if (sb1)
goto mmi_success;
else
goto outnobh;
}
sbi = QNX6_SB(s);
sbi->s_bytesex = BYTESEX_LE;
/* Check the superblock signatures
start with the first superblock */
bh1 = qnx6_check_first_superblock(s,
bootblock_offset / QNX6_SUPERBLOCK_SIZE, silent);
if (!bh1) {
/* try again without bootblock offset */
bh1 = qnx6_check_first_superblock(s, 0, silent);
if (!bh1) {
pr_err("unable to read the first superblock\n");
goto outnobh;
}
/* seems that no bootblock at partition start */
bootblock_offset = 0;
}
sb1 = (struct qnx6_super_block *)bh1->b_data;
#ifdef CONFIG_QNX6FS_DEBUG
qnx6_superblock_debug(sb1, s);
#endif
/* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb1->sb_checksum) !=
crc32_be(0, (char *)(bh1->b_data + 8), 504)) {
pr_err("superblock #1 checksum error\n");
goto out;
}
/* set new blocksize */
if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) {
pr_err("unable to set blocksize\n");
goto out;
}
/* blocksize invalidates bh - pull it back in */
brelse(bh1);
bh1 = sb_bread(s, bootblock_offset >> s->s_blocksize_bits);
if (!bh1)
goto outnobh;
sb1 = (struct qnx6_super_block *)bh1->b_data;
/* calculate second superblock blocknumber */
offset = fs32_to_cpu(sbi, sb1->sb_num_blocks) +
(bootblock_offset >> s->s_blocksize_bits) +
(QNX6_SUPERBLOCK_AREA >> s->s_blocksize_bits);
/* set bootblock offset */
sbi->s_blks_off = (bootblock_offset >> s->s_blocksize_bits) +
(QNX6_SUPERBLOCK_AREA >> s->s_blocksize_bits);
/* next the second superblock */
bh2 = sb_bread(s, offset);
if (!bh2) {
pr_err("unable to read the second superblock\n");
goto out;
}
sb2 = (struct qnx6_super_block *)bh2->b_data;
if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) {
if (!silent)
pr_err("wrong signature (magic) in superblock #2.\n");
goto out;
}
/* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb2->sb_checksum) !=
crc32_be(0, (char *)(bh2->b_data + 8), 504)) {
pr_err("superblock #2 checksum error\n");
goto out;
}
if (fs64_to_cpu(sbi, sb1->sb_serial) >=
fs64_to_cpu(sbi, sb2->sb_serial)) {
/* superblock #1 active */
sbi->sb_buf = bh1;
sbi->sb = (struct qnx6_super_block *)bh1->b_data;
brelse(bh2);
pr_info("superblock #1 active\n");
} else {
/* superblock #2 active */
sbi->sb_buf = bh2;
sbi->sb = (struct qnx6_super_block *)bh2->b_data;
brelse(bh1);
pr_info("superblock #2 active\n");
}
mmi_success:
/* sanity check - limit maximum indirect pointer levels */
if (sb1->Inode.levels > QNX6_PTR_MAX_LEVELS) {
pr_err("too many inode levels (max %i, sb %i)\n",
QNX6_PTR_MAX_LEVELS, sb1->Inode.levels);
goto out;
}
if (sb1->Longfile.levels > QNX6_PTR_MAX_LEVELS) {
pr_err("too many longfilename levels (max %i, sb %i)\n",
QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels);
goto out;
}
s->s_op = &qnx6_sops;
s->s_magic = QNX6_SUPER_MAGIC;
s->s_flags |= MS_RDONLY; /* Yup, read-only yet */
/* ease the later tree level calculations */
sbi = QNX6_SB(s);
sbi->s_ptrbits = ilog2(s->s_blocksize / 4);
sbi->inodes = qnx6_private_inode(s, &sb1->Inode);
if (!sbi->inodes)
goto out;
sbi->longfile = qnx6_private_inode(s, &sb1->Longfile);
if (!sbi->longfile)
goto out1;
/* prefetch root inode */
root = qnx6_iget(s, QNX6_ROOT_INO);
if (IS_ERR(root)) {
pr_err("get inode failed\n");
ret = PTR_ERR(root);
goto out2;
}
ret = -ENOMEM;
s->s_root = d_make_root(root);
if (!s->s_root)
goto out2;
ret = -EINVAL;
errmsg = qnx6_checkroot(s);
if (errmsg != NULL) {
if (!silent)
pr_err("%s\n", errmsg);
goto out3;
}
return 0;
out3:
dput(s->s_root);
s->s_root = NULL;
out2:
iput(sbi->longfile);
out1:
iput(sbi->inodes);
out:
if (bh1)
brelse(bh1);
if (bh2)
brelse(bh2);
outnobh:
kfree(qs);
s->s_fs_info = NULL;
return ret;
}
static void qnx6_put_super(struct super_block *sb)
{
struct qnx6_sb_info *qs = QNX6_SB(sb);
brelse(qs->sb_buf);
iput(qs->longfile);
iput(qs->inodes);
kfree(qs);
sb->s_fs_info = NULL;
return;
}
static sector_t qnx6_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping, block, qnx6_get_block);
}
static const struct address_space_operations qnx6_aops = {
.readpage = qnx6_readpage,
.readpages = qnx6_readpages,
.bmap = qnx6_bmap
};
static struct inode *qnx6_private_inode(struct super_block *s,
struct qnx6_root_node *p)
{
struct inode *inode = new_inode(s);
if (inode) {
struct qnx6_inode_info *ei = QNX6_I(inode);
struct qnx6_sb_info *sbi = QNX6_SB(s);
inode->i_size = fs64_to_cpu(sbi, p->size);
memcpy(ei->di_block_ptr, p->ptr, sizeof(p->ptr));
ei->di_filelevels = p->levels;
inode->i_mode = S_IFREG | S_IRUSR; /* probably wrong */
inode->i_mapping->a_ops = &qnx6_aops;
}
return inode;
}
struct inode *qnx6_iget(struct super_block *sb, unsigned ino)
{
struct qnx6_sb_info *sbi = QNX6_SB(sb);
struct qnx6_inode_entry *raw_inode;
struct inode *inode;
struct qnx6_inode_info *ei;
struct address_space *mapping;
struct page *page;
u32 n, offs;
inode = iget_locked(sb, ino);
if (!inode)
return ERR_PTR(-ENOMEM);
if (!(inode->i_state & I_NEW))
return inode;
ei = QNX6_I(inode);
inode->i_mode = 0;
if (ino == 0) {
pr_err("bad inode number on dev %s: %u is out of range\n",
sb->s_id, ino);
iget_failed(inode);
return ERR_PTR(-EIO);
}
n = (ino - 1) >> (PAGE_CACHE_SHIFT - QNX6_INODE_SIZE_BITS);
offs = (ino - 1) & (~PAGE_CACHE_MASK >> QNX6_INODE_SIZE_BITS);
mapping = sbi->inodes->i_mapping;
page = read_mapping_page(mapping, n, NULL);
if (IS_ERR(page)) {
pr_err("major problem: unable to read inode from dev %s\n",
sb->s_id);
iget_failed(inode);
return ERR_CAST(page);
}
kmap(page);
raw_inode = ((struct qnx6_inode_entry *)page_address(page)) + offs;
inode->i_mode = fs16_to_cpu(sbi, raw_inode->di_mode);
i_uid_write(inode, (uid_t)fs32_to_cpu(sbi, raw_inode->di_uid));
i_gid_write(inode, (gid_t)fs32_to_cpu(sbi, raw_inode->di_gid));
inode->i_size = fs64_to_cpu(sbi, raw_inode->di_size);
inode->i_mtime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_mtime);
inode->i_mtime.tv_nsec = 0;
inode->i_atime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_atime);
inode->i_atime.tv_nsec = 0;
inode->i_ctime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_ctime);
inode->i_ctime.tv_nsec = 0;
/* calc blocks based on 512 byte blocksize */
inode->i_blocks = (inode->i_size + 511) >> 9;
memcpy(&ei->di_block_ptr, &raw_inode->di_block_ptr,
sizeof(raw_inode->di_block_ptr));
ei->di_filelevels = raw_inode->di_filelevels;
if (S_ISREG(inode->i_mode)) {
inode->i_fop = &generic_ro_fops;
inode->i_mapping->a_ops = &qnx6_aops;
} else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &qnx6_dir_inode_operations;
inode->i_fop = &qnx6_dir_operations;
inode->i_mapping->a_ops = &qnx6_aops;
} else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &qnx6_aops;
} else
init_special_inode(inode, inode->i_mode, 0);
qnx6_put_page(page);
unlock_new_inode(inode);
return inode;
}
static struct kmem_cache *qnx6_inode_cachep;
static struct inode *qnx6_alloc_inode(struct super_block *sb)
{
struct qnx6_inode_info *ei;
ei = kmem_cache_alloc(qnx6_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
}
static void qnx6_i_callback(struct rcu_head *head)
{
struct inode *inode = container_of(head, struct inode, i_rcu);
kmem_cache_free(qnx6_inode_cachep, QNX6_I(inode));
}
static void qnx6_destroy_inode(struct inode *inode)
{
call_rcu(&inode->i_rcu, qnx6_i_callback);
}
static void init_once(void *foo)
{
struct qnx6_inode_info *ei = (struct qnx6_inode_info *) foo;
inode_init_once(&ei->vfs_inode);
}
static int init_inodecache(void)
{
qnx6_inode_cachep = kmem_cache_create("qnx6_inode_cache",
sizeof(struct qnx6_inode_info),
0, (SLAB_RECLAIM_ACCOUNT|
SLAB_MEM_SPREAD),
init_once);
if (!qnx6_inode_cachep)
return -ENOMEM;
return 0;
}
static void destroy_inodecache(void)
{
/*
* Make sure all delayed rcu free inodes are flushed before we
* destroy cache.
*/
rcu_barrier();
kmem_cache_destroy(qnx6_inode_cachep);
}
static struct dentry *qnx6_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
return mount_bdev(fs_type, flags, dev_name, data, qnx6_fill_super);
}
static struct file_system_type qnx6_fs_type = {
.owner = THIS_MODULE,
.name = "qnx6",
.mount = qnx6_mount,
.kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};
MODULE_ALIAS_FS("qnx6");
static int __init init_qnx6_fs(void)
{
int err;
err = init_inodecache();
if (err)
return err;
err = register_filesystem(&qnx6_fs_type);
if (err) {
destroy_inodecache();
return err;
}
pr_info("QNX6 filesystem 1.0.0 registered.\n");
return 0;
}
static void __exit exit_qnx6_fs(void)
{
unregister_filesystem(&qnx6_fs_type);
destroy_inodecache();
}
module_init(init_qnx6_fs)
module_exit(exit_qnx6_fs)
MODULE_LICENSE("GPL");
/************************************************************/
/* ../linux-3.17/fs/qnx6/inode.c */
/************************************************************/
/*
* QNX6 file system, Linux implementation.
*
* Version : 1.0.0
*
* History :
*
* 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
* 16-02-2012 pagemap extension by Al Viro
*
*/
// #include "qnx6.h"
static unsigned qnx6_lfile_checksum(char *name, unsigned size)
{
unsigned crc = 0;
char *end = name + size;
while (name < end) {
crc = ((crc >> 1) + *(name++)) ^
((crc & 0x00000001) ? 0x80000000 : 0);
}
return crc;
}
static struct page *qnx6_get_page(struct inode *dir, unsigned long n)
{
struct address_space *mapping = dir->i_mapping;
struct page *page = read_mapping_page(mapping, n, NULL);
if (!IS_ERR(page))
kmap(page);
return page;
}
static inline unsigned long dir_pages(struct inode *inode)
{
return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
}
static unsigned last_entry(struct inode *inode, unsigned long page_nr)
{
unsigned long last_byte = inode->i_size;
last_byte -= page_nr << PAGE_CACHE_SHIFT;
if (last_byte > PAGE_CACHE_SIZE)
last_byte = PAGE_CACHE_SIZE;
return last_byte / QNX6_DIR_ENTRY_SIZE;
}
static struct qnx6_long_filename *qnx6_longname(struct super_block *sb,
struct qnx6_long_dir_entry *de,
struct page **p)
{
struct qnx6_sb_info *sbi = QNX6_SB(sb);
u32 s = fs32_to_cpu(sbi, de->de_long_inode); /* in block units */
u32 n = s >> (PAGE_CACHE_SHIFT - sb->s_blocksize_bits); /* in pages */
/* within page */
u32 offs = (s << sb->s_blocksize_bits) & ~PAGE_CACHE_MASK;
struct address_space *mapping = sbi->longfile->i_mapping;
struct page *page = read_mapping_page(mapping, n, NULL);
if (IS_ERR(page))
return ERR_CAST(page);
kmap(*p = page);
return (struct qnx6_long_filename *)(page_address(page) + offs);
}
static int qnx6_dir_longfilename(struct inode *inode,
struct qnx6_long_dir_entry *de,
struct dir_context *ctx,
unsigned de_inode)
{
struct qnx6_long_filename *lf;
struct super_block *s = inode->i_sb;
struct qnx6_sb_info *sbi = QNX6_SB(s);
struct page *page;
int lf_size;
if (de->de_size != 0xff) {
/* error - long filename entries always have size 0xff
in direntry */
pr_err("invalid direntry size (%i).\n", de->de_size);
return 0;
}
lf = qnx6_longname(s, de, &page);
if (IS_ERR(lf)) {
pr_err("Error reading longname\n");
return 0;
}
lf_size = fs16_to_cpu(sbi, lf->lf_size);
if (lf_size > QNX6_LONG_NAME_MAX) {
pr_debug("file %s\n", lf->lf_fname);
pr_err("Filename too long (%i)\n", lf_size);
qnx6_put_page(page);
return 0;
}
/* calc & validate longfilename checksum
mmi 3g filesystem does not have that checksum */
if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) !=
qnx6_lfile_checksum(lf->lf_fname, lf_size))
pr_info("long filename checksum error.\n");
pr_debug("qnx6_readdir:%.*s inode:%u\n",
lf_size, lf->lf_fname, de_inode);
if (!dir_emit(ctx, lf->lf_fname, lf_size, de_inode, DT_UNKNOWN)) {
qnx6_put_page(page);
return 0;
}
qnx6_put_page(page);
/* success */
return 1;
}
static int qnx6_readdir(struct file *file, struct dir_context *ctx)
{
struct inode *inode = file_inode(file);
struct super_block *s = inode->i_sb;
struct qnx6_sb_info *sbi = QNX6_SB(s);
loff_t pos = ctx->pos & ~(QNX6_DIR_ENTRY_SIZE - 1);
unsigned long npages = dir_pages(inode);
unsigned long n = pos >> PAGE_CACHE_SHIFT;
unsigned start = (pos & ~PAGE_CACHE_MASK) / QNX6_DIR_ENTRY_SIZE;
bool done = false;
ctx->pos = pos;
if (ctx->pos >= inode->i_size)
return 0;
for ( ; !done && n < npages; n++, start = 0) {
struct page *page = qnx6_get_page(inode, n);
int limit = last_entry(inode, n);
struct qnx6_dir_entry *de;
int i = start;
if (IS_ERR(page)) {
pr_err("%s(): read failed\n", __func__);
ctx->pos = (n + 1) << PAGE_CACHE_SHIFT;
return PTR_ERR(page);
}
de = ((struct qnx6_dir_entry *)page_address(page)) + start;
for (; i < limit; i++, de++, ctx->pos += QNX6_DIR_ENTRY_SIZE) {
int size = de->de_size;
u32 no_inode = fs32_to_cpu(sbi, de->de_inode);
if (!no_inode || !size)
continue;
if (size > QNX6_SHORT_NAME_MAX) {
/* long filename detected
get the filename from long filename
structure / block */
if (!qnx6_dir_longfilename(inode,
(struct qnx6_long_dir_entry *)de,
ctx, no_inode)) {
done = true;
break;
}
} else {
pr_debug("%s():%.*s inode:%u\n",
__func__, size, de->de_fname,
no_inode);
if (!dir_emit(ctx, de->de_fname, size,
no_inode, DT_UNKNOWN)) {
done = true;
break;
}
}
}
qnx6_put_page(page);
}
return 0;
}
/*
* check if the long filename is correct.
*/
static unsigned qnx6_long_match(int len, const char *name,
struct qnx6_long_dir_entry *de, struct inode *dir)
{
struct super_block *s = dir->i_sb;
struct qnx6_sb_info *sbi = QNX6_SB(s);
struct page *page;
int thislen;
struct qnx6_long_filename *lf = qnx6_longname(s, de, &page);
if (IS_ERR(lf))
return 0;
thislen = fs16_to_cpu(sbi, lf->lf_size);
if (len != thislen) {
qnx6_put_page(page);
return 0;
}
if (memcmp(name, lf->lf_fname, len) == 0) {
qnx6_put_page(page);
return fs32_to_cpu(sbi, de->de_inode);
}
qnx6_put_page(page);
return 0;
}
/*
* check if the filename is correct.
*/
static unsigned qnx6_match(struct super_block *s, int len, const char *name,
struct qnx6_dir_entry *de)
{
struct qnx6_sb_info *sbi = QNX6_SB(s);
if (memcmp(name, de->de_fname, len) == 0)
return fs32_to_cpu(sbi, de->de_inode);
return 0;
}
unsigned qnx6_find_entry(int len, struct inode *dir, const char *name,
struct page **res_page)
{
struct super_block *s = dir->i_sb;
struct qnx6_inode_info *ei = QNX6_I(dir);
struct page *page = NULL;
unsigned long start, n;
unsigned long npages = dir_pages(dir);
unsigned ino;
struct qnx6_dir_entry *de;
struct qnx6_long_dir_entry *lde;
*res_page = NULL;
if (npages == 0)
return 0;
start = ei->i_dir_start_lookup;
if (start >= npages)
start = 0;
n = start;
do {
page = qnx6_get_page(dir, n);
if (!IS_ERR(page)) {
int limit = last_entry(dir, n);
int i;
de = (struct qnx6_dir_entry *)page_address(page);
for (i = 0; i < limit; i++, de++) {
if (len <= QNX6_SHORT_NAME_MAX) {
/* short filename */
if (len != de->de_size)
continue;
ino = qnx6_match(s, len, name, de);
if (ino)
goto found;
} else if (de->de_size == 0xff) {
/* deal with long filename */
lde = (struct qnx6_long_dir_entry *)de;
ino = qnx6_long_match(len,
name, lde, dir);
if (ino)
goto found;
} else
pr_err("undefined filename size in inode.\n");
}
qnx6_put_page(page);
}
if (++n >= npages)
n = 0;
} while (n != start);
return 0;
found:
*res_page = page;
ei->i_dir_start_lookup = n;
return ino;
}
const struct file_operations qnx6_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.iterate = qnx6_readdir,
.fsync = generic_file_fsync,
};
const struct inode_operations qnx6_dir_inode_operations = {
.lookup = qnx6_lookup,
};
/************************************************************/
/* ../linux-3.17/fs/qnx6/dir.c */
/************************************************************/
/*
* QNX6 file system, Linux implementation.
*
* Version : 1.0.0
*
* History :
*
* 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
* 16-02-2012 pagemap extension by Al Viro
*
*/
// #include "qnx6.h"
struct dentry *qnx6_lookup(struct inode *dir, struct dentry *dentry,
unsigned int flags)
{
unsigned ino;
struct page *page;
struct inode *foundinode = NULL;
const char *name = dentry->d_name.name;
int len = dentry->d_name.len;
if (len > QNX6_LONG_NAME_MAX)
return ERR_PTR(-ENAMETOOLONG);
ino = qnx6_find_entry(len, dir, name, &page);
if (ino) {
foundinode = qnx6_iget(dir->i_sb, ino);
qnx6_put_page(page);
if (IS_ERR(foundinode)) {
pr_debug("lookup->iget -> error %ld\n",
PTR_ERR(foundinode));
return ERR_CAST(foundinode);
}
} else {
pr_debug("%s(): not found %s\n", __func__, name);
return NULL;
}
d_add(dentry, foundinode);
return NULL;
}
/************************************************************/
/* ../linux-3.17/fs/qnx6/namei.c */
/************************************************************/
/*
* QNX6 file system, Linux implementation.
*
* Version : 1.0.0
*
* History :
*
* 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
*
*/
// #include <linux/buffer_head.h>
// #include <linux/slab.h>
// #include <linux/crc32.h>
// #include "qnx6.h"
static void qnx6_mmi_copy_sb(struct qnx6_super_block *qsb,
struct qnx6_mmi_super_block *sb)
{
qsb->sb_magic = sb->sb_magic;
qsb->sb_checksum = sb->sb_checksum;
qsb->sb_serial = sb->sb_serial;
qsb->sb_blocksize = sb->sb_blocksize;
qsb->sb_num_inodes = sb->sb_num_inodes;
qsb->sb_free_inodes = sb->sb_free_inodes;
qsb->sb_num_blocks = sb->sb_num_blocks;
qsb->sb_free_blocks = sb->sb_free_blocks;
/* the rest of the superblock is the same */
memcpy(&qsb->Inode, &sb->Inode, sizeof(sb->Inode));
memcpy(&qsb->Bitmap, &sb->Bitmap, sizeof(sb->Bitmap));
memcpy(&qsb->Longfile, &sb->Longfile, sizeof(sb->Longfile));
}
struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
{
struct buffer_head *bh1, *bh2 = NULL;
struct qnx6_mmi_super_block *sb1, *sb2;
struct qnx6_super_block *qsb = NULL;
struct qnx6_sb_info *sbi;
__u64 offset;
/* Check the superblock signatures
start with the first superblock */
bh1 = sb_bread(s, 0);
if (!bh1) {
pr_err("Unable to read first mmi superblock\n");
return NULL;
}
sb1 = (struct qnx6_mmi_super_block *)bh1->b_data;
sbi = QNX6_SB(s);
if (fs32_to_cpu(sbi, sb1->sb_magic) != QNX6_SUPER_MAGIC) {
if (!silent) {
pr_err("wrong signature (magic) in superblock #1.\n");
goto out;
}
}
/* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb1->sb_checksum) !=
crc32_be(0, (char *)(bh1->b_data + 8), 504)) {
pr_err("superblock #1 checksum error\n");
goto out;
}
/* calculate second superblock blocknumber */
offset = fs32_to_cpu(sbi, sb1->sb_num_blocks) + QNX6_SUPERBLOCK_AREA /
fs32_to_cpu(sbi, sb1->sb_blocksize);
/* set new blocksize */
if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) {
pr_err("unable to set blocksize\n");
goto out;
}
/* blocksize invalidates bh - pull it back in */
brelse(bh1);
bh1 = sb_bread(s, 0);
if (!bh1)
goto out;
sb1 = (struct qnx6_mmi_super_block *)bh1->b_data;
/* read second superblock */
bh2 = sb_bread(s, offset);
if (!bh2) {
pr_err("unable to read the second superblock\n");
goto out;
}
sb2 = (struct qnx6_mmi_super_block *)bh2->b_data;
if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) {
if (!silent)
pr_err("wrong signature (magic) in superblock #2.\n");
goto out;
}
/* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb2->sb_checksum)
!= crc32_be(0, (char *)(bh2->b_data + 8), 504)) {
pr_err("superblock #1 checksum error\n");
goto out;
}
qsb = kmalloc(sizeof(*qsb), GFP_KERNEL);
if (!qsb) {
pr_err("unable to allocate memory.\n");
goto out;
}
if (fs64_to_cpu(sbi, sb1->sb_serial) >
fs64_to_cpu(sbi, sb2->sb_serial)) {
/* superblock #1 active */
qnx6_mmi_copy_sb(qsb, sb1);
#ifdef CONFIG_QNX6FS_DEBUG
qnx6_superblock_debug(qsb, s);
#endif
memcpy(bh1->b_data, qsb, sizeof(struct qnx6_super_block));
sbi->sb_buf = bh1;
sbi->sb = (struct qnx6_super_block *)bh1->b_data;
brelse(bh2);
pr_info("superblock #1 active\n");
} else {
/* superblock #2 active */
qnx6_mmi_copy_sb(qsb, sb2);
#ifdef CONFIG_QNX6FS_DEBUG
qnx6_superblock_debug(qsb, s);
#endif
memcpy(bh2->b_data, qsb, sizeof(struct qnx6_super_block));
sbi->sb_buf = bh2;
sbi->sb = (struct qnx6_super_block *)bh2->b_data;
brelse(bh1);
pr_info("superblock #2 active\n");
}
kfree(qsb);
/* offset for mmi_fs is just SUPERBLOCK_AREA bytes */
sbi->s_blks_off = QNX6_SUPERBLOCK_AREA / s->s_blocksize;
/* success */
return sbi->sb;
out:
if (bh1 != NULL)
brelse(bh1);
if (bh2 != NULL)
brelse(bh2);
return NULL;
}
/************************************************************/
/* ../linux-3.17/fs/qnx6/super_mmi.c */
/************************************************************/
| 25.666951 | 102 | 0.673415 |
5a21dad028ff8edd0aa52aef82fb2f8bb99833fe | 647 | h | C | atom/renderer/guest_view_container.h | fireball-x/atom-shell | d229338e40058a9b4323b2544f62818a3c55748c | [
"MIT"
] | 4 | 2016-04-02T14:53:54.000Z | 2017-07-26T05:47:43.000Z | atom/renderer/guest_view_container.h | cocos-creator/atom-shell | d229338e40058a9b4323b2544f62818a3c55748c | [
"MIT"
] | null | null | null | atom/renderer/guest_view_container.h | cocos-creator/atom-shell | d229338e40058a9b4323b2544f62818a3c55748c | [
"MIT"
] | 1 | 2019-05-28T16:27:12.000Z | 2019-05-28T16:27:12.000Z | // Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_RENDERER_GUEST_VIEW_CONTAINER_H_
#define ATOM_RENDERER_GUEST_VIEW_CONTAINER_H_
#include "content/public/renderer/browser_plugin_delegate.h"
#include "v8/include/v8.h"
namespace atom {
class GuestViewContainer : public content::BrowserPluginDelegate {
public:
explicit GuestViewContainer(content::RenderFrame* render_frame);
~GuestViewContainer() override;
private:
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
};
} // namespace atom
#endif // ATOM_RENDERER_GUEST_VIEW_CONTAINER_H_
| 25.88 | 69 | 0.797527 |
7cbdfcae8770955be175e824e92e535fabae4430 | 820 | h | C | 3rdparty/musl/libc-test/src/math/sanity/exp.h | jbdelcuv/openenclave | c2e9cfabd788597f283c8dd39edda5837b1b1339 | [
"MIT"
] | 2 | 2022-03-31T05:46:57.000Z | 2022-03-31T07:13:13.000Z | 3rdparty/musl/libc-test/src/math/sanity/exp.h | jbdelcuv/openenclave | c2e9cfabd788597f283c8dd39edda5837b1b1339 | [
"MIT"
] | 21 | 2020-02-05T11:09:56.000Z | 2020-03-26T18:09:09.000Z | 3rdparty/musl/libc-test/src/math/sanity/exp.h | jbdelcuv/openenclave | c2e9cfabd788597f283c8dd39edda5837b1b1339 | [
"MIT"
] | 4 | 2019-09-14T07:58:58.000Z | 2020-03-03T15:55:28.000Z | T(RN, -0x1.02239f3c6a8f1p+3, 0x1.490327ea61235p-12, -0x1.0a2866p-2, INEXACT)
T(RN, 0x1.161868e18bc67p+2, 0x1.34712ed238c04p+6, -0x1.c98d5p-6, INEXACT)
T(RN, -0x1.0c34b3e01e6e7p+3, 0x1.e06b1b6c18e64p-13, -0x1.ff797p-3, INEXACT)
T(RN, -0x1.a206f0a19dcc4p+2, 0x1.7dd47f810e68cp-10, -0x1.ed3e1cp-2, INEXACT)
T(RN, 0x1.288bbb0d6a1e6p+3, 0x1.4abc77496e07ep+13, 0x1.6a6ep-3, INEXACT)
T(RN, 0x1.52efd0cd80497p-1, 0x1.f04a9c10805p+0, -0x1.fc56bep-2, INEXACT)
T(RN, -0x1.a05cc754481d1p-2, 0x1.54f1e0fd3ea0dp-1, -0x1.b28448p-4, INEXACT)
T(RN, 0x1.1f9ef934745cbp-1, 0x1.c0f6266a6a547p+0, -0x1.91052p-2, INEXACT)
T(RN, 0x1.8c5db097f7442p-1, 0x1.1599b1d4a25fbp+1, -0x1.32cda4p-2, INEXACT)
T(RN, -0x1.5b86ea8118a0ep-1, 0x1.03b5728a00229p-1, 0x1.e3f5dp-2, INEXACT)
| 74.545455 | 81 | 0.690244 |
91367ed1e832a110896475c28b7cfb85f7d0f998 | 1,608 | h | C | FYHelper/Classes/FYCategory/UIView+FYBorder.h | iosfeng/FYHelper | 46ccd5f75cb794ef2ca6fdd9df0a0eec9e59855c | [
"MIT"
] | 5 | 2017-03-23T11:11:26.000Z | 2020-01-21T22:33:57.000Z | FYHelper/Classes/FYCategory/UIView+FYBorder.h | fee-studio/FYHelper | 46ccd5f75cb794ef2ca6fdd9df0a0eec9e59855c | [
"MIT"
] | 1 | 2016-10-24T09:35:25.000Z | 2017-05-09T07:03:03.000Z | FYHelper/Classes/FYCategory/UIView+FYBorder.h | iosfeng/FYHelper | 46ccd5f75cb794ef2ca6fdd9df0a0eec9e59855c | [
"MIT"
] | null | null | null | //
// UIView+FYBorder.h
// Fred
//
// Created by efeng on 2016/10/25.
// Copyright © 2016年 weiboyi. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_OPTIONS(NSUInteger, FYExcludePoint) {
FYExcludeStartPoint = 1 << 0,
FYExcludeEndPoint = 1 << 1,
FYExcludeAllPoint = ~0UL
};
@interface UIView (FYBorder)
- (void)fy_cornerStyleWithRadius:(CGFloat)radius;
- (void)fy_borderStyleWithColor:(UIColor *)color width:(CGFloat)width cornerRadius:(CGFloat)radius;
- (void)fy_borderStyleWithColor:(UIColor *)color width:(CGFloat)width;
/////////////////////////////////////////////
- (void)fy_addTopBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth;
- (void)fy_addLeftBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth;
- (void)fy_addBottomBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth;
- (void)fy_addRightBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth;
- (void)fy_removeTopBorder;
- (void)fy_removeLeftBorder;
- (void)fy_removeBottomBorder;
- (void)fy_removeRightBorder;
- (void)fy_addTopBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth excludePoint:(CGFloat)point edgeType:(FYExcludePoint)edge;
- (void)fy_addLeftBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth excludePoint:(CGFloat)point edgeType:(FYExcludePoint)edge;
- (void)fy_addBottomBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth excludePoint:(CGFloat)point edgeType:(FYExcludePoint)edge;
- (void)fy_addRightBorderWithColor:(UIColor *)color width:(CGFloat)borderWidth excludePoint:(CGFloat)point edgeType:(FYExcludePoint)edge;
@end
| 29.777778 | 138 | 0.754353 |
7b6fd07eeb846f14d59909bdab8099590450c006 | 28,314 | c | C | sources/versypdf/sources/VSBaseA.c | joycodex/VersyPDF | 9344245f371f3c36f15835d56edcd48a1d65cd36 | [
"Unlicense"
] | 127 | 2016-08-07T09:55:44.000Z | 2022-03-30T09:34:07.000Z | sources/versypdf/sources/VSBaseA.c | joycodex/VersyPDF | 9344245f371f3c36f15835d56edcd48a1d65cd36 | [
"Unlicense"
] | 2 | 2019-06-07T13:04:52.000Z | 2022-03-28T07:23:25.000Z | sources/versypdf/sources/VSBaseA.c | joycodex/VersyPDF | 9344245f371f3c36f15835d56edcd48a1d65cd36 | [
"Unlicense"
] | 32 | 2016-10-17T03:54:12.000Z | 2022-02-27T21:41:26.000Z | /*********************************************************************
This file is part of the VersyPDF project.
Copyright (C) 2005 - 2016 Sybrex Systems Ltd. All rights reserved.
Authors: Vadzim Shakun , et al.
VersyPDF is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version, with the addition of the following
permission added to Section 15 as permitted in Section 7(a):
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
SYBREX SYSTEMS. SYBREX SYSTEMS DISCLAIMS THE WARRANTY OF NON
INFRINGEMENT OF THIRD PARTY RIGHTS.
VersyPDF 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 Affero General Public License for more details.
In accordance with Section 7(b) of the GNU Affero General Public License,
a covered work must retain the producer line in every PDF that is created
or manipulated using VersyPDF.
You can be released from the requirements of the license by purchasing
a commercial license. Buying such a license is mandatory as soon as you
develop commercial activities involving VersyPDF without disclosing
the source code of your own applications, offering paid services to customers
as an ASP, serving PDFs on the fly in a commerce web application,
or shipping VersyPDF with a closed source product.
For more information, please contact Sybrex Systems at http://www.sybrex.com
----------------------------------------------------------------------
VSBaseA.c
*********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "../VSBaseA.h"
#include "VSLibI.h"
#include "VSMisc.h"
#include "VSAssert.h"
#ifdef WINDOWS_PLATFORM
#include <windows.h>
#include <winbase.h>
#endif
/* Atom Section*/
ppInt32 ULModFindOrAppendAtom(PDFLibHandle Lib, char *str)
{
PPDFLib l = ( PPDFLib ) Lib;
ppInt32 i, cmp;
char *n;
PppAtomNode /* T = &( l-> AtomRoot), */
S,P, Q;
S = P = l->AtomRoot.Right;
if ( !S ){
S = ( PppAtomNode ) mmalloc ( Lib, sizeof ( ppAtomNode ) );
i = ( ppInt32 ) strlen ( str );
n = ( char * ) mmalloc ( Lib, i + 1 );
memcpy ( n, str, i + 1 );
S->Balance = 0;
S->ID = 0;
S->Left = NULL;
S->Right = NULL;
S->String = n;
S->EscStr = ULGetEscName ( Lib, n );
S->Length = ULGetNameSize ( n );
if ( ( l->AtomCount ) == l->AtomCapacity ){
l->AtomCapacity += CalculateDelta(l->AtomCapacity);
l->AtomArray = ( PppAtomNode *) mrealloc ( Lib, l->AtomArray, sizeof ( PppAtomNode ) * l->AtomCapacity );
};
l->AtomArray[l->AtomCount++] = S;
l->AtomRoot.Right = S;
return 0;
}
A2 :
cmp = strcmp ( str, P->String );
if ( !cmp )
return P->ID;
if ( cmp < 0 ){
Q = P->Left;
if ( !Q ){
Q = ( PppAtomNode ) mmalloc ( Lib, sizeof ( ppAtomNode ) );
P->Left = Q;
goto A5;
}
} else{
Q = P->Right;
if ( !Q ){
Q = ( PppAtomNode )mmalloc ( Lib, sizeof ( ppAtomNode ) );
P->Right = Q;
goto A5;
}
}
/* if ( Q->Balance ){
T = P;
S = Q;
}*/
P = Q;
goto A2;
A5 :
i = ( ppInt32 ) strlen ( str );
n = ( char * ) mmalloc ( Lib, i + 1 );
memcpy ( n, str, i + 1 );
Q->Balance = 0;
Q->ID = l->AtomCount;
Q->Left = NULL;
Q->Right = NULL;
Q->String = n;
Q->EscStr = ULGetEscName ( Lib, n );
Q->Length = ULGetNameSize ( n );
if ( ( l->AtomCount ) == l->AtomCapacity ){
l->AtomCapacity += CalculateDelta ( l->AtomCapacity ) ;
l->AtomArray = ( PppAtomNode * )mrealloc ( Lib, l->AtomArray, sizeof ( PppAtomNode ) * l->AtomCapacity );
};
l->AtomArray[l->AtomCount] = Q;
return l->AtomCount++;
}
ppAtom ULStringToAtom(PDFLibHandle Lib, char *str)
{
return ULModFindOrAppendAtom ( Lib, str );
}
char * ULAtomToString(PDFLibHandle Lib, ppAtom atom)
{
if ( atom >= ( (PPDFLib) Lib )->AtomCount )
return NULL;
return ( (PPDFLib) Lib )->AtomArray[atom]->String;
}
ppInt32 ULGetAtomCount(PDFLibHandle Lib)
{
return ( (PPDFLib) Lib )->AtomCount;
}
void ULFindAtom(PDFLibHandle Lib, char *str, PppAtomNode node)
{
ppInt32 i;
if ( !node )
return;
i = strcmp ( str, node->String );
if ( i < 0 )
ULFindAtom ( Lib, str, node->Left );
else if ( i > 0 )
ULFindAtom ( Lib, str, node->Right );
else
( (PPDFLib) Lib )->LastAtom = node;
}
ppBool ULExistsAtomForString(PDFLibHandle Lib, char *str)
{
( (PPDFLib) Lib )->LastAtom = NULL;
if ( ( (PPDFLib) Lib )->AtomRoot.Right )
ULFindAtom ( Lib, str, ( (PPDFLib) Lib )->AtomRoot.Right );
else if ( ( (PPDFLib) Lib )->AtomRoot.Left )
ULFindAtom ( Lib, str, ( (PPDFLib) Lib )->AtomRoot.Left );
return ( (PPDFLib) Lib )->LastAtom ? true : false;
}
/* File Section*/
ppInt32 ULWriteFileBuffer(PDFFileHandle file, void *buffer, ppInt32 len)
{
#ifdef WINDOWS_PLATFORM
ppUns32 sz;
BOOL b;
#endif
if ( len == 0 )
return 0;
if ( ( ( PppFile ) file )->Mode == ppFileReadMode )
return 0;
#ifdef WINDOWS_PLATFORM
b = WriteFile ( ( ( PppFile ) file )->File, buffer, len, &sz, NULL );
if ( !b )
PDFRAISE ( ( ( PppFile ) file )->Lib,
PDFBuildErrCode ( ErrGeneralLevel, gleCannotSaveBufferToFileError ) );
#else
if ( fwrite ( buffer, 1, len, ( ( PppFile ) file )->File ) != len )
PDFRAISE ( ( ( PppFile ) file )->Lib,
PDFBuildErrCode ( ErrGeneralLevel, gleCannotSaveBufferToFileError ) );
#endif
return 0;
}
ppUns32 ULFileGetPosition(PDFFileHandle file)
{
if ( ( ( PppFile ) file )->Mode == ppFileReadMode )
#ifdef WINDOWS_PLATFORM
return ( ( PppFile ) file )->Position;
#else
return ( ppInt32 ) ftell ( ( ( PppFile ) file )->File );
#endif
else
return ( ( PppFile ) file )->FileSize + ( ( PppFile ) file )->BufferSize;
}
PDFFileHandle ULFileOpen(PDFLibHandle Lib, char *filename, ppFileOpenMode mode)
{
PppFile tmp;
#ifdef WINDOWS_PLATFORM
PVOID map = NULL;
HANDLE hFile = NULL, hFileMapping;
ppInt32 sz = 0 ;
#else
FILE *f;
#endif
if ( !filename )
return NULL;
#ifndef WINDOWS_PLATFORM
switch ( mode ){
case ppFileReadMode:
f = fopen ( filename, READMODE );
break;
case ppFileWriteMode:
f = fopen ( filename, WRITEMODE );
break;
};
if ( !f ){
switch ( mode ){
case ppFileWriteMode:
PDFRAISE ( Lib, PDFBuildErrCode ( ErrGeneralLevel, gleCannotCreateFileError ) );
break;
case ppFileReadMode:
default:
PDFRAISE ( Lib, PDFBuildErrCode ( ErrGeneralLevel, gleCannotOpenFileError ) );
}
}
PDFTRY ( Lib ){
tmp = mmalloc ( Lib, sizeof ( ppFile ) );
tmp->Buffer = mmalloc ( Lib, FILE_BUFFER_SIZE );
} PDFEXCEPT ( Lib ){
chfreez ( Lib, tmp );
fclose ( f );
PDFRERAISE ( Lib );
}
PDFTRYEND ( Lib );
tmp->File = f;
tmp->Mode = mode;
tmp->Lib = Lib;
tmp->BufferSize = 0;
tmp->FileSize = 0;
return( PDFFileHandle ) tmp;
#else
switch ( mode ){
case ppFileReadMode:
hFile = CreateFile ( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, 0 );
if ( hFile == INVALID_HANDLE_VALUE )
PDFRAISE ( Lib, PDFBuildErrCode ( ErrGeneralLevel, gleCannotOpenFileError ) );
sz = GetFileSize ( hFile, NULL );
if ( sz == 0 ){
CloseHandle ( hFile );
PDFRAISE ( Lib,
PDFBuildErrCode ( ErrGeneralLevel, gleCannotReceiveFileSizeError ) );
};
hFileMapping = CreateFileMapping ( hFile, NULL, PAGE_READONLY, 0, sz, NULL );
if ( !hFileMapping ){
CloseHandle ( hFile );
PDFRAISE ( Lib, PDFBuildErrCode ( ErrGeneralLevel, gleCannotCreateMapFileError ) );
};
CloseHandle ( hFile );
map = MapViewOfFile ( hFileMapping, FILE_MAP_READ, 0, 0, 0 );
CloseHandle ( hFileMapping );
if ( !map )
PDFRAISE ( Lib, PDFBuildErrCode ( ErrGeneralLevel, gleCannotCreateMapFileError ) );
break;
case ppFileWriteMode:
hFile = CreateFile ( filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, 0 );
if ( hFile == INVALID_HANDLE_VALUE )
PDFRAISE ( Lib, PDFBuildErrCode ( ErrGeneralLevel, gleCannotCreateFileError ) );
break;
};
tmp = ( PppFile ) mmalloc ( Lib, sizeof ( ppFile ) );
if (mode == ppFileWriteMode){
PDFTRY ( Lib ){
tmp->Buffer = ( ppUns8 * ) mmalloc ( Lib, FILE_BUFFER_SIZE );
}PDFEXCEPT ( Lib ){
chfreez ( Lib, tmp );
CloseHandle ( hFile );
PDFRERAISE ( Lib );
}
PDFTRYEND ( Lib );
}
tmp->Mode = mode;
tmp->Map = map;
tmp->Size = sz;
tmp->File = hFile;
tmp->Position = 0;
tmp->BufferSize = 0;
tmp->FileSize = 0;
tmp->Lib = Lib;
return ( PDFFileHandle ) tmp;
#endif
}
ppUns32 ULFileWrite(PDFFileHandle file, void *buffer, ppUns32 len)
{
#define _F ((PppFile)file)
ppInt32 j;
if ( len == 0 )
return 0;
if ( _F->Mode == ppFileReadMode )
return 0;
if ( len > FILE_BUFFER_SIZE ){
if ( _F->BufferSize )
ULWriteFileBuffer ( file, _F->Buffer, _F->BufferSize );
ULWriteFileBuffer ( file, buffer, len );
_F->FileSize += _F->BufferSize + len;
_F->BufferSize = 0;
return len;
}
if ( len + _F->BufferSize < FILE_BUFFER_SIZE ){
memcpy ( &( _F->Buffer[_F->BufferSize] ), buffer, len );
_F->BufferSize += len;
return len;
}
memcpy ( &( _F->Buffer[_F->BufferSize] ), buffer, j = FILE_BUFFER_SIZE - _F->BufferSize );
ULWriteFileBuffer ( file, _F->Buffer, FILE_BUFFER_SIZE );
_F->FileSize += FILE_BUFFER_SIZE;
_F->BufferSize = len - j;
if ( _F->BufferSize )
memcpy ( _F->Buffer, &( ( ( ppUns8 * ) buffer )[j] ), _F->BufferSize );
return len;
}
void ULFileClose(PDFFileHandle file)
{
if ( ( ( PppFile ) file )->Mode != ppFileReadMode ){
if ( ( ( PppFile ) file )->BufferSize )
ULWriteFileBuffer ( file, ( ( PppFile ) file )->Buffer,
( ( PppFile ) file )->BufferSize );
}
#ifdef WINDOWS_PLATFORM
if ( ( ( PppFile ) file )->Mode == ppFileReadMode )
UnmapViewOfFile ( ( ( PppFile ) file )->Map );
else{
mfree ( ((PppFile)file)->Lib, ( ( PppFile ) file )->Buffer );
CloseHandle ( ( ( PppFile ) file )->File );
}
#else
mfree ( ((PppFile)file)->Lib, ( ( PppFile ) file )->Buffer );
fclose ( ( ( PppFile ) file )->File );
#endif
mfree ( ((PppFile)file)->Lib, file );
}
ppUns32 ULFileSetPosition(PDFFileHandle file, ppUns32 pos)
{
#ifdef WINDOWS_PLATFORM
if ( ( ( PppFile ) file )->Mode == ppFileReadMode ){
( ( PppFile ) file )->Position = pos;
return pos;
} else
return SetFilePointer ( ( ( PppFile ) file )->File, pos, NULL, FILE_BEGIN );
#else
fseek ( ( ( PppFile ) file )->File, pos, SEEK_SET );
return pos;
#endif
}
ppUns32 ULFileGetSize(PDFFileHandle file)
{
#ifdef WINDOWS_PLATFORM
if ( ( ( PppFile ) file )->Mode == ppFileReadMode )
return ( ( PppFile ) file )->Size;
else
return GetFileSize ( ( ( PppFile ) file )->File, 0 );
#else
ppInt32 old, ret;
old = (ppInt32)ftell ( ( ( PppFile ) file )->File );
fseek ( ( ( PppFile ) file )->File, 0, SEEK_END );
ret = (ppInt32)ftell ( ( ( PppFile ) file )->File );
fseek ( ( ( PppFile ) file )->File, old, SEEK_SET );
return ret;
#endif
}
ppUns32 ULFileRead(PDFFileHandle file, void *buffer, ppUns32 len)
{
#ifdef WINDOWS_PLATFORM
char *b;
ppInt32 k;
#endif
if ( len == 0 )
return 0;
if ( ( ( PppFile ) file )->Mode != ppFileWriteMode )
#ifdef WINDOWS_PLATFORM
{
b = ( char * )( ( PppFile ) file )->Map;
b += ( ( PppFile ) file )->Position;
if ( ( ( PppFile ) file )->Position + len > ( ( PppFile ) file )->Size )
k = ( ( PppFile ) file )->Size - ( ( PppFile ) file )->Position;
else
k = len;
if ( k <= 0 )
return 0;
memcpy ( buffer, b, k );
( ( PppFile ) file )->Position += k;
return k;
}
#else
return ( ppInt32 ) fread ( buffer, 1, len, ( ( PppFile ) file )->File );
#endif
else
return 0;
}
ppInt32 ULFileGetChar(PDFFileHandle file)
{
#ifdef WINDOWS_PLATFORM
unsigned char * b;
ppInt32 v;
if ( ( ( PppFile ) file )->Mode != ppFileReadMode )
return EOF;
if ( ( ( PppFile ) file )->Size > ( ( PppFile ) file )->Position ){
b = ( unsigned char * ) ( ( PppFile ) file )->Map;
b += ( ( PppFile ) file )->Position;
v = ( ppInt32 ) ( *b );
( ( PppFile ) file )->Position++;
return v;
} else
return EOF;
#else
return fgetc ( ( ( PppFile ) file )->File );
#endif
}
ppInt32 ULFileLookChar(PDFFileHandle file)
{
#ifdef WINDOWS_PLATFORM
unsigned char * b;
ppInt32 v;
if ( ( ( PppFile ) file )->Mode != ppFileReadMode )
return EOF;
if ( ( ( PppFile ) file )->Size > ( ( PppFile ) file )->Position ){
b = ( unsigned char * )( ( PppFile ) file )->Map;
b += ( ( PppFile ) file )->Position;
v = ( ppInt32 ) ( *b );
return v;
} else
return EOF;
#else
ppInt32 pos, r;
pos = ULFileGetPosition ( file );
r = ULFileGetChar ( file );
ULFileSetPosition ( file, pos );
return r;
#endif
}
/*Stream Section */
#define __Stream(Strm) ((PULStrm) Strm )
#define _Stream __Stream(Strm)
void * ULStrmReAlloc(PULStrm pms, ppUns32 *NewCapacity)
{
void *t;
if ( *NewCapacity > 0 && *NewCapacity != pms->Sections.Memory.Size )
*NewCapacity = *NewCapacity + ( ( MemoryDelta - 1 ) & ( ~( MemoryDelta - 1 ) ) );
t = pms->Sections.Memory.Buffer;
if ( *NewCapacity != pms->Sections.Memory.Capacity ){
if ( *NewCapacity == 0 ){
mfree ( pms->Lib, pms->Sections.Memory.Buffer );
t = NULL;
} else if ( pms->Sections.Memory.Capacity == 0 )
t = mmalloc ( pms->Lib, *NewCapacity );
else
t = mrealloc ( pms->Lib, pms->Sections.Memory.Buffer, *NewCapacity );
}
return t;
}
ppInt32 ULStrmSetCapacity(PDFStreamHandle Strm, ppUns32 NewCapacity)
{
if ( _Stream->Type != strtMemory || _Stream->RO )
return 0;
_Stream->Sections.Memory.Buffer = ULStrmReAlloc (_Stream, &NewCapacity );
_Stream->Sections.Memory.Capacity = NewCapacity;
return NewCapacity;
}
void ULStreamClear(PDFStreamHandle Strm, ppUns32 InitSize)
{
if ( _Stream->Type != strtMemory )
return ;
if ( !InitSize ){
ULStrmSetCapacity ( Strm, 0 );
_Stream->Sections.Memory.Buffer = NULL;
} else
ULStrmSetCapacity ( Strm, InitSize );
_Stream->Sections.Memory.Size = 0;
_Stream->Sections.Memory.Position = 0;
}
PDFStreamHandle ULStreamFileNew(PDFLibHandle Lib, char *filename, ppFileOpenMode mode)
{
PDFFileHandle f;
PULStrm wrk = NULL;
f = ULFileOpen ( Lib, filename, mode );
PDFTRY ( Lib ){
wrk = ( PULStrm ) mmalloc ( Lib, sizeof ( TULStrm ) );
} PDFEXCEPT ( Lib ){
ULFileClose ( f );
PDFRERAISE ( Lib );
}
PDFTRYEND ( Lib );
wrk->RO = ( ppBool )( mode == ppFileReadMode );
wrk->Lib = Lib;
wrk->Sections.File.HandleCreated = true;
wrk->Type = strtFile;
wrk->Sections.File.FileHandle = f;
return ( PDFStreamHandle ) wrk;
}
PDFStreamHandle ULStreamFileHandleNew(PDFLibHandle Lib, PDFFileHandle file)
{
PULStrm wrk;
wrk = ( PULStrm ) mmalloc ( Lib, sizeof ( TULStrm ) );
wrk->RO = ( ppBool ) ( ( ( PppFile ) file )->Mode == ppFileReadMode );
wrk->Lib = Lib;
wrk->Sections.File.HandleCreated = false;
wrk->Type = strtFile;
wrk->Sections.File.FileHandle = file;
return ( PDFStreamHandle ) wrk;
}
PDFStreamHandle ULStreamMemNew(PDFLibHandle Lib, ppUns32 newsize)
{
PULStrm wrk;
wrk = ( PULStrm ) mmalloc ( Lib, sizeof ( TULStrm ) );
wrk->RO = false;
wrk->Lib = Lib;
wrk->Type = strtMemory;
wrk->Sections.Memory.Capacity = 0;
wrk->Sections.Memory.Size = 0;
wrk->Sections.Memory.Position = 0;
wrk->Sections.Memory.Buffer = NULL;
if ( newsize != 0 )
ULStrmSetCapacity ( wrk, newsize );
return ( PDFStreamHandle ) wrk;
}
PDFStreamHandle ULStreamCustomNew ( PDFLibHandle Lib, StreamReadBufferProc ReadBuffer, StreamWriteBufferProc WriteBuffer,
StreamGetPositionProc GetPosition, StreamSetPositionProc SetPosition, StreamGetSizeProc GetSize,
StreamGetCharProc GetChar, StreamLookCharProc LookChar, void * AStream )
{
PULStrm wrk;
wrk = ( PULStrm ) mmalloc ( Lib, sizeof ( TULStrm ) );
wrk->RO = false;
wrk->Lib = Lib;
wrk->Type = strtCustom;
wrk->Sections.Custom.AStream = AStream;
wrk->Sections.Custom.ReadBuffer = ReadBuffer;
wrk->Sections.Custom.WriteBuffer = WriteBuffer;
wrk->Sections.Custom.GetPosition = GetPosition;
wrk->Sections.Custom.GetSize = GetSize;
wrk->Sections.Custom.SetPosition = SetPosition;
wrk->Sections.Custom.GetChar = GetChar;
wrk->Sections.Custom.LookChar = LookChar;
return ( PDFStreamHandle ) wrk;
}
PDFStreamHandle ULStreamMemReadOnlyNew(PDFLibHandle Lib, void *buf, ppUns32 len)
{
PULStrm wrk;
wrk = ( PULStrm ) mmalloc ( Lib, sizeof ( TULStrm ) );
wrk->Sections.Memory.Buffer = buf;
wrk->Sections.Memory.Capacity = len;
wrk->Lib = Lib;
wrk->RO = true;
wrk->Sections.Memory.Position = 0;
wrk->Sections.Memory.Size = len;
wrk->Type = strtMemory;
return ( PDFStreamHandle ) wrk;
}
void ULStreamClose(PDFStreamHandle Strm)
{
ULStrmSetCapacity ( Strm, 0 );
if ( _Stream->Type == strtFile && _Stream->Sections.File.HandleCreated )
ULFileClose ( _Stream->Sections.File.FileHandle);
mfree ( _Stream->Lib, Strm );
}
ppUns32 ULStreamSetSize(PDFStreamHandle Strm, ppUns32 size)
{
ppUns32 OldPos;
if ( _Stream->Type != strtMemory || _Stream->RO )
return 0;
OldPos = _Stream->Sections.Memory.Position;
ULStrmSetCapacity ( Strm, size );
_Stream->Sections.Memory.Size = size;
if ( OldPos > size )
_Stream->Sections.Memory.Position = _Stream->Sections.Memory.Size;
return size;
}
ppUns32 ULStreamSetPosition(PDFStreamHandle Strm, ppUns32 newposition)
{
switch ( _Stream->Type ){
case strtMemory:
_Stream->Sections.Memory.Position = newposition;
return newposition;
case strtFile:
return ULFileSetPosition ( _Stream->Sections.File.FileHandle, newposition );
case strtCustom:
return _Stream->Sections.Custom.SetPosition ( _Stream->Lib, _Stream->Sections.Custom.AStream, newposition );
} ;
return 0;
}
ppUns32 ULStreamGetSize(PDFStreamHandle Strm)
{
switch ( _Stream->Type ){
case strtMemory:
return _Stream->Sections.Memory.Size;
case strtFile:
return ULFileGetSize ( _Stream->Sections.File.FileHandle );
case strtCustom:
return _Stream ->Sections.Custom.GetSize ( _Stream->Lib, _Stream->Sections.Custom.AStream );
} ;
return 0;
}
ppUns32 ULStreamGetPosition(PDFStreamHandle Strm)
{
switch ( _Stream->Type ){
case strtMemory:
return _Stream->Sections.Memory.Position;
case strtFile:
return ULFileGetPosition ( _Stream->Sections.File.FileHandle );
case strtCustom :
return _Stream->Sections.Custom.GetPosition (_Stream->Lib, _Stream->Sections.Custom.AStream );
} ;
return 0;
}
ppInt32 ULStreamReadChar(PDFStreamHandle Strm)
{
unsigned char * k, r;
switch ( _Stream->Type ){
case strtMemory:
if ( _Stream->Sections.Memory.Position >= _Stream->Sections.Memory.Size )
return EOF;
k = ( unsigned char * )_Stream->Sections.Memory.Buffer;
k += _Stream->Sections.Memory.Position;
r = *k;
_Stream->Sections.Memory.Position++;
return r;
case strtFile:
return ULFileGetChar ( _Stream->Sections.File.FileHandle );
case strtCustom:
return _Stream->Sections.Custom.GetChar (_Stream->Lib, _Stream->Sections.Custom.AStream );
} ;
return 0;
}
ppInt32 ULStreamLookChar(PDFStreamHandle Strm)
{
unsigned char * k, r;
switch ( _Stream->Type ){
case strtMemory:
if ( _Stream->Sections.Memory.Position >= _Stream->Sections.Memory.Size )
return EOF;
k = ( unsigned char * ) _Stream->Sections.Memory.Buffer;
k += _Stream->Sections.Memory.Position;
r = *k;
return r;
case strtFile:
return ULFileLookChar ( _Stream->Sections.File.FileHandle );
case strtCustom:
return _Stream->Sections.Custom.LookChar ( _Stream->Lib, _Stream->Sections.Custom.AStream );
} ;
return 0;
}
char * ULStreamReadLine(PDFStreamHandle Strm)
{
ppInt32 i, sz, pos;
ppUns32 a;
char *st;
sz = ULStreamGetSize ( Strm );
pos = ULStreamGetPosition ( Strm );
for ( i = 0; i + pos < sz && ( a = ULStreamReadChar ( Strm ) ) != '\r' && a != '\n'; i++ ){
};
st = ( char * ) mmalloc ( _Stream->Lib, i + 1 );
ULStreamSetPosition ( Strm, pos );
if ( i > 0 )
ULStreamReadBuffer ( Strm, st, i );
st[i] = '\0';
if ( i + pos != sz ){
a = ULStreamReadChar ( Strm );
if ( a == '\r' )
if ( 1 + i + pos < sz && ( ppUns32 ) ULStreamLookChar ( Strm ) == '\n' )
ULStreamReadChar ( Strm );
};
return st;
}
ppUns32 ULStreamReadBuffer(PDFStreamHandle Strm, void *Buffer, ppUns32 Count)
{
ppUns32 rr;
char *k;
switch ( _Stream->Type ){
case strtMemory:
rr = _Stream->Sections.Memory.Size - _Stream->Sections.Memory.Position;
if ( rr > 0 ){
if ( rr > Count )
rr = Count;
k = ( char * ) _Stream->Sections.Memory.Buffer;
k += _Stream->Sections.Memory.Position;
memcpy ( Buffer, k, rr );
_Stream->Sections.Memory.Position += rr;
return rr;
};
return 0;
case strtFile:
return ULFileRead ( _Stream->Sections.File.FileHandle, Buffer, Count );
case strtCustom:
return _Stream->Sections.Custom.ReadBuffer ( _Stream->Lib, _Stream->Sections.Custom.AStream, Buffer, Count );
} ;
return 0;
}
ppUns32 ULStreamWriteBuffer(PDFStreamHandle Strm, void *Buffer, ppUns32 Count)
{
ppUns32 pos;
char *k;
if ( _Stream->RO )
return 0;
switch ( _Stream->Type ){
case strtMemory:
pos = _Stream->Sections.Memory.Position + Count;
if ( pos > 0 ){
if ( pos > _Stream->Sections.Memory.Size ){
if ( pos > _Stream->Sections.Memory.Capacity )
ULStrmSetCapacity ( Strm, pos );
_Stream->Sections.Memory.Size = pos;
};
k = ( char * ) _Stream->Sections.Memory.Buffer;
k += _Stream->Sections.Memory.Position;
memcpy ( k, Buffer, Count );
_Stream->Sections.Memory.Position = pos;
return Count;
};
return _Stream->Sections.Memory.Position;
case strtFile:
return ULFileWrite ( _Stream->Sections.File.FileHandle, Buffer, Count );
case strtCustom:
return _Stream->Sections.Custom.WriteBuffer ( _Stream->Lib, _Stream->Sections.Custom.AStream, Buffer, Count );
} ;
return 0;
}
ppUns32 ULStreamWriteChar(PDFStreamHandle Strm, char ch)
{
return ULStreamWriteBuffer ( Strm, &ch, 1 );
}
ppInt32 ULStrmReset(PDFStreamHandle Strm)
{
switch ( _Stream->Type ){
case strtFile:
ULFileSetPosition ( _Stream->Sections.File.FileHandle, 0 );
break;
case strtMemory:
_Stream->Sections.Memory.Position = 0;
break;
case strtCustom:
_Stream->Sections.Custom.SetPosition ( _Stream->Lib, _Stream->Sections.Custom.AStream, 0 );
default:
;
}
return 0;
}
ppUns32 ULStreamCopyToStream(PDFStreamHandle FromStrm, PDFStreamHandle ToStrm)
{
void *bf;
char *b;
ppInt32 sz, pos, i;
switch ( __Stream (FromStrm )->Type ){
case strtMemory:
return ULStreamWriteBuffer ( ToStrm, __Stream (FromStrm )->Sections.Memory.Buffer,
__Stream (FromStrm )->Sections.Memory.Size );
case strtFile:
pos = ULFileGetPosition ( __Stream (FromStrm )->Sections.File.FileHandle );
ULFileSetPosition ( __Stream (FromStrm )->Sections.File.FileHandle, 0 );
sz = ULFileGetSize ( __Stream (FromStrm )->Sections.File.FileHandle );
if ( __Stream (ToStrm )->Type == strtMemory ){
if ( __Stream (ToStrm )->RO )
return 0;
else{
if ( __Stream (ToStrm )->Sections.Memory.Size < __Stream (ToStrm )->Sections.Memory.Position + sz )
ULStreamSetSize ( ToStrm, __Stream (ToStrm )->Sections.Memory.Position + sz );
b = ( char * ) __Stream (ToStrm )->Sections.Memory.Buffer;
b += __Stream (ToStrm )->Sections.Memory.Position;
i = ULFileRead ( __Stream (FromStrm )->Sections.File.FileHandle, b, sz );
ULFileSetPosition ( __Stream (FromStrm )->Sections.File.FileHandle, pos );
return i;
};
} else{
bf = mmalloc ( __Stream (FromStrm )->Lib, sz );
ULFileRead ( __Stream (FromStrm )->Sections.File.FileHandle, bf, sz );
ULFileSetPosition ( __Stream (FromStrm )->Sections.File.FileHandle, pos );
pos = ULStreamWriteBuffer ( ToStrm, bf, sz );
mfree ( __Stream (FromStrm )->Lib, bf );
return pos;
};
case strtCustom:
pos = __Stream( FromStrm )->Sections.Custom.GetPosition ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream );
__Stream( FromStrm )->Sections.Custom.SetPosition ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream, 0 );
sz = __Stream ( FromStrm )->Sections.Custom.GetSize ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream );
if ( __Stream (ToStrm )->Type == strtMemory ){
if ( __Stream (ToStrm )->RO )
return 0;
else{
if ( __Stream (ToStrm )->Sections.Memory.Size < __Stream (ToStrm )->Sections.Memory.Position + sz )
ULStreamSetSize ( ToStrm, __Stream (ToStrm )->Sections.Memory.Position + sz );
b = ( char * ) __Stream (ToStrm )->Sections.Memory.Buffer;
b += __Stream (ToStrm )->Sections.Memory.Position;
i = __Stream ( FromStrm )->Sections.Custom.ReadBuffer ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream, b, sz );
__Stream( FromStrm )->Sections.Custom.SetPosition ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream, pos );
return i;
};
} else{
bf = mmalloc ( __Stream (FromStrm )->Lib, sz );
__Stream ( FromStrm )->Sections.Custom.ReadBuffer ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream, bf, sz );
__Stream( FromStrm )->Sections.Custom.SetPosition ( __Stream (FromStrm )->Lib, __Stream (FromStrm )->Sections.Custom.AStream, pos );
pos = ULStreamWriteBuffer ( ToStrm, bf, sz );
mfree ( __Stream (FromStrm )->Lib, bf );
return pos;
};
} ;
return 0;
}
| 32.885017 | 143 | 0.592852 |
72c5204f21f3500c898d86e76dfeb9c3cee05c9b | 273 | h | C | cellAutomatonLibrary/cellautomatontoolbar.h | mtromp/cell-automaton | 086ad47bd638f69466b4e8207f6e1f55502fbc67 | [
"MIT"
] | null | null | null | cellAutomatonLibrary/cellautomatontoolbar.h | mtromp/cell-automaton | 086ad47bd638f69466b4e8207f6e1f55502fbc67 | [
"MIT"
] | null | null | null | cellAutomatonLibrary/cellautomatontoolbar.h | mtromp/cell-automaton | 086ad47bd638f69466b4e8207f6e1f55502fbc67 | [
"MIT"
] | null | null | null | #ifndef CELLAUTOMATONTOOLBAR_H
#define CELLAUTOMATONTOOLBAR_H
#include <QToolBar>
class CellAutomatonToolBar : public QToolBar
{
Q_OBJECT
public:
CellAutomatonToolBar(QWidget* parent = nullptr);
virtual ~CellAutomatonToolBar();
};
#endif // CELLAUTOMATONTOOLBAR_H
| 18.2 | 50 | 0.798535 |
980098b24d51119d8d7e8188bacc2ffa2cd220c4 | 1,223 | h | C | src/config.h | krux/apt-s3 | b9114a2b7fae1616849acb505e47d9e67c6e7d99 | [
"BSD-3-Clause"
] | null | null | null | src/config.h | krux/apt-s3 | b9114a2b7fae1616849acb505e47d9e67c6e7d99 | [
"BSD-3-Clause"
] | null | null | null | src/config.h | krux/apt-s3 | b9114a2b7fae1616849acb505e47d9e67c6e7d99 | [
"BSD-3-Clause"
] | null | null | null | /* include/config.h. Generated from config.h.in by configure. */
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* The following 4 are only used by inttypes.h shim if the system lacks
inttypes.h */
/* The number of bytes in a usigned char. */
/* #undef SIZEOF_CHAR */
/* The number of bytes in a unsigned int. */
/* #undef SIZEOF_INT */
/* The number of bytes in a unsigned long. */
/* #undef SIZEOF_LONG */
/* The number of bytes in a unsigned short. */
/* #undef SIZEOF_SHORT */
/* Define if we have the timegm() function */
#define HAVE_TIMEGM 1
/* These two are used by the statvfs shim for glibc2.0 and bsd */
/* Define if we have sys/vfs.h */
/* #undef HAVE_VFS_H */
/* Define if we have sys/mount.h */
/* #undef HAVE_MOUNT_H */
/* Define if we have enabled pthread support */
/* #undef HAVE_PTHREAD */
/* If there is no socklen_t, define this for the netdb shim */
/* #undef NEED_SOCKLEN_T_DEFINE */
/* Define the arch name string */
#define COMMON_ARCH "darwin-i386"
/* The version number string */
#define VERSION "0.7.20.2"
/* The package name string */
#define PACKAGE "apt"
| 27.795455 | 71 | 0.686018 |
bc8f2c156faf96348ecdfee461bfff9edc89ff75 | 11,932 | c | C | src/cpu/arm7/arm7exec.c | automation-club/pinmame | c44c0503a6516f79259bf5d1dbbfcdeadada1d1a | [
"BSD-3-Clause"
] | 46 | 2016-09-10T15:43:48.000Z | 2022-03-30T13:50:11.000Z | src/cpu/arm7/arm7exec.c | Kissarmynh/pinmame | c552e469d60400602f62f7cdc3c4e93d81c3b720 | [
"BSD-3-Clause"
] | 13 | 2021-01-20T18:36:26.000Z | 2021-12-31T06:49:42.000Z | src/cpu/arm7/arm7exec.c | Kissarmynh/pinmame | c552e469d60400602f62f7cdc3c4e93d81c3b720 | [
"BSD-3-Clause"
] | 25 | 2017-11-13T07:20:39.000Z | 2022-03-30T09:17:23.000Z | /*****************************************************************************
*
* arm7exec.c
* Portable ARM7TDMI Core Emulator
*
* Copyright (c) 2004 Steve Ellenoff, all rights reserved.
*
* - This source code is released as freeware for non-commercial purposes.
* - You are free to use and redistribute this code in modified or
* unmodified form, provided you list me in the credits.
* - If you modify this source code, you must add a notice to each modified
* source file that it has been changed. If you're a nice person, you
* will clearly mark each change too. :)
* - If you wish to use this for commercial purposes, please contact me at
* sellenoff@hotmail.com
* - The author of this copywritten work reserves the right to change the
* terms of its usage and license at any time, including retroactively
* - This entire notice must remain in the source code.
*
* This work is based on:
* #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999'
* #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76)
*
*****************************************************************************/
/******************************************************************************
* Notes:
* This file contains the code to run during the CPU EXECUTE METHOD.
* It has been split into it's own file (from the arm7core.c) so it can be
* directly compiled into any cpu core that wishes to use it.
*
* It should be included as follows in your cpu core:
*
* int arm7_execute( int cycles )
* {
* #include "arm7exec.c"
* }
*
*****************************************************************************/
//#define ARM9 has newer MAME code, but that is only partially ported over to the old codebase
#ifdef ARM9
void arm7_cpu_device::arm9ops_undef(uint32_t insn)
{
// unsupported instruction
LOG(("ARM7: Instruction %08X unsupported\n", insn));
}
void arm7_cpu_device::arm9ops_1(uint32_t insn)
{
/* Change processor state (CPS) */
if ((insn & 0x00f10020) == 0x00000000)
{
// unsupported (armv6 onwards only)
arm9ops_undef(insn);
R15 += 4;
}
else if ((insn & 0x00ff00f0) == 0x00010000) /* set endianness (SETEND) */
{
// unsupported (armv6 onwards only)
arm9ops_undef(insn);
R15 += 4;
}
else
{
arm9ops_undef(insn);
R15 += 4;
}
}
void arm7_cpu_device::arm9ops_57(uint32_t insn)
{
/* Cache Preload (PLD) */
if ((insn & 0x0070f000) == 0x0050f000)
{
// unsupported (armv6 onwards only)
arm9ops_undef(insn);
R15 += 4;
}
else
{
arm9ops_undef(insn);
R15 += 4;
}
}
void arm7_cpu_device::arm9ops_89(uint32_t insn)
{
/* Save Return State (SRS) */
if ((insn & 0x005f0f00) == 0x004d0500)
{
// unsupported (armv6 onwards only)
arm9ops_undef(insn);
R15 += 4;
}
else if ((insn & 0x00500f00) == 0x00100a00) /* Return From Exception (RFE) */
{
// unsupported (armv6 onwards only)
arm9ops_undef(insn);
R15 += 4;
}
else
{
arm9ops_undef(insn);
R15 += 4;
}
}
void arm7_cpu_device::arm9ops_ab(uint32_t insn)
{
// BLX
HandleBranch(insn, true);
set_cpsr(GET_CPSR|T_MASK);
}
void arm7_cpu_device::arm9ops_c(uint32_t insn)
{
/* Additional coprocessor double register transfer */
if ((insn & 0x00e00000) == 0x00400000)
{
// unsupported
arm9ops_undef(insn);
R15 += 4;
}
else
{
arm9ops_undef(insn);
R15 += 4;
}
}
void arm7_cpu_device::arm9ops_e(uint32_t insn)
{
/* Additional coprocessor register transfer */
// unsupported
arm9ops_undef(insn);
R15 += 4;
}
#endif
extern unsigned at91_get_reg(int regnum);
/* This implementation uses an improved switch() for hopefully faster opcode fetches compared to my last version
.. though there's still room for improvement. */
{
data32_t pc;
static data32_t pc_prev2 = 0, pc_prev1 = 0;
data32_t insn;
int op_offset;
RESET_ICOUNT
do
{
/* Hook for Pre-Opcode Processing */
BEFORE_OPCODE_EXEC_HOOK
#ifdef MAME_DEBUG
if (mame_debug)
MAME_Debug();
#endif
/* load 32 bit instruction, trying the JIT first */
pc = R15;
// Debug test triggers
// Helpful to backtrace a crash :)
JIT_FETCH(ARM7.jit, pc);
insn = cpu_readop32(pc);
op_offset = 0;
pc_prev2 = pc_prev1;
pc_prev1 = pc;
/* process condition codes for this instruction */
switch (insn >> INSN_COND_SHIFT)
{
case COND_EQ:
if (Z_IS_CLEAR(GET_CPSR)) goto L_Next;
break;
case COND_NE:
if (Z_IS_SET(GET_CPSR)) goto L_Next;
break;
case COND_CS:
if (C_IS_CLEAR(GET_CPSR)) goto L_Next;
break;
case COND_CC:
if (C_IS_SET(GET_CPSR)) goto L_Next;
break;
case COND_MI:
if (N_IS_CLEAR(GET_CPSR)) goto L_Next;
break;
case COND_PL:
if (N_IS_SET(GET_CPSR)) goto L_Next;
break;
case COND_VS:
if (V_IS_CLEAR(GET_CPSR)) goto L_Next;
break;
case COND_VC:
if (V_IS_SET(GET_CPSR)) goto L_Next;
break;
case COND_HI:
if (C_IS_CLEAR(GET_CPSR) || Z_IS_SET(GET_CPSR)) goto L_Next;
break;
case COND_LS:
if (C_IS_SET(GET_CPSR) && Z_IS_CLEAR(GET_CPSR)) goto L_Next;
break;
case COND_GE:
if (!(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK)) goto L_Next; /* Use x ^ (x >> ...) method */
break;
case COND_LT:
if (!(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK)) goto L_Next;
break;
case COND_GT:
if (Z_IS_SET(GET_CPSR) || (!(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK))) goto L_Next;
break;
case COND_LE:
if (Z_IS_CLEAR(GET_CPSR) && (!(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK))) goto L_Next;
break;
case COND_NV:
#ifdef ARM9
if (m_archRev < 5)
#endif
goto L_Next;
#ifdef ARM9
else
op_offset = 0x10;
#endif
break;
}
/*******************************************************************/
/* If we got here - condition satisfied, so decode the instruction */
/*******************************************************************/
switch( ((insn & 0xF000000)>>24) + op_offset)
{
/* Bits 27-24 = 0000 -> Can be Data Proc, Multiply, Multiply Long, Halfword Data Transfer */
case 0:
/* Bits 7-4 */
switch(insn & 0xf0)
{
// Multiply, Multiply Long
case 0x90: //1001
/* multiply long */
if( insn&0x800000 ) //Bit 23 = 1 for Multiply Long
{
/* Signed? */
if( insn&0x00400000 )
HandleSMulLong(insn);
else
HandleUMulLong(insn);
}
/* multiply */
else
{
HandleMul(insn);
}
R15 += 4;
break;
// Halfword Data Transfer
case 0xb0: //1011
case 0xd0: //1101
HandleHalfWordDT(insn);
break;
// Data Proc (Cannot be PSR Transfer since bit 24 = 0)
default:
HandleALU(insn);
}
break;
/* Bits 27-24 = 0001 -> Can be BX, SWP, Halfword Data Transfer, Data Proc/PSR Transfer */
case 1:
/* Branch and Exchange (BX) */
if( (insn&0x0ffffff0)==0x012fff10 ) //bits 27-4 == 000100101111111111110001
{
R15 = GET_REGISTER(insn & 0x0f);
//If new PC address has A0 set, switch to Thumb mode
if(R15 & 1) {
SET_CPSR(GET_CPSR|T_BIT);
LOG(("%08x: Setting Thumb Mode due to R15 change to %08x - but not supported\n",pc,R15));
}
}
else
/* Swap OR Half Word Data Transfer OR Data Proc/PSR Transfer */
if( (insn & 0x80) && (insn & 0x10) ) // bit 7=1, bit 4=1
{
/* Half Word Data Transfer */
if(insn & 0x60) //bits = 6-5 != 00
{
HandleHalfWordDT(insn);
}
else
/* Swap */
{
HandleSwap(insn);
}
}
else
/* Data Processing OR PSR Transfer */
{
/* PSR Transfer (MRS & MSR) */
if( ((insn&0x0100000)==0) && ((insn&0x01800000)==0x01000000) ) //( S bit must be clear, and bit 24,23 = 10 )
{
HandlePSRTransfer(insn);
ARM7_ICOUNT += 2; //PSR only takes 1 - S Cycle, so we add + 2, since at end, we -3..
R15 += 4;
}
/* Data Processing */
else
{
HandleALU(insn);
}
}
break;
/* Bits 27-24 = 0011 OR 0010 -> Can only be Data Proc/PSR Transfer */
case 2:
case 3:
/* PSR Transfer (MRS & MSR) */
if( ((insn&0x0100000)==0) && ((insn&0x01800000)==0x01000000) ) //( S bit must be clear, and bit 24,23 = 10 )
{
HandlePSRTransfer(insn);
ARM7_ICOUNT += 2; //PSR only takes 1 - S Cycle, so we add + 2, since at end, we -3..
R15 += 4;
}
/* Data Processing */
else
{
HandleALU(insn);
}
break;
/* Data Transfer - Single Data Access */
case 4:
case 5:
case 6:
case 7:
HandleMemSingle(insn);
R15 += 4;
ARM7_CHECKIRQ;
break;
/* Block Data Transfer/Access */
case 8:
case 9:
HandleMemBlock(insn);
R15 += 4;
break;
/* Branch or Branch & Link */
case 0xa:
case 0xb:
HandleBranch(insn, 0);
break;
/* Co-Processor Data Transfer */
case 0xc:
case 0xd:
HandleCoProcDT(insn);
R15 += 4;
break;
/* Co-Processor Data Operation or Register Transfer */
case 0xe:
if(insn & 0x10)
HandleCoProcRT(insn);
else
HandleCoProcDO(insn);
R15 += 4;
break;
/* Software Interrupt */
case 0x0f:
ARM7.pendingSwi = 1;
ARM7_CHECKIRQ;
//couldn't find any cycle counts for SWI
break;
/* Undefined */
default:
ARM7.pendingSwi = 1;
ARM7_ICOUNT -= 1; //undefined takes 4 cycles (page 77)
LOG(("%08x: Undefined instruction\n",pc-4));
L_Next:
R15 += 4;
ARM7_ICOUNT +=2; //Any unexecuted instruction only takes 1 cycle (page 193)
ARM7_CHECKIRQ;
}
/* All instructions remove 3 cycles.. Others taking less / more will have adjusted this # prior to here */
ARM7_ICOUNT -= 3;
/* Hook for capturing previous cycles */
CAPTURE_NUM_CYCLES
/* Hook for Post-Opcode Processing */
AFTER_OPCODE_EXEC_HOOK
#if JIT_ENABLED
resume_from_jit: ;
#endif
} while( ARM7_ICOUNT > 0 );
return cycles - ARM7_ICOUNT;
// --------------------------------------------------------------------------
//
// Windows/Intel JIT
//
#if JIT_ENABLED
// call native code translated by the JIT
jit_go_native:
{
// get the native code pointer and cycle counter into stack variables
data32_t tmp1 = (data32_t)JIT_NATIVE(ARM7.jit, pc);
data32_t tmp2 = ARM7_ICOUNT;
__asm {
// Allocate space for temporary variables we'll need on return from the
// native code (see 'IMPORTANT' note below). 1 stack DWORD == 4 bytes.
SUB ESP, 4;
// save registers that the generated code uses and that the C caller
// might expect to be preserved across function calls
PUSH EBX;
PUSH ECX;
PUSH EDX;
PUSH ESI;
PUSH EDI;
// get the native code address, and move the cycle counter into EDI for
// use in the translated code
MOV EAX, tmp1;
MOV EDI, tmp2;
// IMPORTANT: don't access any C local variables (tmp1, tmp2, etc) from
// here until after the POPs below. At least one VC optimization mode uses
// EBX as the frame pointer, and it's possible that other modes or other
// compilers use other registers. C local access will be safe again
// after the POPs below, which will recover the pre-call register values.
// In the meantime, anything we need to store temporarily must be saved
// explicitly in stack slots allocated with the SUB ESP, n above, and
// addressed explicitly in terms of [ESP+n] addresses. These are safe
// because we control the stack layout in this section of code.
// call the native code
CALL EAX;
// save the new cycle counter from EDI into a stack temp (before we restore
// the pre-call EDI)
MOV [ESP+20], EDI;
// restore saved registers
POP EDI;
POP ESI;
POP EDX;
POP ECX;
POP EBX;
// recover the new PC and cycle count
MOV tmp1, EAX;
POP tmp2;
}
R15 = tmp1;
ARM7_ICOUNT = tmp2;
}
// resume emulation
goto resume_from_jit;
#endif /* JIT_ENABLED */
}
| 25.226216 | 113 | 0.603755 |
ad276f10453b96254b04a88e577a8a475bfc91c4 | 5,513 | h | C | include/ui_elements.h | armagidon-exception/watch-os | 83c9adf814313f88101d8a57da1e50c45e98bb49 | [
"MIT"
] | null | null | null | include/ui_elements.h | armagidon-exception/watch-os | 83c9adf814313f88101d8a57da1e50c45e98bb49 | [
"MIT"
] | null | null | null | include/ui_elements.h | armagidon-exception/watch-os | 83c9adf814313f88101d8a57da1e50c45e98bb49 | [
"MIT"
] | null | null | null | #pragma once
#include "component.h"
#include "button.h"
#include "Arduino_ST7789_Fast.h"
#include "stdlib.h"
#define INDICATOR_NAME
typedef struct ArrowShape {
bool inverted;
uint8_t size;
} ArrowShape;
static Component create_navigation_button(Vec2D pos, bool inverted, uint8_t size, void (*onClick)(Component*)) {
Component component = create_button(pos, [](Component* context, Arduino_ST7789* display){
ArrowShape* shape = (ArrowShape*) get_from_storage(&context->customData, 1);
//Verticies
uint8_t x1 = context->x, x2 = context->x + (shape->inverted ? -10: 10) * shape->size, x3 = context->x + (shape->inverted ? -10 : 10) * shape->size;
uint8_t y1 = context->y, y2 = context->y + 10 * shape->size, y3 = context->y - 10 * shape->size;
uint8_t rxmin = min(x1, x2),
rymin = min(y1, min(y2, y3)),
rxmax = max(x1, x2),
rymax = max(y1, max(y2, y3));
if (!context->highlighted) {
display->fillRect(rxmin, rymin, rxmax - rxmin, rymax - rymin, BLACK);
display->fillTriangle(x1, y1, x2, y2, x3, y3, WHITE);
} else {
display->fillRect(rxmin, rymin, rxmax - rxmin, rymax - rymin, WHITE);
display->fillTriangle(x1, y1, x2, y2, x3, y3, BLACK);
}
}, onClick);
ArrowShape shape= {inverted, size};
put_to_storage(&component.customData, &shape, sizeof(ArrowShape));
return component;
}
static Component create_application_indicator() {
Component cmp = create_button({120, 120 + 20}, [](Component* context, Arduino_ST7789* display) {
uint8_t applicationIndex = *(uint8_t*) get_from_storage(&context->customData, 1);
Application* app = (Application*) get_element(&applications, applicationIndex);
if (app == nullptr) {
display->fillRect(context->x, context->y, 20, 20, WHITE);
return;
}
bool inv = context->highlighted ? true : false;
display->drawBufferScaled(app->icon.colors, context->x - app->icon.size.width * app->icon.scale / 2, context->y - app->icon.size.height * app->icon.scale / 2, app->icon.size.width, app->icon.size.height, app->icon.scale, inv);
const uint8_t tw = strlen(app->title) * 6 * 2, th = 8 * 2;
display->fillRect(0, context->y - th / 2 + 50, DISPLAY_SIZE, th, BLACK);
display->setCursor(context->x - tw / 2, context->y - th / 2 + 50);
display->setTextSize(2);
display->setTextColor(WHITE);
display->setTextWrap(false);
display->println(app->title);
}, [](Component* context) {
uint8_t applicationIndex = *(uint8_t*) get_from_storage(&context->customData, 1);
Application* app = (Application*) get_element(&applications, applicationIndex);
if (app == nullptr) return;
app->invoke(app);
});
uint8_t applicationIndex = 0;
put_to_storage(&cmp.customData, &applicationIndex, sizeof(uint8_t));
return cmp;
}
static void change_indicator_index(Scene* screen, int8_t x) {
Component* indicator = (Component*) (get_element_by_id(&screen->components, "indicator"));
uint8_t* ptr = (uint8_t*) get_from_storage(&indicator->customData, 1);
CHANGE_INDEX(x, applications.__element_head - 1, ptr);
indicator->update = true;
}
typedef struct {
char* label;
uint8_t size;
} Label;
static Component create_label(uint8_t x, uint8_t y, uint8_t size, const char* label) {
Component cmp = createComponent(x, y, [](Component* context, Arduino_ST7789* renderer) {
Label* label = (Label*) get_from_storage(&context->customData, 0);
if (!context->highlighted)
printText(renderer, context->x, context->y, label->size, WHITE, BLACK, label->label);
else
printText(renderer, context->x, context->y, label->size, BLACK, WHITE, label->label);
});
cmp.type = LABEL_TYPE;
char* labelPtr = (char*) calloc(strlen(label) + 1, sizeof(char));
strcpy(labelPtr, label);
Label l = {labelPtr, size};
put_to_storage(&cmp.customData, &l, sizeof(Label));
return cmp;
}
static Component create_label_button(Vec2D pos, Label label, ComponentCallback onClick) {
Component button = create_button(pos, [](Component* context, Arduino_ST7789* renderer) {
Label* label = (Label*) get_from_storage(&context->customData, 1);
if (!context->highlighted)
printText(renderer, context->x, context->y, label->size, WHITE, BLACK, label->label);
else
printText(renderer, context->x, context->y, label->size, BLACK, WHITE, label->label);
}, onClick);
put_to_storage(&button.customData, &label, sizeof(label));
}
typedef struct NumberLabel {
uint8_t size;
uint8_t number;
} NumberLabel;
static Component create_number_label_button(Vec2D pos, NumberLabel label, ComponentCallback onClick) {
Component button = create_button(pos, [](Component* context, Arduino_ST7789* renderer) {
NumberLabel* label = (NumberLabel*) get_from_storage(&context->customData, 1);
char* lbl = (char*) calloc(2, sizeof(char));
sprintf(lbl, "%d", label->number);
if (!context->highlighted)
printText(renderer, context->x, context->y, label->size, WHITE, BLACK, lbl);
else
printText(renderer, context->x, context->y, label->size, BLACK, WHITE, lbl);
free(label);
}, onClick);
put_to_storage(&button.customData, &label, sizeof(label));
} | 44.821138 | 234 | 0.640849 |
710cbf04f148e88893c92c287c020691126bba54 | 6,339 | h | C | include/spio/source.h | eliaskosunen/spio | d65757315bf4f0bfb7976782e33651a5662bbe1c | [
"Apache-2.0"
] | 3 | 2017-08-27T12:52:14.000Z | 2018-06-28T18:03:39.000Z | include/spio/source.h | eliaskosunen/spio | d65757315bf4f0bfb7976782e33651a5662bbe1c | [
"Apache-2.0"
] | 9 | 2018-01-01T13:50:55.000Z | 2018-02-03T13:13:29.000Z | include/spio/source.h | eliaskosunen/spio | d65757315bf4f0bfb7976782e33651a5662bbe1c | [
"Apache-2.0"
] | null | null | null | // Copyright 2017-2018 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This file is a part of spio:
// https://github.com/eliaskosunen/spio
#ifndef SPIO_SOURCE_H
#define SPIO_SOURCE_H
#include "config.h"
#include "device.h"
#include "error.h"
#include "result.h"
#include "ring.h"
#include "third_party/expected.h"
#include "third_party/gsl.h"
#include "util.h"
#ifndef SPIO_READ_ALL_MAX_ATTEMPTS
#define SPIO_READ_ALL_MAX_ATTEMPTS 8
#endif
namespace spio {
SPIO_BEGIN_NAMESPACE
template <typename Readable>
result read_all(Readable& d, span<byte> s, bool& eof)
{
auto total_read = 0;
for (auto i = 0; i < SPIO_READ_ALL_MAX_ATTEMPTS; ++i) {
auto ret = d.read(s, eof);
total_read += ret.value();
if (eof) {
break;
}
if (SPIO_UNLIKELY(ret.has_error() &&
ret.error().code() != std::errc::interrupted)) {
return make_result(total_read, ret.error());
}
if (SPIO_UNLIKELY(ret.value() != s.size())) {
s = s.subspan(ret.value());
}
break;
}
return total_read;
}
template <typename VectorReadable>
expected<span<typename VectorReadable::buffer_type>, failure> vread_all(
span<typename VectorReadable::buffer_type> bufs,
streampos pos = 0)
{
SPIO_UNUSED(bufs);
SPIO_UNUSED(pos);
SPIO_UNIMPLEMENTED;
}
namespace detail {
template <typename Source>
class basic_buffered_source_base {
public:
using source_type = Source;
basic_buffered_source_base(source_type* s) : m_source(s) {}
SPIO_CONSTEXPR14 source_type& get() noexcept
{
return *m_source;
}
SPIO_CONSTEXPR const source_type& get() const noexcept
{
return *m_source;
}
SPIO_CONSTEXPR14 source_type& operator*() noexcept
{
return get();
}
SPIO_CONSTEXPR const source_type& operator*() const noexcept
{
return get();
}
SPIO_CONSTEXPR14 source_type* operator->() noexcept
{
return m_source;
}
SPIO_CONSTEXPR const source_type* operator->() const noexcept
{
return m_source;
}
private:
source_type* m_source;
};
template <typename T>
SPIO_CONSTEXPR14 T round_up_multiple_of_two(T n, T multiple) noexcept
{
Expects(multiple > 0);
Expects((multiple & (multiple - 1)) == 0);
return (n + multiple - 1) & -multiple;
}
} // namespace detail
template <typename Readable>
class basic_buffered_readable
: public detail::basic_buffered_source_base<Readable> {
using base = detail::basic_buffered_source_base<Readable>;
public:
using readable_type = typename base::source_type;
using buffer_type = ring;
using size_type = std::ptrdiff_t;
static SPIO_CONSTEXPR_DECL const size_type buffer_size = BUFSIZ * 2;
basic_buffered_readable(readable_type& r,
size_type s = size_type(buffer_size),
size_type rs = -1)
: base(std::addressof(r)),
m_buffer(detail::round_up_power_of_two(s)),
m_read_size(rs)
{
if (m_read_size == -1) {
m_read_size = m_buffer.size() / 2;
}
m_read_size = detail::round_up_power_of_two(m_read_size);
Expects(rs <= m_buffer.size());
}
SPIO_CONSTEXPR size_type free_space() const noexcept
{
return m_buffer.free_space();
}
SPIO_CONSTEXPR size_type in_use() const noexcept
{
return m_buffer.in_use();
}
SPIO_CONSTEXPR size_type size() const noexcept
{
return m_buffer.size();
}
result read(span<byte> s, bool& eof)
{
auto r = [&]() -> result {
if (in_use() < s.size() && !m_eof) {
return read_into_buffer(get_read_size(s.size()), m_eof);
}
return {0};
}();
if (m_eof && s.size() > in_use()) {
eof = true;
}
s = s.first(std::min(s.size(), in_use()));
auto bytes_read = read_from_buffer(s);
Ensures(bytes_read == s.size());
return {bytes_read, r.inspect_error()};
}
result putback(span<byte> s)
{
#if SPIO_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#endif
if (s.size() > free_space()) {
return make_result(m_buffer.write_tail(s.first(free_space())),
out_of_memory);
}
return m_buffer.write_tail(s);
#if SPIO_GCC
#pragma GCC diagnostic pop
#endif
}
private:
SPIO_CONSTEXPR14 size_type get_read_size(size_type n) const noexcept
{
return std::min(detail::round_up_multiple_of_two(n, m_read_size),
free_space());
}
result read_into_buffer(size_type n, bool& eof)
{
Expects(n <= free_space());
size_type has_read = 0;
auto buffer = m_buffer.direct_write(n);
for (auto it = buffer.begin(); it != buffer.end(); ++it) {
auto r = base::get().read(*it, eof);
has_read += r.value();
if (r.has_error()) {
return {has_read, r.inspect_error()};
}
if (eof) {
if (it != buffer.end()) {
++it; // can't use a ranged for because of this
}
break;
}
}
m_buffer.move_head(-(n - has_read));
return has_read;
}
size_type read_from_buffer(span<byte> s)
{
return m_buffer.read(s);
}
buffer_type m_buffer;
size_type m_read_size;
bool m_eof{false};
};
SPIO_END_NAMESPACE
} // namespace spio
#endif // SPIO_SINK_H
| 27.56087 | 75 | 0.593785 |
3952576ef2e7e280cb2b58be21e85b6eaf1c1d2f | 554 | h | C | JGSSecurityKeyboard/JGSSecurityKeyboard/JGSSymbolKeyboard.h | Dengni8023/JGSourceBase | c9f3e60470b76626f8c7eb75e5cb97c316dcadc6 | [
"MIT"
] | 6 | 2021-11-25T06:08:16.000Z | 2022-03-15T15:59:13.000Z | JGSSecurityKeyboard/JGSSecurityKeyboard/JGSSymbolKeyboard.h | Dengni8023/JGSourceBase | c9f3e60470b76626f8c7eb75e5cb97c316dcadc6 | [
"MIT"
] | null | null | null | JGSSecurityKeyboard/JGSSecurityKeyboard/JGSSymbolKeyboard.h | Dengni8023/JGSourceBase | c9f3e60470b76626f8c7eb75e5cb97c316dcadc6 | [
"MIT"
] | 2 | 2022-01-16T06:15:59.000Z | 2022-03-17T07:33:34.000Z | //
// JGSSymbolKeyboard.h
// JGSSecurityKeyboard
//
// Created by 梅继高 on 2022/1/7.
// Copyright © 2022 MeiJiGao. All rights reserved.
//
#import "JGSBaseKeyboard.h"
NS_ASSUME_NONNULL_BEGIN
@interface JGSSymbolKeyboard : JGSBaseKeyboard
@property (nonatomic, assign) BOOL showFullAngle; // 是否开启全角,默认关闭,支持全角时将支持全半角字符输入
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
| 22.16 | 80 | 0.781588 |
f914f33df25b49f950b2661682ed8e55aa62d4b3 | 818 | h | C | TBSpringboard/SpringBoard/TBCollectionViewCell.h | TimBao/TBSpringBoard | b5a78421ea954998e3c6c65a1dfcac7ca1889c48 | [
"Apache-2.0"
] | 16 | 2016-01-05T07:00:11.000Z | 2021-02-23T10:23:37.000Z | TBSpringboard/SpringBoard/TBCollectionViewCell.h | TimBao/TBSpringBoard | b5a78421ea954998e3c6c65a1dfcac7ca1889c48 | [
"Apache-2.0"
] | null | null | null | TBSpringboard/SpringBoard/TBCollectionViewCell.h | TimBao/TBSpringBoard | b5a78421ea954998e3c6c65a1dfcac7ca1889c48 | [
"Apache-2.0"
] | 3 | 2016-03-19T03:15:53.000Z | 2016-12-09T01:39:45.000Z | //
// TBCollectionViewCell.h
// TBSpringboard
//
// Created by baotim on 16/1/5.
// Copyright © 2016年 tbao. All rights reserved.
//
#import <UIKit/UIKit.h>
static CGFloat const DELETE_ICON_CORNER_RADIUS = 10;
@class TBCollectionViewCell;
@protocol TBCollectionViewCellDelegate <NSObject>
- (void)deleteButtonClickedInCollectionViewCell:(TBCollectionViewCell *)deletedCell;
@end
@interface TBCollectionViewCell : UICollectionViewCell
@property (nonatomic, weak ) id<TBCollectionViewCellDelegate> delegate;
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, copy ) NSString *title;
@property (nonatomic, assign) BOOL editing;
@property (nonatomic, strong) NSMutableArray *icons;
- (void)reset;
- (UIView *)snapshotView;
@end
| 25.5625 | 84 | 0.724939 |
2466f68083df0cc25a447060abc5a4c3a64e92b3 | 12,226 | h | C | code_reading/oceanbase-master/src/sql/resolver/ddl/ob_database_resolver.h | wangcy6/weekly_read | 3a8837ee9cd957787ee1785e4066dd623e02e13a | [
"Apache-2.0"
] | null | null | null | code_reading/oceanbase-master/src/sql/resolver/ddl/ob_database_resolver.h | wangcy6/weekly_read | 3a8837ee9cd957787ee1785e4066dd623e02e13a | [
"Apache-2.0"
] | null | null | null | code_reading/oceanbase-master/src/sql/resolver/ddl/ob_database_resolver.h | wangcy6/weekly_read | 3a8837ee9cd957787ee1785e4066dd623e02e13a | [
"Apache-2.0"
] | 1 | 2020-10-18T12:59:31.000Z | 2020-10-18T12:59:31.000Z | /**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PubL v2 for more details.
*/
#ifndef OCEANBASE_SQL_RESOLVER_DDL_OB_DATABASE_RESOLVER_H
#define OCEANBASE_SQL_RESOLVER_DDL_OB_DATABASE_RESOLVER_H
#include "lib/oblog/ob_log.h"
#include "lib/string/ob_sql_string.h"
#include "share/ob_rpc_struct.h"
#include "sql/resolver/ob_stmt.h"
#include "lib/charset/ob_charset.h"
namespace oceanbase {
namespace sql {
template <class T>
class ObDatabaseResolver {
public:
ObDatabaseResolver() : alter_option_bitset_(), collation_already_set_(false)
{}
~ObDatabaseResolver(){};
private:
DISALLOW_COPY_AND_ASSIGN(ObDatabaseResolver);
public:
static int resolve_primary_zone(T* stmt, ParseNode* node);
int resolve_database_options(T* stmt, ParseNode* node);
const common::ObBitSet<>& get_alter_option_bitset() const
{
return alter_option_bitset_;
};
private:
int resolve_database_option(T* stmt, ParseNode* node);
int resolve_zone_list(T* stmt, ParseNode* node) const;
private:
common::ObBitSet<> alter_option_bitset_;
bool collation_already_set_;
};
template <class T>
int ObDatabaseResolver<T>::resolve_database_options(T* stmt, ParseNode* node)
{
int ret = common::OB_SUCCESS;
if (OB_ISNULL(stmt) || OB_ISNULL(node)) {
ret = common::OB_INVALID_ARGUMENT;
OB_LOG(WARN, "invalid argument", K(stmt), K(node));
} else if (OB_UNLIKELY(T_DATABASE_OPTION_LIST != node->type_) || OB_UNLIKELY(0 > node->num_child_) ||
OB_ISNULL(node->children_)) {
ret = common::OB_ERR_UNEXPECTED;
OB_LOG(WARN, "invalid node info", K(node->type_), K(node->num_child_), K(node->children_));
} else {
ParseNode* option_node = NULL;
int32_t num = node->num_child_;
for (int32_t i = 0; ret == common::OB_SUCCESS && i < num; i++) {
option_node = node->children_[i];
if (OB_FAIL(resolve_database_option(stmt, option_node))) {
OB_LOG(WARN, "resolve database option failed", K(ret));
}
}
}
return ret;
}
template <class T>
int ObDatabaseResolver<T>::resolve_primary_zone(T* stmt, ParseNode* node)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(node) || OB_ISNULL(stmt)) {
ret = common::OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "invalid primary_zone argument", K(ret), K(node));
} else if (node->type_ == T_DEFAULT) {
if (GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_2000) {
ret = OB_OP_NOT_ALLOW;
SQL_RESV_LOG(WARN, "set primary_zone DEFAULT is not allowed now", K(ret));
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "set primary_zone DEFAULT");
}
} else if (T_RANDOM == node->type_) {
if (GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_2000) {
ret = OB_OP_NOT_ALLOW;
SQL_RESV_LOG(WARN, "set primary_zone RANDOM is not allowed now", K(ret));
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "set primary_zone RANDOM");
} else {
if (OB_FAIL(stmt->set_primary_zone(common::ObString(common::OB_RANDOM_PRIMARY_ZONE)))) {
SQL_RESV_LOG(WARN, "fail to set primary zone", K(ret));
}
}
} else {
common::ObString primary_zone;
primary_zone.assign_ptr(const_cast<char*>(node->str_value_), static_cast<int32_t>(node->str_len_));
if (GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_2000 && primary_zone.empty()) {
ret = OB_OP_NOT_ALLOW;
SQL_RESV_LOG(WARN, "set primary_zone empty is not allowed now", K(ret));
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "set primary_zone empty");
} else if (OB_FAIL(stmt->set_primary_zone(primary_zone))) {
SQL_RESV_LOG(WARN, "fail to set primary zone", K(ret));
}
}
return ret;
}
template <class T>
int ObDatabaseResolver<T>::resolve_database_option(T* stmt, ParseNode* node)
{
int ret = common::OB_SUCCESS;
ParseNode* option_node = node;
if (OB_ISNULL(stmt)) {
ret = common::OB_INVALID_ARGUMENT;
OB_LOG(WARN, "invalid argument", K(stmt), K(node));
} else if (OB_ISNULL(option_node)) {
// nothing to do
} else {
switch (option_node->type_) {
case T_REPLICA_NUM: {
int32_t replica_num = static_cast<int32_t>(option_node->value_);
if (replica_num <= 0 || replica_num > common::OB_TABLET_MAX_REPLICA_COUNT) {
ret = common::OB_NOT_SUPPORTED;
OB_LOG(WARN, "Invalid replica_num", K(replica_num));
} else {
if (stmt::T_ALTER_DATABASE == stmt->get_stmt_type()) {
if (OB_FAIL(alter_option_bitset_.add_member(obrpc::ObAlterDatabaseArg::REPLICA_NUM))) {
OB_LOG(WARN, "failed to add member to bitset!", K(ret));
}
}
}
break;
}
case T_PRIMARY_ZONE: {
if (NULL == option_node->children_ || option_node->num_child_ != 1) {
ret = common::OB_INVALID_ARGUMENT;
SQL_RESV_LOG(WARN, "invalid primary_zone argument", K(ret), "num_child", option_node->num_child_);
} else if (OB_FAIL(ObDatabaseResolver<T>::resolve_primary_zone(stmt, option_node->children_[0]))) {
SQL_RESV_LOG(WARN, "failed to resolve primary zone", K(ret));
} else if (stmt::T_ALTER_DATABASE == stmt->get_stmt_type()) {
if (OB_FAIL(alter_option_bitset_.add_member(obrpc::ObAlterDatabaseArg::PRIMARY_ZONE))) {
SQL_RESV_LOG(WARN, "failed to add member to bitset!", K(ret));
}
}
break;
}
case T_CHARSET:
case T_COLLATION: {
common::ObCharsetType charset_type = common::CHARSET_INVALID;
common::ObCollationType collation_type = common::CS_TYPE_INVALID;
if (T_CHARSET == option_node->type_) {
common::ObString charset(option_node->str_len_, option_node->str_value_);
charset_type = common::ObCharset::charset_type(charset.trim());
collation_type = common::ObCharset::get_default_collation(charset_type);
if (OB_UNLIKELY(common::CHARSET_INVALID == charset_type)) {
ret = common::OB_ERR_UNKNOWN_CHARSET;
LOG_USER_ERROR(OB_ERR_UNKNOWN_CHARSET, charset.length(), charset.ptr());
} else if (OB_UNLIKELY(common::CS_TYPE_INVALID == collation_type)) {
ret = common::OB_ERR_UNEXPECTED;
SQL_RESV_LOG(WARN,
"all valid charset types should have default collation type",
K(ret),
K(charset_type),
K(collation_type));
} else if (OB_UNLIKELY(collation_already_set_ && stmt->get_charset_type() != charset_type)) {
ret = OB_ERR_CONFLICTING_DECLARATIONS;
SQL_RESV_LOG(WARN, "charsets mismatch", K(stmt->get_charset_type()), K(charset_type));
const char* charset_name1 = ObCharset::charset_name(stmt->get_charset_type());
const char* charset_name2 = ObCharset::charset_name(charset_type);
LOG_USER_ERROR(OB_ERR_CONFLICTING_DECLARATIONS, charset_name1, charset_name2);
}
} else {
common::ObString collation(option_node->str_len_, option_node->str_value_);
collation_type = common::ObCharset::collation_type(collation.trim());
charset_type = ObCharset::charset_type_by_coll(collation_type);
if (OB_UNLIKELY(common::CS_TYPE_INVALID == collation_type)) {
ret = common::OB_ERR_UNKNOWN_COLLATION;
LOG_USER_ERROR(OB_ERR_UNKNOWN_COLLATION, collation.length(), collation.ptr());
} else if (OB_UNLIKELY(common::CHARSET_INVALID == charset_type)) {
ret = common::OB_ERR_UNEXPECTED;
SQL_RESV_LOG(WARN,
"all valid collation types should have corresponding charset type",
K(ret),
K(charset_type),
K(collation_type));
} else if (OB_UNLIKELY(collation_already_set_ && stmt->get_charset_type() != charset_type)) {
ret = OB_ERR_COLLATION_MISMATCH;
SQL_RESV_LOG(WARN, "charset and collation mismatch", K(stmt->get_charset_type()), K(charset_type));
}
}
if (OB_SUCC(ret)) {
stmt->set_charset_type(charset_type);
stmt->set_collation_type(collation_type);
collation_already_set_ = true;
if (stmt::T_ALTER_DATABASE == stmt->get_stmt_type()) {
if (OB_FAIL(alter_option_bitset_.add_member(obrpc::ObAlterDatabaseArg::COLLATION_TYPE))) {
OB_LOG(WARN, "failed to add member to bitset!", K(ret));
}
}
}
break;
}
case T_READ_ONLY: {
if (OB_ISNULL(option_node->children_[0])) {
ret = common::OB_ERR_UNEXPECTED;
OB_LOG(WARN, "invalid option node for read_only", K(option_node), K(option_node->children_[0]));
} else if (T_ON == option_node->children_[0]->type_) {
stmt->set_read_only(true);
} else if (T_OFF == option_node->children_[0]->type_) {
stmt->set_read_only(false);
} else {
ret = common::OB_ERR_UNEXPECTED;
OB_LOG(WARN, "unknown read only options", K(ret));
}
if (common::OB_SUCCESS == ret && stmt->get_stmt_type() == stmt::T_ALTER_DATABASE) {
if (OB_FAIL(alter_option_bitset_.add_member(obrpc::ObAlterDatabaseArg::READ_ONLY))) {
OB_LOG(WARN, "failed to add member to bitset!", K(ret));
}
}
break;
}
case T_DEFAULT_TABLEGROUP: {
common::ObString tablegroup_name(option_node->str_len_, option_node->str_value_);
if (OB_FAIL(stmt->set_default_tablegroup_name(tablegroup_name))) {
OB_LOG(WARN, "failed to set default tablegroup name", K(ret));
}
if (common::OB_SUCCESS == ret && stmt->get_stmt_type() == stmt::T_ALTER_DATABASE) {
if (OB_FAIL(alter_option_bitset_.add_member(obrpc::ObAlterDatabaseArg::DEFAULT_TABLEGROUP))) {
OB_LOG(WARN, "failed to add member to bitset!", K(ret));
}
}
break;
}
case T_DATABASE_ID: {
if (stmt::T_CREATE_DATABASE != stmt->get_stmt_type()) {
ret = common::OB_ERR_PARSE_SQL;
SQL_RESV_LOG(WARN, "database id can be set in create database", K(ret));
} else {
if (OB_ISNULL(option_node->children_[0])) {
ret = common::OB_ERR_UNEXPECTED;
SQL_RESV_LOG(WARN, "option_node child is null", K(option_node->children_[0]), K(ret));
} else {
uint64_t database_id = static_cast<uint64_t>(option_node->children_[0]->value_);
stmt->set_database_id(database_id);
}
}
break;
}
default: {
OB_LOG(WARN, "invalid type of parse node", K(option_node));
break;
}
}
}
return ret;
}
template <class T>
int ObDatabaseResolver<T>::resolve_zone_list(T* stmt, ParseNode* node) const
{
int ret = common::OB_SUCCESS;
if (OB_ISNULL(stmt) || OB_ISNULL(node) || T_ZONE_LIST != node->type_ || OB_ISNULL(node->children_)) {
ret = common::OB_INVALID_ARGUMENT;
OB_LOG(WARN, "invalid argument", K(ret), K(stmt), K(node));
} else {
for (int32_t i = 0; ret == common::OB_SUCCESS && i < node->num_child_; i++) {
ParseNode* elem = node->children_[i];
if (OB_ISNULL(elem)) {
ret = common::OB_ERR_PARSER_SYNTAX;
OB_LOG(WARN, "Wrong zone", K(node));
} else {
if (OB_LIKELY(T_VARCHAR == elem->type_)) {
common::ObSqlString buf;
if (OB_FAIL(buf.append(elem->str_value_, elem->str_len_))) {
OB_LOG(WARN, "fail to assign str value to buf", K(ret));
} else {
ret = stmt->add_zone(buf.ptr());
}
} else {
ret = common::OB_ERR_PARSER_SYNTAX;
OB_LOG(WARN, "Wrong zone");
break;
}
}
}
}
return ret;
}
} // namespace sql
} // namespace oceanbase
#endif // OCEANBASE_SQL_RESOLVER_DDL_OB_DATABASE_RESOLVER_H
| 41.164983 | 111 | 0.643465 |
c9aee419d962fd975685130ea66fde12aa76c36f | 384 | c | C | src/LAB_entity.c | manuel-fischer/LAB | c592f1349487c13904437fa4dac3b6c09f4431c3 | [
"MIT"
] | 6 | 2020-08-08T20:12:01.000Z | 2022-01-06T11:03:37.000Z | src/LAB_entity.c | manuel-fischer/LAB | c592f1349487c13904437fa4dac3b6c09f4431c3 | [
"MIT"
] | null | null | null | src/LAB_entity.c | manuel-fischer/LAB | c592f1349487c13904437fa4dac3b6c09f4431c3 | [
"MIT"
] | null | null | null | #include "LAB_entity.h"
#include "LAB_memory.h"
// TODO
void LAB_EntitySet_Create(LAB_EntitySet* set)
{
memset(set, 0, sizeof(*set));
}
void LAB_EntitySet_Destroy(LAB_EntitySet* set)
{
for(int i = 0; i < LAB_EC_COUNT; ++i)
{
/// TODO call destructors here
LAB_Free(set->components[i]);
}
LAB_Free(set->offsets);
LAB_Free(set->entities);
}
| 16.695652 | 46 | 0.635417 |
a796cdaeedcf37987899a190901942f51f148726 | 860 | h | C | src/core/spin_mutex.h | Mike-Leo-Smith/LuisaCompute | 232c0039bffb743d3bb5dfffc40d37a39dcd7570 | [
"BSD-3-Clause"
] | 31 | 2020-11-21T08:16:53.000Z | 2021-09-05T13:46:32.000Z | src/core/spin_mutex.h | Mike-Leo-Smith/LuisaCompute | 232c0039bffb743d3bb5dfffc40d37a39dcd7570 | [
"BSD-3-Clause"
] | 1 | 2021-03-08T04:15:26.000Z | 2021-03-19T04:40:02.000Z | src/core/spin_mutex.h | Mike-Leo-Smith/LuisaCompute | 232c0039bffb743d3bb5dfffc40d37a39dcd7570 | [
"BSD-3-Clause"
] | 4 | 2020-12-02T09:41:22.000Z | 2021-03-06T06:36:40.000Z | //
// Created by Mike Smith on 2021/3/14.
//
#pragma once
#include <atomic>
#include <thread>
#include <core/intrin.h>
namespace luisa {
class spin_mutex {
private:
std::atomic_flag _flag = ATOMIC_FLAG_INIT;// ATOMIC_FLAG_INIT not needed as per C++20
public:
spin_mutex() noexcept = default;
void lock() noexcept {
while (_flag.test_and_set(std::memory_order::acquire)) {// acquire lock
LUISA_INTRIN_PAUSE();
#ifdef __cpp_lib_atomic_flag_test
while (_flag.test(std::memory_order::relaxed)) {// test lock
std::this_thread::yield();
}
#endif
}
}
bool try_lock() noexcept {
return !_flag.test_and_set(std::memory_order::acquire);
}
void unlock() noexcept {
_flag.clear(std::memory_order::release);// release lock
}
};
}// namespace luisa
| 20.97561 | 89 | 0.632558 |
57eb28ba46be0065aa6b37bf37f1988ce44b5a9a | 723 | h | C | base/win32/verifier/critsect.h | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/win32/verifier/critsect.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/win32/verifier/critsect.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /*++
Copyright (c) Microsoft Corporation. All rights reserved.
Header Name:
critsect.h
Abstract:
This module implements verification functions for
critical section interfaces.
Author:
Daniel Mihai (DMihai) 27-Mar-2001
Revision History:
--*/
#ifndef _CRITSECT_H_
#define _CRITSECT_H_
#include "support.h"
NTSTATUS
CritSectInitialize (
VOID
);
VOID
CritSectUninitialize (
VOID
);
VOID
AVrfpFreeMemLockChecks (
VERIFIER_DLL_FREEMEM_TYPE FreeMemType,
PVOID StartAddress,
SIZE_T RegionSize,
PWSTR UnloadedDllName
);
VOID
AVrfpIncrementOwnedCriticalSections (
LONG Increment
);
#endif // _CRITSECT_H_
| 14.176471 | 58 | 0.66805 |
cb12f81ce15d1971a9719bf3720913da46836cc8 | 1,679 | c | C | metalibm_core/support_lib/ml_libm_compatibility.c | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | 27 | 2018-03-12T16:49:36.000Z | 2021-12-15T06:53:55.000Z | metalibm_core/support_lib/ml_libm_compatibility.c | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | 57 | 2018-03-12T16:49:56.000Z | 2021-03-04T15:25:39.000Z | metalibm_core/support_lib/ml_libm_compatibility.c | nibrunie/metalibm | 776b044f5f323ef907a8724d9ce9a27a482f6cc5 | [
"MIT"
] | 4 | 2021-03-10T15:06:58.000Z | 2021-07-14T17:39:53.000Z | #include <math.h>
#include <errno.h>
float ml_raise_libm_underflowf(float result, float arg, char* func_name) {
float return_value = result;
if (_LIB_VERSION == _IEEE_) {
return return_value;
} else if (_LIB_VERSION == _POSIX_) {
errno = ERANGE;
return return_value;
} else if (_LIB_VERSION == _XOPEN_) {
struct exception e_struct = {.type = UNDERFLOW, .name = func_name, .arg1 = arg, .retval = return_value};
matherr(&e_struct);
errno = ERANGE;
return e_struct.retval;
} else if (_LIB_VERSION == _SVID_) {
errno = ERANGE;
struct exception e_struct = {.type = UNDERFLOW, .name = func_name, .arg1 = arg, .retval = return_value};
matherr(&e_struct);
return e_struct.retval;
} else {
return return_value;
}
return return_value;
}
float ml_raise_libm_overflowf(float result, float arg, char* func_name) {
float return_value = HUGE_VALF;
if (_LIB_VERSION == _IEEE_) {
return return_value;
} else if (_LIB_VERSION == _POSIX_) {
errno = ERANGE;
return return_value;
} else if (_LIB_VERSION == _XOPEN_) {
struct exception e_struct = {.type = OVERFLOW, .name = func_name, .arg1 = arg, .retval = return_value};
matherr(&e_struct);
errno = ERANGE;
return e_struct.retval;
} else if (_LIB_VERSION == _SVID_) {
errno = ERANGE;
struct exception e_struct = {.type = OVERFLOW, .name = func_name, .arg1 = arg, .retval = return_value};
matherr(&e_struct);
return e_struct.retval;
} else {
return return_value;
}
return return_value;
}
| 31.679245 | 112 | 0.616438 |
3b138171d086adaf30ab1e17ef0a2a4930ee53b5 | 1,331 | h | C | linux-2.6.16-unmod/include/asm-arm/arch-iop3xx/hardware.h | ut-osa/syncchar | eba20da163260b6ae1ef3e334ad2137873a8d625 | [
"BSD-3-Clause"
] | null | null | null | linux-2.6.16-unmod/include/asm-arm/arch-iop3xx/hardware.h | ut-osa/syncchar | eba20da163260b6ae1ef3e334ad2137873a8d625 | [
"BSD-3-Clause"
] | null | null | null | linux-2.6.16-unmod/include/asm-arm/arch-iop3xx/hardware.h | ut-osa/syncchar | eba20da163260b6ae1ef3e334ad2137873a8d625 | [
"BSD-3-Clause"
] | 1 | 2019-05-14T16:36:45.000Z | 2019-05-14T16:36:45.000Z | /*
* linux/include/asm-arm/arch-iop3xx/hardware.h
*/
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
#include <asm/types.h>
/*
* Note about PCI IO space mappings
*
* To make IO space accesses efficient, we store virtual addresses in
* the IO resources.
*
* The PCI IO space is located at virtual 0xfe000000 from physical
* 0x90000000. The PCI BARs must be programmed with physical addresses,
* but when we read them, we convert them to virtual addresses. See
* arch/arm/mach-iop3xx/iop3xx-pci.c
*/
#define pcibios_assign_all_busses() 1
/*
* The min PCI I/O and MEM space are dependent on what specific
* chipset/platform we are running on, so instead of hardcoding with
* #ifdefs, we just fill these in the platform level PCI init code.
*/
#ifndef __ASSEMBLY__
extern unsigned long iop3xx_pcibios_min_io;
extern unsigned long iop3xx_pcibios_min_mem;
extern unsigned int processor_id;
#endif
/*
* We just set these to zero since they are really bogus anyways
*/
#define PCIBIOS_MIN_IO (iop3xx_pcibios_min_io)
#define PCIBIOS_MIN_MEM (iop3xx_pcibios_min_mem)
/*
* Generic chipset bits
*
*/
#include "iop321.h"
#include "iop331.h"
/*
* Board specific bits
*/
#include "iq80321.h"
#include "iq31244.h"
#include "iq80331.h"
#include "iq80332.h"
#endif /* _ASM_ARCH_HARDWARE_H */
| 22.948276 | 72 | 0.742299 |
7e140fd3503542cd7cf9747746ca41fefc57e095 | 7,380 | h | C | dist/include/Fuji/MFMidi_Tables.h | TurkeyMan/fuji | afd6a26c710ce23965b088ad158fe916d6a1a091 | [
"BSD-2-Clause"
] | 35 | 2015-01-19T22:07:48.000Z | 2022-02-21T22:17:53.000Z | dist/include/Fuji/MFMidi_Tables.h | TurkeyMan/fuji | afd6a26c710ce23965b088ad158fe916d6a1a091 | [
"BSD-2-Clause"
] | 1 | 2022-02-23T09:34:15.000Z | 2022-02-23T09:34:15.000Z | dist/include/Fuji/MFMidi_Tables.h | TurkeyMan/fuji | afd6a26c710ce23965b088ad158fe916d6a1a091 | [
"BSD-2-Clause"
] | 4 | 2015-05-11T03:31:35.000Z | 2018-09-27T04:55:57.000Z | /**
* @file MFMidi_Tables.h
* @brief MIDI data tables.
* @author Manu Evans
* @defgroup MFMidi MIDI I/O access
* @{
*/
#if !defined(_MFMIDI_TABLES_H)
#define _MFMIDI_TABLES_H
enum MFMidiControlCode
{
MFMCF_BankSelectMSB = 0x00, // 0 - 127
MFMCF_ModulationWheelOrLeverMSB = 0x01, // 0 - 127
MFMCF_BreathControllerMSB = 0x02, // 0 - 127
MFMCF_FootControllerMSB = 0x04, // 0 - 127
MFMCF_PortamentoTimeMSB = 0x05, // 0 - 127
MFMCF_DataEntryMSB = 0x06, // 0 - 127
MFMCF_ChannelVolumeMSB = 0x07, // 0 - 127 (formerly MainVolume)
MFMCF_BalanceMSB = 0x08, // 0 - 127
MFMCF_PanMSB = 0x0A, // 0 - 127
MFMCF_ExpressionControllerMSB = 0x0B, // 0 - 127
MFMCF_EffectControl1MSB = 0x0C, // 0 - 127
MFMCF_EffectControl2MSB = 0x0D, // 0 - 127
MFMCF_GeneralPurposeController1MSB = 0x10, // 0 - 127
MFMCF_GeneralPurposeController2MSB = 0x11, // 0 - 127
MFMCF_GeneralPurposeController3MSB = 0x12, // 0 - 127
MFMCF_GeneralPurposeController4MSB = 0x13, // 0 - 127
MFMCF_BankSelectLSB = 0x20, // 0 - 127
MFMCF_ModulationWheelOrLeverLSB = 0x21, // 0 - 127
MFMCF_BreathControllerLSB = 0x22, // 0 - 127
MFMCF_FootControllerLSB = 0x24, // 0 - 127
MFMCF_PortamentoTimeLSB = 0x25, // 0 - 127
MFMCF_DataEntryLSB = 0x26, // 0 - 127
MFMCF_ChannelVolumeLSB = 0x27, // 0 - 127 (formerly MainVolume)
MFMCF_BalanceLSB = 0x28, // 0 - 127
MFMCF_PanLSB = 0x2A, // 0 - 127
MFMCF_ExpressionControllerLSB = 0x2B, // 0 - 127
MFMCF_EffectControl1LSB = 0x2C, // 0 - 127
MFMCF_EffectControl2LSB = 0x2D, // 0 - 127
MFMCF_GeneralPurposeController1LSB = 0x30, // 0 - 127
MFMCF_GeneralPurposeController2LSB = 0x31, // 0 - 127
MFMCF_GeneralPurposeController3LSB = 0x32, // 0 - 127
MFMCF_GeneralPurposeController4LSB = 0x33, // 0 - 127
MFMCF_DamperPedal = 0x40, // ≤63 off, ≥64 on
MFMCF_Portamento = 0x41, // ≤63 off, ≥64 on
MFMCF_Sostenuto = 0x42, // ≤63 off, ≥64 on
MFMCF_SoftPedal = 0x43, // ≤63 off, ≥64 on
MFMCF_LegatoFootswitch = 0x44, // ≤63 Normal, ≥64 Legato
MFMCF_Hold2 = 0x45, // ≤63 off, ≥64 on
MFMCF_SoundController1 = 0x46, // 0 - 127 (default: SoundVariation)
MFMCF_SoundController2 = 0x47, // 0 - 127 (default: Timbre / Harmonic Intens.)
MFMCF_SoundController3 = 0x48, // 0 - 127 (default: ReleaseTime)
MFMCF_SoundController4 = 0x49, // 0 - 127 (default: AttackTime)
MFMCF_SoundController5 = 0x4A, // 0 - 127 (default: Brightness)
MFMCF_SoundController6 = 0x4B, // 0 - 127 (default: DecayTime - see MMA RP - 021)
MFMCF_SoundController7 = 0x4C, // 0 - 127 (default: VibratoRate - see MMA RP - 021)
MFMCF_SoundController8 = 0x4D, // 0 - 127 (default: VibratoDepth - see MMA RP - 021)
MFMCF_SoundController9 = 0x4E, // 0 - 127 (default: VibratoDelay - see MMA RP - 021)
MFMCF_SoundController10 = 0x4F, // 0 - 127 (default undefined - see MMA RP - 021)
MFMCF_GeneralPurposeController5 = 0x50, // 0 - 127
MFMCF_GeneralPurposeController6 = 0x51, // 0 - 127
MFMCF_GeneralPurposeController7 = 0x52, // 0 - 127
MFMCF_GeneralPurposeController8 = 0x53, // 0 - 127
MFMCF_PortamentoControl = 0x54, // 0 - 127
MFMCF_HighResolutionVelocityPrefix = 0x58, // 0 - 127
MFMCF_Effects1Depth = 0x5B, // 0 - 127 (default: ReverbSendLevel - see MMA RP - 023, formerly ExternalEffectsDepth)
MFMCF_Effects2Depth = 0x5C, // 0 - 127 (formerly TremoloDepth)
MFMCF_Effects3Depth = 0x5D, // 0 - 127 (default: ChorusSendLevel - see MMA RP - 023, formerly ChorusDepth)
MFMCF_Effects4Depth = 0x5E, // 0 - 127 (formerly Celeste[Detune]Depth)
MFMCF_Effects5Depth = 0x5F, // 0 - 127 (formerly PhaserDepth)
MFMCF_DataIncrement = 0x60, // (DataEntry + 1, see MMA RP - 018)
MFMCF_DataDecrement = 0x61, // (DataEntry - 1, see MMA RP - 018)
MFMCF_NonRegisteredParameterNumberLSB = 0x62, // 0 - 127 (NRPN)
MFMCF_NonRegisteredParameterNumberMSB = 0x63, // 0 - 127 (NRPN)
MFMCF_RegisteredParameterNumberLSB = 0x64, // 0 - 127 (RPN)
MFMCF_RegisteredParameterNumberMSB = 0x65, // 0 - 127 (RPN)
// Controller numbers 120 - 127 are reserved for Channel Mode Messages, which rather than controlling sound parameters, affect the channel's operating mode. (See also Table 1.)
MFMCF_CMM_AllSoundOff = 0x78, // 0
MFMCF_CMM_ResetAllControllers = 0x79, // 0 (See MMA RP - 015)
MFMCF_CMM_LocalControl = 0x7A, // 0 off, 127 on
MFMCF_CMM_AllNotesOff = 0x7B, // 0
MFMCF_CMM_OmniModeOff = 0x7C, // 0 (+all notes off)
MFMCF_CMM_OmniModeOn = 0x7D, // 0 (+all notes off)
MFMCF_CMM_MonoModeOn = 0x7E, // N (+poly off, +all notes off) Note: This equals the number of channels, or zero if the number of channels equals the number of voices in the receiver
MFMCF_CMM_PolyModeOn = 0x7F // 0 (+mono off, +all notes off)
};
enum MFMidiRegisteredParameters
{
MFRPN_PitchBendSensitivity = 0x0000, // 0xSSCC S = semi, C = cent
MFRPN_ChannelFineTuning = 0x0001, // Resolution 100/8192 cents: 0000 = -100 cents, 4000 = A440, 7F7F = +100 cents
MFRPN_ChannelCoarseTuning = 0x0002, // Only MSB used, Resolution 100 cent: 00 = -6400 cents, 40 = A440, 7F = +6300 cents
MFRPN_TuningProgramChange = 0x0003, // Tuning Program Number
MFRPN_TuningBankSelect = 0x0004, // Tuning Bank Number
MFRPN_ModulationDepthRange = 0x0005, // For GM2, defined in GM2 Specification. For other systems, defined by manufacturer.
// 3D sound controllers (See RP-049)
MFRPN_AzimuthAngle = 0x1E80,
MFRPN_ElevationAngle = 0x1E81,
MFRPN_Gain = 0x1E82,
MFRPN_DistanceRatio = 0x1E83,
MFRPN_MaximumDistance = 0x1E84,
MFRPN_GainAtMaximumDistance = 0x1E85,
MFRPN_ReferenceDistanceRatio = 0x1E86,
MFRPN_PanSpreadAngle = 0x1E87,
MFRPN_RollAngle = 0x1E88,
// reset parameter number
MFRPN_NullFunctionNumber = 0x3FFF // Setting RPN to 7FH,7FH will disable the data entry, data increment, and data decrement controllers until a new RPN or NRPN is selected.
};
enum MFMidiNote
{
MFMN_Unknown = 0xFF,
MFMN_C0 = 0,
MFMN_Cs0,
MFMN_D0,
MFMN_Ds0,
MFMN_E0,
MFMN_F0,
MFMN_Fs0,
MFMN_G0,
MFMN_Gs0,
MFMN_A0,
MFMN_As0,
MFMN_B0,
MFMN_C1,
MFMN_Cs1,
MFMN_D1,
MFMN_Ds1,
MFMN_E1,
MFMN_F1,
MFMN_Fs1,
MFMN_G1,
MFMN_Gs1,
MFMN_A1,
MFMN_As1,
MFMN_B1,
MFMN_C2,
MFMN_Cs2,
MFMN_D2,
MFMN_Ds2,
MFMN_E2,
MFMN_F2,
MFMN_Fs2,
MFMN_G2,
MFMN_Gs2,
MFMN_A2,
MFMN_As2,
MFMN_B2,
MFMN_C3,
MFMN_Cs3,
MFMN_D3,
MFMN_Ds3,
MFMN_E3,
MFMN_F3,
MFMN_Fs3,
MFMN_G3,
MFMN_Gs3,
MFMN_A3,
MFMN_As3,
MFMN_B3,
MFMN_C4,
MFMN_Cs4,
MFMN_D4,
MFMN_Ds4,
MFMN_E4,
MFMN_F4,
MFMN_Fs4,
MFMN_G4,
MFMN_Gs4,
MFMN_A4,
MFMN_As4,
MFMN_B4,
MFMN_C5,
MFMN_Cs5,
MFMN_D5,
MFMN_Ds5,
MFMN_E5,
MFMN_F5,
MFMN_Fs5,
MFMN_G5,
MFMN_Gs5,
MFMN_A5,
MFMN_As5,
MFMN_B5,
MFMN_C6,
MFMN_Cs6,
MFMN_D6,
MFMN_Ds6,
MFMN_E6,
MFMN_F6,
MFMN_Fs6,
MFMN_G6,
MFMN_Gs6,
MFMN_A6,
MFMN_As6,
MFMN_B6,
MFMN_C7,
MFMN_Cs7,
MFMN_D7,
MFMN_Ds7,
MFMN_E7,
MFMN_F7,
MFMN_Fs7,
MFMN_G7,
MFMN_Gs7,
MFMN_A7,
MFMN_As7,
MFMN_B7,
MFMN_C8,
MFMN_Cs8,
MFMN_D8,
MFMN_Ds8,
MFMN_E8,
MFMN_F8,
MFMN_Fs8,
MFMN_G8,
MFMN_Gs8,
MFMN_A8,
MFMN_As8,
MFMN_B8,
MFMN_C9,
MFMN_Cs9,
MFMN_D9,
MFMN_Ds9,
MFMN_E9,
MFMN_F9,
MFMN_Fs9,
MFMN_G9,
MFMN_Gs9,
MFMN_A9,
MFMN_As9,
MFMN_B9,
MFMN_C10,
MFMN_Cs10,
MFMN_D10,
MFMN_Ds10,
MFMN_E10,
MFMN_F10,
MFMN_Fs10,
MFMN_G10
};
#endif // _MFMIDI_TABLES_H
/** @} */
| 29.285714 | 184 | 0.70122 |
7dc8fda9a089aca335076c5f5c0afad5ba576818 | 900 | h | C | Native/Mobilisten.framework/Headers/LiveChatEmbed.h | mageshdharmalingam/MobiSDK | 7ecc1312bdd8bbea29d8ad336e874eb59cbc9065 | [
"MIT"
] | null | null | null | Native/Mobilisten.framework/Headers/LiveChatEmbed.h | mageshdharmalingam/MobiSDK | 7ecc1312bdd8bbea29d8ad336e874eb59cbc9065 | [
"MIT"
] | null | null | null | Native/Mobilisten.framework/Headers/LiveChatEmbed.h | mageshdharmalingam/MobiSDK | 7ecc1312bdd8bbea29d8ad336e874eb59cbc9065 | [
"MIT"
] | null | null | null | //
// LiveChatEmbed.h
// LiveChatEmbed
//
// Created by Shanmuga Sundaram G on 01/06/16.
// Copyright © 2016 Zoho. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for LiveChatEmbed.
FOUNDATION_EXPORT double LiveChatEmbedVersionNumber;
//! Project version string for LiveChatEmbed.
FOUNDATION_EXPORT const unsigned char LiveChatEmbedVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <LiveChatEmbed/PublicHeader.h>
#import <LiveChatEmbed/LCReachability.h>
#import <LiveChatEmbed/PEXHeader.h>
#import <LiveChatEmbed/WmsConfig.h>
#import <LiveChatEmbed/MessageHandler.h>
#import <LiveChatEmbed/LDPexAdaptor.h>
#import <LiveChatEmbed/LDPexHeader.h>
#import <LiveChatEmbed/Chathandler.h>
#import <LiveChatEmbed/SwiftTryCatch.h>
#import <LiveChatEmbed/asl.h>
#import <LiveChatEmbed/ApiHeaders.h>
| 31.034483 | 138 | 0.79 |
d1114fe306b7d065e8bcd47ed4bbe1968b9e4013 | 1,764 | h | C | include/upcn/crc.h | umr-ds/uPCN | 0f7323034920649802af27823c1363bc894589b6 | [
"BSD-3-Clause"
] | 2 | 2019-07-10T02:33:46.000Z | 2022-03-31T06:18:03.000Z | include/upcn/crc.h | umr-ds/uPCN | 0f7323034920649802af27823c1363bc894589b6 | [
"BSD-3-Clause"
] | null | null | null | include/upcn/crc.h | umr-ds/uPCN | 0f7323034920649802af27823c1363bc894589b6 | [
"BSD-3-Clause"
] | null | null | null | #ifndef CRC_H_INCLUDED
#define CRC_H_INCLUDED
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
enum crc_version {
CRC16_X25,
CRC16_CCITT_FALSE,
// CRC-32-C (Castagnoli)
CRC32,
};
struct crc_stream {
void (*feed)(struct crc_stream *crc, uint8_t byte);
void (*feed_eof)(struct crc_stream *crc);
union {
uint32_t checksum;
uint8_t bytes[4];
};
};
/**
* @brief X.25 CRC-16 checksum
*
* Polynom: 0x1021
* Initial value: 0xffff
* Final XOR value: 0xffff
* Reflect input data: TRUE
* Reflect result before final XOR: TRUE
*
* @param data Pointer to byte array to perform CRC on
* @param len Number of bytes (8-bit) to CRC
*
* @return CRC checksum
*/
uint16_t crc16_x25(const uint8_t *data, size_t len);
/**
* @brief CRC-16 CCITT FALSE checksum
*
* Parameters:
* Polynomial 0x1021
* Reflect input data: FALSE
* Reflect result before final XOR: FALSE
* Initial Value: 0xffff
* Final XOR Value: 0x0000
*
* @param data Pointer to byte array to perform CRC on
* @param len Number of bytes (8-bit) to CRC
*
* @return CRC checksum
*/
uint16_t crc16_ccitt_false(const uint8_t *data, size_t len);
/**
* @brief CRC-32 (ANSI/Ethernet) checksum
*
* Polynom: 0x04c11db7
* Initial value: 0xffffffff
* Final XOR value: 0xffffffff
* Reflect input data: TRUE
* Reflect result before final XOR: TRUE
*
* @param data Pointer to byte array to perform CRC on
* @param len Number of bytes (8-bit) to CRC
*
* @return CRC checksum
*/
uint32_t crc32(const uint8_t *data, size_t len);
void crc_init(struct crc_stream *crc, enum crc_version version);
void crc_feed_bytes(struct crc_stream *crc, const uint8_t *data, size_t len);
#endif /* CRC_H_INCLUDED */
| 21.777778 | 77 | 0.680839 |
d13377e952e513b2e829db0fa7d26c884da6c70f | 790 | h | C | inc/error.h | thecatkitty/yeet | 44fdf25f27c1ef66526bc19e1d8c3e02270ab9cc | [
"MIT"
] | null | null | null | inc/error.h | thecatkitty/yeet | 44fdf25f27c1ef66526bc19e1d8c3e02270ab9cc | [
"MIT"
] | null | null | null | inc/error.h | thecatkitty/yeet | 44fdf25f27c1ef66526bc19e1d8c3e02270ab9cc | [
"MIT"
] | null | null | null | #ifndef _ERROR_H_
#define _ERROR_H_
typedef long STATUS;
#define MAKE_ERROR( \
Facility, \
Code) \
( \
0xA0000000 | ((Facility) << 16) | (Code) \
)
#define MAKE_SUCCESS( \
Facility, \
Code) \
( \
0x20000000 | ((Facility) << 16) | (Code) \
)
#define STATUS_ERROR( \
Status) \
( \
(Status) & 0x80000000 \
)
#define STATUS_GET_FACILITY( \
Status) \
( \
((Status) >> 16) & 0x7FF \
)
#define STATUS_GET_CODE( \
Status) \
( \
(Status) & 0xFF \
)
#define NULL_STATUS_FACILITY 0x000
#define STATUS_CODE_SUCCESS 0x0000
#define STATUS_CODE_NULL_REFERENCE 0x0001
#define STATUS_CODE_BAD_ALLOC 0x0002
#define STATUS_SUCCESS MAKE_SUCCESS(NULL_STATUS_FACILITY, STATUS_CODE_SUCCESS)
#endif
| 15.8 | 79 | 0.611392 |
007e6aa5e50450ca7ee8708b04ab4b762fbf03a2 | 75 | h | C | Module 2/Chapter (5)/Swift2ByExample-4_PrettyWeather_6_Complete/PrettyWeatherApp/Pods/Headers/Private/FlickrKit/FKFlickrFavoritesAdd.h | PacktPublishing/Swift-Developing-iOS-Application | c91506a8840cca8eead164b35c2b7fd87c4024f3 | [
"MIT"
] | 4 | 2016-09-27T22:34:50.000Z | 2017-12-20T07:33:42.000Z | Module 2/Chapter (5)/Swift2ByExample-4_PrettyWeather_6_Complete/PrettyWeatherApp/Pods/Headers/Private/FlickrKit/FKFlickrFavoritesAdd.h | PacktPublishing/Swift-Developing-iOS-Application | c91506a8840cca8eead164b35c2b7fd87c4024f3 | [
"MIT"
] | 1 | 2016-05-23T07:50:14.000Z | 2016-05-29T12:29:41.000Z | Module 2/Chapter (5)/Swift2ByExample-4_PrettyWeather_6_Complete/PrettyWeatherApp/Pods/Headers/Private/FlickrKit/FKFlickrFavoritesAdd.h | PacktPublishing/Swift-Developing-iOS-Application | c91506a8840cca8eead164b35c2b7fd87c4024f3 | [
"MIT"
] | 8 | 2016-03-08T00:16:18.000Z | 2021-04-22T09:56:09.000Z | ../../../FlickrKit/Classes/Model/Generated/Favorites/FKFlickrFavoritesAdd.h | 75 | 75 | 0.8 |
449151116186b4a16f0d2e1b89add8b85de26c26 | 254 | h | C | CGIMockTool/CGIMockTool/ViewController/JSONEditorWindowViewController.h | albert1024/CGIMockTool | 2d418c522d179d97f46531ee218a0b9b251f716a | [
"MIT"
] | 1 | 2019-09-20T06:01:47.000Z | 2019-09-20T06:01:47.000Z | CGIMockTool/CGIMockTool/ViewController/JSONEditorWindowViewController.h | albert1024/CGIMockTool | 2d418c522d179d97f46531ee218a0b9b251f716a | [
"MIT"
] | null | null | null | CGIMockTool/CGIMockTool/ViewController/JSONEditorWindowViewController.h | albert1024/CGIMockTool | 2d418c522d179d97f46531ee218a0b9b251f716a | [
"MIT"
] | null | null | null | //
// JSONEditorWindowViewController.h
// CGIMockTool
//
// Created by littleliang on 2018/6/15.
// Copyright © 2018年 littleliang. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface JSONEditorWindowViewController : NSWindowController
@end
| 18.142857 | 62 | 0.748031 |
16e982d2feccac922191b7bd4a87b4dcbdc8d2ab | 335 | h | C | 014_StencilTesting/StencilTesting/CameraController.h | David-Luis/graphics | 2397e79353e4721ed6199a4e05572bc992ba24d4 | [
"MIT"
] | null | null | null | 014_StencilTesting/StencilTesting/CameraController.h | David-Luis/graphics | 2397e79353e4721ed6199a4e05572bc992ba24d4 | [
"MIT"
] | null | null | null | 014_StencilTesting/StencilTesting/CameraController.h | David-Luis/graphics | 2397e79353e4721ed6199a4e05572bc992ba24d4 | [
"MIT"
] | null | null | null | #pragma once
#include <Engine/OpenGLApplication.h>
#include <vector>
struct GLFWwindow;
class Camera;
class CameraController
{
public:
CameraController();
void SetCamera(Camera* camera);
void ProcessInput(GLFWwindow* window, glm::vec3 deltaMousePosition, float deltaTime);
private:
Camera* m_camera;
bool m_mouseEnabled;
};
| 15.952381 | 86 | 0.773134 |
79ad2f29cc9596d439e498778cbc97eafd2ab2b3 | 2,335 | h | C | src/triangle.h | jimhester/euclid | 098411d5b6d55e935dbd420d1335c8b0f9105e93 | [
"MIT"
] | null | null | null | src/triangle.h | jimhester/euclid | 098411d5b6d55e935dbd420d1335c8b0f9105e93 | [
"MIT"
] | null | null | null | src/triangle.h | jimhester/euclid | 098411d5b6d55e935dbd420d1335c8b0f9105e93 | [
"MIT"
] | null | null | null | #pragma once
#include <cpp11/strings.hpp>
#include <cpp11/doubles.hpp>
#include "cgal_types.h"
#include "geometry_vector.h"
#include "exact_numeric.h"
class triangle2 : public geometry_vector<Triangle_2, 2> {
public:
const Primitive geo_type = TRIANGLE;
using geometry_vector::geometry_vector;
~triangle2() = default;
geometry_vector_base* new_from_vector(std::vector<Triangle_2> vec) const {
triangle2* copy = new triangle2();
copy->_storage.swap(vec);
return copy;
}
size_t cardinality(size_t i) const { return 3; }
size_t long_length() const { return size() * 3; }
cpp11::writable::strings def_names() const {
return {"x", "y"};
}
Exact_number get_single_definition(size_t i, int which, int element) const {
switch(which) {
case 0: return _storage[i].vertex(element).x();
case 1: return _storage[i].vertex(element).y();
}
return _storage[i].vertex(0).x();
}
std::vector<double> get_row(size_t i, size_t j) const {
return {
CGAL::to_double(_storage[i].vertex(j).x().exact()),
CGAL::to_double(_storage[i].vertex(j).y().exact())
};
}
};
typedef cpp11::external_pointer<triangle2> triangle2_p;
class triangle3 : public geometry_vector<Triangle_3, 3> {
public:
const Primitive geo_type = TRIANGLE;
using geometry_vector::geometry_vector;
~triangle3() = default;
geometry_vector_base* new_from_vector(std::vector<Triangle_3> vec) const {
triangle3* copy = new triangle3();
copy->_storage.swap(vec);
return copy;
}
size_t cardinality(size_t i) const { return 3; }
size_t long_length() const { return size() * 3; }
cpp11::writable::strings def_names() const {
return {"x", "y", "z"};
}
Exact_number get_single_definition(size_t i, int which, int element) const {
switch(which) {
case 0: return _storage[i].vertex(element).x();
case 1: return _storage[i].vertex(element).y();
case 2: return _storage[i].vertex(element).z();
}
return _storage[i].vertex(0).x();
}
std::vector<double> get_row(size_t i, size_t j) const {
return {
CGAL::to_double(_storage[i].vertex(j).x().exact()),
CGAL::to_double(_storage[i].vertex(j).y().exact()),
CGAL::to_double(_storage[i].vertex(j).z().exact())
};
}
};
typedef cpp11::external_pointer<triangle3> triangle3_p;
| 25.944444 | 78 | 0.670664 |
6504b03588b442324f08ad056ebce605324a332d | 957 | c | C | C00/ex05/main.c | arthur-trt/42-Pool | 340f68b48b4717925809e64425739f207062eb94 | [
"MIT"
] | null | null | null | C00/ex05/main.c | arthur-trt/42-Pool | 340f68b48b4717925809e64425739f207062eb94 | [
"MIT"
] | null | null | null | C00/ex05/main.c | arthur-trt/42-Pool | 340f68b48b4717925809e64425739f207062eb94 | [
"MIT"
] | null | null | null | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atrouill <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/01 14:50:29 by atrouill #+# #+# */
/* Updated: 2019/08/01 14:51:21 by atrouill ### ########.fr */
/* */
/* ************************************************************************** */
void ft_print_comb(void);
int main(void)
{
ft_print_comb();
}
| 50.368421 | 80 | 0.140021 |
b24b97e554e2ca4b8c99470ca43df5805ba63a83 | 1,181 | h | C | hv/test/kvm-unit-tests/lib/arm/asm/mmu.h | wtliang110/lk_hv | fbbbb280114c44bf321b8f02301a84e3c469d8a2 | [
"MIT"
] | 4 | 2022-02-24T06:16:42.000Z | 2022-02-24T23:49:29.000Z | hv/test/kvm-unit-tests/lib/arm/asm/mmu.h | wtliang110/lk_hv | fbbbb280114c44bf321b8f02301a84e3c469d8a2 | [
"MIT"
] | null | null | null | hv/test/kvm-unit-tests/lib/arm/asm/mmu.h | wtliang110/lk_hv | fbbbb280114c44bf321b8f02301a84e3c469d8a2 | [
"MIT"
] | null | null | null | #ifndef _ASMARM_MMU_H_
#define _ASMARM_MMU_H_
/*
* Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.
*/
#include <asm/barrier.h>
#define PTE_USER L_PTE_USER
#define PTE_UXN L_PTE_XN
#define PTE_PXN L_PTE_PXN
#define PTE_RDONLY PTE_AP2
#define PTE_SHARED L_PTE_SHARED
#define PTE_AF PTE_EXT_AF
#define PTE_WBWA L_PTE_MT_WRITEALLOC
#define PTE_UNCACHED L_PTE_MT_UNCACHED
/* See B3.18.7 TLB maintenance operations */
static inline void local_flush_tlb_all(void)
{
dsb(nshst);
/* TLBIALL */
asm volatile("mcr p15, 0, %0, c8, c7, 0" :: "r" (0));
dsb(nsh);
isb();
}
static inline void flush_tlb_all(void)
{
dsb(ishst);
/* TLBIALLIS */
asm volatile("mcr p15, 0, %0, c8, c3, 0" :: "r" (0));
dsb(ish);
isb();
}
static inline void flush_tlb_page(unsigned long vaddr)
{
dsb(ishst);
/* TLBIMVAAIS */
asm volatile("mcr p15, 0, %0, c8, c3, 3" :: "r" (vaddr));
dsb(ish);
isb();
}
static inline void flush_dcache_addr(unsigned long vaddr)
{
/* DCCIMVAC */
asm volatile("mcr p15, 0, %0, c7, c14, 1" :: "r" (vaddr));
}
#include <asm/mmu-api.h>
#endif /* _ASMARM_MMU_H_ */
| 20.719298 | 69 | 0.679086 |
bf8719e5306d10718a043c900b646d1e6dbb536f | 5,170 | h | C | 02_Library/Include/XMCocos2D-v3/2d/CCCamera.h | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | 2 | 2017-08-03T07:15:00.000Z | 2018-06-18T10:32:53.000Z | 02_Library/Include/XMCocos2D-v3/2d/CCCamera.h | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | null | null | null | 02_Library/Include/XMCocos2D-v3/2d/CCCamera.h | mcodegeeks/OpenKODE-Framework | d4382d781da7f488a0e7667362a89e8e389468dd | [
"MIT"
] | 2 | 2019-03-04T22:57:42.000Z | 2020-03-06T01:32:26.000Z | /* -----------------------------------------------------------------------------------
*
* File CCCamera.h
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* -----------------------------------------------------------------------------------
*
* Copyright (c) 2010-2014 XMSoft
* Copyright (c) 2010-2013 cocos2d-x.org
* Copyright (c) 2010 Ricardo Quesada
* Copyright (c) 2011 Zynga Inc.
*
* http://www.cocos2d-x.org
*
* -----------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* --------------------------------------------------------------------------------- */
#ifndef __CCCamera_h__
#define __CCCamera_h__
#include "../base/CCObject.h"
#include "XMKazmath/mat4.h"
NS_CC_BEGIN
/**
* @addtogroup base_nodes
* @{
*/
/**
* A Camera is used in every Node.
* Useful to look at the object from different views.
* The OpenGL gluLookAt() function is used to locate the
* camera.
*
* If the object is transformed by any of the scale, rotation or
* position attributes, then they will override the camera.
*
* IMPORTANT: Either your use the camera or the rotation/scale/position properties. You can't use both.
* World coordinates won't work if you use the camera.
*
* Limitations:
*
* - Some nodes, like ParallaxNode, Particle uses world node coordinates, and they won't work properly if you move them (or any of their ancestors)
* using the camera.
*
* - It doesn't work on batched nodes like Sprite objects when they are parented to a SpriteBatchNode object.
*
* - It is recommended to use it ONLY if you are going to create 3D effects. For 2D effects, use the action Follow or position/scale/rotate.
*
*/
class CC_DLL Camera : public Object
{
public :
/** returns the Z eye */
static KDfloat getZEye ( KDvoid );
/**
* @js ctor
*/
Camera ( KDvoid );
/**
* @js NA
* @lua NA
*/
~Camera ( KDvoid );
KDvoid init ( KDvoid );
/**
* @js NA
* @lua NA
*/
const KDchar* description ( KDvoid ) const;
/** sets the dirty value */
inline KDvoid setDirty ( KDbool bValue ) { m_bDirty = bValue; }
/** get the dirty value */
inline KDbool isDirty ( KDvoid ) const { return m_bDirty; }
/** sets the camera in the default position */
KDvoid restore ( KDvoid );
/** Sets the camera using gluLookAt using its eye, center and up_vector */
KDvoid locate ( KDvoid );
/** sets the eye values in points */
KDvoid setEye ( KDfloat fEyeX, KDfloat fEyeY, KDfloat fEyeZ );
/** sets the center values in points */
KDvoid setCenter ( KDfloat fCenterX, KDfloat fCenterY, KDfloat fCenterZ );
/** sets the up values */
KDvoid setUp ( KDfloat fUpX, KDfloat fUpY, KDfloat fUpZ );
/**
* get the eye vector values in points
* @code
* when this function bound to js or lua,the input params are changed
* in js: var getEye()
* in lua:local getEye()
* @endcode
*/
KDvoid getEye ( KDfloat* pEyeX, KDfloat* pEyeY, KDfloat* pEyeZ ) const;
/**
* get the center vector values int points
* when this function bound to js or lua,the input params are changed
* in js: var getCenter()
* in lua:local getCenter()
*/
KDvoid getCenter ( KDfloat* pCenterX, KDfloat* pCenterY, KDfloat* pCenterZ ) const;
/**
* get the up vector values
* when this function bound to js or lua,the input params are changed
* in js: var getUp()
* in lua:local getUp()
*/
KDvoid getUp ( KDfloat* pUpX, KDfloat* pUpY, KDfloat* pUpZ ) const;
protected :
KDfloat m_fEyeX;
KDfloat m_fEyeY;
KDfloat m_fEyeZ;
KDfloat m_fCenterX;
KDfloat m_fCenterY;
KDfloat m_fCenterZ;
KDfloat m_fUpX;
KDfloat m_fUpY;
KDfloat m_fUpZ;
KDbool m_bDirty;
kmMat4 m_tLookupMatrix;
private :
DISALLOW_COPY_AND_ASSIGN ( Camera );
};
// end of base_node group
/// @}
NS_CC_END
#endif // __CCCamera_h__
| 29.542857 | 148 | 0.617215 |
0fbcfa6668db111ce3898941dced8d42d635f58b | 302 | h | C | src/rk_jpeg.h | zhangximin/rk_jpeg | 52022e9de43270540afbf76a7daacb88e252fa49 | [
"Apache-2.0"
] | 9 | 2016-03-10T06:27:18.000Z | 2021-06-09T00:06:29.000Z | src/rk_jpeg.h | zhangximin/rk_jpeg | 52022e9de43270540afbf76a7daacb88e252fa49 | [
"Apache-2.0"
] | 1 | 2016-04-18T09:19:00.000Z | 2016-04-21T08:25:53.000Z | src/rk_jpeg.h | zhangximin/rk_jpeg | 52022e9de43270540afbf76a7daacb88e252fa49 | [
"Apache-2.0"
] | 13 | 2015-06-10T10:27:13.000Z | 2020-11-08T06:11:37.000Z | /*
* rk_jpeg.h
*
* Created on: 2015-4-14
* Author: simon
*/
#ifndef RK_JPEG_H_
#define RK_JPEG_H_
#ifdef __cplusplus
extern "C"
{
#endif
int hwjpeg_decoder(char* data,char * data_out, int size, int loff,int toff,int width,int height);
#ifdef __cplusplus
}
#endif
#endif /* RK_JPEG_H_ */
| 13.727273 | 97 | 0.682119 |
beb89657e6ddb69b5b83cac080c1e23959f29c6d | 2,772 | h | C | tools/bonsaiRenderer/CameraPath.h | ericchill/Bonsai | 8904dd3ebf395ccaaf0eacef38933002b49fc3ba | [
"Apache-2.0"
] | 40 | 2015-02-02T13:24:11.000Z | 2021-09-10T05:43:44.000Z | tools/bonsaiRenderer/CameraPath.h | ericchill/Bonsai | 8904dd3ebf395ccaaf0eacef38933002b49fc3ba | [
"Apache-2.0"
] | 17 | 2015-02-20T08:29:57.000Z | 2022-02-17T17:26:40.000Z | tools/bonsaiRenderer/CameraPath.h | ericchill/Bonsai | 8904dd3ebf395ccaaf0eacef38933002b49fc3ba | [
"Apache-2.0"
] | 24 | 2015-01-30T09:14:51.000Z | 2021-12-28T01:53:28.000Z | #pragma once
#include <fstream>
#include <string>
#include <cassert>
#include <vector>
#include <cmath>
class CameraPath
{
public:
using real = double;
struct camera_t
{
union
{
struct{
real rotx,roty,rotz;
real tranx,trany,tranz;
};
real data[6];
};
};
private:
std::vector<camera_t> cameraVec_base, cameraVec;
public:
CameraPath(const std::string &fileName)
{
std::ifstream fin(fileName);
int nval;
real time;
fin >> nval >> time;
cameraVec_base.resize(nval);
for (int i = 0; i < nval; i++)
{
int idum;
fin >> idum;
assert(idum == i+1);
auto &cam = cameraVec_base[i];
fin >> cam.tranx >> cam.trany >> cam.tranz;
fin >> cam.rotx >> cam.roty >> cam.rotz;
cam.rotx *= -180.0/M_PI;
cam.roty *= -180.0/M_PI;
cam.rotz *= -180.0/M_PI;
cam.tranx *= -1.0;
cam.trany *= -1.0;
cam.tranz *= -1.0;
std::string order;
fin >> order;
assert(order == "XYZ");
}
cameraVec = cameraVec_base;
}
camera_t interpolate(const real r) const
{
assert(r >= 0.0);
assert(r <= 1.0);
const int nframes = cameraVec_base.size();
const real t = r * (nframes-1);
const real t0 = floor(t);
const real t1 = t0 + 1.0;
auto c0 = cameraVec_base[static_cast<int>(t0)];
auto c1 = cameraVec_base[std::min(static_cast<int>(t1),nframes-1)];
const real f = (t-t0)/(t1-t0);
auto cvt = [&](const real f0, const real f1)
{
return f0 + (f1-f0)*f;
};
/* correct angles, to ensure continuited across [-PI;+PI] boudary */
#if 0
for (int k = 0; k < 3; k++)
if (std::abs(c0.data[k] - c1.data[k]) > M_PI)
{
// fprintf(stdout, " k0: %d %5.2f %5.2f \n", k, c0.data[k]*M_PI/180.0, c1.data[k]*M_PI/180.0);
if (c0.data[k] > 0.0)
c1.data[k] += 360.0;
else if (c0.data[k] < 0.0)
c1.data[k] -= 360.0;
// fprintf(stdout, " k1: %d %5.2f %5.2f \n", k, c0.data[k]*M_PI/180.0, c1.data[k]*M_PI/180.0);
}
#endif
camera_t cam;
for (int k = 0; k < 6; k++)
cam.data[k] = cvt(c0.data[k], c1.data[k]);
return cam;
}
void reframe(const int nframe)
{
assert(nframe > 0);
cameraVec.resize(nframe);
for (int i = 0; i < nframe; i++)
{
const real f = static_cast<real>(i)/(nframe-1);
cameraVec[i] = interpolate(f);
}
}
int nFrames() const { return cameraVec.size(); }
const camera_t& getFrame(const int step) const { return cameraVec[step%nFrames()]; }
};
| 24.530973 | 106 | 0.505051 |
806b9857fc3007ab293645d79fd06894ca4deed1 | 1,227 | h | C | avalanche/Factory.h | evenmdert/avalanche | 6b8292675c828d5fb3ba997fb1df8dac68201a85 | [
"MIT"
] | 59 | 2017-07-18T21:00:01.000Z | 2022-03-29T19:04:23.000Z | avalanche/Factory.h | terrainwax/avalanche | 05f660ca9c8494302faf0a0ecd1cb752964879cf | [
"MIT"
] | 3 | 2019-10-04T00:58:38.000Z | 2021-06-14T20:41:40.000Z | avalanche/Factory.h | terrainwax/avalanche | 05f660ca9c8494302faf0a0ecd1cb752964879cf | [
"MIT"
] | 8 | 2018-08-06T22:41:47.000Z | 2022-03-18T10:32:44.000Z | #ifndef _AVALANCHE_FACTORY_H_
#define _AVALANCHE_FACTORY_H_
#include <unordered_map>
#include <memory>
#include <algorithm>
#include <cctype>
namespace avalanche {
template <typename T, typename... Args>
class Factory {
public:
using MethodCreator = std::unique_ptr<T>(*)(Args... args);
using MethodRegistry = std::unordered_map<std::string, MethodCreator>;
private:
MethodRegistry m_Methods;
public:
Factory() = default;
Factory(const MethodRegistry& registry) {
m_Methods = registry;
}
template <typename Method>
void Register(const std::string& name) {
auto creator = [](Args... args) -> std::unique_ptr<T> {
return std::make_unique<Method>(args...);
};
m_Methods.insert(std::make_pair(name, creator));
}
bool Contains(const std::string& name) const { return m_Methods.find(name) != m_Methods.end(); }
std::unique_ptr<T> Create(std::string name, Args... args) const {
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
auto iter = m_Methods.find(name);
if (iter == m_Methods.end())
return nullptr;
return iter->second(args...);
}
};
} // ns avalanche
#endif
| 23.596154 | 100 | 0.638957 |
806d8a5e202e1355e3002729b876be67a6bab933 | 857 | h | C | src/config.h | realraum/r3CellarDewpointVentilation | 3c7e340b96b3e5dbdef5e37b174183f165938086 | [
"BSD-2-Clause"
] | null | null | null | src/config.h | realraum/r3CellarDewpointVentilation | 3c7e340b96b3e5dbdef5e37b174183f165938086 | [
"BSD-2-Clause"
] | null | null | null | src/config.h | realraum/r3CellarDewpointVentilation | 3c7e340b96b3e5dbdef5e37b174183f165938086 | [
"BSD-2-Clause"
] | null | null | null | #ifndef CONFIG__H
#define CONFIG__H
#define SPI_BMP_CS 15
#define I2C_DISPLAY_SDA 5
#define I2C_DISPLAY_SCL 4
#define I2C_BME1_SDA 13
#define I2C_BME1_SCL 16
// #define I2C_BMP2_SDA 5
// #define I2C_BMP2_SCL 4
#define MAX_MANUAL_VENT_TIME_S 6*3600
//Relay control pins
#define RELAY1 25
#define RELAY2 26
#define RELAY_OFF LOW
#define RELAY_ON HIGH
#define BUTTON_PIN 12
#define BUTTON_PRESSED LOW
#define BUTTON_DEBOUNCE 100
//Set the frequency of updating the relay here, in minutes. The larger the value, the less likely you will have rapid on/off cycling
#define RELAYINTERVAL 1
//Set the ventilation threshold of the DEWPOINT in degrees celcius. I recccomend it being greater than 1, as that seems to be the margin of error for these sensors
#define VENTTHRESHOLD 1.5
//Set cutoff temp for ventilation, celcius
#define TEMPCUTOFF 15
#endif | 23.162162 | 163 | 0.794632 |
8083647fa5086a0de05110607643c999feccd135 | 1,728 | h | C | Source/Foundation/Data/Type/Text.h | GoPlan/cldeplus | b5c7b95db10f64ac597aa0bf82e1bd94e4c7c940 | [
"Apache-2.0"
] | null | null | null | Source/Foundation/Data/Type/Text.h | GoPlan/cldeplus | b5c7b95db10f64ac597aa0bf82e1bd94e4c7c940 | [
"Apache-2.0"
] | null | null | null | Source/Foundation/Data/Type/Text.h | GoPlan/cldeplus | b5c7b95db10f64ac597aa0bf82e1bd94e4c7c940 | [
"Apache-2.0"
] | null | null | null | /*
Copyright 2015 LE, Duc-Anh
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 CLOUD_E_CPLUS_FOUNDATION_DATA_TYPE_TEXT_H
#define CLOUD_E_CPLUS_FOUNDATION_DATA_TYPE_TEXT_H
#include "../../../Portable/CommonTypes.h"
#include "../CharacterValue.h"
namespace CLDEPlus {
namespace Foundation {
namespace Data {
namespace Type {
class Text : public CharacterValue {
char *_buffer = nullptr;
public:
explicit Text(string const &text);
explicit Text(char const *text);
explicit Text(unsigned long length);
Text(Text const &) = default;
Text(Text &&) = default;
Text &operator=(Text const &) = default;
Text &operator=(Text &&) = default;
~Text();
// Value
virtual void *PointerToBuffer() override;
virtual size_t getActualSize() override;
// IPrintable
virtual string ToString() const override;
};
}
}
}
}
#endif //CLOUD_E_CPLUS_FOUNDATION_DATA_TYPE_TEXT_H
| 29.793103 | 72 | 0.596065 |
b9ae57cf68eaa557260773c7a6a00d6de5eda4af | 265 | h | C | API/inc/Common/Platforms.h | cnsuhao/OtterUI-1 | 07149c970adaaa8c7696efa9ad7a92137f0a4557 | [
"MIT"
] | 10 | 2016-06-03T02:18:37.000Z | 2021-02-03T15:14:50.000Z | API/inc/Common/Platforms.h | ppiecuch/OtterUI | 07149c970adaaa8c7696efa9ad7a92137f0a4557 | [
"MIT"
] | null | null | null | API/inc/Common/Platforms.h | ppiecuch/OtterUI | 07149c970adaaa8c7696efa9ad7a92137f0a4557 | [
"MIT"
] | 5 | 2017-07-31T07:25:50.000Z | 2021-03-16T11:45:31.000Z | #pragma once
#ifndef PLATFORM_WIN32
#define sprintf_s(d, ds, fmt, ...) sprintf(d, fmt, __VA_ARGS__)
#define memcpy_s(d, ds, s, ss) memcpy(d, s, ss)
#define vsprintf_s(d, ds, fmt, args) vsprintf(d, fmt, args)
#define strncpy_s(d, ds, s, ss) strncpy(d, s, ss)
#endif | 33.125 | 63 | 0.686792 |
7e995ad3b6ca321371053fd1f8a3e05d0fc47429 | 273 | c | C | 80407370-deactive_if_38stars.c | frauber84/mario64missingstars | 6c43f398c88526955cbd38d3e0b7a7aee0afbdb5 | [
"MIT"
] | null | null | null | 80407370-deactive_if_38stars.c | frauber84/mario64missingstars | 6c43f398c88526955cbd38d3e0b7a7aee0afbdb5 | [
"MIT"
] | null | null | null | 80407370-deactive_if_38stars.c | frauber84/mario64missingstars | 6c43f398c88526955cbd38d3e0b7a7aee0afbdb5 | [
"MIT"
] | null | null | null |
#include <n64.h>
#include "explode.h"
struct object **Obj = (void*)M64_CURR_OBJ_PTR;
void _start ( void )
{
u16 *NumStars = (void*)0x8033B21A;
if ( (*NumStars) == 38)
{
(*Obj)->active = 0;
}
}
| 16.058824 | 71 | 0.446886 |
7d8ec0b955b75f2145299e0f3d1308491cc58da9 | 226 | h | C | Thing.Core/IDigitalInput.h | Alv3s/Thing.Core | 16f5afa37aef24769436e909e88648f0345b2031 | [
"MIT"
] | 3 | 2020-06-08T12:50:37.000Z | 2020-09-22T01:13:01.000Z | Thing.Core/IDigitalInput.h | Alv3s/Thing.Core | 16f5afa37aef24769436e909e88648f0345b2031 | [
"MIT"
] | null | null | null | Thing.Core/IDigitalInput.h | Alv3s/Thing.Core | 16f5afa37aef24769436e909e88648f0345b2031 | [
"MIT"
] | 1 | 2020-09-24T19:22:10.000Z | 2020-09-24T19:22:10.000Z | #pragma once
#include "IDigitalIO.h"
#include "HardwareEnumerations.h"
namespace Thing
{
namespace Core
{
class IDigitalInput : public virtual IDigitalIO
{
public:
virtual DigitalValue DigitalRead() = 0;
};
}
} | 14.125 | 49 | 0.712389 |
24b5e6447d897cdd5bef3287aed214f2e7e17a39 | 493 | h | C | SGL/src/SGL.h | Jesseblast/SGL | 0ad1302ae024853e322fd1f0ad366059379a5fb0 | [
"Zlib"
] | null | null | null | SGL/src/SGL.h | Jesseblast/SGL | 0ad1302ae024853e322fd1f0ad366059379a5fb0 | [
"Zlib"
] | null | null | null | SGL/src/SGL.h | Jesseblast/SGL | 0ad1302ae024853e322fd1f0ad366059379a5fb0 | [
"Zlib"
] | null | null | null | /**
*
*
* Document like this: https://developer.lsst.io/cpp/api-docs.html
*/
#ifndef _SGL_H_
#define _SGL_H_
#include "SGLCore.h"
#include "Drawable.h"
#include "DrawMethod.h"
#include "DrawMode.h"
#include "Renderer.h"
#include "RendererType.h"
#include "ShaderGLSL.h"
#include "Texture.h"
#include "TextureFilter.h"
#include "TextureUnit.h"
#include "Color.h"
#include "Input.h"
#include "Matrix4.h"
#include "Vector2.h"
#include "Vector3.h"
#include "Window.h"
#endif /* _SGL_H_ */ | 15.40625 | 65 | 0.703854 |
24c2992425e4332ad5a9b74d859e64ad84473b10 | 1,469 | h | C | objc/SwaggerClient/Model/SWGGeocodingLocation.h | byung90/graphhopper | 443891657e20cd1393675b1d4a1b9f38c691cdff | [
"Apache-2.0"
] | null | null | null | objc/SwaggerClient/Model/SWGGeocodingLocation.h | byung90/graphhopper | 443891657e20cd1393675b1d4a1b9f38c691cdff | [
"Apache-2.0"
] | null | null | null | objc/SwaggerClient/Model/SWGGeocodingLocation.h | byung90/graphhopper | 443891657e20cd1393675b1d4a1b9f38c691cdff | [
"Apache-2.0"
] | null | null | null | #import <Foundation/Foundation.h>
#import "SWGObject.h"
/**
* GraphHopper Directions API
* You use the GraphHopper Directions API to add route planning, navigation and route optimization to your software. E.g. the Routing API has turn instructions and elevation data and the Route Optimization API solves your logistic problems and supports various constraints like time window and capacity restrictions. Also it is possible to get all distances between all locations with our fast Matrix API.
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
#import "SWGGeocodingPoint.h"
@protocol SWGGeocodingPoint;
@class SWGGeocodingPoint;
@protocol SWGGeocodingLocation
@end
@interface SWGGeocodingLocation : SWGObject
@property(nonatomic) SWGGeocodingPoint* point;
/* OSM Id [optional]
*/
@property(nonatomic) NSString* osmId;
/* N = node, R = relation, W = way [optional]
*/
@property(nonatomic) NSString* osmType;
/* The osm key of the result like `place` or `amenity` [optional]
*/
@property(nonatomic) NSString* osmKey;
@property(nonatomic) NSString* name;
@property(nonatomic) NSString* country;
@property(nonatomic) NSString* city;
@property(nonatomic) NSString* state;
@property(nonatomic) NSString* street;
@property(nonatomic) NSString* housenumber;
@property(nonatomic) NSString* postcode;
@end
| 26.709091 | 404 | 0.76855 |
4a96dfdbd08c6e709dd756ff7ad846edbf20c611 | 479 | h | C | Headers/Frameworks/Flexo/FFInspectorVideoEffectsDraggingContext.h | CommandPost/FinalCutProFrameworks | d98b00ff0c84af80942d71514e9238d624aca50a | [
"MIT"
] | 3 | 2020-11-19T10:04:02.000Z | 2021-10-02T17:25:21.000Z | Headers/Frameworks/Flexo/FFInspectorVideoEffectsDraggingContext.h | CommandPost/FinalCutProFrameworks | d98b00ff0c84af80942d71514e9238d624aca50a | [
"MIT"
] | null | null | null | Headers/Frameworks/Flexo/FFInspectorVideoEffectsDraggingContext.h | CommandPost/FinalCutProFrameworks | d98b00ff0c84af80942d71514e9238d624aca50a | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Mar 11 2021 20:53:35).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <Flexo/FFInspectorEffectsDraggingContext.h>
__attribute__((visibility("hidden")))
@interface FFInspectorVideoEffectsDraggingContext : FFInspectorEffectsDraggingContext
{
BOOL _isMaskEffectController;
}
@property(nonatomic) BOOL isMaskEffectController; // @synthesize isMaskEffectController=_isMaskEffectController;
@end
| 25.210526 | 112 | 0.778706 |
6041473fbe83a1ee6308f93bd5adbcde1b3445f2 | 8,871 | h | C | ccnx/forwarder/metis/processor/metis_MessageProcessor.h | parc-ccnx-archive/Metis | f6d573f99fb51bc9716cdbc825ecfc824baa4a8b | [
"BSD-2-Clause"
] | null | null | null | ccnx/forwarder/metis/processor/metis_MessageProcessor.h | parc-ccnx-archive/Metis | f6d573f99fb51bc9716cdbc825ecfc824baa4a8b | [
"BSD-2-Clause"
] | null | null | null | ccnx/forwarder/metis/processor/metis_MessageProcessor.h | parc-ccnx-archive/Metis | f6d573f99fb51bc9716cdbc825ecfc824baa4a8b | [
"BSD-2-Clause"
] | null | null | null | /*
* Copyright (c) 2013-2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL XEROX OR PARC 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.
*
* ################################################################################
* #
* # PATENT NOTICE
* #
* # This software is distributed under the BSD 2-clause License (see LICENSE
* # file). This BSD License does not make any patent claims and as such, does
* # not act as a patent grant. The purpose of this section is for each contributor
* # to define their intentions with respect to intellectual property.
* #
* # Each contributor to this source code is encouraged to state their patent
* # claims and licensing mechanisms for any contributions made. At the end of
* # this section contributors may each make their own statements. Contributor's
* # claims and grants only apply to the pieces (source code, programs, text,
* # media, etc) that they have contributed directly to this software.
* #
* # There is no guarantee that this section is complete, up to date or accurate. It
* # is up to the contributors to maintain their portion of this section and up to
* # the user of the software to verify any claims herein.
* #
* # Do not remove this header notification. The contents of this section must be
* # present in all distributions of the software. You may only modify your own
* # intellectual property statements. Please provide contact information.
*
* - Palo Alto Research Center, Inc
* This software distribution does not grant any rights to patents owned by Palo
* Alto Research Center, Inc (PARC). Rights to these patents are available via
* various mechanisms. As of January 2016 PARC has committed to FRAND licensing any
* intellectual property used by its contributions to this software. You may
* contact PARC at cipo@parc.com for more information or visit http://www.ccnx.org
*/
/**
* @file metis_MessageProcessor.h
* @brief Executes the set of rules dictated by the PacketType
*
* This is a "run-to-completion" handling of a message based on the PacketType.
*
* The MessageProcessor also owns the PIT and FIB tables.
*
* @author Marc Mosko, Palo Alto Research Center (Xerox PARC)
* @copyright (c) 2013-2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC). All rights reserved.
*/
#ifndef Metis_metis_MessageProcessor_h
#define Metis_metis_MessageProcessor_h
#include <ccnx/api/control/cpi_RouteEntry.h>
#include <ccnx/forwarder/metis/core/metis_Forwarder.h>
#include <ccnx/forwarder/metis/core/metis_Message.h>
#include <ccnx/forwarder/metis/processor/metis_Tap.h>
#include <ccnx/forwarder/metis/content_store/metis_ContentStoreInterface.h>
struct metis_message_processor;
typedef struct metis_message_processor MetisMessageProcessor;
/**
* Allocates a MessageProcessor along with PIT, FIB and ContentStore tables
*
* The metis pointer is primarily used for logging (metisForwarder_Log), getting the
* configuration, and accessing the connection table.
*
* @param [in] metis Pointer to owning Metis process
*
* @retval non-null An allocated message processor
* @retval null An error
*
* Example:
* @code
* <#example#>
* @endcode
*/
MetisMessageProcessor *metisMessageProcessor_Create(MetisForwarder *metis);
/**
* Deallocates a message processor an all internal tables
*
* <#Paragraphs Of Explanation#>
*
* @param [in,out] processorPtr Pointer to message processor to de-allocate, will be NULL'd.
*
* Example:
* @code
* <#example#>
* @endcode
*/
void metisMessageProcessor_Destroy(MetisMessageProcessor **processorPtr);
/**
* @function metisMessageProcessor_Receive
* @abstract Process the message, takes ownership of the memory.
* @discussion
* Will call destroy on the memory when done with it, so if the caller wants to
* keep it, make a reference counted copy.
*
* Receive may modify some fields in the message, such as the HopLimit field.
*
* @param <#param1#>
* @return <#return#>
*/
void metisMessageProcessor_Receive(MetisMessageProcessor *procesor, MetisMessage *message);
/**
* @function metisMessageProcessor_AddTap
* @abstract Add a tap to see messages. Only one allowed. caller must remove and free it.
* @discussion
* The tap will see messages on Receive, Drop, or Send, based on the properties of the Tap.
* The caller owns the memory and must remove and free it.
*
* Currently only supports one tap. If one is already set, its replaced.
*
* @param <#param1#>
* @return <#return#>
*/
void metisMessageProcessor_AddTap(MetisMessageProcessor *procesor, MetisTap *tap);
/**
* @function metisMessageProcessor_RemoveTap
* @abstract Removes the tap from the message path.
* @discussion
* <#Discussion#>
*
* @param <#param1#>
* @return <#return#>
*/
void metisMessageProcessor_RemoveTap(MetisMessageProcessor *procesor, const MetisTap *tap);
/**
* Adds or updates a route in the FIB
*
* If the route already exists, it is replaced
*
* @param [in] procesor An allocated message processor
* @param [in] route The route to update
*
* @retval true added or updated
* @retval false An error
*
* Example:
* @code
* <#example#>
* @endcode
*/
bool metisMessageProcessor_AddOrUpdateRoute(MetisMessageProcessor *procesor, CPIRouteEntry *route);
/**
* Removes a route from the FIB
*
* Removes a specific nexthop for a route. If there are no nexthops left after the
* removal, the entire route is deleted from the FIB.
*
* @param [in] procesor An allocated message processor
* @param [in] route The route to remove
*
* @retval true Route completely removed
* @retval false There is still a nexthop for the route
*
* Example:
* @code
* <#example#>
* @endcode
*/
bool metisMessageProcessor_RemoveRoute(MetisMessageProcessor *procesor, CPIRouteEntry *route);
/**
* Removes a given connection id from all FIB entries
*
* Iterates the FIB and removes the given connection ID from every route.
* If a route is left with no nexthops, it stays in the FIB, but packets that match it will
* not be forwarded. IS THIS THE RIGHT BEHAVIOR?
*
* @param [<#in out in,out#>] <#name#> <#description#>
*
* Example:
* @code
* <#example#>
* @endcode
*/
void metisMessageProcessor_RemoveConnectionIdFromRoutes(MetisMessageProcessor *processor, unsigned connectionId);
/**
* Returns a list of all FIB entries
*
* You must destroy the list.
*
* @param [<#in out in,out#>] <#name#> <#description#>
*
* @retval non-null The list of FIB entries
* @retval null An error
*
* Example:
* @code
* <#example#>
* @endcode
*/
MetisFibEntryList *metisMessageProcessor_GetFibEntries(MetisMessageProcessor *processor);
/**
* Adjusts the ContentStore to the given size.
*
* This will destroy and re-create the content store, so any cached objects will be lost.
*
* @param [<#in out in,out#>] <#name#> <#description#>
*
* Example:
* @code
* <#example#>
* @endcode
*/
void metisMessageProcessor_SetContentObjectStoreSize(MetisMessageProcessor *processor, size_t maximumContentStoreSize);
/**
* Return the interface to the currently instantiated ContentStore, if any.
*
* @param [in] processor the `MetisMessageProcessor` from which to return the ContentStoreInterface.
*
* Example:
* @code
* {
* MetisContentStoreInterface *storeImpl = metisMessageProcessor_GetContentObjectStore(processor);
* size_t capacity = metisContentStoreInterface_GetObjectCapacity(storeImpl);
* }
* @endcode
*/
MetisContentStoreInterface *metisMessageProcessor_GetContentObjectStore(const MetisMessageProcessor *processor);
#endif // Metis_metis_MessageProcessor_h
| 35.626506 | 119 | 0.736445 |
d18b9464b62a950e48db393bf617ae0b070a4880 | 2,509 | h | C | Device/Demo_Linux/XWeiTTSManager.h | tencentyun/xiaowei-device-sdk | 09bf2e4a992158a853b650024ce124390274bf5a | [
"MIT"
] | 28 | 2018-05-11T09:10:40.000Z | 2021-11-23T09:16:42.000Z | Device/Demo_Linux/XWeiTTSManager.h | tencentyun/xiaowei-device-sdk | 09bf2e4a992158a853b650024ce124390274bf5a | [
"MIT"
] | 1 | 2019-01-16T11:33:26.000Z | 2019-01-16T11:33:26.000Z | Device/Demo_Linux/XWeiTTSManager.h | tencentyun/xiaowei-device-sdk | 09bf2e4a992158a853b650024ce124390274bf5a | [
"MIT"
] | 6 | 2018-05-11T09:09:06.000Z | 2019-01-04T01:42:58.000Z | /*
* Tencent is pleased to support the open source community by making XiaoweiSDK Demo Codes available.
*
* Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://opensource.org/licenses/MIT
*
* 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 <stdio.h>
#include <list>
#include <map>
#include <string>
#include "TXCAudioType.h"
template <typename T>
class Singleton
{
public:
static T *instance()
{
if (!instance_)
{
instance_ = new T;
}
return instance_;
}
private:
static T *instance_;
};
template <typename T>
T *Singleton<T>::instance_ = NULL;
class XWTTSDataInfo
{
public:
XWTTSDataInfo();
~XWTTSDataInfo();
std::string res_id;
int seq;
bool is_end;
int pcm_sample_rate;
int sample_rate;
int channel;
int format;
std::string data;
std::string ToString();
};
class TTSItem
{
public:
TTSItem();
~TTSItem();
std::list<XWTTSDataInfo *> data;
std::string all_data;
bool is_end;
int pcm_sample_rate;
int sample_rate;
int channel;
int format;
std::string res_id;
bool recoverable;
int cur_seq;
int length;
std::string ToString();
};
// TTS监听
class OnTTSPushListener
{
public:
virtual void OnTTSInfo(TTSItem *ttsInfo) = 0;
virtual void OnTTSData(XWTTSDataInfo *ttsInfo) = 0;
};
class CXWeiTTSManager : public Singleton<CXWeiTTSManager>
{
public:
void write(TXCA_PARAM_AUDIO_DATA *data);
TTSItem *getInfo(std::string resId);
void read(std::string resId, OnTTSPushListener *listener);
void reset(std::string resId);
void release(std::string resId);
void associate(int sessionId, std::string resId);
void release(int sessionId);
private:
friend class Singleton<CXWeiTTSManager>;
CXWeiTTSManager();
~CXWeiTTSManager();
private:
std::map<std::string, TTSItem *> mCache;
std::map<int, std::list<std::string>> associateMap;
std::map<std::string, OnTTSPushListener *> mTTSListeners;
};
| 21.817391 | 102 | 0.680749 |
062083fc765bc49344e55c29c3faab0a1e0c4ddb | 548 | h | C | MMAliBeautyKitDemo/Ali/AliDemo/AliLiveEngineMaker.h | cosmos33/MMBeautyKitDemo-iOS | 739627885c4d6f843ee408cd068d31cc9455b5dd | [
"MIT"
] | 2 | 2020-10-23T01:14:06.000Z | 2022-01-05T06:38:21.000Z | MMAliBeautyKitDemo/Ali/AliDemo/AliLiveEngineMaker.h | cosmos33/MMBeautyKitDemo-iOS | 739627885c4d6f843ee408cd068d31cc9455b5dd | [
"MIT"
] | null | null | null | MMAliBeautyKitDemo/Ali/AliDemo/AliLiveEngineMaker.h | cosmos33/MMBeautyKitDemo-iOS | 739627885c4d6f843ee408cd068d31cc9455b5dd | [
"MIT"
] | 4 | 2019-12-25T04:30:17.000Z | 2022-01-05T10:01:46.000Z | //
// AliLiveEngineFactory.h
// AliLiveSdk-Demo
//
// Created by ZhouGuixin on 2020/8/4.
// Copyright © 2020 alilive. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AliLiveSdk/AliLiveSdk.h>
NS_ASSUME_NONNULL_BEGIN
@interface AliLiveEngineMaker : NSObject
+ (AliLiveEngine *)createEngine:(id<AliLiveRtsDelegate, AliLivePushInfoStatusDelegate>)delegate;
+ (AliLiveEngine *)createEngine:(nullable AliLiveConfig *)config delegate:(id<AliLiveRtsDelegate, AliLivePushInfoStatusDelegate>)delegate;
@end
NS_ASSUME_NONNULL_END
| 24.909091 | 138 | 0.791971 |
062fd5618d3af66e673a9d759ee97676c15522ee | 664 | h | C | Frameworks/AddressBookUI.framework/ABPersonLinkedInfo.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 36 | 2016-04-20T04:19:04.000Z | 2018-10-08T04:12:25.000Z | Frameworks/AddressBookUI.framework/ABPersonLinkedInfo.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | null | null | null | Frameworks/AddressBookUI.framework/ABPersonLinkedInfo.h | shaojiankui/iOS10-Runtime-Headers | 6b0d842bed0c52c2a7c1464087b3081af7e10c43 | [
"MIT"
] | 10 | 2016-06-16T02:40:44.000Z | 2019-01-15T03:31:45.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI
*/
@interface ABPersonLinkedInfo : NSObject {
NSString * _name;
ABUIPerson * _person;
NSString * _type;
bool _unified;
}
@property (retain) NSString *name;
@property (retain) ABUIPerson *person;
@property (retain) NSString *type;
@property (getter=isUnified) bool unified;
- (void)dealloc;
- (id)description;
- (unsigned long long)hash;
- (bool)isEqual:(id)arg1;
- (bool)isUnified;
- (id)name;
- (id)person;
- (void)setName:(id)arg1;
- (void)setPerson:(id)arg1;
- (void)setType:(id)arg1;
- (void)setUnified:(bool)arg1;
- (id)type;
@end
| 21.419355 | 74 | 0.701807 |
947a7319c3f9a31f4483ea5ee7367e93cada2298 | 3,474 | h | C | vcgapps/OGF/basic/debug/assert.h | mattjr/structured | 0cb4635af7602f2a243a9b739e5ed757424ab2a7 | [
"Apache-2.0"
] | 14 | 2015-01-11T02:53:04.000Z | 2021-11-25T17:31:22.000Z | vcgapps/OGF/basic/debug/assert.h | skair39/structured | 0cb4635af7602f2a243a9b739e5ed757424ab2a7 | [
"Apache-2.0"
] | null | null | null | vcgapps/OGF/basic/debug/assert.h | skair39/structured | 0cb4635af7602f2a243a9b739e5ed757424ab2a7 | [
"Apache-2.0"
] | 14 | 2015-07-21T04:47:52.000Z | 2020-03-12T12:31:25.000Z | /*
* OGF/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000 Bruno Levy
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* If you modify this software, you should include a notice giving the
* name of the person performing the modification, the date of modification,
* and the reason for such modification.
*
* Contact: Bruno Levy
*
* levy@loria.fr
*
* ISA Project
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239
* 54506 VANDOEUVRE LES NANCY CEDEX
* FRANCE
*
* Note that the GNU General Public License does not permit incorporating
* the Software into proprietary programs.
*/
#ifndef __OGF_BASIC_DEBUG_ASSERT__
#define __OGF_BASIC_DEBUG_ASSERT__
#include <OGF/basic/common/common.h>
#include <OGF/basic/debug/logger.h>
#include <string>
namespace OGF {
void BASIC_API ogf_assertion_failed(
const std::string& condition_string,
const std::string& file, int line
) ;
void BASIC_API ogf_range_assertion_failed(
double value, double min_value, double max_value,
const std::string& file, int line
) ;
void BASIC_API ogf_should_not_have_reached(
const std::string& file, int line
) ;
}
// Three levels of assert:
// use ogf_assert() and ogf_range_assert() for non-expensive asserts
// use ogf_debug_assert() and ogf_debug_range_assert() for expensive asserts
// use ogf_parano_assert() and ogf_parano_range_assert() for very exensive asserts
#define ogf_assert(x) { \
if(!(x)) { \
::OGF::ogf_assertion_failed(#x,__FILE__, __LINE__) ; \
} \
}
#define ogf_range_assert(x,min_val,max_val) { \
if(((x) < (min_val)) || ((x) > (max_val))) { \
::OGF::ogf_range_assertion_failed(x, min_val, max_val, \
__FILE__, __LINE__ \
) ; \
} \
}
#define ogf_assert_not_reached { \
::OGF::ogf_should_not_have_reached(__FILE__, __LINE__) ; \
}
#ifdef OGF_DEBUG
#define ogf_debug_assert(x) ogf_assert(x)
#define ogf_debug_range_assert(x,min_val,max_val) ogf_range_assert(x,min_val,max_val)
#else
#define ogf_debug_assert(x)
#define ogf_debug_range_assert(x,min_val,max_val)
#endif
#ifdef OGF_PARANOID
#define ogf_parano_assert(x) ogf_assert(x)
#define ogf_parano_range_assert(x,min_val,max_val) ogf_range_assert(x,min_val,max_val)
#else
#define ogf_parano_assert(x)
#define ogf_parano_range_assert(x,min_val,max_val)
#endif
#endif
| 33.728155 | 86 | 0.639033 |
9e4f889440b039d8a91b2c1fe7415fd3674c170b | 14,381 | c | C | Ouroboros/External/OpenSSL/openssl-1.0.0e/crypto/x509v3/v3_cpols.c | jiangzhu1212/oooii | fc00ff81e74adaafd9c98ba7c055f55d95a36e3b | [
"MIT"
] | 6 | 2015-09-22T05:57:29.000Z | 2019-10-10T12:58:41.000Z | Ouroboros/External/OpenSSL/openssl-1.0.0e/crypto/x509v3/v3_cpols.c | jiangzhu1212/oooii | fc00ff81e74adaafd9c98ba7c055f55d95a36e3b | [
"MIT"
] | null | null | null | Ouroboros/External/OpenSSL/openssl-1.0.0e/crypto/x509v3/v3_cpols.c | jiangzhu1212/oooii | fc00ff81e74adaafd9c98ba7c055f55d95a36e3b | [
"MIT"
] | 4 | 2016-04-16T04:54:01.000Z | 2021-04-16T07:04:25.000Z | /* v3_cpols.c */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999-2004 The OpenSSL 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. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT 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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/conf.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/x509v3.h>
#include "pcy_int.h"
/* Certificate policies extension support: this one is a bit complex... */
static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, BIO *out, int indent);
static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *value);
static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, int indent);
static void print_notice(BIO *out, USERNOTICE *notice, int indent);
static POLICYINFO *policy_section(X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *polstrs, int ia5org);
static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *unot, int ia5org);
static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos);
const X509V3_EXT_METHOD v3_cpols = {
NID_certificate_policies, 0,ASN1_ITEM_ref(CERTIFICATEPOLICIES),
0,0,0,0,
0,0,
0,0,
(X509V3_EXT_I2R)i2r_certpol,
(X509V3_EXT_R2I)r2i_certpol,
NULL
};
ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES) =
ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CERTIFICATEPOLICIES, POLICYINFO)
ASN1_ITEM_TEMPLATE_END(CERTIFICATEPOLICIES)
IMPLEMENT_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
ASN1_SEQUENCE(POLICYINFO) = {
ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT),
ASN1_SEQUENCE_OF_OPT(POLICYINFO, qualifiers, POLICYQUALINFO)
} ASN1_SEQUENCE_END(POLICYINFO)
IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO)
ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY);
ASN1_ADB(POLICYQUALINFO) = {
ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING)),
ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE(POLICYQUALINFO, d.usernotice, USERNOTICE))
} ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, &policydefault_tt, NULL);
ASN1_SEQUENCE(POLICYQUALINFO) = {
ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT),
ASN1_ADB_OBJECT(POLICYQUALINFO)
} ASN1_SEQUENCE_END(POLICYQUALINFO)
IMPLEMENT_ASN1_FUNCTIONS(POLICYQUALINFO)
ASN1_SEQUENCE(USERNOTICE) = {
ASN1_OPT(USERNOTICE, noticeref, NOTICEREF),
ASN1_OPT(USERNOTICE, exptext, DISPLAYTEXT)
} ASN1_SEQUENCE_END(USERNOTICE)
IMPLEMENT_ASN1_FUNCTIONS(USERNOTICE)
ASN1_SEQUENCE(NOTICEREF) = {
ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT),
ASN1_SEQUENCE_OF(NOTICEREF, noticenos, ASN1_INTEGER)
} ASN1_SEQUENCE_END(NOTICEREF)
IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF)
static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, char *value)
{
STACK_OF(POLICYINFO) *pols = NULL;
char *pstr;
POLICYINFO *pol;
ASN1_OBJECT *pobj;
STACK_OF(CONF_VALUE) *vals;
CONF_VALUE *cnf;
int i, ia5org;
pols = sk_POLICYINFO_new_null();
if (pols == NULL) {
X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE);
return NULL;
}
vals = X509V3_parse_list(value);
if (vals == NULL) {
X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_X509V3_LIB);
goto err;
}
ia5org = 0;
for(i = 0; i < sk_CONF_VALUE_num(vals); i++) {
cnf = sk_CONF_VALUE_value(vals, i);
if(cnf->value || !cnf->name ) {
X509V3err(X509V3_F_R2I_CERTPOL,X509V3_R_INVALID_POLICY_IDENTIFIER);
X509V3_conf_err(cnf);
goto err;
}
pstr = cnf->name;
if(!strcmp(pstr,"ia5org")) {
ia5org = 1;
continue;
} else if(*pstr == '@') {
STACK_OF(CONF_VALUE) *polsect;
polsect = X509V3_get_section(ctx, pstr + 1);
if(!polsect) {
X509V3err(X509V3_F_R2I_CERTPOL,X509V3_R_INVALID_SECTION);
X509V3_conf_err(cnf);
goto err;
}
pol = policy_section(ctx, polsect, ia5org);
X509V3_section_free(ctx, polsect);
if(!pol) goto err;
} else {
if(!(pobj = OBJ_txt2obj(cnf->name, 0))) {
X509V3err(X509V3_F_R2I_CERTPOL,X509V3_R_INVALID_OBJECT_IDENTIFIER);
X509V3_conf_err(cnf);
goto err;
}
pol = POLICYINFO_new();
pol->policyid = pobj;
}
if (!sk_POLICYINFO_push(pols, pol)){
POLICYINFO_free(pol);
X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE);
goto err;
}
}
sk_CONF_VALUE_pop_free(vals, X509V3_conf_free);
return pols;
err:
sk_CONF_VALUE_pop_free(vals, X509V3_conf_free);
sk_POLICYINFO_pop_free(pols, POLICYINFO_free);
return NULL;
}
static POLICYINFO *policy_section(X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *polstrs, int ia5org)
{
int i;
CONF_VALUE *cnf;
POLICYINFO *pol;
POLICYQUALINFO *qual;
if(!(pol = POLICYINFO_new())) goto merr;
for(i = 0; i < sk_CONF_VALUE_num(polstrs); i++) {
cnf = sk_CONF_VALUE_value(polstrs, i);
if(!strcmp(cnf->name, "policyIdentifier")) {
ASN1_OBJECT *pobj;
if(!(pobj = OBJ_txt2obj(cnf->value, 0))) {
X509V3err(X509V3_F_POLICY_SECTION,X509V3_R_INVALID_OBJECT_IDENTIFIER);
X509V3_conf_err(cnf);
goto err;
}
pol->policyid = pobj;
} else if(!name_cmp(cnf->name, "CPS")) {
if(!pol->qualifiers) pol->qualifiers =
sk_POLICYQUALINFO_new_null();
if(!(qual = POLICYQUALINFO_new())) goto merr;
if(!sk_POLICYQUALINFO_push(pol->qualifiers, qual))
goto merr;
qual->pqualid = OBJ_nid2obj(NID_id_qt_cps);
qual->d.cpsuri = M_ASN1_IA5STRING_new();
if(!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
strlen(cnf->value))) goto merr;
} else if(!name_cmp(cnf->name, "userNotice")) {
STACK_OF(CONF_VALUE) *unot;
if(*cnf->value != '@') {
X509V3err(X509V3_F_POLICY_SECTION,X509V3_R_EXPECTED_A_SECTION_NAME);
X509V3_conf_err(cnf);
goto err;
}
unot = X509V3_get_section(ctx, cnf->value + 1);
if(!unot) {
X509V3err(X509V3_F_POLICY_SECTION,X509V3_R_INVALID_SECTION);
X509V3_conf_err(cnf);
goto err;
}
qual = notice_section(ctx, unot, ia5org);
X509V3_section_free(ctx, unot);
if(!qual) goto err;
if(!pol->qualifiers) pol->qualifiers =
sk_POLICYQUALINFO_new_null();
if(!sk_POLICYQUALINFO_push(pol->qualifiers, qual))
goto merr;
} else {
X509V3err(X509V3_F_POLICY_SECTION,X509V3_R_INVALID_OPTION);
X509V3_conf_err(cnf);
goto err;
}
}
if(!pol->policyid) {
X509V3err(X509V3_F_POLICY_SECTION,X509V3_R_NO_POLICY_IDENTIFIER);
goto err;
}
return pol;
merr:
X509V3err(X509V3_F_POLICY_SECTION,ERR_R_MALLOC_FAILURE);
err:
POLICYINFO_free(pol);
return NULL;
}
static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
STACK_OF(CONF_VALUE) *unot, int ia5org)
{
int i, ret;
CONF_VALUE *cnf;
USERNOTICE *not;
POLICYQUALINFO *qual;
if(!(qual = POLICYQUALINFO_new())) goto merr;
qual->pqualid = OBJ_nid2obj(NID_id_qt_unotice);
if(!(not = USERNOTICE_new())) goto merr;
qual->d.usernotice = not;
for(i = 0; i < sk_CONF_VALUE_num(unot); i++) {
cnf = sk_CONF_VALUE_value(unot, i);
if(!strcmp(cnf->name, "explicitText")) {
not->exptext = M_ASN1_VISIBLESTRING_new();
if(!ASN1_STRING_set(not->exptext, cnf->value,
strlen(cnf->value))) goto merr;
} else if(!strcmp(cnf->name, "organization")) {
NOTICEREF *nref;
if(!not->noticeref) {
if(!(nref = NOTICEREF_new())) goto merr;
not->noticeref = nref;
} else nref = not->noticeref;
if(ia5org) nref->organization->type = V_ASN1_IA5STRING;
else nref->organization->type = V_ASN1_VISIBLESTRING;
if(!ASN1_STRING_set(nref->organization, cnf->value,
strlen(cnf->value))) goto merr;
} else if(!strcmp(cnf->name, "noticeNumbers")) {
NOTICEREF *nref;
STACK_OF(CONF_VALUE) *nos;
if(!not->noticeref) {
if(!(nref = NOTICEREF_new())) goto merr;
not->noticeref = nref;
} else nref = not->noticeref;
nos = X509V3_parse_list(cnf->value);
if(!nos || !sk_CONF_VALUE_num(nos)) {
X509V3err(X509V3_F_NOTICE_SECTION,X509V3_R_INVALID_NUMBERS);
X509V3_conf_err(cnf);
goto err;
}
ret = nref_nos(nref->noticenos, nos);
sk_CONF_VALUE_pop_free(nos, X509V3_conf_free);
if (!ret)
goto err;
} else {
X509V3err(X509V3_F_NOTICE_SECTION,X509V3_R_INVALID_OPTION);
X509V3_conf_err(cnf);
goto err;
}
}
if(not->noticeref &&
(!not->noticeref->noticenos || !not->noticeref->organization)) {
X509V3err(X509V3_F_NOTICE_SECTION,X509V3_R_NEED_ORGANIZATION_AND_NUMBERS);
goto err;
}
return qual;
merr:
X509V3err(X509V3_F_NOTICE_SECTION,ERR_R_MALLOC_FAILURE);
err:
POLICYQUALINFO_free(qual);
return NULL;
}
static int nref_nos(STACK_OF(ASN1_INTEGER) *nnums, STACK_OF(CONF_VALUE) *nos)
{
CONF_VALUE *cnf;
ASN1_INTEGER *aint;
int i;
for(i = 0; i < sk_CONF_VALUE_num(nos); i++) {
cnf = sk_CONF_VALUE_value(nos, i);
if(!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) {
X509V3err(X509V3_F_NREF_NOS,X509V3_R_INVALID_NUMBER);
goto err;
}
if(!sk_ASN1_INTEGER_push(nnums, aint)) goto merr;
}
return 1;
merr:
X509V3err(X509V3_F_NREF_NOS,ERR_R_MALLOC_FAILURE);
err:
sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free);
return 0;
}
static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol,
BIO *out, int indent)
{
int i;
POLICYINFO *pinfo;
/* First print out the policy OIDs */
for(i = 0; i < sk_POLICYINFO_num(pol); i++) {
pinfo = sk_POLICYINFO_value(pol, i);
BIO_printf(out, "%*sPolicy: ", indent, "");
i2a_ASN1_OBJECT(out, pinfo->policyid);
BIO_puts(out, "\n");
if(pinfo->qualifiers)
print_qualifiers(out, pinfo->qualifiers, indent + 2);
}
return 1;
}
static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals,
int indent)
{
POLICYQUALINFO *qualinfo;
int i;
for(i = 0; i < sk_POLICYQUALINFO_num(quals); i++) {
qualinfo = sk_POLICYQUALINFO_value(quals, i);
switch(OBJ_obj2nid(qualinfo->pqualid))
{
case NID_id_qt_cps:
BIO_printf(out, "%*sCPS: %s\n", indent, "",
qualinfo->d.cpsuri->data);
break;
case NID_id_qt_unotice:
BIO_printf(out, "%*sUser Notice:\n", indent, "");
print_notice(out, qualinfo->d.usernotice, indent + 2);
break;
default:
BIO_printf(out, "%*sUnknown Qualifier: ",
indent + 2, "");
i2a_ASN1_OBJECT(out, qualinfo->pqualid);
BIO_puts(out, "\n");
break;
}
}
}
static void print_notice(BIO *out, USERNOTICE *notice, int indent)
{
int i;
if(notice->noticeref) {
NOTICEREF *ref;
ref = notice->noticeref;
BIO_printf(out, "%*sOrganization: %s\n", indent, "",
ref->organization->data);
BIO_printf(out, "%*sNumber%s: ", indent, "",
sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : "");
for(i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) {
ASN1_INTEGER *num;
char *tmp;
num = sk_ASN1_INTEGER_value(ref->noticenos, i);
if(i) BIO_puts(out, ", ");
tmp = i2s_ASN1_INTEGER(NULL, num);
BIO_puts(out, tmp);
OPENSSL_free(tmp);
}
BIO_puts(out, "\n");
}
if(notice->exptext)
BIO_printf(out, "%*sExplicit Text: %s\n", indent, "",
notice->exptext->data);
}
void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent)
{
const X509_POLICY_DATA *dat = node->data;
BIO_printf(out, "%*sPolicy: ", indent, "");
i2a_ASN1_OBJECT(out, dat->valid_policy);
BIO_puts(out, "\n");
BIO_printf(out, "%*s%s\n", indent + 2, "",
node_data_critical(dat) ? "Critical" : "Non Critical");
if (dat->qualifier_set)
print_qualifiers(out, dat->qualifier_set, indent + 2);
else
BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, "");
}
IMPLEMENT_STACK_OF(X509_POLICY_NODE)
IMPLEMENT_STACK_OF(X509_POLICY_DATA)
| 31.399563 | 100 | 0.686948 |
7fadaae1cf07a539c26e47020ef24dbdae72a8ab | 403 | h | C | InstagramViewer/InstagramViewer/Classes/View/LoginUIView.h | mendesbarreto/IOS | e215e528b94ccd4a2bc3de6c1ade814fa4f76b21 | [
"MIT"
] | null | null | null | InstagramViewer/InstagramViewer/Classes/View/LoginUIView.h | mendesbarreto/IOS | e215e528b94ccd4a2bc3de6c1ade814fa4f76b21 | [
"MIT"
] | null | null | null | InstagramViewer/InstagramViewer/Classes/View/LoginUIView.h | mendesbarreto/IOS | e215e528b94ccd4a2bc3de6c1ade814fa4f76b21 | [
"MIT"
] | null | null | null | //
// LoginUIView.h
// InstagramViewer
//
// Created by Douglas Barreto on 12/22/15.
// Copyright © 2015 Douglas Mendes. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LoginUIView : UIView
@property (weak, nonatomic)IBOutlet UITextField *usernameField;
@property (weak, nonatomic) IBOutlet UITextField *passwordField;
@property (weak, nonatomic) IBOutlet UIButton *signInButton;
@end
| 23.705882 | 64 | 0.74938 |
3685f11cef83a19d2173823871f4df40d05b0aac | 3,001 | h | C | shotgun/lib/grammar_internal.h | chad/rubinius | d01494a8f5843f3479b4f4164d920c6299c01228 | [
"BSD-3-Clause"
] | 3 | 2015-12-24T09:15:32.000Z | 2021-05-14T05:23:15.000Z | shotgun/lib/grammar_internal.h | reinh/rubinius | 07a2efa3dafdb0d75592d9762e234dd5b22fdf9b | [
"BSD-3-Clause"
] | null | null | null | shotgun/lib/grammar_internal.h | reinh/rubinius | 07a2efa3dafdb0d75592d9762e234dd5b22fdf9b | [
"BSD-3-Clause"
] | 1 | 2015-12-03T11:56:16.000Z | 2015-12-03T11:56:16.000Z | #ifndef RBS_GRAMMAR_INTERNAL_H
#define RBS_GRAMMAR_INTERNAL_H
#include <stdbool.h>
#include "quark.h"
#include "bstrlib.h"
#include "shotgun/lib/shotgun.h"
#define ID quark
#define VALUE OBJECT
#include "shotgun/lib/var_table.h"
enum lex_state {
EXPR_BEG, /* ignore newline, +/- is a sign. */
EXPR_END, /* newline significant, +/- is a operator. */
EXPR_ARG, /* newline significant, +/- is a operator. */
EXPR_CMDARG, /* newline significant, +/- is a operator. */
EXPR_ENDARG, /* newline significant, +/- is a operator. */
EXPR_MID, /* newline significant, +/- is a operator. */
EXPR_FNAME, /* ignore newline, no reserved words. */
EXPR_DOT, /* right after `.' or `::', no reserved words. */
EXPR_CLASS, /* immediate after `class', no here document. */
};
#ifdef HAVE_LONG_LONG
typedef unsigned LONG_LONG stack_type;
#else
typedef unsigned long stack_type;
#endif
#include "shotgun/lib/grammar_node.h"
typedef struct rb_parse_state {
int end_seen;
int debug_lines;
int heredoc_end;
int command_start;
NODE *lex_strterm;
int class_nest;
int in_single;
int in_def;
int compile_for_eval;
ID cur_mid;
char *token_buffer;
int tokidx;
int toksiz;
int emit_warnings;
/* Mirror'ing the 1.8 parser, There are 2 input methods,
from IO and directly from a string. */
/* this function reads a line from lex_io and stores it in
* line_buffer.
*/
bool (*lex_gets)();
bstring line_buffer;
/* If this is set, we use the io method. */
FILE *lex_io;
/* Otherwise, we use this. */
bstring lex_string;
bstring lex_lastline;
char *lex_pbeg;
char *lex_p;
char *lex_pend;
int lex_str_used;
enum lex_state lex_state;
int in_defined;
stack_type cond_stack;
stack_type cmdarg_stack;
void *lval; /* the parser's yylval */
ptr_array comments;
int column;
NODE *top;
ID *locals;
var_table variables;
var_table block_vars;
int ternary_colon;
void **memory_pools;
int pool_size, current_pool;
char *memory_cur;
char *memory_last_addr;
int memory_size;
STATE;
OBJECT error;
} rb_parse_state;
#define PARSE_STATE ((rb_parse_state*)parse_state)
#define PARSE_VAR(var) (PARSE_STATE->var)
#define ruby_debug_lines PARSE_VAR(debug_lines)
#define heredoc_end PARSE_VAR(heredoc_end)
#define command_start PARSE_VAR(command_start)
#define lex_strterm PARSE_VAR(lex_strterm)
#define class_nest PARSE_VAR(class_nest)
#define in_single PARSE_VAR(in_single)
#define in_def PARSE_VAR(in_def)
#define compile_for_eval PARSE_VAR(compile_for_eval)
#define cur_mid PARSE_VAR(cur_mid)
#define tokenbuf PARSE_VAR(token_buffer)
#define tokidx PARSE_VAR(tokidx)
#define toksiz PARSE_VAR(toksiz)
#endif /* __GRAMMER_INTERNAL_H__ */
| 26.095652 | 81 | 0.661113 |
2cba6fa56a59ade214057bbf3e18cae02065f957 | 5,523 | h | C | System/Library/PrivateFrameworks/DataAccess.framework/DALocalDBGateKeeper.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | 2 | 2021-04-15T10:50:21.000Z | 2021-08-19T19:00:09.000Z | System/Library/PrivateFrameworks/DataAccess.framework/DALocalDBGateKeeper.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/DataAccess.framework/DALocalDBGateKeeper.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 14, 2021 at 2:25:51 PM Mountain Standard Time
* Operating System: Version 14.4 (Build 18K802)
* Image Source: /System/Library/PrivateFrameworks/DataAccess.framework/DataAccess
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
@protocol DADataclassLockWatcher;
@class NSMutableArray, NSMutableSet, NSString;
@interface DALocalDBGateKeeper : NSObject {
BOOL _claimedOwnershipOfContacts;
BOOL _claimedOwnershipOfEvents;
BOOL _claimedOwnershipOfNotes;
id<DADataclassLockWatcher> _contactsLockHolder;
NSMutableArray* _contactsWaiters;
NSMutableSet* _waiterIDsExpectingContactsLock;
id<DADataclassLockWatcher> _eventsLockHolder;
NSMutableArray* _eventsWaiters;
NSMutableSet* _waiterIDsExpectingEventsLock;
id<DADataclassLockWatcher> _notesLockHolder;
NSMutableArray* _notesWaiters;
NSMutableSet* _waiterIDsExpectingNotesLock;
NSString* _unitTestHackRunLoopMode;
}
@property (assign,nonatomic) BOOL claimedOwnershipOfContacts; //@synthesize claimedOwnershipOfContacts=_claimedOwnershipOfContacts - In the implementation block
@property (nonatomic,retain) id<DADataclassLockWatcher> contactsLockHolder; //@synthesize contactsLockHolder=_contactsLockHolder - In the implementation block
@property (nonatomic,retain) NSMutableArray * contactsWaiters; //@synthesize contactsWaiters=_contactsWaiters - In the implementation block
@property (nonatomic,retain) NSMutableSet * waiterIDsExpectingContactsLock; //@synthesize waiterIDsExpectingContactsLock=_waiterIDsExpectingContactsLock - In the implementation block
@property (assign,nonatomic) BOOL claimedOwnershipOfEvents; //@synthesize claimedOwnershipOfEvents=_claimedOwnershipOfEvents - In the implementation block
@property (nonatomic,retain) id<DADataclassLockWatcher> eventsLockHolder; //@synthesize eventsLockHolder=_eventsLockHolder - In the implementation block
@property (nonatomic,retain) NSMutableArray * eventsWaiters; //@synthesize eventsWaiters=_eventsWaiters - In the implementation block
@property (nonatomic,retain) NSMutableSet * waiterIDsExpectingEventsLock; //@synthesize waiterIDsExpectingEventsLock=_waiterIDsExpectingEventsLock - In the implementation block
@property (assign,nonatomic) BOOL claimedOwnershipOfNotes; //@synthesize claimedOwnershipOfNotes=_claimedOwnershipOfNotes - In the implementation block
@property (nonatomic,retain) id<DADataclassLockWatcher> notesLockHolder; //@synthesize notesLockHolder=_notesLockHolder - In the implementation block
@property (nonatomic,retain) NSMutableArray * notesWaiters; //@synthesize notesWaiters=_notesWaiters - In the implementation block
@property (nonatomic,retain) NSMutableSet * waiterIDsExpectingNotesLock; //@synthesize waiterIDsExpectingNotesLock=_waiterIDsExpectingNotesLock - In the implementation block
@property (nonatomic,retain) NSString * unitTestHackRunLoopMode; //@synthesize unitTestHackRunLoopMode=_unitTestHackRunLoopMode - In the implementation block
+(id)sharedGateKeeper;
-(id)init;
-(void)dealloc;
-(id)stateString;
-(void)claimedOwnershipOfDataclasses:(long long)arg1 ;
-(void)setEventsWaiters:(NSMutableArray *)arg1 ;
-(void)setWaiterIDsExpectingEventsLock:(NSMutableSet *)arg1 ;
-(void)setContactsWaiters:(NSMutableArray *)arg1 ;
-(void)setNotesWaiters:(NSMutableArray *)arg1 ;
-(void)setWaiterIDsExpectingContactsLock:(NSMutableSet *)arg1 ;
-(void)setWaiterIDsExpectingNotesLock:(NSMutableSet *)arg1 ;
-(void)setContactsLockHolder:(id<DADataclassLockWatcher>)arg1 ;
-(void)setEventsLockHolder:(id<DADataclassLockWatcher>)arg1 ;
-(void)setNotesLockHolder:(id<DADataclassLockWatcher>)arg1 ;
-(BOOL)_canWakenWaiter:(id)arg1 ;
-(void)_abortWaiterForWrappers:(id)arg1 ;
-(void)_setUnitTestHackRunLoopMode:(id)arg1 ;
-(void)_notifyWaitersForDataclasses:(id)arg1 ;
-(void)_registerWaiter:(id)arg1 forDataclassLocks:(long long)arg2 preempt:(BOOL)arg3 completionHandler:(/*^block*/id)arg4 ;
-(void)relinquishLocksForWaiter:(id)arg1 dataclasses:(long long)arg2 moreComing:(BOOL)arg3 ;
-(void)_sendAllClearNotifications;
-(void)registerPreemptiveWaiter:(id)arg1 forDataclassLocks:(long long)arg2 completionHandler:(/*^block*/id)arg3 ;
-(void)registerWaiter:(id)arg1 forDataclassLocks:(long long)arg2 completionHandler:(/*^block*/id)arg3 ;
-(void)unregisterWaiterForDataclassLocks:(id)arg1 ;
-(BOOL)claimedOwnershipOfContacts;
-(void)setClaimedOwnershipOfContacts:(BOOL)arg1 ;
-(id<DADataclassLockWatcher>)contactsLockHolder;
-(NSMutableArray *)contactsWaiters;
-(NSMutableSet *)waiterIDsExpectingContactsLock;
-(BOOL)claimedOwnershipOfEvents;
-(void)setClaimedOwnershipOfEvents:(BOOL)arg1 ;
-(id<DADataclassLockWatcher>)eventsLockHolder;
-(NSMutableArray *)eventsWaiters;
-(NSMutableSet *)waiterIDsExpectingEventsLock;
-(BOOL)claimedOwnershipOfNotes;
-(void)setClaimedOwnershipOfNotes:(BOOL)arg1 ;
-(id<DADataclassLockWatcher>)notesLockHolder;
-(NSMutableArray *)notesWaiters;
-(NSMutableSet *)waiterIDsExpectingNotesLock;
-(NSString *)unitTestHackRunLoopMode;
-(void)setUnitTestHackRunLoopMode:(NSString *)arg1 ;
@end
| 63.482759 | 195 | 0.76788 |
d0e0d0a30d2287b480199d2d709194c6fa09e539 | 1,050 | h | C | OpenCL/inc_amp.h | ekmixon/hashcat | 14f78d9910a103c996a0d8af6f969bb0640b3d6c | [
"MIT"
] | null | null | null | OpenCL/inc_amp.h | ekmixon/hashcat | 14f78d9910a103c996a0d8af6f969bb0640b3d6c | [
"MIT"
] | null | null | null | OpenCL/inc_amp.h | ekmixon/hashcat | 14f78d9910a103c996a0d8af6f969bb0640b3d6c | [
"MIT"
] | null | null | null | /**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _INC_AMP_H
#define _INC_AMP_H
#if defined IS_METAL
#define KERN_ATTR_AMP \
GLOBAL_AS pw_t *pws, \
GLOBAL_AS pw_t *pws_amp, \
CONSTANT_AS const kernel_rule_t *rules_buf, \
GLOBAL_AS const pw_t *combs_buf, \
GLOBAL_AS const bf_t *bfs_buf, \
CONSTANT_AS const u32 &combs_mode, \
CONSTANT_AS const u64 &gid_max, \
uint hc_gid [[ thread_position_in_grid ]]
#else // CUDA, HIP, OpenCL
#define KERN_ATTR_AMP \
GLOBAL_AS pw_t *pws, \
GLOBAL_AS pw_t *pws_amp, \
CONSTANT_AS const kernel_rule_t *rules_buf, \
GLOBAL_AS const pw_t *combs_buf, \
GLOBAL_AS const bf_t *bfs_buf, \
const u32 combs_mode, \
const u64 gid_max
#endif // IS_METAL
#endif // _INC_AMP_H
| 30 | 71 | 0.512381 |
c57f8301303dff2b2639afa020767c8292d91508 | 163,171 | h | C | physx/source/physxmetadata/core/include/PxAutoGeneratedMetaDataObjects.h | yangfengzzz/PhysX | aed9c3035955d4ad90e5741f7d1dcfb5c178d44f | [
"BSD-3-Clause"
] | null | null | null | physx/source/physxmetadata/core/include/PxAutoGeneratedMetaDataObjects.h | yangfengzzz/PhysX | aed9c3035955d4ad90e5741f7d1dcfb5c178d44f | [
"BSD-3-Clause"
] | null | null | null | physx/source/physxmetadata/core/include/PxAutoGeneratedMetaDataObjects.h | yangfengzzz/PhysX | aed9c3035955d4ad90e5741f7d1dcfb5c178d44f | [
"BSD-3-Clause"
] | null | null | null | //
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of NVIDIA CORPORATION nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''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.
//
// Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
// This code is auto-generated by the PhysX Clang metadata generator. Do not edit or be
// prepared for your edits to be quietly ignored next time the clang metadata generator is
// run. You can find the most recent version of clang metadata generator by contacting
// Chris Nuernberger <chrisn@nvidia.com> or Dilip or Adam.
// The source code for the generate was at one time checked into:
// physx/PhysXMetaDataGenerator/llvm/tools/clang/lib/Frontend/PhysXMetaDataAction.cpp
#define THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
#define PX_PROPERTY_INFO_NAME PxPropertyInfoName
static PxU32ToName g_physx__PxShapeFlag__EnumConversion[] = {
{"eSIMULATION_SHAPE", static_cast<PxU32>(physx::PxShapeFlag::eSIMULATION_SHAPE)},
{"eSCENE_QUERY_SHAPE", static_cast<PxU32>(physx::PxShapeFlag::eSCENE_QUERY_SHAPE)},
{"eTRIGGER_SHAPE", static_cast<PxU32>(physx::PxShapeFlag::eTRIGGER_SHAPE)},
{"eVISUALIZATION", static_cast<PxU32>(physx::PxShapeFlag::eVISUALIZATION)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxShapeFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxShapeFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxPhysics;
struct PxPhysicsGeneratedValues {
PxTolerancesScale TolerancesScale;
PX_PHYSX_CORE_API PxPhysicsGeneratedValues(const PxPhysics *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxPhysics, TolerancesScale, PxPhysicsGeneratedValues)
struct PxPhysicsGeneratedInfo
{
static const char *getClassName() { return "PxPhysics"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_TolerancesScale, PxPhysics, const PxTolerancesScale>
TolerancesScale;
PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_TriangleMeshes, PxPhysics, PxTriangleMesh *,
PxInputStream &>
TriangleMeshes;
PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_HeightFields, PxPhysics, PxHeightField *,
PxInputStream &>
HeightFields;
PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_ConvexMeshes, PxPhysics, PxConvexMesh *,
PxInputStream &>
ConvexMeshes;
PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_BVHStructures, PxPhysics, PxBVHStructure *,
PxInputStream &>
BVHStructures;
PxFactoryCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_Scenes, PxPhysics, PxScene *, const PxSceneDesc &>
Scenes;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_Shapes, PxPhysics, PxShape *> Shapes;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPhysics_Materials, PxPhysics, PxMaterial *> Materials;
PX_PHYSX_CORE_API PxPhysicsGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxPhysics *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 8; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(TolerancesScale, inStartIndex + 0);
;
inOperator(TriangleMeshes, inStartIndex + 1);
;
inOperator(HeightFields, inStartIndex + 2);
;
inOperator(ConvexMeshes, inStartIndex + 3);
;
inOperator(BVHStructures, inStartIndex + 4);
;
inOperator(Scenes, inStartIndex + 5);
;
inOperator(Shapes, inStartIndex + 6);
;
inOperator(Materials, inStartIndex + 7);
;
return 8 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxPhysics> {
PxPhysicsGeneratedInfo Info;
const PxPhysicsGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxMaterialFlag__EnumConversion[] = {
{"eDISABLE_FRICTION", static_cast<PxU32>(physx::PxMaterialFlag::eDISABLE_FRICTION)},
{"eDISABLE_STRONG_FRICTION", static_cast<PxU32>(physx::PxMaterialFlag::eDISABLE_STRONG_FRICTION)},
{"eIMPROVED_PATCH_FRICTION", static_cast<PxU32>(physx::PxMaterialFlag::eIMPROVED_PATCH_FRICTION)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxMaterialFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxMaterialFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxCombineMode__EnumConversion[] = {
{"eAVERAGE", static_cast<PxU32>(physx::PxCombineMode::eAVERAGE)},
{"eMIN", static_cast<PxU32>(physx::PxCombineMode::eMIN)},
{"eMULTIPLY", static_cast<PxU32>(physx::PxCombineMode::eMULTIPLY)},
{"eMAX", static_cast<PxU32>(physx::PxCombineMode::eMAX)},
{"eN_VALUES", static_cast<PxU32>(physx::PxCombineMode::eN_VALUES)},
{"ePAD_32", static_cast<PxU32>(physx::PxCombineMode::ePAD_32)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxCombineMode::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxCombineMode__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxMaterial;
struct PxMaterialGeneratedValues {
PxU32 ReferenceCount;
PxReal DynamicFriction;
PxReal StaticFriction;
PxReal Restitution;
PxMaterialFlags Flags;
PxCombineMode::Enum FrictionCombineMode;
PxCombineMode::Enum RestitutionCombineMode;
const char *ConcreteTypeName;
void *UserData;
PX_PHYSX_CORE_API PxMaterialGeneratedValues(const PxMaterial *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, ReferenceCount, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, DynamicFriction, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, StaticFriction, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, Restitution, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, Flags, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, FrictionCombineMode, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, RestitutionCombineMode, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, ConcreteTypeName, PxMaterialGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMaterial, UserData, PxMaterialGeneratedValues)
struct PxMaterialGeneratedInfo
{
static const char *getClassName() { return "PxMaterial"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_ReferenceCount, PxMaterial, PxU32> ReferenceCount;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_DynamicFriction, PxMaterial, PxReal, PxReal> DynamicFriction;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_StaticFriction, PxMaterial, PxReal, PxReal> StaticFriction;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_Restitution, PxMaterial, PxReal, PxReal> Restitution;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_Flags, PxMaterial, PxMaterialFlags, PxMaterialFlags> Flags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_FrictionCombineMode, PxMaterial, PxCombineMode::Enum,
PxCombineMode::Enum>
FrictionCombineMode;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_RestitutionCombineMode, PxMaterial, PxCombineMode::Enum,
PxCombineMode::Enum>
RestitutionCombineMode;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_ConcreteTypeName, PxMaterial, const char *> ConcreteTypeName;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMaterial_UserData, PxMaterial, void *, void *> UserData;
PX_PHYSX_CORE_API PxMaterialGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxMaterial *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 9; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ReferenceCount, inStartIndex + 0);
;
inOperator(DynamicFriction, inStartIndex + 1);
;
inOperator(StaticFriction, inStartIndex + 2);
;
inOperator(Restitution, inStartIndex + 3);
;
inOperator(Flags, inStartIndex + 4);
;
inOperator(FrictionCombineMode, inStartIndex + 5);
;
inOperator(RestitutionCombineMode, inStartIndex + 6);
;
inOperator(ConcreteTypeName, inStartIndex + 7);
;
inOperator(UserData, inStartIndex + 8);
;
return 9 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxMaterial> {
PxMaterialGeneratedInfo Info;
const PxMaterialGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxActorType__EnumConversion[] = {
{"eRIGID_STATIC", static_cast<PxU32>(physx::PxActorType::eRIGID_STATIC)},
{"eRIGID_DYNAMIC", static_cast<PxU32>(physx::PxActorType::eRIGID_DYNAMIC)},
{"eARTICULATION_LINK", static_cast<PxU32>(physx::PxActorType::eARTICULATION_LINK)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxActorType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxActorType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxActorFlag__EnumConversion[] = {
{"eVISUALIZATION", static_cast<PxU32>(physx::PxActorFlag::eVISUALIZATION)},
{"eDISABLE_GRAVITY", static_cast<PxU32>(physx::PxActorFlag::eDISABLE_GRAVITY)},
{"eSEND_SLEEP_NOTIFIES", static_cast<PxU32>(physx::PxActorFlag::eSEND_SLEEP_NOTIFIES)},
{"eDISABLE_SIMULATION", static_cast<PxU32>(physx::PxActorFlag::eDISABLE_SIMULATION)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxActorFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxActorFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxActor;
struct PxActorGeneratedValues {
PxScene *Scene;
const char *Name;
PxActorFlags ActorFlags;
PxDominanceGroup DominanceGroup;
PxClientID OwnerClient;
PxAggregate *Aggregate;
void *UserData;
PX_PHYSX_CORE_API PxActorGeneratedValues(const PxActor *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, Scene, PxActorGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, Name, PxActorGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, ActorFlags, PxActorGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, DominanceGroup, PxActorGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, OwnerClient, PxActorGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, Aggregate, PxActorGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxActor, UserData, PxActorGeneratedValues)
struct PxActorGeneratedInfo
{
static const char *getClassName() { return "PxActor"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_Scene, PxActor, PxScene *> Scene;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_Name, PxActor, const char *, const char *> Name;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_ActorFlags, PxActor, PxActorFlags, PxActorFlags> ActorFlags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_DominanceGroup, PxActor, PxDominanceGroup, PxDominanceGroup>
DominanceGroup;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_OwnerClient, PxActor, PxClientID, PxClientID> OwnerClient;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_Aggregate, PxActor, PxAggregate *> Aggregate;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxActor_UserData, PxActor, void *, void *> UserData;
PX_PHYSX_CORE_API PxActorGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxActor *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 7; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Scene, inStartIndex + 0);
;
inOperator(Name, inStartIndex + 1);
;
inOperator(ActorFlags, inStartIndex + 2);
;
inOperator(DominanceGroup, inStartIndex + 3);
;
inOperator(OwnerClient, inStartIndex + 4);
;
inOperator(Aggregate, inStartIndex + 5);
;
inOperator(UserData, inStartIndex + 6);
;
return 7 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxActor> {
PxActorGeneratedInfo Info;
const PxActorGeneratedInfo *getInfo() { return &Info; }
};
class PxRigidActor;
struct PxRigidActorGeneratedValues : PxActorGeneratedValues {
PxTransform GlobalPose;
PX_PHYSX_CORE_API PxRigidActorGeneratedValues(const PxRigidActor *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidActor, GlobalPose, PxRigidActorGeneratedValues)
struct PxRigidActorGeneratedInfo : PxActorGeneratedInfo {
static const char *getClassName() { return "PxRigidActor"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidActor_GlobalPose, PxRigidActor, const PxTransform &, PxTransform>
GlobalPose;
PxRigidActorShapeCollection Shapes;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidActor_Constraints, PxRigidActor, PxConstraint *>
Constraints;
PX_PHYSX_CORE_API PxRigidActorGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxRigidActor *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxActorGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxActorGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxActorGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 3; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxActorGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(GlobalPose, inStartIndex + 0);
;
inOperator(Shapes, inStartIndex + 1);
;
inOperator(Constraints, inStartIndex + 2);
;
return 3 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxRigidActor> {
PxRigidActorGeneratedInfo Info;
const PxRigidActorGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxForceMode__EnumConversion[] = {
{"eFORCE", static_cast<PxU32>(physx::PxForceMode::eFORCE)},
{"eIMPULSE", static_cast<PxU32>(physx::PxForceMode::eIMPULSE)},
{"eVELOCITY_CHANGE", static_cast<PxU32>(physx::PxForceMode::eVELOCITY_CHANGE)},
{"eACCELERATION", static_cast<PxU32>(physx::PxForceMode::eACCELERATION)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxForceMode::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxForceMode__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxRigidBodyFlag__EnumConversion[] = {
{"eKINEMATIC", static_cast<PxU32>(physx::PxRigidBodyFlag::eKINEMATIC)},
{"eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES",
static_cast<PxU32>(physx::PxRigidBodyFlag::eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES)},
{"eENABLE_CCD", static_cast<PxU32>(physx::PxRigidBodyFlag::eENABLE_CCD)},
{"eENABLE_CCD_FRICTION", static_cast<PxU32>(physx::PxRigidBodyFlag::eENABLE_CCD_FRICTION)},
{"eENABLE_POSE_INTEGRATION_PREVIEW", static_cast<PxU32>(physx::PxRigidBodyFlag::eENABLE_POSE_INTEGRATION_PREVIEW)},
{"eENABLE_SPECULATIVE_CCD", static_cast<PxU32>(physx::PxRigidBodyFlag::eENABLE_SPECULATIVE_CCD)},
{"eENABLE_CCD_MAX_CONTACT_IMPULSE", static_cast<PxU32>(physx::PxRigidBodyFlag::eENABLE_CCD_MAX_CONTACT_IMPULSE)},
{"eRETAIN_ACCELERATIONS", static_cast<PxU32>(physx::PxRigidBodyFlag::eRETAIN_ACCELERATIONS)},
{"eFORCE_KINE_KINE_NOTIFICATIONS", static_cast<PxU32>(physx::PxRigidBodyFlag::eFORCE_KINE_KINE_NOTIFICATIONS)},
{"eFORCE_STATIC_KINE_NOTIFICATIONS", static_cast<PxU32>(physx::PxRigidBodyFlag::eFORCE_STATIC_KINE_NOTIFICATIONS)},
{"eRESERVED", static_cast<PxU32>(physx::PxRigidBodyFlag::eRESERVED)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxRigidBodyFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxRigidBodyFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxRigidBody;
struct PxRigidBodyGeneratedValues : PxRigidActorGeneratedValues {
PxTransform CMassLocalPose;
PxReal Mass;
PxReal InvMass;
PxVec3 MassSpaceInertiaTensor;
PxVec3 MassSpaceInvInertiaTensor;
PxReal LinearDamping;
PxReal AngularDamping;
PxVec3 LinearVelocity;
PxVec3 AngularVelocity;
PxReal MaxAngularVelocity;
PxReal MaxLinearVelocity;
PxRigidBodyFlags RigidBodyFlags;
PxReal MinCCDAdvanceCoefficient;
PxReal MaxDepenetrationVelocity;
PxReal MaxContactImpulse;
PX_PHYSX_CORE_API PxRigidBodyGeneratedValues(const PxRigidBody *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, CMassLocalPose, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, Mass, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, InvMass, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MassSpaceInertiaTensor, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MassSpaceInvInertiaTensor, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, LinearDamping, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, AngularDamping, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, LinearVelocity, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, AngularVelocity, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MaxAngularVelocity, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MaxLinearVelocity, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, RigidBodyFlags, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MinCCDAdvanceCoefficient, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MaxDepenetrationVelocity, PxRigidBodyGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidBody, MaxContactImpulse, PxRigidBodyGeneratedValues)
struct PxRigidBodyGeneratedInfo : PxRigidActorGeneratedInfo {
static const char *getClassName() { return "PxRigidBody"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_CMassLocalPose, PxRigidBody, const PxTransform &, PxTransform>
CMassLocalPose;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_Mass, PxRigidBody, PxReal, PxReal> Mass;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_InvMass, PxRigidBody, PxReal> InvMass;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MassSpaceInertiaTensor, PxRigidBody, const PxVec3 &, PxVec3>
MassSpaceInertiaTensor;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MassSpaceInvInertiaTensor, PxRigidBody, PxVec3>
MassSpaceInvInertiaTensor;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_LinearDamping, PxRigidBody, PxReal, PxReal> LinearDamping;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_AngularDamping, PxRigidBody, PxReal, PxReal> AngularDamping;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_LinearVelocity, PxRigidBody, const PxVec3 &, PxVec3> LinearVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_AngularVelocity, PxRigidBody, const PxVec3 &, PxVec3>
AngularVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxAngularVelocity, PxRigidBody, PxReal, PxReal> MaxAngularVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxLinearVelocity, PxRigidBody, PxReal, PxReal> MaxLinearVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_RigidBodyFlags, PxRigidBody, PxRigidBodyFlags, PxRigidBodyFlags>
RigidBodyFlags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MinCCDAdvanceCoefficient, PxRigidBody, PxReal, PxReal>
MinCCDAdvanceCoefficient;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxDepenetrationVelocity, PxRigidBody, PxReal, PxReal>
MaxDepenetrationVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidBody_MaxContactImpulse, PxRigidBody, PxReal, PxReal> MaxContactImpulse;
PX_PHYSX_CORE_API PxRigidBodyGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxRigidBody *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxRigidActorGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxRigidActorGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxRigidActorGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 15; }
static PxU32 totalPropertyCount() {
return instancePropertyCount() + PxRigidActorGeneratedInfo::totalPropertyCount();
}
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(CMassLocalPose, inStartIndex + 0);
;
inOperator(Mass, inStartIndex + 1);
;
inOperator(InvMass, inStartIndex + 2);
;
inOperator(MassSpaceInertiaTensor, inStartIndex + 3);
;
inOperator(MassSpaceInvInertiaTensor, inStartIndex + 4);
;
inOperator(LinearDamping, inStartIndex + 5);
;
inOperator(AngularDamping, inStartIndex + 6);
;
inOperator(LinearVelocity, inStartIndex + 7);
;
inOperator(AngularVelocity, inStartIndex + 8);
;
inOperator(MaxAngularVelocity, inStartIndex + 9);
;
inOperator(MaxLinearVelocity, inStartIndex + 10);
;
inOperator(RigidBodyFlags, inStartIndex + 11);
;
inOperator(MinCCDAdvanceCoefficient, inStartIndex + 12);
;
inOperator(MaxDepenetrationVelocity, inStartIndex + 13);
;
inOperator(MaxContactImpulse, inStartIndex + 14);
;
return 15 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxRigidBody> {
PxRigidBodyGeneratedInfo Info;
const PxRigidBodyGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxRigidDynamicLockFlag__EnumConversion[] = {
{"eLOCK_LINEAR_X", static_cast<PxU32>(physx::PxRigidDynamicLockFlag::eLOCK_LINEAR_X)},
{"eLOCK_LINEAR_Y", static_cast<PxU32>(physx::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y)},
{"eLOCK_LINEAR_Z", static_cast<PxU32>(physx::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z)},
{"eLOCK_ANGULAR_X", static_cast<PxU32>(physx::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X)},
{"eLOCK_ANGULAR_Y", static_cast<PxU32>(physx::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y)},
{"eLOCK_ANGULAR_Z", static_cast<PxU32>(physx::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxRigidDynamicLockFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxRigidDynamicLockFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxRigidDynamic;
struct PxRigidDynamicGeneratedValues : PxRigidBodyGeneratedValues {
_Bool IsSleeping;
PxReal SleepThreshold;
PxReal StabilizationThreshold;
PxRigidDynamicLockFlags RigidDynamicLockFlags;
PxReal WakeCounter;
PxU32 SolverIterationCounts[2];
PxReal ContactReportThreshold;
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxRigidDynamicGeneratedValues(const PxRigidDynamic *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, IsSleeping, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, SleepThreshold, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, StabilizationThreshold, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, RigidDynamicLockFlags, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, WakeCounter, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, SolverIterationCounts, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, ContactReportThreshold, PxRigidDynamicGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidDynamic, ConcreteTypeName, PxRigidDynamicGeneratedValues)
struct PxRigidDynamicGeneratedInfo : PxRigidBodyGeneratedInfo {
static const char *getClassName() { return "PxRigidDynamic"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_IsSleeping, PxRigidDynamic, _Bool> IsSleeping;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_SleepThreshold, PxRigidDynamic, PxReal, PxReal> SleepThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_StabilizationThreshold, PxRigidDynamic, PxReal, PxReal>
StabilizationThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_RigidDynamicLockFlags, PxRigidDynamic, PxRigidDynamicLockFlags,
PxRigidDynamicLockFlags>
RigidDynamicLockFlags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_WakeCounter, PxRigidDynamic, PxReal, PxReal> WakeCounter;
PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_SolverIterationCounts, PxRigidDynamic, PxU32>
SolverIterationCounts;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_ContactReportThreshold, PxRigidDynamic, PxReal, PxReal>
ContactReportThreshold;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidDynamic_ConcreteTypeName, PxRigidDynamic, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxRigidDynamicGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxRigidDynamic *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxRigidBodyGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxRigidBodyGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxRigidBodyGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 8; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRigidBodyGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(IsSleeping, inStartIndex + 0);
;
inOperator(SleepThreshold, inStartIndex + 1);
;
inOperator(StabilizationThreshold, inStartIndex + 2);
;
inOperator(RigidDynamicLockFlags, inStartIndex + 3);
;
inOperator(WakeCounter, inStartIndex + 4);
;
inOperator(SolverIterationCounts, inStartIndex + 5);
;
inOperator(ContactReportThreshold, inStartIndex + 6);
;
inOperator(ConcreteTypeName, inStartIndex + 7);
;
return 8 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxRigidDynamic> {
PxRigidDynamicGeneratedInfo Info;
const PxRigidDynamicGeneratedInfo *getInfo() { return &Info; }
};
class PxRigidStatic;
struct PxRigidStaticGeneratedValues : PxRigidActorGeneratedValues {
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxRigidStaticGeneratedValues(const PxRigidStatic *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxRigidStatic, ConcreteTypeName, PxRigidStaticGeneratedValues)
struct PxRigidStaticGeneratedInfo : PxRigidActorGeneratedInfo {
static const char *getClassName() { return "PxRigidStatic"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxRigidStatic_ConcreteTypeName, PxRigidStatic, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxRigidStaticGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxRigidStatic *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxRigidActorGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxRigidActorGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxRigidActorGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 1; }
static PxU32 totalPropertyCount() {
return instancePropertyCount() + PxRigidActorGeneratedInfo::totalPropertyCount();
}
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ConcreteTypeName, inStartIndex + 0);
;
return 1 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxRigidStatic> {
PxRigidStaticGeneratedInfo Info;
const PxRigidStaticGeneratedInfo *getInfo() { return &Info; }
};
class PxArticulationLink;
struct PxArticulationLinkGeneratedValues : PxRigidBodyGeneratedValues {
PxArticulationJointBase *InboundJoint;
PxU32 InboundJointDof;
PxU32 LinkIndex;
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxArticulationLinkGeneratedValues(const PxArticulationLink *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationLink, InboundJoint, PxArticulationLinkGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationLink, InboundJointDof, PxArticulationLinkGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationLink, LinkIndex, PxArticulationLinkGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationLink, ConcreteTypeName, PxArticulationLinkGeneratedValues)
struct PxArticulationLinkGeneratedInfo : PxRigidBodyGeneratedInfo {
static const char *getClassName() { return "PxArticulationLink"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_InboundJoint, PxArticulationLink,
PxArticulationJointBase *>
InboundJoint;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_InboundJointDof, PxArticulationLink, PxU32>
InboundJointDof;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_LinkIndex, PxArticulationLink, PxU32> LinkIndex;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_Children, PxArticulationLink,
PxArticulationLink *>
Children;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationLink_ConcreteTypeName, PxArticulationLink, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxArticulationLinkGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulationLink *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxRigidBodyGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxRigidBodyGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxRigidBodyGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 5; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxRigidBodyGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(InboundJoint, inStartIndex + 0);
;
inOperator(InboundJointDof, inStartIndex + 1);
;
inOperator(LinkIndex, inStartIndex + 2);
;
inOperator(Children, inStartIndex + 3);
;
inOperator(ConcreteTypeName, inStartIndex + 4);
;
return 5 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulationLink> {
PxArticulationLinkGeneratedInfo Info;
const PxArticulationLinkGeneratedInfo *getInfo() { return &Info; }
};
class PxArticulationJointBase;
struct PxArticulationJointBaseGeneratedValues {
PxTransform ParentPose;
PxTransform ChildPose;
PX_PHYSX_CORE_API PxArticulationJointBaseGeneratedValues(const PxArticulationJointBase *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointBase, ParentPose, PxArticulationJointBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointBase, ChildPose, PxArticulationJointBaseGeneratedValues)
struct PxArticulationJointBaseGeneratedInfo
{
static const char *getClassName() { return "PxArticulationJointBase"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointBase_ParentPose, PxArticulationJointBase,
const PxTransform &, PxTransform>
ParentPose;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointBase_ChildPose, PxArticulationJointBase, const PxTransform &,
PxTransform>
ChildPose;
PX_PHYSX_CORE_API PxArticulationJointBaseGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulationJointBase *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 2; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ParentPose, inStartIndex + 0);
;
inOperator(ChildPose, inStartIndex + 1);
;
return 2 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulationJointBase> {
PxArticulationJointBaseGeneratedInfo Info;
const PxArticulationJointBaseGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxArticulationJointDriveType__EnumConversion[] = {
{"eTARGET", static_cast<PxU32>(physx::PxArticulationJointDriveType::eTARGET)},
{"eERROR", static_cast<PxU32>(physx::PxArticulationJointDriveType::eERROR)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationJointDriveType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationJointDriveType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxArticulationJoint;
struct PxArticulationJointGeneratedValues : PxArticulationJointBaseGeneratedValues {
PxQuat TargetOrientation;
PxVec3 TargetVelocity;
PxArticulationJointDriveType::Enum DriveType;
PxReal Stiffness;
PxReal Damping;
PxReal InternalCompliance;
PxReal ExternalCompliance;
PxReal SwingLimit[2];
PxReal TangentialStiffness;
PxReal TangentialDamping;
PxReal SwingLimitContactDistance;
_Bool SwingLimitEnabled;
PxReal TwistLimit[2];
_Bool TwistLimitEnabled;
PxReal TwistLimitContactDistance;
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxArticulationJointGeneratedValues(const PxArticulationJoint *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TargetOrientation, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TargetVelocity, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, DriveType, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, Stiffness, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, Damping, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, InternalCompliance, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, ExternalCompliance, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, SwingLimit, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TangentialStiffness, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TangentialDamping, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, SwingLimitContactDistance, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, SwingLimitEnabled, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TwistLimit, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TwistLimitEnabled, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, TwistLimitContactDistance, PxArticulationJointGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJoint, ConcreteTypeName, PxArticulationJointGeneratedValues)
struct PxArticulationJointGeneratedInfo : PxArticulationJointBaseGeneratedInfo {
static const char *getClassName() { return "PxArticulationJoint"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TargetOrientation, PxArticulationJoint, const PxQuat &,
PxQuat>
TargetOrientation;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TargetVelocity, PxArticulationJoint, const PxVec3 &, PxVec3>
TargetVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_DriveType, PxArticulationJoint,
PxArticulationJointDriveType::Enum, PxArticulationJointDriveType::Enum>
DriveType;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_Stiffness, PxArticulationJoint, PxReal, PxReal> Stiffness;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_Damping, PxArticulationJoint, PxReal, PxReal> Damping;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_InternalCompliance, PxArticulationJoint, PxReal, PxReal>
InternalCompliance;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_ExternalCompliance, PxArticulationJoint, PxReal, PxReal>
ExternalCompliance;
PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_SwingLimit, PxArticulationJoint, PxReal> SwingLimit;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TangentialStiffness, PxArticulationJoint, PxReal, PxReal>
TangentialStiffness;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TangentialDamping, PxArticulationJoint, PxReal, PxReal>
TangentialDamping;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_SwingLimitContactDistance, PxArticulationJoint, PxReal,
PxReal>
SwingLimitContactDistance;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_SwingLimitEnabled, PxArticulationJoint, _Bool, _Bool>
SwingLimitEnabled;
PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TwistLimit, PxArticulationJoint, PxReal> TwistLimit;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TwistLimitEnabled, PxArticulationJoint, _Bool, _Bool>
TwistLimitEnabled;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_TwistLimitContactDistance, PxArticulationJoint, PxReal,
PxReal>
TwistLimitContactDistance;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJoint_ConcreteTypeName, PxArticulationJoint, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxArticulationJointGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulationJoint *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxArticulationJointBaseGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxArticulationJointBaseGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxArticulationJointBaseGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 16; }
static PxU32 totalPropertyCount() {
return instancePropertyCount() + PxArticulationJointBaseGeneratedInfo::totalPropertyCount();
}
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(TargetOrientation, inStartIndex + 0);
;
inOperator(TargetVelocity, inStartIndex + 1);
;
inOperator(DriveType, inStartIndex + 2);
;
inOperator(Stiffness, inStartIndex + 3);
;
inOperator(Damping, inStartIndex + 4);
;
inOperator(InternalCompliance, inStartIndex + 5);
;
inOperator(ExternalCompliance, inStartIndex + 6);
;
inOperator(SwingLimit, inStartIndex + 7);
;
inOperator(TangentialStiffness, inStartIndex + 8);
;
inOperator(TangentialDamping, inStartIndex + 9);
;
inOperator(SwingLimitContactDistance, inStartIndex + 10);
;
inOperator(SwingLimitEnabled, inStartIndex + 11);
;
inOperator(TwistLimit, inStartIndex + 12);
;
inOperator(TwistLimitEnabled, inStartIndex + 13);
;
inOperator(TwistLimitContactDistance, inStartIndex + 14);
;
inOperator(ConcreteTypeName, inStartIndex + 15);
;
return 16 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulationJoint> {
PxArticulationJointGeneratedInfo Info;
const PxArticulationJointGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxArticulationJointType__EnumConversion[] = {
{"eFIX", static_cast<PxU32>(physx::PxArticulationJointType::eFIX)},
{"ePRISMATIC", static_cast<PxU32>(physx::PxArticulationJointType::ePRISMATIC)},
{"eREVOLUTE", static_cast<PxU32>(physx::PxArticulationJointType::eREVOLUTE)},
{"eSPHERICAL", static_cast<PxU32>(physx::PxArticulationJointType::eSPHERICAL)},
{"eUNDEFINED", static_cast<PxU32>(physx::PxArticulationJointType::eUNDEFINED)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationJointType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationJointType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxArticulationAxis__EnumConversion[] = {
{"eTWIST", static_cast<PxU32>(physx::PxArticulationAxis::eTWIST)},
{"eSWING1", static_cast<PxU32>(physx::PxArticulationAxis::eSWING1)},
{"eSWING2", static_cast<PxU32>(physx::PxArticulationAxis::eSWING2)},
{"eX", static_cast<PxU32>(physx::PxArticulationAxis::eX)},
{"eY", static_cast<PxU32>(physx::PxArticulationAxis::eY)},
{"eZ", static_cast<PxU32>(physx::PxArticulationAxis::eZ)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationAxis::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationAxis__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxArticulationMotion__EnumConversion[] = {
{"eLOCKED", static_cast<PxU32>(physx::PxArticulationMotion::eLOCKED)},
{"eLIMITED", static_cast<PxU32>(physx::PxArticulationMotion::eLIMITED)},
{"eFREE", static_cast<PxU32>(physx::PxArticulationMotion::eFREE)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationMotion::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationMotion__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxArticulationDriveType__EnumConversion[] = {
{"eFORCE", static_cast<PxU32>(physx::PxArticulationDriveType::eFORCE)},
{"eACCELERATION", static_cast<PxU32>(physx::PxArticulationDriveType::eACCELERATION)},
{"eTARGET", static_cast<PxU32>(physx::PxArticulationDriveType::eTARGET)},
{"eVELOCITY", static_cast<PxU32>(physx::PxArticulationDriveType::eVELOCITY)},
{"eNONE", static_cast<PxU32>(physx::PxArticulationDriveType::eNONE)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationDriveType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationDriveType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxArticulationJointReducedCoordinate;
struct PxArticulationJointReducedCoordinateGeneratedValues : PxArticulationJointBaseGeneratedValues {
PxArticulationJointType::Enum JointType;
PxArticulationMotion::Enum Motion[physx::PxArticulationAxis::eCOUNT];
PxReal FrictionCoefficient;
const char *ConcreteTypeName;
PxReal MaxJointVelocity;
PX_PHYSX_CORE_API
PxArticulationJointReducedCoordinateGeneratedValues(const PxArticulationJointReducedCoordinate *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointReducedCoordinate, JointType,
PxArticulationJointReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointReducedCoordinate, Motion,
PxArticulationJointReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointReducedCoordinate, FrictionCoefficient,
PxArticulationJointReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointReducedCoordinate, ConcreteTypeName,
PxArticulationJointReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationJointReducedCoordinate, MaxJointVelocity,
PxArticulationJointReducedCoordinateGeneratedValues)
struct PxArticulationJointReducedCoordinateGeneratedInfo : PxArticulationJointBaseGeneratedInfo {
static const char *getClassName() { return "PxArticulationJointReducedCoordinate"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_JointType,
PxArticulationJointReducedCoordinate, PxArticulationJointType::Enum, PxArticulationJointType::Enum>
JointType;
PxIndexedPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_Motion,
PxArticulationJointReducedCoordinate, PxArticulationAxis::Enum, PxArticulationMotion::Enum>
Motion;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_FrictionCoefficient,
PxArticulationJointReducedCoordinate, const PxReal, PxReal>
FrictionCoefficient;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_ConcreteTypeName,
PxArticulationJointReducedCoordinate, const char *>
ConcreteTypeName;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationJointReducedCoordinate_MaxJointVelocity,
PxArticulationJointReducedCoordinate, const PxReal, PxReal>
MaxJointVelocity;
PX_PHYSX_CORE_API PxArticulationJointReducedCoordinateGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulationJointReducedCoordinate *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxArticulationJointBaseGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxArticulationJointBaseGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxArticulationJointBaseGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 5; }
static PxU32 totalPropertyCount() {
return instancePropertyCount() + PxArticulationJointBaseGeneratedInfo::totalPropertyCount();
}
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(JointType, inStartIndex + 0);
;
inOperator(Motion, inStartIndex + 1);
;
inOperator(FrictionCoefficient, inStartIndex + 2);
;
inOperator(ConcreteTypeName, inStartIndex + 3);
;
inOperator(MaxJointVelocity, inStartIndex + 4);
;
return 5 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulationJointReducedCoordinate> {
PxArticulationJointReducedCoordinateGeneratedInfo Info;
const PxArticulationJointReducedCoordinateGeneratedInfo *getInfo() { return &Info; }
};
class PxArticulationBase;
struct PxArticulationBaseGeneratedValues {
PxScene *Scene;
PxU32 SolverIterationCounts[2];
_Bool IsSleeping;
PxReal SleepThreshold;
PxReal StabilizationThreshold;
PxReal WakeCounter;
const char *Name;
PxAggregate *Aggregate;
void *UserData;
PX_PHYSX_CORE_API PxArticulationBaseGeneratedValues(const PxArticulationBase *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, Scene, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, SolverIterationCounts, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, IsSleeping, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, SleepThreshold, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, StabilizationThreshold, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, WakeCounter, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, Name, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, Aggregate, PxArticulationBaseGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationBase, UserData, PxArticulationBaseGeneratedValues)
struct PxArticulationBaseGeneratedInfo
{
static const char *getClassName() { return "PxArticulationBase"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_Scene, PxArticulationBase, PxScene *> Scene;
PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_SolverIterationCounts, PxArticulationBase, PxU32>
SolverIterationCounts;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_IsSleeping, PxArticulationBase, _Bool> IsSleeping;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_SleepThreshold, PxArticulationBase, PxReal, PxReal>
SleepThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_StabilizationThreshold, PxArticulationBase, PxReal, PxReal>
StabilizationThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_WakeCounter, PxArticulationBase, PxReal, PxReal> WakeCounter;
PxArticulationLinkCollectionProp Links;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_Name, PxArticulationBase, const char *, const char *> Name;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_Aggregate, PxArticulationBase, PxAggregate *>
Aggregate;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationBase_UserData, PxArticulationBase, void *, void *> UserData;
PX_PHYSX_CORE_API PxArticulationBaseGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulationBase *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 10; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Scene, inStartIndex + 0);
;
inOperator(SolverIterationCounts, inStartIndex + 1);
;
inOperator(IsSleeping, inStartIndex + 2);
;
inOperator(SleepThreshold, inStartIndex + 3);
;
inOperator(StabilizationThreshold, inStartIndex + 4);
;
inOperator(WakeCounter, inStartIndex + 5);
;
inOperator(Links, inStartIndex + 6);
;
inOperator(Name, inStartIndex + 7);
;
inOperator(Aggregate, inStartIndex + 8);
;
inOperator(UserData, inStartIndex + 9);
;
return 10 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulationBase> {
PxArticulationBaseGeneratedInfo Info;
const PxArticulationBaseGeneratedInfo *getInfo() { return &Info; }
};
class PxArticulation;
struct PxArticulationGeneratedValues : PxArticulationBaseGeneratedValues {
PxU32 MaxProjectionIterations;
PxReal SeparationTolerance;
PxU32 InternalDriveIterations;
PxU32 ExternalDriveIterations;
PX_PHYSX_CORE_API PxArticulationGeneratedValues(const PxArticulation *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulation, MaxProjectionIterations, PxArticulationGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulation, SeparationTolerance, PxArticulationGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulation, InternalDriveIterations, PxArticulationGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulation, ExternalDriveIterations, PxArticulationGeneratedValues)
struct PxArticulationGeneratedInfo : PxArticulationBaseGeneratedInfo {
static const char *getClassName() { return "PxArticulation"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulation_MaxProjectionIterations, PxArticulation, PxU32, PxU32>
MaxProjectionIterations;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulation_SeparationTolerance, PxArticulation, PxReal, PxReal>
SeparationTolerance;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulation_InternalDriveIterations, PxArticulation, PxU32, PxU32>
InternalDriveIterations;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulation_ExternalDriveIterations, PxArticulation, PxU32, PxU32>
ExternalDriveIterations;
PX_PHYSX_CORE_API PxArticulationGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulation *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxArticulationBaseGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxArticulationBaseGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxArticulationBaseGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 4; }
static PxU32 totalPropertyCount() {
return instancePropertyCount() + PxArticulationBaseGeneratedInfo::totalPropertyCount();
}
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(MaxProjectionIterations, inStartIndex + 0);
;
inOperator(SeparationTolerance, inStartIndex + 1);
;
inOperator(InternalDriveIterations, inStartIndex + 2);
;
inOperator(ExternalDriveIterations, inStartIndex + 3);
;
return 4 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulation> {
PxArticulationGeneratedInfo Info;
const PxArticulationGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxArticulationFlag__EnumConversion[] = {
{"eFIX_BASE", static_cast<PxU32>(physx::PxArticulationFlag::eFIX_BASE)},
{"eDRIVE_LIMITS_ARE_FORCES", static_cast<PxU32>(physx::PxArticulationFlag::eDRIVE_LIMITS_ARE_FORCES)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxArticulationCache__EnumConversion[] = {
{"eVELOCITY", static_cast<PxU32>(physx::PxArticulationCache::eVELOCITY)},
{"eACCELERATION", static_cast<PxU32>(physx::PxArticulationCache::eACCELERATION)},
{"ePOSITION", static_cast<PxU32>(physx::PxArticulationCache::ePOSITION)},
{"eFORCE", static_cast<PxU32>(physx::PxArticulationCache::eFORCE)},
{"eLINKVELOCITY", static_cast<PxU32>(physx::PxArticulationCache::eLINKVELOCITY)},
{"eLINKACCELERATION", static_cast<PxU32>(physx::PxArticulationCache::eLINKACCELERATION)},
{"eROOT", static_cast<PxU32>(physx::PxArticulationCache::eROOT)},
{"eALL", static_cast<PxU32>(physx::PxArticulationCache::eALL)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxArticulationCache::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxArticulationCache__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxArticulationReducedCoordinate;
struct PxArticulationReducedCoordinateGeneratedValues : PxArticulationBaseGeneratedValues {
PxArticulationFlags ArticulationFlags;
PxU32 Dofs;
PxU32 CacheDataSize;
PxU32 CoefficientMatrixSize;
PX_PHYSX_CORE_API PxArticulationReducedCoordinateGeneratedValues(const PxArticulationReducedCoordinate *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationReducedCoordinate, ArticulationFlags,
PxArticulationReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationReducedCoordinate, Dofs,
PxArticulationReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationReducedCoordinate, CacheDataSize,
PxArticulationReducedCoordinateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxArticulationReducedCoordinate, CoefficientMatrixSize,
PxArticulationReducedCoordinateGeneratedValues)
struct PxArticulationReducedCoordinateGeneratedInfo : PxArticulationBaseGeneratedInfo {
static const char *getClassName() { return "PxArticulationReducedCoordinate"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_ArticulationFlags,
PxArticulationReducedCoordinate, PxArticulationFlags, PxArticulationFlags>
ArticulationFlags;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_Dofs, PxArticulationReducedCoordinate,
PxU32>
Dofs;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_CacheDataSize,
PxArticulationReducedCoordinate, PxU32>
CacheDataSize;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxArticulationReducedCoordinate_CoefficientMatrixSize,
PxArticulationReducedCoordinate, PxU32>
CoefficientMatrixSize;
PX_PHYSX_CORE_API PxArticulationReducedCoordinateGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxArticulationReducedCoordinate *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxArticulationBaseGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxArticulationBaseGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxArticulationBaseGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 4; }
static PxU32 totalPropertyCount() {
return instancePropertyCount() + PxArticulationBaseGeneratedInfo::totalPropertyCount();
}
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ArticulationFlags, inStartIndex + 0);
;
inOperator(Dofs, inStartIndex + 1);
;
inOperator(CacheDataSize, inStartIndex + 2);
;
inOperator(CoefficientMatrixSize, inStartIndex + 3);
;
return 4 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxArticulationReducedCoordinate> {
PxArticulationReducedCoordinateGeneratedInfo Info;
const PxArticulationReducedCoordinateGeneratedInfo *getInfo() { return &Info; }
};
class PxAggregate;
struct PxAggregateGeneratedValues {
PxU32 MaxNbActors;
_Bool SelfCollision;
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxAggregateGeneratedValues(const PxAggregate *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxAggregate, MaxNbActors, PxAggregateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxAggregate, SelfCollision, PxAggregateGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxAggregate, ConcreteTypeName, PxAggregateGeneratedValues)
struct PxAggregateGeneratedInfo
{
static const char *getClassName() { return "PxAggregate"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_MaxNbActors, PxAggregate, PxU32> MaxNbActors;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_Actors, PxAggregate, PxActor *> Actors;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_SelfCollision, PxAggregate, _Bool> SelfCollision;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxAggregate_ConcreteTypeName, PxAggregate, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxAggregateGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxAggregate *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 4; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(MaxNbActors, inStartIndex + 0);
;
inOperator(Actors, inStartIndex + 1);
;
inOperator(SelfCollision, inStartIndex + 2);
;
inOperator(ConcreteTypeName, inStartIndex + 3);
;
return 4 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxAggregate> {
PxAggregateGeneratedInfo Info;
const PxAggregateGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxConstraintFlag__EnumConversion[] = {
{"eBROKEN", static_cast<PxU32>(physx::PxConstraintFlag::eBROKEN)},
{"ePROJECT_TO_ACTOR0", static_cast<PxU32>(physx::PxConstraintFlag::ePROJECT_TO_ACTOR0)},
{"ePROJECT_TO_ACTOR1", static_cast<PxU32>(physx::PxConstraintFlag::ePROJECT_TO_ACTOR1)},
{"ePROJECTION", static_cast<PxU32>(physx::PxConstraintFlag::ePROJECTION)},
{"eCOLLISION_ENABLED", static_cast<PxU32>(physx::PxConstraintFlag::eCOLLISION_ENABLED)},
{"eVISUALIZATION", static_cast<PxU32>(physx::PxConstraintFlag::eVISUALIZATION)},
{"eDRIVE_LIMITS_ARE_FORCES", static_cast<PxU32>(physx::PxConstraintFlag::eDRIVE_LIMITS_ARE_FORCES)},
{"eIMPROVED_SLERP", static_cast<PxU32>(physx::PxConstraintFlag::eIMPROVED_SLERP)},
{"eDISABLE_PREPROCESSING", static_cast<PxU32>(physx::PxConstraintFlag::eDISABLE_PREPROCESSING)},
{"eENABLE_EXTENDED_LIMITS", static_cast<PxU32>(physx::PxConstraintFlag::eENABLE_EXTENDED_LIMITS)},
{"eGPU_COMPATIBLE", static_cast<PxU32>(physx::PxConstraintFlag::eGPU_COMPATIBLE)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxConstraintFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxConstraintFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxConstraint;
struct PxConstraintGeneratedValues {
PxScene *Scene;
PxRigidActor *Actors[2];
PxConstraintFlags Flags;
_Bool IsValid;
PxReal BreakForce[2];
PxReal MinResponseThreshold;
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxConstraintGeneratedValues(const PxConstraint *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, Scene, PxConstraintGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, Actors, PxConstraintGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, Flags, PxConstraintGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, IsValid, PxConstraintGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, BreakForce, PxConstraintGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, MinResponseThreshold, PxConstraintGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConstraint, ConcreteTypeName, PxConstraintGeneratedValues)
struct PxConstraintGeneratedInfo
{
static const char *getClassName() { return "PxConstraint"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_Scene, PxConstraint, PxScene *> Scene;
PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_Actors, PxConstraint, PxRigidActor *> Actors;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_Flags, PxConstraint, PxConstraintFlags, PxConstraintFlags> Flags;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_IsValid, PxConstraint, _Bool> IsValid;
PxRangePropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_BreakForce, PxConstraint, PxReal> BreakForce;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_MinResponseThreshold, PxConstraint, PxReal, PxReal>
MinResponseThreshold;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxConstraint_ConcreteTypeName, PxConstraint, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxConstraintGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxConstraint *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 7; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Scene, inStartIndex + 0);
;
inOperator(Actors, inStartIndex + 1);
;
inOperator(Flags, inStartIndex + 2);
;
inOperator(IsValid, inStartIndex + 3);
;
inOperator(BreakForce, inStartIndex + 4);
;
inOperator(MinResponseThreshold, inStartIndex + 5);
;
inOperator(ConcreteTypeName, inStartIndex + 6);
;
return 7 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxConstraint> {
PxConstraintGeneratedInfo Info;
const PxConstraintGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxGeometryType__EnumConversion[] = {
{"eSPHERE", static_cast<PxU32>(physx::PxGeometryType::eSPHERE)},
{"ePLANE", static_cast<PxU32>(physx::PxGeometryType::ePLANE)},
{"eCAPSULE", static_cast<PxU32>(physx::PxGeometryType::eCAPSULE)},
{"eBOX", static_cast<PxU32>(physx::PxGeometryType::eBOX)},
{"eCONVEXMESH", static_cast<PxU32>(physx::PxGeometryType::eCONVEXMESH)},
{"eTRIANGLEMESH", static_cast<PxU32>(physx::PxGeometryType::eTRIANGLEMESH)},
{"eHEIGHTFIELD", static_cast<PxU32>(physx::PxGeometryType::eHEIGHTFIELD)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxGeometryType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxGeometryType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxShape;
struct PxShapeGeneratedValues {
PxU32 ReferenceCount;
PxGeometryType::Enum GeometryType;
PxGeometryHolder Geometry;
PxTransform LocalPose;
PxFilterData SimulationFilterData;
PxFilterData QueryFilterData;
PxReal ContactOffset;
PxReal RestOffset;
PxReal TorsionalPatchRadius;
PxReal MinTorsionalPatchRadius;
PxShapeFlags Flags;
_Bool IsExclusive;
const char *Name;
const char *ConcreteTypeName;
void *UserData;
PX_PHYSX_CORE_API PxShapeGeneratedValues(const PxShape *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, ReferenceCount, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, GeometryType, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, Geometry, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, LocalPose, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, SimulationFilterData, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, QueryFilterData, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, ContactOffset, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, RestOffset, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, TorsionalPatchRadius, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, MinTorsionalPatchRadius, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, Flags, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, IsExclusive, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, Name, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, ConcreteTypeName, PxShapeGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxShape, UserData, PxShapeGeneratedValues)
struct PxShapeGeneratedInfo
{
static const char *getClassName() { return "PxShape"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_ReferenceCount, PxShape, PxU32> ReferenceCount;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_GeometryType, PxShape, PxGeometryType::Enum> GeometryType;
PxShapeGeometryProperty Geometry;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_LocalPose, PxShape, const PxTransform &, PxTransform> LocalPose;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_SimulationFilterData, PxShape, const PxFilterData &, PxFilterData>
SimulationFilterData;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_QueryFilterData, PxShape, const PxFilterData &, PxFilterData>
QueryFilterData;
PxShapeMaterialsProperty Materials;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_ContactOffset, PxShape, PxReal, PxReal> ContactOffset;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_RestOffset, PxShape, PxReal, PxReal> RestOffset;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_TorsionalPatchRadius, PxShape, PxReal, PxReal> TorsionalPatchRadius;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_MinTorsionalPatchRadius, PxShape, PxReal, PxReal>
MinTorsionalPatchRadius;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_Flags, PxShape, PxShapeFlags, PxShapeFlags> Flags;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_IsExclusive, PxShape, _Bool> IsExclusive;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_Name, PxShape, const char *, const char *> Name;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_ConcreteTypeName, PxShape, const char *> ConcreteTypeName;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxShape_UserData, PxShape, void *, void *> UserData;
PX_PHYSX_CORE_API PxShapeGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxShape *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 16; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ReferenceCount, inStartIndex + 0);
;
inOperator(GeometryType, inStartIndex + 1);
;
inOperator(Geometry, inStartIndex + 2);
;
inOperator(LocalPose, inStartIndex + 3);
;
inOperator(SimulationFilterData, inStartIndex + 4);
;
inOperator(QueryFilterData, inStartIndex + 5);
;
inOperator(Materials, inStartIndex + 6);
;
inOperator(ContactOffset, inStartIndex + 7);
;
inOperator(RestOffset, inStartIndex + 8);
;
inOperator(TorsionalPatchRadius, inStartIndex + 9);
;
inOperator(MinTorsionalPatchRadius, inStartIndex + 10);
;
inOperator(Flags, inStartIndex + 11);
;
inOperator(IsExclusive, inStartIndex + 12);
;
inOperator(Name, inStartIndex + 13);
;
inOperator(ConcreteTypeName, inStartIndex + 14);
;
inOperator(UserData, inStartIndex + 15);
;
return 16 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxShape> {
PxShapeGeneratedInfo Info;
const PxShapeGeneratedInfo *getInfo() { return &Info; }
};
class PxPruningStructure;
struct PxPruningStructureGeneratedValues {
const char *ConcreteTypeName;
PX_PHYSX_CORE_API PxPruningStructureGeneratedValues(const PxPruningStructure *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxPruningStructure, ConcreteTypeName, PxPruningStructureGeneratedValues)
struct PxPruningStructureGeneratedInfo
{
static const char *getClassName() { return "PxPruningStructure"; }
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxPruningStructure_RigidActors, PxPruningStructure,
PxRigidActor *>
RigidActors;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxPruningStructure_ConcreteTypeName, PxPruningStructure, const char *>
ConcreteTypeName;
PX_PHYSX_CORE_API PxPruningStructureGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxPruningStructure *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 2; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(RigidActors, inStartIndex + 0);
;
inOperator(ConcreteTypeName, inStartIndex + 1);
;
return 2 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxPruningStructure> {
PxPruningStructureGeneratedInfo Info;
const PxPruningStructureGeneratedInfo *getInfo() { return &Info; }
};
class PxTolerancesScale;
struct PxTolerancesScaleGeneratedValues {
_Bool IsValid;
PxReal Length;
PxReal Speed;
PX_PHYSX_CORE_API PxTolerancesScaleGeneratedValues(const PxTolerancesScale *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxTolerancesScale, IsValid, PxTolerancesScaleGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxTolerancesScale, Length, PxTolerancesScaleGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxTolerancesScale, Speed, PxTolerancesScaleGeneratedValues)
struct PxTolerancesScaleGeneratedInfo
{
static const char *getClassName() { return "PxTolerancesScale"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxTolerancesScale_IsValid, PxTolerancesScale, _Bool> IsValid;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTolerancesScale_Length, PxTolerancesScale, PxReal, PxReal> Length;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTolerancesScale_Speed, PxTolerancesScale, PxReal, PxReal> Speed;
PX_PHYSX_CORE_API PxTolerancesScaleGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxTolerancesScale *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 3; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(IsValid, inStartIndex + 0);
;
inOperator(Length, inStartIndex + 1);
;
inOperator(Speed, inStartIndex + 2);
;
return 3 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxTolerancesScale> {
PxTolerancesScaleGeneratedInfo Info;
const PxTolerancesScaleGeneratedInfo *getInfo() { return &Info; }
};
class PxGeometry;
struct PxGeometryGeneratedValues {
PX_PHYSX_CORE_API PxGeometryGeneratedValues(const PxGeometry *inSource);
};
struct PxGeometryGeneratedInfo
{
static const char *getClassName() { return "PxGeometry"; }
PX_PHYSX_CORE_API PxGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 0; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return 0 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxGeometry> {
PxGeometryGeneratedInfo Info;
const PxGeometryGeneratedInfo *getInfo() { return &Info; }
};
class PxBoxGeometry;
struct PxBoxGeometryGeneratedValues : PxGeometryGeneratedValues {
PxVec3 HalfExtents;
PX_PHYSX_CORE_API PxBoxGeometryGeneratedValues(const PxBoxGeometry *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxBoxGeometry, HalfExtents, PxBoxGeometryGeneratedValues)
struct PxBoxGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxBoxGeometry"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxBoxGeometry_HalfExtents, PxBoxGeometry, PxVec3, PxVec3> HalfExtents;
PX_PHYSX_CORE_API PxBoxGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxBoxGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 1; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(HalfExtents, inStartIndex + 0);
;
return 1 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxBoxGeometry> {
PxBoxGeometryGeneratedInfo Info;
const PxBoxGeometryGeneratedInfo *getInfo() { return &Info; }
};
class PxCapsuleGeometry;
struct PxCapsuleGeometryGeneratedValues : PxGeometryGeneratedValues {
PxReal Radius;
PxReal HalfHeight;
PX_PHYSX_CORE_API PxCapsuleGeometryGeneratedValues(const PxCapsuleGeometry *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxCapsuleGeometry, Radius, PxCapsuleGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxCapsuleGeometry, HalfHeight, PxCapsuleGeometryGeneratedValues)
struct PxCapsuleGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxCapsuleGeometry"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxCapsuleGeometry_Radius, PxCapsuleGeometry, PxReal, PxReal> Radius;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxCapsuleGeometry_HalfHeight, PxCapsuleGeometry, PxReal, PxReal> HalfHeight;
PX_PHYSX_CORE_API PxCapsuleGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxCapsuleGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 2; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Radius, inStartIndex + 0);
;
inOperator(HalfHeight, inStartIndex + 1);
;
return 2 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxCapsuleGeometry> {
PxCapsuleGeometryGeneratedInfo Info;
const PxCapsuleGeometryGeneratedInfo *getInfo() { return &Info; }
};
class PxMeshScale;
struct PxMeshScaleGeneratedValues {
PxVec3 Scale;
PxQuat Rotation;
PX_PHYSX_CORE_API PxMeshScaleGeneratedValues(const PxMeshScale *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMeshScale, Scale, PxMeshScaleGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxMeshScale, Rotation, PxMeshScaleGeneratedValues)
struct PxMeshScaleGeneratedInfo
{
static const char *getClassName() { return "PxMeshScale"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMeshScale_Scale, PxMeshScale, PxVec3, PxVec3> Scale;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxMeshScale_Rotation, PxMeshScale, PxQuat, PxQuat> Rotation;
PX_PHYSX_CORE_API PxMeshScaleGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxMeshScale *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 2; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Scale, inStartIndex + 0);
;
inOperator(Rotation, inStartIndex + 1);
;
return 2 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxMeshScale> {
PxMeshScaleGeneratedInfo Info;
const PxMeshScaleGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxConvexMeshGeometryFlag__EnumConversion[] = {
{"eTIGHT_BOUNDS", static_cast<PxU32>(physx::PxConvexMeshGeometryFlag::eTIGHT_BOUNDS)}, {NULL, 0}};
template <> struct PxEnumTraits<physx::PxConvexMeshGeometryFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxConvexMeshGeometryFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxConvexMeshGeometry;
struct PxConvexMeshGeometryGeneratedValues : PxGeometryGeneratedValues {
PxMeshScale Scale;
PxConvexMesh *ConvexMesh;
PxConvexMeshGeometryFlags MeshFlags;
PX_PHYSX_CORE_API PxConvexMeshGeometryGeneratedValues(const PxConvexMeshGeometry *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConvexMeshGeometry, Scale, PxConvexMeshGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConvexMeshGeometry, ConvexMesh, PxConvexMeshGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxConvexMeshGeometry, MeshFlags, PxConvexMeshGeometryGeneratedValues)
struct PxConvexMeshGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxConvexMeshGeometry"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConvexMeshGeometry_Scale, PxConvexMeshGeometry, PxMeshScale, PxMeshScale>
Scale;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConvexMeshGeometry_ConvexMesh, PxConvexMeshGeometry, PxConvexMesh *,
PxConvexMesh *>
ConvexMesh;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxConvexMeshGeometry_MeshFlags, PxConvexMeshGeometry, PxConvexMeshGeometryFlags,
PxConvexMeshGeometryFlags>
MeshFlags;
PX_PHYSX_CORE_API PxConvexMeshGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxConvexMeshGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 3; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Scale, inStartIndex + 0);
;
inOperator(ConvexMesh, inStartIndex + 1);
;
inOperator(MeshFlags, inStartIndex + 2);
;
return 3 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxConvexMeshGeometry> {
PxConvexMeshGeometryGeneratedInfo Info;
const PxConvexMeshGeometryGeneratedInfo *getInfo() { return &Info; }
};
class PxSphereGeometry;
struct PxSphereGeometryGeneratedValues : PxGeometryGeneratedValues {
PxReal Radius;
PX_PHYSX_CORE_API PxSphereGeometryGeneratedValues(const PxSphereGeometry *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSphereGeometry, Radius, PxSphereGeometryGeneratedValues)
struct PxSphereGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxSphereGeometry"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSphereGeometry_Radius, PxSphereGeometry, PxReal, PxReal> Radius;
PX_PHYSX_CORE_API PxSphereGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxSphereGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 1; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Radius, inStartIndex + 0);
;
return 1 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxSphereGeometry> {
PxSphereGeometryGeneratedInfo Info;
const PxSphereGeometryGeneratedInfo *getInfo() { return &Info; }
};
class PxPlaneGeometry;
struct PxPlaneGeometryGeneratedValues : PxGeometryGeneratedValues {
PX_PHYSX_CORE_API PxPlaneGeometryGeneratedValues(const PxPlaneGeometry *inSource);
};
struct PxPlaneGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxPlaneGeometry"; }
PX_PHYSX_CORE_API PxPlaneGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxPlaneGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 0; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return 0 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxPlaneGeometry> {
PxPlaneGeometryGeneratedInfo Info;
const PxPlaneGeometryGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxMeshGeometryFlag__EnumConversion[] = {
{"eDOUBLE_SIDED", static_cast<PxU32>(physx::PxMeshGeometryFlag::eDOUBLE_SIDED)}, {NULL, 0}};
template <> struct PxEnumTraits<physx::PxMeshGeometryFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxMeshGeometryFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxTriangleMeshGeometry;
struct PxTriangleMeshGeometryGeneratedValues : PxGeometryGeneratedValues {
PxMeshScale Scale;
PxMeshGeometryFlags MeshFlags;
PxTriangleMesh *TriangleMesh;
PX_PHYSX_CORE_API PxTriangleMeshGeometryGeneratedValues(const PxTriangleMeshGeometry *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxTriangleMeshGeometry, Scale, PxTriangleMeshGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxTriangleMeshGeometry, MeshFlags, PxTriangleMeshGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxTriangleMeshGeometry, TriangleMesh, PxTriangleMeshGeometryGeneratedValues)
struct PxTriangleMeshGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxTriangleMeshGeometry"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTriangleMeshGeometry_Scale, PxTriangleMeshGeometry, PxMeshScale, PxMeshScale>
Scale;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTriangleMeshGeometry_MeshFlags, PxTriangleMeshGeometry, PxMeshGeometryFlags,
PxMeshGeometryFlags>
MeshFlags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxTriangleMeshGeometry_TriangleMesh, PxTriangleMeshGeometry, PxTriangleMesh *,
PxTriangleMesh *>
TriangleMesh;
PX_PHYSX_CORE_API PxTriangleMeshGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxTriangleMeshGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 3; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Scale, inStartIndex + 0);
;
inOperator(MeshFlags, inStartIndex + 1);
;
inOperator(TriangleMesh, inStartIndex + 2);
;
return 3 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxTriangleMeshGeometry> {
PxTriangleMeshGeometryGeneratedInfo Info;
const PxTriangleMeshGeometryGeneratedInfo *getInfo() { return &Info; }
};
class PxHeightFieldGeometry;
struct PxHeightFieldGeometryGeneratedValues : PxGeometryGeneratedValues {
PxHeightField *HeightField;
PxReal HeightScale;
PxReal RowScale;
PxReal ColumnScale;
PxMeshGeometryFlags HeightFieldFlags;
PX_PHYSX_CORE_API PxHeightFieldGeometryGeneratedValues(const PxHeightFieldGeometry *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldGeometry, HeightField, PxHeightFieldGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldGeometry, HeightScale, PxHeightFieldGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldGeometry, RowScale, PxHeightFieldGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldGeometry, ColumnScale, PxHeightFieldGeometryGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldGeometry, HeightFieldFlags, PxHeightFieldGeometryGeneratedValues)
struct PxHeightFieldGeometryGeneratedInfo : PxGeometryGeneratedInfo {
static const char *getClassName() { return "PxHeightFieldGeometry"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_HeightField, PxHeightFieldGeometry, PxHeightField *,
PxHeightField *>
HeightField;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_HeightScale, PxHeightFieldGeometry, PxReal, PxReal>
HeightScale;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_RowScale, PxHeightFieldGeometry, PxReal, PxReal> RowScale;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_ColumnScale, PxHeightFieldGeometry, PxReal, PxReal>
ColumnScale;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldGeometry_HeightFieldFlags, PxHeightFieldGeometry,
PxMeshGeometryFlags, PxMeshGeometryFlags>
HeightFieldFlags;
PX_PHYSX_CORE_API PxHeightFieldGeometryGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxHeightFieldGeometry *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) {
PX_UNUSED(inOperator);
inOperator(*static_cast<PxGeometryGeneratedInfo *>(this));
}
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitBaseProperties(inOperator, inStartIndex);
inStartIndex = PxGeometryGeneratedInfo::visitInstanceProperties(inOperator, inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 5; }
static PxU32 totalPropertyCount() { return instancePropertyCount() + PxGeometryGeneratedInfo::totalPropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(HeightField, inStartIndex + 0);
;
inOperator(HeightScale, inStartIndex + 1);
;
inOperator(RowScale, inStartIndex + 2);
;
inOperator(ColumnScale, inStartIndex + 3);
;
inOperator(HeightFieldFlags, inStartIndex + 4);
;
return 5 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxHeightFieldGeometry> {
PxHeightFieldGeometryGeneratedInfo Info;
const PxHeightFieldGeometryGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxHeightFieldFormat__EnumConversion[] = {
{"eS16_TM", static_cast<PxU32>(physx::PxHeightFieldFormat::eS16_TM)}, {NULL, 0}};
template <> struct PxEnumTraits<physx::PxHeightFieldFormat::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxHeightFieldFormat__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxHeightFieldFlag__EnumConversion[] = {
{"eNO_BOUNDARY_EDGES", static_cast<PxU32>(physx::PxHeightFieldFlag::eNO_BOUNDARY_EDGES)}, {NULL, 0}};
template <> struct PxEnumTraits<physx::PxHeightFieldFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxHeightFieldFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxHeightFieldDesc;
struct PxHeightFieldDescGeneratedValues {
PxU32 NbRows;
PxU32 NbColumns;
PxHeightFieldFormat::Enum Format;
PxStridedData Samples;
PxReal ConvexEdgeThreshold;
PxHeightFieldFlags Flags;
PX_PHYSX_CORE_API PxHeightFieldDescGeneratedValues(const PxHeightFieldDesc *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldDesc, NbRows, PxHeightFieldDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldDesc, NbColumns, PxHeightFieldDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldDesc, Format, PxHeightFieldDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldDesc, Samples, PxHeightFieldDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldDesc, ConvexEdgeThreshold, PxHeightFieldDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxHeightFieldDesc, Flags, PxHeightFieldDescGeneratedValues)
struct PxHeightFieldDescGeneratedInfo
{
static const char *getClassName() { return "PxHeightFieldDesc"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_NbRows, PxHeightFieldDesc, PxU32, PxU32> NbRows;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_NbColumns, PxHeightFieldDesc, PxU32, PxU32> NbColumns;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_Format, PxHeightFieldDesc, PxHeightFieldFormat::Enum,
PxHeightFieldFormat::Enum>
Format;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_Samples, PxHeightFieldDesc, PxStridedData, PxStridedData>
Samples;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_ConvexEdgeThreshold, PxHeightFieldDesc, PxReal, PxReal>
ConvexEdgeThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxHeightFieldDesc_Flags, PxHeightFieldDesc, PxHeightFieldFlags,
PxHeightFieldFlags>
Flags;
PX_PHYSX_CORE_API PxHeightFieldDescGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxHeightFieldDesc *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 6; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(NbRows, inStartIndex + 0);
;
inOperator(NbColumns, inStartIndex + 1);
;
inOperator(Format, inStartIndex + 2);
;
inOperator(Samples, inStartIndex + 3);
;
inOperator(ConvexEdgeThreshold, inStartIndex + 4);
;
inOperator(Flags, inStartIndex + 5);
;
return 6 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxHeightFieldDesc> {
PxHeightFieldDescGeneratedInfo Info;
const PxHeightFieldDescGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxSceneFlag__EnumConversion[] = {
{"eENABLE_ACTIVE_ACTORS", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_ACTIVE_ACTORS)},
{"eENABLE_CCD", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_CCD)},
{"eDISABLE_CCD_RESWEEP", static_cast<PxU32>(physx::PxSceneFlag::eDISABLE_CCD_RESWEEP)},
{"eADAPTIVE_FORCE", static_cast<PxU32>(physx::PxSceneFlag::eADAPTIVE_FORCE)},
{"eENABLE_PCM", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_PCM)},
{"eDISABLE_CONTACT_REPORT_BUFFER_RESIZE",
static_cast<PxU32>(physx::PxSceneFlag::eDISABLE_CONTACT_REPORT_BUFFER_RESIZE)},
{"eDISABLE_CONTACT_CACHE", static_cast<PxU32>(physx::PxSceneFlag::eDISABLE_CONTACT_CACHE)},
{"eREQUIRE_RW_LOCK", static_cast<PxU32>(physx::PxSceneFlag::eREQUIRE_RW_LOCK)},
{"eENABLE_STABILIZATION", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_STABILIZATION)},
{"eENABLE_AVERAGE_POINT", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_AVERAGE_POINT)},
{"eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS",
static_cast<PxU32>(physx::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS)},
{"eENABLE_GPU_DYNAMICS", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_GPU_DYNAMICS)},
{"eENABLE_ENHANCED_DETERMINISM", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_ENHANCED_DETERMINISM)},
{"eENABLE_FRICTION_EVERY_ITERATION", static_cast<PxU32>(physx::PxSceneFlag::eENABLE_FRICTION_EVERY_ITERATION)},
{"eMUTABLE_FLAGS", static_cast<PxU32>(physx::PxSceneFlag::eMUTABLE_FLAGS)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxSceneFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxSceneFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxActorTypeFlag__EnumConversion[] = {
{"eRIGID_STATIC", static_cast<PxU32>(physx::PxActorTypeFlag::eRIGID_STATIC)},
{"eRIGID_DYNAMIC", static_cast<PxU32>(physx::PxActorTypeFlag::eRIGID_DYNAMIC)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxActorTypeFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxActorTypeFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxPairFilteringMode__EnumConversion[] = {
{"eKEEP", static_cast<PxU32>(physx::PxPairFilteringMode::eKEEP)},
{"eSUPPRESS", static_cast<PxU32>(physx::PxPairFilteringMode::eSUPPRESS)},
{"eKILL", static_cast<PxU32>(physx::PxPairFilteringMode::eKILL)},
{"eDEFAULT", static_cast<PxU32>(physx::PxPairFilteringMode::eDEFAULT)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxPairFilteringMode::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxPairFilteringMode__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxFrictionType__EnumConversion[] = {
{"ePATCH", static_cast<PxU32>(physx::PxFrictionType::ePATCH)},
{"eONE_DIRECTIONAL", static_cast<PxU32>(physx::PxFrictionType::eONE_DIRECTIONAL)},
{"eTWO_DIRECTIONAL", static_cast<PxU32>(physx::PxFrictionType::eTWO_DIRECTIONAL)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxFrictionType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxFrictionType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxVisualizationParameter__EnumConversion[] = {
{"eSCALE", static_cast<PxU32>(physx::PxVisualizationParameter::eSCALE)},
{"eWORLD_AXES", static_cast<PxU32>(physx::PxVisualizationParameter::eWORLD_AXES)},
{"eBODY_AXES", static_cast<PxU32>(physx::PxVisualizationParameter::eBODY_AXES)},
{"eBODY_MASS_AXES", static_cast<PxU32>(physx::PxVisualizationParameter::eBODY_MASS_AXES)},
{"eBODY_LIN_VELOCITY", static_cast<PxU32>(physx::PxVisualizationParameter::eBODY_LIN_VELOCITY)},
{"eBODY_ANG_VELOCITY", static_cast<PxU32>(physx::PxVisualizationParameter::eBODY_ANG_VELOCITY)},
{"eCONTACT_POINT", static_cast<PxU32>(physx::PxVisualizationParameter::eCONTACT_POINT)},
{"eCONTACT_NORMAL", static_cast<PxU32>(physx::PxVisualizationParameter::eCONTACT_NORMAL)},
{"eCONTACT_ERROR", static_cast<PxU32>(physx::PxVisualizationParameter::eCONTACT_ERROR)},
{"eCONTACT_FORCE", static_cast<PxU32>(physx::PxVisualizationParameter::eCONTACT_FORCE)},
{"eACTOR_AXES", static_cast<PxU32>(physx::PxVisualizationParameter::eACTOR_AXES)},
{"eCOLLISION_AABBS", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_AABBS)},
{"eCOLLISION_SHAPES", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_SHAPES)},
{"eCOLLISION_AXES", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_AXES)},
{"eCOLLISION_COMPOUNDS", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_COMPOUNDS)},
{"eCOLLISION_FNORMALS", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_FNORMALS)},
{"eCOLLISION_EDGES", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_EDGES)},
{"eCOLLISION_STATIC", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_STATIC)},
{"eCOLLISION_DYNAMIC", static_cast<PxU32>(physx::PxVisualizationParameter::eCOLLISION_DYNAMIC)},
{"eDEPRECATED_COLLISION_PAIRS", static_cast<PxU32>(physx::PxVisualizationParameter::eDEPRECATED_COLLISION_PAIRS)},
{"eJOINT_LOCAL_FRAMES", static_cast<PxU32>(physx::PxVisualizationParameter::eJOINT_LOCAL_FRAMES)},
{"eJOINT_LIMITS", static_cast<PxU32>(physx::PxVisualizationParameter::eJOINT_LIMITS)},
{"eCULL_BOX", static_cast<PxU32>(physx::PxVisualizationParameter::eCULL_BOX)},
{"eMBP_REGIONS", static_cast<PxU32>(physx::PxVisualizationParameter::eMBP_REGIONS)},
{"eNUM_VALUES", static_cast<PxU32>(physx::PxVisualizationParameter::eNUM_VALUES)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxVisualizationParameter::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxVisualizationParameter__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxPruningStructureType__EnumConversion[] = {
{"eNONE", static_cast<PxU32>(physx::PxPruningStructureType::eNONE)},
{"eDYNAMIC_AABB_TREE", static_cast<PxU32>(physx::PxPruningStructureType::eDYNAMIC_AABB_TREE)},
{"eSTATIC_AABB_TREE", static_cast<PxU32>(physx::PxPruningStructureType::eSTATIC_AABB_TREE)},
{"eLAST", static_cast<PxU32>(physx::PxPruningStructureType::eLAST)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxPruningStructureType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxPruningStructureType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxSceneQueryUpdateMode__EnumConversion[] = {
{"eBUILD_ENABLED_COMMIT_ENABLED", static_cast<PxU32>(physx::PxSceneQueryUpdateMode::eBUILD_ENABLED_COMMIT_ENABLED)},
{"eBUILD_ENABLED_COMMIT_DISABLED",
static_cast<PxU32>(physx::PxSceneQueryUpdateMode::eBUILD_ENABLED_COMMIT_DISABLED)},
{"eBUILD_DISABLED_COMMIT_DISABLED",
static_cast<PxU32>(physx::PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxSceneQueryUpdateMode::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxSceneQueryUpdateMode__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxHitFlag__EnumConversion[] = {
{"ePOSITION", static_cast<PxU32>(physx::PxHitFlag::ePOSITION)},
{"eNORMAL", static_cast<PxU32>(physx::PxHitFlag::eNORMAL)},
{"eUV", static_cast<PxU32>(physx::PxHitFlag::eUV)},
{"eASSUME_NO_INITIAL_OVERLAP", static_cast<PxU32>(physx::PxHitFlag::eASSUME_NO_INITIAL_OVERLAP)},
{"eMESH_MULTIPLE", static_cast<PxU32>(physx::PxHitFlag::eMESH_MULTIPLE)},
{"eMESH_ANY", static_cast<PxU32>(physx::PxHitFlag::eMESH_ANY)},
{"eMESH_BOTH_SIDES", static_cast<PxU32>(physx::PxHitFlag::eMESH_BOTH_SIDES)},
{"ePRECISE_SWEEP", static_cast<PxU32>(physx::PxHitFlag::ePRECISE_SWEEP)},
{"eMTD", static_cast<PxU32>(physx::PxHitFlag::eMTD)},
{"eFACE_INDEX", static_cast<PxU32>(physx::PxHitFlag::eFACE_INDEX)},
{"eDEFAULT", static_cast<PxU32>(physx::PxHitFlag::eDEFAULT)},
{"eMODIFIABLE_FLAGS", static_cast<PxU32>(physx::PxHitFlag::eMODIFIABLE_FLAGS)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxHitFlag::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxHitFlag__EnumConversion) {}
const PxU32ToName *NameConversion;
};
static PxU32ToName g_physx__PxBroadPhaseType__EnumConversion[] = {
{"eSAP", static_cast<PxU32>(physx::PxBroadPhaseType::eSAP)},
{"eMBP", static_cast<PxU32>(physx::PxBroadPhaseType::eMBP)},
{"eABP", static_cast<PxU32>(physx::PxBroadPhaseType::eABP)},
{"eGPU", static_cast<PxU32>(physx::PxBroadPhaseType::eGPU)},
{"eLAST", static_cast<PxU32>(physx::PxBroadPhaseType::eLAST)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxBroadPhaseType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxBroadPhaseType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxScene;
struct PxSceneGeneratedValues {
PxSceneFlags Flags;
PxSceneLimits Limits;
PxU32 Timestamp;
PxCpuDispatcher *CpuDispatcher;
PxCudaContextManager *CudaContextManager;
PxSimulationEventCallback *SimulationEventCallback;
PxContactModifyCallback *ContactModifyCallback;
PxCCDContactModifyCallback *CCDContactModifyCallback;
PxBroadPhaseCallback *BroadPhaseCallback;
PxU32 FilterShaderDataSize;
PxSimulationFilterShader FilterShader;
PxSimulationFilterCallback *FilterCallback;
PxPairFilteringMode::Enum KinematicKinematicFilteringMode;
PxPairFilteringMode::Enum StaticKinematicFilteringMode;
PxVec3 Gravity;
PxReal BounceThresholdVelocity;
PxU32 CCDMaxPasses;
PxReal FrictionOffsetThreshold;
PxFrictionType::Enum FrictionType;
PxBounds3 VisualizationCullingBox;
PxPruningStructureType::Enum StaticStructure;
PxPruningStructureType::Enum DynamicStructure;
PxU32 DynamicTreeRebuildRateHint;
PxSceneQueryUpdateMode::Enum SceneQueryUpdateMode;
PxU32 SceneQueryStaticTimestamp;
PxBroadPhaseType::Enum BroadPhaseType;
PxTaskManager *TaskManager;
PxU32 MaxNbContactDataBlocksUsed;
PxU32 ContactReportStreamBufferSize;
PxU32 SolverBatchSize;
PxU32 SolverArticulationBatchSize;
PxReal WakeCounterResetValue;
void *UserData;
PxSimulationStatistics SimulationStatistics;
PX_PHYSX_CORE_API PxSceneGeneratedValues(const PxScene *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, Flags, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, Limits, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, Timestamp, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, CpuDispatcher, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, CudaContextManager, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, SimulationEventCallback, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, ContactModifyCallback, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, CCDContactModifyCallback, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, BroadPhaseCallback, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, FilterShaderDataSize, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, FilterShader, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, FilterCallback, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, KinematicKinematicFilteringMode, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, StaticKinematicFilteringMode, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, Gravity, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, BounceThresholdVelocity, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, CCDMaxPasses, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, FrictionOffsetThreshold, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, FrictionType, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, VisualizationCullingBox, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, StaticStructure, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, DynamicStructure, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, DynamicTreeRebuildRateHint, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, SceneQueryUpdateMode, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, SceneQueryStaticTimestamp, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, BroadPhaseType, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, TaskManager, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, MaxNbContactDataBlocksUsed, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, ContactReportStreamBufferSize, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, SolverBatchSize, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, SolverArticulationBatchSize, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, WakeCounterResetValue, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, UserData, PxSceneGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxScene, SimulationStatistics, PxSceneGeneratedValues)
struct PxSceneGeneratedInfo
{
static const char *getClassName() { return "PxScene"; }
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Flags, PxScene, PxSceneFlags> Flags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Limits, PxScene, const PxSceneLimits &, PxSceneLimits> Limits;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Timestamp, PxScene, PxU32> Timestamp;
PxReadOnlyFilteredCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Actors, PxScene, PxActor *, PxActorTypeFlags>
Actors;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Articulations, PxScene, PxArticulationBase *>
Articulations;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Constraints, PxScene, PxConstraint *> Constraints;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Aggregates, PxScene, PxAggregate *> Aggregates;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CpuDispatcher, PxScene, PxCpuDispatcher *> CpuDispatcher;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CudaContextManager, PxScene, PxCudaContextManager *>
CudaContextManager;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SimulationEventCallback, PxScene, PxSimulationEventCallback *,
PxSimulationEventCallback *>
SimulationEventCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_ContactModifyCallback, PxScene, PxContactModifyCallback *,
PxContactModifyCallback *>
ContactModifyCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CCDContactModifyCallback, PxScene, PxCCDContactModifyCallback *,
PxCCDContactModifyCallback *>
CCDContactModifyCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BroadPhaseCallback, PxScene, PxBroadPhaseCallback *,
PxBroadPhaseCallback *>
BroadPhaseCallback;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FilterShaderDataSize, PxScene, PxU32> FilterShaderDataSize;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FilterShader, PxScene, PxSimulationFilterShader> FilterShader;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FilterCallback, PxScene, PxSimulationFilterCallback *>
FilterCallback;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_KinematicKinematicFilteringMode, PxScene,
PxPairFilteringMode::Enum>
KinematicKinematicFilteringMode;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_StaticKinematicFilteringMode, PxScene,
PxPairFilteringMode::Enum>
StaticKinematicFilteringMode;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_Gravity, PxScene, const PxVec3 &, PxVec3> Gravity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BounceThresholdVelocity, PxScene, const PxReal, PxReal>
BounceThresholdVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_CCDMaxPasses, PxScene, PxU32, PxU32> CCDMaxPasses;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FrictionOffsetThreshold, PxScene, PxReal>
FrictionOffsetThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_FrictionType, PxScene, PxFrictionType::Enum, PxFrictionType::Enum>
FrictionType;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_VisualizationCullingBox, PxScene, const PxBounds3 &, PxBounds3>
VisualizationCullingBox;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_StaticStructure, PxScene, PxPruningStructureType::Enum>
StaticStructure;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_DynamicStructure, PxScene, PxPruningStructureType::Enum>
DynamicStructure;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_DynamicTreeRebuildRateHint, PxScene, PxU32, PxU32>
DynamicTreeRebuildRateHint;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SceneQueryUpdateMode, PxScene, PxSceneQueryUpdateMode::Enum,
PxSceneQueryUpdateMode::Enum>
SceneQueryUpdateMode;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SceneQueryStaticTimestamp, PxScene, PxU32>
SceneQueryStaticTimestamp;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BroadPhaseType, PxScene, PxBroadPhaseType::Enum> BroadPhaseType;
PxReadOnlyCollectionPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_BroadPhaseRegions, PxScene, PxBroadPhaseRegionInfo>
BroadPhaseRegions;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_TaskManager, PxScene, PxTaskManager *> TaskManager;
PxWriteOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_NbContactDataBlocks, PxScene, PxU32> NbContactDataBlocks;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_MaxNbContactDataBlocksUsed, PxScene, PxU32>
MaxNbContactDataBlocksUsed;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_ContactReportStreamBufferSize, PxScene, PxU32>
ContactReportStreamBufferSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SolverBatchSize, PxScene, PxU32, PxU32> SolverBatchSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_SolverArticulationBatchSize, PxScene, PxU32, PxU32>
SolverArticulationBatchSize;
PxReadOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_WakeCounterResetValue, PxScene, PxReal> WakeCounterResetValue;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxScene_UserData, PxScene, void *, void *> UserData;
SimulationStatisticsProperty SimulationStatistics;
PX_PHYSX_CORE_API PxSceneGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxScene *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 40; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(Flags, inStartIndex + 0);
;
inOperator(Limits, inStartIndex + 1);
;
inOperator(Timestamp, inStartIndex + 2);
;
inOperator(Actors, inStartIndex + 3);
;
inOperator(Articulations, inStartIndex + 4);
;
inOperator(Constraints, inStartIndex + 5);
;
inOperator(Aggregates, inStartIndex + 6);
;
inOperator(CpuDispatcher, inStartIndex + 7);
;
inOperator(CudaContextManager, inStartIndex + 8);
;
inOperator(SimulationEventCallback, inStartIndex + 9);
;
inOperator(ContactModifyCallback, inStartIndex + 10);
;
inOperator(CCDContactModifyCallback, inStartIndex + 11);
;
inOperator(BroadPhaseCallback, inStartIndex + 12);
;
inOperator(FilterShaderDataSize, inStartIndex + 13);
;
inOperator(FilterShader, inStartIndex + 14);
;
inOperator(FilterCallback, inStartIndex + 15);
;
inOperator(KinematicKinematicFilteringMode, inStartIndex + 16);
;
inOperator(StaticKinematicFilteringMode, inStartIndex + 17);
;
inOperator(Gravity, inStartIndex + 18);
;
inOperator(BounceThresholdVelocity, inStartIndex + 19);
;
inOperator(CCDMaxPasses, inStartIndex + 20);
;
inOperator(FrictionOffsetThreshold, inStartIndex + 21);
;
inOperator(FrictionType, inStartIndex + 22);
;
inOperator(VisualizationCullingBox, inStartIndex + 23);
;
inOperator(StaticStructure, inStartIndex + 24);
;
inOperator(DynamicStructure, inStartIndex + 25);
;
inOperator(DynamicTreeRebuildRateHint, inStartIndex + 26);
;
inOperator(SceneQueryUpdateMode, inStartIndex + 27);
;
inOperator(SceneQueryStaticTimestamp, inStartIndex + 28);
;
inOperator(BroadPhaseType, inStartIndex + 29);
;
inOperator(BroadPhaseRegions, inStartIndex + 30);
;
inOperator(TaskManager, inStartIndex + 31);
;
inOperator(NbContactDataBlocks, inStartIndex + 32);
;
inOperator(MaxNbContactDataBlocksUsed, inStartIndex + 33);
;
inOperator(ContactReportStreamBufferSize, inStartIndex + 34);
;
inOperator(SolverBatchSize, inStartIndex + 35);
;
inOperator(SolverArticulationBatchSize, inStartIndex + 36);
;
inOperator(WakeCounterResetValue, inStartIndex + 37);
;
inOperator(UserData, inStartIndex + 38);
;
inOperator(SimulationStatistics, inStartIndex + 39);
;
return 40 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxScene> {
PxSceneGeneratedInfo Info;
const PxSceneGeneratedInfo *getInfo() { return &Info; }
};
class PxSceneLimits;
struct PxSceneLimitsGeneratedValues {
PxU32 MaxNbActors;
PxU32 MaxNbBodies;
PxU32 MaxNbStaticShapes;
PxU32 MaxNbDynamicShapes;
PxU32 MaxNbAggregates;
PxU32 MaxNbConstraints;
PxU32 MaxNbRegions;
PxU32 MaxNbBroadPhaseOverlaps;
PX_PHYSX_CORE_API PxSceneLimitsGeneratedValues(const PxSceneLimits *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbActors, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbBodies, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbStaticShapes, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbDynamicShapes, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbAggregates, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbConstraints, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbRegions, PxSceneLimitsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneLimits, MaxNbBroadPhaseOverlaps, PxSceneLimitsGeneratedValues)
struct PxSceneLimitsGeneratedInfo
{
static const char *getClassName() { return "PxSceneLimits"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbActors, PxSceneLimits, PxU32, PxU32> MaxNbActors;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbBodies, PxSceneLimits, PxU32, PxU32> MaxNbBodies;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbStaticShapes, PxSceneLimits, PxU32, PxU32> MaxNbStaticShapes;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbDynamicShapes, PxSceneLimits, PxU32, PxU32>
MaxNbDynamicShapes;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbAggregates, PxSceneLimits, PxU32, PxU32> MaxNbAggregates;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbConstraints, PxSceneLimits, PxU32, PxU32> MaxNbConstraints;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbRegions, PxSceneLimits, PxU32, PxU32> MaxNbRegions;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneLimits_MaxNbBroadPhaseOverlaps, PxSceneLimits, PxU32, PxU32>
MaxNbBroadPhaseOverlaps;
PX_PHYSX_CORE_API PxSceneLimitsGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxSceneLimits *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 8; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(MaxNbActors, inStartIndex + 0);
;
inOperator(MaxNbBodies, inStartIndex + 1);
;
inOperator(MaxNbStaticShapes, inStartIndex + 2);
;
inOperator(MaxNbDynamicShapes, inStartIndex + 3);
;
inOperator(MaxNbAggregates, inStartIndex + 4);
;
inOperator(MaxNbConstraints, inStartIndex + 5);
;
inOperator(MaxNbRegions, inStartIndex + 6);
;
inOperator(MaxNbBroadPhaseOverlaps, inStartIndex + 7);
;
return 8 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxSceneLimits> {
PxSceneLimitsGeneratedInfo Info;
const PxSceneLimitsGeneratedInfo *getInfo() { return &Info; }
};
struct PxgDynamicsMemoryConfig;
struct PxgDynamicsMemoryConfigGeneratedValues {
PxU32 ConstraintBufferCapacity;
PxU32 ContactBufferCapacity;
PxU32 TempBufferCapacity;
PxU32 ContactStreamSize;
PxU32 PatchStreamSize;
PxU32 ForceStreamCapacity;
PxU32 HeapCapacity;
PxU32 FoundLostPairsCapacity;
PX_PHYSX_CORE_API PxgDynamicsMemoryConfigGeneratedValues(const PxgDynamicsMemoryConfig *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, ConstraintBufferCapacity,
PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, ContactBufferCapacity,
PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, TempBufferCapacity, PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, ContactStreamSize, PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, PatchStreamSize, PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, ForceStreamCapacity,
PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, HeapCapacity, PxgDynamicsMemoryConfigGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxgDynamicsMemoryConfig, FoundLostPairsCapacity,
PxgDynamicsMemoryConfigGeneratedValues)
struct PxgDynamicsMemoryConfigGeneratedInfo
{
static const char *getClassName() { return "PxgDynamicsMemoryConfig"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_ConstraintBufferCapacity, PxgDynamicsMemoryConfig,
PxU32, PxU32>
ConstraintBufferCapacity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_ContactBufferCapacity, PxgDynamicsMemoryConfig, PxU32,
PxU32>
ContactBufferCapacity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_TempBufferCapacity, PxgDynamicsMemoryConfig, PxU32,
PxU32>
TempBufferCapacity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_ContactStreamSize, PxgDynamicsMemoryConfig, PxU32,
PxU32>
ContactStreamSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_PatchStreamSize, PxgDynamicsMemoryConfig, PxU32, PxU32>
PatchStreamSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_ForceStreamCapacity, PxgDynamicsMemoryConfig, PxU32,
PxU32>
ForceStreamCapacity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_HeapCapacity, PxgDynamicsMemoryConfig, PxU32, PxU32>
HeapCapacity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxgDynamicsMemoryConfig_FoundLostPairsCapacity, PxgDynamicsMemoryConfig, PxU32,
PxU32>
FoundLostPairsCapacity;
PX_PHYSX_CORE_API PxgDynamicsMemoryConfigGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxgDynamicsMemoryConfig *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 8; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ConstraintBufferCapacity, inStartIndex + 0);
;
inOperator(ContactBufferCapacity, inStartIndex + 1);
;
inOperator(TempBufferCapacity, inStartIndex + 2);
;
inOperator(ContactStreamSize, inStartIndex + 3);
;
inOperator(PatchStreamSize, inStartIndex + 4);
;
inOperator(ForceStreamCapacity, inStartIndex + 5);
;
inOperator(HeapCapacity, inStartIndex + 6);
;
inOperator(FoundLostPairsCapacity, inStartIndex + 7);
;
return 8 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxgDynamicsMemoryConfig> {
PxgDynamicsMemoryConfigGeneratedInfo Info;
const PxgDynamicsMemoryConfigGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxSolverType__EnumConversion[] = {{"ePGS", static_cast<PxU32>(physx::PxSolverType::ePGS)},
{"eTGS", static_cast<PxU32>(physx::PxSolverType::eTGS)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxSolverType::Enum> {
PxEnumTraits() : NameConversion(g_physx__PxSolverType__EnumConversion) {}
const PxU32ToName *NameConversion;
};
class PxSceneDesc;
struct PxSceneDescGeneratedValues {
PxVec3 Gravity;
PxSimulationEventCallback *SimulationEventCallback;
PxContactModifyCallback *ContactModifyCallback;
PxCCDContactModifyCallback *CcdContactModifyCallback;
const void *FilterShaderData;
PxU32 FilterShaderDataSize;
PxSimulationFilterShader FilterShader;
PxSimulationFilterCallback *FilterCallback;
PxPairFilteringMode::Enum KineKineFilteringMode;
PxPairFilteringMode::Enum StaticKineFilteringMode;
PxBroadPhaseType::Enum BroadPhaseType;
PxBroadPhaseCallback *BroadPhaseCallback;
PxSceneLimits Limits;
PxFrictionType::Enum FrictionType;
PxSolverType::Enum SolverType;
PxReal BounceThresholdVelocity;
PxReal FrictionOffsetThreshold;
PxReal CcdMaxSeparation;
PxReal SolverOffsetSlop;
PxSceneFlags Flags;
PxCpuDispatcher *CpuDispatcher;
PxCudaContextManager *CudaContextManager;
PxPruningStructureType::Enum StaticStructure;
PxPruningStructureType::Enum DynamicStructure;
PxU32 DynamicTreeRebuildRateHint;
PxSceneQueryUpdateMode::Enum SceneQueryUpdateMode;
void *UserData;
PxU32 SolverBatchSize;
PxU32 SolverArticulationBatchSize;
PxU32 NbContactDataBlocks;
PxU32 MaxNbContactDataBlocks;
PxReal MaxBiasCoefficient;
PxU32 ContactReportStreamBufferSize;
PxU32 CcdMaxPasses;
PxReal CcdThreshold;
PxReal WakeCounterResetValue;
PxBounds3 SanityBounds;
PxgDynamicsMemoryConfig GpuDynamicsConfig;
PxU32 GpuMaxNumPartitions;
PxU32 GpuComputeVersion;
PX_PHYSX_CORE_API PxSceneDescGeneratedValues(const PxSceneDesc *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, Gravity, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SimulationEventCallback, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, ContactModifyCallback, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, CcdContactModifyCallback, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, FilterShaderData, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, FilterShaderDataSize, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, FilterShader, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, FilterCallback, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, KineKineFilteringMode, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, StaticKineFilteringMode, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, BroadPhaseType, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, BroadPhaseCallback, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, Limits, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, FrictionType, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SolverType, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, BounceThresholdVelocity, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, FrictionOffsetThreshold, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, CcdMaxSeparation, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SolverOffsetSlop, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, Flags, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, CpuDispatcher, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, CudaContextManager, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, StaticStructure, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, DynamicStructure, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, DynamicTreeRebuildRateHint, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SceneQueryUpdateMode, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, UserData, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SolverBatchSize, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SolverArticulationBatchSize, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, NbContactDataBlocks, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, MaxNbContactDataBlocks, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, MaxBiasCoefficient, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, ContactReportStreamBufferSize, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, CcdMaxPasses, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, CcdThreshold, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, WakeCounterResetValue, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, SanityBounds, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, GpuDynamicsConfig, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, GpuMaxNumPartitions, PxSceneDescGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSceneDesc, GpuComputeVersion, PxSceneDescGeneratedValues)
struct PxSceneDescGeneratedInfo
{
static const char *getClassName() { return "PxSceneDesc"; }
PxWriteOnlyPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ToDefault, PxSceneDesc, const PxTolerancesScale &>
ToDefault;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_Gravity, PxSceneDesc, PxVec3, PxVec3> Gravity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SimulationEventCallback, PxSceneDesc, PxSimulationEventCallback *,
PxSimulationEventCallback *>
SimulationEventCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ContactModifyCallback, PxSceneDesc, PxContactModifyCallback *,
PxContactModifyCallback *>
ContactModifyCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdContactModifyCallback, PxSceneDesc, PxCCDContactModifyCallback *,
PxCCDContactModifyCallback *>
CcdContactModifyCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterShaderData, PxSceneDesc, const void *, const void *>
FilterShaderData;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterShaderDataSize, PxSceneDesc, PxU32, PxU32>
FilterShaderDataSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterShader, PxSceneDesc, PxSimulationFilterShader,
PxSimulationFilterShader>
FilterShader;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FilterCallback, PxSceneDesc, PxSimulationFilterCallback *,
PxSimulationFilterCallback *>
FilterCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_KineKineFilteringMode, PxSceneDesc, PxPairFilteringMode::Enum,
PxPairFilteringMode::Enum>
KineKineFilteringMode;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_StaticKineFilteringMode, PxSceneDesc, PxPairFilteringMode::Enum,
PxPairFilteringMode::Enum>
StaticKineFilteringMode;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_BroadPhaseType, PxSceneDesc, PxBroadPhaseType::Enum,
PxBroadPhaseType::Enum>
BroadPhaseType;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_BroadPhaseCallback, PxSceneDesc, PxBroadPhaseCallback *,
PxBroadPhaseCallback *>
BroadPhaseCallback;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_Limits, PxSceneDesc, PxSceneLimits, PxSceneLimits> Limits;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FrictionType, PxSceneDesc, PxFrictionType::Enum,
PxFrictionType::Enum>
FrictionType;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverType, PxSceneDesc, PxSolverType::Enum, PxSolverType::Enum>
SolverType;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_BounceThresholdVelocity, PxSceneDesc, PxReal, PxReal>
BounceThresholdVelocity;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_FrictionOffsetThreshold, PxSceneDesc, PxReal, PxReal>
FrictionOffsetThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdMaxSeparation, PxSceneDesc, PxReal, PxReal> CcdMaxSeparation;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverOffsetSlop, PxSceneDesc, PxReal, PxReal> SolverOffsetSlop;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_Flags, PxSceneDesc, PxSceneFlags, PxSceneFlags> Flags;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CpuDispatcher, PxSceneDesc, PxCpuDispatcher *, PxCpuDispatcher *>
CpuDispatcher;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CudaContextManager, PxSceneDesc, PxCudaContextManager *,
PxCudaContextManager *>
CudaContextManager;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_StaticStructure, PxSceneDesc, PxPruningStructureType::Enum,
PxPruningStructureType::Enum>
StaticStructure;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_DynamicStructure, PxSceneDesc, PxPruningStructureType::Enum,
PxPruningStructureType::Enum>
DynamicStructure;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_DynamicTreeRebuildRateHint, PxSceneDesc, PxU32, PxU32>
DynamicTreeRebuildRateHint;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SceneQueryUpdateMode, PxSceneDesc, PxSceneQueryUpdateMode::Enum,
PxSceneQueryUpdateMode::Enum>
SceneQueryUpdateMode;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_UserData, PxSceneDesc, void *, void *> UserData;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverBatchSize, PxSceneDesc, PxU32, PxU32> SolverBatchSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SolverArticulationBatchSize, PxSceneDesc, PxU32, PxU32>
SolverArticulationBatchSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_NbContactDataBlocks, PxSceneDesc, PxU32, PxU32> NbContactDataBlocks;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_MaxNbContactDataBlocks, PxSceneDesc, PxU32, PxU32>
MaxNbContactDataBlocks;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_MaxBiasCoefficient, PxSceneDesc, PxReal, PxReal> MaxBiasCoefficient;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_ContactReportStreamBufferSize, PxSceneDesc, PxU32, PxU32>
ContactReportStreamBufferSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdMaxPasses, PxSceneDesc, PxU32, PxU32> CcdMaxPasses;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_CcdThreshold, PxSceneDesc, PxReal, PxReal> CcdThreshold;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_WakeCounterResetValue, PxSceneDesc, PxReal, PxReal>
WakeCounterResetValue;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_SanityBounds, PxSceneDesc, PxBounds3, PxBounds3> SanityBounds;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuDynamicsConfig, PxSceneDesc, PxgDynamicsMemoryConfig,
PxgDynamicsMemoryConfig>
GpuDynamicsConfig;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuMaxNumPartitions, PxSceneDesc, PxU32, PxU32> GpuMaxNumPartitions;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSceneDesc_GpuComputeVersion, PxSceneDesc, PxU32, PxU32> GpuComputeVersion;
PX_PHYSX_CORE_API PxSceneDescGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxSceneDesc *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 41; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(ToDefault, inStartIndex + 0);
;
inOperator(Gravity, inStartIndex + 1);
;
inOperator(SimulationEventCallback, inStartIndex + 2);
;
inOperator(ContactModifyCallback, inStartIndex + 3);
;
inOperator(CcdContactModifyCallback, inStartIndex + 4);
;
inOperator(FilterShaderData, inStartIndex + 5);
;
inOperator(FilterShaderDataSize, inStartIndex + 6);
;
inOperator(FilterShader, inStartIndex + 7);
;
inOperator(FilterCallback, inStartIndex + 8);
;
inOperator(KineKineFilteringMode, inStartIndex + 9);
;
inOperator(StaticKineFilteringMode, inStartIndex + 10);
;
inOperator(BroadPhaseType, inStartIndex + 11);
;
inOperator(BroadPhaseCallback, inStartIndex + 12);
;
inOperator(Limits, inStartIndex + 13);
;
inOperator(FrictionType, inStartIndex + 14);
;
inOperator(SolverType, inStartIndex + 15);
;
inOperator(BounceThresholdVelocity, inStartIndex + 16);
;
inOperator(FrictionOffsetThreshold, inStartIndex + 17);
;
inOperator(CcdMaxSeparation, inStartIndex + 18);
;
inOperator(SolverOffsetSlop, inStartIndex + 19);
;
inOperator(Flags, inStartIndex + 20);
;
inOperator(CpuDispatcher, inStartIndex + 21);
;
inOperator(CudaContextManager, inStartIndex + 22);
;
inOperator(StaticStructure, inStartIndex + 23);
;
inOperator(DynamicStructure, inStartIndex + 24);
;
inOperator(DynamicTreeRebuildRateHint, inStartIndex + 25);
;
inOperator(SceneQueryUpdateMode, inStartIndex + 26);
;
inOperator(UserData, inStartIndex + 27);
;
inOperator(SolverBatchSize, inStartIndex + 28);
;
inOperator(SolverArticulationBatchSize, inStartIndex + 29);
;
inOperator(NbContactDataBlocks, inStartIndex + 30);
;
inOperator(MaxNbContactDataBlocks, inStartIndex + 31);
;
inOperator(MaxBiasCoefficient, inStartIndex + 32);
;
inOperator(ContactReportStreamBufferSize, inStartIndex + 33);
;
inOperator(CcdMaxPasses, inStartIndex + 34);
;
inOperator(CcdThreshold, inStartIndex + 35);
;
inOperator(WakeCounterResetValue, inStartIndex + 36);
;
inOperator(SanityBounds, inStartIndex + 37);
;
inOperator(GpuDynamicsConfig, inStartIndex + 38);
;
inOperator(GpuMaxNumPartitions, inStartIndex + 39);
;
inOperator(GpuComputeVersion, inStartIndex + 40);
;
return 41 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxSceneDesc> {
PxSceneDescGeneratedInfo Info;
const PxSceneDescGeneratedInfo *getInfo() { return &Info; }
};
static PxU32ToName g_physx__PxSimulationStatistics__RbPairStatsTypeConversion[] = {
{"eDISCRETE_CONTACT_PAIRS", static_cast<PxU32>(physx::PxSimulationStatistics::eDISCRETE_CONTACT_PAIRS)},
{"eCCD_PAIRS", static_cast<PxU32>(physx::PxSimulationStatistics::eCCD_PAIRS)},
{"eMODIFIED_CONTACT_PAIRS", static_cast<PxU32>(physx::PxSimulationStatistics::eMODIFIED_CONTACT_PAIRS)},
{"eTRIGGER_PAIRS", static_cast<PxU32>(physx::PxSimulationStatistics::eTRIGGER_PAIRS)},
{NULL, 0}};
template <> struct PxEnumTraits<physx::PxSimulationStatistics::RbPairStatsType> {
PxEnumTraits() : NameConversion(g_physx__PxSimulationStatistics__RbPairStatsTypeConversion) {}
const PxU32ToName *NameConversion;
};
class PxSimulationStatistics;
struct PxSimulationStatisticsGeneratedValues {
PxU32 NbActiveConstraints;
PxU32 NbActiveDynamicBodies;
PxU32 NbActiveKinematicBodies;
PxU32 NbStaticBodies;
PxU32 NbDynamicBodies;
PxU32 NbKinematicBodies;
PxU32 NbAggregates;
PxU32 NbArticulations;
PxU32 NbAxisSolverConstraints;
PxU32 CompressedContactSize;
PxU32 RequiredContactConstraintMemory;
PxU32 PeakConstraintMemory;
PxU32 NbDiscreteContactPairsTotal;
PxU32 NbDiscreteContactPairsWithCacheHits;
PxU32 NbDiscreteContactPairsWithContacts;
PxU32 NbNewPairs;
PxU32 NbLostPairs;
PxU32 NbNewTouches;
PxU32 NbLostTouches;
PxU32 NbPartitions;
PxU32 NbBroadPhaseAdds;
PxU32 NbBroadPhaseRemoves;
PxU32 NbDiscreteContactPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
PxU32 NbModifiedContactPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
PxU32 NbCCDPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
PxU32 NbTriggerPairs[PxGeometryType::eGEOMETRY_COUNT][PxGeometryType::eGEOMETRY_COUNT];
PxU32 NbShapes[PxGeometryType::eGEOMETRY_COUNT];
PX_PHYSX_CORE_API PxSimulationStatisticsGeneratedValues(const PxSimulationStatistics *inSource);
};
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbActiveConstraints, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbActiveDynamicBodies,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbActiveKinematicBodies,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbStaticBodies, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbDynamicBodies, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbKinematicBodies, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbAggregates, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbArticulations, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbAxisSolverConstraints,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, CompressedContactSize,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, RequiredContactConstraintMemory,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, PeakConstraintMemory, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbDiscreteContactPairsTotal,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbDiscreteContactPairsWithCacheHits,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbDiscreteContactPairsWithContacts,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbNewPairs, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbLostPairs, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbNewTouches, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbLostTouches, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbPartitions, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbBroadPhaseAdds, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbBroadPhaseRemoves, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbDiscreteContactPairs,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbModifiedContactPairs,
PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbCCDPairs, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbTriggerPairs, PxSimulationStatisticsGeneratedValues)
DEFINE_PROPERTY_TO_VALUE_STRUCT_MAP(PxSimulationStatistics, NbShapes, PxSimulationStatisticsGeneratedValues)
struct PxSimulationStatisticsGeneratedInfo
{
static const char *getClassName() { return "PxSimulationStatistics"; }
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbActiveConstraints, PxSimulationStatistics, PxU32,
PxU32>
NbActiveConstraints;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbActiveDynamicBodies, PxSimulationStatistics, PxU32,
PxU32>
NbActiveDynamicBodies;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbActiveKinematicBodies, PxSimulationStatistics, PxU32,
PxU32>
NbActiveKinematicBodies;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbStaticBodies, PxSimulationStatistics, PxU32, PxU32>
NbStaticBodies;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDynamicBodies, PxSimulationStatistics, PxU32, PxU32>
NbDynamicBodies;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbKinematicBodies, PxSimulationStatistics, PxU32, PxU32>
NbKinematicBodies;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbAggregates, PxSimulationStatistics, PxU32, PxU32>
NbAggregates;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbArticulations, PxSimulationStatistics, PxU32, PxU32>
NbArticulations;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbAxisSolverConstraints, PxSimulationStatistics, PxU32,
PxU32>
NbAxisSolverConstraints;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_CompressedContactSize, PxSimulationStatistics, PxU32,
PxU32>
CompressedContactSize;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_RequiredContactConstraintMemory, PxSimulationStatistics,
PxU32, PxU32>
RequiredContactConstraintMemory;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_PeakConstraintMemory, PxSimulationStatistics, PxU32,
PxU32>
PeakConstraintMemory;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDiscreteContactPairsTotal, PxSimulationStatistics,
PxU32, PxU32>
NbDiscreteContactPairsTotal;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDiscreteContactPairsWithCacheHits,
PxSimulationStatistics, PxU32, PxU32>
NbDiscreteContactPairsWithCacheHits;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbDiscreteContactPairsWithContacts,
PxSimulationStatistics, PxU32, PxU32>
NbDiscreteContactPairsWithContacts;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbNewPairs, PxSimulationStatistics, PxU32, PxU32>
NbNewPairs;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbLostPairs, PxSimulationStatistics, PxU32, PxU32>
NbLostPairs;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbNewTouches, PxSimulationStatistics, PxU32, PxU32>
NbNewTouches;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbLostTouches, PxSimulationStatistics, PxU32, PxU32>
NbLostTouches;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbPartitions, PxSimulationStatistics, PxU32, PxU32>
NbPartitions;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbBroadPhaseAdds, PxSimulationStatistics, PxU32, PxU32>
NbBroadPhaseAdds;
PxPropertyInfo<PX_PROPERTY_INFO_NAME::PxSimulationStatistics_NbBroadPhaseRemoves, PxSimulationStatistics, PxU32,
PxU32>
NbBroadPhaseRemoves;
NbDiscreteContactPairsProperty NbDiscreteContactPairs;
NbModifiedContactPairsProperty NbModifiedContactPairs;
NbCCDPairsProperty NbCCDPairs;
NbTriggerPairsProperty NbTriggerPairs;
NbShapesProperty NbShapes;
PX_PHYSX_CORE_API PxSimulationStatisticsGeneratedInfo();
template <typename TReturnType, typename TOperator> TReturnType visitType(TOperator inOperator) const {
return inOperator(reinterpret_cast<PxSimulationStatistics *>(NULL));
}
template <typename TOperator> void visitBases(TOperator inOperator) { PX_UNUSED(inOperator); }
template <typename TOperator> PxU32 visitBaseProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
return inStartIndex;
}
static PxU32 instancePropertyCount() { return 27; }
static PxU32 totalPropertyCount() { return instancePropertyCount(); }
template <typename TOperator> PxU32 visitInstanceProperties(TOperator inOperator, PxU32 inStartIndex = 0) const {
PX_UNUSED(inOperator);
PX_UNUSED(inStartIndex);
inOperator(NbActiveConstraints, inStartIndex + 0);
;
inOperator(NbActiveDynamicBodies, inStartIndex + 1);
;
inOperator(NbActiveKinematicBodies, inStartIndex + 2);
;
inOperator(NbStaticBodies, inStartIndex + 3);
;
inOperator(NbDynamicBodies, inStartIndex + 4);
;
inOperator(NbKinematicBodies, inStartIndex + 5);
;
inOperator(NbAggregates, inStartIndex + 6);
;
inOperator(NbArticulations, inStartIndex + 7);
;
inOperator(NbAxisSolverConstraints, inStartIndex + 8);
;
inOperator(CompressedContactSize, inStartIndex + 9);
;
inOperator(RequiredContactConstraintMemory, inStartIndex + 10);
;
inOperator(PeakConstraintMemory, inStartIndex + 11);
;
inOperator(NbDiscreteContactPairsTotal, inStartIndex + 12);
;
inOperator(NbDiscreteContactPairsWithCacheHits, inStartIndex + 13);
;
inOperator(NbDiscreteContactPairsWithContacts, inStartIndex + 14);
;
inOperator(NbNewPairs, inStartIndex + 15);
;
inOperator(NbLostPairs, inStartIndex + 16);
;
inOperator(NbNewTouches, inStartIndex + 17);
;
inOperator(NbLostTouches, inStartIndex + 18);
;
inOperator(NbPartitions, inStartIndex + 19);
;
inOperator(NbBroadPhaseAdds, inStartIndex + 20);
;
inOperator(NbBroadPhaseRemoves, inStartIndex + 21);
;
inOperator(NbDiscreteContactPairs, inStartIndex + 22);
;
inOperator(NbModifiedContactPairs, inStartIndex + 23);
;
inOperator(NbCCDPairs, inStartIndex + 24);
;
inOperator(NbTriggerPairs, inStartIndex + 25);
;
inOperator(NbShapes, inStartIndex + 26);
;
return 27 + inStartIndex;
}
};
template <> struct PxClassInfoTraits<PxSimulationStatistics> {
PxSimulationStatisticsGeneratedInfo Info;
const PxSimulationStatisticsGeneratedInfo *getInfo() { return &Info; }
};
#undef THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
#undef PX_PROPERTY_INFO_NAME
| 51.263274 | 120 | 0.802489 |
c5be6376bd649475e61ac51bbab45f8786efd9ca | 8,438 | c | C | sqlite/src/test_init.c | kbore/pbis-open | a05eb9309269b6402b4d6659bc45961986ea5eab | [
"Apache-2.0"
] | 372 | 2016-10-28T10:50:35.000Z | 2022-03-18T19:54:37.000Z | third_party/sqlite/src/test_init.c | rwatson/chromium-capsicum | b03da8e897f897c6ad2cda03ceda217b760fd528 | [
"BSD-3-Clause"
] | 317 | 2016-11-02T17:41:48.000Z | 2021-11-08T20:28:19.000Z | third_party/sqlite/src/test_init.c | rwatson/chromium-capsicum | b03da8e897f897c6ad2cda03ceda217b760fd528 | [
"BSD-3-Clause"
] | 107 | 2016-11-03T19:25:16.000Z | 2022-03-20T21:15:22.000Z | /*
** 2009 August 17
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
**
** The code in this file is used for testing SQLite. It is not part of
** the source code used in production systems.
**
** Specifically, this file tests the effect of errors while initializing
** the various pluggable sub-systems from within sqlite3_initialize().
** If an error occurs in sqlite3_initialize() the following should be
** true:
**
** 1) An error code is returned to the user, and
** 2) A subsequent call to sqlite3_shutdown() calls the shutdown method
** of those subsystems that were initialized, and
** 3) A subsequent call to sqlite3_initialize() attempts to initialize
** the remaining, uninitialized, subsystems.
*/
#include "sqliteInt.h"
#include <string.h>
#include <tcl.h>
static struct Wrapped {
sqlite3_pcache_methods pcache;
sqlite3_mem_methods mem;
sqlite3_mutex_methods mutex;
int mem_init; /* True if mem subsystem is initalized */
int mem_fail; /* True to fail mem subsystem inialization */
int mutex_init; /* True if mutex subsystem is initalized */
int mutex_fail; /* True to fail mutex subsystem inialization */
int pcache_init; /* True if pcache subsystem is initalized */
int pcache_fail; /* True to fail pcache subsystem inialization */
} wrapped;
static int wrMemInit(void *pAppData){
int rc;
if( wrapped.mem_fail ){
rc = SQLITE_ERROR;
}else{
rc = wrapped.mem.xInit(wrapped.mem.pAppData);
}
if( rc==SQLITE_OK ){
wrapped.mem_init = 1;
}
return rc;
}
static void wrMemShutdown(void *pAppData){
wrapped.mem.xShutdown(wrapped.mem.pAppData);
wrapped.mem_init = 0;
}
static void *wrMemMalloc(int n) {return wrapped.mem.xMalloc(n);}
static void wrMemFree(void *p) {wrapped.mem.xFree(p);}
static void *wrMemRealloc(void *p, int n) {return wrapped.mem.xRealloc(p, n);}
static int wrMemSize(void *p) {return wrapped.mem.xSize(p);}
static int wrMemRoundup(int n) {return wrapped.mem.xRoundup(n);}
static int wrMutexInit(void){
int rc;
if( wrapped.mutex_fail ){
rc = SQLITE_ERROR;
}else{
rc = wrapped.mutex.xMutexInit();
}
if( rc==SQLITE_OK ){
wrapped.mutex_init = 1;
}
return rc;
}
static int wrMutexEnd(void){
wrapped.mutex.xMutexEnd();
wrapped.mutex_init = 0;
return SQLITE_OK;
}
static sqlite3_mutex *wrMutexAlloc(int e){
return wrapped.mutex.xMutexAlloc(e);
}
static void wrMutexFree(sqlite3_mutex *p){
wrapped.mutex.xMutexFree(p);
}
static void wrMutexEnter(sqlite3_mutex *p){
wrapped.mutex.xMutexEnter(p);
}
static int wrMutexTry(sqlite3_mutex *p){
return wrapped.mutex.xMutexTry(p);
}
static void wrMutexLeave(sqlite3_mutex *p){
wrapped.mutex.xMutexLeave(p);
}
static int wrMutexHeld(sqlite3_mutex *p){
return wrapped.mutex.xMutexHeld(p);
}
static int wrMutexNotheld(sqlite3_mutex *p){
return wrapped.mutex.xMutexNotheld(p);
}
static int wrPCacheInit(void *pArg){
int rc;
if( wrapped.pcache_fail ){
rc = SQLITE_ERROR;
}else{
rc = wrapped.pcache.xInit(wrapped.pcache.pArg);
}
if( rc==SQLITE_OK ){
wrapped.pcache_init = 1;
}
return rc;
}
static void wrPCacheShutdown(void *pArg){
wrapped.pcache.xShutdown(wrapped.pcache.pArg);
wrapped.pcache_init = 0;
}
static sqlite3_pcache *wrPCacheCreate(int a, int b){
return wrapped.pcache.xCreate(a, b);
}
static void wrPCacheCachesize(sqlite3_pcache *p, int n){
wrapped.pcache.xCachesize(p, n);
}
static int wrPCachePagecount(sqlite3_pcache *p){
return wrapped.pcache.xPagecount(p);
}
static void *wrPCacheFetch(sqlite3_pcache *p, unsigned a, int b){
return wrapped.pcache.xFetch(p, a, b);
}
static void wrPCacheUnpin(sqlite3_pcache *p, void *a, int b){
wrapped.pcache.xUnpin(p, a, b);
}
static void wrPCacheRekey(sqlite3_pcache *p, void *a, unsigned b, unsigned c){
wrapped.pcache.xRekey(p, a, b, c);
}
static void wrPCacheTruncate(sqlite3_pcache *p, unsigned a){
wrapped.pcache.xTruncate(p, a);
}
static void wrPCacheDestroy(sqlite3_pcache *p){
wrapped.pcache.xDestroy(p);
}
static void installInitWrappers(void){
sqlite3_mutex_methods mutexmethods = {
wrMutexInit, wrMutexEnd, wrMutexAlloc,
wrMutexFree, wrMutexEnter, wrMutexTry,
wrMutexLeave, wrMutexHeld, wrMutexNotheld
};
sqlite3_pcache_methods pcachemethods = {
0,
wrPCacheInit, wrPCacheShutdown, wrPCacheCreate,
wrPCacheCachesize, wrPCachePagecount, wrPCacheFetch,
wrPCacheUnpin, wrPCacheRekey, wrPCacheTruncate,
wrPCacheDestroy
};
sqlite3_mem_methods memmethods = {
wrMemMalloc, wrMemFree, wrMemRealloc,
wrMemSize, wrMemRoundup, wrMemInit,
wrMemShutdown,
0
};
memset(&wrapped, 0, sizeof(wrapped));
sqlite3_shutdown();
sqlite3_config(SQLITE_CONFIG_GETMUTEX, &wrapped.mutex);
sqlite3_config(SQLITE_CONFIG_GETMALLOC, &wrapped.mem);
sqlite3_config(SQLITE_CONFIG_GETPCACHE, &wrapped.pcache);
sqlite3_config(SQLITE_CONFIG_MUTEX, &mutexmethods);
sqlite3_config(SQLITE_CONFIG_MALLOC, &memmethods);
sqlite3_config(SQLITE_CONFIG_PCACHE, &pcachemethods);
}
static int init_wrapper_install(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
int i;
installInitWrappers();
for(i=1; i<objc; i++){
char *z = Tcl_GetString(objv[i]);
if( strcmp(z, "mem")==0 ){
wrapped.mem_fail = 1;
}else if( strcmp(z, "mutex")==0 ){
wrapped.mutex_fail = 1;
}else if( strcmp(z, "pcache")==0 ){
wrapped.pcache_fail = 1;
}else{
Tcl_AppendResult(interp, "Unknown argument: \"", z, "\"");
return TCL_ERROR;
}
}
return TCL_OK;
}
static int init_wrapper_uninstall(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
memset(&wrapped, 0, sizeof(&wrapped));
sqlite3_shutdown();
sqlite3_config(SQLITE_CONFIG_MUTEX, &wrapped.mutex);
sqlite3_config(SQLITE_CONFIG_MALLOC, &wrapped.mem);
sqlite3_config(SQLITE_CONFIG_PCACHE, &wrapped.pcache);
return TCL_OK;
}
static int init_wrapper_clear(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
wrapped.mem_fail = 0;
wrapped.mutex_fail = 0;
wrapped.pcache_fail = 0;
return TCL_OK;
}
static int init_wrapper_query(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
Tcl_Obj *pRet;
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
pRet = Tcl_NewObj();
if( wrapped.mutex_init ){
Tcl_ListObjAppendElement(interp, pRet, Tcl_NewStringObj("mutex", -1));
}
if( wrapped.mem_init ){
Tcl_ListObjAppendElement(interp, pRet, Tcl_NewStringObj("mem", -1));
}
if( wrapped.pcache_init ){
Tcl_ListObjAppendElement(interp, pRet, Tcl_NewStringObj("pcache", -1));
}
Tcl_SetObjResult(interp, pRet);
return TCL_OK;
}
int Sqlitetest_init_Init(Tcl_Interp *interp){
static struct {
char *zName;
Tcl_ObjCmdProc *xProc;
} aObjCmd[] = {
{"init_wrapper_install", init_wrapper_install},
{"init_wrapper_query", init_wrapper_query },
{"init_wrapper_uninstall", init_wrapper_uninstall},
{"init_wrapper_clear", init_wrapper_clear}
};
int i;
for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, 0, 0);
}
return TCL_OK;
}
| 29.197232 | 79 | 0.68156 |
cf3172f8bbe4947fe2c52a15e034e795731bf1c9 | 9,811 | h | C | xdk-asf-3.51.0/thirdparty/qtouch/qdebug/QDebug_samd.h | j3270/SAMD_Experiments | 5c242aff44fc8d7092322d7baf2dda450a78a9b7 | [
"MIT"
] | null | null | null | xdk-asf-3.51.0/thirdparty/qtouch/qdebug/QDebug_samd.h | j3270/SAMD_Experiments | 5c242aff44fc8d7092322d7baf2dda450a78a9b7 | [
"MIT"
] | null | null | null | xdk-asf-3.51.0/thirdparty/qtouch/qdebug/QDebug_samd.h | j3270/SAMD_Experiments | 5c242aff44fc8d7092322d7baf2dda450a78a9b7 | [
"MIT"
] | null | null | null | /* This source file is part of the ATMEL QTouch Library 5.0.1 */
/*****************************************************************************
*
* \file
*
* \brief This file contains the QDebug public API that can be used to
* transfer data from a Touch Device to QTouch Studio using the QT600
* USB Bridge.
*
*
* - Userguide: QTouch Library Peripheral Touch Controller User Guide.
* - Support: https://www.microchip.com/support/
*
*
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
*
* \asf_license_start
*
* \page License
*
* Subject to your compliance with these terms, you may use Microchip
* software and any derivatives exclusively with Microchip products.
* It is your responsibility to comply with third party license terms applicable
* to your use of third party software (including open source software) that
* may accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*
* \asf_license_stop
*
******************************************************************************/
#ifndef _QDEBUG_SAMD_H_
#define _QDEBUG_SAMD_H_
#ifdef __cplusplus
extern "C"
{
#endif
/*============================ INCLUDES ======================================*/
#include "touch_api_SAMD.h"
/* ! compile file only when QDebug is enabled. */
#if DEF_TOUCH_QDEBUG_ENABLE == 1
/*======================== MANIFEST CONSTANTS ================================*/
/*! \name Subscription definitions.
*/
/* ! @{ */
#define SUBS_SIGN_ON 0
#define SUBS_GLOBAL_CONFIG 1
#define SUBS_SENSOR_CONFIG 2
#define SUBS_SIGNALS 3
#define SUBS_REF 4
#define SUBS_DELTA 5
#define SUBS_STATES 6
/* ! @} */
/*! \name PC commands.
*/
/* ! @{ */
#define QT_CMD_DUMMY 0x10
#define QT_CMD_SET_SUBS 0x11
#define QT_CMD_SET_GLOBAL_CONFIG 0x12
#define QT_CMD_SET_CH_CONFIG 0x13
#define QT_CMD_SET_MEASUREMENT_PERIOD 0x14
#define QT_CMD_SET_QM_BURST_LENGTHS 0x15
/* ! @} */
/*! \name Touch MCU data packets.
*/
/* ! @{ */
#define QT_DUMMY 0x20
#define QT_SIGN_ON 0x21
#define QT_GLOBAL_CONFIG 0x22
#define QT_SENSOR_CONFIG 0x23
#define QT_SIGNALS 0x24
#define QT_REFERENCES 0x25
#define QT_DELTAS 0x26
#define QT_STATES 0x27
/* ! @} */
/*============================ MACROS ========================================*/
/*! \name Macros for QTouch API and data structure.
*/
#ifdef DEF_TOUCH_QDEBUG_ENABLE_MUTLCAP
#define QDEBUG_SENSOR_STATES_PTR p_mutlcap_measure_data-> \
p_sensor_states
#define QDEBUG_SENSOR_PTR p_mutlcap_measure_data-> \
p_sensors
#define QDEBUG_SIGNALS_PTR p_mutlcap_measure_data-> \
p_channel_signals
#define QDEBUG_REFERENCES_PTR p_mutlcap_measure_data-> \
p_channel_references
#define QDEBUG_SENSOR_RS_VALUES p_mutlcap_measure_data-> \
p_rotor_slider_values
#define QDEBUG_LIBINFO qt_libinfo
#define QDEBUG_NUM_SENSOR_STATE_BYTES ((DEF_MUTLCAP_NUM_CHANNELS + \
7u) / 8u)
#define QDEBUG_GET_DELTA_FUNC(x, y) touch_mutlcap_sensor_get_delta( \
x, y)
#define QDEBUG_GET_LIBINFO_FUNC(x) touch_mutlcap_get_libinfo(x)
#define QDEBUG_GET_GLOBAL_PARAM_FUNC(x) touch_mutlcap_get_global_param(x)
#define QDEBUG_UPDATE_GLOBAL_PARAM_FUNC(x) touch_mutlcap_update_global_param( \
x)
#define QDEBUG_GET_SENSOR_CONFIG_FUNC(x, y) touch_mutlcap_sensor_get_config( \
x, y)
#define QDEBUG_UPDATE_SENSOR_CONFIG_FUNC(x, \
y) touch_mutlcap_sensor_update_config(x, y)
#define QDEBUG_NUM_SENSORS DEF_MUTLCAP_NUM_SENSORS
#define QDEBUG_NUM_CHANNELS DEF_MUTLCAP_NUM_CHANNELS
#define QDEBUG_NUM_ROTORS_SLIDERS DEF_MUTLCAP_NUM_ROTORS_SLIDERS
#endif
#ifdef DEF_TOUCH_QDEBUG_ENABLE_SELFCAP
#define QDEBUG_SENSOR_STATES_PTR p_selfcap_measure_data-> \
p_sensor_states
#define QDEBUG_SENSOR_PTR p_selfcap_measure_data-> \
p_sensors
#define QDEBUG_SIGNALS_PTR p_selfcap_measure_data-> \
p_channel_signals
#define QDEBUG_REFERENCES_PTR p_selfcap_measure_data-> \
p_channel_references
#define QDEBUG_SENSOR_RS_VALUES p_selfcap_measure_data-> \
p_rotor_slider_values
#define QDEBUG_LIBINFO qt_libinfo
#define QDEBUG_NUM_SENSOR_STATE_BYTES ((DEF_SELFCAP_NUM_CHANNELS + \
7u) / 8u)
#define QDEBUG_GET_DELTA_FUNC(x, y) touch_selfcap_sensor_get_delta( \
x, y)
#define QDEBUG_GET_LIBINFO_FUNC(x) touch_selfcap_get_libinfo(x)
#define QDEBUG_GET_GLOBAL_PARAM_FUNC(x) touch_selfcap_get_global_param(x)
#define QDEBUG_UPDATE_GLOBAL_PARAM_FUNC(x) touch_selfcap_update_global_param( \
x)
#define QDEBUG_GET_SENSOR_CONFIG_FUNC(x, y) touch_selfcap_sensor_get_config( \
x, y)
#define QDEBUG_UPDATE_SENSOR_CONFIG_FUNC(x, \
y) touch_selfcap_sensor_update_config(x, y)
#define QDEBUG_NUM_SENSORS DEF_SELFCAP_NUM_SENSORS
#define QDEBUG_NUM_CHANNELS DEF_SELFCAP_NUM_CHANNELS
#define QDEBUG_NUM_ROTORS_SLIDERS DEF_SELFCAP_NUM_ROTORS_SLIDERS
#endif
/*======================== EXTERN VARIABLES ==================================*/
/* ! QTouch measured data pointer. */
/* extern touch_measure_data_t *p_qt_measure_data; */
/*============================ PROTOTYPES ====================================*/
/*! \name Public functions.
*/
/* ! @{ */
/*! \brief This API initializes QDebug interface, including the low level
* hardware interface (SPI, TWI, USART etc).
* \note Must be called before using any other QDebug API.
*/
void QDebug_Init(void);
/*! \brief Command handler for the data received from QTouch Studio
* \note This function should be called in the main loop after
* measure_sensors to process the data received from QTOuch Studio.
*/
void QDebug_ProcessCommands(void);
/*! \brief Send data to QTouch Studio based on the subscription.
* \param qt_lib_flags:Change flag from measure_sensors.
*/
void QDebug_SendData(uint16_t qt_lib_flags);
/*! \brief Set subscription values.
* \note This function can be used directly in main to set data subscription
* if 1way SPI interface is used.
*/
void QDebug_SetSubscriptions(uint16_t once, uint16_t change,
uint16_t allways);
/* ! @} */
/*! \name Private functions.
*/
/* ! @{ */
/*! \brief Extract the data packet from QTouch Studio and set global config.
* \note Should only be called from the command handler.
*/
void Set_Global_Config(void);
/*! \brief Extract the data packet from QTouch Studio and set channel config.
* \note Should only be called from the command handler.
*/
void Set_Channel_Config(void);
/*! \brief Set Data Subscription values.
* \note Should only be called from the command handler.
*/
void Set_Subscriptions(void);
/*! \brief Extract the data packet from QTouch Studio and set measurement
* period.
* \note Should only be called from the command handler.
*/
void Set_Measurement_Period(void);
/*! \brief Extract the data packet from QTouch Studio and set QMatrix burst
* lengths.
* \note Should only be called from the command handler.
*/
void Set_QM_Burst_Lengths(void);
/*! \brief Extracts user data from QTouch Studio to touch mcu memory.
* \param pdata: data pointer.
* \note The data can be binary data.
*/
void Set_QT_User_Data(uint8_t *pdata);
/*! \brief Transmits a dummy packet if no other subscriptions are set.
*/
void Transmit_Dummy(void);
/*! \brief Transmits the sign on packet to QTouch Studio.
*/
void Transmit_Sign_On(void);
/*! \brief Transmits the global config struct to QTouch Studio.
*/
void Transmit_Global_Config(void);
/*! \brief Transmits the channel config struct to QTouch Studio.
*/
void Transmit_Sensor_Config(void);
/*! \brief Transmits the measurement values for each channel to QTouch Studio.
*/
void Transmit_Signals(void);
/*! \brief Transmits the channel reference values to QTouch Studio.
*/
void Transmit_Ref(void);
/*! \brief Transmits the channel delta values to QTouch Studio.
*/
void Transmit_Delta(void);
/*! \brief Transmits the state values to QTouch Studio.
*/
void Transmit_State(void);
/*! \brief Transmits the application execution timestamp values to QTouch
* Studio.
* \note This value is a combination of current_time_ms_touch (high word) &
* timer counter register (low word).
*/
void Transmit_Time_Stamps(void);
/*! \brief Transmits user data to QTouch Studio.
* \param pdata: data pointer.
* \param c: length of data in bytes.
* \note The data will be binary data.
*/
void Transmit_QT_User_Data(uint8_t *pdata, uint16_t c);
/* ! @} */
#endif /* DEF_TOUCH_QDEBUG_ENABLE == 1 */
#ifdef __cplusplus
}
#endif
#endif /* _QDEBUG_SAMD_H_ */
/* EOF */
| 33.257627 | 83 | 0.671185 |
d0a121f8cf92c215aaf2aa461407d8174fb57856 | 42,444 | c | C | src/vm/wren_core.c | aahlad2000/wren | dd1e8a00db5e0c9eb9f95dd73ebdae44904cd29d | [
"MIT"
] | 2,712 | 2018-11-23T08:38:27.000Z | 2022-03-31T16:30:29.000Z | src/vm/wren_core.c | aahlad2000/wren | dd1e8a00db5e0c9eb9f95dd73ebdae44904cd29d | [
"MIT"
] | 501 | 2018-11-24T03:02:31.000Z | 2022-03-20T01:49:49.000Z | src/vm/wren_core.c | aahlad2000/wren | dd1e8a00db5e0c9eb9f95dd73ebdae44904cd29d | [
"MIT"
] | 303 | 2018-11-22T08:18:27.000Z | 2022-03-20T10:57:42.000Z | #include <ctype.h>
#include <errno.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include "wren_common.h"
#include "wren_core.h"
#include "wren_math.h"
#include "wren_primitive.h"
#include "wren_value.h"
#include "wren_core.wren.inc"
DEF_PRIMITIVE(bool_not)
{
RETURN_BOOL(!AS_BOOL(args[0]));
}
DEF_PRIMITIVE(bool_toString)
{
if (AS_BOOL(args[0]))
{
RETURN_VAL(CONST_STRING(vm, "true"));
}
else
{
RETURN_VAL(CONST_STRING(vm, "false"));
}
}
DEF_PRIMITIVE(class_name)
{
RETURN_OBJ(AS_CLASS(args[0])->name);
}
DEF_PRIMITIVE(class_supertype)
{
ObjClass* classObj = AS_CLASS(args[0]);
// Object has no superclass.
if (classObj->superclass == NULL) RETURN_NULL;
RETURN_OBJ(classObj->superclass);
}
DEF_PRIMITIVE(class_toString)
{
RETURN_OBJ(AS_CLASS(args[0])->name);
}
DEF_PRIMITIVE(class_attributes)
{
RETURN_VAL(AS_CLASS(args[0])->attributes);
}
DEF_PRIMITIVE(fiber_new)
{
if (!validateFn(vm, args[1], "Argument")) return false;
ObjClosure* closure = AS_CLOSURE(args[1]);
if (closure->fn->arity > 1)
{
RETURN_ERROR("Function cannot take more than one parameter.");
}
RETURN_OBJ(wrenNewFiber(vm, closure));
}
DEF_PRIMITIVE(fiber_abort)
{
vm->fiber->error = args[1];
// If the error is explicitly null, it's not really an abort.
return IS_NULL(args[1]);
}
// Transfer execution to [fiber] coming from the current fiber whose stack has
// [args].
//
// [isCall] is true if [fiber] is being called and not transferred.
//
// [hasValue] is true if a value in [args] is being passed to the new fiber.
// Otherwise, `null` is implicitly being passed.
static bool runFiber(WrenVM* vm, ObjFiber* fiber, Value* args, bool isCall,
bool hasValue, const char* verb)
{
if (wrenHasError(fiber))
{
RETURN_ERROR_FMT("Cannot $ an aborted fiber.", verb);
}
if (isCall)
{
// You can't call a called fiber, but you can transfer directly to it,
// which is why this check is gated on `isCall`. This way, after resuming a
// suspended fiber, it will run and then return to the fiber that called it
// and so on.
if (fiber->caller != NULL) RETURN_ERROR("Fiber has already been called.");
if (fiber->state == FIBER_ROOT) RETURN_ERROR("Cannot call root fiber.");
// Remember who ran it.
fiber->caller = vm->fiber;
}
if (fiber->numFrames == 0)
{
RETURN_ERROR_FMT("Cannot $ a finished fiber.", verb);
}
// When the calling fiber resumes, we'll store the result of the call in its
// stack. If the call has two arguments (the fiber and the value), we only
// need one slot for the result, so discard the other slot now.
if (hasValue) vm->fiber->stackTop--;
if (fiber->numFrames == 1 &&
fiber->frames[0].ip == fiber->frames[0].closure->fn->code.data)
{
// The fiber is being started for the first time. If its function takes a
// parameter, bind an argument to it.
if (fiber->frames[0].closure->fn->arity == 1)
{
fiber->stackTop[0] = hasValue ? args[1] : NULL_VAL;
fiber->stackTop++;
}
}
else
{
// The fiber is being resumed, make yield() or transfer() return the result.
fiber->stackTop[-1] = hasValue ? args[1] : NULL_VAL;
}
vm->fiber = fiber;
return false;
}
DEF_PRIMITIVE(fiber_call)
{
return runFiber(vm, AS_FIBER(args[0]), args, true, false, "call");
}
DEF_PRIMITIVE(fiber_call1)
{
return runFiber(vm, AS_FIBER(args[0]), args, true, true, "call");
}
DEF_PRIMITIVE(fiber_current)
{
RETURN_OBJ(vm->fiber);
}
DEF_PRIMITIVE(fiber_error)
{
RETURN_VAL(AS_FIBER(args[0])->error);
}
DEF_PRIMITIVE(fiber_isDone)
{
ObjFiber* runFiber = AS_FIBER(args[0]);
RETURN_BOOL(runFiber->numFrames == 0 || wrenHasError(runFiber));
}
DEF_PRIMITIVE(fiber_suspend)
{
// Switching to a null fiber tells the interpreter to stop and exit.
vm->fiber = NULL;
vm->apiStack = NULL;
return false;
}
DEF_PRIMITIVE(fiber_transfer)
{
return runFiber(vm, AS_FIBER(args[0]), args, false, false, "transfer to");
}
DEF_PRIMITIVE(fiber_transfer1)
{
return runFiber(vm, AS_FIBER(args[0]), args, false, true, "transfer to");
}
DEF_PRIMITIVE(fiber_transferError)
{
runFiber(vm, AS_FIBER(args[0]), args, false, true, "transfer to");
vm->fiber->error = args[1];
return false;
}
DEF_PRIMITIVE(fiber_try)
{
runFiber(vm, AS_FIBER(args[0]), args, true, false, "try");
// If we're switching to a valid fiber to try, remember that we're trying it.
if (!wrenHasError(vm->fiber)) vm->fiber->state = FIBER_TRY;
return false;
}
DEF_PRIMITIVE(fiber_try1)
{
runFiber(vm, AS_FIBER(args[0]), args, true, true, "try");
// If we're switching to a valid fiber to try, remember that we're trying it.
if (!wrenHasError(vm->fiber)) vm->fiber->state = FIBER_TRY;
return false;
}
DEF_PRIMITIVE(fiber_yield)
{
ObjFiber* current = vm->fiber;
vm->fiber = current->caller;
// Unhook this fiber from the one that called it.
current->caller = NULL;
current->state = FIBER_OTHER;
if (vm->fiber != NULL)
{
// Make the caller's run method return null.
vm->fiber->stackTop[-1] = NULL_VAL;
}
return false;
}
DEF_PRIMITIVE(fiber_yield1)
{
ObjFiber* current = vm->fiber;
vm->fiber = current->caller;
// Unhook this fiber from the one that called it.
current->caller = NULL;
current->state = FIBER_OTHER;
if (vm->fiber != NULL)
{
// Make the caller's run method return the argument passed to yield.
vm->fiber->stackTop[-1] = args[1];
// When the yielding fiber resumes, we'll store the result of the yield
// call in its stack. Since Fiber.yield(value) has two arguments (the Fiber
// class and the value) and we only need one slot for the result, discard
// the other slot now.
current->stackTop--;
}
return false;
}
DEF_PRIMITIVE(fn_new)
{
if (!validateFn(vm, args[1], "Argument")) return false;
// The block argument is already a function, so just return it.
RETURN_VAL(args[1]);
}
DEF_PRIMITIVE(fn_arity)
{
RETURN_NUM(AS_CLOSURE(args[0])->fn->arity);
}
static void call_fn(WrenVM* vm, Value* args, int numArgs)
{
// +1 to include the function itself.
wrenCallFunction(vm, vm->fiber, AS_CLOSURE(args[0]), numArgs + 1);
}
#define DEF_FN_CALL(numArgs) \
DEF_PRIMITIVE(fn_call##numArgs) \
{ \
call_fn(vm, args, numArgs); \
return false; \
}
DEF_FN_CALL(0)
DEF_FN_CALL(1)
DEF_FN_CALL(2)
DEF_FN_CALL(3)
DEF_FN_CALL(4)
DEF_FN_CALL(5)
DEF_FN_CALL(6)
DEF_FN_CALL(7)
DEF_FN_CALL(8)
DEF_FN_CALL(9)
DEF_FN_CALL(10)
DEF_FN_CALL(11)
DEF_FN_CALL(12)
DEF_FN_CALL(13)
DEF_FN_CALL(14)
DEF_FN_CALL(15)
DEF_FN_CALL(16)
DEF_PRIMITIVE(fn_toString)
{
RETURN_VAL(CONST_STRING(vm, "<fn>"));
}
// Creates a new list of size args[1], with all elements initialized to args[2].
DEF_PRIMITIVE(list_filled)
{
if (!validateInt(vm, args[1], "Size")) return false;
if (AS_NUM(args[1]) < 0) RETURN_ERROR("Size cannot be negative.");
uint32_t size = (uint32_t)AS_NUM(args[1]);
ObjList* list = wrenNewList(vm, size);
for (uint32_t i = 0; i < size; i++)
{
list->elements.data[i] = args[2];
}
RETURN_OBJ(list);
}
DEF_PRIMITIVE(list_new)
{
RETURN_OBJ(wrenNewList(vm, 0));
}
DEF_PRIMITIVE(list_add)
{
wrenValueBufferWrite(vm, &AS_LIST(args[0])->elements, args[1]);
RETURN_VAL(args[1]);
}
// Adds an element to the list and then returns the list itself. This is called
// by the compiler when compiling list literals instead of using add() to
// minimize stack churn.
DEF_PRIMITIVE(list_addCore)
{
wrenValueBufferWrite(vm, &AS_LIST(args[0])->elements, args[1]);
// Return the list.
RETURN_VAL(args[0]);
}
DEF_PRIMITIVE(list_clear)
{
wrenValueBufferClear(vm, &AS_LIST(args[0])->elements);
RETURN_NULL;
}
DEF_PRIMITIVE(list_count)
{
RETURN_NUM(AS_LIST(args[0])->elements.count);
}
DEF_PRIMITIVE(list_insert)
{
ObjList* list = AS_LIST(args[0]);
// count + 1 here so you can "insert" at the very end.
uint32_t index = validateIndex(vm, args[1], list->elements.count + 1,
"Index");
if (index == UINT32_MAX) return false;
wrenListInsert(vm, list, args[2], index);
RETURN_VAL(args[2]);
}
DEF_PRIMITIVE(list_iterate)
{
ObjList* list = AS_LIST(args[0]);
// If we're starting the iteration, return the first index.
if (IS_NULL(args[1]))
{
if (list->elements.count == 0) RETURN_FALSE;
RETURN_NUM(0);
}
if (!validateInt(vm, args[1], "Iterator")) return false;
// Stop if we're out of bounds.
double index = AS_NUM(args[1]);
if (index < 0 || index >= list->elements.count - 1) RETURN_FALSE;
// Otherwise, move to the next index.
RETURN_NUM(index + 1);
}
DEF_PRIMITIVE(list_iteratorValue)
{
ObjList* list = AS_LIST(args[0]);
uint32_t index = validateIndex(vm, args[1], list->elements.count, "Iterator");
if (index == UINT32_MAX) return false;
RETURN_VAL(list->elements.data[index]);
}
DEF_PRIMITIVE(list_removeAt)
{
ObjList* list = AS_LIST(args[0]);
uint32_t index = validateIndex(vm, args[1], list->elements.count, "Index");
if (index == UINT32_MAX) return false;
RETURN_VAL(wrenListRemoveAt(vm, list, index));
}
DEF_PRIMITIVE(list_removeValue) {
ObjList* list = AS_LIST(args[0]);
int index = wrenListIndexOf(vm, list, args[1]);
if(index == -1) RETURN_NULL;
RETURN_VAL(wrenListRemoveAt(vm, list, index));
}
DEF_PRIMITIVE(list_indexOf)
{
ObjList* list = AS_LIST(args[0]);
RETURN_NUM(wrenListIndexOf(vm, list, args[1]));
}
DEF_PRIMITIVE(list_swap)
{
ObjList* list = AS_LIST(args[0]);
uint32_t indexA = validateIndex(vm, args[1], list->elements.count, "Index 0");
if (indexA == UINT32_MAX) return false;
uint32_t indexB = validateIndex(vm, args[2], list->elements.count, "Index 1");
if (indexB == UINT32_MAX) return false;
Value a = list->elements.data[indexA];
list->elements.data[indexA] = list->elements.data[indexB];
list->elements.data[indexB] = a;
RETURN_NULL;
}
DEF_PRIMITIVE(list_subscript)
{
ObjList* list = AS_LIST(args[0]);
if (IS_NUM(args[1]))
{
uint32_t index = validateIndex(vm, args[1], list->elements.count,
"Subscript");
if (index == UINT32_MAX) return false;
RETURN_VAL(list->elements.data[index]);
}
if (!IS_RANGE(args[1]))
{
RETURN_ERROR("Subscript must be a number or a range.");
}
int step;
uint32_t count = list->elements.count;
uint32_t start = calculateRange(vm, AS_RANGE(args[1]), &count, &step);
if (start == UINT32_MAX) return false;
ObjList* result = wrenNewList(vm, count);
for (uint32_t i = 0; i < count; i++)
{
result->elements.data[i] = list->elements.data[start + i * step];
}
RETURN_OBJ(result);
}
DEF_PRIMITIVE(list_subscriptSetter)
{
ObjList* list = AS_LIST(args[0]);
uint32_t index = validateIndex(vm, args[1], list->elements.count,
"Subscript");
if (index == UINT32_MAX) return false;
list->elements.data[index] = args[2];
RETURN_VAL(args[2]);
}
DEF_PRIMITIVE(map_new)
{
RETURN_OBJ(wrenNewMap(vm));
}
DEF_PRIMITIVE(map_subscript)
{
if (!validateKey(vm, args[1])) return false;
ObjMap* map = AS_MAP(args[0]);
Value value = wrenMapGet(map, args[1]);
if (IS_UNDEFINED(value)) RETURN_NULL;
RETURN_VAL(value);
}
DEF_PRIMITIVE(map_subscriptSetter)
{
if (!validateKey(vm, args[1])) return false;
wrenMapSet(vm, AS_MAP(args[0]), args[1], args[2]);
RETURN_VAL(args[2]);
}
// Adds an entry to the map and then returns the map itself. This is called by
// the compiler when compiling map literals instead of using [_]=(_) to
// minimize stack churn.
DEF_PRIMITIVE(map_addCore)
{
if (!validateKey(vm, args[1])) return false;
wrenMapSet(vm, AS_MAP(args[0]), args[1], args[2]);
// Return the map itself.
RETURN_VAL(args[0]);
}
DEF_PRIMITIVE(map_clear)
{
wrenMapClear(vm, AS_MAP(args[0]));
RETURN_NULL;
}
DEF_PRIMITIVE(map_containsKey)
{
if (!validateKey(vm, args[1])) return false;
RETURN_BOOL(!IS_UNDEFINED(wrenMapGet(AS_MAP(args[0]), args[1])));
}
DEF_PRIMITIVE(map_count)
{
RETURN_NUM(AS_MAP(args[0])->count);
}
DEF_PRIMITIVE(map_iterate)
{
ObjMap* map = AS_MAP(args[0]);
if (map->count == 0) RETURN_FALSE;
// If we're starting the iteration, start at the first used entry.
uint32_t index = 0;
// Otherwise, start one past the last entry we stopped at.
if (!IS_NULL(args[1]))
{
if (!validateInt(vm, args[1], "Iterator")) return false;
if (AS_NUM(args[1]) < 0) RETURN_FALSE;
index = (uint32_t)AS_NUM(args[1]);
if (index >= map->capacity) RETURN_FALSE;
// Advance the iterator.
index++;
}
// Find a used entry, if any.
for (; index < map->capacity; index++)
{
if (!IS_UNDEFINED(map->entries[index].key)) RETURN_NUM(index);
}
// If we get here, walked all of the entries.
RETURN_FALSE;
}
DEF_PRIMITIVE(map_remove)
{
if (!validateKey(vm, args[1])) return false;
RETURN_VAL(wrenMapRemoveKey(vm, AS_MAP(args[0]), args[1]));
}
DEF_PRIMITIVE(map_keyIteratorValue)
{
ObjMap* map = AS_MAP(args[0]);
uint32_t index = validateIndex(vm, args[1], map->capacity, "Iterator");
if (index == UINT32_MAX) return false;
MapEntry* entry = &map->entries[index];
if (IS_UNDEFINED(entry->key))
{
RETURN_ERROR("Invalid map iterator.");
}
RETURN_VAL(entry->key);
}
DEF_PRIMITIVE(map_valueIteratorValue)
{
ObjMap* map = AS_MAP(args[0]);
uint32_t index = validateIndex(vm, args[1], map->capacity, "Iterator");
if (index == UINT32_MAX) return false;
MapEntry* entry = &map->entries[index];
if (IS_UNDEFINED(entry->key))
{
RETURN_ERROR("Invalid map iterator.");
}
RETURN_VAL(entry->value);
}
DEF_PRIMITIVE(null_not)
{
RETURN_VAL(TRUE_VAL);
}
DEF_PRIMITIVE(null_toString)
{
RETURN_VAL(CONST_STRING(vm, "null"));
}
DEF_PRIMITIVE(num_fromString)
{
if (!validateString(vm, args[1], "Argument")) return false;
ObjString* string = AS_STRING(args[1]);
// Corner case: Can't parse an empty string.
if (string->length == 0) RETURN_NULL;
errno = 0;
char* end;
double number = strtod(string->value, &end);
// Skip past any trailing whitespace.
while (*end != '\0' && isspace((unsigned char)*end)) end++;
if (errno == ERANGE) RETURN_ERROR("Number literal is too large.");
// We must have consumed the entire string. Otherwise, it contains non-number
// characters and we can't parse it.
if (end < string->value + string->length) RETURN_NULL;
RETURN_NUM(number);
}
// Defines a primitive on Num that calls infix [op] and returns [type].
#define DEF_NUM_CONSTANT(name, value) \
DEF_PRIMITIVE(num_##name) \
{ \
RETURN_NUM(value); \
}
DEF_NUM_CONSTANT(infinity, INFINITY)
DEF_NUM_CONSTANT(nan, WREN_DOUBLE_NAN)
DEF_NUM_CONSTANT(pi, 3.14159265358979323846264338327950288)
DEF_NUM_CONSTANT(tau, 6.28318530717958647692528676655900577)
DEF_NUM_CONSTANT(largest, DBL_MAX)
DEF_NUM_CONSTANT(smallest, DBL_MIN)
DEF_NUM_CONSTANT(maxSafeInteger, 9007199254740991.0)
DEF_NUM_CONSTANT(minSafeInteger, -9007199254740991.0)
// Defines a primitive on Num that calls infix [op] and returns [type].
#define DEF_NUM_INFIX(name, op, type) \
DEF_PRIMITIVE(num_##name) \
{ \
if (!validateNum(vm, args[1], "Right operand")) return false; \
RETURN_##type(AS_NUM(args[0]) op AS_NUM(args[1])); \
}
DEF_NUM_INFIX(minus, -, NUM)
DEF_NUM_INFIX(plus, +, NUM)
DEF_NUM_INFIX(multiply, *, NUM)
DEF_NUM_INFIX(divide, /, NUM)
DEF_NUM_INFIX(lt, <, BOOL)
DEF_NUM_INFIX(gt, >, BOOL)
DEF_NUM_INFIX(lte, <=, BOOL)
DEF_NUM_INFIX(gte, >=, BOOL)
// Defines a primitive on Num that call infix bitwise [op].
#define DEF_NUM_BITWISE(name, op) \
DEF_PRIMITIVE(num_bitwise##name) \
{ \
if (!validateNum(vm, args[1], "Right operand")) return false; \
uint32_t left = (uint32_t)AS_NUM(args[0]); \
uint32_t right = (uint32_t)AS_NUM(args[1]); \
RETURN_NUM(left op right); \
}
DEF_NUM_BITWISE(And, &)
DEF_NUM_BITWISE(Or, |)
DEF_NUM_BITWISE(Xor, ^)
DEF_NUM_BITWISE(LeftShift, <<)
DEF_NUM_BITWISE(RightShift, >>)
// Defines a primitive method on Num that returns the result of [fn].
#define DEF_NUM_FN(name, fn) \
DEF_PRIMITIVE(num_##name) \
{ \
RETURN_NUM(fn(AS_NUM(args[0]))); \
}
DEF_NUM_FN(abs, fabs)
DEF_NUM_FN(acos, acos)
DEF_NUM_FN(asin, asin)
DEF_NUM_FN(atan, atan)
DEF_NUM_FN(cbrt, cbrt)
DEF_NUM_FN(ceil, ceil)
DEF_NUM_FN(cos, cos)
DEF_NUM_FN(floor, floor)
DEF_NUM_FN(negate, -)
DEF_NUM_FN(round, round)
DEF_NUM_FN(sin, sin)
DEF_NUM_FN(sqrt, sqrt)
DEF_NUM_FN(tan, tan)
DEF_NUM_FN(log, log)
DEF_NUM_FN(log2, log2)
DEF_NUM_FN(exp, exp)
DEF_PRIMITIVE(num_mod)
{
if (!validateNum(vm, args[1], "Right operand")) return false;
RETURN_NUM(fmod(AS_NUM(args[0]), AS_NUM(args[1])));
}
DEF_PRIMITIVE(num_eqeq)
{
if (!IS_NUM(args[1])) RETURN_FALSE;
RETURN_BOOL(AS_NUM(args[0]) == AS_NUM(args[1]));
}
DEF_PRIMITIVE(num_bangeq)
{
if (!IS_NUM(args[1])) RETURN_TRUE;
RETURN_BOOL(AS_NUM(args[0]) != AS_NUM(args[1]));
}
DEF_PRIMITIVE(num_bitwiseNot)
{
// Bitwise operators always work on 32-bit unsigned ints.
RETURN_NUM(~(uint32_t)AS_NUM(args[0]));
}
DEF_PRIMITIVE(num_dotDot)
{
if (!validateNum(vm, args[1], "Right hand side of range")) return false;
double from = AS_NUM(args[0]);
double to = AS_NUM(args[1]);
RETURN_VAL(wrenNewRange(vm, from, to, true));
}
DEF_PRIMITIVE(num_dotDotDot)
{
if (!validateNum(vm, args[1], "Right hand side of range")) return false;
double from = AS_NUM(args[0]);
double to = AS_NUM(args[1]);
RETURN_VAL(wrenNewRange(vm, from, to, false));
}
DEF_PRIMITIVE(num_atan2)
{
if (!validateNum(vm, args[1], "x value")) return false;
RETURN_NUM(atan2(AS_NUM(args[0]), AS_NUM(args[1])));
}
DEF_PRIMITIVE(num_min)
{
if (!validateNum(vm, args[1], "Other value")) return false;
double value = AS_NUM(args[0]);
double other = AS_NUM(args[1]);
RETURN_NUM(value <= other ? value : other);
}
DEF_PRIMITIVE(num_max)
{
if (!validateNum(vm, args[1], "Other value")) return false;
double value = AS_NUM(args[0]);
double other = AS_NUM(args[1]);
RETURN_NUM(value > other ? value : other);
}
DEF_PRIMITIVE(num_clamp)
{
if (!validateNum(vm, args[1], "Min value")) return false;
if (!validateNum(vm, args[2], "Max value")) return false;
double value = AS_NUM(args[0]);
double min = AS_NUM(args[1]);
double max = AS_NUM(args[2]);
double result = (value < min) ? min : ((value > max) ? max : value);
RETURN_NUM(result);
}
DEF_PRIMITIVE(num_pow)
{
if (!validateNum(vm, args[1], "Power value")) return false;
RETURN_NUM(pow(AS_NUM(args[0]), AS_NUM(args[1])));
}
DEF_PRIMITIVE(num_fraction)
{
double unused;
RETURN_NUM(modf(AS_NUM(args[0]) , &unused));
}
DEF_PRIMITIVE(num_isInfinity)
{
RETURN_BOOL(isinf(AS_NUM(args[0])));
}
DEF_PRIMITIVE(num_isInteger)
{
double value = AS_NUM(args[0]);
if (isnan(value) || isinf(value)) RETURN_FALSE;
RETURN_BOOL(trunc(value) == value);
}
DEF_PRIMITIVE(num_isNan)
{
RETURN_BOOL(isnan(AS_NUM(args[0])));
}
DEF_PRIMITIVE(num_sign)
{
double value = AS_NUM(args[0]);
if (value > 0)
{
RETURN_NUM(1);
}
else if (value < 0)
{
RETURN_NUM(-1);
}
else
{
RETURN_NUM(0);
}
}
DEF_PRIMITIVE(num_toString)
{
RETURN_VAL(wrenNumToString(vm, AS_NUM(args[0])));
}
DEF_PRIMITIVE(num_truncate)
{
double integer;
modf(AS_NUM(args[0]) , &integer);
RETURN_NUM(integer);
}
DEF_PRIMITIVE(object_same)
{
RETURN_BOOL(wrenValuesEqual(args[1], args[2]));
}
DEF_PRIMITIVE(object_not)
{
RETURN_VAL(FALSE_VAL);
}
DEF_PRIMITIVE(object_eqeq)
{
RETURN_BOOL(wrenValuesEqual(args[0], args[1]));
}
DEF_PRIMITIVE(object_bangeq)
{
RETURN_BOOL(!wrenValuesEqual(args[0], args[1]));
}
DEF_PRIMITIVE(object_is)
{
if (!IS_CLASS(args[1]))
{
RETURN_ERROR("Right operand must be a class.");
}
ObjClass *classObj = wrenGetClass(vm, args[0]);
ObjClass *baseClassObj = AS_CLASS(args[1]);
// Walk the superclass chain looking for the class.
do
{
if (baseClassObj == classObj) RETURN_BOOL(true);
classObj = classObj->superclass;
}
while (classObj != NULL);
RETURN_BOOL(false);
}
DEF_PRIMITIVE(object_toString)
{
Obj* obj = AS_OBJ(args[0]);
Value name = OBJ_VAL(obj->classObj->name);
RETURN_VAL(wrenStringFormat(vm, "instance of @", name));
}
DEF_PRIMITIVE(object_type)
{
RETURN_OBJ(wrenGetClass(vm, args[0]));
}
DEF_PRIMITIVE(range_from)
{
RETURN_NUM(AS_RANGE(args[0])->from);
}
DEF_PRIMITIVE(range_to)
{
RETURN_NUM(AS_RANGE(args[0])->to);
}
DEF_PRIMITIVE(range_min)
{
ObjRange* range = AS_RANGE(args[0]);
RETURN_NUM(fmin(range->from, range->to));
}
DEF_PRIMITIVE(range_max)
{
ObjRange* range = AS_RANGE(args[0]);
RETURN_NUM(fmax(range->from, range->to));
}
DEF_PRIMITIVE(range_isInclusive)
{
RETURN_BOOL(AS_RANGE(args[0])->isInclusive);
}
DEF_PRIMITIVE(range_iterate)
{
ObjRange* range = AS_RANGE(args[0]);
// Special case: empty range.
if (range->from == range->to && !range->isInclusive) RETURN_FALSE;
// Start the iteration.
if (IS_NULL(args[1])) RETURN_NUM(range->from);
if (!validateNum(vm, args[1], "Iterator")) return false;
double iterator = AS_NUM(args[1]);
// Iterate towards [to] from [from].
if (range->from < range->to)
{
iterator++;
if (iterator > range->to) RETURN_FALSE;
}
else
{
iterator--;
if (iterator < range->to) RETURN_FALSE;
}
if (!range->isInclusive && iterator == range->to) RETURN_FALSE;
RETURN_NUM(iterator);
}
DEF_PRIMITIVE(range_iteratorValue)
{
// Assume the iterator is a number so that is the value of the range.
RETURN_VAL(args[1]);
}
DEF_PRIMITIVE(range_toString)
{
ObjRange* range = AS_RANGE(args[0]);
Value from = wrenNumToString(vm, range->from);
wrenPushRoot(vm, AS_OBJ(from));
Value to = wrenNumToString(vm, range->to);
wrenPushRoot(vm, AS_OBJ(to));
Value result = wrenStringFormat(vm, "@$@", from,
range->isInclusive ? ".." : "...", to);
wrenPopRoot(vm);
wrenPopRoot(vm);
RETURN_VAL(result);
}
DEF_PRIMITIVE(string_fromCodePoint)
{
if (!validateInt(vm, args[1], "Code point")) return false;
int codePoint = (int)AS_NUM(args[1]);
if (codePoint < 0)
{
RETURN_ERROR("Code point cannot be negative.");
}
else if (codePoint > 0x10ffff)
{
RETURN_ERROR("Code point cannot be greater than 0x10ffff.");
}
RETURN_VAL(wrenStringFromCodePoint(vm, codePoint));
}
DEF_PRIMITIVE(string_fromByte)
{
if (!validateInt(vm, args[1], "Byte")) return false;
int byte = (int) AS_NUM(args[1]);
if (byte < 0)
{
RETURN_ERROR("Byte cannot be negative.");
}
else if (byte > 0xff)
{
RETURN_ERROR("Byte cannot be greater than 0xff.");
}
RETURN_VAL(wrenStringFromByte(vm, (uint8_t) byte));
}
DEF_PRIMITIVE(string_byteAt)
{
ObjString* string = AS_STRING(args[0]);
uint32_t index = validateIndex(vm, args[1], string->length, "Index");
if (index == UINT32_MAX) return false;
RETURN_NUM((uint8_t)string->value[index]);
}
DEF_PRIMITIVE(string_byteCount)
{
RETURN_NUM(AS_STRING(args[0])->length);
}
DEF_PRIMITIVE(string_codePointAt)
{
ObjString* string = AS_STRING(args[0]);
uint32_t index = validateIndex(vm, args[1], string->length, "Index");
if (index == UINT32_MAX) return false;
// If we are in the middle of a UTF-8 sequence, indicate that.
const uint8_t* bytes = (uint8_t*)string->value;
if ((bytes[index] & 0xc0) == 0x80) RETURN_NUM(-1);
// Decode the UTF-8 sequence.
RETURN_NUM(wrenUtf8Decode((uint8_t*)string->value + index,
string->length - index));
}
DEF_PRIMITIVE(string_contains)
{
if (!validateString(vm, args[1], "Argument")) return false;
ObjString* string = AS_STRING(args[0]);
ObjString* search = AS_STRING(args[1]);
RETURN_BOOL(wrenStringFind(string, search, 0) != UINT32_MAX);
}
DEF_PRIMITIVE(string_endsWith)
{
if (!validateString(vm, args[1], "Argument")) return false;
ObjString* string = AS_STRING(args[0]);
ObjString* search = AS_STRING(args[1]);
// Edge case: If the search string is longer then return false right away.
if (search->length > string->length) RETURN_FALSE;
RETURN_BOOL(memcmp(string->value + string->length - search->length,
search->value, search->length) == 0);
}
DEF_PRIMITIVE(string_indexOf1)
{
if (!validateString(vm, args[1], "Argument")) return false;
ObjString* string = AS_STRING(args[0]);
ObjString* search = AS_STRING(args[1]);
uint32_t index = wrenStringFind(string, search, 0);
RETURN_NUM(index == UINT32_MAX ? -1 : (int)index);
}
DEF_PRIMITIVE(string_indexOf2)
{
if (!validateString(vm, args[1], "Argument")) return false;
ObjString* string = AS_STRING(args[0]);
ObjString* search = AS_STRING(args[1]);
uint32_t start = validateIndex(vm, args[2], string->length, "Start");
if (start == UINT32_MAX) return false;
uint32_t index = wrenStringFind(string, search, start);
RETURN_NUM(index == UINT32_MAX ? -1 : (int)index);
}
DEF_PRIMITIVE(string_iterate)
{
ObjString* string = AS_STRING(args[0]);
// If we're starting the iteration, return the first index.
if (IS_NULL(args[1]))
{
if (string->length == 0) RETURN_FALSE;
RETURN_NUM(0);
}
if (!validateInt(vm, args[1], "Iterator")) return false;
if (AS_NUM(args[1]) < 0) RETURN_FALSE;
uint32_t index = (uint32_t)AS_NUM(args[1]);
// Advance to the beginning of the next UTF-8 sequence.
do
{
index++;
if (index >= string->length) RETURN_FALSE;
} while ((string->value[index] & 0xc0) == 0x80);
RETURN_NUM(index);
}
DEF_PRIMITIVE(string_iterateByte)
{
ObjString* string = AS_STRING(args[0]);
// If we're starting the iteration, return the first index.
if (IS_NULL(args[1]))
{
if (string->length == 0) RETURN_FALSE;
RETURN_NUM(0);
}
if (!validateInt(vm, args[1], "Iterator")) return false;
if (AS_NUM(args[1]) < 0) RETURN_FALSE;
uint32_t index = (uint32_t)AS_NUM(args[1]);
// Advance to the next byte.
index++;
if (index >= string->length) RETURN_FALSE;
RETURN_NUM(index);
}
DEF_PRIMITIVE(string_iteratorValue)
{
ObjString* string = AS_STRING(args[0]);
uint32_t index = validateIndex(vm, args[1], string->length, "Iterator");
if (index == UINT32_MAX) return false;
RETURN_VAL(wrenStringCodePointAt(vm, string, index));
}
DEF_PRIMITIVE(string_startsWith)
{
if (!validateString(vm, args[1], "Argument")) return false;
ObjString* string = AS_STRING(args[0]);
ObjString* search = AS_STRING(args[1]);
// Edge case: If the search string is longer then return false right away.
if (search->length > string->length) RETURN_FALSE;
RETURN_BOOL(memcmp(string->value, search->value, search->length) == 0);
}
DEF_PRIMITIVE(string_plus)
{
if (!validateString(vm, args[1], "Right operand")) return false;
RETURN_VAL(wrenStringFormat(vm, "@@", args[0], args[1]));
}
DEF_PRIMITIVE(string_subscript)
{
ObjString* string = AS_STRING(args[0]);
if (IS_NUM(args[1]))
{
int index = validateIndex(vm, args[1], string->length, "Subscript");
if (index == -1) return false;
RETURN_VAL(wrenStringCodePointAt(vm, string, index));
}
if (!IS_RANGE(args[1]))
{
RETURN_ERROR("Subscript must be a number or a range.");
}
int step;
uint32_t count = string->length;
int start = calculateRange(vm, AS_RANGE(args[1]), &count, &step);
if (start == -1) return false;
RETURN_VAL(wrenNewStringFromRange(vm, string, start, count, step));
}
DEF_PRIMITIVE(string_toString)
{
RETURN_VAL(args[0]);
}
DEF_PRIMITIVE(system_clock)
{
RETURN_NUM((double)clock() / CLOCKS_PER_SEC);
}
DEF_PRIMITIVE(system_gc)
{
wrenCollectGarbage(vm);
RETURN_NULL;
}
DEF_PRIMITIVE(system_writeString)
{
if (vm->config.writeFn != NULL)
{
vm->config.writeFn(vm, AS_CSTRING(args[1]));
}
RETURN_VAL(args[1]);
}
// Creates either the Object or Class class in the core module with [name].
static ObjClass* defineClass(WrenVM* vm, ObjModule* module, const char* name)
{
ObjString* nameString = AS_STRING(wrenNewString(vm, name));
wrenPushRoot(vm, (Obj*)nameString);
ObjClass* classObj = wrenNewSingleClass(vm, 0, nameString);
wrenDefineVariable(vm, module, name, nameString->length, OBJ_VAL(classObj), NULL);
wrenPopRoot(vm);
return classObj;
}
void wrenInitializeCore(WrenVM* vm)
{
ObjModule* coreModule = wrenNewModule(vm, NULL);
wrenPushRoot(vm, (Obj*)coreModule);
// The core module's key is null in the module map.
wrenMapSet(vm, vm->modules, NULL_VAL, OBJ_VAL(coreModule));
wrenPopRoot(vm); // coreModule.
// Define the root Object class. This has to be done a little specially
// because it has no superclass.
vm->objectClass = defineClass(vm, coreModule, "Object");
PRIMITIVE(vm->objectClass, "!", object_not);
PRIMITIVE(vm->objectClass, "==(_)", object_eqeq);
PRIMITIVE(vm->objectClass, "!=(_)", object_bangeq);
PRIMITIVE(vm->objectClass, "is(_)", object_is);
PRIMITIVE(vm->objectClass, "toString", object_toString);
PRIMITIVE(vm->objectClass, "type", object_type);
// Now we can define Class, which is a subclass of Object.
vm->classClass = defineClass(vm, coreModule, "Class");
wrenBindSuperclass(vm, vm->classClass, vm->objectClass);
PRIMITIVE(vm->classClass, "name", class_name);
PRIMITIVE(vm->classClass, "supertype", class_supertype);
PRIMITIVE(vm->classClass, "toString", class_toString);
PRIMITIVE(vm->classClass, "attributes", class_attributes);
// Finally, we can define Object's metaclass which is a subclass of Class.
ObjClass* objectMetaclass = defineClass(vm, coreModule, "Object metaclass");
// Wire up the metaclass relationships now that all three classes are built.
vm->objectClass->obj.classObj = objectMetaclass;
objectMetaclass->obj.classObj = vm->classClass;
vm->classClass->obj.classObj = vm->classClass;
// Do this after wiring up the metaclasses so objectMetaclass doesn't get
// collected.
wrenBindSuperclass(vm, objectMetaclass, vm->classClass);
PRIMITIVE(objectMetaclass, "same(_,_)", object_same);
// The core class diagram ends up looking like this, where single lines point
// to a class's superclass, and double lines point to its metaclass:
//
// .------------------------------------. .====.
// | .---------------. | # #
// v | v | v #
// .---------. .-------------------. .-------. #
// | Object |==>| Object metaclass |==>| Class |=="
// '---------' '-------------------' '-------'
// ^ ^ ^ ^ ^
// | .--------------' # | #
// | | # | #
// .---------. .-------------------. # | # -.
// | Base |==>| Base metaclass |======" | # |
// '---------' '-------------------' | # |
// ^ | # |
// | .------------------' # | Example classes
// | | # |
// .---------. .-------------------. # |
// | Derived |==>| Derived metaclass |==========" |
// '---------' '-------------------' -'
// The rest of the classes can now be defined normally.
wrenInterpret(vm, NULL, coreModuleSource);
vm->boolClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Bool"));
PRIMITIVE(vm->boolClass, "toString", bool_toString);
PRIMITIVE(vm->boolClass, "!", bool_not);
vm->fiberClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Fiber"));
PRIMITIVE(vm->fiberClass->obj.classObj, "new(_)", fiber_new);
PRIMITIVE(vm->fiberClass->obj.classObj, "abort(_)", fiber_abort);
PRIMITIVE(vm->fiberClass->obj.classObj, "current", fiber_current);
PRIMITIVE(vm->fiberClass->obj.classObj, "suspend()", fiber_suspend);
PRIMITIVE(vm->fiberClass->obj.classObj, "yield()", fiber_yield);
PRIMITIVE(vm->fiberClass->obj.classObj, "yield(_)", fiber_yield1);
PRIMITIVE(vm->fiberClass, "call()", fiber_call);
PRIMITIVE(vm->fiberClass, "call(_)", fiber_call1);
PRIMITIVE(vm->fiberClass, "error", fiber_error);
PRIMITIVE(vm->fiberClass, "isDone", fiber_isDone);
PRIMITIVE(vm->fiberClass, "transfer()", fiber_transfer);
PRIMITIVE(vm->fiberClass, "transfer(_)", fiber_transfer1);
PRIMITIVE(vm->fiberClass, "transferError(_)", fiber_transferError);
PRIMITIVE(vm->fiberClass, "try()", fiber_try);
PRIMITIVE(vm->fiberClass, "try(_)", fiber_try1);
vm->fnClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Fn"));
PRIMITIVE(vm->fnClass->obj.classObj, "new(_)", fn_new);
PRIMITIVE(vm->fnClass, "arity", fn_arity);
FUNCTION_CALL(vm->fnClass, "call()", fn_call0);
FUNCTION_CALL(vm->fnClass, "call(_)", fn_call1);
FUNCTION_CALL(vm->fnClass, "call(_,_)", fn_call2);
FUNCTION_CALL(vm->fnClass, "call(_,_,_)", fn_call3);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_)", fn_call4);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_)", fn_call5);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_)", fn_call6);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_)", fn_call7);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_)", fn_call8);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_)", fn_call9);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_)", fn_call10);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_,_)", fn_call11);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_,_,_)", fn_call12);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_,_,_,_)", fn_call13);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_,_,_,_,_)", fn_call14);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)", fn_call15);
FUNCTION_CALL(vm->fnClass, "call(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)", fn_call16);
PRIMITIVE(vm->fnClass, "toString", fn_toString);
vm->nullClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Null"));
PRIMITIVE(vm->nullClass, "!", null_not);
PRIMITIVE(vm->nullClass, "toString", null_toString);
vm->numClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Num"));
PRIMITIVE(vm->numClass->obj.classObj, "fromString(_)", num_fromString);
PRIMITIVE(vm->numClass->obj.classObj, "infinity", num_infinity);
PRIMITIVE(vm->numClass->obj.classObj, "nan", num_nan);
PRIMITIVE(vm->numClass->obj.classObj, "pi", num_pi);
PRIMITIVE(vm->numClass->obj.classObj, "tau", num_tau);
PRIMITIVE(vm->numClass->obj.classObj, "largest", num_largest);
PRIMITIVE(vm->numClass->obj.classObj, "smallest", num_smallest);
PRIMITIVE(vm->numClass->obj.classObj, "maxSafeInteger", num_maxSafeInteger);
PRIMITIVE(vm->numClass->obj.classObj, "minSafeInteger", num_minSafeInteger);
PRIMITIVE(vm->numClass, "-(_)", num_minus);
PRIMITIVE(vm->numClass, "+(_)", num_plus);
PRIMITIVE(vm->numClass, "*(_)", num_multiply);
PRIMITIVE(vm->numClass, "/(_)", num_divide);
PRIMITIVE(vm->numClass, "<(_)", num_lt);
PRIMITIVE(vm->numClass, ">(_)", num_gt);
PRIMITIVE(vm->numClass, "<=(_)", num_lte);
PRIMITIVE(vm->numClass, ">=(_)", num_gte);
PRIMITIVE(vm->numClass, "&(_)", num_bitwiseAnd);
PRIMITIVE(vm->numClass, "|(_)", num_bitwiseOr);
PRIMITIVE(vm->numClass, "^(_)", num_bitwiseXor);
PRIMITIVE(vm->numClass, "<<(_)", num_bitwiseLeftShift);
PRIMITIVE(vm->numClass, ">>(_)", num_bitwiseRightShift);
PRIMITIVE(vm->numClass, "abs", num_abs);
PRIMITIVE(vm->numClass, "acos", num_acos);
PRIMITIVE(vm->numClass, "asin", num_asin);
PRIMITIVE(vm->numClass, "atan", num_atan);
PRIMITIVE(vm->numClass, "cbrt", num_cbrt);
PRIMITIVE(vm->numClass, "ceil", num_ceil);
PRIMITIVE(vm->numClass, "cos", num_cos);
PRIMITIVE(vm->numClass, "floor", num_floor);
PRIMITIVE(vm->numClass, "-", num_negate);
PRIMITIVE(vm->numClass, "round", num_round);
PRIMITIVE(vm->numClass, "min(_)", num_min);
PRIMITIVE(vm->numClass, "max(_)", num_max);
PRIMITIVE(vm->numClass, "clamp(_,_)", num_clamp);
PRIMITIVE(vm->numClass, "sin", num_sin);
PRIMITIVE(vm->numClass, "sqrt", num_sqrt);
PRIMITIVE(vm->numClass, "tan", num_tan);
PRIMITIVE(vm->numClass, "log", num_log);
PRIMITIVE(vm->numClass, "log2", num_log2);
PRIMITIVE(vm->numClass, "exp", num_exp);
PRIMITIVE(vm->numClass, "%(_)", num_mod);
PRIMITIVE(vm->numClass, "~", num_bitwiseNot);
PRIMITIVE(vm->numClass, "..(_)", num_dotDot);
PRIMITIVE(vm->numClass, "...(_)", num_dotDotDot);
PRIMITIVE(vm->numClass, "atan(_)", num_atan2);
PRIMITIVE(vm->numClass, "pow(_)", num_pow);
PRIMITIVE(vm->numClass, "fraction", num_fraction);
PRIMITIVE(vm->numClass, "isInfinity", num_isInfinity);
PRIMITIVE(vm->numClass, "isInteger", num_isInteger);
PRIMITIVE(vm->numClass, "isNan", num_isNan);
PRIMITIVE(vm->numClass, "sign", num_sign);
PRIMITIVE(vm->numClass, "toString", num_toString);
PRIMITIVE(vm->numClass, "truncate", num_truncate);
// These are defined just so that 0 and -0 are equal, which is specified by
// IEEE 754 even though they have different bit representations.
PRIMITIVE(vm->numClass, "==(_)", num_eqeq);
PRIMITIVE(vm->numClass, "!=(_)", num_bangeq);
vm->stringClass = AS_CLASS(wrenFindVariable(vm, coreModule, "String"));
PRIMITIVE(vm->stringClass->obj.classObj, "fromCodePoint(_)", string_fromCodePoint);
PRIMITIVE(vm->stringClass->obj.classObj, "fromByte(_)", string_fromByte);
PRIMITIVE(vm->stringClass, "+(_)", string_plus);
PRIMITIVE(vm->stringClass, "[_]", string_subscript);
PRIMITIVE(vm->stringClass, "byteAt_(_)", string_byteAt);
PRIMITIVE(vm->stringClass, "byteCount_", string_byteCount);
PRIMITIVE(vm->stringClass, "codePointAt_(_)", string_codePointAt);
PRIMITIVE(vm->stringClass, "contains(_)", string_contains);
PRIMITIVE(vm->stringClass, "endsWith(_)", string_endsWith);
PRIMITIVE(vm->stringClass, "indexOf(_)", string_indexOf1);
PRIMITIVE(vm->stringClass, "indexOf(_,_)", string_indexOf2);
PRIMITIVE(vm->stringClass, "iterate(_)", string_iterate);
PRIMITIVE(vm->stringClass, "iterateByte_(_)", string_iterateByte);
PRIMITIVE(vm->stringClass, "iteratorValue(_)", string_iteratorValue);
PRIMITIVE(vm->stringClass, "startsWith(_)", string_startsWith);
PRIMITIVE(vm->stringClass, "toString", string_toString);
vm->listClass = AS_CLASS(wrenFindVariable(vm, coreModule, "List"));
PRIMITIVE(vm->listClass->obj.classObj, "filled(_,_)", list_filled);
PRIMITIVE(vm->listClass->obj.classObj, "new()", list_new);
PRIMITIVE(vm->listClass, "[_]", list_subscript);
PRIMITIVE(vm->listClass, "[_]=(_)", list_subscriptSetter);
PRIMITIVE(vm->listClass, "add(_)", list_add);
PRIMITIVE(vm->listClass, "addCore_(_)", list_addCore);
PRIMITIVE(vm->listClass, "clear()", list_clear);
PRIMITIVE(vm->listClass, "count", list_count);
PRIMITIVE(vm->listClass, "insert(_,_)", list_insert);
PRIMITIVE(vm->listClass, "iterate(_)", list_iterate);
PRIMITIVE(vm->listClass, "iteratorValue(_)", list_iteratorValue);
PRIMITIVE(vm->listClass, "removeAt(_)", list_removeAt);
PRIMITIVE(vm->listClass, "remove(_)", list_removeValue);
PRIMITIVE(vm->listClass, "indexOf(_)", list_indexOf);
PRIMITIVE(vm->listClass, "swap(_,_)", list_swap);
vm->mapClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Map"));
PRIMITIVE(vm->mapClass->obj.classObj, "new()", map_new);
PRIMITIVE(vm->mapClass, "[_]", map_subscript);
PRIMITIVE(vm->mapClass, "[_]=(_)", map_subscriptSetter);
PRIMITIVE(vm->mapClass, "addCore_(_,_)", map_addCore);
PRIMITIVE(vm->mapClass, "clear()", map_clear);
PRIMITIVE(vm->mapClass, "containsKey(_)", map_containsKey);
PRIMITIVE(vm->mapClass, "count", map_count);
PRIMITIVE(vm->mapClass, "remove(_)", map_remove);
PRIMITIVE(vm->mapClass, "iterate(_)", map_iterate);
PRIMITIVE(vm->mapClass, "keyIteratorValue_(_)", map_keyIteratorValue);
PRIMITIVE(vm->mapClass, "valueIteratorValue_(_)", map_valueIteratorValue);
vm->rangeClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Range"));
PRIMITIVE(vm->rangeClass, "from", range_from);
PRIMITIVE(vm->rangeClass, "to", range_to);
PRIMITIVE(vm->rangeClass, "min", range_min);
PRIMITIVE(vm->rangeClass, "max", range_max);
PRIMITIVE(vm->rangeClass, "isInclusive", range_isInclusive);
PRIMITIVE(vm->rangeClass, "iterate(_)", range_iterate);
PRIMITIVE(vm->rangeClass, "iteratorValue(_)", range_iteratorValue);
PRIMITIVE(vm->rangeClass, "toString", range_toString);
ObjClass* systemClass = AS_CLASS(wrenFindVariable(vm, coreModule, "System"));
PRIMITIVE(systemClass->obj.classObj, "clock", system_clock);
PRIMITIVE(systemClass->obj.classObj, "gc()", system_gc);
PRIMITIVE(systemClass->obj.classObj, "writeString_(_)", system_writeString);
// While bootstrapping the core types and running the core module, a number
// of string objects have been created, many of which were instantiated
// before stringClass was stored in the VM. Some of them *must* be created
// first -- the ObjClass for string itself has a reference to the ObjString
// for its name.
//
// These all currently have a NULL classObj pointer, so go back and assign
// them now that the string class is known.
for (Obj* obj = vm->first; obj != NULL; obj = obj->next)
{
if (obj->type == OBJ_STRING) obj->classObj = vm->stringClass;
}
}
| 28.524194 | 85 | 0.649774 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.