text
stringlengths 4
6.14k
|
|---|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_file_system_11.c
Label Definition File: CWE78_OS_Command_Injection.one_string.label.xml
Template File: sources-sink-11.tmpl.c
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: file Read input from a file
* GoodSource: Fixed string
* Sink: system
* BadSink : Execute command in data using system()
* Flow Variant: 11 Control flow: if(globalReturnsTrue()) and if(globalReturnsFalse())
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define FULL_COMMAND L"dir "
#else
#include <unistd.h>
#define FULL_COMMAND L"ls "
#endif
#ifdef _WIN32
#define FILENAME "C:\\temp\\file.txt"
#else
#define FILENAME "/tmp/file.txt"
#endif
#ifdef _WIN32
#define SYSTEM _wsystem
#else /* NOT _WIN32 */
#define SYSTEM system
#endif
#ifndef OMITBAD
void CWE78_OS_Command_Injection__wchar_t_file_system_11_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(globalReturnsTrue())
{
{
/* Read input from a file */
size_t dataLen = wcslen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgetws(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
fclose(pFile);
}
}
}
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) != 0)
{
printLine("command execution failed!");
exit(1);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B1() - use goodsource and badsink by changing the globalReturnsTrue() to globalReturnsFalse() */
static void goodG2B1()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(globalReturnsFalse())
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) != 0)
{
printLine("command execution failed!");
exit(1);
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if statement */
static void goodG2B2()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(globalReturnsTrue())
{
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) != 0)
{
printLine("command execution failed!");
exit(1);
}
}
void CWE78_OS_Command_Injection__wchar_t_file_system_11_good()
{
goodG2B1();
goodG2B2();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE78_OS_Command_Injection__wchar_t_file_system_11_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE78_OS_Command_Injection__wchar_t_file_system_11_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
/**
** @file tcOptionsView2.h
*/
/*
** Copyright (c) 2014, GCBLUE PROJECT
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
**
** 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
**
** 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
**
** 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from
** this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
** NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
** IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _OPTIONSVIEW2_H_
#define _OPTIONSVIEW2_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "wx/wx.h"
#include <boost/shared_ptr.hpp>
#include "tcOptions.h"
#include "tcXmlWindow.h"
#include "tcTabbedWindow.h"
class tcTexture2D;
class tcOptions;
class tcSound;
/// View and GUI for user options data
class tcOptionsView2 : public tcXmlWindow, public tcTabbedWindow
{
// placement info for GUI buttons, text, etc.
struct tsButtonInfo
{
int buttonX;
int buttonY;
int textX;
int textY;
int optionIdx;
int valueIdx;
bool isSlider; ///< a hack to add sliders
tcRect thumbRect; ///< rect of slider "thumb"
};
public:
void Init();
void Draw();
void DrawButton(int x, int y, int abOn);
void DrawSlider(int x, int y, tcRect thumbRect, float value, bool interacting);
void OnLButtonDown(wxMouseEvent& event);
void OnLButtonUp(wxMouseEvent& event);
void OnLeaveWindow(wxMouseEvent& event);
void OnMouseMove(wxMouseEvent& event);
bool OnLButtonDownSlider(const wxPoint& pos);
void OnSize(wxSizeEvent& event);
virtual void SetActive(bool abActive);
bool ButtonContainingPoint(wxPoint point, int& rnOption, int& rnValue);
tcOptionsView2(wxWindow* parent,
const wxPoint& pos, const wxSize& size,
const wxString& name = "OptionsView");
tcOptionsView2(tc3DWindow2* parent,
const wxPoint& pos, const wxSize& size,
const wxString& name);
virtual ~tcOptionsView2();
private:
tcOptions *mpOptions;
struct ControlGroup
{
std::string groupName;
std::vector<tc3DWindow2*> controls;
std::vector<tc3DWindow2*> labels;
};
std::vector<ControlGroup> controlGroups;
boost::shared_ptr<tcTexture2D> mpiButtonOn;
boost::shared_ptr<tcTexture2D> mpiButtonOff;
float fontSize; ///< font size of options choice text
int mnButtonWidth;
int mnButtonHeight;
std::vector<tsButtonInfo> buttonInfo;
int mnXStart;
int mnYStart;
std::string lastTab;
// section to support dragging slider bar
const float sliderBarWidth;
bool sliderDragActive;
size_t sliderIdx; ///< index in buttonInfo of slider being dragged
wxPoint buttonDownPoint;
float sliderDragValue;
std::string buttonDownTab; ///< to detect if tab has been changed in middle of drag
void OnControlUpdate(wxCommandEvent& event);
void CloseAllLists();
void UpdateButtonInfo();
DECLARE_EVENT_TABLE()
};
#endif // _OPTIONSVIEW_H_
|
#ifndef COG_H
#define COG_H
#include <wheel.h>
namespace cog
{
class CoreEngine
{
private:
bool setup_paths(const char* pname);
protected:
wcl::ModuleLibrary modulelibrary;
wheel::interface::Video* window;
wheel::interface::Audio* audio;
wheel::Library library;
struct
{
wheel::string save;
wheel::string content;
wheel::string module;
} paths;
public:
wheel::EventList eventlist;
wheel::interface::Video* video_ptr() { return window; }
wheel::interface::Audio* audio_ptr() { return audio; }
virtual bool run();
bool running();
CoreEngine(const char* name, int argc, char* argv[]);
virtual ~CoreEngine() { wcl::terminate(); }
};
}
#endif
|
/*
* libjingle
* Copyright 2012, Google Inc.
*
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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.
*/
// This file contains mock implementations of observers used in PeerConnection.
#ifndef TALK_APP_WEBRTC_TEST_MOCKPEERCONNECTIONOBSERVERS_H_
#define TALK_APP_WEBRTC_TEST_MOCKPEERCONNECTIONOBSERVERS_H_
#include <string>
#include "talk/app/webrtc/datachannelinterface.h"
namespace webrtc {
class MockCreateSessionDescriptionObserver
: public webrtc::CreateSessionDescriptionObserver {
public:
MockCreateSessionDescriptionObserver()
: called_(false),
result_(false) {}
virtual ~MockCreateSessionDescriptionObserver() {}
virtual void OnSuccess(SessionDescriptionInterface* desc) {
called_ = true;
result_ = true;
desc_.reset(desc);
}
virtual void OnFailure(const std::string& error) {
called_ = true;
result_ = false;
}
bool called() const { return called_; }
bool result() const { return result_; }
SessionDescriptionInterface* release_desc() {
return desc_.release();
}
private:
bool called_;
bool result_;
rtc::scoped_ptr<SessionDescriptionInterface> desc_;
};
class MockSetSessionDescriptionObserver
: public webrtc::SetSessionDescriptionObserver {
public:
MockSetSessionDescriptionObserver()
: called_(false),
result_(false) {}
virtual ~MockSetSessionDescriptionObserver() {}
virtual void OnSuccess() {
called_ = true;
result_ = true;
}
virtual void OnFailure(const std::string& error) {
called_ = true;
result_ = false;
}
bool called() const { return called_; }
bool result() const { return result_; }
private:
bool called_;
bool result_;
};
class MockDataChannelObserver : public webrtc::DataChannelObserver {
public:
explicit MockDataChannelObserver(webrtc::DataChannelInterface* channel)
: channel_(channel), received_message_count_(0) {
channel_->RegisterObserver(this);
state_ = channel_->state();
}
virtual ~MockDataChannelObserver() {
channel_->UnregisterObserver();
}
virtual void OnStateChange() { state_ = channel_->state(); }
virtual void OnMessage(const DataBuffer& buffer) {
last_message_.assign(buffer.data.data(), buffer.data.length());
++received_message_count_;
}
bool IsOpen() const { return state_ == DataChannelInterface::kOpen; }
const std::string& last_message() const { return last_message_; }
size_t received_message_count() const { return received_message_count_; }
private:
rtc::scoped_refptr<webrtc::DataChannelInterface> channel_;
DataChannelInterface::DataState state_;
std::string last_message_;
size_t received_message_count_;
};
class MockStatsObserver : public webrtc::StatsObserver {
public:
MockStatsObserver()
: called_(false) {}
virtual ~MockStatsObserver() {}
virtual void OnComplete(const StatsReports& reports) {
called_ = true;
reports_.clear();
reports_.reserve(reports.size());
StatsReports::const_iterator it;
for (it = reports.begin(); it != reports.end(); ++it)
reports_.push_back(StatsReportCopyable(*(*it)));
}
bool called() const { return called_; }
size_t number_of_reports() const { return reports_.size(); }
int AudioOutputLevel() {
return GetSsrcStatsValue(
webrtc::StatsReport::kStatsValueNameAudioOutputLevel);
}
int AudioInputLevel() {
return GetSsrcStatsValue(
webrtc::StatsReport::kStatsValueNameAudioInputLevel);
}
int BytesReceived() {
return GetSsrcStatsValue(
webrtc::StatsReport::kStatsValueNameBytesReceived);
}
int BytesSent() {
return GetSsrcStatsValue(webrtc::StatsReport::kStatsValueNameBytesSent);
}
private:
int GetSsrcStatsValue(StatsReport::StatsValueName name) {
if (reports_.empty()) {
return 0;
}
for (size_t i = 0; i < reports_.size(); ++i) {
if (reports_[i].type != StatsReport::kStatsReportTypeSsrc)
continue;
webrtc::StatsReport::Values::const_iterator it =
reports_[i].values.begin();
for (; it != reports_[i].values.end(); ++it) {
if (it->name == name) {
return rtc::FromString<int>(it->value);
}
}
}
return 0;
}
bool called_;
std::vector<StatsReportCopyable> reports_;
};
} // namespace webrtc
#endif // TALK_APP_WEBRTC_TEST_MOCKPEERCONNECTIONOBSERVERS_H_
|
// 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 COMPONENTS_EXO_WAYLAND_WL_DATA_DEVICE_MANAGER_H_
#define COMPONENTS_EXO_WAYLAND_WL_DATA_DEVICE_MANAGER_H_
#include <stdint.h>
#include "base/macros.h"
struct wl_client;
namespace exo {
class Display;
namespace wayland {
class SerialTracker;
constexpr uint32_t kWlDataDeviceManagerVersion = 3;
struct WaylandDataDeviceManager {
WaylandDataDeviceManager(Display* display, SerialTracker* serial_tracker)
: display(display), serial_tracker(serial_tracker) {}
WaylandDataDeviceManager(const WaylandDataDeviceManager&) = delete;
WaylandDataDeviceManager& operator=(const WaylandDataDeviceManager&) = delete;
// Owned by WaylandServerController, which always outlives
// wl_data_device_manager.
Display* const display;
// Owned by Server, which always outlives wl_data_device_manager.
SerialTracker* const serial_tracker;
};
void bind_data_device_manager(wl_client* client,
void* data,
uint32_t version,
uint32_t id);
} // namespace wayland
} // namespace exo
#endif // COMPONENTS_EXO_WAYLAND_WL_DATA_DEVICE_MANAGER_H_
|
#include "stack.h"
#include <stdlib.h>
#include <stdio.h>
void kw_stack_init(stack *s) {
s->stack = malloc(STACK_DEFAULT_SIZE * sizeof(void*));
s->pos = 0;
s->mlen = STACK_DEFAULT_SIZE;
}
void kw_stack_free(stack *s) {
if(!s) return;
if(!s->stack) return;
free(s->stack);
}
void *kw_stack_grow(stack *s) {
void *junk; // So we don't whack s->stack on failure
s->mlen *= 2; // Double it
junk = realloc(s->stack, sizeof(void *) * s->mlen);
return junk;
}
int kw_push(stack *s, void *item) {
if(!s) {
fprintf(stderr, "Bad stack passed to kw_kw_kw_pop()\n");
return -1;
}
if(!item) return -1;
if(s->pos >= s->mlen && !kw_stack_grow(s)) {
fprintf(stderr, "Realloc failed\n");
return -1;
}
s->stack[s->pos] = item;
return ++s->pos;
}
void *kw_pop(stack *s) {
if(!s) {
fprintf(stderr, "Bad stack passed to kw_pop()\n");
return NULL;
}
if(s->pos > s->mlen) return NULL;
if(s->pos - 1 < 0) return NULL;
return s->stack[--s->pos];
}
void *kw_peek(stack *s, int back) {
if(!s) {
fprintf(stderr, "Bad stack passed to kw_peek()\n");
return NULL;
}
int pos = s->pos - back - 1;
if(pos < 0) {
return NULL;
}
return s->stack[pos];
}
|
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas 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.
*/
#include "blis.h"
#define FUNCPTR_T axpyv_fp
typedef void (*FUNCPTR_T)(
conj_t conjx,
dim_t n,
void* alpha,
void* x, inc_t incx,
void* y, inc_t incy
);
// If some mixed datatype functions will not be compiled, we initialize
// the corresponding elements of the function array to NULL.
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
static FUNCPTR_T GENARRAY3_ALL(ftypes,axpyv_kernel_void);
#else
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
static FUNCPTR_T GENARRAY3_EXT(ftypes,axpyv_kernel_void);
#else
static FUNCPTR_T GENARRAY3_MIN(ftypes,axpyv_kernel_void);
#endif
#endif
void bli_axpyv_kernel( obj_t* alpha,
obj_t* x,
obj_t* y )
{
num_t dt_x = bli_obj_datatype( *x );
num_t dt_y = bli_obj_datatype( *y );
conj_t conjx = bli_obj_conj_status( *x );
dim_t n = bli_obj_vector_dim( *x );
inc_t inc_x = bli_obj_vector_inc( *x );
void* buf_x = bli_obj_buffer_at_off( *x );
inc_t inc_y = bli_obj_vector_inc( *y );
void* buf_y = bli_obj_buffer_at_off( *y );
num_t dt_alpha;
void* buf_alpha;
FUNCPTR_T f;
// If alpha is a scalar constant, use dt_x to extract the address of the
// corresponding constant value; otherwise, use the datatype encoded
// within the alpha object and extract the buffer at the alpha offset.
bli_set_scalar_dt_buffer( alpha, dt_x, dt_alpha, buf_alpha );
// Index into the type combination array to extract the correct
// function pointer.
f = ftypes[dt_alpha][dt_x][dt_y];
// Invoke the function.
f( conjx,
n,
buf_alpha,
buf_x, inc_x,
buf_y, inc_y );
}
#undef GENTFUNC3
#define GENTFUNC3( ctype_a, ctype_x, ctype_y, cha, chx, chy, varname, kername ) \
\
void PASTEMAC3(cha,chx,chy,varname)( \
conj_t conjx, \
dim_t n, \
void* alpha, \
void* x, inc_t incx, \
void* y, inc_t incy \
) \
{ \
PASTEMAC3(cha,chx,chy,kername)( conjx, \
n, \
alpha, \
x, incx, \
y, incy ); \
}
// Define the basic set of functions unconditionally, and then also some
// mixed datatype functions if requested.
INSERT_GENTFUNC3_BASIC( axpyv_kernel_void, AXPYV_KERNEL )
#ifdef BLIS_ENABLE_MIXED_DOMAIN_SUPPORT
INSERT_GENTFUNC3_MIX_D( axpyv_kernel_void, AXPYV_KERNEL )
#endif
#ifdef BLIS_ENABLE_MIXED_PRECISION_SUPPORT
INSERT_GENTFUNC3_MIX_P( axpyv_kernel_void, AXPYV_KERNEL )
#endif
|
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrTestBatch_DEFINED
#define GrTestBatch_DEFINED
#include "GrBatch.h"
#include "GrVertexBuffer.h"
/*
* A simple batch only for testing purposes which actually doesn't batch at all, but can fit into
* the batch pipeline and generate arbitrary geometry
*/
class GrTestBatch : public GrBatch {
public:
struct Geometry {
GrColor fColor;
};
virtual const char* name() const override = 0;
void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
// When this is called on a batch, there is only one geometry bundle
out->setKnownFourComponents(this->geoData(0)->fColor);
}
void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
out->setUnknownSingleComponent();
}
void initBatchTracker(const GrPipelineInfo& init) override {
// Handle any color overrides
if (!init.readsColor()) {
this->geoData(0)->fColor = GrColor_ILLEGAL;
}
init.getOverrideColorIfSet(&this->geoData(0)->fColor);
// setup batch properties
fBatch.fColorIgnored = !init.readsColor();
fBatch.fColor = this->geoData(0)->fColor;
fBatch.fUsesLocalCoords = init.readsLocalCoords();
fBatch.fCoverageIgnored = !init.readsCoverage();
}
void generateGeometry(GrBatchTarget* batchTarget) override {
batchTarget->initDraw(fGeometryProcessor, this->pipeline());
this->onGenerateGeometry(batchTarget);
}
protected:
GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) {
fGeometryProcessor.reset(SkRef(gp));
this->setBounds(bounds);
}
const GrGeometryProcessor* geometryProcessor() const { return fGeometryProcessor; }
private:
virtual Geometry* geoData(int index) = 0;
virtual const Geometry* geoData(int index) const = 0;
bool onCombineIfPossible(GrBatch* t) override {
return false;
}
virtual void onGenerateGeometry(GrBatchTarget* batchTarget) = 0;
struct BatchTracker {
GrColor fColor;
bool fUsesLocalCoords;
bool fColorIgnored;
bool fCoverageIgnored;
};
SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
BatchTracker fBatch;
};
#endif
|
//
// UIViewController+INNControllerContext.h
// ControllerContextTest
//
// Created by Michael Raber on 5/14/14.
// Copyright (c) 2014 Innoruptor. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "INNControllerContext.h"
@interface UIViewController (INNControllerContext)
-(id) INN_initWithContext:(INNControllerContext *)context;
-(void) INN_setContext:(INNControllerContext *)context;
-(INNControllerContext *)INN_context;
#ifdef USE_NON_NAMESPACED_INNCONTROLLERCONTEXT_CATEGORY
-(id) initWithContext:(INNControllerContext *)context;
-(void) setContext:(INNControllerContext *)context;
-(INNControllerContext *)context;
#endif
@end
|
// Copyright 2017 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 SERVICES_PREFERENCES_TRACKED_TRACKED_PERSISTENT_PREF_STORE_FACTORY_H_
#define SERVICES_PREFERENCES_TRACKED_TRACKED_PERSISTENT_PREF_STORE_FACTORY_H_
#include <utility>
#include "base/sequenced_task_runner.h"
#include "services/preferences/public/mojom/preferences.mojom.h"
namespace base {
class DictionaryValue;
}
class PersistentPrefStore;
PersistentPrefStore* CreateTrackedPersistentPrefStore(
prefs::mojom::TrackedPersistentPrefStoreConfigurationPtr config,
scoped_refptr<base::SequencedTaskRunner> io_task_runner);
// TODO(sammc): This should move somewhere more appropriate in the longer term.
void InitializeMasterPrefsTracking(
prefs::mojom::TrackedPersistentPrefStoreConfigurationPtr configuration,
base::DictionaryValue* master_prefs);
#endif // SERVICES_PREFERENCES_TRACKED_TRACKED_PERSISTENT_PREF_STORE_FACTORY_H_
|
/***************************************************************************
* Copyright (C) YEAR~YEAR by Your Name *
* your-email@address.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "big5-internal.h"
CONFIG_BINDING_BEGIN(FcitxBig5Config)
CONFIG_BINDING_END()
|
// Copyright 2018 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_BLOB_TESTING_FAKE_BLOB_REGISTRY_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BLOB_TESTING_FAKE_BLOB_REGISTRY_H_
#include "third_party/blink/public/mojom/blob/blob_registry.mojom-blink.h"
namespace blink {
// Mocked BlobRegistry implementation for testing. Simply keeps track of all
// blob registrations and blob lookup requests, binding each blob request to a
// FakeBlob instance with the correct uuid.
class FakeBlobRegistry : public mojom::blink::BlobRegistry {
public:
void Register(mojo::PendingReceiver<mojom::blink::Blob>,
const String& uuid,
const String& content_type,
const String& content_disposition,
Vector<mojom::blink::DataElementPtr> elements,
RegisterCallback) override;
void RegisterFromStream(
const String& content_type,
const String& content_disposition,
uint64_t expected_length,
mojo::ScopedDataPipeConsumerHandle,
mojo::PendingAssociatedRemote<mojom::blink::ProgressClient>,
RegisterFromStreamCallback) override;
void GetBlobFromUUID(mojo::PendingReceiver<mojom::blink::Blob>,
const String& uuid,
GetBlobFromUUIDCallback) override;
void URLStoreForOrigin(
const scoped_refptr<const SecurityOrigin>&,
mojo::PendingAssociatedReceiver<mojom::blink::BlobURLStore>) override;
struct Registration {
String uuid;
String content_type;
String content_disposition;
Vector<mojom::blink::DataElementPtr> elements;
};
Vector<Registration> registrations;
struct OwnedReceiver {
String uuid;
};
Vector<OwnedReceiver> owned_receivers;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_BLOB_TESTING_FAKE_BLOB_REGISTRY_H_
|
// Copyright (c) 2013 - 2015 The Sporting Exchange Limited
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. All advertising materials mentioning features or use of this software
// must display the following acknowledgement:
// This product includes software developed by The Sporting Exchange Limited.
// 4. Neither the name of The Sporting Exchange Limited 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 SPORTING EXCHANGE LIMITED ''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 SPORTING EXCHANGE LIMITED BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/Foundation.h>
@class BNGCompetition;
/**
* Wrapper class around `BNGCompetition` which gives the client top-level information about the competition such as how many markets are associated with the comptition.
*/
@interface BNGCompetitionResult : NSObject
/**
* The competition which backs this wrapper class.
*/
@property (nonatomic) BNGCompetition *competition;
/**
* How many markets are associated with this `BNGCompetition`
*/
@property (nonatomic) NSInteger marketCount;
/**
* Where in the world this competition is being held.
*/
@property (nonatomic, copy) NSString *competitionRegion;
@end
|
// Copyright 2015-present 650 Industries. All rights reserved.
#import <React/RCTDevSettings.h>
@interface EXDevSettings : RCTDevSettings
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithScopeKey:(NSString *)scopeKey
isDevelopment:(BOOL)isDevelopment NS_DESIGNATED_INITIALIZER;
@end
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ServiceWorkerRegistration_h
#define ServiceWorkerRegistration_h
#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/ActiveDOMObject.h"
#include "core/events/EventTarget.h"
#include "modules/serviceworkers/ServiceWorker.h"
#include "modules/serviceworkers/ServiceWorkerRegistration.h"
#include "platform/Supplementable.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerRegistration.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerRegistrationProxy.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace blink {
class ScriptPromise;
class ScriptState;
class WebServiceWorkerProvider;
// The implementation of a service worker registration object in Blink. Actual
// registration representation is in the embedder and this class accesses it
// via WebServiceWorkerRegistration::Handle object.
class ServiceWorkerRegistration final
: public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerRegistration>
, public ActiveScriptWrappable
, public ActiveDOMObject
, public WebServiceWorkerRegistrationProxy
, public Supplementable<ServiceWorkerRegistration> {
DEFINE_WRAPPERTYPEINFO();
REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerRegistration);
USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistration);
public:
// EventTarget overrides.
const AtomicString& interfaceName() const override;
ExecutionContext* getExecutionContext() const override { return ActiveDOMObject::getExecutionContext(); }
// WebServiceWorkerRegistrationProxy overrides.
void dispatchUpdateFoundEvent() override;
void setInstalling(std::unique_ptr<WebServiceWorker::Handle>) override;
void setWaiting(std::unique_ptr<WebServiceWorker::Handle>) override;
void setActive(std::unique_ptr<WebServiceWorker::Handle>) override;
// Returns an existing registration object for the handle if it exists.
// Otherwise, returns a new registration object.
static ServiceWorkerRegistration* getOrCreate(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegistration::Handle>);
ServiceWorker* installing() { return m_installing; }
ServiceWorker* waiting() { return m_waiting; }
ServiceWorker* active() { return m_active; }
String scope() const;
WebServiceWorkerRegistration* webRegistration() { return m_handle->registration(); }
ScriptPromise update(ScriptState*);
ScriptPromise unregister(ScriptState*);
DEFINE_ATTRIBUTE_EVENT_LISTENER(updatefound);
~ServiceWorkerRegistration() override;
// Eager finalization needed to promptly release owned WebServiceWorkerRegistration.
EAGERLY_FINALIZE();
DECLARE_VIRTUAL_TRACE();
private:
ServiceWorkerRegistration(ExecutionContext*, PassOwnPtr<WebServiceWorkerRegistration::Handle>);
// ActiveScriptWrappable overrides.
bool hasPendingActivity() const final;
// ActiveDOMObject overrides.
void stop() override;
// A handle to the registration representation in the embedder.
OwnPtr<WebServiceWorkerRegistration::Handle> m_handle;
WebServiceWorkerProvider* m_provider;
Member<ServiceWorker> m_installing;
Member<ServiceWorker> m_waiting;
Member<ServiceWorker> m_active;
bool m_stopped;
};
class ServiceWorkerRegistrationArray {
STATIC_ONLY(ServiceWorkerRegistrationArray);
public:
static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResolver* resolver, Vector<OwnPtr<WebServiceWorkerRegistration::Handle>>* webServiceWorkerRegistrations)
{
HeapVector<Member<ServiceWorkerRegistration>> registrations;
for (auto& registration : *webServiceWorkerRegistrations)
registrations.append(ServiceWorkerRegistration::getOrCreate(resolver->getExecutionContext(), registration.release()));
return registrations;
}
};
} // namespace blink
#endif // ServiceWorkerRegistration_h
|
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP9_COMMON_VP9_QUANT_COMMON_H_
#define VP9_COMMON_VP9_QUANT_COMMON_H_
#include "string.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_onyxc_int.h"
extern void vp9_init_quant_tables(void);
extern int vp9_ac_yquant(int QIndex);
extern int vp9_dc_quant(int QIndex, int Delta);
extern int vp9_dc2quant(int QIndex, int Delta);
extern int vp9_ac2quant(int QIndex, int Delta);
extern int vp9_dc_uv_quant(int QIndex, int Delta);
extern int vp9_ac_uv_quant(int QIndex, int Delta);
#endif // VP9_COMMON_VP9_QUANT_COMMON_H_
|
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * 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 Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ServiceWorkerContainer_h
#define ServiceWorkerContainer_h
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseProperty.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/events/EventTarget.h"
#include "modules/ModulesExport.h"
#include "modules/serviceworkers/RegistrationOptions.h"
#include "modules/serviceworkers/ServiceWorker.h"
#include "modules/serviceworkers/ServiceWorkerRegistration.h"
#include "platform/heap/Handle.h"
#include "public/platform/modules/serviceworker/WebServiceWorkerProviderClient.h"
#include "wtf/Forward.h"
namespace blink {
class ExecutionContext;
class WebServiceWorker;
class WebServiceWorkerProvider;
class WebServiceWorkerRegistration;
class MODULES_EXPORT ServiceWorkerContainer final
: public RefCountedGarbageCollectedEventTargetWithInlineData<ServiceWorkerContainer>
, public ContextLifecycleObserver
, public WebServiceWorkerProviderClient {
DEFINE_WRAPPERTYPEINFO();
REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServiceWorkerContainer);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainer);
public:
static ServiceWorkerContainer* create(ExecutionContext*);
~ServiceWorkerContainer();
void willBeDetachedFromFrame();
DECLARE_VIRTUAL_TRACE();
ServiceWorker* controller() { return m_controller; }
ScriptPromise ready(ScriptState*);
WebServiceWorkerProvider* provider() { return m_provider; }
ScriptPromise registerServiceWorker(ScriptState*, const String& pattern, const RegistrationOptions&);
ScriptPromise getRegistration(ScriptState*, const String& documentURL);
ScriptPromise getRegistrations(ScriptState*);
// WebServiceWorkerProviderClient overrides.
void setController(WebPassOwnPtr<WebServiceWorker::Handle>, bool shouldNotifyControllerChange) override;
void dispatchMessageEvent(WebPassOwnPtr<WebServiceWorker::Handle>, const WebString& message, const WebMessagePortChannelArray&) override;
// EventTarget overrides.
ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); }
const AtomicString& interfaceName() const override;
DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange);
DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
private:
explicit ServiceWorkerContainer(ExecutionContext*);
class GetRegistrationForReadyCallback;
typedef ScriptPromiseProperty<Member<ServiceWorkerContainer>, Member<ServiceWorkerRegistration>, Member<ServiceWorkerRegistration>> ReadyProperty;
ReadyProperty* createReadyProperty();
WebServiceWorkerProvider* m_provider;
Member<ServiceWorker> m_controller;
Member<ReadyProperty> m_ready;
};
} // namespace blink
#endif // ServiceWorkerContainer_h
|
/********************************************************
* GoOS Loader - elf64.h
********************************************************
* Copyright (c) 2016, Gert Nutterts
* All rights reserved
*
* Released under the BSD 3-clause license.
* https://github.com/nutterts/GoOS/blob/master/LICENSE
********************************************************/
#ifndef __ELF64_H__
#define __ELF64_H__ 1
#include <ldr.h>
#define ELF64_MAGIC 0x464C457F
#define ELFCLASS64 0x2
#define ELFDATA2LSB 0x1
#define EM_X86_64 0x3E
enum {
ET_REL = 1,
ET_EXEC = 2
};
enum {
SHT_PROGBITS = 1,
SHT_NOBITS = 8
};
enum {
SHF_WRITE = 1,
SHF_ALLOC = 2,
SHF_EXECINSTR = 4
};
struct elf64_ident {
uint32_t magic;
uint8_t class;
uint8_t data;
uint8_t version;
uint8_t osabi;
uint8_t abiversion;
uint8_t padding[7];
};
typedef struct elf64_ident elf64_ident_t;
struct elf64_header {
elf64_ident_t ident;
uint16_t type;
uint16_t machine;
uint32_t version;
uint64_t entry;
uint64_t phoff;
uint64_t shoff;
uint32_t flags;
uint16_t ehsize;
uint16_t phentsize;
uint16_t phnum;
uint16_t shentsize;
uint16_t shnum;
uint16_t shstmdx;
};
typedef struct elf64_header elf64_header_t;
struct elf64_s_header {
uint32_t name;
uint32_t type;
uint64_t flags;
uint64_t addr;
uint64_t offset;
uint64_t size;
uint32_t link;
uint32_t info;
uint64_t addralign;
uint64_t entsize;
};
typedef struct elf64_s_header elf64_s_header_t;
struct elf64_p_header {
uint32_t type;
uint32_t flags;
uint64_t offset;
uint64_t vaddr;
uint64_t paddr;
uint64_t filesz;
uint64_t memsz;
uint64_t align;
};
typedef struct elf64_p_header elf64_p_header_t;
#endif
|
/**
* @file nwk_config.h
*
* @brief These are all timer IDs which are used in NWK.
*
* $Id: nwk_config.h 25096 2011-01-24 09:26:10Z uwalter $
*
* @author Atmel Corporation: http://www.atmel.com
* @author Support: http://www.atmel.com/design-support/
*/
/*
* Copyright (c) 2009-2014, Atmel Corporation All rights reserved.
*
*
*/
/* Prevent double inclusion */
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef NWK_CONFIG_H
#define NWK_CONFIG_H
/* === Includes ============================================================= */
#include "mac_config.h"
/* === Macros =============================================================== */
#define NWK_FIRST_TIMER_ID (MAC_LAST_TIMER_ID + 1)
/* === Types ================================================================ */
/* Timer ID's used by NWK */
typedef enum
{
/* NWK Timers start from NWK_FIRST_TIMER_ID */
/* T_NWK is the generic timer used for the NWK layer */
T_NWK = (NWK_FIRST_TIMER_ID)
#if ((defined CHANNEL_AGILITY) || (defined RF4CE_PLATFORM))
,
T_CH_AG = (NWK_FIRST_TIMER_ID + 1)
#endif /* #if (defined CHANNEL_AGILITY) || (defined RF4CE_PLATFORM) */
#ifdef ZRC_PROFILE
,
#if ((defined CHANNEL_AGILITY) || (defined RF4CE_PLATFORM))
T_ZRC_PROFILE = (NWK_FIRST_TIMER_ID + 2)
#else
T_ZRC_PROFILE = (NWK_FIRST_TIMER_ID + 1)
#endif
#endif /* ZRC_PROFILE */
} nwk_timer_t;
#if ((defined CHANNEL_AGILITY) || (defined RF4CE_PLATFORM))
#define NUMBER_OF_CH_AG_TIMERS 1
#else
#define NUMBER_OF_CH_AG_TIMERS 0
#endif
#ifdef ZRC_PROFILE
#define NUMBER_OF_PROFILE_TIMERS 1
#else
#define NUMBER_OF_PROFILE_TIMERS 0
#endif
#define NUMBER_OF_NWK_TIMERS 1 + NUMBER_OF_CH_AG_TIMERS + NUMBER_OF_PROFILE_TIMERS
#define NWK_LAST_TIMER_ID (MAC_LAST_TIMER_ID + NUMBER_OF_NWK_TIMERS)
#ifdef ENABLE_QUEUE_CAPACITY
/**
* Macro configuring the queue capacities.
*/
#define NHLE_NWK_QUEUE_CAPACITY (255)
#define NWK_NHLE_QUEUE_CAPACITY (255)
#define MAC_NWK_QUEUE_CAPACITY (255)
#endif /* ENABLE_QUEUE_CAPACITY */
#define DEVICE_TYPE_LIST_SIZE 3
#define PROFILE_ID_LIST_SIZE 7
/* === Externals ============================================================ */
/* === Prototypes =========================================================== */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* NWK_CONFIG_H */
/* EOF */
|
// Copyright (c) 2009-2016 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Developers
// Copyright (c) 2015-2016 Silk Network
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef DARKSILK_WALLETDB_H
#define DARKSILK_WALLETDB_H
#include <list>
#include <string>
#include <utility>
#include <vector>
#include "wallet/db.h"
#include "keystore.h"
#include "anon/stealth/stealth.h"
#include "amount.h"
class CAccount;
class CAccountingEntry;
class CBlockLocator;
class CKeyPool;
class CMasterKey;
class CScript;
class CWallet;
class CWalletTx;
class uint160;
class uint256;
/** Error statuses for the wallet database */
enum DBErrors
{
DB_LOAD_OK,
DB_CORRUPT,
DB_NONCRITICAL_ERROR,
DB_TOO_NEW,
DB_LOAD_FAIL,
DB_NEED_REWRITE
};
class CKeyMetadata
{
public:
static const int CURRENT_VERSION=1;
int nVersion;
int64_t nCreateTime; // 0 means unknown
CKeyMetadata()
{
SetNull();
}
CKeyMetadata(int64_t nCreateTime_)
{
nVersion = CKeyMetadata::CURRENT_VERSION;
nCreateTime = nCreateTime_;
}
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
READWRITE(this->nVersion);
nVersion = this->nVersion;
READWRITE(nCreateTime);
}
void SetNull()
{
nVersion = CKeyMetadata::CURRENT_VERSION;
nCreateTime = 0;
}
};
class CStealthKeyMetadata
{
// -- used to get secret for keys created by stealth transaction with wallet locked
public:
CStealthKeyMetadata() {};
CStealthKeyMetadata(CPubKey pkEphem_, CPubKey pkScan_)
{
pkEphem = pkEphem_;
pkScan = pkScan_;
};
CPubKey pkEphem;
CPubKey pkScan;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
READWRITE(pkEphem);
READWRITE(pkScan);
}
};
/** Access to the wallet database (wallet.dat) */
class CWalletDB : public CDB
{
public:
CWalletDB(const std::string& strFilename, const char* pszMode = "r+") : CDB(strFilename, pszMode)
{
}
private:
CWalletDB(const CWalletDB&);
void operator=(const CWalletDB&);
public:
bool WriteName(const std::string& strAddress, const std::string& strName);
bool EraseName(const std::string& strAddress);
bool WriteTx(uint256 hash, const CWalletTx& wtx);
bool EraseTx(uint256 hash);
bool WriteStealthKeyMeta(const CKeyID& keyId, const CStealthKeyMetadata& sxKeyMeta);
bool EraseStealthKeyMeta(const CKeyID& keyId);
bool WriteStealthAddress(const CStealthAddress& sxAddr);
bool ReadStealthAddress(CStealthAddress& sxAddr);
bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta);
bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta);
bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey);
bool WriteCScript(const uint160& hash, const CScript& redeemScript);
bool WriteWatchOnly(const CScript &script);
bool EraseWatchOnly(const CScript &script);
bool WriteBestBlock(const CBlockLocator& locator);
bool ReadBestBlock(CBlockLocator& locator);
bool WriteOrderPosNext(int64_t nOrderPosNext);
bool WriteDefaultKey(const CPubKey& vchPubKey);
bool ReadPool(int64_t nPool, CKeyPool& keypool);
bool WritePool(int64_t nPool, const CKeyPool& keypool);
bool ErasePool(int64_t nPool);
bool WriteMinVersion(int nVersion);
bool ReadAccount(const std::string& strAccount, CAccount& account);
bool WriteAccount(const std::string& strAccount, const CAccount& account);
private:
bool WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry);
public:
bool WriteAccountingEntry(const CAccountingEntry& acentry);
CAmount GetAccountCreditDebit(const std::string& strAccount);
void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);
DBErrors ReorderTransactions(CWallet* pwallet);
DBErrors LoadWallet(CWallet* pwallet);
static bool Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKeys);
static bool Recover(CDBEnv& dbenv, const std::string& filename);
};
bool BackupWallet(const CWallet& wallet, const std::string& strDest);
#endif // DARKSILK_WALLETDB_H
|
//
// CategoryViewModel.h
// CodeMonkeyReader
//
// Created by kino on 15/6/29.
//
//
#import <Foundation/Foundation.h>
#import "ReaderCategory.h"
#import <RVMViewModel.h>
@class ArticleListViewModel;
@interface CategoryViewModel : RVMViewModel
@property (strong, nonatomic, readonly) NSArray *categories;
//- (instancetype)initWithCategory:(ReaderCategory *)category;
- (RACSignal *)fetchCategoryItems;
- (ArticleListViewModel *)articleListViewModelAtIndex:(NSInteger)index;
@end
|
//
// VerifyUtils.h
// PAAccountFramework
//
// Created by shen peng on 14-5-9.
// Copyright (c) 2014年 Ping An Health Insurance Company of China, Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface VerifyUtil : NSObject
/**
* 校验手机号是否有效
*
* @param mobile 手机号
*
* @return 是否有效
*/
+ (BOOL)mobileValid:(NSString *)mobile;
@end
|
/* isupper( int )
This file is part of the Public Domain C Library (PDCLib).
Permission is granted to use, modify, and / or redistribute at will.
*/
#include <ctype.h>
#ifndef REGTEST
#include "_PDCLIB_locale.h"
int isupper( int c )
{
return ( _PDCLIB_threadlocale()->_CType[c].flags & _PDCLIB_CTYPE_UPPER );
}
#endif
#ifdef TEST
#include "_PDCLIB_test.h"
int main( void )
{
TESTCASE( isupper( 'A' ) );
TESTCASE( isupper( 'Z' ) );
TESTCASE( ! isupper( 'a' ) );
TESTCASE( ! isupper( 'z' ) );
TESTCASE( ! isupper( ' ' ) );
TESTCASE( ! isupper( '@' ) );
return TEST_RESULTS;
}
#endif
|
//
// SCAPIClient+SCFile.h
// Pods
//
// Created by Jan Lipmann on 30/06/15.
//
//
#import "SCAPIClient.h"
#import <AFNetworking/AFNetworking.h>
@interface SCAPIClient (SCFile)
+ (AFHTTPRequestOperation *)downloadFileFromURL:(NSURL *)fileURL withCompletion:(SCAPIFileDownloadCompletionBlock)completion;
@end
|
#pragma once
#define Mortgage_h
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
class Mortgage {
private:
/* **************************************************
Class Constants
************************************************** */
const float NUM_MONTHS = 12.0; // Number of months in a year.
const float ONE = 1.0; // Const for one.
const float HUNDRED = 100.0; // Const for one hundred.
/* **************************************************
String Error constants for each possible error.
************************************************** */
const string ERR_AMOUNT = "Invalid Amount!";
const string ERR_RATE = "Invalid Interest Rate!";
const string ERR_YEARS = "Invalid Years!";
/* **************************************************
Class Member Variables
************************************************** */
float monthlyPayment = 0.0; // Monthly Payment.
float loanAmount = 0.0; // The dollar amount of the loan.
float interestRate = 0.0; // The annual interest rate.
float numYears = 0.0; // The number of years of the loan.
/* **************************************************
Private Member Functions
************************************************** */
void MonthlyPayment();
float PeriodInterestRate();
float Term();
void ThrowError(const string ERROR);
float GetMonthInterest(float balance);
float GetMonthPrincipal(float balance);
public:
/* **************************************************
Public Member Functions
************************************************** */
bool SetLoanAmount(float amount);
bool SetInterestRate(float rate);
bool SetYears(float years);
float GetMonthlyPayment();
void PrintMonthlyPayment();
void PrintStatement();
void AskUser();
};
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
class BoundFunction : public JavascriptFunction
{
protected:
DEFINE_VTABLE_CTOR(BoundFunction, JavascriptFunction);
DEFINE_MARSHAL_OBJECT_TO_SCRIPT_CONTEXT(BoundFunction);
private:
bool GetPropertyBuiltIns(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext, BOOL* result);
bool SetPropertyBuiltIns(PropertyId propertyId, Var value, PropertyOperationFlags flags, PropertyValueInfo* info, BOOL* result);
protected:
BoundFunction(DynamicType * type);
BoundFunction(Arguments args, DynamicType * type);
public:
static BoundFunction* New(ScriptContext* scriptContext, ArgumentReader args);
static Var NewInstance(RecyclableObject* function, CallInfo callInfo, ...);
virtual JavascriptString* GetDisplayNameImpl() const override;
virtual PropertyQueryFlags GetPropertyReferenceQuery(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) override;
_Check_return_ _Success_(return) virtual BOOL GetAccessors(PropertyId propertyId, _Outptr_result_maybenull_ Var* getter, _Outptr_result_maybenull_ Var* setter, ScriptContext* requestContext) override;
virtual DescriptorFlags GetSetter(PropertyId propertyId, Var *setterValue, PropertyValueInfo* info, ScriptContext* requestContext) override;
virtual DescriptorFlags GetSetter(JavascriptString* propertyNameString, Var *setterValue, PropertyValueInfo* info, ScriptContext* requestContext) override;
virtual BOOL InitProperty(PropertyId propertyId, Var value, PropertyOperationFlags flags = PropertyOperation_None, PropertyValueInfo* info = NULL) override;
virtual BOOL HasInstance(Var instance, ScriptContext* scriptContext, IsInstInlineCache* inlineCache = NULL) override;
virtual inline BOOL IsConstructor() const override;
// Below functions are used by debugger to identify and emit event handler information
virtual bool IsBoundFunction() const { return true; }
JavascriptFunction * GetTargetFunction() const;
// Below functions are used by heap enumerator
uint GetArgsCountForHeapEnum() { return count;}
Field(Var)* GetArgsForHeapEnum() { return boundArgs;}
RecyclableObject* GetBoundThis();
#if ENABLE_TTD
public:
virtual void MarkVisitKindSpecificPtrs(TTD::SnapshotExtractor* extractor) override;
virtual void ProcessCorePaths() override;
virtual TTD::NSSnapObjects::SnapObjectType GetSnapTag_TTD() const override;
virtual void ExtractSnapObjectDataInto(TTD::NSSnapObjects::SnapObject* objData, TTD::SlabAllocator& alloc) override;
static BoundFunction* InflateBoundFunction(
ScriptContext* ctx, RecyclableObject* function, Var bThis, uint32 ct, Field(Var)* args);
#endif
private:
static FunctionInfo functionInfo;
Field(RecyclableObject*) targetFunction;
Field(Var) boundThis;
Field(uint) count;
Field(Field(Var)*) boundArgs;
};
template <> inline bool VarIsImpl<BoundFunction>(RecyclableObject* obj)
{
return VarIs<JavascriptFunction>(obj) && UnsafeVarTo<JavascriptFunction>(obj)->IsBoundFunction();
}
} // namespace Js
|
#ifndef REPEATED_INCLUDE_H
#define REPEATED_INCLUDE_H
#include "repeated_include.h"
int ret_val()
//@ requires true;
//@ ensures true;
{
return CONST;
}
#endif
|
//
// FLErrors.h
// FishLampCore
//
// Created by Mike Fullerton on 9/3/13.
// Copyright (c) 2013 Mike Fullerton. All rights reserved.
//
#import "FLCoreRequired.h"
#import "NSError+FLExtras.h"
#import "FLExceptions.h"
#import "FLErrorCodes.h"
#import "FLErrorException.h"
#import "FLCancelError.h"
#import "FLErrorDomainInfo.h"
|
/*
* Generated by class-dump 3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard.
*/
#import "NSObject.h"
#import "DVTInvalidation.h"
@class DVTStackBacktrace, IDEActivityLogSection, IDELogStore, IDESourceControlExtension, IDESourceControlOperation, IDESourceControlRepository, IDESourceControlTree, IDESourceControlWorkingCopyConfiguration, NSArray, NSDictionary, NSString;
@interface IDESourceControlRequest : NSObject <DVTInvalidation>
{
IDESourceControlTree *_sourceTree;
IDESourceControlWorkingCopyConfiguration *_wcc;
IDESourceControlRepository *_remote;
int _type;
NSString *_startingRevision;
NSString *_endingRevision;
NSString *_destination;
NSArray *_files;
NSDictionary *_options;
IDEActivityLogSection *_log;
IDEActivityLogSection *_logSection;
NSString *_shortTitle;
NSString *_longTitle;
NSString *_workspaceName;
IDELogStore *_logStore;
IDESourceControlExtension *_sourceControlExtension;
NSString *_message;
IDESourceControlOperation *_operation;
BOOL _stopAllActivityWhenCanceled;
BOOL _shouldGenerateLog;
BOOL _cancelable;
id _progressBlock;
}
+ (void)initialize;
- (void).cxx_destruct;
- (void)cancelOperation;
@property BOOL cancelable; // @synthesize cancelable=_cancelable;
@property(readonly, copy) NSString *description;
@property(copy) NSString *destination; // @synthesize destination=_destination;
@property(copy) NSString *endingRevision; // @synthesize endingRevision=_endingRevision;
@property(copy) NSArray *files; // @synthesize files=_files;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2 destination:(id)arg3 files:(id)arg4 options:(id)arg5;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2 destination:(id)arg3 startingRevision:(id)arg4 endingRevision:(id)arg5 files:(id)arg6 options:(id)arg7;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2 files:(id)arg3;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2 files:(id)arg3 options:(id)arg4;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2 message:(id)arg3 files:(id)arg4 options:(id)arg5;
- (id)initWithType:(int)arg1 sourceTree:(id)arg2 startingRevision:(id)arg3 endingRevision:(id)arg4 files:(id)arg5 options:(id)arg6;
- (id)initWithType:(int)arg1 startingRevision:(id)arg2 destination:(id)arg3 options:(id)arg4;
- (id)initWithType:(int)arg1 workingCopyConfiguration:(id)arg2 destination:(id)arg3 files:(id)arg4 options:(id)arg5;
- (BOOL)isRequestBlacklistedFromLogging;
@property(retain) IDEActivityLogSection *log; // @synthesize log=_log;
@property(retain) IDEActivityLogSection *logSection; // @synthesize logSection=_logSection;
@property(readonly) IDELogStore *logStore; // @synthesize logStore=_logStore;
@property(readonly, copy) NSString *longTitle; // @synthesize longTitle=_longTitle;
@property(copy) NSString *message; // @synthesize message=_message;
@property IDESourceControlOperation *operation; // @synthesize operation=_operation;
@property(copy) NSDictionary *options; // @synthesize options=_options;
- (void)primitiveInvalidate;
@property(copy) id progressBlock; // @synthesize progressBlock=_progressBlock;
@property(retain) IDESourceControlRepository *remote; // @synthesize remote=_remote;
@property(readonly) IDESourceControlRepository *repositoryToAuthenticate;
@property BOOL shouldGenerateLog; // @synthesize shouldGenerateLog=_shouldGenerateLog;
- (void)setShouldGenerateLog:(BOOL)arg1 logStore:(id)arg2 shortTitle:(id)arg3 longTitle:(id)arg4;
- (void)setShouldGenerateLog:(BOOL)arg1 logStore:(id)arg2 workspaceName:(id)arg3;
@property(retain) IDESourceControlExtension *sourceControlExtension; // @synthesize sourceControlExtension=_sourceControlExtension;
@property(retain) IDESourceControlTree *sourceTree; // @synthesize sourceTree=_sourceTree;
@property(copy) NSString *startingRevision; // @synthesize startingRevision=_startingRevision;
@property BOOL stopAllActivityWhenCanceled; // @synthesize stopAllActivityWhenCanceled=_stopAllActivityWhenCanceled;
@property int type; // @synthesize type=_type;
@property(retain) IDESourceControlWorkingCopyConfiguration *wcc; // @synthesize wcc=_wcc;
@property(readonly, copy) NSString *shortTitle; // @synthesize shortTitle=_shortTitle;
@property(readonly, copy) NSString *workspaceName; // @synthesize workspaceName=_workspaceName;
// Remaining properties
@property(retain) DVTStackBacktrace *creationBacktrace;
@property(readonly, copy) NSString *debugDescription;
@property(readonly) unsigned long long hash;
@property(readonly) DVTStackBacktrace *invalidationBacktrace;
@property(readonly) Class superclass;
@property(readonly, nonatomic, getter=isValid) BOOL valid;
@end
|
/**
http://www.w3.org/TR/2011/REC-SVG11-20110816/text.html#InterfaceSVGTextPositioningElement
interface SVGTextPositioningElement : SVGTextContentElement {
readonly attribute SVGAnimatedLengthList x;
readonly attribute SVGAnimatedLengthList y;
readonly attribute SVGAnimatedLengthList dx;
readonly attribute SVGAnimatedLengthList dy;
readonly attribute SVGAnimatedNumberList rotate;
*/
#if (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#import "SVGTextContentElement.h"
#import "SVGLength.h"
@interface SVGTextPositioningElement : SVGTextContentElement
@property(nonatomic,strong,readonly) SVGLength* /* FIXME: should be SVGAnimatedLengthList */ x;
@property(nonatomic,strong,readonly) SVGLength* /* FIXME: should be SVGAnimatedLengthList */ y;
@property(nonatomic,strong,readonly) SVGLength* /* FIXME: should be SVGAnimatedLengthList */ dx;
@property(nonatomic,strong,readonly) SVGLength* /* FIXME: should be SVGAnimatedLengthList */ dy;
@property(nonatomic,strong,readonly) SVGLength* /* FIXME: should be SVGAnimatedLengthList */ rotate;
@end
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_OVERUSE_DETECTOR_H_
#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_OVERUSE_DETECTOR_H_
#include <list>
#include "webrtc/base/constructormagic.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h"
#include "webrtc/typedefs.h"
namespace webrtc {
enum RateControlRegion;
bool AdaptiveThresholdExperimentIsEnabled();
class OveruseDetector {
public:
explicit OveruseDetector(const OverUseDetectorOptions& options);
virtual ~OveruseDetector();
// Update the detection state based on the estimated inter-arrival time delta
// offset. |timestamp_delta| is the delta between the last timestamp which the
// estimated offset is based on and the last timestamp on which the last
// offset was based on, representing the time between detector updates.
// |num_of_deltas| is the number of deltas the offset estimate is based on.
// Returns the state after the detection update.
BandwidthUsage Detect(double offset,
double timestamp_delta,
int num_of_deltas,
int64_t now_ms);
// Returns the current detector state.
BandwidthUsage State() const;
private:
void UpdateThreshold(double modified_offset, int64_t now_ms);
void InitializeExperiment();
const bool in_experiment_;
double k_up_;
double k_down_;
double overusing_time_threshold_;
// Must be first member variable. Cannot be const because we need to be
// copyable.
webrtc::OverUseDetectorOptions options_;
double threshold_;
int64_t last_update_ms_;
double prev_offset_;
double time_over_using_;
int overuse_counter_;
BandwidthUsage hypothesis_;
RTC_DISALLOW_COPY_AND_ASSIGN(OveruseDetector);
};
} // namespace webrtc
#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_OVERUSE_DETECTOR_H_
|
//
// UIAView.h
// FoundationExtension
//
// Created by Jeong YunWon on 13. 5. 24..
// Copyright (c) 2013 youknowone.org. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <UIKitExtension/UIAViewController.h>
/*!
* @brief UIView with refined lifecycle. (testing)
*/
@interface UIAView : UIView<UIAViewLifeCycle>
@end
|
//===-- XCoreMCTargetDesc.h - XCore Target Descriptions ---------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file provides XCore specific target descriptions.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_XCORE_MCTARGETDESC_XCOREMCTARGETDESC_H
#define LLVM_LIB_TARGET_XCORE_MCTARGETDESC_XCOREMCTARGETDESC_H
#include "llvm/Support/DataTypes.h"
namespace llvm {
class Target;
Target &getTheXCoreTarget();
} // End llvm namespace
// Defines symbolic names for XCore registers. This defines a mapping from
// register name to register number.
//
#define GET_REGINFO_ENUM
#include "XCoreGenRegisterInfo.inc"
// Defines symbolic names for the XCore instructions.
//
#define GET_INSTRINFO_ENUM
#include "XCoreGenInstrInfo.inc"
#define GET_SUBTARGETINFO_ENUM
#include "XCoreGenSubtargetInfo.inc"
#endif
|
#pragma once
#include "types.h"
#include "rtmp/client.h"
#include "rtmp/messages.h"
#include "flex/messages.h"
#include <iostream>
#include <vector>
#include <functional>
namespace flex {
namespace messaging {
class Consumer {
typedef std::function<void(const amf::Variant&)> MessageListener;
public:
Consumer(){
}
std::string destination(){
return mDestination;
}
std::string clientId(){
return mClientId;
}
void setDestination(const std::string& value){
mDestination = value;
}
void subscribe(const std::string& clientid){
mClientId = clientid;
rtmp::Client::instance().registerConsumer(this);
flex::messaging::messages::CommandMessage* msg = new flex::messaging::messages::CommandMessage();
msg->setClientId(mClientId);
msg->setDestination(mDestination);
msg->setOperation(flex::messaging::messages::CommandMessage::SUBSCRIBE);
msg->headers()->set("DSSubtopic", mClientId);
rtmp::Client::instance().send(&rtmp::messages::Amf3Command(amf::Variant((amf::Object*)msg)), std::bind(&Consumer::onSubscribe, this, std::placeholders::_1));
}
void addListener(const MessageListener& listener){
mListeners.push_back(listener);
}
void onMessage(const amf::Variant& message){
for(auto itr = mListeners.begin(); itr != mListeners.end(); ++itr)
(*itr)(message);
}
private:
void onSubscribe(const amf::Variant& result){
std::cout << "Consumer " << mClientId << " acknowledged" << std::endl;
}
private:
std::string mClientId;
std::string mDestination;
std::vector<MessageListener> mListeners;
};
};
};
|
/*
* Generated by class-dump 3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard.
*/
#import "NSWindowController.h"
@class DVTBorderedView, IDEAssistant, IDEAssistantContext, IDEFilterControlBar, NSBox, NSButton, NSMutableArray, NSString, NSTextField, NSView;
@interface IDEAssistantWindowController : NSWindowController
{
NSBox *_box;
DVTBorderedView *_outerBorderedView;
DVTBorderedView *_borderedView;
DVTBorderedView *_sourceListBorderedView;
NSButton *_nextButton;
NSButton *_backButton;
NSButton *_cancelButton;
NSTextField *_titleField;
IDEFilterControlBar *_filterControlBar;
IDEAssistant *_installedAssistant;
IDEAssistantContext *_assistantContext;
id _currentCompletionBlock;
NSMutableArray *_assistantHistory;
NSMutableArray *_allAnimations;
NSView *_nextKeyView;
double _lastAnimationDirection;
_Bool _backtrackingFromOverlayAssistant;
_Bool _closing;
IDEAssistant *_currentAssistant;
NSString *_nextButtonTitle;
NSString *_finishButtonTitle;
NSMutableArray *_completionPreprocessors;
NSMutableArray *_completionPreprocessorExecutionStack;
}
+ (id)keyPathsForValuesAffectingAssistantTitle;
+ (id)keyPathsForValuesAffectingCanCancel;
+ (id)keyPathsForValuesAffectingCanGoForwardOrFinish;
+ (id)keyPathsForValuesAffectingForwardOrFinishButtonTitle;
+ (id)keyPathsForValuesAffectingOnFirstAssistant;
- (void).cxx_destruct;
- (void)_clearAssistantHistoryStack;
- (void)_finishWithAction:(id)arg1;
- (id)_popAssistantHistoryStack;
- (id)_popAssistantHistoryStackToIdentifier:(id)arg1;
- (void)_pushAssistantOntoHistoryStack:(id)arg1;
- (void)addAnimationForKey:(id)arg1 toView:(id)arg2;
- (void)addGoForwardPreprocessor:(id)arg1;
- (id)assistantTitle;
- (id)assistantWithIdentifier:(id)arg1;
- (void)beginSessionForWorkspaceWindow:(id)arg1;
- (void)beginSessionWithAssistantIdentifier:(id)arg1 context:(id)arg2 completionBlock:(id)arg3;
- (BOOL)canCancel;
- (BOOL)canGoBack;
- (BOOL)canGoForwardOrFinish;
- (void)cancelSession;
- (void)close;
@property(retain, nonatomic) NSMutableArray *completionPreprocessorExecutionStack; // @synthesize completionPreprocessorExecutionStack=_completionPreprocessorExecutionStack;
@property(retain, nonatomic) NSMutableArray *completionPreprocessors; // @synthesize completionPreprocessors=_completionPreprocessors;
- (void)configureAnimationImageViewWithDirection:(double)arg1 actionBlock:(id)arg2;
@property(readonly, nonatomic) IDEAssistant *currentAssistant; // @synthesize currentAssistant=_currentAssistant;
- (void)didInstallViewController:(id)arg1;
- (void)drainPreprocessorOrContinueWithSender:(id)arg1;
- (void)endAssistantSessionWithResult:(int)arg1 error:(id)arg2;
@property(retain, nonatomic) NSString *finishButtonTitle; // @synthesize finishButtonTitle=_finishButtonTitle;
- (id)forwardOrFinishButtonTitle;
- (void)goBack:(id)arg1;
- (void)goNextOrFinish:(id)arg1;
- (id)init;
@property(retain, nonatomic) NSString *nextButtonTitle; // @synthesize nextButtonTitle=_nextButtonTitle;
- (BOOL)onFirstAssistant;
- (void)setAnimationDuration;
- (void)setCurrentAssistant:(id)arg1;
- (void)setCurrentAssistant:(id)arg1 andInstallView:(BOOL)arg2;
- (void)setupAccessoriesForAssistant:(id)arg1 animated:(BOOL)arg2;
- (id)skipAheadIfPossibleAndReturnAssistantIdentifier;
- (void)willInstallViewController:(id)arg1;
- (void)windowDidLoad;
@end
|
//
// MSColorSelectionView.h
//
// Created by Maksym Shcheglov on 2015-04-12.
//
// The MIT License (MIT)
// Copyright (c) 2015 Maksym Shcheglov
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <UIKit/UIKit.h>
#import "MSColorView.h"
/**
* The enum to define the MSColorView's types.
*/
typedef NS_ENUM(NSUInteger, MSSelectedColorView) {
/**
* The RGB color view type.
*/
MSSelectedColorViewRGB,
/**
* The HSB color view type.
*/
MSSelectedColorViewHSB
};
/**
* The MSColorSelectionView aggregates views that should be used to edit color components.
*/
@interface MSColorSelectionView : UIView <MSColorView>
/**
* The selected color view
*/
@property (nonatomic, assign, readonly) MSSelectedColorView selectedIndex;
/**
* Makes a color component view (rgb or hsb) visible according to the index.
*
* @param index This index define a view to show.
* @param animated If YES, the view is being appeared using an animation.
*/
- (void)setSelectedIndex:(MSSelectedColorView)index animated:(BOOL)animated;
@end
|
/*
* Generated by class-dump 3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard.
*/
#import <IDEKit/IDETemplateInstantiationAssistant.h>
#import "NSComboBoxDataSource.h"
@class NSArray, NSMutableDictionary, NSString, NSTextField, NSView;
@interface IDETemplateOptionsAssistant : IDETemplateInstantiationAssistant <NSComboBoxDataSource>
{
NSView *_mainView;
NSArray *_classNames;
NSMutableDictionary *_controlsForOptionIds;
BOOL _canGoForward;
NSTextField *_firstTextField;
NSArray *_allSortedOptions;
}
- (void).cxx_destruct;
- (void)_setAccessibilityForCell:(id)arg1 withOption:(id)arg2 prefix:(id)arg3;
- (void)_setControl:(id)arg1 forOptionIdentifier:(id)arg2;
- (id)additionalOptions;
@property(readonly) NSArray *allSortedOptions; // @synthesize allSortedOptions=_allSortedOptions;
- (id)assistantTitle;
@property BOOL canGoForward; // @synthesize canGoForward=_canGoForward;
- (id)classNamesForComboBox:(id)arg1;
- (id)comboBox:(id)arg1 completedString:(id)arg2;
- (unsigned long long)comboBox:(id)arg1 indexOfItemWithStringValue:(id)arg2;
- (id)comboBox:(id)arg1 objectValueForItemAtIndex:(long long)arg2;
- (id)controlForOptionIdentifier:(id)arg1;
- (id)createControlForOption:(id)arg1;
- (id)createLabelForOption:(id)arg1;
@property(retain) NSTextField *firstTextField; // @synthesize firstTextField=_firstTextField;
- (void)loadView;
- (id)nextAssistantIdentifier;
- (long long)numberOfItemsInComboBox:(id)arg1;
- (double)requiredViewSpacingForOption:(id)arg1;
- (void)restoreSelectionFromUserDefaults;
- (void)setAssistantContext:(id)arg1;
- (void)setupOptionViews;
- (void)updateOptions:(id)arg1;
- (void)viewDidInstall;
- (void)viewWillUninstall;
- (void)writeStateToUserDefaults;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
|
//
// AppDelegate.h
// Chapter 05 - Earth
//
// Created by David Rönnqvist on 2014-04-05.
// Copyright (c) 2014 David Rönnqvist.
//
// 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.
// ==================================================================================
// IMPORTANT NOTE:
// The Image assets (textures) that are included in this project are used with permission
// from the original creator. These permissions include their usage in the digital book
// and in this sample project (including distribution of the sample project).
//
// If you want to use them for other purposes, you can download lower resolution versions
// at: http://planetpixelemporium.com/earth.html or get in contact with the creator.
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@end
|
//==================================================================================
// Copyright (c) 2016 , Advanced Micro Devices, Inc. All rights reserved.
//
/// \author AMD Developer Tools Team
/// \file pdRemoteProcessDebuggerDebuggingServerWatcherThread.h
///
//==================================================================================
//------------------------------ pdRemoteProcessDebuggerDebuggingServerWatcherThread.h ------------------------------
#ifndef __PDREMOTEPROCESSDEBUGGERDEBUGGINGSERVERWATCHERTHREAD_H
#define __PDREMOTEPROCESSDEBUGGERDEBUGGINGSERVERWATCHERTHREAD_H
// Infra:
#include <AMDTOSWrappers/Include/osThread.h>
// ----------------------------------------------------------------------------------
// Class Name: pdRemoteProcessDebuggerDebuggingServerWatcherThread : public osThread
// General Description: A thread to monitor the remote debugging server, and terminate it when
// the debugged process is terminated.
// Author: Uri Shomroni
// Creation Date: 16/8/2009
// ----------------------------------------------------------------------------------
class pdRemoteProcessDebuggerDebuggingServerWatcherThread : public osThread
{
public:
pdRemoteProcessDebuggerDebuggingServerWatcherThread();
~pdRemoteProcessDebuggerDebuggingServerWatcherThread();
// Overrides osThread:
virtual int entryPoint();
virtual void beforeTermination();
// Used to start and stop monitoring debugging servers:
void monitorLocalMachineDebuggingServer(osProcessId debuggingServerProcID);
void stopMonitoringDebuggingServer();
// Are we currently watching a process:
bool isMonitoringRemoteDebuggingServer() const {return (0 != _localMachineDebuggingServerProcId);};
private:
void terminateDebuggingServer();
private:
bool _waitingForNewServer;
osProcessId _localMachineDebuggingServerProcId;
};
#endif //__PDREMOTEPROCESSDEBUGGERDEBUGGINGSERVERWATCHERTHREAD_H
|
/* Copyright (c) 2008-2009 Christopher J. W. Lloyd
Permission is hereby granted,free of charge,to any person obtaining a copy of this software and associated documentation files (the "Software"),to deal in the Software without restriction,including without limitation the rights to use,copy,modify,merge,publish,distribute,sublicense,and/or sell copies of the Software,and to permit persons to whom the Software is furnished to do so,subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE,ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreFoundation/CFBase.h>
#import <CoreFoundation/CFNumber.h>
typedef struct __NSNumberFormatter *CFNumberFormatterRef;
enum {
kCFNumberFormatterNoStyle =0,
kCFNumberFormatterDecimalStyle =1,
kCFNumberFormatterCurrencyStyle =2,
kCFNumberFormatterPercentStyle =3,
kCFNumberFormatterScientificStyle=4,
kCFNumberFormatterSpellOutStyle =5,
};
typedef CFIndex CFNumberFormatterStyle;
enum {
kCFNumberFormatterParseIntegersOnly= 1
};
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterCurrencyCode;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterDecimalSeparator;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterCurrencyDecimalSeparator;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterAlwaysShowDecimalSeparator;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterGroupingSeparator;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterUseGroupingSeparator;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPercentSymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterZeroSymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterNaNSymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterInfinitySymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMinusSign;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPlusSign;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterCurrencySymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterExponentSymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMinIntegerDigits;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMaxIntegerDigits;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMinFractionDigits;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMaxFractionDigits;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterGroupingSize;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterSecondaryGroupingSize;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterRoundingMode;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterRoundingIncrement;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterFormatWidth;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPaddingPosition;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPaddingCharacter;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterDefaultFormat;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMultiplier;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPositivePrefix;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPositiveSuffix;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterNegativePrefix;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterNegativeSuffix;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterPerMillSymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterInternationalCurrencySymbol;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterCurrencyGroupingSeparator;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterIsLenient;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterUseSignificantDigits;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMinSignificantDigits;
COREFOUNDATION_EXPORT const CFStringRef kCFNumberFormatterMaxSignificantDigits;
CFTypeID CFNumberFormatterGetTypeID(void);
CFNumberFormatterRef CFNumberFormatterCreate(CFAllocatorRef allocator,CFLocaleRef locale,CFNumberFormatterStyle style);
CFLocaleRef CFNumberFormatterGetLocale(CFNumberFormatterRef self);
CFNumberFormatterStyle CFNumberFormatterGetStyle(CFNumberFormatterRef self);
CFStringRef CFNumberFormatterGetFormat(CFNumberFormatterRef self);
void CFNumberFormatterSetFormat(CFNumberFormatterRef self,CFStringRef format);
void CFNumberFormatterSetProperty(CFNumberFormatterRef self,CFStringRef key,CFTypeRef value);
CFTypeRef CFNumberFormatterCopyProperty(CFNumberFormatterRef self,CFStringRef key);
CFNumberRef CFNumberFormatterCreateNumberFromString(CFAllocatorRef allocator,CFNumberFormatterRef self,CFStringRef string,CFRange *rangep,CFOptionFlags options);
CFStringRef CFNumberFormatterCreateStringWithNumber(CFAllocatorRef allocator,CFNumberFormatterRef self,CFNumberRef number);
CFStringRef CFNumberFormatterCreateStringWithValue(CFAllocatorRef allocator,CFNumberFormatterRef self,CFNumberType numberType,const void *valuep);
Boolean CFNumberFormatterGetDecimalInfoForCurrencyCode(CFStringRef currencyCode,int32_t *defaultFractionDigits,double *roundingIncrement);
Boolean CFNumberFormatterGetValueFromString(CFNumberFormatterRef self,CFStringRef string,CFRange *rangep,CFNumberType numberType,void *valuep);
|
/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2017 Intel Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
#ifndef UPM_COMPASS_H_
#define UPM_COMPASS_H_
#ifdef __cplusplus
extern "C" {
#endif
// Compass function table
typedef struct _upm_compass_ft {
upm_result_t (*upm_compass_set_scale) (void* dev, float scale);
upm_result_t (*upm_compass_set_offset) (void* dev, float offset);
// returns a heading in degrees
upm_result_t (*upm_compass_get_value) (void* dev, float *value);
} upm_compass_ft;
#ifdef __cplusplus
}
#endif
#endif /* UPM_COMPASS_H_ */
|
//
// Person.h
// MVVMWithKVO
//
// Created by Bryan Luby on 10/27/13.
// Copyright (c) 2013 Bryan Luby. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Person : NSObject
@property (copy, nonatomic) NSString *name;
@property (strong, nonatomic) NSDate *birthday;
- (instancetype)initWithName:(NSString *)name;
@end
|
//
// TrackParams.h
// ViSearch
//
// Created by Yaoxuan on 5/12/16.
// Copyright © 2016 Shaohuan Li. All rights reserved.
//
#ifndef TrackParams_h
#define TrackParams_h
#import <Foundation/Foundation.h>
#import "BaseSearchParams.h"
@interface TrackParams : BaseSearchParams
@property (nonatomic, readonly) NSString * action;
@property (nonatomic) NSString * imName;
@property (nonatomic, readonly) NSString * reqId;
@property (nonatomic, readonly) NSString * cid; // set to access key
@property (nonatomic) NSString * cuid;
- (id) init __unavailable;
- (TrackParams *)withImName:(NSString *)imName;
+ (TrackParams *)createWithCID:(NSString *)cid ReqId:(NSString *)reqId andAction:(NSString *)action __deprecated_msg("use createWithAccessKey:accessKey:reqId:andAction method instead");
+ (TrackParams *)createWithAccessKey:(NSString *)accessKey reqId:(NSString *)reqId andAction:(NSString *)action;
@end
#endif /* TrackParams_h */
|
//
// RequestManager.h
// Organic
//
// Created by Mike on 1/18/15.
// Copyright (c) 2015 Mike Amaral. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RequestManager : NSObject
+ (id)sharedInstance;
- (void)getGitHubDetailsForUser:(NSString *)user handler:(void (^)(NSError *error, NSDictionary *user, NSArray *repos))handler;
@end
|
//
// AppDelegate.h
// FFPickerView
//
// Created by Felix Ayala on 6/18/15.
// Copyright (c) 2015 Pandorga. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
// if97_xps stub - Interfaces CoolProp IF97 function to Mathcad
//
// this code executes the user function if97_xps(p,s), which is a wrapper for
// the CoolProp-IF97 function, Q_psmass(p,s).
LRESULT if97_XPS(
LPCOMPLEXSCALAR x, // pointer to the result
LPCCOMPLEXSCALAR p,
LPCCOMPLEXSCALAR s) // pointer to the parameter received from Mathcad
{
// first check to make sure "p" and "s" have no imaginary component
if ( p->imag != 0.0 )
return MAKELRESULT(MUST_BE_REAL,1);
if ( s->imag != 0.0 )
return MAKELRESULT(MUST_BE_REAL,2);
//otherwise, all is well, evaluate function
try {
x->real = IF97::Q_psmass(p->real,s->real);
}
catch (const std::out_of_range& e) {
if (e.what()[0] == 'P')
return MAKELRESULT(P_OUT_OF_RANGE,1);
else if ((e.what()[0] == 'E') && (e.what()[3] == 'r'))
return MAKELRESULT(S_OUT_OF_RANGE,2);
else
return MAKELRESULT(UNKNOWN,1);
}
// normal return
return 0;
}
FUNCTIONINFO if97_xps =
{
"if97_xps", // name by which Mathcad will recognize the function
"p,s", // if97_xps will be called as if97_xps(p,s)
// description of if97_xps(p,s)
"Obtains the steam quality, x, as a function of pressure, p [Pa], and mass entropy [J/kg-K].",
(LPCFUNCTION)if97_XPS, // pointer to executable code
COMPLEX_SCALAR, // the return type is a complex scalar
2, // there are two input parameters
{ COMPLEX_SCALAR, COMPLEX_SCALAR } // that are both complex scalars
};
|
#ifndef UTIL_TOKEN_H
#define UTIL_TOKEN_H
#include <stdbool.h>
#define TOKEN_STRLEN 33
bool generate_token(char out[static TOKEN_STRLEN]);
#endif
|
#ifndef JQ_PARSER_H
#define JQ_PARSER_H
int jq_parse(struct locfile* source, block* answer);
int jq_parse_library(struct locfile* locations, block* answer);
#endif
|
#if defined(PEGASUS_OS_HPUX)
# include "UNIX_DatabaseSystemPrivate_HPUX.h"
#elif defined(PEGASUS_OS_LINUX)
# include "UNIX_DatabaseSystemPrivate_LINUX.h"
#elif defined(PEGASUS_OS_DARWIN)
# include "UNIX_DatabaseSystemPrivate_DARWIN.h"
#elif defined(PEGASUS_OS_AIX)
# include "UNIX_DatabaseSystemPrivate_AIX.h"
#elif defined(PEGASUS_OS_FREEBSD)
# include "UNIX_DatabaseSystemPrivate_FREEBSD.h"
#elif defined(PEGASUS_OS_SOLARIS)
# include "UNIX_DatabaseSystemPrivate_SOLARIS.h"
#elif defined(PEGASUS_OS_ZOS)
# include "UNIX_DatabaseSystemPrivate_ZOS.h"
#elif defined(PEGASUS_OS_VMS)
# include "UNIX_DatabaseSystemPrivate_VMS.h"
#elif defined(PEGASUS_OS_TRU64)
# include "UNIX_DatabaseSystemPrivate_TRU64.h"
#else
# include "UNIX_DatabaseSystemPrivate_STUB.h"
#endif
|
//
// KPCAASaturnMoons.h
// SwiftAA
//
// Created by Cédric Foellmi on 10/07/15.
// Licensed under the MIT License (see LICENSE file)
//
#import <Foundation/Foundation.h>
#import "KPCAA3DCoordinate.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct KPCAASaturnMoonDetails {
KPCAA3DCoordinateComponents TrueRectangularCoordinateComponents;
KPCAA3DCoordinateComponents ApparentRectangularCoordinateComponents;
BOOL inTransit;
BOOL inOccultation;
BOOL inEclipse;
BOOL inShadowTransit;
} KPCAASaturnMoonDetails;
typedef struct KPCAASaturnMoonsDetails {
KPCAASaturnMoonDetails Satellite1;
KPCAASaturnMoonDetails Satellite2;
KPCAASaturnMoonDetails Satellite3;
KPCAASaturnMoonDetails Satellite4;
KPCAASaturnMoonDetails Satellite5;
KPCAASaturnMoonDetails Satellite6;
KPCAASaturnMoonDetails Satellite7;
KPCAASaturnMoonDetails Satellite8;
} KPCAASaturnMoonsDetails;
KPCAASaturnMoonsDetails KPCAASaturnMoonsDetails_Calculate(double JD, BOOL highPrecision);
#if __cplusplus
}
#endif
|
#include "zerosInFactorial.c"
|
#include <io.h>
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#define read(...) _read(__VA_ARGS__)
#define write(...) _write(__VA_ARGS__)
#define isatty(...) _isatty(__VA_ARGS__)
|
#ifndef __BARRIER_SYNC_CLIENT_H__
#define __BARRIER_SYNC_CLIENT_H__
#include "fixed_types.h"
#include "clock_skew_minimization_object.h"
#include "packetize.h"
#include "subsecond_time.h"
// Forward Decls
class Core;
class BarrierSyncClient : public ClockSkewMinimizationClient
{
private:
Core* m_core;
SubsecondTime m_barrier_interval;
SubsecondTime m_next_sync_time;
UInt32 m_num_outstanding;
public:
BarrierSyncClient(Core* core);
~BarrierSyncClient();
void enable() {}
void disable() {}
void synchronize(SubsecondTime time, bool ignore_time, bool abort_func(void*) = NULL, void* abort_arg = NULL);
};
#endif /* __BARRIER_SYNC_CLIENT_H__ */
|
//
// ELCodable_osx.h
// ELCodable_osx
//
// Created by Brandon Sneed on 6/16/16.
// Copyright © 2016 WalmartLabs. All rights reserved.
//
#import <Cocoa/Cocoa.h>
//! Project version number for ELCodable_osx.
FOUNDATION_EXPORT double ELCodable_osxVersionNumber;
//! Project version string for ELCodable_osx.
FOUNDATION_EXPORT const unsigned char ELCodable_osxVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <ELCodable_osx/PublicHeader.h>
|
/*******************************************************************************
** ArrayOperations.h
** Part of the mutual information toolbox
**
** Contains functions to floor arrays, and to merge arrays into a joint
** state.
**
** Author: Adam Pocock
** Created 17/2/2010
** Updated - 22/02/2014 - Added checking on calloc, and an increment array function.
**
** Copyright 2010,2014 Adam Pocock, The University Of Manchester
** www.cs.manchester.ac.uk
**
** This file is part of MIToolbox, licensed under the 3-clause BSD license.
*******************************************************************************/
#ifndef __ArrayOperations_H
#define __ArrayOperations_H
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
** A version of calloc which checks to see if memory was allocated.
*******************************************************************************/
void* checkedCalloc(size_t vectorLength, size_t sizeOfType);
/*******************************************************************************
** Increments each value in a double array
*******************************************************************************/
void incrementVector(double* vector, int vectorLength);
/*******************************************************************************
** Simple print functions for debugging
*******************************************************************************/
void printDoubleVector(double *vector, int vectorlength);
void printIntVector(int *vector, int vectorLength);
/*******************************************************************************
** numberOfUniqueValues finds the number of unique values in an array by
** repeatedly iterating through the array and checking if a value has been
** seen previously
*******************************************************************************/
int numberOfUniqueValues(double *featureVector, int vectorLength);
/*******************************************************************************
** normaliseArray takes an input vector and writes an output vector
** which is a normalised version of the input, and returns the number of states
** A normalised array has min value = 0, max value = number of states
** and all values are integers
**
** length(inputVector) == length(outputVector) == vectorLength otherwise there
** is a memory leak
*******************************************************************************/
int normaliseArray(double *inputVector, int *outputVector, int vectorLength);
/*******************************************************************************
** mergeArrays takes in two arrays and writes the joint state of those arrays
** to the output vector
**
** the length of the vectors must be the same and equal to vectorLength
*******************************************************************************/
int mergeArrays(double *firstVector, double *secondVector, double *outputVector, int vectorLength);
int mergeArraysArities(double *firstVector, int numFirstStates, double *secondVector, int numSecondStates, double *outputVector, int vectorLength);
/*******************************************************************************
** mergeMultipleArrays takes in a matrix and repeatedly merges the matrix using
** merge arrays and writes the joint state of that matrix
** to the output vector
**
** the length of the vectors must be the same and equal to vectorLength
** matrixWidth = the number of columns in the matrix
*******************************************************************************/
int mergeMultipleArrays(double *inputMatrix, double *outputVector, int matrixWidth, int vectorLength);
int mergeMultipleArraysArities(double *inputMatrix, double *outputVector, int matrixWidth, int *arities, int vectorLength);
#ifdef __cplusplus
}
#endif
#endif
|
/*++
Module:
@file stringlib.h
Abstract:
@author Joe N. Turner <joe@agavemountain.com>
Copyright (C) 2008 Agave Mountain, Inc.; All right reserved.
*/
/*! \mainpage
Welcome to the C++ String Utility Library
<table>
<tr><th>Library <td>String utility shared library
<tr><th>Author <td>Joe Turner
<tr><th>Version <td>0.0.1
</table>
@section intro INTRODUCTION
This is a shared library designed to capture various design patterns,
utility functions, templates, and reusable code into one
unit tested reusable library.
Topics:
- \subpage requirements
- \subpage history
Questions, comments, concerns, or dissenting opinions should be directed
to Joe Turner, joe@agavemountain.com
\page requirements Requirements
The requirements for code inclusion into this library are relavetly simple:
-# The code has to be useful
-# The code has to be reusable
-# The code has to be optimized for speed or performance
\page history Revision History
<HR>
\section v0_0 Release v0.0
The upcoming v1.0 release is currently under development in the main source trunk.
*/
/**
All of the library's code is confined in the agavecore namespace to avoid
namespace collisions with other namespaces.
*/
namespace stringlib
{
};
|
/*
* Copyright (c) 2013 Apple Inc. All rights reserved.
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
* 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.
*
* @APPLE_APACHE_LICENSE_HEADER_END@
*/
/*
* IMPORTANT: This header file describes INTERNAL interfaces to libplatform
* which are subject to change in future releases of Mac OS X. Any applications
* relying on these interfaces WILL break.
*/
#ifndef __OS_YIELD__
#define __OS_YIELD__
#include <TargetConditionals.h>
#pragma mark -
#pragma mark _os_wait_until
#if OS_ATOMIC_UP
#define _os_wait_until(c) do { \
int _spins = 0; \
while (unlikely(!(c))) { \
_spins++; \
_os_preemption_yield(_spins); \
} } while (0)
#elif TARGET_OS_EMBEDDED
// <rdar://problem/15508918>
#ifndef OS_WAIT_SPINS
#define OS_WAIT_SPINS 1024
#endif
#define _os_wait_until(c) do { \
int _spins = -(OS_WAIT_SPINS); \
while (unlikely(!(c))) { \
if (unlikely(_spins++ >= 0)) { \
_os_preemption_yield(_spins); \
} else { \
os_hardware_pause(); \
} \
} } while (0)
#else
#define _os_wait_until(c) do { \
while (!(c)) { \
os_hardware_pause(); \
} } while (0)
#endif
#pragma mark -
#pragma mark os_hardware_pause
#if defined(__x86_64__) || defined(__i386__)
#define os_hardware_pause() __asm__("pause")
#elif (defined(__arm__) && defined(_ARM_ARCH_7) && defined(__thumb__)) || \
defined(__arm64__)
#define os_hardware_pause() __asm__("yield")
#define os_hardware_wfe() __asm__("wfe")
#else
#define os_hardware_pause() __asm__("")
#endif
#pragma mark -
#pragma mark _os_preemption_yield
#if defined(SWITCH_OPTION_OSLOCK_DEPRESS) && !(TARGET_IPHONE_SIMULATOR && \
IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED < 1090)
#define OS_YIELD_THREAD_SWITCH_OPTION SWITCH_OPTION_OSLOCK_DEPRESS
#else
#define OS_YIELD_THREAD_SWITCH_OPTION SWITCH_OPTION_DEPRESS
#endif
#define _os_preemption_yield(n) thread_switch(MACH_PORT_NULL, \
OS_YIELD_THREAD_SWITCH_OPTION, (mach_msg_timeout_t)(n))
#endif // __OS_YIELD__
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject-Protocol.h"
@protocol XDComponentIdentifying <NSObject>
+ (id)defaultIdentifier;
- (id)identifier;
@end
|
/* encodeErgeHssCellLines.h was originally generated by the autoSql program, which also
* generated encodeErgeHssCellLines.c and encodeErgeHssCellLines.sql. This header links the database and
* the RAM representation of objects. */
/* Copyright (C) 2008 The Regents of the University of California
* See README in this or parent directory for licensing information. */
#ifndef ENCODEERGEHSSCELLLINES_H
#define ENCODEERGEHSSCELLLINES_H
#define ENCODEERGEHSSCELLLINES_NUM_COLS 15
struct encodeErgeHssCellLines
/* ENCODE experimental data from dbERGEII */
{
struct encodeErgeHssCellLines *next; /* Next in singly linked list. */
char *chrom; /* Human chromosome */
unsigned chromStart; /* Start position in chromosome */
unsigned chromEnd; /* End position in chromosome */
char *name; /* Name of read - up to 255 characters */
unsigned score; /* Score from 0-1000. 1000 is best */
char strand[2]; /* Value should be + or - */
unsigned thickStart; /* Start of where display should be thick (start codon) */
unsigned thickEnd; /* End of where display should be thick (stop codon) */
unsigned reserved; /* Always zero for now */
unsigned blockCount; /* Number of separate blocks (regions without gaps) */
unsigned *blockSizes; /* Comma separated list of block sizes */
unsigned *chromStarts; /* Start position of each block in relative to chromStart */
char *Id; /* dbERGEII Id */
char *color; /* RGB color values */
char *allLines; /* List of all cell lines */
};
struct encodeErgeHssCellLines *encodeErgeHssCellLinesLoad(char **row);
/* Load a encodeErgeHssCellLines from row fetched with select * from encodeErgeHssCellLines
* from database. Dispose of this with encodeErgeHssCellLinesFree(). */
struct encodeErgeHssCellLines *encodeErgeHssCellLinesLoadAll(char *fileName);
/* Load all encodeErgeHssCellLines from whitespace-separated file.
* Dispose of this with encodeErgeHssCellLinesFreeList(). */
struct encodeErgeHssCellLines *encodeErgeHssCellLinesLoadAllByChar(char *fileName, char chopper);
/* Load all encodeErgeHssCellLines from chopper separated file.
* Dispose of this with encodeErgeHssCellLinesFreeList(). */
#define encodeErgeHssCellLinesLoadAllByTab(a) encodeErgeHssCellLinesLoadAllByChar(a, '\t');
/* Load all encodeErgeHssCellLines from tab separated file.
* Dispose of this with encodeErgeHssCellLinesFreeList(). */
struct encodeErgeHssCellLines *encodeErgeHssCellLinesCommaIn(char **pS, struct encodeErgeHssCellLines *ret);
/* Create a encodeErgeHssCellLines out of a comma separated string.
* This will fill in ret if non-null, otherwise will
* return a new encodeErgeHssCellLines */
void encodeErgeHssCellLinesFree(struct encodeErgeHssCellLines **pEl);
/* Free a single dynamically allocated encodeErgeHssCellLines such as created
* with encodeErgeHssCellLinesLoad(). */
void encodeErgeHssCellLinesFreeList(struct encodeErgeHssCellLines **pList);
/* Free a list of dynamically allocated encodeErgeHssCellLines's */
void encodeErgeHssCellLinesOutput(struct encodeErgeHssCellLines *el, FILE *f, char sep, char lastSep);
/* Print out encodeErgeHssCellLines. Separate fields with sep. Follow last field with lastSep. */
#define encodeErgeHssCellLinesTabOut(el,f) encodeErgeHssCellLinesOutput(el,f,'\t','\n');
/* Print out encodeErgeHssCellLines as a line in a tab-separated file. */
#define encodeErgeHssCellLinesCommaOut(el,f) encodeErgeHssCellLinesOutput(el,f,',',',');
/* Print out encodeErgeHssCellLines as a comma separated list including final comma. */
/* -------------------------------- End autoSql Generated Code -------------------------------- */
struct encodeErgeHssCellLines *encodeErgeHssCellLinesLoadByQuery(struct sqlConnection *conn, char *query);
/* Load all encodeErge from table that satisfy the query given.
* Where query is of the form 'select * from example where something=something'
* or 'select example.* from example, anotherTable where example.something =
* anotherTable.something'.
* Dispose of this with encodeErgeFreeList(). */
#endif /* ENCODEERGEHSSCELLLINES_H */
|
//*****************************************************************************
//
//! \file xdebug.h
//! \brief Drivers for assisting debug of the peripheral library.
//! \version V2.2.1.0
//! \date 11/20/2011
//! \author CooCox
//! \copy
//!
//! Copyright (c) 2011, CooCox
//! All rights reserved.
//!
//! Redistribution and use in source and binary forms, with or without
//! modification, are permitted provided that the following conditions
//! are met:
//!
//! * Redistributions of source code must retain the above copyright
//! notice, this list of conditions and the following disclaimer.
//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
//! contributors may be used to endorse or promote products derived
//! from this software without specific prior written permission.
//!
//! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
//! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
//! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
//! THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************
//*****************************************************************************
//
//! \brief Error Function to be called when assert runs false.
//!
//! \param pcFilename is the current file name.
//! \param ulLine is the current line number.
//!
//! This is just an default error handler function, Users should implement
//! this function with your own way when debug.
//!
//! \note This is only used when doing a \b xDEBUG build.
//!
//! \return None.
//
//*****************************************************************************
#ifdef xDEBUG
void __xerror__(char *pcFilename, unsigned long ulLine)
{
//
// Add your own error handling
//
while(1)
{
}
}
#endif
|
/*************************************************************************/ /*!
@File
@Title RGX Transfer queue Functionality
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Header for the RGX Transfer queue Functionality
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
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.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) 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.
*/ /**************************************************************************/
#if !defined(__RGXTRANSFER_H__)
#define __RGXTRANSFER_H__
#include "devicemem.h"
#include "device.h"
#include "rgxdevice.h"
#include "rgxfwutils.h"
#include "rgx_fwif_resetframework.h"
#include "sync_server.h"
#include "connection_server.h"
#if defined (__cplusplus)
extern "C" {
#endif
typedef struct _RGX_SERVER_TQ_CONTEXT_ RGX_SERVER_TQ_CONTEXT;
/*!
*******************************************************************************
@Function PVRSRVRGXCreateTransferContextKM
@Description
Server-side implementation of RGXCreateTransferContext
@Input pvDeviceNode - device node
FIXME fill this in
@Return PVRSRV_ERROR
******************************************************************************/
IMG_EXPORT
PVRSRV_ERROR PVRSRVRGXCreateTransferContextKM(CONNECTION_DATA *psConnection,
PVRSRV_DEVICE_NODE *psDeviceNode,
IMG_UINT32 ui32Priority,
IMG_DEV_VIRTADDR sMCUFenceAddr,
IMG_UINT32 ui32FrameworkCommandSize,
IMG_PBYTE pabyFrameworkCommand,
IMG_HANDLE hMemCtxPrivData,
RGX_SERVER_TQ_CONTEXT **ppsTransferContext);
/*!
*******************************************************************************
@Function PVRSRVRGXDestroyTransferContextKM
@Description
Server-side implementation of RGXDestroyTransferContext
@Input psTransferContext - Transfer context
@Return PVRSRV_ERROR
******************************************************************************/
IMG_EXPORT
PVRSRV_ERROR PVRSRVRGXDestroyTransferContextKM(RGX_SERVER_TQ_CONTEXT *psTransferContext);
/*!
*******************************************************************************
@Function PVRSRVSubmitTransferKM
@Description
Schedules one or more 2D or 3D HW commands on the firmware
@Return PVRSRV_ERROR
******************************************************************************/
IMG_EXPORT
PVRSRV_ERROR PVRSRVRGXSubmitTransferKM(RGX_SERVER_TQ_CONTEXT *psTransferContext,
IMG_UINT32 ui32PrepareCount,
IMG_UINT32 *paui32ClientFenceCount,
PRGXFWIF_UFO_ADDR **papauiClientFenceUFOAddress,
IMG_UINT32 **papaui32ClientFenceValue,
IMG_UINT32 *paui32ClientUpdateCount,
PRGXFWIF_UFO_ADDR **papauiClientUpdateUFOAddress,
IMG_UINT32 **papaui32ClientUpdateValue,
IMG_UINT32 *paui32ServerSyncCount,
IMG_UINT32 **papaui32ServerSyncFlags,
SERVER_SYNC_PRIMITIVE ***papapsServerSyncs,
IMG_UINT32 ui32NumFenceFDs,
IMG_INT32 *paui32FenceFDs,
IMG_UINT32 *paui32FWCommandSize,
IMG_UINT8 **papaui8FWCommand,
IMG_UINT32 *pui32TQPrepareFlags);
IMG_EXPORT
PVRSRV_ERROR PVRSRVRGXSetTransferContextPriorityKM(CONNECTION_DATA *psConnection,
RGX_SERVER_TQ_CONTEXT *psTransferContext,
IMG_UINT32 ui32Priority);
/* Debug - check if transfer context is waiting on a fence */
IMG_VOID CheckForStalledTransferCtxt(PVRSRV_RGXDEV_INFO *psDevInfo);
#endif /* __RGXTRANSFER_H__ */
|
//========================== Open Steamworks ================================
//
// This file is part of the Open Steamworks project. All individuals associated
// with this project do not claim ownership of the contents
//
// The code, comments, and all related files, projects, resources,
// redistributables included with this project are Copyright Valve Corporation.
// Additionally, Valve, the Valve logo, Half-Life, the Half-Life logo, the
// Lambda logo, Steam, the Steam logo, Team Fortress, the Team Fortress logo,
// Opposing Force, Day of Defeat, the Day of Defeat logo, Counter-Strike, the
// Counter-Strike logo, Source, the Source logo, and Counter-Strike Condition
// Zero are trademarks and or registered trademarks of Valve Corporation.
// All other trademarks are property of their respective owners.
//
//=============================================================================
#ifndef ISTEAMGAMECOORDINATOR001_H
#define ISTEAMGAMECOORDINATOR001_H
#ifdef _WIN32
#pragma once
#endif
#include "SteamTypes.h"
#include "GameCoordinatorCommon.h"
//-----------------------------------------------------------------------------
// Purpose: Functions for sending and receiving messages from the Game Coordinator
// for this application
//-----------------------------------------------------------------------------
class ISteamGameCoordinator001
{
public:
// sends a message to the Game Coordinator
virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0;
// returns true if there is a message waiting from the game coordinator
virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0;
// fills the provided buffer with the first message in the queue and returns k_EGCResultOK or
// returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size.
// If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned
// and the message remains at the head of the queue.
virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
};
#endif // ISTEAMGAMECOORDINATOR001_H
|
//
// RECommonFunctions.h
// RESideMenu
//
// Copyright (c) 2013-2014 Roman Efimov (https://github.com/romaonthego)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#ifndef REUIKitIsFlatMode
#define REUIKitIsFlatMode() RESideMenuUIKitIsFlatMode()
#endif
#ifndef kCFCoreFoundationVersionNumber_iOS_6_1
#define kCFCoreFoundationVersionNumber_iOS_6_1 793.00
#endif
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1
#define IF_IOS7_OR_GREATER(...) \
if (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_6_1) \
{ \
__VA_ARGS__ \
}
#else
#define IF_IOS7_OR_GREATER(...)
#endif
BOOL RESideMenuUIKitIsFlatMode(void);
|
/*
* Copyright (C) 2015-2016 Team Kodi
* http://kodi.tv
*
* 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, 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; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "JoystickTypes.h"
namespace JOYSTICK
{
/*!
* \brief Interface for handling keymap keys
*
* Keys can be mapped to analog actions (e.g. "AnalogSeekForward") or digital
* actions (e.g. "Up").
*/
class IKeymapHandler
{
public:
virtual ~IKeymapHandler(void) { }
/*!
* \brief Get the type of action mapped to the specified key ID
*
* \param keyId The key ID from Key.h
*
* \return The type of action mapped to keyId, or INPUT_TYPE::UNKNOWN if
* no action is mapped to the specified key
*/
virtual INPUT_TYPE GetInputType(unsigned int keyId) const = 0;
/*!
* \brief Get the action ID mapped to the specified key ID
*
* \param keyId The key ID from Key.h
*
* \return The action ID, or ACTION_NONE if no action is mapped to the
* specified key
*/
virtual int GetActionID(unsigned int keyId) const = 0;
/*!
* \brief A key mapped to a digital action has been pressed or released
*
* \param keyId The key ID from Key.h
* \param bPressed true if the key's button/axis is activated, false if deactivated
* \param holdTimeMs The held time in ms for pressed buttons, or 0 for released
*/
virtual void OnDigitalKey(unsigned int keyId, bool bPressed, unsigned int holdTimeMs = 0) = 0;
/*!
* \brief Callback for keys mapped to analog actions
*
* \param keyId The button key ID from Key.h
* \param magnitude The amount of the analog action
*
* If keyId is not mapped to an analog action, no action need be taken
*/
virtual void OnAnalogKey(unsigned int buttonKeyId, float magnitude) = 0;
};
}
|
static int cmp1(const void *p, const void *q);
int main (int argc, char *argv[]) {
int i,y;
int NrOfLots;
int *lots;
if (argc < 5) {
printf("Dette programet splitter opp en urdil pasert på hovedlot.\n\n\tUsage:\n\tSplittUdfileByLot udfile filmedLoter filutenlotter lotnomre...\n\n");
exit(0);
}
NrOfLots = argc -4;
printf("NrOfLots: %i\n",NrOfLots);
//allokerer minne til en array over lottene
lots = malloc(sizeof(int) * NrOfLots);
//legger inn lotene
y = 0;
for (i=4;i<argc;i++) {
printf("lotnr %s\n",argv[i]);
lots[y] = atoi(argv[i]);
y++;
}
//sorterer lottene
qsort(lots,NrOfLots,sizeof(int),cmp1);
for(i=0;i<NrOfLots;i++) {
printf("lotsorted: %i\n",lots[i]);
}
free(lots);
}
static int cmp1(const void *p, const void *q)
{
return *(const int *) p - *(const int *) q;
}
|
/* Defines the LTC_ARGCHK macro used within the library */
/* ARGTYPE is defined in mycrypt_cfg.h */
#if ARGTYPE == 0
#include <signal.h>
/* this is the default LibTomCrypt macro */
void crypt_argchk(char *v, char *s, int d);
#define LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); }
#elif ARGTYPE == 1
/* fatal type of error */
#define LTC_ARGCHK(x) assert((x))
#elif ARGTYPE == 2
#define LTC_ARGCHK(x)
#endif
/* $Source$ */
/* $Revision$ */
/* $Date$ */
|
/*
* LZO1X Decompressor from LZO
*
* Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <markus@oberhumer.com>
*
* The full LZO package can be found at:
* http://www.oberhumer.com/opensource/lzo/
*
* Changed for Linux kernel use by:
* Nitin Gupta <nitingupta910@gmail.com>
* Richard Purdie <rpurdie@openedhand.com>
*/
#ifndef STATIC
#include <linux/module.h>
#include <linux/kernel.h>
#endif
#include <asm/unaligned.h>
#include <linux/lzo.h>
#include "lzodefs.h"
#define HAVE_IP(x) ((size_t)(ip_end - ip) >= (size_t)(x))
#define HAVE_OP(x) ((size_t)(op_end - op) >= (size_t)(x))
#define NEED_IP(x) if (!HAVE_IP(x)) goto input_overrun
#define NEED_OP(x) if (!HAVE_OP(x)) goto output_overrun
#define TEST_LB(m_pos) if ((m_pos) < out) goto lookbehind_overrun
/* This MAX_255_COUNT is the maximum number of times we can add 255 to a base
* count without overflowing an integer. The multiply will overflow when
* multiplying 255 by more than MAXINT/255. The sum will overflow earlier
* depending on the base count. Since the base count is taken from a u8
* and a few bits, it is safe to assume that it will always be lower than
* or equal to 2*255, thus we can always prevent any overflow by accepting
* two less 255 steps. See Documentation/lzo.txt for more information.
*/
#define MAX_255_COUNT ((((size_t)~0) / 255) - 2)
int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
unsigned char *out, size_t *out_len)
{
unsigned char *op;
const unsigned char *ip;
size_t t, next;
size_t state = 0;
const unsigned char *m_pos;
const unsigned char * const ip_end = in + in_len;
unsigned char * const op_end = out + *out_len;
op = out;
ip = in;
if (unlikely(in_len < 3))
goto input_overrun;
if (*ip > 17) {
t = *ip++ - 17;
if (t < 4) {
next = t;
goto match_next;
}
goto copy_literal_run;
}
for (;;) {
t = *ip++;
if (t < 16) {
if (likely(state == 0)) {
if (unlikely(t == 0)) {
size_t offset;
const unsigned char *ip_last = ip;
while (unlikely(*ip == 0)) {
ip++;
NEED_IP(1);
}
offset = ip - ip_last;
if (unlikely(offset > MAX_255_COUNT))
return LZO_E_ERROR;
offset = (offset << 8) - offset;
t += offset + 15 + *ip++;
}
t += 3;
copy_literal_run:
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (likely(HAVE_IP(t + 15) && HAVE_OP(t + 15))) {
const unsigned char *ie = ip + t;
unsigned char *oe = op + t;
do {
COPY8(op, ip);
op += 8;
ip += 8;
# if !defined(__arm__)
COPY8(op, ip);
op += 8;
ip += 8;
#endif
} while (ip < ie);
ip = ie;
op = oe;
} else
#endif
{
NEED_OP(t);
NEED_IP(t + 3);
do {
*op++ = *ip++;
} while (--t > 0);
}
state = 4;
continue;
} else if (state != 4) {
next = t & 3;
m_pos = op - 1;
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
TEST_LB(m_pos);
NEED_OP(2);
op[0] = m_pos[0];
op[1] = m_pos[1];
op += 2;
goto match_next;
} else {
next = t & 3;
m_pos = op - (1 + M2_MAX_OFFSET);
m_pos -= t >> 2;
m_pos -= *ip++ << 2;
t = 3;
}
} else if (t >= 64) {
next = t & 3;
m_pos = op - 1;
m_pos -= (t >> 2) & 7;
m_pos -= *ip++ << 3;
t = (t >> 5) - 1 + (3 - 1);
} else if (t >= 32) {
t = (t & 31) + (3 - 1);
if (unlikely(t == 2)) {
size_t offset;
const unsigned char *ip_last = ip;
while (unlikely(*ip == 0)) {
ip++;
NEED_IP(1);
}
offset = ip - ip_last;
if (unlikely(offset > MAX_255_COUNT))
return LZO_E_ERROR;
offset = (offset << 8) - offset;
t += offset + 31 + *ip++;
NEED_IP(2);
}
m_pos = op - 1;
next = get_unaligned_le16(ip);
ip += 2;
m_pos -= next >> 2;
next &= 3;
} else {
m_pos = op;
m_pos -= (t & 8) << 11;
t = (t & 7) + (3 - 1);
if (unlikely(t == 2)) {
size_t offset;
const unsigned char *ip_last = ip;
while (unlikely(*ip == 0)) {
ip++;
NEED_IP(1);
}
offset = ip - ip_last;
if (unlikely(offset > MAX_255_COUNT))
return LZO_E_ERROR;
offset = (offset << 8) - offset;
t += offset + 7 + *ip++;
NEED_IP(2);
}
next = get_unaligned_le16(ip);
ip += 2;
m_pos -= next >> 2;
next &= 3;
if (m_pos == op)
goto eof_found;
m_pos -= 0x4000;
}
TEST_LB(m_pos);
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (op - m_pos >= 8) {
unsigned char *oe = op + t;
if (likely(HAVE_OP(t + 15))) {
do {
COPY8(op, m_pos);
op += 8;
m_pos += 8;
# if !defined(__arm__)
COPY8(op, m_pos);
op += 8;
m_pos += 8;
#endif
} while (op < oe);
op = oe;
if (HAVE_IP(6)) {
state = next;
COPY4(op, ip);
op += next;
ip += next;
continue;
}
} else {
NEED_OP(t);
do {
*op++ = *m_pos++;
} while (op < oe);
}
} else
#endif
{
unsigned char *oe = op + t;
NEED_OP(t);
op[0] = m_pos[0];
op[1] = m_pos[1];
op += 2;
m_pos += 2;
do {
*op++ = *m_pos++;
} while (op < oe);
}
match_next:
state = next;
t = next;
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (likely(HAVE_IP(6) && HAVE_OP(4))) {
COPY4(op, ip);
op += t;
ip += t;
} else
#endif
{
NEED_IP(t + 3);
NEED_OP(t);
while (t > 0) {
*op++ = *ip++;
t--;
}
}
}
eof_found:
*out_len = op - out;
return (t != 3 ? LZO_E_ERROR :
ip == ip_end ? LZO_E_OK :
ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN);
input_overrun:
*out_len = op - out;
return LZO_E_INPUT_OVERRUN;
output_overrun:
*out_len = op - out;
return LZO_E_OUTPUT_OVERRUN;
lookbehind_overrun:
*out_len = op - out;
return LZO_E_LOOKBEHIND_OVERRUN;
}
#ifndef STATIC
EXPORT_SYMBOL_GPL(lzo1x_decompress_safe);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("LZO1X Decompressor");
#endif
|
/* (c) 2001-2004 by Marcin Wiacek */
#ifndef __gsm_wap_h
#define __gsm_wap_h
#include <gammu-wap.h>
#include <gammu-message.h>
void NOKIA_EncodeWAPMMSSettingsSMSText(unsigned char *Buffer, size_t *Length, GSM_WAPSettings *settings, gboolean MMS);
/* -------------------------------- WAP Bookmark --------------------------- */
void NOKIA_EncodeWAPBookmarkSMSText (unsigned char *Buffer, size_t *Length, GSM_WAPBookmark *bookmark);
/* ------------------------------ MMS Indicator ---------------------------- */
void GSM_EncodeMMSIndicatorSMSText(unsigned char *Buffer, size_t *Length, GSM_MMSIndicator Indicator);
void GSM_EncodeWAPIndicatorSMSText(unsigned char *Buffer, size_t *Length, char *Text, char *URL);
#endif
/* How should editor hadle tabs in this file? Add editor commands here.
* vim: noexpandtab sw=8 ts=8 sts=8:
*/
|
/*
This program is part of Netmodeler, a library for graph and network
modeling and simulation.
Copyright (C) 2005 University of California
Copyright (C) 2005 P. Oscar Boykin <boykin@pobox.com>, University of Florida
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef starsky__edgefactory_h
#define starsky__edgefactory_h
#include <edge.h>
namespace Starsky {
/**
* A templated class to create
* edges. Any attribute other
* than the direction of the edge
* are passed as a string
*/
class EdgeFactory {
public:
virtual Edge* create(Node* from, Node* to) { return new Edge(from, to); }
/**
* The default implemenation returns the same as the above
*/
virtual Edge* create(Node* from, Node* to, const std::string& attr) {
return new Edge(from, to);
}
};
}
#endif
|
#ifndef _CNWDOMAIN_H_
#define _CNWDOMAIN_H_
#include "nwndef.h"
class CNWDomain
{
public:
int GetDescriptionText();
int GetNameText();
~CNWDomain();
CNWDomain();
};
#endif
|
#pragma once
#ifdef LIBTGB_EXPORT
#define LIBTGB_API __declspec(dllexport)
#else
#define LIBTGB_API __declspec(dllimport)
#endif
class gb;
struct ext_hook;
namespace tgb
{
class GBRenderer;
class LIBTGB_API Emulator
{
private:
gb* _gb;
GBRenderer* _renderer;
ext_hook* _exthookDef;
public:
Emulator(GBRenderer& renderer);
virtual ~Emulator();
void Clear();
bool LoadCartridge(const char* name);
void Update();
unsigned char SeriSend(unsigned char data);
void HookExport(unsigned char(*send)(unsigned char), bool(*led)(void));
void UnhookExport();
};
}
|
/*
* The Mana Client
* Copyright (C) 2009-2012 The Mana Developers
*
* This file is part of The Mana Client.
*
* 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
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib> // pulls in int64_t
#include <cstdio>
#include <string>
#ifndef NET_DOWNLOAD_H
#define NET_DOWNLOAD_H
enum DownloadStatus
{
DOWNLOAD_STATUS_CANCELLED = -3,
DOWNLOAD_STATUS_THREAD_ERROR = -2,
DOWNLOAD_STATUS_ERROR = -1,
DOWNLOAD_STATUS_STARTING = 0,
DOWNLOAD_STATUS_IDLE,
DOWNLOAD_STATUS_COMPLETE
};
typedef int (*DownloadUpdate)(void *ptr, DownloadStatus status,
size_t total, size_t remaining);
// Matches what CURL expects
typedef size_t (*WriteFunction)( void *ptr, size_t size, size_t nmemb,
void *stream);
struct SDL_Thread;
typedef void CURL;
struct curl_slist;
namespace Net {
class Download
{
public:
Download(void *ptr, const std::string &url, DownloadUpdate updateFunction);
~Download();
void addHeader(const std::string &header);
/**
* Convience method for adding no-cache headers.
*/
void noCache();
void setFile(const std::string &filename, int64_t adler32 = -1);
void setWriteFunction(WriteFunction write);
/**
* Starts the download thread.
* @returns true if thread was created
* false if the thread could not be made or download wasn't
* properly setup
*/
bool start();
/**
* Cancels the download. Returns immediately, the cancelled status will
* be noted in the next avialable update call.
*/
void cancel();
char *getError();
private:
static int downloadThread(void *ptr);
static int downloadProgress(void *clientp, double dltotal, double dlnow,
double ultotal, double ulnow);
void *mPtr;
std::string mUrl;
struct {
unsigned cancel : 1;
unsigned memoryWrite: 1;
unsigned checkAdler: 1;
} mOptions;
std::string mFileName;
WriteFunction mWriteFunction;
unsigned long mAdler;
DownloadUpdate mUpdateFunction;
SDL_Thread *mThread;
CURL *mCurl;
curl_slist *mHeaders;
char *mError;
};
} // namespace Net
#endif // NET_DOWNLOAD_H
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* 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, 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 XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#if !defined(TARGET_WINDOWS)
#define DECLARE_UNUSED(a,b) a __attribute__((unused)) b;
#endif
/*****************
* All platforms
*****************/
#define HAS_DVD_SWSCALE
#define HAS_VideoPlayer
#define HAS_EVENT_SERVER
#define HAS_SCREENSAVER
#define HAS_VIDEO_PLAYBACK
#define HAS_VISUALISATION
#define HAS_PVRCLIENTS
#define HAS_ADSPADDONS
#ifdef HAVE_LIBMICROHTTPD
#define HAS_WEB_SERVER
#define HAS_WEB_INTERFACE
#endif
#define HAS_JSONRPC
#define HAS_FILESYSTEM
#define HAS_FILESYSTEM_CDDA
#ifdef HAVE_LIBSMBCLIENT
#define HAS_FILESYSTEM_SMB
#endif
#ifdef HAVE_LIBNFS
#define HAS_FILESYSTEM_NFS
#endif
#ifdef HAVE_LIBPLIST
#define HAS_AIRPLAY
#endif
#if defined(HAVE_LIBSHAIRPLAY)
#define HAS_AIRTUNES
#endif
#ifdef HAVE_MYSQL
#define HAS_MYSQL
#endif
#if defined(USE_UPNP)
#define HAS_UPNP
#endif
#if defined(HAVE_LIBMDNS)
#define HAS_ZEROCONF
#define HAS_MDNS
#if defined(HAVE_LIBMDNSEMBEDDED)
#define HAS_MDNS_EMBEDDED
#endif
#endif
/*****************
* Win32 Specific
*****************/
#if defined(TARGET_WINDOWS)
#define HAS_WIN32_NETWORK
#define HAS_IRSERVERSUITE
#define HAS_FILESYSTEM_SMB
#define DECLARE_UNUSED(a,b) a b;
#endif
/*****************
* Mac Specific
*****************/
#if defined(TARGET_DARWIN)
#if defined(TARGET_DARWIN_OSX)
#define HAS_GL
#define HAS_SDL
#define HAS_SDL_WIN_EVENTS
#endif
#define HAS_ZEROCONF
#define HAS_LINUX_NETWORK
#endif
/*****************
* Linux Specific
*****************/
#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
#if defined(HAVE_LIBAVAHI_COMMON) && defined(HAVE_LIBAVAHI_CLIENT)
#define HAS_ZEROCONF
#define HAS_AVAHI
#endif
#ifdef HAVE_DBUS
#define HAS_DBUS
#endif
#define HAS_GL
#ifdef HAVE_X11
#define HAS_X11_WIN_EVENTS
#endif
#ifdef HAVE_SDL
#define HAS_SDL
#ifndef HAVE_X11
#define HAS_SDL_WIN_EVENTS
#endif
#else
#ifndef HAVE_X11
#define HAS_LINUX_EVENTS
#endif
#endif
#define HAS_LINUX_NETWORK
#ifdef HAVE_LIRC
#define HAS_LIRC
#endif
#ifdef HAVE_LIBPULSE
#define HAS_PULSEAUDIO
#endif
#ifdef HAVE_ALSA
#define HAS_ALSA
#endif
#endif
#ifdef HAVE_LIBSSH
#define HAS_FILESYSTEM_SFTP
#endif
#if defined(HAVE_X11)
#define HAS_EGL
#if !defined(HAVE_LIBGLESV2)
#define HAS_GLX
#endif
#endif
/****************************************
* Additional platform specific includes
****************************************/
#if defined(TARGET_WINDOWS)
#include <windows.h>
#define DIRECTINPUT_VERSION 0x0800
#include "mmsystem.h"
#include "DInput.h"
#include "DSound.h"
#define DSSPEAKER_USE_DEFAULT DSSPEAKER_STEREO
#define LPDIRECTSOUND8 LPDIRECTSOUND
#undef GetFreeSpace
#include "PlatformInclude.h"
#ifdef HAS_DX
#include "d3d9.h" // On Win32, we're always using DirectX for something, whether it be the actual rendering
#include "d3d11_1.h"
#include "dxgi.h"
#include "d3dcompiler.h"
#include "directxmath.h"
#else
#include <d3d9types.h>
#endif
#ifdef HAS_SDL
#include "SDL\SDL.h"
#endif
#endif
#if defined(TARGET_POSIX)
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
#include "PlatformInclude.h"
#endif
#if defined(TARGET_ANDROID)
#undef HAS_LINUX_EVENTS
#undef HAS_LIRC
#endif
#ifdef HAVE_LIBEGL
#define HAS_EGL
#endif
// GLES2.0 detected. Dont use GL!
#ifdef HAVE_LIBGLESV2
#undef HAS_GL
#define HAS_GLES 2
#endif
// GLES1.0 detected. Dont use GL!
#ifdef HAVE_LIBGLES
#undef HAS_GL
#define HAS_GLES 1
#endif
#ifdef HAS_DVD_DRIVE
#define HAS_CDDA_RIPPER
#endif
#define SAFE_DELETE(p) do { delete (p); (p)=NULL; } while (0)
#define SAFE_DELETE_ARRAY(p) do { delete[] (p); (p)=NULL; } while (0)
#define SAFE_RELEASE(p) do { if(p) { (p)->Release(); (p)=NULL; } } while (0)
// Useful pixel colour manipulation macros
#define GET_A(color) ((color >> 24) & 0xFF)
#define GET_R(color) ((color >> 16) & 0xFF)
#define GET_G(color) ((color >> 8) & 0xFF)
#define GET_B(color) ((color >> 0) & 0xFF)
|
/*
* Driver for the NXP SAA7164 PCIe bridge
*
* Copyright (c) 2010 Steven Toth <stoth@kernellabs.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/io.h>
#include "saa7164.h"
static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
{
struct saa7164_i2c *bus = i2c_adap->algo_data;
struct saa7164_dev *dev = bus->dev;
int i, retval = 0;
dprintk(DBGLVL_I2C, "%s(num = %d)\n", __func__, num);
for (i = 0 ; i < num; i++) {
dprintk(DBGLVL_I2C, "%s(num = %d) addr = 0x%02x len = 0x%x\n",
__func__, num, msgs[i].addr, msgs[i].len);
if (msgs[i].flags & I2C_M_RD) {
/* Unsupported - Yet*/
printk(KERN_ERR "%s() Unsupported - Yet\n", __func__);
continue;
} else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) &&
msgs[i].addr == msgs[i + 1].addr) {
/* write then read from same address */
retval = saa7164_api_i2c_read(bus, msgs[i].addr,
msgs[i].len, msgs[i].buf,
msgs[i+1].len, msgs[i+1].buf
);
i++;
if (retval < 0)
goto err;
} else {
/* write */
retval = saa7164_api_i2c_write(bus, msgs[i].addr,
msgs[i].len, msgs[i].buf);
}
if (retval < 0)
goto err;
}
return num;
err:
return retval;
}
void saa7164_call_i2c_clients(struct saa7164_i2c *bus, unsigned int cmd,
void *arg)
{
if (bus->i2c_rc != 0)
return;
i2c_clients_command(&bus->i2c_adap, cmd, arg);
}
static u32 saa7164_functionality(struct i2c_adapter *adap)
{
return I2C_FUNC_I2C;
}
static struct i2c_algorithm saa7164_i2c_algo_template = {
.master_xfer = i2c_xfer,
.functionality = saa7164_functionality,
};
/* ----------------------------------------------------------------------- */
static struct i2c_adapter saa7164_i2c_adap_template = {
.name = "saa7164",
.owner = THIS_MODULE,
.algo = &saa7164_i2c_algo_template,
};
static struct i2c_client saa7164_i2c_client_template = {
.name = "saa7164 internal",
};
int saa7164_i2c_register(struct saa7164_i2c *bus)
{
struct saa7164_dev *dev = bus->dev;
dprintk(DBGLVL_I2C, "%s(bus = %d)\n", __func__, bus->nr);
memcpy(&bus->i2c_adap, &saa7164_i2c_adap_template,
sizeof(bus->i2c_adap));
memcpy(&bus->i2c_algo, &saa7164_i2c_algo_template,
sizeof(bus->i2c_algo));
memcpy(&bus->i2c_client, &saa7164_i2c_client_template,
sizeof(bus->i2c_client));
bus->i2c_adap.dev.parent = &dev->pci->dev;
strlcpy(bus->i2c_adap.name, bus->dev->name,
sizeof(bus->i2c_adap.name));
bus->i2c_algo.data = bus;
bus->i2c_adap.algo_data = bus;
i2c_set_adapdata(&bus->i2c_adap, bus);
i2c_add_adapter(&bus->i2c_adap);
bus->i2c_client.adapter = &bus->i2c_adap;
if (0 != bus->i2c_rc)
printk(KERN_ERR "%s: i2c bus %d register FAILED\n",
dev->name, bus->nr);
return bus->i2c_rc;
}
int saa7164_i2c_unregister(struct saa7164_i2c *bus)
{
i2c_del_adapter(&bus->i2c_adap);
return 0;
}
|
/* vim: set ts=8 sw=8 sts=8 noet tw=78:
*
* tup - A file-based build system
*
* Copyright (C) 2011-2017 Mike Shal <marfey@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef tup_fuse_fs_h
#define tup_fuse_fs_h
#define FUSE_USE_VERSION 26
#include <fuse.h>
#include "tup/tupid.h"
#define TUP_TMP ".tup/tmp"
#define TUP_JOB "@tupjob-"
struct file_info;
int tup_fuse_add_group(int id, struct file_info *finfo);
int tup_fuse_rm_group(struct file_info *finfo);
void tup_fuse_set_parser_mode(int mode);
int tup_fuse_server_get_dir_entries(const char *path, void *buf,
fuse_fill_dir_t filler);
void tup_fuse_fs_init(void);
int tup_fs_inited(void);
extern struct fuse_operations tup_fs_oper;
#endif
|
/* This file is part of the KDE project
* Copyright (C) 2010 Matus Talcik <matus.talcik@gmail.com>
*
* 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.
*/
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef KIS_UNDO_MODEL_H
#define KIS_UNDO_MODEL_H
#include <QAbstractItemModel>
#include <kundo2qstack.h>
#include <QItemSelectionModel>
#include <QIcon>
#include <kundo2command.h>
#include "kis_types.h"
#include "kis_canvas2.h"
#include "kis_view2.h"
#include "kis_image.h"
#include "kis_paint_device.h"
class KisUndoModel : public QAbstractItemModel
{
Q_OBJECT
public:
KisUndoModel(QObject *parent = 0);
KUndo2QStack *stack() const;
virtual QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex parent(const QModelIndex &child) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QModelIndex selectedIndex() const;
QItemSelectionModel *selectionModel() const;
QString emptyLabel() const;
void setEmptyLabel(const QString &label);
void setCleanIcon(const QIcon &icon);
QIcon cleanIcon() const;
void setCanvas(KisCanvas2* canvas);
public slots:
void setStack(KUndo2QStack *stack);
void addImage(int idx);
private slots:
void stackChanged();
void stackDestroyed(QObject *obj);
void setStackCurrentIndex(const QModelIndex &index);
private:
bool m_blockOutgoingHistoryChange;
KUndo2QStack *m_stack;
QItemSelectionModel *m_sel_model;
QString m_empty_label;
QIcon m_clean_icon;
KisCanvas2* m_canvas;
QMap<const KUndo2Command*, QImage> imageMap;
};
#endif
|
/* Company : Nequeo Pty Ltd, http://www.nequeo.com.au/
* Copyright : Copyright © Nequeo Pty Ltd 2014 http://www.nequeo.com.au/
*
* File : TextIterator.h
* Purpose : TextIterator header.
*
*/
/*
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#ifndef _TEXTITERATOR_H
#define _TEXTITERATOR_H
#include "GlobalText.h"
namespace Nequeo{
namespace IO{
namespace Text
{
class TextEncoding;
class TextIterator
/// An unidirectional iterator for iterating over characters in a string.
/// The TextIterator uses a TextEncoding object to
/// work with multi-byte character encodings like UTF-8.
/// Characters are reported in Unicode.
///
/// Example: Count the number of UTF-8 characters in a string.
///
/// UTF8Encoding utf8Encoding;
/// std::string utf8String("....");
/// TextIterator it(utf8String, utf8Encoding);
/// TextIterator end(utf8String);
/// int n = 0;
/// while (it != end) { ++n; ++it; }
///
/// NOTE: When an UTF-16 encoding is used, surrogate pairs will be
/// reported as two separate characters, due to restrictions of
/// the TextEncoding class.
///
/// For iterating over char buffers, see the TextBufferIterator class.
{
public:
TextIterator();
/// Creates an uninitialized TextIterator.
TextIterator(const std::string& str, const TextEncoding& encoding);
/// Creates a TextIterator for the given string.
/// The encoding object must not be deleted as long as the iterator
/// is in use.
TextIterator(const std::string::const_iterator& begin, const std::string::const_iterator& end, const TextEncoding& encoding);
/// Creates a TextIterator for the given range.
/// The encoding object must not be deleted as long as the iterator
/// is in use.
TextIterator(const std::string& str);
/// Creates an end TextIterator for the given string.
TextIterator(const std::string::const_iterator& end);
/// Creates an end TextIterator.
~TextIterator();
/// Destroys the TextIterator.
TextIterator(const TextIterator& it);
/// Copy constructor.
TextIterator& operator = (const TextIterator& it);
/// Assignment operator.
void swap(TextIterator& it);
/// Swaps the iterator with another one.
int operator * () const;
/// Returns the Unicode value of the current character.
/// If there is no valid character at the current position,
/// -1 is returned.
TextIterator& operator ++ ();
/// Prefix increment operator.
TextIterator operator ++ (int);
/// Postfix increment operator.
bool operator == (const TextIterator& it) const;
/// Compares two iterators for equality.
bool operator != (const TextIterator& it) const;
/// Compares two iterators for inequality.
TextIterator end() const;
/// Returns the end iterator for the range handled
/// by the iterator.
private:
const TextEncoding* _pEncoding;
std::string::const_iterator _it;
std::string::const_iterator _end;
};
//
// inlines
//
inline bool TextIterator::operator == (const TextIterator& it) const
{
return _it == it._it;
}
inline bool TextIterator::operator != (const TextIterator& it) const
{
return _it != it._it;
}
inline void swap(TextIterator& it1, TextIterator& it2)
{
it1.swap(it2);
}
inline TextIterator TextIterator::end() const
{
return TextIterator(_end);
}
}
}
}
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_FPOINT_H
#define TITANIC_FPOINT_H
namespace Titanic {
/**
* Floating point Point class
*/
class FPoint {
public:
double _x, _y;
public:
FPoint() : _x(0), _y(0) {}
FPoint(double x, double y) : _x(x), _y(y) {}
bool operator==(const FPoint &p) const { return _x == p._x && _y == p._y; }
bool operator!=(const FPoint &p) const { return _x != p._x || _y != p._y; }
void operator+=(const FPoint &delta) {
_x += delta._x;
_y += delta._y;
}
void operator-=(const FPoint &delta) {
_x -= delta._x;
_y -= delta._y;
}
/**
* Normalises the X and Y coordinates as fractions relative to the
* value of the hypotenuse formed by a triangle from the origin (0,0)
*/
void normalize();
};
} // End of namespace Titanic
#endif /* TITANIC_FPOINT_H */
|
/*
Copyright (c) 2007-2011 Gordon Gremme <gremme@zbh.uni-hamburg.de>
Copyright (c) 2007-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef INTER_FEATURE_STREAM_API_H
#define INTER_FEATURE_STREAM_API_H
#include <stdio.h>
#include "extended/node_stream_api.h"
/* Implements the <GtNodeStream> interface. A <GtInterFeatureStream> inserts new
feature nodes between existing feature nodes of a certain type. */
typedef struct GtInterFeatureStream GtInterFeatureStream;
/* Create a <GtInterFeatureStream*> which inserts feature nodes of type
<inter_type> between the feature nodes of type <outside_type> it retrieves
from <in_stream> and returns them. */
GtNodeStream* gt_inter_feature_stream_new(GtNodeStream *in_stream,
const char *outside_type,
const char *inter_type);
#endif
|
/*
* Mach Operating System
* Copyright (c) 1993-1989 Carnegie Mellon University.
* Copyright (c) 1994 The University of Utah and
* the Computer Systems Laboratory (CSL).
* All rights reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF
* THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
* OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
* THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
#include <mach.h>
#include <device/device.h>
#include <varargs.h>
extern mach_port_t __libmach_console_port;
safe_gets(str, maxlen)
char *str;
int maxlen;
{
register char *lp;
register int c;
char inbuf[IO_INBAND_MAX];
mach_msg_type_number_t count;
register char *ip;
char *strmax = str + maxlen - 1; /* allow space for trailing 0 */
lp = str;
for (;;) {
count = IO_INBAND_MAX;
(void) device_read_inband(__libmach_console_port,
(dev_mode_t)0, (recnum_t)0,
sizeof(inbuf), inbuf, &count);
for (ip = inbuf; ip < &inbuf[count]; ip++) {
c = *ip;
switch (c) {
case '\n':
case '\r':
printf("\n");
*lp++ = 0;
return;
case '\b':
case '#':
case '\177':
if (lp > str) {
printf("\b \b");
lp--;
}
continue;
case '@':
case 'u'&037:
lp = str;
printf("\n\r");
continue;
default:
if (c >= ' ' && c < '\177') {
if (lp < strmax) {
*lp++ = c;
printf("%c", c);
}
else {
printf("%c", '\007'); /* beep */
}
}
}
}
}
}
|
/* libdiskfs implementation of fs.defs: dir_link
Copyright (C) 1992,93,94,95,96,97,99 Free Software Foundation, Inc.
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, 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. */
#include "priv.h"
#include "fs_S.h"
/* Implement dir_link as described in <hurd/fs.defs>. */
kern_return_t
diskfs_S_dir_link (struct protid *dircred,
struct protid *filecred,
char *name,
int excl)
{
struct node *np; /* node being linked */
struct node *tnp; /* node being deleted implicitly */
struct node *dnp; /* directory of new entry */
struct dirstat *ds = alloca (diskfs_dirstat_size);
error_t error;
if (!dircred)
return EOPNOTSUPP;
if (diskfs_check_readonly ())
return EROFS;
if (!filecred)
return EXDEV;
np = filecred->po->np;
mutex_lock (&np->lock);
if (S_ISDIR (np->dn_stat.st_mode))
{
mutex_unlock (&np->lock);
return EISDIR;
}
mutex_unlock (&np->lock);
dnp = dircred->po->np;
mutex_lock (&dnp->lock);
/* Lookup new location */
error = diskfs_lookup (dnp, name, RENAME, &tnp, ds, dircred);
if (!error && excl)
{
error = EEXIST;
diskfs_nput (tnp);
}
if (error && error != ENOENT)
{
if (error == EAGAIN)
error = EINVAL;
diskfs_drop_dirstat (dnp, ds);
mutex_unlock (&dnp->lock);
return error;
}
if (np == tnp)
{
diskfs_drop_dirstat (dnp, ds);
mutex_unlock (&dnp->lock);
mutex_unlock (&tnp->lock);
mach_port_deallocate (mach_task_self (), filecred->pi.port_right);
return 0;
}
if (tnp && S_ISDIR (tnp->dn_stat.st_mode))
{
diskfs_drop_dirstat (dnp, ds);
mutex_unlock (&dnp->lock);
mutex_unlock (&tnp->lock);
return EISDIR;
}
/* Create new entry for NP */
/* This is safe because NP is not a directory (thus not DNP) and
not TNP and is a leaf. */
mutex_lock (&np->lock);
/* Increment link count */
if (np->dn_stat.st_nlink == diskfs_link_max - 1)
{
diskfs_drop_dirstat (dnp, ds);
mutex_unlock (&np->lock);
mutex_unlock (&dnp->lock);
return EMLINK;
}
np->dn_stat.st_nlink++;
np->dn_set_ctime = 1;
diskfs_node_update (np, 1);
/* Attach it */
if (tnp)
{
assert (!excl);
error = diskfs_dirrewrite (dnp, tnp, np, name, ds);
if (!error)
{
/* Deallocate link on TNP */
tnp->dn_stat.st_nlink--;
tnp->dn_set_ctime = 1;
if (diskfs_synchronous)
diskfs_node_update (tnp, 1);
}
diskfs_nput (tnp);
}
else
error = diskfs_direnter (dnp, name, np, ds, dircred);
if (diskfs_synchronous)
diskfs_node_update (dnp, 1);
mutex_unlock (&dnp->lock);
mutex_unlock (&np->lock);
if (!error)
/* MiG won't do this for us, which it ought to. */
mach_port_deallocate (mach_task_self (), filecred->pi.port_right);
return error;
}
|
/* Extended Module Player
* Copyright (C) 1996-2006 Claudio Matsuoka and Hipolito Carraro Jr
*
* $Id: liq.h,v 1.2 2006/02/12 16:58:48 cmatsuoka Exp $
*
* This file is part of the Extended Module Player and is distributed
* under the terms of the GNU General Public License. See doc/COPYING
* for more information.
*/
struct liq_header {
uint8 magic[14]; /* "Liquid Module:" */
uint8 name[30]; /* ASCIIZ module name */
uint8 author[20]; /* Author name */
uint8 _0x1a; /* 0x1a */
uint8 tracker[20]; /* Tracker name */
uint16 version; /* Format version */
uint16 speed; /* Initial speed */
uint16 bpm; /* Initial bpm */
uint16 low; /* Lowest note (Amiga Period*4) */
uint16 high; /* Uppest note (Amiga Period*4) */
uint16 chn; /* Number of channels */
uint32 flags; /* Module flags */
uint16 pat; /* Number of patterns saved */
uint16 ins; /* Number of instruments */
uint16 len; /* Module length */
uint16 hdrsz; /* Header size */
};
struct liq_instrument {
#if 0
uint8 magic[4]; /* 'L', 'D', 'S', 'S' */
#endif
uint16 version; /* LDSS header version */
uint8 name[30]; /* Instrument name */
uint8 editor[20]; /* Generator name */
uint8 author[20]; /* Author name */
uint8 hw_id; /* Hardware used to record the sample */
uint32 length; /* Sample length */
uint32 loopstart; /* Sample loop start */
uint32 loopend; /* Sample loop end */
uint32 c2spd; /* C2SPD */
uint8 vol; /* Volume */
uint8 flags; /* Flags */
uint8 pan; /* Pan */
uint8 midi_ins; /* General MIDI instrument */
uint8 gvl; /* Global volume */
uint8 chord; /* Chord type */
uint16 hdrsz; /* LDSS header size */
uint16 comp; /* Compression algorithm */
uint32 crc; /* CRC */
uint8 midi_ch; /* MIDI channel */
uint8 rsvd[11]; /* Reserved */
uint8 filename[25]; /* DOS file name */
};
struct liq_pattern {
#if 0
uint8 magic[4]; /* 'L', 'P', 0, 0 */
#endif
uint8 name[30]; /* ASCIIZ pattern name */
uint16 rows; /* Number of rows */
uint32 size; /* Size of packed pattern */
uint32 reserved; /* Reserved */
};
|
#ifndef NODECACHE_H_
#define NODECACHE_H_
#include <vector>
#include <string>
#include "node.h"
/*!
Caches string values per node based on the node.index().
The node index guaranteed to be unique per node tree since the index is reset
every time a new tree is generated.
*/
class NodeCache
{
public:
NodeCache() { }
virtual ~NodeCache() { }
bool contains(const AbstractNode &node) const {
return !(*this)[node].empty();
}
/*! Returns a reference to the cached string copy. NB! don't rely on
* this reference to be valid for long - if the cache is resized
* internally, existing values are lost. */
const std::string & operator[](const AbstractNode &node) const {
if (this->cache.size() > node.index()) return this->cache[node.index()];
else return this->nullvalue;
}
/*! Returns a reference to the cached string copy. NB! don't rely on
* this reference to be valid for long - if the cache is resized
* internally, existing values are lost. */
const std::string &insert(const class AbstractNode &node, const std::string & value) {
if (this->cache.size() <= node.index()) this->cache.resize(node.index() + 1);
return this->cache[node.index()] = value;
}
void remove(const class AbstractNode &node) {
if (this->cache.size() > node.index()) this->cache[node.index()] = std::string();
}
void clear() {
this->cache.clear();
}
private:
std::vector<std::string> cache;
std::string nullvalue;
};
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2013 Google Inc.
* Copyright (C) 2015 Intel Corp.
*
* 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; version 2 of the License.
*
* 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.
*/
#include <cpu/x86/msr.h>
#include <cpu/x86/tsc.h>
#include <rules.h>
#include <soc/msr.h>
#include <console/console.h>
#if ENV_RAMSTAGE
#include <soc/ramstage.h>
#else
#include <soc/romstage.h>
#endif
#include <stdint.h>
static const unsigned int cpu_bus_clk_freq_table[] = {
83333,
100000,
133333,
116666,
80000,
93333,
90000,
88900,
87500
};
unsigned int cpu_bus_freq_khz(void)
{
msr_t clk_info = rdmsr(MSR_BSEL_CR_OVERCLOCK_CONTROL);
if((clk_info.lo & 0xF) < (sizeof(cpu_bus_clk_freq_table)/sizeof(unsigned int)))
{
return(cpu_bus_clk_freq_table[clk_info.lo & 0xF]);
}
return 0;
}
unsigned long tsc_freq_mhz(void)
{
msr_t platform_info;
unsigned int bclk_khz = cpu_bus_freq_khz();
if (!bclk_khz)
return 0;
platform_info = rdmsr(MSR_PLATFORM_INFO);
return (bclk_khz * ((platform_info.lo >> 8) & 0xff)) / 1000;
}
#if !ENV_SMM
void set_max_freq(void)
{
msr_t perf_ctl;
msr_t msr;
/* Enable speed step. */
msr = rdmsr(MSR_IA32_MISC_ENABLES);
msr.lo |= (1 << 16);
wrmsr(MSR_IA32_MISC_ENABLES, msr);
/* Enable Burst Mode */
msr = rdmsr(MSR_IA32_MISC_ENABLES);
msr.hi = 0;
wrmsr(MSR_IA32_MISC_ENABLES, msr);
/*
* Set guranteed ratio [21:16] from IACORE_RATIOS to bits [15:8] of
* the PERF_CTL.
*/
msr = rdmsr(MSR_IACORE_TURBO_RATIOS);
perf_ctl.lo = (msr.lo & 0x3f0000) >> 8;
/*
* Set guranteed vid [21:16] from IACORE_VIDS to bits [7:0] of
* the PERF_CTL.
*/
msr = rdmsr(MSR_IACORE_TURBO_VIDS);
perf_ctl.lo |= (msr.lo & 0x7f0000) >> 16;
perf_ctl.hi = 0;
wrmsr(MSR_IA32_PERF_CTL, perf_ctl);
}
#endif /* ENV_SMM */
|
/**
* $Id$
*
* Copyright (C) 2012 Daniel-Constantin Mierla (asipto.com)
*
* This file is part of Kamailio, a free SIP server.
*
* This file 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 file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "../../dprint.h"
#include "../../globals.h"
#include "../../ut.h"
#include "../../dset.h"
#include "msrp_parser.h"
#include "msrp_netio.h"
#include "msrp_env.h"
extern int msrp_param_sipmsg;
static msrp_env_t _msrp_env = {0};
/**
*
*/
msrp_env_t *msrp_get_env(void)
{
return &_msrp_env;
}
/**
*
*/
void msrp_reset_env(void)
{
memset(&_msrp_env, 0, sizeof(struct msrp_env));
}
/**
*
*/
msrp_frame_t *msrp_get_current_frame(void)
{
return _msrp_env.msrp;
}
/**
*
*/
int msrp_set_current_frame(msrp_frame_t *mf)
{
_msrp_env.msrp = mf;
init_dst_from_rcv(&_msrp_env.srcinfo, mf->tcpinfo->rcv);
_msrp_env.envflags |= MSRP_ENV_SRCINFO;
return 0;
}
/**
*
*/
int msrp_env_set_dstinfo(msrp_frame_t *mf, str *addr, str *fsock, int flags)
{
struct socket_info *si = NULL;
snd_flags_t sflags = {0};
if(fsock!=NULL && fsock->len>0)
{
si = msrp_get_local_socket(fsock);
if(si==NULL)
{
LM_DBG("local socket not found [%.*s] - trying to continue\n",
fsock->len, fsock->s);
}
}
sflags.f = flags;
if(si==NULL)
{
sflags.f &= ~SND_F_FORCE_SOCKET;
} else {
sflags.f |= SND_F_FORCE_SOCKET;
}
sflags.f |= _msrp_env.sndflags;
memset(&_msrp_env.dstinfo, 0, sizeof(struct dest_info));
if(msrp_uri_to_dstinfo(NULL, &_msrp_env.dstinfo, si, sflags, addr)==NULL)
{
LM_ERR("failed to set destination address [%.*s]\n",
addr->len, addr->s);
return -1;
}
_msrp_env.envflags |= MSRP_ENV_DSTINFO;
return 0;
}
/**
*
*/
int msrp_env_set_sndflags(msrp_frame_t *mf, int flags)
{
_msrp_env.sndflags |= (flags & (~SND_F_FORCE_SOCKET));
if(_msrp_env.envflags & MSRP_ENV_DSTINFO)
{
_msrp_env.dstinfo.send_flags.f |= _msrp_env.sndflags;
}
return 0;
}
/**
*
*/
int msrp_env_set_rplflags(msrp_frame_t *mf, int flags)
{
_msrp_env.rplflags |= (flags & (~SND_F_FORCE_SOCKET));
if(_msrp_env.envflags & MSRP_ENV_SRCINFO)
{
_msrp_env.srcinfo.send_flags.f |= _msrp_env.rplflags;
}
return 0;
}
/**
*
*/
#define MSRP_FAKED_SIPMSG_START "MSRP sip:a@127.0.0.1 SIP/2.0\r\nVia: SIP/2.0/UDP 127.0.0.1:9;branch=z9hG4bKa\r\nFrom: <b@127.0.0.1>;tag=a\r\nTo: <a@127.0.0.1>\r\nCall-ID: a\r\nCSeq: 1 MSRP\r\nContent-Length: 0\r\nMSRP-First-Line: "
#define MSRP_FAKED_SIPMSG_EXTRA 11240
#define MSRP_FAKED_SIPMSG_SIZE (sizeof(MSRP_FAKED_SIPMSG_START)+MSRP_FAKED_SIPMSG_EXTRA)
static char _msrp_faked_sipmsg_buf[MSRP_FAKED_SIPMSG_SIZE];
static sip_msg_t _msrp_faked_sipmsg;
static unsigned int _msrp_faked_sipmsg_no = 0;
sip_msg_t *msrp_fake_sipmsg(msrp_frame_t *mf)
{
int len;
if(msrp_param_sipmsg==0)
return NULL;
if(mf->buf.len >= MSRP_FAKED_SIPMSG_EXTRA-1)
return NULL;
len = sizeof(MSRP_FAKED_SIPMSG_START)-1;
memcpy(_msrp_faked_sipmsg_buf, MSRP_FAKED_SIPMSG_START, len);
memcpy(_msrp_faked_sipmsg_buf + len, mf->buf.s,
mf->fline.buf.len + mf->hbody.len);
len += mf->fline.buf.len + mf->hbody.len;
memcpy(_msrp_faked_sipmsg_buf + len, "\r\n", 2);
len += 2;
_msrp_faked_sipmsg_buf[len] = '\0';
memset(&_msrp_faked_sipmsg, 0, sizeof(sip_msg_t));
_msrp_faked_sipmsg.buf=_msrp_faked_sipmsg_buf;
_msrp_faked_sipmsg.len=len;
_msrp_faked_sipmsg.set_global_address=default_global_address;
_msrp_faked_sipmsg.set_global_port=default_global_port;
if (parse_msg(_msrp_faked_sipmsg.buf, _msrp_faked_sipmsg.len,
&_msrp_faked_sipmsg)!=0)
{
LM_ERR("parse_msg failed\n");
return NULL;
}
_msrp_faked_sipmsg.id = 1 + _msrp_faked_sipmsg_no++;
_msrp_faked_sipmsg.pid = my_pid();
clear_branches();
return &_msrp_faked_sipmsg;
}
|
/*
* pxa2xx_udc_gpio.c: Generic driver for GPIO-controlled PXA2xx UDC.
*
* */
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dpm.h>
#include <asm/arch/udc.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
static struct pxa2xx_udc_gpio_info *pdata;
static void pda_udc_command(int cmd)
{
switch (cmd) {
case PXA2XX_UDC_CMD_DISCONNECT:
DPM_DEBUG("pda_udc: Turning off port\n");
dpm_power(&pdata->power_ctrl, 0);
break;
case PXA2XX_UDC_CMD_CONNECT:
DPM_DEBUG("pda_udc: Turning on port\n");
dpm_power(&pdata->power_ctrl, 1);
break;
default:
printk("pda_udc: unknown command!\n");
break;
}
}
static int pda_udc_is_connected(void)
{
int status = !!gpiodev_get_value(&pdata->detect_gpio) ^ pdata->detect_gpio_negative;
return status;
}
static struct pxa2xx_udc_mach_info pda_udc_info __initdata = {
.udc_is_connected = pda_udc_is_connected,
.udc_command = pda_udc_command,
};
static int pda_udc_probe(struct platform_device * pdev)
{
printk("pxa2xx-udc-gpio: Generic driver for GPIO-controlled PXA2xx UDC\n");
pdata = pdev->dev.platform_data;
pxa_set_udc_info(&pda_udc_info);
return 0;
}
static struct platform_driver pda_udc_driver = {
.driver = {
.name = "pxa2xx-udc-gpio",
},
.probe = pda_udc_probe,
};
static int __init pda_udc_init(void)
{
return platform_driver_register(&pda_udc_driver);
}
#ifdef MODULE
module_init(pda_udc_init);
#else /* start early for dependencies */
fs_initcall(pda_udc_init);
#endif
MODULE_AUTHOR("Paul Sokolovsky <pmiscml@gmail.com>");
MODULE_DESCRIPTION("Generic driver for GPIO-controlled PXA2xx UDC");
MODULE_LICENSE("GPL");
|
// Replacement for sys/mman.h which factors out platform differences.
#include <sys/mman.h>
#if defined(VGO_darwin) || defined(VGO_freebsd)
# define MAP_ANONYMOUS MAP_ANON
#endif
#include <assert.h>
#include <unistd.h>
// Map a page, then unmap it, then return that address. That
// guarantees to give an address which will fault when accessed,
// without making any assumptions about the layout of the address
// space.
__attribute__((unused))
static void* get_unmapped_page(void)
{
void* ptr;
int r;
long pagesz = sysconf(_SC_PAGE_SIZE);
assert(pagesz == 4096 || pagesz == 16384 || pagesz == 65536);
ptr = mmap(0, pagesz, PROT_READ, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
assert(ptr != (void*)-1);
r = munmap(ptr, pagesz);
assert(r == 0);
return ptr;
}
|
//
// LQAnalyzeForYearUseItemModel.h
// 朝阳能源结算
//
// Created by admin on 15/9/4.
// Copyright (c) 2015年 dieshang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LQAnalyzeForYearUseItemModel : NSObject
@property (nonatomic, copy ) NSString *accountId;
@property (nonatomic, copy ) NSString *recvalues;
@property (nonatomic, assign) int recyear;
@property (nonatomic, assign) int recmonth;
@end
|
/* Copyright 2013 David Axmark
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 _SYMBIAN9_INJECTOR_H_
#define _SYMBIAN9_INJECTOR_H_
#include "Injector.h"
namespace MoSync {
class Symbian9Injector : public Injector {
public:
void inject(const Icon* icon, const std::map<std::string, std::string>& params);
};
}
#endif // _SYMBIAN9_INJECTOR_H_
|
#ifndef KVM__VESA_H
#define KVM__VESA_H
#define VESA_WIDTH 640
#define VESA_HEIGHT 480
#define VESA_MEM_ADDR 0xd0000000
#define VESA_BPP 32
/*
* We actually only need VESA_BPP/8*VESA_WIDTH*VESA_HEIGHT bytes. But the memory
* size must be a power of 2, so we round up.
*/
#define VESA_MEM_SIZE (1 << 21)
struct kvm;
struct biosregs;
struct framebuffer *vesa__init(struct kvm *self);
#endif
|
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_PER_FACE_NORMALS_H
#define IGL_PER_FACE_NORMALS_H
#include "igl_inline.h"
#include <Eigen/Core>
namespace igl
{
// Compute face normals via vertex position list, face list
// Inputs:
// V #V by 3 eigen Matrix of mesh vertex 3D positions
// F #F by 3 eigen Matrix of face (triangle) indices
// Z 3 vector normal given to faces with degenerate normal.
// Output:
// N #F by 3 eigen Matrix of mesh face (triangle) 3D normals
//
// Example:
// // Give degenerate faces (1/3,1/3,1/3)^0.5
// per_face_normals(V,F,Vector3d(1,1,1).normalized(),N);
template <typename DerivedV, typename DerivedF, typename DerivedZ, typename DerivedN>
IGL_INLINE void per_face_normals(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedZ> & Z,
Eigen::PlainObjectBase<DerivedN> & N);
// Wrapper with Z = (0,0,0). Note that this means that row norms will be zero
// (i.e. not 1) for degenerate normals.
template <typename DerivedV, typename DerivedF, typename DerivedN>
IGL_INLINE void per_face_normals(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedN> & N);
}
#ifndef IGL_STATIC_LIBRARY
# include "per_face_normals.cpp"
#endif
#endif
|
/*
* Samsung Exynos5 SoC series FIMC-IS driver
*
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef FIMC_IS_BINARY_H
#define FIMC_IS_BINARY_H
#include "fimc-is-config.h"
#define SDCARD_FW
#define VENDER_PATH
#ifdef VENDER_PATH
#define FIMC_IS_FW_PATH "/system/vendor/firmware/"
#define FIMC_IS_FW_DUMP_PATH "/data/"
#define FIMC_IS_SETFILE_SDCARD_PATH "/data/media/0/"
#define FIMC_IS_FW_SDCARD "/data/media/0/fimc_is_fw2.bin"
#define FIMC_IS_FW "fimc_is_fw2.bin"
#define FIMC_IS_ISP_LIB_SDCARD_PATH "/data/media/0/"
#define FIMC_IS_ISP_LIB "fimc_is_lib_isp.bin"
#define FIMC_IS_REAR_CAL_SDCARD_PATH "/data/media/0/"
#define FIMC_IS_FRONT_CAL_SDCARD_PATH "/data/media/0/"
#define FIMC_IS_REAR_CAL "rear_cal_data.bin"
#define FIMC_IS_FRONT_CAL "front_cal_data.bin"
#else
#define FIMC_IS_FW_PATH "/data/"
#define FIMC_IS_FW_DUMP_PATH "/data/"
#define FIMC_IS_SETFILE_SDCARD_PATH "/data/"
#define FIMC_IS_FW_SDCARD "/data/fimc_is_fw2.bin"
#define FIMC_IS_FW "fimc_is_fw2.bin"
#define FIMC_IS_ISP_LIB_SDCARD_PATH "/data/"
#define FIMC_IS_ISP_LIB "fimc_is_lib_isp.bin"
#define FIMC_IS_REAR_CAL_SDCARD_PATH "/data/"
#define FIMC_IS_FRONT_CAL_SDCARD_PATH "/data/"
#define FIMC_IS_REAR_CAL "rear_cal_data.bin"
#define FIMC_IS_FRONT_CAL "front_cal_data.bin"
#endif
#define FIMC_IS_FW_BASE_MASK ((1 << 26) - 1)
#define FIMC_IS_VERSION_SIZE 42
#define FIMC_IS_SETFILE_VER_OFFSET 0x40
#define FIMC_IS_SETFILE_VER_SIZE 52
#ifdef ENABLE_IS_CORE
#ifdef SUPPORTED_A5_MEMORY_SIZE_UP
#define FIMC_IS_CAL_START_ADDR (0x01FD0000)
#else
#define FIMC_IS_CAL_START_ADDR (0x013D0000)
#endif
#else /* #ifdef ENABLE_IS_CORE */
#define FIMC_IS_CAL_START_ADDR (FIMC_IS_REAR_CALDATA_OFFSET)
#define FIMC_IS_CAL_START_ADDR_FRONT (FIMC_IS_FRONT_CALDATA_OFFSET)
#endif
#define FIMC_IS_CAL_RETRY_CNT (2)
#define FIMC_IS_FW_RETRY_CNT (2)
#define FIMC_IS_MAX_COMPANION_FW_SIZE (120 * 1024)
#if defined(CONFIG_USE_HOST_FD_LIBRARY)
#define FD_SW_BIN_NAME "fimc_is_fd.bin"
#ifdef VENDER_PATH
#define FD_SW_SDCARD_PATH "/data/media/0/"
#else
#define FD_SW_SDCARD_PATH "/data/"
#endif
#endif
enum fimc_is_bin_type {
FIMC_IS_BIN_FW = 0,
FIMC_IS_BIN_SETFILE,
FIMC_IS_BIN_LIBRARY,
};
struct fimc_is_binary {
void *data;
size_t size;
const struct firmware *fw;
unsigned long customized;
/* request_firmware retry */
unsigned int retry_cnt;
int retry_err;
/* custom memory allocation */
void *(*alloc)(unsigned long size);
void (*free)(const void *buf);
};
void setup_binary_loader(struct fimc_is_binary *bin,
unsigned int retry_cnt, int retry_err,
void *(*alloc)(unsigned long size),
void (*free)(const void *buf));
int request_binary(struct fimc_is_binary *bin, const char *path,
const char *name, struct device *device);
void release_binary(struct fimc_is_binary *bin);
int was_loaded_by(struct fimc_is_binary *bin);
#endif
|
/*****************************************************************************\
* $Id: php_genders.h,v 1.4 2010-02-02 00:04:34 chu11 Exp $
*****************************************************************************
* Copyright (C) 2007-2019 Lawrence Livermore National Security, LLC.
* Copyright (C) 2001-2007 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Jim Garlick <garlick@llnl.gov> and Albert Chu <chu11@llnl.gov>.
* UCRL-CODE-2003-004.
*
* This file is part of Genders, a cluster configuration database.
* For details, see <http://www.llnl.gov/linux/genders/>.
*
* Genders 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.
*
* Genders 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 Genders. If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/
#ifndef PHP_GENDERS_H
#define PHP_GENDERS_H
extern zend_module_entry genders_module_entry;
#define phpext_genders_ptr &genders_module_entry
#ifdef PHP_WIN32
#define PHP_GENDERS_API __declspec(dllexport)
#else
#define PHP_GENDERS_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
PHP_MINIT_FUNCTION(genders);
PHP_MSHUTDOWN_FUNCTION(genders);
PHP_RINIT_FUNCTION(genders);
PHP_RSHUTDOWN_FUNCTION(genders);
PHP_MINFO_FUNCTION(genders);
PHP_FUNCTION(genders_getnumattrs);
PHP_FUNCTION(genders_getattr);
PHP_FUNCTION(genders_getattr_all);
PHP_FUNCTION(genders_getnodes);
#ifdef ZTS
#define GENDERS_G(v) TSRMG(genders_globals_id, zend_genders_globals *, v)
#else
#define GENDERS_G(v) (genders_globals.v)
#endif
#endif
|
/*
*@@sourcefile disk.h:
* header file for disk.c (XFldDisk implementation).
*
* This file is ALL new with V0.9.0.
*
*@@include #define INCL_DOSDEVIOCTL
*@@include #include <os2.h>
*@@include #include "shared\notebook.h"
*@@include #include "filesys\disk.h"
*/
/*
* Copyright (C) 1997-2006 Ulrich Mller.
*
* This file is part of the XWorkplace source package.
* XWorkplace 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, in version 2 as it comes in the
* "COPYING" file of the XWorkplace main distribution.
* 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.
*/
#ifndef DISK_HEADER_INCLUDED
#define DISK_HEADER_INCLUDED
/* ******************************************************************
*
* Disk implementation
*
********************************************************************/
#ifdef SOM_WPFolder_h
WPFolder* dskCheckDriveReady(WPDisk *somSelf);
#endif
#ifdef INCL_DOSDEVIOCTL
BOOL APIENTRY dskQueryInfo(PXDISKINFO paDiskInfos,
ULONG ulLogicalDrive);
typedef BOOL APIENTRY DSKQUERYINFO(PXDISKINFO paDiskInfos,
ULONG ulLogicalDrive);
typedef DSKQUERYINFO *PDSKQUERYINFO;
#endif
/* ******************************************************************
*
* Setup strings
*
********************************************************************/
#ifdef SOM_WPFolder_h
BOOL dskSetup(WPDisk *somSelf,
PCSZ pszSetupString); // V1.0.6 (2006-08-22) [pr]: added
#endif
/* ******************************************************************
*
* XFldDisk notebook callbacks (notebook.c)
*
********************************************************************/
#ifdef NOTEBOOK_HEADER_INCLUDED
VOID XWPENTRY dskDetailsInitPage(PNOTEBOOKPAGE pnbp,
ULONG flFlags);
MRESULT XWPENTRY dskDetailsItemChanged(PNOTEBOOKPAGE pnbp,
ULONG ulItemID,
USHORT usNotifyCode,
ULONG ulExtra);
VOID XWPENTRY dskDetailsTimer(PNOTEBOOKPAGE pnbp, ULONG ul);
#endif
#endif
|
/*
* linux/drivers/cpufreq/freq_table.c
*
* Copyright (C) 2002 - 2003 Dominik Brodowski
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpufreq.h>
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg)
/*********************************************************************
* FREQUENCY TABLE HELPERS *
*********************************************************************/
int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table)
{
unsigned int min_freq = ~0;
unsigned int max_freq = 0;
unsigned int i = 0;
for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID) {
dprintk("table entry %u is invalid, skipping\n", i);
continue;
}
dprintk("table entry %u: %u kHz, %u index\n", i, freq, table[i].index);
if (freq < min_freq)
min_freq = freq;
if (freq > max_freq)
max_freq = freq;
}
policy->min = policy->cpuinfo.min_freq = min_freq;
policy->max = policy->cpuinfo.max_freq = max_freq;
if (policy->min == ~0)
return -EINVAL;
else
return 0;
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_cpuinfo);
int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table)
{
unsigned int next_larger = ~0;
unsigned int i = 0;
unsigned int count = 0;
dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu);
if (!cpu_online(policy->cpu))
return -EINVAL;
cpufreq_verify_within_limits(policy,
policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
if ((freq >= policy->min) && (freq <= policy->max))
count++;
else if ((next_larger > freq) && (freq > policy->max))
next_larger = freq;
}
if (!count)
policy->max = next_larger;
cpufreq_verify_within_limits(policy,
policy->cpuinfo.min_freq, policy->cpuinfo.max_freq);
dprintk("verification lead to (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu);
return 0;
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_verify);
int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
unsigned int target_freq,
unsigned int relation,
unsigned int *index)
{
struct cpufreq_frequency_table optimal = { .index = ~0, };
struct cpufreq_frequency_table suboptimal = { .index = ~0, };
unsigned int i;
dprintk("request for target %u kHz (relation: %u) for cpu %u\n", target_freq, relation, policy->cpu);
switch (relation) {
case CPUFREQ_RELATION_H:
optimal.frequency = 0;
suboptimal.frequency = ~0;
break;
case CPUFREQ_RELATION_L:
optimal.frequency = ~0;
suboptimal.frequency = 0;
break;
}
if (!cpu_online(policy->cpu))
return -EINVAL;
for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID)
continue;
if ((freq < policy->min) || (freq > policy->max))
continue;
switch(relation) {
case CPUFREQ_RELATION_H:
if (freq <= target_freq) {
if (freq >= optimal.frequency) {
optimal.frequency = freq;
optimal.index = i;
}
} else {
if (freq <= suboptimal.frequency) {
suboptimal.frequency = freq;
suboptimal.index = i;
}
}
break;
case CPUFREQ_RELATION_L:
if (freq >= target_freq) {
if (freq <= optimal.frequency) {
optimal.frequency = freq;
optimal.index = i;
}
} else {
if (freq >= suboptimal.frequency) {
suboptimal.frequency = freq;
suboptimal.index = i;
}
}
break;
}
}
if (optimal.index > i) {
if (suboptimal.index > i)
return -EINVAL;
*index = suboptimal.index;
} else
*index = optimal.index;
dprintk("target is %u (%u kHz, %u)\n", *index, table[*index].frequency,
table[*index].index);
return 0;
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target);
static struct cpufreq_frequency_table *show_table[NR_CPUS];
/**
* show_scaling_governor - show the current policy for the specified CPU
*/
static ssize_t show_available_freqs (struct cpufreq_policy *policy, char *buf)
{
unsigned int i = 0;
unsigned int cpu = policy->cpu;
ssize_t count = 0;
struct cpufreq_frequency_table *table;
if (!show_table[cpu])
return -ENODEV;
table = show_table[cpu];
for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
continue;
count += sprintf(&buf[count], "%d ", table[i].frequency);
}
count += sprintf(&buf[count], "\n");
return count;
}
struct freq_attr cpufreq_freq_attr_scaling_available_freqs = {
.attr = { .name = "scaling_available_frequencies", .mode = 0444, .owner=THIS_MODULE },
.show = show_available_freqs,
};
EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs);
/*
* if you use these, you must assure that the frequency table is valid
* all the time between get_attr and put_attr!
*/
void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
unsigned int cpu)
{
dprintk("setting show_table for cpu %u to %p\n", cpu, table);
show_table[cpu] = table;
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr);
void cpufreq_frequency_table_put_attr(unsigned int cpu)
{
dprintk("clearing show_table for cpu %u\n", cpu);
show_table[cpu] = NULL;
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu)
{
return show_table[cpu];
}
EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>");
MODULE_DESCRIPTION ("CPUfreq frequency table helpers");
MODULE_LICENSE ("GPL");
|
/* Copyright (C) 2000-2008 by George Williams */
/*
* 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.
* The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _GRESOURCE_H
#define _GRESOURCE_H
#include "gdraw.h"
enum res_type { rt_int, rt_double, rt_bool/* int */, rt_color, rt_string };
typedef struct gresstruct {
char *resname;
enum res_type type;
void *val;
void *(*cvt)(char *,void *); /* converts a string into a whatever */
int found;
} GResStruct;
extern char *GResourceProgramName, *GResourceFullProgram, *GResourceProgramDir;
extern int local_encoding;
#if HAVE_ICONV_H
# include <iconv.h>
extern char *iconv_local_encoding_name;
#endif
void GResourceSetProg(char *prog);
void GResourceAddResourceFile(char *filename,char *prog);
void GResourceAddResourceString(char *string,char *prog);
void GResourceFind( GResStruct *info, char *prefix);
char *GResourceFindString(char *name);
int GResourceFindBool(char *name, int def);
long GResourceFindInt(char *name, long def);
Color GResourceFindColor(char *name, Color def);
GImage *GResourceFindImage(char *name, GImage *def);
#endif
|
#ifndef GUI_WINDOW_ABOUT_H_
#define GUI_WINDOW_ABOUT_H_
#include <QDialog>
#include "../../common.h"
namespace gui {
namespace window {
class about : public QDialog {
Q_OBJECT
public:
about(QWidget *parent);
};
} // ns window
} // ns gui
#endif //GUI_WINDOW_ABOUT_H_
|
/* ============================================================
*
* This file is a part of digiKam project
* http://www.digikam.org
*
* Date : 2012-10-03
* Description : kipi loader implementation
*
* Copyright (C) 2004-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2012 by Victor Dodon <dodonvictor at gmail dot com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation;
* either version 2, 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.
*
* ============================================================ */
#ifndef KIPIPLUGINLOADER_H
#define KIPIPLUGINLOADER_H
// Qt includes
#include <QObject>
#include <QList>
// LibKIPI includes
#include <libkipi/plugin.h>
class QAction;
class KActionCollection;
using namespace KIPI;
namespace Digikam
{
class SplashScreen;
class KipiPluginLoader : public QObject
{
Q_OBJECT
public:
/** Standard constructor. Pass parent object instance and splashscreen
* instance. This last one can be null.
*/
KipiPluginLoader(QObject* const parent, SplashScreen* const splash);
/** Return a list of all plugin actions accordingly of plugin category.
* See Category enum for details.
*/
QList<QAction*> kipiActionsByCategory(Category cat) const;
/** Return the instance of action collection for all KIPI plugins.
*/
KActionCollection* pluginsActionCollection() const;
/** Return the instance of this singleton plugin loader.
*/
static KipiPluginLoader* instance();
private Q_SLOTS:
/** Called by PluginLoader when plugins list must be re-loaded in application.
*/
void slotKipiPluginPlug();
private:
/** Disabled destructor.
*/
~KipiPluginLoader();
private:
static KipiPluginLoader* m_instance;
class Private;
Private* const d;
};
} // namespace Digikam
#endif // KIPIPLUGINLOADER_H
|
/*-
* Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Kenneth Almquist.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: @(#)input.h 5.1 (Berkeley) 3/7/91
* input.h,v 1.4 1993/08/01 18:58:27 mycroft Exp
*/
/* PEOF (the end of file marker) is defined in syntax.h */
/*
* The input line number. Input.c just defines this variable, and saves
* and restores it when files are pushed and popped. The user of this
* package must set its value.
*/
extern int plinno;
extern int parsenleft; /* number of characters left in input buffer */
extern char *parsenextc; /* next character in input buffer */
#ifdef __STDC__
char *pfgets(char *, int);
int pgetc(void);
int preadbuffer(void);
void pungetc(void);
void ppushback(char *, int);
void setinputfile(char *, int);
void setinputfd(int, int);
void setinputstring(char *, int);
void popfile(void);
void popallfiles(void);
void closescript(void);
#else
char *pfgets();
int pgetc();
int preadbuffer();
void pungetc();
void ppushback();
void setinputfile();
void setinputfd();
void setinputstring();
void popfile();
void popallfiles();
void closescript();
#endif
#define pgetc_macro() (--parsenleft >= 0? *parsenextc++ : preadbuffer())
|
#undef CONFIG_APM_IGNORE_USER_SUSPEND
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.